import { Delegation, GatewayOwnershipResponse, MixOwnershipResponse, PagedGatewayDelegationsResponse, PagedGatewayResponse, PagedMixDelegationsResponse, PagedMixnodeResponse, StateParams } from "./types"; import { DirectSecp256k1HdWallet, EncodeObject } from "@cosmjs/proto-signing"; import { Coin, StdFee } from "@cosmjs/stargate"; import { BroadcastTxResponse } from "@cosmjs/stargate"; import { ExecuteResult, InstantiateOptions, InstantiateResult, MigrateResult, UploadMeta, UploadResult } from "@cosmjs/cosmwasm-stargate"; export interface INetClient { clientAddress: string; getBalance(address: string, denom: 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; signAndBroadcast(signerAddress: string, messages: readonly EncodeObject[], fee: StdFee, memo?: string): Promise; executeContract(senderAddress: string, contractAddress: string, handleMsg: Record, memo?: string, transferAmount?: readonly Coin[]): Promise; instantiate(senderAddress: string, codeId: number, initMsg: Record, label: string, options?: InstantiateOptions): Promise; sendTokens(senderAddress: string, recipientAddress: string, transferAmount: readonly Coin[], memo?: string): Promise; upload(senderAddress: string, wasmCode: Uint8Array, meta?: UploadMeta, memo?: 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 NetClient implements INetClient { clientAddress: string; private cosmClient; private readonly wallet; private readonly signerOptions; private constructor(); static connect(wallet: DirectSecp256k1HdWallet, url: string, prefix: 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, denom: string): Promise; getStateParams(contractAddress: string): Promise; executeContract(senderAddress: string, contractAddress: string, handleMsg: Record, memo?: string, transferAmount?: readonly Coin[]): Promise; signAndBroadcast(signerAddress: string, messages: readonly EncodeObject[], fee: StdFee, memo?: string): Promise; sendTokens(senderAddress: string, recipientAddress: string, transferAmount: readonly Coin[], memo?: string): Promise; upload(senderAddress: string, wasmCode: Uint8Array, meta?: UploadMeta, memo?: string): Promise; instantiate(senderAddress: string, codeId: number, initMsg: Record, label: string, options?: InstantiateOptions): Promise; migrate(senderAddress: string, contractAddress: string, codeId: number, migrateMsg: Record, memo?: string): Promise; }