BlockchainUtils class final

Facade selecting the active BlockchainUtilsApi backend (Dart or Rust).

Properties

api → BlockchainUtilsApi
Currently selected backend.
no setter
backend → Bu?
Native backend instance from the last setRustApi, or null on the pure-Dart backend. Prefer the typed api.* facades over this escape hatch.
no setter
groth16 → BuGroth16Api
Groth16 proof verification (BLS12-381 + BN254, e.g. Sui zkLogin).
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasNativeBackend → bool
Whether a native backend is active (set via setRustApi).
no setter
isSealed → bool
Whether seal was called.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dartApi() → DefaultBlockchainUtilsApi
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
seal() → void
One-way latch: after seal, setApi, setRustApi and setDartApi throw. Call once during app startup, after the backend is selected, to prevent any later code (injected scripts, plugins) from silently swapping the crypto backend — e.g. for an exfiltrating fake whose sign() receives raw secret keys. Tests never seal, so backend switching keeps working there.
setApi(BlockchainUtilsApi api, {bool seal = false}) → void
Sets the active BlockchainUtilsApi implementation directly.
setDartApi({bool seal = false}) → void
Selects the pure-Dart backend; no native library or WASM setup required.
setRustApi({String? libraryPath, String? wasmGlueUrl, String? wasmModuleUrl, bool randomFromBackend = true, bool seal = false}) → void
Selects the Rust backend via Bu.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited