UNPKG

@gala-chain/launchpad-mcp-server

Version:

MCP server for Gala Launchpad - 102 tools (pool management, event watchers, GSwap DEX trading, price history, token creation, wallet management, DEX pool discovery, liquidity positions, token locks, locked token queries, composite pool data, cross-chain b

79 lines 3.26 kB
"use strict"; /** * Token Lock/Unlock Tools */ Object.defineProperty(exports, "__esModule", { value: true }); exports.lockTools = exports.unlockTokenTool = exports.lockTokenTool = void 0; const response_formatter_js_1 = require("../../utils/response-formatter.js"); const error_handler_js_1 = require("../../utils/error-handler.js"); const common_schemas_js_1 = require("../../schemas/common-schemas.js"); // 1. Lock Token exports.lockTokenTool = { name: 'gala_launchpad_lock_token', description: 'Lock tokens on GalaChain. Locked tokens cannot be transferred until unlocked by the lock authority.', inputSchema: { type: 'object', properties: { tokenName: common_schemas_js_1.TOKEN_NAME_SCHEMA, amount: common_schemas_js_1.INTEGER_AMOUNT_SCHEMA, lockAuthority: { type: 'string', description: 'Address that can unlock these tokens (defaults to caller if not specified)', }, expires: { type: 'number', description: 'Optional expiration timestamp in milliseconds (epoch time). Lock auto-releases after this time.', }, name: { type: 'string', description: 'Optional name/identifier for the lock. Can be used to match during unlock.', }, uniqueKey: common_schemas_js_1.UNIQUE_KEY_SCHEMA, privateKey: common_schemas_js_1.PRIVATE_KEY_SCHEMA, }, required: ['tokenName', 'amount'], }, handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => { const result = await sdk.lockToken({ tokenName: args.tokenName, amount: args.amount, lockAuthority: args.lockAuthority, expires: args.expires, name: args.name, uniqueKey: args.uniqueKey, privateKey: args.privateKey, }); return (0, response_formatter_js_1.formatSuccess)(result); }), }; // 2. Unlock Token exports.unlockTokenTool = { name: 'gala_launchpad_unlock_token', description: 'Unlock previously locked tokens on GalaChain. Must be called by the lock authority.', inputSchema: { type: 'object', properties: { tokenName: common_schemas_js_1.TOKEN_NAME_SCHEMA, amount: common_schemas_js_1.INTEGER_AMOUNT_SCHEMA, name: { type: 'string', description: 'Optional name to match a specific lock (must match the name used during lock)', }, uniqueKey: common_schemas_js_1.UNIQUE_KEY_SCHEMA, privateKey: common_schemas_js_1.PRIVATE_KEY_SCHEMA, }, required: ['tokenName', 'amount'], }, handler: (0, error_handler_js_1.withErrorHandling)(async (sdk, args) => { const result = await sdk.unlockToken({ tokenName: args.tokenName, amount: args.amount, name: args.name, uniqueKey: args.uniqueKey, privateKey: args.privateKey, }); return (0, response_formatter_js_1.formatSuccess)(result); }), }; exports.lockTools = [exports.lockTokenTool, exports.unlockTokenTool]; //# sourceMappingURL=index.js.map