Skip to content

@fuel-ts/script v0.94.1Docs


Class: Script<TInput, TOutput>

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

Extends

  • AbstractScript

Type Parameters

Type Parameter
TInput extends any[]
TOutput

Constructors

new Script()

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

Create a new instance of the Script class.

Parameters

ParameterTypeDescription
bytecodeBytesLikeThe compiled bytecode of the script.
abiJsonAbiThe ABI interface for the script.
accountAccountThe account associated with the script.

Returns

Script<TInput, TOutput>

Overrides

AbstractScript.constructor

Defined in

script.ts:70

Properties

PropertyTypeDescriptionOverridesDefined in
accountAccountThe account associated with the script.AbstractScript.accountscript.ts:46
bytesUint8ArrayThe compiled bytecode of the script.AbstractScript.bytesscript.ts:36
functionsobjectFunctions that can be invoked within the script.-script.ts:61
functions.mainInvokeMain<TInput, TOutput>--script.ts:61
interfaceInterfaceThe ABI interface for the script.AbstractScript.interfacescript.ts:41
providerProviderThe provider used for interacting with the network.AbstractScript.providerscript.ts:56
scriptScriptRequest<InputValue<void>[], Result<TOutput>>The script request object.-script.ts:51

Methods

setConfigurableConstants()

setConfigurableConstants(configurables): Script<TInput, TOutput>

Set the configurable constants of the script.

Parameters

ParameterTypeDescription
configurablesobjectAn object containing the configurable constants and their values.

Returns

Script<TInput, TOutput>

This instance 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.

Defined in

script.ts:91