@one_deploy/sdk 1.0.3 → 1.0.5

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 (53) hide show
  1. package/dist/{engine-CrlhH0nw.d.mts → engine-BeVuHpVx.d.mts} +163 -0
  2. package/dist/{engine-5ndtBaCr.d.ts → engine-DSc1Em4V.d.ts} +163 -0
  3. package/dist/hooks/index.d.mts +132 -3
  4. package/dist/hooks/index.d.ts +132 -3
  5. package/dist/hooks/index.js +351 -0
  6. package/dist/hooks/index.js.map +1 -1
  7. package/dist/hooks/index.mjs +345 -2
  8. package/dist/hooks/index.mjs.map +1 -1
  9. package/dist/index.d.mts +3 -3
  10. package/dist/index.d.ts +3 -3
  11. package/dist/index.js +352 -1
  12. package/dist/index.js.map +1 -1
  13. package/dist/index.mjs +345 -2
  14. package/dist/index.mjs.map +1 -1
  15. package/dist/providers/index.d.mts +1 -1
  16. package/dist/providers/index.d.ts +1 -1
  17. package/dist/providers/index.js +98 -0
  18. package/dist/providers/index.js.map +1 -1
  19. package/dist/providers/index.mjs +98 -0
  20. package/dist/providers/index.mjs.map +1 -1
  21. package/dist/react-native.d.mts +140 -3
  22. package/dist/react-native.d.ts +140 -3
  23. package/dist/react-native.js +642 -0
  24. package/dist/react-native.js.map +1 -1
  25. package/dist/react-native.mjs +636 -1
  26. package/dist/react-native.mjs.map +1 -1
  27. package/dist/services/index.d.mts +99 -79
  28. package/dist/services/index.d.ts +99 -79
  29. package/dist/services/index.js +254 -0
  30. package/dist/services/index.js.map +1 -1
  31. package/dist/services/index.mjs +252 -1
  32. package/dist/services/index.mjs.map +1 -1
  33. package/dist/supabase-BT0c7q9e.d.mts +82 -0
  34. package/dist/supabase-BT0c7q9e.d.ts +82 -0
  35. package/package.json +5 -1
  36. package/src/components/OneSwapWidget.tsx +1 -1
  37. package/src/components/ai/OneChainSelector.tsx +183 -0
  38. package/src/components/ai/OneCycleSelector.tsx +187 -0
  39. package/src/components/ai/OnePairSelector.tsx +181 -0
  40. package/src/components/ai/OneTierSelector.tsx +187 -0
  41. package/src/components/ai/index.ts +17 -0
  42. package/src/components/index.ts +3 -0
  43. package/src/hooks/index.ts +20 -0
  44. package/src/hooks/useAITrading.ts +444 -0
  45. package/src/index.ts +20 -0
  46. package/src/react-native.ts +23 -0
  47. package/src/services/engine.ts +184 -0
  48. package/src/services/index.ts +16 -0
  49. package/src/services/usage.ts +249 -0
  50. package/.turbo/turbo-build.log +0 -0
  51. package/.turbo/turbo-type-check.log +0 -0
  52. package/tsconfig.json +0 -22
  53. package/tsup.config.ts +0 -25
@@ -1,10 +1,147 @@
1
1
  import { ApiResponse } from './types/index.mjs';
2
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.mjs';
3
3
  export { CHAIN_CONFIGS, COINGECKO_IDS, OneConfig, TOKEN_NAMES, getConfig, initOneSDK } from './config/index.mjs';
4
- import { E as EngineAuthResponse, O as OneEngineClient } from './engine-CrlhH0nw.mjs';
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-CrlhH0nw.mjs';
4
+ import { E as EngineAuthResponse, O as OneEngineClient } from './engine-BeVuHpVx.mjs';
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-BeVuHpVx.mjs';
6
6
  export { P as PriceService, p as priceService } from './price-ClbLHHjv.mjs';
7
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.mjs';
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>;
8
145
 
9
146
  /**
10
147
  * Storage adapter interface for React Native
@@ -117,4 +254,4 @@ declare function generateShareContent(params: {
117
254
  */
118
255
  declare function getExplorerUrl(chainId: number, hash: string, type?: 'tx' | 'address' | 'token'): string;
119
256
 
120
- export { ApiResponse, type BiometricConfig, type BiometricResult, type DeepLinkHandler, EngineAuthResponse, OneEngineClient, type QRScanResult, type StorageAdapter, createCachedEngineClient, createDeepLinkHandler, formatCryptoAmount, generateShareContent, getExplorerUrl, parseQRCode };
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 };
@@ -1,10 +1,147 @@
1
1
  import { ApiResponse } from './types/index.js';
2
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
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-5ndtBaCr.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-5ndtBaCr.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
6
  export { P as PriceService, p as priceService } from './price-CgqXPnT3.js';
7
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>;
8
145
 
9
146
  /**
10
147
  * Storage adapter interface for React Native
@@ -117,4 +254,4 @@ declare function generateShareContent(params: {
117
254
  */
118
255
  declare function getExplorerUrl(chainId: number, hash: string, type?: 'tx' | 'address' | 'token'): string;
119
256
 
120
- export { ApiResponse, type BiometricConfig, type BiometricResult, type DeepLinkHandler, EngineAuthResponse, OneEngineClient, type QRScanResult, type StorageAdapter, createCachedEngineClient, createDeepLinkHandler, formatCryptoAmount, generateShareContent, getExplorerUrl, parseQRCode };
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 };