getProgramAccounts

Returns all accounts owned by the provided program Pubkey.

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: 'getProgramAccounts',
    params: [],
    id: 1,
  }),
});

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

Response

Program Accounts Response

Program Accounts Response
array
items
object
pubkey
* string
account
* object
data
* string
executable
* boolean
lamports
* integer
owner
* string
rentEpoch
* integer
space
* integer
additionalProperties
none
additionalProperties
none
JSON
1
2
3
4
5
6
7
8
9
10
11
12
13
14
[
  {
    "pubkey": "CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY",
    "account": {
      "data": "2R9jLfiAQ9bgdcw6h8s44439",
      "executable": false,
      "lamports": 15298080,
      "owner": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
      "rentEpoch": 28,
      "space": 42
    }
  }
]

Did you find what you need?