Metodo RPC getProgramAccounts

Restituisce tutti gli account posseduti dalla Pubkey del programma fornita

$ curl https://api.devnet.solana.com -s -X \
> POST -H "Content-Type: application/json" -d '
> {
> "jsonrpc": "2.0",
> "id": 1,
> "method": "getProgramAccounts",
> "params": [
> "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
> {
> "commitment": "finalized",
> "filters": [
> { "dataSize": 17 },
> {
> "memcmp": {
> "offset": 4,
> "bytes": "3Mc6vR"
> }
> }
> ]
> }
> ]
> }
> '

params

stringrequired

Pubkey del programma, come stringa codificata in base-58

objectoptional

Oggetto di configurazione contenente i seguenti campi:

result

Response
{
"jsonrpc": "2.0",
"result": [
{
"pubkey": "CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY",
"account": {
"data": "2R9jLfiAQ9bgdcw6h8s44439",
"executable": false,
"lamports": 15298080,
"owner": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"rentEpoch": 28,
"space": 42
}
}
],
"id": 1
}
array

Per impostazione predefinita, restituisce un array di oggetti JSON. Se il flag withContext è impostato, l'array sarà avvolto in un oggetto JSON RpcResponse.

Ogni oggetto contiene:

Is this page helpful?