Skip to content

Conversation

@Overtorment
Copy link
Member

@Overtorment Overtorment commented Nov 21, 2025

Note

Fixes Boltz ARK fee parsing and transaction amount calculation, adds Jest moduleNameMapper for expo/fetch, and updates integration test expectation.

  • Lightning Ark wallet (class/wallets/lightning-ark-wallet.ts):
    • Parse Boltz fees from feesResponseJson.ARK.BTC and log a warning on unexpected responses.
    • In getTransactions(), prefer decoded invoice num_satoshis and adjust amount priority: expectedAmount || decodedValue || request.invoiceAmount || onchainAmount.
  • Testing/Config:
    • jest.config.js: add moduleNameMapper for expo/fetch -> util/expo-fetch.js.
    • Update integration test expected receive amount to 10000 in tests/integration/lightning-ark-wallet.test.ts.

Written by Cursor Bugbot for commit 956d937. This will update automatically on new commits. Configure here.

this._feePercentage = feesResponseJson?.ARK?.BTC?.fees?.percentage ?? 0;
if (!feesResponseJson?.ARK?.BTC?.fees?.percentage) {
console.log('warning: unexpected fees response from boltz:', JSON.stringify(feesResponseJson, null, 2));
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Warning triggers on valid zero fee percentage

The warning check uses a falsy test that incorrectly triggers when percentage is 0, even though zero is a valid fee percentage (as evidenced by the fallback value on line 171). The condition !feesResponseJson?.ARK?.BTC?.fees?.percentage evaluates to true when percentage is 0, causing false warnings. The check needs to test for undefined or null specifically rather than falsy values.

Fix in Cursor Fix in Web

@Overtorment Overtorment merged commit 8757ae0 into master Nov 22, 2025
15 checks passed
@Overtorment Overtorment deleted the fix-ark branch November 22, 2025 13:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants