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

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 (312) 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 +2 -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 +4 -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 +357 -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/NetworkUtil.d.ts +2 -0
  260. package/lib/typescript/utils/NetworkUtil.d.ts.map +1 -1
  261. package/lib/typescript/utils/PresetsUtil.d.ts +0 -5
  262. package/lib/typescript/utils/PresetsUtil.d.ts.map +1 -1
  263. package/lib/typescript/utils/StringUtil.d.ts +1 -0
  264. package/lib/typescript/utils/StringUtil.d.ts.map +1 -1
  265. package/package.json +10 -19
  266. package/src/adapters/BitcoinBaseAdapter.ts +5 -0
  267. package/src/adapters/BlockchainAdapter.ts +48 -21
  268. package/src/adapters/EvmAdapter.ts +186 -18
  269. package/src/adapters/SolanaBaseAdapter.ts +3 -1
  270. package/src/adapters/__tests__/EvmAdapter.test.ts +126 -0
  271. package/src/index.ts +3 -1
  272. package/src/networks/bitcoin.ts +1 -1
  273. package/src/networks/solana.ts +1 -1
  274. package/src/types/api/blockchain-api.ts +213 -0
  275. package/src/types/api/events.ts +462 -0
  276. package/src/types/api/index.ts +4 -0
  277. package/src/types/api/wallet-api.ts +71 -0
  278. package/src/types/blockchain/adapter.ts +52 -0
  279. package/src/types/blockchain/balance.ts +31 -0
  280. package/src/types/blockchain/index.ts +5 -0
  281. package/src/types/blockchain/network.ts +39 -0
  282. package/src/types/blockchain/transaction.ts +71 -0
  283. package/src/types/common.ts +56 -0
  284. package/src/types/index.ts +28 -0
  285. package/src/types/onramp/countries.ts +11 -0
  286. package/src/types/onramp/currencies.ts +32 -0
  287. package/src/types/onramp/errors.ts +22 -0
  288. package/src/types/onramp/index.ts +5 -0
  289. package/src/types/onramp/quotes.ts +46 -0
  290. package/src/types/siwx/config.ts +73 -0
  291. package/src/types/siwx/index.ts +4 -0
  292. package/src/types/siwx/message.ts +92 -0
  293. package/src/types/siwx/storage.ts +44 -0
  294. package/src/types/siwx/verifier.ts +32 -0
  295. package/src/types/storage.ts +64 -0
  296. package/src/types/swap/index.ts +2 -0
  297. package/src/types/swap/tokens.ts +21 -0
  298. package/src/types/ui.ts +26 -0
  299. package/src/types/wallet/connection.ts +34 -0
  300. package/src/types/wallet/connector.ts +83 -0
  301. package/src/types/wallet/index.ts +4 -0
  302. package/src/types/wallet/wallet-info.ts +42 -0
  303. package/src/utils/ConstantsUtil.ts +48 -7
  304. package/src/utils/ErrorUtil.ts +2 -2
  305. package/src/utils/NetworkUtil.ts +5 -0
  306. package/src/utils/PresetsUtil.ts +0 -25
  307. package/src/utils/StringUtil.ts +7 -0
  308. package/lib/commonjs/utils/TypeUtil.js.map +0 -1
  309. package/lib/module/utils/TypeUtil.js.map +0 -1
  310. package/lib/typescript/utils/TypeUtil.d.ts +0 -276
  311. package/lib/typescript/utils/TypeUtil.d.ts.map +0 -1
  312. package/src/utils/TypeUtil.ts +0 -336
@@ -0,0 +1,462 @@
1
+ import type {
2
+ Platform,
3
+ SocialProvider,
4
+ AccountType,
5
+ CaipNetworkId,
6
+ ChainNamespace,
7
+ ThemeVariables,
8
+ ThemeMode
9
+ } from '../common';
10
+ import type { Features } from '../ui';
11
+ import type { Metadata } from '../wallet';
12
+
13
+ export type WalletImpressionItem = {
14
+ name: string;
15
+ walletRank: number | undefined;
16
+ explorerId: string;
17
+ view: 'Connect' | 'AllWallets';
18
+ displayIndex?: number;
19
+ query?: string;
20
+ certified?: boolean;
21
+ installed?: boolean;
22
+ };
23
+
24
+ export type EventName =
25
+ | 'MODAL_LOADED'
26
+ | 'MODAL_OPEN'
27
+ | 'MODAL_CLOSE'
28
+ | 'INITIALIZE'
29
+ | 'WALLET_IMPRESSION'
30
+ | 'CLICK_ALL_WALLETS'
31
+ | 'CLICK_NETWORKS'
32
+ | 'SWITCH_NETWORK'
33
+ | 'SELECT_WALLET'
34
+ | 'CONNECT_SUCCESS'
35
+ | 'CONNECT_ERROR'
36
+ | 'DISCONNECT_SUCCESS'
37
+ | 'DISCONNECT_ERROR'
38
+ | 'CLICK_WALLET_HELP'
39
+ | 'CLICK_NETWORK_HELP'
40
+ | 'CLICK_GET_WALLET_HELP'
41
+ | 'GET_WALLET'
42
+ | 'EMAIL_LOGIN_SELECTED'
43
+ | 'EMAIL_VERIFICATION_CODE_PASS'
44
+ | 'EMAIL_VERIFICATION_CODE_FAIL'
45
+ | 'EMAIL_EDIT'
46
+ | 'EMAIL_EDIT_COMPLETE'
47
+ | 'EMAIL_UPGRADE_FROM_MODAL'
48
+ | 'SIWX_AUTH_SUCCESS'
49
+ | 'SIWX_AUTH_ERROR'
50
+ | 'CLICK_SIGN_SIWX_MESSAGE'
51
+ | 'CLICK_CANCEL_SIWX'
52
+ | 'CLICK_TRANSACTIONS'
53
+ | 'ERROR_FETCH_TRANSACTIONS'
54
+ | 'LOAD_MORE_TRANSACTIONS'
55
+ | 'OPEN_SEND'
56
+ | 'OPEN_SWAP'
57
+ | 'INITIATE_SWAP'
58
+ | 'SWAP_SUCCESS'
59
+ | 'SWAP_ERROR'
60
+ | 'SEND_INITIATED'
61
+ | 'SEND_SUCCESS'
62
+ | 'SEND_ERROR'
63
+ | 'SOCIAL_LOGIN_STARTED'
64
+ | 'SOCIAL_LOGIN_SUCCESS'
65
+ | 'SOCIAL_LOGIN_REQUEST_USER_DATA'
66
+ | 'SOCIAL_LOGIN_CANCELED'
67
+ | 'SOCIAL_LOGIN_ERROR'
68
+ | 'SET_PREFERRED_ACCOUNT_TYPE';
69
+
70
+ export type Event =
71
+ | {
72
+ type: 'track';
73
+ event: 'MODAL_CREATED';
74
+ }
75
+ | {
76
+ type: 'track';
77
+ event: 'MODAL_LOADED';
78
+ }
79
+ | {
80
+ type: 'track';
81
+ event: 'MODAL_OPEN';
82
+ properties: {
83
+ connected: boolean;
84
+ };
85
+ }
86
+ | {
87
+ type: 'track';
88
+ event: 'INITIALIZE';
89
+ properties: {
90
+ showWallets?: boolean;
91
+ themeMode?: ThemeMode;
92
+ themeVariables?: ThemeVariables;
93
+ networks: CaipNetworkId[];
94
+ defaultNetwork?: CaipNetworkId;
95
+ metadata?: Metadata;
96
+ enableAnalytics?: boolean;
97
+ features?: Features;
98
+ adapters?: string[];
99
+ extraConnectors?: string[];
100
+ siwx?: boolean;
101
+ };
102
+ }
103
+ | {
104
+ type: 'track';
105
+ event: 'MODAL_CLOSE';
106
+ properties: {
107
+ connected: boolean;
108
+ };
109
+ }
110
+ | {
111
+ type: 'track';
112
+ event: 'CLICK_ALL_WALLETS';
113
+ }
114
+ | {
115
+ type: 'track';
116
+ event: 'CLICK_NETWORKS';
117
+ }
118
+ | {
119
+ type: 'track';
120
+ event: 'SWITCH_NETWORK';
121
+ properties: {
122
+ network: CaipNetworkId;
123
+ };
124
+ }
125
+ | {
126
+ type: 'track';
127
+ event: 'SELECT_WALLET';
128
+ properties: {
129
+ name: string;
130
+ platform?: Platform;
131
+ explorerId?: string;
132
+ walletRank?: number;
133
+ displayIndex?: number;
134
+ view?: 'Connect' | 'AllWallets';
135
+ };
136
+ }
137
+ | {
138
+ type: 'track';
139
+ event: 'CONNECT_SUCCESS';
140
+ address?: string;
141
+ properties: {
142
+ name: string;
143
+ caipNetworkId?: CaipNetworkId;
144
+ method?: Platform;
145
+ explorerId?: string;
146
+ reconnect?: boolean;
147
+ };
148
+ }
149
+ | {
150
+ type: 'track';
151
+ event: 'CONNECT_ERROR';
152
+ properties: {
153
+ message: string;
154
+ };
155
+ }
156
+ | {
157
+ type: 'track';
158
+ event: 'DISCONNECT_SUCCESS';
159
+ properties: {
160
+ namespace?: ChainNamespace;
161
+ };
162
+ }
163
+ | {
164
+ type: 'track';
165
+ event: 'DISCONNECT_ERROR';
166
+ }
167
+ | {
168
+ type: 'track';
169
+ event: 'CLICK_WALLET_HELP';
170
+ }
171
+ | {
172
+ type: 'track';
173
+ event: 'CLICK_NETWORK_HELP';
174
+ }
175
+ | {
176
+ type: 'track';
177
+ event: 'CLICK_GET_WALLET_HELP';
178
+ }
179
+ | {
180
+ type: 'track';
181
+ event: 'GET_WALLET';
182
+ properties: {
183
+ name: string;
184
+ explorerId?: string;
185
+ link?: string;
186
+ linkType?: 'appstore' | 'playstore';
187
+ walletRank?: number;
188
+ };
189
+ }
190
+ | {
191
+ type: 'track';
192
+ event: 'EMAIL_LOGIN_SELECTED';
193
+ }
194
+ | {
195
+ type: 'track';
196
+ event: 'EMAIL_VERIFICATION_CODE_PASS';
197
+ }
198
+ | {
199
+ type: 'track';
200
+ event: 'EMAIL_VERIFICATION_CODE_FAIL';
201
+ }
202
+ | {
203
+ type: 'track';
204
+ event: 'EMAIL_EDIT';
205
+ }
206
+ | {
207
+ type: 'track';
208
+ event: 'EMAIL_EDIT_COMPLETE';
209
+ }
210
+ | {
211
+ type: 'track';
212
+ event: 'EMAIL_UPGRADE_FROM_MODAL';
213
+ }
214
+ | {
215
+ type: 'track';
216
+ address?: string;
217
+ event: 'CLICK_SIGN_SIWX_MESSAGE';
218
+ properties: {
219
+ network?: CaipNetworkId;
220
+ isSmartAccount: boolean;
221
+ };
222
+ }
223
+ | {
224
+ type: 'track';
225
+ event: 'CLICK_CANCEL_SIWX';
226
+ properties: {
227
+ network?: CaipNetworkId;
228
+ isSmartAccount: boolean;
229
+ };
230
+ }
231
+ | {
232
+ type: 'track';
233
+ event: 'SIWX_AUTH_SUCCESS';
234
+ properties: {
235
+ network?: CaipNetworkId;
236
+ isSmartAccount: boolean;
237
+ };
238
+ }
239
+ | {
240
+ type: 'track';
241
+ event: 'SIWX_AUTH_ERROR';
242
+ properties: {
243
+ network?: CaipNetworkId;
244
+ isSmartAccount: boolean;
245
+ message?: string;
246
+ };
247
+ }
248
+ | {
249
+ type: 'track';
250
+ event: 'CLICK_TRANSACTIONS';
251
+ properties: {
252
+ isSmartAccount: boolean;
253
+ };
254
+ }
255
+ | {
256
+ type: 'track';
257
+ event: 'ERROR_FETCH_TRANSACTIONS';
258
+ properties: {
259
+ address: string;
260
+ projectId: string;
261
+ cursor: string | undefined;
262
+ isSmartAccount: boolean;
263
+ };
264
+ }
265
+ | {
266
+ type: 'track';
267
+ event: 'LOAD_MORE_TRANSACTIONS';
268
+ properties: {
269
+ address: string | undefined;
270
+ projectId: string;
271
+ cursor: string | undefined;
272
+ isSmartAccount: boolean;
273
+ };
274
+ }
275
+ | {
276
+ type: 'track';
277
+ event: 'OPEN_SEND';
278
+ properties: {
279
+ isSmartAccount: boolean;
280
+ network?: CaipNetworkId;
281
+ };
282
+ }
283
+ | {
284
+ type: 'track';
285
+ event: 'OPEN_SWAP';
286
+ properties: {
287
+ isSmartAccount: boolean;
288
+ network?: CaipNetworkId;
289
+ };
290
+ }
291
+ | {
292
+ type: 'track';
293
+ event: 'INITIATE_SWAP';
294
+ properties: {
295
+ isSmartAccount: boolean;
296
+ network?: CaipNetworkId;
297
+ swapFromToken: string;
298
+ swapToToken: string;
299
+ swapFromAmount: string;
300
+ swapToAmount: string;
301
+ };
302
+ }
303
+ | {
304
+ type: 'track';
305
+ event: 'SWAP_SUCCESS';
306
+ properties: {
307
+ isSmartAccount: boolean;
308
+ network?: CaipNetworkId;
309
+ swapFromToken: string;
310
+ swapToToken: string;
311
+ swapFromAmount: string;
312
+ swapToAmount: string;
313
+ };
314
+ }
315
+ | {
316
+ type: 'track';
317
+ event: 'SWAP_ERROR';
318
+ properties: {
319
+ isSmartAccount: boolean;
320
+ network?: CaipNetworkId;
321
+ swapFromToken: string;
322
+ swapToToken: string;
323
+ swapFromAmount: string;
324
+ swapToAmount: string;
325
+ message: string;
326
+ };
327
+ }
328
+ | {
329
+ type: 'track';
330
+ event: 'SEND_INITIATED';
331
+ properties: {
332
+ isSmartAccount: boolean;
333
+ network?: CaipNetworkId;
334
+ token: string;
335
+ amount: number;
336
+ };
337
+ }
338
+ | {
339
+ type: 'track';
340
+ event: 'SEND_SUCCESS';
341
+ properties: {
342
+ isSmartAccount: boolean;
343
+ network?: CaipNetworkId;
344
+ token: string;
345
+ amount: number;
346
+ };
347
+ }
348
+ | {
349
+ type: 'track';
350
+ event: 'SEND_ERROR';
351
+ properties: {
352
+ isSmartAccount: boolean;
353
+ network?: CaipNetworkId;
354
+ token: string;
355
+ amount: number;
356
+ };
357
+ }
358
+ | {
359
+ type: 'track';
360
+ event: 'SOCIAL_LOGIN_STARTED';
361
+ properties: {
362
+ provider: SocialProvider;
363
+ };
364
+ }
365
+ | {
366
+ type: 'track';
367
+ event: 'SOCIAL_LOGIN_SUCCESS';
368
+ properties: {
369
+ provider: SocialProvider;
370
+ };
371
+ }
372
+ | {
373
+ type: 'track';
374
+ event: 'SOCIAL_LOGIN_REQUEST_USER_DATA';
375
+ properties: {
376
+ provider: SocialProvider;
377
+ };
378
+ }
379
+ | {
380
+ type: 'track';
381
+ event: 'SOCIAL_LOGIN_CANCELED';
382
+ properties: {
383
+ provider: SocialProvider;
384
+ };
385
+ }
386
+ | {
387
+ type: 'track';
388
+ event: 'SOCIAL_LOGIN_ERROR';
389
+ properties: {
390
+ provider: SocialProvider;
391
+ };
392
+ }
393
+ | {
394
+ type: 'track';
395
+ event: 'SET_PREFERRED_ACCOUNT_TYPE';
396
+ properties: {
397
+ accountType: AccountType;
398
+ network: string;
399
+ };
400
+ }
401
+ | {
402
+ type: 'track';
403
+ event: 'SELECT_BUY_CRYPTO';
404
+ }
405
+ | {
406
+ type: 'track';
407
+ event: 'SELECT_BUY_ASSET';
408
+ properties: {
409
+ asset: string;
410
+ };
411
+ }
412
+ | {
413
+ type: 'track';
414
+ event: 'BUY_SUBMITTED';
415
+ properties: {
416
+ asset?: string;
417
+ network?: string;
418
+ amount?: string;
419
+ currency?: string;
420
+ provider?: string;
421
+ serviceProvider?: string;
422
+ paymentMethod?: string;
423
+ };
424
+ }
425
+ | {
426
+ type: 'track';
427
+ event: 'BUY_SUCCESS';
428
+ properties: {
429
+ asset?: string | null;
430
+ network?: string | null;
431
+ amount?: string | null;
432
+ currency?: string | null;
433
+ provider?: string | null;
434
+ orderId?: string | null;
435
+ };
436
+ }
437
+ | {
438
+ type: 'track';
439
+ event: 'BUY_FAIL';
440
+ properties: {
441
+ asset?: string;
442
+ network?: string;
443
+ amount?: string;
444
+ currency?: string;
445
+ provider?: string;
446
+ serviceProvider?: string;
447
+ paymentMethod?: string;
448
+ message?: string;
449
+ };
450
+ }
451
+ | {
452
+ type: 'track';
453
+ event: 'BUY_CANCEL';
454
+ properties?: {
455
+ message?: string;
456
+ };
457
+ }
458
+ | {
459
+ type: 'track';
460
+ event: 'WALLET_IMPRESSION';
461
+ items: Array<WalletImpressionItem>;
462
+ };
@@ -0,0 +1,4 @@
1
+ // API types barrel export
2
+ export * from './blockchain-api';
3
+ export * from './wallet-api';
4
+ export * from './events';
@@ -0,0 +1,71 @@
1
+ import type { CaipNetworkId } from '../common';
2
+
3
+ export interface WcWallet {
4
+ id: string;
5
+ name: string;
6
+ homepage?: string;
7
+ image_id?: string;
8
+ image_url?: string;
9
+ order?: number;
10
+ mobile_link?: string | null;
11
+ desktop_link?: string | null;
12
+ webapp_link?: string | null;
13
+ link_mode?: string | null;
14
+ app_store?: string | null;
15
+ play_store?: string | null;
16
+ chains?: readonly CaipNetworkId[];
17
+ badge_type?: 'certified' | 'none';
18
+ }
19
+
20
+ export interface DataWallet {
21
+ id: string;
22
+ ios_schema?: string;
23
+ android_app_id?: string;
24
+ }
25
+
26
+ export interface ApiGetWalletsRequest {
27
+ page: number;
28
+ entries: number;
29
+ search?: string;
30
+ include?: string[];
31
+ exclude?: string[];
32
+ }
33
+
34
+ export interface ApiGetWalletsResponse {
35
+ data: WcWallet[];
36
+ count: number;
37
+ }
38
+
39
+ export interface ApiGetDataWalletsResponse {
40
+ data: DataWallet[];
41
+ count: number;
42
+ }
43
+
44
+ export interface ApiGetAnalyticsConfigResponse {
45
+ isAnalyticsEnabled: boolean;
46
+ }
47
+
48
+ export type CustomWallet = Pick<
49
+ WcWallet,
50
+ | 'id'
51
+ | 'name'
52
+ | 'homepage'
53
+ | 'image_url'
54
+ | 'image_id'
55
+ | 'mobile_link'
56
+ | 'desktop_link'
57
+ | 'webapp_link'
58
+ | 'link_mode'
59
+ | 'app_store'
60
+ | 'play_store'
61
+ > & {
62
+ android_app_id?: string;
63
+ ios_schema?: string;
64
+ };
65
+
66
+ export type UniversalProviderConfigOverride = {
67
+ methods?: Record<string, string[]>;
68
+ chains?: Record<string, string[]>;
69
+ events?: Record<string, string[]>;
70
+ rpcMap?: Record<string, string>;
71
+ };
@@ -0,0 +1,52 @@
1
+ import type { ChainNamespace, CaipAddress, AdapterType } from '../common';
2
+ import type { WalletConnector } from '../wallet';
3
+ import type { BalanceChangedEvent } from './balance';
4
+
5
+ export interface BlockchainAdapterConfig {
6
+ supportedNamespace: ChainNamespace;
7
+ adapterType: AdapterType;
8
+ }
9
+
10
+ export interface BlockchainAdapterInitParams {
11
+ connector: WalletConnector;
12
+ }
13
+
14
+ export interface AdapterEvents {
15
+ accountsChanged: (event: AccountsChangedEvent) => void;
16
+ chainChanged: (event: ChainChangedEvent) => void;
17
+ disconnect: (event: DisconnectEvent) => void;
18
+ balanceChanged: (event: BalanceChangedEvent) => void;
19
+ }
20
+
21
+ export type AccountsChangedEvent = {
22
+ accounts: CaipAddress[];
23
+ };
24
+
25
+ export type ChainChangedEvent = {
26
+ chainId: string;
27
+ };
28
+
29
+ export type DisconnectEvent = undefined;
30
+
31
+ export interface Provider {
32
+ connect<T>(params?: any): Promise<T>;
33
+ disconnect(): Promise<void>;
34
+ request<T = unknown>(
35
+ args: RequestArguments,
36
+ chain?: string | undefined,
37
+ expiry?: number | undefined
38
+ ): Promise<T>;
39
+ on(event: string, listener: (args?: any) => void): any;
40
+ off(event: string, listener: (args?: any) => void): any;
41
+ }
42
+
43
+ export interface RequestArguments {
44
+ method: string;
45
+ params?: unknown[] | Record<string, unknown> | object | undefined;
46
+ }
47
+
48
+ export interface ConnectionResponse {
49
+ accounts: string[];
50
+ chainId: string;
51
+ [key: string]: any;
52
+ }
@@ -0,0 +1,31 @@
1
+ import type { CaipAddress } from '../common';
2
+ import type { Tokens } from '../wallet';
3
+ import type { AppKitNetwork } from './network';
4
+
5
+ export interface Balance {
6
+ name?: string;
7
+ amount: string;
8
+ symbol: string;
9
+ quantity?: {
10
+ decimals: string;
11
+ numeric: string;
12
+ };
13
+ chainId?: string;
14
+ address?: CaipAddress | string; // contract address
15
+ value?: number; //total value of the amount in currency
16
+ price?: number; //price of the token in currency
17
+ iconUrl?: string;
18
+ }
19
+
20
+ export interface GetBalanceParams {
21
+ network: AppKitNetwork;
22
+ address?: CaipAddress;
23
+ tokens?: Tokens;
24
+ }
25
+
26
+ export type GetBalanceResponse = Balance;
27
+
28
+ export type BalanceChangedEvent = {
29
+ address: CaipAddress;
30
+ balance: Balance;
31
+ };
@@ -0,0 +1,5 @@
1
+ // Blockchain types barrel export
2
+ export * from './adapter';
3
+ export * from './balance';
4
+ export * from './network';
5
+ export * from './transaction';
@@ -0,0 +1,39 @@
1
+ import type { ChainNamespace, CaipNetworkId } from '../common';
2
+
3
+ export type Network = {
4
+ // Core viem/chain properties
5
+ id: number | string;
6
+ name: string;
7
+ nativeCurrency: { name: string; symbol: string; decimals: number };
8
+ rpcUrls: {
9
+ default: { http: readonly string[] };
10
+ [key: string]: { http: readonly string[] } | undefined;
11
+ };
12
+ blockExplorers?: {
13
+ default: { name: string; url: string };
14
+ [key: string]: { name: string; url: string } | undefined;
15
+ };
16
+
17
+ // AppKit specific / CAIP properties (Optional in type, but needed in practice)
18
+ chainNamespace?: ChainNamespace; // e.g., 'eip155'
19
+ caipNetworkId?: CaipNetworkId; // e.g., 'eip155:1'
20
+ testnet?: boolean;
21
+ deprecatedCaipNetworkId?: CaipNetworkId; // for Solana deprecated id
22
+ imageUrl?: string;
23
+ };
24
+
25
+ export type AppKitNetwork = Network & {
26
+ chainNamespace: ChainNamespace; // mandatory for AppKitNetwork
27
+ caipNetworkId: CaipNetworkId; // mandatory for AppKitNetwork
28
+ };
29
+
30
+ export interface CaipNetwork {
31
+ id: CaipNetworkId;
32
+ name?: string;
33
+ imageId?: string;
34
+ imageUrl?: string;
35
+ }
36
+
37
+ export interface AppKitOpenOptions {
38
+ view: 'Account' | 'Connect' | 'WalletConnect' | 'Networks' | 'Swap' | 'OnRamp';
39
+ }