privateKeyToAccount
Get an Account
object from a private key.
import { privateKeyToAccount } from "thirdweb/wallets"; const wallet = privateKeyToAccount({ client, privateKey: "...",});
function privateKeyToAccount(
The options for privateKeyToAccount
Refer to the type PrivateKeyToAccountOptions
let returnType: { address: Address; onTransactionRequested?: ( ) => Promise<void>; sendBatchTransaction?: ( txs: Array<SendTransactionOption>, ) => Promise<SendTransactionResult>; sendRawTransaction?: ( tx: SendRawTransactionOptions, ) => Promise<SendTransactionResult>; sendTransaction: ( tx: SendTransactionOption, ) => Promise<SendTransactionResult>; 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>;};
The Account
object that represents the private key