Skip to main content

Module wormhole

Module wormhole 

Source

Re-exports§

pub use crate::wormhole_lib::compute_output_amount;
pub use crate::wormhole_lib::NATIVE_ASSET_ID;
pub use crate::wormhole_lib::SCALE_DOWN_FACTOR;
pub use crate::wormhole_lib::VOLUME_FEE_BPS;

Structs§

ProofOutputAssignment
Output assignment for a single proof (supports dual outputs)
VerificationResult
Result of checking proof verification events

Enums§

WormholeCommands

Functions§

compute_random_output_assignments
Compute random output assignments for a set of proofs.
format_balance
Format a balance amount from raw units (12 decimals) to human-readable format
handle_wormhole_command
parse_exit_account
Parse an exit account from either hex or SS58 format
parse_secret_hex
Parse a hex-encoded secret string into a 32-byte array
quantize_funding_amount
Quantize a funding amount from 12 decimal places to 2 decimal places Returns an error if the quantized value doesn’t fit in u32
random_partition
Randomly partition a total amount into n parts. Each part will be at least min_per_part and the sum equals total. Returns amounts aligned to SCALE_DOWN_FACTOR for clean quantization.
read_proof_file
Read and decode a hex-encoded proof file
write_proof_file
Write a proof to a hex-encoded file

Type Aliases§

TransferProofData
Full transfer data including amount - used to compute the leaf_inputs_hash via Poseidon2. This is what the ZK circuit verifies.
TransferProofKey
Key for TransferProof storage - uniquely identifies a transfer. Uses (to, transfer_count) since transfer_count is atomic per recipient. This is hashed with Blake2_256 to form the storage key suffix.