@gala-chain/launchpad-mcp-server 5.0.3 → 5.0.4-beta.1
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 +49 -21
- package/dist/ai-docs.json +7357 -0
- package/dist/constants/mcpToolNames.d.ts +3 -1
- package/dist/constants/mcpToolNames.d.ts.map +1 -1
- package/dist/constants/mcpToolNames.js +2 -1
- package/dist/constants/mcpToolNames.js.map +1 -1
- package/dist/explain-sdk-usage-ai.json +3445 -0
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.d.ts.map +1 -1
- package/dist/generated/version.js +1 -1
- package/dist/generated/version.js.map +1 -1
- package/dist/prompts/account.d.ts +24 -0
- package/dist/prompts/account.d.ts.map +1 -0
- package/dist/prompts/account.js +89 -0
- package/dist/prompts/account.js.map +1 -0
- package/dist/prompts/api-keys.d.ts +36 -0
- package/dist/prompts/api-keys.d.ts.map +1 -0
- package/dist/prompts/api-keys.js +251 -0
- package/dist/prompts/api-keys.js.map +1 -0
- package/dist/prompts/auth.d.ts +29 -0
- package/dist/prompts/auth.d.ts.map +1 -0
- package/dist/prompts/auth.js +127 -0
- package/dist/prompts/auth.js.map +1 -0
- package/dist/prompts/balances.d.ts.map +1 -1
- package/dist/prompts/balances.js +17 -17
- package/dist/prompts/balances.js.map +1 -1
- package/dist/prompts/bans.d.ts +23 -0
- package/dist/prompts/bans.d.ts.map +1 -0
- package/dist/prompts/bans.js +82 -0
- package/dist/prompts/bans.js.map +1 -0
- package/dist/prompts/bridge.d.ts +2 -1
- package/dist/prompts/bridge.d.ts.map +1 -1
- package/dist/prompts/bridge.js +91 -227
- package/dist/prompts/bridge.js.map +1 -1
- package/dist/prompts/burns.d.ts +30 -0
- package/dist/prompts/burns.d.ts.map +1 -0
- package/dist/prompts/burns.js +127 -0
- package/dist/prompts/burns.js.map +1 -0
- package/dist/prompts/chat-messages.d.ts +21 -0
- package/dist/prompts/chat-messages.d.ts.map +1 -0
- package/dist/prompts/chat-messages.js +103 -0
- package/dist/prompts/chat-messages.js.map +1 -0
- package/dist/prompts/chat.d.ts +67 -0
- package/dist/prompts/chat.d.ts.map +1 -0
- package/dist/prompts/chat.js +355 -0
- package/dist/prompts/chat.js.map +1 -0
- package/dist/prompts/comments.d.ts +29 -0
- package/dist/prompts/comments.d.ts.map +1 -0
- package/dist/prompts/comments.js +133 -0
- package/dist/prompts/comments.js.map +1 -0
- package/dist/prompts/content-flags.d.ts +29 -0
- package/dist/prompts/content-flags.d.ts.map +1 -0
- package/dist/prompts/content-flags.js +248 -0
- package/dist/prompts/content-flags.js.map +1 -0
- package/dist/prompts/content-reactions.d.ts +29 -0
- package/dist/prompts/content-reactions.d.ts.map +1 -0
- package/dist/prompts/content-reactions.js +77 -0
- package/dist/prompts/content-reactions.js.map +1 -0
- package/dist/prompts/create-token.d.ts.map +1 -1
- package/dist/prompts/create-token.js +11 -18
- package/dist/prompts/create-token.js.map +1 -1
- package/dist/prompts/dex-trading.d.ts.map +1 -1
- package/dist/prompts/dex-trading.js +11 -42
- package/dist/prompts/dex-trading.js.map +1 -1
- package/dist/prompts/discover-tokens.d.ts.map +1 -1
- package/dist/prompts/discover-tokens.js +11 -26
- package/dist/prompts/discover-tokens.js.map +1 -1
- package/dist/prompts/event-subscriptions.d.ts +45 -0
- package/dist/prompts/event-subscriptions.d.ts.map +1 -0
- package/dist/prompts/event-subscriptions.js +330 -0
- package/dist/prompts/event-subscriptions.js.map +1 -0
- package/dist/prompts/explore-dex-pools.d.ts +2 -0
- package/dist/prompts/explore-dex-pools.d.ts.map +1 -1
- package/dist/prompts/explore-dex-pools.js +26 -104
- package/dist/prompts/explore-dex-pools.js.map +1 -1
- package/dist/prompts/factories/balance-prompt-factory.d.ts +102 -0
- package/dist/prompts/factories/balance-prompt-factory.d.ts.map +1 -0
- package/dist/prompts/factories/balance-prompt-factory.js +176 -0
- package/dist/prompts/factories/balance-prompt-factory.js.map +1 -0
- package/dist/prompts/factories/ban-management-factory.d.ts +90 -0
- package/dist/prompts/factories/ban-management-factory.d.ts.map +1 -0
- package/dist/prompts/factories/ban-management-factory.js +330 -0
- package/dist/prompts/factories/ban-management-factory.js.map +1 -0
- package/dist/prompts/factories/calculation-prompt-factory.d.ts +119 -0
- package/dist/prompts/factories/calculation-prompt-factory.d.ts.map +1 -0
- package/dist/prompts/factories/calculation-prompt-factory.js +183 -0
- package/dist/prompts/factories/calculation-prompt-factory.js.map +1 -0
- package/dist/prompts/factories/discovery-prompt-factory.d.ts +135 -0
- package/dist/prompts/factories/discovery-prompt-factory.d.ts.map +1 -0
- package/dist/prompts/factories/discovery-prompt-factory.js +240 -0
- package/dist/prompts/factories/discovery-prompt-factory.js.map +1 -0
- package/dist/prompts/factories/event-subscription-factory.d.ts +177 -0
- package/dist/prompts/factories/event-subscription-factory.d.ts.map +1 -0
- package/dist/prompts/factories/event-subscription-factory.js +329 -0
- package/dist/prompts/factories/event-subscription-factory.js.map +1 -0
- package/dist/prompts/factories/filtered-list-prompt-factory.d.ts +95 -0
- package/dist/prompts/factories/filtered-list-prompt-factory.d.ts.map +1 -0
- package/dist/prompts/factories/filtered-list-prompt-factory.js +147 -0
- package/dist/prompts/factories/filtered-list-prompt-factory.js.map +1 -0
- package/dist/prompts/factories/index.d.ts +33 -0
- package/dist/prompts/factories/index.d.ts.map +1 -0
- package/dist/prompts/factories/index.js +91 -0
- package/dist/prompts/factories/index.js.map +1 -0
- package/dist/prompts/factories/invite-management-factory.d.ts +88 -0
- package/dist/prompts/factories/invite-management-factory.d.ts.map +1 -0
- package/dist/prompts/factories/invite-management-factory.js +262 -0
- package/dist/prompts/factories/invite-management-factory.js.map +1 -0
- package/dist/prompts/factories/reaction-prompt-factory.d.ts +81 -0
- package/dist/prompts/factories/reaction-prompt-factory.d.ts.map +1 -0
- package/dist/prompts/factories/reaction-prompt-factory.js +188 -0
- package/dist/prompts/factories/reaction-prompt-factory.js.map +1 -0
- package/dist/prompts/factories/simple-operation-factory.d.ts +166 -0
- package/dist/prompts/factories/simple-operation-factory.d.ts.map +1 -0
- package/dist/prompts/factories/simple-operation-factory.js +218 -0
- package/dist/prompts/factories/simple-operation-factory.js.map +1 -0
- package/dist/prompts/index.d.ts +31 -6
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +136 -5
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/locks.d.ts.map +1 -1
- package/dist/prompts/locks.js +32 -56
- package/dist/prompts/locks.js.map +1 -1
- package/dist/prompts/moderators.d.ts +22 -0
- package/dist/prompts/moderators.d.ts.map +1 -0
- package/dist/prompts/moderators.js +62 -0
- package/dist/prompts/moderators.js.map +1 -0
- package/dist/prompts/monitoring.d.ts +3 -1
- package/dist/prompts/monitoring.d.ts.map +1 -1
- package/dist/prompts/monitoring.js +52 -140
- package/dist/prompts/monitoring.js.map +1 -1
- package/dist/prompts/overseers.d.ts +34 -0
- package/dist/prompts/overseers.d.ts.map +1 -0
- package/dist/prompts/overseers.js +117 -0
- package/dist/prompts/overseers.js.map +1 -0
- package/dist/prompts/pools.d.ts +22 -20
- package/dist/prompts/pools.d.ts.map +1 -1
- package/dist/prompts/pools.js +150 -251
- package/dist/prompts/pools.js.map +1 -1
- package/dist/prompts/portfolio.d.ts.map +1 -1
- package/dist/prompts/portfolio.js +1 -9
- package/dist/prompts/portfolio.js.map +1 -1
- package/dist/prompts/prompt-factories.d.ts +179 -0
- package/dist/prompts/prompt-factories.d.ts.map +1 -0
- package/dist/prompts/prompt-factories.js +230 -0
- package/dist/prompts/prompt-factories.js.map +1 -0
- package/dist/prompts/referrals.d.ts +27 -0
- package/dist/prompts/referrals.d.ts.map +1 -0
- package/dist/prompts/referrals.js +176 -0
- package/dist/prompts/referrals.js.map +1 -0
- package/dist/prompts/streaming.d.ts +84 -0
- package/dist/prompts/streaming.d.ts.map +1 -0
- package/dist/prompts/streaming.js +411 -0
- package/dist/prompts/streaming.js.map +1 -0
- package/dist/prompts/tier1-bridge-operations.d.ts +30 -0
- package/dist/prompts/tier1-bridge-operations.d.ts.map +1 -0
- package/dist/prompts/tier1-bridge-operations.js +634 -0
- package/dist/prompts/tier1-bridge-operations.js.map +1 -0
- package/dist/prompts/tier1-liquidity-management.d.ts +30 -0
- package/dist/prompts/tier1-liquidity-management.d.ts.map +1 -0
- package/dist/prompts/tier1-liquidity-management.js +560 -0
- package/dist/prompts/tier1-liquidity-management.js.map +1 -0
- package/dist/prompts/tier1-pool-discovery.d.ts +30 -0
- package/dist/prompts/tier1-pool-discovery.d.ts.map +1 -0
- package/dist/prompts/tier1-pool-discovery.js +221 -0
- package/dist/prompts/tier1-pool-discovery.js.map +1 -0
- package/dist/prompts/tier1-price-history.d.ts +30 -0
- package/dist/prompts/tier1-price-history.d.ts.map +1 -0
- package/dist/prompts/tier1-price-history.js +429 -0
- package/dist/prompts/tier1-price-history.js.map +1 -0
- package/dist/prompts/tier1-token-analysis.d.ts +30 -0
- package/dist/prompts/tier1-token-analysis.d.ts.map +1 -0
- package/dist/prompts/tier1-token-analysis.js +376 -0
- package/dist/prompts/tier1-token-analysis.js.map +1 -0
- package/dist/prompts/tier2-account-setup.d.ts +24 -0
- package/dist/prompts/tier2-account-setup.d.ts.map +1 -0
- package/dist/prompts/tier2-account-setup.js +206 -0
- package/dist/prompts/tier2-account-setup.js.map +1 -0
- package/dist/prompts/tier2-advanced-liquidity.d.ts +24 -0
- package/dist/prompts/tier2-advanced-liquidity.d.ts.map +1 -0
- package/dist/prompts/tier2-advanced-liquidity.js +298 -0
- package/dist/prompts/tier2-advanced-liquidity.js.map +1 -0
- package/dist/prompts/tier2-asset-management.d.ts +25 -0
- package/dist/prompts/tier2-asset-management.d.ts.map +1 -0
- package/dist/prompts/tier2-asset-management.js +246 -0
- package/dist/prompts/tier2-asset-management.js.map +1 -0
- package/dist/prompts/tier2-token-lifecycle.d.ts +25 -0
- package/dist/prompts/tier2-token-lifecycle.d.ts.map +1 -0
- package/dist/prompts/tier2-token-lifecycle.js +241 -0
- package/dist/prompts/tier2-token-lifecycle.js.map +1 -0
- package/dist/prompts/tier3-community-engagement.d.ts +26 -0
- package/dist/prompts/tier3-community-engagement.d.ts.map +1 -0
- package/dist/prompts/tier3-community-engagement.js +610 -0
- package/dist/prompts/tier3-community-engagement.js.map +1 -0
- package/dist/prompts/tier3-moderation-workflows.d.ts +31 -0
- package/dist/prompts/tier3-moderation-workflows.d.ts.map +1 -0
- package/dist/prompts/tier3-moderation-workflows.js +511 -0
- package/dist/prompts/tier3-moderation-workflows.js.map +1 -0
- package/dist/prompts/tier3-streaming-management.d.ts +26 -0
- package/dist/prompts/tier3-streaming-management.d.ts.map +1 -0
- package/dist/prompts/tier3-streaming-management.js +797 -0
- package/dist/prompts/tier3-streaming-management.js.map +1 -0
- package/dist/prompts/token-bans.d.ts +27 -0
- package/dist/prompts/token-bans.d.ts.map +1 -0
- package/dist/prompts/token-bans.js +77 -0
- package/dist/prompts/token-bans.js.map +1 -0
- package/dist/prompts/trades.d.ts +22 -0
- package/dist/prompts/trades.d.ts.map +1 -0
- package/dist/prompts/trades.js +107 -0
- package/dist/prompts/trades.js.map +1 -0
- package/dist/prompts/trading-calculations.d.ts +3 -1
- package/dist/prompts/trading-calculations.d.ts.map +1 -1
- package/dist/prompts/trading-calculations.js +134 -270
- package/dist/prompts/trading-calculations.js.map +1 -1
- package/dist/prompts/trading.d.ts +10 -1
- package/dist/prompts/trading.d.ts.map +1 -1
- package/dist/prompts/trading.js +128 -2
- package/dist/prompts/trading.js.map +1 -1
- package/dist/prompts/transfers.d.ts +2 -1
- package/dist/prompts/transfers.d.ts.map +1 -1
- package/dist/prompts/transfers.js +26 -30
- package/dist/prompts/transfers.js.map +1 -1
- package/dist/prompts/uploads.d.ts +19 -0
- package/dist/prompts/uploads.d.ts.map +1 -0
- package/dist/prompts/uploads.js +114 -0
- package/dist/prompts/uploads.js.map +1 -0
- package/dist/prompts/utility-tools.d.ts.map +1 -1
- package/dist/prompts/utility-tools.js +27 -18
- package/dist/prompts/utility-tools.js.map +1 -1
- package/dist/prompts/utils/index.d.ts +21 -0
- package/dist/prompts/utils/index.d.ts.map +1 -0
- package/dist/prompts/utils/index.js +38 -0
- package/dist/prompts/utils/index.js.map +1 -0
- package/dist/prompts/utils/pagination-helpers.d.ts +95 -0
- package/dist/prompts/utils/pagination-helpers.d.ts.map +1 -0
- package/dist/prompts/utils/pagination-helpers.js +121 -0
- package/dist/prompts/utils/pagination-helpers.js.map +1 -0
- package/dist/prompts/utils/workflowTemplates.d.ts.map +1 -1
- package/dist/prompts/utils/workflowTemplates.js +4 -3
- package/dist/prompts/utils/workflowTemplates.js.map +1 -1
- package/dist/prompts/wallet.d.ts +24 -0
- package/dist/prompts/wallet.d.ts.map +1 -0
- package/dist/prompts/wallet.js +139 -0
- package/dist/prompts/wallet.js.map +1 -0
- package/dist/schemas/common-schemas.d.ts +890 -0
- package/dist/schemas/common-schemas.d.ts.map +1 -1
- package/dist/schemas/common-schemas.js +853 -1
- package/dist/schemas/common-schemas.js.map +1 -1
- package/dist/server.d.ts +31 -3
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +68 -7
- package/dist/server.js.map +1 -1
- package/dist/tools/api-keys/index.d.ts +41 -0
- package/dist/tools/api-keys/index.d.ts.map +1 -0
- package/dist/tools/api-keys/index.js +245 -0
- package/dist/tools/api-keys/index.js.map +1 -0
- package/dist/tools/auth/index.d.ts +19 -0
- package/dist/tools/auth/index.d.ts.map +1 -0
- package/dist/tools/auth/index.js +138 -0
- package/dist/tools/auth/index.js.map +1 -0
- package/dist/tools/balance/helpers/format-balance.d.ts +86 -0
- package/dist/tools/balance/helpers/format-balance.d.ts.map +1 -0
- package/dist/tools/balance/helpers/format-balance.js +87 -0
- package/dist/tools/balance/helpers/format-balance.js.map +1 -0
- package/dist/tools/balance/index.d.ts +4 -4
- package/dist/tools/balance/index.d.ts.map +1 -1
- package/dist/tools/balance/index.js +64 -176
- package/dist/tools/balance/index.js.map +1 -1
- package/dist/tools/ban/index.d.ts +37 -0
- package/dist/tools/ban/index.d.ts.map +1 -0
- package/dist/tools/ban/index.js +206 -0
- package/dist/tools/ban/index.js.map +1 -0
- package/dist/tools/bridge/helpers/bridgeable-token-tools.d.ts +87 -0
- package/dist/tools/bridge/helpers/bridgeable-token-tools.d.ts.map +1 -0
- package/dist/tools/bridge/helpers/bridgeable-token-tools.js +130 -0
- package/dist/tools/bridge/helpers/bridgeable-token-tools.js.map +1 -0
- package/dist/tools/bridge/helpers/external-chain-balance-tools.d.ts +87 -0
- package/dist/tools/bridge/helpers/external-chain-balance-tools.d.ts.map +1 -0
- package/dist/tools/bridge/helpers/external-chain-balance-tools.js +167 -0
- package/dist/tools/bridge/helpers/external-chain-balance-tools.js.map +1 -0
- package/dist/tools/bridge/index.d.ts +3 -7
- package/dist/tools/bridge/index.d.ts.map +1 -1
- package/dist/tools/bridge/index.js +89 -371
- package/dist/tools/bridge/index.js.map +1 -1
- package/dist/tools/burns/index.d.ts.map +1 -1
- package/dist/tools/burns/index.js +8 -36
- package/dist/tools/burns/index.js.map +1 -1
- package/dist/tools/chat/getPinnedChatMessage.d.ts +15 -0
- package/dist/tools/chat/getPinnedChatMessage.d.ts.map +1 -0
- package/dist/tools/chat/getPinnedChatMessage.js +37 -0
- package/dist/tools/chat/getPinnedChatMessage.js.map +1 -0
- package/dist/tools/chat/index.d.ts +73 -0
- package/dist/tools/chat/index.d.ts.map +1 -0
- package/dist/tools/chat/index.js +359 -0
- package/dist/tools/chat/index.js.map +1 -0
- package/dist/tools/chat/pinChatMessage.d.ts +16 -0
- package/dist/tools/chat/pinChatMessage.d.ts.map +1 -0
- package/dist/tools/chat/pinChatMessage.js +51 -0
- package/dist/tools/chat/pinChatMessage.js.map +1 -0
- package/dist/tools/chat/unpinChatMessage.d.ts +16 -0
- package/dist/tools/chat/unpinChatMessage.d.ts.map +1 -0
- package/dist/tools/chat/unpinChatMessage.js +39 -0
- package/dist/tools/chat/unpinChatMessage.js.map +1 -0
- package/dist/tools/chat-messages/index.d.ts +35 -0
- package/dist/tools/chat-messages/index.d.ts.map +1 -0
- package/dist/tools/chat-messages/index.js +165 -0
- package/dist/tools/chat-messages/index.js.map +1 -0
- package/dist/tools/comments/index.d.ts +44 -0
- package/dist/tools/comments/index.d.ts.map +1 -0
- package/dist/tools/comments/index.js +171 -0
- package/dist/tools/comments/index.js.map +1 -0
- package/dist/tools/content-flags/index.d.ts +38 -0
- package/dist/tools/content-flags/index.d.ts.map +1 -0
- package/dist/tools/content-flags/index.js +282 -0
- package/dist/tools/content-flags/index.js.map +1 -0
- package/dist/tools/content-reactions/index.d.ts +43 -0
- package/dist/tools/content-reactions/index.d.ts.map +1 -0
- package/dist/tools/content-reactions/index.js +135 -0
- package/dist/tools/content-reactions/index.js.map +1 -0
- package/dist/tools/creation/index.d.ts.map +1 -1
- package/dist/tools/creation/index.js +2 -5
- package/dist/tools/creation/index.js.map +1 -1
- package/dist/tools/dex/fetchAllDexPools.d.ts.map +1 -1
- package/dist/tools/dex/fetchAllDexPools.js +5 -21
- package/dist/tools/dex/fetchAllDexPools.js.map +1 -1
- package/dist/tools/dex/fetchDexPools.d.ts.map +1 -1
- package/dist/tools/dex/fetchDexPools.js +11 -28
- package/dist/tools/dex/fetchDexPools.js.map +1 -1
- package/dist/tools/dex/helpers.d.ts +479 -0
- package/dist/tools/dex/helpers.d.ts.map +1 -0
- package/dist/tools/dex/helpers.js +570 -0
- package/dist/tools/dex/helpers.js.map +1 -0
- package/dist/tools/dex/index.d.ts +50 -11
- package/dist/tools/dex/index.d.ts.map +1 -1
- package/dist/tools/dex/index.js +124 -486
- package/dist/tools/dex/index.js.map +1 -1
- package/dist/tools/dex/leaderboard.d.ts.map +1 -1
- package/dist/tools/dex/leaderboard.js +5 -70
- package/dist/tools/dex/leaderboard.js.map +1 -1
- package/dist/tools/dex/liquidity-positions.d.ts.map +1 -1
- package/dist/tools/dex/liquidity-positions.js +20 -91
- package/dist/tools/dex/liquidity-positions.js.map +1 -1
- package/dist/tools/dex/volume.d.ts.map +1 -1
- package/dist/tools/dex/volume.js +6 -21
- package/dist/tools/dex/volume.js.map +1 -1
- package/dist/tools/dex-analytics/index.d.ts +48 -0
- package/dist/tools/dex-analytics/index.d.ts.map +1 -0
- package/dist/tools/dex-analytics/index.js +111 -0
- package/dist/tools/dex-analytics/index.js.map +1 -0
- package/dist/tools/dex-liquidity/index.d.ts +22 -0
- package/dist/tools/dex-liquidity/index.d.ts.map +1 -0
- package/dist/tools/dex-liquidity/index.js +384 -0
- package/dist/tools/dex-liquidity/index.js.map +1 -0
- package/dist/tools/dex-pools/index.d.ts +60 -0
- package/dist/tools/dex-pools/index.d.ts.map +1 -0
- package/dist/tools/dex-pools/index.js +231 -0
- package/dist/tools/dex-pools/index.js.map +1 -0
- package/dist/tools/handler-factories.d.ts +1401 -0
- package/dist/tools/handler-factories.d.ts.map +1 -0
- package/dist/tools/handler-factories.js +1680 -0
- package/dist/tools/handler-factories.js.map +1 -0
- package/dist/tools/index.d.ts +1 -11
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +171 -27
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/locks/index.d.ts +2 -0
- package/dist/tools/locks/index.d.ts.map +1 -1
- package/dist/tools/locks/index.js +9 -86
- package/dist/tools/locks/index.js.map +1 -1
- package/dist/tools/moderators/index.d.ts +53 -0
- package/dist/tools/moderators/index.d.ts.map +1 -0
- package/dist/tools/moderators/index.js +258 -0
- package/dist/tools/moderators/index.js.map +1 -0
- package/dist/tools/overseers/getOverseerUserSummary.d.ts +15 -0
- package/dist/tools/overseers/getOverseerUserSummary.d.ts.map +1 -0
- package/dist/tools/overseers/getOverseerUserSummary.js +40 -0
- package/dist/tools/overseers/getOverseerUserSummary.js.map +1 -0
- package/dist/tools/overseers/index.d.ts +58 -0
- package/dist/tools/overseers/index.d.ts.map +1 -0
- package/dist/tools/overseers/index.js +325 -0
- package/dist/tools/overseers/index.js.map +1 -0
- package/dist/tools/overseers/listOverseerUsers.d.ts +15 -0
- package/dist/tools/overseers/listOverseerUsers.d.ts.map +1 -0
- package/dist/tools/overseers/listOverseerUsers.js +76 -0
- package/dist/tools/overseers/listOverseerUsers.js.map +1 -0
- package/dist/tools/pagination-handler-factory.d.ts +131 -0
- package/dist/tools/pagination-handler-factory.d.ts.map +1 -0
- package/dist/tools/pagination-handler-factory.js +159 -0
- package/dist/tools/pagination-handler-factory.js.map +1 -0
- package/dist/tools/pools/checkPoolExists.d.ts +16 -0
- package/dist/tools/pools/checkPoolExists.d.ts.map +1 -0
- package/dist/tools/pools/checkPoolExists.js +48 -0
- package/dist/tools/pools/checkPoolExists.js.map +1 -0
- package/dist/tools/pools/fetchAllPools.d.ts.map +1 -1
- package/dist/tools/pools/fetchAllPools.js +51 -11
- package/dist/tools/pools/fetchAllPools.js.map +1 -1
- package/dist/tools/pools/fetchAllPriceHistory.d.ts.map +1 -1
- package/dist/tools/pools/fetchAllPriceHistory.js +11 -51
- package/dist/tools/pools/fetchAllPriceHistory.js.map +1 -1
- package/dist/tools/pools/fetchPoolDetails.d.ts.map +1 -1
- package/dist/tools/pools/fetchPoolDetails.js +4 -11
- package/dist/tools/pools/fetchPoolDetails.js.map +1 -1
- package/dist/tools/pools/fetchPools.d.ts.map +1 -1
- package/dist/tools/pools/fetchPools.js +40 -20
- package/dist/tools/pools/fetchPools.js.map +1 -1
- package/dist/tools/pools/fetchPriceHistory.d.ts.map +1 -1
- package/dist/tools/pools/fetchPriceHistory.js +10 -51
- package/dist/tools/pools/fetchPriceHistory.js.map +1 -1
- package/dist/tools/pools/fetchTokenDetails.d.ts.map +1 -1
- package/dist/tools/pools/fetchTokenDetails.js +4 -35
- package/dist/tools/pools/fetchTokenDetails.js.map +1 -1
- package/dist/tools/pools/index.d.ts +2 -0
- package/dist/tools/pools/index.d.ts.map +1 -1
- package/dist/tools/pools/index.js +103 -35
- package/dist/tools/pools/index.js.map +1 -1
- package/dist/tools/pools/onDexPoolCreation.d.ts +1 -2
- package/dist/tools/pools/onDexPoolCreation.d.ts.map +1 -1
- package/dist/tools/pools/onDexPoolCreation.js +14 -48
- package/dist/tools/pools/onDexPoolCreation.js.map +1 -1
- package/dist/tools/pools/onLaunchpadTokenCreation.d.ts +1 -2
- package/dist/tools/pools/onLaunchpadTokenCreation.d.ts.map +1 -1
- package/dist/tools/pools/onLaunchpadTokenCreation.js +9 -42
- package/dist/tools/pools/onLaunchpadTokenCreation.js.map +1 -1
- package/dist/tools/pools/priceHistoryFactory.d.ts +44 -0
- package/dist/tools/pools/priceHistoryFactory.d.ts.map +1 -0
- package/dist/tools/pools/priceHistoryFactory.js +154 -0
- package/dist/tools/pools/priceHistoryFactory.js.map +1 -0
- package/dist/tools/pools/updateTokenSocials.d.ts +16 -0
- package/dist/tools/pools/updateTokenSocials.d.ts.map +1 -0
- package/dist/tools/pools/updateTokenSocials.js +84 -0
- package/dist/tools/pools/updateTokenSocials.js.map +1 -0
- package/dist/tools/referrals/index.d.ts +12 -0
- package/dist/tools/referrals/index.d.ts.map +1 -0
- package/dist/tools/referrals/index.js +110 -0
- package/dist/tools/referrals/index.js.map +1 -0
- package/dist/tools/streaming/index.d.ts +94 -0
- package/dist/tools/streaming/index.d.ts.map +1 -0
- package/dist/tools/streaming/index.js +549 -0
- package/dist/tools/streaming/index.js.map +1 -0
- package/dist/tools/streaming/setNextLiveStreamCountdown.d.ts +16 -0
- package/dist/tools/streaming/setNextLiveStreamCountdown.d.ts.map +1 -0
- package/dist/tools/streaming/setNextLiveStreamCountdown.js +62 -0
- package/dist/tools/streaming/setNextLiveStreamCountdown.js.map +1 -0
- package/dist/tools/token-ban/index.d.ts +39 -0
- package/dist/tools/token-ban/index.d.ts.map +1 -0
- package/dist/tools/token-ban/index.js +177 -0
- package/dist/tools/token-ban/index.js.map +1 -0
- package/dist/tools/tool-factory.d.ts +84 -0
- package/dist/tools/tool-factory.d.ts.map +1 -0
- package/dist/tools/tool-factory.js +135 -0
- package/dist/tools/tool-factory.js.map +1 -0
- package/dist/tools/trades/index.d.ts +20 -0
- package/dist/tools/trades/index.d.ts.map +1 -0
- package/dist/tools/trades/index.js +113 -0
- package/dist/tools/trades/index.js.map +1 -0
- package/dist/tools/trading/helpers/arg-extractors.d.ts +128 -0
- package/dist/tools/trading/helpers/arg-extractors.d.ts.map +1 -0
- package/dist/tools/trading/helpers/arg-extractors.js +215 -0
- package/dist/tools/trading/helpers/arg-extractors.js.map +1 -0
- package/dist/tools/trading/helpers/index.d.ts +8 -0
- package/dist/tools/trading/helpers/index.d.ts.map +1 -0
- package/dist/tools/trading/helpers/index.js +24 -0
- package/dist/tools/trading/helpers/index.js.map +1 -0
- package/dist/tools/trading/helpers/trading-schemas.d.ts +276 -0
- package/dist/tools/trading/helpers/trading-schemas.d.ts.map +1 -0
- package/dist/tools/trading/helpers/trading-schemas.js +310 -0
- package/dist/tools/trading/helpers/trading-schemas.js.map +1 -0
- package/dist/tools/trading/index.d.ts +2 -0
- package/dist/tools/trading/index.d.ts.map +1 -1
- package/dist/tools/trading/index.js +148 -371
- package/dist/tools/trading/index.js.map +1 -1
- package/dist/tools/transfers/index.d.ts +3 -0
- package/dist/tools/transfers/index.d.ts.map +1 -1
- package/dist/tools/transfers/index.js +72 -52
- package/dist/tools/transfers/index.js.map +1 -1
- package/dist/tools/utils/cleanup.d.ts.map +1 -1
- package/dist/tools/utils/cleanup.js +2 -9
- package/dist/tools/utils/cleanup.js.map +1 -1
- package/dist/tools/utils/clearCache.d.ts.map +1 -1
- package/dist/tools/utils/clearCache.js +5 -7
- package/dist/tools/utils/clearCache.js.map +1 -1
- package/dist/tools/utils/explainSdkUsage.d.ts +52 -0
- package/dist/tools/utils/explainSdkUsage.d.ts.map +1 -1
- package/dist/tools/utils/explainSdkUsage.js +1905 -93
- package/dist/tools/utils/explainSdkUsage.js.map +1 -1
- package/dist/tools/utils/getEthereumAddressFromPrivateKey.d.ts.map +1 -1
- package/dist/tools/utils/getEthereumAddressFromPrivateKey.js +2 -1
- package/dist/tools/utils/getEthereumAddressFromPrivateKey.js.map +1 -1
- package/dist/tools/utils/index.d.ts +2 -0
- package/dist/tools/utils/index.d.ts.map +1 -1
- package/dist/tools/utils/index.js +2 -12
- package/dist/tools/utils/index.js.map +1 -1
- package/dist/tools/wallet/index.d.ts +7 -0
- package/dist/tools/wallet/index.d.ts.map +1 -0
- package/dist/tools/wallet/index.js +24 -0
- package/dist/tools/wallet/index.js.map +1 -0
- package/dist/utils/date-converter.d.ts +58 -0
- package/dist/utils/date-converter.d.ts.map +1 -0
- package/dist/utils/date-converter.js +83 -0
- package/dist/utils/date-converter.js.map +1 -0
- package/dist/utils/pool-filter-builder.d.ts +78 -0
- package/dist/utils/pool-filter-builder.d.ts.map +1 -0
- package/dist/utils/pool-filter-builder.js +130 -0
- package/dist/utils/pool-filter-builder.js.map +1 -0
- package/dist/utils/safe-parsers.d.ts +87 -0
- package/dist/utils/safe-parsers.d.ts.map +1 -0
- package/dist/utils/safe-parsers.js +134 -0
- package/dist/utils/safe-parsers.js.map +1 -0
- package/dist/utils/validation.d.ts +5 -5
- package/dist/utils/validation.d.ts.map +1 -1
- package/dist/utils/validation.js +23 -21
- package/dist/utils/validation.js.map +1 -1
- package/package.json +23 -15
- package/.env.example +0 -21
- package/.eslintrc.json +0 -88
- package/CHANGELOG.md +0 -2161
- package/DOCS_AUDIT_REPORT.md +0 -189
- package/DRY_REFACTORING_GUIDE.md +0 -271
- package/MCP_COVERAGE_REPORT.md +0 -164
- package/MCP_TEST_ANALYSIS.md +0 -317
- package/jest.integration.config.js +0 -70
- package/scripts/inject-version.ts +0 -31
- package/scripts/validate-mcp-test-analysis.ts +0 -250
|
@@ -0,0 +1,1401 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Handler Factory Utilities
|
|
3
|
+
*
|
|
4
|
+
* Provides reusable factory functions for creating MCP tool handlers with common patterns.
|
|
5
|
+
* Reduces boilerplate and ensures consistent error handling across all tools.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // Simple single-arg handler
|
|
9
|
+
* const handler = createSimpleHandler('fetchGalaBalance', (args) => args.address);
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // Toggle enable/disable pattern
|
|
13
|
+
* const handler = createToggleHandler('enableChat', 'disableChat');
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Transaction status handler
|
|
17
|
+
* const handler = createTransactionStatusHandler('getSolanaTransactionStatus', 'Solana');
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* // No-arg convenience fetcher
|
|
21
|
+
* const handler = createConvenienceFetcher('getGlobalChatStatus');
|
|
22
|
+
*/
|
|
23
|
+
import type { MCPToolResponse } from '../types/mcp.js';
|
|
24
|
+
import type { LaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
25
|
+
/**
|
|
26
|
+
* Core SDK invocation result
|
|
27
|
+
*/
|
|
28
|
+
interface SdkInvocationResult<T = unknown> {
|
|
29
|
+
result: T;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Options for invoking an SDK method
|
|
33
|
+
*
|
|
34
|
+
* @internal Used by handler factories to invoke SDK methods with consistent error handling.
|
|
35
|
+
*/
|
|
36
|
+
interface InvokeSdkMethodOptions {
|
|
37
|
+
/**
|
|
38
|
+
* The SDK instance to call the method on.
|
|
39
|
+
* Method will be looked up as sdk[methodName].
|
|
40
|
+
*/
|
|
41
|
+
sdk: LaunchpadSDK;
|
|
42
|
+
/**
|
|
43
|
+
* Name of the SDK method to call.
|
|
44
|
+
* Must be a valid method name on LaunchpadSDK (validated at runtime).
|
|
45
|
+
*/
|
|
46
|
+
methodName: string;
|
|
47
|
+
/**
|
|
48
|
+
* Extracted arguments to pass to the method.
|
|
49
|
+
* - `undefined`: Calls method with no arguments
|
|
50
|
+
* - Array: Spreads as positional arguments via apply()
|
|
51
|
+
* - Other: Passes as single argument via call()
|
|
52
|
+
*/
|
|
53
|
+
extractedArgs?: unknown | unknown[];
|
|
54
|
+
/**
|
|
55
|
+
* Context for error messages.
|
|
56
|
+
* Defaults to methodName if not provided.
|
|
57
|
+
*/
|
|
58
|
+
errorContext?: string;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Core helper: Looks up and invokes an SDK method with the given arguments.
|
|
62
|
+
*
|
|
63
|
+
* This is the core primitive that all handler factories use. It handles:
|
|
64
|
+
* - Method lookup on the SDK instance
|
|
65
|
+
* - Method existence validation
|
|
66
|
+
* - Argument handling (no args, single arg, spread array)
|
|
67
|
+
* - Proper `this` binding via call/apply
|
|
68
|
+
*
|
|
69
|
+
* @param options - Invocation configuration
|
|
70
|
+
* @returns Promise resolving to the SDK method result
|
|
71
|
+
* @throws Error if the SDK method doesn't exist
|
|
72
|
+
*
|
|
73
|
+
* @internal Exported for use by pagination-handler-factory; not part of public API.
|
|
74
|
+
*/
|
|
75
|
+
export declare function invokeSdkMethod<T = unknown>(options: InvokeSdkMethodOptions): Promise<SdkInvocationResult<T>>;
|
|
76
|
+
/**
|
|
77
|
+
* Creates a simple handler that calls an SDK method with extracted arguments.
|
|
78
|
+
*
|
|
79
|
+
* Handles single or multi-argument SDK methods, with optional custom argument extraction.
|
|
80
|
+
*
|
|
81
|
+
* @param sdkMethodName - Name of the SDK method to call (must exist on LaunchpadSDK)
|
|
82
|
+
* @param argExtractor - Optional function to extract/transform args before calling SDK method
|
|
83
|
+
* @returns Handler that calls the SDK method and returns formatted success response
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* // Simple single-arg extraction
|
|
87
|
+
* const handler = createSimpleHandler('fetchGalaBalance', (args) => args.address);
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* // Multi-arg extraction
|
|
91
|
+
* const handler = createSimpleHandler('fetchTokenBalance', (args) => [
|
|
92
|
+
* args.tokenName,
|
|
93
|
+
* args.address
|
|
94
|
+
* ]);
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* // No extraction (uses entire args object)
|
|
98
|
+
* const handler = createSimpleHandler('registerAccount');
|
|
99
|
+
*/
|
|
100
|
+
export declare function createSimpleHandler(sdkMethodName: string, argExtractor?: (args: Record<string, unknown>) => unknown | unknown[]): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
101
|
+
/**
|
|
102
|
+
* Creates a toggle handler for enable/disable patterns.
|
|
103
|
+
*
|
|
104
|
+
* Returns a handler that calls the appropriate enable or disable SDK method
|
|
105
|
+
* based on the `enabled` argument value.
|
|
106
|
+
*
|
|
107
|
+
* @param enableMethod - Name of the SDK method to enable (called when enabled=true)
|
|
108
|
+
* @param disableMethod - Name of the SDK method to disable (called when enabled=false)
|
|
109
|
+
* @param argExtractor - Optional function to extract arguments for the SDK methods
|
|
110
|
+
* @returns Handler that toggles between enable and disable methods
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* const handler = createToggleHandler('enableChat', 'disableChat', (args) => args.tokenName);
|
|
114
|
+
*
|
|
115
|
+
* // When args = { enabled: true, tokenName: 'mytoken' }
|
|
116
|
+
* // Calls: sdk.enableChat('mytoken')
|
|
117
|
+
*
|
|
118
|
+
* // When args = { enabled: false, tokenName: 'mytoken' }
|
|
119
|
+
* // Calls: sdk.disableChat('mytoken')
|
|
120
|
+
*/
|
|
121
|
+
export declare function createToggleHandler(enableMethod: string, disableMethod: string, argExtractor?: (args: Record<string, unknown>) => unknown | unknown[]): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
122
|
+
/**
|
|
123
|
+
* Creates a transaction status handler for blockchain transaction queries.
|
|
124
|
+
*
|
|
125
|
+
* Handles transaction status patterns like getSolanaTransactionStatus and getEthereumTransactionStatus.
|
|
126
|
+
* These methods typically require a transaction hash and optional chain hint.
|
|
127
|
+
*
|
|
128
|
+
* @param sdkMethod - Name of the SDK method to call (e.g., 'getSolanaTransactionStatus')
|
|
129
|
+
* @param chainName - Name of the chain for context in error messages
|
|
130
|
+
* @returns Handler that queries transaction status
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* const handler = createTransactionStatusHandler('getSolanaTransactionStatus', 'Solana');
|
|
134
|
+
*
|
|
135
|
+
* // Args expected: { transactionHash, chainHint? }
|
|
136
|
+
*/
|
|
137
|
+
export declare function createTransactionStatusHandler(sdkMethod: string, chainName: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
138
|
+
/**
|
|
139
|
+
* Creates a convenience fetcher handler for simple no-arg or single-arg SDK methods.
|
|
140
|
+
*
|
|
141
|
+
* Ideal for read-only queries that don't require complex argument extraction.
|
|
142
|
+
* Automatically formats the result as JSON.
|
|
143
|
+
*
|
|
144
|
+
* @param sdkMethod - Name of the SDK method to call
|
|
145
|
+
* @param argExtractor - Optional function to extract single argument
|
|
146
|
+
* @returns Handler that fetches data from SDK
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* // No-arg fetcher
|
|
150
|
+
* const handler = createConvenienceFetcher('getGlobalChatStatus');
|
|
151
|
+
*
|
|
152
|
+
* // Single-arg fetcher
|
|
153
|
+
* const handler = createConvenienceFetcher('fetchProfile', (args) => args.address);
|
|
154
|
+
*/
|
|
155
|
+
export declare function createConvenienceFetcher(sdkMethod: string, argExtractor?: (args: Record<string, unknown>) => unknown): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
156
|
+
/**
|
|
157
|
+
* Creates a simple handler that returns a boolean success result.
|
|
158
|
+
*
|
|
159
|
+
* Use this for handlers that call SDK methods and just need to report success/failure,
|
|
160
|
+
* rather than returning the full SDK result.
|
|
161
|
+
*
|
|
162
|
+
* @param sdkMethodName - Name of the SDK method to call
|
|
163
|
+
* @param argExtractor - Optional function to extract/transform args before calling SDK method
|
|
164
|
+
* @param successMessage - Optional custom success message (defaults to "Operation completed successfully")
|
|
165
|
+
* @returns Handler that calls the SDK method and returns formatted boolean response
|
|
166
|
+
*
|
|
167
|
+
* @example
|
|
168
|
+
* const handler = createBooleanHandler('updateProfile', (args) => [
|
|
169
|
+
* { fullName: args.fullName, profileImage: args.profileImage },
|
|
170
|
+
* args.address,
|
|
171
|
+
* args.privateKey
|
|
172
|
+
* ], 'Profile updated successfully');
|
|
173
|
+
*/
|
|
174
|
+
export declare function createBooleanHandler(sdkMethodName: string, argExtractor?: (args: Record<string, unknown>) => unknown | unknown[], successMessage?: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
175
|
+
/**
|
|
176
|
+
* Creates a handler with custom result transformation.
|
|
177
|
+
*
|
|
178
|
+
* Use this for handlers that need to post-process SDK results before formatting.
|
|
179
|
+
* The resultTransformer receives the raw SDK result and args, and returns the
|
|
180
|
+
* transformed data to be formatted.
|
|
181
|
+
*
|
|
182
|
+
* @param sdkMethodName - Name of the SDK method to call
|
|
183
|
+
* @param argExtractor - Optional function to extract/transform args before calling SDK method
|
|
184
|
+
* @param resultTransformer - Function to transform the SDK result before formatting
|
|
185
|
+
* @returns Handler that calls the SDK method and returns formatted transformed response
|
|
186
|
+
*
|
|
187
|
+
* @example
|
|
188
|
+
* const handler = createTransformingHandler(
|
|
189
|
+
* 'getSupportedBridgeTokens',
|
|
190
|
+
* undefined,
|
|
191
|
+
* (result, args) => {
|
|
192
|
+
* if (args.chain) {
|
|
193
|
+
* return result.tokens.filter(t => t.supportedChains.includes(args.chain));
|
|
194
|
+
* }
|
|
195
|
+
* return result;
|
|
196
|
+
* }
|
|
197
|
+
* );
|
|
198
|
+
*/
|
|
199
|
+
export declare function createTransformingHandler<TResult, TTransformed>(sdkMethodName: string, argExtractor: ((args: Record<string, unknown>) => unknown | unknown[]) | undefined, resultTransformer: (result: TResult, args: Record<string, unknown>) => TTransformed): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
200
|
+
/**
|
|
201
|
+
* Creates a reaction handler for add/remove reaction operations.
|
|
202
|
+
*
|
|
203
|
+
* This factory handles the common pattern of reaction operations that take
|
|
204
|
+
* tokenName, messageId, and reactionType parameters. Consolidates add/remove
|
|
205
|
+
* into a single factory with operation type parameter.
|
|
206
|
+
*
|
|
207
|
+
* Note: The `operation` parameter is intentionally kept for API clarity and
|
|
208
|
+
* future extensibility (e.g., logging, metrics). The actual SDK method
|
|
209
|
+
* determines the operation semantics.
|
|
210
|
+
*
|
|
211
|
+
* @param _operation - Either 'add' or 'remove' (documents intent, used for API clarity)
|
|
212
|
+
* @param sdkMethodName - Name of the SDK method to call
|
|
213
|
+
* @returns Handler that calls the SDK method with reaction parameters
|
|
214
|
+
*
|
|
215
|
+
* @example
|
|
216
|
+
* // Create add reaction handler
|
|
217
|
+
* const handler = createReactionHandler('add', 'addContentReaction');
|
|
218
|
+
*
|
|
219
|
+
* // Create remove reaction handler
|
|
220
|
+
* const handler = createReactionHandler('remove', 'removeContentReaction');
|
|
221
|
+
*
|
|
222
|
+
* @since 5.13.0
|
|
223
|
+
*/
|
|
224
|
+
export declare function createReactionHandler(operation: 'add' | 'remove', sdkMethodName: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
225
|
+
/**
|
|
226
|
+
* Creates a WebSocket action handler with custom response formatting.
|
|
227
|
+
*
|
|
228
|
+
* This factory handles WebSocket operations that don't return meaningful
|
|
229
|
+
* SDK responses but need to return a custom success response.
|
|
230
|
+
*
|
|
231
|
+
* @param sdkMethodName - Name of the SDK method to call
|
|
232
|
+
* @param argExtractor - Function to extract arguments from input
|
|
233
|
+
* @param responseBuilder - Function to build the success response from args
|
|
234
|
+
* @returns Handler that calls SDK method and returns custom response
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* const handler = createWebSocketActionHandler(
|
|
238
|
+
* 'sendStreamChatViaWebSocket',
|
|
239
|
+
* (args) => [args.tokenName, args.content],
|
|
240
|
+
* (args) => ({ sent: true, tokenName: args.tokenName, content: args.content })
|
|
241
|
+
* );
|
|
242
|
+
*
|
|
243
|
+
* @since 5.13.0
|
|
244
|
+
*/
|
|
245
|
+
export declare function createWebSocketActionHandler(sdkMethodName: string, argExtractor: (args: Record<string, unknown>) => unknown[], responseBuilder: (args: Record<string, unknown>) => Record<string, unknown>): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
246
|
+
/**
|
|
247
|
+
* Creates a typing indicator handler for start/stop typing operations.
|
|
248
|
+
*
|
|
249
|
+
* This factory handles the typing indicator pattern where a boolean
|
|
250
|
+
* determines which SDK method to call (sendTypingStart or sendTypingStop).
|
|
251
|
+
*
|
|
252
|
+
* Note: This handler uses synchronous SDK methods, which is why it doesn't
|
|
253
|
+
* use the shared invokeSdkMethod helper (designed for async methods).
|
|
254
|
+
*
|
|
255
|
+
* @param startMethod - SDK method name for start typing (sync method)
|
|
256
|
+
* @param stopMethod - SDK method name for stop typing (sync method)
|
|
257
|
+
* @returns Handler that calls appropriate method based on isTyping flag
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* const handler = createTypingIndicatorHandler('sendTypingStart', 'sendTypingStop');
|
|
261
|
+
*
|
|
262
|
+
* @since 5.13.0
|
|
263
|
+
*/
|
|
264
|
+
export declare function createTypingIndicatorHandler(startMethod: string, stopMethod: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
265
|
+
/**
|
|
266
|
+
* Configuration for content CRUD handler factories.
|
|
267
|
+
*
|
|
268
|
+
* These factories consolidate the common CRUD patterns found in comments,
|
|
269
|
+
* chat-messages, and similar streaming content tools.
|
|
270
|
+
*/
|
|
271
|
+
export interface ContentCrudConfig {
|
|
272
|
+
/**
|
|
273
|
+
* SDK method name for the list operation (e.g., 'getComments', 'getChatMessages')
|
|
274
|
+
*/
|
|
275
|
+
listMethod: string;
|
|
276
|
+
/**
|
|
277
|
+
* SDK method name for the create operation (e.g., 'createComment', 'sendChatMessage')
|
|
278
|
+
*/
|
|
279
|
+
createMethod: string;
|
|
280
|
+
/**
|
|
281
|
+
* SDK method name for the update operation (e.g., 'updateComment', 'updateChatMessage')
|
|
282
|
+
*/
|
|
283
|
+
updateMethod: string;
|
|
284
|
+
/**
|
|
285
|
+
* SDK method name for the delete operation (e.g., 'deleteComment', 'deleteChatMessage')
|
|
286
|
+
*/
|
|
287
|
+
deleteMethod: string;
|
|
288
|
+
/**
|
|
289
|
+
* Human-readable resource name for error messages (e.g., 'Comment', 'Chat message')
|
|
290
|
+
*/
|
|
291
|
+
resourceName: string;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Creates a list handler for content with tokenName/userAddress filters and pagination.
|
|
295
|
+
*
|
|
296
|
+
* This factory handles the common pattern of listing content (comments, chat messages)
|
|
297
|
+
* with optional tokenName and/or userAddress filters plus pagination.
|
|
298
|
+
*
|
|
299
|
+
* @param sdkMethod - Name of the SDK method to call
|
|
300
|
+
* @param options - Configuration options
|
|
301
|
+
* @returns Handler that lists content with filters and pagination
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* const handler = createContentListHandler('getComments', {
|
|
305
|
+
* requireAtLeastOneFilter: true,
|
|
306
|
+
* resourceName: 'comments'
|
|
307
|
+
* });
|
|
308
|
+
*
|
|
309
|
+
* @since 6.3.0
|
|
310
|
+
*/
|
|
311
|
+
export declare function createContentListHandler(sdkMethod: string, options?: {
|
|
312
|
+
/** Whether at least one of tokenName or userAddress is required */
|
|
313
|
+
requireAtLeastOneFilter?: boolean;
|
|
314
|
+
/** Resource name for error messages */
|
|
315
|
+
resourceName?: string;
|
|
316
|
+
}): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
317
|
+
/**
|
|
318
|
+
* Creates a create handler for content with tokenName and content fields.
|
|
319
|
+
*
|
|
320
|
+
* This factory handles the common pattern of creating content (comments, chat messages)
|
|
321
|
+
* with tokenName and content as required fields.
|
|
322
|
+
*
|
|
323
|
+
* @param sdkMethod - Name of the SDK method to call
|
|
324
|
+
* @returns Handler that creates content
|
|
325
|
+
*
|
|
326
|
+
* @example
|
|
327
|
+
* const handler = createContentCreateHandler('createComment');
|
|
328
|
+
*
|
|
329
|
+
* @since 6.3.0
|
|
330
|
+
*/
|
|
331
|
+
export declare function createContentCreateHandler(sdkMethod: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
332
|
+
/**
|
|
333
|
+
* Creates an update handler for content with id and content fields.
|
|
334
|
+
*
|
|
335
|
+
* This factory handles the common pattern of updating content (comments, chat messages)
|
|
336
|
+
* with id and content wrapped in an update object.
|
|
337
|
+
*
|
|
338
|
+
* @param sdkMethod - Name of the SDK method to call
|
|
339
|
+
* @returns Handler that updates content
|
|
340
|
+
*
|
|
341
|
+
* @example
|
|
342
|
+
* const handler = createContentUpdateHandler('updateComment');
|
|
343
|
+
*
|
|
344
|
+
* @since 6.3.0
|
|
345
|
+
*/
|
|
346
|
+
export declare function createContentUpdateHandler(sdkMethod: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
347
|
+
/**
|
|
348
|
+
* Creates a delete handler for content with just an id field.
|
|
349
|
+
*
|
|
350
|
+
* This factory handles the common pattern of deleting content (comments, chat messages)
|
|
351
|
+
* by id, returning a boolean success response.
|
|
352
|
+
*
|
|
353
|
+
* @param sdkMethod - Name of the SDK method to call
|
|
354
|
+
* @param successMessage - Optional custom success message
|
|
355
|
+
* @returns Handler that deletes content
|
|
356
|
+
*
|
|
357
|
+
* @example
|
|
358
|
+
* const handler = createContentDeleteHandler('deleteComment', 'Comment deleted');
|
|
359
|
+
*
|
|
360
|
+
* @since 6.3.0
|
|
361
|
+
*/
|
|
362
|
+
export declare function createContentDeleteHandler(sdkMethod: string, successMessage?: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
363
|
+
/**
|
|
364
|
+
* Creates all four CRUD handlers for a content resource.
|
|
365
|
+
*
|
|
366
|
+
* Returns an object with list, create, update, and delete handlers configured
|
|
367
|
+
* for the specified SDK methods. This is a convenience factory for resources
|
|
368
|
+
* that implement the full CRUD pattern.
|
|
369
|
+
*
|
|
370
|
+
* @param config - Configuration specifying SDK methods and resource name
|
|
371
|
+
* @returns Object containing all four CRUD handlers
|
|
372
|
+
*
|
|
373
|
+
* @example
|
|
374
|
+
* const { list, create, update, delete: remove } = createContentCrudHandlers({
|
|
375
|
+
* listMethod: 'getComments',
|
|
376
|
+
* createMethod: 'createComment',
|
|
377
|
+
* updateMethod: 'updateComment',
|
|
378
|
+
* deleteMethod: 'deleteComment',
|
|
379
|
+
* resourceName: 'Comment'
|
|
380
|
+
* });
|
|
381
|
+
*
|
|
382
|
+
* @since 6.3.0
|
|
383
|
+
*/
|
|
384
|
+
export declare function createContentCrudHandlers(config: ContentCrudConfig): {
|
|
385
|
+
list: (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
386
|
+
create: (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
387
|
+
update: (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
388
|
+
delete: (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
389
|
+
};
|
|
390
|
+
/**
|
|
391
|
+
* Configuration for streaming resource handlers.
|
|
392
|
+
*
|
|
393
|
+
* Streaming resources follow patterns like:
|
|
394
|
+
* - list: List resources for a token (paginated)
|
|
395
|
+
* - get: Get a single resource by tokenName + resourceId
|
|
396
|
+
* - delete: Delete a resource by tokenName + resourceId
|
|
397
|
+
*/
|
|
398
|
+
export interface StreamingResourceConfig {
|
|
399
|
+
/**
|
|
400
|
+
* SDK method name for the list operation
|
|
401
|
+
*/
|
|
402
|
+
listMethod: string;
|
|
403
|
+
/**
|
|
404
|
+
* SDK method name for the get operation (optional)
|
|
405
|
+
*/
|
|
406
|
+
getMethod?: string;
|
|
407
|
+
/**
|
|
408
|
+
* SDK method name for the delete operation (optional)
|
|
409
|
+
*/
|
|
410
|
+
deleteMethod?: string;
|
|
411
|
+
/**
|
|
412
|
+
* Name of the resource ID field in args (e.g., 'assetId', 'targetId')
|
|
413
|
+
*/
|
|
414
|
+
resourceIdField: string;
|
|
415
|
+
/**
|
|
416
|
+
* Human-readable resource name for success messages
|
|
417
|
+
*/
|
|
418
|
+
resourceName: string;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Creates a list handler for streaming resources with tokenName and pagination.
|
|
422
|
+
*
|
|
423
|
+
* @param sdkMethod - Name of the SDK method to call
|
|
424
|
+
* @returns Handler that lists streaming resources
|
|
425
|
+
*
|
|
426
|
+
* @example
|
|
427
|
+
* const handler = createStreamingListHandler('getStreamRecordings');
|
|
428
|
+
*
|
|
429
|
+
* @since 6.3.0
|
|
430
|
+
*/
|
|
431
|
+
export declare function createStreamingListHandler(sdkMethod: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
432
|
+
/**
|
|
433
|
+
* Creates a get/fetch handler for streaming resources with tokenName and resourceId.
|
|
434
|
+
*
|
|
435
|
+
* @param sdkMethod - Name of the SDK method to call
|
|
436
|
+
* @param resourceIdField - Name of the resource ID field in args
|
|
437
|
+
* @returns Handler that fetches a single streaming resource
|
|
438
|
+
*
|
|
439
|
+
* @example
|
|
440
|
+
* const handler = createStreamingGetHandler('getRecordingDownload', 'assetId');
|
|
441
|
+
*
|
|
442
|
+
* @since 6.3.0
|
|
443
|
+
*/
|
|
444
|
+
export declare function createStreamingGetHandler(sdkMethod: string, resourceIdField: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
445
|
+
/**
|
|
446
|
+
* Creates a delete handler for streaming resources with tokenName and resourceId.
|
|
447
|
+
*
|
|
448
|
+
* @param sdkMethod - Name of the SDK method to call
|
|
449
|
+
* @param resourceIdField - Name of the resource ID field in args
|
|
450
|
+
* @param successMessage - Success message to return
|
|
451
|
+
* @returns Handler that deletes a streaming resource
|
|
452
|
+
*
|
|
453
|
+
* @example
|
|
454
|
+
* const handler = createStreamingDeleteHandler('deleteRecording', 'assetId', 'Recording deleted');
|
|
455
|
+
*
|
|
456
|
+
* @since 6.3.0
|
|
457
|
+
*/
|
|
458
|
+
export declare function createStreamingDeleteHandler(sdkMethod: string, resourceIdField: string, successMessage: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
459
|
+
/**
|
|
460
|
+
* Creates a handler for operations that take tokenName and userAddress.
|
|
461
|
+
*
|
|
462
|
+
* This is a common pattern for ban/moderation operations:
|
|
463
|
+
* - createBan
|
|
464
|
+
* - removeBan
|
|
465
|
+
* - getBanStatus
|
|
466
|
+
*
|
|
467
|
+
* Reduces boilerplate by providing consistent argument extraction.
|
|
468
|
+
*
|
|
469
|
+
* @param sdkMethodName - Name of the SDK method to call
|
|
470
|
+
* @param additionalExtractor - Optional function to extract additional arguments
|
|
471
|
+
* @returns Handler that calls SDK method with tokenName, userAddress, and optional extras
|
|
472
|
+
*
|
|
473
|
+
* @example
|
|
474
|
+
* // Simple case: tokenName + userAddress only
|
|
475
|
+
* const handler = createTokenUserHandler('removeBan');
|
|
476
|
+
*
|
|
477
|
+
* // With additional args
|
|
478
|
+
* const handler = createTokenUserHandler('createBan', (args) => ({
|
|
479
|
+
* reason: args.reason as string | undefined,
|
|
480
|
+
* durationSeconds: args.durationSeconds as number | undefined,
|
|
481
|
+
* }));
|
|
482
|
+
*
|
|
483
|
+
* @since 6.6.0
|
|
484
|
+
*/
|
|
485
|
+
export declare function createTokenUserHandler(sdkMethodName: string, additionalExtractor?: (args: Record<string, unknown>) => Record<string, unknown>): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
486
|
+
/**
|
|
487
|
+
* Creates a handler for no-argument async actions that return a custom response.
|
|
488
|
+
*
|
|
489
|
+
* Use this for SDK methods that take no arguments and need a custom success response.
|
|
490
|
+
* Ideal for WebSocket connection management, initialization operations, etc.
|
|
491
|
+
*
|
|
492
|
+
* @param sdkMethodName - Name of the SDK method to call (takes no arguments)
|
|
493
|
+
* @param successResponse - Static response to return on success
|
|
494
|
+
* @returns Handler that calls SDK method and returns the custom response
|
|
495
|
+
*
|
|
496
|
+
* @example
|
|
497
|
+
* const handler = createNoArgActionHandler(
|
|
498
|
+
* 'connectStreamWebSocket',
|
|
499
|
+
* { connected: true, message: 'Connected to stream WebSocket' }
|
|
500
|
+
* );
|
|
501
|
+
*
|
|
502
|
+
* @since 6.6.0
|
|
503
|
+
*/
|
|
504
|
+
export declare function createNoArgActionHandler(sdkMethodName: string, successResponse: Record<string, unknown>): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
505
|
+
/**
|
|
506
|
+
* Configuration for wrap/unwrap tool creation
|
|
507
|
+
*/
|
|
508
|
+
export interface WrapUnwrapToolConfig {
|
|
509
|
+
/** Tool name (e.g., 'gala_launchpad_wrap_token') */
|
|
510
|
+
name: string;
|
|
511
|
+
/** Tool description */
|
|
512
|
+
description: string;
|
|
513
|
+
/** SDK method to call ('wrapToken' or 'unwrapToken') */
|
|
514
|
+
sdkMethodName: 'wrapToken' | 'unwrapToken';
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Creates a wrap or unwrap handler for cross-channel bridge operations.
|
|
518
|
+
*
|
|
519
|
+
* Both wrap and unwrap operations share identical structure:
|
|
520
|
+
* - tokenId (flexible format)
|
|
521
|
+
* - amount (decimal string)
|
|
522
|
+
* - recipient (optional)
|
|
523
|
+
* - memo (optional)
|
|
524
|
+
*
|
|
525
|
+
* The only difference is the SDK method called.
|
|
526
|
+
*
|
|
527
|
+
* @param sdkMethodName - Either 'wrapToken' or 'unwrapToken'
|
|
528
|
+
* @returns Handler for the wrap/unwrap operation
|
|
529
|
+
*
|
|
530
|
+
* @example
|
|
531
|
+
* const wrapHandler = createWrapUnwrapHandler('wrapToken');
|
|
532
|
+
* const unwrapHandler = createWrapUnwrapHandler('unwrapToken');
|
|
533
|
+
*
|
|
534
|
+
* @since 6.4.0
|
|
535
|
+
*/
|
|
536
|
+
export declare function createWrapUnwrapHandler(sdkMethodName: 'wrapToken' | 'unwrapToken'): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
537
|
+
/**
|
|
538
|
+
* Supported external blockchain chains for balance operations.
|
|
539
|
+
*/
|
|
540
|
+
export type ExternalChain = 'Ethereum' | 'Solana';
|
|
541
|
+
/**
|
|
542
|
+
* Configuration for external chain balance tool creation.
|
|
543
|
+
*
|
|
544
|
+
* These tools share identical patterns across Ethereum and Solana:
|
|
545
|
+
* - Token balance: symbol + optional address
|
|
546
|
+
* - Native balance: optional address only
|
|
547
|
+
* - All balances: optional address only
|
|
548
|
+
*/
|
|
549
|
+
export interface ExternalChainBalanceConfig {
|
|
550
|
+
/** Chain identifier */
|
|
551
|
+
chain: ExternalChain;
|
|
552
|
+
/** Chain-specific address format (for description) */
|
|
553
|
+
addressFormat: string;
|
|
554
|
+
/** Native token symbol (ETH for Ethereum, SOL for Solana) */
|
|
555
|
+
nativeSymbol: string;
|
|
556
|
+
/** Supported ERC-20/SPL token symbols */
|
|
557
|
+
tokenSymbols: string[];
|
|
558
|
+
/** Number of RPC calls for "all balances" operation */
|
|
559
|
+
allBalancesRpcCount: number;
|
|
560
|
+
}
|
|
561
|
+
/**
|
|
562
|
+
* Pre-configured chain settings for Ethereum and Solana.
|
|
563
|
+
* Single source of truth for chain-specific configuration.
|
|
564
|
+
*/
|
|
565
|
+
export declare const EXTERNAL_CHAIN_CONFIG: Record<ExternalChain, ExternalChainBalanceConfig>;
|
|
566
|
+
/**
|
|
567
|
+
* Creates a token balance handler for external chains (Ethereum ERC-20, Solana SPL).
|
|
568
|
+
*
|
|
569
|
+
* Used for fetching single token balances on external chains.
|
|
570
|
+
* Takes symbol and optional address, returns token balance.
|
|
571
|
+
*
|
|
572
|
+
* @param chain - Target chain ('Ethereum' or 'Solana')
|
|
573
|
+
* @returns Handler that fetches single token balance
|
|
574
|
+
*
|
|
575
|
+
* @example
|
|
576
|
+
* const handler = createExternalTokenBalanceHandler('Ethereum');
|
|
577
|
+
* // SDK method: fetchEthereumWalletTokenBalance
|
|
578
|
+
*
|
|
579
|
+
* @since 6.5.0
|
|
580
|
+
*/
|
|
581
|
+
export declare function createExternalTokenBalanceHandler(chain: ExternalChain): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
582
|
+
/**
|
|
583
|
+
* Creates a native balance handler for external chains (ETH, SOL).
|
|
584
|
+
*
|
|
585
|
+
* Used for fetching native currency balance on external chains.
|
|
586
|
+
* Takes optional address, returns native balance.
|
|
587
|
+
*
|
|
588
|
+
* @param chain - Target chain ('Ethereum' or 'Solana')
|
|
589
|
+
* @returns Handler that fetches native currency balance
|
|
590
|
+
*
|
|
591
|
+
* @example
|
|
592
|
+
* const handler = createExternalNativeBalanceHandler('Solana');
|
|
593
|
+
* // SDK method: fetchSolanaWalletNativeBalance
|
|
594
|
+
*
|
|
595
|
+
* @since 6.5.0
|
|
596
|
+
*/
|
|
597
|
+
export declare function createExternalNativeBalanceHandler(chain: ExternalChain): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
598
|
+
/**
|
|
599
|
+
* Creates an all-balances handler for external chains.
|
|
600
|
+
*
|
|
601
|
+
* Used for fetching all supported token balances on external chains.
|
|
602
|
+
* Takes optional address, returns native + all supported token balances.
|
|
603
|
+
*
|
|
604
|
+
* @param chain - Target chain ('Ethereum' or 'Solana')
|
|
605
|
+
* @returns Handler that fetches all balances
|
|
606
|
+
*
|
|
607
|
+
* @example
|
|
608
|
+
* const handler = createExternalAllBalancesHandler('Ethereum');
|
|
609
|
+
* // SDK method: fetchEthereumWalletAllBalances
|
|
610
|
+
*
|
|
611
|
+
* @since 6.5.0
|
|
612
|
+
*/
|
|
613
|
+
export declare function createExternalAllBalancesHandler(chain: ExternalChain): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
614
|
+
/**
|
|
615
|
+
* Field definition for generic argument extraction.
|
|
616
|
+
*
|
|
617
|
+
* Specifies how to extract and type a single field from MCP args.
|
|
618
|
+
*
|
|
619
|
+
* @since 6.11.0
|
|
620
|
+
*/
|
|
621
|
+
export interface FieldDefinition {
|
|
622
|
+
/** The field name in MCP args */
|
|
623
|
+
name: string;
|
|
624
|
+
/** Whether the field is required (default: false, meaning undefined allowed) */
|
|
625
|
+
required?: boolean;
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Creates a type-safe argument extractor function from field definitions.
|
|
629
|
+
*
|
|
630
|
+
* This factory eliminates repetitive argument extraction patterns like:
|
|
631
|
+
* ```typescript
|
|
632
|
+
* // Before (repeated many times)
|
|
633
|
+
* function extractFooArgs(args: Record<string, unknown>): FooArgs {
|
|
634
|
+
* return {
|
|
635
|
+
* page: args.page as number | undefined,
|
|
636
|
+
* limit: args.limit as number | undefined,
|
|
637
|
+
* };
|
|
638
|
+
* }
|
|
639
|
+
*
|
|
640
|
+
* // After
|
|
641
|
+
* const extractFooArgs = createArgumentExtractor<FooArgs>(['page', 'limit']);
|
|
642
|
+
* ```
|
|
643
|
+
*
|
|
644
|
+
* @param fields - Array of field names to extract (strings or FieldDefinition objects)
|
|
645
|
+
* @returns Function that extracts specified fields from MCP args with proper typing
|
|
646
|
+
*
|
|
647
|
+
* @example
|
|
648
|
+
* // Simple field names (all optional)
|
|
649
|
+
* const extractPaginationArgs = createArgumentExtractor<PaginationArgs>(['page', 'limit']);
|
|
650
|
+
*
|
|
651
|
+
* @example
|
|
652
|
+
* // Mixed required/optional
|
|
653
|
+
* const extractTransferArgs = createArgumentExtractor<TransferArgs>([
|
|
654
|
+
* { name: 'recipientAddress', required: true },
|
|
655
|
+
* { name: 'amount', required: true },
|
|
656
|
+
* 'uniqueKey', // optional
|
|
657
|
+
* 'privateKey', // optional
|
|
658
|
+
* ]);
|
|
659
|
+
*
|
|
660
|
+
* @since 6.11.0
|
|
661
|
+
*/
|
|
662
|
+
export declare function createArgumentExtractor<T>(fields: (string | FieldDefinition)[]): (args: Record<string, unknown>) => T;
|
|
663
|
+
/**
|
|
664
|
+
* Standard pagination parameters extracted from MCP tool args.
|
|
665
|
+
*
|
|
666
|
+
* Used by list/query operations that support page-based pagination.
|
|
667
|
+
*
|
|
668
|
+
* @since 6.7.0
|
|
669
|
+
*/
|
|
670
|
+
export interface PaginationArgs {
|
|
671
|
+
page: number | undefined;
|
|
672
|
+
limit: number | undefined;
|
|
673
|
+
}
|
|
674
|
+
/**
|
|
675
|
+
* Offset-based pagination parameters for bridgeable/wrappable token queries.
|
|
676
|
+
*
|
|
677
|
+
* @since 6.7.0
|
|
678
|
+
*/
|
|
679
|
+
export interface OffsetPaginationArgs {
|
|
680
|
+
offset: number | undefined;
|
|
681
|
+
limit: number | undefined;
|
|
682
|
+
}
|
|
683
|
+
/**
|
|
684
|
+
* Common filter parameters for list operations with search capabilities.
|
|
685
|
+
*
|
|
686
|
+
* @since 6.7.0
|
|
687
|
+
*/
|
|
688
|
+
export interface SearchFilterArgs {
|
|
689
|
+
search: string | undefined;
|
|
690
|
+
name: string | undefined;
|
|
691
|
+
userAddress: string | undefined;
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Extracts standard page/limit pagination from MCP args.
|
|
695
|
+
*
|
|
696
|
+
* Use this helper to avoid repetitive casting in list handlers.
|
|
697
|
+
*
|
|
698
|
+
* @param args - MCP tool arguments
|
|
699
|
+
* @returns Typed pagination object with page and limit
|
|
700
|
+
*
|
|
701
|
+
* @example
|
|
702
|
+
* handler: createSimpleHandler('listItems', (args) => ({
|
|
703
|
+
* tokenName: args.tokenName as string,
|
|
704
|
+
* ...extractPaginationArgs(args),
|
|
705
|
+
* })),
|
|
706
|
+
*
|
|
707
|
+
* @since 6.7.0
|
|
708
|
+
*/
|
|
709
|
+
export declare const extractPaginationArgs: (args: Record<string, unknown>) => PaginationArgs;
|
|
710
|
+
/**
|
|
711
|
+
* Creates a handler for SDK methods that take an optional wallet address.
|
|
712
|
+
*
|
|
713
|
+
* Consolidates the common pattern where an SDK method accepts an optional
|
|
714
|
+
* address parameter that defaults to the SDK's configured wallet.
|
|
715
|
+
*
|
|
716
|
+
* @param sdkMethodName - Name of the SDK method to call
|
|
717
|
+
* @returns Handler that fetches data with optional address
|
|
718
|
+
*
|
|
719
|
+
* @example
|
|
720
|
+
* // For fetchGalaBalance, fetchProfile
|
|
721
|
+
* const handler = createOptionalAddressFetcher('fetchGalaBalance');
|
|
722
|
+
*
|
|
723
|
+
* @since 6.8.0
|
|
724
|
+
*/
|
|
725
|
+
export declare function createOptionalAddressFetcher(sdkMethodName: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
726
|
+
/**
|
|
727
|
+
* Creates a handler for SDK methods that take tokenName and address parameters.
|
|
728
|
+
*
|
|
729
|
+
* Consolidates the common pattern for balance queries that need both
|
|
730
|
+
* a token identifier and a wallet address.
|
|
731
|
+
*
|
|
732
|
+
* @param sdkMethodName - Name of the SDK method to call
|
|
733
|
+
* @returns Handler that fetches token-specific data for an address
|
|
734
|
+
*
|
|
735
|
+
* @example
|
|
736
|
+
* // For fetchTokenBalance
|
|
737
|
+
* const handler = createTokenAddressHandler('fetchTokenBalance');
|
|
738
|
+
*
|
|
739
|
+
* @since 6.8.0
|
|
740
|
+
*/
|
|
741
|
+
export declare function createTokenAddressHandler(sdkMethodName: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
742
|
+
/**
|
|
743
|
+
* Extracts offset/limit pagination from MCP args.
|
|
744
|
+
*
|
|
745
|
+
* Used for bridgeable token queries that use offset-based pagination.
|
|
746
|
+
*
|
|
747
|
+
* @param args - MCP tool arguments
|
|
748
|
+
* @returns Typed pagination object with offset and limit
|
|
749
|
+
*
|
|
750
|
+
* @example
|
|
751
|
+
* handler: createSimpleHandler('fetchTokens', (args) => ({
|
|
752
|
+
* network: args.network as string,
|
|
753
|
+
* ...extractOffsetPaginationArgs(args),
|
|
754
|
+
* })),
|
|
755
|
+
*
|
|
756
|
+
* @since 6.7.0
|
|
757
|
+
*/
|
|
758
|
+
export declare const extractOffsetPaginationArgs: (args: Record<string, unknown>) => OffsetPaginationArgs;
|
|
759
|
+
/**
|
|
760
|
+
* Extracts common search/filter parameters from MCP args.
|
|
761
|
+
*
|
|
762
|
+
* Used for list operations that support search, name, and userAddress filters.
|
|
763
|
+
*
|
|
764
|
+
* @param args - MCP tool arguments
|
|
765
|
+
* @returns Typed filter object
|
|
766
|
+
*
|
|
767
|
+
* @example
|
|
768
|
+
* handler: createSimpleHandler('listBans', (args) => ({
|
|
769
|
+
* tokenName: args.tokenName as string,
|
|
770
|
+
* ...extractPaginationArgs(args),
|
|
771
|
+
* ...extractSearchFilterArgs(args),
|
|
772
|
+
* })),
|
|
773
|
+
*
|
|
774
|
+
* @since 6.7.0
|
|
775
|
+
*/
|
|
776
|
+
export declare const extractSearchFilterArgs: (args: Record<string, unknown>) => SearchFilterArgs;
|
|
777
|
+
/**
|
|
778
|
+
* Extracts status filter with typed union constraint.
|
|
779
|
+
*
|
|
780
|
+
* @param args - MCP tool arguments
|
|
781
|
+
* @returns Status string or undefined
|
|
782
|
+
*
|
|
783
|
+
* @example
|
|
784
|
+
* handler: createSimpleHandler('listInvites', (args) => ({
|
|
785
|
+
* ...extractPaginationArgs(args),
|
|
786
|
+
* status: extractStatusArg<'PENDING' | 'CLAIMED' | 'REVOKED' | 'EXPIRED'>(args),
|
|
787
|
+
* })),
|
|
788
|
+
*
|
|
789
|
+
* @since 6.7.0
|
|
790
|
+
*/
|
|
791
|
+
export declare function extractStatusArg<T extends string>(args: Record<string, unknown>): T | undefined;
|
|
792
|
+
/**
|
|
793
|
+
* Creates a handler for paginated list operations with common patterns.
|
|
794
|
+
*
|
|
795
|
+
* This factory reduces boilerplate for handlers that:
|
|
796
|
+
* - Require tokenName (optional or required)
|
|
797
|
+
* - Use page/limit pagination
|
|
798
|
+
* - Optionally include status filter
|
|
799
|
+
*
|
|
800
|
+
* @param sdkMethodName - Name of the SDK method to call
|
|
801
|
+
* @param options - Configuration options
|
|
802
|
+
* @returns Handler that calls SDK method with extracted args
|
|
803
|
+
*
|
|
804
|
+
* @example
|
|
805
|
+
* const handler = createPaginatedListHandler('listModeratorInvites', {
|
|
806
|
+
* tokenNameRequired: false,
|
|
807
|
+
* includeStatus: true,
|
|
808
|
+
* });
|
|
809
|
+
*
|
|
810
|
+
* @since 6.7.0
|
|
811
|
+
*/
|
|
812
|
+
export declare function createPaginatedListHandler<TStatus extends string = string>(sdkMethodName: string, options?: {
|
|
813
|
+
/** Whether tokenName is required (true) or optional (false) */
|
|
814
|
+
tokenNameRequired?: boolean;
|
|
815
|
+
/** Whether to include status filter in args */
|
|
816
|
+
includeStatus?: boolean;
|
|
817
|
+
}): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
818
|
+
/**
|
|
819
|
+
* Common arguments for batch token operations (lock, unlock).
|
|
820
|
+
*/
|
|
821
|
+
interface BatchTokenOperationArgs {
|
|
822
|
+
tokens: Array<{
|
|
823
|
+
tokenName: string;
|
|
824
|
+
amount: string;
|
|
825
|
+
}>;
|
|
826
|
+
uniqueKey: string | undefined;
|
|
827
|
+
privateKey: string | undefined;
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* Extracts common batch token operation args from MCP tool args.
|
|
831
|
+
*
|
|
832
|
+
* Used by lockTokens and unlockTokens which share identical argument patterns.
|
|
833
|
+
*
|
|
834
|
+
* @param args - MCP tool arguments
|
|
835
|
+
* @returns Typed batch operation arguments
|
|
836
|
+
*
|
|
837
|
+
* @since 6.8.0
|
|
838
|
+
*/
|
|
839
|
+
export declare const extractBatchTokenOperationArgs: (args: Record<string, unknown>) => BatchTokenOperationArgs;
|
|
840
|
+
/**
|
|
841
|
+
* Creates a handler for batch token operations (lock, unlock).
|
|
842
|
+
*
|
|
843
|
+
* Consolidates the common pattern for operations that batch multiple
|
|
844
|
+
* token amounts with optional uniqueKey and privateKey.
|
|
845
|
+
*
|
|
846
|
+
* @param sdkMethodName - Name of the SDK method to call ('lockTokens' or 'unlockTokens')
|
|
847
|
+
* @returns Handler that processes batch token operations
|
|
848
|
+
*
|
|
849
|
+
* @example
|
|
850
|
+
* const lockHandler = createBatchTokenOperationHandler('lockTokens');
|
|
851
|
+
* const unlockHandler = createBatchTokenOperationHandler('unlockTokens');
|
|
852
|
+
*
|
|
853
|
+
* @since 6.8.0
|
|
854
|
+
*/
|
|
855
|
+
export declare function createBatchTokenOperationHandler(sdkMethodName: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
856
|
+
/**
|
|
857
|
+
* Common base arguments shared by all transfer operations.
|
|
858
|
+
*
|
|
859
|
+
* @since 6.11.0
|
|
860
|
+
*/
|
|
861
|
+
interface BaseTransferArgs {
|
|
862
|
+
amount: string;
|
|
863
|
+
uniqueKey: string | undefined;
|
|
864
|
+
privateKey: string | undefined;
|
|
865
|
+
}
|
|
866
|
+
/**
|
|
867
|
+
* Arguments for GALA transfer operations (uses recipientAddress).
|
|
868
|
+
*/
|
|
869
|
+
interface TransferArgs extends BaseTransferArgs {
|
|
870
|
+
recipientAddress: string;
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* Arguments for token transfer operations (uses 'to' and tokenName).
|
|
874
|
+
*/
|
|
875
|
+
interface TokenTransferArgs extends BaseTransferArgs {
|
|
876
|
+
to: string;
|
|
877
|
+
tokenName: string;
|
|
878
|
+
}
|
|
879
|
+
/**
|
|
880
|
+
* Extracts GALA transfer args from MCP tool args.
|
|
881
|
+
*
|
|
882
|
+
* Used by transferGala which uses recipientAddress.
|
|
883
|
+
*
|
|
884
|
+
* @param args - MCP tool arguments
|
|
885
|
+
* @returns Typed transfer arguments
|
|
886
|
+
*
|
|
887
|
+
* @since 6.8.0
|
|
888
|
+
*/
|
|
889
|
+
export declare function extractTransferArgs(args: Record<string, unknown>): TransferArgs;
|
|
890
|
+
/**
|
|
891
|
+
* Extracts token transfer args from MCP tool args.
|
|
892
|
+
*
|
|
893
|
+
* Used by transferToken which uses 'to' and tokenName.
|
|
894
|
+
*
|
|
895
|
+
* @param args - MCP tool arguments
|
|
896
|
+
* @returns Typed token transfer arguments
|
|
897
|
+
*
|
|
898
|
+
* @since 6.8.0
|
|
899
|
+
*/
|
|
900
|
+
export declare function extractTokenTransferArgs(args: Record<string, unknown>): TokenTransferArgs;
|
|
901
|
+
/**
|
|
902
|
+
* Creates a handler for GALA transfer operations.
|
|
903
|
+
*
|
|
904
|
+
* Consolidates the GALA transfer pattern which uses recipientAddress.
|
|
905
|
+
*
|
|
906
|
+
* @returns Handler that processes GALA transfers
|
|
907
|
+
*
|
|
908
|
+
* @example
|
|
909
|
+
* const handler = createGalaTransferHandler();
|
|
910
|
+
*
|
|
911
|
+
* @since 6.8.0
|
|
912
|
+
*/
|
|
913
|
+
export declare function createGalaTransferHandler(): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
914
|
+
/**
|
|
915
|
+
* Creates a handler for token transfer operations.
|
|
916
|
+
*
|
|
917
|
+
* Consolidates the token transfer pattern which uses 'to' and tokenName.
|
|
918
|
+
*
|
|
919
|
+
* @returns Handler that processes token transfers
|
|
920
|
+
*
|
|
921
|
+
* @example
|
|
922
|
+
* const handler = createTokenTransferHandler();
|
|
923
|
+
*
|
|
924
|
+
* @since 6.8.0
|
|
925
|
+
*/
|
|
926
|
+
export declare function createTokenTransferHandler(): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
927
|
+
/**
|
|
928
|
+
* Creates a fetcher handler for SDK methods that take tokenName as the sole argument.
|
|
929
|
+
*
|
|
930
|
+
* This is a specialized version of createConvenienceFetcher that eliminates the
|
|
931
|
+
* repetitive pattern: `(args) => args.tokenName as string`
|
|
932
|
+
*
|
|
933
|
+
* Common in streaming/chat status tools:
|
|
934
|
+
* - getChatStatus
|
|
935
|
+
* - getStreamInfo
|
|
936
|
+
* - getSimulcastTargets
|
|
937
|
+
* - resetStreamKey
|
|
938
|
+
*
|
|
939
|
+
* @param sdkMethod - Name of the SDK method that accepts tokenName
|
|
940
|
+
* @returns Handler that calls SDK method with tokenName extracted from args
|
|
941
|
+
*
|
|
942
|
+
* @example
|
|
943
|
+
* // Before (repetitive)
|
|
944
|
+
* handler: createConvenienceFetcher('getChatStatus', (args) => args.tokenName as string),
|
|
945
|
+
* handler: createConvenienceFetcher('getStreamInfo', (args) => args.tokenName as string),
|
|
946
|
+
*
|
|
947
|
+
* // After (DRY)
|
|
948
|
+
* handler: createTokenNameFetcher('getChatStatus'),
|
|
949
|
+
* handler: createTokenNameFetcher('getStreamInfo'),
|
|
950
|
+
*
|
|
951
|
+
* @since 6.8.0
|
|
952
|
+
*/
|
|
953
|
+
export declare function createTokenNameFetcher(sdkMethod: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
954
|
+
/**
|
|
955
|
+
* Creates a simple handler for SDK methods that take tokenName as the sole argument.
|
|
956
|
+
*
|
|
957
|
+
* Similar to createTokenNameFetcher but uses createSimpleHandler internally.
|
|
958
|
+
* Use this for write operations that take only tokenName.
|
|
959
|
+
*
|
|
960
|
+
* @param sdkMethod - Name of the SDK method that accepts tokenName
|
|
961
|
+
* @returns Handler that calls SDK method with tokenName extracted from args
|
|
962
|
+
*
|
|
963
|
+
* @example
|
|
964
|
+
* // Before (repetitive)
|
|
965
|
+
* handler: createSimpleHandler('startStream', (args) => args.tokenName as string),
|
|
966
|
+
*
|
|
967
|
+
* // After (DRY)
|
|
968
|
+
* handler: createTokenNameHandler('startStream'),
|
|
969
|
+
*
|
|
970
|
+
* @since 6.8.0
|
|
971
|
+
*/
|
|
972
|
+
export declare function createTokenNameHandler(sdkMethod: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
973
|
+
/**
|
|
974
|
+
* Creates a boolean handler for SDK methods that take tokenName and return success.
|
|
975
|
+
*
|
|
976
|
+
* Combines tokenName extraction with boolean success response.
|
|
977
|
+
* Use for operations like stopStream that return { success: true }.
|
|
978
|
+
*
|
|
979
|
+
* @param sdkMethod - Name of the SDK method that accepts tokenName
|
|
980
|
+
* @param successMessage - Success message to return
|
|
981
|
+
* @returns Handler that calls SDK method and returns boolean success
|
|
982
|
+
*
|
|
983
|
+
* @example
|
|
984
|
+
* // Before
|
|
985
|
+
* handler: createBooleanHandler('stopStream', (args) => args.tokenName as string, 'Stream stopped'),
|
|
986
|
+
*
|
|
987
|
+
* // After
|
|
988
|
+
* handler: createTokenNameBooleanHandler('stopStream', 'Stream stopped'),
|
|
989
|
+
*
|
|
990
|
+
* @since 6.8.0
|
|
991
|
+
*/
|
|
992
|
+
export declare function createTokenNameBooleanHandler(sdkMethod: string, successMessage: string): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
993
|
+
/**
|
|
994
|
+
* Creates a handler that calls an SDK method and builds a response with custom message.
|
|
995
|
+
*
|
|
996
|
+
* Use this for handlers that need to format a response with an interpolated message
|
|
997
|
+
* based on the SDK result. This is a common pattern in pool info, quote, and
|
|
998
|
+
* position query tools.
|
|
999
|
+
*
|
|
1000
|
+
* @param sdkMethodName - Name of the SDK method to call
|
|
1001
|
+
* @param argExtractor - Function to extract arguments from MCP args
|
|
1002
|
+
* @param responseBuilder - Function to build the response object from SDK result
|
|
1003
|
+
* @returns Handler that calls SDK method and returns custom formatted response
|
|
1004
|
+
*
|
|
1005
|
+
* @example
|
|
1006
|
+
* const handler = createCustomMessageHandler(
|
|
1007
|
+
* 'getSwapPoolInfo',
|
|
1008
|
+
* (args) => [args.tokenA as string, args.tokenB as string],
|
|
1009
|
+
* (result, args) => ({
|
|
1010
|
+
* ...result,
|
|
1011
|
+
* message: `Pool ${args.tokenA}/${args.tokenB} has ${result.liquidity} liquidity`,
|
|
1012
|
+
* })
|
|
1013
|
+
* );
|
|
1014
|
+
*
|
|
1015
|
+
* @since 6.9.0
|
|
1016
|
+
*/
|
|
1017
|
+
export declare function createCustomMessageHandler<TResult, TResponse extends Record<string, unknown>>(sdkMethodName: string, argExtractor: (args: Record<string, unknown>) => unknown | unknown[], responseBuilder: (result: TResult, args: Record<string, unknown>) => TResponse): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
1018
|
+
/**
|
|
1019
|
+
* Creates a handler that validates wallet configuration before calling SDK method.
|
|
1020
|
+
*
|
|
1021
|
+
* Use this for write operations that require a configured wallet (swaps, liquidity
|
|
1022
|
+
* add/remove, transfers, etc.). Fails fast with helpful error if wallet not configured.
|
|
1023
|
+
*
|
|
1024
|
+
* @param sdkMethodName - Name of the SDK method to call
|
|
1025
|
+
* @param argExtractor - Function to extract arguments from MCP args
|
|
1026
|
+
* @param responseBuilder - Optional function to build custom response (defaults to result)
|
|
1027
|
+
* @param walletValidator - Optional custom wallet validation function
|
|
1028
|
+
* @returns Handler that validates wallet then calls SDK method
|
|
1029
|
+
*
|
|
1030
|
+
* @example
|
|
1031
|
+
* const handler = createWalletRequiredHandler(
|
|
1032
|
+
* 'executeSwap',
|
|
1033
|
+
* (args) => [args.fromToken, args.toToken, args.amount, args.estimatedOutput, args.feeTier, args.slippageTolerance || 0.01],
|
|
1034
|
+
* (result) => ({ ...result, message: `Swap completed!` })
|
|
1035
|
+
* );
|
|
1036
|
+
*
|
|
1037
|
+
* @since 6.9.0
|
|
1038
|
+
*/
|
|
1039
|
+
export declare function createWalletRequiredHandler<TResult, TResponse extends Record<string, unknown> = Record<string, unknown>>(sdkMethodName: string, argExtractor: (args: Record<string, unknown>) => unknown | unknown[], responseBuilder?: (result: TResult, args: Record<string, unknown>) => TResponse, walletValidator?: (sdk: LaunchpadSDK) => void): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
1040
|
+
/**
|
|
1041
|
+
* Creates a handler that returns found: false response if SDK result is null/undefined.
|
|
1042
|
+
*
|
|
1043
|
+
* Use this for position lookups and resource queries that may return null when
|
|
1044
|
+
* the resource doesn't exist. Provides consistent not-found responses.
|
|
1045
|
+
*
|
|
1046
|
+
* @param sdkMethodName - Name of the SDK method to call
|
|
1047
|
+
* @param argExtractor - Function to extract arguments from MCP args
|
|
1048
|
+
* @param notFoundBuilder - Function to build not-found response (receives args)
|
|
1049
|
+
* @param foundBuilder - Function to build found response (receives result and args)
|
|
1050
|
+
* @returns Handler with conditional found/not-found response
|
|
1051
|
+
*
|
|
1052
|
+
* @example
|
|
1053
|
+
* const handler = createNotFoundHandler(
|
|
1054
|
+
* 'getSwapLiquidityPositionById',
|
|
1055
|
+
* (args) => [args.ownerAddress, args.positionId],
|
|
1056
|
+
* (args) => ({ found: false, message: `Position ${args.positionId} not found` }),
|
|
1057
|
+
* (result, args) => ({ found: true, ...result, message: `Found position ${args.positionId}` })
|
|
1058
|
+
* );
|
|
1059
|
+
*
|
|
1060
|
+
* @since 6.9.0
|
|
1061
|
+
*/
|
|
1062
|
+
export declare function createNotFoundHandler<TResult, TNotFound extends Record<string, unknown>, TFound extends Record<string, unknown>>(sdkMethodName: string, argExtractor: (args: Record<string, unknown>) => unknown | unknown[], notFoundBuilder: (args: Record<string, unknown>) => TNotFound, foundBuilder: (result: TResult, args: Record<string, unknown>) => TFound): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
1063
|
+
/**
|
|
1064
|
+
* Creates a handler for no-argument SDK methods with custom response formatting.
|
|
1065
|
+
*
|
|
1066
|
+
* Unlike createNoArgActionHandler which returns a static response, this factory
|
|
1067
|
+
* allows building the response from the SDK result. Useful for session info,
|
|
1068
|
+
* status queries, and other async methods that return data.
|
|
1069
|
+
*
|
|
1070
|
+
* @param sdkMethodName - Name of the SDK method to call (takes no arguments)
|
|
1071
|
+
* @param responseBuilder - Function to build response from SDK result
|
|
1072
|
+
* @returns Handler that calls SDK method and formats response
|
|
1073
|
+
*
|
|
1074
|
+
* @example
|
|
1075
|
+
* const handler = createNoArgResultHandler(
|
|
1076
|
+
* 'getSession',
|
|
1077
|
+
* (session) => ({
|
|
1078
|
+
* address: session.address,
|
|
1079
|
+
* expiresAt: session.expiresAt,
|
|
1080
|
+
* message: `Session for ${session.address}, expires ${new Date(session.expiresAt).toISOString()}`,
|
|
1081
|
+
* })
|
|
1082
|
+
* );
|
|
1083
|
+
*
|
|
1084
|
+
* @since 6.9.0
|
|
1085
|
+
*/
|
|
1086
|
+
export declare function createNoArgResultHandler<TResult, TResponse extends Record<string, unknown>>(sdkMethodName: string, responseBuilder: (result: TResult) => TResponse): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
1087
|
+
/**
|
|
1088
|
+
* Creates a handler for synchronous SDK methods that return boolean with conditional messages.
|
|
1089
|
+
*
|
|
1090
|
+
* Use for sync methods like isAuthenticated(), shouldRefreshToken() that need
|
|
1091
|
+
* different messages based on the boolean result.
|
|
1092
|
+
*
|
|
1093
|
+
* @param syncMethodName - Name of the sync SDK method to call
|
|
1094
|
+
* @param argExtractor - Optional function to extract arguments from MCP args
|
|
1095
|
+
* @param messages - Object with true and false message strings
|
|
1096
|
+
* @returns Handler that calls sync method and returns formatted boolean response
|
|
1097
|
+
*
|
|
1098
|
+
* @example
|
|
1099
|
+
* const handler = createSyncBooleanHandler(
|
|
1100
|
+
* 'isAuthenticated',
|
|
1101
|
+
* undefined,
|
|
1102
|
+
* { true: 'Session is valid', false: 'Not authenticated or token expired' }
|
|
1103
|
+
* );
|
|
1104
|
+
*
|
|
1105
|
+
* @since 6.9.0
|
|
1106
|
+
*/
|
|
1107
|
+
export declare function createSyncBooleanHandler(syncMethodName: string, argExtractor: ((args: Record<string, unknown>) => unknown) | undefined, messages: {
|
|
1108
|
+
true: string;
|
|
1109
|
+
false: string;
|
|
1110
|
+
}): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
1111
|
+
/**
|
|
1112
|
+
* Flexible token identifier extracted from MCP args.
|
|
1113
|
+
*
|
|
1114
|
+
* Returns either tokenName OR tokenId based on which was provided.
|
|
1115
|
+
* Mutual exclusivity validation happens in the SDK.
|
|
1116
|
+
*
|
|
1117
|
+
* @since 6.10.0
|
|
1118
|
+
*/
|
|
1119
|
+
export interface FlexibleTokenId {
|
|
1120
|
+
tokenName?: string;
|
|
1121
|
+
tokenId?: unknown;
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
1124
|
+
* Extracts flexible token identifier from MCP args.
|
|
1125
|
+
*
|
|
1126
|
+
* Handles the common pattern where tools accept either tokenName (convenience)
|
|
1127
|
+
* or tokenId (full identifier), but not both. Returns an object with the
|
|
1128
|
+
* appropriate property set based on which was provided.
|
|
1129
|
+
*
|
|
1130
|
+
* Pattern replaced:
|
|
1131
|
+
* ```typescript
|
|
1132
|
+
* // Before (repeated 6+ times)
|
|
1133
|
+
* if (args.tokenName) {
|
|
1134
|
+
* options.tokenName = args.tokenName;
|
|
1135
|
+
* } else {
|
|
1136
|
+
* options.tokenId = args.tokenId;
|
|
1137
|
+
* }
|
|
1138
|
+
*
|
|
1139
|
+
* // After
|
|
1140
|
+
* const tokenId = extractFlexibleTokenId(args);
|
|
1141
|
+
* const options = { ...tokenId, ...otherOptions };
|
|
1142
|
+
* ```
|
|
1143
|
+
*
|
|
1144
|
+
* @param args - MCP tool arguments containing tokenName and/or tokenId
|
|
1145
|
+
* @returns Object with either tokenName or tokenId property set
|
|
1146
|
+
*
|
|
1147
|
+
* @example
|
|
1148
|
+
* // In fetchPriceHistory handler:
|
|
1149
|
+
* handler: createSimpleHandler('fetchPriceHistory', (args) => ({
|
|
1150
|
+
* ...extractFlexibleTokenId(args),
|
|
1151
|
+
* sortOrder: args.sortOrder,
|
|
1152
|
+
* page: args.page,
|
|
1153
|
+
* limit: args.limit,
|
|
1154
|
+
* })),
|
|
1155
|
+
*
|
|
1156
|
+
* @since 6.10.0
|
|
1157
|
+
*/
|
|
1158
|
+
export declare function extractFlexibleTokenId(args: Record<string, unknown>): FlexibleTokenId;
|
|
1159
|
+
/**
|
|
1160
|
+
* Creates a handler for SDK methods that may return null with different success responses.
|
|
1161
|
+
*
|
|
1162
|
+
* Use for methods like getAccessToken() that return null when not authenticated,
|
|
1163
|
+
* requiring different response structures for null vs non-null results.
|
|
1164
|
+
*
|
|
1165
|
+
* @param sdkMethodName - Name of the SDK method to call (sync or async)
|
|
1166
|
+
* @param nullResponse - Response to return when result is null/undefined
|
|
1167
|
+
* @param valueBuilder - Function to build response when result has value
|
|
1168
|
+
* @param isSync - Whether the SDK method is synchronous (default: false)
|
|
1169
|
+
* @returns Handler with conditional null/value responses
|
|
1170
|
+
*
|
|
1171
|
+
* @example
|
|
1172
|
+
* const handler = createConditionalResponseHandler(
|
|
1173
|
+
* 'getAccessToken',
|
|
1174
|
+
* { accessToken: null, message: 'Not authenticated - no token available' },
|
|
1175
|
+
* (token) => ({ accessToken: token, message: 'Access token retrieved' }),
|
|
1176
|
+
* true // sync method
|
|
1177
|
+
* );
|
|
1178
|
+
*
|
|
1179
|
+
* @since 6.9.0
|
|
1180
|
+
*/
|
|
1181
|
+
export declare function createConditionalResponseHandler<TResult, TNullResponse extends Record<string, unknown>, TValueResponse extends Record<string, unknown>>(sdkMethodName: string, nullResponse: TNullResponse, valueBuilder: (result: TResult) => TValueResponse, isSync?: boolean): (sdk: LaunchpadSDK, args: Record<string, unknown>) => Promise<MCPToolResponse>;
|
|
1182
|
+
/**
|
|
1183
|
+
* Standard authentication requirement descriptions for MCP tool definitions.
|
|
1184
|
+
*
|
|
1185
|
+
* Provides consistent, reusable auth requirement strings to eliminate
|
|
1186
|
+
* repetitive boilerplate in tool descriptions.
|
|
1187
|
+
*
|
|
1188
|
+
* @example
|
|
1189
|
+
* description: `Get chat status for a stream.
|
|
1190
|
+
*
|
|
1191
|
+
* ${AUTH_DESCRIPTIONS.PUBLIC}`,
|
|
1192
|
+
*
|
|
1193
|
+
* @example
|
|
1194
|
+
* description: `Start a stream.
|
|
1195
|
+
*
|
|
1196
|
+
* ${AUTH_DESCRIPTIONS.JWT_SESSION}`,
|
|
1197
|
+
*
|
|
1198
|
+
* @since 6.8.0
|
|
1199
|
+
*/
|
|
1200
|
+
export declare const AUTH_DESCRIPTIONS: {
|
|
1201
|
+
/** No authentication required */
|
|
1202
|
+
readonly PUBLIC: "Authentication: None required (public endpoint)";
|
|
1203
|
+
/** Requires JWT session (login first) */
|
|
1204
|
+
readonly JWT_SESSION: "Authentication: Requires JWT session (call gala_launchpad_login first)";
|
|
1205
|
+
/** Requires wallet signature */
|
|
1206
|
+
readonly WALLET_SIGNATURE: "Authentication: Requires wallet signature";
|
|
1207
|
+
/** Requires stream admin API key */
|
|
1208
|
+
readonly ADMIN_API_KEY: "Authentication: Requires streamAdminApiKey configuration";
|
|
1209
|
+
/** Requires admin API key OR JWT as token owner */
|
|
1210
|
+
readonly ADMIN_OR_OWNER: "Authentication: Requires streamAdminApiKey (admin) OR JWT auth (token owner)";
|
|
1211
|
+
/** Requires admin API key OR JWT as moderator */
|
|
1212
|
+
readonly ADMIN_OR_MODERATOR: "Authentication: Requires streamAdminApiKey (admin) OR JWT auth (token owner/moderator)";
|
|
1213
|
+
/** Requires admin API key OR JWT as overseer */
|
|
1214
|
+
readonly ADMIN_OR_OVERSEER: "Authentication: Requires streamAdminApiKey (admin) OR JWT auth as Overseer";
|
|
1215
|
+
/** Requires admin API key OR JWT as existing overseer */
|
|
1216
|
+
readonly ADMIN_OR_EXISTING_OVERSEER: "Authentication: Requires streamAdminApiKey (admin) OR JWT auth as existing Overseer";
|
|
1217
|
+
/** Stream creator only (wallet signature) */
|
|
1218
|
+
readonly STREAM_CREATOR: "Authentication: Requires wallet signature (stream creator only)";
|
|
1219
|
+
/** Optional JWT - returns null/limited if not authenticated */
|
|
1220
|
+
readonly OPTIONAL_JWT: "Authentication: Optional JWT - returns limited data if not authenticated";
|
|
1221
|
+
/** Requires JWT or API key with specific permission */
|
|
1222
|
+
readonly JWT_OR_API_KEY: (permission: string) => string;
|
|
1223
|
+
};
|
|
1224
|
+
/**
|
|
1225
|
+
* Creates a handler for SDK methods that return optional results (null/undefined if not found).
|
|
1226
|
+
*
|
|
1227
|
+
* Use this for resource lookup operations where not finding the resource is a valid
|
|
1228
|
+
* outcome (not an error). Returns a consistent { found: false } response when
|
|
1229
|
+
* the resource doesn't exist, and { found: true, data: result } when it does.
|
|
1230
|
+
*
|
|
1231
|
+
* @param sdkMethod - Function that calls the SDK method with sdk and args
|
|
1232
|
+
* @param notFoundMessage - Message to return when resource is not found (default: 'Resource not found')
|
|
1233
|
+
* @returns Handler with consistent found/not-found response structure
|
|
1234
|
+
*
|
|
1235
|
+
* @example
|
|
1236
|
+
* const handler = createOptionResultHandler(
|
|
1237
|
+
* (sdk, args) => sdk.getSwapLiquidityPositionById(args.ownerAddress, args.positionId),
|
|
1238
|
+
* 'Position not found'
|
|
1239
|
+
* );
|
|
1240
|
+
*
|
|
1241
|
+
* @since 6.12.0
|
|
1242
|
+
*/
|
|
1243
|
+
export declare function createOptionResultHandler<T extends Record<string, unknown>>(sdkMethod: (sdk: LaunchpadSDK, args: T) => Promise<unknown | null | undefined>, notFoundMessage?: string): (sdk: LaunchpadSDK, args: T) => Promise<MCPToolResponse>;
|
|
1244
|
+
/**
|
|
1245
|
+
* Creates a handler for SDK methods requiring wallet validation with optional result transformation.
|
|
1246
|
+
*
|
|
1247
|
+
* This is a simplified version of createWalletRequiredHandler that takes the SDK method
|
|
1248
|
+
* directly (as a function) rather than a method name string. Useful for cases where
|
|
1249
|
+
* you need direct SDK method calls with type safety.
|
|
1250
|
+
*
|
|
1251
|
+
* @param sdkMethod - Function that calls the SDK method with sdk and args
|
|
1252
|
+
* @param transformer - Optional function to transform the result before returning
|
|
1253
|
+
* @returns Handler that validates wallet then calls SDK method
|
|
1254
|
+
*
|
|
1255
|
+
* @example
|
|
1256
|
+
* const handler = createWalletRequiredMethodHandler(
|
|
1257
|
+
* (sdk, args) => sdk.addSwapLiquidityByPrice({
|
|
1258
|
+
* token0: args.token0, token1: args.token1, fee: args.fee,
|
|
1259
|
+
* minPrice: args.minPrice, maxPrice: args.maxPrice,
|
|
1260
|
+
* amount0Desired: args.amount0Desired, amount1Desired: args.amount1Desired,
|
|
1261
|
+
* }),
|
|
1262
|
+
* (result) => ({ ...result, message: 'Liquidity added!' })
|
|
1263
|
+
* );
|
|
1264
|
+
*
|
|
1265
|
+
* @since 6.12.0
|
|
1266
|
+
*/
|
|
1267
|
+
export declare function createWalletRequiredMethodHandler<T extends Record<string, unknown>, R>(sdkMethod: (sdk: LaunchpadSDK, args: T) => Promise<R>, transformer?: (result: R) => unknown): (sdk: LaunchpadSDK, args: T) => Promise<MCPToolResponse>;
|
|
1268
|
+
/**
|
|
1269
|
+
* Creates a handler for SDK methods that accept optional parameter objects.
|
|
1270
|
+
*
|
|
1271
|
+
* This factory handles the common pattern where an SDK method takes an optional
|
|
1272
|
+
* params object, and you want to build those params from the MCP args.
|
|
1273
|
+
*
|
|
1274
|
+
* @param sdkMethod - Function that calls the SDK method with sdk and optional params
|
|
1275
|
+
* @param paramBuilder - Optional function to build params from args (if omitted, passes args directly)
|
|
1276
|
+
* @param resultTransformer - Optional function to transform the result before returning
|
|
1277
|
+
* @returns Handler that builds params and calls SDK method
|
|
1278
|
+
*
|
|
1279
|
+
* @example
|
|
1280
|
+
* const handler = createOptionalParamsHandler(
|
|
1281
|
+
* (sdk, params) => sdk.getAllSwapUserLiquidityPositions(params?.ownerAddress, params?.options),
|
|
1282
|
+
* (args) => ({
|
|
1283
|
+
* ownerAddress: args.ownerAddress,
|
|
1284
|
+
* options: args.withPrices ? { withPrices: true } : undefined,
|
|
1285
|
+
* }),
|
|
1286
|
+
* (result, args) => formatPositionListResponse(parsePositionListResult(result), { ownerAddress: args.ownerAddress })
|
|
1287
|
+
* );
|
|
1288
|
+
*
|
|
1289
|
+
* @since 6.12.0
|
|
1290
|
+
*/
|
|
1291
|
+
export declare function createOptionalParamsHandler<T extends Record<string, unknown>, R>(sdkMethod: (sdk: LaunchpadSDK, params?: Partial<T>) => Promise<R>, paramBuilder?: (args: T) => Partial<T>, resultTransformer?: (result: R, args: T) => unknown): (sdk: LaunchpadSDK, args: T) => Promise<MCPToolResponse>;
|
|
1292
|
+
/**
|
|
1293
|
+
* Liquidity position data fetched from SDK, used for enriching operation responses.
|
|
1294
|
+
*
|
|
1295
|
+
* @since 6.14.0
|
|
1296
|
+
*/
|
|
1297
|
+
export interface PositionData {
|
|
1298
|
+
token0: string;
|
|
1299
|
+
token1: string;
|
|
1300
|
+
feeTier: number;
|
|
1301
|
+
tickLower: number;
|
|
1302
|
+
tickUpper: number;
|
|
1303
|
+
}
|
|
1304
|
+
/**
|
|
1305
|
+
* Standard result from liquidity position operations (remove, collect fees).
|
|
1306
|
+
*
|
|
1307
|
+
* @since 6.14.0
|
|
1308
|
+
*/
|
|
1309
|
+
export interface PositionOperationResult {
|
|
1310
|
+
transactionId: string;
|
|
1311
|
+
status?: string;
|
|
1312
|
+
amount0?: string;
|
|
1313
|
+
amount1?: string;
|
|
1314
|
+
}
|
|
1315
|
+
/**
|
|
1316
|
+
* Configuration for position enrichment handler factory.
|
|
1317
|
+
*
|
|
1318
|
+
* @since 6.14.0
|
|
1319
|
+
*/
|
|
1320
|
+
export interface PositionEnrichmentConfig<TArgs extends Record<string, unknown>, TResult extends PositionOperationResult> {
|
|
1321
|
+
/**
|
|
1322
|
+
* Function that calls the SDK operation method with position data and args.
|
|
1323
|
+
* Receives the fetched position (with token pair info) and the original args.
|
|
1324
|
+
*/
|
|
1325
|
+
operation: (sdk: LaunchpadSDK, position: PositionData, args: TArgs) => Promise<TResult>;
|
|
1326
|
+
/**
|
|
1327
|
+
* Function to build the enriched response from the operation result and position.
|
|
1328
|
+
*/
|
|
1329
|
+
responseBuilder: (result: TResult, position: PositionData, args: TArgs) => Record<string, unknown>;
|
|
1330
|
+
}
|
|
1331
|
+
/**
|
|
1332
|
+
* Creates a handler for liquidity position operations that require pre-fetching position details.
|
|
1333
|
+
*
|
|
1334
|
+
* This factory consolidates the common pattern found in removeLiquidity and collectPositionFees:
|
|
1335
|
+
* 1. Validate wallet configured
|
|
1336
|
+
* 2. Extract ownerAddress and positionId from args
|
|
1337
|
+
* 3. Fetch position details via getSwapLiquidityPositionById
|
|
1338
|
+
* 4. Validate position exists
|
|
1339
|
+
* 5. Call the SDK operation with position data
|
|
1340
|
+
* 6. Return enriched response with position token info
|
|
1341
|
+
*
|
|
1342
|
+
* Pattern replaced:
|
|
1343
|
+
* ```typescript
|
|
1344
|
+
* // Before (40+ lines duplicated in 2 handlers)
|
|
1345
|
+
* handler: withErrorHandling(async (sdk, args) => {
|
|
1346
|
+
* validateWalletConfigured(sdk);
|
|
1347
|
+
* const ownerAddress = args.ownerAddress as string;
|
|
1348
|
+
* const positionId = args.positionId as string;
|
|
1349
|
+
* const position = await sdk.getSwapLiquidityPositionById(ownerAddress, positionId);
|
|
1350
|
+
* if (!position) throw new Error(`Position ${positionId} not found...`);
|
|
1351
|
+
* const result = await sdk.someOperation({...});
|
|
1352
|
+
* return formatSuccess({ transactionId: result.transactionId, token0: position.token0, ... });
|
|
1353
|
+
* })
|
|
1354
|
+
*
|
|
1355
|
+
* // After
|
|
1356
|
+
* handler: createPositionEnrichmentHandler({
|
|
1357
|
+
* operation: (sdk, position, args) => sdk.removeSwapLiquidity({
|
|
1358
|
+
* token0: position.token0, token1: position.token1, ...args,
|
|
1359
|
+
* }),
|
|
1360
|
+
* responseBuilder: (result, position, args) => ({
|
|
1361
|
+
* transactionId: result.transactionId,
|
|
1362
|
+
* token0: position.token0,
|
|
1363
|
+
* message: `Liquidity removed! Received ${result.amount0} ${position.token0}...`,
|
|
1364
|
+
* })
|
|
1365
|
+
* })
|
|
1366
|
+
* ```
|
|
1367
|
+
*
|
|
1368
|
+
* @param config - Configuration specifying the SDK operation and response builder
|
|
1369
|
+
* @returns Handler that pre-fetches position, calls operation, and returns enriched response
|
|
1370
|
+
*
|
|
1371
|
+
* @example
|
|
1372
|
+
* // Remove liquidity handler
|
|
1373
|
+
* const handler = createPositionEnrichmentHandler({
|
|
1374
|
+
* operation: (sdk, position, args) => sdk.removeSwapLiquidity({
|
|
1375
|
+
* token0: position.token0,
|
|
1376
|
+
* token1: position.token1,
|
|
1377
|
+
* fee: position.feeTier,
|
|
1378
|
+
* tickLower: position.tickLower,
|
|
1379
|
+
* tickUpper: position.tickUpper,
|
|
1380
|
+
* liquidity: args.liquidity,
|
|
1381
|
+
* amount0Min: args.amount0Min,
|
|
1382
|
+
* amount1Min: args.amount1Min,
|
|
1383
|
+
* positionId: args.positionId,
|
|
1384
|
+
* }),
|
|
1385
|
+
* responseBuilder: (result, position, args) => ({
|
|
1386
|
+
* transactionId: result.transactionId,
|
|
1387
|
+
* status: result.status,
|
|
1388
|
+
* positionId: args.positionId,
|
|
1389
|
+
* token0: position.token0,
|
|
1390
|
+
* token1: position.token1,
|
|
1391
|
+
* amount0: result.amount0,
|
|
1392
|
+
* amount1: result.amount1,
|
|
1393
|
+
* message: `Liquidity removed! Received ${result.amount0} ${position.token0} and ${result.amount1} ${position.token1}`,
|
|
1394
|
+
* })
|
|
1395
|
+
* });
|
|
1396
|
+
*
|
|
1397
|
+
* @since 6.14.0
|
|
1398
|
+
*/
|
|
1399
|
+
export declare function createPositionEnrichmentHandler<TArgs extends Record<string, unknown>, TResult extends PositionOperationResult>(config: PositionEnrichmentConfig<TArgs, TResult>): (sdk: LaunchpadSDK, args: TArgs) => Promise<MCPToolResponse>;
|
|
1400
|
+
export {};
|
|
1401
|
+
//# sourceMappingURL=handler-factories.d.ts.map
|