最終更新:
編集

mpt_holders

[Source]

(Requires the MPTokensV1 amendment )

For a given MPTokenIssuanceID and ledger sequence, mpt_holders returns all holders of that MPT and their balance. This method likely returns very large data sets, so you should expect to implement paging via the marker field. This API is only available using Clio, not rippled. New in: Clio v2.3.0

Request Format

{
  "command": "mpt_holders",
  "mpt_issuance_id": "0024D204E07DDDFBCD83B1649C07FE27FD536A3A32E6FDD8",
  "ledger_index": "validated"
}
試してみる

The request contains the following parameters:

FieldTypeRequired?Description
mpt_issuance_idStringYesThe MPTokenIssuance to query.
ledger_indexLedger IndexNoThe Ledger Index of the max ledger to use, or a shortcut string to choose a ledger automatically. You must specify either ledger_index or ledger_hash. See Specifying Ledgers.
ledger_hashStringNoA 32-byte hex string for the ledger version to use. You must specify either ledger_index or ledger_hash. See Specifying Ledgers.
markerMarkerNoUsed to continue your query where it left off in paginating.
limitNumber (positive integer)NoSpecify a limit to the number of MPTs returned.

Response Format

{
  "result": {
    "mpt_issuance_id": "0024D204E07DDDFBCD83B1649C07FE27FD536A3A32E6FDD8",
    "limit": 50,
    "ledger_index": 2414929,
    "mptokens": [
      {
        "account": "rfyWeQpYM3vCXRHA9cMLs2ZEdZv1F1jzm9",
        "flags": 0,
        "mpt_amount": "200",
        "mptoken_index": "22F99DCD55BCCF3D68DC3E4D6CF12602006A7563A6BE93FC57FD63298BCCEB13"
      }
    ],
    "validated": true
  },
  "status": "success",
  "type": "response",
  "warnings": [
    {
      "id": 2001,
      "message": "This is a clio server. clio only serves validated data. If you want to talk to rippled, include 'ledger_index':'current' in your request"
    }
  ]
}

Response Fields

The response follows the standard format, with the result containing the following fields:

FieldTypeDescription
mpt_issuance_idStringThe MPTokenIssuance queried.
mptokensArrayAn array of MPTokens. Includes all relevant fields in the underlying MPToken object.
markerMarkerUsed to continue querying where we left off when paginating. Omitted if there are no more entries after this result.
limitNumberThe limit, as specified in the request.
ledger_indexLedger IndexThe index of the ledger used.
validatedBooleanIf true, the ledger has been validated by the consensus process and is immutable. Otherwise, the contents of the ledger are not final and may change. In Clio, this is always true as Clio stores and returns validated ledger data.

MPToken

An MPToken object has the following parameters:

FieldTypeDescription
accountStringThe account address of the holder who owns the MPToken.
flagsNumberThe flags assigned to theMPToken object.
mpt_amountString NumberSpecifies a positive amount of tokens currently held by the owner.
mptoken_indexStringKey of the MPToken object.

Possible Errors

  • Any of the universal error types.
  • invalidParams - One or more fields are specified incorrectly, or one or more required fields are missing.