serializeTransaction

Serializes a legacy, EIP-1559, EIP-2930, EIP-4844, or EIP-7702 transaction object.

Example

import { serializeTransaction } from "thirdweb";
const serializedTransaction = serializeTransaction({
transaction: {
to: "0x",
value: 0n,
},
});
function serializeTransaction(
): SerializedTransactionReturnType<transaction, _transactionType>;

Parameters

The serialization options.

Type

let options: {
signature?: Signature;
transaction: TransactionSerializable;
};

Returns

let returnType: SerializedTransactionReturnType<
transaction,
_transactionType
>;

The serialized transaction.