@exodus/bitcoin-plugin 1.29.2 → 1.30.0
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/CHANGELOG.md +10 -0
- package/package.json +2 -2
- package/src/create-asset.js +3 -0
- package/src/custom-fees.js +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,16 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [1.30.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.29.2...@exodus/bitcoin-plugin@1.30.0) (2024-12-09)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
* feat: customFees api (#4653)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
6
16
|
## [1.29.2](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.29.1...@exodus/bitcoin-plugin@1.29.2) (2024-12-04)
|
|
7
17
|
|
|
8
18
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/bitcoin-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.30.0",
|
|
4
4
|
"description": "Bitcoin plugin for Exodus SDK powered wallets",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"type": "git",
|
|
59
59
|
"url": "git+https://github.com/ExodusMovement/assets.git"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "4d505ee7d024c0ae961e2d95e6408b0b251a7d89"
|
|
62
62
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -30,6 +30,7 @@ import _coinInfo from 'coininfo'
|
|
|
30
30
|
import assert from 'minimalistic-assert'
|
|
31
31
|
|
|
32
32
|
import { createGetSupportedPurposes, getDefaultAddressPath } from './compatibility-modes.js'
|
|
33
|
+
import { createCustomFeesApi } from './custom-fees.js'
|
|
33
34
|
import { bitcoinFeeDataFactory } from './fee-data.js'
|
|
34
35
|
import BitcoinFeeMonitor from './fee-monitor.js'
|
|
35
36
|
import { brc20BalancesAndFeeAdapterFactory } from './ordinals/brc-20-balances-and-fee-adapter.js'
|
|
@@ -111,6 +112,7 @@ export const createBitcoinAssetFactory =
|
|
|
111
112
|
customTokens: brc20Enabled,
|
|
112
113
|
isTestnet,
|
|
113
114
|
signWithSigner: true,
|
|
115
|
+
supportsCustomFees: true,
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
const getFeeEstimator = getFeeEstimatorFactory({
|
|
@@ -351,6 +353,7 @@ export const createBitcoinAssetFactory =
|
|
|
351
353
|
createFeeMonitor: (args) =>
|
|
352
354
|
new BitcoinFeeMonitor({ ...args, insight: () => insightClient, assetName: asset.name }),
|
|
353
355
|
createHistoryMonitor,
|
|
356
|
+
customFees: createCustomFeesApi({ baseAsset: asset }),
|
|
354
357
|
features,
|
|
355
358
|
getDefaultAddressPath,
|
|
356
359
|
getFeeData: () => feeData,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export const createCustomFeesApi = ({ baseAsset }) => {
|
|
2
|
+
return {
|
|
3
|
+
getRecommendedMinMaxFeeUnitPrices: ({ feeData }) => {
|
|
4
|
+
return {
|
|
5
|
+
recommended: feeData.fastestFee.toBaseNumber(),
|
|
6
|
+
min: feeData.minimumFee.toBaseNumber(),
|
|
7
|
+
max: feeData.fastestFee.toBaseNumber() * 3,
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
unit: 'sat/byte',
|
|
11
|
+
feeUnitPriceToNumber: (feeNumberUnit) => feeNumberUnit.div(1000).toBaseNumber(),
|
|
12
|
+
numberToFeeUnitPrice: (value) => baseAsset.currency.baseUnit(value * 1000),
|
|
13
|
+
isEnabled: ({ feeData }) => Boolean(feeData.rbfEnabled),
|
|
14
|
+
}
|
|
15
|
+
}
|