@exodus/bitcoin-plugin 1.20.0 → 1.21.1

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 CHANGED
@@ -3,6 +3,23 @@
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.21.1](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.21.0...@exodus/bitcoin-plugin@1.21.1) (2024-07-15)
7
+
8
+ **Note:** Version bump only for package @exodus/bitcoin-plugin
9
+
10
+
11
+
12
+
13
+
14
+ ## [1.21.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.20.0...@exodus/bitcoin-plugin@1.21.0) (2024-07-09)
15
+
16
+
17
+ ### Features
18
+
19
+ * **BTC:** add changeAddressType to createAsset config ([#2772](https://github.com/ExodusMovement/assets/issues/2772)) ([d8e38dd](https://github.com/ExodusMovement/assets/commit/d8e38dddfbe59b3e8ff9fc2432049bb512a91c22))
20
+
21
+
22
+
6
23
  ## [1.20.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.19.0...@exodus/bitcoin-plugin@1.20.0) (2024-07-05)
7
24
 
8
25
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exodus/bitcoin-plugin",
3
- "version": "1.20.0",
3
+ "version": "1.21.1",
4
4
  "description": "Exodus bitcoin-plugin",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -24,7 +24,7 @@
24
24
  "@exodus/basic-utils": "^2.1.0",
25
25
  "@exodus/bip32": "^1.1.2",
26
26
  "@exodus/bip44-constants": "^195.0.0",
27
- "@exodus/bitcoin-api": "^2.19.0",
27
+ "@exodus/bitcoin-api": "^2.20.1",
28
28
  "@exodus/bitcoin-lib": "^2.4.0",
29
29
  "@exodus/bitcoin-meta": "^1.0.2",
30
30
  "@exodus/bitcoinjs-lib": "^6.1.5-exodus.2",
@@ -64,5 +64,5 @@
64
64
  "type": "git",
65
65
  "url": "git+https://github.com/ExodusMovement/assets.git"
66
66
  },
67
- "gitHead": "9c3024f69fbda1069a437fb19c43e6f341185c6f"
67
+ "gitHead": "e1354557f99e81651fad1b25a4f72183587324b6"
68
68
  }
@@ -8,6 +8,7 @@ import {
8
8
  createAccountState,
9
9
  createAndBroadcastTXFactory,
10
10
  createBitcoinMonitor,
11
+ createMagicEdenBitcoinMonitor,
11
12
  createBtcLikeAddress,
12
13
  createBtcLikeKeys,
13
14
  getAddressesFromPrivateKeyFactory,
@@ -42,6 +43,11 @@ import { createWeb3API } from './web3'
42
43
 
43
44
  const DEFAULT_TICKS_BETWEEN_BRC20_FETCHES = 30
44
45
 
46
+ const MonitorType = {
47
+ DEFAULT: 'default',
48
+ ME: 'meMonitor',
49
+ }
50
+
45
51
  export const createBitcoinAssetFactory =
46
52
  ({ asset, apiUrl: defaultApiUrl, coinInfoNetwork, isTestnet = false }) =>
47
53
  (
@@ -62,6 +68,8 @@ export const createBitcoinAssetFactory =
62
68
  utxosDescendingOrder = false,
63
69
  omitSupportedPurposes = [],
64
70
  defaultOutputType = 'P2WSH',
71
+ changeAddressType = 'P2WPKH',
72
+ monitorType = MonitorType.DEFAULT,
65
73
  } = Object.create(null),
66
74
  } = Object.create(null)
67
75
  ) => {
@@ -119,6 +127,7 @@ export const createBitcoinAssetFactory =
119
127
  getFeeEstimator,
120
128
  allowUnconfirmedRbfEnabledUtxos,
121
129
  utxosDescendingOrder,
130
+ changeAddressType,
122
131
  })
123
132
 
124
133
  const feeData = bitcoinFeeDataFactory({
@@ -143,6 +152,7 @@ export const createBitcoinAssetFactory =
143
152
  ordinalsEnabled,
144
153
  utxosDescendingOrder,
145
154
  assetClientInterface,
155
+ changeAddressType,
146
156
  })
147
157
 
148
158
  const baseSendTx = createAndBroadcastTXFactory({
@@ -151,6 +161,7 @@ export const createBitcoinAssetFactory =
151
161
  ordinalsEnabled,
152
162
  utxosDescendingOrder,
153
163
  assetClientInterface,
164
+ changeAddressType,
154
165
  })
155
166
  const inscriptionsService = brc20Enabled
156
167
  ? inscriptionsServiceFactory({
@@ -216,7 +227,12 @@ export const createBitcoinAssetFactory =
216
227
  }),
217
228
  })
218
229
 
219
- const accountStateClass = createAccountState({ asset, ordinalsEnabled, brc20Enabled })
230
+ const accountStateClass = createAccountState({
231
+ asset,
232
+ ordinalsEnabled,
233
+ brc20Enabled,
234
+ isMagicEdenFungibleBalancesEnabled: monitorType === MonitorType.ME,
235
+ })
220
236
 
221
237
  const nfts = ordinalsEnabled
222
238
  ? nftsApiFactory({ ordinalChainIndex, asset, assetClientInterface })
@@ -227,7 +243,9 @@ export const createBitcoinAssetFactory =
227
243
  : {}
228
244
 
229
245
  const createHistoryMonitor = (args) => {
230
- const monitor = createBitcoinMonitor({
246
+ const createMonitor =
247
+ monitorType === MonitorType.ME ? createMagicEdenBitcoinMonitor : createBitcoinMonitor
248
+ const monitor = createMonitor({
231
249
  insightClient,
232
250
  ordinalsEnabled,
233
251
  ordinalChainIndex,