@reown/appkit-common-react-native 2.0.0 → 2.0.2

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 (314) hide show
  1. package/lib/commonjs/adapters/BitcoinBaseAdapter.js +10 -0
  2. package/lib/commonjs/adapters/BitcoinBaseAdapter.js.map +1 -0
  3. package/lib/commonjs/adapters/BlockchainAdapter.js +38 -14
  4. package/lib/commonjs/adapters/BlockchainAdapter.js.map +1 -1
  5. package/lib/commonjs/adapters/EvmAdapter.js +126 -16
  6. package/lib/commonjs/adapters/EvmAdapter.js.map +1 -1
  7. package/lib/commonjs/adapters/SolanaBaseAdapter.js +1 -3
  8. package/lib/commonjs/adapters/SolanaBaseAdapter.js.map +1 -1
  9. package/lib/commonjs/contracts/erc20.js.map +1 -1
  10. package/lib/commonjs/contracts/usdt.js.map +1 -1
  11. package/lib/commonjs/index.js +13 -5
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/networks/bitcoin.js.map +1 -1
  14. package/lib/commonjs/networks/solana.js.map +1 -1
  15. package/lib/commonjs/package.json +1 -0
  16. package/lib/commonjs/types/api/blockchain-api.js +15 -0
  17. package/lib/commonjs/types/api/blockchain-api.js.map +1 -0
  18. package/lib/commonjs/types/api/events.js +6 -0
  19. package/lib/commonjs/types/api/events.js.map +1 -0
  20. package/lib/commonjs/types/api/index.js +39 -0
  21. package/lib/commonjs/types/api/index.js.map +1 -0
  22. package/lib/commonjs/types/api/wallet-api.js +6 -0
  23. package/lib/commonjs/types/api/wallet-api.js.map +1 -0
  24. package/lib/commonjs/types/blockchain/adapter.js +6 -0
  25. package/lib/commonjs/types/blockchain/adapter.js.map +1 -0
  26. package/lib/commonjs/types/blockchain/balance.js +6 -0
  27. package/lib/commonjs/types/blockchain/balance.js.map +1 -0
  28. package/lib/commonjs/types/blockchain/index.js +50 -0
  29. package/lib/commonjs/types/blockchain/index.js.map +1 -0
  30. package/lib/commonjs/types/blockchain/network.js +6 -0
  31. package/lib/commonjs/types/blockchain/network.js.map +1 -0
  32. package/lib/commonjs/types/blockchain/transaction.js +2 -0
  33. package/lib/commonjs/types/blockchain/transaction.js.map +1 -0
  34. package/lib/commonjs/types/common.js +2 -0
  35. package/lib/commonjs/types/common.js.map +1 -0
  36. package/lib/commonjs/types/index.js +105 -0
  37. package/lib/commonjs/types/index.js.map +1 -0
  38. package/lib/commonjs/types/onramp/countries.js +2 -0
  39. package/lib/commonjs/types/onramp/countries.js.map +1 -0
  40. package/lib/commonjs/types/onramp/currencies.js +2 -0
  41. package/lib/commonjs/types/onramp/currencies.js.map +1 -0
  42. package/lib/commonjs/types/onramp/errors.js +22 -0
  43. package/lib/commonjs/types/onramp/errors.js.map +1 -0
  44. package/lib/commonjs/types/onramp/index.js +50 -0
  45. package/lib/commonjs/types/onramp/index.js.map +1 -0
  46. package/lib/commonjs/types/onramp/quotes.js +2 -0
  47. package/lib/commonjs/types/onramp/quotes.js.map +1 -0
  48. package/lib/commonjs/types/siwx/config.js +6 -0
  49. package/lib/commonjs/types/siwx/config.js.map +1 -0
  50. package/lib/commonjs/types/siwx/index.js +50 -0
  51. package/lib/commonjs/types/siwx/index.js.map +1 -0
  52. package/lib/commonjs/types/siwx/message.js +6 -0
  53. package/lib/commonjs/types/siwx/message.js.map +1 -0
  54. package/lib/commonjs/types/siwx/storage.js +6 -0
  55. package/lib/commonjs/types/siwx/storage.js.map +1 -0
  56. package/lib/commonjs/types/siwx/verifier.js +35 -0
  57. package/lib/commonjs/types/siwx/verifier.js.map +1 -0
  58. package/lib/commonjs/types/storage.js +24 -0
  59. package/lib/commonjs/types/storage.js.map +1 -0
  60. package/lib/commonjs/types/swap/index.js +17 -0
  61. package/lib/commonjs/types/swap/index.js.map +1 -0
  62. package/lib/commonjs/types/swap/tokens.js +6 -0
  63. package/lib/commonjs/types/swap/tokens.js.map +1 -0
  64. package/lib/commonjs/types/ui.js +6 -0
  65. package/lib/commonjs/types/ui.js.map +1 -0
  66. package/lib/commonjs/types/wallet/connection.js +6 -0
  67. package/lib/commonjs/types/wallet/connection.js.map +1 -0
  68. package/lib/commonjs/{utils/TypeUtil.js → types/wallet/connector.js} +7 -13
  69. package/lib/commonjs/types/wallet/connector.js.map +1 -0
  70. package/lib/commonjs/types/wallet/index.js +39 -0
  71. package/lib/commonjs/types/wallet/index.js.map +1 -0
  72. package/lib/commonjs/types/wallet/wallet-info.js +6 -0
  73. package/lib/commonjs/types/wallet/wallet-info.js.map +1 -0
  74. package/lib/commonjs/utils/ConstantsUtil.js +45 -6
  75. package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
  76. package/lib/commonjs/utils/ContractUtil.js.map +1 -1
  77. package/lib/commonjs/utils/DateUtil.js.map +1 -1
  78. package/lib/commonjs/utils/ErrorUtil.js +57 -2
  79. package/lib/commonjs/utils/ErrorUtil.js.map +1 -1
  80. package/lib/commonjs/utils/NamesUtil.js.map +1 -1
  81. package/lib/commonjs/utils/NetworkUtil.js +3 -0
  82. package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
  83. package/lib/commonjs/utils/NumberUtil.js +1 -2
  84. package/lib/commonjs/utils/NumberUtil.js.map +1 -1
  85. package/lib/commonjs/utils/PresetsUtil.js +0 -18
  86. package/lib/commonjs/utils/PresetsUtil.js.map +1 -1
  87. package/lib/commonjs/utils/StringUtil.js +7 -0
  88. package/lib/commonjs/utils/StringUtil.js.map +1 -1
  89. package/lib/module/adapters/BitcoinBaseAdapter.js +5 -0
  90. package/lib/module/adapters/BitcoinBaseAdapter.js.map +1 -0
  91. package/lib/module/adapters/BlockchainAdapter.js +40 -14
  92. package/lib/module/adapters/BlockchainAdapter.js.map +1 -1
  93. package/lib/module/adapters/EvmAdapter.js +129 -16
  94. package/lib/module/adapters/EvmAdapter.js.map +1 -1
  95. package/lib/module/adapters/SolanaBaseAdapter.js +3 -3
  96. package/lib/module/adapters/SolanaBaseAdapter.js.map +1 -1
  97. package/lib/module/contracts/erc20.js +2 -0
  98. package/lib/module/contracts/erc20.js.map +1 -1
  99. package/lib/module/contracts/usdt.js +2 -0
  100. package/lib/module/contracts/usdt.js.map +1 -1
  101. package/lib/module/index.js +4 -1
  102. package/lib/module/index.js.map +1 -1
  103. package/lib/module/networks/bitcoin.js +2 -0
  104. package/lib/module/networks/bitcoin.js.map +1 -1
  105. package/lib/module/networks/solana.js +2 -0
  106. package/lib/module/networks/solana.js.map +1 -1
  107. package/lib/module/types/api/blockchain-api.js +10 -0
  108. package/lib/module/types/api/blockchain-api.js.map +1 -0
  109. package/lib/module/types/api/events.js +4 -0
  110. package/lib/module/types/api/events.js.map +1 -0
  111. package/lib/module/types/api/index.js +7 -0
  112. package/lib/module/types/api/index.js.map +1 -0
  113. package/lib/module/types/api/wallet-api.js +4 -0
  114. package/lib/module/types/api/wallet-api.js.map +1 -0
  115. package/lib/module/types/blockchain/adapter.js +4 -0
  116. package/lib/module/types/blockchain/adapter.js.map +1 -0
  117. package/lib/module/types/blockchain/balance.js +4 -0
  118. package/lib/module/types/blockchain/balance.js.map +1 -0
  119. package/lib/module/types/blockchain/index.js +8 -0
  120. package/lib/module/types/blockchain/index.js.map +1 -0
  121. package/lib/module/types/blockchain/network.js +4 -0
  122. package/lib/module/types/blockchain/network.js.map +1 -0
  123. package/lib/module/types/blockchain/transaction.js +2 -0
  124. package/lib/module/types/blockchain/transaction.js.map +1 -0
  125. package/lib/module/types/common.js +2 -0
  126. package/lib/module/types/common.js.map +1 -0
  127. package/lib/module/types/index.js +31 -0
  128. package/lib/module/types/index.js.map +1 -0
  129. package/lib/module/types/onramp/countries.js +2 -0
  130. package/lib/module/types/onramp/countries.js.map +1 -0
  131. package/lib/module/types/onramp/currencies.js +2 -0
  132. package/lib/module/types/onramp/currencies.js.map +1 -0
  133. package/lib/module/types/onramp/errors.js +18 -0
  134. package/lib/module/types/onramp/errors.js.map +1 -0
  135. package/lib/module/types/onramp/index.js +8 -0
  136. package/lib/module/types/onramp/index.js.map +1 -0
  137. package/lib/module/types/onramp/quotes.js +2 -0
  138. package/lib/module/types/onramp/quotes.js.map +1 -0
  139. package/lib/module/types/siwx/config.js +4 -0
  140. package/lib/module/types/siwx/config.js.map +1 -0
  141. package/lib/module/types/siwx/index.js +7 -0
  142. package/lib/module/types/siwx/index.js.map +1 -0
  143. package/lib/module/types/siwx/message.js +4 -0
  144. package/lib/module/types/siwx/message.js.map +1 -0
  145. package/lib/module/types/siwx/storage.js +4 -0
  146. package/lib/module/types/siwx/storage.js.map +1 -0
  147. package/lib/module/types/siwx/verifier.js +30 -0
  148. package/lib/module/types/siwx/verifier.js.map +1 -0
  149. package/lib/module/types/storage.js +20 -0
  150. package/lib/module/types/storage.js.map +1 -0
  151. package/lib/module/types/swap/index.js +5 -0
  152. package/lib/module/types/swap/index.js.map +1 -0
  153. package/lib/module/types/swap/tokens.js +4 -0
  154. package/lib/module/types/swap/tokens.js.map +1 -0
  155. package/lib/module/types/ui.js +4 -0
  156. package/lib/module/types/ui.js.map +1 -0
  157. package/lib/module/types/wallet/connection.js +4 -0
  158. package/lib/module/types/wallet/connection.js.map +1 -0
  159. package/lib/module/{utils/TypeUtil.js → types/wallet/connector.js} +9 -14
  160. package/lib/module/types/wallet/connector.js.map +1 -0
  161. package/lib/module/types/wallet/index.js +7 -0
  162. package/lib/module/types/wallet/index.js.map +1 -0
  163. package/lib/module/types/wallet/wallet-info.js +4 -0
  164. package/lib/module/types/wallet/wallet-info.js.map +1 -0
  165. package/lib/module/utils/ConstantsUtil.js +47 -6
  166. package/lib/module/utils/ConstantsUtil.js.map +1 -1
  167. package/lib/module/utils/ContractUtil.js +2 -0
  168. package/lib/module/utils/ContractUtil.js.map +1 -1
  169. package/lib/module/utils/DateUtil.js +2 -0
  170. package/lib/module/utils/DateUtil.js.map +1 -1
  171. package/lib/module/utils/ErrorUtil.js +59 -2
  172. package/lib/module/utils/ErrorUtil.js.map +1 -1
  173. package/lib/module/utils/NamesUtil.js +2 -0
  174. package/lib/module/utils/NamesUtil.js.map +1 -1
  175. package/lib/module/utils/NetworkUtil.js +5 -0
  176. package/lib/module/utils/NetworkUtil.js.map +1 -1
  177. package/lib/module/utils/NumberUtil.js +2 -0
  178. package/lib/module/utils/NumberUtil.js.map +1 -1
  179. package/lib/module/utils/PresetsUtil.js +2 -18
  180. package/lib/module/utils/PresetsUtil.js.map +1 -1
  181. package/lib/module/utils/StringUtil.js +9 -0
  182. package/lib/module/utils/StringUtil.js.map +1 -1
  183. package/lib/typescript/adapters/BitcoinBaseAdapter.d.ts +5 -0
  184. package/lib/typescript/adapters/BitcoinBaseAdapter.d.ts.map +1 -0
  185. package/lib/typescript/adapters/BlockchainAdapter.d.ts +6 -7
  186. package/lib/typescript/adapters/BlockchainAdapter.d.ts.map +1 -1
  187. package/lib/typescript/adapters/EvmAdapter.d.ts +21 -1
  188. package/lib/typescript/adapters/EvmAdapter.d.ts.map +1 -1
  189. package/lib/typescript/adapters/SolanaBaseAdapter.d.ts +3 -0
  190. package/lib/typescript/adapters/SolanaBaseAdapter.d.ts.map +1 -1
  191. package/lib/typescript/adapters/__tests__/EvmAdapter.test.d.ts +2 -0
  192. package/lib/typescript/adapters/__tests__/EvmAdapter.test.d.ts.map +1 -0
  193. package/lib/typescript/index.d.ts +2 -1
  194. package/lib/typescript/index.d.ts.map +1 -1
  195. package/lib/typescript/networks/bitcoin.d.ts +1 -1
  196. package/lib/typescript/networks/bitcoin.d.ts.map +1 -1
  197. package/lib/typescript/networks/solana.d.ts +1 -1
  198. package/lib/typescript/networks/solana.d.ts.map +1 -1
  199. package/lib/typescript/types/api/blockchain-api.d.ts +183 -0
  200. package/lib/typescript/types/api/blockchain-api.d.ts.map +1 -0
  201. package/lib/typescript/types/api/events.d.ts +364 -0
  202. package/lib/typescript/types/api/events.d.ts.map +1 -0
  203. package/lib/typescript/types/api/index.d.ts +4 -0
  204. package/lib/typescript/types/api/index.d.ts.map +1 -0
  205. package/lib/typescript/types/api/wallet-api.d.ts +51 -0
  206. package/lib/typescript/types/api/wallet-api.d.ts.map +1 -0
  207. package/lib/typescript/types/blockchain/adapter.d.ts +40 -0
  208. package/lib/typescript/types/blockchain/adapter.d.ts.map +1 -0
  209. package/lib/typescript/types/blockchain/balance.d.ts +28 -0
  210. package/lib/typescript/types/blockchain/balance.d.ts.map +1 -0
  211. package/lib/typescript/types/blockchain/index.d.ts +5 -0
  212. package/lib/typescript/types/blockchain/index.d.ts.map +1 -0
  213. package/lib/typescript/types/blockchain/network.d.ts +47 -0
  214. package/lib/typescript/types/blockchain/network.d.ts.map +1 -0
  215. package/lib/typescript/types/blockchain/transaction.d.ts +63 -0
  216. package/lib/typescript/types/blockchain/transaction.d.ts.map +1 -0
  217. package/lib/typescript/types/common.d.ts +24 -0
  218. package/lib/typescript/types/common.d.ts.map +1 -0
  219. package/lib/typescript/types/index.d.ts +10 -0
  220. package/lib/typescript/types/index.d.ts.map +1 -0
  221. package/lib/typescript/types/onramp/countries.d.ts +11 -0
  222. package/lib/typescript/types/onramp/countries.d.ts.map +1 -0
  223. package/lib/typescript/types/onramp/currencies.d.ts +30 -0
  224. package/lib/typescript/types/onramp/currencies.d.ts.map +1 -0
  225. package/lib/typescript/types/onramp/errors.d.ts +21 -0
  226. package/lib/typescript/types/onramp/errors.d.ts.map +1 -0
  227. package/lib/typescript/types/onramp/index.d.ts +5 -0
  228. package/lib/typescript/types/onramp/index.d.ts.map +1 -0
  229. package/lib/typescript/types/onramp/quotes.d.ts +45 -0
  230. package/lib/typescript/types/onramp/quotes.d.ts.map +1 -0
  231. package/lib/typescript/types/siwx/config.d.ts +73 -0
  232. package/lib/typescript/types/siwx/config.d.ts.map +1 -0
  233. package/lib/typescript/types/siwx/index.d.ts +5 -0
  234. package/lib/typescript/types/siwx/index.d.ts.map +1 -0
  235. package/lib/typescript/types/siwx/message.d.ts +92 -0
  236. package/lib/typescript/types/siwx/message.d.ts.map +1 -0
  237. package/lib/typescript/types/siwx/storage.d.ts +41 -0
  238. package/lib/typescript/types/siwx/storage.d.ts.map +1 -0
  239. package/lib/typescript/types/siwx/verifier.d.ts +28 -0
  240. package/lib/typescript/types/siwx/verifier.d.ts.map +1 -0
  241. package/lib/typescript/types/storage.d.ts +59 -0
  242. package/lib/typescript/types/storage.d.ts.map +1 -0
  243. package/lib/typescript/types/swap/index.d.ts +2 -0
  244. package/lib/typescript/types/swap/index.d.ts.map +1 -0
  245. package/lib/typescript/types/swap/tokens.d.ts +19 -0
  246. package/lib/typescript/types/swap/tokens.d.ts.map +1 -0
  247. package/lib/typescript/types/ui.d.ts +26 -0
  248. package/lib/typescript/types/ui.d.ts.map +1 -0
  249. package/lib/typescript/types/wallet/connection.d.ts +31 -0
  250. package/lib/typescript/types/wallet/connection.d.ts.map +1 -0
  251. package/lib/typescript/types/wallet/connector.d.ts +59 -0
  252. package/lib/typescript/types/wallet/connector.d.ts.map +1 -0
  253. package/lib/typescript/types/wallet/index.d.ts +4 -0
  254. package/lib/typescript/types/wallet/index.d.ts.map +1 -0
  255. package/lib/typescript/types/wallet/wallet-info.d.ts +37 -0
  256. package/lib/typescript/types/wallet/wallet-info.d.ts.map +1 -0
  257. package/lib/typescript/utils/ConstantsUtil.d.ts +43 -4
  258. package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
  259. package/lib/typescript/utils/ErrorUtil.d.ts +13 -0
  260. package/lib/typescript/utils/ErrorUtil.d.ts.map +1 -1
  261. package/lib/typescript/utils/NetworkUtil.d.ts +2 -0
  262. package/lib/typescript/utils/NetworkUtil.d.ts.map +1 -1
  263. package/lib/typescript/utils/PresetsUtil.d.ts +0 -5
  264. package/lib/typescript/utils/PresetsUtil.d.ts.map +1 -1
  265. package/lib/typescript/utils/StringUtil.d.ts +1 -0
  266. package/lib/typescript/utils/StringUtil.d.ts.map +1 -1
  267. package/package.json +10 -19
  268. package/src/adapters/BitcoinBaseAdapter.ts +5 -0
  269. package/src/adapters/BlockchainAdapter.ts +48 -21
  270. package/src/adapters/EvmAdapter.ts +186 -18
  271. package/src/adapters/SolanaBaseAdapter.ts +3 -1
  272. package/src/adapters/__tests__/EvmAdapter.test.ts +126 -0
  273. package/src/index.ts +3 -1
  274. package/src/networks/bitcoin.ts +1 -1
  275. package/src/networks/solana.ts +1 -1
  276. package/src/types/api/blockchain-api.ts +213 -0
  277. package/src/types/api/events.ts +471 -0
  278. package/src/types/api/index.ts +4 -0
  279. package/src/types/api/wallet-api.ts +71 -0
  280. package/src/types/blockchain/adapter.ts +52 -0
  281. package/src/types/blockchain/balance.ts +31 -0
  282. package/src/types/blockchain/index.ts +5 -0
  283. package/src/types/blockchain/network.ts +39 -0
  284. package/src/types/blockchain/transaction.ts +71 -0
  285. package/src/types/common.ts +56 -0
  286. package/src/types/index.ts +28 -0
  287. package/src/types/onramp/countries.ts +11 -0
  288. package/src/types/onramp/currencies.ts +32 -0
  289. package/src/types/onramp/errors.ts +22 -0
  290. package/src/types/onramp/index.ts +5 -0
  291. package/src/types/onramp/quotes.ts +46 -0
  292. package/src/types/siwx/config.ts +73 -0
  293. package/src/types/siwx/index.ts +4 -0
  294. package/src/types/siwx/message.ts +92 -0
  295. package/src/types/siwx/storage.ts +44 -0
  296. package/src/types/siwx/verifier.ts +32 -0
  297. package/src/types/storage.ts +64 -0
  298. package/src/types/swap/index.ts +2 -0
  299. package/src/types/swap/tokens.ts +21 -0
  300. package/src/types/ui.ts +26 -0
  301. package/src/types/wallet/connection.ts +34 -0
  302. package/src/types/wallet/connector.ts +83 -0
  303. package/src/types/wallet/index.ts +4 -0
  304. package/src/types/wallet/wallet-info.ts +42 -0
  305. package/src/utils/ConstantsUtil.ts +48 -7
  306. package/src/utils/ErrorUtil.ts +80 -2
  307. package/src/utils/NetworkUtil.ts +5 -0
  308. package/src/utils/PresetsUtil.ts +0 -25
  309. package/src/utils/StringUtil.ts +7 -0
  310. package/lib/commonjs/utils/TypeUtil.js.map +0 -1
  311. package/lib/module/utils/TypeUtil.js.map +0 -1
  312. package/lib/typescript/utils/TypeUtil.d.ts +0 -276
  313. package/lib/typescript/utils/TypeUtil.d.ts.map +0 -1
  314. package/src/utils/TypeUtil.ts +0 -336
@@ -0,0 +1,83 @@
1
+ import { EventEmitter } from 'events';
2
+ import type { ChainNamespace, CaipAddress, CaipNetworkId } from '../common';
3
+ import type { AppKitNetwork } from '../blockchain/network';
4
+ import type { Provider } from '../blockchain/adapter';
5
+ import type { WalletInfo, Metadata } from './wallet-info';
6
+ import type { ConnectionProperties } from './connection';
7
+ import type { Storage } from '../storage';
8
+ import type { WcWallet } from '../api/wallet-api';
9
+
10
+ export type ConnectorType = 'walletconnect' | 'coinbase' | 'phantom' | 'solflare';
11
+
12
+ export interface BaseNamespace {
13
+ chains?: CaipNetworkId[];
14
+ accounts: CaipAddress[];
15
+ methods: string[];
16
+ events: string[];
17
+ }
18
+
19
+ type Namespace = BaseNamespace;
20
+
21
+ export type Namespaces = Record<string, Namespace>;
22
+
23
+ export type ProposalNamespaces = Record<
24
+ string,
25
+ Omit<Namespace, 'accounts'> &
26
+ Required<Pick<Namespace, 'chains'>> & { rpcMap: Record<string, string> }
27
+ >;
28
+
29
+ export type ConnectOptions = {
30
+ namespaces?: ProposalNamespaces;
31
+ defaultNetwork?: AppKitNetwork;
32
+ universalLink?: string;
33
+ };
34
+
35
+ export type ConnectorInitOptions = {
36
+ storage: Storage;
37
+ metadata: Metadata;
38
+ };
39
+
40
+ export abstract class WalletConnector extends EventEmitter {
41
+ public type: ConnectorType;
42
+ protected provider?: Provider;
43
+ protected namespaces?: Namespaces;
44
+ protected wallet?: WalletInfo;
45
+ protected storage?: Storage;
46
+ protected metadata?: Metadata;
47
+ protected properties?: ConnectionProperties;
48
+
49
+ constructor({ type }: { type: ConnectorType }) {
50
+ super();
51
+ this.type = type;
52
+ }
53
+
54
+ public async init(ops: ConnectorInitOptions) {
55
+ this.storage = ops.storage;
56
+ this.metadata = ops.metadata;
57
+ }
58
+
59
+ public setProvider(provider: Provider) {
60
+ this.provider = provider;
61
+ }
62
+
63
+ public async disconnect() {
64
+ await this.provider?.disconnect();
65
+ this.namespaces = undefined;
66
+ this.wallet = undefined;
67
+ this.properties = undefined;
68
+ }
69
+
70
+ abstract connect(opts: ConnectOptions): Promise<Namespaces | undefined>;
71
+ abstract getProvider(namespace?: ChainNamespace): Provider;
72
+ abstract getNamespaces(): Namespaces;
73
+ abstract getChainId(namespace: ChainNamespace): CaipNetworkId | undefined;
74
+ abstract getWalletInfo(): WalletInfo | undefined;
75
+ abstract getProperties(): ConnectionProperties | undefined;
76
+ abstract switchNetwork(network: AppKitNetwork): Promise<void>;
77
+ abstract restoreSession(): Promise<boolean>;
78
+ }
79
+
80
+ export type AppKitConnectOptions = {
81
+ walletId?: string;
82
+ wallet?: WcWallet;
83
+ };
@@ -0,0 +1,4 @@
1
+ // Wallet types barrel export
2
+ export * from './connector';
3
+ export * from './connection';
4
+ export * from './wallet-info';
@@ -0,0 +1,42 @@
1
+ import type { CaipNetworkId } from '../common';
2
+
3
+ export interface WalletInfo {
4
+ name?: string;
5
+ icon?: string;
6
+ description?: string;
7
+ url?: string;
8
+ icons?: string[];
9
+ redirect?: {
10
+ native?: string;
11
+ universal?: string;
12
+ linkMode?: boolean;
13
+ };
14
+ type?: 'walletconnect' | 'external' | 'unknown';
15
+ [key: string]: unknown;
16
+ }
17
+
18
+ export type Metadata = {
19
+ name: string;
20
+ description: string;
21
+ url: string;
22
+ icons: string[];
23
+ redirect?: {
24
+ native?: string;
25
+ universal?: string;
26
+ linkMode?: boolean;
27
+ };
28
+ };
29
+
30
+ export interface Token {
31
+ address: string;
32
+ image?: string;
33
+ }
34
+
35
+ export type Tokens = Record<CaipNetworkId, Token>;
36
+
37
+ export interface Identity {
38
+ name: string;
39
+ avatar?: string;
40
+ }
41
+
42
+ export type ConnectedWalletInfo = WalletInfo | undefined;
@@ -1,5 +1,5 @@
1
1
  export const ConstantsUtil = {
2
- VERSION: '2.0.0',
2
+ VERSION: '2.0.2',
3
3
 
4
4
  EIP155: 'eip155',
5
5
  ADD_CHAIN_METHOD: 'wallet_addEthereumChain',
@@ -11,12 +11,20 @@ export const ConstantsUtil = {
11
11
  BLOCKCHAIN_API_RPC_URL_STAGING: 'https://staging.rpc.walletconnect.org',
12
12
  PULSE_API_URL: 'https://pulse.walletconnect.org',
13
13
  API_URL: 'https://api.web3modal.org',
14
+ WEB_WALLET_URL: 'https://web-wallet.walletconnect.org',
15
+ SECURE_SITE_DASHBOARD: `https://secure.reown.com/dashboard`,
16
+ SECURE_SITE_ICON: `https://secure.reown.com/images/favicon.png`,
17
+ REOWN_URL: `https://reown.com`,
14
18
 
15
- WALLET_CONNECT_CONNECTOR_ID: 'walletConnect',
16
- COINBASE_CONNECTOR_ID: 'coinbaseWallet',
17
- AUTH_CONNECTOR_ID: 'appKitAuth',
18
-
19
- COINBASE_EXPLORER_ID: 'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa',
19
+ CHAIN_NAME_MAP: {
20
+ eip155: 'EVM Networks',
21
+ solana: 'Solana',
22
+ polkadot: 'Polkadot',
23
+ bip122: 'Bitcoin',
24
+ cosmos: 'Cosmos',
25
+ sui: 'Sui',
26
+ stacks: 'Stacks'
27
+ },
20
28
 
21
29
  USDT_CONTRACT_ADDRESSES: [
22
30
  // Mainnet
@@ -33,5 +41,38 @@ export const ConstantsUtil = {
33
41
  '0x55d398326f99059fF775485246999027B3197955',
34
42
  // Arbitrum
35
43
  '0xfd086bc7cd5c481dcc9c85ebe478a1c0b69fcbb9'
36
- ]
44
+ ],
45
+
46
+ PHANTOM_CUSTOM_WALLET: {
47
+ id: 'a797aa35c0fadbfc1a53e7f675162ed5226968b44a19ee3d24385c64d1d3c393',
48
+ name: 'Phantom Wallet',
49
+ image_id: 'b6ec7b81-bb4f-427d-e290-7631e6e50d00',
50
+ mobile_link: 'phantom://',
51
+ play_store: 'https://play.google.com/store/apps/details?id=app.phantom',
52
+ app_store: 'https://apps.apple.com/app/id1598432977',
53
+ android_app_id: 'app.phantom',
54
+ ios_schema: 'phantom://'
55
+ },
56
+
57
+ COINBASE_CUSTOM_WALLET: {
58
+ id: 'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa',
59
+ name: 'Coinbase Wallet',
60
+ image_id: 'a5ebc364-8f91-4200-fcc6-be81310a0000',
61
+ mobile_link: 'https://wallet.coinbase.com/wsegue',
62
+ play_store: 'https://play.google.com/store/apps/details?id=org.toshi',
63
+ app_store: 'https://apps.apple.com/app/id1278383455',
64
+ android_app_id: 'org.toshi',
65
+ ios_schema: 'cbwallet://'
66
+ },
67
+
68
+ SOLFLARE_CUSTOM_WALLET: {
69
+ id: '1ca0bdd4747578705b1939af023d120677c64fe6ca76add81fda36e350605e79',
70
+ name: 'Solflare Wallet',
71
+ image_id: '34c0e38d-66c4-470e-1aed-a6fabe2d1e00',
72
+ mobile_link: 'solflare://',
73
+ play_store: 'https://play.google.com/store/apps/details?id=com.solflare.mobile',
74
+ app_store: 'https://apps.apple.com/app/id1580902717',
75
+ android_app_id: 'com.solflare.mobile',
76
+ ios_schema: 'solflare://'
77
+ }
37
78
  };
@@ -1,4 +1,8 @@
1
1
  export const ErrorUtil = {
2
+ RPC_ERROR_CODE: {
3
+ USER_REJECTED_REQUEST: 4001,
4
+ USER_REJECTED_METHODS: 5002
5
+ } as const,
2
6
  UniversalProviderErrors: {
3
7
  UNAUTHORIZED_DOMAIN_NOT_ALLOWED: {
4
8
  message: 'Unauthorized: origin not allowed',
@@ -16,12 +20,12 @@ export const ErrorUtil = {
16
20
  ALERT_ERRORS: {
17
21
  INVALID_APP_CONFIGURATION: {
18
22
  shortMessage: 'Invalid App Configuration',
19
- longMessage: `Bundle ID not found on Allowlist - Please verify that your bundle ID is allowed at https://cloud.reown.com`
23
+ longMessage: `Bundle ID not found on Allowlist - Please verify that your bundle ID is allowed at https://dashboard.reown.com`
20
24
  },
21
25
  SOCIALS_TIMEOUT: {
22
26
  shortMessage: 'Invalid App Configuration',
23
27
  longMessage:
24
- 'There was an issue loading the embedded wallet. Please verify that your bundle ID is allowed at https://cloud.reown.com'
28
+ 'There was an issue loading the embedded wallet. Please verify that your bundle ID is allowed at https://dashboard.reown.com'
25
29
  },
26
30
  JWT_TOKEN_NOT_VALID: {
27
31
  shortMessage: 'Session Expired',
@@ -31,5 +35,79 @@ export const ErrorUtil = {
31
35
  shortMessage: 'Project ID Not Configured',
32
36
  longMessage: 'Project ID Not Configured - update configuration'
33
37
  }
38
+ },
39
+ isRpcProviderError(error: any): error is { message: string; code: number } {
40
+ try {
41
+ if (typeof error === 'object' && error !== null) {
42
+ const objErr = error as Record<string, unknown>;
43
+
44
+ const hasMessage = typeof objErr['message'] === 'string';
45
+ const hasCode = typeof objErr['code'] === 'number';
46
+
47
+ return hasMessage && hasCode;
48
+ }
49
+
50
+ return false;
51
+ } catch {
52
+ return false;
53
+ }
54
+ },
55
+ isUserRejectedMessage(message: string) {
56
+ return (
57
+ message.toLowerCase().includes('rejected') ||
58
+ message.toLowerCase().includes('user cancelled') ||
59
+ message.toLowerCase().includes('user canceled')
60
+ );
61
+ },
62
+ isUserRejectedRequestError(error: any) {
63
+ if (ErrorUtil.isRpcProviderError(error)) {
64
+ const isUserRejectedCode = error.code === ErrorUtil.RPC_ERROR_CODE.USER_REJECTED_REQUEST;
65
+ const isUserRejectedMethodsCode =
66
+ error.code === ErrorUtil.RPC_ERROR_CODE.USER_REJECTED_METHODS;
67
+
68
+ return (
69
+ isUserRejectedCode ||
70
+ isUserRejectedMethodsCode ||
71
+ ErrorUtil.isUserRejectedMessage(error.message)
72
+ );
73
+ }
74
+
75
+ if (error instanceof Error) {
76
+ return ErrorUtil.isUserRejectedMessage(error.message);
77
+ }
78
+
79
+ return false;
80
+ },
81
+ isProposalExpiredError(error: any) {
82
+ if (ErrorUtil.isRpcProviderError(error)) {
83
+ return error.message?.toLowerCase().includes('proposal expired');
84
+ }
85
+
86
+ if (error) {
87
+ return (
88
+ typeof error?.message === 'string' &&
89
+ error.message?.toLowerCase().includes('proposal expired')
90
+ );
91
+ }
92
+
93
+ return false;
94
+ },
95
+ isWalletNotFoundError(error: any) {
96
+ if (error && typeof error?.message === 'string') {
97
+ return /wallet not found/i.test(error.message);
98
+ }
99
+
100
+ return false;
101
+ },
102
+ categorizeConnectionError(error: any): 'not_installed' | 'declined' | 'default' {
103
+ if (ErrorUtil.isWalletNotFoundError(error)) {
104
+ return 'not_installed';
105
+ }
106
+
107
+ if (ErrorUtil.isUserRejectedRequestError(error)) {
108
+ return 'declined';
109
+ }
110
+
111
+ return 'default';
34
112
  }
35
113
  };
@@ -1,5 +1,10 @@
1
+ import type { CaipAddress } from '../types';
2
+
1
3
  export const NetworkUtil = {
2
4
  caipNetworkIdToNumber(caipnetworkId?: `${string}:${string}`) {
3
5
  return caipnetworkId ? Number(caipnetworkId.split(':')[1]) : undefined;
6
+ },
7
+ getPlainAddress(caipAddress?: CaipAddress) {
8
+ return caipAddress?.split(':')[2];
4
9
  }
5
10
  };
@@ -1,12 +1,4 @@
1
- import type { ConnectorType } from './TypeUtil';
2
- import { ConstantsUtil } from './ConstantsUtil';
3
-
4
1
  export const PresetsUtil = {
5
- ConnectorExplorerIds: {
6
- [ConstantsUtil.COINBASE_CONNECTOR_ID]:
7
- 'fd20dc426fb37566d803205b19bbc1d4096b248ac04548e3cfb6b3a38bd033aa'
8
- } as Record<string, string>,
9
-
10
2
  NetworkImageIds: {
11
3
  // Ethereum
12
4
  1: 'ba0ba0cd-17c6-4806-ad93-f9d174f17900',
@@ -81,23 +73,6 @@ export const PresetsUtil = {
81
73
  '000000000933ea01ad0ee984209779ba': '39354064-d79b-420b-065d-f980c4b78200'
82
74
  } as Record<string, string>,
83
75
 
84
- ConnectorNamesMap: {
85
- [ConstantsUtil.WALLET_CONNECT_CONNECTOR_ID]: 'WalletConnect',
86
- [ConstantsUtil.COINBASE_CONNECTOR_ID]: 'Coinbase Wallet',
87
- [ConstantsUtil.AUTH_CONNECTOR_ID]: 'AppKit Universal Wallet'
88
- } as Record<string, string>,
89
-
90
- ConnectorImageIds: {
91
- [ConstantsUtil.COINBASE_CONNECTOR_ID]: '0c2840c3-5b04-4c44-9661-fbd4b49e1800',
92
- [ConstantsUtil.WALLET_CONNECT_CONNECTOR_ID]: 'ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400'
93
- } as Record<string, string>,
94
-
95
- ConnectorTypesMap: {
96
- [ConstantsUtil.WALLET_CONNECT_CONNECTOR_ID]: 'WALLET_CONNECT',
97
- [ConstantsUtil.COINBASE_CONNECTOR_ID]: 'COINBASE',
98
- [ConstantsUtil.AUTH_CONNECTOR_ID]: 'AUTH'
99
- } as Record<string, ConnectorType>,
100
-
101
76
  RpcChainIds: [
102
77
  // Ethereum
103
78
  1,
@@ -5,5 +5,12 @@ export const StringUtil = {
5
5
  }
6
6
 
7
7
  return value.charAt(0).toUpperCase() + value.slice(1).toLowerCase();
8
+ },
9
+ hexToString(hexValue: string) {
10
+ // Remove 0x prefix if present
11
+ const cleanHex = hexValue.startsWith('0x') ? hexValue.slice(2) : hexValue;
12
+ // Convert hex to decimal number, then to string
13
+
14
+ return parseInt(cleanHex, 16).toString();
8
15
  }
9
16
  };
@@ -1 +0,0 @@
1
- {"version":3,"names":["_events","require","WalletConnector","EventEmitter","constructor","type","init","ops","storage","metadata","setProvider","provider","exports"],"sourceRoot":"../../../src","sources":["utils/TypeUtil.ts"],"mappings":";;;;;;AAAA,IAAAA,OAAA,GAAAC,OAAA;AAgKA;;AAoBA;;AAsBA;;AA6BO,MAAeC,eAAe,SAASC,oBAAY,CAAC;EAQzDC,WAAWA,CAAC;IAAEC;EAAkC,CAAC,EAAE;IACjD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,IAAI,GAAGA,IAAI;EAClB;EAEA,MAAaC,IAAIA,CAACC,GAAyB,EAAE;IAC3C,IAAI,CAACC,OAAO,GAAGD,GAAG,CAACC,OAAO;IAC1B,IAAI,CAACC,QAAQ,GAAGF,GAAG,CAACE,QAAQ;EAC9B;EAEOC,WAAWA,CAACC,QAAkB,EAAE;IACrC,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC1B;AASF;;AAEA;;AAmBA;;AAGA;AAAAC,OAAA,CAAAV,eAAA,GAAAA,eAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"names":["EventEmitter","WalletConnector","constructor","type","init","ops","storage","metadata","setProvider","provider"],"sourceRoot":"../../../src","sources":["utils/TypeUtil.ts"],"mappings":"AAAA,SAASA,YAAY,QAAQ,QAAQ;;AAgKrC;;AAoBA;;AAsBA;;AA6BA,OAAO,MAAeC,eAAe,SAASD,YAAY,CAAC;EAQzDE,WAAWA,CAAC;IAAEC;EAAkC,CAAC,EAAE;IACjD,KAAK,CAAC,CAAC;IACP,IAAI,CAACA,IAAI,GAAGA,IAAI;EAClB;EAEA,MAAaC,IAAIA,CAACC,GAAyB,EAAE;IAC3C,IAAI,CAACC,OAAO,GAAGD,GAAG,CAACC,OAAO;IAC1B,IAAI,CAACC,QAAQ,GAAGF,GAAG,CAACE,QAAQ;EAC9B;EAEOC,WAAWA,CAACC,QAAkB,EAAE;IACrC,IAAI,CAACA,QAAQ,GAAGA,QAAQ;EAC1B;AASF;;AAEA;;AAmBA;;AAGA"}
@@ -1,276 +0,0 @@
1
- /// <reference types="node" />
2
- import { EventEmitter } from 'events';
3
- export type CaipAddress = `${string}:${string}:${string}`;
4
- export type CaipNetworkId = `${string}:${string}`;
5
- export type ChainNamespace = 'eip155' | 'solana' | 'polkadot' | 'bip122';
6
- export type Network = {
7
- id: number | string;
8
- name: string;
9
- nativeCurrency: {
10
- name: string;
11
- symbol: string;
12
- decimals: number;
13
- };
14
- rpcUrls: {
15
- default: {
16
- http: readonly string[];
17
- };
18
- [key: string]: {
19
- http: readonly string[];
20
- } | undefined;
21
- };
22
- blockExplorers?: {
23
- default: {
24
- name: string;
25
- url: string;
26
- };
27
- [key: string]: {
28
- name: string;
29
- url: string;
30
- } | undefined;
31
- };
32
- chainNamespace?: ChainNamespace;
33
- caipNetworkId?: CaipNetworkId;
34
- testnet?: boolean;
35
- deprecatedCaipNetworkId?: CaipNetworkId;
36
- };
37
- export type AppKitNetwork = Network & {
38
- chainNamespace: ChainNamespace;
39
- caipNetworkId: CaipNetworkId;
40
- testnet?: boolean;
41
- deprecatedCaipNetworkId?: CaipNetworkId;
42
- };
43
- export interface CaipNetwork {
44
- id: CaipNetworkId;
45
- name?: string;
46
- imageId?: string;
47
- imageUrl?: string;
48
- }
49
- export interface Balance {
50
- name: string;
51
- symbol: string;
52
- chainId: string;
53
- address?: CaipAddress;
54
- value?: number;
55
- price: number;
56
- quantity: BalanceQuantity;
57
- iconUrl: string;
58
- }
59
- type BalanceQuantity = {
60
- decimals: string;
61
- numeric: string;
62
- };
63
- export type TransactionStatus = 'confirmed' | 'failed' | 'pending';
64
- export type TransactionDirection = 'in' | 'out' | 'self';
65
- export type TransactionImage = {
66
- type: 'FUNGIBLE' | 'NFT' | undefined;
67
- url: string | undefined;
68
- };
69
- export interface Transaction {
70
- id: string;
71
- metadata: TransactionMetadata;
72
- transfers: TransactionTransfer[];
73
- }
74
- export interface TransactionMetadata {
75
- application: {
76
- iconUrl: string | null;
77
- name: string | null;
78
- };
79
- operationType: string;
80
- hash: string;
81
- minedAt: string;
82
- sentFrom: string;
83
- sentTo: string;
84
- status: TransactionStatus;
85
- nonce: number;
86
- chain?: string;
87
- }
88
- export interface TransactionTransfer {
89
- fungible_info?: {
90
- name?: string;
91
- symbol?: string;
92
- icon?: {
93
- url: string;
94
- };
95
- };
96
- nft_info?: TransactionNftInfo;
97
- direction: TransactionDirection;
98
- quantity: TransactionQuantity;
99
- value?: number;
100
- price?: number;
101
- }
102
- export interface TransactionNftInfo {
103
- name?: string;
104
- content?: TransactionContent;
105
- flags: TransactionNftInfoFlags;
106
- }
107
- export interface TransactionNftInfoFlags {
108
- is_spam: boolean;
109
- }
110
- export interface TransactionContent {
111
- preview?: TransactionPreview;
112
- detail?: TransactionDetail;
113
- }
114
- export interface TransactionPreview {
115
- url: string;
116
- content_type?: null;
117
- }
118
- export interface TransactionDetail {
119
- url: string;
120
- content_type?: null;
121
- }
122
- export interface TransactionQuantity {
123
- numeric: string;
124
- }
125
- export type SocialProvider = 'apple' | 'x' | 'discord' | 'farcaster';
126
- export type ThemeMode = 'dark' | 'light';
127
- export interface ThemeVariables {
128
- accent?: string;
129
- }
130
- export interface Token {
131
- address: string;
132
- image?: string;
133
- }
134
- export type Tokens = Record<CaipNetworkId, Token>;
135
- export type ConnectorType = 'WALLET_CONNECT' | 'COINBASE' | 'AUTH' | 'EXTERNAL';
136
- export type Metadata = {
137
- name: string;
138
- description: string;
139
- url: string;
140
- icons: string[];
141
- redirect?: {
142
- native?: string;
143
- universal?: string;
144
- linkMode?: boolean;
145
- };
146
- };
147
- export type AccountsChangedEvent = {
148
- accounts: string[];
149
- };
150
- export type ChainChangedEvent = {
151
- chainId: string;
152
- };
153
- export type DisconnectEvent = {};
154
- export type BalanceChangedEvent = {
155
- address: CaipAddress;
156
- balance: {
157
- amount: string;
158
- symbol: string;
159
- contractAddress?: ContractAddress;
160
- };
161
- };
162
- export interface AdapterEvents {
163
- accountsChanged: (event: AccountsChangedEvent) => void;
164
- chainChanged: (event: ChainChangedEvent) => void;
165
- disconnect: (event: DisconnectEvent) => void;
166
- balanceChanged: (event: BalanceChangedEvent) => void;
167
- }
168
- export interface GetBalanceParams {
169
- address?: CaipAddress;
170
- network?: AppKitNetwork;
171
- tokens?: Tokens;
172
- }
173
- type ContractAddress = CaipAddress;
174
- export interface GetBalanceResponse {
175
- amount: string;
176
- symbol: string;
177
- contractAddress?: ContractAddress;
178
- }
179
- interface BaseNamespace {
180
- chains?: CaipNetworkId[];
181
- accounts: CaipAddress[];
182
- methods: string[];
183
- events: string[];
184
- }
185
- type Namespace = BaseNamespace;
186
- export type Namespaces = Record<string, Namespace>;
187
- export type ProposalNamespaces = Record<string, Omit<Namespace, 'accounts'> & Required<Pick<Namespace, 'chains'>> & {
188
- rpcMap: Record<string, string>;
189
- }>;
190
- export type ConnectOptions = {
191
- namespaces?: ProposalNamespaces;
192
- defaultChain?: CaipNetworkId;
193
- universalLink?: string;
194
- };
195
- export type ConnectorInitOptions = {
196
- storage: Storage;
197
- metadata: Metadata;
198
- };
199
- export declare abstract class WalletConnector extends EventEmitter {
200
- type: New_ConnectorType;
201
- protected provider?: Provider;
202
- protected namespaces?: Namespaces;
203
- protected wallet?: WalletInfo;
204
- protected storage?: Storage;
205
- protected metadata?: Metadata;
206
- constructor({ type }: {
207
- type: New_ConnectorType;
208
- });
209
- init(ops: ConnectorInitOptions): Promise<void>;
210
- setProvider(provider: Provider): void;
211
- abstract connect(opts: ConnectOptions): Promise<Namespaces | undefined>;
212
- abstract disconnect(): Promise<void>;
213
- abstract getProvider(): Provider;
214
- abstract getNamespaces(): Namespaces;
215
- abstract getChainId(namespace: ChainNamespace): CaipNetworkId | undefined;
216
- abstract getWalletInfo(): WalletInfo | undefined;
217
- abstract switchNetwork(network: AppKitNetwork): Promise<void>;
218
- }
219
- export interface Provider {
220
- connect<T>(params?: any): Promise<T>;
221
- disconnect(): Promise<void>;
222
- request<T = unknown>(args: RequestArguments, chain?: string | undefined, expiry?: number | undefined): Promise<T>;
223
- on(event: string, listener: (args?: any) => void): any;
224
- off(event: string, listener: (args?: any) => void): any;
225
- }
226
- export interface RequestArguments {
227
- method: string;
228
- params?: unknown[] | Record<string, unknown> | object | undefined;
229
- }
230
- export type New_ConnectorType = 'walletconnect' | 'coinbase' | 'auth' | 'phantom';
231
- export interface ConnectionResponse {
232
- accounts: string[];
233
- chainId: string;
234
- [key: string]: any;
235
- }
236
- export interface WalletInfo {
237
- name?: string;
238
- icon?: string;
239
- description?: string;
240
- url?: string;
241
- icons?: string[];
242
- redirect?: {
243
- native?: string;
244
- universal?: string;
245
- linkMode?: boolean;
246
- };
247
- [key: string]: unknown;
248
- }
249
- export interface Storage {
250
- /**
251
- * Returns all keys in storage.
252
- */
253
- getKeys(): Promise<string[]>;
254
- /**
255
- * Returns all key-value entries in storage.
256
- */
257
- getEntries<T = any>(): Promise<[string, T][]>;
258
- /**
259
- * Get an item from storage for a given key.
260
- * @param key The key to retrieve.
261
- */
262
- getItem<T = any>(key: string): Promise<T | undefined>;
263
- /**
264
- * Set an item in storage for a given key.
265
- * @param key The key to set.
266
- * @param value The value to set.
267
- */
268
- setItem<T = any>(key: string, value: T): Promise<void>;
269
- /**
270
- * Remove an item from storage for a given key.
271
- * @param key The key to remove.
272
- */
273
- removeItem(key: string): Promise<void>;
274
- }
275
- export {};
276
- //# sourceMappingURL=TypeUtil.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"TypeUtil.d.ts","sourceRoot":"","sources":["../../../src/utils/TypeUtil.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAEtC,MAAM,MAAM,WAAW,GAAG,GAAG,MAAM,IAAI,MAAM,IAAI,MAAM,EAAE,CAAC;AAE1D,MAAM,MAAM,aAAa,GAAG,GAAG,MAAM,IAAI,MAAM,EAAE,CAAC;AAElD,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEzE,MAAM,MAAM,OAAO,GAAG;IAEpB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IACnE,OAAO,EAAE;QACP,OAAO,EAAE;YAAE,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;SAAE,CAAC;QACrC,CAAC,GAAG,EAAE,MAAM,GAAG;YAAE,IAAI,EAAE,SAAS,MAAM,EAAE,CAAA;SAAE,GAAG,SAAS,CAAC;KACxD,CAAC;IACF,cAAc,CAAC,EAAE;QACf,OAAO,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,GAAG,EAAE,MAAM,CAAA;SAAE,CAAC;QACvC,C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