engineAccount

Creates an account that uses your engine backend wallet for sending transactions and signing messages.

Example

import { engineAccount } from "thirdweb/wallets/engine";
const engineAcc = engineAccount({
engineUrl: "https://engine.thirdweb.com",
authToken: "your-auth-token",
walletAddress: "0x...",
});
// then use the account as you would any other account
const transaction = claimTo({
contract,
to: "0x...",
quantity: 1n,
});
const result = await sendTransaction({
transaction,
account: engineAcc,
});
console.log("Transaction sent:", result.transactionHash);
function engineAccount(options: EngineAccountOptions): Account;

Parameters

The options for the engine account.

Type

let options: {
authToken: string;
chain?: Chain;
engineUrl: string;
walletAddress: string;
};

Returns

let returnType: {
address: Address;
estimateGas?: (tx: PreparedTransaction) => Promise<bigint>;
onTransactionRequested?: (
transaction: PreparedTransaction<any>,
) => Promise<void>;
sendBatchTransaction?: (
txs: Array<SendTransactionOption>,
) => Promise<SendTransactionResult>;
sendRawTransaction?: (
tx: SendRawTransactionOptions,
) => Promise<SendTransactionResult>;
sendTransaction: (
tx: SendTransactionOption,
) => Promise<SendTransactionResult>;
signAuthorization?: (
authorization: AuthorizationRequest,
) => Promise<SignedAuthorization>;
signMessage: ({
message,
}: {
message: SignableMessage;
}) => Promise<Hex>;
signTransaction?: (tx: SerializableTransaction) => Promise<Hex>;
signTypedData: (
_typedData: ox__TypedData.Definition<typedData, primaryType>,
) => Promise<Hex>;
watchAsset?: (asset: WatchAssetParams) => Promise<boolean>;
};

An account that uses your engine backend wallet.