@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,257 @@
1
+ import { ApiResponse } from './types/index.js';
2
+ export { AIMarketData, AINavSnapshot, AIOrder, AIOrderStatus, AIPortfolioSummary, AIRedemptionResult, AIStrategy, AITradeAllocation, AITradeExecution, AdminListOptions, AdminProject, AdminUser, AssetAllocation, BillCategory, BillPayment, BillProvider, BridgeQuote, BridgeRoute, BridgeTransaction, Card, CardStatus, CardTier, CardTransaction, ChainConfig, Contract, ContractDeployParams, ContractReadParams, ContractType, ContractWriteParams, CreateAIOrderRequest, CreateWebhookInput, GasEstimate, GasPrice, KycLevel, KycStatus, LimitOrder, MembershipTier, NFT, NFTAttribute, NFTCollection, NFTTransfer, Notification, NotificationSettings, OfframpQuote, OfframpRequest, OfframpTransaction, OnChainBalance, PaginatedResult, Permission, PermissionScope, PortfolioAnalytics, PortfolioHistory, Position, RateLimitInfo, Referral, ReferralInfo, RiskLevel, SDKEvent, SDKEventType, Session, StakingPool, StakingPosition, StrategyCategory, SystemLog, SystemStats, Token, TokenPrice, TradeAction, TradingCondition, Transaction, TransactionStatus, TransactionType, UpdateWebhookInput, User, UserProfile, UserSettings, WalletBalance, WalletExport, WalletImportRequest, Webhook, WebhookDelivery, WebhookEventType } from './types/index.js';
3
+ export { CHAIN_CONFIGS, COINGECKO_IDS, OneConfig, TOKEN_NAMES, getConfig, initOneSDK } from './config/index.js';
4
+ import { E as EngineAuthResponse, O as OneEngineClient } from './engine-DSc1Em4V.js';
5
+ export { b as EngineTransactionRequest, d as EngineTransactionResponse, a as EngineWalletBalance, g as OnrampQuote, f as OnrampSession, e as OnrampSessionRequest, h as OnrampTransaction, j as SwapExecuteRequest, i as SwapQuote, S as SwapQuoteRequest, k as SwapResult, c as createOneEngineClient } from './engine-DSc1Em4V.js';
6
+ export { P as PriceService, p as priceService } from './price-CgqXPnT3.js';
7
+ export { OneSDKError, capitalize, checksumAddress, formatDate, formatDateTime, formatNumber, formatPercent, formatRelativeTime, formatTokenAmount, formatUSD, isOneSDKError, isValidAddress, isValidEmail, isValidPhone, omit, pick, retry, shortenAddress, sleep, slugify, truncate } from './utils/index.js';
8
+ import React from 'react';
9
+ import { ViewStyle, TextStyle } from 'react-native';
10
+
11
+ /**
12
+ * OneChainSelector - Multi-chain selection component for AI trading
13
+ * Part of ONE Ecosystem SDK - can be used by any ecosystem partner
14
+ */
15
+
16
+ declare const CHAIN_CONFIG: Record<string, {
17
+ name: string;
18
+ icon: string;
19
+ color: string;
20
+ }>;
21
+ interface OneChainSelectorProps {
22
+ /** List of supported chain IDs */
23
+ supportedChains: string[];
24
+ /** Currently selected chains */
25
+ selectedChains: string[];
26
+ /** Callback when chain selection changes */
27
+ onSelectChain: (chain: string) => void;
28
+ /** Enable multi-select (default: true) */
29
+ multiSelect?: boolean;
30
+ /** Accent color for selected state */
31
+ accentColor?: string;
32
+ /** Section title */
33
+ title?: string;
34
+ /** Section subtitle */
35
+ subtitle?: string;
36
+ /** Minimum required selections (for multi-select) */
37
+ minSelections?: number;
38
+ /** Custom styles */
39
+ style?: ViewStyle;
40
+ /** Custom title style */
41
+ titleStyle?: TextStyle;
42
+ }
43
+ declare const OneChainSelector: React.FC<OneChainSelectorProps>;
44
+
45
+ /**
46
+ * OneTierSelector - Investment tier selection component for AI trading
47
+ * Part of ONE Ecosystem SDK - can be used by any ecosystem partner
48
+ */
49
+
50
+ interface Tier {
51
+ tier: number;
52
+ amount: number;
53
+ label: string;
54
+ label_zh?: string;
55
+ }
56
+ interface OneTierSelectorProps {
57
+ /** Available investment tiers */
58
+ tiers: Tier[];
59
+ /** Currently selected tier */
60
+ selectedTier: Tier | null;
61
+ /** Callback when tier selection changes */
62
+ onSelectTier: (tier: Tier) => void;
63
+ /** Accent color for selected state */
64
+ accentColor?: string;
65
+ /** Section title */
66
+ title?: string;
67
+ /** Section subtitle */
68
+ subtitle?: string;
69
+ /** Show recommended badge on middle tier */
70
+ showRecommended?: boolean;
71
+ /** Recommended label text */
72
+ recommendedLabel?: string;
73
+ /** Use Chinese labels */
74
+ useZhLabels?: boolean;
75
+ /** Custom styles */
76
+ style?: ViewStyle;
77
+ /** Custom title style */
78
+ titleStyle?: TextStyle;
79
+ }
80
+ declare const OneTierSelector: React.FC<OneTierSelectorProps>;
81
+
82
+ /**
83
+ * OneCycleSelector - Investment cycle selection component for AI trading
84
+ * Part of ONE Ecosystem SDK - can be used by any ecosystem partner
85
+ */
86
+
87
+ declare const DEFAULT_SHARE_RATES: Record<number, number>;
88
+ interface OneCycleSelectorProps {
89
+ /** List of supported cycle days */
90
+ supportedCycles: number[];
91
+ /** Currently selected cycle */
92
+ selectedCycle: number;
93
+ /** Callback when cycle selection changes */
94
+ onSelectCycle: (cycle: number) => void;
95
+ /** Accent color for selected state */
96
+ accentColor?: string;
97
+ /** Section title */
98
+ title?: string;
99
+ /** Section subtitle */
100
+ subtitle?: string;
101
+ /** Custom share rates by cycle (overrides defaults) */
102
+ shareRates?: Record<number, number>;
103
+ /** Days label */
104
+ daysLabel?: string;
105
+ /** Your share label */
106
+ yourShareLabel?: string;
107
+ /** Platform fee label */
108
+ platformFeeLabel?: string;
109
+ /** Custom styles */
110
+ style?: ViewStyle;
111
+ /** Custom title style */
112
+ titleStyle?: TextStyle;
113
+ }
114
+ declare const OneCycleSelector: React.FC<OneCycleSelectorProps>;
115
+
116
+ /**
117
+ * OnePairSelector - Trading pair selection component for AI trading
118
+ * Part of ONE Ecosystem SDK - can be used by any ecosystem partner
119
+ */
120
+
121
+ declare const PAIR_ICONS: Record<string, string>;
122
+ interface OnePairSelectorProps {
123
+ /** List of supported trading pairs */
124
+ supportedPairs: string[];
125
+ /** Currently selected pairs */
126
+ selectedPairs: string[];
127
+ /** Callback when pair selection changes */
128
+ onTogglePair: (pair: string) => void;
129
+ /** Accent color for selected state */
130
+ accentColor?: string;
131
+ /** Section title */
132
+ title?: string;
133
+ /** Section subtitle */
134
+ subtitle?: string;
135
+ /** Minimum required selections */
136
+ minSelections?: number;
137
+ /** Maximum allowed selections (0 = unlimited) */
138
+ maxSelections?: number;
139
+ /** Custom styles */
140
+ style?: ViewStyle;
141
+ /** Custom title style */
142
+ titleStyle?: TextStyle;
143
+ }
144
+ declare const OnePairSelector: React.FC<OnePairSelectorProps>;
145
+
146
+ /**
147
+ * Storage adapter interface for React Native
148
+ * Implement this with AsyncStorage or other storage solutions
149
+ */
150
+ interface StorageAdapter {
151
+ getItem(key: string): Promise<string | null>;
152
+ setItem(key: string, value: string): Promise<void>;
153
+ removeItem(key: string): Promise<void>;
154
+ clear(): Promise<void>;
155
+ }
156
+ /**
157
+ * Create a cached engine client with persistent storage
158
+ */
159
+ declare function createCachedEngineClient(storage: StorageAdapter, options?: {
160
+ baseUrl?: string;
161
+ clientId?: string;
162
+ secretKey?: string;
163
+ }): {
164
+ /**
165
+ * Initialize with stored token
166
+ */
167
+ initialize(): Promise<boolean>;
168
+ /**
169
+ * Login and persist token
170
+ */
171
+ login(email: string, otp: string): Promise<ApiResponse<EngineAuthResponse>>;
172
+ /**
173
+ * Logout and clear stored tokens
174
+ */
175
+ logout(): Promise<void>;
176
+ /**
177
+ * Refresh token from storage
178
+ */
179
+ refreshFromStorage(): Promise<boolean>;
180
+ getClient: () => OneEngineClient;
181
+ };
182
+ /**
183
+ * Deep linking handler for ONE SDK
184
+ */
185
+ interface DeepLinkHandler {
186
+ /**
187
+ * Parse deep link URL
188
+ */
189
+ parse(url: string): {
190
+ type: 'onramp_callback' | 'wallet_connect' | 'payment' | 'unknown';
191
+ params: Record<string, string>;
192
+ };
193
+ /**
194
+ * Generate deep link URL
195
+ */
196
+ generate(type: string, params: Record<string, string>): string;
197
+ }
198
+ declare function createDeepLinkHandler(scheme?: string): DeepLinkHandler;
199
+ /**
200
+ * Biometric authentication helper types
201
+ */
202
+ interface BiometricConfig {
203
+ promptMessage: string;
204
+ cancelButtonText?: string;
205
+ fallbackLabel?: string;
206
+ }
207
+ interface BiometricResult {
208
+ success: boolean;
209
+ error?: string;
210
+ }
211
+ /**
212
+ * QR Code scanning result types
213
+ */
214
+ interface QRScanResult {
215
+ type: 'address' | 'wallet_connect' | 'payment_request' | 'unknown';
216
+ data: string;
217
+ parsed?: {
218
+ address?: string;
219
+ chainId?: number;
220
+ amount?: string;
221
+ token?: string;
222
+ message?: string;
223
+ };
224
+ }
225
+ /**
226
+ * Parse QR code data for wallet operations
227
+ */
228
+ declare function parseQRCode(data: string): QRScanResult;
229
+ /**
230
+ * Format crypto amount for display on mobile
231
+ */
232
+ declare function formatCryptoAmount(amount: number | string, symbol: string, options?: {
233
+ maxDecimals?: number;
234
+ showSymbol?: boolean;
235
+ compact?: boolean;
236
+ }): string;
237
+ /**
238
+ * Generate share content for transactions
239
+ */
240
+ declare function generateShareContent(params: {
241
+ type: 'receive' | 'payment_request' | 'transaction';
242
+ address?: string;
243
+ amount?: string;
244
+ token?: string;
245
+ txHash?: string;
246
+ chainId?: number;
247
+ }): {
248
+ title: string;
249
+ message: string;
250
+ url?: string;
251
+ };
252
+ /**
253
+ * Get block explorer URL
254
+ */
255
+ declare function getExplorerUrl(chainId: number, hash: string, type?: 'tx' | 'address' | 'token'): string;
256
+
257
+ export { ApiResponse, type BiometricConfig, type BiometricResult, CHAIN_CONFIG, DEFAULT_SHARE_RATES, type DeepLinkHandler, EngineAuthResponse, OneChainSelector, type OneChainSelectorProps, OneCycleSelector, type OneCycleSelectorProps, OneEngineClient, OnePairSelector, type OnePairSelectorProps, OneTierSelector, type OneTierSelectorProps, PAIR_ICONS, type QRScanResult, type StorageAdapter, type Tier, createCachedEngineClient, createDeepLinkHandler, formatCryptoAmount, generateShareContent, getExplorerUrl, parseQRCode };