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