gate-mcp 0.15.5 → 0.16.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 +39 -19
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/dist/tools/activity.d.ts +3 -0
- package/dist/tools/activity.d.ts.map +1 -0
- package/dist/tools/activity.js +55 -0
- package/dist/tools/activity.js.map +1 -0
- package/dist/tools/coupon.d.ts +3 -0
- package/dist/tools/coupon.d.ts.map +1 -0
- package/dist/tools/coupon.js +63 -0
- package/dist/tools/coupon.js.map +1 -0
- package/dist/tools/earn.d.ts.map +1 -1
- package/dist/tools/earn.js +147 -1
- package/dist/tools/earn.js.map +1 -1
- package/dist/tools/flash_swap.d.ts.map +1 -1
- package/dist/tools/flash_swap.js +91 -1
- package/dist/tools/flash_swap.js.map +1 -1
- package/dist/tools/futures.d.ts.map +1 -1
- package/dist/tools/futures.js +6 -11
- package/dist/tools/futures.js.map +1 -1
- package/dist/tools/launch.d.ts +3 -0
- package/dist/tools/launch.d.ts.map +1 -0
- package/dist/tools/launch.js +132 -0
- package/dist/tools/launch.js.map +1 -0
- package/dist/tools/options.d.ts.map +1 -1
- package/dist/tools/options.js +2 -3
- package/dist/tools/options.js.map +1 -1
- package/dist/tools/rebate.d.ts.map +1 -1
- package/dist/tools/rebate.js +20 -0
- package/dist/tools/rebate.js.map +1 -1
- package/dist/tools/square.d.ts +3 -0
- package/dist/tools/square.d.ts.map +1 -0
- package/dist/tools/square.js +59 -0
- package/dist/tools/square.js.map +1 -0
- package/dist/tools/trad_fi.d.ts.map +1 -1
- package/dist/tools/trad_fi.js +2 -1
- package/dist/tools/trad_fi.js.map +1 -1
- package/dist/tools/welfare.d.ts +3 -0
- package/dist/tools/welfare.d.ts.map +1 -0
- package/dist/tools/welfare.js +26 -0
- package/dist/tools/welfare.js.map +1 -0
- package/dist/utils.js +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ A local (stdio) MCP server that exposes the full [Gate](https://www.gate.com) AP
|
|
|
8
8
|
|
|
9
9
|
## Features
|
|
10
10
|
|
|
11
|
-
- **
|
|
11
|
+
- **357 tools** covering Spot, Futures, Delivery, Margin, Wallet, Account, Options, Earn, Flash Swap, Unified, Sub-Account, Multi-Collateral Loan, P2P, TradFi, CrossEx, Alpha, Rebate, Activity, Coupon, Launch, Square, and Welfare APIs
|
|
12
12
|
- **Zero config for public endpoints** — market data, tickers, order books work without any credentials
|
|
13
13
|
- **Authenticated endpoints** — trading, wallet, and account tools activate automatically when `GATE_API_KEY` + `GATE_API_SECRET` env vars are set
|
|
14
14
|
- **Testnet support** — set `GATE_BASE_URL` to use the testnet endpoint
|
|
@@ -66,7 +66,7 @@ A local (stdio) MCP server that exposes the full [Gate](https://www.gate.com) AP
|
|
|
66
66
|
|
|
67
67
|
## Module Filtering
|
|
68
68
|
|
|
69
|
-
By default all
|
|
69
|
+
By default all 357 tools (22 modules) are registered. To reduce the tool count (e.g. Cursor warns above 80), restrict to specific modules:
|
|
70
70
|
|
|
71
71
|
**CLI flags:**
|
|
72
72
|
```bash
|
|
@@ -95,7 +95,7 @@ npx gate-mcp --modules=futures --readonly
|
|
|
95
95
|
}
|
|
96
96
|
```
|
|
97
97
|
|
|
98
|
-
**Available modules:** `spot`, `futures`, `delivery`, `margin`, `wallet`, `account`, `options`, `earn`, `flash_swap`, `unified`, `sub_account`, `multi_collateral_loan`, `p2p`, `tradfi`, `crossex`, `alpha`, `rebate`
|
|
98
|
+
**Available modules:** `spot`, `futures`, `delivery`, `margin`, `wallet`, `account`, `options`, `earn`, `flash_swap`, `unified`, `sub_account`, `multi_collateral_loan`, `p2p`, `tradfi`, `crossex`, `alpha`, `rebate`, `activity`, `coupon`, `launch`, `square`, `welfare`
|
|
99
99
|
|
|
100
100
|
| Module | Total | Read-only |
|
|
101
101
|
|---|---|---|
|
|
@@ -105,9 +105,9 @@ npx gate-mcp --modules=futures --readonly
|
|
|
105
105
|
| margin | 17 | 14 |
|
|
106
106
|
| wallet | 22 | 18 |
|
|
107
107
|
| account | 10 | 6 |
|
|
108
|
-
| options |
|
|
109
|
-
| earn |
|
|
110
|
-
| flash_swap |
|
|
108
|
+
| options | 29 | 22 |
|
|
109
|
+
| earn | 29 | 22 |
|
|
110
|
+
| flash_swap | 7 | 5 |
|
|
111
111
|
| unified | 16 | 12 |
|
|
112
112
|
| sub_account | 11 | 5 |
|
|
113
113
|
| multi_collateral_loan | 12 | 9 |
|
|
@@ -115,7 +115,12 @@ npx gate-mcp --modules=futures --readonly
|
|
|
115
115
|
| tradfi | 18 | 12 |
|
|
116
116
|
| crossex | 31 | 21 |
|
|
117
117
|
| alpha | 9 | 7 |
|
|
118
|
-
| rebate |
|
|
118
|
+
| rebate | 9 | 9 |
|
|
119
|
+
| activity | 3 | 3 |
|
|
120
|
+
| coupon | 2 | 2 |
|
|
121
|
+
| launch | 5 | 3 |
|
|
122
|
+
| square | 2 | 2 |
|
|
123
|
+
| welfare | 2 | 2 |
|
|
119
124
|
|
|
120
125
|
## Environment Variables
|
|
121
126
|
|
|
@@ -132,10 +137,10 @@ npx gate-mcp --modules=futures --readonly
|
|
|
132
137
|
Tools marked `*` require authentication (`GATE_API_KEY` + `GATE_API_SECRET`).
|
|
133
138
|
|
|
134
139
|
### Spot (31 tools)
|
|
135
|
-
`cex_spot_list_currencies`, `cex_spot_get_currency`, `cex_spot_list_currency_pairs`, `cex_spot_get_currency_pair`, `cex_spot_get_spot_tickers`, `cex_spot_get_spot_order_book`, `cex_spot_get_spot_trades`, `cex_spot_get_spot_candlesticks`, `cex_spot_get_spot_fee`\*, `cex_spot_get_spot_accounts`\*, `
|
|
140
|
+
`cex_spot_list_currencies`, `cex_spot_get_currency`, `cex_spot_list_currency_pairs`, `cex_spot_get_currency_pair`, `cex_spot_get_spot_tickers`, `cex_spot_get_spot_order_book`, `cex_spot_get_spot_trades`, `cex_spot_get_spot_candlesticks`, `cex_spot_get_spot_insurance_history`, `cex_spot_get_spot_fee`\*, `cex_spot_get_spot_accounts`\*, `cex_spot_list_spot_orders`\*, `cex_spot_create_spot_order`\*, `cex_spot_get_spot_order`\*, `cex_spot_cancel_spot_order`\*, `cex_spot_amend_spot_order`\*, `cex_spot_cancel_all_spot_orders`\*, `cex_spot_list_spot_my_trades`\*, `cex_spot_list_all_open_orders`\*, `cex_spot_list_spot_price_triggered_orders`\*, `cex_spot_list_spot_account_book`\*, `cex_spot_get_spot_batch_fee`\*, `cex_spot_create_spot_batch_orders`\*, `cex_spot_amend_spot_batch_orders`\*, `cex_spot_cancel_spot_batch_orders`\*, `cex_spot_create_cross_liquidate_order`\*, `cex_spot_create_spot_price_triggered_order`\*, `cex_spot_get_spot_price_triggered_order`\*, `cex_spot_cancel_spot_price_triggered_order`\*, `cex_spot_cancel_spot_price_triggered_order_list`\*, `cex_spot_countdown_cancel_all_spot`\*
|
|
136
141
|
|
|
137
|
-
### Futures (
|
|
138
|
-
`cex_fx_list_fx_contracts`, `cex_fx_get_fx_contract`, `cex_fx_get_fx_order_book`, `cex_fx_get_fx_candlesticks`, `cex_fx_get_fx_tickers`, `cex_fx_get_fx_funding_rate`, `cex_fx_get_fx_trades`, `cex_fx_list_contract_stats`, `cex_fx_get_fx_premium_index`, `cex_fx_get_fx_accounts`\*, `cex_fx_list_fx_account_book`\*, `
|
|
142
|
+
### Futures (64 tools) — prefix abbreviated to `cex_fx_`
|
|
143
|
+
`cex_fx_list_fx_contracts`, `cex_fx_get_fx_contract`, `cex_fx_get_fx_order_book`, `cex_fx_get_fx_candlesticks`, `cex_fx_get_fx_tickers`, `cex_fx_get_fx_funding_rate`, `cex_fx_get_fx_trades`, `cex_fx_list_contract_stats`, `cex_fx_get_fx_premium_index`, `cex_fx_list_batch_fx_funding_rates`, `cex_fx_list_fx_insurance_ledger`, `cex_fx_get_index_constituents`, `cex_fx_list_liquidated_orders`, `cex_fx_get_fx_accounts`\*, `cex_fx_list_fx_account_book`\*, `cex_fx_list_fx_positions`\*, `cex_fx_list_positions_timerange`\*, `cex_fx_get_fx_position`\*, `cex_fx_get_leverage`\*, `cex_fx_get_fx_fee`\*, `cex_fx_list_fx_risk_limit_tiers`\*, `cex_fx_get_fx_risk_limit_table`\*, `cex_fx_list_fx_orders`\*, `cex_fx_create_fx_order`\*, `cex_fx_create_fx_bbo_order`\*, `cex_fx_get_fx_order`\*, `cex_fx_amend_fx_order`\*, `cex_fx_cancel_fx_order`\*, `cex_fx_cancel_all_fx_orders`\*, `cex_fx_create_fx_batch_orders`\*, `cex_fx_cancel_fx_batch_orders`\*, `cex_fx_amend_fx_batch_orders`\*, `cex_fx_get_fx_orders_with_time_range`\*, `cex_fx_list_fx_my_trades`\*, `cex_fx_get_fx_my_trades_timerange`\*, `cex_fx_list_position_close`\*, `cex_fx_list_fx_liq_orders`\*, `cex_fx_list_auto_deleverages`\*, `cex_fx_update_fx_position_leverage`\*, `cex_fx_update_fx_contract_position_leverage`\*, `cex_fx_update_fx_position_margin`\*, `cex_fx_update_fx_position_risk_limit`\*, `cex_fx_update_fx_position_cross_mode`\*, `cex_fx_update_fx_dual_position_cross_mode`\*, `cex_fx_set_fx_dual`\*, `cex_fx_set_position_mode`\*, `cex_fx_get_fx_dual_position`\*, `cex_fx_update_fx_dual_position_margin`\*, `cex_fx_update_fx_dual_position_leverage`\*, `cex_fx_update_fx_dual_position_risk_limit`\*, `cex_fx_countdown_cancel_all_fx`\*, `cex_fx_create_trail_order`\*, `cex_fx_get_trail_orders`\*, `cex_fx_get_trail_order_detail`\*, `cex_fx_update_trail_order`\*, `cex_fx_stop_trail_order`\*, `cex_fx_stop_all_trail_orders`\*, `cex_fx_get_trail_order_change_log`\*, `cex_fx_list_price_triggered_orders`\*, `cex_fx_create_fx_price_triggered_order`\*, `cex_fx_get_fx_price_triggered_order`\*, `cex_fx_update_fx_price_triggered_order`\*, `cex_fx_cancel_fx_price_triggered_order`\*, `cex_fx_cancel_fx_price_triggered_order_list`\*
|
|
139
144
|
|
|
140
145
|
### Delivery (11 tools) — prefix abbreviated to `cex_dc_`
|
|
141
146
|
`cex_dc_list_dc_contracts`, `cex_dc_get_dc_contract`, `cex_dc_list_dc_order_book`, `cex_dc_list_dc_candlesticks`, `cex_dc_list_dc_tickers`, `cex_dc_list_dc_accounts`\*, `cex_dc_list_dc_positions`\*, `cex_dc_list_dc_orders`\*, `cex_dc_create_dc_order`\*, `cex_dc_cancel_dc_order`\*, `cex_dc_get_my_dc_trades`\*
|
|
@@ -149,14 +154,14 @@ Tools marked `*` require authentication (`GATE_API_KEY` + `GATE_API_SECRET`).
|
|
|
149
154
|
### Account (10 tools)
|
|
150
155
|
`cex_account_get_account_detail`\*, `cex_account_get_account_rate_limit`\*, `cex_account_get_debit_fee`\*, `cex_account_set_debit_fee`\*, `cex_account_get_account_main_keys`\*, `cex_account_list_stp_groups`\*, `cex_account_create_stp_group`\*, `cex_account_list_stp_group_users`\*, `cex_account_add_stp_group_users`\*, `cex_account_delete_stp_group_user`\*
|
|
151
156
|
|
|
152
|
-
### Options (
|
|
153
|
-
`cex_options_list_options_underlyings`, `cex_options_list_options_expirations`, `cex_options_list_options_contracts`, `cex_options_get_options_contract`, `cex_options_list_options_order_book`, `cex_options_list_options_tickers`, `cex_options_list_options_underlying_tickers`, `cex_options_list_options_candlesticks`, `cex_options_list_options_underlying_candlesticks`, `cex_options_list_options_settlements`, `cex_options_get_options_settlement`, `cex_options_list_options_trades`, `cex_options_list_options_account`\*, `cex_options_list_options_account_book`\*, `cex_options_list_my_options_settlements`\*, `cex_options_list_options_positions`\*, `cex_options_get_options_position`\*, `cex_options_list_options_position_close`\*, `cex_options_list_options_orders`\*, `cex_options_create_options_order`\*, `cex_options_cancel_options_order`\*, `cex_options_get_options_order`\*, `cex_options_cancel_options_orders`\*, `cex_options_countdown_cancel_all_options`\*, `cex_options_get_options_mmp`\*, `cex_options_set_options_mmp`\*, `cex_options_reset_options_mmp`\*, `cex_options_list_my_options_trades`\*
|
|
157
|
+
### Options (29 tools)
|
|
158
|
+
`cex_options_list_options_underlyings`, `cex_options_list_options_expirations`, `cex_options_list_options_contracts`, `cex_options_get_options_contract`, `cex_options_list_options_order_book`, `cex_options_list_options_tickers`, `cex_options_list_options_underlying_tickers`, `cex_options_list_options_candlesticks`, `cex_options_list_options_underlying_candlesticks`, `cex_options_list_options_settlements`, `cex_options_get_options_settlement`, `cex_options_list_options_trades`, `cex_options_list_options_account`\*, `cex_options_list_options_account_book`\*, `cex_options_list_my_options_settlements`\*, `cex_options_list_options_positions`\*, `cex_options_get_options_position`\*, `cex_options_list_options_position_close`\*, `cex_options_list_options_orders`\*, `cex_options_create_options_order`\*, `cex_options_amend_options_order`\*, `cex_options_cancel_options_order`\*, `cex_options_get_options_order`\*, `cex_options_cancel_options_orders`\*, `cex_options_countdown_cancel_all_options`\*, `cex_options_get_options_mmp`\*, `cex_options_set_options_mmp`\*, `cex_options_reset_options_mmp`\*, `cex_options_list_my_options_trades`\*
|
|
154
159
|
|
|
155
|
-
### Earn (
|
|
156
|
-
`cex_earn_list_dual_investment_plans`, `cex_earn_list_structured_products`, `cex_earn_find_coin`, `cex_earn_list_uni_currencies`, `cex_earn_get_uni_currency`, `cex_earn_list_uni_chart`, `cex_earn_list_uni_rate`, `cex_earn_list_dual_orders`\*, `cex_earn_place_dual_order`\*, `cex_earn_list_dual_balance`\*, `cex_earn_list_structured_orders`\*, `cex_earn_place_structured_order`\*, `cex_earn_swap_staking_coin`\*, `cex_earn_order_list`\*, `cex_earn_award_list`\*, `cex_earn_asset_list`\*, `cex_earn_list_user_uni_lends`\*, `cex_earn_create_uni_lend`\*, `cex_earn_change_uni_lend`\*, `cex_earn_list_uni_lend_records`\*, `cex_earn_get_uni_interest`\*, `cex_earn_list_uni_interest_records`\*, `cex_earn_get_uni_interest_status`\*
|
|
160
|
+
### Earn (29 tools)
|
|
161
|
+
`cex_earn_list_dual_investment_plans`, `cex_earn_list_structured_products`, `cex_earn_find_coin`, `cex_earn_list_uni_currencies`, `cex_earn_get_uni_currency`, `cex_earn_list_uni_chart`, `cex_earn_list_uni_rate`, `cex_earn_list_earn_fixed_term_products`, `cex_earn_list_earn_fixed_term_products_by_asset`, `cex_earn_list_dual_orders`\*, `cex_earn_place_dual_order`\*, `cex_earn_list_dual_balance`\*, `cex_earn_list_structured_orders`\*, `cex_earn_place_structured_order`\*, `cex_earn_swap_staking_coin`\*, `cex_earn_order_list`\*, `cex_earn_award_list`\*, `cex_earn_asset_list`\*, `cex_earn_list_user_uni_lends`\*, `cex_earn_create_uni_lend`\*, `cex_earn_change_uni_lend`\*, `cex_earn_list_uni_lend_records`\*, `cex_earn_get_uni_interest`\*, `cex_earn_list_uni_interest_records`\*, `cex_earn_get_uni_interest_status`\*, `cex_earn_list_earn_fixed_term_lends`\*, `cex_earn_create_earn_fixed_term_lend`\*, `cex_earn_create_earn_fixed_term_pre_redeem`\*, `cex_earn_list_earn_fixed_term_history`\*
|
|
157
162
|
|
|
158
|
-
### Flash Swap (
|
|
159
|
-
`cex_fc_list_fc_currency_pairs`, `cex_fc_list_fc_orders`\*, `cex_fc_get_fc_order`\*
|
|
163
|
+
### Flash Swap (7 tools) — prefix abbreviated to `cex_fc_`
|
|
164
|
+
`cex_fc_list_fc_currency_pairs`, `cex_fc_preview_fc_multi_currency_many_to_one_order`, `cex_fc_preview_fc_multi_currency_one_to_many_order`, `cex_fc_list_fc_orders`\*, `cex_fc_get_fc_order`\*, `cex_fc_create_fc_multi_currency_many_to_one_order`\*, `cex_fc_create_fc_multi_currency_one_to_many_order`\*
|
|
160
165
|
|
|
161
166
|
### Unified Account (16 tools)
|
|
162
167
|
`cex_unified_list_currency_discount_tiers`, `cex_unified_get_unified_accounts`\*, `cex_unified_list_unified_currencies`\*, `cex_unified_get_unified_mode`\*, `cex_unified_set_unified_mode`\*, `cex_unified_get_unified_risk_units`\*, `cex_unified_get_unified_borrowable`\*, `cex_unified_get_unified_transferable`\*, `cex_unified_get_unified_estimate_rate`\*, `cex_unified_list_unified_loans`\*, `cex_unified_create_unified_loan`\*, `cex_unified_list_unified_loan_records`\*, `cex_unified_list_unified_loan_interest_records`\*, `cex_unified_get_user_leverage_currency_setting`\*, `cex_unified_set_user_leverage_currency_setting`\*, `cex_unified_set_unified_collateral`\*
|
|
@@ -171,7 +176,7 @@ Tools marked `*` require authentication (`GATE_API_KEY` + `GATE_API_SECRET`).
|
|
|
171
176
|
`cex_p2p_get_user_info`\*, `cex_p2p_get_counterparty_user_info`\*, `cex_p2p_get_myself_payment`\*, `cex_p2p_get_pending_transactions`\*, `cex_p2p_get_completed_transactions`\*, `cex_p2p_get_transaction_details`\*, `cex_p2p_confirm_payment`\*, `cex_p2p_confirm_receipt`\*, `cex_p2p_cancel_transaction`\*, `cex_p2p_place_ad_order`\*, `cex_p2p_update_ad_status`\*, `cex_p2p_get_ad_detail`\*, `cex_p2p_list_my_ads`\*, `cex_p2p_list_ads`\*, `cex_p2p_get_chat_messages`\*, `cex_p2p_send_chat_message`\*, `cex_p2p_upload_chat_file`\*
|
|
172
177
|
|
|
173
178
|
### TradFi (18 tools) — prefix: `cex_tradfi_`
|
|
174
|
-
`cex_tradfi_query_categories`, `cex_tradfi_query_symbols`, `
|
|
179
|
+
`cex_tradfi_query_categories`, `cex_tradfi_query_symbols`, `cex_tradfi_query_symbol_kline`, `cex_tradfi_query_symbol_ticker`, `cex_tradfi_query_symbol_detail`\*, `cex_tradfi_query_mt5_account_info`\*, `cex_tradfi_query_user_assets`\*, `cex_tradfi_query_transaction`\*, `cex_tradfi_create_transaction`\*, `cex_tradfi_query_order_list`\*, `cex_tradfi_create_tradfi_order`\*, `cex_tradfi_update_order`\*, `cex_tradfi_delete_order`\*, `cex_tradfi_query_order_history_list`\*, `cex_tradfi_query_position_list`\*, `cex_tradfi_update_position`\*, `cex_tradfi_close_position`\*, `cex_tradfi_query_position_history_list`\*
|
|
175
180
|
|
|
176
181
|
### CrossEx (31 tools) — prefix abbreviated to `cex_crx_`
|
|
177
182
|
`cex_crx_list_crx_rule_symbols`, `cex_crx_list_crx_rule_risk_limits`, `cex_crx_list_crx_transfer_coins`, `cex_crx_get_crx_fee`, `cex_crx_get_crx_interest_rate`, `cex_crx_list_crx_coin_discount_rate`, `cex_crx_list_crx_transfers`\*, `cex_crx_create_crx_transfer`\*, `cex_crx_list_crx_open_orders`\*, `cex_crx_create_crx_order`\*, `cex_crx_get_crx_order`\*, `cex_crx_update_crx_order`\*, `cex_crx_cancel_crx_order`\*, `cex_crx_list_crx_history_orders`\*, `cex_crx_list_crx_history_trades`\*, `cex_crx_create_crx_convert_quote`\*, `cex_crx_create_crx_convert_order`\*, `cex_crx_get_crx_account`\*, `cex_crx_update_crx_account`\*, `cex_crx_list_crx_account_book`\*, `cex_crx_list_crx_positions`\*, `cex_crx_list_crx_margin_positions`\*, `cex_crx_list_crx_adl_rank`\*, `cex_crx_get_crx_positions_leverage`\*, `cex_crx_update_crx_positions_leverage`\*, `cex_crx_get_crx_margin_positions_leverage`\*, `cex_crx_update_crx_margin_positions_leverage`\*, `cex_crx_close_crx_position`\*, `cex_crx_list_crx_history_positions`\*, `cex_crx_list_crx_history_margin_positions`\*, `cex_crx_list_crx_history_margin_interests`\*
|
|
@@ -179,8 +184,23 @@ Tools marked `*` require authentication (`GATE_API_KEY` + `GATE_API_SECRET`).
|
|
|
179
184
|
### Alpha (9 tools)
|
|
180
185
|
`cex_alpha_list_alpha_currencies`, `cex_alpha_list_alpha_tickers`, `cex_alpha_list_alpha_tokens`, `cex_alpha_list_alpha_accounts`\*, `cex_alpha_list_alpha_account_book`\*, `cex_alpha_list_alpha_orders`\*, `cex_alpha_get_alpha_order`\*, `cex_alpha_quote_alpha_order`\*, `cex_alpha_place_alpha_order`\*
|
|
181
186
|
|
|
182
|
-
### Rebate (
|
|
183
|
-
`cex_rebate_partner_transaction_history`\*, `cex_rebate_partner_commissions_history`\*, `cex_rebate_partner_sub_list`\*, `cex_rebate_broker_commission_history`\*, `cex_rebate_broker_transaction_history`\*, `cex_rebate_user_info`\*, `cex_rebate_user_sub_relation`\*
|
|
187
|
+
### Rebate (9 tools)
|
|
188
|
+
`cex_rebate_partner_transaction_history`\*, `cex_rebate_partner_commissions_history`\*, `cex_rebate_partner_sub_list`\*, `cex_rebate_broker_commission_history`\*, `cex_rebate_broker_transaction_history`\*, `cex_rebate_user_info`\*, `cex_rebate_get_partner_application_recent`\*, `cex_rebate_get_partner_eligibility`\*, `cex_rebate_user_sub_relation`\*
|
|
189
|
+
|
|
190
|
+
### Activity (3 tools)
|
|
191
|
+
`cex_activity_list_activities`, `cex_activity_list_activity_types`, `cex_activity_get_my_activity_entry`\*
|
|
192
|
+
|
|
193
|
+
### Coupon (2 tools)
|
|
194
|
+
`cex_coupon_list_user_coupons`\*, `cex_coupon_get_user_coupon_detail`\*
|
|
195
|
+
|
|
196
|
+
### Launch (5 tools)
|
|
197
|
+
`cex_launch_list_launch_pool_projects`, `cex_launch_create_launch_pool_order`\*, `cex_launch_redeem_launch_pool`\*, `cex_launch_list_launch_pool_pledge_records`\*, `cex_launch_list_launch_pool_reward_records`\*
|
|
198
|
+
|
|
199
|
+
### Square (2 tools)
|
|
200
|
+
`cex_square_list_square_ai_search`, `cex_square_list_live_replay`
|
|
201
|
+
|
|
202
|
+
### Welfare (2 tools)
|
|
203
|
+
`cex_welfare_get_user_identity`\*, `cex_welfare_get_beginner_task_list`\*
|
|
184
204
|
|
|
185
205
|
*\* Requires authentication (`GATE_API_KEY` + `GATE_API_SECRET`)*
|
|
186
206
|
|
package/dist/config.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const VALID_MODULES: readonly ["spot", "futures", "delivery", "margin", "wallet", "account", "options", "earn", "flash_swap", "unified", "sub_account", "p2p", "tradfi", "crossex", "alpha", "rebate", "multi_collateral_loan"];
|
|
1
|
+
export declare const VALID_MODULES: readonly ["spot", "futures", "delivery", "margin", "wallet", "account", "options", "earn", "flash_swap", "unified", "sub_account", "p2p", "tradfi", "crossex", "alpha", "rebate", "multi_collateral_loan", "activity", "coupon", "launch", "square", "welfare"];
|
|
2
2
|
export type ModuleName = typeof VALID_MODULES[number];
|
|
3
3
|
export interface ServerConfig {
|
|
4
4
|
/** null means all modules */
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,iQAIhB,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC;AAEtD,MAAM,WAAW,YAAY;IAC3B,6BAA6B;IAC7B,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IAChC,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,wBAAgB,WAAW,IAAI,YAAY,CAyC1C"}
|
package/dist/config.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export const VALID_MODULES = [
|
|
2
2
|
'spot', 'futures', 'delivery', 'margin', 'wallet',
|
|
3
3
|
'account', 'options', 'earn', 'flash_swap', 'unified', 'sub_account',
|
|
4
|
-
'p2p', 'tradfi', 'crossex', 'alpha', 'rebate', 'multi_collateral_loan',
|
|
4
|
+
'p2p', 'tradfi', 'crossex', 'alpha', 'rebate', 'multi_collateral_loan', 'activity', 'coupon', 'launch', 'square', 'welfare',
|
|
5
5
|
];
|
|
6
6
|
export function parseConfig() {
|
|
7
7
|
// --- readonly ---
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,C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IAAI,EAAE,QAAQ,EAAE,CAAC;IACrC,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;AACtC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -41,6 +41,11 @@ import { registerCrossExTools } from './tools/cross_ex.js';
|
|
|
41
41
|
import { registerAlphaTools } from './tools/alpha.js';
|
|
42
42
|
import { registerRebateTools } from './tools/rebate.js';
|
|
43
43
|
import { registerMultiCollateralLoanTools } from './tools/multi_collateral_loan.js';
|
|
44
|
+
import { registerActivityTools } from './tools/activity.js';
|
|
45
|
+
import { registerCouponTools } from './tools/coupon.js';
|
|
46
|
+
import { registerLaunchTools } from './tools/launch.js';
|
|
47
|
+
import { registerSquareTools } from './tools/square.js';
|
|
48
|
+
import { registerWelfareTools } from './tools/welfare.js';
|
|
44
49
|
const config = parseConfig();
|
|
45
50
|
const server = new McpServer({
|
|
46
51
|
name: 'gate',
|
|
@@ -75,6 +80,11 @@ const MODULE_REGISTRY = {
|
|
|
75
80
|
alpha: registerAlphaTools,
|
|
76
81
|
rebate: registerRebateTools,
|
|
77
82
|
multi_collateral_loan: registerMultiCollateralLoanTools,
|
|
83
|
+
activity: registerActivityTools,
|
|
84
|
+
coupon: registerCouponTools,
|
|
85
|
+
launch: registerLaunchTools,
|
|
86
|
+
square: registerSquareTools,
|
|
87
|
+
welfare: registerWelfareTools,
|
|
78
88
|
};
|
|
79
89
|
const modulesToLoad = config.modules ?? new Set(Object.keys(MODULE_REGISTRY));
|
|
80
90
|
for (const name of modulesToLoad) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;A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B,CAAC,CAAC;AAE9F,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;IACjC,eAAe,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC;AAED,IAAI,MAAM,CAAC,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;IACtC,MAAM,UAAU,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;IAC3E,OAAO,CAAC,KAAK,CAAC,uBAAuB,UAAU,gBAAgB,MAAM,CAAC,QAAQ,EAAE,CAAC,CAAC;AACpF,CAAC;AAED,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;AAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../src/tools/activity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMpE,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAmD7D"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { DefaultApi } from 'gate-api';
|
|
3
|
+
import { createClient, requireAuth } from '../client.js';
|
|
4
|
+
import { textContent, errorContent } from '../utils.js';
|
|
5
|
+
export function registerActivityTools(server) {
|
|
6
|
+
server.tool('cex_activity_get_my_activity_entry', 'Get current user activity entry and participation status (requires authentication)', {}, async () => {
|
|
7
|
+
try {
|
|
8
|
+
requireAuth();
|
|
9
|
+
const { body } = await new DefaultApi(createClient()).getMyActivityEntry();
|
|
10
|
+
return textContent(body);
|
|
11
|
+
}
|
|
12
|
+
catch (e) {
|
|
13
|
+
return errorContent(e);
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
server.tool('cex_activity_list_activities', 'List available activities with optional filters', {
|
|
17
|
+
recommend_type: z.string().optional().describe('Filter by recommendation type'),
|
|
18
|
+
type_ids: z.string().optional().describe('Comma-separated activity type IDs to filter by'),
|
|
19
|
+
keywords: z.string().optional().describe('Search keywords'),
|
|
20
|
+
page: z.number().int().optional().describe('Page number (default 1)'),
|
|
21
|
+
page_size: z.number().int().optional().describe('Number of results per page'),
|
|
22
|
+
sort_by: z.string().optional().describe('Sort field'),
|
|
23
|
+
}, async ({ recommend_type, type_ids, keywords, page, page_size, sort_by }) => {
|
|
24
|
+
try {
|
|
25
|
+
const opts = {};
|
|
26
|
+
if (recommend_type !== undefined)
|
|
27
|
+
opts.recommendType = recommend_type;
|
|
28
|
+
if (type_ids !== undefined)
|
|
29
|
+
opts.typeIds = type_ids;
|
|
30
|
+
if (keywords !== undefined)
|
|
31
|
+
opts.keywords = keywords;
|
|
32
|
+
if (page !== undefined)
|
|
33
|
+
opts.page = page;
|
|
34
|
+
if (page_size !== undefined)
|
|
35
|
+
opts.pageSize = page_size;
|
|
36
|
+
if (sort_by !== undefined)
|
|
37
|
+
opts.sortBy = sort_by;
|
|
38
|
+
const { body } = await new DefaultApi(createClient()).listActivities(opts);
|
|
39
|
+
return textContent(body);
|
|
40
|
+
}
|
|
41
|
+
catch (e) {
|
|
42
|
+
return errorContent(e);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
server.tool('cex_activity_list_activity_types', 'List all available activity types', {}, async () => {
|
|
46
|
+
try {
|
|
47
|
+
const { body } = await new DefaultApi(createClient()).listActivityTypes();
|
|
48
|
+
return textContent(body);
|
|
49
|
+
}
|
|
50
|
+
catch (e) {
|
|
51
|
+
return errorContent(e);
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=activity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../../src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CAAC,IAAI,CAAC,CAAC;QAC3B,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YAAC,OAAO,YAAY,CAAC,CAAC,CAAC,CAAC;QAAC,CAAC;IACzC,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"coupon.d.ts","sourceRoot":"","sources":["../../src/tools/coupon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAapE,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAgD3D"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { CouponApi } from 'gate-api';
|
|
3
|
+
import { createClient, requireAuth } from '../client.js';
|
|
4
|
+
import { textContent, errorContent } from '../utils.js';
|
|
5
|
+
const couponTypeSchema = z.enum([
|
|
6
|
+
'position_voucher', 'tradfi_position_voucher', 'contract_bonus', 'contract_bonus_new',
|
|
7
|
+
'commission_rebate', 'hold_bonus', 'point', 'financial_rate', 'robot_bonus',
|
|
8
|
+
'loss_protection_copier', 'vip_card', 'interest_voucher', 'p2p', 'cash',
|
|
9
|
+
'crypto_loan_interest', 'copy_trading', 'alpha_voucher', 'etf_voucher',
|
|
10
|
+
]);
|
|
11
|
+
export function registerCouponTools(server) {
|
|
12
|
+
server.tool('cex_coupon_list_user_coupons', 'List user coupons with optional filters (requires authentication)', {
|
|
13
|
+
expired: z.union([z.literal(0), z.literal(1)]).optional().describe('0 = active, 1 = expired'),
|
|
14
|
+
limit: z.number().int().optional().describe('Max number of results'),
|
|
15
|
+
last_id: z.number().int().optional().describe('Pagination cursor — last coupon ID from previous page'),
|
|
16
|
+
expire_time: z.number().optional().describe('Filter coupons expiring before this Unix timestamp'),
|
|
17
|
+
order_by: z.enum(['latest', 'expired']).optional().describe('Sort order'),
|
|
18
|
+
type: couponTypeSchema.optional().describe('Filter by coupon type'),
|
|
19
|
+
is_task_coupon: z.union([z.literal(0), z.literal(1)]).optional().describe('1 = task coupons only'),
|
|
20
|
+
}, async ({ expired, limit, last_id, expire_time, order_by, type, is_task_coupon }) => {
|
|
21
|
+
try {
|
|
22
|
+
requireAuth();
|
|
23
|
+
const opts = {};
|
|
24
|
+
if (expired !== undefined)
|
|
25
|
+
opts.expired = expired;
|
|
26
|
+
if (limit !== undefined)
|
|
27
|
+
opts.limit = limit;
|
|
28
|
+
if (last_id !== undefined)
|
|
29
|
+
opts.lastId = last_id;
|
|
30
|
+
if (expire_time !== undefined)
|
|
31
|
+
opts.expireTime = expire_time;
|
|
32
|
+
if (order_by !== undefined)
|
|
33
|
+
opts.orderBy = order_by;
|
|
34
|
+
if (type !== undefined)
|
|
35
|
+
opts.type = type;
|
|
36
|
+
if (is_task_coupon !== undefined)
|
|
37
|
+
opts.isTaskCoupon = is_task_coupon;
|
|
38
|
+
const { body } = await new CouponApi(createClient()).listUserCoupons(opts);
|
|
39
|
+
return textContent(body);
|
|
40
|
+
}
|
|
41
|
+
catch (e) {
|
|
42
|
+
return errorContent(e);
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
server.tool('cex_coupon_get_user_coupon_detail', 'Get detail of a specific user coupon (requires authentication)', {
|
|
46
|
+
coupon_type: couponTypeSchema.describe('Coupon type'),
|
|
47
|
+
detail_id: z.number().int().describe('Coupon detail ID'),
|
|
48
|
+
is_task_coupon: z.union([z.literal(0), z.literal(1)]).optional().describe('1 = task coupon'),
|
|
49
|
+
}, async ({ coupon_type, detail_id, is_task_coupon }) => {
|
|
50
|
+
try {
|
|
51
|
+
requireAuth();
|
|
52
|
+
const opts = {};
|
|
53
|
+
if (is_task_coupon !== undefined)
|
|
54
|
+
opts.isTaskCoupon = is_task_coupon;
|
|
55
|
+
const { body } = await new CouponApi(createClient()).getUserCouponDetail(coupon_type, detail_id, opts);
|
|
56
|
+
return textContent(body);
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
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.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"earn.d.ts","sourceRoot":"","sources":["../../src/tools/earn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMpE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"earn.d.ts","sourceRoot":"","sources":["../../src/tools/earn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAMpE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,CAklBzD"}
|
package/dist/tools/earn.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { EarnApi, EarnUniApi } from 'gate-api';
|
|
2
|
+
import { EarnApi, EarnUniApi, FixedTermLendRequest, InlineObject } from 'gate-api';
|
|
3
3
|
import { createClient, requireAuth } from '../client.js';
|
|
4
4
|
import { textContent, errorContent } from '../utils.js';
|
|
5
5
|
export function registerEarnTools(server) {
|
|
@@ -421,5 +421,151 @@ export function registerEarnTools(server) {
|
|
|
421
421
|
return errorContent(e);
|
|
422
422
|
}
|
|
423
423
|
});
|
|
424
|
+
// ── Fixed-Term ────────────────────────────────────────────────────────────
|
|
425
|
+
server.tool('cex_earn_list_earn_fixed_term_products', 'List fixed-term earn products', {
|
|
426
|
+
page: z.number().int().describe('Page number'),
|
|
427
|
+
limit: z.number().int().describe('Results per page'),
|
|
428
|
+
asset: z.string().optional().describe('Filter by asset symbol e.g. USDT'),
|
|
429
|
+
type: z.number().int().optional().describe('Product type filter'),
|
|
430
|
+
}, async ({ page, limit, asset, type }) => {
|
|
431
|
+
try {
|
|
432
|
+
const opts = {};
|
|
433
|
+
if (asset !== undefined)
|
|
434
|
+
opts.asset = asset;
|
|
435
|
+
if (type !== undefined)
|
|
436
|
+
opts.type = type;
|
|
437
|
+
const { body } = await new EarnApi(createClient()).listEarnFixedTermProducts(page, limit, opts);
|
|
438
|
+
return textContent(body);
|
|
439
|
+
}
|
|
440
|
+
catch (e) {
|
|
441
|
+
return errorContent(e);
|
|
442
|
+
}
|
|
443
|
+
});
|
|
444
|
+
server.tool('cex_earn_list_earn_fixed_term_products_by_asset', 'List fixed-term earn products for a specific asset', {
|
|
445
|
+
asset: z.string().describe('Asset symbol e.g. USDT'),
|
|
446
|
+
type: z.string().optional().describe('Product type filter'),
|
|
447
|
+
}, async ({ asset, type }) => {
|
|
448
|
+
try {
|
|
449
|
+
const opts = {};
|
|
450
|
+
if (type !== undefined)
|
|
451
|
+
opts.type = type;
|
|
452
|
+
const { body } = await new EarnApi(createClient()).listEarnFixedTermProductsByAsset(asset, opts);
|
|
453
|
+
return textContent(body);
|
|
454
|
+
}
|
|
455
|
+
catch (e) {
|
|
456
|
+
return errorContent(e);
|
|
457
|
+
}
|
|
458
|
+
});
|
|
459
|
+
server.tool('cex_earn_list_earn_fixed_term_lends', 'List fixed-term earn lend orders (requires authentication)', {
|
|
460
|
+
order_type: z.string().describe('Order type filter'),
|
|
461
|
+
page: z.number().int().describe('Page number'),
|
|
462
|
+
limit: z.number().int().describe('Results per page'),
|
|
463
|
+
product_id: z.number().int().optional().describe('Filter by product ID'),
|
|
464
|
+
order_id: z.number().int().optional().describe('Filter by order ID'),
|
|
465
|
+
asset: z.string().optional().describe('Filter by asset symbol'),
|
|
466
|
+
sub_business: z.number().int().optional().describe('Sub-business type filter'),
|
|
467
|
+
business_filter: z.string().optional().describe('Business filter string'),
|
|
468
|
+
}, async ({ order_type, page, limit, product_id, order_id, asset, sub_business, business_filter }) => {
|
|
469
|
+
try {
|
|
470
|
+
requireAuth();
|
|
471
|
+
const opts = {};
|
|
472
|
+
if (product_id !== undefined)
|
|
473
|
+
opts.productId = product_id;
|
|
474
|
+
if (order_id !== undefined)
|
|
475
|
+
opts.orderId = order_id;
|
|
476
|
+
if (asset !== undefined)
|
|
477
|
+
opts.asset = asset;
|
|
478
|
+
if (sub_business !== undefined)
|
|
479
|
+
opts.subBusiness = sub_business;
|
|
480
|
+
if (business_filter !== undefined)
|
|
481
|
+
opts.businessFilter = business_filter;
|
|
482
|
+
const { body } = await new EarnApi(createClient()).listEarnFixedTermLends(order_type, page, limit, opts);
|
|
483
|
+
return textContent(body);
|
|
484
|
+
}
|
|
485
|
+
catch (e) {
|
|
486
|
+
return errorContent(e);
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
server.tool('cex_earn_create_earn_fixed_term_lend', 'Create a fixed-term earn lend order (requires authentication)', {
|
|
490
|
+
product_id: z.number().int().describe('Product ID to lend into'),
|
|
491
|
+
amount: z.string().describe('Lend amount'),
|
|
492
|
+
year_rate: z.string().optional().describe('Target annual rate'),
|
|
493
|
+
reinvest_status: z.number().int().optional().describe('Auto-reinvest flag'),
|
|
494
|
+
redeem_account_type: z.number().int().optional().describe('Redemption account type'),
|
|
495
|
+
financial_rate_id: z.number().int().optional().describe('Financial rate ID'),
|
|
496
|
+
sub_business: z.number().int().optional().describe('Sub-business type'),
|
|
497
|
+
}, async ({ product_id, amount, year_rate, reinvest_status, redeem_account_type, financial_rate_id, sub_business }) => {
|
|
498
|
+
try {
|
|
499
|
+
requireAuth();
|
|
500
|
+
const req = new FixedTermLendRequest();
|
|
501
|
+
req.productId = product_id;
|
|
502
|
+
req.amount = amount;
|
|
503
|
+
if (year_rate !== undefined)
|
|
504
|
+
req.yearRate = year_rate;
|
|
505
|
+
if (reinvest_status !== undefined)
|
|
506
|
+
req.reinvestStatus = reinvest_status;
|
|
507
|
+
if (redeem_account_type !== undefined)
|
|
508
|
+
req.redeemAccountType = redeem_account_type;
|
|
509
|
+
if (financial_rate_id !== undefined)
|
|
510
|
+
req.financialRateId = financial_rate_id;
|
|
511
|
+
if (sub_business !== undefined)
|
|
512
|
+
req.subBusiness = sub_business;
|
|
513
|
+
const { body } = await new EarnApi(createClient()).createEarnFixedTermLend({ fixedTermLendRequest: req });
|
|
514
|
+
return textContent(body);
|
|
515
|
+
}
|
|
516
|
+
catch (e) {
|
|
517
|
+
return errorContent(e);
|
|
518
|
+
}
|
|
519
|
+
});
|
|
520
|
+
server.tool('cex_earn_create_earn_fixed_term_pre_redeem', 'Pre-redeem a fixed-term earn order (requires authentication)', {
|
|
521
|
+
order_id: z.string().describe('Order ID to pre-redeem'),
|
|
522
|
+
}, async ({ order_id }) => {
|
|
523
|
+
try {
|
|
524
|
+
requireAuth();
|
|
525
|
+
const req = new InlineObject();
|
|
526
|
+
req.orderId = order_id;
|
|
527
|
+
const { body } = await new EarnApi(createClient()).createEarnFixedTermPreRedeem({ inlineObject: req });
|
|
528
|
+
return textContent(body);
|
|
529
|
+
}
|
|
530
|
+
catch (e) {
|
|
531
|
+
return errorContent(e);
|
|
532
|
+
}
|
|
533
|
+
});
|
|
534
|
+
server.tool('cex_earn_list_earn_fixed_term_history', 'List fixed-term earn order history (requires authentication)', {
|
|
535
|
+
type: z.string().describe('History type filter'),
|
|
536
|
+
page: z.number().int().describe('Page number'),
|
|
537
|
+
limit: z.number().int().describe('Results per page'),
|
|
538
|
+
product_id: z.number().int().optional().describe('Filter by product ID'),
|
|
539
|
+
order_id: z.string().optional().describe('Filter by order ID'),
|
|
540
|
+
asset: z.string().optional().describe('Filter by asset symbol'),
|
|
541
|
+
start_at: z.number().optional().describe('Start time (Unix timestamp)'),
|
|
542
|
+
end_at: z.number().optional().describe('End time (Unix timestamp)'),
|
|
543
|
+
sub_business: z.number().int().optional().describe('Sub-business type filter'),
|
|
544
|
+
business_filter: z.string().optional().describe('Business filter string'),
|
|
545
|
+
}, async ({ type, page, limit, product_id, order_id, asset, start_at, end_at, sub_business, business_filter }) => {
|
|
546
|
+
try {
|
|
547
|
+
requireAuth();
|
|
548
|
+
const opts = {};
|
|
549
|
+
if (product_id !== undefined)
|
|
550
|
+
opts.productId = product_id;
|
|
551
|
+
if (order_id !== undefined)
|
|
552
|
+
opts.orderId = order_id;
|
|
553
|
+
if (asset !== undefined)
|
|
554
|
+
opts.asset = asset;
|
|
555
|
+
if (start_at !== undefined)
|
|
556
|
+
opts.startAt = start_at;
|
|
557
|
+
if (end_at !== undefined)
|
|
558
|
+
opts.endAt = end_at;
|
|
559
|
+
if (sub_business !== undefined)
|
|
560
|
+
opts.subBusiness = sub_business;
|
|
561
|
+
if (business_filter !== undefined)
|
|
562
|
+
opts.businessFilter = business_filter;
|
|
563
|
+
const { body } = await new EarnApi(createClient()).listEarnFixedTermHistory(type, page, limit, opts);
|
|
564
|
+
return textContent(body);
|
|
565
|
+
}
|
|
566
|
+
catch (e) {
|
|
567
|
+
return errorContent(e);
|
|
568
|
+
}
|
|
569
|
+
});
|
|
424
570
|
}
|
|
425
571
|
//# sourceMappingURL=earn.js.map
|