prepareDirectDeployTransaction
Prepares a direct deploy transaction with ABI.
import { prepareDirectDeployTransaction } from "thirdweb/deploys";import { ethereum } from "thirdweb/chains";const tx = prepareDirectDeployTransaction({ client, chain: ethereum, bytecode: "0x...", constructorAbi: { inputs: [{ type: "uint256", name: "value" }], type: "constructor", }, constructorParams: [123],});
function prepareDirectDeployTransaction(options: { bytecode: `0x${string}`; chain: Readonly<(ChainOptions) & ({ rpc: string })>; client: ThirdwebClient; constructorAbi: TConstructor; constructorParams: {[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType<TConstructor["inputs"][key<key>], AbiParameterKind>}[key]} extends readonly Array<AbiParameter> ? (readonly Array<AbiParameter>) & ({[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType<TConstructor["inputs"][key<key>], AbiParameterKind>}[key]}) : readonly Array<unknown> }) : PreparedTransaction<[], AbiFunction, PrepareTransactionOptions>
The options for preparing the transaction.
let options: { bytecode: `0x${string}`; chain: Readonly<(ChainOptions) & ({ rpc: string })>; client: ThirdwebClient; constructorAbi: TConstructor; constructorParams: {[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType<TConstructor["inputs"][key<key>], AbiParameterKind>}[key]} extends readonly Array<AbiParameter> ? (readonly Array<AbiParameter>) & ({[key in string | number | symbol] : {[key in string | number | symbol] : AbiParameterToPrimitiveType<TConstructor["inputs"][key<key>], AbiParameterKind>}[key]}) : readonly Array<unknown> }
[], AbiFunction,>;
The prepared transaction.