@@ -7499,6 +7499,66 @@ function buildTools(): ToolDefinition[] {
74997499 required: ['api_key'],
75007500 },
75017501 },
7502+ {
7503+ name: 'setup_binance_credentials',
7504+ description: 'Set up Binance Futures trading credentials. Required before trading futures on Binance.',
7505+ input_schema: {
7506+ type: 'object',
7507+ properties: {
7508+ api_key: { type: 'string', description: 'Binance API key' },
7509+ api_secret: { type: 'string', description: 'Binance API secret' },
7510+ },
7511+ required: ['api_key', 'api_secret'],
7512+ },
7513+ },
7514+ {
7515+ name: 'setup_bybit_credentials',
7516+ description: 'Set up Bybit Futures trading credentials. Required before trading futures on Bybit.',
7517+ input_schema: {
7518+ type: 'object',
7519+ properties: {
7520+ api_key: { type: 'string', description: 'Bybit API key' },
7521+ api_secret: { type: 'string', description: 'Bybit API secret' },
7522+ },
7523+ required: ['api_key', 'api_secret'],
7524+ },
7525+ },
7526+ {
7527+ name: 'setup_hyperliquid_credentials',
7528+ description: 'Set up Hyperliquid trading credentials. Required before trading on Hyperliquid.',
7529+ input_schema: {
7530+ type: 'object',
7531+ properties: {
7532+ private_key: { type: 'string', description: 'Ethereum private key (0x...) for signing' },
7533+ wallet_address: { type: 'string', description: 'Wallet address (0x...)' },
7534+ },
7535+ required: ['private_key'],
7536+ },
7537+ },
7538+ {
7539+ name: 'setup_mexc_credentials',
7540+ description: 'Set up MEXC Futures trading credentials. Required before trading futures on MEXC.',
7541+ input_schema: {
7542+ type: 'object',
7543+ properties: {
7544+ api_key: { type: 'string', description: 'MEXC API key' },
7545+ api_secret: { type: 'string', description: 'MEXC API secret' },
7546+ },
7547+ required: ['api_key', 'api_secret'],
7548+ },
7549+ },
7550+ {
7551+ name: 'setup_betfair_credentials',
7552+ description: 'Set up Betfair trading credentials. Required before trading on Betfair.',
7553+ input_schema: {
7554+ type: 'object',
7555+ properties: {
7556+ app_key: { type: 'string', description: 'Betfair application key' },
7557+ session_token: { type: 'string', description: 'Betfair session token (SSOID)' },
7558+ },
7559+ required: ['app_key', 'session_token'],
7560+ },
7561+ },
75027562 {
75037563 name: 'list_trading_credentials',
75047564 description: 'List which platforms the user has trading credentials set up for',
@@ -7516,7 +7576,7 @@ function buildTools(): ToolDefinition[] {
75167576 platform: {
75177577 type: 'string',
75187578 description: 'Platform to delete credentials for',
7519- enum: ['polymarket', 'kalshi', 'manifold'],
7579+ enum: ['polymarket', 'kalshi', 'manifold', 'binance', 'bybit', 'hyperliquid', 'mexc', 'betfair' ],
75207580 },
75217581 },
75227582 required: ['platform'],
@@ -9794,6 +9854,61 @@ async function executeTool(
97949854 });
97959855 }
97969856
9857+ case 'setup_binance_credentials': {
9858+ await context.credentials.setCredentials(userId, 'binance', {
9859+ apiKey: toolInput.api_key as string,
9860+ apiSecret: toolInput.api_secret as string,
9861+ });
9862+ return JSON.stringify({
9863+ result: 'Binance credentials saved! You can now trade futures on Binance.',
9864+ security_notice: 'Your credentials are encrypted with AES-256-GCM. Use IP-restricted API keys for maximum security.',
9865+ });
9866+ }
9867+
9868+ case 'setup_bybit_credentials': {
9869+ await context.credentials.setCredentials(userId, 'bybit', {
9870+ apiKey: toolInput.api_key as string,
9871+ apiSecret: toolInput.api_secret as string,
9872+ });
9873+ return JSON.stringify({
9874+ result: 'Bybit credentials saved! You can now trade futures on Bybit.',
9875+ security_notice: 'Your credentials are encrypted with AES-256-GCM. Use IP-restricted API keys for maximum security.',
9876+ });
9877+ }
9878+
9879+ case 'setup_hyperliquid_credentials': {
9880+ await context.credentials.setCredentials(userId, 'hyperliquid', {
9881+ privateKey: toolInput.private_key as string,
9882+ walletAddress: (toolInput.wallet_address as string) || '',
9883+ });
9884+ return JSON.stringify({
9885+ result: 'Hyperliquid credentials saved! You can now trade on Hyperliquid.',
9886+ security_notice: 'Your private key is encrypted with AES-256-GCM. Consider using a dedicated trading wallet.',
9887+ });
9888+ }
9889+
9890+ case 'setup_mexc_credentials': {
9891+ await context.credentials.setCredentials(userId, 'mexc', {
9892+ apiKey: toolInput.api_key as string,
9893+ apiSecret: toolInput.api_secret as string,
9894+ });
9895+ return JSON.stringify({
9896+ result: 'MEXC credentials saved! You can now trade futures on MEXC.',
9897+ security_notice: 'Your credentials are encrypted with AES-256-GCM. Use IP-restricted API keys for maximum security.',
9898+ });
9899+ }
9900+
9901+ case 'setup_betfair_credentials': {
9902+ await context.credentials.setCredentials(userId, 'betfair', {
9903+ appKey: toolInput.app_key as string,
9904+ sessionToken: toolInput.session_token as string,
9905+ });
9906+ return JSON.stringify({
9907+ result: 'Betfair credentials saved! You can now trade on Betfair.',
9908+ security_notice: 'Your credentials are encrypted with AES-256-GCM. Session tokens expire — you may need to refresh periodically.',
9909+ });
9910+ }
9911+
97979912 case 'list_trading_credentials': {
97989913 const platforms = await context.credentials.listUserPlatforms(userId);
97999914
0 commit comments