@microcosmmoney/portal-react 3.13.0 → 3.13.2
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/index.d.ts +13 -0
- package/dist/index.js +27 -1
- package/dist/main-portal/components/dashboard/EcosystemStatsCard.d.ts +1 -0
- package/dist/main-portal/components/dashboard/EcosystemStatsCard.js +37 -0
- package/dist/main-portal/components/dashboard/LockPeriodsCard.d.ts +1 -0
- package/dist/main-portal/components/dashboard/LockPeriodsCard.js +16 -0
- package/dist/main-portal/components/dashboard/MCCPriceChart.d.ts +1 -0
- package/dist/main-portal/components/dashboard/MCCPriceChart.js +74 -0
- package/dist/main-portal/components/dashboard/MCCTokenStatsCard.d.ts +1 -0
- package/dist/main-portal/components/dashboard/MCCTokenStatsCard.js +39 -0
- package/dist/main-portal/components/dashboard/MCDStatsCard.d.ts +1 -0
- package/dist/main-portal/components/dashboard/MCDStatsCard.js +39 -0
- package/dist/main-portal/components/dashboard/MarketOverviewBar.d.ts +1 -0
- package/dist/main-portal/components/dashboard/MarketOverviewBar.js +141 -0
- package/dist/main-portal/components/dashboard/MiningWeightCard.d.ts +1 -0
- package/dist/main-portal/components/dashboard/MiningWeightCard.js +56 -0
- package/dist/main-portal/components/dashboard/MintingStatsCard.d.ts +1 -0
- package/dist/main-portal/components/dashboard/MintingStatsCard.js +29 -0
- package/dist/main-portal/components/dashboard/MyAssetsSummary.d.ts +1 -0
- package/dist/main-portal/components/dashboard/MyAssetsSummary.js +69 -0
- package/dist/main-portal/components/dashboard/MyMiningCard.d.ts +1 -0
- package/dist/main-portal/components/dashboard/MyMiningCard.js +46 -0
- package/dist/main-portal/components/dashboard/QuickActions.d.ts +1 -0
- package/dist/main-portal/components/dashboard/QuickActions.js +49 -0
- package/dist/main-portal/components/dashboard/UserDashboardPage.d.ts +1 -0
- package/dist/main-portal/components/dashboard/UserDashboardPage.js +36 -0
- package/dist/main-portal/components/mainnet/wave-text.d.ts +8 -0
- package/dist/main-portal/components/mainnet/wave-text.js +50 -0
- package/dist/main-portal/components/mining/MiningModal.js +1 -1
- package/dist/main-portal/components/providers/SolanaWalletProvider.js +1 -1
- package/dist/main-portal/components/resources/public-mining-modal.js +1 -1
- package/dist/main-portal/hooks/useAuth.js +3 -2
- package/dist/main-portal/lib/api/index.d.ts +2 -9
- package/dist/main-portal/lib/api/index.js +17 -210
- package/package.json +1 -1
- package/dist/main-portal/lib/analytics/hooks.d.ts +0 -139
- package/dist/main-portal/lib/analytics/hooks.js +0 -277
- package/dist/main-portal/lib/analytics/index.d.ts +0 -2
- package/dist/main-portal/lib/analytics/index.js +0 -19
- package/dist/main-portal/lib/analytics/types.d.ts +0 -611
- package/dist/main-portal/lib/analytics/types.js +0 -2
- package/dist/main-portal/lib/api/account.d.ts +0 -39
- package/dist/main-portal/lib/api/account.js +0 -86
- package/dist/main-portal/lib/api/admin.d.ts +0 -78
- package/dist/main-portal/lib/api/admin.js +0 -195
- package/dist/main-portal/lib/api/analytics.d.ts +0 -217
- package/dist/main-portal/lib/api/analytics.js +0 -55
- package/dist/main-portal/lib/api/mcc-holders.d.ts +0 -130
- package/dist/main-portal/lib/api/mcc-holders.js +0 -47
- package/dist/main-portal/lib/api/org-service-proxy.d.ts +0 -7
- package/dist/main-portal/lib/api/org-service-proxy.js +0 -55
- package/dist/main-portal/lib/api/strategies.d.ts +0 -101
- package/dist/main-portal/lib/api/strategies.js +0 -87
- package/dist/main-portal/lib/exchanges/config.d.ts +0 -34
- package/dist/main-portal/lib/exchanges/config.js +0 -185
- package/dist/main-portal/lib/exchanges/hooks/index.d.ts +0 -5
- package/dist/main-portal/lib/exchanges/hooks/index.js +0 -10
- package/dist/main-portal/lib/exchanges/hooks/useBinanceData.d.ts +0 -15
- package/dist/main-portal/lib/exchanges/hooks/useBinanceData.js +0 -216
- package/dist/main-portal/lib/exchanges/hooks/useBinanceDialogs.d.ts +0 -32
- package/dist/main-portal/lib/exchanges/hooks/useBinanceDialogs.js +0 -395
- package/dist/main-portal/lib/exchanges/hooks/useUserExchanges.d.ts +0 -15
- package/dist/main-portal/lib/exchanges/hooks/useUserExchanges.js +0 -51
- package/dist/main-portal/lib/exchanges/index.d.ts +0 -4
- package/dist/main-portal/lib/exchanges/index.js +0 -21
- package/dist/main-portal/lib/exchanges/types.d.ts +0 -102
- package/dist/main-portal/lib/exchanges/types.js +0 -2
- package/dist/main-portal/lib/exchanges/utils.d.ts +0 -1
- package/dist/main-portal/lib/exchanges/utils.js +0 -10
- package/dist/main-portal/lib/gcp-secrets.d.ts +0 -7
- package/dist/main-portal/lib/gcp-secrets.js +0 -45
- package/dist/main-portal/lib/mockWallet.d.ts +0 -130
- package/dist/main-portal/lib/mockWallet.js +0 -284
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
export interface MCCHolder {
|
|
2
|
-
id: number;
|
|
3
|
-
wallet_address: string;
|
|
4
|
-
token_account: string;
|
|
5
|
-
mcc_balance: number;
|
|
6
|
-
sol_balance: number;
|
|
7
|
-
usdt_balance: number;
|
|
8
|
-
usdc_balance: number;
|
|
9
|
-
first_seen_at: string | null;
|
|
10
|
-
first_tx_signature: string | null;
|
|
11
|
-
first_tx_time: string | null;
|
|
12
|
-
last_tx_time: string | null;
|
|
13
|
-
tx_count: number;
|
|
14
|
-
buy_count: number;
|
|
15
|
-
sell_count: number;
|
|
16
|
-
total_bought: number;
|
|
17
|
-
total_sold: number;
|
|
18
|
-
holder_type: 'individual' | 'whale' | 'bot' | 'exchange' | 'team' | 'unknown';
|
|
19
|
-
holder_label: string | null;
|
|
20
|
-
is_excluded: boolean;
|
|
21
|
-
exclude_reason: string | null;
|
|
22
|
-
notes: string | null;
|
|
23
|
-
balance_updated_at: string | null;
|
|
24
|
-
created_at: string;
|
|
25
|
-
updated_at: string;
|
|
26
|
-
}
|
|
27
|
-
export interface HolderListParams {
|
|
28
|
-
page?: number;
|
|
29
|
-
page_size?: number;
|
|
30
|
-
sort_by?: string;
|
|
31
|
-
sort_order?: 'asc' | 'desc';
|
|
32
|
-
holder_type?: string;
|
|
33
|
-
min_balance?: number;
|
|
34
|
-
}
|
|
35
|
-
export interface HolderStats {
|
|
36
|
-
total_holders: number;
|
|
37
|
-
total_mcc_held: number;
|
|
38
|
-
holder_type_distribution: {
|
|
39
|
-
individual: number;
|
|
40
|
-
whale: number;
|
|
41
|
-
bot: number;
|
|
42
|
-
unknown: number;
|
|
43
|
-
};
|
|
44
|
-
new_today: number;
|
|
45
|
-
last_sync_at: string | null;
|
|
46
|
-
}
|
|
47
|
-
export interface HolderTransaction {
|
|
48
|
-
signature: string;
|
|
49
|
-
block_time: string | null;
|
|
50
|
-
slot: number;
|
|
51
|
-
err: boolean;
|
|
52
|
-
memo: string | null;
|
|
53
|
-
}
|
|
54
|
-
export interface PoolTrader {
|
|
55
|
-
wallet_address: string;
|
|
56
|
-
address_type: 'system' | 'platform' | 'external';
|
|
57
|
-
address_label: string | null;
|
|
58
|
-
buy_count: number;
|
|
59
|
-
sell_count: number;
|
|
60
|
-
trade_count: number;
|
|
61
|
-
total_mcc_bought: number;
|
|
62
|
-
total_mcc_sold: number;
|
|
63
|
-
total_usdc_spent: number;
|
|
64
|
-
total_usdc_received: number;
|
|
65
|
-
net_mcc: number;
|
|
66
|
-
net_usdc: number;
|
|
67
|
-
estimated_profit_usdc: number;
|
|
68
|
-
first_trade_time: string | null;
|
|
69
|
-
last_trade_time: string | null;
|
|
70
|
-
trades: PoolTrade[];
|
|
71
|
-
}
|
|
72
|
-
export interface PoolTrade {
|
|
73
|
-
type: 'buy' | 'sell';
|
|
74
|
-
mcc_amount: number;
|
|
75
|
-
usdc_amount: number;
|
|
76
|
-
price: number;
|
|
77
|
-
tx_signature: string;
|
|
78
|
-
time: string | null;
|
|
79
|
-
}
|
|
80
|
-
export interface AddressSearchResult {
|
|
81
|
-
wallet_address: string;
|
|
82
|
-
period: string;
|
|
83
|
-
db_info: MCCHolder | null;
|
|
84
|
-
address_classification: {
|
|
85
|
-
type: 'system' | 'platform' | 'external';
|
|
86
|
-
category: string;
|
|
87
|
-
label: string | null;
|
|
88
|
-
} | null;
|
|
89
|
-
chain_trades: PoolTrade[];
|
|
90
|
-
summary: {
|
|
91
|
-
buy_count: number;
|
|
92
|
-
sell_count: number;
|
|
93
|
-
total_mcc_bought: number;
|
|
94
|
-
total_mcc_sold: number;
|
|
95
|
-
total_usdc_spent: number;
|
|
96
|
-
total_usdc_received: number;
|
|
97
|
-
net_mcc: number;
|
|
98
|
-
net_usdc: number;
|
|
99
|
-
estimated_profit_usdc: number;
|
|
100
|
-
};
|
|
101
|
-
current_balances: {
|
|
102
|
-
sol_balance: number;
|
|
103
|
-
usdt_balance: number;
|
|
104
|
-
usdc_balance: number;
|
|
105
|
-
} | null;
|
|
106
|
-
}
|
|
107
|
-
export interface SystemAddress {
|
|
108
|
-
id: number;
|
|
109
|
-
wallet_address: string;
|
|
110
|
-
category: string;
|
|
111
|
-
label: string;
|
|
112
|
-
owner_uid: string | null;
|
|
113
|
-
owner_name: string | null;
|
|
114
|
-
notes: string | null;
|
|
115
|
-
created_at: string;
|
|
116
|
-
updated_at: string;
|
|
117
|
-
}
|
|
118
|
-
export declare const getMCCHolders: (params?: HolderListParams) => Promise<any>;
|
|
119
|
-
export declare const getMCCHolderStats: () => Promise<any>;
|
|
120
|
-
export declare const getMCCHolderTransactions: (wallet: string, limit?: number) => Promise<any>;
|
|
121
|
-
export declare const labelMCCHolder: (wallet: string, data: {
|
|
122
|
-
holder_type?: string;
|
|
123
|
-
holder_label?: string;
|
|
124
|
-
notes?: string;
|
|
125
|
-
}) => Promise<any>;
|
|
126
|
-
export declare const syncMCCHolders: () => Promise<any>;
|
|
127
|
-
export declare const getPoolTraders: (period?: string) => Promise<any>;
|
|
128
|
-
export declare const refreshPoolTraders: (period?: string) => Promise<any>;
|
|
129
|
-
export declare const searchAddress: (address: string, period?: string) => Promise<any>;
|
|
130
|
-
export declare const getSystemAddresses: (category?: string) => Promise<any>;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSystemAddresses = exports.searchAddress = exports.refreshPoolTraders = exports.getPoolTraders = exports.syncMCCHolders = exports.labelMCCHolder = exports.getMCCHolderTransactions = exports.getMCCHolderStats = exports.getMCCHolders = void 0;
|
|
4
|
-
// AI-generated · AI-managed · AI-maintained
|
|
5
|
-
const core_1 = require("./core");
|
|
6
|
-
// === API 调用 ===
|
|
7
|
-
const getMCCHolders = (params) => {
|
|
8
|
-
const query = new URLSearchParams();
|
|
9
|
-
if (params?.page)
|
|
10
|
-
query.append('page', params.page.toString());
|
|
11
|
-
if (params?.page_size)
|
|
12
|
-
query.append('page_size', params.page_size.toString());
|
|
13
|
-
if (params?.sort_by)
|
|
14
|
-
query.append('sort_by', params.sort_by);
|
|
15
|
-
if (params?.sort_order)
|
|
16
|
-
query.append('sort_order', params.sort_order);
|
|
17
|
-
if (params?.holder_type)
|
|
18
|
-
query.append('holder_type', params.holder_type);
|
|
19
|
-
if (params?.min_balance !== undefined)
|
|
20
|
-
query.append('min_balance', params.min_balance.toString());
|
|
21
|
-
const qs = query.toString();
|
|
22
|
-
return (0, core_1.fetchApi)(`/blockchain/mcc/holders${qs ? '?' + qs : ''}`);
|
|
23
|
-
};
|
|
24
|
-
exports.getMCCHolders = getMCCHolders;
|
|
25
|
-
const getMCCHolderStats = () => (0, core_1.fetchApi)('/blockchain/mcc/holders/stats');
|
|
26
|
-
exports.getMCCHolderStats = getMCCHolderStats;
|
|
27
|
-
const getMCCHolderTransactions = (wallet, limit = 50) => (0, core_1.fetchApi)(`/blockchain/mcc/holders/${wallet}/transactions?limit=${limit}`);
|
|
28
|
-
exports.getMCCHolderTransactions = getMCCHolderTransactions;
|
|
29
|
-
const labelMCCHolder = (wallet, data) => (0, core_1.fetchApi)(`/blockchain/mcc/holders/${wallet}/label`, {
|
|
30
|
-
method: 'POST',
|
|
31
|
-
body: JSON.stringify(data)
|
|
32
|
-
});
|
|
33
|
-
exports.labelMCCHolder = labelMCCHolder;
|
|
34
|
-
const syncMCCHolders = () => (0, core_1.fetchApi)('/blockchain/mcc/holders/sync', { method: 'POST' });
|
|
35
|
-
exports.syncMCCHolders = syncMCCHolders;
|
|
36
|
-
// === 新增 API ===
|
|
37
|
-
const getPoolTraders = (period = '7d') => (0, core_1.fetchApi)(`/blockchain/mcc/holders/traders?period=${period}`);
|
|
38
|
-
exports.getPoolTraders = getPoolTraders;
|
|
39
|
-
const refreshPoolTraders = (period = '7d') => (0, core_1.fetchApi)(`/blockchain/mcc/holders/traders/refresh?period=${period}`, { method: 'POST' });
|
|
40
|
-
exports.refreshPoolTraders = refreshPoolTraders;
|
|
41
|
-
const searchAddress = (address, period = '24h') => (0, core_1.fetchApi)(`/blockchain/mcc/holders/search?address=${encodeURIComponent(address)}&period=${period}`);
|
|
42
|
-
exports.searchAddress = searchAddress;
|
|
43
|
-
const getSystemAddresses = (category) => {
|
|
44
|
-
const params = category ? `?category=${category}` : '';
|
|
45
|
-
return (0, core_1.fetchApi)(`/blockchain/mcc/holders/system-addresses${params}`);
|
|
46
|
-
};
|
|
47
|
-
exports.getSystemAddresses = getSystemAddresses;
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.proxyToOrgService = proxyToOrgService;
|
|
4
|
-
// AI-generated · AI-managed · AI-maintained
|
|
5
|
-
async function proxyToOrgService(endpoint, options = {}) {
|
|
6
|
-
const baseUrl = process.env.ORGANIZATION_SERVICE_URL || 'http://organization-service.microcosm.svc.cluster.local';
|
|
7
|
-
const internalSecret = process.env.MICROCOSM_INTERNAL_SECRET || '';
|
|
8
|
-
let uid = options.xUserUid || null;
|
|
9
|
-
if (!uid && options.authHeader) {
|
|
10
|
-
try {
|
|
11
|
-
const token = options.authHeader.replace('Bearer ', '');
|
|
12
|
-
const response = await fetch(`${baseUrl}/auth/verify-firebase-token`, {
|
|
13
|
-
method: 'POST',
|
|
14
|
-
headers: {
|
|
15
|
-
'Content-Type': 'application/json',
|
|
16
|
-
'X-Microcosm-Internal-Secret': internalSecret,
|
|
17
|
-
},
|
|
18
|
-
body: JSON.stringify({ token })
|
|
19
|
-
});
|
|
20
|
-
if (response.ok) {
|
|
21
|
-
const data = await response.json();
|
|
22
|
-
uid = data.uid;
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
catch (error) {
|
|
26
|
-
console.error('Firebase token verification failed:', error);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
if (!uid) {
|
|
30
|
-
throw new Error('无法获取用户标识');
|
|
31
|
-
}
|
|
32
|
-
let url = `${baseUrl}${endpoint}`;
|
|
33
|
-
if (options.query) {
|
|
34
|
-
const params = new URLSearchParams(options.query);
|
|
35
|
-
url += `?${params.toString()}`;
|
|
36
|
-
}
|
|
37
|
-
const fetchOptions = {
|
|
38
|
-
method: options.method || 'GET',
|
|
39
|
-
headers: {
|
|
40
|
-
'Content-Type': 'application/json',
|
|
41
|
-
'X-User-UID': uid,
|
|
42
|
-
'X-Microcosm-Internal-Secret': internalSecret,
|
|
43
|
-
},
|
|
44
|
-
cache: 'no-store',
|
|
45
|
-
};
|
|
46
|
-
if (options.body && (options.method === 'POST' || options.method === 'PUT')) {
|
|
47
|
-
fetchOptions.body = JSON.stringify(options.body);
|
|
48
|
-
}
|
|
49
|
-
const response = await fetch(url, fetchOptions);
|
|
50
|
-
if (!response.ok) {
|
|
51
|
-
const errorText = await response.text();
|
|
52
|
-
throw new Error(`Organization service returned ${response.status}: ${errorText}`);
|
|
53
|
-
}
|
|
54
|
-
return response.json();
|
|
55
|
-
}
|
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
export declare const getStrategies: () => Promise<any>;
|
|
2
|
-
export declare const getStrategyDetails: (strategyId: string) => Promise<any>;
|
|
3
|
-
export declare const startStrategy: (strategyId: string) => Promise<any>;
|
|
4
|
-
export declare const stopStrategy: (strategyId: string) => Promise<any>;
|
|
5
|
-
export declare const createStrategy: (strategyParams: Record<string, unknown>) => Promise<any>;
|
|
6
|
-
export declare const deleteStrategy: (strategyId: string) => Promise<any>;
|
|
7
|
-
export declare const updateStrategy: (strategyId: string, params: Record<string, unknown>) => Promise<any>;
|
|
8
|
-
export declare const getEnergyOrders: (strategyId: string, includeHistory?: boolean) => Promise<any>;
|
|
9
|
-
export declare const getEnergyHistory: (strategyId: string, page?: number, pageSize?: number) => Promise<any>;
|
|
10
|
-
export declare const batchPreviewStrategies: (filters: {
|
|
11
|
-
symbol?: string;
|
|
12
|
-
status?: "active" | "inactive";
|
|
13
|
-
}) => Promise<any>;
|
|
14
|
-
export declare const batchUpdateStrategies: (strategyIds: string[], paramPath: string, paramValue: unknown, filters?: Record<string, unknown>) => Promise<any>;
|
|
15
|
-
export declare const getBatchHistory: (limit?: number) => Promise<any>;
|
|
16
|
-
export interface ParamTemplate {
|
|
17
|
-
id: number;
|
|
18
|
-
name: string;
|
|
19
|
-
description?: string;
|
|
20
|
-
params: Array<{
|
|
21
|
-
path: string;
|
|
22
|
-
value: unknown;
|
|
23
|
-
}>;
|
|
24
|
-
use_count: number;
|
|
25
|
-
last_used_at?: string;
|
|
26
|
-
created_by_email?: string;
|
|
27
|
-
created_at?: string;
|
|
28
|
-
updated_at?: string;
|
|
29
|
-
}
|
|
30
|
-
export declare const getTemplates: () => Promise<any>;
|
|
31
|
-
export declare const getTemplate: (templateId: number) => Promise<any>;
|
|
32
|
-
export declare const createTemplate: (data: {
|
|
33
|
-
name: string;
|
|
34
|
-
description?: string;
|
|
35
|
-
params: Array<{
|
|
36
|
-
path: string;
|
|
37
|
-
value: unknown;
|
|
38
|
-
}>;
|
|
39
|
-
}) => Promise<any>;
|
|
40
|
-
export declare const updateTemplate: (templateId: number, data: Partial<{
|
|
41
|
-
name: string;
|
|
42
|
-
description: string;
|
|
43
|
-
params: Array<{
|
|
44
|
-
path: string;
|
|
45
|
-
value: unknown;
|
|
46
|
-
}>;
|
|
47
|
-
}>) => Promise<any>;
|
|
48
|
-
export declare const deleteTemplate: (templateId: number) => Promise<any>;
|
|
49
|
-
export interface GroupCondition {
|
|
50
|
-
field: 'symbol' | 'status' | 'created_at' | 'uid';
|
|
51
|
-
operator: '=' | 'in' | 'not_in' | '>=' | '<=' | 'between';
|
|
52
|
-
value: unknown;
|
|
53
|
-
}
|
|
54
|
-
export interface GroupRules {
|
|
55
|
-
conditions: GroupCondition[];
|
|
56
|
-
logic: 'AND' | 'OR';
|
|
57
|
-
}
|
|
58
|
-
export interface StrategyGroup {
|
|
59
|
-
id: number;
|
|
60
|
-
name: string;
|
|
61
|
-
description?: string;
|
|
62
|
-
group_type: 'auto' | 'manual' | 'hybrid';
|
|
63
|
-
auto_rules?: GroupRules;
|
|
64
|
-
strategy_count: number;
|
|
65
|
-
pending_review: number;
|
|
66
|
-
created_by_email?: string;
|
|
67
|
-
created_at?: string;
|
|
68
|
-
updated_at?: string;
|
|
69
|
-
}
|
|
70
|
-
export declare const getGroups: () => Promise<any>;
|
|
71
|
-
export declare const getGroup: (groupId: number) => Promise<any>;
|
|
72
|
-
export declare const createGroup: (data: {
|
|
73
|
-
name: string;
|
|
74
|
-
description?: string;
|
|
75
|
-
group_type: string;
|
|
76
|
-
auto_rules?: GroupRules;
|
|
77
|
-
}) => Promise<any>;
|
|
78
|
-
export declare const updateGroup: (groupId: number, data: Partial<{
|
|
79
|
-
name: string;
|
|
80
|
-
description: string;
|
|
81
|
-
auto_rules: GroupRules;
|
|
82
|
-
}>) => Promise<any>;
|
|
83
|
-
export declare const deleteGroup: (groupId: number) => Promise<any>;
|
|
84
|
-
export declare const getGroupStrategies: (groupId: number, page?: number, pageSize?: number, needsReview?: boolean) => Promise<any>;
|
|
85
|
-
export declare const addStrategiesToGroup: (groupId: number, strategyIds: string[]) => Promise<any>;
|
|
86
|
-
export declare const removeStrategiesFromGroup: (groupId: number, strategyIds: string[]) => Promise<any>;
|
|
87
|
-
export declare const reviewGroupStrategies: (groupId: number, strategyIds: string[], action: "approve" | "reject") => Promise<any>;
|
|
88
|
-
export declare const refreshGroup: (groupId: number) => Promise<any>;
|
|
89
|
-
export declare const previewGroupRules: (rules: GroupRules) => Promise<any>;
|
|
90
|
-
export interface DistributeParams {
|
|
91
|
-
template_id?: number;
|
|
92
|
-
params?: Array<{
|
|
93
|
-
path: string;
|
|
94
|
-
value: unknown;
|
|
95
|
-
}>;
|
|
96
|
-
target_type: 'group' | 'manual';
|
|
97
|
-
group_id?: number;
|
|
98
|
-
strategy_ids?: string[];
|
|
99
|
-
}
|
|
100
|
-
export declare const distributeParams: (data: DistributeParams) => Promise<any>;
|
|
101
|
-
export declare const getDistributeHistory: (limit?: number) => Promise<any>;
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDistributeHistory = exports.distributeParams = exports.previewGroupRules = exports.refreshGroup = exports.reviewGroupStrategies = exports.removeStrategiesFromGroup = exports.addStrategiesToGroup = exports.getGroupStrategies = exports.deleteGroup = exports.updateGroup = exports.createGroup = exports.getGroup = exports.getGroups = exports.deleteTemplate = exports.updateTemplate = exports.createTemplate = exports.getTemplate = exports.getTemplates = exports.getBatchHistory = exports.batchUpdateStrategies = exports.batchPreviewStrategies = exports.getEnergyHistory = exports.getEnergyOrders = exports.updateStrategy = exports.deleteStrategy = exports.createStrategy = exports.stopStrategy = exports.startStrategy = exports.getStrategyDetails = exports.getStrategies = void 0;
|
|
4
|
-
// AI-generated · AI-managed · AI-maintained
|
|
5
|
-
const core_1 = require("./core");
|
|
6
|
-
const getStrategies = () => (0, core_1.fetchApi)('/strategies');
|
|
7
|
-
exports.getStrategies = getStrategies;
|
|
8
|
-
const getStrategyDetails = (strategyId) => (0, core_1.fetchApi)(`/strategies/${strategyId}`);
|
|
9
|
-
exports.getStrategyDetails = getStrategyDetails;
|
|
10
|
-
const startStrategy = (strategyId) => (0, core_1.fetchApi)(`/strategies/${strategyId}/start`, { method: 'POST' });
|
|
11
|
-
exports.startStrategy = startStrategy;
|
|
12
|
-
const stopStrategy = (strategyId) => (0, core_1.fetchApi)(`/strategies/${strategyId}/stop`, { method: 'POST' });
|
|
13
|
-
exports.stopStrategy = stopStrategy;
|
|
14
|
-
const createStrategy = (strategyParams) => (0, core_1.fetchApi)('/strategies', {
|
|
15
|
-
method: 'POST',
|
|
16
|
-
body: JSON.stringify(strategyParams)
|
|
17
|
-
});
|
|
18
|
-
exports.createStrategy = createStrategy;
|
|
19
|
-
const deleteStrategy = (strategyId) => (0, core_1.fetchApi)(`/strategies/${strategyId}`, { method: 'DELETE' });
|
|
20
|
-
exports.deleteStrategy = deleteStrategy;
|
|
21
|
-
const updateStrategy = (strategyId, params) => (0, core_1.fetchApi)(`/strategies/${strategyId}`, {
|
|
22
|
-
method: 'PUT',
|
|
23
|
-
body: JSON.stringify(params)
|
|
24
|
-
});
|
|
25
|
-
exports.updateStrategy = updateStrategy;
|
|
26
|
-
const getEnergyOrders = (strategyId, includeHistory = false) => (0, core_1.fetchApi)(`/strategies/${strategyId}/energy-orders${includeHistory ? '?include_history=true' : ''}`);
|
|
27
|
-
exports.getEnergyOrders = getEnergyOrders;
|
|
28
|
-
const getEnergyHistory = (strategyId, page = 1, pageSize = 50) => (0, core_1.fetchApi)(`/strategies/${strategyId}/energy-history?page=${page}&page_size=${pageSize}`);
|
|
29
|
-
exports.getEnergyHistory = getEnergyHistory;
|
|
30
|
-
const batchPreviewStrategies = (filters) => (0, core_1.fetchApi)('/strategies/batch/preview', {
|
|
31
|
-
method: 'POST',
|
|
32
|
-
body: JSON.stringify({ filters })
|
|
33
|
-
});
|
|
34
|
-
exports.batchPreviewStrategies = batchPreviewStrategies;
|
|
35
|
-
const batchUpdateStrategies = (strategyIds, paramPath, paramValue, filters) => (0, core_1.fetchApi)('/strategies/batch/update', {
|
|
36
|
-
method: 'POST',
|
|
37
|
-
body: JSON.stringify({
|
|
38
|
-
strategy_ids: strategyIds,
|
|
39
|
-
param_path: paramPath,
|
|
40
|
-
param_value: paramValue,
|
|
41
|
-
filters: filters || {}
|
|
42
|
-
})
|
|
43
|
-
});
|
|
44
|
-
exports.batchUpdateStrategies = batchUpdateStrategies;
|
|
45
|
-
const getBatchHistory = (limit = 20) => (0, core_1.fetchApi)(`/strategies/batch/history?limit=${limit}`);
|
|
46
|
-
exports.getBatchHistory = getBatchHistory;
|
|
47
|
-
const getTemplates = () => (0, core_1.fetchApi)('/strategies/templates');
|
|
48
|
-
exports.getTemplates = getTemplates;
|
|
49
|
-
const getTemplate = (templateId) => (0, core_1.fetchApi)(`/strategies/templates/${templateId}`);
|
|
50
|
-
exports.getTemplate = getTemplate;
|
|
51
|
-
const createTemplate = (data) => (0, core_1.fetchApi)('/strategies/templates', { method: 'POST', body: JSON.stringify(data) });
|
|
52
|
-
exports.createTemplate = createTemplate;
|
|
53
|
-
const updateTemplate = (templateId, data) => (0, core_1.fetchApi)(`/strategies/templates/${templateId}`, { method: 'PUT', body: JSON.stringify(data) });
|
|
54
|
-
exports.updateTemplate = updateTemplate;
|
|
55
|
-
const deleteTemplate = (templateId) => (0, core_1.fetchApi)(`/strategies/templates/${templateId}`, { method: 'DELETE' });
|
|
56
|
-
exports.deleteTemplate = deleteTemplate;
|
|
57
|
-
const getGroups = () => (0, core_1.fetchApi)('/strategies/groups');
|
|
58
|
-
exports.getGroups = getGroups;
|
|
59
|
-
const getGroup = (groupId) => (0, core_1.fetchApi)(`/strategies/groups/${groupId}`);
|
|
60
|
-
exports.getGroup = getGroup;
|
|
61
|
-
const createGroup = (data) => (0, core_1.fetchApi)('/strategies/groups', { method: 'POST', body: JSON.stringify(data) });
|
|
62
|
-
exports.createGroup = createGroup;
|
|
63
|
-
const updateGroup = (groupId, data) => (0, core_1.fetchApi)(`/strategies/groups/${groupId}`, { method: 'PUT', body: JSON.stringify(data) });
|
|
64
|
-
exports.updateGroup = updateGroup;
|
|
65
|
-
const deleteGroup = (groupId) => (0, core_1.fetchApi)(`/strategies/groups/${groupId}`, { method: 'DELETE' });
|
|
66
|
-
exports.deleteGroup = deleteGroup;
|
|
67
|
-
const getGroupStrategies = (groupId, page = 1, pageSize = 50, needsReview) => {
|
|
68
|
-
let url = `/strategies/groups/${groupId}/strategies?page=${page}&page_size=${pageSize}`;
|
|
69
|
-
if (needsReview !== undefined)
|
|
70
|
-
url += `&needs_review=${needsReview}`;
|
|
71
|
-
return (0, core_1.fetchApi)(url);
|
|
72
|
-
};
|
|
73
|
-
exports.getGroupStrategies = getGroupStrategies;
|
|
74
|
-
const addStrategiesToGroup = (groupId, strategyIds) => (0, core_1.fetchApi)(`/strategies/groups/${groupId}/strategies`, { method: 'POST', body: JSON.stringify({ strategy_ids: strategyIds }) });
|
|
75
|
-
exports.addStrategiesToGroup = addStrategiesToGroup;
|
|
76
|
-
const removeStrategiesFromGroup = (groupId, strategyIds) => (0, core_1.fetchApi)(`/strategies/groups/${groupId}/strategies`, { method: 'DELETE', body: JSON.stringify({ strategy_ids: strategyIds }) });
|
|
77
|
-
exports.removeStrategiesFromGroup = removeStrategiesFromGroup;
|
|
78
|
-
const reviewGroupStrategies = (groupId, strategyIds, action) => (0, core_1.fetchApi)(`/strategies/groups/${groupId}/review`, { method: 'POST', body: JSON.stringify({ strategy_ids: strategyIds, action }) });
|
|
79
|
-
exports.reviewGroupStrategies = reviewGroupStrategies;
|
|
80
|
-
const refreshGroup = (groupId) => (0, core_1.fetchApi)(`/strategies/groups/${groupId}/refresh`, { method: 'POST' });
|
|
81
|
-
exports.refreshGroup = refreshGroup;
|
|
82
|
-
const previewGroupRules = (rules) => (0, core_1.fetchApi)('/strategies/groups/preview', { method: 'POST', body: JSON.stringify({ rules }) });
|
|
83
|
-
exports.previewGroupRules = previewGroupRules;
|
|
84
|
-
const distributeParams = (data) => (0, core_1.fetchApi)('/strategies/distribute', { method: 'POST', body: JSON.stringify(data) });
|
|
85
|
-
exports.distributeParams = distributeParams;
|
|
86
|
-
const getDistributeHistory = (limit = 50) => (0, core_1.fetchApi)(`/strategies/distribute/history?limit=${limit}`);
|
|
87
|
-
exports.getDistributeHistory = getDistributeHistory;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export type ExchangeType = 'cex' | 'dex';
|
|
2
|
-
export type AuthType = 'api_key' | 'wallet';
|
|
3
|
-
export interface ExchangeConfig {
|
|
4
|
-
id: string;
|
|
5
|
-
name: string;
|
|
6
|
-
displayName: string;
|
|
7
|
-
type: ExchangeType;
|
|
8
|
-
authType: AuthType;
|
|
9
|
-
enabled: boolean;
|
|
10
|
-
priority: number;
|
|
11
|
-
authFields: {
|
|
12
|
-
apiKey?: boolean;
|
|
13
|
-
secretKey?: boolean;
|
|
14
|
-
passphrase?: boolean;
|
|
15
|
-
privateKey?: boolean;
|
|
16
|
-
walletAddress?: boolean;
|
|
17
|
-
};
|
|
18
|
-
features: {
|
|
19
|
-
spot: boolean;
|
|
20
|
-
futures: boolean;
|
|
21
|
-
margin: boolean;
|
|
22
|
-
};
|
|
23
|
-
logoUrl?: string;
|
|
24
|
-
helpUrl?: string;
|
|
25
|
-
testnetUrl?: string;
|
|
26
|
-
}
|
|
27
|
-
export declare const EXCHANGE_CONFIGS: Record<string, ExchangeConfig>;
|
|
28
|
-
export declare function getEnabledExchanges(): ExchangeConfig[];
|
|
29
|
-
export declare function getCEXExchanges(): ExchangeConfig[];
|
|
30
|
-
export declare function getDEXExchanges(): ExchangeConfig[];
|
|
31
|
-
export declare function getExchangeConfig(exchangeId: string): ExchangeConfig | undefined;
|
|
32
|
-
export declare function requiresPassphrase(exchangeId: string): boolean;
|
|
33
|
-
export declare function isDEX(exchangeId: string): boolean;
|
|
34
|
-
export declare function getAuthFields(exchangeId: string): string[];
|
|
@@ -1,185 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EXCHANGE_CONFIGS = void 0;
|
|
4
|
-
exports.getEnabledExchanges = getEnabledExchanges;
|
|
5
|
-
exports.getCEXExchanges = getCEXExchanges;
|
|
6
|
-
exports.getDEXExchanges = getDEXExchanges;
|
|
7
|
-
exports.getExchangeConfig = getExchangeConfig;
|
|
8
|
-
exports.requiresPassphrase = requiresPassphrase;
|
|
9
|
-
exports.isDEX = isDEX;
|
|
10
|
-
exports.getAuthFields = getAuthFields;
|
|
11
|
-
exports.EXCHANGE_CONFIGS = {
|
|
12
|
-
binance: {
|
|
13
|
-
id: 'binance',
|
|
14
|
-
name: 'Binance',
|
|
15
|
-
displayName: '币安',
|
|
16
|
-
type: 'cex',
|
|
17
|
-
authType: 'api_key',
|
|
18
|
-
enabled: true,
|
|
19
|
-
priority: 1,
|
|
20
|
-
authFields: {
|
|
21
|
-
apiKey: true,
|
|
22
|
-
secretKey: true,
|
|
23
|
-
},
|
|
24
|
-
features: {
|
|
25
|
-
spot: true,
|
|
26
|
-
futures: true,
|
|
27
|
-
margin: true,
|
|
28
|
-
},
|
|
29
|
-
helpUrl: 'https://www.binance.com/zh-CN/support/faq/how-to-create-api-keys-on-binance-360002502072',
|
|
30
|
-
},
|
|
31
|
-
bybit: {
|
|
32
|
-
id: 'bybit',
|
|
33
|
-
name: 'Bybit',
|
|
34
|
-
displayName: 'Bybit',
|
|
35
|
-
type: 'cex',
|
|
36
|
-
authType: 'api_key',
|
|
37
|
-
enabled: true,
|
|
38
|
-
priority: 2,
|
|
39
|
-
authFields: {
|
|
40
|
-
apiKey: true,
|
|
41
|
-
secretKey: true,
|
|
42
|
-
},
|
|
43
|
-
features: {
|
|
44
|
-
spot: true,
|
|
45
|
-
futures: true,
|
|
46
|
-
margin: false,
|
|
47
|
-
},
|
|
48
|
-
helpUrl: 'https://www.bybit.com/zh-TW/help-center/bybitHC_Article/?id=000001966',
|
|
49
|
-
},
|
|
50
|
-
okx: {
|
|
51
|
-
id: 'okx',
|
|
52
|
-
name: 'OKX',
|
|
53
|
-
displayName: 'OKX',
|
|
54
|
-
type: 'cex',
|
|
55
|
-
authType: 'api_key',
|
|
56
|
-
enabled: true,
|
|
57
|
-
priority: 3,
|
|
58
|
-
authFields: {
|
|
59
|
-
apiKey: true,
|
|
60
|
-
secretKey: true,
|
|
61
|
-
passphrase: true,
|
|
62
|
-
},
|
|
63
|
-
features: {
|
|
64
|
-
spot: true,
|
|
65
|
-
futures: true,
|
|
66
|
-
margin: true,
|
|
67
|
-
},
|
|
68
|
-
helpUrl: 'https://www.okx.com/zh-hans/help/how-do-i-create-an-api-key',
|
|
69
|
-
},
|
|
70
|
-
bitget: {
|
|
71
|
-
id: 'bitget',
|
|
72
|
-
name: 'Bitget',
|
|
73
|
-
displayName: 'Bitget',
|
|
74
|
-
type: 'cex',
|
|
75
|
-
authType: 'api_key',
|
|
76
|
-
enabled: true,
|
|
77
|
-
priority: 4,
|
|
78
|
-
authFields: {
|
|
79
|
-
apiKey: true,
|
|
80
|
-
secretKey: true,
|
|
81
|
-
passphrase: true,
|
|
82
|
-
},
|
|
83
|
-
features: {
|
|
84
|
-
spot: true,
|
|
85
|
-
futures: true,
|
|
86
|
-
margin: false,
|
|
87
|
-
},
|
|
88
|
-
helpUrl: 'https://www.bitget.com/zh-CN/academy/how-to-create-api-key',
|
|
89
|
-
},
|
|
90
|
-
hyperliquid: {
|
|
91
|
-
id: 'hyperliquid',
|
|
92
|
-
name: 'Hyperliquid',
|
|
93
|
-
displayName: 'Hyperliquid',
|
|
94
|
-
type: 'dex',
|
|
95
|
-
authType: 'wallet',
|
|
96
|
-
enabled: true,
|
|
97
|
-
priority: 5,
|
|
98
|
-
authFields: {
|
|
99
|
-
privateKey: true,
|
|
100
|
-
walletAddress: true,
|
|
101
|
-
},
|
|
102
|
-
features: {
|
|
103
|
-
spot: false,
|
|
104
|
-
futures: true,
|
|
105
|
-
margin: false,
|
|
106
|
-
},
|
|
107
|
-
helpUrl: 'https://hyperliquid.gitbook.io/hyperliquid-docs',
|
|
108
|
-
},
|
|
109
|
-
aster: {
|
|
110
|
-
id: 'aster',
|
|
111
|
-
name: 'Aster',
|
|
112
|
-
displayName: 'Aster DEX',
|
|
113
|
-
type: 'dex',
|
|
114
|
-
authType: 'wallet',
|
|
115
|
-
enabled: true,
|
|
116
|
-
priority: 6,
|
|
117
|
-
authFields: {
|
|
118
|
-
privateKey: true,
|
|
119
|
-
walletAddress: true,
|
|
120
|
-
},
|
|
121
|
-
features: {
|
|
122
|
-
spot: false,
|
|
123
|
-
futures: true,
|
|
124
|
-
margin: false,
|
|
125
|
-
},
|
|
126
|
-
},
|
|
127
|
-
lighter: {
|
|
128
|
-
id: 'lighter',
|
|
129
|
-
name: 'Lighter',
|
|
130
|
-
displayName: 'Lighter',
|
|
131
|
-
type: 'dex',
|
|
132
|
-
authType: 'wallet',
|
|
133
|
-
enabled: true,
|
|
134
|
-
priority: 7,
|
|
135
|
-
authFields: {
|
|
136
|
-
privateKey: true,
|
|
137
|
-
walletAddress: true,
|
|
138
|
-
},
|
|
139
|
-
features: {
|
|
140
|
-
spot: false,
|
|
141
|
-
futures: true,
|
|
142
|
-
margin: false,
|
|
143
|
-
},
|
|
144
|
-
helpUrl: 'https://docs.lighter.xyz/',
|
|
145
|
-
},
|
|
146
|
-
};
|
|
147
|
-
function getEnabledExchanges() {
|
|
148
|
-
return Object.values(exports.EXCHANGE_CONFIGS)
|
|
149
|
-
.filter(config => config.enabled)
|
|
150
|
-
.sort((a, b) => a.priority - b.priority);
|
|
151
|
-
}
|
|
152
|
-
function getCEXExchanges() {
|
|
153
|
-
return getEnabledExchanges().filter(config => config.type === 'cex');
|
|
154
|
-
}
|
|
155
|
-
function getDEXExchanges() {
|
|
156
|
-
return getEnabledExchanges().filter(config => config.type === 'dex');
|
|
157
|
-
}
|
|
158
|
-
function getExchangeConfig(exchangeId) {
|
|
159
|
-
return exports.EXCHANGE_CONFIGS[exchangeId.toLowerCase()];
|
|
160
|
-
}
|
|
161
|
-
function requiresPassphrase(exchangeId) {
|
|
162
|
-
const config = getExchangeConfig(exchangeId);
|
|
163
|
-
return config?.authFields.passphrase ?? false;
|
|
164
|
-
}
|
|
165
|
-
function isDEX(exchangeId) {
|
|
166
|
-
const config = getExchangeConfig(exchangeId);
|
|
167
|
-
return config?.type === 'dex';
|
|
168
|
-
}
|
|
169
|
-
function getAuthFields(exchangeId) {
|
|
170
|
-
const config = getExchangeConfig(exchangeId);
|
|
171
|
-
if (!config)
|
|
172
|
-
return [];
|
|
173
|
-
const fields = [];
|
|
174
|
-
if (config.authFields.apiKey)
|
|
175
|
-
fields.push('apiKey');
|
|
176
|
-
if (config.authFields.secretKey)
|
|
177
|
-
fields.push('secretKey');
|
|
178
|
-
if (config.authFields.passphrase)
|
|
179
|
-
fields.push('passphrase');
|
|
180
|
-
if (config.authFields.privateKey)
|
|
181
|
-
fields.push('privateKey');
|
|
182
|
-
if (config.authFields.walletAddress)
|
|
183
|
-
fields.push('walletAddress');
|
|
184
|
-
return fields;
|
|
185
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export { useBinanceData } from './useBinanceData';
|
|
2
|
-
export type { UseBinanceDataReturn } from './useBinanceData';
|
|
3
|
-
export { useBinanceDialogs } from './useBinanceDialogs';
|
|
4
|
-
export type { UseBinanceDialogsReturn, DialogType } from './useBinanceDialogs';
|
|
5
|
-
export { useUserExchanges } from './useUserExchanges';
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useUserExchanges = exports.useBinanceDialogs = exports.useBinanceData = void 0;
|
|
4
|
-
// AI-generated · AI-managed · AI-maintained
|
|
5
|
-
var useBinanceData_1 = require("./useBinanceData");
|
|
6
|
-
Object.defineProperty(exports, "useBinanceData", { enumerable: true, get: function () { return useBinanceData_1.useBinanceData; } });
|
|
7
|
-
var useBinanceDialogs_1 = require("./useBinanceDialogs");
|
|
8
|
-
Object.defineProperty(exports, "useBinanceDialogs", { enumerable: true, get: function () { return useBinanceDialogs_1.useBinanceDialogs; } });
|
|
9
|
-
var useUserExchanges_1 = require("./useUserExchanges");
|
|
10
|
-
Object.defineProperty(exports, "useUserExchanges", { enumerable: true, get: function () { return useUserExchanges_1.useUserExchanges; } });
|