Skip to content

Midnight makeTransfer throws when the optional options argument is omitted #2252

Description

@dvgui

Which Lace surface?

Browser extension (Chrome)

Version

Lace 2.2.0

What happened?

Calling the Midnight connector API with makeTransfer([output]) fails before the confirmation screen:

Cannot read properties of undefined (reading 'sender')

The connector API defines the second options argument as optional. The same transfer works when it is supplied explicitly:

await walletApi.makeTransfer(outputs, { payFees: true });

The extension appends its sender context after the arguments provided by the dApp. When options is omitted, that context reaches makeTransfer as its second argument, but the current implementation expects it as the third argument.

What did you expect to happen?

makeTransfer([output]) should use the default payFees: true behavior and open the transaction confirmation screen.

Steps to reproduce

  1. Connect a Midnight dApp to Lace on Preprod.
  2. Call walletApi.makeTransfer([output]) without an options argument.
  3. Observe the error before transaction confirmation.
  4. Call walletApi.makeTransfer([output], { payFees: true }).
  5. Observe that the confirmation screen opens normally.

Environment

  • Lace browser extension 2.2.0
  • Chromium
  • Midnight Preprod
  • @midnight-ntwrk/dapp-connector-api 4.0.1

Logs, screenshots, or additional context

The API type declares options as optional, documents payFees as true by default, and the package README demonstrates the one-argument call. balanceSealedTransaction and balanceUnsealedTransaction already handle the sender context arriving in the optional-options position.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions