@swapkit/wallet-keystore 1.6.6 → 1.6.8
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/dist/index.js +8 -8
- package/dist/index.js.map +3 -3
- package/package.json +8 -8
- package/src/keystore.ts +16 -10
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
3
|
"@scure/bip39": "1.3.0",
|
|
4
|
-
"@swapkit/helpers": "2.5.
|
|
5
|
-
"@swapkit/toolbox-cosmos": "1.10.
|
|
6
|
-
"@swapkit/toolbox-evm": "1.9.
|
|
7
|
-
"@swapkit/toolbox-radix": "1.2.
|
|
8
|
-
"@swapkit/toolbox-solana": "1.
|
|
9
|
-
"@swapkit/toolbox-substrate": "1.3.
|
|
10
|
-
"@swapkit/toolbox-utxo": "1.3.
|
|
4
|
+
"@swapkit/helpers": "2.5.4",
|
|
5
|
+
"@swapkit/toolbox-cosmos": "1.10.5",
|
|
6
|
+
"@swapkit/toolbox-evm": "1.9.4",
|
|
7
|
+
"@swapkit/toolbox-radix": "1.2.38",
|
|
8
|
+
"@swapkit/toolbox-solana": "1.5.1",
|
|
9
|
+
"@swapkit/toolbox-substrate": "1.3.23",
|
|
10
|
+
"@swapkit/toolbox-utxo": "1.3.5",
|
|
11
11
|
"blakejs": "1.2.1",
|
|
12
12
|
"micro-key-producer": "0.7.1"
|
|
13
13
|
},
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
},
|
|
35
35
|
"type": "module",
|
|
36
36
|
"types": "./src/index.ts",
|
|
37
|
-
"version": "1.6.
|
|
37
|
+
"version": "1.6.8"
|
|
38
38
|
}
|
package/src/keystore.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import {
|
|
2
|
-
type AssetValue,
|
|
3
2
|
Chain,
|
|
4
3
|
type ChainApis,
|
|
5
4
|
type ConnectWalletParams,
|
|
@@ -9,7 +8,6 @@ import {
|
|
|
9
8
|
NetworkDerivationPath,
|
|
10
9
|
UTXOChains,
|
|
11
10
|
WalletOption,
|
|
12
|
-
type WalletTxParams,
|
|
13
11
|
type Witness,
|
|
14
12
|
derivationPathToString,
|
|
15
13
|
filterSupportedChains,
|
|
@@ -39,6 +37,7 @@ type KeystoreOptions = {
|
|
|
39
37
|
ethplorerApiKey?: string;
|
|
40
38
|
blockchairApiKey?: string;
|
|
41
39
|
covalentApiKey?: string;
|
|
40
|
+
swapkitApiKey?: string;
|
|
42
41
|
stagenet?: boolean;
|
|
43
42
|
};
|
|
44
43
|
|
|
@@ -58,6 +57,7 @@ const getWalletMethodsForChain = async ({
|
|
|
58
57
|
ethplorerApiKey,
|
|
59
58
|
covalentApiKey,
|
|
60
59
|
blockchairApiKey,
|
|
60
|
+
swapkitApiKey,
|
|
61
61
|
derivationPath,
|
|
62
62
|
stagenet,
|
|
63
63
|
}: Params) => {
|
|
@@ -153,7 +153,7 @@ const getWalletMethodsForChain = async ({
|
|
|
153
153
|
|
|
154
154
|
const api = apis?.[chain];
|
|
155
155
|
|
|
156
|
-
const toolbox = getToolboxByChain(chain)({ server: api, stagenet });
|
|
156
|
+
const toolbox = getToolboxByChain(chain)({ server: api, stagenet, swapkitApiKey });
|
|
157
157
|
const address = await toolbox.getAddressFromMnemonic(phrase);
|
|
158
158
|
const signer = await toolbox.getSigner(phrase);
|
|
159
159
|
|
|
@@ -205,16 +205,14 @@ const getWalletMethodsForChain = async ({
|
|
|
205
205
|
}
|
|
206
206
|
|
|
207
207
|
case Chain.Solana: {
|
|
208
|
-
const { SOLToolbox } = await import("@swapkit/toolbox-solana");
|
|
209
|
-
const
|
|
210
|
-
const
|
|
208
|
+
const { SOLToolbox, createKeysForPath } = await import("@swapkit/toolbox-solana");
|
|
209
|
+
const signer = createKeysForPath({ phrase, derivationPath });
|
|
210
|
+
const toolbox = SOLToolbox({ rpcUrl, signer });
|
|
211
211
|
|
|
212
212
|
return {
|
|
213
|
-
address: toolbox.getAddressFromKeys(
|
|
213
|
+
address: toolbox.getAddressFromKeys(signer),
|
|
214
214
|
walletMethods: {
|
|
215
215
|
...toolbox,
|
|
216
|
-
transfer: (params: WalletTxParams & { assetValue: AssetValue }) =>
|
|
217
|
-
toolbox.transfer({ ...params, fromKeypair: keypair }),
|
|
218
216
|
},
|
|
219
217
|
};
|
|
220
218
|
}
|
|
@@ -228,7 +226,14 @@ function connectKeystore({
|
|
|
228
226
|
addChain,
|
|
229
227
|
apis,
|
|
230
228
|
rpcUrls,
|
|
231
|
-
config: {
|
|
229
|
+
config: {
|
|
230
|
+
thorswapApiKey,
|
|
231
|
+
covalentApiKey,
|
|
232
|
+
ethplorerApiKey,
|
|
233
|
+
blockchairApiKey,
|
|
234
|
+
stagenet,
|
|
235
|
+
swapkitApiKey,
|
|
236
|
+
},
|
|
232
237
|
}: ConnectWalletParams) {
|
|
233
238
|
return async function connectKeystore(
|
|
234
239
|
chains: Chain[],
|
|
@@ -274,6 +279,7 @@ function connectKeystore({
|
|
|
274
279
|
ethplorerApiKey,
|
|
275
280
|
phrase,
|
|
276
281
|
blockchairApiKey,
|
|
282
|
+
swapkitApiKey,
|
|
277
283
|
stagenet,
|
|
278
284
|
});
|
|
279
285
|
|