Callable object: contract. Can build and upload, and instantiate itself.

Type Parameters

Hierarchy

Constructors

Properties

address?: string = undefined

Address of this contract instance. Unique per chain.

agent?: Agent = undefined

The Agent instance that will be used to upload and instantiate the contract.

artifact?: string | URL = undefined

URL to the compiled code.

builder?: Builder = undefined

Build procedure implementation.

builderId?: string = undefined

Builder implementation that produces a Contract from the Source.

chainId?: string = undefined

ID of chain on which this contract is uploaded.

client?: ClientClass<C> = undefined

The Client subclass that exposes the contract's methods.

Default

the base Client class.

codeHash?: string = undefined

Code hash uniquely identifying the compiled code.

codeId?: string = undefined

Code ID representing the identity of the contract's code on a specific chain.

crate?: string = undefined

Name of crate in workspace.

deployment?: Deployment = undefined

The deployment that this template belongs to.

dirty?: boolean = undefined

Whether there were any uncommitted changes at build time.

features?: string[] = undefined

List of crate features to enable during build.

initBy?: string = undefined

Address of agent that performed the init tx.

initMsg?: Into<Message> = undefined

Address of agent that performed the init tx.

initTx?: string = undefined

TXID of transaction that performed the init.

label?: string = undefined

Full label of the instance. Unique for a given Chain.

log: Console
name?: string

Proper name of the instance. Unique within the deployment. If the instance is not part of a Deployment, this is equal to the label. If the instance is part of a Deployment, this is used as storage key. You are encouraged to store application-specific versioning info in this field.

prefix?: string = undefined

Prefix of the instance label. Identifies which Deployment the instance belongs to, if any. Prepended to contract label with a /: PREFIX/NAME...

repository?: string | URL = undefined

URL pointing to Git repository containing the source code.

revision?: string = undefined

Branch/tag pointing to the source commit.

suffix?: string = undefined

Deduplication suffix. Appended to the contract label with a +: ...NAME+SUFFIX. This field has sometimes been used to redeploy an new instance within the same Deployment, taking the place of the old one. TODO: implement this field's semantics: last result of alphanumeric sort of suffixes is "the real one" (see https://stackoverflow.com/a/54427214.

uploadBy?: string = undefined

Address of agent that performed the upload.

uploadTx?: string = undefined

TXID of transaction that performed the upload.

uploader?: Uploader = undefined

Upload procedure implementation.

uploaderId?: string = undefined

Object containing upload logic.

workspace?: string = undefined

Path to root directory of crate or workspace.

Accessors

  • get deployed(): Promise<C>
  • One-shot deployment task. After the first call, deploy redefines it to return the self-same deploying promise. Call deploy again to reset.

    Returns Promise<C>

Methods

  • Deploy the contract, or retrieve it if it's already deployed.

    Returns

    promise of instance of this.client

    Parameters

    Returns Promise<C>

  • Returns

    an instance of this contract's client

    Throws

    tf the contract has no known address.

    Parameters

    • Optional message: string

    Returns C

  • Returns

    true if the specified properties match the properties of this contract.

    Parameters

    Returns boolean

Generated using TypeDoc