@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.
Files changed (106) hide show
  1. package/README.md +339 -0
  2. package/dist/ForexPoolDataGenerator--__twRwl.d.mts +76 -0
  3. package/dist/ForexPoolDataGenerator-eUgwsU_B.d.ts +76 -0
  4. package/dist/OneForexTradeHistory-TlKxjbFF.d.ts +250 -0
  5. package/dist/OneForexTradeHistory-iDySMcw0.d.mts +250 -0
  6. package/dist/components/index.d.mts +539 -0
  7. package/dist/components/index.d.ts +539 -0
  8. package/dist/components/index.js +7295 -0
  9. package/dist/components/index.js.map +1 -0
  10. package/dist/components/index.mjs +7243 -0
  11. package/dist/components/index.mjs.map +1 -0
  12. package/dist/config/index.d.mts +1 -0
  13. package/dist/config/index.d.ts +1 -0
  14. package/dist/console-BfTMA7ah.d.mts +504 -0
  15. package/dist/console-BfTMA7ah.d.ts +504 -0
  16. package/dist/hooks/index.d.mts +323 -1
  17. package/dist/hooks/index.d.ts +323 -1
  18. package/dist/hooks/index.js +3223 -0
  19. package/dist/hooks/index.js.map +1 -1
  20. package/dist/hooks/index.mjs +3204 -1
  21. package/dist/hooks/index.mjs.map +1 -1
  22. package/dist/index.d.mts +18 -352
  23. package/dist/index.d.ts +18 -352
  24. package/dist/index.js +8646 -574
  25. package/dist/index.js.map +1 -1
  26. package/dist/index.mjs +8449 -432
  27. package/dist/index.mjs.map +1 -1
  28. package/dist/providers/index.d.mts +31 -31
  29. package/dist/providers/index.d.ts +31 -31
  30. package/dist/providers/index.js +140 -153
  31. package/dist/providers/index.js.map +1 -1
  32. package/dist/providers/index.mjs +100 -109
  33. package/dist/providers/index.mjs.map +1 -1
  34. package/dist/react-native.d.mts +8 -144
  35. package/dist/react-native.d.ts +8 -144
  36. package/dist/react-native.js +2640 -689
  37. package/dist/react-native.js.map +1 -1
  38. package/dist/react-native.mjs +2610 -691
  39. package/dist/react-native.mjs.map +1 -1
  40. package/dist/services/index.d.mts +85 -4
  41. package/dist/services/index.d.ts +85 -4
  42. package/dist/services/index.js +1621 -0
  43. package/dist/services/index.js.map +1 -1
  44. package/dist/services/index.mjs +1619 -1
  45. package/dist/services/index.mjs.map +1 -1
  46. package/dist/types/index.d.mts +203 -1
  47. package/dist/types/index.d.ts +203 -1
  48. package/dist/types/index.js +275 -0
  49. package/dist/types/index.js.map +1 -1
  50. package/dist/types/index.mjs +251 -0
  51. package/dist/types/index.mjs.map +1 -1
  52. package/dist/useForexTrading-BleeSor8.d.mts +80 -0
  53. package/dist/useForexTrading-ZgW_G40Q.d.ts +80 -0
  54. package/package.json +9 -2
  55. package/src/components/OneConnectButton.tsx +24 -1
  56. package/src/components/OneNFTGallery.tsx +13 -7
  57. package/src/components/OneOfframpWidget.tsx +4 -3
  58. package/src/components/OnePayWidget.tsx +10 -1
  59. package/src/components/OneSendWidget.tsx +3 -3
  60. package/src/components/OneSwapWidget.tsx +4 -4
  61. package/src/components/OneTransactionButton.tsx +28 -3
  62. package/src/components/OneWalletBalance.tsx +1 -1
  63. package/src/components/ai/OneChainSelector.tsx +63 -336
  64. package/src/components/ai/OneForexCapitalSplit.tsx +112 -0
  65. package/src/components/ai/OneForexConsoleView.tsx +90 -0
  66. package/src/components/ai/OneForexPairSelector.tsx +101 -0
  67. package/src/components/ai/OneForexPoolCard.tsx +105 -0
  68. package/src/components/ai/OneForexTradeHistory.tsx +107 -0
  69. package/src/components/ai/OnePairSelector.tsx +77 -434
  70. package/src/components/ai/console/OneAIQuantConsole.tsx +423 -0
  71. package/src/components/ai/console/OneAgentCard.tsx +383 -0
  72. package/src/components/ai/console/OneAgentConsole.tsx +469 -0
  73. package/src/components/ai/console/OneDecisionTimeline.tsx +433 -0
  74. package/src/components/ai/console/OneMetricsDashboard.tsx +493 -0
  75. package/src/components/ai/console/OnePositionCard.tsx +406 -0
  76. package/src/components/ai/console/OnePositionDetail.tsx +600 -0
  77. package/src/components/ai/console/OneRiskIndicator.tsx +464 -0
  78. package/src/components/ai/console/OneTradingConsole.tsx +660 -0
  79. package/src/components/ai/console/index.ts +17 -0
  80. package/src/components/ai/index.ts +10 -0
  81. package/src/hooks/index.ts +46 -0
  82. package/src/hooks/useAIDecisions.ts +280 -0
  83. package/src/hooks/useAIPositions.ts +349 -0
  84. package/src/hooks/useAIQuantConsole.ts +283 -0
  85. package/src/hooks/useAIRiskStatus.ts +276 -0
  86. package/src/hooks/useAITrading.ts +190 -0
  87. package/src/hooks/useBotSimulation.ts +201 -0
  88. package/src/hooks/useForexTrading.ts +430 -0
  89. package/src/hooks/useTradingConsole.ts +243 -0
  90. package/src/index.ts +123 -5
  91. package/src/providers/OneProvider.tsx +181 -5
  92. package/src/providers/index.ts +22 -8
  93. package/src/react-native.ts +41 -0
  94. package/src/services/forex/BotSimulationEngine.ts +968 -0
  95. package/src/services/forex/ForexPoolDataGenerator.ts +542 -0
  96. package/src/services/forex/ForexSimulationEngine.ts +482 -0
  97. package/src/services/forex/index.ts +21 -0
  98. package/src/services/index.ts +16 -0
  99. package/src/types/aiTrading.ts +151 -0
  100. package/src/types/console.ts +380 -0
  101. package/src/types/forex.ts +282 -0
  102. package/src/types/index.ts +106 -0
  103. package/dist/price-CgqXPnT3.d.ts +0 -13
  104. package/dist/price-ClbLHHjv.d.mts +0 -13
  105. package/dist/supabase-BT0c7q9e.d.mts +0 -82
  106. package/dist/supabase-BT0c7q9e.d.ts +0 -82
@@ -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';
@@ -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 };