Chain instance containing a local mocknet.

Hierarchy

Constructors

Properties

Agent: AgentClass<Mocknet.Agent> = Mocknet.Agent

Agent class.

_height: number = 0

Current block height. Increments when accessing nextBlock

balances: Record<string, string> = {}

Simulation of bank module.

codeIdOfAddress: Record<string, string> = {}

Map of contract address to code id.

codeIdOfCodeHash: Record<string, string> = {}

Map of code hash to code id.

contracts: Record<string, MocknetContract<"0.x" | "1.x">> = {}

Map of addresses to WASM instances.

defaultDenom: string = 'umock'

Native token.

devnet?: DevnetHandle

If this is a devnet, this contains an interface to the devnet container.

id: string

The unique chain id.

labelOfAddress: Record<string, string> = {}

Map of contract address to label.

lastCodeId: number = 0

Increments when uploading to assign sequential code ids.

log: MocknetConsole = ...

Logger.

mode: ChainMode

Whether this is mainnet, public testnet, local devnet, or mocknet.

stopped: boolean = false

Whether this chain is stopped.

uploads: Record<string, {
    codeHash: string;
    codeId: string;
    cwVersion: CW;
    meta?: any;
    module: Module;
    wasm: Uint8Array;
}> = {}

Map of code ID to WASM code blobs.

Type declaration

  • codeHash: string
  • codeId: string
  • cwVersion: CW
  • Optional meta?: any
  • module: Module
  • wasm: Uint8Array
url: string = ''

The API URL to use.

Agent class.

Mode: typeof ChainMode = ChainMode

Shorthand for the ChainMode enum.

variants: ChainRegistry = ...

Async functions that return Chain instances in different modes. Values for FADROMA_CHAIN environment variable. Populated by @fadroma/connect.

Accessors

  • get devMode(): boolean
  • Whether this is a devnet or mocknet.

    Returns boolean

  • get height(): Promise<number>
  • Get the current block height.

    Returns Promise<number>

  • get isDevnet(): boolean
  • Whether this is a devnet.

    Returns boolean

  • get isMainnet(): boolean
  • Whether this is a mainnet.

    Returns boolean

  • get isMocknet(): boolean
  • Whether this is a mocknet.

    Returns boolean

  • get isTestnet(): boolean
  • Whether this is a testnet.

    Returns boolean

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

    Returns Promise<number>

Methods

  • Get the code hash of a smart contract.

    Parameters

    • address: string
    • Optional expectedCodeHash: string

    Returns Promise<string>

  • Parameters

    • sender: string
    • __namedParameters: Partial<Client>
    • msg: Message
    • funds: unknown
    • Optional memo: unknown
    • Optional fee: unknown

    Returns Promise<any>

  • Parameters

    • codeId: string

    Returns {
        codeHash: string;
        codeId: string;
        cwVersion: CW;
        meta?: any;
        module: Module;
        wasm: Uint8Array;
    }

    • codeHash: string
    • codeId: string
    • cwVersion: CW
    • Optional meta?: any
    • module: Module
    • wasm: Uint8Array
  • Parameters

    • cwVersion: CW
    • sender: string
    • messages: any[]

    Returns Promise<void>

  • Parameters

    • wasm: Uint8Array
    • Optional meta: any

    Returns Promise<{
        codeHash: string;
        codeId: string;
        cwVersion: CW;
        meta?: any;
        module: Module;
        wasm: Uint8Array;
    }>

Generated using TypeDoc