XRP Ledger

Available Endpoints:

Click on the endpoint to jump to the section with full details

  • /getbalance GET - Get the balance or number of the given token in the requested public address.

  • /getblock GET - Get details of a block(ledger).

  • /getgasprice GET - Get the current gas price from the XRPL.

  • /gettransaction GET - Get details of a specified transaction.

  • /portfolio GET - Get comprehensive information about the assets/ tokens a user owns, including their name, balance, symbol, address, and their equivalent USD price.

  • /getusertransactions GET - Get the historical transaction details for a specific user address.

  • /getlatestledger GET - Get details for the current latest known ledger of the node.

  • /sendtransaction POST - Submit a signed transaction to XRPL for processing.

  • /createaccount POST - Initiates a transaction to fund a newly created account 10 XRP using the public key as the account ID.

  • /decodetransaction POST - Get the decoded transaction(sender, recipient, gas limit, method signature, and more) for the provided raw transaction.

Also, see Error Handling Details

DEX IDs

Please use Chain ID 1600 for the XRP Ledger Mainnet and 1601 for the XRP Ledger Testnet See the Chain ID for a complete list of DEX IDs.

Endpoint Details

/getbalance

Get the balance or number of the given token in the requested public address.

GET https://api.expand.network/chain/getbalance

Query Parameters

NameTypeDescription

rpc

String

Remote procedural call URL

chainId*

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

address*

String

The public address to get the balance of.

issuer

String

The public address of the issuer.

assetCode

String

The code of asset to get the balance of. *Required, if issuer address is provided.

https://api.expand.network/chain/getbalance?chainId=1600&address=rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6&assetCode=USD&issuer=rrpNnNLKrartuEqfJGpqyDwPj1AFPg9vn1

back to top

/getblock

Get details of a block(ledger).

GET https://historicallp.api.expand.network/chain/getblock

Query Parameters

NameTypeDescription

rpc

String

Remote procedural call URL.

chainId*

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

blockNumber*

String

Sequence number of the ledger.

https://historicallp.api.expand.network/chain/getblock?chainId=1600&blockNumber=89475323

back to top

/getgasprice

Get the current gas price from the XRPL.

GET https://api.expand.network/chain/getgasprice

Query Parameters

NameTypeDescription

rpc

String

Remote procedural call URL.

chainId*

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

https://api.expand.network/chain/getgasprice?chainId=1600

back to top

/gettransaction

Get details of a specified transaction.

GET https://api.expand.network/chain/gettransaction

Query Parameters

NameTypeDescription

rpc

String

Remote procedural call URL.

chainId*

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

transactionHash*

String

The transaction hash.

https://api.expand.network/chain/gettransaction?chainId=1600&transactionHash=478061849940F06D822BF28A0D3FF6EE9832729E79DDD10C05967FB0C86B3C5E

back to top

/portfolio

Get the comprehensive information about the assets/ tokens owned by a user, including their name, balance, symbol, address, and their equivalent USD price.

GET https://api.expand.network/chain/portfolio

Query Parameters

NameTypeDescription

rpc

String

Remote procedural call URL.

chainId*

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

address*

String

Public addess of the user.

assetType

String

fungible/nonFungible standard choice. By default, all.

availableOnly

Boolean

By default, false. If true, tokens with balance > 0 will be listed.

https://api.expand.network/chain/chain/portfolio?chainId=1600&address=rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6&assetType=fungible&availableOnly=true

back to top

/getusertransactions

Get the historical transaction details for a specific user address.

GET https://historicallp.api.expand.network/chain/getusertransactions

Query Parameters

NameTypeDescription

rpc

String

Remote procedural call URL.

chainId*

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

address*

String

The public address of the user.

pageToken

String

A string ID that points to a specific location in a collection of responses, present at the end of the response.

sortOrder

String

The transaction sorting order. asc or desc. By default, desc.

https://historicallp.api.expand.network/chain/getusertransactions?chainId=1600&address=r3KFdr7FTU1hxo9DbS1h65Wq8MXG7e9cgK&pageToken=89465257:45&sortOrder=asc

back to top

/getlatestledger

Get details for the current latest known ledger of the node.

GET https://api.expand.network/chain/getlatestledger

Query Parameters

NameTypeDescription

rpc

String

Remote procedural call URL.

chainId

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

https://api.expand.network/chain/getlatestledger?chainId=1600

back to top

/sendtransaction

Submit a signed transaction to XRPL for processing.

POST https://api.expand.network/chain/sendtransaction

Request Body

NameTypeDescription

rpc

String

Remote procedural call URL.

chainId

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

rawTransaction*

String

The signed transaction to broadcast for inclusion in a ledger, serialized as a base64 string.

{
  "chainId": "1600",
  "rawTransaction": "12000022000000002405594454201B055945D261400000000000271068400000000000000C73210330A70B8D820332240B97477520296FD5A8F2E531B17DF54C6DE13F8737012E8374473045022100C32E02C67EEA80379EFBCF450E5BB66F62122B57D0F91F0694F5D5BE840D738802202536AAC1568EAE56BD2F04B8822E580D325C367468455B2475C81F4F3D08B4018114A682E02A8BDB803AB509F3BE5D384841A7227CE583149901A6A96D83F029FB8BCF116527AD19A6EEA803"
}

back to top

/createaccount

Initiates a transaction to fund a newly created account 10 XRP using the public key as the account ID.

POST https://api.expand.network/chain/createaccount

Request body

NameTypeDescription

rpc

String

Remote procedural call URL.

chainId*

String

Refer to the Chain ID page for details.

chainSymbol

String

Refer to the Chain ID page for details.

from*

String

Public address of the sender who funds the account.

to*

String

Public address of the recipient who will get funded.

destinationTag

String

{
    "chainId": "1600",
    "from": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6",
    "to": "rBTwLga3i2gz3doX6Gva3MgEV8ZCD8jjah"
}

back to top

/decodetransaction

Get the decoded transaction(sender, recipient, gas limit, method signature, and more) for the provided raw transaction.

POST https://api.expand.network/chain/decodetransaction

Request Body

NameTypeDescription

chainId*

String

Refer to the Chain ID page for details. By default, Ethereum.

chainSymbol

String

Refer to the Chain ID page for details.

rawTransaction*

String

A signed XRPL transaction, serialized as a base64 string.

{
  "chainId": "1600",
  "rawTransaction": "12000022000000002405594454201B055945D261400000000000271068400000000000000C73210330A70B8D820332240B97477520296FD5A8F2E531B17DF54C6DE13F8737012E8374473045022100C32E02C67EEA80379EFBCF450E5BB66F62122B57D0F91F0694F5D5BE840D738802202536AAC1568EAE56BD2F04B8822E580D325C367468455B2475C81F4F3D08B4018114A682E02A8BDB803AB509F3BE5D384841A7227CE583149901A6A96D83F029FB8BCF116527AD19A6EEA803"
}

back to top

Error Handling Details

ErrorDescription

400 (Bad Request)

Indicates the request is invalid or missing the required parameters. The msg field will contain details about the error.

401 (Unauthorised)

Indicates the request lacks valid authentication credentials (API key). Ensure that you provide a valid API key in the request headers.

404 (Not Found)

Indicates that the specified endpoint or resource does not exist.

500 (Server Error)

Indicates an internal server error.

back to top

Last updated