Skip to main content

Module wormhole

Module wormhole 

Source

Structs§

AggregationConfig
Aggregation config loaded from generated-bins/config.json. Must match the CircuitBinsConfig struct in qp-wormhole-aggregator/src/config.rs
BinaryHashes
SHA256 hashes of circuit binary files for integrity verification. Must match the BinaryHashes struct in qp-wormhole-aggregator/src/config.rs
ProofOutputAssignment
Output assignment for a single proof (supports dual outputs)
VerificationResult
Result of checking proof verification events

Enums§

WormholeCommands

Constants§

NATIVE_ASSET_ID
Native asset id
SCALE_DOWN_FACTOR
Scale down factor for quantizing amounts (10^10 to go from 12 to 2 decimal places)
VOLUME_FEE_BPS
Volume fee rate in basis points (10 bps = 0.1%) This must match the on-chain VolumeFeeRateBps configuration

Functions§

compute_output_amount
Compute output amount after fee deduction output = input * (10000 - fee_bps) / 10000
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§

TransferProofKey