getProgramAccounts RPC 메소드

제공된 프로그램 pubkey가 소유한 모든 계정을 반환합니다

$ 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

base-58로 인코딩된 문자열 형태의 프로그램 pubkey

objectoptional

다음 필드를 포함하는 구성 객체:

result

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

기본적으로 JSON 객체 배열을 반환합니다. withContext 플래그가 설정된 경우, 배열은 RpcResponse JSON 객체로 래핑됩니다.

각 객체에는 다음이 포함됩니다:

Is this page helpful?