@fuel-ts/contract v0.97.0 • Docs
ContractFactory
provides utilities for deploying and configuring contracts.
new ContractFactory(
bytecode
,abi
,accountOrProvider
):ContractFactory
Create a ContractFactory instance.
• bytecode: BytesLike
The bytecode of the contract.
• abi: Interface
| JsonAbi
The contract's ABI (Application Binary Interface).
• accountOrProvider: null
| Provider
| Account
= null
An account or provider to be associated with the factory.
packages/contract/src/contract-factory.ts:68
account:
null
|Account
packages/contract/src/contract-factory.ts:59
bytecode:
BytesLike
packages/contract/src/contract-factory.ts:56
interface:
Interface
packages/contract/src/contract-factory.ts:57
provider:
null
|Provider
packages/contract/src/contract-factory.ts:58
connect(
provider
):ContractFactory
Connect the factory to a provider.
• provider: Provider
The provider to be associated with the factory.
A new ContractFactory instance.
packages/contract/src/contract-factory.ts:110
createTransactionRequest(
deployOptions
?):object
Create a transaction request to deploy a contract with the specified options.
• deployOptions?: object
& CreateTransactionRequestLike
& object
Options for deploying the contract.
object
The CreateTransactionRequest object for deploying the contract.
contractId:
string
transactionRequest:
CreateTransactionRequest
packages/contract/src/contract-factory.ts:120
deploy<
TContract
>(deployOptions
):Promise
<DeployContractResult
<TContract
>>
Deploy a contract of any length with the specified options.
• TContract extends Contract
= Contract
• deployOptions: DeployContractOptions
= {}
Options for deploying the contract.
Promise
<DeployContractResult
<TContract
>>
A promise that resolves to the deployed contract instance.
packages/contract/src/contract-factory.ts:195
deployAsBlobTx<
TContract
>(deployOptions
):Promise
<DeployContractResult
<TContract
>>
Chunks and deploys a contract via a loader contract. Suitable for deploying contracts larger than the max contract size.
• TContract extends Contract
= Contract
• deployOptions: DeployContractOptions
= ...
Options for deploying the contract.
Promise
<DeployContractResult
<TContract
>>
A promise that resolves to the deployed contract instance.
packages/contract/src/contract-factory.ts:251
deployAsCreateTx<
TContract
>(deployOptions
):Promise
<DeployContractResult
<TContract
>>
Deploy a contract with the specified options.
• TContract extends Contract
= Contract
• deployOptions: DeployContractOptions
= {}
Options for deploying the contract.
Promise
<DeployContractResult
<TContract
>>
A promise that resolves to the deployed contract instance.
packages/contract/src/contract-factory.ts:213
setConfigurableConstants(
configurableConstants
):void
Set configurable constants of the contract with the specified values.
• configurableConstants
An object containing configurable names and their values.
void