Solana
geyser.Geyser/Subscribe25 créditos
Opens a bidirectional stream of slot, account, transaction and block updates (gRPC; one stream is billed once).
Parâmetros
| Nome | Tipo | Descrição |
|---|---|---|
| accounts | map<string, SubscribeRequestFilterAccounts> | Account filters by name. Each filter: account (string[]), owner (string[]), filters (memcmp { offset, bytes | base58 | base64 }, datasize, token_account_state, lamports { eq | ne | lt | gt }), nonempty_txn_signature (bool). (opcional) |
| slots | map<string, SubscribeRequestFilterSlots> | Slot filters by name. Each filter: filter_by_commitment (bool), interslot_updates (bool). (opcional) |
| transactions | map<string, SubscribeRequestFilterTransactions> | Transaction filters by name. Each filter: vote (bool), failed (bool), signature (string), account_include, account_exclude, account_required (string[]). (opcional) |
| transactions_status | map<string, SubscribeRequestFilterTransactions> | Transaction status filters by name; same filter fields as transactions. (opcional) |
| blocks | map<string, SubscribeRequestFilterBlocks> | Block filters by name. Each filter: account_include (string[]), include_transactions, include_accounts, include_entries (bool). (opcional) |
| blocks_meta | map<string, SubscribeRequestFilterBlocksMeta> | Block metadata filters by name; the filter message has no fields. (opcional) |
| entry | map<string, SubscribeRequestFilterEntry> | Entry filters by name; the filter message has no required fields. (opcional) |
| commitment | CommitmentLevel | Commitment level: 0 = PROCESSED, 1 = CONFIRMED, 2 = FINALIZED. Optional. (opcional) |
| accounts_data_slice | SubscribeRequestAccountsDataSlice[] | Slices { offset, length } (uint64) of account data to return. (opcional) |
| ping | SubscribeRequestPing | { id: int32 }; the node answers with a pong update. (opcional) |
| from_slot | uint64 | Replay updates starting from this slot (see SubscribeReplayInfo). (opcional) |
Retorno
Tipo
stream SubscribeUpdate
A stream of messages { filters: string[], created_at: Timestamp, update_oneof } where update_oneof is one of account, slot, transaction, transaction_status, block, ping, pong, block_meta or entry. filters lists the names of the matched filters from the request.
Exemplos de código
# the key of the endpoint goes in the x-token header; add -proto <file> when the node has no gRPC reflection
grpcurl \
-H 'x-token: 7c9e6679-7425-40de-944b-e07fc1f90ae7' \
-d '{
"slots": {
"slots": {
"filter_by_commitment": true
}
},
"commitment": 1
}' \
grpc-holy-burned-sky-solana-mainnet.rpcnode.dev:443 \
geyser.Geyser/Subscribe