@fuel-ts/script .Script
Script
provides a typed interface for interacting with the script program type.
Name | Type |
---|---|
TInput | extends any [] |
TOutput | TOutput |
AbstractScript
↳ Script
• new Script<TInput
, TOutput
>(bytecode
, abi
, account
): Script
<TInput
, TOutput
>
Create a new instance of the Script class.
Name | Type |
---|---|
TInput | extends any [] |
TOutput | TOutput |
Name | Type | Description |
---|---|---|
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.
Name | Type |
---|---|
main | InvokeMain <TInput , TOutput > |
• interface: Interface
<JsonAbi
>
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.
Throws
Will throw an error if the script has no configurable constants to be set or if an invalid constant is provided.
Name | Type | Description |
---|---|---|
configurables | Object | An object containing the configurable constants and their values. |
Script
<TInput
, TOutput
>
This instance of the Script
.