Unary Methods
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).
typescript
const response = await client.subscribeReplayInfo();
console.log("First available slot:", response.firstAvailable);python
response = stub.SubscribeReplayInfo(geyser_pb2.SubscribeReplayInfoRequest())
print(f"First available: {response.first_available}")Ping
Health check that echoes back a count value.
int32requiredA counter value to echo back.
countint32The echoed counter value.
typescript
const response = await client.ping(1);
console.log("Pong:", response);python
response = stub.Ping(geyser_pb2.PingRequest(count=1))
print(f"Pong: {response.count}")GetLatestBlockhash
Returns the latest blockhash and last valid block height.
CommitmentLevelCommitment level: PROCESSED, CONFIRMED, or FINALIZED.
slotuint64Slot of the blockhash.
blockhashstringLatest blockhash.
last_valid_block_heightuint64Last block height at which the blockhash is valid.
typescript
const response = await client.getLatestBlockhash(CommitmentLevel.CONFIRMED);
console.log(`Blockhash: ${response.blockhash}`);
console.log(`Valid until block: ${response.lastValidBlockHeight}`);python
response = stub.GetLatestBlockhash(
geyser_pb2.GetLatestBlockhashRequest(commitment=geyser_pb2.CONFIRMED)
)
print(f"Blockhash: {response.blockhash}")
print(f"Valid until: {response.last_valid_block_height}")GetBlockHeight
Returns the current block height.
CommitmentLevelCommitment level.
block_heightuint64Current block height.
typescript
const response = await client.getBlockHeight(CommitmentLevel.CONFIRMED);
console.log(`Block height: ${response.blockHeight}`);python
response = stub.GetBlockHeight(
geyser_pb2.GetBlockHeightRequest(commitment=geyser_pb2.CONFIRMED)
)
print(f"Block height: {response.block_height}")GetSlot
Returns the current slot.
CommitmentLevelCommitment level.
slotuint64Current slot number.
typescript
const response = await client.getSlot(CommitmentLevel.CONFIRMED);
console.log(`Current slot: ${response.slot}`);python
response = stub.GetSlot(
geyser_pb2.GetSlotRequest(commitment=geyser_pb2.CONFIRMED)
)
print(f"Current slot: {response.slot}")IsBlockhashValid
Checks whether a given blockhash is still valid.
stringrequiredThe blockhash to validate.
CommitmentLevelCommitment level.
slotuint64Slot at which validity was checked.
validbooltrue if the blockhash is still valid.typescript
const response = await client.isBlockhashValid("YOUR_BLOCKHASH");
console.log(`Valid: ${response.valid}, Slot: ${response.slot}`);python
response = stub.IsBlockhashValid(
geyser_pb2.IsBlockhashValidRequest(
blockhash="YOUR_BLOCKHASH",
commitment=geyser_pb2.CONFIRMED
)
)
print(f"Valid: {response.valid}, Slot: {response.slot}")GetVersion
Returns the Yellowstone gRPC server version.
Parameters: None
versionstringServer version string.
typescript
const response = await client.getVersion();
console.log(`Version: ${response.version}`);python
response = stub.GetVersion(geyser_pb2.GetVersionRequest())
print(f"Version: {response.version}")