@reown/appkit-core-react-native 0.0.0-feat-coinbase-20250722184953 → 0.0.0-feat-onramp-20250722205908

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 (195) hide show
  1. package/lib/commonjs/controllers/AccountController.js +17 -20
  2. package/lib/commonjs/controllers/AccountController.js.map +1 -1
  3. package/lib/commonjs/controllers/ApiController.js +16 -28
  4. package/lib/commonjs/controllers/ApiController.js.map +1 -1
  5. package/lib/commonjs/controllers/BlockchainApiController.js +74 -204
  6. package/lib/commonjs/controllers/BlockchainApiController.js.map +1 -1
  7. package/lib/commonjs/controllers/ConnectionController.js +11 -8
  8. package/lib/commonjs/controllers/ConnectionController.js.map +1 -1
  9. package/lib/commonjs/controllers/ConnectorController.js +49 -0
  10. package/lib/commonjs/controllers/ConnectorController.js.map +1 -0
  11. package/lib/commonjs/controllers/EnsController.js +4 -4
  12. package/lib/commonjs/controllers/EnsController.js.map +1 -1
  13. package/lib/commonjs/controllers/EventsController.js +4 -4
  14. package/lib/commonjs/controllers/EventsController.js.map +1 -1
  15. package/lib/commonjs/controllers/ModalController.js +7 -6
  16. package/lib/commonjs/controllers/ModalController.js.map +1 -1
  17. package/lib/commonjs/controllers/OnRampController.js +69 -22
  18. package/lib/commonjs/controllers/OnRampController.js.map +1 -1
  19. package/lib/commonjs/controllers/OptionsController.js +3 -11
  20. package/lib/commonjs/controllers/OptionsController.js.map +1 -1
  21. package/lib/commonjs/controllers/RouterController.js +22 -1
  22. package/lib/commonjs/controllers/RouterController.js.map +1 -1
  23. package/lib/commonjs/controllers/SendController.js +101 -101
  24. package/lib/commonjs/controllers/SendController.js.map +1 -1
  25. package/lib/commonjs/controllers/SnackController.js +5 -29
  26. package/lib/commonjs/controllers/SnackController.js.map +1 -1
  27. package/lib/commonjs/controllers/SwapController.js +150 -151
  28. package/lib/commonjs/controllers/SwapController.js.map +1 -1
  29. package/lib/commonjs/controllers/ThemeController.js +1 -9
  30. package/lib/commonjs/controllers/ThemeController.js.map +1 -1
  31. package/lib/commonjs/controllers/TransactionsController.js +21 -25
  32. package/lib/commonjs/controllers/TransactionsController.js.map +1 -1
  33. package/lib/commonjs/controllers/WebviewController.js +52 -0
  34. package/lib/commonjs/controllers/WebviewController.js.map +1 -0
  35. package/lib/commonjs/index.js +24 -3
  36. package/lib/commonjs/index.js.map +1 -1
  37. package/lib/commonjs/utils/AssetUtil.js +15 -3
  38. package/lib/commonjs/utils/AssetUtil.js.map +1 -1
  39. package/lib/commonjs/utils/ConnectionUtil.js +33 -0
  40. package/lib/commonjs/utils/ConnectionUtil.js.map +1 -0
  41. package/lib/commonjs/utils/ConstantsUtil.js +9 -538
  42. package/lib/commonjs/utils/ConstantsUtil.js.map +1 -1
  43. package/lib/commonjs/utils/CoreHelperUtil.js +6 -12
  44. package/lib/commonjs/utils/CoreHelperUtil.js.map +1 -1
  45. package/lib/commonjs/utils/FetchUtil.js +28 -9
  46. package/lib/commonjs/utils/FetchUtil.js.map +1 -1
  47. package/lib/commonjs/utils/NetworkUtil.js +46 -0
  48. package/lib/commonjs/utils/NetworkUtil.js.map +1 -0
  49. package/lib/commonjs/utils/StorageUtil.js +42 -51
  50. package/lib/commonjs/utils/StorageUtil.js.map +1 -1
  51. package/lib/commonjs/utils/SwapApiUtil.js +21 -15
  52. package/lib/commonjs/utils/SwapApiUtil.js.map +1 -1
  53. package/lib/module/controllers/AccountController.js +17 -20
  54. package/lib/module/controllers/AccountController.js.map +1 -1
  55. package/lib/module/controllers/ApiController.js +16 -27
  56. package/lib/module/controllers/ApiController.js.map +1 -1
  57. package/lib/module/controllers/BlockchainApiController.js +73 -203
  58. package/lib/module/controllers/BlockchainApiController.js.map +1 -1
  59. package/lib/module/controllers/ConnectionController.js +11 -8
  60. package/lib/module/controllers/ConnectionController.js.map +1 -1
  61. package/lib/module/controllers/ConnectorController.js +44 -0
  62. package/lib/module/controllers/ConnectorController.js.map +1 -0
  63. package/lib/module/controllers/EnsController.js +2 -2
  64. package/lib/module/controllers/EnsController.js.map +1 -1
  65. package/lib/module/controllers/EventsController.js +1 -1
  66. package/lib/module/controllers/EventsController.js.map +1 -1
  67. package/lib/module/controllers/ModalController.js +7 -6
  68. package/lib/module/controllers/ModalController.js.map +1 -1
  69. package/lib/module/controllers/OnRampController.js +70 -23
  70. package/lib/module/controllers/OnRampController.js.map +1 -1
  71. package/lib/module/controllers/OptionsController.js +3 -11
  72. package/lib/module/controllers/OptionsController.js.map +1 -1
  73. package/lib/module/controllers/RouterController.js +22 -1
  74. package/lib/module/controllers/RouterController.js.map +1 -1
  75. package/lib/module/controllers/SendController.js +98 -98
  76. package/lib/module/controllers/SendController.js.map +1 -1
  77. package/lib/module/controllers/SnackController.js +5 -29
  78. package/lib/module/controllers/SnackController.js.map +1 -1
  79. package/lib/module/controllers/SwapController.js +150 -151
  80. package/lib/module/controllers/SwapController.js.map +1 -1
  81. package/lib/module/controllers/ThemeController.js +1 -9
  82. package/lib/module/controllers/ThemeController.js.map +1 -1
  83. package/lib/module/controllers/TransactionsController.js +19 -23
  84. package/lib/module/controllers/TransactionsController.js.map +1 -1
  85. package/lib/module/controllers/WebviewController.js +47 -0
  86. package/lib/module/controllers/WebviewController.js.map +1 -0
  87. package/lib/module/index.js +4 -1
  88. package/lib/module/index.js.map +1 -1
  89. package/lib/module/utils/AssetUtil.js +15 -3
  90. package/lib/module/utils/AssetUtil.js.map +1 -1
  91. package/lib/module/utils/ConnectionUtil.js +27 -0
  92. package/lib/module/utils/ConnectionUtil.js.map +1 -0
  93. package/lib/module/utils/ConstantsUtil.js +9 -538
  94. package/lib/module/utils/ConstantsUtil.js.map +1 -1
  95. package/lib/module/utils/CoreHelperUtil.js +6 -12
  96. package/lib/module/utils/CoreHelperUtil.js.map +1 -1
  97. package/lib/module/utils/FetchUtil.js +28 -9
  98. package/lib/module/utils/FetchUtil.js.map +1 -1
  99. package/lib/module/utils/NetworkUtil.js +40 -0
  100. package/lib/module/utils/NetworkUtil.js.map +1 -0
  101. package/lib/module/utils/StorageUtil.js +42 -51
  102. package/lib/module/utils/StorageUtil.js.map +1 -1
  103. package/lib/module/utils/SwapApiUtil.js +21 -15
  104. package/lib/module/utils/SwapApiUtil.js.map +1 -1
  105. package/lib/typescript/controllers/AccountController.d.ts +4 -4
  106. package/lib/typescript/controllers/AccountController.d.ts.map +1 -1
  107. package/lib/typescript/controllers/ApiController.d.ts +2 -3
  108. package/lib/typescript/controllers/ApiController.d.ts.map +1 -1
  109. package/lib/typescript/controllers/BlockchainApiController.d.ts +15 -29
  110. package/lib/typescript/controllers/BlockchainApiController.d.ts.map +1 -1
  111. package/lib/typescript/controllers/ConnectionController.d.ts +11 -3
  112. package/lib/typescript/controllers/ConnectionController.d.ts.map +1 -1
  113. package/lib/typescript/controllers/ConnectorController.d.ts +18 -0
  114. package/lib/typescript/controllers/ConnectorController.d.ts.map +1 -0
  115. package/lib/typescript/controllers/ModalController.d.ts +1 -1
  116. package/lib/typescript/controllers/ModalController.d.ts.map +1 -1
  117. package/lib/typescript/controllers/NetworkController.d.ts +1 -1
  118. package/lib/typescript/controllers/NetworkController.d.ts.map +1 -1
  119. package/lib/typescript/controllers/OnRampController.d.ts +3 -1
  120. package/lib/typescript/controllers/OnRampController.d.ts.map +1 -1
  121. package/lib/typescript/controllers/OptionsController.d.ts +2 -7
  122. package/lib/typescript/controllers/OptionsController.d.ts.map +1 -1
  123. package/lib/typescript/controllers/PublicStateController.d.ts +1 -1
  124. package/lib/typescript/controllers/PublicStateController.d.ts.map +1 -1
  125. package/lib/typescript/controllers/RouterController.d.ts +16 -4
  126. package/lib/typescript/controllers/RouterController.d.ts.map +1 -1
  127. package/lib/typescript/controllers/SendController.d.ts +7 -5
  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 -12
  132. package/lib/typescript/controllers/SwapController.d.ts.map +1 -1
  133. package/lib/typescript/controllers/ThemeController.d.ts +1 -1
  134. package/lib/typescript/controllers/ThemeController.d.ts.map +1 -1
  135. package/lib/typescript/controllers/TransactionsController.d.ts +3 -3
  136. package/lib/typescript/controllers/TransactionsController.d.ts.map +1 -1
  137. package/lib/typescript/controllers/WebviewController.d.ts +21 -0
  138. package/lib/typescript/controllers/WebviewController.d.ts.map +1 -0
  139. package/lib/typescript/index.d.ts +4 -1
  140. package/lib/typescript/index.d.ts.map +1 -1
  141. package/lib/typescript/utils/AssetUtil.d.ts +3 -2
  142. package/lib/typescript/utils/AssetUtil.d.ts.map +1 -1
  143. package/lib/typescript/utils/ConnectionUtil.d.ts +4 -0
  144. package/lib/typescript/utils/ConnectionUtil.d.ts.map +1 -0
  145. package/lib/typescript/utils/ConstantsUtil.d.ts +3 -422
  146. package/lib/typescript/utils/ConstantsUtil.d.ts.map +1 -1
  147. package/lib/typescript/utils/CoreHelperUtil.d.ts +4 -5
  148. package/lib/typescript/utils/CoreHelperUtil.d.ts.map +1 -1
  149. package/lib/typescript/utils/FetchUtil.d.ts +1 -1
  150. package/lib/typescript/utils/FetchUtil.d.ts.map +1 -1
  151. package/lib/typescript/utils/NetworkUtil.d.ts +8 -0
  152. package/lib/typescript/utils/NetworkUtil.d.ts.map +1 -0
  153. package/lib/typescript/utils/StorageUtil.d.ts +7 -14
  154. package/lib/typescript/utils/StorageUtil.d.ts.map +1 -1
  155. package/lib/typescript/utils/SwapApiUtil.d.ts +3 -3
  156. package/lib/typescript/utils/SwapApiUtil.d.ts.map +1 -1
  157. package/lib/typescript/utils/TypeUtil.d.ts +191 -42
  158. package/lib/typescript/utils/TypeUtil.d.ts.map +1 -1
  159. package/package.json +4 -4
  160. package/src/controllers/AccountController.ts +27 -23
  161. package/src/controllers/ApiController.ts +10 -29
  162. package/src/controllers/BlockchainApiController.ts +65 -179
  163. package/src/controllers/ConnectionController.ts +24 -12
  164. package/src/controllers/ConnectorController.ts +63 -0
  165. package/src/controllers/EnsController.ts +2 -2
  166. package/src/controllers/EventsController.ts +1 -1
  167. package/src/controllers/ModalController.ts +8 -8
  168. package/src/controllers/NetworkController.ts +1 -1
  169. package/src/controllers/OnRampController.ts +99 -35
  170. package/src/controllers/OptionsController.ts +13 -19
  171. package/src/controllers/PublicStateController.ts +1 -1
  172. package/src/controllers/RouterController.ts +54 -5
  173. package/src/controllers/SendController.ts +113 -124
  174. package/src/controllers/SnackController.ts +5 -31
  175. package/src/controllers/SwapController.ts +181 -174
  176. package/src/controllers/ThemeController.ts +2 -11
  177. package/src/controllers/TransactionsController.ts +20 -26
  178. package/src/controllers/WebviewController.ts +63 -0
  179. package/src/index.ts +6 -3
  180. package/src/utils/AssetUtil.ts +20 -4
  181. package/src/utils/ConnectionUtil.ts +27 -0
  182. package/src/utils/ConstantsUtil.ts +9 -544
  183. package/src/utils/CoreHelperUtil.ts +9 -34
  184. package/src/utils/FetchUtil.ts +31 -10
  185. package/src/utils/NetworkUtil.ts +33 -0
  186. package/src/utils/StorageUtil.ts +48 -60
  187. package/src/utils/SwapApiUtil.ts +38 -27
  188. package/src/utils/TypeUtil.ts +193 -43
  189. package/lib/commonjs/controllers/ConnectionsController.js +0 -387
  190. package/lib/commonjs/controllers/ConnectionsController.js.map +0 -1
  191. package/lib/module/controllers/ConnectionsController.js +0 -382
  192. package/lib/module/controllers/ConnectionsController.js.map +0 -1
  193. package/lib/typescript/controllers/ConnectionsController.d.ts +0 -53
  194. package/lib/typescript/controllers/ConnectionsController.d.ts.map +0 -1
  195. package/src/controllers/ConnectionsController.ts +0 -509
@@ -1,12 +1,28 @@
1
- import type { AccountType, CaipAddress, CaipNetworkId } from '@reown/appkit-common-react-native';
2
- import type { SocialProvider, Transaction } from '@reown/appkit-common-react-native';
3
-
1
+ import { type EventEmitter } from 'events';
2
+ import type {
3
+ Balance,
4
+ SocialProvider,
5
+ ThemeMode,
6
+ Transaction,
7
+ ConnectorType
8
+ } from '@reown/appkit-common-react-native';
4
9
  import { OnRampErrorType } from './ConstantsUtil';
5
10
 
6
11
  export interface BaseError {
7
12
  message?: string;
8
13
  }
9
14
 
15
+ export type CaipAddress = `${string}:${string}:${string}`;
16
+
17
+ export type CaipNetworkId = `${string}:${string}`;
18
+
19
+ export interface CaipNetwork {
20
+ id: CaipNetworkId;
21
+ name?: string;
22
+ imageId?: string;
23
+ imageUrl?: string;
24
+ }
25
+
10
26
  export type ConnectedWalletInfo =
11
27
  | {
12
28
  name?: string;
@@ -32,6 +48,18 @@ export type ProjectId = string;
32
48
 
33
49
  export type Platform = 'mobile' | 'web' | 'qrcode' | 'email' | 'unsupported';
34
50
 
51
+ export type Connector = {
52
+ id: string;
53
+ type: ConnectorType;
54
+ name?: string;
55
+ imageId?: string;
56
+ explorerId?: string;
57
+ imageUrl?: string;
58
+ info?: { rdns?: string };
59
+ provider?: unknown;
60
+ installed?: boolean;
61
+ };
62
+
35
63
  export type CaipNamespaces = Record<
36
64
  string,
37
65
  {
@@ -43,9 +71,12 @@ export type CaipNamespaces = Record<
43
71
 
44
72
  export type SdkType = 'appkit';
45
73
 
46
- export type SdkVersion = `react-native-${string}-${string}`;
74
+ export type SdkVersion =
75
+ | `react-native-wagmi-${string}`
76
+ | `react-native-ethers5-${string}`
77
+ | `react-native-ethers-${string}`;
47
78
 
48
- type EnabledSocials = SocialProvider;
79
+ type EnabledSocials = Exclude<SocialProvider, 'farcaster'>;
49
80
 
50
81
  export type Features = {
51
82
  /**
@@ -59,10 +90,15 @@ export type Features = {
59
90
  */
60
91
  onramp?: boolean;
61
92
  /**
62
- * @description Show or hide the regular wallet options when socials are enabled. Enabled by default.
93
+ * @description Enable or disable the email feature. Enabled by default.
94
+ * @type {boolean}
95
+ */
96
+ email?: boolean;
97
+ /**
98
+ * @description Show or hide the regular wallet options when email is enabled. Enabled by default.
63
99
  * @type {boolean}
64
100
  */
65
- showWallets?: boolean;
101
+ emailShowWallets?: boolean;
66
102
  /**
67
103
  * @description Enable or disable the socials feature. Enabled by default.
68
104
  * @type {EnabledSocials[]}
@@ -124,7 +160,7 @@ export type RequestCache =
124
160
 
125
161
  // -- BlockchainApiController Types ---------------------------------------------
126
162
  export interface BlockchainApiIdentityRequest {
127
- address: `0x${string}`;
163
+ address: string;
128
164
  }
129
165
 
130
166
  export interface BlockchainApiIdentityResponse {
@@ -132,22 +168,8 @@ export interface BlockchainApiIdentityResponse {
132
168
  name: string;
133
169
  }
134
170
 
135
- export interface BlockchainApiBalance {
136
- name: string;
137
- symbol: string;
138
- chainId: string;
139
- address?: CaipAddress;
140
- value?: number;
141
- price: number;
142
- quantity: {
143
- decimals: string;
144
- numeric: string;
145
- };
146
- iconUrl: string;
147
- }
148
-
149
171
  export interface BlockchainApiBalanceResponse {
150
- balances: BlockchainApiBalance[];
172
+ balances: Balance[];
151
173
  }
152
174
 
153
175
  export interface BlockchainApiTransactionsRequest {
@@ -157,7 +179,6 @@ export interface BlockchainApiTransactionsRequest {
157
179
  onramp?: 'coinbase';
158
180
  signal?: AbortSignal;
159
181
  cache?: RequestCache;
160
- chainId: CaipNetworkId;
161
182
  }
162
183
 
163
184
  export interface BlockchainApiTransactionsResponse {
@@ -171,9 +192,9 @@ export interface BlockchainApiSwapAllowanceResponse {
171
192
 
172
193
  export interface BlockchainApiGenerateSwapCalldataRequest {
173
194
  projectId: string;
174
- userAddress: CaipAddress;
175
- from: CaipAddress;
176
- to: CaipAddress;
195
+ userAddress: string;
196
+ from: string;
197
+ to: string;
177
198
  amount: string;
178
199
  eip155?: {
179
200
  slippage: string;
@@ -196,9 +217,9 @@ export interface BlockchainApiGenerateSwapCalldataResponse {
196
217
 
197
218
  export interface BlockchainApiGenerateApproveCalldataRequest {
198
219
  projectId: string;
199
- userAddress: CaipAddress;
200
- from: CaipAddress;
201
- to: CaipAddress;
220
+ userAddress: string;
221
+ from: string;
222
+ to: string;
202
223
  amount?: number;
203
224
  }
204
225
 
@@ -218,7 +239,7 @@ export interface BlockchainApiGenerateApproveCalldataResponse {
218
239
  export interface BlockchainApiTokenPriceRequest {
219
240
  projectId: string;
220
241
  currency?: 'usd' | 'eur' | 'gbp' | 'aud' | 'cad' | 'inr' | 'jpy' | 'btc' | 'eth';
221
- addresses: CaipAddress[];
242
+ addresses: string[];
222
243
  }
223
244
 
224
245
  export interface BlockchainApiTokenPriceResponse {
@@ -232,13 +253,13 @@ export interface BlockchainApiTokenPriceResponse {
232
253
 
233
254
  export interface BlockchainApiSwapAllowanceRequest {
234
255
  projectId: string;
235
- tokenAddress: CaipAddress;
236
- userAddress: CaipAddress;
256
+ tokenAddress: string;
257
+ userAddress: string;
237
258
  }
238
259
 
239
260
  export interface BlockchainApiGasPriceRequest {
240
261
  projectId: string;
241
- chainId: CaipNetworkId;
262
+ chainId: string;
242
263
  }
243
264
 
244
265
  export interface BlockchainApiGasPriceResponse {
@@ -273,11 +294,11 @@ export interface BlockchainApiLookupEnsName {
273
294
 
274
295
  export interface BlockchainApiSwapQuoteRequest {
275
296
  projectId: string;
276
- chainId?: CaipNetworkId;
297
+ chainId?: string;
277
298
  amount: string;
278
- userAddress: CaipAddress;
279
- from: CaipAddress;
280
- to: CaipAddress;
299
+ userAddress: string;
300
+ from: string;
301
+ to: string;
281
302
  gasPrice: string;
282
303
  }
283
304
 
@@ -293,16 +314,17 @@ export interface BlockchainApiSwapQuoteResponse {
293
314
 
294
315
  export interface BlockchainApiSwapTokensRequest {
295
316
  projectId: string;
296
- chainId: CaipNetworkId;
317
+ chainId?: string;
297
318
  }
298
319
 
299
320
  export interface BlockchainApiOnRampQuotesRequest {
300
321
  countryCode: string;
301
- paymentMethodType: string;
322
+ paymentMethodType?: string;
302
323
  destinationCurrencyCode: string;
303
324
  sourceAmount: number;
304
325
  sourceCurrencyCode: string;
305
326
  walletAddress: string;
327
+ excludeProviders?: string[];
306
328
  }
307
329
 
308
330
  export interface BlockchainApiSwapTokensResponse {
@@ -325,13 +347,31 @@ export type BlockchainApiOnRampWidgetResponse = {
325
347
  };
326
348
 
327
349
  // -- OptionsController Types ---------------------------------------------------
350
+ export interface Token {
351
+ address: string;
352
+ image?: string;
353
+ }
354
+
355
+ export type Tokens = Record<CaipNetworkId, Token>;
356
+
357
+ export type Metadata = {
358
+ name: string;
359
+ description: string;
360
+ url: string;
361
+ icons: string[];
362
+ redirect?: {
363
+ native?: string;
364
+ universal?: string;
365
+ linkMode?: boolean;
366
+ };
367
+ };
368
+
328
369
  export type CustomWallet = Pick<
329
370
  WcWallet,
330
371
  | 'id'
331
372
  | 'name'
332
373
  | 'homepage'
333
374
  | 'image_url'
334
- | 'image_id'
335
375
  | 'mobile_link'
336
376
  | 'desktop_link'
337
377
  | 'webapp_link'
@@ -357,6 +397,9 @@ export type EventName =
357
397
  | 'CLICK_NETWORK_HELP'
358
398
  | 'CLICK_GET_WALLET'
359
399
  | 'EMAIL_LOGIN_SELECTED'
400
+ | 'EMAIL_SUBMITTED'
401
+ | 'DEVICE_REGISTERED_FOR_EMAIL'
402
+ | 'EMAIL_VERIFICATION_CODE_SENT'
360
403
  | 'EMAIL_VERIFICATION_CODE_PASS'
361
404
  | 'EMAIL_VERIFICATION_CODE_FAIL'
362
405
  | 'EMAIL_EDIT'
@@ -419,7 +462,7 @@ export type Event =
419
462
  type: 'track';
420
463
  event: 'SWITCH_NETWORK';
421
464
  properties: {
422
- network: number | string;
465
+ network: string;
423
466
  };
424
467
  }
425
468
  | {
@@ -471,6 +514,18 @@ export type Event =
471
514
  type: 'track';
472
515
  event: 'EMAIL_LOGIN_SELECTED';
473
516
  }
517
+ | {
518
+ type: 'track';
519
+ event: 'EMAIL_SUBMITTED';
520
+ }
521
+ | {
522
+ type: 'track';
523
+ event: 'DEVICE_REGISTERED_FOR_EMAIL';
524
+ }
525
+ | {
526
+ type: 'track';
527
+ event: 'EMAIL_VERIFICATION_CODE_SENT';
528
+ }
474
529
  | {
475
530
  type: 'track';
476
531
  event: 'EMAIL_VERIFICATION_CODE_PASS';
@@ -672,7 +727,7 @@ export type Event =
672
727
  type: 'track';
673
728
  event: 'SET_PREFERRED_ACCOUNT_TYPE';
674
729
  properties: {
675
- accountType: AccountType;
730
+ accountType: AppKitFrameAccountType;
676
731
  network: string;
677
732
  };
678
733
  }
@@ -806,6 +861,12 @@ export type OnRampCountry = {
806
861
  name: string;
807
862
  };
808
863
 
864
+ export type OnRampCountryDefaults = {
865
+ countryCode: string;
866
+ defaultCurrencyCode: string;
867
+ defaultPaymentMethods: string[];
868
+ };
869
+
809
870
  export type OnRampFiatCurrency = {
810
871
  currencyCode: string;
811
872
  name: string;
@@ -875,3 +936,92 @@ export type OnRampTransactionResult = {
875
936
  status: string | null;
876
937
  network: string | null;
877
938
  };
939
+
940
+ // -- Email Types ------------------------------------------------
941
+ /**
942
+ * Matches type defined for packages/wallet/src/AppKitFrameProvider.ts
943
+ * It's duplicated in order to decouple scaffold from email package
944
+ */
945
+
946
+ export type AppKitFrameAccountType = 'eoa' | 'smartAccount';
947
+
948
+ export interface AppKitFrameProvider {
949
+ readonly id: string;
950
+ readonly name: string;
951
+ getEventEmitter(): EventEmitter;
952
+ getSecureSiteURL(): string;
953
+ getSecureSiteDashboardURL(): string;
954
+ getSecureSiteIconURL(): string;
955
+ getEmail(): string | undefined;
956
+ getUsername(): string | undefined;
957
+ getLastUsedChainId(): Promise<number | undefined>;
958
+ rejectRpcRequest(): void;
959
+ connectEmail(payload: { email: string }): Promise<{
960
+ action: 'VERIFY_DEVICE' | 'VERIFY_OTP';
961
+ }>;
962
+ connectDevice(): Promise<unknown>;
963
+ connectSocial(uri: string): Promise<{
964
+ chainId: string | number;
965
+ email: string;
966
+ address: string;
967
+ accounts?: {
968
+ type: AppKitFrameAccountType;
969
+ address: string;
970
+ }[];
971
+ userName?: string;
972
+ }>;
973
+ getSocialRedirectUri(payload: { provider: SocialProvider }): Promise<{
974
+ uri: string;
975
+ }>;
976
+ connectOtp(payload: { otp: string }): Promise<unknown>;
977
+ connectFarcaster: () => Promise<{ userName: string }>;
978
+ getFarcasterUri(): Promise<{ url: string }>;
979
+ isConnected(): Promise<{
980
+ isConnected: boolean;
981
+ }>;
982
+ getChainId(): Promise<{
983
+ chainId: number;
984
+ }>;
985
+ updateEmail(payload: { email: string }): Promise<{
986
+ action: 'VERIFY_PRIMARY_OTP' | 'VERIFY_SECONDARY_OTP';
987
+ }>;
988
+ updateEmailPrimaryOtp(payload: { otp: string }): Promise<unknown>;
989
+ updateEmailSecondaryOtp(payload: { otp: string }): Promise<{
990
+ newEmail: string;
991
+ }>;
992
+ syncTheme(payload: {
993
+ themeMode: ThemeMode | undefined;
994
+ themeVariables: Record<string, string | number> | undefined;
995
+ }): Promise<unknown>;
996
+ syncDappData(payload: {
997
+ projectId: string;
998
+ sdkVersion: SdkVersion;
999
+ sdkType: SdkType;
1000
+ metadata?: Metadata;
1001
+ }): Promise<unknown>;
1002
+ connect(payload?: { chainId: number | undefined }): Promise<{
1003
+ chainId: number;
1004
+ email?: string | null;
1005
+ address: string;
1006
+ smartAccountDeployed: boolean;
1007
+ preferredAccountType: AppKitFrameAccountType;
1008
+ }>;
1009
+ switchNetwork(chainId: number): Promise<{
1010
+ chainId: number;
1011
+ }>;
1012
+ setPreferredAccount(type: AppKitFrameAccountType): Promise<{
1013
+ type: AppKitFrameAccountType;
1014
+ address: string;
1015
+ }>;
1016
+ setOnTimeout(callback: () => void): void;
1017
+ getSmartAccountEnabledNetworks(): Promise<{
1018
+ smartAccountEnabledNetworks: number[];
1019
+ }>;
1020
+ disconnect(): Promise<unknown>;
1021
+ request(req: any): Promise<any>;
1022
+ AuthView: () => React.JSX.Element | null;
1023
+ Webview: () => React.JSX.Element | null;
1024
+ onSetPreferredAccount: (
1025
+ callback: (values: { type: AppKitFrameAccountType; address: string }) => void
1026
+ ) => void;
1027
+ }