When calling prepareTransactions from base-relayer for the first transactions of an undeployed sequence wallet, this error was thrown
Uncaught Error: Unable to prepare transactions without a defined nonce
My approach was that I firstly signed the txns using wallet.signTransactions and then passed the attributes from the signed Transactions to prepareTransactions.
I found the issue was in these LOC
const nonce = readSequenceNonce(...transactions)
if (!nonce) {
throw new Error('Unable to prepare transactions without a defined nonce')
}
The transaction produced by signTransactions has the nonce of 0 instead of BigNumber { 0x0 } hence this check !nonce is true for both undefined and 0 values.
How can I do differently to use this prepareTransactions for the first txns?