권한 부여
메시지
gRPC API는 여러 구독 유형을 지원하며 단일 요청으로 결합할 수 있습니다.object
계정 업데이트를 구독합니다. 지정된 계정이 수정되면 데이터를 반환합니다.
숨기기 속성
숨기기 속성
array
모니터링할 계정 pubkey 배열입니다.
array
모니터링할 소유자 pubkey 배열입니다 (이 프로그램이 소유한 모든 계정).
object
적용할 선택적 필터입니다.
표시 필터 옵션
표시 필터 옵션
object
integer
바이트 단위의 정확한 계정 데이터 크기로 필터링합니다.
boolean
토큰 계정만 필터링합니다.
boolean
만약
true, 거래로 인해 발생한 업데이트만 포함합니다. 만약 false, 거래로 인해 발생하지 않은 업데이트만 포함합니다. 만약 undefined, 모든 업데이트를 포함합니다.object
object
거래 업데이트를 구독합니다.
숨기기 속성
숨기기 속성
boolean
투표 거래를 포함합니다.
boolean
실패한 거래를 포함합니다.
string
특정 거래 서명을 모니터링합니다.
array
이러한 계정에 영향을 미치는 거래만 포함합니다.
array
이러한 계정에 영향을 미치는 거래를 제외합니다.
array
거래는 반드시 이 모든 계정에 영향을 미쳐야 합니다.
enum
선택적 ATA(Associated Token Account) 확장 (필드 태그 30,
TokenAccountExpansionControlFlag). 설정 시, account_include 지갑은 SPL 토큰 잔액을 소유하는 거래도 매칭됩니다 — 예를 들어 지갑의 토큰 계정을 만지는 인바운드 토큰 전송. 두 가지 변형:ALL(0) — 지갑이 소유한 토큰 잔액을 참조하는 모든 거래와 일치, 심지어 변경되지 않아도. 높은 볼륨.BALANCE_CHANGED(1) — 지갑이 소유한 토큰 잔액이 변경된 (또는 토큰 계정이 닫힌) 거래와 일치합니다.
None) — “off” 열거값이 없습니다. 범위를 초과한 정수는 구성 빌드에서 거부됩니다: Invalid token_accounts value, expected ALL (0) or BALANCE_CHANGED (1).ALL는 0 값입니다. “default/off”를 기대하며 열거값을 0로 설정한 클라이언트는 ALL — 가장 넓고, 높은 볼륨 모드를 얻습니다. “no expansion”을 의미하는 유일한 방법은 필드를 완전히 생략하는 것입니다.object
object
object
object
enum
integer
업데이트를 수신할 시작 슬롯입니다. 이 값 이전의 슬롯에 대한 업데이트는 제외됩니다.
{
"slots": {
"slots": {}
},
"accounts": {
"user-defined-label": {
"account": [
"DjUF9ASpyMbVpGJmTvzfSbCgUWj6JowwLh8dGAJzSPmu",
"5U3bH5b6XtG99aVCE9ycvDgBKQx3fVT8WwTNbMToFuEr"
],
"owner": [
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
],
"filter": {
"memcmp": {
"offset": 0,
"bytes": "0102030405"
},
"datasize": 165,
"token_account_state": true,
"lamports": {
"gt": 100000000
}
},
"nonempty_txn_signature": true
}
},
"transactions": {},
"blocks": {},
"blocks_meta": {},
"accounts_data_slice": [],
"commitment": 1
}
{
"slots": {
"incoming_slots": {}
},
"commitment": 1
}
{
"transactions": {
"vote": false,
"failed": true,
"signature": "4RPMxKBhCBubFmZ1r9BC52ztjG3qBTW9Gp1PXfufUSATQaLKTW3Dj6vQBYyVrhfjgJ4PjZLzwYs4Z92KDCPw8Qym",
"account_include": ["DjUF9ASpyMbVpGJmTvzfSbCgUWj6JowwLh8dGAJzSPmu"],
"account_exclude": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"],
"account_required": ["11111111111111111111111111111111"]
},
"commitment": 2
}
{
"transactions": {
"wallet": {
"vote": false,
"failed": false,
"account_include": ["DjUF9ASpyMbVpGJmTvzfSbCgUWj6JowwLh8dGAJzSPmu"],
"account_exclude": [],
"account_required": [],
"token_accounts": 1
}
},
"commitment": 1
}
{
"transactions_status": {
"vote": false,
"failed": true,
"account_include": ["DjUF9ASpyMbVpGJmTvzfSbCgUWj6JowwLh8dGAJzSPmu"],
"account_exclude": ["TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"],
"account_required": ["11111111111111111111111111111111"]
},
"commitment": 2
}
{
"blocks": {
"account_include": ["DjUF9ASpyMbVpGJmTvzfSbCgUWj6JowwLh8dGAJzSPmu"],
"include_transactions": 1,
"include_accounts": 1,
"include_entries": 0
},
"commitment": 2
}
{
"blocks_meta": {},
"commitment": 2,
"from_slot": 139000000
}
{
"entry": {},
"commitment": 1
}
{
"accounts": {
"account": ["DjUF9ASpyMbVpGJmTvzfSbCgUWj6JowwLh8dGAJzSPmu"]
},
"accounts_data_slice": [
{
"offset": 0,
"length": 64
},
{
"offset": 128,
"length": 32
}
],
"commitment": 2
}
{
"ping": {
"id": 1
}
}
{
"accounts": {
"account": ["DjUF9ASpyMbVpGJmTvzfSbCgUWj6JowwLh8dGAJzSPmu"],
"nonempty_txn_signature": true
},
"slots": {
"filter_by_commitment": 1,
"interslot_updates": 1
},
"commitment": 2,
"from_slot": 139000000,
"ping": {
"id": 123
}
}
커밋 수준
모든 구독은 다음 커밋 수준을 지원합니다:PROCESSED: 현재 노드에 의해 처리됨 (0)CONFIRMED: 클러스터의 슈퍼다수에 의해 확인됨 (1)FINALIZED: 클러스터에 의해 완료됨 (2)
응답 구조
구독 응답에는 다음이 포함됩니다:filters: 이 업데이트와 일치하는 필터 이름- 다음 업데이트 유형 중 하나:
account: 계정 데이터, 소유자, lamports, 실행 가능 상태 등slot: 슬롯 정보 및 상태 업데이트transaction: 전체 거래 세부사항, 서명 및 메타데이터transaction_status: 거래 실행 상태 (성공/오류)block: 거래, 계정, 보상 등을 포함한 전체 블록 데이터block_meta: 전체 거래 세부사항 없이 경량 블록 메타데이터entry: 블록 내 항목 세부사항ping/pong: 연결 상태 확인 메시지
created_at: 업데이트가 생성된 시간의 타임스탬프
{
"filters": ["accounts"],
"account": {
"account": {
"pubkey": "BASE58_ENCODED_PUBKEY",
"lamports": 12345678,
"owner": "BASE58_ENCODED_OWNER",
"executable": false,
"rent_epoch": 361,
"data": "BASE64_ENCODED_DATA",
"write_version": 123,
"txn_signature": "BASE58_ENCODED_SIGNATURE"
},
"slot": 189554321,
"is_startup": false
},
"created_at": "2023-04-28T12:34:56.789Z"
}
{
"filters": ["slots"],
"slot": {
"slot": 189554321,
"parent": 189554320,
"status": 2,
"dead_error": null
},
"created_at": "2023-04-28T12:34:56.789Z"
}
{
"filters": ["transactions"],
"transaction": {
"transaction": {
"signature": "BASE58_ENCODED_SIGNATURE",
"is_vote": false,
"transaction": {
"signatures": ["BASE58_ENCODED_SIGNATURE"],
"message": {
"header": {
"num_required_signatures": 1,
"num_readonly_signed_accounts": 0,
"num_readonly_unsigned_accounts": 1
},
"account_keys": ["BASE58_ENCODED_PUBKEY1", "BASE58_ENCODED_PUBKEY2"],
"recent_blockhash": "BASE58_ENCODED_BLOCKHASH",
"instructions": [
{
"program_id_index": 1,
"accounts": [0],
"data": "BASE64_ENCODED_INSTRUCTION_DATA"
}
]
}
},
"meta": {
"err": null,
"fee": 5000,
"pre_balances": [10000000, 1],
"post_balances": [9995000, 1],
"pre_token_balances": [],
"post_token_balances": [],
"log_messages": ["Program log: Instruction executed"],
"rewards": []
},
"index": 2
},
"slot": 189554321
},
"created_at": "2023-04-28T12:34:56.789Z"
}
{
"filters": ["blocks_meta"],
"block_meta": {
"slot": 189554321,
"blockhash": "BASE58_ENCODED_BLOCKHASH",
"rewards": [
{
"pubkey": "BASE58_ENCODED_PUBKEY",
"lamports": 1785000,
"post_balance": 48589432109,
"reward_type": 0,
"commission": 10
}
],
"block_time": 1682684096,
"block_height": 185432109,
"parent_slot": 189554320,
"parent_blockhash": "BASE58_ENCODED_PARENT_BLOCKHASH",
"executed_transaction_count": 2576,
"entries_count": 16
},
"created_at": "2023-04-28T12:34:56.789Z"
}
{
"filters": ["entry"],
"entry": {
"slot": 189554321,
"index": 5,
"num_hashes": 8765432,
"hash": "BASE58_ENCODED_HASH",
"executed_transaction_count": 128,
"starting_transaction_index": 1024
},
"created_at": "2023-04-28T12:34:56.789Z"
}
{
"filters": [],
"pong": {
"id": 1
},
"created_at": "2023-04-28T12:34:56.789Z"
}