@exodus/bitcoin-plugin 1.6.5 → 1.6.7
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-plugin",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.7",
|
|
4
4
|
"description": "Exodus bitcoin-plugin",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"@exodus/asset-lib": "^4.0.0",
|
|
22
22
|
"@exodus/basic-utils": "^2.1.0",
|
|
23
|
-
"@exodus/bitcoin-api": "^2.6.
|
|
23
|
+
"@exodus/bitcoin-api": "^2.6.6",
|
|
24
24
|
"@exodus/bitcoin-lib": "^2.2.11",
|
|
25
25
|
"@exodus/models": "^11.0.0",
|
|
26
26
|
"@exodus/text-encoding-utf8": "^1.0.2",
|
|
27
27
|
"minimalistic-assert": "^1.0.1"
|
|
28
28
|
},
|
|
29
|
-
"gitHead": "
|
|
29
|
+
"gitHead": "b2ed2bffe712facdd412df1a0ebc6a8ac92c4d1c"
|
|
30
30
|
}
|
|
@@ -2,6 +2,8 @@ import { WalletAccount } from '@exodus/models'
|
|
|
2
2
|
|
|
3
3
|
export const ordinals84 = 'ordinals84'
|
|
4
4
|
export const ordinals86 = 'ordinals86'
|
|
5
|
+
export const trezor = 'trezor'
|
|
6
|
+
export const ledger = 'ledger'
|
|
5
7
|
export const xverse49 = 'xverse49'
|
|
6
8
|
|
|
7
9
|
export const getDefaultAddressPath = ({ compatibilityMode }) => {
|
|
@@ -12,8 +14,12 @@ export const getDefaultAddressPath = ({ compatibilityMode }) => {
|
|
|
12
14
|
}
|
|
13
15
|
|
|
14
16
|
export const getSupportedPurposes = ({ compatibilityMode, walletAccount }) => {
|
|
15
|
-
if (walletAccount
|
|
16
|
-
return [84,
|
|
17
|
+
if (walletAccount?.source === WalletAccount.TREZOR_SRC || compatibilityMode === trezor) {
|
|
18
|
+
return [84, 49]
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (compatibilityMode === ledger) {
|
|
22
|
+
return [84, 86, 49, 44]
|
|
17
23
|
}
|
|
18
24
|
|
|
19
25
|
if (compatibilityMode === ordinals84) {
|
package/src/create-asset.js
CHANGED
|
@@ -198,6 +198,12 @@ export const createBitcoinAssetFactory = ({ asset, apiUrl, coinInfoNetwork }) =>
|
|
|
198
198
|
return !!result?.items.length
|
|
199
199
|
}
|
|
200
200
|
|
|
201
|
+
const getBalanceForAddress = async (address) => {
|
|
202
|
+
assert(typeof address === 'string', 'Address is required')
|
|
203
|
+
const { balance } = await insightClient.fetchBalance(address)
|
|
204
|
+
return asset.currency.defaultUnit(balance)
|
|
205
|
+
}
|
|
206
|
+
|
|
201
207
|
const isOrdinalTx = (tx) => {
|
|
202
208
|
const isInscription = tx.data?.isInscriptionSent || tx.data?.isInscriptionReceived
|
|
203
209
|
return ordinalsEnabled && tx.coinName === asset.name && isInscription
|
|
@@ -249,6 +255,7 @@ export const createBitcoinAssetFactory = ({ asset, apiUrl, coinInfoNetwork }) =>
|
|
|
249
255
|
getDefaultAddressPath,
|
|
250
256
|
getFeeData: () => feeData,
|
|
251
257
|
getBalances,
|
|
258
|
+
getBalanceForAddress,
|
|
252
259
|
getKeyIdentifier: createGetKeyIdentifier({
|
|
253
260
|
bip44,
|
|
254
261
|
allowedPurposes,
|