shared validation logic for Tana smart contracts with WebAssembly support.
tana-validation provides error formatting and validation utilities that work across both Rust and TypeScript environments. by writing core logic once in Rust and compiling to WebAssembly, the library ensures consistent behavior everywhere.
the library exports a single error formatting function that produces Rust/Gleam-style error messages with precise source locations. whether validation runs in the native Rust runtime or the browser-based playground, users see identical, helpful error output.
Validation Error
Invalid Import
contract.ts:1:26
1 import { console } from 'tana/invalid';
^^^^^^^^^^^^ module 'tana/invalid' not found
help: available modules: tana/core, tana/kv
the same Rust code compiles to:
this eliminates the possibility of validation behavior diverging between development and production environments.
written in Rust with wasm-pack for WebAssembly compilation. the library has zero dependencies beyond the standard library, keeping bundle size minimal (~21KB WASM).
TypeScript type definitions are generated automatically during the WASM build process, providing full type safety for JavaScript consumers.
tana-validation is used by:
all validation errors look the same regardless of where they originate, providing a consistent developer experience.
shared validation logic for Tana smart contracts with WebAssembly support.
tana-validation provides error formatting and validation utilities that work across both Rust and TypeScript environments. by writing core logic once in Rust and compiling to WebAssembly, the library ensures consistent behavior everywhere.
the library exports a single error formatting function that produces Rust/Gleam-style error messages with precise source locations. whether validation runs in the native Rust runtime or the browser-based playground, users see identical, helpful error output.
Validation Error
Invalid Import
contract.ts:1:26
1 import { console } from 'tana/invalid';
^^^^^^^^^^^^ module 'tana/invalid' not found
help: available modules: tana/core, tana/kv
the same Rust code compiles to:
this eliminates the possibility of validation behavior diverging between development and production environments.
written in Rust with wasm-pack for WebAssembly compilation. the library has zero dependencies beyond the standard library, keeping bundle size minimal (~21KB WASM).
TypeScript type definitions are generated automatically during the WASM build process, providing full type safety for JavaScript consumers.
tana-validation is used by:
all validation errors look the same regardless of where they originate, providing a consistent developer experience.