getProgramAccounts RPC-metodi

Palauttaa kaikki annetun ohjelma-pubkeyn omistamat tilit

$ 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

Ohjelman pubkey base-58-koodattuna merkkijonona

objectoptional

Määritysobjekti, joka sisältää seuraavat kentät:

result

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

Oletuksena palauttaa JSON-objektien taulukon. Jos withContext -lippu on asetettu, taulukko kääritään RpcResponse JSON-objektiin.

Jokainen objekti sisältää:

Is this page helpful?