Class: Script<TInput, TOutput>
@fuel-ts/script.Script
Script
provides a typed interface for interacting with the script program type.
Type parameters
Name | Type |
---|---|
TInput | extends any [] |
TOutput | TOutput |
Hierarchy
AbstractScript
↳
Script
Constructors
constructor
• new Script<TInput
, TOutput
>(bytecode
, abi
, account
): Script
<TInput
, TOutput
>
Create a new instance of the Script class.
Type parameters
Name | Type |
---|---|
TInput | extends any [] |
TOutput | TOutput |
Parameters
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. |
Returns
Script
<TInput
, TOutput
>
Overrides
AbstractScript.constructor
Defined in
Properties
account
• account: Account
The account associated with the script.
Overrides
AbstractScript.account
Defined in
bytes
• bytes: Uint8Array
The compiled bytecode of the script.
Overrides
AbstractScript.bytes
Defined in
functions
• functions: Object
Functions that can be invoked within the script.
Type declaration
Name | Type |
---|---|
main | InvokeMain <TInput , TOutput > |
Defined in
interface
• interface: Interface
<JsonAbi
>
The ABI interface for the script.
Overrides
AbstractScript.interface
Defined in
provider
• provider: Provider
The provider used for interacting with the network.
Overrides
AbstractScript.provider
Defined in
script
• script: ScriptRequest
<InputValue
<void
>[], Result
<TOutput
>>
The script request object.
Defined in
Methods
setConfigurableConstants
▸ 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.
Parameters
Name | Type | Description |
---|---|---|
configurables | Object | An object containing the configurable constants and their values. |
Returns
Script
<TInput
, TOutput
>
This instance of the Script
.