@swapkit/wallet-keystore 1.0.0-rc.85 → 1.0.0-rc.87

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
@@ -13,11 +13,12 @@
13
13
  "vite": "5.0.12",
14
14
  "vitest": "1.2.1",
15
15
  "@internal/config": "0.0.2-rc.0",
16
- "@swapkit/helpers": "1.0.0-rc.66",
17
- "@swapkit/toolbox-cosmos": "1.0.0-rc.74",
18
- "@swapkit/toolbox-evm": "1.0.0-rc.72",
19
- "@swapkit/toolbox-utxo": "1.0.0-rc.71",
20
- "@swapkit/types": "1.0.0-rc.34"
16
+ "@swapkit/helpers": "1.0.0-rc.68",
17
+ "@swapkit/toolbox-cosmos": "1.0.0-rc.76",
18
+ "@swapkit/toolbox-evm": "1.0.0-rc.74",
19
+ "@swapkit/toolbox-substrate": "1.0.0-rc.2",
20
+ "@swapkit/toolbox-utxo": "1.0.0-rc.73",
21
+ "@swapkit/types": "1.0.0-rc.36"
21
22
  },
22
23
  "eslintConfig": {
23
24
  "extends": "../../../internal/eslint-config"
@@ -39,11 +40,12 @@
39
40
  "module": "./dist/index.es.js",
40
41
  "name": "@swapkit/wallet-keystore",
41
42
  "peerDependencies": {
42
- "@swapkit/helpers": "1.0.0-rc.66",
43
- "@swapkit/toolbox-cosmos": "1.0.0-rc.74",
44
- "@swapkit/toolbox-evm": "1.0.0-rc.72",
45
- "@swapkit/toolbox-utxo": "1.0.0-rc.71",
46
- "@swapkit/types": "1.0.0-rc.34"
43
+ "@swapkit/helpers": "1.0.0-rc.68",
44
+ "@swapkit/toolbox-cosmos": "1.0.0-rc.76",
45
+ "@swapkit/toolbox-evm": "1.0.0-rc.74",
46
+ "@swapkit/toolbox-substrate": "1.0.0-rc.2",
47
+ "@swapkit/toolbox-utxo": "1.0.0-rc.73",
48
+ "@swapkit/types": "1.0.0-rc.36"
47
49
  },
48
50
  "react-native": "./src/index.ts",
49
51
  "repository": {
@@ -52,7 +54,7 @@
52
54
  },
53
55
  "type": "module",
54
56
  "types": "./dist/index.d.ts",
55
- "version": "1.0.0-rc.85",
57
+ "version": "1.0.0-rc.87",
56
58
  "scripts": {
57
59
  "build": "vite build",
58
60
  "clean": "rm -rf dist vite.config.ts.* .turbo node_modules",
package/src/keystore.ts CHANGED
@@ -5,6 +5,7 @@ import type {
5
5
  ThorchainToolboxType,
6
6
  TransferParams,
7
7
  } from '@swapkit/toolbox-cosmos';
8
+ import { Network } from '@swapkit/toolbox-substrate';
8
9
  import type {
9
10
  Psbt,
10
11
  TransactionType,
@@ -40,7 +41,7 @@ const getWalletMethodsForChain = async ({
40
41
  index,
41
42
  stagenet,
42
43
  }: Params) => {
43
- const derivationPath = `${DerivationPath[chain]}/${index}`;
44
+ const derivationPath = `${DerivationPath[chain] as string}/${index}`;
44
45
 
45
46
  switch (chain) {
46
47
  case Chain.BinanceSmartChain:
@@ -185,6 +186,21 @@ const getWalletMethodsForChain = async ({
185
186
  return { address, walletMethods };
186
187
  }
187
188
 
189
+ case Chain.Polkadot:
190
+ case Chain.Chainflip: {
191
+ const { getToolboxByChain, createKeyring } = await import('@swapkit/toolbox-substrate');
192
+
193
+ const network = Network[chain];
194
+
195
+ const signer = await createKeyring(phrase, network.prefix);
196
+
197
+ const toolbox = await getToolboxByChain(chain, {
198
+ signer,
199
+ });
200
+
201
+ return { address: signer.address, walletMethods: toolbox };
202
+ }
203
+
188
204
  default:
189
205
  throw new Error(`Unsupported chain ${chain}`);
190
206
  }