@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,471 @@
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
+ | 'USER_REJECTED'
37
+ | 'DISCONNECT_SUCCESS'
38
+ | 'DISCONNECT_ERROR'
39
+ | 'CLICK_WALLET_HELP'
40
+ | 'CLICK_NETWORK_HELP'
41
+ | 'CLICK_GET_WALLET_HELP'
42
+ | 'GET_WALLET'
43
+ | 'EMAIL_LOGIN_SELECTED'
44
+ | 'EMAIL_VERIFICATION_CODE_PASS'
45
+ | 'EMAIL_VERIFICATION_CODE_FAIL'
46
+ | 'EMAIL_EDIT'
47
+ | 'EMAIL_EDIT_COMPLETE'
48
+ | 'EMAIL_UPGRADE_FROM_MODAL'
49
+ | 'SIWX_AUTH_SUCCESS'
50
+ | 'SIWX_AUTH_ERROR'
51
+ | 'CLICK_SIGN_SIWX_MESSAGE'
52
+ | 'CLICK_CANCEL_SIWX'
53
+ | 'CLICK_TRANSACTIONS'
54
+ | 'ERROR_FETCH_TRANSACTIONS'
55
+ | 'LOAD_MORE_TRANSACTIONS'
56
+ | 'OPEN_SEND'
57
+ | 'OPEN_SWAP'
58
+ | 'INITIATE_SWAP'
59
+ | 'SWAP_SUCCESS'
60
+ | 'SWAP_ERROR'
61
+ | 'SEND_INITIATED'
62
+ | 'SEND_SUCCESS'
63
+ | 'SEND_ERROR'
64
+ | 'SOCIAL_LOGIN_STARTED'
65
+ | 'SOCIAL_LOGIN_SUCCESS'
66
+ | 'SOCIAL_LOGIN_REQUEST_USER_DATA'
67
+ | 'SOCIAL_LOGIN_CANCELED'
68
+ | 'SOCIAL_LOGIN_ERROR'
69
+ | 'SET_PREFERRED_ACCOUNT_TYPE';
70
+
71
+ export type Event =
72
+ | {
73
+ type: 'track';
74
+ event: 'MODAL_CREATED';
75
+ }
76
+ | {
77
+ type: 'track';
78
+ event: 'MODAL_LOADED';
79
+ }
80
+ | {
81
+ type: 'track';
82
+ event: 'MODAL_OPEN';
83
+ properties: {
84
+ connected: boolean;
85
+ };
86
+ }
87
+ | {
88
+ type: 'track';
89
+ event: 'INITIALIZE';
90
+ properties: {
91
+ showWallets?: boolean;
92
+ themeMode?: ThemeMode;
93
+ themeVariables?: ThemeVariables;
94
+ networks: CaipNetworkId[];
95
+ defaultNetwork?: CaipNetworkId;
96
+ metadata?: Metadata;
97
+ enableAnalytics?: boolean;
98
+ features?: Features;
99
+ adapters?: string[];
100
+ extraConnectors?: string[];
101
+ siwx?: boolean;
102
+ };
103
+ }
104
+ | {
105
+ type: 'track';
106
+ event: 'MODAL_CLOSE';
107
+ properties: {
108
+ connected: boolean;
109
+ };
110
+ }
111
+ | {
112
+ type: 'track';
113
+ event: 'CLICK_ALL_WALLETS';
114
+ }
115
+ | {
116
+ type: 'track';
117
+ event: 'CLICK_NETWORKS';
118
+ }
119
+ | {
120
+ type: 'track';
121
+ event: 'SWITCH_NETWORK';
122
+ properties: {
123
+ network: CaipNetworkId;
124
+ };
125
+ }
126
+ | {
127
+ type: 'track';
128
+ event: 'SELECT_WALLET';
129
+ properties: {
130
+ name: string;
131
+ platform?: Platform;
132
+ explorerId?: string;
133
+ walletRank?: number;
134
+ displayIndex?: number;
135
+ view?: 'Connect' | 'AllWallets';
136
+ };
137
+ }
138
+ | {
139
+ type: 'track';
140
+ event: 'CONNECT_SUCCESS';
141
+ address?: string;
142
+ properties: {
143
+ name: string;
144
+ caipNetworkId?: CaipNetworkId;
145
+ method?: Platform;
146
+ explorerId?: string;
147
+ reconnect?: boolean;
148
+ };
149
+ }
150
+ | {
151
+ type: 'track';
152
+ event: 'CONNECT_ERROR';
153
+ properties: {
154
+ message: string;
155
+ };
156
+ }
157
+ | {
158
+ type: 'track';
159
+ address?: string;
160
+ event: 'USER_REJECTED';
161
+ properties: {
162
+ message: string;
163
+ };
164
+ }
165
+ | {
166
+ type: 'track';
167
+ event: 'DISCONNECT_SUCCESS';
168
+ properties: {
169
+ namespace?: ChainNamespace;
170
+ };
171
+ }
172
+ | {
173
+ type: 'track';
174
+ event: 'DISCONNECT_ERROR';
175
+ }
176
+ | {
177
+ type: 'track';
178
+ event: 'CLICK_WALLET_HELP';
179
+ }
180
+ | {
181
+ type: 'track';
182
+ event: 'CLICK_NETWORK_HELP';
183
+ }
184
+ | {
185
+ type: 'track';
186
+ event: 'CLICK_GET_WALLET_HELP';
187
+ }
188
+ | {
189
+ type: 'track';
190
+ event: 'GET_WALLET';
191
+ properties: {
192
+ name: string;
193
+ explorerId?: string;
194
+ link?: string;
195
+ linkType?: 'appstore' | 'playstore';
196
+ walletRank?: number;
197
+ };
198
+ }
199
+ | {
200
+ type: 'track';
201
+ event: 'EMAIL_LOGIN_SELECTED';
202
+ }
203
+ | {
204
+ type: 'track';
205
+ event: 'EMAIL_VERIFICATION_CODE_PASS';
206
+ }
207
+ | {
208
+ type: 'track';
209
+ event: 'EMAIL_VERIFICATION_CODE_FAIL';
210
+ }
211
+ | {
212
+ type: 'track';
213
+ event: 'EMAIL_EDIT';
214
+ }
215
+ | {
216
+ type: 'track';
217
+ event: 'EMAIL_EDIT_COMPLETE';
218
+ }
219
+ | {
220
+ type: 'track';
221
+ event: 'EMAIL_UPGRADE_FROM_MODAL';
222
+ }
223
+ | {
224
+ type: 'track';
225
+ address?: string;
226
+ event: 'CLICK_SIGN_SIWX_MESSAGE';
227
+ properties: {
228
+ network?: CaipNetworkId;
229
+ isSmartAccount: boolean;
230
+ };
231
+ }
232
+ | {
233
+ type: 'track';
234
+ event: 'CLICK_CANCEL_SIWX';
235
+ properties: {
236
+ network?: CaipNetworkId;
237
+ isSmartAccount: boolean;
238
+ };
239
+ }
240
+ | {
241
+ type: 'track';
242
+ event: 'SIWX_AUTH_SUCCESS';
243
+ properties: {
244
+ network?: CaipNetworkId;
245
+ isSmartAccount: boolean;
246
+ };
247
+ }
248
+ | {
249
+ type: 'track';
250
+ event: 'SIWX_AUTH_ERROR';
251
+ properties: {
252
+ network?: CaipNetworkId;
253
+ isSmartAccount: boolean;
254
+ message?: string;
255
+ };
256
+ }
257
+ | {
258
+ type: 'track';
259
+ event: 'CLICK_TRANSACTIONS';
260
+ properties: {
261
+ isSmartAccount: boolean;
262
+ };
263
+ }
264
+ | {
265
+ type: 'track';
266
+ event: 'ERROR_FETCH_TRANSACTIONS';
267
+ properties: {
268
+ address: string;
269
+ projectId: string;
270
+ cursor: string | undefined;
271
+ isSmartAccount: boolean;
272
+ };
273
+ }
274
+ | {
275
+ type: 'track';
276
+ event: 'LOAD_MORE_TRANSACTIONS';
277
+ properties: {
278
+ address: string | undefined;
279
+ projectId: string;
280
+ cursor: string | undefined;
281
+ isSmartAccount: boolean;
282
+ };
283
+ }
284
+ | {
285
+ type: 'track';
286
+ event: 'OPEN_SEND';
287
+ properties: {
288
+ isSmartAccount: boolean;
289
+ network?: CaipNetworkId;
290
+ };
291
+ }
292
+ | {
293
+ type: 'track';
294
+ event: 'OPEN_SWAP';
295
+ properties: {
296
+ isSmartAccount: boolean;
297
+ network?: CaipNetworkId;
298
+ };
299
+ }
300
+ | {
301
+ type: 'track';
302
+ event: 'INITIATE_SWAP';
303
+ properties: {
304
+ isSmartAccount: boolean;
305
+ network?: CaipNetworkId;
306
+ swapFromToken: string;
307
+ swapToToken: string;
308
+ swapFromAmount: string;
309
+ swapToAmount: string;
310
+ };
311
+ }
312
+ | {
313
+ type: 'track';
314
+ event: 'SWAP_SUCCESS';
315
+ properties: {
316
+ isSmartAccount: boolean;
317
+ network?: CaipNetworkId;
318
+ swapFromToken: string;
319
+ swapToToken: string;
320
+ swapFromAmount: string;
321
+ swapToAmount: string;
322
+ };
323
+ }
324
+ | {
325
+ type: 'track';
326
+ event: 'SWAP_ERROR';
327
+ properties: {
328
+ isSmartAccount: boolean;
329
+ network?: CaipNetworkId;
330
+ swapFromToken: string;
331
+ swapToToken: string;
332
+ swapFromAmount: string;
333
+ swapToAmount: string;
334
+ message: string;
335
+ };
336
+ }
337
+ | {
338
+ type: 'track';
339
+ event: 'SEND_INITIATED';
340
+ properties: {
341
+ isSmartAccount: boolean;
342
+ network?: CaipNetworkId;
343
+ token: string;
344
+ amount: number;
345
+ };
346
+ }
347
+ | {
348
+ type: 'track';
349
+ event: 'SEND_SUCCESS';
350
+ properties: {
351
+ isSmartAccount: boolean;
352
+ network?: CaipNetworkId;
353
+ token: string;
354
+ amount: number;
355
+ };
356
+ }
357
+ | {
358
+ type: 'track';
359
+ event: 'SEND_ERROR';
360
+ properties: {
361
+ isSmartAccount: boolean;
362
+ network?: CaipNetworkId;
363
+ token: string;
364
+ amount: number;
365
+ };
366
+ }
367
+ | {
368
+ type: 'track';
369
+ event: 'SOCIAL_LOGIN_STARTED';
370
+ properties: {
371
+ provider: SocialProvider;
372
+ };
373
+ }
374
+ | {
375
+ type: 'track';
376
+ event: 'SOCIAL_LOGIN_SUCCESS';
377
+ properties: {
378
+ provider: SocialProvider;
379
+ };
380
+ }
381
+ | {
382
+ type: 'track';
383
+ event: 'SOCIAL_LOGIN_REQUEST_USER_DATA';
384
+ properties: {
385
+ provider: SocialProvider;
386
+ };
387
+ }
388
+ | {
389
+ type: 'track';
390
+ event: 'SOCIAL_LOGIN_CANCELED';
391
+ properties: {
392
+ provider: SocialProvider;
393
+ };
394
+ }
395
+ | {
396
+ type: 'track';
397
+ event: 'SOCIAL_LOGIN_ERROR';
398
+ properties: {
399
+ provider: SocialProvider;
400
+ };
401
+ }
402
+ | {
403
+ type: 'track';
404
+ event: 'SET_PREFERRED_ACCOUNT_TYPE';
405
+ properties: {
406
+ accountType: AccountType;
407
+ network: string;
408
+ };
409
+ }
410
+ | {
411
+ type: 'track';
412
+ event: 'SELECT_BUY_CRYPTO';
413
+ }
414
+ | {
415
+ type: 'track';
416
+ event: 'SELECT_BUY_ASSET';
417
+ properties: {
418
+ asset: string;
419
+ };
420
+ }
421
+ | {
422
+ type: 'track';
423
+ event: 'BUY_SUBMITTED';
424
+ properties: {
425
+ asset?: string;
426
+ network?: string;
427
+ amount?: string;
428
+ currency?: string;
429
+ provider?: string;
430
+ serviceProvider?: string;
431
+ paymentMethod?: string;
432
+ };
433
+ }
434
+ | {
435
+ type: 'track';
436
+ event: 'BUY_SUCCESS';
437
+ properties: {
438
+ asset?: string | null;
439
+ network?: string | null;
440
+ amount?: string | null;
441
+ currency?: string | null;
442
+ provider?: string | null;
443
+ orderId?: string | null;
444
+ };
445
+ }
446
+ | {
447
+ type: 'track';
448
+ event: 'BUY_FAIL';
449
+ properties: {
450
+ asset?: string;
451
+ network?: string;
452
+ amount?: string;
453
+ currency?: string;
454
+ provider?: string;
455
+ serviceProvider?: string;
456
+ paymentMethod?: string;
457
+ message?: string;
458
+ };
459
+ }
460
+ | {
461
+ type: 'track';
462
+ event: 'BUY_CANCEL';
463
+ properties?: {
464
+ message?: string;
465
+ };
466
+ }
467
+ | {
468
+ type: 'track';
469
+ event: 'WALLET_IMPRESSION';
470
+ items: Array<WalletImpressionItem>;
471
+ };
@@ -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
+ }