prepareDirectDeployTransaction

Prepares a direct deploy transaction with ABI.

Example

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>

Parameters

The options for preparing the transaction.

Type

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> }

Returns

let returnType: PreparedTransaction<
[],
AbiFunction,
>;
  • The prepared transaction.