@fuel-ts/script v0.94.2 • Docs
Script
provides a typed interface for interacting with the script program type.
AbstractScript
• TInput extends any
[]
• TOutput
new Script<
TInput
,TOutput
>(bytecode
,abi
,account
):Script
<TInput
,TOutput
>
Create a new instance of the Script class.
• bytecode: BytesLike
The compiled bytecode of the script.
• abi: JsonAbi
The ABI interface for the script.
• account: Account
The account associated with the script.
Script
<TInput
, TOutput
>
AbstractScript.constructor
account:
Account
The account associated with the script.
AbstractScript.account
bytes:
Uint8Array
The compiled bytecode of the script.
AbstractScript.bytes
functions:
object
Functions that can be invoked within the script.
main:
InvokeMain
<TInput
,TOutput
>
interface:
Interface
The ABI interface for the script.
AbstractScript.interface
provider:
Provider
The provider used for interacting with the network.
AbstractScript.provider
script:
ScriptRequest
<InputValue
<void
>[],Result
<TOutput
>>
The script request object.
setConfigurableConstants(
configurables
):Script
<TInput
,TOutput
>
Set the configurable constants of the script.
• configurables
An object containing the configurable constants and their values.
Script
<TInput
, TOutput
>
This instance of the Script
.
Will throw an error if the script has no configurable constants to be set or if an invalid constant is provided.