@exodus/bitcoin-api 2.5.2 → 2.5.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/bitcoin-api",
3
- "version": "2.5.2",
3
+ "version": "2.5.5",
4
4
  "description": "Exodus bitcoin-api",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -43,5 +43,5 @@
43
43
  "@scure/btc-signer": "^1.1.0",
44
44
  "jest-when": "^3.5.1"
45
45
  },
46
- "gitHead": "6cdfe274e480b791993b5d9336ee42d590473de3"
46
+ "gitHead": "34e27320059c9cb94b150c3206309bfa5ae54671"
47
47
  }
@@ -24,6 +24,7 @@ export class GetFeeResolver {
24
24
  isSendAll,
25
25
  nft, // sending one nft
26
26
  brc20, // sending multiple inscriptions ids (as in sending multiple transfer ordinals)
27
+ receiveAddress,
27
28
  }) => {
28
29
  if (nft) {
29
30
  assert(!amount, 'amount must not be provided when nft is provided!!!')
@@ -43,6 +44,7 @@ export class GetFeeResolver {
43
44
  accountState,
44
45
  txSet,
45
46
  feeData,
47
+ receiveAddress,
46
48
  amount: brc20 ? undefined : amount,
47
49
  customFee,
48
50
  isSendAll,
@@ -78,6 +80,7 @@ export class GetFeeResolver {
78
80
  accountState,
79
81
  txSet,
80
82
  feeData,
83
+ receiveAddress,
81
84
  amount,
82
85
  customFee,
83
86
  isSendAll,
@@ -105,6 +108,7 @@ export class GetFeeResolver {
105
108
  replaceableTxs,
106
109
  amount,
107
110
  feeRate: feePerKB,
111
+ receiveAddress,
108
112
  inscriptionIds,
109
113
  isSendAll: isSendAll,
110
114
  getFeeEstimator: this.#getFeeEstimator,
@@ -482,11 +482,19 @@ export const createAndBroadcastTXFactory = ({
482
482
  ? replaceTx.data.sent.concat([{ address: displayReceiveAddress, amount }])
483
483
  : [{ address: displayReceiveAddress, amount }]
484
484
 
485
- const coinAmount = selfSend
486
- ? maybeToken.currency.ZERO
487
- : isToken
488
- ? tokenAmount.abs().negate()
489
- : totalAmount.abs().negate()
485
+ const calculateCoinAmount = () => {
486
+ if (selfSend) {
487
+ return maybeToken.currency.ZERO
488
+ } else if (isToken) {
489
+ return tokenAmount.abs().negate()
490
+ } else if (nft) {
491
+ return transferOrdinalsUtxos.value.abs().negate()
492
+ } else {
493
+ return totalAmount.abs().negate()
494
+ }
495
+ }
496
+
497
+ const coinAmount = calculateCoinAmount()
490
498
 
491
499
  await assetClientInterface.updateTxLogAndNotify({
492
500
  assetName: maybeToken.name,