@one_deploy/sdk 1.0.0

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 (83) hide show
  1. package/.turbo/turbo-build.log +0 -0
  2. package/.turbo/turbo-type-check.log +0 -0
  3. package/dist/config/index.d.mts +74 -0
  4. package/dist/config/index.d.ts +74 -0
  5. package/dist/config/index.js +242 -0
  6. package/dist/config/index.js.map +1 -0
  7. package/dist/config/index.mjs +224 -0
  8. package/dist/config/index.mjs.map +1 -0
  9. package/dist/engine-5ndtBaCr.d.ts +1039 -0
  10. package/dist/engine-CrlhH0nw.d.mts +1039 -0
  11. package/dist/hooks/index.d.mts +56 -0
  12. package/dist/hooks/index.d.ts +56 -0
  13. package/dist/hooks/index.js +1360 -0
  14. package/dist/hooks/index.js.map +1 -0
  15. package/dist/hooks/index.mjs +1356 -0
  16. package/dist/hooks/index.mjs.map +1 -0
  17. package/dist/index.d.mts +356 -0
  18. package/dist/index.d.ts +356 -0
  19. package/dist/index.js +5068 -0
  20. package/dist/index.js.map +1 -0
  21. package/dist/index.mjs +4949 -0
  22. package/dist/index.mjs.map +1 -0
  23. package/dist/price-CgqXPnT3.d.ts +13 -0
  24. package/dist/price-ClbLHHjv.d.mts +13 -0
  25. package/dist/providers/index.d.mts +121 -0
  26. package/dist/providers/index.d.ts +121 -0
  27. package/dist/providers/index.js +1642 -0
  28. package/dist/providers/index.js.map +1 -0
  29. package/dist/providers/index.mjs +1600 -0
  30. package/dist/providers/index.mjs.map +1 -0
  31. package/dist/react-native.d.mts +120 -0
  32. package/dist/react-native.d.ts +120 -0
  33. package/dist/react-native.js +1792 -0
  34. package/dist/react-native.js.map +1 -0
  35. package/dist/react-native.mjs +1755 -0
  36. package/dist/react-native.mjs.map +1 -0
  37. package/dist/services/index.d.mts +85 -0
  38. package/dist/services/index.d.ts +85 -0
  39. package/dist/services/index.js +1466 -0
  40. package/dist/services/index.js.map +1 -0
  41. package/dist/services/index.mjs +1458 -0
  42. package/dist/services/index.mjs.map +1 -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 +101 -0
  56. package/src/components/OneConnectButton.tsx +143 -0
  57. package/src/components/OneNFTGallery.tsx +324 -0
  58. package/src/components/OneOfframpWidget.tsx +660 -0
  59. package/src/components/OneOnrampWidget.tsx +596 -0
  60. package/src/components/OnePayWidget.tsx +160 -0
  61. package/src/components/OneReceiveWidget.tsx +272 -0
  62. package/src/components/OneSendWidget.tsx +248 -0
  63. package/src/components/OneSwapWidget.tsx +715 -0
  64. package/src/components/OneTransactionButton.tsx +150 -0
  65. package/src/components/OneWalletBalance.tsx +354 -0
  66. package/src/components/index.ts +24 -0
  67. package/src/config/index.ts +299 -0
  68. package/src/hooks/index.ts +2 -0
  69. package/src/hooks/useTokenPrice.ts +162 -0
  70. package/src/hooks/useWalletBalance.ts +98 -0
  71. package/src/index.ts +193 -0
  72. package/src/providers/OneProvider.tsx +452 -0
  73. package/src/providers/ThirdwebProvider.tsx +203 -0
  74. package/src/providers/index.ts +26 -0
  75. package/src/react-native.ts +378 -0
  76. package/src/services/engine.ts +1854 -0
  77. package/src/services/index.ts +30 -0
  78. package/src/services/price.ts +164 -0
  79. package/src/services/supabase.ts +180 -0
  80. package/src/types/index.ts +887 -0
  81. package/src/utils/index.ts +200 -0
  82. package/tsconfig.json +22 -0
  83. package/tsup.config.ts +25 -0
@@ -0,0 +1,1039 @@
1
+ import { ApiResponse, User, Token, Transaction, AIStrategy, AIOrder, NFT, NFTCollection, Contract, ContractReadParams, ContractWriteParams, ContractDeployParams, OfframpQuote, OfframpRequest, OfframpTransaction, BillProvider, BillPayment, StakingPool, StakingPosition, UserProfile, UserSettings, Notification, ReferralInfo, Referral, BridgeQuote, BridgeTransaction, GasEstimate, GasPrice, WalletImportRequest, PortfolioAnalytics, TradingCondition, LimitOrder, Webhook, CreateWebhookInput, UpdateWebhookInput, WebhookDelivery, AdminListOptions, PaginatedResult, AdminUser, AdminProject, SystemStats, SystemLog, RateLimitInfo, StrategyCategory, AINavSnapshot, AIMarketData, AITradeExecution, CreateAIOrderRequest, AIOrderStatus, AIRedemptionResult, AIPortfolioSummary, AITradeAllocation } from './types/index.mjs';
2
+
3
+ /**
4
+ * ONE Engine Client - The unified API gateway for all ONE Ecosystem services
5
+ *
6
+ * All wallet operations, onramp, swap, trading go through ONE Engine.
7
+ * Thirdweb/Onramper/etc are internal to ONE Engine and hidden from clients.
8
+ */
9
+
10
+ interface EngineAuthResponse {
11
+ user: User;
12
+ accessToken: string;
13
+ refreshToken?: string;
14
+ expiresIn: number;
15
+ }
16
+ interface EngineWalletBalance {
17
+ address: string;
18
+ totalUsd: number;
19
+ change24h: number;
20
+ changePercent24h: number;
21
+ tokens: Token[];
22
+ }
23
+ interface EngineTransactionRequest {
24
+ to: string;
25
+ amount: string;
26
+ tokenSymbol: string;
27
+ chainId: number;
28
+ memo?: string;
29
+ }
30
+ interface EngineTransactionResponse {
31
+ txId: string;
32
+ status: 'queued' | 'pending' | 'confirmed' | 'failed';
33
+ txHash?: string;
34
+ explorerUrl?: string;
35
+ }
36
+ interface OnrampSessionRequest {
37
+ walletAddress: string;
38
+ fiatCurrency?: string;
39
+ fiatAmount?: number;
40
+ cryptoCurrency?: string;
41
+ cryptoNetwork?: string;
42
+ paymentMethod?: string;
43
+ redirectUrl?: string;
44
+ }
45
+ interface OnrampSession {
46
+ sessionId: string;
47
+ widgetUrl: string;
48
+ expiresAt: string;
49
+ }
50
+ interface OnrampQuote {
51
+ provider: string;
52
+ fiatCurrency: string;
53
+ fiatAmount: number;
54
+ cryptoCurrency: string;
55
+ cryptoAmount: number;
56
+ rate: number;
57
+ fees: {
58
+ network: number;
59
+ provider: number;
60
+ total: number;
61
+ };
62
+ paymentMethod: string;
63
+ estimatedTime: string;
64
+ }
65
+ interface OnrampTransaction {
66
+ id: string;
67
+ sessionId: string;
68
+ status: 'pending' | 'processing' | 'completed' | 'failed' | 'expired';
69
+ fiatAmount: number;
70
+ fiatCurrency: string;
71
+ cryptoAmount?: number;
72
+ cryptoCurrency: string;
73
+ walletAddress: string;
74
+ txHash?: string;
75
+ createdAt: string;
76
+ completedAt?: string;
77
+ }
78
+ interface SwapQuoteRequest {
79
+ fromToken: string;
80
+ fromAmount: string;
81
+ fromChainId: number;
82
+ toToken: string;
83
+ toChainId: number;
84
+ walletAddress: string;
85
+ slippage?: number;
86
+ }
87
+ interface SwapQuote {
88
+ quoteId: string;
89
+ fromToken: string;
90
+ fromAmount: string;
91
+ fromChainId: number;
92
+ toToken: string;
93
+ toAmount: string;
94
+ toChainId: number;
95
+ rate: number;
96
+ priceImpact: number;
97
+ estimatedGas: string;
98
+ estimatedTime: string;
99
+ fees: {
100
+ gas: number;
101
+ protocol: number;
102
+ total: number;
103
+ };
104
+ expiresAt: string;
105
+ }
106
+ interface SwapExecuteRequest {
107
+ quoteId: string;
108
+ walletAddress: string;
109
+ signature?: string;
110
+ }
111
+ interface SwapResult {
112
+ swapId: string;
113
+ status: 'pending' | 'confirming' | 'completed' | 'failed';
114
+ txHash?: string;
115
+ fromAmount: string;
116
+ toAmount?: string;
117
+ }
118
+ declare class OneEngineClient {
119
+ private baseUrl;
120
+ private clientId;
121
+ private secretKey?;
122
+ private accessToken?;
123
+ constructor(options?: {
124
+ baseUrl?: string;
125
+ clientId?: string;
126
+ secretKey?: string;
127
+ });
128
+ /**
129
+ * Set access token for authenticated requests
130
+ */
131
+ setAccessToken(token: string): void;
132
+ /**
133
+ * Clear access token
134
+ */
135
+ clearAccessToken(): void;
136
+ private getHeaders;
137
+ private request;
138
+ /**
139
+ * Send OTP to email for authentication
140
+ */
141
+ sendEmailOtp(email: string): Promise<ApiResponse<{
142
+ message: string;
143
+ }>>;
144
+ /**
145
+ * Verify OTP and get access token
146
+ */
147
+ verifyEmailOtp(email: string, otp: string): Promise<ApiResponse<EngineAuthResponse>>;
148
+ /**
149
+ * Authenticate with wallet signature
150
+ */
151
+ authWithWallet(walletAddress: string, signature: string, message: string): Promise<ApiResponse<EngineAuthResponse>>;
152
+ /**
153
+ * Refresh access token
154
+ */
155
+ refreshToken(refreshToken: string): Promise<ApiResponse<EngineAuthResponse>>;
156
+ /**
157
+ * Get current user
158
+ */
159
+ getCurrentUser(): Promise<ApiResponse<User>>;
160
+ /**
161
+ * Sign out
162
+ */
163
+ signOut(): Promise<ApiResponse<{
164
+ success: boolean;
165
+ }>>;
166
+ /**
167
+ * Get wallet balance across all chains
168
+ */
169
+ getWalletBalance(walletAddress: string, chains?: number[]): Promise<ApiResponse<EngineWalletBalance>>;
170
+ /**
171
+ * Get portfolio summary
172
+ */
173
+ getPortfolioSummary(walletAddress: string): Promise<ApiResponse<{
174
+ totalValue: number;
175
+ change24h: number;
176
+ tokens: Token[];
177
+ }>>;
178
+ /**
179
+ * Get user's wallets
180
+ */
181
+ getUserWallets(chainId?: number): Promise<ApiResponse<{
182
+ wallets: any[];
183
+ total: number;
184
+ }>>;
185
+ /**
186
+ * Create a new wallet
187
+ */
188
+ createWallet(chainId?: number, type?: 'smart' | 'eoa' | 'multisig'): Promise<ApiResponse<{
189
+ wallet: any;
190
+ smartAccountAddress: string;
191
+ personalAddress: string;
192
+ }>>;
193
+ /**
194
+ * Get wallet transactions (placeholder - needs endpoint)
195
+ */
196
+ getWalletTransactions(walletAddress: string, options?: {
197
+ limit?: number;
198
+ offset?: number;
199
+ chainId?: number;
200
+ }): Promise<ApiResponse<{
201
+ transactions: Transaction[];
202
+ total: number;
203
+ }>>;
204
+ /**
205
+ * Send native token or ERC20
206
+ */
207
+ sendTransaction(request: EngineTransactionRequest): Promise<ApiResponse<EngineTransactionResponse>>;
208
+ /**
209
+ * Get transaction status
210
+ */
211
+ getTransactionStatus(txId: string): Promise<ApiResponse<EngineTransactionResponse>>;
212
+ /**
213
+ * Get onramp quote
214
+ */
215
+ getOnrampQuote(fiatCurrency: string, fiatAmount: number, cryptoCurrency: string, paymentMethod?: string): Promise<ApiResponse<OnrampQuote[]>>;
216
+ /**
217
+ * Create onramp session (returns widget URL)
218
+ */
219
+ createOnrampSession(request: OnrampSessionRequest): Promise<ApiResponse<OnrampSession>>;
220
+ /**
221
+ * Get onramp session status
222
+ */
223
+ getOnrampStatus(sessionId: string): Promise<ApiResponse<OnrampTransaction>>;
224
+ /**
225
+ * Get supported currencies (fiat + crypto)
226
+ */
227
+ getSupportedCurrencies(): Promise<ApiResponse<{
228
+ fiatCurrencies: string[];
229
+ cryptoCurrencies: string[];
230
+ }>>;
231
+ /**
232
+ * Get supported fiat currencies
233
+ */
234
+ getSupportedFiatCurrencies(): Promise<ApiResponse<string[]>>;
235
+ /**
236
+ * Get supported payment methods
237
+ */
238
+ getSupportedPaymentMethods(country?: string): Promise<ApiResponse<string[]>>;
239
+ /**
240
+ * Get swap quote
241
+ */
242
+ getSwapQuote(request: SwapQuoteRequest): Promise<ApiResponse<SwapQuote>>;
243
+ /**
244
+ * Execute swap
245
+ */
246
+ executeSwap(request: SwapExecuteRequest): Promise<ApiResponse<SwapResult>>;
247
+ /**
248
+ * Get swap status
249
+ */
250
+ getSwapStatus(swapId: string): Promise<ApiResponse<SwapResult>>;
251
+ /**
252
+ * Get supported tokens for swap
253
+ */
254
+ getSupportedSwapTokens(chainId?: number): Promise<ApiResponse<{
255
+ tokens: Token[];
256
+ }>>;
257
+ /**
258
+ * Get supported chains for swap
259
+ */
260
+ getSupportedSwapChains(): Promise<ApiResponse<{
261
+ chains: {
262
+ id: number;
263
+ name: string;
264
+ }[];
265
+ }>>;
266
+ /**
267
+ * Get available AI trading strategies
268
+ */
269
+ getStrategies(): Promise<ApiResponse<AIStrategy[]>>;
270
+ /**
271
+ * Get strategy details
272
+ */
273
+ getStrategy(strategyId: string): Promise<ApiResponse<AIStrategy>>;
274
+ /**
275
+ * Get user's positions
276
+ */
277
+ getPositions(): Promise<ApiResponse<any[]>>;
278
+ /**
279
+ * Create investment order
280
+ */
281
+ createOrder(strategyId: string, amount: number, currency: string): Promise<ApiResponse<AIOrder>>;
282
+ /**
283
+ * Get user's orders
284
+ */
285
+ getUserOrders(): Promise<ApiResponse<AIOrder[]>>;
286
+ /**
287
+ * Get user's portfolio stats from positions
288
+ */
289
+ getPortfolioStats(): Promise<ApiResponse<{
290
+ totalInvested: number;
291
+ totalValue: number;
292
+ totalPnl: number;
293
+ totalPnlPercent: number;
294
+ activePositions: number;
295
+ }>>;
296
+ /**
297
+ * Get token prices
298
+ */
299
+ getTokenPrices(symbols: string[]): Promise<ApiResponse<Record<string, {
300
+ price: number;
301
+ change24h: number;
302
+ marketCap?: number;
303
+ }>>>;
304
+ /**
305
+ * Get market data overview
306
+ */
307
+ getMarketData(): Promise<ApiResponse<{
308
+ totalMarketCap: number;
309
+ totalVolume24h: number;
310
+ btcDominance: number;
311
+ markets: any[];
312
+ }>>;
313
+ /**
314
+ * Get user's NFTs
315
+ */
316
+ getUserNFTs(walletAddress: string, options?: {
317
+ chainId?: number;
318
+ limit?: number;
319
+ offset?: number;
320
+ }): Promise<ApiResponse<{
321
+ nfts: NFT[];
322
+ total: number;
323
+ }>>;
324
+ /**
325
+ * Get NFT details
326
+ */
327
+ getNFTDetails(contractAddress: string, tokenId: string, chainId: number): Promise<ApiResponse<NFT>>;
328
+ /**
329
+ * Get NFT collection
330
+ */
331
+ getNFTCollection(contractAddress: string, chainId: number): Promise<ApiResponse<NFTCollection>>;
332
+ /**
333
+ * Transfer NFT
334
+ */
335
+ transferNFT(params: {
336
+ contractAddress: string;
337
+ tokenId: string;
338
+ chainId: number;
339
+ to: string;
340
+ tokenType?: 'ERC721' | 'ERC1155';
341
+ amount?: number;
342
+ }): Promise<ApiResponse<{
343
+ txHash: string;
344
+ status: string;
345
+ }>>;
346
+ /**
347
+ * Get user's contracts
348
+ */
349
+ getUserContracts(options?: {
350
+ chainId?: number;
351
+ limit?: number;
352
+ offset?: number;
353
+ }): Promise<ApiResponse<{
354
+ contracts: Contract[];
355
+ total: number;
356
+ }>>;
357
+ /**
358
+ * Get contract details
359
+ */
360
+ getContractDetails(address: string, chainId: number): Promise<ApiResponse<Contract>>;
361
+ /**
362
+ * Read contract (call view function)
363
+ */
364
+ readContract(params: ContractReadParams): Promise<ApiResponse<any>>;
365
+ /**
366
+ * Write to contract (execute transaction)
367
+ */
368
+ writeContract(params: ContractWriteParams): Promise<ApiResponse<{
369
+ txHash: string;
370
+ status: string;
371
+ }>>;
372
+ /**
373
+ * Deploy contract
374
+ */
375
+ deployContract(params: ContractDeployParams): Promise<ApiResponse<{
376
+ address: string;
377
+ txHash: string;
378
+ contract: Contract;
379
+ }>>;
380
+ /**
381
+ * Get offramp quote
382
+ */
383
+ getOfframpQuote(cryptoCurrency: string, cryptoAmount: number, fiatCurrency: string, payoutMethod?: string): Promise<ApiResponse<OfframpQuote[]>>;
384
+ /**
385
+ * Create offramp transaction
386
+ */
387
+ createOfframpTransaction(request: OfframpRequest): Promise<ApiResponse<OfframpTransaction>>;
388
+ /**
389
+ * Get offramp transaction status
390
+ */
391
+ getOfframpStatus(transactionId: string): Promise<ApiResponse<OfframpTransaction>>;
392
+ /**
393
+ * Get supported payout methods
394
+ */
395
+ getSupportedPayoutMethods(country?: string): Promise<ApiResponse<string[]>>;
396
+ /**
397
+ * Get bill providers
398
+ */
399
+ getBillProviders(country?: string, category?: string): Promise<ApiResponse<BillProvider[]>>;
400
+ /**
401
+ * Get bill details/validate account
402
+ */
403
+ validateBillAccount(providerId: string, accountNumber: string): Promise<ApiResponse<{
404
+ valid: boolean;
405
+ accountName?: string;
406
+ minAmount?: number;
407
+ maxAmount?: number;
408
+ dueAmount?: number;
409
+ }>>;
410
+ /**
411
+ * Pay bill
412
+ */
413
+ payBill(params: {
414
+ providerId: string;
415
+ accountNumber: string;
416
+ amount: number;
417
+ currency: string;
418
+ }): Promise<ApiResponse<BillPayment>>;
419
+ /**
420
+ * Get bill payment history
421
+ */
422
+ getBillHistory(options?: {
423
+ limit?: number;
424
+ offset?: number;
425
+ }): Promise<ApiResponse<{
426
+ payments: BillPayment[];
427
+ total: number;
428
+ }>>;
429
+ /**
430
+ * Get staking pools
431
+ */
432
+ getStakingPools(chainId?: number): Promise<ApiResponse<StakingPool[]>>;
433
+ /**
434
+ * Get user's staking positions
435
+ */
436
+ getStakingPositions(): Promise<ApiResponse<StakingPosition[]>>;
437
+ /**
438
+ * Stake tokens
439
+ */
440
+ stake(params: {
441
+ poolId: string;
442
+ amount: number;
443
+ }): Promise<ApiResponse<{
444
+ positionId: string;
445
+ txHash: string;
446
+ }>>;
447
+ /**
448
+ * Unstake tokens
449
+ */
450
+ unstake(params: {
451
+ positionId: string;
452
+ amount?: number;
453
+ }): Promise<ApiResponse<{
454
+ txHash: string;
455
+ }>>;
456
+ /**
457
+ * Claim staking rewards
458
+ */
459
+ claimStakingRewards(positionId: string): Promise<ApiResponse<{
460
+ txHash: string;
461
+ amount: number;
462
+ }>>;
463
+ /**
464
+ * Get user profile
465
+ */
466
+ getUserProfile(): Promise<ApiResponse<UserProfile>>;
467
+ /**
468
+ * Update user profile
469
+ */
470
+ updateUserProfile(updates: Partial<UserProfile>): Promise<ApiResponse<UserProfile>>;
471
+ /**
472
+ * Get user settings
473
+ */
474
+ getUserSettings(): Promise<ApiResponse<UserSettings>>;
475
+ /**
476
+ * Update user settings
477
+ */
478
+ updateUserSettings(updates: Partial<UserSettings>): Promise<ApiResponse<UserSettings>>;
479
+ /**
480
+ * Get notifications
481
+ */
482
+ getNotifications(options?: {
483
+ unreadOnly?: boolean;
484
+ limit?: number;
485
+ offset?: number;
486
+ }): Promise<ApiResponse<{
487
+ notifications: Notification[];
488
+ unreadCount: number;
489
+ }>>;
490
+ /**
491
+ * Mark notification as read
492
+ */
493
+ markNotificationRead(notificationId: string): Promise<ApiResponse<void>>;
494
+ /**
495
+ * Mark all notifications as read
496
+ */
497
+ markAllNotificationsRead(): Promise<ApiResponse<void>>;
498
+ /**
499
+ * Get referral info
500
+ */
501
+ getReferralInfo(): Promise<ApiResponse<ReferralInfo>>;
502
+ /**
503
+ * Get referred users
504
+ */
505
+ getReferrals(): Promise<ApiResponse<Referral[]>>;
506
+ /**
507
+ * Apply referral code
508
+ */
509
+ applyReferralCode(code: string): Promise<ApiResponse<{
510
+ success: boolean;
511
+ message: string;
512
+ }>>;
513
+ /**
514
+ * Claim referral rewards
515
+ */
516
+ claimReferralRewards(): Promise<ApiResponse<{
517
+ amount: number;
518
+ txHash?: string;
519
+ }>>;
520
+ /**
521
+ * Get KYC status
522
+ */
523
+ getKycStatus(): Promise<ApiResponse<{
524
+ status: 'none' | 'pending' | 'verified' | 'rejected';
525
+ level: number;
526
+ limits: {
527
+ daily: number;
528
+ monthly: number;
529
+ };
530
+ rejectionReason?: string;
531
+ }>>;
532
+ /**
533
+ * Start KYC verification
534
+ */
535
+ startKycVerification(level: number): Promise<ApiResponse<{
536
+ verificationUrl: string;
537
+ sessionId: string;
538
+ }>>;
539
+ /**
540
+ * Submit KYC documents
541
+ */
542
+ submitKycDocuments(params: {
543
+ documentType: 'passport' | 'id_card' | 'drivers_license';
544
+ frontImage: string;
545
+ backImage?: string;
546
+ selfieImage: string;
547
+ }): Promise<ApiResponse<{
548
+ status: string;
549
+ message: string;
550
+ }>>;
551
+ /**
552
+ * Get bridge quote
553
+ */
554
+ getBridgeQuote(params: {
555
+ fromChainId: number;
556
+ toChainId: number;
557
+ fromToken: string;
558
+ toToken: string;
559
+ amount: string;
560
+ walletAddress: string;
561
+ }): Promise<ApiResponse<BridgeQuote>>;
562
+ /**
563
+ * Execute bridge transaction
564
+ */
565
+ executeBridge(params: {
566
+ quoteId: string;
567
+ walletAddress: string;
568
+ }): Promise<ApiResponse<BridgeTransaction>>;
569
+ /**
570
+ * Get bridge transaction status
571
+ */
572
+ getBridgeStatus(bridgeId: string): Promise<ApiResponse<BridgeTransaction>>;
573
+ /**
574
+ * Get supported bridge routes
575
+ */
576
+ getSupportedBridgeRoutes(): Promise<ApiResponse<{
577
+ routes: {
578
+ fromChainId: number;
579
+ toChainId: number;
580
+ tokens: string[];
581
+ }[];
582
+ }>>;
583
+ /**
584
+ * Get gas estimate for transaction
585
+ */
586
+ getGasEstimate(params: {
587
+ chainId: number;
588
+ to: string;
589
+ data?: string;
590
+ value?: string;
591
+ }): Promise<ApiResponse<GasEstimate>>;
592
+ /**
593
+ * Get current gas prices for chain
594
+ */
595
+ getGasPrice(chainId: number): Promise<ApiResponse<GasPrice>>;
596
+ /**
597
+ * Import wallet from private key or mnemonic
598
+ */
599
+ importWallet(request: WalletImportRequest): Promise<ApiResponse<{
600
+ wallet: any;
601
+ address: string;
602
+ smartAccountAddress?: string;
603
+ }>>;
604
+ /**
605
+ * Export wallet (get encrypted private key)
606
+ * Requires additional authentication
607
+ */
608
+ exportWallet(walletId: string, pin: string): Promise<ApiResponse<{
609
+ encryptedPrivateKey: string;
610
+ address: string;
611
+ }>>;
612
+ /**
613
+ * Generate new mnemonic phrase
614
+ */
615
+ generateMnemonic(): Promise<ApiResponse<{
616
+ mnemonic: string;
617
+ address: string;
618
+ }>>;
619
+ /**
620
+ * Validate mnemonic phrase
621
+ */
622
+ validateMnemonic(mnemonic: string): Promise<ApiResponse<{
623
+ valid: boolean;
624
+ address?: string;
625
+ }>>;
626
+ /**
627
+ * Get portfolio analytics with historical data
628
+ */
629
+ getPortfolioAnalytics(walletAddress: string, period?: '24h' | '7d' | '30d' | '90d' | '1y' | 'all'): Promise<ApiResponse<PortfolioAnalytics>>;
630
+ /**
631
+ * Get transaction analytics
632
+ */
633
+ getTransactionAnalytics(walletAddress: string, period?: '24h' | '7d' | '30d' | '90d'): Promise<ApiResponse<{
634
+ totalTransactions: number;
635
+ totalVolume: number;
636
+ avgTransactionValue: number;
637
+ byType: Record<string, number>;
638
+ byChain: Record<string, number>;
639
+ }>>;
640
+ /**
641
+ * Create limit order
642
+ */
643
+ createLimitOrder(params: {
644
+ tokenSymbol: string;
645
+ type: 'buy' | 'sell';
646
+ amount: number;
647
+ limitPrice: number;
648
+ chainId: number;
649
+ expiresIn?: number;
650
+ conditions?: TradingCondition[];
651
+ }): Promise<ApiResponse<LimitOrder>>;
652
+ /**
653
+ * Get user's limit orders
654
+ */
655
+ getLimitOrders(status?: 'pending' | 'filled' | 'cancelled'): Promise<ApiResponse<LimitOrder[]>>;
656
+ /**
657
+ * Cancel limit order
658
+ */
659
+ cancelLimitOrder(orderId: string): Promise<ApiResponse<{
660
+ success: boolean;
661
+ }>>;
662
+ /**
663
+ * Set price alert
664
+ */
665
+ setPriceAlert(params: {
666
+ tokenSymbol: string;
667
+ targetPrice: number;
668
+ condition: 'above' | 'below';
669
+ notification: 'push' | 'email' | 'both';
670
+ }): Promise<ApiResponse<{
671
+ alertId: string;
672
+ }>>;
673
+ /**
674
+ * Get price alerts
675
+ */
676
+ getPriceAlerts(): Promise<ApiResponse<{
677
+ id: string;
678
+ tokenSymbol: string;
679
+ targetPrice: number;
680
+ condition: 'above' | 'below';
681
+ status: 'active' | 'triggered' | 'cancelled';
682
+ createdAt: string;
683
+ triggeredAt?: string;
684
+ }[]>>;
685
+ /**
686
+ * Delete price alert
687
+ */
688
+ deletePriceAlert(alertId: string): Promise<ApiResponse<{
689
+ success: boolean;
690
+ }>>;
691
+ /**
692
+ * Get active sessions
693
+ */
694
+ getActiveSessions(): Promise<ApiResponse<{
695
+ sessions: {
696
+ id: string;
697
+ deviceName: string;
698
+ ipAddress: string;
699
+ lastActive: string;
700
+ current: boolean;
701
+ }[];
702
+ }>>;
703
+ /**
704
+ * Revoke session
705
+ */
706
+ revokeSession(sessionId: string): Promise<ApiResponse<{
707
+ success: boolean;
708
+ }>>;
709
+ /**
710
+ * Revoke all other sessions
711
+ */
712
+ revokeAllOtherSessions(): Promise<ApiResponse<{
713
+ revokedCount: number;
714
+ }>>;
715
+ /**
716
+ * List webhooks for the project
717
+ */
718
+ listWebhooks(options?: {
719
+ isActive?: boolean;
720
+ }): Promise<ApiResponse<{
721
+ webhooks: Webhook[];
722
+ total: number;
723
+ }>>;
724
+ /**
725
+ * Get webhook by ID
726
+ */
727
+ getWebhook(webhookId: string): Promise<ApiResponse<{
728
+ webhook: Webhook;
729
+ }>>;
730
+ /**
731
+ * Create a webhook
732
+ */
733
+ createWebhook(input: CreateWebhookInput): Promise<ApiResponse<{
734
+ webhook: Webhook;
735
+ }>>;
736
+ /**
737
+ * Update a webhook
738
+ */
739
+ updateWebhook(webhookId: string, input: UpdateWebhookInput): Promise<ApiResponse<{
740
+ webhook: Webhook;
741
+ }>>;
742
+ /**
743
+ * Delete a webhook
744
+ */
745
+ deleteWebhook(webhookId: string): Promise<ApiResponse<{
746
+ deleted: boolean;
747
+ }>>;
748
+ /**
749
+ * Get webhook deliveries
750
+ */
751
+ getWebhookDeliveries(webhookId: string, options?: {
752
+ status?: 'pending' | 'success' | 'failed';
753
+ limit?: number;
754
+ offset?: number;
755
+ }): Promise<ApiResponse<{
756
+ deliveries: WebhookDelivery[];
757
+ total: number;
758
+ }>>;
759
+ /**
760
+ * Test a webhook
761
+ */
762
+ testWebhook(webhookId: string): Promise<ApiResponse<{
763
+ success: boolean;
764
+ statusCode?: number;
765
+ responseTime?: number;
766
+ error?: string;
767
+ }>>;
768
+ /**
769
+ * List all users (admin only)
770
+ */
771
+ adminListUsers(options?: AdminListOptions & {
772
+ role?: 'user' | 'admin';
773
+ kycStatus?: 'none' | 'pending' | 'verified' | 'rejected';
774
+ isActive?: boolean;
775
+ }): Promise<ApiResponse<PaginatedResult<AdminUser>>>;
776
+ /**
777
+ * Get user by ID (admin only)
778
+ */
779
+ adminGetUser(userId: string): Promise<ApiResponse<{
780
+ user: AdminUser;
781
+ }>>;
782
+ /**
783
+ * Update user (admin only)
784
+ */
785
+ adminUpdateUser(userId: string, data: {
786
+ role?: 'user' | 'admin';
787
+ isActive?: boolean;
788
+ kycStatus?: 'none' | 'pending' | 'verified' | 'rejected';
789
+ }): Promise<ApiResponse<{
790
+ user: AdminUser;
791
+ }>>;
792
+ /**
793
+ * List all projects (admin only)
794
+ */
795
+ adminListProjects(options?: AdminListOptions & {
796
+ isActive?: boolean;
797
+ }): Promise<ApiResponse<PaginatedResult<AdminProject>>>;
798
+ /**
799
+ * Get project by ID (admin only)
800
+ */
801
+ adminGetProject(projectId: string): Promise<ApiResponse<{
802
+ project: AdminProject;
803
+ }>>;
804
+ /**
805
+ * Update project (admin only)
806
+ */
807
+ adminUpdateProject(projectId: string, data: {
808
+ name?: string;
809
+ isActive?: boolean;
810
+ settings?: Record<string, unknown>;
811
+ }): Promise<ApiResponse<{
812
+ project: AdminProject;
813
+ }>>;
814
+ /**
815
+ * Regenerate project API key (admin only)
816
+ */
817
+ adminRegenerateApiKey(projectId: string): Promise<ApiResponse<{
818
+ apiKey: string;
819
+ }>>;
820
+ /**
821
+ * Get system statistics (admin only)
822
+ */
823
+ adminGetStats(days?: number): Promise<ApiResponse<SystemStats>>;
824
+ /**
825
+ * Get system logs (admin only)
826
+ */
827
+ adminGetLogs(options?: {
828
+ level?: 'info' | 'warn' | 'error';
829
+ service?: string;
830
+ limit?: number;
831
+ offset?: number;
832
+ startDate?: string;
833
+ endDate?: string;
834
+ }): Promise<ApiResponse<{
835
+ logs: SystemLog[];
836
+ total: number;
837
+ }>>;
838
+ /**
839
+ * Get rate limit status (admin only)
840
+ */
841
+ adminGetRateLimits(options?: {
842
+ identifier?: string;
843
+ limit?: number;
844
+ }): Promise<ApiResponse<{
845
+ limits: RateLimitInfo[];
846
+ }>>;
847
+ /**
848
+ * Clear rate limits for an identifier (admin only)
849
+ */
850
+ adminClearRateLimits(identifier: string): Promise<ApiResponse<{
851
+ success: boolean;
852
+ }>>;
853
+ /**
854
+ * Get all AI trading strategies
855
+ */
856
+ getAIStrategies(filters?: {
857
+ category?: StrategyCategory;
858
+ riskLevel?: number;
859
+ minTvl?: number;
860
+ isActive?: boolean;
861
+ }): Promise<ApiResponse<{
862
+ strategies: AIStrategy[];
863
+ }>>;
864
+ /**
865
+ * Get AI strategy details
866
+ */
867
+ getAIStrategy(strategyId: string, include?: ('performance' | 'market' | 'trades')[]): Promise<ApiResponse<{
868
+ strategy: AIStrategy;
869
+ performance?: AINavSnapshot[];
870
+ marketData?: AIMarketData[];
871
+ trades?: AITradeExecution[];
872
+ }>>;
873
+ /**
874
+ * Get strategy performance history
875
+ */
876
+ getAIStrategyPerformance(strategyId: string, days?: number): Promise<ApiResponse<{
877
+ performance: AINavSnapshot[];
878
+ }>>;
879
+ /**
880
+ * Get real-time market data for strategy pairs
881
+ */
882
+ getAIStrategyMarketData(strategyId: string): Promise<ApiResponse<{
883
+ marketData: AIMarketData[];
884
+ }>>;
885
+ /**
886
+ * Create AI trading order
887
+ */
888
+ createAIOrder(request: CreateAIOrderRequest): Promise<ApiResponse<{
889
+ order: AIOrder;
890
+ }>>;
891
+ /**
892
+ * Get user's AI orders
893
+ */
894
+ getAIOrders(filters?: {
895
+ strategyId?: string;
896
+ status?: AIOrderStatus;
897
+ }): Promise<ApiResponse<{
898
+ orders: AIOrder[];
899
+ }>>;
900
+ /**
901
+ * Get AI order details
902
+ */
903
+ getAIOrder(orderId: string): Promise<ApiResponse<{
904
+ order: AIOrder;
905
+ strategy: AIStrategy;
906
+ }>>;
907
+ /**
908
+ * Pause AI order
909
+ */
910
+ pauseAIOrder(orderId: string): Promise<ApiResponse<{
911
+ order: AIOrder;
912
+ message: string;
913
+ }>>;
914
+ /**
915
+ * Resume AI order
916
+ */
917
+ resumeAIOrder(orderId: string): Promise<ApiResponse<{
918
+ order: AIOrder;
919
+ message: string;
920
+ }>>;
921
+ /**
922
+ * Request redemption for AI order
923
+ */
924
+ redeemAIOrder(orderId: string): Promise<ApiResponse<{
925
+ success: boolean;
926
+ redemption: AIRedemptionResult;
927
+ message: string;
928
+ }>>;
929
+ /**
930
+ * Get AI portfolio summary
931
+ */
932
+ getAIPortfolio(include?: ('allocations' | 'orders')[]): Promise<ApiResponse<{
933
+ portfolio: AIPortfolioSummary;
934
+ allocations?: AITradeAllocation[];
935
+ orders?: AIOrder[];
936
+ }>>;
937
+ /**
938
+ * Get user's trade allocations
939
+ */
940
+ getAITradeAllocations(limit?: number): Promise<ApiResponse<{
941
+ allocations: AITradeAllocation[];
942
+ }>>;
943
+ /**
944
+ * Get trade history for a strategy
945
+ */
946
+ getAITradeHistory(strategyId: string, limit?: number): Promise<ApiResponse<{
947
+ trades: AITradeExecution[];
948
+ }>>;
949
+ /**
950
+ * Execute AI signals for a strategy (admin only)
951
+ */
952
+ executeAISignals(strategyId: string): Promise<ApiResponse<{
953
+ executions: AITradeExecution[];
954
+ count: number;
955
+ message: string;
956
+ }>>;
957
+ /**
958
+ * Get cryptocurrency prices (FREE - uses CoinGecko/Binance/CoinCap)
959
+ */
960
+ getCryptoPrices(symbols: string[]): Promise<ApiResponse<{
961
+ prices: Array<{
962
+ symbol: string;
963
+ price: number;
964
+ change24h: number;
965
+ changePercent24h: number;
966
+ high24h: number;
967
+ low24h: number;
968
+ volume24h: number;
969
+ marketCap?: number;
970
+ lastUpdated: string;
971
+ }>;
972
+ }>>;
973
+ /**
974
+ * Get single cryptocurrency price (FREE)
975
+ */
976
+ getCryptoPrice(symbol: string): Promise<ApiResponse<{
977
+ price: {
978
+ symbol: string;
979
+ price: number;
980
+ change24h: number;
981
+ changePercent24h: number;
982
+ high24h: number;
983
+ low24h: number;
984
+ volume24h: number;
985
+ marketCap?: number;
986
+ lastUpdated: string;
987
+ };
988
+ }>>;
989
+ /**
990
+ * Get OHLCV candles for charting (FREE - from Binance)
991
+ */
992
+ getCryptoCandles(symbol: string, interval?: '1m' | '5m' | '15m' | '1h' | '4h' | '1d', limit?: number): Promise<ApiResponse<{
993
+ symbol: string;
994
+ interval: string;
995
+ candles: Array<{
996
+ timestamp: number;
997
+ open: number;
998
+ high: number;
999
+ low: number;
1000
+ close: number;
1001
+ volume: number;
1002
+ }>;
1003
+ }>>;
1004
+ /**
1005
+ * Get top cryptocurrencies by market cap (FREE)
1006
+ */
1007
+ getTopCryptos(limit?: number): Promise<ApiResponse<{
1008
+ prices: Array<{
1009
+ symbol: string;
1010
+ price: number;
1011
+ change24h: number;
1012
+ changePercent24h: number;
1013
+ high24h: number;
1014
+ low24h: number;
1015
+ volume24h: number;
1016
+ marketCap?: number;
1017
+ lastUpdated: string;
1018
+ }>;
1019
+ }>>;
1020
+ /**
1021
+ * Get crypto market overview (FREE)
1022
+ */
1023
+ getCryptoMarketOverview(): Promise<ApiResponse<{
1024
+ overview: {
1025
+ totalMarketCap: number;
1026
+ totalVolume24h: number;
1027
+ btcDominance: number;
1028
+ marketCapChange24h: number;
1029
+ activeCryptocurrencies: number;
1030
+ };
1031
+ }>>;
1032
+ }
1033
+ declare function createOneEngineClient(options?: {
1034
+ baseUrl?: string;
1035
+ clientId?: string;
1036
+ secretKey?: string;
1037
+ }): OneEngineClient;
1038
+
1039
+ export { type EngineAuthResponse as E, OneEngineClient as O, type SwapQuoteRequest as S, type EngineWalletBalance as a, type EngineTransactionRequest as b, createOneEngineClient as c, type EngineTransactionResponse as d, type OnrampSessionRequest as e, type OnrampSession as f, type OnrampQuote as g, type OnrampTransaction as h, type SwapQuote as i, type SwapExecuteRequest as j, type SwapResult as k };