@exodus/bitcoin-plugin 1.21.1 → 1.22.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 +19 -0
- package/package.json +5 -5
- package/src/create-asset.js +28 -18
- package/src/index.js +1 -0
- package/src/ordinals/brc-20-balances-and-fee-adapter.js +4 -3
- package/src/ordinals/brc-20-client.js +1 -1
- package/src/ordinals/brc-20-utils.js +1 -1
- package/src/ordinals/create-brc-20-command.js +1 -0
- package/src/ordinals/get-inscription-addresses.js +2 -1
- package/src/ordinals/inscriptions-service.js +6 -6
- package/src/ordinals/nfts.js +3 -2
- package/src/ordinals/reload-brc20-token-balances.js +2 -1
- package/src/web3/createSimulateTransactions.js +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
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.22.1](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.22.0...@exodus/bitcoin-plugin@1.22.1) (2024-07-26)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* btc like lint ([#2978](https://github.com/ExodusMovement/assets/issues/2978)) ([cfb0b91](https://github.com/ExodusMovement/assets/commit/cfb0b914b469728349c39673d268ad58b9f90f6f))
|
|
12
|
+
* disable multi address scanning in `multiAddressMode` is false ([#2984](https://github.com/ExodusMovement/assets/issues/2984)) ([37bab79](https://github.com/ExodusMovement/assets/commit/37bab79ec9bcb8e08850402dd5f71df823eddd3b))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
## [1.22.0](https://github.com/ExodusMovement/assets/compare/@exodus/bitcoin-plugin@1.21.1...@exodus/bitcoin-plugin@1.22.0) (2024-07-19)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **BTC:** create batch tx from array of recipients ([#2881](https://github.com/ExodusMovement/assets/issues/2881)) ([440d5d5](https://github.com/ExodusMovement/assets/commit/440d5d5879c902ef10ff7644c92a5092bb868872))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
## [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
26
|
|
|
8
27
|
**Note:** Version bump only for package @exodus/bitcoin-plugin
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/bitcoin-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.22.1",
|
|
4
4
|
"description": "Exodus bitcoin-plugin",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"access": "restricted"
|
|
16
16
|
},
|
|
17
17
|
"scripts": {
|
|
18
|
-
"test": "run -T jest",
|
|
18
|
+
"test": "run -T exodus-test --jest --esbuild",
|
|
19
19
|
"lint": "run -T eslint .",
|
|
20
20
|
"lint:fix": "yarn lint --fix"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@exodus/asset-lib": "^4.1.0",
|
|
24
24
|
"@exodus/basic-utils": "^2.1.0",
|
|
25
|
-
"@exodus/bip32": "^
|
|
25
|
+
"@exodus/bip32": "^3.1.0",
|
|
26
26
|
"@exodus/bip44-constants": "^195.0.0",
|
|
27
|
-
"@exodus/bitcoin-api": "^2.
|
|
27
|
+
"@exodus/bitcoin-api": "^2.21.2",
|
|
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": "
|
|
67
|
+
"gitHead": "139dd9f87ac7299463ce64a4a53f1daa4542fd2c"
|
|
68
68
|
}
|
package/src/create-asset.js
CHANGED
|
@@ -1,44 +1,46 @@
|
|
|
1
|
-
import _coinInfo from 'coininfo'
|
|
2
|
-
import * as bitcoinjsLib from '@exodus/bitcoinjs-lib'
|
|
3
|
-
import { createGetKeyIdentifier } from '@exodus/bitcoin-lib'
|
|
4
|
-
import { Tx } from '@exodus/models'
|
|
5
|
-
|
|
6
1
|
import bip44Constants from '@exodus/bip44-constants/by-ticker'
|
|
7
2
|
import {
|
|
8
3
|
createAccountState,
|
|
9
4
|
createAndBroadcastTXFactory,
|
|
10
5
|
createBitcoinMonitor,
|
|
11
|
-
createMagicEdenBitcoinMonitor,
|
|
12
6
|
createBtcLikeAddress,
|
|
13
7
|
createBtcLikeKeys,
|
|
8
|
+
createEncodeMultisigContract,
|
|
9
|
+
createMagicEdenBitcoinMonitor,
|
|
10
|
+
createPrepareForSigning,
|
|
11
|
+
createPsbtToUnsignedTx,
|
|
14
12
|
getAddressesFromPrivateKeyFactory,
|
|
15
13
|
getBalancesFactory,
|
|
16
14
|
getBtcVersions,
|
|
15
|
+
getCreateBatchTransaction,
|
|
17
16
|
getFeeEstimatorFactory,
|
|
18
17
|
GetFeeResolver,
|
|
18
|
+
getPrepareSendTransaction,
|
|
19
19
|
InsightAPIClient,
|
|
20
20
|
isValidInscription,
|
|
21
21
|
moveFundsFactory,
|
|
22
|
-
signTxFactory,
|
|
23
22
|
signHardwareFactory,
|
|
24
23
|
signMessage,
|
|
25
|
-
|
|
26
|
-
createEncodeMultisigContract,
|
|
27
|
-
createPrepareForSigning,
|
|
24
|
+
signTxFactory,
|
|
28
25
|
} from '@exodus/bitcoin-api'
|
|
26
|
+
import { parseCurrency } from '@exodus/bitcoin-api/src/fee/fee-utils'
|
|
27
|
+
import { createGetKeyIdentifier } from '@exodus/bitcoin-lib'
|
|
28
|
+
import * as bitcoinjsLib from '@exodus/bitcoinjs-lib'
|
|
29
|
+
import { Tx } from '@exodus/models'
|
|
30
|
+
import _coinInfo from 'coininfo'
|
|
31
|
+
import assert from 'minimalistic-assert'
|
|
32
|
+
|
|
33
|
+
import { createGetSupportedPurposes, getDefaultAddressPath } from './compatibility-modes'
|
|
29
34
|
import { bitcoinFeeDataFactory } from './fee-data'
|
|
30
35
|
import BitcoinFeeMonitor from './fee-monitor'
|
|
31
|
-
import assert from 'minimalistic-assert'
|
|
32
|
-
import { DEFAULT_ORDINAL_CHAIN_INDEX } from './ordinals/ordinals-constants'
|
|
33
|
-
import { reloadBrc20TokenBalances } from './ordinals/reload-brc20-token-balances'
|
|
34
|
-
import { createTokenFactory } from './ordinals/create-token-factory'
|
|
35
|
-
import { brc20ApiClientFactory, DEFAULT_BRC_20_URL } from './ordinals/brc-20-client'
|
|
36
|
-
import { nftsApiFactory } from './ordinals/nfts'
|
|
37
36
|
import { brc20BalancesAndFeeAdapterFactory } from './ordinals/brc-20-balances-and-fee-adapter'
|
|
38
|
-
import {
|
|
37
|
+
import { brc20ApiClientFactory, DEFAULT_BRC_20_URL } from './ordinals/brc-20-client'
|
|
38
|
+
import { createTokenFactory } from './ordinals/create-token-factory'
|
|
39
39
|
import { inscriptionsServiceFactory } from './ordinals/inscriptions-service'
|
|
40
|
+
import { nftsApiFactory } from './ordinals/nfts'
|
|
41
|
+
import { DEFAULT_ORDINAL_CHAIN_INDEX } from './ordinals/ordinals-constants'
|
|
42
|
+
import { reloadBrc20TokenBalances } from './ordinals/reload-brc20-token-balances'
|
|
40
43
|
import { tickInscriptionIdIndexerFactory } from './ordinals/tick-inscription-id-indexer'
|
|
41
|
-
import { createGetSupportedPurposes, getDefaultAddressPath } from './compatibility-modes'
|
|
42
44
|
import { createWeb3API } from './web3'
|
|
43
45
|
|
|
44
46
|
const DEFAULT_TICKS_BETWEEN_BRC20_FETCHES = 30
|
|
@@ -342,7 +344,13 @@ export const createBitcoinAssetFactory =
|
|
|
342
344
|
.filter(txLogFilter)
|
|
343
345
|
}
|
|
344
346
|
|
|
347
|
+
const createBatchTx = getCreateBatchTransaction({
|
|
348
|
+
getFeeEstimator,
|
|
349
|
+
assetClientInterface,
|
|
350
|
+
changeAddressType,
|
|
351
|
+
})
|
|
345
352
|
const encodeMultisigContract = createEncodeMultisigContract({ network: coinInfo.toBitcoinJS() })
|
|
353
|
+
const psbtToUnsignedTx = createPsbtToUnsignedTx({ assetClientInterface, assetName: asset.name })
|
|
346
354
|
|
|
347
355
|
const api = {
|
|
348
356
|
getActivityTxs,
|
|
@@ -390,7 +398,9 @@ export const createBitcoinAssetFactory =
|
|
|
390
398
|
getSpendableBalance,
|
|
391
399
|
inscriptions: inscriptionsService,
|
|
392
400
|
prepareSendTx: baseGetPrepareSendTx,
|
|
401
|
+
createBatchTx,
|
|
393
402
|
encodeMultisigContract,
|
|
403
|
+
psbtToUnsignedTx,
|
|
394
404
|
}
|
|
395
405
|
return overrideCallback({ asset: fullAsset })
|
|
396
406
|
}
|
package/src/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { getOrdinalsUtxos } from '@exodus/bitcoin-api'
|
|
2
2
|
import { BumpType } from '@exodus/bitcoin-lib'
|
|
3
|
+
import { Address, UtxoCollection } from '@exodus/models'
|
|
4
|
+
import assert from 'minimalistic-assert'
|
|
5
|
+
|
|
3
6
|
import { brc20Utils } from './brc-20-utils'
|
|
4
7
|
import { createBrc20Command } from './create-brc-20-command'
|
|
5
|
-
import { Address, UtxoCollection } from '@exodus/models'
|
|
6
|
-
import { getOrdinalsUtxos } from '@exodus/bitcoin-api'
|
|
7
8
|
|
|
8
9
|
export const brc20BalancesAndFeeAdapterFactory = ({
|
|
9
10
|
assetClientInterface,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ecc, getECPair, getOrdinalsUtxos, toAsyncSigner, toXOnly } from '@exodus/bitcoin-api'
|
|
2
|
+
import { getTxSequence } from '@exodus/bitcoin-lib'
|
|
2
3
|
import * as bitcoinjsLib from '@exodus/bitcoinjs-lib'
|
|
3
|
-
import {
|
|
4
|
+
import { witnessStackToScriptWitness } from '@exodus/bitcoinjs-lib/src/psbt/psbtutils'
|
|
4
5
|
import { randomBytes } from '@exodus/crypto/randomBytes'
|
|
6
|
+
import { TextEncoder } from '@exodus/text-encoding-utf8'
|
|
7
|
+
import assert from 'minimalistic-assert'
|
|
5
8
|
import * as secp256k1 from 'tiny-secp256k1'
|
|
6
|
-
import { DEFAULT_BRC20_POSTAGE, DEFAULT_ORDINAL_POSTAGE } from './ordinals-constants'
|
|
7
9
|
|
|
8
|
-
import {
|
|
9
|
-
import { getTxSequence } from '@exodus/bitcoin-lib'
|
|
10
|
-
import { ecc, getECPair, getOrdinalsUtxos, toAsyncSigner, toXOnly } from '@exodus/bitcoin-api'
|
|
10
|
+
import { DEFAULT_BRC20_POSTAGE, DEFAULT_ORDINAL_POSTAGE } from './ordinals-constants'
|
|
11
11
|
|
|
12
12
|
const encoder = new TextEncoder()
|
|
13
13
|
export function createInscriptionScript({ xOnlyPublicKey, inscription }) {
|
package/src/ordinals/nfts.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { getOrdinalAddress, getOrdinalsUtxos, getUtxos, partitionUtxos } from '@exodus/bitcoin-api'
|
|
2
|
+
import { isEqual, uniq } from 'lodash'
|
|
1
3
|
import assert from 'minimalistic-assert'
|
|
4
|
+
|
|
2
5
|
import { getInscriptionAddresses } from './get-inscription-addresses'
|
|
3
6
|
import { isNftBrc20 } from './nft-utils'
|
|
4
|
-
import { getOrdinalAddress, getOrdinalsUtxos, getUtxos, partitionUtxos } from '@exodus/bitcoin-api'
|
|
5
|
-
import { uniq, isEqual } from 'lodash'
|
|
6
7
|
|
|
7
8
|
export const nftsApiFactory = ({ ordinalChainIndex, asset, assetClientInterface: aci }) => {
|
|
8
9
|
assert(asset, 'asset is required')
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { groupBy, mapValues } from 'lodash'
|
|
1
2
|
import assert from 'minimalistic-assert'
|
|
3
|
+
|
|
2
4
|
import { getInscriptionAddresses } from './get-inscription-addresses'
|
|
3
|
-
import { groupBy, mapValues } from 'lodash'
|
|
4
5
|
|
|
5
6
|
const toTxLog = ({ historyItem, baseAsset, asset }) => {
|
|
6
7
|
const amount = asset.currency.defaultUnit(historyItem.brc20Amt || 0)
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { createSimulateTransactions as createSimulateBitcoinTransactions } from '@exodus/web3-bitcoin-utils'
|
|
2
1
|
import { Psbt } from '@exodus/bitcoinjs-lib'
|
|
3
|
-
|
|
2
|
+
import { createSimulateTransactions as createSimulateBitcoinTransactions } from '@exodus/web3-bitcoin-utils'
|
|
4
3
|
import assert from 'minimalistic-assert'
|
|
5
4
|
|
|
6
5
|
// This function accepts either a list of transactions created by a wallet (unsignedTxs) or a web3 transaction (transactionBuffers).
|