getInitializeTransaction

Prepares the initialization transaction for a contract deployment

function getInitializeTransaction(options: {
account: Account;
chain: Readonly<ChainOptions & { rpc: string }>;
client: ThirdwebClient;
deployMetadata: FetchDeployMetadataResult;
implementationContract: Readonly<ContractOptions<[]>>;
initializeParams?: Record<string, unknown>;
modules?: Array<{
deployMetadata: FetchDeployMetadataResult;
initializeParams?: Record<string, unknown>;
}>;
}): Promise<
>;

Parameters

The options for generating the initialize transaction

Type

let options: {
account: Account;
chain: Readonly<ChainOptions & { rpc: string }>;
client: ThirdwebClient;
deployMetadata: FetchDeployMetadataResult;
implementationContract: Readonly<ContractOptions<[]>>;
initializeParams?: Record<string, unknown>;
modules?: Array<{
deployMetadata: FetchDeployMetadataResult;
initializeParams?: Record<string, unknown>;
}>;
};

Returns

let returnType: Readonly<options> & {
__contract?: ThirdwebContract<abi>;
__preparedMethod?: () => Promise<PreparedMethod<abiFn>>;
};

The prepared transaction for contract initialization