Skip to main content
Version: Next

Class: Contract

Not used at the moment

Implements​

Indexable​

β–ͺ [key: string]: AsyncContractFunction | any

Constructors​

constructor​

β€’ new Contract(abi, address, providerOrAccount?)

Contract class to handle contract methods

Parameters​

NameTypeDefault valueDescription
abiAbiundefinedAbi of the contract object
addressstringundefined(optional) - address to connect to
providerOrAccountProviderInterface | AccountInterfacedefaultProvider(optional) - Provider or Account to attach to

Defined in​

src/contract/default.ts:142

Properties​

abi​

β€’ abi: Abi

Implementation of​

ContractInterface.abi

Defined in​

src/contract/default.ts:113


address​

β€’ address: string

Implementation of​

ContractInterface.address

Defined in​

src/contract/default.ts:115


providerOrAccount​

β€’ providerOrAccount: ProviderInterface | AccountInterface

Implementation of​

ContractInterface.providerOrAccount

Defined in​

src/contract/default.ts:117


deployTransactionHash​

β€’ Optional deployTransactionHash: string

Implementation of​

ContractInterface.deployTransactionHash

Defined in​

src/contract/default.ts:119


structs​

β€’ Protected Readonly structs: Object

Index signature​

β–ͺ [name: string]: StructAbi

Defined in​

src/contract/default.ts:121


functions​

β€’ Readonly functions: Object

Index signature​

β–ͺ [name: string]: AsyncContractFunction

Implementation of​

ContractInterface.functions

Defined in​

src/contract/default.ts:123


callStatic​

β€’ Readonly callStatic: Object

Index signature​

β–ͺ [name: string]: AsyncContractFunction

Implementation of​

ContractInterface.callStatic

Defined in​

src/contract/default.ts:125


populateTransaction​

β€’ Readonly populateTransaction: Object

Index signature​

β–ͺ [name: string]: ContractFunction

Implementation of​

ContractInterface.populateTransaction

Defined in​

src/contract/default.ts:127


estimateFee​

β€’ Readonly estimateFee: Object

Index signature​

β–ͺ [name: string]: ContractFunction

Implementation of​

ContractInterface.estimateFee

Defined in​

src/contract/default.ts:129


callData​

β€’ Private callData: CallData

Defined in​

src/contract/default.ts:133

Methods​

attach​

β–Έ attach(address): void

Saves the address of the contract deployed on network that will be used for interaction

Parameters​

NameTypeDescription
addressstringaddress of the contract

Returns​

void

Implementation of​

ContractInterface.attach

Defined in​

src/contract/default.ts:196


connect​

β–Έ connect(providerOrAccount): void

Attaches to new Provider or Account

Parameters​

NameTypeDescription
providerOrAccountProviderInterface | AccountInterfacenew Provider or Account to attach to

Returns​

void

Implementation of​

ContractInterface.connect

Defined in​

src/contract/default.ts:200


deployed​

β–Έ deployed(): Promise<Contract>

Resolves when contract is deployed on the network or when no deployment transaction is found

Throws

When deployment fails

Returns​

Promise<Contract>

Promise that resolves when contract is deployed on the network or when no deployment transaction is found

Implementation of​

ContractInterface.deployed

Defined in​

src/contract/default.ts:204


call​

β–Έ call(method, args?, Β«destructuredΒ»?): Promise<Result>

Calls a method on a contract

Parameters​

NameTypeDefault valueDescription
methodstringundefinedname of the method
argsArgsOrCalldata[]Array of the arguments for the call
Β«destructuredΒ»CallOptions{}optional blockIdentifier

Returns​

Promise<Result>

Result of the call as an array with key value pars

Implementation of​

ContractInterface.call

Defined in​

src/contract/default.ts:212


invoke​

β–Έ invoke(method, args?, Β«destructuredΒ»?): Promise<InvokeFunctionResponse>

Invokes a method on a contract

Parameters​

NameTypeDefault valueDescription
methodstringundefinedname of the method
argsArgsOrCalldata[]Array of the arguments for the invoke or Calldata
Β«destructuredΒ»InvokeOptions{}

Returns​

Promise<InvokeFunctionResponse>

Add Transaction Response

Implementation of​

ContractInterface.invoke

Defined in​

src/contract/default.ts:254


estimate​

β–Έ estimate(method, args?): Promise<EstimateFeeResponse>

Estimates a method on a contract

Parameters​

NameTypeDefault valueDescription
methodstringundefinedname of the method
argsArgsOrCalldata[]Array of the arguments for the call or Calldata

Returns​

Promise<EstimateFeeResponse>

Implementation of​

ContractInterface.estimate

Defined in​

src/contract/default.ts:298


populate​

β–Έ populate(method, args?): Call

Calls a method on a contract

Parameters​

NameTypeDefault valueDescription
methodstringundefinedname of the method
argsArgsOrCalldata[]Array of the arguments for the call or Calldata

Returns​

Call

Invocation object

Implementation of​

ContractInterface.populate

Defined in​

src/contract/default.ts:312