docs.rs failed to build keetanetwork-client-wasm-0.2.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
WebAssembly bindings for the keetanetwork-client crate.
Build the package with wasm-pack build --target web, then drive it from
the browser.
Conventions
- Amounts are decimal strings (
"1000"), never JSnumber. - Cryptographic bytes (
sign/verify/encrypt/decrypt) areUint8Array; hashes and keys are hex strings. - Errors are JS
Errorobjects carrying a stableerror.codefor programmatic handling (e.g.INVALID_PERMISSION_FLAG).
Example
import init from './pkg/keetanetwork_client_wasm.js';
// Instantiate the wasm module once.
await ;
// Named network (resolves representatives + id), or `new KeetaClient(url)`
// plus `.withNetwork(id)` for a custom endpoint.
const client = ;
// Derive an account (algorithm defaults to ecdsa_secp256k1).
const me = ;
const token = ;
const to = ;
// High-level signed write: send(to, amount, token).
const user = ;
await user.;
// Or assemble a multi-operation block and transmit it as one round.
const builder = user.;
builder.;
await user.;
// Sign / verify arbitrary bytes.
const message = .;
const signature = me.;
const ok = me.; // true
try catch