Nataly Shmakova
Nataly Shmakova

Reputation: 1

Token XRPL listing

I am trying to list a token of XRPL, set truct and receive the following

"error_message" => "Field 'tx_json.LimitAmount' has invalid data."
    "request" => array:5 [▼
      "command" => "submit"
      "fee_mult_max" => 1000
      "offline" => false
      "secret" => "<masked>"
      "tx_json" => array:6 [▼
        "Account" => "rX49UBNi94tCCt2jb7tHVjdYSVwHNhQK2"
        "DestinationTag" => 1
        "Fee" => "15000"
        "Flags" => 262144
        "LimitAmount" => array:3 [▼
          "currency" => "Xoge"
          "issuer" => "rJMtvf5B3GbuFMrqybh5wYVXEH4QE8VyU1"
          "value" => "1000000000000000"
        ]
        "TransactionType" => "TrustSet"
      ]
    ]
    "status" => "error"

using this document: https://xrpl.org/trustset.html

Upvotes: -1

Views: 141

Answers (1)

Satish
Satish

Reputation: 173

XRP Ledger supports either a three-letter ISO 4217 Currency Code or a 160-bit(40-character) hexadecimal string as value for "currency" field.

In your case(above code), you are using "Xoge" as value for the field "currency" inside "LimitAmount" object. "Xoge" has more than 3 letters, so it's throwing error. You can either switch to a 3 letter currency code or convert "Xoge" into 160-bit(40-character) hexadecimal string.

    LimitAmount: {
      currency: '586F676500000000000000000000000000000000',
      issuer: 'rJMtvf5B3GbuFMrqybh5wYVXEH4QE8VyU1',
      value: '1000000000000000'
    },

Here 586F676500000000000000000000000000000000 represents Xoge in 160-bit hex.

Couple of more things I noticed from your code:

  1. Fee is represented in drops. So you can lower your fee a bit, and it'll still work.
  2. You are setting flag 262144 which enables rippling. Usually TrustLine is setup by regular users with the issuer, so it's always recommended to have flag 131072, which blocks rippling from the user end of the TrustLine.

Upvotes: -1

Related Questions