getTokenAccountsByOwner

Returns all SPL Token accounts by token owner.

https://api.1inch.com/web3/501
Supported on:
Solana

Request

Request
object
jsonrpc
* string (Enum)
2.0
method
* string
params
array
items
any
id
* number
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
const response = await fetch('https://api.1inch.com/web3/501', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    Authorization: `Bearer ${API_KEY}`,
  },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'getTokenAccountsByOwner',
    params: [],
    id: 1,
  }),
});

const data = await response.json();
console.log(data);

Response

Token Accounts By Owner Response

Token Accounts By Owner Response
object
context
* object
slot
* integer
apiVersion
string
additionalProperties
none
value
* array
items
object
pubkey
* string
account
* object
data
* object
executable
* boolean
lamports
* integer
owner
* string
rentEpoch
* integer
space
* integer
additionalProperties
none
additionalProperties
none
additionalProperties
none
JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
  "context": {
    "slot": 1114
  },
  "value": [
    {
      "pubkey": "C2jDL4pcwpE2pP5EryTGn842JJUJTcurPGZUquQjySxK",
      "account": {
        "data": {},
        "executable": false,
        "lamports": 1726080,
        "owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
        "rentEpoch": 4,
        "space": 165
      }
    }
  ]
}

Did you find what you need?