gRPC Unary Methods
Simple request/response gRPC methods for blockhash, block height, slot, and version queries.
Unary Methods
These are simple request/response gRPC methods (not streaming).
SubscribeReplayInfo
Returns information about the earliest slot available for replay subscriptions.
Parameters: None (empty request message)
first_availableuint64The first slot available for replay (optional - may be absent if replay is not supported).
const response = await client.subscribeReplayInfo();console.log("First available slot:", response.firstAvailable);Ping
Health check that echoes back a count value.
countint32requiredA counter value to echo back.
countint32The echoed counter value.
const response = await client.ping(1);console.log("Pong:", response);GetLatestBlockhash
Returns the latest blockhash and last valid block height.
commitmentCommitmentLevelCommitment level: PROCESSED, CONFIRMED, or FINALIZED.
slotuint64blockhashstringlast_valid_block_heightuint64const response = await client.getLatestBlockhash(CommitmentLevel.CONFIRMED);console.log(`Blockhash: ${response.blockhash}`);console.log(`Valid until block: ${response.lastValidBlockHeight}`);GetBlockHeight
Returns the current block height.
commitmentCommitmentLevelCommitment level.
block_heightuint64const response = await client.getBlockHeight(CommitmentLevel.CONFIRMED);console.log(`Block height: ${response.blockHeight}`);GetSlot
Returns the current slot.
commitmentCommitmentLevelCommitment level.
slotuint64const response = await client.getSlot(CommitmentLevel.CONFIRMED);console.log(`Current slot: ${response.slot}`);IsBlockhashValid
Checks whether a given blockhash is still valid.
blockhashstringrequiredThe blockhash to validate.
commitmentCommitmentLevelCommitment level.
slotuint64validbooltrue if the blockhash is still valid.const response = await client.isBlockhashValid("YOUR_BLOCKHASH");console.log(`Valid: ${response.valid}, Slot: ${response.slot}`);GetVersion
Returns the Yellowstone gRPC server version.
Parameters: None
versionstringconst response = await client.getVersion();console.log(`Version: ${response.version}`);