@swapkit/wallets 4.0.0-beta.54 → 4.0.0-beta.56

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.
Files changed (294) hide show
  1. package/dist/{chunk-e674mh4n.js → chunk-mcrgqfr9.js} +3 -3
  2. package/dist/{chunk-e674mh4n.js.map → chunk-mcrgqfr9.js.map} +1 -1
  3. package/dist/{chunk-mvbb9fwb.js → chunk-sbf0f2p4.js} +2 -2
  4. package/dist/{chunk-p2ca0j1v.js → chunk-yqaz2d25.js} +3 -3
  5. package/dist/{chunk-p2ca0j1v.js.map → chunk-yqaz2d25.js.map} +1 -1
  6. package/dist/src/bitget/index.cjs +2 -2
  7. package/dist/src/bitget/index.cjs.map +3 -3
  8. package/dist/src/bitget/index.js +2 -2
  9. package/dist/src/bitget/index.js.map +3 -3
  10. package/dist/src/coinbase/index.cjs +2 -2
  11. package/dist/src/coinbase/index.cjs.map +3 -3
  12. package/dist/src/coinbase/index.js +2 -2
  13. package/dist/src/coinbase/index.js.map +3 -3
  14. package/dist/src/cosmostation/index.cjs +2 -2
  15. package/dist/src/cosmostation/index.cjs.map +3 -3
  16. package/dist/src/cosmostation/index.js +2 -2
  17. package/dist/src/cosmostation/index.js.map +3 -3
  18. package/dist/src/ctrl/index.cjs +2 -2
  19. package/dist/src/ctrl/index.cjs.map +3 -3
  20. package/dist/src/ctrl/index.js +2 -2
  21. package/dist/src/ctrl/index.js.map +3 -3
  22. package/dist/src/evm-extensions/index.cjs +2 -2
  23. package/dist/src/evm-extensions/index.cjs.map +3 -3
  24. package/dist/src/evm-extensions/index.js +2 -2
  25. package/dist/src/evm-extensions/index.js.map +3 -3
  26. package/dist/src/exodus/index.cjs +2 -2
  27. package/dist/src/exodus/index.cjs.map +3 -3
  28. package/dist/src/exodus/index.js +2 -2
  29. package/dist/src/exodus/index.js.map +3 -3
  30. package/dist/src/index.cjs +2 -2
  31. package/dist/src/index.cjs.map +5 -3
  32. package/dist/src/index.js +2 -2
  33. package/dist/src/index.js.map +5 -3
  34. package/dist/src/keepkey-bex/index.cjs +2 -2
  35. package/dist/src/keepkey-bex/index.cjs.map +3 -3
  36. package/dist/src/keepkey-bex/index.js +2 -2
  37. package/dist/src/keepkey-bex/index.js.map +3 -3
  38. package/dist/src/keepkey.cjs +4 -0
  39. package/dist/src/keepkey.cjs.map +10 -0
  40. package/dist/src/keepkey.js +4 -0
  41. package/dist/src/keepkey.js.map +10 -0
  42. package/dist/src/keplr/index.cjs +2 -2
  43. package/dist/src/keplr/index.cjs.map +3 -3
  44. package/dist/src/keplr/index.js +2 -2
  45. package/dist/src/keplr/index.js.map +3 -3
  46. package/dist/src/keystore.cjs +4 -0
  47. package/dist/src/keystore.cjs.map +10 -0
  48. package/dist/src/keystore.js +4 -0
  49. package/dist/src/keystore.js.map +10 -0
  50. package/dist/src/ledger.cjs +4 -0
  51. package/dist/src/ledger.cjs.map +10 -0
  52. package/dist/src/ledger.js +4 -0
  53. package/dist/src/ledger.js.map +10 -0
  54. package/dist/src/okx/index.cjs +2 -2
  55. package/dist/src/okx/index.cjs.map +4 -4
  56. package/dist/src/okx/index.js +2 -2
  57. package/dist/src/okx/index.js.map +4 -4
  58. package/dist/src/onekey/index.cjs +2 -2
  59. package/dist/src/onekey/index.cjs.map +3 -3
  60. package/dist/src/onekey/index.js +2 -2
  61. package/dist/src/onekey/index.js.map +3 -3
  62. package/dist/src/phantom/index.cjs +2 -2
  63. package/dist/src/phantom/index.cjs.map +3 -3
  64. package/dist/src/phantom/index.js +2 -2
  65. package/dist/src/phantom/index.js.map +3 -3
  66. package/dist/src/polkadotjs/index.cjs +2 -2
  67. package/dist/src/polkadotjs/index.cjs.map +3 -3
  68. package/dist/src/polkadotjs/index.js +2 -2
  69. package/dist/src/polkadotjs/index.js.map +3 -3
  70. package/dist/src/radix/index.cjs +2 -2
  71. package/dist/src/radix/index.cjs.map +3 -3
  72. package/dist/src/radix/index.js +2 -2
  73. package/dist/src/radix/index.js.map +3 -3
  74. package/dist/src/talisman/index.cjs +2 -2
  75. package/dist/src/talisman/index.cjs.map +3 -3
  76. package/dist/src/talisman/index.js +2 -2
  77. package/dist/src/talisman/index.js.map +3 -3
  78. package/dist/src/trezor.cjs +4 -0
  79. package/dist/src/trezor.cjs.map +10 -0
  80. package/dist/src/trezor.js +4 -0
  81. package/dist/src/trezor.js.map +10 -0
  82. package/dist/src/tronlink/index.cjs +4 -0
  83. package/dist/src/tronlink/index.cjs.map +11 -0
  84. package/dist/src/tronlink/index.js +4 -0
  85. package/dist/src/tronlink/index.js.map +11 -0
  86. package/dist/src/vultisig/index.cjs +2 -2
  87. package/dist/src/vultisig/index.cjs.map +3 -3
  88. package/dist/src/vultisig/index.js +2 -2
  89. package/dist/src/vultisig/index.js.map +3 -3
  90. package/dist/src/walletconnect/index.cjs +2 -2
  91. package/dist/src/walletconnect/index.cjs.map +3 -3
  92. package/dist/src/walletconnect/index.js +2 -2
  93. package/dist/src/walletconnect/index.js.map +3 -3
  94. package/dist/src/xaman/index.cjs +2 -2
  95. package/dist/src/xaman/index.cjs.map +5 -5
  96. package/dist/src/xaman/index.js +2 -2
  97. package/dist/src/xaman/index.js.map +5 -5
  98. package/dist/types/bitget/helpers.d.ts +330 -0
  99. package/dist/types/bitget/helpers.d.ts.map +1 -0
  100. package/dist/types/bitget/index.d.ts +11 -0
  101. package/dist/types/bitget/index.d.ts.map +1 -0
  102. package/dist/types/coinbase/index.d.ts +11 -0
  103. package/dist/types/coinbase/index.d.ts.map +1 -0
  104. package/dist/types/coinbase/signer.d.ts +91 -0
  105. package/dist/types/coinbase/signer.d.ts.map +1 -0
  106. package/dist/types/cosmostation/index.d.ts +21 -0
  107. package/dist/types/cosmostation/index.d.ts.map +1 -0
  108. package/dist/types/ctrl/index.d.ts +11 -0
  109. package/dist/types/ctrl/index.d.ts.map +1 -0
  110. package/dist/types/ctrl/walletHelpers.d.ts +24 -0
  111. package/dist/types/ctrl/walletHelpers.d.ts.map +1 -0
  112. package/dist/types/evm-extensions/index.d.ts +101 -0
  113. package/dist/types/evm-extensions/index.d.ts.map +1 -0
  114. package/{src/evm-extensions/types.ts → dist/types/evm-extensions/types.d.ts} +11 -13
  115. package/dist/types/evm-extensions/types.d.ts.map +1 -0
  116. package/dist/types/exodus/index.d.ts +14 -0
  117. package/dist/types/exodus/index.d.ts.map +1 -0
  118. package/dist/types/helpers/near.d.ts +57 -0
  119. package/dist/types/helpers/near.d.ts.map +1 -0
  120. package/dist/types/index.d.ts +4 -0
  121. package/dist/types/index.d.ts.map +1 -0
  122. package/dist/types/keepkey-bex/index.d.ts +11 -0
  123. package/dist/types/keepkey-bex/index.d.ts.map +1 -0
  124. package/dist/types/keepkey-bex/walletHelpers.d.ts +45 -0
  125. package/dist/types/keepkey-bex/walletHelpers.d.ts.map +1 -0
  126. package/dist/types/keepkey.d.ts +2 -0
  127. package/dist/types/keepkey.d.ts.map +1 -0
  128. package/dist/types/keplr/chainRegistry.d.ts +4 -0
  129. package/dist/types/keplr/chainRegistry.d.ts.map +1 -0
  130. package/dist/types/keplr/index.d.ts +11 -0
  131. package/dist/types/keplr/index.d.ts.map +1 -0
  132. package/dist/types/keystore.d.ts +2 -0
  133. package/dist/types/keystore.d.ts.map +1 -0
  134. package/dist/types/ledger.d.ts +2 -0
  135. package/dist/types/ledger.d.ts.map +1 -0
  136. package/dist/types/okx/helpers.d.ts +227 -0
  137. package/dist/types/okx/helpers.d.ts.map +1 -0
  138. package/dist/types/okx/index.d.ts +11 -0
  139. package/dist/types/okx/index.d.ts.map +1 -0
  140. package/dist/types/okx/types.d.ts +104 -0
  141. package/dist/types/okx/types.d.ts.map +1 -0
  142. package/dist/types/onekey/evmSigner.d.ts +29 -0
  143. package/dist/types/onekey/evmSigner.d.ts.map +1 -0
  144. package/dist/types/onekey/index.d.ts +11 -0
  145. package/dist/types/onekey/index.d.ts.map +1 -0
  146. package/dist/types/phantom/index.d.ts +12 -0
  147. package/dist/types/phantom/index.d.ts.map +1 -0
  148. package/dist/types/polkadotjs/index.d.ts +11 -0
  149. package/dist/types/polkadotjs/index.d.ts.map +1 -0
  150. package/dist/types/radix/index.d.ts +11 -0
  151. package/dist/types/radix/index.d.ts.map +1 -0
  152. package/dist/types/talisman/index.d.ts +11 -0
  153. package/dist/types/talisman/index.d.ts.map +1 -0
  154. package/dist/types/trezor.d.ts +2 -0
  155. package/dist/types/trezor.d.ts.map +1 -0
  156. package/dist/types/tronlink/helpers.d.ts +24 -0
  157. package/dist/types/tronlink/helpers.d.ts.map +1 -0
  158. package/dist/types/tronlink/index.d.ts +11 -0
  159. package/dist/types/tronlink/index.d.ts.map +1 -0
  160. package/dist/types/tronlink/types.d.ts +59 -0
  161. package/dist/types/tronlink/types.d.ts.map +1 -0
  162. package/dist/types/types.d.ts +249 -0
  163. package/dist/types/types.d.ts.map +1 -0
  164. package/dist/types/utils.d.ts +4 -0
  165. package/dist/types/utils.d.ts.map +1 -0
  166. package/dist/types/vultisig/index.d.ts +11 -0
  167. package/dist/types/vultisig/index.d.ts.map +1 -0
  168. package/dist/types/vultisig/walletHelpers.d.ts +34 -0
  169. package/dist/types/vultisig/walletHelpers.d.ts.map +1 -0
  170. package/dist/types/walletconnect/constants.d.ts +85 -0
  171. package/dist/types/walletconnect/constants.d.ts.map +1 -0
  172. package/dist/types/walletconnect/evmSigner.d.ts +25 -0
  173. package/dist/types/walletconnect/evmSigner.d.ts.map +1 -0
  174. package/dist/types/walletconnect/helpers.d.ts +4 -0
  175. package/dist/types/walletconnect/helpers.d.ts.map +1 -0
  176. package/dist/types/walletconnect/index.d.ts +22 -0
  177. package/dist/types/walletconnect/index.d.ts.map +1 -0
  178. package/dist/types/walletconnect/namespaces.d.ts +7 -0
  179. package/dist/types/walletconnect/namespaces.d.ts.map +1 -0
  180. package/dist/types/walletconnect/types.d.ts +7 -0
  181. package/dist/types/walletconnect/types.d.ts.map +1 -0
  182. package/dist/types/xaman/helpers.d.ts +54 -0
  183. package/dist/types/xaman/helpers.d.ts.map +1 -0
  184. package/dist/types/xaman/index.d.ts +14 -0
  185. package/dist/types/xaman/index.d.ts.map +1 -0
  186. package/dist/types/xaman/types.d.ts +24 -0
  187. package/dist/types/xaman/types.d.ts.map +1 -0
  188. package/dist/types/xaman/walletMethods.d.ts +16 -0
  189. package/dist/types/xaman/walletMethods.d.ts.map +1 -0
  190. package/package.json +53 -74
  191. package/dist/chunk-2aa1w78q.js +0 -4
  192. package/dist/chunk-2aa1w78q.js.map +0 -10
  193. package/dist/chunk-31bmhjxx.js +0 -4
  194. package/dist/chunk-31bmhjxx.js.map +0 -10
  195. package/dist/chunk-3etn0w20.js +0 -4
  196. package/dist/chunk-3etn0w20.js.map +0 -10
  197. package/dist/chunk-bk58smyr.js +0 -4
  198. package/dist/chunk-bk58smyr.js.map +0 -10
  199. package/dist/chunk-etm8zfkk.js +0 -4
  200. package/dist/chunk-etm8zfkk.js.map +0 -10
  201. package/dist/chunk-h7myvxxm.js +0 -5
  202. package/dist/chunk-h7myvxxm.js.map +0 -10
  203. package/dist/chunk-htvthkj1.js +0 -5
  204. package/dist/chunk-htvthkj1.js.map +0 -10
  205. package/dist/chunk-nfas79hz.js +0 -4
  206. package/dist/chunk-nfas79hz.js.map +0 -10
  207. package/dist/src/keepkey/index.cjs +0 -4
  208. package/dist/src/keepkey/index.cjs.map +0 -15
  209. package/dist/src/keepkey/index.js +0 -4
  210. package/dist/src/keepkey/index.js.map +0 -15
  211. package/dist/src/keystore/index.cjs +0 -4
  212. package/dist/src/keystore/index.cjs.map +0 -11
  213. package/dist/src/keystore/index.js +0 -4
  214. package/dist/src/keystore/index.js.map +0 -11
  215. package/dist/src/ledger/index.cjs +0 -5
  216. package/dist/src/ledger/index.cjs.map +0 -25
  217. package/dist/src/ledger/index.js +0 -5
  218. package/dist/src/ledger/index.js.map +0 -25
  219. package/dist/src/trezor/index.cjs +0 -4
  220. package/dist/src/trezor/index.cjs.map +0 -10
  221. package/dist/src/trezor/index.js +0 -4
  222. package/dist/src/trezor/index.js.map +0 -10
  223. package/src/bitget/helpers.ts +0 -167
  224. package/src/bitget/index.ts +0 -34
  225. package/src/coinbase/index.ts +0 -52
  226. package/src/coinbase/signer.ts +0 -83
  227. package/src/cosmostation/index.ts +0 -142
  228. package/src/ctrl/index.ts +0 -248
  229. package/src/ctrl/walletHelpers.ts +0 -297
  230. package/src/evm-extensions/index.ts +0 -134
  231. package/src/exodus/index.ts +0 -179
  232. package/src/helpers/near-browser-provider.d.ts +0 -286
  233. package/src/helpers/near.ts +0 -206
  234. package/src/index.ts +0 -2
  235. package/src/keepkey/chains/cosmos.ts +0 -78
  236. package/src/keepkey/chains/evm.ts +0 -125
  237. package/src/keepkey/chains/mayachain.ts +0 -123
  238. package/src/keepkey/chains/ripple.ts +0 -118
  239. package/src/keepkey/chains/thorchain.ts +0 -118
  240. package/src/keepkey/chains/utxo.ts +0 -147
  241. package/src/keepkey/coins.ts +0 -71
  242. package/src/keepkey/index.ts +0 -153
  243. package/src/keepkey-bex/index.ts +0 -162
  244. package/src/keepkey-bex/walletHelpers.ts +0 -255
  245. package/src/keplr/chainRegistry.ts +0 -211
  246. package/src/keplr/index.ts +0 -55
  247. package/src/keystore/helpers.ts +0 -102
  248. package/src/keystore/index.ts +0 -73
  249. package/src/ledger/clients/cosmos.ts +0 -102
  250. package/src/ledger/clients/evm.ts +0 -183
  251. package/src/ledger/clients/near.ts +0 -86
  252. package/src/ledger/clients/thorchain/common.ts +0 -117
  253. package/src/ledger/clients/thorchain/helpers.ts +0 -149
  254. package/src/ledger/clients/thorchain/index.ts +0 -94
  255. package/src/ledger/clients/thorchain/lib.ts +0 -300
  256. package/src/ledger/clients/thorchain/utils.ts +0 -76
  257. package/src/ledger/clients/tron.ts +0 -92
  258. package/src/ledger/clients/utxo.ts +0 -148
  259. package/src/ledger/clients/xrp.ts +0 -66
  260. package/src/ledger/cosmosTypes.ts +0 -101
  261. package/src/ledger/helpers/getLedgerAddress.ts +0 -67
  262. package/src/ledger/helpers/getLedgerClient.ts +0 -124
  263. package/src/ledger/helpers/getLedgerTransport.ts +0 -80
  264. package/src/ledger/helpers/index.ts +0 -3
  265. package/src/ledger/index.ts +0 -311
  266. package/src/ledger/interfaces/CosmosLedgerInterface.ts +0 -65
  267. package/src/ledger/types.ts +0 -45
  268. package/src/okx/helpers.ts +0 -181
  269. package/src/okx/index.ts +0 -43
  270. package/src/okx/types.ts +0 -117
  271. package/src/onekey/evmSigner.ts +0 -133
  272. package/src/onekey/index.ts +0 -213
  273. package/src/phantom/index.ts +0 -126
  274. package/src/polkadotjs/index.ts +0 -67
  275. package/src/radix/index.ts +0 -202
  276. package/src/talisman/index.ts +0 -130
  277. package/src/trezor/evmSigner.ts +0 -197
  278. package/src/trezor/index.ts +0 -260
  279. package/src/types.ts +0 -280
  280. package/src/utils.ts +0 -60
  281. package/src/vultisig/index.ts +0 -199
  282. package/src/vultisig/walletHelpers.ts +0 -359
  283. package/src/walletconnect/constants.ts +0 -104
  284. package/src/walletconnect/evmSigner.ts +0 -147
  285. package/src/walletconnect/helpers.ts +0 -77
  286. package/src/walletconnect/index.ts +0 -460
  287. package/src/walletconnect/namespaces.ts +0 -87
  288. package/src/walletconnect/types.ts +0 -6
  289. package/src/xaman/README.md +0 -66
  290. package/src/xaman/helpers.ts +0 -59
  291. package/src/xaman/index.ts +0 -79
  292. package/src/xaman/types.ts +0 -26
  293. package/src/xaman/walletMethods.ts +0 -126
  294. /package/dist/{chunk-mvbb9fwb.js.map → chunk-sbf0f2p4.js.map} +0 -0
package/src/types.ts DELETED
@@ -1,280 +0,0 @@
1
- import type {
2
- AminoSignResponse,
3
- OfflineAminoSigner,
4
- StdSignDoc,
5
- StdSignature,
6
- } from "@cosmjs/amino";
7
- import type { Keplr } from "@keplr-wallet/types";
8
- import { type EthereumWindowProvider, WalletOption } from "@swapkit/helpers";
9
- import type { SolanaProvider } from "@swapkit/toolboxes/solana";
10
- import type { BrowserProvider, Eip1193Provider } from "ethers";
11
-
12
- import type { SubstrateInjectedExtension } from "@swapkit/toolboxes/substrate";
13
- import type { bitgetWallet } from "./bitget";
14
- import type { coinbaseWallet } from "./coinbase";
15
- import type { cosmostationWallet } from "./cosmostation";
16
- import type { ctrlWallet } from "./ctrl";
17
- import type { evmWallet } from "./evm-extensions";
18
- import type { exodusWallet } from "./exodus";
19
- import type { NearBrowserWalletProvider } from "./helpers/near";
20
- import type { keepkeyWallet } from "./keepkey";
21
- import type { keepkeyBexWallet } from "./keepkey-bex";
22
- import type { keplrWallet } from "./keplr";
23
- import type { keystoreWallet } from "./keystore";
24
- import type { ledgerWallet } from "./ledger";
25
- import type { okxWallet } from "./okx";
26
- import type { onekeyWallet } from "./onekey";
27
- import type { phantomWallet } from "./phantom";
28
- import type { polkadotWallet } from "./polkadotjs";
29
- import type { radixWallet } from "./radix";
30
- import type { talismanWallet } from "./talisman";
31
- import type { trezorWallet } from "./trezor";
32
- import type { vultisigWallet } from "./vultisig";
33
- import type { walletconnectWallet } from "./walletconnect";
34
- import type { xamanWallet } from "./xaman";
35
-
36
- export type Callback = (
37
- error: Error | null,
38
- result?: any, // https://github.com/vultisig/vultisig-windows/blob/baeb3e8099a0003404f9664c43b0183c26029041/clients/extension/src/utils/interfaces.ts#L11
39
- ) => void;
40
-
41
- export type VultisigCosmosProvider = {
42
- request(
43
- request: { method: string; params?: any[] | Record<string, any> },
44
- callback?: Callback,
45
- ): Promise<any>;
46
- };
47
-
48
- export type SKWallets = {
49
- [WalletOption.BITGET]: typeof bitgetWallet;
50
- [WalletOption.BRAVE]: typeof evmWallet;
51
- [WalletOption.COINBASE_MOBILE]: typeof coinbaseWallet;
52
- [WalletOption.COINBASE_WEB]: typeof evmWallet;
53
- [WalletOption.COSMOSTATION]: typeof cosmostationWallet;
54
- [WalletOption.CTRL]: typeof ctrlWallet;
55
- [WalletOption.EIP6963]: typeof evmWallet;
56
- [WalletOption.EXODUS]: typeof exodusWallet;
57
- [WalletOption.KEEPKEY]: typeof keepkeyWallet;
58
- [WalletOption.KEEPKEY_BEX]: typeof keepkeyBexWallet;
59
- [WalletOption.KEPLR]: typeof keplrWallet;
60
- [WalletOption.KEYSTORE]: typeof keystoreWallet;
61
- [WalletOption.LEAP]: typeof keplrWallet;
62
- [WalletOption.LEDGER]: typeof ledgerWallet;
63
- [WalletOption.LEDGER_LIVE]: typeof ledgerWallet;
64
- [WalletOption.METAMASK]: typeof evmWallet;
65
- [WalletOption.OKX]: typeof okxWallet;
66
- [WalletOption.OKX_MOBILE]: typeof evmWallet;
67
- [WalletOption.ONEKEY]: typeof onekeyWallet;
68
- [WalletOption.PHANTOM]: typeof phantomWallet;
69
- [WalletOption.POLKADOT_JS]: typeof polkadotWallet;
70
- [WalletOption.RADIX_WALLET]: typeof radixWallet;
71
- [WalletOption.TALISMAN]: typeof talismanWallet;
72
- [WalletOption.TREZOR]: typeof trezorWallet;
73
- [WalletOption.TRUSTWALLET_WEB]: typeof evmWallet;
74
- [WalletOption.VULTISIG]: typeof vultisigWallet;
75
- [WalletOption.WALLETCONNECT]: typeof walletconnectWallet;
76
- [WalletOption.XAMAN]: typeof xamanWallet;
77
- };
78
-
79
- export type SKConnectWallets = SKWallets[keyof SKWallets];
80
-
81
- export type SKWalletsSupportedChains = {
82
- [WalletOption.BITGET]: typeof bitgetWallet.connectBitget.supportedChains;
83
- [WalletOption.BRAVE]: typeof evmWallet.connectEVMWallet.supportedChains;
84
- [WalletOption.COINBASE_MOBILE]: typeof coinbaseWallet.connectCoinbaseWallet.supportedChains;
85
- [WalletOption.COINBASE_WEB]: typeof evmWallet.connectEVMWallet.supportedChains;
86
- [WalletOption.COSMOSTATION]: typeof cosmostationWallet.connectCosmostation.supportedChains;
87
- [WalletOption.CTRL]: typeof ctrlWallet.connectCtrl.supportedChains;
88
- [WalletOption.EIP6963]: typeof evmWallet.connectEVMWallet.supportedChains;
89
- [WalletOption.EXODUS]: typeof exodusWallet.connectExodusWallet.supportedChains;
90
- [WalletOption.KEEPKEY]: typeof keepkeyWallet.connectKeepkey.supportedChains;
91
- [WalletOption.KEEPKEY_BEX]: typeof keepkeyBexWallet.connectKeepkeyBex.supportedChains;
92
- [WalletOption.KEPLR]: typeof keplrWallet.connectKeplr.supportedChains;
93
- [WalletOption.KEYSTORE]: typeof keystoreWallet.connectKeystore.supportedChains;
94
- [WalletOption.LEAP]: typeof keplrWallet.connectKeplr.supportedChains;
95
- [WalletOption.LEDGER]: typeof ledgerWallet.connectLedger.supportedChains;
96
- [WalletOption.LEDGER_LIVE]: typeof ledgerWallet.connectLedger.supportedChains;
97
- [WalletOption.METAMASK]: typeof evmWallet.connectEVMWallet.supportedChains;
98
- [WalletOption.OKX]: typeof okxWallet.connectOkx.supportedChains;
99
- [WalletOption.OKX_MOBILE]: typeof evmWallet.connectEVMWallet.supportedChains;
100
- [WalletOption.ONEKEY]: typeof onekeyWallet.connectOnekeyWallet.supportedChains;
101
- [WalletOption.PHANTOM]: typeof phantomWallet.connectPhantom.supportedChains;
102
- [WalletOption.POLKADOT_JS]: typeof polkadotWallet.connectPolkadotJs.supportedChains;
103
- [WalletOption.RADIX_WALLET]: typeof radixWallet.connectRadixWallet.supportedChains;
104
- [WalletOption.TALISMAN]: typeof talismanWallet.connectTalisman.supportedChains;
105
- [WalletOption.TREZOR]: typeof trezorWallet.connectTrezor.supportedChains;
106
- [WalletOption.TRUSTWALLET_WEB]: typeof evmWallet.connectEVMWallet.supportedChains;
107
- [WalletOption.VULTISIG]: typeof vultisigWallet.connectVultisig.supportedChains;
108
- [WalletOption.WALLETCONNECT]: typeof walletconnectWallet.connectWalletconnect.supportedChains;
109
- [WalletOption.XAMAN]: typeof xamanWallet.connectXaman.supportedChains;
110
- };
111
-
112
- type UnisatToSignInputs = {
113
- index: number;
114
- sighashTypes?: number[];
115
- disableTweakSigner?: boolean;
116
- } & ({ address: string } | { publicKey: string });
117
-
118
- declare global {
119
- interface Window {
120
- injectedWeb3?: SubstrateInjectedExtension;
121
- talismanEth?: EthereumWindowProvider;
122
- $onekey?: any;
123
- braveSolana: any;
124
- coinbaseWalletExtension: EthereumWindowProvider;
125
- ethereum: EthereumWindowProvider;
126
- keplr: Keplr;
127
- leap: Keplr;
128
- trustwallet: EthereumWindowProvider;
129
- phantom: {
130
- solana: SolanaProvider;
131
- };
132
-
133
- xfi?: {
134
- binance: Eip1193Provider;
135
- bitcoin: Eip1193Provider;
136
- bitcoincash: Eip1193Provider;
137
- dogecoin: Eip1193Provider;
138
- ethereum: BrowserProvider;
139
- keplr: Keplr;
140
- litecoin: Eip1193Provider;
141
- thorchain: Eip1193Provider;
142
- mayachain: Eip1193Provider;
143
- solana: SolanaProvider & { isXDEFI: boolean };
144
- near: NearBrowserWalletProvider;
145
- };
146
-
147
- vultisig?: {
148
- bitcoin: Eip1193Provider;
149
- bitcoincash: Eip1193Provider;
150
- dogecoin: Eip1193Provider;
151
- ethereum: Eip1193Provider;
152
- keplr: Keplr;
153
- cosmos: VultisigCosmosProvider;
154
- litecoin: Eip1193Provider;
155
- thorchain: Eip1193Provider;
156
- mayachain: Eip1193Provider;
157
- solana: SolanaProvider;
158
- polkadot: Eip1193Provider;
159
- ripple: Eip1193Provider;
160
- dash: Eip1193Provider;
161
- zcash: Eip1193Provider;
162
- };
163
-
164
- bitkeep?: {
165
- unisat: {
166
- requestAccounts: () => Promise<[string, ...string[]]>;
167
- signMessage: (message: string, type?: "ecdsa" | "bip322-simple") => Promise<string>;
168
- signPsbt: (
169
- psbtHex: string,
170
- {
171
- autoFinalized,
172
- toSignInputs,
173
- }: { autoFinalized?: boolean; toSignInputs?: UnisatToSignInputs[] },
174
- ) => Promise<string>;
175
- };
176
- keplr: {
177
- enable: (chainId: string | string[]) => Promise<void>;
178
- signAmino: (
179
- chainId: string,
180
- signer: string,
181
- signDoc: StdSignDoc,
182
- signOptions: any,
183
- ) => Promise<AminoSignResponse>;
184
- signArbitrary: (
185
- chainId: string,
186
- signer: string,
187
- data: string | Uint8Array,
188
- ) => Promise<StdSignature>;
189
- verifyArbitrary: (
190
- chainId: string,
191
- signer: string,
192
- data: string | Uint8Array,
193
- signature: StdSignature,
194
- ) => Promise<boolean>;
195
- getOfflineSignerOnlyAmino: (chainId: string) => OfflineAminoSigner;
196
- };
197
- solana: SolanaProvider;
198
- ethereum: EthereumWindowProvider;
199
- tronLink: {
200
- request: (args: { method: string; params?: any }) => Promise<any>;
201
- ready: boolean;
202
- };
203
- tronWeb: {
204
- defaultAddress: {
205
- base58: string;
206
- hex: string;
207
- };
208
- trx: {
209
- sign: (transaction: any) => Promise<any>;
210
- sendRawTransaction: (signedTransaction: any) => Promise<any>;
211
- getAccount: (address: string) => Promise<any>;
212
- getBalance: (address: string) => Promise<number>;
213
- };
214
- };
215
- };
216
-
217
- okxwallet?:
218
- | {
219
- bitcoin: {
220
- connect: () => Promise<{
221
- address: string;
222
- publicKey: string;
223
- }>;
224
- disconnect: () => Promise<void>;
225
- signMessage: (message: string, { from }: { from: string }) => Promise<string>;
226
- signPsbt: (
227
- psbtHex: string,
228
- { from, type }: { from: string; type: string },
229
- ) => Promise<string>;
230
- };
231
- keplr: {
232
- enable: (chainId: string | string[]) => Promise<void>;
233
- signAmino: (
234
- chainId: string,
235
- signer: string,
236
- signDoc: StdSignDoc,
237
- signOptions: any,
238
- ) => Promise<AminoSignResponse>;
239
- signArbitrary: (
240
- chainId: string,
241
- signer: string,
242
- data: string | Uint8Array,
243
- ) => Promise<StdSignature>;
244
- verifyArbitrary: (
245
- chainId: string,
246
- signer: string,
247
- data: string | Uint8Array,
248
- signature: StdSignature,
249
- ) => Promise<boolean>;
250
- getOfflineSignerOnlyAmino: (chainId: string) => OfflineAminoSigner;
251
- };
252
- near: NearBrowserWalletProvider & {
253
- requestSignIn: (params?: {
254
- contractId?: string;
255
- methodNames?: string[];
256
- }) => Promise<{ accountId: string; accessKey?: any }>;
257
- requestSignTransactions: (params: {
258
- transactions: any[];
259
- }) => Promise<any>;
260
- };
261
- tronLink: {
262
- request: (args: { method: string; params?: any }) => Promise<any>;
263
- ready: boolean;
264
- tronWeb: {
265
- defaultAddress: {
266
- base58: string;
267
- hex: string;
268
- };
269
- trx: {
270
- sign: (transaction: any) => Promise<any>;
271
- sendRawTransaction: (signedTransaction: any) => Promise<any>;
272
- getAccount: (address: string) => Promise<any>;
273
- getBalance: (address: string) => Promise<number>;
274
- };
275
- };
276
- };
277
- }
278
- | EthereumWindowProvider;
279
- }
280
- }
package/src/utils.ts DELETED
@@ -1,60 +0,0 @@
1
- import { WalletOption, type createWallet } from "@swapkit/helpers";
2
- import type { SKWallets } from "./types";
3
-
4
- export function getWalletSupportedChains<
5
- T extends ReturnType<typeof createWallet<any, any, any, any>>,
6
- >(wallet: T): T[keyof T]["supportedChains"] {
7
- const walletName = Object.keys(wallet)?.[0] || "";
8
- return wallet?.[walletName]?.supportedChains || [];
9
- }
10
-
11
- export async function loadWallet<W extends WalletOption>(walletOption: W): Promise<SKWallets[W]> {
12
- const { match } = await import("ts-pattern");
13
-
14
- const wallet = await match(walletOption as WalletOption)
15
- .with(WalletOption.COINBASE_MOBILE, async () => (await import("./coinbase")).coinbaseWallet)
16
- .with(WalletOption.BITGET, async () => (await import("./bitget")).bitgetWallet)
17
- .with(WalletOption.CTRL, async () => (await import("./ctrl")).ctrlWallet)
18
- .with(WalletOption.VULTISIG, async () => (await import("./vultisig")).vultisigWallet)
19
- .with(WalletOption.OKX, async () => (await import("./okx")).okxWallet)
20
- .with(WalletOption.ONEKEY, async () => (await import("./onekey")).onekeyWallet)
21
- .with(WalletOption.EXODUS, async () => (await import("./exodus")).exodusWallet)
22
- .with(WalletOption.KEEPKEY, async () => (await import("./keepkey")).keepkeyWallet)
23
- .with(WalletOption.KEEPKEY_BEX, async () => (await import("./keepkey-bex")).keepkeyBexWallet)
24
- .with(
25
- WalletOption.WALLETCONNECT,
26
- async () => (await import("./walletconnect")).walletconnectWallet,
27
- )
28
- .with(WalletOption.KEPLR, WalletOption.LEAP, async () => (await import("./keplr")).keplrWallet)
29
- .with(
30
- WalletOption.COSMOSTATION,
31
- async () => (await import("./cosmostation")).cosmostationWallet,
32
- )
33
- .with(
34
- WalletOption.BRAVE,
35
- WalletOption.COINBASE_WEB,
36
- WalletOption.EIP6963,
37
- WalletOption.METAMASK,
38
- WalletOption.OKX_MOBILE,
39
- WalletOption.TRUSTWALLET_WEB,
40
- async () => (await import("./evm-extensions")).evmWallet,
41
- )
42
-
43
- .with(WalletOption.KEYSTORE, async () => (await import("./keystore")).keystoreWallet)
44
- .with(WalletOption.TREZOR, async () => (await import("./trezor")).trezorWallet)
45
- .with(
46
- WalletOption.LEDGER,
47
- // TODO: Remove
48
- WalletOption.LEDGER_LIVE,
49
- async () => (await import("./ledger")).ledgerWallet,
50
- )
51
-
52
- .with(WalletOption.PHANTOM, async () => (await import("./phantom")).phantomWallet)
53
- .with(WalletOption.POLKADOT_JS, async () => (await import("./polkadotjs")).polkadotWallet)
54
- .with(WalletOption.RADIX_WALLET, async () => (await import("./radix")).radixWallet)
55
- .with(WalletOption.TALISMAN, async () => (await import("./talisman")).talismanWallet)
56
- .with(WalletOption.XAMAN, async () => (await import("./xaman")).xamanWallet)
57
- .exhaustive();
58
-
59
- return wallet as SKWallets[W];
60
- }
@@ -1,199 +0,0 @@
1
- import {
2
- Chain,
3
- type EVMChain,
4
- type GenericTransferParams,
5
- SwapKitError,
6
- type UTXOChain,
7
- UTXOChains,
8
- WalletOption,
9
- createWallet,
10
- filterSupportedChains,
11
- } from "@swapkit/helpers";
12
-
13
- import { getWalletSupportedChains } from "../utils";
14
- import {
15
- getVultisigAddress,
16
- getVultisigMethods,
17
- getVultisigProvider,
18
- prepareNetworkSwitchCosmos,
19
- walletTransfer,
20
- } from "./walletHelpers";
21
-
22
- export const vultisigWallet = createWallet({
23
- name: "connectVultisig",
24
- walletType: WalletOption.VULTISIG,
25
- supportedChains: [
26
- Chain.Arbitrum,
27
- Chain.Avalanche,
28
- Chain.Base,
29
- Chain.BinanceSmartChain,
30
- Chain.Bitcoin,
31
- Chain.BitcoinCash,
32
- Chain.Cosmos,
33
- Chain.Dash,
34
- Chain.Dogecoin,
35
- Chain.Ethereum,
36
- Chain.Kujira,
37
- Chain.Litecoin,
38
- Chain.Maya,
39
- Chain.Optimism,
40
- Chain.Polkadot,
41
- Chain.Polygon,
42
- Chain.Ripple,
43
- Chain.Solana,
44
- Chain.THORChain,
45
- Chain.Zcash,
46
- ],
47
- connect: ({ addChain, walletType, supportedChains }) =>
48
- async function connectVultisig(chains: Chain[]) {
49
- const filteredChains = filterSupportedChains({ chains, supportedChains, walletType });
50
-
51
- const promises = filteredChains
52
- .filter((chain) => chain !== Chain.Cosmos && chain !== Chain.Kujira)
53
- .map(async (chain) => {
54
- const address = await getVultisigAddress(chain);
55
- const walletMethods = await getWalletMethods(chain);
56
-
57
- addChain({ ...walletMethods, address, chain, walletType });
58
- });
59
-
60
- const cosmosIncluded = filteredChains.includes(Chain.Cosmos);
61
- const kujiraIncluded = filteredChains.includes(Chain.Kujira);
62
-
63
- // Race condition single cosmos provider exposed.
64
- if (cosmosIncluded) {
65
- const addressCosmos = await getVultisigAddress(Chain.Cosmos);
66
- const walletMethodsCosmos = await getWalletMethods(Chain.Cosmos);
67
- addChain({
68
- ...walletMethodsCosmos,
69
- address: addressCosmos,
70
- chain: Chain.Cosmos,
71
- walletType,
72
- });
73
- }
74
- if (kujiraIncluded) {
75
- const addressKujira = await getVultisigAddress(Chain.Kujira);
76
- const walletMethodsKujira = await getWalletMethods(Chain.Kujira);
77
- addChain({
78
- ...walletMethodsKujira,
79
- address: addressKujira,
80
- chain: Chain.Kujira,
81
- walletType,
82
- });
83
- }
84
- //--//
85
-
86
- await Promise.all(promises);
87
-
88
- return true;
89
- },
90
- });
91
-
92
- export const VULTISIG_SUPPORTED_CHAINS = getWalletSupportedChains(vultisigWallet);
93
-
94
- async function getWalletMethods(chain: (typeof VULTISIG_SUPPORTED_CHAINS)[number]) {
95
- const { match } = await import("ts-pattern");
96
- return match(chain)
97
- .with(Chain.Solana, async () => {
98
- const { getSolanaToolbox } = await import("@swapkit/toolboxes/solana");
99
- const solanaProvider = window.vultisig?.solana;
100
- if (!solanaProvider) throw new SwapKitError("wallet_vultisig_not_found");
101
- const toolbox = await getSolanaToolbox({ signer: solanaProvider });
102
- return { ...toolbox };
103
- })
104
-
105
- .with(Chain.Maya, Chain.THORChain, async () => {
106
- const { getCosmosToolbox, THORCHAIN_GAS_VALUE, MAYA_GAS_VALUE } = await import(
107
- "@swapkit/toolboxes/cosmos"
108
- );
109
- const gasLimit = chain === Chain.Maya ? MAYA_GAS_VALUE : THORCHAIN_GAS_VALUE;
110
- const toolbox = await getCosmosToolbox(chain as Chain.Cosmos | Chain.Kujira);
111
- return {
112
- ...toolbox,
113
- deposit: (tx: GenericTransferParams) =>
114
- walletTransfer({ ...tx, recipient: "" }, "deposit_transaction"),
115
- transfer: (tx: GenericTransferParams) =>
116
- walletTransfer({ ...tx, gasLimit }, "send_transaction"),
117
- };
118
- })
119
-
120
- .with(Chain.Cosmos, Chain.Kujira, async () => {
121
- const { getCosmosToolbox } = await import("@swapkit/toolboxes/cosmos");
122
- const provider = await getVultisigProvider(chain as Chain.Cosmos | Chain.Kujira);
123
- const toolbox = await getCosmosToolbox(chain as Chain.Cosmos | Chain.Kujira);
124
- return prepareNetworkSwitchCosmos({
125
- provider,
126
- chain,
127
- toolbox: {
128
- ...toolbox,
129
- transfer: walletTransfer,
130
- },
131
- });
132
- })
133
-
134
- .with(...UTXOChains, async () => {
135
- const { getUtxoToolbox } = await import("@swapkit/toolboxes/utxo");
136
- const toolbox = await getUtxoToolbox(chain as UTXOChain);
137
- return { ...toolbox, transfer: walletTransfer };
138
- })
139
-
140
- .with(
141
- Chain.Arbitrum,
142
- Chain.Avalanche,
143
- Chain.Base,
144
- Chain.BinanceSmartChain,
145
- Chain.Ethereum,
146
- Chain.Optimism,
147
- Chain.Polygon,
148
- async () => {
149
- const { prepareNetworkSwitch, switchEVMWalletNetwork } = await import("@swapkit/helpers");
150
- const { getEvmToolbox } = await import("@swapkit/toolboxes/evm");
151
- const { BrowserProvider } = await import("ethers");
152
- const ethereumWindowProvider = await getVultisigProvider(chain as EVMChain);
153
-
154
- if (!ethereumWindowProvider) {
155
- throw new SwapKitError("wallet_vultisig_not_found");
156
- }
157
-
158
- const provider = new BrowserProvider(ethereumWindowProvider, "any");
159
- const signer = await provider.getSigner();
160
- const toolbox = await getEvmToolbox(chain as EVMChain, { provider, signer });
161
- const vultisigMethods = getVultisigMethods(provider, chain as EVMChain);
162
-
163
- try {
164
- if (chain !== Chain.Ethereum) {
165
- const networkParams = toolbox.getNetworkParams();
166
- await switchEVMWalletNetwork(provider, chain, networkParams);
167
- }
168
- } catch (_error) {
169
- throw new SwapKitError({
170
- errorKey: "wallet_failed_to_add_or_switch_network",
171
- info: { wallet: WalletOption.VULTISIG, chain },
172
- });
173
- }
174
-
175
- return prepareNetworkSwitch({
176
- provider,
177
- chain,
178
- toolbox: {
179
- ...toolbox,
180
- ...vultisigMethods,
181
- },
182
- });
183
- },
184
- )
185
-
186
- .with(Chain.Ripple, async () => {
187
- const { getRippleToolbox } = await import("@swapkit/toolboxes/ripple");
188
- const toolbox = await getRippleToolbox();
189
- return { ...toolbox, transfer: walletTransfer };
190
- })
191
-
192
- .with(Chain.Polkadot, async () => {
193
- const { getSubstrateToolbox } = await import("@swapkit/toolboxes/substrate");
194
- const toolbox = await getSubstrateToolbox(chain as Chain.Polkadot);
195
- return { ...toolbox, transfer: walletTransfer };
196
- })
197
-
198
- .otherwise(async () => null);
199
- }