Skip to main content

getTransformedAccountData

Returns transformed account data based on specified transformation configurations. This endpoint requires an rpcX package that implements the accounts transformer interfaces to be published.

Parameters​

package <string>​

  • The rpcX package identifier for the transformation

config <object>​

An object containing the transformation configuration with the following structure:

  • request : One of two possible configuration types:
    1. AccountsTransformerSetup:

      • command: Setup command to execute
      • params: Parameters for the setup command
    2. AccountsTransformer:

      • accounts: Array of account public keys as base-58 encoded strings
      • command: Transform command to execute
      • params: Parameters for the transformation command

Result​

The result will be an RpcResponse JSON object with the value field set to the transformed account data according to the specified configuration.

Code sample​

curl "https://testnet.atlas.xyz" -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": "bd1d8e81-75d4-4075-9bdb-8d7321c6f163",
"method": "getTransformedAccountData",
"params": [
"phoenix-v1",
{
"request": {
"accountsTransformer": {
"accounts": [
"7ttXVXWHvahy9uDtUZh75Un8vrogdzkqrqni4c3N6B8n",
"SysvarC1ock11111111111111111111111111111111"
],
"command": "get-l2-orderbook",
"params": "3"
}
}
}
]
}
'

Response​

{
"jsonrpc": "2.0",
"id": "bd1d8e81-75d4-4075-9bdb-8d7321c6f163",
"result": {
"context": {
"slot": 1150555
},
"value": {
"asks": [
{
"price": "0.07541",
"size": "27.2101"
},
{
"price": "0.07542",
"size": "33.8366"
},
{
"price": "0.07543",
"size": "53.7137"
}
],
"bids": [
{
"price": "0.07537",
"size": "27.2264"
},
{
"price": "0.07536",
"size": "33.8637"
},
{
"price": "0.07534",
"size": "53.7782"
}
]
}
}
}