Skip to content

[@0xsequence/relayer] prepareTransactions doesn't work with undeployed wallets #309

@sondnm

Description

@sondnm

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions