⌘K

Icon SunFilledIcon MoonStars

Icon LinkClass: Script<TInput, TOutput>

@fuel-ts/script .Script

Script provides a typed interface for interacting with the script program type.

Icon LinkType parameters

NameType
TInputextends any[]
TOutputTOutput

Icon LinkHierarchy

  • AbstractScript

    Script

Icon LinkConstructors

Icon Linkconstructor

new Script<TInput, TOutput>(bytecode, abi, account): Script <TInput, TOutput>

Create a new instance of the Script class.

Icon LinkType parameters

NameType
TInputextends any[]
TOutputTOutput

Icon LinkParameters

NameTypeDescription
bytecodeBytesLikeThe compiled bytecode of the script.
abiJsonAbiThe ABI interface for the script.
accountAccount The account associated with the script.

Icon LinkReturns

Script <TInput, TOutput>

Icon LinkOverrides

AbstractScript.constructor

Icon LinkDefined in

script.ts:70 Icon Link

Icon LinkProperties

Icon Linkaccount

account: Account

The account associated with the script.

Icon LinkOverrides

AbstractScript.account

Icon LinkDefined in

script.ts:46 Icon Link


Icon Linkbytes

bytes: Uint8Array

The compiled bytecode of the script.

Icon LinkOverrides

AbstractScript.bytes

Icon LinkDefined in

script.ts:36 Icon Link


Icon Linkfunctions

functions: Object

Functions that can be invoked within the script.

Icon LinkType declaration

NameType
mainInvokeMain<TInput, TOutput>

Icon LinkDefined in

script.ts:61 Icon Link


Icon Linkinterface

interface: Interface<JsonAbi>

The ABI interface for the script.

Icon LinkOverrides

AbstractScript.interface

Icon LinkDefined in

script.ts:41 Icon Link


Icon Linkprovider

provider: Provider

The provider used for interacting with the network.

Icon LinkOverrides

AbstractScript.provider

Icon LinkDefined in

script.ts:56 Icon Link


Icon Linkscript

script: ScriptRequest <InputValue<void>[], Result<TOutput>>

The script request object.

Icon LinkDefined in

script.ts:51 Icon Link

Icon LinkMethods

Icon LinksetConfigurableConstants

setConfigurableConstants(configurables): Script <TInput, TOutput>

Set the configurable constants of the script.

Throws

Will throw an error if the script has no configurable constants to be set or if an invalid constant is provided.

Icon LinkParameters

NameTypeDescription
configurablesObjectAn object containing the configurable constants and their values.

Icon LinkReturns

Script <TInput, TOutput>

This instance of the Script.

Icon LinkDefined in

script.ts:91 Icon Link