MPP.Methods.XRPL.Codec (mpp v0.17.0)

Copy Markdown View Source

Bounded XRPL Payment, PaymentChannelCreate and PaymentChannelClaim codec.

Field ordinals and encodings follow https://xrpl.org/docs/references/protocol/binary-format and XRPLF/xrpl.js packages/ripple-binary-codec/src/enums/definitions.json. Unknown fields, duplicate fields, noncanonical order and truncated objects fail closed. The decoder does not sign transactions; encode_claim/1 serializes a PaymentChannelClaim for local signing.

Summary

Functions

Decode a classic address to its 20-byte AccountID.

Validate a classic address's version, length and checksum.

STX-prefixed signing serialization for a PaymentChannelClaim.

Decode a hex Payment blob, rejecting malformed or unsupported encodings.

Decode a signed PaymentChannelClaim blob.

Decode a signed PaymentChannelCreate blob for session open.

Decode a family seed to algorithm and 16-byte entropy.

Encode a 20-byte AccountID as a classic address.

Serialize a PaymentChannelClaim. Pass signing: true to omit Signature and TxnSignature.

Return true when the transaction carries a signature or a non-empty signer list.

Functions

account_id(address)

@spec account_id(term()) :: {:ok, binary()} | :error

Decode a classic address to its 20-byte AccountID.

address?(address)

@spec address?(term()) :: boolean()

Validate a classic address's version, length and checksum.

claim_signing_data(tx)

@spec claim_signing_data(map()) :: {:ok, binary()} | :error

STX-prefixed signing serialization for a PaymentChannelClaim.

decode(hex)

@spec decode(term()) :: {:ok, map()} | {:error, :malformed_blob}

Decode a hex Payment blob, rejecting malformed or unsupported encodings.

decode_claim(hex)

@spec decode_claim(term()) :: {:ok, map()} | {:error, :malformed_blob}

Decode a signed PaymentChannelClaim blob.

decode_create(hex)

@spec decode_create(term()) :: {:ok, map()} | {:error, :malformed_blob}

Decode a signed PaymentChannelCreate blob for session open.

decode_seed(seed)

@spec decode_seed(term()) :: {:ok, {:ed25519 | :secp256k1, binary()}} | :error

Decode a family seed to algorithm and 16-byte entropy.

encode_account(arg1)

@spec encode_account(binary()) :: {:ok, String.t()} | :error

Encode a 20-byte AccountID as a classic address.

encode_claim(tx)

@spec encode_claim(map()) :: {:ok, String.t()} | :error

Serialize a PaymentChannelClaim. Pass signing: true to omit Signature and TxnSignature.

signed?(arg1)

@spec signed?(term()) :: boolean()

Return true when the transaction carries a signature or a non-empty signer list.