@one_deploy/sdk 1.0.4 → 1.0.6

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 (57) hide show
  1. package/dist/config/index.d.mts +74 -0
  2. package/dist/config/index.d.ts +74 -0
  3. package/dist/config/index.js +244 -0
  4. package/dist/config/index.js.map +1 -0
  5. package/dist/config/index.mjs +226 -0
  6. package/dist/config/index.mjs.map +1 -0
  7. package/dist/engine-BeVuHpVx.d.mts +1202 -0
  8. package/dist/engine-DSc1Em4V.d.ts +1202 -0
  9. package/dist/hooks/index.d.mts +185 -0
  10. package/dist/hooks/index.d.ts +185 -0
  11. package/dist/hooks/index.js +1711 -0
  12. package/dist/hooks/index.js.map +1 -0
  13. package/dist/hooks/index.mjs +1699 -0
  14. package/dist/hooks/index.mjs.map +1 -0
  15. package/dist/index.d.mts +356 -0
  16. package/dist/index.d.ts +356 -0
  17. package/dist/index.js +5420 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/index.mjs +5293 -0
  20. package/dist/index.mjs.map +1 -0
  21. package/dist/price-CgqXPnT3.d.ts +13 -0
  22. package/dist/price-ClbLHHjv.d.mts +13 -0
  23. package/dist/providers/index.d.mts +121 -0
  24. package/dist/providers/index.d.ts +121 -0
  25. package/dist/providers/index.js +1741 -0
  26. package/dist/providers/index.js.map +1 -0
  27. package/dist/providers/index.mjs +1699 -0
  28. package/dist/providers/index.mjs.map +1 -0
  29. package/dist/react-native.d.mts +257 -0
  30. package/dist/react-native.d.ts +257 -0
  31. package/dist/react-native.js +2436 -0
  32. package/dist/react-native.js.map +1 -0
  33. package/dist/react-native.mjs +2392 -0
  34. package/dist/react-native.mjs.map +1 -0
  35. package/dist/services/index.d.mts +105 -0
  36. package/dist/services/index.d.ts +105 -0
  37. package/dist/services/index.js +1720 -0
  38. package/dist/services/index.js.map +1 -0
  39. package/dist/services/index.mjs +1709 -0
  40. package/dist/services/index.mjs.map +1 -0
  41. package/dist/supabase-BT0c7q9e.d.mts +82 -0
  42. package/dist/supabase-BT0c7q9e.d.ts +82 -0
  43. package/dist/types/index.d.mts +759 -0
  44. package/dist/types/index.d.ts +759 -0
  45. package/dist/types/index.js +4 -0
  46. package/dist/types/index.js.map +1 -0
  47. package/dist/types/index.mjs +3 -0
  48. package/dist/types/index.mjs.map +1 -0
  49. package/dist/utils/index.d.mts +36 -0
  50. package/dist/utils/index.d.ts +36 -0
  51. package/dist/utils/index.js +164 -0
  52. package/dist/utils/index.js.map +1 -0
  53. package/dist/utils/index.mjs +142 -0
  54. package/dist/utils/index.mjs.map +1 -0
  55. package/package.json +5 -1
  56. package/tsconfig.json +0 -22
  57. package/tsup.config.ts +0 -25
@@ -0,0 +1,2436 @@
1
+ 'use strict';
2
+
3
+ var reactNative = require('react-native');
4
+ var jsxRuntime = require('react/jsx-runtime');
5
+
6
+ // src/config/index.ts
7
+ var DEFAULT_ENGINE_URL = "https://api.one23.io";
8
+ var DEFAULT_CLIENT_ID = "one_pk_e8f647bfa643fdcfaa3a23f760488e49be09f929296eed4a6c399d437d907f60";
9
+ var config = null;
10
+ function initOneSDK(options) {
11
+ const engineUrl = options.oneEngineUrl || DEFAULT_ENGINE_URL;
12
+ const clientId = options.oneClientId || DEFAULT_CLIENT_ID;
13
+ config = {
14
+ ...options,
15
+ oneEngineUrl: engineUrl,
16
+ oneClientId: clientId
17
+ };
18
+ }
19
+ function getConfig() {
20
+ if (!config) {
21
+ throw new Error("ONE SDK not initialized. Call initOneSDK() first.");
22
+ }
23
+ return config;
24
+ }
25
+ var TOKEN_NAMES = {
26
+ ETH: "Ethereum",
27
+ BTC: "Bitcoin",
28
+ BNB: "BNB",
29
+ MATIC: "Polygon",
30
+ POL: "Polygon",
31
+ AVAX: "Avalanche",
32
+ USDT: "Tether",
33
+ USDC: "USD Coin",
34
+ DAI: "Dai",
35
+ WBTC: "Wrapped Bitcoin",
36
+ WETH: "Wrapped Ether",
37
+ ARB: "Arbitrum",
38
+ OP: "Optimism",
39
+ LINK: "Chainlink",
40
+ UNI: "Uniswap",
41
+ AAVE: "Aave",
42
+ CRV: "Curve",
43
+ MKR: "Maker",
44
+ SNX: "Synthetix",
45
+ COMP: "Compound",
46
+ SUSHI: "SushiSwap",
47
+ YFI: "Yearn Finance",
48
+ SOL: "Solana",
49
+ DOT: "Polkadot",
50
+ ATOM: "Cosmos",
51
+ NEAR: "Near Protocol"
52
+ };
53
+ var COINGECKO_IDS = {
54
+ ETH: "ethereum",
55
+ BTC: "bitcoin",
56
+ BNB: "binancecoin",
57
+ MATIC: "matic-network",
58
+ POL: "matic-network",
59
+ AVAX: "avalanche-2",
60
+ USDT: "tether",
61
+ USDC: "usd-coin",
62
+ DAI: "dai",
63
+ WBTC: "wrapped-bitcoin",
64
+ WETH: "weth",
65
+ ARB: "arbitrum",
66
+ OP: "optimism",
67
+ LINK: "chainlink",
68
+ UNI: "uniswap",
69
+ AAVE: "aave",
70
+ SOL: "solana"
71
+ };
72
+ var CHAIN_CONFIGS = {
73
+ ethereum: {
74
+ id: 1,
75
+ name: "Ethereum",
76
+ shortName: "ETH",
77
+ icon: "\u229F",
78
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
79
+ rpcUrls: ["https://ethereum.rpc.thirdweb.com"],
80
+ blockExplorerUrls: ["https://etherscan.io"],
81
+ testnet: false
82
+ },
83
+ polygon: {
84
+ id: 137,
85
+ name: "Polygon",
86
+ shortName: "MATIC",
87
+ icon: "\u{1F7E3}",
88
+ nativeCurrency: { name: "POL", symbol: "POL", decimals: 18 },
89
+ rpcUrls: ["https://polygon.rpc.thirdweb.com"],
90
+ blockExplorerUrls: ["https://polygonscan.com"],
91
+ testnet: false
92
+ },
93
+ base: {
94
+ id: 8453,
95
+ name: "Base",
96
+ shortName: "BASE",
97
+ icon: "\u{1F537}",
98
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
99
+ rpcUrls: ["https://base.rpc.thirdweb.com"],
100
+ blockExplorerUrls: ["https://basescan.org"],
101
+ testnet: false
102
+ },
103
+ arbitrum: {
104
+ id: 42161,
105
+ name: "Arbitrum One",
106
+ shortName: "ARB",
107
+ icon: "\u{1F535}",
108
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
109
+ rpcUrls: ["https://arbitrum.rpc.thirdweb.com"],
110
+ blockExplorerUrls: ["https://arbiscan.io"],
111
+ testnet: false
112
+ },
113
+ optimism: {
114
+ id: 10,
115
+ name: "Optimism",
116
+ shortName: "OP",
117
+ icon: "\u{1F534}",
118
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
119
+ rpcUrls: ["https://optimism.rpc.thirdweb.com"],
120
+ blockExplorerUrls: ["https://optimistic.etherscan.io"],
121
+ testnet: false
122
+ }
123
+ };
124
+
125
+ // src/services/engine.ts
126
+ var OneEngineClient = class {
127
+ constructor(options) {
128
+ const config2 = getConfig();
129
+ this.baseUrl = options?.baseUrl || config2.oneEngineUrl;
130
+ this.clientId = options?.clientId || config2.oneClientId || "";
131
+ this.secretKey = options?.secretKey || config2.oneSecretKey;
132
+ }
133
+ /**
134
+ * Set access token for authenticated requests
135
+ */
136
+ setAccessToken(token) {
137
+ this.accessToken = token;
138
+ }
139
+ /**
140
+ * Clear access token
141
+ */
142
+ clearAccessToken() {
143
+ this.accessToken = void 0;
144
+ }
145
+ getHeaders(includeSecret = false) {
146
+ const headers = {
147
+ "Content-Type": "application/json",
148
+ "x-client-id": this.clientId
149
+ };
150
+ if (this.accessToken) {
151
+ headers["Authorization"] = `Bearer ${this.accessToken}`;
152
+ }
153
+ if (includeSecret && this.secretKey) {
154
+ headers["x-secret-key"] = this.secretKey;
155
+ }
156
+ return headers;
157
+ }
158
+ async request(endpoint, options = {}, includeSecret = false) {
159
+ try {
160
+ const response = await fetch(`${this.baseUrl}${endpoint}`, {
161
+ ...options,
162
+ headers: {
163
+ ...this.getHeaders(includeSecret),
164
+ ...options.headers
165
+ }
166
+ });
167
+ const data = await response.json();
168
+ if (!response.ok) {
169
+ return {
170
+ success: false,
171
+ error: {
172
+ code: data.error?.code || `HTTP_${response.status}`,
173
+ message: data.error?.message || "Request failed"
174
+ }
175
+ };
176
+ }
177
+ return {
178
+ success: true,
179
+ data: data.data || data
180
+ };
181
+ } catch (error) {
182
+ return {
183
+ success: false,
184
+ error: {
185
+ code: "NETWORK_ERROR",
186
+ message: error instanceof Error ? error.message : "Network request failed"
187
+ }
188
+ };
189
+ }
190
+ }
191
+ // ===============================
192
+ // AUTH ENDPOINTS
193
+ // ===============================
194
+ /**
195
+ * Send OTP to email for authentication
196
+ */
197
+ async sendEmailOtp(email) {
198
+ return this.request("/api/v1/auth/otp", {
199
+ method: "POST",
200
+ body: JSON.stringify({ email })
201
+ });
202
+ }
203
+ /**
204
+ * Verify OTP and get access token
205
+ */
206
+ async verifyEmailOtp(email, otp) {
207
+ return this.request("/api/v1/auth/otp/verify", {
208
+ method: "POST",
209
+ body: JSON.stringify({ email, otp })
210
+ });
211
+ }
212
+ /**
213
+ * Authenticate with wallet signature
214
+ */
215
+ async authWithWallet(walletAddress, signature, message) {
216
+ return this.request("/api/v1/auth/wallet", {
217
+ method: "POST",
218
+ body: JSON.stringify({ walletAddress, signature, message })
219
+ });
220
+ }
221
+ /**
222
+ * Refresh access token
223
+ */
224
+ async refreshToken(refreshToken) {
225
+ return this.request("/api/v1/auth/refresh", {
226
+ method: "POST",
227
+ body: JSON.stringify({ refreshToken })
228
+ });
229
+ }
230
+ /**
231
+ * Get current user
232
+ */
233
+ async getCurrentUser() {
234
+ return this.request("/api/v1/auth/me", { method: "GET" });
235
+ }
236
+ /**
237
+ * Sign out
238
+ */
239
+ async signOut() {
240
+ return this.request("/api/v1/auth/logout", { method: "POST" });
241
+ }
242
+ // ===============================
243
+ // WALLET/ASSETS ENDPOINTS
244
+ // ===============================
245
+ /**
246
+ * Get wallet balance across all chains
247
+ */
248
+ async getWalletBalance(walletAddress, chains) {
249
+ const params = new URLSearchParams({ address: walletAddress });
250
+ if (chains?.length && chains.length > 0) {
251
+ params.set("chainId", chains[0].toString());
252
+ }
253
+ return this.request(`/api/v1/assets?${params}`, { method: "GET" });
254
+ }
255
+ /**
256
+ * Get portfolio summary
257
+ */
258
+ async getPortfolioSummary(walletAddress) {
259
+ const params = new URLSearchParams({ address: walletAddress });
260
+ return this.request(`/api/v1/assets/portfolio?${params}`, { method: "GET" });
261
+ }
262
+ /**
263
+ * Get user's wallets
264
+ */
265
+ async getUserWallets(chainId) {
266
+ const params = chainId ? `?chainId=${chainId}` : "";
267
+ return this.request(`/api/v1/wallet${params}`, { method: "GET" });
268
+ }
269
+ /**
270
+ * Create a new wallet
271
+ */
272
+ async createWallet(chainId = 8453, type = "smart") {
273
+ return this.request("/api/v1/wallet", {
274
+ method: "POST",
275
+ body: JSON.stringify({ chainId, type })
276
+ });
277
+ }
278
+ /**
279
+ * Get wallet transactions (placeholder - needs endpoint)
280
+ */
281
+ async getWalletTransactions(walletAddress, options) {
282
+ const params = new URLSearchParams({ address: walletAddress });
283
+ if (options?.limit) params.set("limit", options.limit.toString());
284
+ if (options?.offset) params.set("offset", options.offset.toString());
285
+ if (options?.chainId) params.set("chainId", options.chainId.toString());
286
+ return this.request(`/api/v1/assets/transactions?${params}`, { method: "GET" });
287
+ }
288
+ /**
289
+ * Send native token or ERC20
290
+ */
291
+ async sendTransaction(request) {
292
+ return this.request("/api/v1/wallet/send", {
293
+ method: "POST",
294
+ body: JSON.stringify(request)
295
+ });
296
+ }
297
+ /**
298
+ * Get transaction status
299
+ */
300
+ async getTransactionStatus(txId) {
301
+ return this.request(`/api/v1/wallet/transaction/${txId}`, { method: "GET" });
302
+ }
303
+ // ===============================
304
+ // ONRAMP ENDPOINTS (Fiat-to-Crypto)
305
+ // ===============================
306
+ /**
307
+ * Get onramp quote
308
+ */
309
+ async getOnrampQuote(fiatCurrency, fiatAmount, cryptoCurrency, paymentMethod) {
310
+ const params = new URLSearchParams({
311
+ fiatCurrency,
312
+ fiatAmount: fiatAmount.toString(),
313
+ cryptoCurrency
314
+ });
315
+ if (paymentMethod) params.set("paymentMethod", paymentMethod);
316
+ return this.request(`/api/v1/fiat/onramp/quote?${params}`, { method: "GET" });
317
+ }
318
+ /**
319
+ * Create onramp session (returns widget URL)
320
+ */
321
+ async createOnrampSession(request) {
322
+ return this.request("/api/v1/fiat/onramp", {
323
+ method: "POST",
324
+ body: JSON.stringify({
325
+ fiatCurrency: request.fiatCurrency || "USD",
326
+ fiatAmount: request.fiatAmount || 100,
327
+ cryptoCurrency: request.cryptoCurrency || "ETH",
328
+ walletAddress: request.walletAddress,
329
+ chainId: 8453
330
+ // Default to Base
331
+ })
332
+ });
333
+ }
334
+ /**
335
+ * Get onramp session status
336
+ */
337
+ async getOnrampStatus(sessionId) {
338
+ return this.request(`/api/v1/fiat/onramp/${sessionId}`, { method: "GET" });
339
+ }
340
+ /**
341
+ * Get supported currencies (fiat + crypto)
342
+ */
343
+ async getSupportedCurrencies() {
344
+ return this.request("/api/v1/fiat/onramp", { method: "GET" });
345
+ }
346
+ /**
347
+ * Get supported fiat currencies
348
+ */
349
+ async getSupportedFiatCurrencies() {
350
+ const result = await this.getSupportedCurrencies();
351
+ if (result.success && result.data) {
352
+ return { success: true, data: result.data.fiatCurrencies };
353
+ }
354
+ return { success: false, error: result.error };
355
+ }
356
+ /**
357
+ * Get supported payment methods
358
+ */
359
+ async getSupportedPaymentMethods(country) {
360
+ return { success: true, data: ["card", "bank_transfer", "apple_pay", "google_pay"] };
361
+ }
362
+ // ===============================
363
+ // SWAP ENDPOINTS
364
+ // ===============================
365
+ /**
366
+ * Get swap quote
367
+ */
368
+ async getSwapQuote(request) {
369
+ return this.request("/api/v1/swap/quote", {
370
+ method: "POST",
371
+ body: JSON.stringify(request)
372
+ });
373
+ }
374
+ /**
375
+ * Execute swap
376
+ */
377
+ async executeSwap(request) {
378
+ return this.request("/api/v1/swap/execute", {
379
+ method: "POST",
380
+ body: JSON.stringify(request)
381
+ });
382
+ }
383
+ /**
384
+ * Get swap status
385
+ */
386
+ async getSwapStatus(swapId) {
387
+ return this.request(`/api/v1/swap/${swapId}`, { method: "GET" });
388
+ }
389
+ /**
390
+ * Get supported tokens for swap
391
+ */
392
+ async getSupportedSwapTokens(chainId) {
393
+ const params = chainId ? `?chainId=${chainId}` : "";
394
+ return this.request(`/api/v1/swap/tokens${params}`, { method: "GET" });
395
+ }
396
+ /**
397
+ * Get supported chains for swap
398
+ */
399
+ async getSupportedSwapChains() {
400
+ return this.request("/api/v1/swap/chains", { method: "GET" });
401
+ }
402
+ // ===============================
403
+ // AI TRADING/QUANT ENDPOINTS
404
+ // ===============================
405
+ /**
406
+ * Get available AI trading strategies
407
+ */
408
+ async getStrategies() {
409
+ return this.request("/api/v1/quant/strategies", { method: "GET" });
410
+ }
411
+ /**
412
+ * Get strategy details
413
+ */
414
+ async getStrategy(strategyId) {
415
+ return this.request(`/api/v1/quant/strategies/${strategyId}`, { method: "GET" });
416
+ }
417
+ /**
418
+ * Get user's positions
419
+ */
420
+ async getPositions() {
421
+ return this.request("/api/v1/quant/positions", { method: "GET" });
422
+ }
423
+ /**
424
+ * Create investment order
425
+ */
426
+ async createOrder(strategyId, amount, currency) {
427
+ return this.request("/api/v1/trading/orders", {
428
+ method: "POST",
429
+ body: JSON.stringify({ strategyId, amount, currency })
430
+ });
431
+ }
432
+ /**
433
+ * Get user's orders
434
+ */
435
+ async getUserOrders() {
436
+ return this.request("/api/v1/trading/orders", { method: "GET" });
437
+ }
438
+ /**
439
+ * Get user's portfolio stats from positions
440
+ */
441
+ async getPortfolioStats() {
442
+ const positionsResult = await this.getPositions();
443
+ if (positionsResult.success && positionsResult.data) {
444
+ const positions = positionsResult.data;
445
+ const totalInvested = positions.reduce((sum, p) => sum + (p.investedAmount || 0), 0);
446
+ const totalValue = positions.reduce((sum, p) => sum + (p.currentValue || 0), 0);
447
+ const totalPnl = totalValue - totalInvested;
448
+ const totalPnlPercent = totalInvested > 0 ? totalPnl / totalInvested * 100 : 0;
449
+ return {
450
+ success: true,
451
+ data: {
452
+ totalInvested,
453
+ totalValue,
454
+ totalPnl,
455
+ totalPnlPercent,
456
+ activePositions: positions.filter((p) => p.status === "active").length
457
+ }
458
+ };
459
+ }
460
+ return {
461
+ success: true,
462
+ data: { totalInvested: 0, totalValue: 0, totalPnl: 0, totalPnlPercent: 0, activePositions: 0 }
463
+ };
464
+ }
465
+ // ===============================
466
+ // MARKET/PRICE ENDPOINTS
467
+ // ===============================
468
+ /**
469
+ * Get token prices
470
+ */
471
+ async getTokenPrices(symbols) {
472
+ const bybitSymbols = symbols.map((s) => {
473
+ const upper = s.toUpperCase();
474
+ if (upper.endsWith("USDT")) return upper;
475
+ return `${upper}USDT`;
476
+ });
477
+ const result = await this.request(
478
+ `/api/v1/trading/market?symbols=${bybitSymbols.join(",")}`,
479
+ { method: "GET" }
480
+ );
481
+ if (result.success && result.data?.markets) {
482
+ const prices = {};
483
+ for (const market of result.data.markets) {
484
+ const symbol = market.symbol?.replace("USDT", "") || "";
485
+ prices[symbol] = {
486
+ price: parseFloat(market.lastPrice) || 0,
487
+ change24h: parseFloat(market.price24hPcnt) * 100 || 0,
488
+ marketCap: void 0
489
+ // Bybit doesn't provide this
490
+ };
491
+ }
492
+ return { success: true, data: prices };
493
+ }
494
+ return { success: false, error: result.error };
495
+ }
496
+ /**
497
+ * Get market data overview
498
+ */
499
+ async getMarketData() {
500
+ const result = await this.request("/api/v1/trading/market", { method: "GET" });
501
+ if (result.success && result.data?.markets) {
502
+ return {
503
+ success: true,
504
+ data: {
505
+ totalMarketCap: 0,
506
+ // Would need separate API
507
+ totalVolume24h: result.data.markets.reduce((sum, m) => sum + (parseFloat(m.volume24h) || 0), 0),
508
+ btcDominance: 0,
509
+ // Would need separate API
510
+ markets: result.data.markets
511
+ }
512
+ };
513
+ }
514
+ return { success: false, error: result.error };
515
+ }
516
+ // ===============================
517
+ // NFT ENDPOINTS
518
+ // ===============================
519
+ /**
520
+ * Get user's NFTs
521
+ */
522
+ async getUserNFTs(walletAddress, options) {
523
+ const params = new URLSearchParams({ address: walletAddress });
524
+ if (options?.chainId) params.set("chainId", options.chainId.toString());
525
+ if (options?.limit) params.set("limit", options.limit.toString());
526
+ if (options?.offset) params.set("offset", options.offset.toString());
527
+ return this.request(`/api/v1/assets/nfts?${params}`, { method: "GET" });
528
+ }
529
+ /**
530
+ * Get NFT details
531
+ */
532
+ async getNFTDetails(contractAddress, tokenId, chainId) {
533
+ return this.request(`/api/v1/assets/nfts/${contractAddress}/${tokenId}?chainId=${chainId}`, { method: "GET" });
534
+ }
535
+ /**
536
+ * Get NFT collection
537
+ */
538
+ async getNFTCollection(contractAddress, chainId) {
539
+ return this.request(`/api/v1/assets/nfts/collection/${contractAddress}?chainId=${chainId}`, { method: "GET" });
540
+ }
541
+ /**
542
+ * Transfer NFT
543
+ */
544
+ async transferNFT(params) {
545
+ return this.request("/api/v1/assets/nfts/transfer", {
546
+ method: "POST",
547
+ body: JSON.stringify(params)
548
+ });
549
+ }
550
+ // ===============================
551
+ // CONTRACT ENDPOINTS
552
+ // ===============================
553
+ /**
554
+ * Get user's contracts
555
+ */
556
+ async getUserContracts(options) {
557
+ const params = new URLSearchParams();
558
+ if (options?.chainId) params.set("chainId", options.chainId.toString());
559
+ if (options?.limit) params.set("limit", options.limit.toString());
560
+ if (options?.offset) params.set("offset", options.offset.toString());
561
+ return this.request(`/api/v1/contracts?${params}`, { method: "GET" });
562
+ }
563
+ /**
564
+ * Get contract details
565
+ */
566
+ async getContractDetails(address, chainId) {
567
+ return this.request(`/api/v1/contracts/${address}?chainId=${chainId}`, { method: "GET" });
568
+ }
569
+ /**
570
+ * Read contract (call view function)
571
+ */
572
+ async readContract(params) {
573
+ return this.request("/api/v1/contracts/read", {
574
+ method: "POST",
575
+ body: JSON.stringify(params)
576
+ });
577
+ }
578
+ /**
579
+ * Write to contract (execute transaction)
580
+ */
581
+ async writeContract(params) {
582
+ return this.request("/api/v1/contracts/write", {
583
+ method: "POST",
584
+ body: JSON.stringify(params)
585
+ });
586
+ }
587
+ /**
588
+ * Deploy contract
589
+ */
590
+ async deployContract(params) {
591
+ return this.request("/api/v1/contracts/deploy", {
592
+ method: "POST",
593
+ body: JSON.stringify(params)
594
+ });
595
+ }
596
+ // ===============================
597
+ // OFFRAMP ENDPOINTS (Crypto-to-Fiat)
598
+ // ===============================
599
+ /**
600
+ * Get offramp quote
601
+ */
602
+ async getOfframpQuote(cryptoCurrency, cryptoAmount, fiatCurrency, payoutMethod) {
603
+ const params = new URLSearchParams({
604
+ cryptoCurrency,
605
+ cryptoAmount: cryptoAmount.toString(),
606
+ fiatCurrency
607
+ });
608
+ if (payoutMethod) params.set("payoutMethod", payoutMethod);
609
+ return this.request(`/api/v1/fiat/offramp/quote?${params}`, { method: "GET" });
610
+ }
611
+ /**
612
+ * Create offramp transaction
613
+ */
614
+ async createOfframpTransaction(request) {
615
+ return this.request("/api/v1/fiat/offramp", {
616
+ method: "POST",
617
+ body: JSON.stringify(request)
618
+ });
619
+ }
620
+ /**
621
+ * Get offramp transaction status
622
+ */
623
+ async getOfframpStatus(transactionId) {
624
+ return this.request(`/api/v1/fiat/offramp/${transactionId}`, { method: "GET" });
625
+ }
626
+ /**
627
+ * Get supported payout methods
628
+ */
629
+ async getSupportedPayoutMethods(country) {
630
+ const params = country ? `?country=${country}` : "";
631
+ return this.request(`/api/v1/fiat/offramp/methods${params}`, { method: "GET" });
632
+ }
633
+ // ===============================
634
+ // BILL PAYMENT ENDPOINTS
635
+ // ===============================
636
+ /**
637
+ * Get bill providers
638
+ */
639
+ async getBillProviders(country, category) {
640
+ const params = new URLSearchParams();
641
+ if (country) params.set("country", country);
642
+ if (category) params.set("category", category);
643
+ return this.request(`/api/v1/bills/providers?${params}`, { method: "GET" });
644
+ }
645
+ /**
646
+ * Get bill details/validate account
647
+ */
648
+ async validateBillAccount(providerId, accountNumber) {
649
+ return this.request("/api/v1/bills/validate", {
650
+ method: "POST",
651
+ body: JSON.stringify({ providerId, accountNumber })
652
+ });
653
+ }
654
+ /**
655
+ * Pay bill
656
+ */
657
+ async payBill(params) {
658
+ return this.request("/api/v1/bills/pay", {
659
+ method: "POST",
660
+ body: JSON.stringify(params)
661
+ });
662
+ }
663
+ /**
664
+ * Get bill payment history
665
+ */
666
+ async getBillHistory(options) {
667
+ const params = new URLSearchParams();
668
+ if (options?.limit) params.set("limit", options.limit.toString());
669
+ if (options?.offset) params.set("offset", options.offset.toString());
670
+ return this.request(`/api/v1/bills/history?${params}`, { method: "GET" });
671
+ }
672
+ // ===============================
673
+ // STAKING ENDPOINTS
674
+ // ===============================
675
+ /**
676
+ * Get staking pools
677
+ */
678
+ async getStakingPools(chainId) {
679
+ const params = chainId ? `?chainId=${chainId}` : "";
680
+ return this.request(`/api/v1/staking/pools${params}`, { method: "GET" });
681
+ }
682
+ /**
683
+ * Get user's staking positions
684
+ */
685
+ async getStakingPositions() {
686
+ return this.request("/api/v1/staking/positions", { method: "GET" });
687
+ }
688
+ /**
689
+ * Stake tokens
690
+ */
691
+ async stake(params) {
692
+ return this.request("/api/v1/staking/stake", {
693
+ method: "POST",
694
+ body: JSON.stringify(params)
695
+ });
696
+ }
697
+ /**
698
+ * Unstake tokens
699
+ */
700
+ async unstake(params) {
701
+ return this.request("/api/v1/staking/unstake", {
702
+ method: "POST",
703
+ body: JSON.stringify(params)
704
+ });
705
+ }
706
+ /**
707
+ * Claim staking rewards
708
+ */
709
+ async claimStakingRewards(positionId) {
710
+ return this.request("/api/v1/staking/claim", {
711
+ method: "POST",
712
+ body: JSON.stringify({ positionId })
713
+ });
714
+ }
715
+ // ===============================
716
+ // USER PROFILE ENDPOINTS
717
+ // ===============================
718
+ /**
719
+ * Get user profile
720
+ */
721
+ async getUserProfile() {
722
+ return this.request("/api/v1/user/profile", { method: "GET" });
723
+ }
724
+ /**
725
+ * Update user profile
726
+ */
727
+ async updateUserProfile(updates) {
728
+ return this.request("/api/v1/user/profile", {
729
+ method: "PATCH",
730
+ body: JSON.stringify(updates)
731
+ });
732
+ }
733
+ /**
734
+ * Get user settings
735
+ */
736
+ async getUserSettings() {
737
+ return this.request("/api/v1/user/settings", { method: "GET" });
738
+ }
739
+ /**
740
+ * Update user settings
741
+ */
742
+ async updateUserSettings(updates) {
743
+ return this.request("/api/v1/user/settings", {
744
+ method: "PATCH",
745
+ body: JSON.stringify(updates)
746
+ });
747
+ }
748
+ // ===============================
749
+ // NOTIFICATION ENDPOINTS
750
+ // ===============================
751
+ /**
752
+ * Get notifications
753
+ */
754
+ async getNotifications(options) {
755
+ const params = new URLSearchParams();
756
+ if (options?.unreadOnly) params.set("unreadOnly", "true");
757
+ if (options?.limit) params.set("limit", options.limit.toString());
758
+ if (options?.offset) params.set("offset", options.offset.toString());
759
+ return this.request(`/api/v1/notifications?${params}`, { method: "GET" });
760
+ }
761
+ /**
762
+ * Mark notification as read
763
+ */
764
+ async markNotificationRead(notificationId) {
765
+ return this.request(`/api/v1/notifications/${notificationId}/read`, { method: "POST" });
766
+ }
767
+ /**
768
+ * Mark all notifications as read
769
+ */
770
+ async markAllNotificationsRead() {
771
+ return this.request("/api/v1/notifications/read-all", { method: "POST" });
772
+ }
773
+ // ===============================
774
+ // REFERRAL ENDPOINTS
775
+ // ===============================
776
+ /**
777
+ * Get referral info
778
+ */
779
+ async getReferralInfo() {
780
+ return this.request("/api/v1/referral", { method: "GET" });
781
+ }
782
+ /**
783
+ * Get referred users
784
+ */
785
+ async getReferrals() {
786
+ return this.request("/api/v1/referral/list", { method: "GET" });
787
+ }
788
+ /**
789
+ * Apply referral code
790
+ */
791
+ async applyReferralCode(code) {
792
+ return this.request("/api/v1/referral/apply", {
793
+ method: "POST",
794
+ body: JSON.stringify({ code })
795
+ });
796
+ }
797
+ /**
798
+ * Claim referral rewards
799
+ */
800
+ async claimReferralRewards() {
801
+ return this.request("/api/v1/referral/claim", { method: "POST" });
802
+ }
803
+ // ===============================
804
+ // KYC ENDPOINTS
805
+ // ===============================
806
+ /**
807
+ * Get KYC status
808
+ */
809
+ async getKycStatus() {
810
+ return this.request("/api/v1/kyc/status", { method: "GET" });
811
+ }
812
+ /**
813
+ * Start KYC verification
814
+ */
815
+ async startKycVerification(level) {
816
+ return this.request("/api/v1/kyc/start", {
817
+ method: "POST",
818
+ body: JSON.stringify({ level })
819
+ });
820
+ }
821
+ /**
822
+ * Submit KYC documents
823
+ */
824
+ async submitKycDocuments(params) {
825
+ return this.request("/api/v1/kyc/submit", {
826
+ method: "POST",
827
+ body: JSON.stringify(params)
828
+ });
829
+ }
830
+ // ===============================
831
+ // BRIDGE ENDPOINTS
832
+ // ===============================
833
+ /**
834
+ * Get bridge quote
835
+ */
836
+ async getBridgeQuote(params) {
837
+ return this.request("/api/v1/bridge/quote", {
838
+ method: "POST",
839
+ body: JSON.stringify(params)
840
+ });
841
+ }
842
+ /**
843
+ * Execute bridge transaction
844
+ */
845
+ async executeBridge(params) {
846
+ return this.request("/api/v1/bridge/execute", {
847
+ method: "POST",
848
+ body: JSON.stringify(params)
849
+ });
850
+ }
851
+ /**
852
+ * Get bridge transaction status
853
+ */
854
+ async getBridgeStatus(bridgeId) {
855
+ return this.request(`/api/v1/bridge/${bridgeId}`, { method: "GET" });
856
+ }
857
+ /**
858
+ * Get supported bridge routes
859
+ */
860
+ async getSupportedBridgeRoutes() {
861
+ return this.request("/api/v1/bridge/routes", { method: "GET" });
862
+ }
863
+ // ===============================
864
+ // GAS ENDPOINTS
865
+ // ===============================
866
+ /**
867
+ * Get gas estimate for transaction
868
+ */
869
+ async getGasEstimate(params) {
870
+ return this.request("/api/v1/gas/estimate", {
871
+ method: "POST",
872
+ body: JSON.stringify(params)
873
+ });
874
+ }
875
+ /**
876
+ * Get current gas prices for chain
877
+ */
878
+ async getGasPrice(chainId) {
879
+ return this.request(`/api/v1/gas/price?chainId=${chainId}`, { method: "GET" });
880
+ }
881
+ // ===============================
882
+ // WALLET IMPORT/EXPORT ENDPOINTS
883
+ // ===============================
884
+ /**
885
+ * Import wallet from private key or mnemonic
886
+ */
887
+ async importWallet(request) {
888
+ return this.request("/api/v1/wallet/import", {
889
+ method: "POST",
890
+ body: JSON.stringify(request)
891
+ }, true);
892
+ }
893
+ /**
894
+ * Export wallet (get encrypted private key)
895
+ * Requires additional authentication
896
+ */
897
+ async exportWallet(walletId, pin) {
898
+ return this.request("/api/v1/wallet/export", {
899
+ method: "POST",
900
+ body: JSON.stringify({ walletId, pin })
901
+ }, true);
902
+ }
903
+ /**
904
+ * Generate new mnemonic phrase
905
+ */
906
+ async generateMnemonic() {
907
+ return this.request("/api/v1/wallet/generate-mnemonic", { method: "POST" }, true);
908
+ }
909
+ /**
910
+ * Validate mnemonic phrase
911
+ */
912
+ async validateMnemonic(mnemonic) {
913
+ return this.request("/api/v1/wallet/validate-mnemonic", {
914
+ method: "POST",
915
+ body: JSON.stringify({ mnemonic })
916
+ });
917
+ }
918
+ // ===============================
919
+ // PORTFOLIO ANALYTICS ENDPOINTS
920
+ // ===============================
921
+ /**
922
+ * Get portfolio analytics with historical data
923
+ */
924
+ async getPortfolioAnalytics(walletAddress, period = "30d") {
925
+ const params = new URLSearchParams({ address: walletAddress, period });
926
+ return this.request(`/api/v1/analytics/portfolio?${params}`, { method: "GET" });
927
+ }
928
+ /**
929
+ * Get transaction analytics
930
+ */
931
+ async getTransactionAnalytics(walletAddress, period = "30d") {
932
+ const params = new URLSearchParams({ address: walletAddress, period });
933
+ return this.request(`/api/v1/analytics/transactions?${params}`, { method: "GET" });
934
+ }
935
+ // ===============================
936
+ // ADVANCED TRADING ENDPOINTS
937
+ // ===============================
938
+ /**
939
+ * Create limit order
940
+ */
941
+ async createLimitOrder(params) {
942
+ return this.request("/api/v1/trading/limit-orders", {
943
+ method: "POST",
944
+ body: JSON.stringify(params)
945
+ });
946
+ }
947
+ /**
948
+ * Get user's limit orders
949
+ */
950
+ async getLimitOrders(status) {
951
+ const params = status ? `?status=${status}` : "";
952
+ return this.request(`/api/v1/trading/limit-orders${params}`, { method: "GET" });
953
+ }
954
+ /**
955
+ * Cancel limit order
956
+ */
957
+ async cancelLimitOrder(orderId) {
958
+ return this.request(`/api/v1/trading/limit-orders/${orderId}`, { method: "DELETE" });
959
+ }
960
+ /**
961
+ * Set price alert
962
+ */
963
+ async setPriceAlert(params) {
964
+ return this.request("/api/v1/trading/alerts", {
965
+ method: "POST",
966
+ body: JSON.stringify(params)
967
+ });
968
+ }
969
+ /**
970
+ * Get price alerts
971
+ */
972
+ async getPriceAlerts() {
973
+ return this.request("/api/v1/trading/alerts", { method: "GET" });
974
+ }
975
+ /**
976
+ * Delete price alert
977
+ */
978
+ async deletePriceAlert(alertId) {
979
+ return this.request(`/api/v1/trading/alerts/${alertId}`, { method: "DELETE" });
980
+ }
981
+ // ===============================
982
+ // SESSION MANAGEMENT
983
+ // ===============================
984
+ /**
985
+ * Get active sessions
986
+ */
987
+ async getActiveSessions() {
988
+ return this.request("/api/v1/auth/sessions", { method: "GET" });
989
+ }
990
+ /**
991
+ * Revoke session
992
+ */
993
+ async revokeSession(sessionId) {
994
+ return this.request(`/api/v1/auth/sessions/${sessionId}`, { method: "DELETE" });
995
+ }
996
+ /**
997
+ * Revoke all other sessions
998
+ */
999
+ async revokeAllOtherSessions() {
1000
+ return this.request("/api/v1/auth/sessions/revoke-all", { method: "POST" });
1001
+ }
1002
+ // ========== Webhooks ==========
1003
+ /**
1004
+ * List webhooks for the project
1005
+ */
1006
+ async listWebhooks(options) {
1007
+ const params = new URLSearchParams();
1008
+ if (options?.isActive !== void 0) params.set("isActive", String(options.isActive));
1009
+ const query = params.toString();
1010
+ return this.request(`/api/v1/webhooks${query ? `?${query}` : ""}`, { method: "GET" });
1011
+ }
1012
+ /**
1013
+ * Get webhook by ID
1014
+ */
1015
+ async getWebhook(webhookId) {
1016
+ return this.request(`/api/v1/webhooks/${webhookId}`, { method: "GET" });
1017
+ }
1018
+ /**
1019
+ * Create a webhook
1020
+ */
1021
+ async createWebhook(input) {
1022
+ return this.request("/api/v1/webhooks", {
1023
+ method: "POST",
1024
+ body: JSON.stringify(input)
1025
+ });
1026
+ }
1027
+ /**
1028
+ * Update a webhook
1029
+ */
1030
+ async updateWebhook(webhookId, input) {
1031
+ return this.request(`/api/v1/webhooks/${webhookId}`, {
1032
+ method: "PATCH",
1033
+ body: JSON.stringify(input)
1034
+ });
1035
+ }
1036
+ /**
1037
+ * Delete a webhook
1038
+ */
1039
+ async deleteWebhook(webhookId) {
1040
+ return this.request(`/api/v1/webhooks/${webhookId}`, { method: "DELETE" });
1041
+ }
1042
+ /**
1043
+ * Get webhook deliveries
1044
+ */
1045
+ async getWebhookDeliveries(webhookId, options) {
1046
+ const params = new URLSearchParams();
1047
+ if (options?.status) params.set("status", options.status);
1048
+ if (options?.limit) params.set("limit", String(options.limit));
1049
+ if (options?.offset) params.set("offset", String(options.offset));
1050
+ const query = params.toString();
1051
+ return this.request(`/api/v1/webhooks/${webhookId}/deliveries${query ? `?${query}` : ""}`, { method: "GET" });
1052
+ }
1053
+ /**
1054
+ * Test a webhook
1055
+ */
1056
+ async testWebhook(webhookId) {
1057
+ return this.request(`/api/v1/webhooks/${webhookId}/test`, { method: "POST" });
1058
+ }
1059
+ // ========== Admin (requires admin role) ==========
1060
+ /**
1061
+ * List all users (admin only)
1062
+ */
1063
+ async adminListUsers(options) {
1064
+ const params = new URLSearchParams();
1065
+ if (options?.page) params.set("page", String(options.page));
1066
+ if (options?.limit) params.set("limit", String(options.limit));
1067
+ if (options?.search) params.set("search", options.search);
1068
+ if (options?.sortBy) params.set("sortBy", options.sortBy);
1069
+ if (options?.sortOrder) params.set("sortOrder", options.sortOrder);
1070
+ if (options?.role) params.set("role", options.role);
1071
+ if (options?.kycStatus) params.set("kycStatus", options.kycStatus);
1072
+ if (options?.isActive !== void 0) params.set("isActive", String(options.isActive));
1073
+ const query = params.toString();
1074
+ return this.request(`/api/v1/admin/users${query ? `?${query}` : ""}`, { method: "GET" });
1075
+ }
1076
+ /**
1077
+ * Get user by ID (admin only)
1078
+ */
1079
+ async adminGetUser(userId) {
1080
+ return this.request(`/api/v1/admin/users/${userId}`, { method: "GET" });
1081
+ }
1082
+ /**
1083
+ * Update user (admin only)
1084
+ */
1085
+ async adminUpdateUser(userId, data) {
1086
+ return this.request(`/api/v1/admin/users/${userId}`, {
1087
+ method: "PATCH",
1088
+ body: JSON.stringify(data)
1089
+ });
1090
+ }
1091
+ /**
1092
+ * List all projects (admin only)
1093
+ */
1094
+ async adminListProjects(options) {
1095
+ const params = new URLSearchParams();
1096
+ if (options?.page) params.set("page", String(options.page));
1097
+ if (options?.limit) params.set("limit", String(options.limit));
1098
+ if (options?.search) params.set("search", options.search);
1099
+ if (options?.sortBy) params.set("sortBy", options.sortBy);
1100
+ if (options?.sortOrder) params.set("sortOrder", options.sortOrder);
1101
+ if (options?.isActive !== void 0) params.set("isActive", String(options.isActive));
1102
+ const query = params.toString();
1103
+ return this.request(`/api/v1/admin/projects${query ? `?${query}` : ""}`, { method: "GET" });
1104
+ }
1105
+ /**
1106
+ * Get project by ID (admin only)
1107
+ */
1108
+ async adminGetProject(projectId) {
1109
+ return this.request(`/api/v1/admin/projects/${projectId}`, { method: "GET" });
1110
+ }
1111
+ /**
1112
+ * Update project (admin only)
1113
+ */
1114
+ async adminUpdateProject(projectId, data) {
1115
+ return this.request(`/api/v1/admin/projects/${projectId}`, {
1116
+ method: "PATCH",
1117
+ body: JSON.stringify(data)
1118
+ });
1119
+ }
1120
+ /**
1121
+ * Regenerate project API key (admin only)
1122
+ */
1123
+ async adminRegenerateApiKey(projectId) {
1124
+ return this.request(`/api/v1/admin/projects/${projectId}/regenerate-key`, { method: "POST" });
1125
+ }
1126
+ /**
1127
+ * Get system statistics (admin only)
1128
+ */
1129
+ async adminGetStats(days) {
1130
+ const query = days ? `?days=${days}` : "";
1131
+ return this.request(`/api/v1/admin/stats${query}`, { method: "GET" });
1132
+ }
1133
+ /**
1134
+ * Get system logs (admin only)
1135
+ */
1136
+ async adminGetLogs(options) {
1137
+ const params = new URLSearchParams();
1138
+ if (options?.level) params.set("level", options.level);
1139
+ if (options?.service) params.set("service", options.service);
1140
+ if (options?.limit) params.set("limit", String(options.limit));
1141
+ if (options?.offset) params.set("offset", String(options.offset));
1142
+ if (options?.startDate) params.set("startDate", options.startDate);
1143
+ if (options?.endDate) params.set("endDate", options.endDate);
1144
+ const query = params.toString();
1145
+ return this.request(`/api/v1/admin/logs${query ? `?${query}` : ""}`, { method: "GET" });
1146
+ }
1147
+ /**
1148
+ * Get rate limit status (admin only)
1149
+ */
1150
+ async adminGetRateLimits(options) {
1151
+ const params = new URLSearchParams();
1152
+ if (options?.identifier) params.set("identifier", options.identifier);
1153
+ if (options?.limit) params.set("limit", String(options.limit));
1154
+ const query = params.toString();
1155
+ return this.request(`/api/v1/admin/rate-limits${query ? `?${query}` : ""}`, { method: "GET" });
1156
+ }
1157
+ /**
1158
+ * Clear rate limits for an identifier (admin only)
1159
+ */
1160
+ async adminClearRateLimits(identifier) {
1161
+ return this.request(`/api/v1/admin/rate-limits/${identifier}`, { method: "DELETE" });
1162
+ }
1163
+ // ========== AI Agent Configuration ==========
1164
+ /**
1165
+ * Get all AI agent configurations
1166
+ * This returns the full agent setup including tiers, cycles, and trading parameters
1167
+ */
1168
+ async getAgentConfigs(options) {
1169
+ const params = new URLSearchParams();
1170
+ if (options?.includeInactive) params.set("includeInactive", "true");
1171
+ if (options?.agentId) params.set("agentId", options.agentId);
1172
+ const query = params.toString();
1173
+ return this.request(`/api/v1/agents${query ? `?${query}` : ""}`, { method: "GET" });
1174
+ }
1175
+ /**
1176
+ * Calculate subscription parameters for an agent
1177
+ */
1178
+ async calculateAgentParams(params) {
1179
+ return this.request("/api/v1/agents/calculate", {
1180
+ method: "POST",
1181
+ body: JSON.stringify(params)
1182
+ });
1183
+ }
1184
+ /**
1185
+ * Get supported trading pairs from agents
1186
+ */
1187
+ async getTradingPairs() {
1188
+ const result = await this.getAgentConfigs();
1189
+ if (result.success && result.data?.agents) {
1190
+ const allPairs = /* @__PURE__ */ new Set();
1191
+ const byAgent = {};
1192
+ for (const agent of result.data.agents) {
1193
+ byAgent[agent.id] = agent.supported_pairs;
1194
+ agent.supported_pairs.forEach((p) => allPairs.add(p));
1195
+ }
1196
+ return { success: true, data: { pairs: Array.from(allPairs), byAgent } };
1197
+ }
1198
+ return { success: false, error: result.error };
1199
+ }
1200
+ // ========== AI Quant Trading ==========
1201
+ /**
1202
+ * Get all AI trading strategies
1203
+ */
1204
+ async getAIStrategies(filters) {
1205
+ const params = new URLSearchParams();
1206
+ if (filters?.category) params.set("category", filters.category);
1207
+ if (filters?.riskLevel) params.set("risk_level", String(filters.riskLevel));
1208
+ if (filters?.minTvl) params.set("min_tvl", String(filters.minTvl));
1209
+ if (filters?.isActive !== void 0) params.set("is_active", String(filters.isActive));
1210
+ const query = params.toString();
1211
+ return this.request(`/api/v1/ai-quant/strategies${query ? `?${query}` : ""}`, { method: "GET" });
1212
+ }
1213
+ /**
1214
+ * Get AI strategy details
1215
+ */
1216
+ async getAIStrategy(strategyId, include) {
1217
+ const params = new URLSearchParams();
1218
+ if (include?.length) params.set("include", include.join(","));
1219
+ const query = params.toString();
1220
+ return this.request(`/api/v1/ai-quant/strategies/${strategyId}${query ? `?${query}` : ""}`, { method: "GET" });
1221
+ }
1222
+ /**
1223
+ * Get strategy performance history
1224
+ */
1225
+ async getAIStrategyPerformance(strategyId, days = 30) {
1226
+ return this.request(`/api/v1/ai-quant/strategies/${strategyId}?include=performance&days=${days}`, { method: "GET" });
1227
+ }
1228
+ /**
1229
+ * Get real-time market data for strategy pairs
1230
+ */
1231
+ async getAIStrategyMarketData(strategyId) {
1232
+ return this.request(`/api/v1/ai-quant/strategies/${strategyId}?include=market`, { method: "GET" });
1233
+ }
1234
+ /**
1235
+ * Create AI trading order
1236
+ */
1237
+ async createAIOrder(request) {
1238
+ return this.request("/api/v1/ai-quant/orders", {
1239
+ method: "POST",
1240
+ body: JSON.stringify(request)
1241
+ });
1242
+ }
1243
+ /**
1244
+ * Get user's AI orders
1245
+ */
1246
+ async getAIOrders(filters) {
1247
+ const params = new URLSearchParams();
1248
+ if (filters?.strategyId) params.set("strategy_id", filters.strategyId);
1249
+ if (filters?.status) params.set("status", filters.status);
1250
+ const query = params.toString();
1251
+ return this.request(`/api/v1/ai-quant/orders${query ? `?${query}` : ""}`, { method: "GET" });
1252
+ }
1253
+ /**
1254
+ * Get AI order details
1255
+ */
1256
+ async getAIOrder(orderId) {
1257
+ return this.request(`/api/v1/ai-quant/orders/${orderId}`, { method: "GET" });
1258
+ }
1259
+ /**
1260
+ * Pause AI order
1261
+ */
1262
+ async pauseAIOrder(orderId) {
1263
+ return this.request(`/api/v1/ai-quant/orders/${orderId}/pause`, { method: "POST" });
1264
+ }
1265
+ /**
1266
+ * Resume AI order
1267
+ */
1268
+ async resumeAIOrder(orderId) {
1269
+ return this.request(`/api/v1/ai-quant/orders/${orderId}/resume`, { method: "POST" });
1270
+ }
1271
+ /**
1272
+ * Request redemption for AI order
1273
+ */
1274
+ async redeemAIOrder(orderId) {
1275
+ return this.request(`/api/v1/ai-quant/orders/${orderId}/redeem`, { method: "POST" });
1276
+ }
1277
+ /**
1278
+ * Get AI portfolio summary
1279
+ */
1280
+ async getAIPortfolio(include) {
1281
+ const params = new URLSearchParams();
1282
+ if (include?.length) params.set("include", include.join(","));
1283
+ const query = params.toString();
1284
+ return this.request(`/api/v1/ai-quant/portfolio${query ? `?${query}` : ""}`, { method: "GET" });
1285
+ }
1286
+ /**
1287
+ * Get user's trade allocations
1288
+ */
1289
+ async getAITradeAllocations(limit = 50) {
1290
+ return this.request(`/api/v1/ai-quant/portfolio?include=allocations&limit=${limit}`, { method: "GET" });
1291
+ }
1292
+ /**
1293
+ * Get trade history for a strategy
1294
+ */
1295
+ async getAITradeHistory(strategyId, limit = 50) {
1296
+ return this.request(`/api/v1/ai-quant/strategies/${strategyId}?include=trades&limit=${limit}`, { method: "GET" });
1297
+ }
1298
+ /**
1299
+ * Execute AI signals for a strategy (admin only)
1300
+ */
1301
+ async executeAISignals(strategyId) {
1302
+ return this.request("/api/v1/ai-quant/execute", {
1303
+ method: "POST",
1304
+ body: JSON.stringify({ strategyId })
1305
+ });
1306
+ }
1307
+ // ========== Free Price APIs (No API Key Required) ==========
1308
+ /**
1309
+ * Get cryptocurrency prices (FREE - uses CoinGecko/Binance/CoinCap)
1310
+ */
1311
+ async getCryptoPrices(symbols) {
1312
+ return this.request(`/api/v1/prices?symbols=${symbols.join(",")}`, { method: "GET" });
1313
+ }
1314
+ /**
1315
+ * Get single cryptocurrency price (FREE)
1316
+ */
1317
+ async getCryptoPrice(symbol) {
1318
+ return this.request(`/api/v1/prices/${symbol}`, { method: "GET" });
1319
+ }
1320
+ /**
1321
+ * Get OHLCV candles for charting (FREE - from Binance)
1322
+ */
1323
+ async getCryptoCandles(symbol, interval = "1h", limit = 100) {
1324
+ return this.request(`/api/v1/prices/${symbol}?candles=true&interval=${interval}&limit=${limit}`, { method: "GET" });
1325
+ }
1326
+ /**
1327
+ * Get top cryptocurrencies by market cap (FREE)
1328
+ */
1329
+ async getTopCryptos(limit = 20) {
1330
+ return this.request(`/api/v1/prices?type=top&limit=${limit}`, { method: "GET" });
1331
+ }
1332
+ /**
1333
+ * Get crypto market overview (FREE)
1334
+ */
1335
+ async getCryptoMarketOverview() {
1336
+ return this.request("/api/v1/prices?type=overview", { method: "GET" });
1337
+ }
1338
+ // ========== Project Management ==========
1339
+ /**
1340
+ * Get user's projects
1341
+ */
1342
+ async getProjects(options) {
1343
+ const params = new URLSearchParams();
1344
+ if (options?.isActive !== void 0) params.set("isActive", String(options.isActive));
1345
+ const query = params.toString();
1346
+ return this.request(`/api/v1/projects${query ? `?${query}` : ""}`, { method: "GET" });
1347
+ }
1348
+ /**
1349
+ * Create a new project for ecosystem partners
1350
+ */
1351
+ async createProject(params) {
1352
+ return this.request("/api/v1/projects", {
1353
+ method: "POST",
1354
+ body: JSON.stringify(params)
1355
+ });
1356
+ }
1357
+ /**
1358
+ * Get project details
1359
+ */
1360
+ async getProject(projectId) {
1361
+ return this.request(`/api/v1/projects/${projectId}`, { method: "GET" });
1362
+ }
1363
+ /**
1364
+ * Update project settings
1365
+ */
1366
+ async updateProject(projectId, updates) {
1367
+ return this.request(`/api/v1/projects/${projectId}`, {
1368
+ method: "PATCH",
1369
+ body: JSON.stringify(updates)
1370
+ });
1371
+ }
1372
+ /**
1373
+ * Get project features status
1374
+ */
1375
+ async getProjectFeatures(projectId) {
1376
+ return this.request(`/api/v1/projects/${projectId}/features`, { method: "GET" });
1377
+ }
1378
+ /**
1379
+ * Enable/disable features for a project
1380
+ */
1381
+ async updateProjectFeatures(projectId, features) {
1382
+ return this.request(`/api/v1/projects/${projectId}/features`, {
1383
+ method: "PATCH",
1384
+ body: JSON.stringify(features)
1385
+ });
1386
+ }
1387
+ /**
1388
+ * Regenerate project API key
1389
+ */
1390
+ async regenerateProjectApiKey(projectId) {
1391
+ return this.request(`/api/v1/projects/${projectId}/api-key`, { method: "POST" });
1392
+ }
1393
+ /**
1394
+ * Delete project
1395
+ */
1396
+ async deleteProject(projectId) {
1397
+ return this.request(`/api/v1/projects/${projectId}`, { method: "DELETE" });
1398
+ }
1399
+ };
1400
+ function createOneEngineClient(options) {
1401
+ return new OneEngineClient(options);
1402
+ }
1403
+
1404
+ // src/services/price.ts
1405
+ var COINGECKO_API = "https://api.coingecko.com/api/v3";
1406
+ var FALLBACK_PRICES = {
1407
+ ETH: 3500,
1408
+ BTC: 95e3,
1409
+ BNB: 700,
1410
+ MATIC: 0.5,
1411
+ AVAX: 40,
1412
+ USDT: 1,
1413
+ USDC: 1,
1414
+ DAI: 1,
1415
+ WBTC: 95e3,
1416
+ WETH: 3500,
1417
+ ARB: 1.2,
1418
+ OP: 2.5,
1419
+ LINK: 20,
1420
+ UNI: 12,
1421
+ AAVE: 250,
1422
+ SOL: 200
1423
+ };
1424
+ var PriceService = class {
1425
+ constructor() {
1426
+ this.cache = /* @__PURE__ */ new Map();
1427
+ this.cacheTTL = 60 * 1e3;
1428
+ }
1429
+ // 1 minute cache
1430
+ async getPrice(symbol) {
1431
+ const upperSymbol = symbol.toUpperCase();
1432
+ const cached = this.cache.get(upperSymbol);
1433
+ if (cached && Date.now() - cached.timestamp < this.cacheTTL) {
1434
+ return cached.price;
1435
+ }
1436
+ const coinId = COINGECKO_IDS[upperSymbol];
1437
+ if (!coinId) {
1438
+ return this.getFallbackPrice(upperSymbol);
1439
+ }
1440
+ try {
1441
+ const response = await fetch(
1442
+ `${COINGECKO_API}/simple/price?ids=${coinId}&vs_currencies=usd&include_24hr_change=true&include_market_cap=true&include_24hr_vol=true`,
1443
+ { headers: { Accept: "application/json" } }
1444
+ );
1445
+ if (!response.ok) {
1446
+ throw new Error(`CoinGecko API error: ${response.status}`);
1447
+ }
1448
+ const data = await response.json();
1449
+ const coinData = data[coinId];
1450
+ if (!coinData) {
1451
+ return this.getFallbackPrice(upperSymbol);
1452
+ }
1453
+ const change24h = coinData.usd_24h_change || 0;
1454
+ const price = {
1455
+ symbol: upperSymbol,
1456
+ price: coinData.usd || 0,
1457
+ change24h,
1458
+ changePercent24h: change24h,
1459
+ priceChange24h: change24h,
1460
+ marketCap: coinData.usd_market_cap,
1461
+ volume24h: coinData.usd_24h_vol
1462
+ };
1463
+ this.cache.set(upperSymbol, { price, timestamp: Date.now() });
1464
+ return price;
1465
+ } catch (error) {
1466
+ console.warn(`Failed to fetch price for ${upperSymbol}:`, error);
1467
+ return this.getFallbackPrice(upperSymbol);
1468
+ }
1469
+ }
1470
+ async getPrices(symbols) {
1471
+ const results = {};
1472
+ const withIds = [];
1473
+ const withoutIds = [];
1474
+ for (const symbol of symbols) {
1475
+ const upper = symbol.toUpperCase();
1476
+ if (COINGECKO_IDS[upper]) {
1477
+ withIds.push(upper);
1478
+ } else {
1479
+ withoutIds.push(upper);
1480
+ }
1481
+ }
1482
+ for (const symbol of withoutIds) {
1483
+ results[symbol] = this.getFallbackPrice(symbol);
1484
+ }
1485
+ if (withIds.length === 0) {
1486
+ return results;
1487
+ }
1488
+ const coinIds = withIds.map((s) => COINGECKO_IDS[s]).join(",");
1489
+ try {
1490
+ const response = await fetch(
1491
+ `${COINGECKO_API}/simple/price?ids=${coinIds}&vs_currencies=usd&include_24hr_change=true`,
1492
+ { headers: { Accept: "application/json" } }
1493
+ );
1494
+ if (!response.ok) {
1495
+ throw new Error(`CoinGecko API error: ${response.status}`);
1496
+ }
1497
+ const data = await response.json();
1498
+ for (const symbol of withIds) {
1499
+ const coinId = COINGECKO_IDS[symbol];
1500
+ const coinData = data[coinId];
1501
+ if (coinData) {
1502
+ const change24h = coinData.usd_24h_change || 0;
1503
+ results[symbol] = {
1504
+ symbol,
1505
+ price: coinData.usd || 0,
1506
+ change24h,
1507
+ changePercent24h: change24h,
1508
+ priceChange24h: change24h
1509
+ };
1510
+ } else {
1511
+ results[symbol] = this.getFallbackPrice(symbol);
1512
+ }
1513
+ }
1514
+ } catch (error) {
1515
+ console.warn("Failed to fetch batch prices:", error);
1516
+ for (const symbol of withIds) {
1517
+ results[symbol] = this.getFallbackPrice(symbol);
1518
+ }
1519
+ }
1520
+ return results;
1521
+ }
1522
+ getFallbackPrice(symbol) {
1523
+ const price = FALLBACK_PRICES[symbol] || 0;
1524
+ return {
1525
+ symbol,
1526
+ price,
1527
+ change24h: 0,
1528
+ changePercent24h: 0,
1529
+ priceChange24h: 0
1530
+ };
1531
+ }
1532
+ clearCache() {
1533
+ this.cache.clear();
1534
+ }
1535
+ };
1536
+ var priceService = new PriceService();
1537
+
1538
+ // src/utils/index.ts
1539
+ function shortenAddress(address, chars = 4) {
1540
+ if (!address) return "";
1541
+ return `${address.slice(0, chars + 2)}...${address.slice(-chars)}`;
1542
+ }
1543
+ function isValidAddress(address) {
1544
+ return /^0x[a-fA-F0-9]{40}$/.test(address);
1545
+ }
1546
+ function checksumAddress(address) {
1547
+ return address.toLowerCase();
1548
+ }
1549
+ function formatNumber(value, options = {}) {
1550
+ const { decimals = 2, compact = false, currency, locale = "en-US" } = options;
1551
+ if (currency) {
1552
+ return new Intl.NumberFormat(locale, {
1553
+ style: "currency",
1554
+ currency,
1555
+ minimumFractionDigits: decimals,
1556
+ maximumFractionDigits: decimals,
1557
+ notation: compact ? "compact" : "standard"
1558
+ }).format(value);
1559
+ }
1560
+ return new Intl.NumberFormat(locale, {
1561
+ minimumFractionDigits: decimals,
1562
+ maximumFractionDigits: decimals,
1563
+ notation: compact ? "compact" : "standard"
1564
+ }).format(value);
1565
+ }
1566
+ function formatUSD(value, compact = false) {
1567
+ return formatNumber(value, { currency: "USD", compact });
1568
+ }
1569
+ function formatPercent(value, decimals = 2) {
1570
+ const sign = value >= 0 ? "+" : "";
1571
+ return `${sign}${value.toFixed(decimals)}%`;
1572
+ }
1573
+ function formatTokenAmount(amount, decimals = 6) {
1574
+ if (amount === 0) return "0";
1575
+ if (amount < 1e-6) return "<0.000001";
1576
+ if (amount < 1) return amount.toFixed(decimals);
1577
+ if (amount < 1e3) return amount.toFixed(4);
1578
+ if (amount < 1e6) return formatNumber(amount, { decimals: 2 });
1579
+ return formatNumber(amount, { decimals: 2, compact: true });
1580
+ }
1581
+ function formatDate(date, options = {
1582
+ year: "numeric",
1583
+ month: "short",
1584
+ day: "numeric"
1585
+ }) {
1586
+ const d = typeof date === "string" ? new Date(date) : date;
1587
+ return d.toLocaleDateString("en-US", options);
1588
+ }
1589
+ function formatDateTime(date) {
1590
+ const d = typeof date === "string" ? new Date(date) : date;
1591
+ return d.toLocaleString("en-US", {
1592
+ year: "numeric",
1593
+ month: "short",
1594
+ day: "numeric",
1595
+ hour: "2-digit",
1596
+ minute: "2-digit"
1597
+ });
1598
+ }
1599
+ function formatRelativeTime(date) {
1600
+ const d = typeof date === "string" ? new Date(date) : date;
1601
+ const now = /* @__PURE__ */ new Date();
1602
+ const diffMs = now.getTime() - d.getTime();
1603
+ const diffSec = Math.floor(diffMs / 1e3);
1604
+ const diffMin = Math.floor(diffSec / 60);
1605
+ const diffHour = Math.floor(diffMin / 60);
1606
+ const diffDay = Math.floor(diffHour / 24);
1607
+ if (diffSec < 60) return "just now";
1608
+ if (diffMin < 60) return `${diffMin}m ago`;
1609
+ if (diffHour < 24) return `${diffHour}h ago`;
1610
+ if (diffDay < 7) return `${diffDay}d ago`;
1611
+ return formatDate(d);
1612
+ }
1613
+ function isValidEmail(email) {
1614
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
1615
+ return emailRegex.test(email);
1616
+ }
1617
+ function isValidPhone(phone) {
1618
+ const phoneRegex = /^\+?[1-9]\d{1,14}$/;
1619
+ return phoneRegex.test(phone.replace(/[\s-()]/g, ""));
1620
+ }
1621
+ function capitalize(str) {
1622
+ return str.charAt(0).toUpperCase() + str.slice(1).toLowerCase();
1623
+ }
1624
+ function truncate(str, length) {
1625
+ if (str.length <= length) return str;
1626
+ return `${str.slice(0, length)}...`;
1627
+ }
1628
+ function slugify(str) {
1629
+ return str.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/(^-|-$)/g, "");
1630
+ }
1631
+ function sleep(ms) {
1632
+ return new Promise((resolve) => setTimeout(resolve, ms));
1633
+ }
1634
+ async function retry(fn, options = {}) {
1635
+ const { maxAttempts = 3, delay = 1e3, backoff = 2 } = options;
1636
+ let lastError;
1637
+ for (let attempt = 1; attempt <= maxAttempts; attempt++) {
1638
+ try {
1639
+ return await fn();
1640
+ } catch (error) {
1641
+ lastError = error instanceof Error ? error : new Error(String(error));
1642
+ if (attempt < maxAttempts) {
1643
+ await sleep(delay * Math.pow(backoff, attempt - 1));
1644
+ }
1645
+ }
1646
+ }
1647
+ throw lastError;
1648
+ }
1649
+ function omit(obj, keys) {
1650
+ const result = { ...obj };
1651
+ for (const key of keys) {
1652
+ delete result[key];
1653
+ }
1654
+ return result;
1655
+ }
1656
+ function pick(obj, keys) {
1657
+ const result = {};
1658
+ for (const key of keys) {
1659
+ if (key in obj) {
1660
+ result[key] = obj[key];
1661
+ }
1662
+ }
1663
+ return result;
1664
+ }
1665
+ var OneSDKError = class extends Error {
1666
+ constructor(message, code, details) {
1667
+ super(message);
1668
+ this.name = "OneSDKError";
1669
+ this.code = code;
1670
+ this.details = details;
1671
+ }
1672
+ };
1673
+ function isOneSDKError(error) {
1674
+ return error instanceof OneSDKError;
1675
+ }
1676
+ var CHAIN_CONFIG = {
1677
+ ethereum: { name: "Ethereum", icon: "\u039E", color: "#627EEA" },
1678
+ arbitrum: { name: "Arbitrum", icon: "\u25C6", color: "#28A0F0" },
1679
+ bsc: { name: "BSC", icon: "\u25C6", color: "#F3BA2F" },
1680
+ base: { name: "Base", icon: "\u25CF", color: "#0052FF" },
1681
+ polygon: { name: "Polygon", icon: "\u2B21", color: "#8247E5" },
1682
+ optimism: { name: "Optimism", icon: "\u25C9", color: "#FF0420" },
1683
+ avalanche: { name: "Avalanche", icon: "\u25B2", color: "#E84142" },
1684
+ linea: { name: "Linea", icon: "\u2550", color: "#121212" },
1685
+ zksync: { name: "zkSync", icon: "\u2B22", color: "#8C8DFC" },
1686
+ scroll: { name: "Scroll", icon: "\u25CE", color: "#FFEEDA" }
1687
+ };
1688
+ var OneChainSelector = ({
1689
+ supportedChains,
1690
+ selectedChains,
1691
+ onSelectChain,
1692
+ multiSelect = true,
1693
+ accentColor = "#188775",
1694
+ title,
1695
+ subtitle,
1696
+ minSelections = 1,
1697
+ style,
1698
+ titleStyle
1699
+ }) => {
1700
+ const handleSelect = (chain) => {
1701
+ if (multiSelect) {
1702
+ if (selectedChains.includes(chain) && selectedChains.length <= minSelections) {
1703
+ return;
1704
+ }
1705
+ onSelectChain(chain);
1706
+ } else {
1707
+ if (!selectedChains.includes(chain)) {
1708
+ onSelectChain(chain);
1709
+ }
1710
+ }
1711
+ };
1712
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles.container, style], children: [
1713
+ title && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles.title, titleStyle], children: title }),
1714
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles.subtitle, children: subtitle }),
1715
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles.chainsContainer, children: supportedChains.map((chain) => {
1716
+ const chainInfo = CHAIN_CONFIG[chain] || { name: chain, icon: "\u25CF", color: "#888" };
1717
+ const isSelected = selectedChains.includes(chain);
1718
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1719
+ reactNative.TouchableOpacity,
1720
+ {
1721
+ style: [
1722
+ styles.chainChip,
1723
+ isSelected && styles.chainChipSelected,
1724
+ isSelected && { borderColor: accentColor, backgroundColor: accentColor + "15" }
1725
+ ],
1726
+ onPress: () => handleSelect(chain),
1727
+ activeOpacity: 0.7,
1728
+ children: [
1729
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles.chainIconBg, { backgroundColor: chainInfo.color + "20" }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles.chainIcon, { color: chainInfo.color }], children: chainInfo.icon }) }),
1730
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
1731
+ styles.chainText,
1732
+ isSelected && { color: accentColor, fontWeight: "600" }
1733
+ ], children: chainInfo.name }),
1734
+ isSelected && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles.checkmark, { color: accentColor }], children: "\u2713" })
1735
+ ]
1736
+ },
1737
+ chain
1738
+ );
1739
+ }) }),
1740
+ multiSelect && selectedChains.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles.selectedInfo, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: styles.selectedText, children: [
1741
+ selectedChains.length,
1742
+ " chain",
1743
+ selectedChains.length > 1 ? "s" : "",
1744
+ " selected"
1745
+ ] }) })
1746
+ ] });
1747
+ };
1748
+ var styles = reactNative.StyleSheet.create({
1749
+ container: {
1750
+ marginBottom: 16
1751
+ },
1752
+ title: {
1753
+ fontSize: 16,
1754
+ fontWeight: "600",
1755
+ color: "#1a1a1a",
1756
+ marginBottom: 4
1757
+ },
1758
+ subtitle: {
1759
+ fontSize: 12,
1760
+ color: "#666",
1761
+ marginBottom: 12
1762
+ },
1763
+ chainsContainer: {
1764
+ flexDirection: "row",
1765
+ flexWrap: "wrap",
1766
+ gap: 8
1767
+ },
1768
+ chainChip: {
1769
+ flexDirection: "row",
1770
+ alignItems: "center",
1771
+ paddingHorizontal: 12,
1772
+ paddingVertical: 8,
1773
+ backgroundColor: "#fff",
1774
+ borderRadius: 12,
1775
+ borderWidth: 2,
1776
+ borderColor: "#e5e5e5",
1777
+ gap: 8
1778
+ },
1779
+ chainChipSelected: {
1780
+ borderWidth: 2
1781
+ },
1782
+ chainIconBg: {
1783
+ width: 28,
1784
+ height: 28,
1785
+ borderRadius: 14,
1786
+ alignItems: "center",
1787
+ justifyContent: "center"
1788
+ },
1789
+ chainIcon: {
1790
+ fontSize: 14,
1791
+ fontWeight: "700"
1792
+ },
1793
+ chainText: {
1794
+ fontSize: 14,
1795
+ color: "#666"
1796
+ },
1797
+ checkmark: {
1798
+ fontSize: 16,
1799
+ fontWeight: "700"
1800
+ },
1801
+ selectedInfo: {
1802
+ marginTop: 8,
1803
+ paddingVertical: 4
1804
+ },
1805
+ selectedText: {
1806
+ fontSize: 12,
1807
+ color: "#888"
1808
+ }
1809
+ });
1810
+ var OneTierSelector = ({
1811
+ tiers,
1812
+ selectedTier,
1813
+ onSelectTier,
1814
+ accentColor = "#188775",
1815
+ title,
1816
+ subtitle,
1817
+ showRecommended = true,
1818
+ recommendedLabel = "Recommended",
1819
+ useZhLabels = false,
1820
+ style,
1821
+ titleStyle
1822
+ }) => {
1823
+ const recommendedTierIndex = Math.floor(tiers.length / 2);
1824
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles2.container, style], children: [
1825
+ title && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles2.title, titleStyle], children: title }),
1826
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles2.subtitle, children: subtitle }),
1827
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles2.tiersContainer, children: tiers.map((tier, index) => {
1828
+ const isSelected = selectedTier?.tier === tier.tier;
1829
+ const isRecommended = showRecommended && index === recommendedTierIndex;
1830
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1831
+ reactNative.TouchableOpacity,
1832
+ {
1833
+ style: [
1834
+ styles2.tierCard,
1835
+ isSelected && styles2.tierCardSelected,
1836
+ isSelected && { borderColor: accentColor }
1837
+ ],
1838
+ onPress: () => onSelectTier(tier),
1839
+ activeOpacity: 0.7,
1840
+ children: [
1841
+ isRecommended && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles2.recommendedBadge, { backgroundColor: accentColor }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles2.recommendedText, children: recommendedLabel }) }),
1842
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
1843
+ styles2.tierLabel,
1844
+ isSelected && { color: accentColor },
1845
+ isRecommended && styles2.tierLabelWithBadge
1846
+ ], children: useZhLabels && tier.label_zh ? tier.label_zh : tier.label }),
1847
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [
1848
+ styles2.tierAmount,
1849
+ isSelected && { color: accentColor }
1850
+ ], children: [
1851
+ "$",
1852
+ tier.amount.toLocaleString()
1853
+ ] }),
1854
+ isSelected && /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: [styles2.checkCircle, { backgroundColor: accentColor }], children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles2.checkmark, children: "\u2713" }) })
1855
+ ]
1856
+ },
1857
+ tier.tier
1858
+ );
1859
+ }) })
1860
+ ] });
1861
+ };
1862
+ var styles2 = reactNative.StyleSheet.create({
1863
+ container: {
1864
+ marginBottom: 16
1865
+ },
1866
+ title: {
1867
+ fontSize: 16,
1868
+ fontWeight: "600",
1869
+ color: "#1a1a1a",
1870
+ marginBottom: 4
1871
+ },
1872
+ subtitle: {
1873
+ fontSize: 12,
1874
+ color: "#666",
1875
+ marginBottom: 12
1876
+ },
1877
+ tiersContainer: {
1878
+ flexDirection: "row",
1879
+ gap: 8
1880
+ },
1881
+ tierCard: {
1882
+ flex: 1,
1883
+ padding: 16,
1884
+ backgroundColor: "#fff",
1885
+ borderRadius: 12,
1886
+ borderWidth: 2,
1887
+ borderColor: "#e5e5e5",
1888
+ alignItems: "center",
1889
+ position: "relative",
1890
+ overflow: "hidden"
1891
+ },
1892
+ tierCardSelected: {
1893
+ backgroundColor: "#fff"
1894
+ },
1895
+ tierLabel: {
1896
+ fontSize: 12,
1897
+ color: "#666",
1898
+ marginBottom: 4
1899
+ },
1900
+ tierLabelWithBadge: {
1901
+ marginTop: 16
1902
+ },
1903
+ tierAmount: {
1904
+ fontSize: 20,
1905
+ fontWeight: "700",
1906
+ color: "#1a1a1a"
1907
+ },
1908
+ checkCircle: {
1909
+ position: "absolute",
1910
+ top: -8,
1911
+ right: -8,
1912
+ width: 28,
1913
+ height: 28,
1914
+ borderRadius: 14,
1915
+ alignItems: "center",
1916
+ justifyContent: "center"
1917
+ },
1918
+ checkmark: {
1919
+ fontSize: 14,
1920
+ fontWeight: "700",
1921
+ color: "#fff"
1922
+ },
1923
+ recommendedBadge: {
1924
+ position: "absolute",
1925
+ top: 0,
1926
+ left: 0,
1927
+ right: 0,
1928
+ paddingVertical: 4,
1929
+ alignItems: "center"
1930
+ },
1931
+ recommendedText: {
1932
+ fontSize: 10,
1933
+ fontWeight: "700",
1934
+ color: "#fff",
1935
+ textTransform: "uppercase"
1936
+ }
1937
+ });
1938
+ var DEFAULT_SHARE_RATES = {
1939
+ 7: 25,
1940
+ 14: 22,
1941
+ 30: 18,
1942
+ 60: 15,
1943
+ 90: 12
1944
+ };
1945
+ var OneCycleSelector = ({
1946
+ supportedCycles,
1947
+ selectedCycle,
1948
+ onSelectCycle,
1949
+ accentColor = "#188775",
1950
+ title,
1951
+ subtitle,
1952
+ shareRates = DEFAULT_SHARE_RATES,
1953
+ daysLabel = "days",
1954
+ yourShareLabel = "Your share",
1955
+ platformFeeLabel = "Platform fee",
1956
+ style,
1957
+ titleStyle
1958
+ }) => {
1959
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles3.container, style], children: [
1960
+ title && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles3.title, titleStyle], children: title }),
1961
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles3.subtitle, children: subtitle }),
1962
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles3.cyclesContainer, children: supportedCycles.map((cycle) => {
1963
+ const isSelected = selectedCycle === cycle;
1964
+ const shareRate = shareRates[cycle] || 20;
1965
+ const userRate = 100 - shareRate;
1966
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1967
+ reactNative.TouchableOpacity,
1968
+ {
1969
+ style: [
1970
+ styles3.cycleOption,
1971
+ isSelected && styles3.cycleOptionSelected,
1972
+ isSelected && { borderColor: accentColor, backgroundColor: accentColor + "10" }
1973
+ ],
1974
+ onPress: () => onSelectCycle(cycle),
1975
+ activeOpacity: 0.7,
1976
+ children: [
1977
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
1978
+ styles3.cycleDays,
1979
+ isSelected && { color: accentColor }
1980
+ ], children: cycle }),
1981
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles3.cycleDaysLabel, children: daysLabel }),
1982
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: styles3.cycleEarnings, children: [
1983
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: [
1984
+ styles3.cycleEarningsValue,
1985
+ isSelected && { color: accentColor }
1986
+ ], children: [
1987
+ userRate,
1988
+ "%"
1989
+ ] }),
1990
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles3.cycleEarningsLabel, children: yourShareLabel })
1991
+ ] }),
1992
+ /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: styles3.cycleFee, children: [
1993
+ shareRate,
1994
+ "% ",
1995
+ platformFeeLabel
1996
+ ] })
1997
+ ]
1998
+ },
1999
+ cycle
2000
+ );
2001
+ }) }),
2002
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles3.infoBox, children: /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles3.infoText, children: "Longer cycles = higher user share" }) })
2003
+ ] });
2004
+ };
2005
+ var styles3 = reactNative.StyleSheet.create({
2006
+ container: {
2007
+ marginBottom: 16
2008
+ },
2009
+ title: {
2010
+ fontSize: 16,
2011
+ fontWeight: "600",
2012
+ color: "#1a1a1a",
2013
+ marginBottom: 4
2014
+ },
2015
+ subtitle: {
2016
+ fontSize: 12,
2017
+ color: "#666",
2018
+ marginBottom: 12
2019
+ },
2020
+ cyclesContainer: {
2021
+ flexDirection: "row",
2022
+ flexWrap: "wrap",
2023
+ gap: 8
2024
+ },
2025
+ cycleOption: {
2026
+ flex: 1,
2027
+ minWidth: "45%",
2028
+ padding: 16,
2029
+ borderRadius: 12,
2030
+ borderWidth: 2,
2031
+ borderColor: "#e5e5e5",
2032
+ backgroundColor: "#fff",
2033
+ alignItems: "center"
2034
+ },
2035
+ cycleOptionSelected: {
2036
+ borderWidth: 2
2037
+ },
2038
+ cycleDays: {
2039
+ fontSize: 28,
2040
+ fontWeight: "700",
2041
+ color: "#1a1a1a"
2042
+ },
2043
+ cycleDaysLabel: {
2044
+ fontSize: 12,
2045
+ color: "#666",
2046
+ marginBottom: 8
2047
+ },
2048
+ cycleEarnings: {
2049
+ alignItems: "center"
2050
+ },
2051
+ cycleEarningsValue: {
2052
+ fontSize: 18,
2053
+ fontWeight: "700",
2054
+ color: "#10B981"
2055
+ },
2056
+ cycleEarningsLabel: {
2057
+ fontSize: 11,
2058
+ color: "#666"
2059
+ },
2060
+ cycleFee: {
2061
+ fontSize: 11,
2062
+ color: "#888",
2063
+ marginTop: 4
2064
+ },
2065
+ infoBox: {
2066
+ marginTop: 12,
2067
+ padding: 8,
2068
+ backgroundColor: "#f5f5f5",
2069
+ borderRadius: 8
2070
+ },
2071
+ infoText: {
2072
+ fontSize: 12,
2073
+ color: "#666",
2074
+ textAlign: "center"
2075
+ }
2076
+ });
2077
+ var PAIR_ICONS = {
2078
+ "BTC/USDT": "\u20BF",
2079
+ "ETH/USDT": "\u039E",
2080
+ "SOL/USDT": "\u25CE",
2081
+ "BNB/USDT": "\u25C6",
2082
+ "XRP/USDT": "\u2715",
2083
+ "DOGE/USDT": "\xD0",
2084
+ "ADA/USDT": "\u25C8",
2085
+ "AVAX/USDT": "\u25B2",
2086
+ "DOT/USDT": "\u25CF",
2087
+ "MATIC/USDT": "\u2B21",
2088
+ "LINK/USDT": "\u25C7",
2089
+ "UNI/USDT": "\u{1F984}",
2090
+ "ATOM/USDT": "\u269B",
2091
+ "LTC/USDT": "\u0141",
2092
+ "ARB/USDT": "\u25C6",
2093
+ "OP/USDT": "\u25C9"
2094
+ };
2095
+ var OnePairSelector = ({
2096
+ supportedPairs,
2097
+ selectedPairs,
2098
+ onTogglePair,
2099
+ accentColor = "#188775",
2100
+ title,
2101
+ subtitle,
2102
+ minSelections = 1,
2103
+ maxSelections = 0,
2104
+ style,
2105
+ titleStyle
2106
+ }) => {
2107
+ const handleToggle = (pair) => {
2108
+ const isSelected = selectedPairs.includes(pair);
2109
+ if (isSelected && selectedPairs.length <= minSelections) {
2110
+ return;
2111
+ }
2112
+ if (!isSelected && maxSelections > 0 && selectedPairs.length >= maxSelections) {
2113
+ return;
2114
+ }
2115
+ onTogglePair(pair);
2116
+ };
2117
+ return /* @__PURE__ */ jsxRuntime.jsxs(reactNative.View, { style: [styles4.container, style], children: [
2118
+ title && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles4.title, titleStyle], children: title }),
2119
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles4.subtitle, children: subtitle }),
2120
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles4.pairsContainer, children: supportedPairs.map((pair) => {
2121
+ const isSelected = selectedPairs.includes(pair);
2122
+ const icon = PAIR_ICONS[pair] || "\u25CF";
2123
+ const baseSymbol = pair.split("/")[0];
2124
+ return /* @__PURE__ */ jsxRuntime.jsxs(
2125
+ reactNative.TouchableOpacity,
2126
+ {
2127
+ style: [
2128
+ styles4.pairChip,
2129
+ isSelected && styles4.pairChipSelected,
2130
+ isSelected && { backgroundColor: accentColor + "15", borderColor: accentColor }
2131
+ ],
2132
+ onPress: () => handleToggle(pair),
2133
+ activeOpacity: 0.7,
2134
+ children: [
2135
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: styles4.pairIcon, children: icon }),
2136
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [
2137
+ styles4.pairText,
2138
+ isSelected && { color: accentColor, fontWeight: "600" }
2139
+ ], children: baseSymbol }),
2140
+ isSelected && /* @__PURE__ */ jsxRuntime.jsx(reactNative.Text, { style: [styles4.checkmark, { color: accentColor }], children: "\u2713" })
2141
+ ]
2142
+ },
2143
+ pair
2144
+ );
2145
+ }) }),
2146
+ /* @__PURE__ */ jsxRuntime.jsx(reactNative.View, { style: styles4.selectedInfo, children: /* @__PURE__ */ jsxRuntime.jsxs(reactNative.Text, { style: styles4.selectedText, children: [
2147
+ selectedPairs.length,
2148
+ " pair",
2149
+ selectedPairs.length !== 1 ? "s" : "",
2150
+ " selected",
2151
+ minSelections > 0 && ` (min: ${minSelections})`,
2152
+ maxSelections > 0 && ` (max: ${maxSelections})`
2153
+ ] }) })
2154
+ ] });
2155
+ };
2156
+ var styles4 = reactNative.StyleSheet.create({
2157
+ container: {
2158
+ marginBottom: 16
2159
+ },
2160
+ title: {
2161
+ fontSize: 16,
2162
+ fontWeight: "600",
2163
+ color: "#1a1a1a",
2164
+ marginBottom: 4
2165
+ },
2166
+ subtitle: {
2167
+ fontSize: 12,
2168
+ color: "#666",
2169
+ marginBottom: 12
2170
+ },
2171
+ pairsContainer: {
2172
+ flexDirection: "row",
2173
+ flexWrap: "wrap",
2174
+ gap: 8
2175
+ },
2176
+ pairChip: {
2177
+ flexDirection: "row",
2178
+ alignItems: "center",
2179
+ paddingHorizontal: 12,
2180
+ paddingVertical: 8,
2181
+ backgroundColor: "#fff",
2182
+ borderRadius: 8,
2183
+ borderWidth: 1,
2184
+ borderColor: "#e5e5e5",
2185
+ gap: 6
2186
+ },
2187
+ pairChipSelected: {
2188
+ borderWidth: 2
2189
+ },
2190
+ pairIcon: {
2191
+ fontSize: 14
2192
+ },
2193
+ pairText: {
2194
+ fontSize: 14,
2195
+ color: "#666"
2196
+ },
2197
+ checkmark: {
2198
+ fontSize: 14,
2199
+ fontWeight: "700"
2200
+ },
2201
+ selectedInfo: {
2202
+ marginTop: 8,
2203
+ paddingVertical: 4
2204
+ },
2205
+ selectedText: {
2206
+ fontSize: 12,
2207
+ color: "#888"
2208
+ }
2209
+ });
2210
+
2211
+ // src/react-native.ts
2212
+ function createCachedEngineClient(storage, options) {
2213
+ const client = createOneEngineClient(options);
2214
+ return {
2215
+ ...client,
2216
+ /**
2217
+ * Initialize with stored token
2218
+ */
2219
+ async initialize() {
2220
+ const token = await storage.getItem("one_access_token");
2221
+ if (token) {
2222
+ client.setAccessToken(token);
2223
+ return true;
2224
+ }
2225
+ return false;
2226
+ },
2227
+ /**
2228
+ * Login and persist token
2229
+ */
2230
+ async login(email, otp) {
2231
+ const result = await client.verifyEmailOtp(email, otp);
2232
+ if (result.success && result.data?.accessToken) {
2233
+ await storage.setItem("one_access_token", result.data.accessToken);
2234
+ if (result.data.refreshToken) {
2235
+ await storage.setItem("one_refresh_token", result.data.refreshToken);
2236
+ }
2237
+ }
2238
+ return result;
2239
+ },
2240
+ /**
2241
+ * Logout and clear stored tokens
2242
+ */
2243
+ async logout() {
2244
+ await client.signOut();
2245
+ await storage.removeItem("one_access_token");
2246
+ await storage.removeItem("one_refresh_token");
2247
+ client.clearAccessToken();
2248
+ },
2249
+ /**
2250
+ * Refresh token from storage
2251
+ */
2252
+ async refreshFromStorage() {
2253
+ const refreshToken = await storage.getItem("one_refresh_token");
2254
+ if (refreshToken) {
2255
+ const result = await client.refreshToken(refreshToken);
2256
+ if (result.success && result.data?.accessToken) {
2257
+ await storage.setItem("one_access_token", result.data.accessToken);
2258
+ if (result.data.refreshToken) {
2259
+ await storage.setItem("one_refresh_token", result.data.refreshToken);
2260
+ }
2261
+ return true;
2262
+ }
2263
+ }
2264
+ return false;
2265
+ },
2266
+ // Expose underlying client
2267
+ getClient: () => client
2268
+ };
2269
+ }
2270
+ function createDeepLinkHandler(scheme = "onewallet") {
2271
+ return {
2272
+ parse(url) {
2273
+ try {
2274
+ const urlObj = new URL(url);
2275
+ const path = urlObj.pathname.replace(/^\//, "");
2276
+ const params = {};
2277
+ urlObj.searchParams.forEach((value, key) => {
2278
+ params[key] = value;
2279
+ });
2280
+ let type = "unknown";
2281
+ if (path.includes("onramp") || path.includes("callback")) {
2282
+ type = "onramp_callback";
2283
+ } else if (path.includes("wc") || path.includes("walletconnect")) {
2284
+ type = "wallet_connect";
2285
+ } else if (path.includes("pay") || path.includes("payment")) {
2286
+ type = "payment";
2287
+ }
2288
+ return { type, params };
2289
+ } catch {
2290
+ return { type: "unknown", params: {} };
2291
+ }
2292
+ },
2293
+ generate(type, params) {
2294
+ const searchParams = new URLSearchParams(params);
2295
+ return `${scheme}://${type}?${searchParams.toString()}`;
2296
+ }
2297
+ };
2298
+ }
2299
+ function parseQRCode(data) {
2300
+ if (/^0x[a-fA-F0-9]{40}$/.test(data)) {
2301
+ return {
2302
+ type: "address",
2303
+ data,
2304
+ parsed: { address: data }
2305
+ };
2306
+ }
2307
+ if (data.startsWith("ethereum:")) {
2308
+ const match = data.match(/^ethereum:(0x[a-fA-F0-9]{40})(?:@(\d+))?(?:\?(.*))?$/);
2309
+ if (match) {
2310
+ const [, address, chainId, queryString] = match;
2311
+ const params = new URLSearchParams(queryString || "");
2312
+ return {
2313
+ type: "payment_request",
2314
+ data,
2315
+ parsed: {
2316
+ address,
2317
+ chainId: chainId ? parseInt(chainId) : void 0,
2318
+ amount: params.get("value") || void 0,
2319
+ token: params.get("token") || void 0,
2320
+ message: params.get("message") || void 0
2321
+ }
2322
+ };
2323
+ }
2324
+ }
2325
+ if (data.startsWith("wc:")) {
2326
+ return {
2327
+ type: "wallet_connect",
2328
+ data
2329
+ };
2330
+ }
2331
+ return { type: "unknown", data };
2332
+ }
2333
+ function formatCryptoAmount(amount, symbol, options = {}) {
2334
+ const { maxDecimals = 6, showSymbol = true, compact = false } = options;
2335
+ const num = typeof amount === "string" ? parseFloat(amount) : amount;
2336
+ if (isNaN(num)) return showSymbol ? `0 ${symbol}` : "0";
2337
+ let formatted;
2338
+ if (compact && num >= 1e6) {
2339
+ formatted = (num / 1e6).toFixed(2) + "M";
2340
+ } else if (compact && num >= 1e3) {
2341
+ formatted = (num / 1e3).toFixed(2) + "K";
2342
+ } else if (num < 1e-6 && num > 0) {
2343
+ formatted = "<0.000001";
2344
+ } else {
2345
+ const decimals = num < 1 ? maxDecimals : Math.min(maxDecimals, 4);
2346
+ formatted = num.toFixed(decimals).replace(/\.?0+$/, "");
2347
+ }
2348
+ return showSymbol ? `${formatted} ${symbol}` : formatted;
2349
+ }
2350
+ function generateShareContent(params) {
2351
+ const { type, address, amount, token, txHash, chainId } = params;
2352
+ switch (type) {
2353
+ case "receive":
2354
+ return {
2355
+ title: "My Wallet Address",
2356
+ message: `Send ${token || "crypto"} to my wallet:
2357
+ ${address}`,
2358
+ url: address ? `ethereum:${address}${chainId ? `@${chainId}` : ""}` : void 0
2359
+ };
2360
+ case "payment_request":
2361
+ return {
2362
+ title: "Payment Request",
2363
+ message: `Please send ${amount} ${token} to:
2364
+ ${address}`,
2365
+ url: `ethereum:${address}${chainId ? `@${chainId}` : ""}?value=${amount}${token ? `&token=${token}` : ""}`
2366
+ };
2367
+ case "transaction":
2368
+ return {
2369
+ title: "Transaction Sent",
2370
+ message: `Transaction confirmed!
2371
+ Hash: ${txHash}`,
2372
+ url: txHash ? getExplorerUrl(chainId || 1, txHash, "tx") : void 0
2373
+ };
2374
+ default:
2375
+ return { title: "", message: "" };
2376
+ }
2377
+ }
2378
+ function getExplorerUrl(chainId, hash, type = "tx") {
2379
+ const explorers = {
2380
+ 1: "https://etherscan.io",
2381
+ 137: "https://polygonscan.com",
2382
+ 42161: "https://arbiscan.io",
2383
+ 10: "https://optimistic.etherscan.io",
2384
+ 8453: "https://basescan.org",
2385
+ 56: "https://bscscan.com",
2386
+ 43114: "https://snowtrace.io"
2387
+ };
2388
+ const baseUrl = explorers[chainId] || explorers[1];
2389
+ return `${baseUrl}/${type}/${hash}`;
2390
+ }
2391
+
2392
+ exports.CHAIN_CONFIG = CHAIN_CONFIG;
2393
+ exports.CHAIN_CONFIGS = CHAIN_CONFIGS;
2394
+ exports.COINGECKO_IDS = COINGECKO_IDS;
2395
+ exports.DEFAULT_SHARE_RATES = DEFAULT_SHARE_RATES;
2396
+ exports.OneChainSelector = OneChainSelector;
2397
+ exports.OneCycleSelector = OneCycleSelector;
2398
+ exports.OneEngineClient = OneEngineClient;
2399
+ exports.OnePairSelector = OnePairSelector;
2400
+ exports.OneSDKError = OneSDKError;
2401
+ exports.OneTierSelector = OneTierSelector;
2402
+ exports.PAIR_ICONS = PAIR_ICONS;
2403
+ exports.PriceService = PriceService;
2404
+ exports.TOKEN_NAMES = TOKEN_NAMES;
2405
+ exports.capitalize = capitalize;
2406
+ exports.checksumAddress = checksumAddress;
2407
+ exports.createCachedEngineClient = createCachedEngineClient;
2408
+ exports.createDeepLinkHandler = createDeepLinkHandler;
2409
+ exports.createOneEngineClient = createOneEngineClient;
2410
+ exports.formatCryptoAmount = formatCryptoAmount;
2411
+ exports.formatDate = formatDate;
2412
+ exports.formatDateTime = formatDateTime;
2413
+ exports.formatNumber = formatNumber;
2414
+ exports.formatPercent = formatPercent;
2415
+ exports.formatRelativeTime = formatRelativeTime;
2416
+ exports.formatTokenAmount = formatTokenAmount;
2417
+ exports.formatUSD = formatUSD;
2418
+ exports.generateShareContent = generateShareContent;
2419
+ exports.getConfig = getConfig;
2420
+ exports.getExplorerUrl = getExplorerUrl;
2421
+ exports.initOneSDK = initOneSDK;
2422
+ exports.isOneSDKError = isOneSDKError;
2423
+ exports.isValidAddress = isValidAddress;
2424
+ exports.isValidEmail = isValidEmail;
2425
+ exports.isValidPhone = isValidPhone;
2426
+ exports.omit = omit;
2427
+ exports.parseQRCode = parseQRCode;
2428
+ exports.pick = pick;
2429
+ exports.priceService = priceService;
2430
+ exports.retry = retry;
2431
+ exports.shortenAddress = shortenAddress;
2432
+ exports.sleep = sleep;
2433
+ exports.slugify = slugify;
2434
+ exports.truncate = truncate;
2435
+ //# sourceMappingURL=react-native.js.map
2436
+ //# sourceMappingURL=react-native.js.map