@one_deploy/sdk 1.0.7 → 1.2.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.
- package/README.md +339 -0
- package/dist/ForexPoolDataGenerator--__twRwl.d.mts +76 -0
- package/dist/ForexPoolDataGenerator-eUgwsU_B.d.ts +76 -0
- package/dist/OneForexTradeHistory-TlKxjbFF.d.ts +250 -0
- package/dist/OneForexTradeHistory-iDySMcw0.d.mts +250 -0
- package/dist/components/index.d.mts +539 -0
- package/dist/components/index.d.ts +539 -0
- package/dist/components/index.js +7295 -0
- package/dist/components/index.js.map +1 -0
- package/dist/components/index.mjs +7243 -0
- package/dist/components/index.mjs.map +1 -0
- package/dist/config/index.d.mts +1 -0
- package/dist/config/index.d.ts +1 -0
- package/dist/console-BfTMA7ah.d.mts +504 -0
- package/dist/console-BfTMA7ah.d.ts +504 -0
- package/dist/hooks/index.d.mts +323 -1
- package/dist/hooks/index.d.ts +323 -1
- package/dist/hooks/index.js +3223 -0
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +3204 -1
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +18 -352
- package/dist/index.d.ts +18 -352
- package/dist/index.js +8646 -574
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8449 -432
- package/dist/index.mjs.map +1 -1
- package/dist/providers/index.d.mts +31 -31
- package/dist/providers/index.d.ts +31 -31
- package/dist/providers/index.js +140 -153
- package/dist/providers/index.js.map +1 -1
- package/dist/providers/index.mjs +100 -109
- package/dist/providers/index.mjs.map +1 -1
- package/dist/react-native.d.mts +8 -144
- package/dist/react-native.d.ts +8 -144
- package/dist/react-native.js +2640 -689
- package/dist/react-native.js.map +1 -1
- package/dist/react-native.mjs +2610 -691
- package/dist/react-native.mjs.map +1 -1
- package/dist/services/index.d.mts +85 -4
- package/dist/services/index.d.ts +85 -4
- package/dist/services/index.js +1621 -0
- package/dist/services/index.js.map +1 -1
- package/dist/services/index.mjs +1619 -1
- package/dist/services/index.mjs.map +1 -1
- package/dist/types/index.d.mts +203 -1
- package/dist/types/index.d.ts +203 -1
- package/dist/types/index.js +275 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/index.mjs +251 -0
- package/dist/types/index.mjs.map +1 -1
- package/dist/useForexTrading-BleeSor8.d.mts +80 -0
- package/dist/useForexTrading-ZgW_G40Q.d.ts +80 -0
- package/package.json +9 -2
- package/src/components/OneConnectButton.tsx +24 -1
- package/src/components/OneNFTGallery.tsx +13 -7
- package/src/components/OneOfframpWidget.tsx +4 -3
- package/src/components/OnePayWidget.tsx +10 -1
- package/src/components/OneSendWidget.tsx +3 -3
- package/src/components/OneSwapWidget.tsx +4 -4
- package/src/components/OneTransactionButton.tsx +28 -3
- package/src/components/OneWalletBalance.tsx +1 -1
- package/src/components/ai/OneChainSelector.tsx +63 -336
- package/src/components/ai/OneForexCapitalSplit.tsx +112 -0
- package/src/components/ai/OneForexConsoleView.tsx +90 -0
- package/src/components/ai/OneForexPairSelector.tsx +101 -0
- package/src/components/ai/OneForexPoolCard.tsx +105 -0
- package/src/components/ai/OneForexTradeHistory.tsx +107 -0
- package/src/components/ai/OnePairSelector.tsx +77 -434
- package/src/components/ai/console/OneAIQuantConsole.tsx +423 -0
- package/src/components/ai/console/OneAgentCard.tsx +383 -0
- package/src/components/ai/console/OneAgentConsole.tsx +469 -0
- package/src/components/ai/console/OneDecisionTimeline.tsx +433 -0
- package/src/components/ai/console/OneMetricsDashboard.tsx +493 -0
- package/src/components/ai/console/OnePositionCard.tsx +406 -0
- package/src/components/ai/console/OnePositionDetail.tsx +600 -0
- package/src/components/ai/console/OneRiskIndicator.tsx +464 -0
- package/src/components/ai/console/OneTradingConsole.tsx +660 -0
- package/src/components/ai/console/index.ts +17 -0
- package/src/components/ai/index.ts +10 -0
- package/src/hooks/index.ts +46 -0
- package/src/hooks/useAIDecisions.ts +280 -0
- package/src/hooks/useAIPositions.ts +349 -0
- package/src/hooks/useAIQuantConsole.ts +283 -0
- package/src/hooks/useAIRiskStatus.ts +276 -0
- package/src/hooks/useAITrading.ts +190 -0
- package/src/hooks/useBotSimulation.ts +201 -0
- package/src/hooks/useForexTrading.ts +430 -0
- package/src/hooks/useTradingConsole.ts +243 -0
- package/src/index.ts +123 -5
- package/src/providers/OneProvider.tsx +181 -5
- package/src/providers/index.ts +22 -8
- package/src/react-native.ts +41 -0
- package/src/services/forex/BotSimulationEngine.ts +968 -0
- package/src/services/forex/ForexPoolDataGenerator.ts +542 -0
- package/src/services/forex/ForexSimulationEngine.ts +482 -0
- package/src/services/forex/index.ts +21 -0
- package/src/services/index.ts +16 -0
- package/src/types/aiTrading.ts +151 -0
- package/src/types/console.ts +380 -0
- package/src/types/forex.ts +282 -0
- package/src/types/index.ts +106 -0
- package/dist/price-CgqXPnT3.d.ts +0 -13
- package/dist/price-ClbLHHjv.d.mts +0 -13
- package/dist/supabase-BT0c7q9e.d.mts +0 -82
- package/dist/supabase-BT0c7q9e.d.ts +0 -82
package/src/types/index.ts
CHANGED
|
@@ -885,3 +885,109 @@ export interface RateLimitInfo {
|
|
|
885
885
|
windowStart: string;
|
|
886
886
|
windowEnd: string;
|
|
887
887
|
}
|
|
888
|
+
|
|
889
|
+
// ===== AI Agent Types =====
|
|
890
|
+
|
|
891
|
+
export interface AIAgentTier {
|
|
892
|
+
tier: number;
|
|
893
|
+
amount: number;
|
|
894
|
+
label: string;
|
|
895
|
+
label_zh?: string;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
export interface AIAgentCycleParams {
|
|
899
|
+
cycle: number;
|
|
900
|
+
lockDays: number;
|
|
901
|
+
shareRate: number;
|
|
902
|
+
expectedApy: number;
|
|
903
|
+
managementFee: number;
|
|
904
|
+
performanceFee: number;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
export interface AIAgent {
|
|
908
|
+
id: string;
|
|
909
|
+
name: string;
|
|
910
|
+
name_zh?: string;
|
|
911
|
+
description: string;
|
|
912
|
+
description_zh?: string;
|
|
913
|
+
category: StrategyCategory;
|
|
914
|
+
risk_level: 1 | 2 | 3 | 4 | 5;
|
|
915
|
+
icon: string;
|
|
916
|
+
color: string;
|
|
917
|
+
tiers: AIAgentTier[];
|
|
918
|
+
supported_cycles: number[];
|
|
919
|
+
default_cycle: number;
|
|
920
|
+
supported_pairs: string[];
|
|
921
|
+
supported_chains: string[];
|
|
922
|
+
is_active: boolean;
|
|
923
|
+
preview?: {
|
|
924
|
+
tier: AIAgentTier;
|
|
925
|
+
cycle: number;
|
|
926
|
+
lockDays: number;
|
|
927
|
+
shareRate: number;
|
|
928
|
+
expectedApy: number;
|
|
929
|
+
managementFee: number;
|
|
930
|
+
performanceFee: number;
|
|
931
|
+
};
|
|
932
|
+
tierParams?: Array<{
|
|
933
|
+
tier: number;
|
|
934
|
+
amount: number;
|
|
935
|
+
label: string;
|
|
936
|
+
label_zh?: string;
|
|
937
|
+
cycles: AIAgentCycleParams[];
|
|
938
|
+
}>;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
export interface AIAgentPerformance {
|
|
942
|
+
agentId: string;
|
|
943
|
+
date: string;
|
|
944
|
+
nav: number;
|
|
945
|
+
dailyPnl: number;
|
|
946
|
+
dailyPnlPct: number;
|
|
947
|
+
cumulativePnl: number;
|
|
948
|
+
cumulativePnlPct: number;
|
|
949
|
+
tradesOpened: number;
|
|
950
|
+
tradesClosed: number;
|
|
951
|
+
winRate: number;
|
|
952
|
+
sharpeRatio: number;
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
export interface AIAgentTrade {
|
|
956
|
+
id: string;
|
|
957
|
+
agentId: string;
|
|
958
|
+
symbol: string;
|
|
959
|
+
side: 'long' | 'short';
|
|
960
|
+
entryPrice: number;
|
|
961
|
+
exitPrice?: number;
|
|
962
|
+
quantity: number;
|
|
963
|
+
leverage: number;
|
|
964
|
+
pnl: number;
|
|
965
|
+
pnlPct: number;
|
|
966
|
+
status: 'open' | 'closed';
|
|
967
|
+
entryReason: string;
|
|
968
|
+
exitReason?: string;
|
|
969
|
+
confidence: number;
|
|
970
|
+
openedAt: string;
|
|
971
|
+
closedAt?: string;
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
export interface AIAgentSubscriptionParams {
|
|
975
|
+
agentId: string;
|
|
976
|
+
tier: number;
|
|
977
|
+
cycle: number;
|
|
978
|
+
amount: number;
|
|
979
|
+
lockDays: number;
|
|
980
|
+
shareRate: number;
|
|
981
|
+
expectedApy: number;
|
|
982
|
+
managementFee: number;
|
|
983
|
+
performanceFee: number;
|
|
984
|
+
}
|
|
985
|
+
|
|
986
|
+
// ===== StableFX Forex Types =====
|
|
987
|
+
export * from './forex';
|
|
988
|
+
|
|
989
|
+
// ===== AI Trading Extended Types =====
|
|
990
|
+
export * from './aiTrading';
|
|
991
|
+
|
|
992
|
+
// ===== Trading Console Types =====
|
|
993
|
+
export * from './console';
|
package/dist/price-CgqXPnT3.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { TokenPrice } from './types/index.js';
|
|
2
|
-
|
|
3
|
-
declare class PriceService {
|
|
4
|
-
private cache;
|
|
5
|
-
private cacheTTL;
|
|
6
|
-
getPrice(symbol: string): Promise<TokenPrice>;
|
|
7
|
-
getPrices(symbols: string[]): Promise<Record<string, TokenPrice>>;
|
|
8
|
-
private getFallbackPrice;
|
|
9
|
-
clearCache(): void;
|
|
10
|
-
}
|
|
11
|
-
declare const priceService: PriceService;
|
|
12
|
-
|
|
13
|
-
export { PriceService as P, priceService as p };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { TokenPrice } from './types/index.mjs';
|
|
2
|
-
|
|
3
|
-
declare class PriceService {
|
|
4
|
-
private cache;
|
|
5
|
-
private cacheTTL;
|
|
6
|
-
getPrice(symbol: string): Promise<TokenPrice>;
|
|
7
|
-
getPrices(symbols: string[]): Promise<Record<string, TokenPrice>>;
|
|
8
|
-
private getFallbackPrice;
|
|
9
|
-
clearCache(): void;
|
|
10
|
-
}
|
|
11
|
-
declare const priceService: PriceService;
|
|
12
|
-
|
|
13
|
-
export { PriceService as P, priceService as p };
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import * as _supabase_supabase_js from '@supabase/supabase-js';
|
|
2
|
-
import { SupabaseClient } from '@supabase/supabase-js';
|
|
3
|
-
|
|
4
|
-
declare function createSupabaseClient(url?: string, anonKey?: string): SupabaseClient;
|
|
5
|
-
declare function getSupabaseClient(): SupabaseClient;
|
|
6
|
-
declare class SupabaseService {
|
|
7
|
-
private client;
|
|
8
|
-
constructor(client?: SupabaseClient);
|
|
9
|
-
signInWithEmail(email: string): Promise<{
|
|
10
|
-
data: {
|
|
11
|
-
user: null;
|
|
12
|
-
session: null;
|
|
13
|
-
messageId?: string | null;
|
|
14
|
-
} | {
|
|
15
|
-
user: null;
|
|
16
|
-
session: null;
|
|
17
|
-
messageId?: null | undefined;
|
|
18
|
-
};
|
|
19
|
-
error: _supabase_supabase_js.AuthError | null;
|
|
20
|
-
}>;
|
|
21
|
-
verifyOtp(email: string, token: string): Promise<{
|
|
22
|
-
data: {
|
|
23
|
-
user: _supabase_supabase_js.AuthUser | null;
|
|
24
|
-
session: _supabase_supabase_js.AuthSession | null;
|
|
25
|
-
} | {
|
|
26
|
-
user: null;
|
|
27
|
-
session: null;
|
|
28
|
-
};
|
|
29
|
-
error: _supabase_supabase_js.AuthError | null;
|
|
30
|
-
}>;
|
|
31
|
-
signOut(): Promise<{
|
|
32
|
-
error: _supabase_supabase_js.AuthError | null;
|
|
33
|
-
}>;
|
|
34
|
-
getSession(): Promise<{
|
|
35
|
-
session: _supabase_supabase_js.AuthSession | null;
|
|
36
|
-
error: _supabase_supabase_js.AuthError | null;
|
|
37
|
-
}>;
|
|
38
|
-
getUser(): Promise<{
|
|
39
|
-
user: _supabase_supabase_js.AuthUser | null;
|
|
40
|
-
error: _supabase_supabase_js.AuthError | null;
|
|
41
|
-
}>;
|
|
42
|
-
getUserProfile(userId: string): Promise<{
|
|
43
|
-
data: any;
|
|
44
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
45
|
-
}>;
|
|
46
|
-
updateUserProfile(userId: string, updates: Record<string, any>): Promise<{
|
|
47
|
-
data: any;
|
|
48
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
49
|
-
}>;
|
|
50
|
-
getTransactions(userId: string, limit?: number): Promise<{
|
|
51
|
-
data: any[] | null;
|
|
52
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
53
|
-
}>;
|
|
54
|
-
createTransaction(transaction: Record<string, any>): Promise<{
|
|
55
|
-
data: any;
|
|
56
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
57
|
-
}>;
|
|
58
|
-
getStrategies(status?: string): Promise<{
|
|
59
|
-
data: any[] | null;
|
|
60
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
61
|
-
}>;
|
|
62
|
-
getStrategyById(strategyId: string): Promise<{
|
|
63
|
-
data: any;
|
|
64
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
65
|
-
}>;
|
|
66
|
-
getUserOrders(userId: string): Promise<{
|
|
67
|
-
data: any[] | null;
|
|
68
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
69
|
-
}>;
|
|
70
|
-
createOrder(order: Record<string, any>): Promise<{
|
|
71
|
-
data: any;
|
|
72
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
73
|
-
}>;
|
|
74
|
-
getUserCards(userId: string): Promise<{
|
|
75
|
-
data: any[] | null;
|
|
76
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
77
|
-
}>;
|
|
78
|
-
subscribeToTransactions(userId: string, callback: (payload: any) => void): _supabase_supabase_js.RealtimeChannel;
|
|
79
|
-
unsubscribe(channel: ReturnType<typeof this$1.client.channel>): Promise<"error" | "ok" | "timed out">;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export { SupabaseService as S, createSupabaseClient as c, getSupabaseClient as g };
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import * as _supabase_supabase_js from '@supabase/supabase-js';
|
|
2
|
-
import { SupabaseClient } from '@supabase/supabase-js';
|
|
3
|
-
|
|
4
|
-
declare function createSupabaseClient(url?: string, anonKey?: string): SupabaseClient;
|
|
5
|
-
declare function getSupabaseClient(): SupabaseClient;
|
|
6
|
-
declare class SupabaseService {
|
|
7
|
-
private client;
|
|
8
|
-
constructor(client?: SupabaseClient);
|
|
9
|
-
signInWithEmail(email: string): Promise<{
|
|
10
|
-
data: {
|
|
11
|
-
user: null;
|
|
12
|
-
session: null;
|
|
13
|
-
messageId?: string | null;
|
|
14
|
-
} | {
|
|
15
|
-
user: null;
|
|
16
|
-
session: null;
|
|
17
|
-
messageId?: null | undefined;
|
|
18
|
-
};
|
|
19
|
-
error: _supabase_supabase_js.AuthError | null;
|
|
20
|
-
}>;
|
|
21
|
-
verifyOtp(email: string, token: string): Promise<{
|
|
22
|
-
data: {
|
|
23
|
-
user: _supabase_supabase_js.AuthUser | null;
|
|
24
|
-
session: _supabase_supabase_js.AuthSession | null;
|
|
25
|
-
} | {
|
|
26
|
-
user: null;
|
|
27
|
-
session: null;
|
|
28
|
-
};
|
|
29
|
-
error: _supabase_supabase_js.AuthError | null;
|
|
30
|
-
}>;
|
|
31
|
-
signOut(): Promise<{
|
|
32
|
-
error: _supabase_supabase_js.AuthError | null;
|
|
33
|
-
}>;
|
|
34
|
-
getSession(): Promise<{
|
|
35
|
-
session: _supabase_supabase_js.AuthSession | null;
|
|
36
|
-
error: _supabase_supabase_js.AuthError | null;
|
|
37
|
-
}>;
|
|
38
|
-
getUser(): Promise<{
|
|
39
|
-
user: _supabase_supabase_js.AuthUser | null;
|
|
40
|
-
error: _supabase_supabase_js.AuthError | null;
|
|
41
|
-
}>;
|
|
42
|
-
getUserProfile(userId: string): Promise<{
|
|
43
|
-
data: any;
|
|
44
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
45
|
-
}>;
|
|
46
|
-
updateUserProfile(userId: string, updates: Record<string, any>): Promise<{
|
|
47
|
-
data: any;
|
|
48
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
49
|
-
}>;
|
|
50
|
-
getTransactions(userId: string, limit?: number): Promise<{
|
|
51
|
-
data: any[] | null;
|
|
52
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
53
|
-
}>;
|
|
54
|
-
createTransaction(transaction: Record<string, any>): Promise<{
|
|
55
|
-
data: any;
|
|
56
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
57
|
-
}>;
|
|
58
|
-
getStrategies(status?: string): Promise<{
|
|
59
|
-
data: any[] | null;
|
|
60
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
61
|
-
}>;
|
|
62
|
-
getStrategyById(strategyId: string): Promise<{
|
|
63
|
-
data: any;
|
|
64
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
65
|
-
}>;
|
|
66
|
-
getUserOrders(userId: string): Promise<{
|
|
67
|
-
data: any[] | null;
|
|
68
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
69
|
-
}>;
|
|
70
|
-
createOrder(order: Record<string, any>): Promise<{
|
|
71
|
-
data: any;
|
|
72
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
73
|
-
}>;
|
|
74
|
-
getUserCards(userId: string): Promise<{
|
|
75
|
-
data: any[] | null;
|
|
76
|
-
error: _supabase_supabase_js.PostgrestError | null;
|
|
77
|
-
}>;
|
|
78
|
-
subscribeToTransactions(userId: string, callback: (payload: any) => void): _supabase_supabase_js.RealtimeChannel;
|
|
79
|
-
unsubscribe(channel: ReturnType<typeof this$1.client.channel>): Promise<"error" | "ok" | "timed out">;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export { SupabaseService as S, createSupabaseClient as c, getSupabaseClient as g };
|