import { Coin } from "@cosmjs/stargate"; import { Delegation, GatewayOwnershipResponse, MixOwnershipResponse, PagedGatewayDelegationsResponse, PagedGatewayResponse, PagedMixDelegationsResponse, PagedMixnodeResponse, StateParams } from "./types"; export interface IQueryClient { getBalance(address: string, stakeDenom: string): Promise; getMixNodes(contractAddress: string, limit: number, start_after?: string): Promise; getGateways(contractAddress: string, limit: number, start_after?: string): Promise; getMixDelegations(contractAddress: string, mixIdentity: string, limit: number, start_after?: string): Promise; getMixDelegation(contractAddress: string, mixIdentity: string, delegatorAddress: string): Promise; getGatewayDelegations(contractAddress: string, gatewayIdentity: string, limit: number, start_after?: string): Promise; getGatewayDelegation(contractAddress: string, gatewayIdentity: string, delegatorAddress: string): Promise; ownsMixNode(contractAddress: string, address: string): Promise; ownsGateway(contractAddress: string, address: string): Promise; getStateParams(contractAddress: string): Promise; changeValidator(newUrl: string): Promise; } /** * Takes care of network communication between this code and the validator. * Depends on `SigningCosmWasClient`, which signs all requests using keypairs * derived from on bech32 mnemonics. * * Wraps several methods from CosmWasmSigningClient so we can mock them for * unit testing. */ export default class QueryClient implements IQueryClient { private cosmClient; private constructor(); static connect(url: string): Promise; changeValidator(url: string): Promise; getMixNodes(contractAddress: string, limit: number, start_after?: string): Promise; getGateways(contractAddress: string, limit: number, start_after?: string): Promise; getMixDelegations(contractAddress: string, mixIdentity: string, limit: number, start_after?: string): Promise; getMixDelegation(contractAddress: string, mixIdentity: string, delegatorAddress: string): Promise; getGatewayDelegations(contractAddress: string, gatewayIdentity: string, limit: number, start_after?: string): Promise; getGatewayDelegation(contractAddress: string, gatewayIdentity: string, delegatorAddress: string): Promise; ownsMixNode(contractAddress: string, address: string): Promise; ownsGateway(contractAddress: string, address: string): Promise; getBalance(address: string, stakeDenom: string): Promise; getStateParams(contractAddress: string): Promise; }