@reown/appkit-core-react-native 0.0.0-fix-approved-networks-20250822000414 → 0.0.0-fix-ui-changes-20250828183750

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