Files
xahau.js/packages/ripple-binary-codec/src/enums
ledhed2222 46a8adcac9 feat: NFT support (#1829)
* add NFTokenBurn and NFTokenMint

* add NFTokenCreateOffer

* add NFTokenCancelOffer

* add NFTokenAcceptOffer

* add requests and responses

* make a beta 2.1.0

* rename TokenIDs to TokenOffers

* add validations and fixup docs

* add tests

* add missing error codes to binary codec

* adds history changes
2021-12-17 18:26:47 -05:00
..
2021-12-17 18:26:47 -05:00
2021-12-17 18:26:47 -05:00
2020-09-08 17:17:14 -05:00
2021-11-12 02:41:28 -05:00

Definitions

Types

These are the types associated with a given Serialization Field. Each type has an arbitrary type_code, with lower codes sorting first.

Ledger Entry Types

Each ledger's state tree contain ledger objects, which represent all settings, balances, and relationships in the shared ledger.

Fields

These are Serialization Fields (sf) defined in rippled's SField.cpp. Fields with undefined values are omitted before encoding.

Key

The key is the string defined in the rippled source code, such as "LedgerEntry", "Transaction", etc.

nth

nth is the sort code, meaning "nth of type." It is is combined with the type code in order to construct the Field ID of this field. The Field ID is only used for sorting the fields. Since there are multiple fields with the same data type, the nth is used to deterministically order each field among other fields of the same data type.

Each field has a Field ID, which is used to sort fields that have the same type as one another with lower codes sorting first.

For example, the Account field has sort code (nth) 1, so it comes before the Destination field which has sort code 3.

Sort code numbers are reused for fields of different types, but different fields of the same type never have the same sort code. When you combine the type code with the sort code, you get the field's unique Field ID.

The unique Field ID is prefixed before the field in the final serialized blob. The size of the Field ID is one to three bytes depending on the type code and the field codes it combines.

isVLEncoded

If true, the field is Variable Length encoded and length-prefixed. The variable-length encoded fields are STI_VL/Blob, STI_ACCOUNT/AccountID, and STI_VECTOR256/Vector256.

isSerialized

Fields are serialized if they are not one of these or if they are not an SField.

isSigningField

True unless the field is specified with SField::notSigning.

Transaction Results

See:

TODO: Write a script to read rippled's source file and generate the necessary mapping.

Transaction Types

See https://github.com/ripple/rippled/blob/develop/src/ripple/protocol/TxFormats.h