import { ChainGetBlockResult, ChainGetBlockTransfersResult, ChainGetEraInfoResult, ChainGetEraSummaryResult, ChainGetStateRootHashResult, InfoGetChainspecResult, InfoGetDeployResult, InfoGetPeerResult, InfoGetRewardResult, InfoGetStatusResult, InfoGetTransactionResult, InfoGetValidatorChangesResult, PutDeployResult, PutTransactionResult, QueryBalanceDetailsResult, QueryBalanceResult, QueryGlobalStateResult, RpcResponse, StateGetAccountInfo, StateGetAuctionInfoResult, StateGetAuctionInfoV1Result, StateGetBalanceResult, StateGetDictionaryResult, StateGetEntityResult, StateGetItemResult } from './response'; import { AccountIdentifier, EntityIdentifier, ParamBlockIdentifier, ParamDictionaryIdentifier, PurseIdentifier, RpcRequest } from './request'; import { Deploy, PublicKey, Transaction } from '../types'; export interface ClientPOS { /** * Retrieves the latest auction information, including Validator Bids and Era Validators. * @returns A Promise resolving to the latest auction info. * @rpc state_get_auction_info_v2 (fallback: state_get_auction_info) */ getLatestAuctionInfo(): Promise; /** * Retrieves auction information by block hash, including Validator Bids and Era Validators. * @param blockHash - The hash of the block to retrieve auction info for. * @returns A Promise resolving to the auction info. * @rpc state_get_auction_info_v2 (fallback: state_get_auction_info) */ getAuctionInfoByHash(blockHash: string): Promise; /** * Retrieves auction information by block height, including Validator Bids and Era Validators. * @param height - The height of the block to retrieve auction info for. * @returns A Promise resolving to the auction info. * @rpc state_get_auction_info_v2 (fallback: state_get_auction_info) */ getAuctionInfoByHeight(height: number): Promise; /** * Retrieves the latest auction information (version 1), including Validator Bids and Era Validators. * @returns A Promise resolving to the latest auction info (V1). * @rpc state_get_auction_info */ getLatestAuctionInfoV1(): Promise; /** * Retrieves auction information by block hash (version 1), including Validator Bids and Era Validators. * @param blockHash - The hash of the block to retrieve auction info for. * @returns A Promise resolving to the auction info (V1). * @rpc state_get_auction_info */ getAuctionInfoV1ByHash(blockHash: string): Promise; /** * Retrieves auction information by block height (version 1), including Validator Bids and Era Validators. * @param height - The height of the block to retrieve auction info for. * @returns A Promise resolving to the auction info (V1). * @rpc state_get_auction_info */ getAuctionInfoV1ByHeight(height: number): Promise; /** * Retrieves the latest EraInfo from the network. * Only the last block in an era (switch block) contains an era summary. * This method returns information about the latest block, which may not be the last block in the era. * @returns A Promise resolving to the latest EraInfo. */ getEraInfoLatest(): Promise; /** * Retrieves EraInfo by block height. * Only the last block in an era (switch block) contains an era summary. * @param height - The height of the block to retrieve EraInfo for. * @returns A Promise resolving to the EraInfo. */ getEraInfoByBlockHeight(height: number): Promise; /** * Retrieves EraInfo by block hash. * Only the last block in an era (switch block) contains an era summary. * @param hash - The hash of the block to retrieve EraInfo for. * @returns A Promise resolving to the EraInfo. */ getEraInfoByBlockHash(hash: string): Promise; /** * Retrieves status changes of active validators. * The changes occurred during the EraId contained within the response itself. * A validator may show more than one change in a single era. * @returns A Promise resolving to validator status changes. */ getValidatorChangesInfo(): Promise; } export interface ClientInformational { getLatestBalance(purseURef: string): Promise; getBalanceByStateRootHash(purseURef: string, stateRootHash: string): Promise; getDeploy(hash: string): Promise; getDeployFinalizedApproval(hash: string): Promise; getTransactionByTransactionHash(transactionHash: string): Promise; getTransactionByDeployHash(deployHash: string): Promise; getTransactionFinalizedApprovalByTransactionHash(transactionHash: string): Promise; getTransactionFinalizedApprovalByDeployHash(deployHash: string): Promise; getDictionaryItem(stateRootHash: string | null, uref: string, key: string): Promise; getDictionaryItemByIdentifier(stateRootHash: string | null, identifier: ParamDictionaryIdentifier): Promise; /** * ⚠️ Deprecated: `getStateItem` is deprecated and will be removed in a future release. * * Use `queryLatestGlobalState`, `queryGlobalStateByBlockHash`, * `queryGlobalStateByBlockHeight`, or `queryGlobalStateByStateHash` instead. * * Reason: The newer Global State Query API provides more consistent behavior * across block identifiers and supports both stored values and typed keys. * * @deprecated Use Global State Query methods instead. */ getStateItem(stateRootHash: string | null, key: string, path: string[]): Promise; queryLatestGlobalState(key: string, path: string[]): Promise; queryGlobalStateByBlockHash(blockHash: string, key: string, path: string[]): Promise; queryGlobalStateByBlockHeight(blockHeight: number, key: string, path: string[]): Promise; queryGlobalStateByStateHash(stateRootHash: string | null, key: string, path: string[]): Promise; getAccountInfoByBlockHash(blockHash: string, pub: PublicKey): Promise; getAccountInfoByBlockHeight(blockHeight: number, pub: PublicKey): Promise; getAccountInfo(blockIdentifier: ParamBlockIdentifier | null, accountIdentifier: AccountIdentifier): Promise; getLatestEntity(entityIdentifier: EntityIdentifier): Promise; getEntityByBlockHash(entityIdentifier: EntityIdentifier, hash: string): Promise; getEntityByBlockHeight(entityIdentifier: EntityIdentifier, height: number): Promise; getLatestBlock(): Promise; getBlockByHash(hash: string): Promise; getBlockByHeight(height: number): Promise; getLatestBlockTransfers(): Promise; getBlockTransfersByHash(blockHash: string): Promise; getBlockTransfersByHeight(height: number): Promise; getEraSummaryLatest(): Promise; getEraSummaryByHash(blockHash: string): Promise; getEraSummaryByHeight(height: number): Promise; getStateRootHashLatest(): Promise; getStateRootHashByHash(blockHash: string): Promise; getStateRootHashByHeight(height: number): Promise; getStatus(): Promise; getPeers(): Promise; queryLatestBalance(identifier: PurseIdentifier): Promise; queryBalanceByBlockHeight(purseIdentifier: PurseIdentifier, height: number): Promise; queryBalanceByBlockHash(purseIdentifier: PurseIdentifier, blockHash: string): Promise; queryBalanceByStateRootHash(purseIdentifier: PurseIdentifier, stateRootHash: string): Promise; queryLatestBalanceDetails(purseIdentifier: PurseIdentifier): Promise; queryBalanceDetailsByBlockHeight(purseIdentifier: PurseIdentifier, height: number): Promise; queryBalanceDetailsByBlockHash(purseIdentifier: PurseIdentifier, blockHash: string): Promise; queryBalanceDetailsByStateRootHash(purseIdentifier: PurseIdentifier, stateRootHash: string): Promise; getChainspec(): Promise; getLatestValidatorReward(validator: PublicKey): Promise; getValidatorRewardByEraID(validator: PublicKey, eraID: number): Promise; getValidatorRewardByBlockHash(validator: PublicKey, blockHash: string): Promise; getValidatorRewardByBlockHeight(validator: PublicKey, height: number): Promise; getLatestDelegatorReward(validator: PublicKey, delegator: PublicKey): Promise; getDelegatorRewardByEraID(validator: PublicKey, delegator: PublicKey, eraID: number): Promise; getDelegatorRewardByBlockHash(validator: PublicKey, delegator: PublicKey, blockHash: string): Promise; getDelegatorRewardByBlockHeight(validator: PublicKey, delegator: PublicKey, height: number): Promise; } export interface ClientTransactional { putDeploy(deploy: Deploy): Promise; putTransaction(transaction: Transaction): Promise; } export interface IClient extends ClientPOS, ClientInformational, ClientTransactional { } export interface IHandler { processCall(params: RpcRequest): Promise; }