Show / Hide Table of Contents

Class XrplBinaryCodec

Inheritance
object
XrplBinaryCodec
Namespace: Xrpl.BinaryCodec
Assembly: Xrpl.BinaryCodec.dll
Syntax
public class XrplBinaryCodec

Methods

| Edit this page View Source

Decode(string)

Decode a hex string into a JsonNode representing the transaction/object.

Declaration
public static JsonNode Decode(string binary)
Parameters
Type Name Description
string binary
Returns
Type Description
JsonNode

JsonNode

| Edit this page View Source

Encode(object)

Encode an object into binary hex string.

Declaration
public static string Encode(object json)
Parameters
Type Name Description
object json
Returns
Type Description
string

string

| Edit this page View Source

Encode(JsonNode)

Encode a JsonNode into binary hex string.

Declaration
public static string Encode(JsonNode token)
Parameters
Type Name Description
JsonNode token
Returns
Type Description
string

string

| Edit this page View Source

EncodeForMultiSigning(object, string)

Encode a transaction into binary format in preparation for providing one signature towards a multi-signed transaction. (Only encodes fields that are intended to be signed.)

Declaration
public static string EncodeForMultiSigning(object json, string signingAccount)
Parameters
Type Name Description
object json
string signingAccount
Returns
Type Description
string

string

| Edit this page View Source

EncodeForMultiSigning(object, string, HashPrefix)

Encode a transaction for one multi-signature under an explicit prefix, for a signer on a co-signing account's SignerList: SponsorTransactionMultiSig for SponsorSignature.Signers, CounterpartyTransactionMultiSig for CounterpartySignature.Signers.

Declaration
public static string EncodeForMultiSigning(object json, string signingAccount, HashPrefix prefix)
Parameters
Type Name Description
object json

The transaction.

string signingAccount

The account whose key signs this entry.

HashPrefix prefix

Prefix for the signing role.

Returns
Type Description
string

string

Remarks

Since fixCleanup3_4_0 a Signer entry is no longer section-agnostic: an entry made for the transaction's own Signers covers different bytes than the same entry inside a role section, so the signer has to know which side it signs for. An overload for the same binary-compatibility reason as EncodeForSigning(object, HashPrefix).

| Edit this page View Source

EncodeForSigning(object)

Encode a transaction into binary format in preparation for signing. (Only encodes fields that are intended to be signed.)

Declaration
public static string EncodeForSigning(object json)
Parameters
Type Name Description
object json
Returns
Type Description
string

string

| Edit this page View Source

EncodeForSigning(object, HashPrefix)

Encode a transaction for signing under an explicit prefix, for a signature that is not the transaction's own: SponsorTransactionSig for SponsorSignature, CounterpartyTransactionSig for CounterpartySignature.

Declaration
public static string EncodeForSigning(object json, HashPrefix prefix)
Parameters
Type Name Description
object json

The transaction.

HashPrefix prefix

Prefix for the signing role.

Returns
Type Description
string

string

Remarks

An overload rather than an optional parameter on the method above: a default value is source-compatible but not binary-compatible, and an assembly built against the one-argument signature would call a method that no longer exists.

| Edit this page View Source

EncodeForSigningBatch(string, uint, uint, IEnumerable<string>)

Encode a multi transaction - Batch (XLS-56, BatchV1_1 amendment). Preimage layout mirrors rippled's serializeBatch(): "BCH\0" || outerAccount(20) || outerSequence(4) || Flags(4) || Count(4) || txID[i](32 each). The signer-specific suffixes (BatchSigner account, inner multisign signer account) are appended by the caller, matching finishMultiSigningData() in rippled.

Declaration
public static byte[] EncodeForSigningBatch(string outerAccount, uint outerSequence, uint flags, IEnumerable<string> txIDs)
Parameters
Type Name Description
string outerAccount

Account of the outer Batch transaction (classic base58 r-address).

uint outerSequence

Sequence of the outer Batch transaction.

uint flags

Batch flags.

IEnumerable<string> txIDs

Collection of inner transaction IDs.

Returns
Type Description
byte[]
Exceptions
Type Condition
ArgumentNullException
ArgumentException
| Edit this page View Source

EncodeForSigningClaim(object)

Encode a payment channel <a href="https://xrpl.org/payment-channels.html">here</a>_ Claim to be signed.

Declaration
public static string EncodeForSigningClaim(object obj)
Parameters
Type Name Description
object obj
Returns
Type Description
string

string

| Edit this page View Source

SerializeJson(JsonNode, byte[]?, byte[]?, bool)

Declaration
public static string SerializeJson(JsonNode json, byte[]? prefix = null, byte[]? suffix = null, bool signingOnly = false)
Parameters
Type Name Description
JsonNode json
byte[] prefix
byte[] suffix
bool signingOnly
Returns
Type Description
string

string

  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX