@reown/appkit-common-react-native 2.0.0-alpha.2 → 2.0.0-alpha.4

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 (237) hide show
  1. package/lib/commonjs/adapters/BlockchainAdapter.js +25 -12
  2. package/lib/commonjs/adapters/BlockchainAdapter.js.map +1 -1
  3. package/lib/commonjs/adapters/EvmAdapter.js +0 -11
  4. package/lib/commonjs/adapters/EvmAdapter.js.map +1 -1
  5. package/lib/commonjs/index.js +4 -4
  6. package/lib/commonjs/index.js.map +1 -1
  7. package/lib/commonjs/types/api/blockchain-api.js +15 -0
  8. package/lib/commonjs/types/api/blockchain-api.js.map +1 -0
  9. package/lib/commonjs/types/api/events.js +6 -0
  10. package/lib/commonjs/types/api/events.js.map +1 -0
  11. package/lib/commonjs/types/api/index.js +39 -0
  12. package/lib/commonjs/types/api/index.js.map +1 -0
  13. package/lib/commonjs/types/api/wallet-api.js +6 -0
  14. package/lib/commonjs/types/api/wallet-api.js.map +1 -0
  15. package/lib/commonjs/types/blockchain/adapter.js +6 -0
  16. package/lib/commonjs/types/blockchain/adapter.js.map +1 -0
  17. package/lib/commonjs/types/blockchain/balance.js +6 -0
  18. package/lib/commonjs/types/blockchain/balance.js.map +1 -0
  19. package/lib/commonjs/types/blockchain/index.js +50 -0
  20. package/lib/commonjs/types/blockchain/index.js.map +1 -0
  21. package/lib/commonjs/types/blockchain/network.js +6 -0
  22. package/lib/commonjs/types/blockchain/network.js.map +1 -0
  23. package/lib/commonjs/types/blockchain/transaction.js +2 -0
  24. package/lib/commonjs/types/blockchain/transaction.js.map +1 -0
  25. package/lib/commonjs/types/common.js +2 -0
  26. package/lib/commonjs/types/common.js.map +1 -0
  27. package/lib/commonjs/types/index.js +105 -0
  28. package/lib/commonjs/types/index.js.map +1 -0
  29. package/lib/commonjs/types/onramp/countries.js +2 -0
  30. package/lib/commonjs/types/onramp/countries.js.map +1 -0
  31. package/lib/commonjs/types/onramp/currencies.js +2 -0
  32. package/lib/commonjs/types/onramp/currencies.js.map +1 -0
  33. package/lib/commonjs/types/onramp/errors.js +22 -0
  34. package/lib/commonjs/types/onramp/errors.js.map +1 -0
  35. package/lib/commonjs/types/onramp/index.js +50 -0
  36. package/lib/commonjs/types/onramp/index.js.map +1 -0
  37. package/lib/commonjs/types/onramp/quotes.js +2 -0
  38. package/lib/commonjs/types/onramp/quotes.js.map +1 -0
  39. package/lib/commonjs/types/siwe/config.js +6 -0
  40. package/lib/commonjs/types/siwe/config.js.map +1 -0
  41. package/lib/commonjs/types/siwe/index.js +28 -0
  42. package/lib/commonjs/types/siwe/index.js.map +1 -0
  43. package/lib/commonjs/types/siwe/message.js +6 -0
  44. package/lib/commonjs/types/siwe/message.js.map +1 -0
  45. package/lib/commonjs/types/storage.js +2 -0
  46. package/lib/commonjs/types/storage.js.map +1 -0
  47. package/lib/commonjs/types/swap/index.js +17 -0
  48. package/lib/commonjs/types/swap/index.js.map +1 -0
  49. package/lib/commonjs/types/swap/tokens.js +6 -0
  50. package/lib/commonjs/types/swap/tokens.js.map +1 -0
  51. package/lib/commonjs/types/ui.js +6 -0
  52. package/lib/commonjs/types/ui.js.map +1 -0
  53. package/lib/commonjs/types/wallet/connection.js +6 -0
  54. package/lib/commonjs/types/wallet/connection.js.map +1 -0
  55. package/lib/commonjs/{utils/TypeUtil.js → types/wallet/connector.js} +1 -15
  56. package/lib/commonjs/types/wallet/connector.js.map +1 -0
  57. package/lib/commonjs/types/wallet/index.js +39 -0
  58. package/lib/commonjs/types/wallet/index.js.map +1 -0
  59. package/lib/commonjs/types/wallet/wallet-info.js +6 -0
  60. package/lib/commonjs/types/wallet/wallet-info.js.map +1 -0
  61. package/lib/commonjs/utils/ConstantsUtil.js +27 -7
  62. package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
  63. package/lib/commonjs/utils/NetworkUtil.js +3 -0
  64. package/lib/commonjs/utils/NetworkUtil.js.map +1 -1
  65. package/lib/module/adapters/BlockchainAdapter.js +25 -12
  66. package/lib/module/adapters/BlockchainAdapter.js.map +1 -1
  67. package/lib/module/adapters/EvmAdapter.js +0 -11
  68. package/lib/module/adapters/EvmAdapter.js.map +1 -1
  69. package/lib/module/index.js +1 -1
  70. package/lib/module/index.js.map +1 -1
  71. package/lib/module/types/api/blockchain-api.js +10 -0
  72. package/lib/module/types/api/blockchain-api.js.map +1 -0
  73. package/lib/module/types/api/events.js +4 -0
  74. package/lib/module/types/api/events.js.map +1 -0
  75. package/lib/module/types/api/index.js +7 -0
  76. package/lib/module/types/api/index.js.map +1 -0
  77. package/lib/module/types/api/wallet-api.js +4 -0
  78. package/lib/module/types/api/wallet-api.js.map +1 -0
  79. package/lib/module/types/blockchain/adapter.js +4 -0
  80. package/lib/module/types/blockchain/adapter.js.map +1 -0
  81. package/lib/module/types/blockchain/balance.js +4 -0
  82. package/lib/module/types/blockchain/balance.js.map +1 -0
  83. package/lib/module/types/blockchain/index.js +8 -0
  84. package/lib/module/types/blockchain/index.js.map +1 -0
  85. package/lib/module/types/blockchain/network.js +4 -0
  86. package/lib/module/types/blockchain/network.js.map +1 -0
  87. package/lib/module/types/blockchain/transaction.js +2 -0
  88. package/lib/module/types/blockchain/transaction.js.map +1 -0
  89. package/lib/module/types/common.js +2 -0
  90. package/lib/module/types/common.js.map +1 -0
  91. package/lib/module/types/index.js +31 -0
  92. package/lib/module/types/index.js.map +1 -0
  93. package/lib/module/types/onramp/countries.js +2 -0
  94. package/lib/module/types/onramp/countries.js.map +1 -0
  95. package/lib/module/types/onramp/currencies.js +2 -0
  96. package/lib/module/types/onramp/currencies.js.map +1 -0
  97. package/lib/module/types/onramp/errors.js +18 -0
  98. package/lib/module/types/onramp/errors.js.map +1 -0
  99. package/lib/module/types/onramp/index.js +8 -0
  100. package/lib/module/types/onramp/index.js.map +1 -0
  101. package/lib/module/types/onramp/quotes.js +2 -0
  102. package/lib/module/types/onramp/quotes.js.map +1 -0
  103. package/lib/module/types/siwe/config.js +4 -0
  104. package/lib/module/types/siwe/config.js.map +1 -0
  105. package/lib/module/types/siwe/index.js +6 -0
  106. package/lib/module/types/siwe/index.js.map +1 -0
  107. package/lib/module/types/siwe/message.js +4 -0
  108. package/lib/module/types/siwe/message.js.map +1 -0
  109. package/lib/module/types/storage.js +2 -0
  110. package/lib/module/types/storage.js.map +1 -0
  111. package/lib/module/types/swap/index.js +5 -0
  112. package/lib/module/types/swap/index.js.map +1 -0
  113. package/lib/module/types/swap/tokens.js +4 -0
  114. package/lib/module/types/swap/tokens.js.map +1 -0
  115. package/lib/module/types/ui.js +4 -0
  116. package/lib/module/types/ui.js.map +1 -0
  117. package/lib/module/types/wallet/connection.js +4 -0
  118. package/lib/module/types/wallet/connection.js.map +1 -0
  119. package/lib/module/{utils/TypeUtil.js → types/wallet/connector.js} +1 -16
  120. package/lib/module/types/wallet/connector.js.map +1 -0
  121. package/lib/module/types/wallet/index.js +7 -0
  122. package/lib/module/types/wallet/index.js.map +1 -0
  123. package/lib/module/types/wallet/wallet-info.js +4 -0
  124. package/lib/module/types/wallet/wallet-info.js.map +1 -0
  125. package/lib/module/utils/ConstantsUtil.js +27 -7
  126. package/lib/module/utils/ConstantsUtil.js.map +1 -1
  127. package/lib/module/utils/NetworkUtil.js +3 -0
  128. package/lib/module/utils/NetworkUtil.js.map +1 -1
  129. package/lib/typescript/adapters/BlockchainAdapter.d.ts +5 -4
  130. package/lib/typescript/adapters/BlockchainAdapter.d.ts.map +1 -1
  131. package/lib/typescript/adapters/EvmAdapter.d.ts +1 -2
  132. package/lib/typescript/adapters/EvmAdapter.d.ts.map +1 -1
  133. package/lib/typescript/index.d.ts +1 -1
  134. package/lib/typescript/index.d.ts.map +1 -1
  135. package/lib/typescript/networks/bitcoin.d.ts +1 -1
  136. package/lib/typescript/networks/bitcoin.d.ts.map +1 -1
  137. package/lib/typescript/networks/solana.d.ts +1 -1
  138. package/lib/typescript/networks/solana.d.ts.map +1 -1
  139. package/lib/typescript/types/api/blockchain-api.d.ts +183 -0
  140. package/lib/typescript/types/api/blockchain-api.d.ts.map +1 -0
  141. package/lib/typescript/types/api/events.d.ts +304 -0
  142. package/lib/typescript/types/api/events.d.ts.map +1 -0
  143. package/lib/typescript/types/api/index.d.ts +4 -0
  144. package/lib/typescript/types/api/index.d.ts.map +1 -0
  145. package/lib/typescript/types/api/wallet-api.d.ts +50 -0
  146. package/lib/typescript/types/api/wallet-api.d.ts.map +1 -0
  147. package/lib/typescript/types/blockchain/adapter.d.ts +40 -0
  148. package/lib/typescript/types/blockchain/adapter.d.ts.map +1 -0
  149. package/lib/typescript/types/blockchain/balance.d.ts +28 -0
  150. package/lib/typescript/types/blockchain/balance.d.ts.map +1 -0
  151. package/lib/typescript/types/blockchain/index.d.ts +5 -0
  152. package/lib/typescript/types/blockchain/index.d.ts.map +1 -0
  153. package/lib/typescript/types/blockchain/network.d.ts +47 -0
  154. package/lib/typescript/types/blockchain/network.d.ts.map +1 -0
  155. package/lib/typescript/types/blockchain/transaction.d.ts +63 -0
  156. package/lib/typescript/types/blockchain/transaction.d.ts.map +1 -0
  157. package/lib/typescript/types/common.d.ts +24 -0
  158. package/lib/typescript/types/common.d.ts.map +1 -0
  159. package/lib/typescript/types/index.d.ts +10 -0
  160. package/lib/typescript/types/index.d.ts.map +1 -0
  161. package/lib/typescript/types/onramp/countries.d.ts +11 -0
  162. package/lib/typescript/types/onramp/countries.d.ts.map +1 -0
  163. package/lib/typescript/types/onramp/currencies.d.ts +30 -0
  164. package/lib/typescript/types/onramp/currencies.d.ts.map +1 -0
  165. package/lib/typescript/types/onramp/errors.d.ts +21 -0
  166. package/lib/typescript/types/onramp/errors.d.ts.map +1 -0
  167. package/lib/typescript/types/onramp/index.d.ts +5 -0
  168. package/lib/typescript/types/onramp/index.d.ts.map +1 -0
  169. package/lib/typescript/types/onramp/quotes.d.ts +45 -0
  170. package/lib/typescript/types/onramp/quotes.d.ts.map +1 -0
  171. package/lib/typescript/types/siwe/config.d.ts +31 -0
  172. package/lib/typescript/types/siwe/config.d.ts.map +1 -0
  173. package/lib/typescript/types/siwe/index.d.ts +3 -0
  174. package/lib/typescript/types/siwe/index.d.ts.map +1 -0
  175. package/lib/typescript/types/siwe/message.d.ts +57 -0
  176. package/lib/typescript/types/siwe/message.d.ts.map +1 -0
  177. package/lib/typescript/types/storage.d.ts +27 -0
  178. package/lib/typescript/types/storage.d.ts.map +1 -0
  179. package/lib/typescript/types/swap/index.d.ts +2 -0
  180. package/lib/typescript/types/swap/index.d.ts.map +1 -0
  181. package/lib/typescript/types/swap/tokens.d.ts +19 -0
  182. package/lib/typescript/types/swap/tokens.d.ts.map +1 -0
  183. package/lib/typescript/types/ui.d.ts +26 -0
  184. package/lib/typescript/types/ui.d.ts.map +1 -0
  185. package/lib/typescript/types/wallet/connection.d.ts +30 -0
  186. package/lib/typescript/types/wallet/connection.d.ts.map +1 -0
  187. package/lib/typescript/types/wallet/connector.d.ts +61 -0
  188. package/lib/typescript/types/wallet/connector.d.ts.map +1 -0
  189. package/lib/typescript/types/wallet/index.d.ts +4 -0
  190. package/lib/typescript/types/wallet/index.d.ts.map +1 -0
  191. package/lib/typescript/types/wallet/wallet-info.d.ts +36 -0
  192. package/lib/typescript/types/wallet/wallet-info.d.ts.map +1 -0
  193. package/lib/typescript/utils/ConstantsUtil.d.ts +25 -5
  194. package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
  195. package/lib/typescript/utils/NetworkUtil.d.ts +2 -0
  196. package/lib/typescript/utils/NetworkUtil.d.ts.map +1 -1
  197. package/package.json +1 -1
  198. package/src/adapters/BlockchainAdapter.ts +34 -15
  199. package/src/adapters/EvmAdapter.ts +1 -13
  200. package/src/adapters/__tests__/EvmAdapter.test.ts +2 -2
  201. package/src/index.ts +2 -1
  202. package/src/networks/bitcoin.ts +1 -1
  203. package/src/networks/solana.ts +1 -1
  204. package/src/types/api/blockchain-api.ts +213 -0
  205. package/src/types/api/events.ts +394 -0
  206. package/src/types/api/index.ts +4 -0
  207. package/src/types/api/wallet-api.ts +70 -0
  208. package/src/types/blockchain/adapter.ts +52 -0
  209. package/src/types/blockchain/balance.ts +31 -0
  210. package/src/types/blockchain/index.ts +5 -0
  211. package/src/types/blockchain/network.ts +39 -0
  212. package/src/types/blockchain/transaction.ts +71 -0
  213. package/src/types/common.ts +56 -0
  214. package/src/types/index.ts +28 -0
  215. package/src/types/onramp/countries.ts +11 -0
  216. package/src/types/onramp/currencies.ts +32 -0
  217. package/src/types/onramp/errors.ts +22 -0
  218. package/src/types/onramp/index.ts +5 -0
  219. package/src/types/onramp/quotes.ts +46 -0
  220. package/src/types/siwe/config.ts +44 -0
  221. package/src/types/siwe/index.ts +3 -0
  222. package/src/types/siwe/message.ts +62 -0
  223. package/src/types/storage.ts +30 -0
  224. package/src/types/swap/index.ts +2 -0
  225. package/src/types/swap/tokens.ts +21 -0
  226. package/src/types/ui.ts +26 -0
  227. package/src/types/wallet/connection.ts +33 -0
  228. package/src/types/wallet/connector.ts +85 -0
  229. package/src/types/wallet/index.ts +4 -0
  230. package/src/types/wallet/wallet-info.ts +41 -0
  231. package/src/utils/ConstantsUtil.ts +29 -9
  232. package/src/utils/NetworkUtil.ts +5 -0
  233. package/lib/commonjs/utils/TypeUtil.js.map +0 -1
  234. package/lib/module/utils/TypeUtil.js.map +0 -1
  235. package/lib/typescript/utils/TypeUtil.d.ts +0 -394
  236. package/lib/typescript/utils/TypeUtil.d.ts.map +0 -1
  237. package/src/utils/TypeUtil.ts +0 -493
@@ -0,0 +1,394 @@
1
+ import type { Platform, SocialProvider, AccountType } from '../common';
2
+
3
+ export type EventName =
4
+ | 'MODAL_LOADED'
5
+ | 'MODAL_OPEN'
6
+ | 'MODAL_CLOSE'
7
+ | 'CLICK_ALL_WALLETS'
8
+ | 'CLICK_NETWORKS'
9
+ | 'SWITCH_NETWORK'
10
+ | 'SELECT_WALLET'
11
+ | 'CONNECT_SUCCESS'
12
+ | 'CONNECT_ERROR'
13
+ | 'DISCONNECT_SUCCESS'
14
+ | 'DISCONNECT_ERROR'
15
+ | 'CLICK_WALLET_HELP'
16
+ | 'CLICK_NETWORK_HELP'
17
+ | 'CLICK_GET_WALLET'
18
+ | 'EMAIL_LOGIN_SELECTED'
19
+ | 'EMAIL_VERIFICATION_CODE_PASS'
20
+ | 'EMAIL_VERIFICATION_CODE_FAIL'
21
+ | 'EMAIL_EDIT'
22
+ | 'EMAIL_EDIT_COMPLETE'
23
+ | 'EMAIL_UPGRADE_FROM_MODAL'
24
+ | 'CLICK_SIGN_SIWE_MESSAGE'
25
+ | 'CLICK_CANCEL_SIWE'
26
+ | 'SIWE_AUTH_SUCCESS'
27
+ | 'SIWE_AUTH_ERROR'
28
+ | 'CLICK_TRANSACTIONS'
29
+ | 'ERROR_FETCH_TRANSACTIONS'
30
+ | 'LOAD_MORE_TRANSACTIONS'
31
+ | 'OPEN_SEND'
32
+ | 'OPEN_SWAP'
33
+ | 'INITIATE_SWAP'
34
+ | 'SWAP_SUCCESS'
35
+ | 'SWAP_ERROR'
36
+ | 'SEND_INITIATED'
37
+ | 'SEND_SUCCESS'
38
+ | 'SEND_ERROR'
39
+ | 'SOCIAL_LOGIN_STARTED'
40
+ | 'SOCIAL_LOGIN_SUCCESS'
41
+ | 'SOCIAL_LOGIN_REQUEST_USER_DATA'
42
+ | 'SOCIAL_LOGIN_CANCELED'
43
+ | 'SOCIAL_LOGIN_ERROR'
44
+ | 'SET_PREFERRED_ACCOUNT_TYPE';
45
+
46
+ export type Event =
47
+ | {
48
+ type: 'track';
49
+ event: 'MODAL_CREATED';
50
+ }
51
+ | {
52
+ type: 'track';
53
+ event: 'MODAL_LOADED';
54
+ }
55
+ | {
56
+ type: 'track';
57
+ event: 'MODAL_OPEN';
58
+ properties: {
59
+ connected: boolean;
60
+ };
61
+ }
62
+ | {
63
+ type: 'track';
64
+ event: 'MODAL_CLOSE';
65
+ properties: {
66
+ connected: boolean;
67
+ };
68
+ }
69
+ | {
70
+ type: 'track';
71
+ event: 'CLICK_ALL_WALLETS';
72
+ }
73
+ | {
74
+ type: 'track';
75
+ event: 'CLICK_NETWORKS';
76
+ }
77
+ | {
78
+ type: 'track';
79
+ event: 'SWITCH_NETWORK';
80
+ properties: {
81
+ network: number | string;
82
+ };
83
+ }
84
+ | {
85
+ type: 'track';
86
+ event: 'SELECT_WALLET';
87
+ properties: {
88
+ name: string;
89
+ platform?: Platform;
90
+ explorer_id?: string;
91
+ };
92
+ }
93
+ | {
94
+ type: 'track';
95
+ event: 'CONNECT_SUCCESS';
96
+ properties: {
97
+ name: string;
98
+ method: Platform;
99
+ explorer_id?: string;
100
+ };
101
+ }
102
+ | {
103
+ type: 'track';
104
+ event: 'CONNECT_ERROR';
105
+ properties: {
106
+ message: string;
107
+ };
108
+ }
109
+ | {
110
+ type: 'track';
111
+ event: 'DISCONNECT_SUCCESS';
112
+ }
113
+ | {
114
+ type: 'track';
115
+ event: 'DISCONNECT_ERROR';
116
+ }
117
+ | {
118
+ type: 'track';
119
+ event: 'CLICK_WALLET_HELP';
120
+ }
121
+ | {
122
+ type: 'track';
123
+ event: 'CLICK_NETWORK_HELP';
124
+ }
125
+ | {
126
+ type: 'track';
127
+ event: 'CLICK_GET_WALLET';
128
+ }
129
+ | {
130
+ type: 'track';
131
+ event: 'EMAIL_LOGIN_SELECTED';
132
+ }
133
+ | {
134
+ type: 'track';
135
+ event: 'EMAIL_VERIFICATION_CODE_PASS';
136
+ }
137
+ | {
138
+ type: 'track';
139
+ event: 'EMAIL_VERIFICATION_CODE_FAIL';
140
+ }
141
+ | {
142
+ type: 'track';
143
+ event: 'EMAIL_EDIT';
144
+ }
145
+ | {
146
+ type: 'track';
147
+ event: 'EMAIL_EDIT_COMPLETE';
148
+ }
149
+ | {
150
+ type: 'track';
151
+ event: 'EMAIL_UPGRADE_FROM_MODAL';
152
+ }
153
+ | {
154
+ type: 'track';
155
+ event: 'CLICK_SIGN_SIWE_MESSAGE';
156
+ properties: {
157
+ network: string;
158
+ isSmartAccount: boolean;
159
+ };
160
+ }
161
+ | {
162
+ type: 'track';
163
+ event: 'CLICK_CANCEL_SIWE';
164
+ properties: {
165
+ network: string;
166
+ isSmartAccount: boolean;
167
+ };
168
+ }
169
+ | {
170
+ type: 'track';
171
+ event: 'SIWE_AUTH_SUCCESS';
172
+ properties: {
173
+ network: string;
174
+ isSmartAccount: boolean;
175
+ };
176
+ }
177
+ | {
178
+ type: 'track';
179
+ event: 'SIWE_AUTH_ERROR';
180
+ properties: {
181
+ network: string;
182
+ isSmartAccount: boolean;
183
+ };
184
+ }
185
+ | {
186
+ type: 'track';
187
+ event: 'CLICK_TRANSACTIONS';
188
+ properties: {
189
+ isSmartAccount: boolean;
190
+ };
191
+ }
192
+ | {
193
+ type: 'track';
194
+ event: 'ERROR_FETCH_TRANSACTIONS';
195
+ properties: {
196
+ address: string;
197
+ projectId: string;
198
+ cursor: string | undefined;
199
+ isSmartAccount: boolean;
200
+ };
201
+ }
202
+ | {
203
+ type: 'track';
204
+ event: 'LOAD_MORE_TRANSACTIONS';
205
+ properties: {
206
+ address: string | undefined;
207
+ projectId: string;
208
+ cursor: string | undefined;
209
+ isSmartAccount: boolean;
210
+ };
211
+ }
212
+ | {
213
+ type: 'track';
214
+ event: 'OPEN_SEND';
215
+ properties: {
216
+ isSmartAccount: boolean;
217
+ network: string;
218
+ };
219
+ }
220
+ | {
221
+ type: 'track';
222
+ event: 'OPEN_SWAP';
223
+ properties: {
224
+ isSmartAccount: boolean;
225
+ network: string;
226
+ };
227
+ }
228
+ | {
229
+ type: 'track';
230
+ event: 'INITIATE_SWAP';
231
+ properties: {
232
+ isSmartAccount: boolean;
233
+ network: string;
234
+ swapFromToken: string;
235
+ swapToToken: string;
236
+ swapFromAmount: string;
237
+ swapToAmount: string;
238
+ };
239
+ }
240
+ | {
241
+ type: 'track';
242
+ event: 'SWAP_SUCCESS';
243
+ properties: {
244
+ isSmartAccount: boolean;
245
+ network: string;
246
+ swapFromToken: string;
247
+ swapToToken: string;
248
+ swapFromAmount: string;
249
+ swapToAmount: string;
250
+ };
251
+ }
252
+ | {
253
+ type: 'track';
254
+ event: 'SWAP_ERROR';
255
+ properties: {
256
+ isSmartAccount: boolean;
257
+ network: string;
258
+ swapFromToken: string;
259
+ swapToToken: string;
260
+ swapFromAmount: string;
261
+ swapToAmount: string;
262
+ message: string;
263
+ };
264
+ }
265
+ | {
266
+ type: 'track';
267
+ event: 'SEND_INITIATED';
268
+ properties: {
269
+ isSmartAccount: boolean;
270
+ network: string;
271
+ token: string;
272
+ amount: number;
273
+ };
274
+ }
275
+ | {
276
+ type: 'track';
277
+ event: 'SEND_SUCCESS';
278
+ properties: {
279
+ isSmartAccount: boolean;
280
+ network: string;
281
+ token: string;
282
+ amount: number;
283
+ };
284
+ }
285
+ | {
286
+ type: 'track';
287
+ event: 'SEND_ERROR';
288
+ properties: {
289
+ isSmartAccount: boolean;
290
+ network: string;
291
+ token: string;
292
+ amount: number;
293
+ };
294
+ }
295
+ | {
296
+ type: 'track';
297
+ event: 'SOCIAL_LOGIN_STARTED';
298
+ properties: {
299
+ provider: SocialProvider;
300
+ };
301
+ }
302
+ | {
303
+ type: 'track';
304
+ event: 'SOCIAL_LOGIN_SUCCESS';
305
+ properties: {
306
+ provider: SocialProvider;
307
+ };
308
+ }
309
+ | {
310
+ type: 'track';
311
+ event: 'SOCIAL_LOGIN_REQUEST_USER_DATA';
312
+ properties: {
313
+ provider: SocialProvider;
314
+ };
315
+ }
316
+ | {
317
+ type: 'track';
318
+ event: 'SOCIAL_LOGIN_CANCELED';
319
+ properties: {
320
+ provider: SocialProvider;
321
+ };
322
+ }
323
+ | {
324
+ type: 'track';
325
+ event: 'SOCIAL_LOGIN_ERROR';
326
+ properties: {
327
+ provider: SocialProvider;
328
+ };
329
+ }
330
+ | {
331
+ type: 'track';
332
+ event: 'SET_PREFERRED_ACCOUNT_TYPE';
333
+ properties: {
334
+ accountType: AccountType;
335
+ network: string;
336
+ };
337
+ }
338
+ | {
339
+ type: 'track';
340
+ event: 'SELECT_BUY_CRYPTO';
341
+ }
342
+ | {
343
+ type: 'track';
344
+ event: 'SELECT_BUY_ASSET';
345
+ properties: {
346
+ asset: string;
347
+ };
348
+ }
349
+ | {
350
+ type: 'track';
351
+ event: 'BUY_SUBMITTED';
352
+ properties: {
353
+ asset?: string;
354
+ network?: string;
355
+ amount?: string;
356
+ currency?: string;
357
+ provider?: string;
358
+ serviceProvider?: string;
359
+ paymentMethod?: string;
360
+ };
361
+ }
362
+ | {
363
+ type: 'track';
364
+ event: 'BUY_SUCCESS';
365
+ properties: {
366
+ asset?: string | null;
367
+ network?: string | null;
368
+ amount?: string | null;
369
+ currency?: string | null;
370
+ provider?: string | null;
371
+ orderId?: string | null;
372
+ };
373
+ }
374
+ | {
375
+ type: 'track';
376
+ event: 'BUY_FAIL';
377
+ properties: {
378
+ asset?: string;
379
+ network?: string;
380
+ amount?: string;
381
+ currency?: string;
382
+ provider?: string;
383
+ serviceProvider?: string;
384
+ paymentMethod?: string;
385
+ message?: string;
386
+ };
387
+ }
388
+ | {
389
+ type: 'track';
390
+ event: 'BUY_CANCEL';
391
+ properties?: {
392
+ message?: string;
393
+ };
394
+ };
@@ -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,70 @@
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
+ }
18
+
19
+ export interface DataWallet {
20
+ id: string;
21
+ ios_schema?: string;
22
+ android_app_id?: string;
23
+ }
24
+
25
+ export interface ApiGetWalletsRequest {
26
+ page: number;
27
+ entries: number;
28
+ search?: string;
29
+ include?: string[];
30
+ exclude?: string[];
31
+ }
32
+
33
+ export interface ApiGetWalletsResponse {
34
+ data: WcWallet[];
35
+ count: number;
36
+ }
37
+
38
+ export interface ApiGetDataWalletsResponse {
39
+ data: DataWallet[];
40
+ count: number;
41
+ }
42
+
43
+ export interface ApiGetAnalyticsConfigResponse {
44
+ isAnalyticsEnabled: boolean;
45
+ }
46
+
47
+ export type CustomWallet = Pick<
48
+ WcWallet,
49
+ | 'id'
50
+ | 'name'
51
+ | 'homepage'
52
+ | 'image_url'
53
+ | 'image_id'
54
+ | 'mobile_link'
55
+ | 'desktop_link'
56
+ | 'webapp_link'
57
+ | 'link_mode'
58
+ | 'app_store'
59
+ | 'play_store'
60
+ > & {
61
+ android_app_id?: string;
62
+ ios_schema?: string;
63
+ };
64
+
65
+ export type UniversalProviderConfigOverride = {
66
+ methods?: Record<string, string[]>;
67
+ chains?: Record<string, string[]>;
68
+ events?: Record<string, string[]>;
69
+ rpcMap?: Record<string, string>;
70
+ };
@@ -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; // 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' | 'Networks' | 'Swap' | 'OnRamp';
39
+ }
@@ -0,0 +1,71 @@
1
+ export type TransactionStatus = 'confirmed' | 'failed' | 'pending';
2
+ export type TransactionDirection = 'in' | 'out' | 'self';
3
+ export type TransactionImage = {
4
+ type: 'FUNGIBLE' | 'NFT' | undefined;
5
+ url: string | undefined;
6
+ };
7
+
8
+ export interface Transaction {
9
+ id: string;
10
+ metadata: TransactionMetadata;
11
+ transfers: TransactionTransfer[];
12
+ }
13
+
14
+ export interface TransactionMetadata {
15
+ application: {
16
+ iconUrl: string | null;
17
+ name: string | null;
18
+ };
19
+ operationType: string;
20
+ hash: string;
21
+ minedAt: string;
22
+ sentFrom: string;
23
+ sentTo: string;
24
+ status: TransactionStatus;
25
+ nonce: number;
26
+ chain?: string;
27
+ }
28
+
29
+ export interface TransactionTransfer {
30
+ fungible_info?: {
31
+ name?: string;
32
+ symbol?: string;
33
+ icon?: {
34
+ url: string;
35
+ };
36
+ };
37
+ nft_info?: TransactionNftInfo;
38
+ direction: TransactionDirection;
39
+ quantity: TransactionQuantity;
40
+ value?: number;
41
+ price?: number;
42
+ }
43
+
44
+ export interface TransactionNftInfo {
45
+ name?: string;
46
+ content?: TransactionContent;
47
+ flags: TransactionNftInfoFlags;
48
+ }
49
+
50
+ export interface TransactionNftInfoFlags {
51
+ is_spam: boolean;
52
+ }
53
+
54
+ export interface TransactionContent {
55
+ preview?: TransactionPreview;
56
+ detail?: TransactionDetail;
57
+ }
58
+
59
+ export interface TransactionPreview {
60
+ url: string;
61
+ content_type?: null;
62
+ }
63
+
64
+ export interface TransactionDetail {
65
+ url: string;
66
+ content_type?: null;
67
+ }
68
+
69
+ export interface TransactionQuantity {
70
+ numeric: string;
71
+ }