@swapkit/wallet-keystore 1.0.0-rc.13 → 1.0.0-rc.14

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
@@ -19,10 +19,10 @@
19
19
  "vite": "4.4.9",
20
20
  "vitest": "0.34.4",
21
21
  "@internal/config": "0.0.0-internal.0",
22
- "@swapkit/helpers": "1.0.0-rc.7",
23
- "@swapkit/toolbox-cosmos": "1.0.0-rc.9",
24
- "@swapkit/toolbox-evm": "1.0.0-rc.8",
25
- "@swapkit/toolbox-utxo": "1.0.0-rc.8"
22
+ "@swapkit/helpers": "1.0.0-rc.8",
23
+ "@swapkit/toolbox-cosmos": "1.0.0-rc.10",
24
+ "@swapkit/toolbox-evm": "1.0.0-rc.9",
25
+ "@swapkit/toolbox-utxo": "1.0.0-rc.9"
26
26
  },
27
27
  "eslintConfig": {
28
28
  "extends": "../../../internal/eslint-config"
@@ -47,10 +47,10 @@
47
47
  "@scure/bip39": "1.2.1",
48
48
  "ethers": "^6.7.1",
49
49
  "bitcoinjs-lib": "^5.2.0",
50
- "@swapkit/helpers": "1.0.0-rc.7",
51
- "@swapkit/toolbox-cosmos": "1.0.0-rc.9",
52
- "@swapkit/toolbox-evm": "1.0.0-rc.8",
53
- "@swapkit/toolbox-utxo": "1.0.0-rc.8"
50
+ "@swapkit/helpers": "1.0.0-rc.8",
51
+ "@swapkit/toolbox-cosmos": "1.0.0-rc.10",
52
+ "@swapkit/toolbox-evm": "1.0.0-rc.9",
53
+ "@swapkit/toolbox-utxo": "1.0.0-rc.9"
54
54
  },
55
55
  "publishConfig": {
56
56
  "access": "public"
@@ -59,7 +59,7 @@
59
59
  "repository": "https://github.com/thorswap/SwapKit.git",
60
60
  "type": "module",
61
61
  "types": "./dist/index.d.ts",
62
- "version": "1.0.0-rc.13",
62
+ "version": "1.0.0-rc.14",
63
63
  "scripts": {
64
64
  "build": "vite build",
65
65
  "clean": "rm -rf dist vite.config.ts.* .turbo node_modules",
package/src/keystore.ts CHANGED
@@ -10,7 +10,7 @@ import type { Psbt } from 'bitcoinjs-lib';
10
10
 
11
11
  type KeystoreOptions = {
12
12
  ethplorerApiKey?: string;
13
- utxoApiKey?: string;
13
+ blockchairApiKey?: string;
14
14
  covalentApiKey?: string;
15
15
  stagenet?: boolean;
16
16
  };
@@ -30,7 +30,7 @@ const getWalletMethodsForChain = async ({
30
30
  phrase,
31
31
  ethplorerApiKey,
32
32
  covalentApiKey,
33
- utxoApiKey,
33
+ blockchairApiKey,
34
34
  index,
35
35
  stagenet,
36
36
  }: Params) => {
@@ -72,9 +72,8 @@ const getWalletMethodsForChain = async ({
72
72
  }
73
73
 
74
74
  case Chain.BitcoinCash: {
75
- if (!utxoApiKey) throw new Error('UTXO API key not found');
76
75
  const { BCHToolbox } = await import('@swapkit/toolbox-utxo');
77
- const toolbox = BCHToolbox({ rpcUrl, apiKey: utxoApiKey, apiClient: api });
76
+ const toolbox = BCHToolbox({ rpcUrl, apiKey: blockchairApiKey, apiClient: api });
78
77
  const keys = await toolbox.createKeysForPath({ phrase, derivationPath });
79
78
  const address = toolbox.getAddressFromKeys(keys);
80
79
 
@@ -106,7 +105,7 @@ const getWalletMethodsForChain = async ({
106
105
  case Chain.Bitcoin:
107
106
  case Chain.Dogecoin:
108
107
  case Chain.Litecoin: {
109
- const params = { rpcUrl, apiKey: utxoApiKey, apiClient: api };
108
+ const params = { rpcUrl, apiKey: blockchairApiKey, apiClient: api };
110
109
 
111
110
  const { BTCToolbox, LTCToolbox, DOGEToolbox } = await import('@swapkit/toolbox-utxo');
112
111
 
@@ -236,7 +235,7 @@ const connectKeystore =
236
235
  addChain,
237
236
  apis,
238
237
  rpcUrls,
239
- config: { covalentApiKey, ethplorerApiKey, utxoApiKey, stagenet },
238
+ config: { covalentApiKey, ethplorerApiKey, blockchairApiKey, utxoApiKey, stagenet },
240
239
  }: ConnectWalletParams) =>
241
240
  async (chains: Chain[], phrase: string, index: number = 0) => {
242
241
  const promises = chains.map(async (chain) => {
@@ -248,7 +247,7 @@ const connectKeystore =
248
247
  covalentApiKey,
249
248
  ethplorerApiKey,
250
249
  phrase,
251
- utxoApiKey,
250
+ blockchairApiKey: blockchairApiKey || utxoApiKey,
252
251
  stagenet,
253
252
  });
254
253