Use the signTransaction method on the Ethereum client to sign a transaction with an Ethereum wallet.

signTransaction: (input: EthereumSignTransactionInputType) => Promise<EthereumSignTransactionResponseType>

Usage

const {signedTransaction, encoding} = await privy.walletApi.ethereum.signTransaction({
    walletId: 'insert-wallet-id',
    transaction: {
        to: '0xE3070d3e4309afA3bC9a6b057685743CF42da77C',
        value: 100000,
        chainId: 8453,
    },
});

Parameters

walletId
string
required

The ID of the wallet to sign the transaction with.

transaction
EthereumTransactionType
required

The transaction to sign.

Returns

signedTransaction
string

The signed transaction.

encoding
'rlp'

The encoding format for the returned signedTransaction. Currently, only 'rlp' is supported for Ethereum.