@fuel-ts/contract v0.94.9 • 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:73
account:
null
|Account
packages/contract/src/contract-factory.ts:64
bytecode:
BytesLike
packages/contract/src/contract-factory.ts:61
interface:
Interface
packages/contract/src/contract-factory.ts:62
provider:
null
|Provider
packages/contract/src/contract-factory.ts:63
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:115
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:125
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:200
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:256
deployAsBlobTxForScript():
Promise
<object
>
Promise
<object
>
blobId:
string
waitForResult: () =>
Promise
<object
>
Promise
<object
>
configurableOffsetDiff:
number
loaderBytecode:
string
packages/contract/src/contract-factory.ts:380
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:218
setConfigurableConstants(
configurableConstants
):void
Set configurable constants of the contract with the specified values.
• configurableConstants
An object containing configurable names and their values.
void