@avalanche-sdk/client
Version:
A TypeScript SDK for interacting with the Avalanche network through JSON-RPC APIs. This SDK provides a comprehensive set of tools to interact with all Avalanche chains (P-Chain, X-Chain, C-Chain) and various APIs, including wallet functionality for transa
29 lines (24 loc) • 827 B
text/typescript
import { RequestErrorType } from "viem/utils";
import { Encoding, PChainBlockType } from "./common.js";
/**
* Parameters for the `platform.getBlockByHeight` method.
* Get a block by its height.
* @property height - The block height to query
* @property encoding - The encoding format to use. Can be either 'hex' or 'json'. Defaults to 'hex'
*/
export type GetBlockByHeightParameters = {
height: number;
encoding?: Encoding;
};
/**
* The return type for the `platform.getBlockByHeight` method.
*
* @see {@link PChainBlockType}
*/
export type GetBlockByHeightReturnType = PChainBlockType;
export type GetBlockByHeightErrorType = RequestErrorType;
export type GetBlockByHeightMethod = {
Method: "platform.getBlockByHeight";
Parameters: GetBlockByHeightParameters;
ReturnType: GetBlockByHeightReturnType;
};