EngineWallet.Create

A .NET integration of thirdweb Engine.

Instantiate a Engine with a given private key. This wallet is capable of signing transactions and messages, interacting with smart contracts, and performing other blockchain operations. This wallet type is intended for backend applications only, due to the sensitive nature of private keys.

Usage

// EngineWallet is compatible with IThirdwebWallet and can be used with any SDK method/extension
var engineWallet = await EngineWallet.Create(
client: client,
engineUrl: Environment.GetEnvironmentVariable("ENGINE_URL"),
authToken: Environment.GetEnvironmentVariable("ENGINE_ACCESS_TOKEN"),
walletAddress: Environment.GetEnvironmentVariable("ENGINE_BACKEND_WALLET_ADDRESS"),
timeoutSeconds: null, // no timeout
additionalHeaders: null // can set things like x-account-address if using basic session keys
);
// Simple self transfer
var receipt = await engineWallet.Transfer(chainId: 11155111, toAddress: await engineWallet.GetAddress(), weiAmount: 0);
Console.WriteLine($"Receipt: {receipt}");