@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
45 lines (40 loc) • 1.18 kB
text/typescript
import { RequestErrorType } from "viem/utils";
/**
* Parameters for the info.peers method.
* @property nodeIDs - Optional array of node IDs to filter peers
*/
export type PeersParameters = {
nodeIDs?: string[];
};
/**
* Return type for the info.peers method.
* @property numPeers - The number of connected peers
* @property peers - Array of peer information
*/
export type PeersReturnType = {
numPeers: number;
peers: {
/** The remote IP of the peer */
ip: string;
/** The public IP of the peer */
publicIP: string;
/** The prefixed Node ID of the peer */
nodeID: string;
/** The version the peer is running */
version: string;
/** Timestamp of last message sent to the peer */
lastSent: string;
/** Timestamp of last message received from the peer */
lastReceived: string;
/** Array of chain IDs the peer is benched on */
benched: string[];
/** The node's primary network uptime observed by the peer */
observedUptime: number;
}[];
};
export type PeersErrorType = RequestErrorType;
export type PeersMethod = {
Method: "info.peers";
Parameters: PeersParameters;
ReturnType: PeersReturnType;
};