@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.
- package/dist/config/index.d.mts +74 -0
- package/dist/config/index.d.ts +74 -0
- package/dist/config/index.js +244 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/index.mjs +226 -0
- package/dist/config/index.mjs.map +1 -0
- package/dist/engine-BeVuHpVx.d.mts +1202 -0
- package/dist/engine-DSc1Em4V.d.ts +1202 -0
- package/dist/hooks/index.d.mts +185 -0
- package/dist/hooks/index.d.ts +185 -0
- package/dist/hooks/index.js +1711 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/index.mjs +1699 -0
- package/dist/hooks/index.mjs.map +1 -0
- package/dist/index.d.mts +356 -0
- package/dist/index.d.ts +356 -0
- package/dist/index.js +5420 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +5293 -0
- package/dist/index.mjs.map +1 -0
- package/dist/price-CgqXPnT3.d.ts +13 -0
- package/dist/price-ClbLHHjv.d.mts +13 -0
- package/dist/providers/index.d.mts +121 -0
- package/dist/providers/index.d.ts +121 -0
- package/dist/providers/index.js +1741 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/index.mjs +1699 -0
- package/dist/providers/index.mjs.map +1 -0
- package/dist/react-native.d.mts +257 -0
- package/dist/react-native.d.ts +257 -0
- package/dist/react-native.js +2436 -0
- package/dist/react-native.js.map +1 -0
- package/dist/react-native.mjs +2392 -0
- package/dist/react-native.mjs.map +1 -0
- package/dist/services/index.d.mts +105 -0
- package/dist/services/index.d.ts +105 -0
- package/dist/services/index.js +1720 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/index.mjs +1709 -0
- package/dist/services/index.mjs.map +1 -0
- package/dist/supabase-BT0c7q9e.d.mts +82 -0
- package/dist/supabase-BT0c7q9e.d.ts +82 -0
- package/dist/types/index.d.mts +759 -0
- package/dist/types/index.d.ts +759 -0
- package/dist/types/index.js +4 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/index.mjs +3 -0
- package/dist/types/index.mjs.map +1 -0
- package/dist/utils/index.d.mts +36 -0
- package/dist/utils/index.d.ts +36 -0
- package/dist/utils/index.js +164 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/index.mjs +142 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +5 -1
- package/tsconfig.json +0 -22
- package/tsup.config.ts +0 -25
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { a as EngineWalletBalance } from '../engine-BeVuHpVx.mjs';
|
|
2
|
+
import { Token, TokenPrice, StrategyCategory, AIStrategy, AINavSnapshot, AIMarketData, AIOrderStatus, AIOrder, CreateAIOrderRequest, ApiResponse, AIPortfolioSummary, AITradeAllocation } from '../types/index.mjs';
|
|
3
|
+
|
|
4
|
+
interface UseWalletBalanceOptions {
|
|
5
|
+
chains?: number[];
|
|
6
|
+
autoRefresh?: boolean;
|
|
7
|
+
refreshInterval?: number;
|
|
8
|
+
engineUrl?: string;
|
|
9
|
+
clientId?: string;
|
|
10
|
+
}
|
|
11
|
+
interface UseWalletBalanceReturn {
|
|
12
|
+
balance: EngineWalletBalance | null;
|
|
13
|
+
tokens: Token[];
|
|
14
|
+
totalUsd: number;
|
|
15
|
+
change24h: number;
|
|
16
|
+
changePercent24h: number;
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
error: string | null;
|
|
19
|
+
refetch: () => Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Hook for fetching wallet balance via ONE Engine
|
|
23
|
+
*
|
|
24
|
+
* Note: If using OneProvider, prefer useOneWallet() instead for better integration.
|
|
25
|
+
* This hook is for standalone usage outside of OneProvider.
|
|
26
|
+
*/
|
|
27
|
+
declare function useWalletBalance(walletAddress: string | null, options?: UseWalletBalanceOptions): UseWalletBalanceReturn;
|
|
28
|
+
|
|
29
|
+
interface UseTokenPriceOptions {
|
|
30
|
+
autoRefresh?: boolean;
|
|
31
|
+
refreshInterval?: number;
|
|
32
|
+
engineUrl?: string;
|
|
33
|
+
clientId?: string;
|
|
34
|
+
}
|
|
35
|
+
interface UseTokenPriceReturn {
|
|
36
|
+
price: TokenPrice | null;
|
|
37
|
+
isLoading: boolean;
|
|
38
|
+
error: string | null;
|
|
39
|
+
refetch: () => Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Hook for fetching token price via ONE Engine
|
|
43
|
+
*
|
|
44
|
+
* Note: If using OneProvider, prefer useOneEngine().getTokenPrices() instead.
|
|
45
|
+
* This hook is for standalone usage outside of OneProvider.
|
|
46
|
+
*/
|
|
47
|
+
declare function useTokenPrice(symbol: string, options?: UseTokenPriceOptions): UseTokenPriceReturn;
|
|
48
|
+
interface UseTokenPricesReturn {
|
|
49
|
+
prices: Record<string, TokenPrice>;
|
|
50
|
+
isLoading: boolean;
|
|
51
|
+
error: string | null;
|
|
52
|
+
refetch: () => Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
declare function useTokenPrices(symbols: string[], options?: UseTokenPriceOptions): UseTokenPricesReturn;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* AI Trading Hooks for ONE SDK
|
|
58
|
+
*
|
|
59
|
+
* React hooks for AI quantitative trading features.
|
|
60
|
+
* These hooks provide easy access to AI strategies, orders, and portfolio management.
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Set the access token for authenticated requests
|
|
65
|
+
*/
|
|
66
|
+
declare function setAITradingAccessToken(token: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* Clear the access token
|
|
69
|
+
*/
|
|
70
|
+
declare function clearAITradingAccessToken(): void;
|
|
71
|
+
interface UseAIStrategiesOptions {
|
|
72
|
+
category?: StrategyCategory;
|
|
73
|
+
riskLevel?: number;
|
|
74
|
+
minTvl?: number;
|
|
75
|
+
isActive?: boolean;
|
|
76
|
+
autoRefresh?: boolean;
|
|
77
|
+
refreshInterval?: number;
|
|
78
|
+
}
|
|
79
|
+
interface UseAIStrategiesResult {
|
|
80
|
+
strategies: AIStrategy[];
|
|
81
|
+
isLoading: boolean;
|
|
82
|
+
error: string | null;
|
|
83
|
+
refresh: () => Promise<void>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Hook to fetch and manage AI trading strategies
|
|
87
|
+
*/
|
|
88
|
+
declare function useAIStrategies(options?: UseAIStrategiesOptions): UseAIStrategiesResult;
|
|
89
|
+
/**
|
|
90
|
+
* Hook to fetch a single AI strategy with performance data
|
|
91
|
+
*/
|
|
92
|
+
interface UseAIStrategyResult {
|
|
93
|
+
strategy: AIStrategy | null;
|
|
94
|
+
performance: AINavSnapshot[];
|
|
95
|
+
marketData: AIMarketData[];
|
|
96
|
+
isLoading: boolean;
|
|
97
|
+
error: string | null;
|
|
98
|
+
refresh: () => Promise<void>;
|
|
99
|
+
}
|
|
100
|
+
declare function useAIStrategy(strategyId: string | undefined, include?: ('performance' | 'market' | 'trades')[]): UseAIStrategyResult;
|
|
101
|
+
interface UseAIOrdersOptions {
|
|
102
|
+
strategyId?: string;
|
|
103
|
+
status?: AIOrderStatus;
|
|
104
|
+
autoRefresh?: boolean;
|
|
105
|
+
refreshInterval?: number;
|
|
106
|
+
}
|
|
107
|
+
interface UseAIOrdersResult {
|
|
108
|
+
orders: AIOrder[];
|
|
109
|
+
isLoading: boolean;
|
|
110
|
+
error: string | null;
|
|
111
|
+
refresh: () => Promise<void>;
|
|
112
|
+
createOrder: (request: CreateAIOrderRequest) => Promise<ApiResponse<{
|
|
113
|
+
order: AIOrder;
|
|
114
|
+
}>>;
|
|
115
|
+
pauseOrder: (orderId: string) => Promise<ApiResponse<{
|
|
116
|
+
order: AIOrder;
|
|
117
|
+
message: string;
|
|
118
|
+
}>>;
|
|
119
|
+
resumeOrder: (orderId: string) => Promise<ApiResponse<{
|
|
120
|
+
order: AIOrder;
|
|
121
|
+
message: string;
|
|
122
|
+
}>>;
|
|
123
|
+
redeemOrder: (orderId: string) => Promise<ApiResponse<any>>;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Hook to manage AI trading orders
|
|
127
|
+
*/
|
|
128
|
+
declare function useAIOrders(options?: UseAIOrdersOptions): UseAIOrdersResult;
|
|
129
|
+
interface UseAIPortfolioResult {
|
|
130
|
+
portfolio: AIPortfolioSummary | null;
|
|
131
|
+
allocations: AITradeAllocation[];
|
|
132
|
+
activeOrders: AIOrder[];
|
|
133
|
+
isLoading: boolean;
|
|
134
|
+
error: string | null;
|
|
135
|
+
refresh: () => Promise<void>;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Hook to fetch AI trading portfolio summary
|
|
139
|
+
*/
|
|
140
|
+
declare function useAIPortfolio(autoRefresh?: boolean): UseAIPortfolioResult;
|
|
141
|
+
interface UseAIMarketDataResult {
|
|
142
|
+
prices: Record<string, {
|
|
143
|
+
price: number;
|
|
144
|
+
change24h: number;
|
|
145
|
+
}>;
|
|
146
|
+
isLoading: boolean;
|
|
147
|
+
error: string | null;
|
|
148
|
+
refresh: () => Promise<void>;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Hook to fetch real-time market data for AI trading pairs
|
|
152
|
+
*/
|
|
153
|
+
declare function useAIMarketData(symbols?: string[], autoRefresh?: boolean): UseAIMarketDataResult;
|
|
154
|
+
interface UseAITradingResult {
|
|
155
|
+
strategies: AIStrategy[];
|
|
156
|
+
strategiesLoading: boolean;
|
|
157
|
+
orders: AIOrder[];
|
|
158
|
+
ordersLoading: boolean;
|
|
159
|
+
portfolio: AIPortfolioSummary | null;
|
|
160
|
+
portfolioLoading: boolean;
|
|
161
|
+
prices: Record<string, {
|
|
162
|
+
price: number;
|
|
163
|
+
change24h: number;
|
|
164
|
+
}>;
|
|
165
|
+
createOrder: (request: CreateAIOrderRequest) => Promise<ApiResponse<{
|
|
166
|
+
order: AIOrder;
|
|
167
|
+
}>>;
|
|
168
|
+
pauseOrder: (orderId: string) => Promise<ApiResponse<{
|
|
169
|
+
order: AIOrder;
|
|
170
|
+
message: string;
|
|
171
|
+
}>>;
|
|
172
|
+
resumeOrder: (orderId: string) => Promise<ApiResponse<{
|
|
173
|
+
order: AIOrder;
|
|
174
|
+
message: string;
|
|
175
|
+
}>>;
|
|
176
|
+
redeemOrder: (orderId: string) => Promise<ApiResponse<any>>;
|
|
177
|
+
refreshAll: () => Promise<void>;
|
|
178
|
+
error: string | null;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Combined hook for all AI trading functionality
|
|
182
|
+
*/
|
|
183
|
+
declare function useAITrading(): UseAITradingResult;
|
|
184
|
+
|
|
185
|
+
export { type UseAIMarketDataResult, type UseAIOrdersOptions, type UseAIOrdersResult, type UseAIPortfolioResult, type UseAIStrategiesOptions, type UseAIStrategiesResult, type UseAIStrategyResult, type UseAITradingResult, clearAITradingAccessToken, setAITradingAccessToken, useAIMarketData, useAIOrders, useAIPortfolio, useAIStrategies, useAIStrategy, useAITrading, useTokenPrice, useTokenPrices, useWalletBalance };
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { a as EngineWalletBalance } from '../engine-DSc1Em4V.js';
|
|
2
|
+
import { Token, TokenPrice, StrategyCategory, AIStrategy, AINavSnapshot, AIMarketData, AIOrderStatus, AIOrder, CreateAIOrderRequest, ApiResponse, AIPortfolioSummary, AITradeAllocation } from '../types/index.js';
|
|
3
|
+
|
|
4
|
+
interface UseWalletBalanceOptions {
|
|
5
|
+
chains?: number[];
|
|
6
|
+
autoRefresh?: boolean;
|
|
7
|
+
refreshInterval?: number;
|
|
8
|
+
engineUrl?: string;
|
|
9
|
+
clientId?: string;
|
|
10
|
+
}
|
|
11
|
+
interface UseWalletBalanceReturn {
|
|
12
|
+
balance: EngineWalletBalance | null;
|
|
13
|
+
tokens: Token[];
|
|
14
|
+
totalUsd: number;
|
|
15
|
+
change24h: number;
|
|
16
|
+
changePercent24h: number;
|
|
17
|
+
isLoading: boolean;
|
|
18
|
+
error: string | null;
|
|
19
|
+
refetch: () => Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Hook for fetching wallet balance via ONE Engine
|
|
23
|
+
*
|
|
24
|
+
* Note: If using OneProvider, prefer useOneWallet() instead for better integration.
|
|
25
|
+
* This hook is for standalone usage outside of OneProvider.
|
|
26
|
+
*/
|
|
27
|
+
declare function useWalletBalance(walletAddress: string | null, options?: UseWalletBalanceOptions): UseWalletBalanceReturn;
|
|
28
|
+
|
|
29
|
+
interface UseTokenPriceOptions {
|
|
30
|
+
autoRefresh?: boolean;
|
|
31
|
+
refreshInterval?: number;
|
|
32
|
+
engineUrl?: string;
|
|
33
|
+
clientId?: string;
|
|
34
|
+
}
|
|
35
|
+
interface UseTokenPriceReturn {
|
|
36
|
+
price: TokenPrice | null;
|
|
37
|
+
isLoading: boolean;
|
|
38
|
+
error: string | null;
|
|
39
|
+
refetch: () => Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Hook for fetching token price via ONE Engine
|
|
43
|
+
*
|
|
44
|
+
* Note: If using OneProvider, prefer useOneEngine().getTokenPrices() instead.
|
|
45
|
+
* This hook is for standalone usage outside of OneProvider.
|
|
46
|
+
*/
|
|
47
|
+
declare function useTokenPrice(symbol: string, options?: UseTokenPriceOptions): UseTokenPriceReturn;
|
|
48
|
+
interface UseTokenPricesReturn {
|
|
49
|
+
prices: Record<string, TokenPrice>;
|
|
50
|
+
isLoading: boolean;
|
|
51
|
+
error: string | null;
|
|
52
|
+
refetch: () => Promise<void>;
|
|
53
|
+
}
|
|
54
|
+
declare function useTokenPrices(symbols: string[], options?: UseTokenPriceOptions): UseTokenPricesReturn;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* AI Trading Hooks for ONE SDK
|
|
58
|
+
*
|
|
59
|
+
* React hooks for AI quantitative trading features.
|
|
60
|
+
* These hooks provide easy access to AI strategies, orders, and portfolio management.
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Set the access token for authenticated requests
|
|
65
|
+
*/
|
|
66
|
+
declare function setAITradingAccessToken(token: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* Clear the access token
|
|
69
|
+
*/
|
|
70
|
+
declare function clearAITradingAccessToken(): void;
|
|
71
|
+
interface UseAIStrategiesOptions {
|
|
72
|
+
category?: StrategyCategory;
|
|
73
|
+
riskLevel?: number;
|
|
74
|
+
minTvl?: number;
|
|
75
|
+
isActive?: boolean;
|
|
76
|
+
autoRefresh?: boolean;
|
|
77
|
+
refreshInterval?: number;
|
|
78
|
+
}
|
|
79
|
+
interface UseAIStrategiesResult {
|
|
80
|
+
strategies: AIStrategy[];
|
|
81
|
+
isLoading: boolean;
|
|
82
|
+
error: string | null;
|
|
83
|
+
refresh: () => Promise<void>;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Hook to fetch and manage AI trading strategies
|
|
87
|
+
*/
|
|
88
|
+
declare function useAIStrategies(options?: UseAIStrategiesOptions): UseAIStrategiesResult;
|
|
89
|
+
/**
|
|
90
|
+
* Hook to fetch a single AI strategy with performance data
|
|
91
|
+
*/
|
|
92
|
+
interface UseAIStrategyResult {
|
|
93
|
+
strategy: AIStrategy | null;
|
|
94
|
+
performance: AINavSnapshot[];
|
|
95
|
+
marketData: AIMarketData[];
|
|
96
|
+
isLoading: boolean;
|
|
97
|
+
error: string | null;
|
|
98
|
+
refresh: () => Promise<void>;
|
|
99
|
+
}
|
|
100
|
+
declare function useAIStrategy(strategyId: string | undefined, include?: ('performance' | 'market' | 'trades')[]): UseAIStrategyResult;
|
|
101
|
+
interface UseAIOrdersOptions {
|
|
102
|
+
strategyId?: string;
|
|
103
|
+
status?: AIOrderStatus;
|
|
104
|
+
autoRefresh?: boolean;
|
|
105
|
+
refreshInterval?: number;
|
|
106
|
+
}
|
|
107
|
+
interface UseAIOrdersResult {
|
|
108
|
+
orders: AIOrder[];
|
|
109
|
+
isLoading: boolean;
|
|
110
|
+
error: string | null;
|
|
111
|
+
refresh: () => Promise<void>;
|
|
112
|
+
createOrder: (request: CreateAIOrderRequest) => Promise<ApiResponse<{
|
|
113
|
+
order: AIOrder;
|
|
114
|
+
}>>;
|
|
115
|
+
pauseOrder: (orderId: string) => Promise<ApiResponse<{
|
|
116
|
+
order: AIOrder;
|
|
117
|
+
message: string;
|
|
118
|
+
}>>;
|
|
119
|
+
resumeOrder: (orderId: string) => Promise<ApiResponse<{
|
|
120
|
+
order: AIOrder;
|
|
121
|
+
message: string;
|
|
122
|
+
}>>;
|
|
123
|
+
redeemOrder: (orderId: string) => Promise<ApiResponse<any>>;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Hook to manage AI trading orders
|
|
127
|
+
*/
|
|
128
|
+
declare function useAIOrders(options?: UseAIOrdersOptions): UseAIOrdersResult;
|
|
129
|
+
interface UseAIPortfolioResult {
|
|
130
|
+
portfolio: AIPortfolioSummary | null;
|
|
131
|
+
allocations: AITradeAllocation[];
|
|
132
|
+
activeOrders: AIOrder[];
|
|
133
|
+
isLoading: boolean;
|
|
134
|
+
error: string | null;
|
|
135
|
+
refresh: () => Promise<void>;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Hook to fetch AI trading portfolio summary
|
|
139
|
+
*/
|
|
140
|
+
declare function useAIPortfolio(autoRefresh?: boolean): UseAIPortfolioResult;
|
|
141
|
+
interface UseAIMarketDataResult {
|
|
142
|
+
prices: Record<string, {
|
|
143
|
+
price: number;
|
|
144
|
+
change24h: number;
|
|
145
|
+
}>;
|
|
146
|
+
isLoading: boolean;
|
|
147
|
+
error: string | null;
|
|
148
|
+
refresh: () => Promise<void>;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Hook to fetch real-time market data for AI trading pairs
|
|
152
|
+
*/
|
|
153
|
+
declare function useAIMarketData(symbols?: string[], autoRefresh?: boolean): UseAIMarketDataResult;
|
|
154
|
+
interface UseAITradingResult {
|
|
155
|
+
strategies: AIStrategy[];
|
|
156
|
+
strategiesLoading: boolean;
|
|
157
|
+
orders: AIOrder[];
|
|
158
|
+
ordersLoading: boolean;
|
|
159
|
+
portfolio: AIPortfolioSummary | null;
|
|
160
|
+
portfolioLoading: boolean;
|
|
161
|
+
prices: Record<string, {
|
|
162
|
+
price: number;
|
|
163
|
+
change24h: number;
|
|
164
|
+
}>;
|
|
165
|
+
createOrder: (request: CreateAIOrderRequest) => Promise<ApiResponse<{
|
|
166
|
+
order: AIOrder;
|
|
167
|
+
}>>;
|
|
168
|
+
pauseOrder: (orderId: string) => Promise<ApiResponse<{
|
|
169
|
+
order: AIOrder;
|
|
170
|
+
message: string;
|
|
171
|
+
}>>;
|
|
172
|
+
resumeOrder: (orderId: string) => Promise<ApiResponse<{
|
|
173
|
+
order: AIOrder;
|
|
174
|
+
message: string;
|
|
175
|
+
}>>;
|
|
176
|
+
redeemOrder: (orderId: string) => Promise<ApiResponse<any>>;
|
|
177
|
+
refreshAll: () => Promise<void>;
|
|
178
|
+
error: string | null;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Combined hook for all AI trading functionality
|
|
182
|
+
*/
|
|
183
|
+
declare function useAITrading(): UseAITradingResult;
|
|
184
|
+
|
|
185
|
+
export { type UseAIMarketDataResult, type UseAIOrdersOptions, type UseAIOrdersResult, type UseAIPortfolioResult, type UseAIStrategiesOptions, type UseAIStrategiesResult, type UseAIStrategyResult, type UseAITradingResult, clearAITradingAccessToken, setAITradingAccessToken, useAIMarketData, useAIOrders, useAIPortfolio, useAIStrategies, useAIStrategy, useAITrading, useTokenPrice, useTokenPrices, useWalletBalance };
|