Icon HelpCircleForumIcon Link

⌘K

Icon HelpCircleForumIcon Link

@fuel-ts/program v0.97.0 Docs


Icon LinkClass: Contract

Contract provides a way to interact with the contract program type.

Icon LinkImplements

Icon LinkConstructors

Icon Linknew Contract()

Icon InfoCircle

new Contract(id, abi, accountOrProvider): Contract

Creates an instance of the Contract class.

Icon LinkParameters

id: string | AbstractAddress

The contract's address.

abi: JsonAbi | Interface

The contract's ABI (JSON ABI or Interface instance).

accountOrProvider: Provider | Account

The account or provider for interaction.

Icon LinkReturns

Contract

Icon LinkDefined in

contract.ts:47 Icon Link

Icon LinkProperties

Icon Linkaccount

Icon InfoCircle

account: null | Account

The account associated with the contract, if available.

Icon LinkImplementation of

AbstractContract .account

Icon LinkDefined in

contract.ts:33 Icon Link


Icon Linkfunctions

Icon InfoCircle

functions: InvokeFunctions = {}

A collection of functions available on the contract.

Icon LinkDefined in

contract.ts:38 Icon Link


Icon Linkid

Icon InfoCircle

id: AbstractAddress

The unique contract identifier.

Icon LinkImplementation of

AbstractContract .id

Icon LinkDefined in

contract.ts:18 Icon Link


Icon Linkinterface

Icon InfoCircle

interface: Interface

The contract's ABI interface.

Icon LinkImplementation of

AbstractContract .interface

Icon LinkDefined in

contract.ts:28 Icon Link


Icon Linkprovider

Icon InfoCircle

provider: Provider

The provider for interacting with the contract.

Icon LinkImplementation of

AbstractContract .provider

Icon LinkDefined in

contract.ts:23 Icon Link

Icon LinkMethods

Icon LinkbuildFunction()

Icon InfoCircle

buildFunction(func): InvokeFunction <any[], any>

Build a function invocation scope for the provided function fragment.

Icon LinkParameters

func: FunctionFragment

The function fragment to build a scope for.

Icon LinkReturns

InvokeFunction <any[], any>

A function that creates a FunctionInvocationScope.

Icon LinkDefined in

contract.ts:91 Icon Link


Icon LinkgetBalance()

Icon InfoCircle

getBalance(assetId): Promise<BN>

Get the balance for a given asset ID for this contract.

Icon LinkParameters

assetId: BytesLike

The specified asset ID.

Icon LinkReturns

Promise<BN>

The balance of the contract for the specified asset.

Icon LinkDefined in

contract.ts:121 Icon Link


Icon LinkmultiCall()

Icon InfoCircle

multiCall(calls): MultiCallInvocationScope <any>

Create a multi-call invocation scope for the provided function invocation scopes.

Icon LinkParameters

calls: FunctionInvocationScope <any[], any>[]

An array of FunctionInvocationScopes to execute in a batch.

Icon LinkReturns

MultiCallInvocationScope <any>

A MultiCallInvocationScope instance.

Icon LinkDefined in

contract.ts:111 Icon Link