Represents a Secret Network API endpoint.

Hierarchy

Constructors

Properties

alive: boolean = true

Setting this to false stops retries.

Underlying API client.

blockInterval: number = 250

Time to ping for next block.

chainId?: string

Chain ID.

fees: {
    exec: IFee;
    init: IFee;
    send: IFee;
    upload: IFee;
} = ...

Set permissive fees by default.

Type declaration

identity: ScrtIdentity

Supports multiple authentication methods.

log: Console
url?: string

Connection URL.

gasToken: Native = ...

Smallest unit of native token.

Accessors

  • get [toStringTag](): string
  • Returns string

  • get balance(): Promise<unknown>
  • Returns Promise<unknown>

  • get defaultDenom(): string
  • Returns string

  • get height(): Promise<number>
  • Returns Promise<number>

  • get nextBlock(): Promise<number>
  • Wait for the block height to increment.

    Returns Promise<number>

Methods

  • Parameters

    • contract: {
          address: string;
          codeHash: string;
      }
      • address: string
      • codeHash: string
    • message: Message
    • Optional options: {
          execFee?: IFee;
          execMemo?: string;
          execSend?: ICoin[];
      } & {
          preSimulate?: boolean;
      }

    Returns Promise<TxResponse>

  • Query a contract.

    Type Parameters

    • U

    Parameters

    • contract: {
          address: string;
          codeHash: string;
      }
      • address: string
      • codeHash: string
    • message: Message

    Returns Promise<U>

    the result of the query

  • Call a given program's transaction method.

    Parameters

    • contract: string | Partial<ContractInstance>
    • message: Message
    • Optional options: {
          execFee?: IFee;
          execMemo?: string;
          execSend?: ICoin[];
      }
      • Optional execFee?: IFee
      • Optional execMemo?: string
      • Optional execSend?: ICoin[]

    Returns Promise<unknown>

  • Get the balance in a given native token, of either this connection's identity's address, or of another given address.

    Parameters

    • token: string
    • Optional address: string | {
          address: string;
      }

    Returns Promise<unknown>

  • Get the balance in a native token of a given address, either in this connection's gas token, or in another given token.

    Parameters

    • address: string | {
          address: string;
      }
    • Optional token: string

    Returns Promise<unknown>

  • Get the code id of a given address.

    Parameters

    • contract: string | {
          address: string;
      }

    Returns Promise<string>

  • Get client handles for all contracts that match multiple code IDs

    Parameters

    • ids: Iterable<string>

    Returns Promise<Record<string, Record<string, Contract>>>

  • Type Parameters

    Parameters

    • ids: Iterable<string>
    • Optional $C: C

    Returns Promise<Record<string, Record<string, InstanceType<C>>>>

  • Type Parameters

    Parameters

    • ids: Record<string, C>

    Returns Promise<Record<string, Record<string, InstanceType<C>>>>

  • Parameters

    • contract_address: string

    Returns Promise<string>

  • Returns Promise<{
        accountNumber: number;
        sequence: number;
    }>

  • Instantiate a new program from a code id, label and init message.

    Parameters

    Returns Promise<ContractInstance & {
        address: string;
    }>

    Deploy.ContractInstance with no address populated yet. This will be populated after executing the batch.

    Example

    await agent.instantiate(template.define({ label, initMsg })
    
  • Query a contract.

    Type Parameters

    • Q

    Parameters

    • contract: string | {
          address: string;
      }
    • message: Message

    Returns Promise<Q>

  • Send native tokens to 1 recipient.

    Parameters

    • recipient: string | {
          address?: string;
      }
    • amounts: (ICoin | Amount)[]
    • Optional options: {
          sendFee?: IFee;
          sendMemo?: string;
      }
      • Optional sendFee?: IFee
      • Optional sendMemo?: string

    Returns Promise<unknown>

  • Parameters

    • outputs: never
    • Optional opts: any

    Returns Promise<void>

  • Upload a contract's code, generating a new code id/hash pair.

    Parameters

    • code: string | Uint8Array | URL | Partial<CompiledCode>
    • options: {
          reupload?: boolean;
          uploadFee?: ICoin[] | "auto";
          uploadMemo?: string;
          uploadStore?: UploadStore;
      } = {}
      • Optional reupload?: boolean
      • Optional uploadFee?: ICoin[] | "auto"
      • Optional uploadMemo?: string
      • Optional uploadStore?: UploadStore

    Returns Promise<UploadedCode & {
        chainId: string;
        codeId: string;
    }>

Generated using TypeDoc