@reown/appkit-core-react-native 2.0.0-alpha.1 → 2.0.0-alpha.3

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 (228) hide show
  1. package/lib/commonjs/controllers/ApiController.js +16 -21
  2. package/lib/commonjs/controllers/ApiController.js.map +1 -1
  3. package/lib/commonjs/controllers/AssetController.js +0 -4
  4. package/lib/commonjs/controllers/AssetController.js.map +1 -1
  5. package/lib/commonjs/controllers/BlockchainApiController.js +102 -112
  6. package/lib/commonjs/controllers/BlockchainApiController.js.map +1 -1
  7. package/lib/commonjs/controllers/ConnectionsController.js +248 -51
  8. package/lib/commonjs/controllers/ConnectionsController.js.map +1 -1
  9. package/lib/commonjs/controllers/EnsController.js +4 -4
  10. package/lib/commonjs/controllers/EnsController.js.map +1 -1
  11. package/lib/commonjs/controllers/EventsController.js +4 -4
  12. package/lib/commonjs/controllers/EventsController.js.map +1 -1
  13. package/lib/commonjs/controllers/ModalController.js +6 -7
  14. package/lib/commonjs/controllers/ModalController.js.map +1 -1
  15. package/lib/commonjs/controllers/OnRampController.js +117 -53
  16. package/lib/commonjs/controllers/OnRampController.js.map +1 -1
  17. package/lib/commonjs/controllers/OptionsController.js +10 -4
  18. package/lib/commonjs/controllers/OptionsController.js.map +1 -1
  19. package/lib/commonjs/controllers/PublicStateController.js.map +1 -1
  20. package/lib/commonjs/controllers/RouterController.js +6 -21
  21. package/lib/commonjs/controllers/RouterController.js.map +1 -1
  22. package/lib/commonjs/controllers/SendController.js +100 -100
  23. package/lib/commonjs/controllers/SendController.js.map +1 -1
  24. package/lib/commonjs/controllers/SnackController.js +29 -5
  25. package/lib/commonjs/controllers/SnackController.js.map +1 -1
  26. package/lib/commonjs/controllers/SwapController.js +109 -117
  27. package/lib/commonjs/controllers/SwapController.js.map +1 -1
  28. package/lib/commonjs/controllers/ThemeController.js.map +1 -1
  29. package/lib/commonjs/controllers/TransactionsController.js +23 -19
  30. package/lib/commonjs/controllers/TransactionsController.js.map +1 -1
  31. package/lib/commonjs/controllers/WcController.js +73 -0
  32. package/lib/commonjs/controllers/WcController.js.map +1 -0
  33. package/lib/commonjs/index.js +3 -38
  34. package/lib/commonjs/index.js.map +1 -1
  35. package/lib/commonjs/package.json +1 -0
  36. package/lib/commonjs/utils/ApiUtil.js.map +1 -1
  37. package/lib/commonjs/utils/AssetUtil.js +6 -14
  38. package/lib/commonjs/utils/AssetUtil.js.map +1 -1
  39. package/lib/commonjs/utils/ConstantsUtil.js +13 -425
  40. package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
  41. package/lib/commonjs/utils/CoreHelperUtil.js +13 -8
  42. package/lib/commonjs/utils/CoreHelperUtil.js.map +1 -1
  43. package/lib/commonjs/utils/EventUtil.js.map +1 -1
  44. package/lib/commonjs/utils/FetchUtil.js +34 -10
  45. package/lib/commonjs/utils/FetchUtil.js.map +1 -1
  46. package/lib/commonjs/utils/RouterUtil.js.map +1 -1
  47. package/lib/commonjs/utils/StorageUtil.js +77 -129
  48. package/lib/commonjs/utils/StorageUtil.js.map +1 -1
  49. package/lib/commonjs/utils/SwapApiUtil.js +2 -17
  50. package/lib/commonjs/utils/SwapApiUtil.js.map +1 -1
  51. package/lib/commonjs/utils/SwapCalculationUtil.js.map +1 -1
  52. package/lib/module/controllers/ApiController.js +17 -21
  53. package/lib/module/controllers/ApiController.js.map +1 -1
  54. package/lib/module/controllers/AssetController.js +2 -4
  55. package/lib/module/controllers/AssetController.js.map +1 -1
  56. package/lib/module/controllers/BlockchainApiController.js +103 -111
  57. package/lib/module/controllers/BlockchainApiController.js.map +1 -1
  58. package/lib/module/controllers/ConnectionsController.js +250 -51
  59. package/lib/module/controllers/ConnectionsController.js.map +1 -1
  60. package/lib/module/controllers/EnsController.js +4 -2
  61. package/lib/module/controllers/EnsController.js.map +1 -1
  62. package/lib/module/controllers/EventsController.js +3 -1
  63. package/lib/module/controllers/EventsController.js.map +1 -1
  64. package/lib/module/controllers/ModalController.js +8 -7
  65. package/lib/module/controllers/ModalController.js.map +1 -1
  66. package/lib/module/controllers/OnRampController.js +118 -52
  67. package/lib/module/controllers/OnRampController.js.map +1 -1
  68. package/lib/module/controllers/OptionsController.js +12 -4
  69. package/lib/module/controllers/OptionsController.js.map +1 -1
  70. package/lib/module/controllers/PublicStateController.js +2 -0
  71. package/lib/module/controllers/PublicStateController.js.map +1 -1
  72. package/lib/module/controllers/RouterController.js +8 -21
  73. package/lib/module/controllers/RouterController.js.map +1 -1
  74. package/lib/module/controllers/SendController.js +99 -97
  75. package/lib/module/controllers/SendController.js.map +1 -1
  76. package/lib/module/controllers/SnackController.js +31 -5
  77. package/lib/module/controllers/SnackController.js.map +1 -1
  78. package/lib/module/controllers/SwapController.js +111 -117
  79. package/lib/module/controllers/SwapController.js.map +1 -1
  80. package/lib/module/controllers/ThemeController.js +2 -0
  81. package/lib/module/controllers/ThemeController.js.map +1 -1
  82. package/lib/module/controllers/TransactionsController.js +23 -17
  83. package/lib/module/controllers/TransactionsController.js.map +1 -1
  84. package/lib/module/controllers/WcController.js +70 -0
  85. package/lib/module/controllers/WcController.js.map +1 -0
  86. package/lib/module/index.js +5 -6
  87. package/lib/module/index.js.map +1 -1
  88. package/lib/module/utils/ApiUtil.js +2 -0
  89. package/lib/module/utils/ApiUtil.js.map +1 -1
  90. package/lib/module/utils/AssetUtil.js +8 -14
  91. package/lib/module/utils/AssetUtil.js.map +1 -1
  92. package/lib/module/utils/ConstantsUtil.js +15 -425
  93. package/lib/module/utils/ConstantsUtil.js.map +1 -1
  94. package/lib/module/utils/CoreHelperUtil.js +15 -6
  95. package/lib/module/utils/CoreHelperUtil.js.map +1 -1
  96. package/lib/module/utils/EventUtil.js +2 -0
  97. package/lib/module/utils/EventUtil.js.map +1 -1
  98. package/lib/module/utils/FetchUtil.js +36 -10
  99. package/lib/module/utils/FetchUtil.js.map +1 -1
  100. package/lib/module/utils/RouterUtil.js +2 -0
  101. package/lib/module/utils/RouterUtil.js.map +1 -1
  102. package/lib/module/utils/StorageUtil.js +80 -129
  103. package/lib/module/utils/StorageUtil.js.map +1 -1
  104. package/lib/module/utils/SwapApiUtil.js +4 -17
  105. package/lib/module/utils/SwapApiUtil.js.map +1 -1
  106. package/lib/module/utils/SwapCalculationUtil.js +3 -0
  107. package/lib/module/utils/SwapCalculationUtil.js.map +1 -1
  108. package/lib/typescript/controllers/ApiController.d.ts +3 -4
  109. package/lib/typescript/controllers/ApiController.d.ts.map +1 -1
  110. package/lib/typescript/controllers/AssetController.d.ts +0 -2
  111. package/lib/typescript/controllers/AssetController.d.ts.map +1 -1
  112. package/lib/typescript/controllers/BlockchainApiController.d.ts +21 -13
  113. package/lib/typescript/controllers/BlockchainApiController.d.ts.map +1 -1
  114. package/lib/typescript/controllers/ConnectionsController.d.ts +19 -17
  115. package/lib/typescript/controllers/ConnectionsController.d.ts.map +1 -1
  116. package/lib/typescript/controllers/EnsController.d.ts +1 -1
  117. package/lib/typescript/controllers/EventsController.d.ts +1 -1
  118. package/lib/typescript/controllers/EventsController.d.ts.map +1 -1
  119. package/lib/typescript/controllers/ModalController.d.ts +1 -1
  120. package/lib/typescript/controllers/ModalController.d.ts.map +1 -1
  121. package/lib/typescript/controllers/OnRampController.d.ts +4 -3
  122. package/lib/typescript/controllers/OnRampController.d.ts.map +1 -1
  123. package/lib/typescript/controllers/OptionsController.d.ts +4 -4
  124. package/lib/typescript/controllers/OptionsController.d.ts.map +1 -1
  125. package/lib/typescript/controllers/RouterController.d.ts +5 -20
  126. package/lib/typescript/controllers/RouterController.d.ts.map +1 -1
  127. package/lib/typescript/controllers/SendController.d.ts +5 -7
  128. package/lib/typescript/controllers/SendController.d.ts.map +1 -1
  129. package/lib/typescript/controllers/SnackController.d.ts +3 -3
  130. package/lib/typescript/controllers/SnackController.d.ts.map +1 -1
  131. package/lib/typescript/controllers/SwapController.d.ts +11 -11
  132. package/lib/typescript/controllers/SwapController.d.ts.map +1 -1
  133. package/lib/typescript/controllers/TransactionsController.d.ts +3 -3
  134. package/lib/typescript/controllers/TransactionsController.d.ts.map +1 -1
  135. package/lib/typescript/controllers/WcController.d.ts +27 -0
  136. package/lib/typescript/controllers/WcController.d.ts.map +1 -0
  137. package/lib/typescript/index.d.ts +1 -7
  138. package/lib/typescript/index.d.ts.map +1 -1
  139. package/lib/typescript/utils/AssetUtil.d.ts +2 -3
  140. package/lib/typescript/utils/AssetUtil.d.ts.map +1 -1
  141. package/lib/typescript/utils/ConstantsUtil.d.ts +7 -415
  142. package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
  143. package/lib/typescript/utils/CoreHelperUtil.d.ts +4 -4
  144. package/lib/typescript/utils/CoreHelperUtil.d.ts.map +1 -1
  145. package/lib/typescript/utils/EventUtil.d.ts +1 -1
  146. package/lib/typescript/utils/EventUtil.d.ts.map +1 -1
  147. package/lib/typescript/utils/FetchUtil.d.ts +1 -1
  148. package/lib/typescript/utils/FetchUtil.d.ts.map +1 -1
  149. package/lib/typescript/utils/StorageUtil.d.ts +8 -19
  150. package/lib/typescript/utils/StorageUtil.d.ts.map +1 -1
  151. package/lib/typescript/utils/SwapApiUtil.d.ts +3 -4
  152. package/lib/typescript/utils/SwapApiUtil.d.ts.map +1 -1
  153. package/lib/typescript/utils/SwapCalculationUtil.d.ts +1 -1
  154. package/lib/typescript/utils/SwapCalculationUtil.d.ts.map +1 -1
  155. package/package.json +9 -23
  156. package/src/controllers/ApiController.ts +24 -28
  157. package/src/controllers/AssetController.ts +0 -6
  158. package/src/controllers/BlockchainApiController.ts +76 -121
  159. package/src/controllers/ConnectionsController.ts +308 -78
  160. package/src/controllers/EnsController.ts +3 -3
  161. package/src/controllers/EventsController.ts +2 -2
  162. package/src/controllers/ModalController.ts +7 -9
  163. package/src/controllers/OnRampController.ts +179 -82
  164. package/src/controllers/OptionsController.ts +24 -8
  165. package/src/controllers/RouterController.ts +12 -54
  166. package/src/controllers/SendController.ts +123 -112
  167. package/src/controllers/SnackController.ts +31 -5
  168. package/src/controllers/SwapController.ts +130 -146
  169. package/src/controllers/TransactionsController.ts +24 -18
  170. package/src/controllers/WcController.ts +93 -0
  171. package/src/index.ts +2 -21
  172. package/src/utils/AssetUtil.ts +7 -17
  173. package/src/utils/ConstantsUtil.ts +15 -429
  174. package/src/utils/CoreHelperUtil.ts +31 -8
  175. package/src/utils/EventUtil.ts +1 -1
  176. package/src/utils/FetchUtil.ts +38 -11
  177. package/src/utils/StorageUtil.ts +146 -157
  178. package/src/utils/SwapApiUtil.ts +18 -37
  179. package/src/utils/SwapCalculationUtil.ts +1 -2
  180. package/lib/commonjs/controllers/AccountController.js +0 -93
  181. package/lib/commonjs/controllers/AccountController.js.map +0 -1
  182. package/lib/commonjs/controllers/ConnectionController.js +0 -132
  183. package/lib/commonjs/controllers/ConnectionController.js.map +0 -1
  184. package/lib/commonjs/controllers/ConnectorController.js +0 -50
  185. package/lib/commonjs/controllers/ConnectorController.js.map +0 -1
  186. package/lib/commonjs/controllers/NetworkController.js +0 -90
  187. package/lib/commonjs/controllers/NetworkController.js.map +0 -1
  188. package/lib/commonjs/controllers/WebviewController.js +0 -52
  189. package/lib/commonjs/controllers/WebviewController.js.map +0 -1
  190. package/lib/commonjs/utils/NetworkUtil.js +0 -46
  191. package/lib/commonjs/utils/NetworkUtil.js.map +0 -1
  192. package/lib/commonjs/utils/TypeUtil.js +0 -6
  193. package/lib/commonjs/utils/TypeUtil.js.map +0 -1
  194. package/lib/module/controllers/AccountController.js +0 -88
  195. package/lib/module/controllers/AccountController.js.map +0 -1
  196. package/lib/module/controllers/ConnectionController.js +0 -127
  197. package/lib/module/controllers/ConnectionController.js.map +0 -1
  198. package/lib/module/controllers/ConnectorController.js +0 -45
  199. package/lib/module/controllers/ConnectorController.js.map +0 -1
  200. package/lib/module/controllers/NetworkController.js +0 -85
  201. package/lib/module/controllers/NetworkController.js.map +0 -1
  202. package/lib/module/controllers/WebviewController.js +0 -47
  203. package/lib/module/controllers/WebviewController.js.map +0 -1
  204. package/lib/module/utils/NetworkUtil.js +0 -40
  205. package/lib/module/utils/NetworkUtil.js.map +0 -1
  206. package/lib/module/utils/TypeUtil.js +0 -2
  207. package/lib/module/utils/TypeUtil.js.map +0 -1
  208. package/lib/typescript/controllers/AccountController.d.ts +0 -33
  209. package/lib/typescript/controllers/AccountController.d.ts.map +0 -1
  210. package/lib/typescript/controllers/ConnectionController.d.ts +0 -68
  211. package/lib/typescript/controllers/ConnectionController.d.ts.map +0 -1
  212. package/lib/typescript/controllers/ConnectorController.d.ts +0 -18
  213. package/lib/typescript/controllers/ConnectorController.d.ts.map +0 -1
  214. package/lib/typescript/controllers/NetworkController.d.ts +0 -34
  215. package/lib/typescript/controllers/NetworkController.d.ts.map +0 -1
  216. package/lib/typescript/controllers/WebviewController.d.ts +0 -21
  217. package/lib/typescript/controllers/WebviewController.d.ts.map +0 -1
  218. package/lib/typescript/utils/NetworkUtil.d.ts +0 -8
  219. package/lib/typescript/utils/NetworkUtil.d.ts.map +0 -1
  220. package/lib/typescript/utils/TypeUtil.d.ts +0 -817
  221. package/lib/typescript/utils/TypeUtil.d.ts.map +0 -1
  222. package/src/controllers/AccountController.ts +0 -128
  223. package/src/controllers/ConnectionController.ts +0 -208
  224. package/src/controllers/ConnectorController.ts +0 -64
  225. package/src/controllers/NetworkController.ts +0 -120
  226. package/src/controllers/WebviewController.ts +0 -63
  227. package/src/utils/NetworkUtil.ts +0 -33
  228. package/src/utils/TypeUtil.ts +0 -995
@@ -1,817 +0,0 @@
1
- /// <reference types="node" />
2
- /// <reference types="react" />
3
- import { type EventEmitter } from 'events';
4
- import type { CaipAddress, CaipNetworkId } from '@reown/appkit-common-react-native';
5
- import type { Balance, SocialProvider, ThemeMode, Transaction, ConnectorType, Metadata } from '@reown/appkit-common-react-native';
6
- import { OnRampErrorType } from './ConstantsUtil';
7
- export interface BaseError {
8
- message?: string;
9
- }
10
- export type ConnectedWalletInfo = {
11
- name?: string;
12
- icon?: string;
13
- description?: string;
14
- url?: string;
15
- icons?: string[];
16
- redirect?: {
17
- native?: string;
18
- universal?: string;
19
- linkMode?: boolean;
20
- };
21
- [key: string]: unknown;
22
- } | undefined;
23
- export interface LinkingRecord {
24
- redirect: string;
25
- href: string;
26
- }
27
- export type ProjectId = string;
28
- export type Platform = 'mobile' | 'web' | 'qrcode' | 'email' | 'unsupported';
29
- export type Connector = {
30
- id: string;
31
- type: ConnectorType;
32
- name?: string;
33
- imageId?: string;
34
- explorerId?: string;
35
- imageUrl?: string;
36
- info?: {
37
- rdns?: string;
38
- };
39
- provider?: unknown;
40
- installed?: boolean;
41
- };
42
- export type CaipNamespaces = Record<string, {
43
- chains: CaipNetworkId[];
44
- methods: string[];
45
- events: string[];
46
- }>;
47
- export type SdkType = 'appkit';
48
- export type SdkVersion = `react-native-wagmi-${string}` | `react-native-ethers5-${string}` | `react-native-ethers-${string}`;
49
- type EnabledSocials = Exclude<SocialProvider, 'farcaster'>;
50
- export type Features = {
51
- /**
52
- * @description Enable or disable the swaps feature. Enabled by default.
53
- * @type {boolean}
54
- */
55
- swaps?: boolean;
56
- /**
57
- * @description Enable or disable the onramp feature. Enabled by default.
58
- * @type {boolean}
59
- */
60
- onramp?: boolean;
61
- /**
62
- * @description Enable or disable the email feature. Enabled by default.
63
- * @type {boolean}
64
- */
65
- email?: boolean;
66
- /**
67
- * @description Show or hide the regular wallet options when email is enabled. Enabled by default.
68
- * @type {boolean}
69
- */
70
- emailShowWallets?: boolean;
71
- /**
72
- * @description Enable or disable the socials feature. Enabled by default.
73
- * @type {EnabledSocials[]}
74
- */
75
- socials?: EnabledSocials[] | false;
76
- };
77
- export interface WcWallet {
78
- id: string;
79
- name: string;
80
- homepage?: string;
81
- image_id?: string;
82
- image_url?: string;
83
- order?: number;
84
- mobile_link?: string | null;
85
- desktop_link?: string | null;
86
- webapp_link?: string | null;
87
- link_mode?: string | null;
88
- app_store?: string | null;
89
- play_store?: string | null;
90
- }
91
- export interface DataWallet {
92
- id: string;
93
- ios_schema?: string;
94
- android_app_id?: string;
95
- }
96
- export interface ApiGetWalletsRequest {
97
- page: number;
98
- entries: number;
99
- search?: string;
100
- include?: string[];
101
- exclude?: string[];
102
- }
103
- export interface ApiGetWalletsResponse {
104
- data: WcWallet[];
105
- count: number;
106
- }
107
- export interface ApiGetDataWalletsResponse {
108
- data: DataWallet[];
109
- count: number;
110
- }
111
- export interface ApiGetAnalyticsConfigResponse {
112
- isAnalyticsEnabled: boolean;
113
- }
114
- export type RequestCache = 'default' | 'force-cache' | 'no-cache' | 'no-store' | 'only-if-cached' | 'reload';
115
- export interface BlockchainApiIdentityRequest {
116
- address: string;
117
- }
118
- export interface BlockchainApiIdentityResponse {
119
- avatar: string;
120
- name: string;
121
- }
122
- export interface BlockchainApiBalanceResponse {
123
- balances: Balance[];
124
- }
125
- export interface BlockchainApiTransactionsRequest {
126
- account: string;
127
- projectId: string;
128
- cursor?: string;
129
- onramp?: 'coinbase';
130
- signal?: AbortSignal;
131
- cache?: RequestCache;
132
- chainId?: CaipNetworkId;
133
- }
134
- export interface BlockchainApiTransactionsResponse {
135
- data: Transaction[];
136
- next: string | null;
137
- }
138
- export interface BlockchainApiSwapAllowanceResponse {
139
- allowance: string;
140
- }
141
- export interface BlockchainApiGenerateSwapCalldataRequest {
142
- projectId: string;
143
- userAddress: string;
144
- from: string;
145
- to: string;
146
- amount: string;
147
- eip155?: {
148
- slippage: string;
149
- permit?: string;
150
- };
151
- }
152
- export interface BlockchainApiGenerateSwapCalldataResponse {
153
- tx: {
154
- from: CaipAddress;
155
- to: CaipAddress;
156
- data: `0x${string}`;
157
- amount: string;
158
- eip155: {
159
- gas: string;
160
- gasPrice: string;
161
- };
162
- };
163
- }
164
- export interface BlockchainApiGenerateApproveCalldataRequest {
165
- projectId: string;
166
- userAddress: string;
167
- from: string;
168
- to: string;
169
- amount?: number;
170
- }
171
- export interface BlockchainApiGenerateApproveCalldataResponse {
172
- tx: {
173
- from: CaipAddress;
174
- to: CaipAddress;
175
- data: `0x${string}`;
176
- value: string;
177
- eip155: {
178
- gas: number;
179
- gasPrice: string;
180
- };
181
- };
182
- }
183
- export interface BlockchainApiTokenPriceRequest {
184
- projectId: string;
185
- currency?: 'usd' | 'eur' | 'gbp' | 'aud' | 'cad' | 'inr' | 'jpy' | 'btc' | 'eth';
186
- addresses: string[];
187
- }
188
- export interface BlockchainApiTokenPriceResponse {
189
- fungibles: {
190
- name: string;
191
- symbol: string;
192
- iconUrl: string;
193
- price: number;
194
- }[];
195
- }
196
- export interface BlockchainApiSwapAllowanceRequest {
197
- projectId: string;
198
- tokenAddress: string;
199
- userAddress: string;
200
- }
201
- export interface BlockchainApiGasPriceRequest {
202
- projectId: string;
203
- chainId: string;
204
- }
205
- export interface BlockchainApiGasPriceResponse {
206
- standard: string;
207
- fast: string;
208
- instant: string;
209
- }
210
- export interface BlockchainApiEnsError extends BaseError {
211
- status: string;
212
- reasons: {
213
- name: string;
214
- description: string;
215
- }[];
216
- }
217
- export type ReownName = `${string}.reown.id` | `${string}.wcn.id`;
218
- export interface BlockchainApiLookupEnsName {
219
- name: ReownName;
220
- registered: number;
221
- updated: number;
222
- addresses: Record<string, {
223
- address: string;
224
- created: string;
225
- }>;
226
- attributes: {
227
- avatar?: string;
228
- bio?: string;
229
- }[];
230
- }
231
- export interface BlockchainApiSwapQuoteRequest {
232
- projectId: string;
233
- chainId?: string;
234
- amount: string;
235
- userAddress: string;
236
- from: string;
237
- to: string;
238
- gasPrice: string;
239
- }
240
- export interface BlockchainApiSwapQuoteResponse {
241
- quotes: {
242
- id: string | null;
243
- fromAmount: string;
244
- fromAccount: string;
245
- toAmount: string;
246
- toAccount: string;
247
- }[];
248
- }
249
- export interface BlockchainApiSwapTokensRequest {
250
- projectId: string;
251
- chainId?: string;
252
- }
253
- export interface BlockchainApiOnRampQuotesRequest {
254
- countryCode: string;
255
- paymentMethodType: string;
256
- destinationCurrencyCode: string;
257
- sourceAmount: number;
258
- sourceCurrencyCode: string;
259
- walletAddress: string;
260
- }
261
- export interface BlockchainApiSwapTokensResponse {
262
- tokens: SwapToken[];
263
- }
264
- export interface BlockchainApiOnRampWidgetRequest {
265
- countryCode: string;
266
- destinationCurrencyCode: string;
267
- paymentMethodType: string;
268
- serviceProvider: string;
269
- sourceAmount: number;
270
- sourceCurrencyCode: string;
271
- walletAddress: string;
272
- redirectUrl?: string;
273
- }
274
- export type BlockchainApiOnRampWidgetResponse = {
275
- widgetUrl: string;
276
- };
277
- export type CustomWallet = Pick<WcWallet, 'id' | 'name' | 'homepage' | 'image_url' | 'mobile_link' | 'desktop_link' | 'webapp_link' | 'link_mode' | 'app_store' | 'play_store'>;
278
- export type EventName = 'MODAL_LOADED' | 'MODAL_OPEN' | 'MODAL_CLOSE' | 'CLICK_ALL_WALLETS' | 'CLICK_NETWORKS' | 'SWITCH_NETWORK' | 'SELECT_WALLET' | 'CONNECT_SUCCESS' | 'CONNECT_ERROR' | 'DISCONNECT_SUCCESS' | 'DISCONNECT_ERROR' | 'CLICK_WALLET_HELP' | 'CLICK_NETWORK_HELP' | 'CLICK_GET_WALLET' | 'EMAIL_LOGIN_SELECTED' | 'EMAIL_SUBMITTED' | 'DEVICE_REGISTERED_FOR_EMAIL' | 'EMAIL_VERIFICATION_CODE_SENT' | 'EMAIL_VERIFICATION_CODE_PASS' | 'EMAIL_VERIFICATION_CODE_FAIL' | 'EMAIL_EDIT' | 'EMAIL_EDIT_COMPLETE' | 'EMAIL_UPGRADE_FROM_MODAL' | 'CLICK_SIGN_SIWE_MESSAGE' | 'CLICK_CANCEL_SIWE' | 'SIWE_AUTH_SUCCESS' | 'SIWE_AUTH_ERROR' | 'CLICK_TRANSACTIONS' | 'ERROR_FETCH_TRANSACTIONS' | 'LOAD_MORE_TRANSACTIONS' | 'OPEN_SEND' | 'OPEN_SWAP' | 'INITIATE_SWAP' | 'SWAP_SUCCESS' | 'SWAP_ERROR' | 'SEND_INITIATED' | 'SEND_SUCCESS' | 'SEND_ERROR' | 'SOCIAL_LOGIN_STARTED' | 'SOCIAL_LOGIN_SUCCESS' | 'SOCIAL_LOGIN_REQUEST_USER_DATA' | 'SOCIAL_LOGIN_CANCELED' | 'SOCIAL_LOGIN_ERROR' | 'SET_PREFERRED_ACCOUNT_TYPE';
279
- export type Event = {
280
- type: 'track';
281
- event: 'MODAL_CREATED';
282
- } | {
283
- type: 'track';
284
- event: 'MODAL_LOADED';
285
- } | {
286
- type: 'track';
287
- event: 'MODAL_OPEN';
288
- properties: {
289
- connected: boolean;
290
- };
291
- } | {
292
- type: 'track';
293
- event: 'MODAL_CLOSE';
294
- properties: {
295
- connected: boolean;
296
- };
297
- } | {
298
- type: 'track';
299
- event: 'CLICK_ALL_WALLETS';
300
- } | {
301
- type: 'track';
302
- event: 'CLICK_NETWORKS';
303
- } | {
304
- type: 'track';
305
- event: 'SWITCH_NETWORK';
306
- properties: {
307
- network: number | string;
308
- };
309
- } | {
310
- type: 'track';
311
- event: 'SELECT_WALLET';
312
- properties: {
313
- name: string;
314
- platform?: Platform;
315
- explorer_id?: string;
316
- };
317
- } | {
318
- type: 'track';
319
- event: 'CONNECT_SUCCESS';
320
- properties: {
321
- name: string;
322
- method: Platform;
323
- explorer_id?: string;
324
- };
325
- } | {
326
- type: 'track';
327
- event: 'CONNECT_ERROR';
328
- properties: {
329
- message: string;
330
- };
331
- } | {
332
- type: 'track';
333
- event: 'DISCONNECT_SUCCESS';
334
- } | {
335
- type: 'track';
336
- event: 'DISCONNECT_ERROR';
337
- } | {
338
- type: 'track';
339
- event: 'CLICK_WALLET_HELP';
340
- } | {
341
- type: 'track';
342
- event: 'CLICK_NETWORK_HELP';
343
- } | {
344
- type: 'track';
345
- event: 'CLICK_GET_WALLET';
346
- } | {
347
- type: 'track';
348
- event: 'EMAIL_LOGIN_SELECTED';
349
- } | {
350
- type: 'track';
351
- event: 'EMAIL_SUBMITTED';
352
- } | {
353
- type: 'track';
354
- event: 'DEVICE_REGISTERED_FOR_EMAIL';
355
- } | {
356
- type: 'track';
357
- event: 'EMAIL_VERIFICATION_CODE_SENT';
358
- } | {
359
- type: 'track';
360
- event: 'EMAIL_VERIFICATION_CODE_PASS';
361
- } | {
362
- type: 'track';
363
- event: 'EMAIL_VERIFICATION_CODE_FAIL';
364
- } | {
365
- type: 'track';
366
- event: 'EMAIL_EDIT';
367
- } | {
368
- type: 'track';
369
- event: 'EMAIL_EDIT_COMPLETE';
370
- } | {
371
- type: 'track';
372
- event: 'EMAIL_UPGRADE_FROM_MODAL';
373
- } | {
374
- type: 'track';
375
- event: 'CLICK_SIGN_SIWE_MESSAGE';
376
- properties: {
377
- network: string;
378
- isSmartAccount: boolean;
379
- };
380
- } | {
381
- type: 'track';
382
- event: 'CLICK_CANCEL_SIWE';
383
- properties: {
384
- network: string;
385
- isSmartAccount: boolean;
386
- };
387
- } | {
388
- type: 'track';
389
- event: 'SIWE_AUTH_SUCCESS';
390
- properties: {
391
- network: string;
392
- isSmartAccount: boolean;
393
- };
394
- } | {
395
- type: 'track';
396
- event: 'SIWE_AUTH_ERROR';
397
- properties: {
398
- network: string;
399
- isSmartAccount: boolean;
400
- };
401
- } | {
402
- type: 'track';
403
- event: 'CLICK_TRANSACTIONS';
404
- properties: {
405
- isSmartAccount: boolean;
406
- };
407
- } | {
408
- type: 'track';
409
- event: 'ERROR_FETCH_TRANSACTIONS';
410
- properties: {
411
- address: string;
412
- projectId: string;
413
- cursor: string | undefined;
414
- isSmartAccount: boolean;
415
- };
416
- } | {
417
- type: 'track';
418
- event: 'LOAD_MORE_TRANSACTIONS';
419
- properties: {
420
- address: string | undefined;
421
- projectId: string;
422
- cursor: string | undefined;
423
- isSmartAccount: boolean;
424
- };
425
- } | {
426
- type: 'track';
427
- event: 'OPEN_SEND';
428
- properties: {
429
- isSmartAccount: boolean;
430
- network: string;
431
- };
432
- } | {
433
- type: 'track';
434
- event: 'OPEN_SWAP';
435
- properties: {
436
- isSmartAccount: boolean;
437
- network: string;
438
- };
439
- } | {
440
- type: 'track';
441
- event: 'INITIATE_SWAP';
442
- properties: {
443
- isSmartAccount: boolean;
444
- network: string;
445
- swapFromToken: string;
446
- swapToToken: string;
447
- swapFromAmount: string;
448
- swapToAmount: string;
449
- };
450
- } | {
451
- type: 'track';
452
- event: 'SWAP_SUCCESS';
453
- properties: {
454
- isSmartAccount: boolean;
455
- network: string;
456
- swapFromToken: string;
457
- swapToToken: string;
458
- swapFromAmount: string;
459
- swapToAmount: string;
460
- };
461
- } | {
462
- type: 'track';
463
- event: 'SWAP_ERROR';
464
- properties: {
465
- isSmartAccount: boolean;
466
- network: string;
467
- swapFromToken: string;
468
- swapToToken: string;
469
- swapFromAmount: string;
470
- swapToAmount: string;
471
- message: string;
472
- };
473
- } | {
474
- type: 'track';
475
- event: 'SEND_INITIATED';
476
- properties: {
477
- isSmartAccount: boolean;
478
- network: string;
479
- token: string;
480
- amount: number;
481
- };
482
- } | {
483
- type: 'track';
484
- event: 'SEND_SUCCESS';
485
- properties: {
486
- isSmartAccount: boolean;
487
- network: string;
488
- token: string;
489
- amount: number;
490
- };
491
- } | {
492
- type: 'track';
493
- event: 'SEND_ERROR';
494
- properties: {
495
- isSmartAccount: boolean;
496
- network: string;
497
- token: string;
498
- amount: number;
499
- };
500
- } | {
501
- type: 'track';
502
- event: 'SOCIAL_LOGIN_STARTED';
503
- properties: {
504
- provider: SocialProvider;
505
- };
506
- } | {
507
- type: 'track';
508
- event: 'SOCIAL_LOGIN_SUCCESS';
509
- properties: {
510
- provider: SocialProvider;
511
- };
512
- } | {
513
- type: 'track';
514
- event: 'SOCIAL_LOGIN_REQUEST_USER_DATA';
515
- properties: {
516
- provider: SocialProvider;
517
- };
518
- } | {
519
- type: 'track';
520
- event: 'SOCIAL_LOGIN_CANCELED';
521
- properties: {
522
- provider: SocialProvider;
523
- };
524
- } | {
525
- type: 'track';
526
- event: 'SOCIAL_LOGIN_ERROR';
527
- properties: {
528
- provider: SocialProvider;
529
- };
530
- } | {
531
- type: 'track';
532
- event: 'SET_PREFERRED_ACCOUNT_TYPE';
533
- properties: {
534
- accountType: AppKitFrameAccountType;
535
- network: string;
536
- };
537
- } | {
538
- type: 'track';
539
- event: 'SELECT_BUY_CRYPTO';
540
- } | {
541
- type: 'track';
542
- event: 'SELECT_BUY_ASSET';
543
- properties: {
544
- asset: string;
545
- };
546
- } | {
547
- type: 'track';
548
- event: 'BUY_SUBMITTED';
549
- properties: {
550
- asset?: string;
551
- network?: string;
552
- amount?: string;
553
- currency?: string;
554
- provider?: string;
555
- serviceProvider?: string;
556
- paymentMethod?: string;
557
- };
558
- } | {
559
- type: 'track';
560
- event: 'BUY_SUCCESS';
561
- properties: {
562
- asset?: string | null;
563
- network?: string | null;
564
- amount?: string | null;
565
- currency?: string | null;
566
- provider?: string | null;
567
- orderId?: string | null;
568
- };
569
- } | {
570
- type: 'track';
571
- event: 'BUY_FAIL';
572
- properties: {
573
- asset?: string;
574
- network?: string;
575
- amount?: string;
576
- currency?: string;
577
- provider?: string;
578
- serviceProvider?: string;
579
- paymentMethod?: string;
580
- message?: string;
581
- };
582
- } | {
583
- type: 'track';
584
- event: 'BUY_CANCEL';
585
- properties?: {
586
- message?: string;
587
- };
588
- };
589
- export type EstimateGasTransactionArgs = {
590
- chainNamespace?: 'eip155';
591
- address: `0x${string}`;
592
- to: `0x${string}`;
593
- data: `0x${string}`;
594
- };
595
- export interface SendTransactionArgs {
596
- to: `0x${string}`;
597
- data: `0x${string}`;
598
- value: bigint;
599
- gas?: bigint;
600
- gasPrice: bigint;
601
- address: `0x${string}`;
602
- chainNamespace?: 'eip155';
603
- }
604
- export interface WriteContractArgs {
605
- receiverAddress: `0x${string}`;
606
- tokenAmount: bigint;
607
- tokenAddress: `0x${string}`;
608
- fromAddress: `0x${string}`;
609
- method: 'send' | 'transfer' | 'call';
610
- abi: any;
611
- }
612
- export type SwapToken = {
613
- name: string;
614
- symbol: string;
615
- address: CaipAddress;
616
- decimals: number;
617
- logoUri: string;
618
- eip2612?: boolean;
619
- };
620
- export type SwapTokenWithBalance = SwapToken & {
621
- quantity: {
622
- decimals: string;
623
- numeric: string;
624
- };
625
- price: number;
626
- value: number;
627
- };
628
- export type SwapInputTarget = 'sourceToken' | 'toToken';
629
- export type OnRampErrorTypeValues = (typeof OnRampErrorType)[keyof typeof OnRampErrorType];
630
- export interface OnRampError {
631
- type: OnRampErrorTypeValues;
632
- message: string;
633
- }
634
- export type OnRampPaymentMethod = {
635
- logos: {
636
- dark: string;
637
- light: string;
638
- };
639
- name: string;
640
- paymentMethod: string;
641
- paymentType: string;
642
- };
643
- export type OnRampCountry = {
644
- countryCode: string;
645
- flagImageUrl: string;
646
- name: string;
647
- };
648
- export type OnRampFiatCurrency = {
649
- currencyCode: string;
650
- name: string;
651
- symbolImageUrl: string;
652
- };
653
- export type OnRampCryptoCurrency = {
654
- currencyCode: string;
655
- name: string;
656
- chainCode: string;
657
- chainName: string;
658
- chainId: string;
659
- contractAddress: string | null;
660
- symbolImageUrl: string;
661
- };
662
- export type OnRampQuote = {
663
- countryCode: string;
664
- customerScore: number;
665
- destinationAmount: number;
666
- destinationAmountWithoutFees: number;
667
- destinationCurrencyCode: string;
668
- exchangeRate: number;
669
- fiatAmountWithoutFees: number;
670
- lowKyc: boolean;
671
- networkFee: number;
672
- paymentMethodType: string;
673
- serviceProvider: string;
674
- sourceAmount: number;
675
- sourceAmountWithoutFees: number;
676
- sourceCurrencyCode: string;
677
- totalFee: number;
678
- transactionFee: number;
679
- transactionType: string;
680
- };
681
- export type OnRampServiceProvider = {
682
- categories: string[];
683
- categoryStatuses: {
684
- additionalProp: string;
685
- };
686
- logos: {
687
- dark: string;
688
- darkShort: string;
689
- light: string;
690
- lightShort: string;
691
- };
692
- name: string;
693
- serviceProvider: string;
694
- status: string;
695
- websiteUrl: string;
696
- };
697
- export type OnRampFiatLimit = {
698
- currencyCode: string;
699
- defaultAmount: number | null;
700
- minimumAmount: number;
701
- maximumAmount: number;
702
- };
703
- export type OnRampTransactionResult = {
704
- purchaseCurrency: string | null;
705
- purchaseAmount: string | null;
706
- purchaseImageUrl: string | null;
707
- paymentCurrency: string | null;
708
- paymentAmount: string | null;
709
- status: string | null;
710
- network: string | null;
711
- };
712
- /**
713
- * Matches type defined for packages/wallet/src/AppKitFrameProvider.ts
714
- * It's duplicated in order to decouple scaffold from email package
715
- */
716
- export type AppKitFrameAccountType = 'eoa' | 'smartAccount';
717
- export interface AppKitFrameProvider {
718
- readonly id: string;
719
- readonly name: string;
720
- getEventEmitter(): EventEmitter;
721
- getSecureSiteURL(): string;
722
- getSecureSiteDashboardURL(): string;
723
- getSecureSiteIconURL(): string;
724
- getEmail(): string | undefined;
725
- getUsername(): string | undefined;
726
- getLastUsedChainId(): Promise<number | undefined>;
727
- rejectRpcRequest(): void;
728
- connectEmail(payload: {
729
- email: string;
730
- }): Promise<{
731
- action: 'VERIFY_DEVICE' | 'VERIFY_OTP';
732
- }>;
733
- connectDevice(): Promise<unknown>;
734
- connectSocial(uri: string): Promise<{
735
- chainId: string | number;
736
- email: string;
737
- address: string;
738
- accounts?: {
739
- type: AppKitFrameAccountType;
740
- address: string;
741
- }[];
742
- userName?: string;
743
- }>;
744
- getSocialRedirectUri(payload: {
745
- provider: SocialProvider;
746
- }): Promise<{
747
- uri: string;
748
- }>;
749
- connectOtp(payload: {
750
- otp: string;
751
- }): Promise<unknown>;
752
- connectFarcaster: () => Promise<{
753
- userName: string;
754
- }>;
755
- getFarcasterUri(): Promise<{
756
- url: string;
757
- }>;
758
- isConnected(): Promise<{
759
- isConnected: boolean;
760
- }>;
761
- getChainId(): Promise<{
762
- chainId: number;
763
- }>;
764
- updateEmail(payload: {
765
- email: string;
766
- }): Promise<{
767
- action: 'VERIFY_PRIMARY_OTP' | 'VERIFY_SECONDARY_OTP';
768
- }>;
769
- updateEmailPrimaryOtp(payload: {
770
- otp: string;
771
- }): Promise<unknown>;
772
- updateEmailSecondaryOtp(payload: {
773
- otp: string;
774
- }): Promise<{
775
- newEmail: string;
776
- }>;
777
- syncTheme(payload: {
778
- themeMode: ThemeMode | undefined;
779
- themeVariables: Record<string, string | number> | undefined;
780
- }): Promise<unknown>;
781
- syncDappData(payload: {
782
- projectId: string;
783
- sdkVersion: SdkVersion;
784
- sdkType: SdkType;
785
- metadata?: Metadata;
786
- }): Promise<unknown>;
787
- connect(payload?: {
788
- chainId: number | undefined;
789
- }): Promise<{
790
- chainId: number;
791
- email?: string | null;
792
- address: string;
793
- smartAccountDeployed: boolean;
794
- preferredAccountType: AppKitFrameAccountType;
795
- }>;
796
- switchNetwork(chainId: number): Promise<{
797
- chainId: number;
798
- }>;
799
- setPreferredAccount(type: AppKitFrameAccountType): Promise<{
800
- type: AppKitFrameAccountType;
801
- address: string;
802
- }>;
803
- setOnTimeout(callback: () => void): void;
804
- getSmartAccountEnabledNetworks(): Promise<{
805
- smartAccountEnabledNetworks: number[];
806
- }>;
807
- disconnect(): Promise<unknown>;
808
- request(req: any): Promise<any>;
809
- AuthView: () => React.JSX.Element | null;
810
- Webview: () => React.JSX.Element | null;
811
- onSetPreferredAccount: (callback: (values: {
812
- type: AppKitFrameAccountType;
813
- address: string;
814
- }) => void) => void;
815
- }
816
- export {};
817
- //# sourceMappingURL=TypeUtil.d.ts.map