Skip to main content

Module dotns

Module dotns 

Source
Expand description

Pure DOTNS encoding and decoding functions.

No I/O. No network calls. WASM-safe.

Provides ENS-style namehashing, ABI encoding, SCALE encoding/decoding, and contenthash → CID conversion for the DOTNS resolver protocol.

Re-exports§

pub use crate::hex_decode;
pub use crate::hex_encode;

Constants§

CONTENTHASH_SELECTOR
Solidity function selector for contenthash(bytes32).

Functions§

base32_encode
RFC 4648 base32 encoding (lowercase, no padding).
contenthash_to_cid
Parse a contenthash value to extract an IPFS CIDv1.
decode_abi_bytes
Decode ABI-encoded bytes return value from Solidity.
decode_contract_result
Decode the SCALE-encoded ContractResult from pallet-revive’s ReviveApi::call.
decode_scale_compact
Decode a SCALE compact-encoded integer, returning (value, bytes_consumed).
decode_unsigned_varint
Decode an unsigned varint (LEB128), returning (value, bytes_consumed).
encode_contenthash_call
ABI-encode contenthash(bytes32 node) call data.
hex_addr
Compile-time hex string to 20-byte address.
hex_nibble
Compile-time hex character to nibble value.
keccak256
Compute keccak256 hash of the given data.
namehash
ENS-style namehash: namehash("mytestapp.dot").
scale_compact_len
SCALE compact encoding for a length prefix.
scale_compact_u64
SCALE compact encoding for a u64 value.
scale_encode_revive_call
SCALE-encode the parameters for ReviveApi::call() runtime API.