@exodus/bitcoin-plugin 1.6.2 → 1.6.4

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.2",
3
+ "version": "1.6.4",
4
4
  "description": "Exodus bitcoin-plugin",
5
5
  "main": "src/index.js",
6
6
  "files": [
@@ -20,12 +20,12 @@
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.2",
24
- "@exodus/bitcoin-lib": "^2.2.9",
25
- "@exodus/models": "^10.1.0",
23
+ "@exodus/bitcoin-api": "^2.6.4",
24
+ "@exodus/bitcoin-lib": "^2.2.11",
25
+ "@exodus/models": "^11.0.0",
26
26
  "@exodus/text-encoding-utf8": "^1.0.2",
27
27
  "bitcoinjs-lib": "^6.1.5",
28
28
  "minimalistic-assert": "^1.0.1"
29
29
  },
30
- "gitHead": "a9f5e8c6f0ac0655cdd2721cf20813f86a373678"
30
+ "gitHead": "33c832c0c550fa4a885aee9b34f7649bfb5fa464"
31
31
  }
@@ -38,6 +38,8 @@ export const createBitcoinAssetFactory = ({ asset, apiUrl, coinInfoNetwork }) =>
38
38
  ordinalChainIndex = DEFAULT_ORDINAL_CHAIN_INDEX,
39
39
  ordinalsEnabled = false,
40
40
  brc20Enabled = false,
41
+ gapLimit = 10,
42
+ refreshGapLimit = 25,
41
43
  overrideCallback = ({ asset }) => asset,
42
44
  } = {}) => {
43
45
  assert(asset, 'asset is required')
@@ -163,6 +165,8 @@ export const createBitcoinAssetFactory = ({ asset, apiUrl, coinInfoNetwork }) =>
163
165
  ordinalsEnabled,
164
166
  ordinalChainIndex,
165
167
  apiUrl,
168
+ gapLimit,
169
+ refreshGapLimit,
166
170
  ...args,
167
171
  })
168
172
  const assetClientInterface = args.assetClientInterface
@@ -4,7 +4,7 @@ import ms from 'ms'
4
4
 
5
5
  const HTTP_POST_TIMEOUT = ms('30s')
6
6
  const DEFAULT_ORDINALS_API_KEY = undefined // ME's api key is included in proxy call
7
- const DEFAULT_BRC_20_URL = 'https://api-mainnet-magiceden.exodus.io/'
7
+ const DEFAULT_BRC_20_URL = 'https://api-mainnet-magiceden.exodus.io'
8
8
 
9
9
  async function improveErrorMessage(err) {
10
10
  if (err.response) {
@@ -7,6 +7,8 @@ const toTxLog = ({ historyItem, baseAsset, asset }) => {
7
7
 
8
8
  const isSend = historyItem.brc20Op === 'send'
9
9
  const isReceive = historyItem.brc20Op === 'receive'
10
+ const isMint = historyItem.brc20Op === 'mint'
11
+ const isTransfer = historyItem.brc20Op === 'transfer'
10
12
 
11
13
  const data = { operation: historyItem.brc20Op }
12
14
  return {
@@ -18,16 +20,17 @@ const toTxLog = ({ historyItem, baseAsset, asset }) => {
18
20
  ...data,
19
21
  sent: [
20
22
  {
21
- address: historyItem.owner, // not right probably
23
+ address: historyItem.transferTo,
22
24
  amount: amount,
23
25
  },
24
26
  ],
25
27
  }
26
28
  : data,
27
- from: isReceive ? [historyItem.owner] : undefined, // from is wrong!!! Unknown the from!!!
28
- addresses: isReceive ? [historyItem.address] : undefined,
29
+ selfSend: isTransfer, // transfer is self inscribed ordinal that hasn't been sent yet
30
+ from: isReceive ? [historyItem.transferFrom] : undefined,
31
+ addresses: isReceive || isMint ? [historyItem.owner] : undefined,
29
32
  dropped: false,
30
- coinAmount: amount,
33
+ coinAmount: isSend ? amount.negate() : amount,
31
34
  coinName: asset.name,
32
35
  feeAmount: baseAsset.currency.defaultUnit(0), // unsure a possible value
33
36
  feeCoinName: baseAsset.name,