logo

EthersV5 <> Peanut Transaction Types

The SDK returns an unsigned transaction object with the following fields:
plain text
interface IPeanutUnsignedTransaction { from?: string to?: string data?: string value?: BigInt }
Do you want to convert this to a transaction type that can be passed into an EthersV5 signer to send the transaction? You can use the following utils function:
plain text
const peanutTransaction // get this from any prepare function const convertedTransaction = peanutToEthersV5(peanutTransaction)
Or the other way around:
plain text
const ethersV5transaction const convertedTransaction = ethersV5ToPeanutTx(ethersV5transaction)
Share