From 2e383782025fff1614d53d361fcbff9cb018757b Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Tue, 8 Jul 2025 12:28:47 -0700 Subject: [PATCH] Fix MPToken ledger entry formatting --- .../ledger-data/ledger-entry-types/mptoken.md | 47 +++++++++---------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/docs/references/protocol/ledger-data/ledger-entry-types/mptoken.md b/docs/references/protocol/ledger-data/ledger-entry-types/mptoken.md index 9fa3a70e67..5dec551fa1 100644 --- a/docs/references/protocol/ledger-data/ledger-entry-types/mptoken.md +++ b/docs/references/protocol/ledger-data/ledger-entry-types/mptoken.md @@ -5,11 +5,9 @@ labels: --- # MPToken -_(Requires the [MPTokensV1 amendment][] {% not-enabled /%})_ +An `MPToken` entry tracks [MPTs](../../../../concepts/tokens/fungible-tokens/multi-purpose-tokens.md) held by an account that is not the token issuer. You can create or delete an empty `MPToken` entry by sending an [MPTokenAuthorize transaction][]. You can send and receive MPTs using several other transaction types including [Payment][] and [OfferCreate][] transactions. -The `MPToken` object represents a number of tokens held by an account that is not the token issuer. MPTs are acquired via ordinary payment or DEX transactions, and can optionally be redeemed or exchanged using these same types of transactions. The object key of the MPToken is derived from hashing the space key, the holder's address, and the `MPTokenIssuanceID`. - - +_(Requires the [MPTokensV1 amendment][] {% not-enabled /%}.)_ ## Example MPToken JSON @@ -24,37 +22,36 @@ The `MPToken` object represents a number of tokens held by an account that is no } ``` -## MPTokenID - -The `MPTokenID` is the result of SHA512-Half of the following values, concatenated in order: - -- The `MPToken` space key (0x0074). -- The `MPTokenIssuanceID` for the issuance being held. -- The `AccountID` of the token holder. - ## MPToken Fields -`MPToken` objects have the following fields. +In addition to the [common fields](../common-fields.md), {% code-page-name /%} entries have the following fields: -| Field Name | JSON Type | Internal Type | Description | -|:------------------|:----------|:--------------|:------------| -| `LedgerEntryType` | number | UInt16 | The value 0x007F, mapped to the string `MPToken`, indicates that this object describes an individual account's holding of an MPT. | -| `Account` | string | AccountID | The owner of the MPT. | -| `MPTokenIssuanceID` | string | UInt192 | The `MPTokenIssuance` identifier. | -| `MPTAmount` | string | UInt64 | This value specifies a positive amount of tokens currently held by the owner. Valid values for this field are between 0x0 and 0x7FFFFFFFFFFFFFFF. | -| `Flags` | number | UInt32 | (Default) See [MPToken Flags](#mptoken-flags) | -| `PreviousTxnID` | string | UInt256 | Transaction ID of the transaction that most recently modified this object. | -| `PreviousTxnLgrSeq` | number | UInt32 | The sequence of the ledger that contains the transaction that most recently modified this object. | -| `OwnerNode` | string | UInt64 | (Default) The page in the owner's directory where this item is referenced. | +| Field Name | JSON Type | Internal Type | Required? | Description | +|:--------------------|:---------------------|:--------------|:----------|:------------| +| `Account` | String - [Address][] | AccountID | Yes | The owner (holder) of these MPTs. | +| `MPTokenIssuanceID` | String - Hexadecimal | UInt192 | Yes | The `MPTokenIssuance` identifier. | +| `MPTAmount` | String - Number | UInt64 | Yes | The amount of tokens currently held by the owner. The minimum is 0 and the maximum is 263-1. | +| `LockedAmount` | String - Number | UInt64 | No | The amount of tokens currently locked up (for example, in escrow or payment channels). _(Requires the [TokenEscrow amendment][] {% not-enabled /%}.)_ | +| `PreviousTxnID` | String - [Hash][] | UInt256 | Yes | The identifying hash of the transaction that most recently modified this entry. | +| `PreviousTxnLgrSeq` | Number | UInt32 | Yes | The sequence of the ledger that contains the transaction that most recently modified this object. | +| `OwnerNode` | String | UInt64 | Yes | A hint indicating which page of the owner directory links to this entry, in case the directory consists of multiple pages. | ### MPToken Flags -Flags are properties or other options associated with the `MPToken` object. - +{% code-page-name /%} entries can have the following flags combined in the `Flags` field: | Flag Name | Flag Value | Description | |:------------------|:-----------|:--------------------------------------------| | `lsfMPTLocked` | `0x00000001` | If enabled, indicates that the MPT owned by this account is currently locked and cannot be used in any XRP transactions other than sending value back to the issuer. | | `lsfMPTAuthorized` | `0x00000002` | (Only applicable for allow-listing) If set, indicates that the issuer has authorized the holder for the MPT. This flag can be set using a `MPTokenAuthorize` transaction; it can also be "un-set" using a `MPTokenAuthorize` transaction specifying the `tfMPTUnauthorize` flag. | + +## MPToken ID Format + +The ID of an `MPToken` entry is the [SHA-512Half][] of the following values, concatenated in order: + +- The `MPToken` space key (0x0074). +- The `MPTokenIssuanceID` for the issuance being held. +- The `AccountID` of the token holder. + {% raw-partial file="/docs/_snippets/common-links.md" /%}