Base class for transaction-bundling Agent for both Secret Network implementations.

Hierarchy

Constructors

Properties

Bundle: (new (agent: Agent) => Bundle) = ...

The Bundle subclass to use.

Type declaration

    • new (agent: Agent): Bundle
    • Bundle class to use when creating a bundle inside a bundle.

      Default

      self

      Parameters

      Returns Bundle

agent: Scrt.Agent

The agent which will sign and/or broadcast the bundle.

callback?: ((bundle: Bundle) => unknown)

Type declaration

    • (bundle: Bundle): unknown
    • Evaluating this defines the contents of the bundle.

      Parameters

      Returns unknown

depth: number = 0

Nested bundles are flattened, this counts the depth.

id: number = 0

Next message id.

msgs: any[] = []

Messages in this bundle, unencrypted.

bundleCounter: number = 0

Accessors

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

  • get address(): undefined | string
  • The address from which transactions are signed and sent.

    Returns undefined | string

  • get balance(): Promise<string>
  • Disallowed in bundle - do it beforehand or afterwards.

    Returns Promise<string>

  • get defaultDenom(): string
  • The default denomination in which the agent operates.

    Returns string

  • get getClient(): (<C>($C: ClientClass<C>, address?: string, codeHash?: string, ...args: unknown[]) => C)
  • Returns (<C>($C: ClientClass<C>, address?: string, codeHash?: string, ...args: unknown[]) => C)

      • <C>($C: ClientClass<C>, address?: string, codeHash?: string, ...args: unknown[]): C
      • Get a client instance for talking to a specific smart contract as this executor.

        Type Parameters

        Parameters

        • $C: ClientClass<C>
        • Optional address: string
        • Optional codeHash: string
        • Rest ...args: unknown[]

        Returns C

  • get getUploader(): (<U>($U: UploaderClass<U>, options?: Partial<U>) => U)
  • Returns (<U>($U: UploaderClass<U>, options?: Partial<U>) => U)

      • <U>($U: UploaderClass<U>, options?: Partial<U>): U
      • Get an uploader instance which performs code uploads and optionally caches them.

        Type Parameters

        Parameters

        Returns U

  • get height(): Promise<number>
  • Disallowed in bundle - do it beforehand or afterwards.

    Returns Promise<number>

  • get name(): string
  • The friendly name of the agent.

    Returns string

  • get nextBlock(): Promise<number>
  • Disallowed in bundle - do it beforehand or afterwards.

    Returns Promise<number>

  • get ready(): Promise<this>
  • Complete the asynchronous initialization of this Agent.

    Returns Promise<this>

Methods

  • This doesnt change over time so it's allowed when building bundles.

    Parameters

    • address: string
    • Optional codeHash: string

    Returns Promise<string>

  • Parameters

    • encryptedMessages: any[]
    • Optional memo: string

    Returns any

  • Disallowed in bundle - do it beforehand or afterwards.

    Parameters

    • denom: string

    Returns Promise<string>

  • This doesnt change over time so it's allowed when building bundles.

    Parameters

    • address: string

    Returns Promise<string>

  • This doesnt change over time so it's allowed when building bundles.

    Parameters

    • address: string | number

    Returns Promise<string>

  • This doesnt change over time so it's allowed when building bundles.

    Parameters

    • address: string

    Returns Promise<string>

  • Add an init message to the bundle.

    Example

    await agent.instantiate(template.define({ label, initMsg })
    

    Returns

    the unmodified input.

    Type Parameters

    Parameters

    Returns Promise<{
        address: string;
        chainId: string;
        codeHash: string;
        initBy: undefined | string;
        label: string;
    }>

  • Add multiple init messages to the bundle.

    Example

    await agent.bundle().wrap(async bundle=>{
    await bundle.instantiateMany(template.instances({
    One: { label, initMsg },
    Two: { label, initMsg },
    }))
    await agent.instantiateMany({
    One: template1.instance({ label, initMsg }),
    Two: template2.instance({ label, initMsg }),
    })
    })

    Returns

    the unmodified inputs.

    Type Parameters

    Parameters

    • inputs: C

    Returns Promise<C>

  • Queries are disallowed in the middle of a bundle because even though the bundle API is structured as multiple function calls, the bundle is ultimately submitted as a single transaction and it doesn't make sense to query state in the middle of that.

    Type Parameters

    • U

    Parameters

    Returns Promise<never>

  • Format the messages for API v1beta1 like secretcli and generate a multisig-ready unsigned transaction bundle; don't execute it, but save it in state/$CHAIN_ID/transactions and output a signing command for it to the console.

    Parameters

    • Optional name: string

    Returns Promise<{
        N: number;
        accountNumber: number;
        name: string;
        sequence: number;
        unsignedTxBody: string;
    }>

  • Uploads are disallowed in the middle of a bundle because it's easy to go over the max request size, and difficult to know what that is in advance.

    Parameters

    • data: Uint8Array
    • Optional meta: Partial<Uploadable>

    Returns Promise<never>

  • Uploads are disallowed in the middle of a bundle because it's easy to go over the max request size, and difficult to know what that is in advance.

    Parameters

    Returns Promise<never>

Generated using TypeDoc