@gala-chain/launchpad-mcp-server 5.0.5-beta.9 → 5.1.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/LICENSE +21 -0
- package/README.md +72 -29
- package/dist/constants/mcpToolNames.d.ts +15 -0
- package/dist/constants/mcpToolNames.d.ts.map +1 -1
- package/dist/constants/mcpToolNames.js +13 -1
- package/dist/constants/mcpToolNames.js.map +1 -1
- 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 +0 -6
- package/dist/prompts/account.d.ts.map +1 -1
- package/dist/prompts/account.js +1 -34
- package/dist/prompts/account.js.map +1 -1
- package/dist/prompts/ai-moderation.d.ts +36 -0
- package/dist/prompts/ai-moderation.d.ts.map +1 -0
- package/dist/prompts/ai-moderation.js +198 -0
- package/dist/prompts/ai-moderation.js.map +1 -0
- package/dist/prompts/chat.d.ts.map +1 -1
- package/dist/prompts/chat.js +6 -1
- package/dist/prompts/chat.js.map +1 -1
- package/dist/prompts/factories/reaction-prompt-factory.d.ts.map +1 -1
- package/dist/prompts/factories/reaction-prompt-factory.js +16 -6
- package/dist/prompts/factories/reaction-prompt-factory.js.map +1 -1
- package/dist/prompts/global-feed.d.ts +24 -0
- package/dist/prompts/global-feed.d.ts.map +1 -0
- package/dist/prompts/global-feed.js +89 -0
- package/dist/prompts/global-feed.js.map +1 -0
- package/dist/prompts/holders.d.ts +31 -0
- package/dist/prompts/holders.d.ts.map +1 -0
- package/dist/prompts/holders.js +117 -0
- package/dist/prompts/holders.js.map +1 -0
- package/dist/prompts/index.d.ts +11 -2
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +47 -1
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/manifest.d.ts +2 -2
- package/dist/prompts/manifest.d.ts.map +1 -1
- package/dist/prompts/manifest.js +406 -21
- package/dist/prompts/manifest.js.map +1 -1
- package/dist/prompts/messages.d.ts +48 -0
- package/dist/prompts/messages.d.ts.map +1 -0
- package/dist/prompts/messages.js +333 -0
- package/dist/prompts/messages.js.map +1 -0
- package/dist/prompts/oembed.d.ts +24 -0
- package/dist/prompts/oembed.d.ts.map +1 -0
- package/dist/prompts/oembed.js +127 -0
- package/dist/prompts/oembed.js.map +1 -0
- package/dist/prompts/platform-stats.d.ts +16 -0
- package/dist/prompts/platform-stats.d.ts.map +1 -0
- package/dist/prompts/platform-stats.js +42 -0
- package/dist/prompts/platform-stats.js.map +1 -0
- package/dist/prompts/restricted-names.d.ts +22 -0
- package/dist/prompts/restricted-names.d.ts.map +1 -0
- package/dist/prompts/restricted-names.js +89 -0
- package/dist/prompts/restricted-names.js.map +1 -0
- package/dist/prompts/websocket-admin.d.ts +100 -0
- package/dist/prompts/websocket-admin.d.ts.map +1 -0
- package/dist/prompts/websocket-admin.js +758 -0
- package/dist/prompts/websocket-admin.js.map +1 -0
- package/dist/prompts/weekly-challenge.d.ts +24 -0
- package/dist/prompts/weekly-challenge.d.ts.map +1 -0
- package/dist/prompts/weekly-challenge.js +100 -0
- package/dist/prompts/weekly-challenge.js.map +1 -0
- package/dist/schemas/common-schemas.d.ts +5 -4
- package/dist/schemas/common-schemas.d.ts.map +1 -1
- package/dist/schemas/common-schemas.js +9 -5
- package/dist/schemas/common-schemas.js.map +1 -1
- package/dist/server.d.ts +1 -6
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +42 -22
- package/dist/server.js.map +1 -1
- package/dist/tools/ai-moderation/index.d.ts +41 -0
- package/dist/tools/ai-moderation/index.d.ts.map +1 -0
- package/dist/tools/ai-moderation/index.js +196 -0
- package/dist/tools/ai-moderation/index.js.map +1 -0
- package/dist/tools/auth/index.d.ts.map +1 -1
- package/dist/tools/auth/index.js +17 -8
- package/dist/tools/auth/index.js.map +1 -1
- package/dist/tools/balance/index.d.ts +0 -1
- package/dist/tools/balance/index.d.ts.map +1 -1
- package/dist/tools/balance/index.js +1 -20
- package/dist/tools/balance/index.js.map +1 -1
- package/dist/tools/ban/onBanEnforcement.d.ts +1 -1
- package/dist/tools/ban/onBanEnforcement.d.ts.map +1 -1
- package/dist/tools/bridge/helpers/external-chain-balance-tools.d.ts +6 -6
- package/dist/tools/bridge/helpers/external-chain-balance-tools.d.ts.map +1 -1
- package/dist/tools/bridge/helpers/external-chain-balance-tools.js +3 -3
- package/dist/tools/bridge/helpers/external-chain-balance-tools.js.map +1 -1
- package/dist/tools/bridge/index.d.ts.map +1 -1
- package/dist/tools/bridge/index.js +2 -0
- package/dist/tools/bridge/index.js.map +1 -1
- package/dist/tools/chat/index.d.ts +6 -0
- package/dist/tools/chat/index.d.ts.map +1 -1
- package/dist/tools/chat/index.js +39 -1
- package/dist/tools/chat/index.js.map +1 -1
- package/dist/tools/comments/onCommentCreated.d.ts +1 -1
- package/dist/tools/comments/onCommentCreated.d.ts.map +1 -1
- package/dist/tools/content-flags/index.d.ts.map +1 -1
- package/dist/tools/content-flags/index.js +10 -2
- package/dist/tools/content-flags/index.js.map +1 -1
- package/dist/tools/creation/index.d.ts +1 -1
- package/dist/tools/creation/index.d.ts.map +1 -1
- package/dist/tools/creation/index.js +5 -0
- package/dist/tools/creation/index.js.map +1 -1
- package/dist/tools/dex/helpers.d.ts +4 -40
- package/dist/tools/dex/helpers.d.ts.map +1 -1
- package/dist/tools/dex/helpers.js +10 -0
- package/dist/tools/dex/helpers.js.map +1 -1
- package/dist/tools/dex/index.d.ts +3 -3
- package/dist/tools/dex/index.js +7 -7
- package/dist/tools/dex/index.js.map +1 -1
- package/dist/tools/dex-liquidity/index.js +8 -8
- package/dist/tools/dex-liquidity/index.js.map +1 -1
- package/dist/tools/dex-pools/index.d.ts.map +1 -1
- package/dist/tools/dex-pools/index.js +7 -6
- package/dist/tools/dex-pools/index.js.map +1 -1
- package/dist/tools/global-feed/getGlobalFeedStatus.d.ts +16 -0
- package/dist/tools/global-feed/getGlobalFeedStatus.d.ts.map +1 -0
- package/dist/tools/global-feed/getGlobalFeedStatus.js +100 -0
- package/dist/tools/global-feed/getGlobalFeedStatus.js.map +1 -0
- package/dist/tools/global-feed/getSiteConfigState.d.ts +16 -0
- package/dist/tools/global-feed/getSiteConfigState.d.ts.map +1 -0
- package/dist/tools/global-feed/getSiteConfigState.js +131 -0
- package/dist/tools/global-feed/getSiteConfigState.js.map +1 -0
- package/dist/tools/global-feed/index.d.ts +22 -0
- package/dist/tools/global-feed/index.d.ts.map +1 -0
- package/dist/tools/global-feed/index.js +40 -0
- package/dist/tools/global-feed/index.js.map +1 -0
- package/dist/tools/global-feed/monitorGlobalFeedEvents.d.ts +16 -0
- package/dist/tools/global-feed/monitorGlobalFeedEvents.d.ts.map +1 -0
- package/dist/tools/global-feed/monitorGlobalFeedEvents.js +162 -0
- package/dist/tools/global-feed/monitorGlobalFeedEvents.js.map +1 -0
- package/dist/tools/global-feed/subscribeToGlobalFeed.d.ts +17 -0
- package/dist/tools/global-feed/subscribeToGlobalFeed.d.ts.map +1 -0
- package/dist/tools/global-feed/subscribeToGlobalFeed.js +110 -0
- package/dist/tools/global-feed/subscribeToGlobalFeed.js.map +1 -0
- package/dist/tools/global-feed/unsubscribeFromGlobalFeed.d.ts +16 -0
- package/dist/tools/global-feed/unsubscribeFromGlobalFeed.d.ts.map +1 -0
- package/dist/tools/global-feed/unsubscribeFromGlobalFeed.js +151 -0
- package/dist/tools/global-feed/unsubscribeFromGlobalFeed.js.map +1 -0
- package/dist/tools/handler-factories.d.ts +1 -1
- package/dist/tools/handler-factories.d.ts.map +1 -1
- package/dist/tools/handler-factories.js +11 -7
- package/dist/tools/handler-factories.js.map +1 -1
- package/dist/tools/holders/index.d.ts.map +1 -1
- package/dist/tools/holders/index.js +9 -0
- package/dist/tools/holders/index.js.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +59 -9
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/manifest.d.ts +3 -3
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/manifest.js +844 -253
- package/dist/tools/manifest.js.map +1 -1
- package/dist/tools/messages/fetchMessages.d.ts.map +1 -1
- package/dist/tools/messages/fetchMessages.js +4 -0
- package/dist/tools/messages/fetchMessages.js.map +1 -1
- package/dist/tools/messages/getMessageStats.d.ts +16 -0
- package/dist/tools/messages/getMessageStats.d.ts.map +1 -0
- package/dist/tools/messages/getMessageStats.js +47 -0
- package/dist/tools/messages/getMessageStats.js.map +1 -0
- package/dist/tools/messages/index.d.ts +6 -2
- package/dist/tools/messages/index.d.ts.map +1 -1
- package/dist/tools/messages/index.js +9 -2
- package/dist/tools/messages/index.js.map +1 -1
- package/dist/tools/moderators/index.d.ts +4 -0
- package/dist/tools/moderators/index.d.ts.map +1 -1
- package/dist/tools/moderators/index.js +35 -1
- package/dist/tools/moderators/index.js.map +1 -1
- package/dist/tools/moderators/onModeratorChanged.d.ts +1 -1
- package/dist/tools/moderators/onModeratorChanged.d.ts.map +1 -1
- package/dist/tools/nft/index.d.ts +2 -2
- package/dist/tools/nft/index.d.ts.map +1 -1
- package/dist/tools/nft/index.js +1 -1
- package/dist/tools/nft/index.js.map +1 -1
- package/dist/tools/notifications/index.d.ts +39 -0
- package/dist/tools/notifications/index.d.ts.map +1 -0
- package/dist/tools/notifications/index.js +196 -0
- package/dist/tools/notifications/index.js.map +1 -0
- package/dist/tools/oembed/index.d.ts +31 -0
- package/dist/tools/oembed/index.d.ts.map +1 -0
- package/dist/tools/oembed/index.js +113 -0
- package/dist/tools/oembed/index.js.map +1 -0
- package/dist/tools/overseers/cache-management.d.ts +27 -0
- package/dist/tools/overseers/cache-management.d.ts.map +1 -0
- package/dist/tools/overseers/cache-management.js +191 -0
- package/dist/tools/overseers/cache-management.js.map +1 -0
- package/dist/tools/overseers/index.d.ts +28 -2
- package/dist/tools/overseers/index.d.ts.map +1 -1
- package/dist/tools/overseers/index.js +143 -3
- package/dist/tools/overseers/index.js.map +1 -1
- package/dist/tools/overseers/listOverseerUsers.d.ts.map +1 -1
- package/dist/tools/overseers/listOverseerUsers.js +1 -0
- package/dist/tools/overseers/listOverseerUsers.js.map +1 -1
- package/dist/tools/pagination-handler-factory.d.ts.map +1 -1
- package/dist/tools/pagination-handler-factory.js +4 -2
- package/dist/tools/pagination-handler-factory.js.map +1 -1
- package/dist/tools/platform-stats/index.d.ts +21 -0
- package/dist/tools/platform-stats/index.d.ts.map +1 -0
- package/dist/tools/platform-stats/index.js +51 -0
- package/dist/tools/platform-stats/index.js.map +1 -0
- package/dist/tools/pools/fetchPoolDetailsForCalculation.d.ts +1 -1
- package/dist/tools/pools/fetchPoolDetailsForCalculation.d.ts.map +1 -1
- package/dist/tools/pools/index.d.ts +7 -7
- package/dist/tools/pools/index.d.ts.map +1 -1
- package/dist/tools/pools/index.js +20 -6
- package/dist/tools/pools/index.js.map +1 -1
- package/dist/tools/pools/onDexPoolCreation.d.ts +1 -1
- package/dist/tools/pools/onDexPoolCreation.d.ts.map +1 -1
- package/dist/tools/pools/onHolderCountChanged.d.ts +1 -1
- package/dist/tools/pools/onHolderCountChanged.d.ts.map +1 -1
- package/dist/tools/pools/onLaunchpadTokenCreation.d.ts +1 -1
- package/dist/tools/pools/onLaunchpadTokenCreation.d.ts.map +1 -1
- package/dist/tools/pools/onPoolUpdated.d.ts +1 -1
- package/dist/tools/pools/onPoolUpdated.d.ts.map +1 -1
- package/dist/tools/pools/updateTokenConfig.d.ts +2 -2
- package/dist/tools/pools/updateTokenConfig.d.ts.map +1 -1
- package/dist/tools/pools/updateTokenConfig.js +88 -5
- package/dist/tools/pools/updateTokenConfig.js.map +1 -1
- package/dist/tools/streaming/index.d.ts.map +1 -1
- package/dist/tools/streaming/index.js +4 -3
- package/dist/tools/streaming/index.js.map +1 -1
- package/dist/tools/streaming/setNextLiveStreamCountdown.js +3 -3
- package/dist/tools/streaming/setNextLiveStreamCountdown.js.map +1 -1
- package/dist/tools/token-ban/onTokenBanChanged.d.ts +1 -1
- package/dist/tools/token-ban/onTokenBanChanged.d.ts.map +1 -1
- package/dist/tools/tool-factory.d.ts.map +1 -1
- package/dist/tools/tool-factory.js +1 -0
- package/dist/tools/tool-factory.js.map +1 -1
- package/dist/tools/trades/index.d.ts.map +1 -1
- package/dist/tools/trades/index.js +8 -1
- package/dist/tools/trades/index.js.map +1 -1
- package/dist/tools/trades/onTradeExecuted.d.ts +1 -1
- package/dist/tools/trades/onTradeExecuted.d.ts.map +1 -1
- package/dist/tools/trading/helpers/arg-extractors.d.ts +6 -41
- package/dist/tools/trading/helpers/arg-extractors.d.ts.map +1 -1
- package/dist/tools/trading/helpers/trading-schemas.d.ts +8 -8
- package/dist/tools/trading/helpers/trading-schemas.d.ts.map +1 -1
- package/dist/tools/trading/helpers/trading-schemas.js.map +1 -1
- package/dist/tools/trading/index.d.ts +4 -0
- package/dist/tools/trading/index.d.ts.map +1 -1
- package/dist/tools/trading/index.js +112 -1
- package/dist/tools/trading/index.js.map +1 -1
- package/dist/tools/utils/createSolanaWallet.d.ts +1 -1
- package/dist/tools/utils/createSolanaWallet.d.ts.map +1 -1
- package/dist/tools/utils/createSolanaWallet.js +2 -1
- package/dist/tools/utils/createSolanaWallet.js.map +1 -1
- package/dist/tools/utils/createWallet.d.ts +1 -1
- package/dist/tools/utils/createWallet.d.ts.map +1 -1
- package/dist/tools/utils/createWallet.js +2 -1
- package/dist/tools/utils/createWallet.js.map +1 -1
- package/dist/tools/utils/explainSdkUsage.d.ts +41 -1
- package/dist/tools/utils/explainSdkUsage.d.ts.map +1 -1
- package/dist/tools/utils/explainSdkUsage.js +1964 -158
- package/dist/tools/utils/explainSdkUsage.js.map +1 -1
- package/dist/tools/utils/explainWebSocketEvents.d.ts.map +1 -1
- package/dist/tools/utils/explainWebSocketEvents.js +6 -4
- package/dist/tools/utils/explainWebSocketEvents.js.map +1 -1
- package/dist/tools/utils/getAddress.d.ts +1 -1
- package/dist/tools/utils/getAddress.d.ts.map +1 -1
- package/dist/tools/utils/getCacheInfo.d.ts +1 -1
- package/dist/tools/utils/getCacheInfo.d.ts.map +1 -1
- package/dist/tools/utils/getConfig.d.ts +1 -1
- package/dist/tools/utils/getConfig.d.ts.map +1 -1
- package/dist/tools/utils/getConfig.js +1 -1
- package/dist/tools/utils/getConfig.js.map +1 -1
- package/dist/tools/utils/getEnvironment.d.ts +1 -1
- package/dist/tools/utils/getEnvironment.d.ts.map +1 -1
- package/dist/tools/utils/getEnvironment.js +1 -1
- package/dist/tools/utils/getEnvironment.js.map +1 -1
- package/dist/tools/utils/getEthereumAddress.d.ts +1 -1
- package/dist/tools/utils/getEthereumAddress.d.ts.map +1 -1
- package/dist/tools/utils/getEthereumAddressFromPrivateKey.d.ts +1 -1
- package/dist/tools/utils/getEthereumAddressFromPrivateKey.d.ts.map +1 -1
- package/dist/tools/utils/getEthereumAddressFromPrivateKey.js +1 -1
- package/dist/tools/utils/getEthereumAddressFromPrivateKey.js.map +1 -1
- package/dist/tools/utils/getEventSchema.d.ts.map +1 -1
- package/dist/tools/utils/getEventSchema.js +88 -2
- package/dist/tools/utils/getEventSchema.js.map +1 -1
- package/dist/tools/utils/getPublicKeyFromPrivateKey.d.ts +1 -1
- package/dist/tools/utils/getPublicKeyFromPrivateKey.d.ts.map +1 -1
- package/dist/tools/utils/getPublicKeyFromPrivateKey.js +1 -1
- package/dist/tools/utils/getPublicKeyFromPrivateKey.js.map +1 -1
- package/dist/tools/utils/getUrlByTokenName.d.ts +1 -1
- package/dist/tools/utils/getUrlByTokenName.d.ts.map +1 -1
- package/dist/tools/utils/getUrlByTokenName.js +1 -1
- package/dist/tools/utils/getUrlByTokenName.js.map +1 -1
- package/dist/tools/utils/getVersion.d.ts +1 -1
- package/dist/tools/utils/getVersion.d.ts.map +1 -1
- package/dist/tools/utils/getVersion.js +1 -1
- package/dist/tools/utils/getVersion.js.map +1 -1
- package/dist/tools/utils/getWallet.d.ts +1 -1
- package/dist/tools/utils/getWallet.d.ts.map +1 -1
- package/dist/tools/utils/hasWallet.d.ts +1 -1
- package/dist/tools/utils/hasWallet.d.ts.map +1 -1
- package/dist/tools/utils/index.d.ts +1 -1
- package/dist/tools/utils/index.d.ts.map +1 -1
- package/dist/tools/utils/isTokenGraduated.d.ts +1 -1
- package/dist/tools/utils/isTokenGraduated.d.ts.map +1 -1
- package/dist/tools/utils/setWallet.d.ts +1 -1
- package/dist/tools/utils/setWallet.d.ts.map +1 -1
- package/dist/tools/utils/setWallet.js +1 -1
- package/dist/tools/utils/setWallet.js.map +1 -1
- package/dist/tools/utils/switchEnvironment.d.ts +1 -1
- package/dist/tools/utils/switchEnvironment.d.ts.map +1 -1
- package/dist/tools/validate-manifest.d.ts.map +1 -1
- package/dist/tools/validate-manifest.js +5 -0
- package/dist/tools/validate-manifest.js.map +1 -1
- package/dist/tools/wallet/index.d.ts +1 -1
- package/dist/tools/wallet/index.d.ts.map +1 -1
- package/dist/tools/websocket-admin/emitBalanceUpdated.d.ts +15 -0
- package/dist/tools/websocket-admin/emitBalanceUpdated.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitBalanceUpdated.js +64 -0
- package/dist/tools/websocket-admin/emitBalanceUpdated.js.map +1 -0
- package/dist/tools/websocket-admin/emitChatMessage.d.ts +15 -0
- package/dist/tools/websocket-admin/emitChatMessage.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitChatMessage.js +56 -0
- package/dist/tools/websocket-admin/emitChatMessage.js.map +1 -0
- package/dist/tools/websocket-admin/emitChatStatus.d.ts +15 -0
- package/dist/tools/websocket-admin/emitChatStatus.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitChatStatus.js +54 -0
- package/dist/tools/websocket-admin/emitChatStatus.js.map +1 -0
- package/dist/tools/websocket-admin/emitDownloadReady.d.ts +15 -0
- package/dist/tools/websocket-admin/emitDownloadReady.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitDownloadReady.js +78 -0
- package/dist/tools/websocket-admin/emitDownloadReady.js.map +1 -0
- package/dist/tools/websocket-admin/emitFeatureStatus.d.ts +15 -0
- package/dist/tools/websocket-admin/emitFeatureStatus.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitFeatureStatus.js +61 -0
- package/dist/tools/websocket-admin/emitFeatureStatus.js.map +1 -0
- package/dist/tools/websocket-admin/emitModeratorAdded.d.ts +15 -0
- package/dist/tools/websocket-admin/emitModeratorAdded.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitModeratorAdded.js +64 -0
- package/dist/tools/websocket-admin/emitModeratorAdded.js.map +1 -0
- package/dist/tools/websocket-admin/emitModeratorRemoved.d.ts +15 -0
- package/dist/tools/websocket-admin/emitModeratorRemoved.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitModeratorRemoved.js +54 -0
- package/dist/tools/websocket-admin/emitModeratorRemoved.js.map +1 -0
- package/dist/tools/websocket-admin/emitRecordingStatus.d.ts +15 -0
- package/dist/tools/websocket-admin/emitRecordingStatus.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitRecordingStatus.js +78 -0
- package/dist/tools/websocket-admin/emitRecordingStatus.js.map +1 -0
- package/dist/tools/websocket-admin/emitRecordingsCountUpdated.d.ts +15 -0
- package/dist/tools/websocket-admin/emitRecordingsCountUpdated.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitRecordingsCountUpdated.js +57 -0
- package/dist/tools/websocket-admin/emitRecordingsCountUpdated.js.map +1 -0
- package/dist/tools/websocket-admin/emitSiteConfigChanged.d.ts +15 -0
- package/dist/tools/websocket-admin/emitSiteConfigChanged.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitSiteConfigChanged.js +54 -0
- package/dist/tools/websocket-admin/emitSiteConfigChanged.js.map +1 -0
- package/dist/tools/websocket-admin/emitStreamCountdown.d.ts +15 -0
- package/dist/tools/websocket-admin/emitStreamCountdown.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitStreamCountdown.js +55 -0
- package/dist/tools/websocket-admin/emitStreamCountdown.js.map +1 -0
- package/dist/tools/websocket-admin/emitStreamStatus.d.ts +15 -0
- package/dist/tools/websocket-admin/emitStreamStatus.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitStreamStatus.js +59 -0
- package/dist/tools/websocket-admin/emitStreamStatus.js.map +1 -0
- package/dist/tools/websocket-admin/emitTokenBanned.d.ts +15 -0
- package/dist/tools/websocket-admin/emitTokenBanned.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitTokenBanned.js +60 -0
- package/dist/tools/websocket-admin/emitTokenBanned.js.map +1 -0
- package/dist/tools/websocket-admin/emitTokenUnbanned.d.ts +15 -0
- package/dist/tools/websocket-admin/emitTokenUnbanned.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitTokenUnbanned.js +54 -0
- package/dist/tools/websocket-admin/emitTokenUnbanned.js.map +1 -0
- package/dist/tools/websocket-admin/emitTradeExecuted.d.ts +15 -0
- package/dist/tools/websocket-admin/emitTradeExecuted.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitTradeExecuted.js +64 -0
- package/dist/tools/websocket-admin/emitTradeExecuted.js.map +1 -0
- package/dist/tools/websocket-admin/emitTypingIndicator.d.ts +15 -0
- package/dist/tools/websocket-admin/emitTypingIndicator.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitTypingIndicator.js +57 -0
- package/dist/tools/websocket-admin/emitTypingIndicator.js.map +1 -0
- package/dist/tools/websocket-admin/emitUserProfileUpdated.d.ts +15 -0
- package/dist/tools/websocket-admin/emitUserProfileUpdated.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitUserProfileUpdated.js +57 -0
- package/dist/tools/websocket-admin/emitUserProfileUpdated.js.map +1 -0
- package/dist/tools/websocket-admin/emitViewerCount.d.ts +15 -0
- package/dist/tools/websocket-admin/emitViewerCount.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitViewerCount.js +50 -0
- package/dist/tools/websocket-admin/emitViewerCount.js.map +1 -0
- package/dist/tools/websocket-admin/emitWebSocketEvent.d.ts +15 -0
- package/dist/tools/websocket-admin/emitWebSocketEvent.d.ts.map +1 -0
- package/dist/tools/websocket-admin/emitWebSocketEvent.js +98 -0
- package/dist/tools/websocket-admin/emitWebSocketEvent.js.map +1 -0
- package/dist/tools/websocket-admin/getConnectedClients.d.ts +15 -0
- package/dist/tools/websocket-admin/getConnectedClients.d.ts.map +1 -0
- package/dist/tools/websocket-admin/getConnectedClients.js +115 -0
- package/dist/tools/websocket-admin/getConnectedClients.js.map +1 -0
- package/dist/tools/websocket-admin/getOnlineOverseers.d.ts +15 -0
- package/dist/tools/websocket-admin/getOnlineOverseers.d.ts.map +1 -0
- package/dist/tools/websocket-admin/getOnlineOverseers.js +39 -0
- package/dist/tools/websocket-admin/getOnlineOverseers.js.map +1 -0
- package/dist/tools/websocket-admin/getOnlineUsers.d.ts +15 -0
- package/dist/tools/websocket-admin/getOnlineUsers.d.ts.map +1 -0
- package/dist/tools/websocket-admin/getOnlineUsers.js +54 -0
- package/dist/tools/websocket-admin/getOnlineUsers.js.map +1 -0
- package/dist/tools/websocket-admin/getTokenViewers.d.ts +15 -0
- package/dist/tools/websocket-admin/getTokenViewers.d.ts.map +1 -0
- package/dist/tools/websocket-admin/getTokenViewers.js +60 -0
- package/dist/tools/websocket-admin/getTokenViewers.js.map +1 -0
- package/dist/tools/websocket-admin/index.d.ts +80 -0
- package/dist/tools/websocket-admin/index.d.ts.map +1 -0
- package/dist/tools/websocket-admin/index.js +139 -0
- package/dist/tools/websocket-admin/index.js.map +1 -0
- package/dist/tools/websocket-admin/isUserOnline.d.ts +15 -0
- package/dist/tools/websocket-admin/isUserOnline.d.ts.map +1 -0
- package/dist/tools/websocket-admin/isUserOnline.js +49 -0
- package/dist/tools/websocket-admin/isUserOnline.js.map +1 -0
- package/dist/tools/weekly-challenge/index.d.ts +28 -0
- package/dist/tools/weekly-challenge/index.d.ts.map +1 -0
- package/dist/tools/weekly-challenge/index.js +95 -0
- package/dist/tools/weekly-challenge/index.js.map +1 -0
- package/dist/types/mcp.d.ts +43 -5
- package/dist/types/mcp.d.ts.map +1 -1
- package/dist/utils/default-values.d.ts +5 -5
- package/dist/utils/default-values.js +12 -12
- package/dist/utils/default-values.js.map +1 -1
- package/dist/utils/error-handler.d.ts +1 -1
- package/dist/utils/error-handler.d.ts.map +1 -1
- package/dist/utils/error-handler.js +10 -1
- package/dist/utils/error-handler.js.map +1 -1
- package/dist/utils/error-templates.d.ts.map +1 -1
- package/dist/utils/error-templates.js +1 -0
- package/dist/utils/error-templates.js.map +1 -1
- package/dist/utils/response-formatter.js +1 -1
- package/dist/utils/response-formatter.js.map +1 -1
- package/dist/utils/tool-factory.d.ts +3 -3
- package/dist/utils/tool-factory.d.ts.map +1 -1
- package/dist/utils/tool-registry.d.ts.map +1 -1
- package/dist/utils/tool-registry.js +17 -8
- package/dist/utils/tool-registry.js.map +1 -1
- package/package.json +33 -34
- package/dist/tools/pools/updateTokenSocials.d.ts +0 -16
- package/dist/tools/pools/updateTokenSocials.d.ts.map +0 -1
- package/dist/tools/pools/updateTokenSocials.js +0 -84
- package/dist/tools/pools/updateTokenSocials.js.map +0 -1
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
* Acts as a development reference showing how MCP tools map to SDK methods.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.explainSdkUsageTool = exports.SDK_EXAMPLES = exports.COMPOSITE_TOPICS = exports.TOPIC_METHOD_MAPPING = void 0;
|
|
9
|
+
exports.explainSdkUsageTool = exports.SDK_EXAMPLE_TOPICS = exports.SDK_EXAMPLES = exports.COMPOSITE_TOPICS = exports.TOPIC_METHOD_MAPPING = void 0;
|
|
10
|
+
exports.isValidSdkTopic = isValidSdkTopic;
|
|
10
11
|
const error_handler_js_1 = require("../../utils/error-handler.js");
|
|
11
12
|
const response_formatter_js_1 = require("../../utils/response-formatter.js");
|
|
12
13
|
// BigNumber utilities for precise currency handling (imported from SDK)
|
|
@@ -33,12 +34,18 @@ exports.TOPIC_METHOD_MAPPING = {
|
|
|
33
34
|
'token-details': ['fetchTokenDetails'],
|
|
34
35
|
'token-distribution': ['fetchTokenDistribution', 'fetchUserHolderContext'],
|
|
35
36
|
'token-status': ['isTokenGraduated', 'onDexPoolCreation', 'onLaunchpadTokenCreation'],
|
|
36
|
-
//
|
|
37
|
-
'
|
|
37
|
+
// Wallet Connection
|
|
38
|
+
'wallet-connect': ['getAddress', 'createWallet', 'getEthereumAddress'],
|
|
39
|
+
'multi-wallet': ['getAddress', 'createWallet', 'createSolanaWallet', 'getEthereumAddress', 'getPublicKeyFromPrivateKey', 'getEthereumAddressFromPrivateKey'],
|
|
38
40
|
'transfers': ['transferGala', 'transferToken'],
|
|
39
41
|
'locks': ['lockTokens', 'unlockTokens', 'burnTokens', 'fetchLockedBalance'],
|
|
40
42
|
// DEX Trading
|
|
41
43
|
'dex-trading': ['getSwapQuoteExactInput', 'getSwapQuoteExactOutput', 'executeSwap', 'getSwapUserAssets', 'getAllSwapUserAssets', 'getSwapPoolInfo'],
|
|
44
|
+
'gdex-stream': [
|
|
45
|
+
'connect', 'disconnect', 'isConnected', 'request', 'serverInfo', 'ping',
|
|
46
|
+
'getPool', 'getBalance', 'getPositions', 'getBlockHeight', 'quote', 'getToken',
|
|
47
|
+
'subscribeSwaps', 'subscribePool', 'subscribeBalances', 'subscribePoolCreated', 'subscribeBlocks'
|
|
48
|
+
],
|
|
42
49
|
'error-handling': ['getBundlerTransactionResult'], // Cross-cutting concern
|
|
43
50
|
// Developer Tools
|
|
44
51
|
'installation': ['getVersion'], // Setup topic
|
|
@@ -63,7 +70,7 @@ exports.TOPIC_METHOD_MAPPING = {
|
|
|
63
70
|
'fetch-dex-aggregated-volume-summary': ['fetchDexAggregatedVolumeSummary'],
|
|
64
71
|
'fetch-dex-pools': ['fetchDexPools', 'fetchAllDexPools'],
|
|
65
72
|
// Event Subscriptions
|
|
66
|
-
'event-subscriptions': ['subscribeToStream', 'unsubscribeFromStream', 'onStreamStatusChanged', 'onUserBanned', 'onUserUnbanned', 'onBanEnforcement', 'onContentFlagged', 'onFlagResolved', 'onStreamChatMessage', 'onStreamChatUpdated', 'onStreamChatDeleted', 'onStreamChatPinned', 'onStreamChatUnpinned', 'onChatStatusChanged', 'onViewerCountChanged', 'onRecordingStatusChanged', 'onSimulcastStatusChanged', 'onDownloadReady', 'onUserTyping', 'onStreamReaction', 'onContentReactionAdded', 'onContentReactionRemoved', 'onStreamCountdownUpdated', 'onStreamLanguageUpdated', 'onStreamControlStatusChanged', 'onConnection', 'onAuthenticated', 'onTokenSubscribed', 'onTokenUnsubscribed', 'onRoomSubscribed', 'onRoomLeft', 'onDexPoolCreation', 'onLaunchpadTokenCreation'],
|
|
73
|
+
'event-subscriptions': ['subscribeToStream', 'unsubscribeFromStream', 'onStreamStatusChanged', 'onUserBanned', 'onUserUnbanned', 'onBanEnforcement', 'onContentFlagged', 'onFlagResolved', 'onStreamChatMessage', 'onStreamChatUpdated', 'onStreamChatDeleted', 'onStreamChatPinned', 'onStreamChatUnpinned', 'onChatStatusChanged', 'onViewerCountChanged', 'onRecordingStatusChanged', 'onSimulcastStatusChanged', 'onDownloadReady', 'onUserTyping', 'onStreamReaction', 'onContentReactionAdded', 'onContentReactionRemoved', 'onStreamCountdownUpdated', 'onStreamLanguageUpdated', 'onStreamControlStatusChanged', 'onConnection', 'onAuthenticated', 'onTokenSubscribed', 'onTokenUnsubscribed', 'onRoomSubscribed', 'onRoomLeft', 'onDexPoolCreation', 'onLaunchpadTokenCreation', 'onEngagementStatsUpdated'],
|
|
67
74
|
// MCP Integration
|
|
68
75
|
'mcp-to-sdk-mapping': ['explainSdkUsage'], // Composite workflow topic
|
|
69
76
|
// Bridge Operations
|
|
@@ -94,10 +101,6 @@ exports.TOPIC_METHOD_MAPPING = {
|
|
|
94
101
|
'referral-system': [
|
|
95
102
|
'fetchReferralUrl', 'fetchReferrals', 'fetchAllReferrals', 'fetchReferralsSummary'
|
|
96
103
|
],
|
|
97
|
-
// Account Management
|
|
98
|
-
'account-management': [
|
|
99
|
-
'registerAccount'
|
|
100
|
-
],
|
|
101
104
|
// Session Authentication (JWT)
|
|
102
105
|
'session-auth': [
|
|
103
106
|
'login', 'logout', 'refreshToken', 'getSession', 'isAuthenticated',
|
|
@@ -137,7 +140,8 @@ exports.TOPIC_METHOD_MAPPING = {
|
|
|
137
140
|
'overseer-invites': [
|
|
138
141
|
'createOverseerInvite', 'claimOverseerInvite', 'listOverseerInvites',
|
|
139
142
|
'getOverseerInviteByCode', 'revokeOverseerInvite', 'listOverseers',
|
|
140
|
-
'revokeOverseer', 'getMyOverseerStatus', 'getOverseerSummary'
|
|
143
|
+
'revokeOverseer', 'getMyOverseerStatus', 'getOverseerSummary',
|
|
144
|
+
'getBanStats', 'getTokenBanStats', 'getInviteStats', 'getFlagStats', 'getUserStats'
|
|
141
145
|
],
|
|
142
146
|
// Content Moderation (Flags & Comments)
|
|
143
147
|
'content-flag-management': [
|
|
@@ -152,7 +156,7 @@ exports.TOPIC_METHOD_MAPPING = {
|
|
|
152
156
|
],
|
|
153
157
|
// Trade History Queries
|
|
154
158
|
'trade-history': [
|
|
155
|
-
'getTrades'
|
|
159
|
+
'getTrades', 'getRecentTrades'
|
|
156
160
|
],
|
|
157
161
|
// Token Ban Management (Platform-wide, Overseer Only)
|
|
158
162
|
'token-ban-management': [
|
|
@@ -166,6 +170,71 @@ exports.TOPIC_METHOD_MAPPING = {
|
|
|
166
170
|
'createNftTokenClass', 'fetchNftTokenClasses',
|
|
167
171
|
'mintNft', 'fetchNftBalances'
|
|
168
172
|
],
|
|
173
|
+
// Token Identification & Format Concepts (v5.14.0+)
|
|
174
|
+
// These are conceptual topics that help AI understand token formats
|
|
175
|
+
'token-identification': [
|
|
176
|
+
'fetchPools', 'isTokenGraduated', 'resolveTokenClassKey', 'fetchTokenPrice'
|
|
177
|
+
],
|
|
178
|
+
'graduation-detection': [
|
|
179
|
+
'isTokenGraduated', 'fetchPools', 'onDexPoolCreation', 'onLaunchpadTokenCreation'
|
|
180
|
+
],
|
|
181
|
+
// AI Moderation (Overseer Only)
|
|
182
|
+
'ai-moderation': [
|
|
183
|
+
'getAIModerationSettings', 'updateAIModerationSettings', 'getAIModeration',
|
|
184
|
+
'triggerAIModeration', 'getAIModerationStatus'
|
|
185
|
+
],
|
|
186
|
+
// Weekly Challenge Leaderboard
|
|
187
|
+
'weekly-challenge': [
|
|
188
|
+
'getWeeklyChallengeLeaderboard', 'getTokenWeeklyHistory'
|
|
189
|
+
],
|
|
190
|
+
// Platform Statistics
|
|
191
|
+
'platform-stats': [
|
|
192
|
+
'getPlatformStats'
|
|
193
|
+
],
|
|
194
|
+
// Restricted Names (Overseer Only)
|
|
195
|
+
'restricted-names': [
|
|
196
|
+
'getRestrictedNames', 'updateRestrictedNames'
|
|
197
|
+
],
|
|
198
|
+
// WebSocket Admin (Overseer/Admin Only)
|
|
199
|
+
'websocket-admin': [
|
|
200
|
+
'emitTradeExecuted', 'emitBalanceUpdated', 'emitStreamStatus', 'emitViewerCount',
|
|
201
|
+
'emitStreamCountdown', 'emitChatMessage', 'emitChatStatus', 'emitTypingIndicator',
|
|
202
|
+
'emitTokenBanned', 'emitTokenUnbanned', 'emitModeratorAdded', 'emitModeratorRemoved',
|
|
203
|
+
'emitUserProfileUpdated', 'emitSiteConfigChanged', 'emitFeatureStatus',
|
|
204
|
+
'getConnectedClients', 'isUserOnline', 'getOnlineUsers', 'getTokenViewers', 'getOnlineOverseers'
|
|
205
|
+
],
|
|
206
|
+
// OEmbed Metadata (Social Media Previews)
|
|
207
|
+
'oembed': [
|
|
208
|
+
'getHomeOEmbed', 'getPoolOEmbed', 'getProfileOEmbed'
|
|
209
|
+
],
|
|
210
|
+
// Unified Messages API (CHAT + COMMENT types)
|
|
211
|
+
'messages': [
|
|
212
|
+
'fetchMessages', 'createMessage', 'updateMessage', 'deleteMessage',
|
|
213
|
+
'getPinnedMessage', 'pinMessage', 'unpinMessage', 'getMessageStats'
|
|
214
|
+
],
|
|
215
|
+
// Holder Data Queries (Derived from Distribution + Trade Data)
|
|
216
|
+
'holders': [
|
|
217
|
+
'fetchTokenDistribution', 'getTrades',
|
|
218
|
+
'getTopHolders', 'getHolderCount', 'getHolderRank', 'getHoldersByBalance', 'getHolderHistory'
|
|
219
|
+
],
|
|
220
|
+
// Trading Quotes (Backend Proxy, v9.1.0+)
|
|
221
|
+
'trading-quotes': [
|
|
222
|
+
'fetchLaunchpadFee', 'fetchSaleDetails', 'getTradeQuote', 'getPremintQuote'
|
|
223
|
+
],
|
|
224
|
+
// Global Feed Reference (MCP documentation tools)
|
|
225
|
+
'global-feed-subscription': [
|
|
226
|
+
'subscribeToStream'
|
|
227
|
+
],
|
|
228
|
+
// Events Tracking (Client-side batching + backend persistence)
|
|
229
|
+
'events-tracking': [],
|
|
230
|
+
// Global Ban Management (Platform-wide, Overseer Only)
|
|
231
|
+
'global-bans': [
|
|
232
|
+
'createGlobalBan', 'removeGlobalBan', 'listGlobalBans', 'getGlobalBan'
|
|
233
|
+
],
|
|
234
|
+
// Recent Trades (Convenience wrapper)
|
|
235
|
+
'recent-trades': [
|
|
236
|
+
'getRecentTrades', 'getTrades'
|
|
237
|
+
],
|
|
169
238
|
};
|
|
170
239
|
/**
|
|
171
240
|
* Composite topics that don't map 1:1 to SDK methods
|
|
@@ -173,7 +242,7 @@ exports.TOPIC_METHOD_MAPPING = {
|
|
|
173
242
|
*/
|
|
174
243
|
exports.COMPOSITE_TOPICS = new Set([
|
|
175
244
|
'buy-tokens', 'sell-tokens', 'pool-graduation', 'fetch-pools', 'balances',
|
|
176
|
-
'token-creation', 'token-status', 'multi-wallet', 'transfers', 'locks', 'dex-trading', 'error-handling',
|
|
245
|
+
'token-creation', 'token-status', 'wallet-connect', 'multi-wallet', 'transfers', 'locks', 'dex-trading', 'gdex-stream', 'error-handling',
|
|
177
246
|
'installation', 'local-calculations', 'price-history', 'token-details',
|
|
178
247
|
'spot-prices-smart-routing', 'profile-management', 'token-distribution',
|
|
179
248
|
'liquidity-positions', 'advanced-dex-analysis',
|
|
@@ -184,6 +253,13 @@ exports.COMPOSITE_TOPICS = new Set([
|
|
|
184
253
|
'session-auth', 'streaming', 'stream-chat', 'ban-management', 'api-key-management',
|
|
185
254
|
'moderator-invites', 'overseer-invites', 'content-flag-management', 'content-reactions', 'trade-history', 'token-ban-management',
|
|
186
255
|
'nft-collection-management',
|
|
256
|
+
// Token Concepts (v5.14.0+)
|
|
257
|
+
'token-identification', 'graduation-detection',
|
|
258
|
+
// New Categories (v7.0.0+)
|
|
259
|
+
'ai-moderation', 'weekly-challenge', 'platform-stats', 'restricted-names',
|
|
260
|
+
'websocket-admin', 'oembed', 'messages', 'holders',
|
|
261
|
+
// Trading & Events (v9.1.0+)
|
|
262
|
+
'trading-quotes', 'global-feed-subscription', 'events-tracking', 'global-bans', 'recent-trades',
|
|
187
263
|
]);
|
|
188
264
|
/**
|
|
189
265
|
* SDK code examples organized by topic
|
|
@@ -620,63 +696,491 @@ async function launchToken() {
|
|
|
620
696
|
- \`gala_launchpad_get_url_by_token_name\`
|
|
621
697
|
`,
|
|
622
698
|
// ============================================================================
|
|
623
|
-
//
|
|
699
|
+
// WALLET CONNECTION & MANAGEMENT
|
|
624
700
|
// ============================================================================
|
|
625
|
-
// -
|
|
701
|
+
// - wallet-connect: Quick start guide for connecting wallets (beginner)
|
|
702
|
+
// - multi-wallet: Full wallet provider system reference (advanced)
|
|
626
703
|
// - transfers: Send GALA and tokens to other addresses
|
|
627
704
|
// ============================================================================
|
|
705
|
+
'wallet-connect': `
|
|
706
|
+
## How to Connect Your Wallet
|
|
707
|
+
|
|
708
|
+
The fastest way to add wallet connection to your dapp. Supports 13 browser wallets, React hooks, and Node.js.
|
|
709
|
+
|
|
710
|
+
---
|
|
711
|
+
|
|
712
|
+
### React (3 Steps)
|
|
713
|
+
|
|
714
|
+
**Step 1: Wrap your app**
|
|
715
|
+
|
|
716
|
+
\`\`\`tsx
|
|
717
|
+
import { WalletProvider } from '@gala-chain/launchpad-sdk/react';
|
|
718
|
+
|
|
719
|
+
function App() {
|
|
720
|
+
return (
|
|
721
|
+
<WalletProvider autoDetect>
|
|
722
|
+
<YourApp />
|
|
723
|
+
</WalletProvider>
|
|
724
|
+
);
|
|
725
|
+
}
|
|
726
|
+
\`\`\`
|
|
727
|
+
|
|
728
|
+
**Step 2: Detect and connect**
|
|
729
|
+
|
|
730
|
+
\`\`\`tsx
|
|
731
|
+
import { useWalletDetection, useWalletConnection } from '@gala-chain/launchpad-sdk/react';
|
|
732
|
+
|
|
733
|
+
function WalletPicker() {
|
|
734
|
+
const { wallets, isDetecting } = useWalletDetection();
|
|
735
|
+
const { connectDetected, isConnecting } = useWalletConnection();
|
|
736
|
+
|
|
737
|
+
if (isDetecting) return <p>Scanning for wallets...</p>;
|
|
738
|
+
|
|
739
|
+
return (
|
|
740
|
+
<div>
|
|
741
|
+
{wallets.map(wallet => (
|
|
742
|
+
<button key={wallet.id} onClick={() => connectDetected(wallet)} disabled={isConnecting}>
|
|
743
|
+
<img src={wallet.icon} alt="" width={24} /> {wallet.name}
|
|
744
|
+
</button>
|
|
745
|
+
))}
|
|
746
|
+
</div>
|
|
747
|
+
);
|
|
748
|
+
}
|
|
749
|
+
\`\`\`
|
|
750
|
+
|
|
751
|
+
**Step 3: Use wallet state**
|
|
752
|
+
|
|
753
|
+
\`\`\`tsx
|
|
754
|
+
import { useWallet, useGalaAddress, useWalletProvider } from '@gala-chain/launchpad-sdk/react';
|
|
755
|
+
|
|
756
|
+
function Dashboard() {
|
|
757
|
+
const { isConnected, address } = useWallet();
|
|
758
|
+
const galaAddress = useGalaAddress(); // eth|0x... format
|
|
759
|
+
const provider = useWalletProvider();
|
|
760
|
+
|
|
761
|
+
if (!isConnected) return <WalletPicker />;
|
|
762
|
+
|
|
763
|
+
// Sign a message
|
|
764
|
+
const sig = await provider.signMessage('Hello from my dapp');
|
|
765
|
+
|
|
766
|
+
// Sign EIP-712 typed data (required for GalaChain transactions)
|
|
767
|
+
const typedSig = await provider.signTypedData(domain, types, value);
|
|
768
|
+
}
|
|
769
|
+
\`\`\`
|
|
770
|
+
|
|
771
|
+
---
|
|
772
|
+
|
|
773
|
+
### Node.js / CLI
|
|
774
|
+
|
|
775
|
+
\`\`\`typescript
|
|
776
|
+
import { PrivateKeyProvider } from '@gala-chain/launchpad-sdk/wallet';
|
|
777
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
778
|
+
|
|
779
|
+
const provider = new PrivateKeyProvider('0xYOUR_PRIVATE_KEY');
|
|
780
|
+
const sdk = createLaunchpadSDK({ walletProvider: provider, environment: 'production' });
|
|
781
|
+
|
|
782
|
+
const address = await provider.getAddress(); // 0x checksummed
|
|
783
|
+
const galaAddr = await provider.getGalaAddress(); // eth|{40-hex}
|
|
784
|
+
\`\`\`
|
|
785
|
+
|
|
786
|
+
---
|
|
787
|
+
|
|
788
|
+
### Vanilla Browser (no React)
|
|
789
|
+
|
|
790
|
+
\`\`\`typescript
|
|
791
|
+
import { detectWallets, ExternalWalletProvider } from '@gala-chain/launchpad-sdk/wallet';
|
|
792
|
+
|
|
793
|
+
const { wallets, primary, hasWallets } = await detectWallets();
|
|
794
|
+
if (hasWallets) {
|
|
795
|
+
const provider = new ExternalWalletProvider(primary.provider);
|
|
796
|
+
const address = await provider.connect(); // triggers wallet popup
|
|
797
|
+
const sig = await provider.signMessage('Hello');
|
|
798
|
+
await provider.disconnect();
|
|
799
|
+
}
|
|
800
|
+
\`\`\`
|
|
801
|
+
|
|
802
|
+
---
|
|
803
|
+
|
|
804
|
+
### Supported Wallets (EIP-6963)
|
|
805
|
+
|
|
806
|
+
MetaMask, Coinbase Wallet, Trust Wallet, Phantom, Rainbow, OKX, Rabby, Brave, Frame, Ledger, Zerion, Gala Wallet, MetaMask Flask.
|
|
807
|
+
|
|
808
|
+
Falls back to \`window.ethereum\` if no EIP-6963 announcements received.
|
|
809
|
+
|
|
810
|
+
### React Hooks
|
|
811
|
+
|
|
812
|
+
| Hook | Returns |
|
|
813
|
+
|------|---------|
|
|
814
|
+
| \`useWallet()\` | isConnected, address, galaAddress, provider, error |
|
|
815
|
+
| \`useWalletAddress()\` | string (0x...) or null |
|
|
816
|
+
| \`useGalaAddress()\` | string (eth|...) or null |
|
|
817
|
+
| \`useWalletProvider()\` | WalletProvider instance or null |
|
|
818
|
+
| \`useWalletConnection()\` | connectDetected(), disconnect(), isConnecting |
|
|
819
|
+
| \`useWalletDetection()\` | wallets[], isDetecting, refreshWallets() |
|
|
820
|
+
|
|
821
|
+
### Import Paths
|
|
822
|
+
|
|
823
|
+
\`\`\`typescript
|
|
824
|
+
// React hooks
|
|
825
|
+
import { WalletProvider, useWallet, useWalletDetection } from '@gala-chain/launchpad-sdk/react';
|
|
826
|
+
|
|
827
|
+
// Low-level providers (non-React)
|
|
828
|
+
import { PrivateKeyProvider, ExternalWalletProvider, detectWallets } from '@gala-chain/launchpad-sdk/wallet';
|
|
829
|
+
\`\`\`
|
|
830
|
+
|
|
831
|
+
### Next Steps
|
|
832
|
+
|
|
833
|
+
- **Advanced wallet management**: See the \`multi-wallet\` topic for provider types, EIP-712 signing, error handling, and multi-wallet patterns
|
|
834
|
+
- **Authentication**: See the \`session-auth\` topic for JWT login flows after wallet connection
|
|
835
|
+
- **Trading**: See \`buy-tokens\` to make your first trade after connecting
|
|
836
|
+
`,
|
|
628
837
|
'multi-wallet': `
|
|
629
|
-
##
|
|
838
|
+
## Wallet Provider System (v9.0.0+)
|
|
630
839
|
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
840
|
+
The SDK provides a unified \`WalletProvider\` interface that abstracts wallet operations across 4 provider types, with EIP-6963 browser wallet detection and full signing support.
|
|
841
|
+
|
|
842
|
+
**Covers:**
|
|
843
|
+
- 4 wallet provider types (PrivateKey, External, Gala, GalaChainConnect)
|
|
844
|
+
- EIP-6963 wallet detection (13 known wallets)
|
|
845
|
+
- Connection lifecycle (connect, sign, disconnect)
|
|
846
|
+
- Multi-wallet patterns and per-operation overrides
|
|
847
|
+
- MCP wallet tools: \`createWallet\`, \`createSolanaWallet\`, \`getAddress\`, \`getEthereumAddress\`, \`getPublicKeyFromPrivateKey\`, \`getEthereumAddressFromPrivateKey\`
|
|
848
|
+
|
|
849
|
+
---
|
|
850
|
+
|
|
851
|
+
### Wallet Provider Types
|
|
852
|
+
|
|
853
|
+
| Provider | Use Case | Key Access | Browser Required |
|
|
854
|
+
|----------|----------|------------|-----------------|
|
|
855
|
+
| \`PrivateKeyProvider\` | CLI, Node.js, scripts | Yes (full) | No |
|
|
856
|
+
| \`ExternalWalletProvider\` | MetaMask, Coinbase, etc. | No | Yes |
|
|
857
|
+
| \`GalaWalletProvider\` | Gala Wallet extension | No | Yes |
|
|
858
|
+
| \`GalaChainConnectProvider\` | @gala-chain/connect clients | No | Yes |
|
|
859
|
+
|
|
860
|
+
---
|
|
861
|
+
|
|
862
|
+
### 1. PrivateKeyProvider (CLI / Node.js)
|
|
863
|
+
|
|
864
|
+
Best for scripts, bots, and server-side code where you have the private key.
|
|
865
|
+
|
|
866
|
+
\`\`\`typescript
|
|
867
|
+
import { PrivateKeyProvider, createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
868
|
+
|
|
869
|
+
// Create provider from private key
|
|
870
|
+
const provider = new PrivateKeyProvider('0xYOUR_PRIVATE_KEY');
|
|
871
|
+
|
|
872
|
+
// Use with SDK
|
|
873
|
+
const sdk = createLaunchpadSDK({
|
|
874
|
+
walletProvider: provider,
|
|
875
|
+
environment: 'production',
|
|
876
|
+
});
|
|
877
|
+
|
|
878
|
+
// Provider is always "connected" - no user interaction needed
|
|
879
|
+
const address = await provider.getAddress(); // 0x checksummed
|
|
880
|
+
const galaAddr = await provider.getGalaAddress(); // eth|{40-hex}
|
|
881
|
+
const key = await provider.getPrivateKey(); // 0x prefixed
|
|
882
|
+
const signature = await provider.signMessage('Hello');
|
|
883
|
+
\`\`\`
|
|
884
|
+
|
|
885
|
+
---
|
|
886
|
+
|
|
887
|
+
### 2. ExternalWalletProvider (Browser Extensions)
|
|
888
|
+
|
|
889
|
+
Wraps any EIP-1193 compatible browser wallet (MetaMask, Coinbase, Phantom, etc.).
|
|
890
|
+
|
|
891
|
+
\`\`\`typescript
|
|
892
|
+
import { ExternalWalletProvider } from '@gala-chain/launchpad-sdk/wallet';
|
|
893
|
+
|
|
894
|
+
// Wrap browser extension provider
|
|
895
|
+
const provider = new ExternalWalletProvider(window.ethereum);
|
|
896
|
+
|
|
897
|
+
// Connect (triggers wallet popup for user approval)
|
|
898
|
+
const address = await provider.connect();
|
|
899
|
+
console.log('Connected:', address);
|
|
900
|
+
|
|
901
|
+
// Sign messages
|
|
902
|
+
const sig = await provider.signMessage('Sign in to Launchpad');
|
|
903
|
+
|
|
904
|
+
// Sign EIP-712 typed data (required for GalaChain transfers)
|
|
905
|
+
const typedSig = await provider.signTypedData(
|
|
906
|
+
{ name: 'GalaChain', version: '1' },
|
|
907
|
+
{ Transfer: [{ name: 'to', type: 'address' }, { name: 'amount', type: 'uint256' }] },
|
|
908
|
+
{ to: '0x...', amount: '1000' }
|
|
909
|
+
);
|
|
910
|
+
|
|
911
|
+
// Disconnect when done
|
|
912
|
+
await provider.disconnect();
|
|
913
|
+
\`\`\`
|
|
914
|
+
|
|
915
|
+
---
|
|
916
|
+
|
|
917
|
+
### 3. Browser Wallet Detection (EIP-6963)
|
|
918
|
+
|
|
919
|
+
The SDK uses the modern EIP-6963 standard to detect installed wallets without conflicts.
|
|
920
|
+
|
|
921
|
+
\`\`\`typescript
|
|
922
|
+
import {
|
|
923
|
+
detectWallets,
|
|
924
|
+
getWalletByRdns,
|
|
925
|
+
isWalletAvailable,
|
|
926
|
+
hasAnyWallet,
|
|
927
|
+
subscribeToWalletChanges,
|
|
928
|
+
KNOWN_WALLET_RDNS,
|
|
929
|
+
ExternalWalletProvider,
|
|
930
|
+
} from '@gala-chain/launchpad-sdk/wallet';
|
|
931
|
+
|
|
932
|
+
// Quick synchronous check (no waiting)
|
|
933
|
+
if (hasAnyWallet()) {
|
|
934
|
+
console.log('At least one wallet detected');
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
// Full async detection (waits for EIP-6963 announcements, 500ms default)
|
|
938
|
+
const { wallets, primary, hasWallets, byId } = await detectWallets();
|
|
939
|
+
|
|
940
|
+
if (hasWallets) {
|
|
941
|
+
console.log('Available wallets:', wallets.map(w => \`\${w.name} (\${w.rdns})\`));
|
|
942
|
+
|
|
943
|
+
// Connect to the primary wallet
|
|
944
|
+
const provider = new ExternalWalletProvider(primary.provider);
|
|
945
|
+
await provider.connect();
|
|
946
|
+
}
|
|
947
|
+
|
|
948
|
+
// Check for a specific wallet
|
|
949
|
+
if (await isWalletAvailable(KNOWN_WALLET_RDNS.METAMASK)) {
|
|
950
|
+
const metamask = await getWalletByRdns(KNOWN_WALLET_RDNS.METAMASK);
|
|
951
|
+
const provider = new ExternalWalletProvider(metamask.provider);
|
|
952
|
+
await provider.connect();
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
// Subscribe to wallet changes (reactive)
|
|
956
|
+
const unsubscribe = subscribeToWalletChanges((result) => {
|
|
957
|
+
console.log('Wallets changed:', result.wallets.length);
|
|
958
|
+
});
|
|
959
|
+
// Later: unsubscribe();
|
|
960
|
+
\`\`\`
|
|
961
|
+
|
|
962
|
+
**13 Known Wallet RDNS Identifiers:**
|
|
963
|
+
\`\`\`typescript
|
|
964
|
+
KNOWN_WALLET_RDNS = {
|
|
965
|
+
METAMASK: 'io.metamask',
|
|
966
|
+
METAMASK_FLASK: 'io.metamask.flask',
|
|
967
|
+
COINBASE: 'com.coinbase.wallet',
|
|
968
|
+
TRUST_WALLET: 'com.trustwallet.app',
|
|
969
|
+
PHANTOM: 'app.phantom',
|
|
970
|
+
RAINBOW: 'me.rainbow',
|
|
971
|
+
OKX: 'com.okex.wallet',
|
|
972
|
+
RABBY: 'io.rabby',
|
|
973
|
+
BRAVE: 'com.brave.wallet',
|
|
974
|
+
FRAME: 'sh.frame',
|
|
975
|
+
LEDGER: 'com.ledger',
|
|
976
|
+
ZERION: 'io.zerion.wallet',
|
|
977
|
+
GALA: 'com.gala.wallet',
|
|
978
|
+
};
|
|
979
|
+
\`\`\`
|
|
980
|
+
|
|
981
|
+
---
|
|
982
|
+
|
|
983
|
+
### 4. GalaWalletProvider
|
|
984
|
+
|
|
985
|
+
Specialized provider for the Gala Wallet browser extension.
|
|
986
|
+
|
|
987
|
+
\`\`\`typescript
|
|
988
|
+
import { GalaWalletProvider } from '@gala-chain/launchpad-sdk/wallet';
|
|
989
|
+
|
|
990
|
+
// window.gala is the Gala Wallet provider
|
|
991
|
+
const provider = new GalaWalletProvider(window.gala);
|
|
992
|
+
const address = await provider.connect();
|
|
993
|
+
\`\`\`
|
|
994
|
+
|
|
995
|
+
---
|
|
996
|
+
|
|
997
|
+
### 5. Factory Function
|
|
998
|
+
|
|
999
|
+
Use \`createWalletProvider()\` when the wallet source is determined at runtime.
|
|
1000
|
+
|
|
1001
|
+
\`\`\`typescript
|
|
1002
|
+
import { createWalletProvider } from '@gala-chain/launchpad-sdk/wallet';
|
|
1003
|
+
|
|
1004
|
+
// From private key
|
|
1005
|
+
const cliProvider = createWalletProvider({ privateKey: '0x...' });
|
|
1006
|
+
|
|
1007
|
+
// From browser extension
|
|
1008
|
+
const browserProvider = createWalletProvider({
|
|
1009
|
+
eip1193Provider: window.ethereum,
|
|
1010
|
+
autoConnect: true,
|
|
1011
|
+
});
|
|
1012
|
+
\`\`\`
|
|
1013
|
+
|
|
1014
|
+
---
|
|
1015
|
+
|
|
1016
|
+
### 6. Provider Utilities
|
|
1017
|
+
|
|
1018
|
+
\`\`\`typescript
|
|
1019
|
+
import {
|
|
1020
|
+
isPrivateKeyProvider,
|
|
1021
|
+
isExternalProvider,
|
|
1022
|
+
getPrivateKeyIfAvailable,
|
|
1023
|
+
ensureConnected,
|
|
1024
|
+
walletToProvider,
|
|
1025
|
+
providerToWallet,
|
|
1026
|
+
} from '@gala-chain/launchpad-sdk/wallet';
|
|
1027
|
+
|
|
1028
|
+
// Type guards
|
|
1029
|
+
if (isPrivateKeyProvider(provider)) {
|
|
1030
|
+
const key = await provider.getPrivateKey();
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
if (isExternalProvider(provider)) {
|
|
1034
|
+
// Cannot access private key - signing goes through browser wallet
|
|
1035
|
+
}
|
|
1036
|
+
|
|
1037
|
+
// Safe private key access (returns null for external providers)
|
|
1038
|
+
const key = await getPrivateKeyIfAvailable(provider);
|
|
1039
|
+
|
|
1040
|
+
// Ensure connected before operations
|
|
1041
|
+
await ensureConnected(provider);
|
|
1042
|
+
|
|
1043
|
+
// Convert between ethers Wallet and WalletProvider
|
|
1044
|
+
import { Wallet } from 'ethers';
|
|
1045
|
+
const ethersWallet = new Wallet('0x...');
|
|
1046
|
+
const provider = walletToProvider(ethersWallet);
|
|
1047
|
+
const wallet = await providerToWallet(provider); // only works for PrivateKeyProvider
|
|
1048
|
+
\`\`\`
|
|
1049
|
+
|
|
1050
|
+
---
|
|
1051
|
+
|
|
1052
|
+
### 7. Multi-Wallet Patterns
|
|
1053
|
+
|
|
1054
|
+
**Per-operation privateKey override** (use a different wallet for one operation):
|
|
634
1055
|
|
|
635
1056
|
\`\`\`typescript
|
|
636
1057
|
import { createLaunchpadSDK, createWallet } from '@gala-chain/launchpad-sdk';
|
|
637
1058
|
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
const sdk = createLaunchpadSDK({
|
|
641
|
-
wallet: 'your-main-private-key'
|
|
642
|
-
});
|
|
1059
|
+
const sdk = createLaunchpadSDK({ wallet: 'main-private-key' });
|
|
1060
|
+
const testWallet = createWallet();
|
|
643
1061
|
|
|
644
|
-
|
|
645
|
-
|
|
1062
|
+
// Fund test wallet from main
|
|
1063
|
+
await sdk.transferGala({
|
|
1064
|
+
recipientAddress: testWallet.address,
|
|
1065
|
+
amount: '1000',
|
|
1066
|
+
});
|
|
646
1067
|
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
1068
|
+
// Buy with test wallet (privateKey override)
|
|
1069
|
+
await sdk.buy({
|
|
1070
|
+
tokenName: 'anime',
|
|
1071
|
+
amount: '100',
|
|
1072
|
+
type: 'native',
|
|
1073
|
+
expectedAmount: '500',
|
|
1074
|
+
slippageToleranceFactor: 0.01,
|
|
1075
|
+
privateKey: testWallet.privateKey, // Uses test wallet for this operation only
|
|
1076
|
+
});
|
|
652
1077
|
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
amount: '100',
|
|
657
|
-
type: 'native'
|
|
658
|
-
});
|
|
1078
|
+
// Main wallet is still the default for other operations
|
|
1079
|
+
const mainBalance = await sdk.fetchGalaBalance();
|
|
1080
|
+
\`\`\`
|
|
659
1081
|
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
1082
|
+
**Switching wallets at runtime:**
|
|
1083
|
+
|
|
1084
|
+
\`\`\`typescript
|
|
1085
|
+
// Create SDK with WalletProvider (can be swapped)
|
|
1086
|
+
let provider = new PrivateKeyProvider('0xKEY_A');
|
|
1087
|
+
const sdk = createLaunchpadSDK({ walletProvider: provider });
|
|
1088
|
+
|
|
1089
|
+
// Later: switch to a different wallet
|
|
1090
|
+
provider = new PrivateKeyProvider('0xKEY_B');
|
|
1091
|
+
const sdk2 = createLaunchpadSDK({ walletProvider: provider });
|
|
1092
|
+
\`\`\`
|
|
1093
|
+
|
|
1094
|
+
---
|
|
1095
|
+
|
|
1096
|
+
### 8. Wallet Creation Utilities
|
|
1097
|
+
|
|
1098
|
+
\`\`\`typescript
|
|
1099
|
+
import { createWallet, WalletUtils } from '@gala-chain/launchpad-sdk';
|
|
1100
|
+
|
|
1101
|
+
// Quick wallet creation (auto-detects input)
|
|
1102
|
+
const random = createWallet(); // Random wallet
|
|
1103
|
+
const fromKey = createWallet('0x...'); // From private key
|
|
1104
|
+
const fromMnemonic = createWallet('word1 word2...'); // From mnemonic
|
|
1105
|
+
|
|
1106
|
+
// WalletUtils class methods
|
|
1107
|
+
const wallet = WalletUtils.generateWallet();
|
|
1108
|
+
const fromPK = WalletUtils.fromPrivateKey('0x...');
|
|
1109
|
+
const fromMN = WalletUtils.fromMnemonic('word1 word2...', 0); // BIP44 index
|
|
1110
|
+
|
|
1111
|
+
// Address conversion
|
|
1112
|
+
const galaAddr = WalletUtils.toGalaAddress('0x1234...'); // eth|1234...
|
|
1113
|
+
const ethAddr = WalletUtils.toEthereumAddress('eth|1234'); // 0x1234...
|
|
1114
|
+
|
|
1115
|
+
// Validation
|
|
1116
|
+
WalletUtils.isValidEthereumAddress('0x...'); // true/false
|
|
1117
|
+
WalletUtils.isValidGalaAddress('eth|...'); // true/false
|
|
1118
|
+
\`\`\`
|
|
1119
|
+
|
|
1120
|
+
---
|
|
1121
|
+
|
|
1122
|
+
### 9. Error Handling
|
|
668
1123
|
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
const testBalance = await sdk.fetchGalaBalance(testWallet.address); // Test wallet
|
|
1124
|
+
\`\`\`typescript
|
|
1125
|
+
import { WalletProviderError, WalletProviderErrorCode } from '@gala-chain/launchpad-sdk/wallet';
|
|
672
1126
|
|
|
1127
|
+
try {
|
|
1128
|
+
await provider.connect();
|
|
1129
|
+
} catch (error) {
|
|
1130
|
+
if (error instanceof WalletProviderError) {
|
|
1131
|
+
switch (error.code) {
|
|
1132
|
+
case WalletProviderErrorCode.USER_REJECTED:
|
|
1133
|
+
console.log('User rejected the connection');
|
|
1134
|
+
break;
|
|
1135
|
+
case WalletProviderErrorCode.PROVIDER_NOT_AVAILABLE:
|
|
1136
|
+
console.log('Wallet not installed');
|
|
1137
|
+
break;
|
|
1138
|
+
case WalletProviderErrorCode.CONNECTION_FAILED:
|
|
1139
|
+
console.log('Connection failed:', error.message);
|
|
1140
|
+
break;
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
673
1143
|
}
|
|
674
1144
|
\`\`\`
|
|
675
1145
|
|
|
676
|
-
**
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
1146
|
+
**Error codes:** USER_REJECTED, NOT_CONNECTED, CONNECTION_FAILED, SIGNING_FAILED, PROVIDER_NOT_AVAILABLE, PRIVATE_KEY_NOT_ACCESSIBLE, INVALID_CONFIG, CHAIN_MISMATCH, UNKNOWN.
|
|
1147
|
+
|
|
1148
|
+
---
|
|
1149
|
+
|
|
1150
|
+
### MCP Tool Equivalents
|
|
1151
|
+
|
|
1152
|
+
| Operation | MCP Tool |
|
|
1153
|
+
|-----------|----------|
|
|
1154
|
+
| Create wallet | \`gala_launchpad_create_wallet\` |
|
|
1155
|
+
| Create Solana wallet | \`gala_launchpad_create_solana_wallet\` |
|
|
1156
|
+
| Get address | \`gala_launchpad_get_address\` |
|
|
1157
|
+
| Get Ethereum address | \`gala_launchpad_get_ethereum_address\` |
|
|
1158
|
+
| Derive public key | \`gala_launchpad_get_public_key_from_private_key\` |
|
|
1159
|
+
| Derive ETH address from key | \`gala_launchpad_get_ethereum_address_from_private_key\` |
|
|
1160
|
+
|
|
1161
|
+
Note: Browser wallet detection and connection are SDK-side operations and don't have MCP tool equivalents (they require a browser environment).
|
|
1162
|
+
|
|
1163
|
+
---
|
|
1164
|
+
|
|
1165
|
+
### Import Paths
|
|
1166
|
+
|
|
1167
|
+
\`\`\`typescript
|
|
1168
|
+
// Main SDK entry (includes wallet creation utilities)
|
|
1169
|
+
import { createWallet, WalletUtils, createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
1170
|
+
|
|
1171
|
+
// Wallet submodule (providers, detection, types)
|
|
1172
|
+
import {
|
|
1173
|
+
PrivateKeyProvider,
|
|
1174
|
+
ExternalWalletProvider,
|
|
1175
|
+
GalaWalletProvider,
|
|
1176
|
+
GalaChainConnectProvider,
|
|
1177
|
+
detectWallets,
|
|
1178
|
+
KNOWN_WALLET_RDNS,
|
|
1179
|
+
createWalletProvider,
|
|
1180
|
+
WalletProviderError,
|
|
1181
|
+
WalletProviderErrorCode,
|
|
1182
|
+
} from '@gala-chain/launchpad-sdk/wallet';
|
|
1183
|
+
\`\`\`
|
|
680
1184
|
`,
|
|
681
1185
|
'transfers': `
|
|
682
1186
|
## Token Transfers with SDK
|
|
@@ -964,7 +1468,7 @@ async function tokenLockingAndBurning() {
|
|
|
964
1468
|
- \`getAllSwapUserAssets()\`
|
|
965
1469
|
- \`getSwapPoolInfo()\`
|
|
966
1470
|
|
|
967
|
-
|
|
1471
|
+
Use REST-backed DEX reads for quotes and pool information, then execute signed swaps with real-time WebSocket transaction monitoring:
|
|
968
1472
|
|
|
969
1473
|
\`\`\`typescript
|
|
970
1474
|
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
@@ -980,6 +1484,10 @@ async function dexTradingExample() {
|
|
|
980
1484
|
// QUOTES: Get pricing information (read-only operations)
|
|
981
1485
|
// ============================================================================
|
|
982
1486
|
|
|
1487
|
+
// Quotes come from the DEX backend (~1s freshness) and need no signer.
|
|
1488
|
+
// Restricted tokens: TokenRestrictedError (403); missing pool: not-found;
|
|
1489
|
+
// heavy usage: 429 rate limit.
|
|
1490
|
+
|
|
983
1491
|
// Quote 1: Exact input (spend known GALA amount)
|
|
984
1492
|
const quoteIn = await sdk.getSwapQuoteExactInput('GALA', 'GUSDC', '100');
|
|
985
1493
|
|
|
@@ -1029,6 +1537,7 @@ async function dexTradingExample() {
|
|
|
1029
1537
|
\`\`\`
|
|
1030
1538
|
|
|
1031
1539
|
**Key Architecture:**
|
|
1540
|
+
- **Public REST Reads**: Quotes and pool information use the DEX backend (~1s freshness) without a signer
|
|
1032
1541
|
- **Unified WebSocket**: Uses LaunchpadSDK's unified WebSocket for transaction monitoring
|
|
1033
1542
|
- **Environment Alignment**: STAGE/PROD URLs must match between LaunchpadSDK and GSwapService
|
|
1034
1543
|
- **Token Formats**:
|
|
@@ -1045,6 +1554,117 @@ async function dexTradingExample() {
|
|
|
1045
1554
|
- \`gala_launchpad_get_swap_user_assets\`
|
|
1046
1555
|
- \`gala_launchpad_get_all_swap_user_assets\`
|
|
1047
1556
|
- \`gala_launchpad_get_swap_pool_info\`
|
|
1557
|
+
`,
|
|
1558
|
+
'gdex-stream': `
|
|
1559
|
+
## Real-Time gSwap Market Data with GDEX Stream
|
|
1560
|
+
|
|
1561
|
+
\`GdexStreamService\` is a public, read-only JSON-RPC 2.0 client for gSwap queries and real-time
|
|
1562
|
+
events over one raw WebSocket connection. It does not use Socket.IO and needs no wallet or signer.
|
|
1563
|
+
|
|
1564
|
+
**Covers Methods:**
|
|
1565
|
+
- \`connect()\`, \`disconnect()\`, \`isConnected()\`, \`request()\`
|
|
1566
|
+
- \`serverInfo()\`, \`ping()\`, \`getPool()\`, \`getBalance()\`, \`getPositions()\`
|
|
1567
|
+
- \`getBlockHeight()\`, \`quote()\`, \`getToken()\`
|
|
1568
|
+
- \`subscribeSwaps()\`, \`subscribePool()\`, \`subscribeBalances()\`
|
|
1569
|
+
- \`subscribePoolCreated()\`, \`subscribeBlocks()\`
|
|
1570
|
+
|
|
1571
|
+
## Get the Service
|
|
1572
|
+
|
|
1573
|
+
Use the SDK facade when the stream should follow the SDK environment, or construct the service
|
|
1574
|
+
directly for a standalone market-data client:
|
|
1575
|
+
|
|
1576
|
+
\`\`\`typescript
|
|
1577
|
+
import { GdexStreamService, LaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
1578
|
+
|
|
1579
|
+
// Lazily created by the SDK; no wallet is required.
|
|
1580
|
+
const sdk = new LaunchpadSDK({ env: 'STAGE' });
|
|
1581
|
+
const gdex = sdk.getGdexStreamService();
|
|
1582
|
+
|
|
1583
|
+
// Or use the service without a LaunchpadSDK instance.
|
|
1584
|
+
const standalone = new GdexStreamService({
|
|
1585
|
+
url: 'wss://swap-backend.stage.defi.ovh.gala.com/ws',
|
|
1586
|
+
});
|
|
1587
|
+
|
|
1588
|
+
await gdex.connect();
|
|
1589
|
+
console.log(await gdex.serverInfo());
|
|
1590
|
+
\`\`\`
|
|
1591
|
+
|
|
1592
|
+
## Stream Swaps and Dedupe Replays
|
|
1593
|
+
|
|
1594
|
+
Delivery is effectively at least once after a reconnect or server restart, so dedupe swap events by
|
|
1595
|
+
\`transactionId\` before updating application state:
|
|
1596
|
+
|
|
1597
|
+
\`\`\`typescript
|
|
1598
|
+
const seenTransactions = new Set<string>();
|
|
1599
|
+
|
|
1600
|
+
const swaps = await gdex.subscribeSwaps(swap => {
|
|
1601
|
+
const transactionId = swap.transactionId as string;
|
|
1602
|
+
if (seenTransactions.has(transactionId)) return;
|
|
1603
|
+
seenTransactions.add(transactionId);
|
|
1604
|
+
|
|
1605
|
+
console.log(transactionId, swap.amount0, swap.amount1, swap.timestamp);
|
|
1606
|
+
}, {
|
|
1607
|
+
poolHash: '760ae55afa52316deb0eeb5d38178d80d90f3a85fcfb93b1c18e2c86c28e886c',
|
|
1608
|
+
});
|
|
1609
|
+
|
|
1610
|
+
// Later: await swaps.unsubscribe();
|
|
1611
|
+
\`\`\`
|
|
1612
|
+
|
|
1613
|
+
## Watch a Pool from Snapshot to Live Updates
|
|
1614
|
+
|
|
1615
|
+
Set \`snapshot: true\` to receive current pool state followed by live deltas on the same callback:
|
|
1616
|
+
|
|
1617
|
+
\`\`\`typescript
|
|
1618
|
+
const pool = await gdex.subscribePool(
|
|
1619
|
+
{ poolHash: '760ae55afa52316deb0eeb5d38178d80d90f3a85fcfb93b1c18e2c86c28e886c' },
|
|
1620
|
+
update => {
|
|
1621
|
+
if (update.snapshot === true) console.log('Current pool state:', update);
|
|
1622
|
+
else console.log('Pool update:', update);
|
|
1623
|
+
},
|
|
1624
|
+
{ snapshot: true }
|
|
1625
|
+
);
|
|
1626
|
+
|
|
1627
|
+
// The same handle remains valid after automatic reconnect.
|
|
1628
|
+
// Later: await pool.unsubscribe();
|
|
1629
|
+
\`\`\`
|
|
1630
|
+
|
|
1631
|
+
## Get a Quote over the WebSocket
|
|
1632
|
+
|
|
1633
|
+
\`quote()\` accepts exactly one of \`amountIn\` or \`amountOut\`. Omit \`fee\` to compare all
|
|
1634
|
+
existing fee tiers.
|
|
1635
|
+
|
|
1636
|
+
\`\`\`typescript
|
|
1637
|
+
const quote = await gdex.quote({
|
|
1638
|
+
tokenIn: 'GALA|Unit|none|none',
|
|
1639
|
+
tokenOut: 'GUSDC|Unit|none|none',
|
|
1640
|
+
fee: 10000,
|
|
1641
|
+
amountIn: '100',
|
|
1642
|
+
});
|
|
1643
|
+
|
|
1644
|
+
console.log(quote);
|
|
1645
|
+
\`\`\`
|
|
1646
|
+
|
|
1647
|
+
## Key Facts
|
|
1648
|
+
|
|
1649
|
+
- **Exact values:** On-chain numerics and epoch-millisecond timestamps are decimal strings. Do not
|
|
1650
|
+
round-trip them through JavaScript floating-point numbers.
|
|
1651
|
+
- **Reconnect behavior:** Unexpected closes use automatic exponential-backoff reconnect. Every
|
|
1652
|
+
active subscription is resubscribed sequentially with forced \`snapshot: true\`; treat that
|
|
1653
|
+
snapshot as truth and compare \`blockNumber\` for state channels.
|
|
1654
|
+
- **Errors:** REST DEX reads may use \`TokenRestrictedError\`-family exceptions. GDEX JSON-RPC
|
|
1655
|
+
protocol and application errors, including \`-32xxx\` codes, reject as \`GdexStreamError\` with
|
|
1656
|
+
\`code\` and optional \`data\`.
|
|
1657
|
+
- **Endpoint availability:** STAGE is live. PROD may reject connections until its server feature flag
|
|
1658
|
+
is enabled; QA1 currently uses STAGE.
|
|
1659
|
+
- **Node.js compatibility:** Browsers and Node.js 22+ use \`globalThis.WebSocket\`. Node.js versions
|
|
1660
|
+
before 22 must pass a standards-compatible constructor through \`webSocketImpl\` (for example,
|
|
1661
|
+
from the \`ws\` package).
|
|
1662
|
+
- **Shutdown:** Call \`disconnect()\` when the application exits; intentional disconnect disables
|
|
1663
|
+
automatic reconnect.
|
|
1664
|
+
|
|
1665
|
+
There is no MCP tool equivalent. See the WebSocket documentation page at
|
|
1666
|
+
\`packages/sdk/docs/websocket/README.md\` and the complete
|
|
1667
|
+
\`packages/sdk/docs/websocket/GDEX-STREAM.md\` guide.
|
|
1048
1668
|
`,
|
|
1049
1669
|
'error-handling': `
|
|
1050
1670
|
## Error Handling with SDK
|
|
@@ -1442,13 +2062,13 @@ async function analyzeTokenDetails() {
|
|
|
1442
2062
|
|
|
1443
2063
|
The SDK intelligently routes pricing requests between DEX and Launchpad backends based on token graduation status - no need to know which backend a token uses!
|
|
1444
2064
|
|
|
2065
|
+
DEX \`tokenId\` price reads use the public \`/v1/trade/price\` REST endpoint (~1s freshness) without a signer. Restricted or ungraduated tokens can return \`TokenRestrictedError\` (403), a missing pool returns a not-found error, and heavy usage can return 429 rate limit.
|
|
2066
|
+
|
|
1445
2067
|
\`\`\`typescript
|
|
1446
2068
|
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
1447
2069
|
|
|
1448
2070
|
async function tokenPricing() {
|
|
1449
|
-
const sdk = createLaunchpadSDK({
|
|
1450
|
-
wallet: 'your-private-key'
|
|
1451
|
-
});
|
|
2071
|
+
const sdk = createLaunchpadSDK({ environment: 'production' });
|
|
1452
2072
|
|
|
1453
2073
|
// OPTION 1: SMART ROUTING (Recommended) - Automatic backend selection
|
|
1454
2074
|
// Use tokenId for ANY token (graduated or ungraduated)
|
|
@@ -1823,6 +2443,8 @@ async function getUserCard() {
|
|
|
1823
2443
|
|
|
1824
2444
|
Provide liquidity on GalaSwap DEX and earn passive trading fees from swaps.
|
|
1825
2445
|
|
|
2446
|
+
Position reads and removal estimates use the DEX backend's public REST endpoints (~1s freshness) and do not require a signer. Restricted tokens can return \`TokenRestrictedError\` (403), missing pools or positions return a not-found error, and heavy usage can return 429 rate limit.
|
|
2447
|
+
|
|
1826
2448
|
**Overview:** Concentrated liquidity allows capital deployment within specific price ranges. Liquidity providers earn fees when trades occur within their price range, making it an attractive passive income strategy.
|
|
1827
2449
|
|
|
1828
2450
|
**9 Core SDK Methods:**
|
|
@@ -1899,6 +2521,8 @@ allPositions.forEach(position => {
|
|
|
1899
2521
|
|
|
1900
2522
|
This workflow demonstrates analyzing graduated tokens using composite data and price calculations.
|
|
1901
2523
|
|
|
2524
|
+
\`fetchCompositePoolData()\` and external quotes are REST-backed DEX reads with ~1s freshness and require no signer. Local quote math performs no network request once composite pool data is supplied. REST reads can return \`TokenRestrictedError\` (403) for restricted tokens, a not-found error for missing pools, or 429 under heavy usage.
|
|
2525
|
+
|
|
1902
2526
|
**Use Cases:**
|
|
1903
2527
|
- Arbitrage opportunity detection
|
|
1904
2528
|
- Price impact analysis before large trades
|
|
@@ -2263,11 +2887,13 @@ async function analyzeVolumeTrends() {
|
|
|
2263
2887
|
|
|
2264
2888
|
Discover and query liquidity pools on GalaSwap with advanced filtering and pagination.
|
|
2265
2889
|
|
|
2890
|
+
These public reads use the DEX backend's REST API (~1s freshness), require no signer, and may return 429 under heavy usage.
|
|
2891
|
+
|
|
2266
2892
|
\`\`\`typescript
|
|
2267
2893
|
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
2268
2894
|
|
|
2269
2895
|
async function queryDexPools() {
|
|
2270
|
-
const sdk = createLaunchpadSDK({
|
|
2896
|
+
const sdk = createLaunchpadSDK({ environment: 'production' });
|
|
2271
2897
|
|
|
2272
2898
|
// Option 1: Fetch pools with pagination
|
|
2273
2899
|
const pools = await sdk.fetchDexPools({
|
|
@@ -2852,6 +3478,26 @@ await sdk.sendTypingStop({
|
|
|
2852
3478
|
});
|
|
2853
3479
|
\`\`\`
|
|
2854
3480
|
|
|
3481
|
+
### Engagement Stats Updates (v8.5.0+)
|
|
3482
|
+
|
|
3483
|
+
\`\`\`typescript
|
|
3484
|
+
// Subscribe to engagement stats updates for a token stream
|
|
3485
|
+
// Fires every ~15 seconds when chat activity occurs
|
|
3486
|
+
await sdk.connectStreamWebSocket();
|
|
3487
|
+
await sdk.authenticateStreamWebSocket('jwt-token');
|
|
3488
|
+
await sdk.subscribeToStream('anime');
|
|
3489
|
+
|
|
3490
|
+
// Register global engagement stats callback
|
|
3491
|
+
const unsubscribe = sdk.onEngagementStatsUpdated((event) => {
|
|
3492
|
+
console.log(\`\${event.tokenName}: \${event.chat.messageCount} chat messages\`);
|
|
3493
|
+
console.log(\`Unique chatters: \${event.chat.uniqueChatters}\`);
|
|
3494
|
+
console.log(\`Comments: \${event.comments.count} from \${event.comments.uniqueCommenters} users\`);
|
|
3495
|
+
});
|
|
3496
|
+
|
|
3497
|
+
// Clean up when done
|
|
3498
|
+
unsubscribe();
|
|
3499
|
+
\`\`\`
|
|
3500
|
+
|
|
2855
3501
|
**MCP Tool Equivalents:**
|
|
2856
3502
|
- \`gala_launchpad_subscribe_to_dex_liquidity_added\`
|
|
2857
3503
|
- \`gala_launchpad_subscribe_to_dex_liquidity_changed\`
|
|
@@ -2859,6 +3505,7 @@ await sdk.sendTypingStop({
|
|
|
2859
3505
|
- \`gala_launchpad_subscribe_to_dex_pool_added\`
|
|
2860
3506
|
- \`gala_launchpad_subscribe_to_dex_swap_executed\`
|
|
2861
3507
|
- \`gala_launchpad_subscribe_to_token_creations\`
|
|
3508
|
+
- \`gala_launchpad_on_engagement_stats_updated\`
|
|
2862
3509
|
`,
|
|
2863
3510
|
// ============================================================================
|
|
2864
3511
|
// MCP TO SDK MAPPING: Cross-Reference Guide
|
|
@@ -3177,6 +3824,69 @@ async function participateInSeason() {
|
|
|
3177
3824
|
- \`fetchCurrentDexLeaderboard()\` - Get current season leaderboard (convenience)
|
|
3178
3825
|
|
|
3179
3826
|
**MCP Tool Equivalent:** \`gala_launchpad_fetch_current_dex_season\`
|
|
3827
|
+
`,
|
|
3828
|
+
'fetch-current-dex-leaderboard': `
|
|
3829
|
+
## Fetch Current DEX Leaderboard
|
|
3830
|
+
|
|
3831
|
+
**Covers Methods:**
|
|
3832
|
+
- \`fetchCurrentDexLeaderboard()\`
|
|
3833
|
+
|
|
3834
|
+
Convenience method to fetch the leaderboard for the current active DEX season.
|
|
3835
|
+
This is a shortcut that combines \`fetchCurrentDexSeason()\` and \`fetchDexLeaderboardBySeasonId()\`.
|
|
3836
|
+
|
|
3837
|
+
\`\`\`typescript
|
|
3838
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
3839
|
+
|
|
3840
|
+
async function viewCurrentLeaderboard() {
|
|
3841
|
+
const sdk = createLaunchpadSDK({ wallet: 'your-private-key' });
|
|
3842
|
+
|
|
3843
|
+
// Fetch current season leaderboard directly
|
|
3844
|
+
const leaderboard = await sdk.fetchCurrentDexLeaderboard();
|
|
3845
|
+
|
|
3846
|
+
if (leaderboard) {
|
|
3847
|
+
console.log('Current Season:', leaderboard.season.name);
|
|
3848
|
+
console.log('Total Participants:', leaderboard.entries.length);
|
|
3849
|
+
|
|
3850
|
+
// Display top 10 traders
|
|
3851
|
+
console.log('\\nTop 10 Traders:');
|
|
3852
|
+
leaderboard.entries.slice(0, 10).forEach((entry, rank) => {
|
|
3853
|
+
console.log(\`#\${rank + 1}: \${entry.wallet}\`);
|
|
3854
|
+
console.log(\` XP: \${entry.xp}, Volume: $\${entry.totalVolume}\`);
|
|
3855
|
+
|
|
3856
|
+
// Display mastery titles
|
|
3857
|
+
if (entry.masteryTitles.length > 0) {
|
|
3858
|
+
console.log(\` Titles: \${entry.masteryTitles.join(', ')}\`);
|
|
3859
|
+
}
|
|
3860
|
+
});
|
|
3861
|
+
|
|
3862
|
+
// Find your own position
|
|
3863
|
+
const myAddress = sdk.getAddress();
|
|
3864
|
+
const myPosition = leaderboard.entries.findIndex(e => e.wallet === myAddress);
|
|
3865
|
+
|
|
3866
|
+
if (myPosition !== -1) {
|
|
3867
|
+
const myEntry = leaderboard.entries[myPosition];
|
|
3868
|
+
console.log(\`\\nYour position: #\${myPosition + 1}\`);
|
|
3869
|
+
console.log(\`XP: \${myEntry.xp}, Volume: $\${myEntry.totalVolume}\`);
|
|
3870
|
+
} else {
|
|
3871
|
+
console.log('\\nYou have not participated in this season yet.');
|
|
3872
|
+
}
|
|
3873
|
+
} else {
|
|
3874
|
+
console.log('No active season currently running.');
|
|
3875
|
+
}
|
|
3876
|
+
}
|
|
3877
|
+
\`\`\`
|
|
3878
|
+
|
|
3879
|
+
**Use Cases:**
|
|
3880
|
+
- Quick access to current season standings
|
|
3881
|
+
- Display leaderboard in UI without multiple API calls
|
|
3882
|
+
- Check your competitive position
|
|
3883
|
+
- Show top traders on dashboard
|
|
3884
|
+
|
|
3885
|
+
**Related Methods:**
|
|
3886
|
+
- \`fetchCurrentDexSeason()\` - Get season metadata only
|
|
3887
|
+
- \`fetchDexLeaderboardBySeasonId()\` - Get leaderboard for any season
|
|
3888
|
+
|
|
3889
|
+
**MCP Tool Equivalent:** \`gala_launchpad_fetch_current_dex_leaderboard\`
|
|
3180
3890
|
`,
|
|
3181
3891
|
// ============================================================================
|
|
3182
3892
|
// BRIDGE OPERATIONS: Cross-Chain Token Bridging
|
|
@@ -3493,44 +4203,6 @@ async function getReferralSummary() {
|
|
|
3493
4203
|
- \`gala_launchpad_fetch_referrals\`
|
|
3494
4204
|
- \`gala_launchpad_fetch_all_referrals\`
|
|
3495
4205
|
- \`gala_launchpad_fetch_referrals_summary\`
|
|
3496
|
-
`,
|
|
3497
|
-
'account-management': `
|
|
3498
|
-
# Account Management
|
|
3499
|
-
|
|
3500
|
-
The SDK provides methods for account registration and management.
|
|
3501
|
-
|
|
3502
|
-
## Register Account
|
|
3503
|
-
|
|
3504
|
-
Register an account for trading on Gala. This should be called before the first purchase
|
|
3505
|
-
to ensure the wallet is ready for trading operations.
|
|
3506
|
-
|
|
3507
|
-
\`\`\`typescript
|
|
3508
|
-
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
3509
|
-
|
|
3510
|
-
async function registerAccount() {
|
|
3511
|
-
const sdk = createLaunchpadSDK({ wallet: 'your-private-key' });
|
|
3512
|
-
|
|
3513
|
-
// Register the SDK wallet
|
|
3514
|
-
const result = await sdk.registerAccount();
|
|
3515
|
-
|
|
3516
|
-
// Register a specific address
|
|
3517
|
-
const otherResult = await sdk.registerAccount({
|
|
3518
|
-
address: '0x1234...' // Supports eth|, 0x, or client| formats
|
|
3519
|
-
});
|
|
3520
|
-
|
|
3521
|
-
}
|
|
3522
|
-
\`\`\`
|
|
3523
|
-
|
|
3524
|
-
**Response Structure:**
|
|
3525
|
-
\`\`\`typescript
|
|
3526
|
-
interface RegisterAccountResult {
|
|
3527
|
-
exists: boolean; // Whether account is registered
|
|
3528
|
-
walletAlias: string; // Normalized wallet alias (client|...)
|
|
3529
|
-
}
|
|
3530
|
-
\`\`\`
|
|
3531
|
-
|
|
3532
|
-
**MCP Tool Equivalents:**
|
|
3533
|
-
- \`gala_launchpad_register_account\`
|
|
3534
4206
|
`,
|
|
3535
4207
|
// ============================================================================
|
|
3536
4208
|
// LIVE STREAMING: Stream Management & Recordings
|
|
@@ -3556,7 +4228,10 @@ async function manageStream() {
|
|
|
3556
4228
|
// Start a stream for your token
|
|
3557
4229
|
const stream = await sdk.startStream('mytoken');
|
|
3558
4230
|
|
|
3559
|
-
//
|
|
4231
|
+
// stream.rtmpsUrl — full RTMPS ingest URL for OBS or compatible software
|
|
4232
|
+
// stream.srtUrl — full SRT ingest URL for low-latency encoders
|
|
4233
|
+
// stream.streamKey — raw key for manual RTMPS configuration
|
|
4234
|
+
// stream.srtPassphrase — raw passphrase for manual SRT configuration
|
|
3560
4235
|
|
|
3561
4236
|
// Get stream info (public endpoint)
|
|
3562
4237
|
const info = await sdk.getStreamInfo('mytoken');
|
|
@@ -3658,10 +4333,10 @@ async function adminOperations() {
|
|
|
3658
4333
|
**Available SDK Methods:**
|
|
3659
4334
|
| Method | Description | Auth |
|
|
3660
4335
|
|--------|-------------|------|
|
|
3661
|
-
| \`startStream(tokenName)\` | Start a stream | Wallet |
|
|
4336
|
+
| \`startStream(tokenName)\` | Start a stream (returns rtmpsUrl, srtUrl, streamKey, srtPassphrase) | Wallet |
|
|
3662
4337
|
| \`stopStream(tokenName)\` | Stop a stream | Wallet |
|
|
3663
4338
|
| \`getStreamInfo(tokenName)\` | Get stream status | Public |
|
|
3664
|
-
| \`resetStreamKey(tokenName)\` | Generate new stream key | Wallet |
|
|
4339
|
+
| \`resetStreamKey(tokenName)\` | Generate new stream key (returns rtmpsUrl, srtUrl, streamKey, srtPassphrase) | Wallet |
|
|
3665
4340
|
| \`disableStream(tokenName)\` | Disable token streaming | Admin |
|
|
3666
4341
|
| \`enableStream(tokenName)\` | Enable token streaming | Admin |
|
|
3667
4342
|
| \`getStreamRecordings(options)\` | List recordings | Public |
|
|
@@ -3923,7 +4598,7 @@ These operations require JWT authentication (call \\\`login()\\\` first):
|
|
|
3923
4598
|
|
|
3924
4599
|
**Streaming:**
|
|
3925
4600
|
- \\\`startStream()\\\` - Start live stream
|
|
3926
|
-
- \\\`resetStreamKey()\\\` - Reset
|
|
4601
|
+
- \\\`resetStreamKey()\\\` - Reset stream key
|
|
3927
4602
|
- \\\`getRecordingDownload()\\\` - Download recordings
|
|
3928
4603
|
- \\\`deleteRecording()\\\` - Delete recordings
|
|
3929
4604
|
- \\\`addSimulcastTarget()\\\` - Add simulcast
|
|
@@ -4190,7 +4865,7 @@ sdk.connectStreamWebSocket({
|
|
|
4190
4865
|
- \`gala_launchpad_get_active_users\`
|
|
4191
4866
|
`,
|
|
4192
4867
|
'api-key-management': `
|
|
4193
|
-
# API Key Management - SDK v5.
|
|
4868
|
+
# API Key Management - SDK v5.0.4-beta.56+
|
|
4194
4869
|
|
|
4195
4870
|
User-managed API keys with role-based permissions for delegating token management
|
|
4196
4871
|
authority to third-party services or automated systems.
|
|
@@ -4789,6 +5464,106 @@ await sdk.deleteComment({ commentId: comment.id });
|
|
|
4789
5464
|
- \`gala_launchpad_delete_comment\`
|
|
4790
5465
|
- \`gala_launchpad_add_reaction\`
|
|
4791
5466
|
- \`gala_launchpad_remove_reaction\`
|
|
5467
|
+
`,
|
|
5468
|
+
'content-reactions': `
|
|
5469
|
+
## Content Reactions - SDK v5.13.0+
|
|
5470
|
+
|
|
5471
|
+
Add and remove reactions on chat messages and pool comments. Reactions provide
|
|
5472
|
+
social engagement features for community interaction.
|
|
5473
|
+
|
|
5474
|
+
**Covers Methods:**
|
|
5475
|
+
- \`addContentReaction()\` - Add reaction to any content
|
|
5476
|
+
- \`removeContentReaction()\` - Remove reaction from any content
|
|
5477
|
+
- \`addReactionToChatMessage()\` - Add reaction specifically to chat message
|
|
5478
|
+
- \`removeReactionFromChatMessage()\` - Remove reaction from chat message
|
|
5479
|
+
- \`addReactionToComment()\` - Add reaction specifically to pool comment
|
|
5480
|
+
- \`removeReactionFromComment()\` - Remove reaction from pool comment
|
|
5481
|
+
|
|
5482
|
+
## Adding Reactions
|
|
5483
|
+
|
|
5484
|
+
\`\`\`typescript
|
|
5485
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
5486
|
+
|
|
5487
|
+
const sdk = createLaunchpadSDK({
|
|
5488
|
+
privateKey: process.env.PRIVATE_KEY,
|
|
5489
|
+
});
|
|
5490
|
+
|
|
5491
|
+
await sdk.login();
|
|
5492
|
+
|
|
5493
|
+
// Generic method - works for any content type
|
|
5494
|
+
await sdk.addContentReaction({
|
|
5495
|
+
messageId: 'msg-123',
|
|
5496
|
+
reactionType: '👍',
|
|
5497
|
+
tokenName: 'mytoken', // optional - backend can resolve from messageId
|
|
5498
|
+
});
|
|
5499
|
+
|
|
5500
|
+
// Specific method for chat messages
|
|
5501
|
+
await sdk.addReactionToChatMessage({
|
|
5502
|
+
tokenName: 'mytoken',
|
|
5503
|
+
messageId: 'chat-msg-456',
|
|
5504
|
+
reactionType: '🔥',
|
|
5505
|
+
});
|
|
5506
|
+
|
|
5507
|
+
// Specific method for pool comments
|
|
5508
|
+
await sdk.addReactionToComment({
|
|
5509
|
+
tokenName: 'mytoken',
|
|
5510
|
+
messageId: 'comment-789',
|
|
5511
|
+
reactionType: '❤️',
|
|
5512
|
+
});
|
|
5513
|
+
\`\`\`
|
|
5514
|
+
|
|
5515
|
+
## Removing Reactions
|
|
5516
|
+
|
|
5517
|
+
\`\`\`typescript
|
|
5518
|
+
// Generic method
|
|
5519
|
+
await sdk.removeContentReaction({
|
|
5520
|
+
messageId: 'msg-123',
|
|
5521
|
+
reactionType: '👍',
|
|
5522
|
+
});
|
|
5523
|
+
|
|
5524
|
+
// Specific method for chat messages
|
|
5525
|
+
await sdk.removeReactionFromChatMessage({
|
|
5526
|
+
tokenName: 'mytoken',
|
|
5527
|
+
messageId: 'chat-msg-456',
|
|
5528
|
+
reactionType: '🔥',
|
|
5529
|
+
});
|
|
5530
|
+
|
|
5531
|
+
// Specific method for pool comments
|
|
5532
|
+
await sdk.removeReactionFromComment({
|
|
5533
|
+
tokenName: 'mytoken',
|
|
5534
|
+
messageId: 'comment-789',
|
|
5535
|
+
reactionType: '❤️',
|
|
5536
|
+
});
|
|
5537
|
+
\`\`\`
|
|
5538
|
+
|
|
5539
|
+
## Common Reaction Types
|
|
5540
|
+
|
|
5541
|
+
| Emoji | Meaning |
|
|
5542
|
+
|-------|---------|
|
|
5543
|
+
| 👍 | Thumbs up / Like |
|
|
5544
|
+
| ❤️ | Love |
|
|
5545
|
+
| 🔥 | Fire / Hot |
|
|
5546
|
+
| 🚀 | Rocket / Moon |
|
|
5547
|
+
| 😂 | Laughing |
|
|
5548
|
+
|
|
5549
|
+
## SDK Methods Reference
|
|
5550
|
+
|
|
5551
|
+
| Method | Description | Auth |
|
|
5552
|
+
|--------|-------------|------|
|
|
5553
|
+
| \`addContentReaction(options)\` | Add reaction to any content | JWT |
|
|
5554
|
+
| \`removeContentReaction(options)\` | Remove reaction from content | JWT |
|
|
5555
|
+
| \`addReactionToChatMessage(options)\` | Add reaction to chat message | JWT |
|
|
5556
|
+
| \`removeReactionFromChatMessage(options)\` | Remove reaction from chat message | JWT |
|
|
5557
|
+
| \`addReactionToComment(options)\` | Add reaction to pool comment | JWT |
|
|
5558
|
+
| \`removeReactionFromComment(options)\` | Remove reaction from pool comment | JWT |
|
|
5559
|
+
|
|
5560
|
+
**MCP Tool Equivalents:**
|
|
5561
|
+
- \`gala_launchpad_add_content_reaction\`
|
|
5562
|
+
- \`gala_launchpad_remove_content_reaction\`
|
|
5563
|
+
- \`gala_launchpad_add_reaction_to_chat_message\`
|
|
5564
|
+
- \`gala_launchpad_remove_reaction_from_chat_message\`
|
|
5565
|
+
- \`gala_launchpad_add_reaction_to_comment\`
|
|
5566
|
+
- \`gala_launchpad_remove_reaction_from_comment\`
|
|
4792
5567
|
`,
|
|
4793
5568
|
'trade-history': `
|
|
4794
5569
|
## Trade History
|
|
@@ -4964,7 +5739,6 @@ for (const ban of page1.items) {
|
|
|
4964
5739
|
// Search for specific tokens (partial match, case-insensitive)
|
|
4965
5740
|
const searchResults = await sdk.listTokenBans({
|
|
4966
5741
|
search: 'scam',
|
|
4967
|
-
page: 1,
|
|
4968
5742
|
limit: 10,
|
|
4969
5743
|
});
|
|
4970
5744
|
|
|
@@ -5177,83 +5951,1115 @@ const balances = await sdk.fetchNftBalances(userWallet, 'MyEpicNFTs');
|
|
|
5177
5951
|
- \`gala_launchpad_mint_nft\`
|
|
5178
5952
|
- \`gala_launchpad_fetch_nft_balances\`
|
|
5179
5953
|
`,
|
|
5180
|
-
|
|
5181
|
-
|
|
5182
|
-
|
|
5954
|
+
// ============================================================================
|
|
5955
|
+
// TOKEN IDENTIFICATION: Understanding Token Formats (v5.14.0+)
|
|
5956
|
+
// ============================================================================
|
|
5957
|
+
// These conceptual topics help AI assistants understand when to use which
|
|
5958
|
+
// token identifier format (tokenName vs tokenClassKey).
|
|
5959
|
+
// ============================================================================
|
|
5960
|
+
'token-identification': `
|
|
5961
|
+
# Token Identification in Launchpad SDK
|
|
5962
|
+
|
|
5963
|
+
The SDK uses **TWO distinct token identifier formats**. Using the wrong format causes errors.
|
|
5964
|
+
|
|
5965
|
+
## Format 1: Token Name (Launchpad/Bonding Curve Tokens)
|
|
5966
|
+
|
|
5967
|
+
- **Format**: Simple lowercase string, 3-20 alphanumeric characters
|
|
5968
|
+
- **Examples**: \`"anime"\`, \`"demonkpop"\`, \`"shoewars"\`
|
|
5969
|
+
- **Parameter**: Usually \`tokenName\`
|
|
5970
|
+
- **Used for**: Bonding curve operations (before graduation)
|
|
5971
|
+
|
|
5972
|
+
\`\`\`typescript
|
|
5973
|
+
// ✅ CORRECT - Bonding curve buy
|
|
5974
|
+
await sdk.buy({ tokenName: 'anime', amount: '100', type: 'native' });
|
|
5975
|
+
|
|
5976
|
+
// ✅ CORRECT - Bonding curve sell
|
|
5977
|
+
await sdk.sell({ tokenName: 'anime', amount: '50', type: 'tokens' });
|
|
5978
|
+
|
|
5979
|
+
// ✅ CORRECT - Check pool status
|
|
5980
|
+
const pool = await sdk.fetchPools({ tokenName: 'anime' });
|
|
5981
|
+
\`\`\`
|
|
5982
|
+
|
|
5983
|
+
## Format 2: TokenClassKey (GalaChain/DEX Tokens)
|
|
5984
|
+
|
|
5985
|
+
- **Format**: Pipe-delimited string: \`collection|category|type|additionalKey\`
|
|
5986
|
+
- **Examples**: \`"GALA|Unit|none|none"\`, \`"GUSDC|Unit|none|eth:0xa0b..."\`
|
|
5987
|
+
- **Parameter**: Usually \`tokenId\`, \`fromToken\`, \`toToken\`
|
|
5988
|
+
- **Used for**: DEX swaps, LP operations, standard GalaChain tokens
|
|
5989
|
+
|
|
5990
|
+
\`\`\`typescript
|
|
5991
|
+
// ✅ CORRECT - DEX swap (requires full tokenClassKey)
|
|
5992
|
+
const quote = await sdk.getSwapQuoteExactInput('GALA|Unit|none|none', 'GUSDC|Unit|none|eth:0xa0b...', '100');
|
|
5993
|
+
await sdk.executeSwap('GALA|Unit|none|none', 'GUSDC|Unit|none|eth:0xa0b...', '100', quote.estimatedOutput, quote.feeTier);
|
|
5994
|
+
|
|
5995
|
+
// ✅ CORRECT - Add DEX liquidity
|
|
5996
|
+
await sdk.addSwapLiquidityByPrice({
|
|
5997
|
+
token0: 'GALA|Unit|none|none',
|
|
5998
|
+
token1: 'GUSDC|Unit|none|eth:0xa0b...',
|
|
5999
|
+
fee: 3000,
|
|
6000
|
+
minPrice: '0.01',
|
|
6001
|
+
maxPrice: '0.05',
|
|
6002
|
+
amount0Desired: '1000',
|
|
6003
|
+
amount1Desired: '50'
|
|
6004
|
+
});
|
|
6005
|
+
\`\`\`
|
|
6006
|
+
|
|
6007
|
+
## Common Mistakes
|
|
6008
|
+
|
|
6009
|
+
\`\`\`typescript
|
|
6010
|
+
// ❌ WRONG - Bare symbol for DEX (throws ValidationError)
|
|
6011
|
+
await sdk.executeSwap('GALA', 'GUSDC', '100', output, fee);
|
|
6012
|
+
|
|
6013
|
+
// ❌ WRONG - TokenClassKey for bonding curve
|
|
6014
|
+
await sdk.buy({ tokenName: 'Token|Unit|ANIME|client:gala-launchpad', amount: '100' });
|
|
6015
|
+
|
|
6016
|
+
// ❌ WRONG - Simple name for DEX quote
|
|
6017
|
+
await sdk.getSwapQuoteExactInput('anime', 'GALA|Unit|none|none', '100');
|
|
6018
|
+
\`\`\`
|
|
6019
|
+
|
|
6020
|
+
## Method-to-Format Quick Reference
|
|
6021
|
+
|
|
6022
|
+
| Method | tokenName | tokenClassKey | Notes |
|
|
6023
|
+
|--------|:---------:|:-------------:|-------|
|
|
6024
|
+
| \`buy()\` | ✅ | ❌ | Bonding curve only |
|
|
6025
|
+
| \`sell()\` | ✅ | ❌ | Bonding curve only |
|
|
6026
|
+
| \`graduateToken()\` | ✅ | ❌ | Triggers DEX migration |
|
|
6027
|
+
| \`executeSwap()\` | ❌ | ✅ | DEX only |
|
|
6028
|
+
| \`getSwapQuote*()\` | ❌ | ✅ | DEX quotes |
|
|
6029
|
+
| \`addSwapLiquidity*()\` | ❌ | ✅ | LP operations |
|
|
6030
|
+
| \`transferToken()\` | ✅ | ✅ | Both work |
|
|
6031
|
+
| \`fetchTokenPrice()\` | ✅ | ✅ | Smart router |
|
|
6032
|
+
|
|
6033
|
+
## Getting TokenClassKey for a Graduated Token
|
|
6034
|
+
|
|
6035
|
+
**⚠️ IMPORTANT: Never construct a tokenClassKey manually!**
|
|
6036
|
+
|
|
6037
|
+
The tokenClassKey contains the token's **symbol** (set at creation), which may differ
|
|
6038
|
+
from the tokenName. Always query for it:
|
|
6039
|
+
|
|
6040
|
+
\`\`\`typescript
|
|
6041
|
+
// From pool data after graduation (RECOMMENDED)
|
|
6042
|
+
const pool = await sdk.fetchPools({ tokenName: 'anime' });
|
|
6043
|
+
const tokenClassKey = pool.items[0]?.tokenClassKey;
|
|
6044
|
+
// → Returns the actual tokenClassKey (symbol may differ from tokenName!)
|
|
6045
|
+
|
|
6046
|
+
// Or use the resolver
|
|
6047
|
+
const resolved = await sdk.resolveTokenClassKey('anime');
|
|
6048
|
+
// → Queries backend for the correct tokenClassKey
|
|
6049
|
+
\`\`\`
|
|
6050
|
+
|
|
6051
|
+
## Well-Known Token Constants
|
|
6052
|
+
|
|
6053
|
+
\`\`\`typescript
|
|
6054
|
+
const GALA = 'GALA|Unit|none|none';
|
|
6055
|
+
const GUSDC = 'GUSDC|Unit|none|eth:0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48';
|
|
6056
|
+
const WETH = 'GETH|Unit|none|eth:0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2';
|
|
6057
|
+
\`\`\`
|
|
6058
|
+
|
|
6059
|
+
**See Also:** \`src/types/token.types.ts\` for full type definitions and utilities.
|
|
6060
|
+
`,
|
|
6061
|
+
'graduation-detection': `
|
|
6062
|
+
# Detecting Token Graduation Status
|
|
6063
|
+
|
|
6064
|
+
Launchpad tokens transition from bonding curve to DEX when they "graduate."
|
|
6065
|
+
This affects which SDK methods work and which token format to use.
|
|
6066
|
+
|
|
6067
|
+
## Checking Graduation Status
|
|
6068
|
+
|
|
6069
|
+
\`\`\`typescript
|
|
6070
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
6071
|
+
|
|
6072
|
+
async function checkGraduationStatus(tokenName: string) {
|
|
6073
|
+
const sdk = createLaunchpadSDK();
|
|
6074
|
+
|
|
6075
|
+
// Method 1: Check via pool data (recommended)
|
|
6076
|
+
const pool = await sdk.fetchPools({ tokenName });
|
|
6077
|
+
const isGraduated = pool.items[0]?.isGraduated ?? false;
|
|
6078
|
+
|
|
6079
|
+
// Method 2: Use the helper method
|
|
6080
|
+
const graduated = await sdk.isTokenGraduated(tokenName);
|
|
6081
|
+
|
|
6082
|
+
return graduated;
|
|
6083
|
+
}
|
|
6084
|
+
\`\`\`
|
|
6085
|
+
|
|
6086
|
+
## Handling Graduated vs Non-Graduated Tokens
|
|
6087
|
+
|
|
6088
|
+
\`\`\`typescript
|
|
6089
|
+
async function tradeToken(tokenName: string, galaAmount: string) {
|
|
6090
|
+
const sdk = createLaunchpadSDK({ wallet: 'your-private-key' });
|
|
6091
|
+
|
|
6092
|
+
// Check graduation status first
|
|
6093
|
+
const pool = await sdk.fetchPools({ tokenName });
|
|
6094
|
+
const isGraduated = pool.items[0]?.isGraduated ?? false;
|
|
6095
|
+
|
|
6096
|
+
if (isGraduated) {
|
|
6097
|
+
// Token is on DEX - use tokenClassKey format
|
|
6098
|
+
const tokenClassKey = pool.items[0]?.tokenClassKey;
|
|
6099
|
+
if (!tokenClassKey) throw new Error('Token graduated but no tokenClassKey found');
|
|
6100
|
+
|
|
6101
|
+
const quote = await sdk.getSwapQuoteExactInput(
|
|
6102
|
+
'GALA|Unit|none|none',
|
|
6103
|
+
tokenClassKey,
|
|
6104
|
+
galaAmount
|
|
6105
|
+
);
|
|
6106
|
+
|
|
6107
|
+
const result = await sdk.executeSwap(
|
|
6108
|
+
'GALA|Unit|none|none',
|
|
6109
|
+
tokenClassKey,
|
|
6110
|
+
galaAmount,
|
|
6111
|
+
quote.estimatedOutput,
|
|
6112
|
+
quote.feeTier
|
|
6113
|
+
);
|
|
6114
|
+
|
|
6115
|
+
return { method: 'DEX', result };
|
|
6116
|
+
} else {
|
|
6117
|
+
// Token is on bonding curve - use simple tokenName
|
|
6118
|
+
const calc = await sdk.calculateBuyAmount({
|
|
6119
|
+
tokenName,
|
|
6120
|
+
amount: galaAmount,
|
|
6121
|
+
type: 'native'
|
|
6122
|
+
});
|
|
6123
|
+
|
|
6124
|
+
const result = await sdk.buy({
|
|
6125
|
+
tokenName,
|
|
6126
|
+
amount: galaAmount,
|
|
6127
|
+
type: 'native',
|
|
6128
|
+
expectedAmount: calc.amount,
|
|
6129
|
+
slippageToleranceFactor: 0.01
|
|
6130
|
+
});
|
|
6131
|
+
|
|
6132
|
+
return { method: 'BondingCurve', result };
|
|
6133
|
+
}
|
|
6134
|
+
}
|
|
6135
|
+
\`\`\`
|
|
6136
|
+
|
|
6137
|
+
## Subscribing to Graduation Events
|
|
6138
|
+
|
|
6139
|
+
\`\`\`typescript
|
|
6140
|
+
// Listen for new DEX pool creation (graduation event)
|
|
6141
|
+
sdk.onDexPoolCreation((event) => {
|
|
6142
|
+
console.log(\`Token graduated: \${event.tokenName}\`);
|
|
6143
|
+
console.log(\`New tokenClassKey: \${event.tokenClassKey}\`);
|
|
6144
|
+
// Update your local state to use DEX trading
|
|
6145
|
+
});
|
|
6146
|
+
|
|
6147
|
+
// Listen for new launchpad token creation
|
|
6148
|
+
sdk.onLaunchpadTokenCreation((event) => {
|
|
6149
|
+
console.log(\`New token launched: \${event.tokenName}\`);
|
|
6150
|
+
// This token is on bonding curve, use tokenName
|
|
6151
|
+
});
|
|
6152
|
+
\`\`\`
|
|
6153
|
+
|
|
6154
|
+
## Key Differences: Pre vs Post Graduation
|
|
6155
|
+
|
|
6156
|
+
| Aspect | Pre-Graduation | Post-Graduation |
|
|
6157
|
+
|--------|----------------|-----------------|
|
|
6158
|
+
| Trading venue | Bonding curve | GalaSwap DEX |
|
|
6159
|
+
| Token format | \`tokenName\` ("anime") | \`tokenClassKey\` ("Token\\|Unit\\|ANIME\\|...") |
|
|
6160
|
+
| Buy method | \`sdk.buy()\` | \`sdk.executeSwap()\` |
|
|
6161
|
+
| Sell method | \`sdk.sell()\` | \`sdk.executeSwap()\` |
|
|
6162
|
+
| Liquidity | None | LP positions available |
|
|
6163
|
+
| Price source | Bonding curve formula | DEX pool |
|
|
6164
|
+
|
|
6165
|
+
## Why This Matters
|
|
6166
|
+
|
|
6167
|
+
- **Wrong format = Error**: Using tokenName for DEX throws \`ValidationError\`
|
|
6168
|
+
- **Wrong method = Error**: Using \`buy()\` for graduated token may fail
|
|
6169
|
+
- **Performance**: Checking graduation once avoids repeated API calls
|
|
6170
|
+
- **User experience**: Show appropriate UI based on trading venue
|
|
6171
|
+
|
|
6172
|
+
**Related Topics:** \`token-identification\`, \`dex-trading\`, \`buy-tokens\`, \`pool-graduation\`
|
|
6173
|
+
`,
|
|
6174
|
+
// ============================================================================
|
|
6175
|
+
// AI MODERATION: AI-Powered Content Moderation
|
|
6176
|
+
// ============================================================================
|
|
6177
|
+
'ai-moderation': `
|
|
6178
|
+
## AI Moderation with SDK
|
|
6179
|
+
|
|
6180
|
+
**Covers Methods:**
|
|
6181
|
+
- \`getAIModerationSettings()\` - Get current AI moderation configuration
|
|
6182
|
+
- \`updateAIModerationSettings()\` - Update AI moderation settings
|
|
6183
|
+
- \`getAIModeration()\` - Get AI analysis result for a message/content
|
|
6184
|
+
- \`triggerAIModeration()\` - Manually trigger AI analysis on content
|
|
6185
|
+
- \`getAIModerationStatus()\` - Check AI moderation service status
|
|
6186
|
+
|
|
6187
|
+
**Auth Required:** Admin API key or Overseer JWT token
|
|
6188
|
+
|
|
6189
|
+
### Get AI Moderation Settings
|
|
6190
|
+
|
|
6191
|
+
\`\`\`typescript
|
|
6192
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
6193
|
+
|
|
6194
|
+
const sdk = createLaunchpadSDK({ apiKey: 'your-admin-api-key' });
|
|
6195
|
+
|
|
6196
|
+
// Get current AI moderation configuration
|
|
6197
|
+
const settings = await sdk.getAIModerationSettings();
|
|
6198
|
+
console.log('AI Moderation Settings:', settings);
|
|
6199
|
+
// Returns: { enabled, sensitivityLevel, autoAction, actionThreshold, ... }
|
|
6200
|
+
\`\`\`
|
|
6201
|
+
|
|
6202
|
+
### Update AI Moderation Settings
|
|
6203
|
+
|
|
6204
|
+
\`\`\`typescript
|
|
6205
|
+
const result = await sdk.updateAIModerationSettings({
|
|
6206
|
+
enabled: true,
|
|
6207
|
+
sensitivityLevel: 'medium', // 'low' | 'medium' | 'high'
|
|
6208
|
+
autoAction: 'flag', // 'none' | 'flag' | 'hide' | 'delete'
|
|
6209
|
+
actionThreshold: 0.8, // 0.0 - 1.0 confidence threshold
|
|
6210
|
+
});
|
|
6211
|
+
console.log('Settings updated:', result);
|
|
6212
|
+
\`\`\`
|
|
6213
|
+
|
|
6214
|
+
### Get AI Moderation Result for Content
|
|
6215
|
+
|
|
6216
|
+
\`\`\`typescript
|
|
6217
|
+
// Get AI analysis for a specific message
|
|
6218
|
+
const result = await sdk.getAIModeration({
|
|
6219
|
+
contentId: 'message-uuid-here',
|
|
6220
|
+
contentType: 'CHAT', // 'CHAT' | 'COMMENT'
|
|
6221
|
+
});
|
|
6222
|
+
console.log('AI Score:', result.score);
|
|
6223
|
+
console.log('AI Action:', result.suggestedAction);
|
|
6224
|
+
console.log('Categories:', result.categories); // spam, toxicity, explicit, etc.
|
|
6225
|
+
\`\`\`
|
|
6226
|
+
|
|
6227
|
+
### Trigger Manual AI Analysis
|
|
6228
|
+
|
|
6229
|
+
\`\`\`typescript
|
|
6230
|
+
// Manually trigger AI analysis on content that hasn't been analyzed yet
|
|
6231
|
+
const result = await sdk.triggerAIModeration({
|
|
6232
|
+
contentId: 'message-uuid-here',
|
|
6233
|
+
contentType: 'COMMENT',
|
|
6234
|
+
});
|
|
6235
|
+
console.log('Moderation triggered:', result.jobId);
|
|
6236
|
+
\`\`\`
|
|
6237
|
+
|
|
6238
|
+
### Check AI Service Status
|
|
6239
|
+
|
|
6240
|
+
\`\`\`typescript
|
|
6241
|
+
// Check if the AI moderation service is operational
|
|
6242
|
+
const status = await sdk.getAIModerationStatus();
|
|
6243
|
+
console.log('AI Service:', status.status); // 'operational' | 'degraded' | 'offline'
|
|
6244
|
+
console.log('Queue Size:', status.queueSize);
|
|
6245
|
+
console.log('Processing Rate:', status.processingRate);
|
|
6246
|
+
\`\`\`
|
|
6247
|
+
|
|
6248
|
+
**Related Topics:** \`content-flag-management\`, \`ban-management\`, \`overseer-invites\`
|
|
6249
|
+
`,
|
|
6250
|
+
// ============================================================================
|
|
6251
|
+
// WEEKLY CHALLENGE: Weekly Token Competition Leaderboard
|
|
6252
|
+
// ============================================================================
|
|
6253
|
+
'weekly-challenge': `
|
|
6254
|
+
## Weekly Challenge with SDK
|
|
6255
|
+
|
|
6256
|
+
**Covers Methods:**
|
|
6257
|
+
- \`getWeeklyChallengeLeaderboard()\` - Get tokens ranked by market cap increase
|
|
6258
|
+
- \`getTokenWeeklyHistory()\` - Get historical weekly challenge results for a token
|
|
6259
|
+
|
|
6260
|
+
**Challenge Rules:**
|
|
6261
|
+
- Week runs Saturday to Friday (UTC)
|
|
6262
|
+
- Baseline market cap taken Saturday at 00:00 UTC
|
|
6263
|
+
- Tokens ranked by percentage market cap increase from baseline
|
|
6264
|
+
- Results available after each week closes
|
|
6265
|
+
|
|
6266
|
+
### Get Weekly Challenge Leaderboard
|
|
6267
|
+
|
|
6268
|
+
\`\`\`typescript
|
|
6269
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
6270
|
+
|
|
6271
|
+
const sdk = createLaunchpadSDK();
|
|
6272
|
+
|
|
6273
|
+
// Get current week's leaderboard
|
|
6274
|
+
const leaderboard = await sdk.getWeeklyChallengeLeaderboard();
|
|
6275
|
+
console.log('Top tokens this week:', leaderboard.tokens.slice(0, 10));
|
|
6276
|
+
|
|
6277
|
+
// Get leaderboard with pagination
|
|
6278
|
+
const page2 = await sdk.getWeeklyChallengeLeaderboard({
|
|
6279
|
+
limit: 20,
|
|
6280
|
+
page: 2,
|
|
6281
|
+
});
|
|
6282
|
+
console.log('Week Period:', page2.weekStart, '-', page2.weekEnd);
|
|
6283
|
+
|
|
6284
|
+
// Get a specific past week by timestamp
|
|
6285
|
+
const pastWeek = await sdk.getWeeklyChallengeLeaderboard({
|
|
6286
|
+
weekTimestamp: '2026-01-01T00:00:00Z',
|
|
6287
|
+
});
|
|
6288
|
+
\`\`\`
|
|
6289
|
+
|
|
6290
|
+
### Get Token's Weekly History
|
|
6291
|
+
|
|
6292
|
+
\`\`\`typescript
|
|
6293
|
+
// Get how a specific token has performed in past weekly challenges
|
|
6294
|
+
const history = await sdk.getTokenWeeklyHistory({
|
|
6295
|
+
tokenName: 'anime',
|
|
6296
|
+
limit: 10, // Last 10 weeks
|
|
6297
|
+
});
|
|
6298
|
+
|
|
6299
|
+
history.weeks.forEach((week) => {
|
|
6300
|
+
console.log(\`Week \${week.weekStart}: Rank #\${week.rank}, +\${week.percentageIncrease}%\`);
|
|
6301
|
+
});
|
|
6302
|
+
\`\`\`
|
|
6303
|
+
|
|
6304
|
+
**Related Topics:** \`trading-analytics\`, \`token-details\`, \`fetch-pools\`
|
|
6305
|
+
`,
|
|
6306
|
+
// ============================================================================
|
|
6307
|
+
// PLATFORM STATS: Platform-Wide Trading Statistics
|
|
6308
|
+
// ============================================================================
|
|
6309
|
+
'platform-stats': `
|
|
6310
|
+
## Platform Statistics with SDK
|
|
6311
|
+
|
|
6312
|
+
**Covers Methods:**
|
|
6313
|
+
- \`getPlatformStats()\` - Get platform-wide trading statistics
|
|
6314
|
+
|
|
6315
|
+
**Auth Required:** None (public endpoint)
|
|
6316
|
+
|
|
6317
|
+
### Get Platform Statistics
|
|
6318
|
+
|
|
6319
|
+
\`\`\`typescript
|
|
6320
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
6321
|
+
|
|
6322
|
+
const sdk = createLaunchpadSDK();
|
|
6323
|
+
|
|
6324
|
+
// Get platform-wide statistics
|
|
6325
|
+
const stats = await sdk.getPlatformStats();
|
|
6326
|
+
|
|
6327
|
+
console.log('GALA Volume (1h):', stats.galaVolume1h);
|
|
6328
|
+
console.log('GALA Volume (24h):', stats.galaVolume24h);
|
|
6329
|
+
console.log('GALA Volume (7d):', stats.galaVolume7d);
|
|
6330
|
+
console.log('Total Tokens:', stats.totalTokens);
|
|
6331
|
+
\`\`\`
|
|
6332
|
+
|
|
6333
|
+
### Display Trading Dashboard
|
|
6334
|
+
|
|
6335
|
+
\`\`\`typescript
|
|
6336
|
+
async function displayPlatformDashboard() {
|
|
6337
|
+
const stats = await sdk.getPlatformStats();
|
|
6338
|
+
|
|
6339
|
+
return {
|
|
6340
|
+
tradingVolume: {
|
|
6341
|
+
lastHour: \`\${stats.galaVolume1h} GALA\`,
|
|
6342
|
+
last24Hours: \`\${stats.galaVolume24h} GALA\`,
|
|
6343
|
+
last7Days: \`\${stats.galaVolume7d} GALA\`,
|
|
6344
|
+
},
|
|
6345
|
+
tokens: {
|
|
6346
|
+
total: stats.totalTokens,
|
|
6347
|
+
},
|
|
6348
|
+
};
|
|
6349
|
+
}
|
|
6350
|
+
\`\`\`
|
|
6351
|
+
|
|
6352
|
+
**Related Topics:** \`weekly-challenge\`, \`trading-analytics\`, \`fetch-pools\`
|
|
6353
|
+
`,
|
|
6354
|
+
// ============================================================================
|
|
6355
|
+
// RESTRICTED NAMES: Restricted Token Names Management (Overseer Only)
|
|
6356
|
+
// ============================================================================
|
|
6357
|
+
'restricted-names': `
|
|
6358
|
+
## Restricted Names with SDK
|
|
6359
|
+
|
|
6360
|
+
**Covers Methods:**
|
|
6361
|
+
- \`getRestrictedNames()\` - Get the list of restricted token names
|
|
6362
|
+
- \`updateRestrictedNames()\` - Update the restricted names list
|
|
6363
|
+
|
|
6364
|
+
**Auth Required:** Overseer JWT token only
|
|
6365
|
+
|
|
6366
|
+
### Get Restricted Names
|
|
6367
|
+
|
|
6368
|
+
\`\`\`typescript
|
|
6369
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
6370
|
+
|
|
6371
|
+
const sdk = createLaunchpadSDK({ jwtToken: 'your-overseer-jwt' });
|
|
6372
|
+
|
|
6373
|
+
// Get current restricted names list
|
|
6374
|
+
const result = await sdk.getRestrictedNames();
|
|
6375
|
+
|
|
6376
|
+
// Names are stored as a newline-separated text blob
|
|
6377
|
+
const namesList = result.names.split('\\n').filter(Boolean);
|
|
6378
|
+
console.log('Restricted names:', namesList);
|
|
6379
|
+
console.log('Total count:', namesList.length);
|
|
6380
|
+
\`\`\`
|
|
6381
|
+
|
|
6382
|
+
### Update Restricted Names
|
|
6383
|
+
|
|
6384
|
+
\`\`\`typescript
|
|
6385
|
+
// Add new restricted names to the list
|
|
6386
|
+
const currentResult = await sdk.getRestrictedNames();
|
|
6387
|
+
const currentNames = currentResult.names.split('\\n').filter(Boolean);
|
|
6388
|
+
|
|
6389
|
+
// Add new names
|
|
6390
|
+
const updatedNames = [...currentNames, 'badword1', 'badword2'];
|
|
6391
|
+
const newNamesBlob = updatedNames.join('\\n');
|
|
6392
|
+
|
|
6393
|
+
const result = await sdk.updateRestrictedNames({
|
|
6394
|
+
names: newNamesBlob,
|
|
6395
|
+
});
|
|
6396
|
+
console.log('Updated successfully:', result);
|
|
6397
|
+
\`\`\`
|
|
6398
|
+
|
|
6399
|
+
### Check If a Name Would Be Restricted
|
|
6400
|
+
|
|
6401
|
+
\`\`\`typescript
|
|
6402
|
+
// Check if a token name would be blocked before creating
|
|
6403
|
+
async function isNameRestricted(tokenName: string): Promise<boolean> {
|
|
6404
|
+
const result = await sdk.getRestrictedNames();
|
|
6405
|
+
const restrictedList = result.names.split('\\n').filter(Boolean);
|
|
6406
|
+
return restrictedList.some(
|
|
6407
|
+
(name) => name.toLowerCase() === tokenName.toLowerCase()
|
|
6408
|
+
);
|
|
6409
|
+
}
|
|
6410
|
+
|
|
6411
|
+
const blocked = await isNameRestricted('badword1');
|
|
6412
|
+
console.log('Name is restricted:', blocked);
|
|
6413
|
+
\`\`\`
|
|
6414
|
+
|
|
6415
|
+
**Related Topics:** \`token-creation\`, \`overseer-invites\`, \`token-ban-management\`
|
|
6416
|
+
`,
|
|
6417
|
+
// ============================================================================
|
|
6418
|
+
// WEBSOCKET ADMIN: Real-Time Event Broadcasting (Admin/Overseer Only)
|
|
6419
|
+
// ============================================================================
|
|
6420
|
+
'websocket-admin': `
|
|
6421
|
+
## WebSocket Admin with SDK
|
|
6422
|
+
|
|
6423
|
+
**Covers Methods:**
|
|
6424
|
+
- **Connection Monitoring:** \`getConnectedClients()\`, \`isUserOnline()\`, \`getOnlineUsers()\`, \`getTokenViewers()\`, \`getOnlineOverseers()\`
|
|
6425
|
+
- **Event Emission:** \`emitTradeExecuted()\`, \`emitBalanceUpdated()\`, \`emitStreamStatus()\`, \`emitViewerCount()\`, \`emitStreamCountdown()\`, \`emitChatMessage()\`, \`emitChatStatus()\`, \`emitTypingIndicator()\`, \`emitTokenBanned()\`, \`emitTokenUnbanned()\`, \`emitModeratorAdded()\`, \`emitModeratorRemoved()\`, \`emitUserProfileUpdated()\`, \`emitSiteConfigChanged()\`, \`emitFeatureStatus()\`
|
|
6426
|
+
|
|
6427
|
+
**Auth Required:** Admin API key or Overseer JWT token
|
|
6428
|
+
|
|
6429
|
+
### Monitor Connected Clients
|
|
6430
|
+
|
|
6431
|
+
\`\`\`typescript
|
|
6432
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
6433
|
+
|
|
6434
|
+
const sdk = createLaunchpadSDK({ apiKey: 'your-admin-api-key' });
|
|
6435
|
+
|
|
6436
|
+
// Get all connected WebSocket clients
|
|
6437
|
+
const clients = await sdk.getConnectedClients();
|
|
6438
|
+
console.log('Total connected:', clients.total);
|
|
6439
|
+
console.log('By token:', clients.byToken);
|
|
6440
|
+
|
|
6441
|
+
// Check if a specific user is online
|
|
6442
|
+
const onlineStatus = await sdk.isUserOnline('eth|0x1234...');
|
|
6443
|
+
console.log('User online:', onlineStatus.isOnline);
|
|
6444
|
+
console.log('Connected since:', onlineStatus.connectedSince);
|
|
6445
|
+
|
|
6446
|
+
// Check multiple users at once
|
|
6447
|
+
const statuses = await sdk.getOnlineUsers(['eth|0x1111...', 'eth|0x2222...']);
|
|
6448
|
+
statuses.forEach((s) => console.log(\`\${s.address}: \${s.isOnline}\`));
|
|
6449
|
+
|
|
6450
|
+
// Get viewers of a specific token stream
|
|
6451
|
+
const viewers = await sdk.getTokenViewers({
|
|
6452
|
+
tokenName: 'anime',
|
|
6453
|
+
limit: 50,
|
|
6454
|
+
});
|
|
6455
|
+
console.log('Current viewers:', viewers.count);
|
|
6456
|
+
|
|
6457
|
+
// Get all online overseers
|
|
6458
|
+
const overseers = await sdk.getOnlineOverseers();
|
|
6459
|
+
console.log('Online overseers:', overseers.addresses);
|
|
6460
|
+
\`\`\`
|
|
6461
|
+
|
|
6462
|
+
### Emit WebSocket Events
|
|
6463
|
+
|
|
6464
|
+
\`\`\`typescript
|
|
6465
|
+
// Emit a trade executed event (triggers real-time UI updates)
|
|
6466
|
+
await sdk.emitTradeExecuted('anime', {
|
|
6467
|
+
tradeType: 'BUY',
|
|
6468
|
+
amount: '100',
|
|
6469
|
+
price: '0.05',
|
|
6470
|
+
userAddress: 'eth|0x1234...',
|
|
6471
|
+
});
|
|
6472
|
+
|
|
6473
|
+
// Emit stream status change
|
|
6474
|
+
await sdk.emitStreamStatus('anime', {
|
|
6475
|
+
isLive: true,
|
|
6476
|
+
viewerCount: 150,
|
|
6477
|
+
});
|
|
6478
|
+
|
|
6479
|
+
// Emit a chat message to all viewers
|
|
6480
|
+
await sdk.emitChatMessage('anime', {
|
|
6481
|
+
messageId: 'uuid-here',
|
|
6482
|
+
content: 'Hello from admin!',
|
|
6483
|
+
authorAddress: 'eth|0x1234...',
|
|
6484
|
+
timestamp: Date.now(),
|
|
6485
|
+
});
|
|
6486
|
+
|
|
6487
|
+
// Broadcast site-wide config change
|
|
6488
|
+
await sdk.emitSiteConfigChanged({
|
|
6489
|
+
key: 'maintenance_mode',
|
|
6490
|
+
value: false,
|
|
6491
|
+
});
|
|
6492
|
+
|
|
6493
|
+
// Emit feature flag change
|
|
6494
|
+
await sdk.emitFeatureStatus({
|
|
6495
|
+
feature: 'trading',
|
|
6496
|
+
enabled: true,
|
|
6497
|
+
});
|
|
6498
|
+
\`\`\`
|
|
6499
|
+
|
|
6500
|
+
**Related Topics:** \`streaming\`, \`stream-chat\`, \`ban-management\`, \`overseer-invites\`
|
|
6501
|
+
`,
|
|
6502
|
+
// ============================================================================
|
|
6503
|
+
// OEMBED: Social Media Link Preview Metadata
|
|
6504
|
+
// ============================================================================
|
|
6505
|
+
'oembed': `
|
|
6506
|
+
## OEmbed Metadata with SDK
|
|
6507
|
+
|
|
6508
|
+
**Covers Methods:**
|
|
6509
|
+
- \`getHomeOEmbed()\` - Get oEmbed metadata for the Launchpad home page
|
|
6510
|
+
- \`getPoolOEmbed()\` - Get oEmbed metadata for a token pool page
|
|
6511
|
+
- \`getProfileOEmbed()\` - Get oEmbed metadata for a user profile page
|
|
6512
|
+
|
|
6513
|
+
**Auth Required:** None (public endpoint)
|
|
6514
|
+
|
|
6515
|
+
OEmbed is a format that allows embedding rich content when sharing links on social media platforms (Twitter/X, Discord, Slack, etc.). These methods return JSON metadata used to generate link previews.
|
|
6516
|
+
|
|
6517
|
+
### Get Home Page OEmbed
|
|
6518
|
+
|
|
6519
|
+
\`\`\`typescript
|
|
6520
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
6521
|
+
|
|
6522
|
+
const sdk = createLaunchpadSDK();
|
|
6523
|
+
|
|
6524
|
+
// Get metadata for the Launchpad home page
|
|
6525
|
+
const homeEmbed = await sdk.getHomeOEmbed();
|
|
6526
|
+
console.log('Title:', homeEmbed.title);
|
|
6527
|
+
console.log('Description:', homeEmbed.description);
|
|
6528
|
+
console.log('Thumbnail:', homeEmbed.thumbnail_url);
|
|
6529
|
+
console.log('Provider:', homeEmbed.provider_name);
|
|
6530
|
+
\`\`\`
|
|
6531
|
+
|
|
6532
|
+
### Get Token Pool OEmbed
|
|
6533
|
+
|
|
6534
|
+
\`\`\`typescript
|
|
6535
|
+
// Get metadata for a specific token's pool page
|
|
6536
|
+
const poolEmbed = await sdk.getPoolOEmbed({
|
|
6537
|
+
tokenName: 'anime',
|
|
6538
|
+
});
|
|
6539
|
+
console.log('Token Title:', poolEmbed.title); // e.g., "Anime Token - Gala Launchpad"
|
|
6540
|
+
console.log('Token Image:', poolEmbed.thumbnail_url);
|
|
6541
|
+
console.log('Description:', poolEmbed.description); // Price, volume, etc.
|
|
6542
|
+
|
|
6543
|
+
// For social sharing: generate the shareable URL
|
|
6544
|
+
const shareUrl = \`https://launchpad.gala.com/pools/\${tokenName}\`;
|
|
6545
|
+
\`\`\`
|
|
6546
|
+
|
|
6547
|
+
### Get User Profile OEmbed
|
|
6548
|
+
|
|
6549
|
+
\`\`\`typescript
|
|
6550
|
+
// Get metadata for a user's profile page
|
|
6551
|
+
const profileEmbed = await sdk.getProfileOEmbed({
|
|
6552
|
+
userAddress: 'eth|0x1234...',
|
|
6553
|
+
});
|
|
6554
|
+
console.log('User Name:', profileEmbed.title);
|
|
6555
|
+
console.log('Avatar:', profileEmbed.thumbnail_url);
|
|
6556
|
+
\`\`\`
|
|
6557
|
+
|
|
6558
|
+
### Integration with Social Sharing
|
|
6559
|
+
|
|
6560
|
+
\`\`\`typescript
|
|
6561
|
+
// Generate open graph meta tags from oEmbed data
|
|
6562
|
+
async function generateMetaTags(tokenName: string) {
|
|
6563
|
+
const embed = await sdk.getPoolOEmbed({ tokenName });
|
|
6564
|
+
return {
|
|
6565
|
+
'og:title': embed.title,
|
|
6566
|
+
'og:description': embed.description,
|
|
6567
|
+
'og:image': embed.thumbnail_url,
|
|
6568
|
+
'og:type': 'website',
|
|
6569
|
+
};
|
|
6570
|
+
}
|
|
6571
|
+
\`\`\`
|
|
6572
|
+
|
|
6573
|
+
**Related Topics:** \`token-details\`, \`profile-management\`, \`fetch-pools\`
|
|
6574
|
+
`,
|
|
6575
|
+
// ============================================================================
|
|
6576
|
+
// MESSAGES: Unified Messages API (CHAT + COMMENT types)
|
|
6577
|
+
// ============================================================================
|
|
6578
|
+
'messages': `
|
|
6579
|
+
## Unified Messages API with SDK
|
|
6580
|
+
|
|
6581
|
+
**Covers Methods:**
|
|
6582
|
+
- \`fetchMessages()\` - Query messages with type/token/user filters
|
|
6583
|
+
- \`createMessage()\` - Create a CHAT or COMMENT message
|
|
6584
|
+
- \`updateMessage()\` - Update message content (author only)
|
|
6585
|
+
- \`deleteMessage()\` - Delete a message (author/owner/moderator)
|
|
6586
|
+
- \`getPinnedMessage()\` - Get the pinned message for a token
|
|
6587
|
+
- \`pinMessage()\` - Pin a message (owner/moderator)
|
|
6588
|
+
- \`unpinMessage()\` - Unpin the current pinned message
|
|
6589
|
+
- \`getMessageStats()\` - Get platform-wide message statistics
|
|
6590
|
+
|
|
6591
|
+
The unified messages API handles both \`CHAT\` (live stream chat) and \`COMMENT\` (token page comments) message types through a single /v1/messages endpoint.
|
|
6592
|
+
|
|
6593
|
+
### Fetch Messages
|
|
6594
|
+
|
|
6595
|
+
\`\`\`typescript
|
|
6596
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
6597
|
+
|
|
6598
|
+
const sdk = createLaunchpadSDK({ jwtToken: 'your-jwt-token' });
|
|
6599
|
+
|
|
6600
|
+
// Fetch chat messages for a token
|
|
6601
|
+
const chatMessages = await sdk.fetchMessages({
|
|
6602
|
+
tokenName: 'anime',
|
|
6603
|
+
type: 'CHAT',
|
|
6604
|
+
limit: 50,
|
|
6605
|
+
page: 1,
|
|
6606
|
+
});
|
|
6607
|
+
|
|
6608
|
+
// Fetch comment-type messages for a token
|
|
6609
|
+
const comments = await sdk.fetchMessages({
|
|
6610
|
+
tokenName: 'anime',
|
|
6611
|
+
type: 'COMMENT',
|
|
6612
|
+
limit: 20,
|
|
6613
|
+
});
|
|
6614
|
+
|
|
6615
|
+
// Fetch messages by a specific user
|
|
6616
|
+
const userMessages = await sdk.fetchMessages({
|
|
6617
|
+
userAddress: 'eth|0x1234...',
|
|
6618
|
+
type: 'CHAT',
|
|
6619
|
+
});
|
|
6620
|
+
\`\`\`
|
|
6621
|
+
|
|
6622
|
+
### Create Messages
|
|
6623
|
+
|
|
6624
|
+
\`\`\`typescript
|
|
6625
|
+
// Create a chat message (live stream chat)
|
|
6626
|
+
const chatMsg = await sdk.createMessage({
|
|
6627
|
+
tokenName: 'anime',
|
|
6628
|
+
content: 'This token is amazing!',
|
|
6629
|
+
type: 'CHAT',
|
|
6630
|
+
});
|
|
6631
|
+
console.log('Created chat message:', chatMsg.id);
|
|
6632
|
+
|
|
6633
|
+
// Create a comment (token page)
|
|
6634
|
+
const comment = await sdk.createMessage({
|
|
6635
|
+
tokenName: 'anime',
|
|
6636
|
+
content: 'Great project, bullish on this!',
|
|
6637
|
+
type: 'COMMENT',
|
|
6638
|
+
});
|
|
6639
|
+
console.log('Created comment:', comment.id);
|
|
6640
|
+
\`\`\`
|
|
6641
|
+
|
|
6642
|
+
### Update and Delete Messages
|
|
6643
|
+
|
|
6644
|
+
\`\`\`typescript
|
|
6645
|
+
// Update your own message
|
|
6646
|
+
const updated = await sdk.updateMessage('message-uuid', {
|
|
6647
|
+
content: 'Updated message content',
|
|
6648
|
+
});
|
|
6649
|
+
|
|
6650
|
+
// Delete a message (must be author, or have moderator/owner role)
|
|
6651
|
+
await sdk.deleteMessage('message-uuid');
|
|
6652
|
+
\`\`\`
|
|
6653
|
+
|
|
6654
|
+
### Pin/Unpin Messages
|
|
6655
|
+
|
|
6656
|
+
\`\`\`typescript
|
|
6657
|
+
// Get the currently pinned message for a token
|
|
6658
|
+
const pinned = await sdk.getPinnedMessage('anime');
|
|
6659
|
+
if (pinned) {
|
|
6660
|
+
console.log('Pinned message:', pinned.content);
|
|
6661
|
+
console.log('Pinned by:', pinned.pinnedBy);
|
|
6662
|
+
}
|
|
6663
|
+
|
|
6664
|
+
// Pin a message (requires owner or moderator role)
|
|
6665
|
+
await sdk.pinMessage('message-uuid');
|
|
6666
|
+
|
|
6667
|
+
// Unpin the current pinned message
|
|
6668
|
+
await sdk.unpinMessage('message-uuid');
|
|
6669
|
+
\`\`\`
|
|
6670
|
+
|
|
6671
|
+
### Get Message Statistics
|
|
6672
|
+
|
|
6673
|
+
\`\`\`typescript
|
|
6674
|
+
// Get platform-wide message statistics (admin/overseer only)
|
|
6675
|
+
const stats = await sdk.getMessageStats();
|
|
6676
|
+
console.log('Total CHAT messages:', stats.chatCount);
|
|
6677
|
+
console.log('Total COMMENT messages:', stats.commentCount);
|
|
6678
|
+
console.log('Messages today:', stats.todayCount);
|
|
6679
|
+
\`\`\`
|
|
6680
|
+
|
|
6681
|
+
**Related Topics:** \`stream-chat\`, \`content-reactions\`, \`content-flag-management\`, \`moderator-invites\`
|
|
6682
|
+
`,
|
|
6683
|
+
// ============================================================================
|
|
6684
|
+
// HOLDERS: Token Holder Data and Distribution Analysis
|
|
6685
|
+
// ============================================================================
|
|
6686
|
+
'holders': `
|
|
6687
|
+
## Token Holder Data with SDK
|
|
6688
|
+
|
|
6689
|
+
**Covers Methods:**
|
|
6690
|
+
- \`getTopHolders(tokenName, limit?)\` - Get top N token holders by balance (v9.2.0+)
|
|
6691
|
+
- \`getHolderCount(tokenName)\` - Get total holder count and combined balance (v9.2.0+)
|
|
6692
|
+
- \`getHolderRank(tokenName, userAddress)\` - Get a user's rank and balance (v9.2.0+)
|
|
6693
|
+
- \`getHoldersByBalance(tokenName, options?)\` - Filter holders by balance range (v9.2.0+)
|
|
6694
|
+
- \`getHolderHistory(tokenName, userAddress, limit?)\` - Get a holder's trade history (v9.2.0+)
|
|
6695
|
+
- \`fetchTokenDistribution(tokenName)\` - Raw distribution data (used internally by the above)
|
|
6696
|
+
|
|
6697
|
+
### Check Holder Rank
|
|
6698
|
+
|
|
6699
|
+
\`\`\`typescript
|
|
6700
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
6701
|
+
|
|
6702
|
+
const sdk = createLaunchpadSDK();
|
|
6703
|
+
|
|
6704
|
+
// Direct SDK convenience method (v9.2.0+)
|
|
6705
|
+
const rank = await sdk.getHolderRank('anime', 'eth|0x1234...');
|
|
6706
|
+
if (rank) {
|
|
6707
|
+
console.log(\`Rank #\${rank.rank} of \${rank.holderCount} holders\`);
|
|
6708
|
+
console.log(\`Balance: \${rank.balance}\`);
|
|
6709
|
+
} else {
|
|
6710
|
+
console.log('User holds no tokens');
|
|
6711
|
+
}
|
|
6712
|
+
\`\`\`
|
|
6713
|
+
|
|
6714
|
+
### Get Top Holders
|
|
6715
|
+
|
|
6716
|
+
\`\`\`typescript
|
|
6717
|
+
// Get top 10 holders with rank enrichment
|
|
6718
|
+
const top10 = await sdk.getTopHolders('anime', 10);
|
|
6719
|
+
top10.forEach((holder) => {
|
|
6720
|
+
console.log(\`#\${holder.rank}: \${holder.address} - \${holder.balance} tokens (\${holder.percentage}%)\`);
|
|
6721
|
+
});
|
|
6722
|
+
\`\`\`
|
|
6723
|
+
|
|
6724
|
+
### Holder Statistics
|
|
6725
|
+
|
|
6726
|
+
\`\`\`typescript
|
|
6727
|
+
const { count, totalBalance } = await sdk.getHolderCount('anime');
|
|
6728
|
+
console.log(\`\${count} holders, total supply: \${totalBalance}\`);
|
|
6729
|
+
\`\`\`
|
|
6730
|
+
|
|
6731
|
+
### Filter Holders by Balance (Whale Detection)
|
|
6732
|
+
|
|
6733
|
+
\`\`\`typescript
|
|
6734
|
+
// Find all holders with ≥10,000 tokens
|
|
6735
|
+
const whales = await sdk.getHoldersByBalance('anime', { minBalance: 10000 });
|
|
6736
|
+
console.log(\`\${whales.length} whales hold ≥10,000 tokens\`);
|
|
6737
|
+
console.log('Top whale:', whales[0]?.address);
|
|
6738
|
+
\`\`\`
|
|
6739
|
+
|
|
6740
|
+
### Get a Holder's Trade History
|
|
6741
|
+
|
|
6742
|
+
\`\`\`typescript
|
|
6743
|
+
// Get last 20 trades for a specific holder
|
|
6744
|
+
const history = await sdk.getHolderHistory('anime', 'eth|0x1234...', 20);
|
|
6745
|
+
history.trades.forEach((t) => {
|
|
6746
|
+
console.log(\`\${t.txnType}: \${t.inputAmount} → \${t.outputAmount} at \${t.createdAt}\`);
|
|
6747
|
+
});
|
|
6748
|
+
\`\`\`
|
|
6749
|
+
|
|
6750
|
+
**Related Topics:** \`token-distribution\`, \`token-details\`, \`trading-analytics\`, \`recent-trades\`
|
|
6751
|
+
`,
|
|
6752
|
+
'trading-quotes': `
|
|
6753
|
+
## Trading Quotes via Backend Proxy (v9.1.0+)
|
|
6754
|
+
|
|
6755
|
+
**Covers Methods:**
|
|
6756
|
+
- \`fetchLaunchpadFee()\` — Backend-cached launchpad fee (1h TTL, @Public)
|
|
6757
|
+
- \`fetchSaleDetails(tokenName)\` — Backend-cached token sale details (10s TTL, @Public)
|
|
6758
|
+
- \`getTradeQuote(params)\` — Instant quote via local bonding curve math (no chain call, @Public)
|
|
6759
|
+
- \`getPremintQuote(amount)\` — Pre-mint quote assuming zero supply (token creation flow, @Public)
|
|
6760
|
+
|
|
6761
|
+
All endpoints are @Public() — no authentication required. These replace the deprecated
|
|
6762
|
+
\`calculateBuyAmountExternal()\` / \`calculateSellAmountExternal()\` chain-direct methods.
|
|
6763
|
+
|
|
6764
|
+
\`\`\`typescript
|
|
6765
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
6766
|
+
|
|
6767
|
+
const sdk = createLaunchpadSDK();
|
|
6768
|
+
|
|
6769
|
+
// 1. Fetch current launchpad fee (cached 1h on backend)
|
|
6770
|
+
const fee = await sdk.fetchLaunchpadFee();
|
|
6771
|
+
console.log(\`Launchpad fee: \${fee} GALA\`);
|
|
6772
|
+
|
|
6773
|
+
// 2. Fetch token sale details (cached 10s on backend)
|
|
6774
|
+
const details = await sdk.fetchSaleDetails('anime');
|
|
6775
|
+
console.log(\`Supply: \${details.sellingTokenQuantity} / \${details.maxSupply}\`);
|
|
6776
|
+
console.log(\`Status: \${details.saleStatus}\`);
|
|
6777
|
+
|
|
6778
|
+
// 3. Get a buy quote: how many tokens for 100 GALA?
|
|
6779
|
+
const buyQuote = await sdk.getTradeQuote({
|
|
6780
|
+
tokenName: 'anime',
|
|
6781
|
+
amount: '100',
|
|
6782
|
+
type: 'NATIVE', // GALA input
|
|
6783
|
+
method: 'IN', // spending this amount
|
|
6784
|
+
});
|
|
6785
|
+
console.log(\`You will receive: \${buyQuote.amount} tokens\`);
|
|
6786
|
+
console.log(\`Fee: \${buyQuote.reverseBondingCurveFee} GALA\`);
|
|
6787
|
+
|
|
6788
|
+
// 4. Get a sell quote: how much GALA for 500 tokens?
|
|
6789
|
+
const sellQuote = await sdk.getTradeQuote({
|
|
6790
|
+
tokenName: 'anime',
|
|
6791
|
+
amount: '500',
|
|
6792
|
+
type: 'MEME', // token input
|
|
6793
|
+
method: 'IN', // selling this amount
|
|
6794
|
+
});
|
|
6795
|
+
console.log(\`You will receive: \${sellQuote.amount} GALA\`);
|
|
6796
|
+
|
|
6797
|
+
// 5. Pre-mint quote for token creation flow (supply = 0)
|
|
6798
|
+
const premintQuote = await sdk.getPremintQuote('500');
|
|
6799
|
+
console.log(\`Initial purchase will yield: \${premintQuote.amount} tokens\`);
|
|
6800
|
+
\`\`\`
|
|
6801
|
+
|
|
6802
|
+
**MCP Tool Equivalents:**
|
|
6803
|
+
- \`gala_launchpad_fetch_launch_token_fee\`
|
|
6804
|
+
- \`gala_launchpad_calculate_buy_amount_local\`
|
|
6805
|
+
|
|
6806
|
+
**Related Topics:** \`buy-tokens\`, \`sell-tokens\`, \`local-calculations\`
|
|
6807
|
+
`,
|
|
6808
|
+
'global-feed-subscription': `
|
|
6809
|
+
## Global Feed Reference Tools (MCP Documentation)
|
|
6810
|
+
|
|
6811
|
+
The global feed reference tools are **documentation/reference tools** in the MCP server, not
|
|
6812
|
+
direct SDK API methods. They explain how to monitor platform-wide events (trades, token launches,
|
|
6813
|
+
pool creations) via WebSocket subscriptions.
|
|
6814
|
+
|
|
6815
|
+
**MCP Reference Tools:**
|
|
6816
|
+
- \`gala_launchpad_global_feed_reference\` — Overview of all global feed event types
|
|
6817
|
+
- \`gala_launchpad_global_feed_status_reference\` — Connection and authentication status patterns
|
|
6818
|
+
- \`gala_launchpad_monitor_global_feed_events_reference\` — Code examples for monitoring events
|
|
6819
|
+
- \`gala_launchpad_site_config_state_reference\` — Site configuration state management
|
|
6820
|
+
- \`gala_launchpad_unsubscribe_from_global_feed_reference\` — Cleanup patterns
|
|
6821
|
+
|
|
6822
|
+
**SDK Equivalent (Direct Usage):**
|
|
6823
|
+
|
|
6824
|
+
\`\`\`typescript
|
|
6825
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
6826
|
+
|
|
6827
|
+
const sdk = createLaunchpadSDK({ wallet: 'your-private-key' });
|
|
6828
|
+
|
|
6829
|
+
// Subscribe to token creation events globally
|
|
6830
|
+
const unsubscribeLaunch = sdk.onLaunchpadTokenCreation((token) => {
|
|
6831
|
+
console.log('New token launched:', token.tokenName);
|
|
6832
|
+
});
|
|
6833
|
+
|
|
6834
|
+
// Subscribe to DEX pool creation events
|
|
6835
|
+
const unsubscribePool = sdk.onDexPoolCreation((pool) => {
|
|
6836
|
+
console.log('New DEX pool:', pool.token0, '/', pool.token1);
|
|
6837
|
+
});
|
|
6838
|
+
|
|
6839
|
+
// Subscribe to stream WebSocket for token-level events
|
|
6840
|
+
await sdk.connectStreamWebSocket();
|
|
6841
|
+
await sdk.authenticateStreamWebSocket('jwt-token');
|
|
6842
|
+
await sdk.subscribeToStream('anime', {
|
|
6843
|
+
onTradeExecuted: (trade) => console.log('Trade:', trade),
|
|
6844
|
+
onStreamStatusChanged: (status) => console.log('Status:', status),
|
|
6845
|
+
});
|
|
6846
|
+
|
|
6847
|
+
// Clean up
|
|
6848
|
+
unsubscribeLaunch();
|
|
6849
|
+
unsubscribePool();
|
|
6850
|
+
\`\`\`
|
|
6851
|
+
|
|
6852
|
+
**Related Topics:** \`event-subscriptions\`, \`streaming\`, \`stream-chat\`
|
|
6853
|
+
`,
|
|
6854
|
+
'events-tracking': `
|
|
6855
|
+
## Client-Side Events Tracking (v8.2.0+)
|
|
6856
|
+
|
|
6857
|
+
**Covers Methods:**
|
|
6858
|
+
- \`sdk.events.track(eventType, payload, options?)\` — Track an event (client-side batching)
|
|
6859
|
+
- \`sdk.events.flush()\` — Manually flush buffered events to backend
|
|
6860
|
+
- \`sdk.events.getStats()\` — Get buffering statistics
|
|
6861
|
+
- \`sdk.events.shutdown(timeoutMs?)\` — Graceful shutdown with final flush
|
|
6862
|
+
|
|
6863
|
+
Events are batched client-side and flushed automatically on time (3s) or size (20 events) thresholds.
|
|
6864
|
+
The backend accepts batches via POST /v1/events, persists via RabbitMQ → MySQL, and broadcasts
|
|
6865
|
+
to the WebSocket firehose for real-time overseer monitoring.
|
|
6866
|
+
|
|
6867
|
+
\`\`\`typescript
|
|
6868
|
+
import { createLaunchpadSDK, EVENT_TYPES } from '@gala-chain/launchpad-sdk';
|
|
6869
|
+
|
|
6870
|
+
const sdk = createLaunchpadSDK({
|
|
6871
|
+
wallet: 'your-private-key',
|
|
6872
|
+
events: {
|
|
6873
|
+
batchSize: 20, // Flush after 20 events (default)
|
|
6874
|
+
flushIntervalMs: 3000, // Or after 3 seconds (default)
|
|
6875
|
+
maxQueueSize: 1000 // Drop oldest if queue exceeds (default)
|
|
6876
|
+
}
|
|
6877
|
+
});
|
|
6878
|
+
|
|
6879
|
+
// Track trading events
|
|
6880
|
+
sdk.events.track(EVENT_TYPES.TOKEN_BUY, {
|
|
6881
|
+
tokenName: 'anime',
|
|
6882
|
+
amount: '100',
|
|
6883
|
+
price: '0.05'
|
|
6884
|
+
});
|
|
6885
|
+
|
|
6886
|
+
sdk.events.track(EVENT_TYPES.TOKEN_SELL, {
|
|
6887
|
+
tokenName: 'anime',
|
|
6888
|
+
amount: '50'
|
|
6889
|
+
});
|
|
6890
|
+
|
|
6891
|
+
// Track page navigation
|
|
6892
|
+
sdk.events.track(EVENT_TYPES.PAGE_VIEW, {
|
|
6893
|
+
path: '/tokens/anime',
|
|
6894
|
+
referrer: 'homepage'
|
|
6895
|
+
});
|
|
6896
|
+
|
|
6897
|
+
// Force immediate send for critical events
|
|
6898
|
+
await sdk.events.track(EVENT_TYPES.LOGIN, { userAddress: 'eth|0x...' }, { immediate: true });
|
|
6899
|
+
|
|
6900
|
+
// Get buffering statistics
|
|
6901
|
+
const stats = sdk.events.getStats();
|
|
6902
|
+
console.log(\`Buffered: \${stats.buffered}, Sent: \${stats.flushed}\`);
|
|
6903
|
+
|
|
6904
|
+
// Manually flush before page unload
|
|
6905
|
+
await sdk.events.flush();
|
|
6906
|
+
|
|
6907
|
+
// Graceful shutdown (waits up to 5 seconds)
|
|
6908
|
+
await sdk.events.shutdown(5000);
|
|
6909
|
+
|
|
6910
|
+
// Get statistics about buffered/sent events
|
|
6911
|
+
const stats = sdk.events.getStats();
|
|
6912
|
+
console.log(\`Buffered: \${stats.buffered}, Sent: \${stats.flushed}, Failed: \${stats.failed}\`);
|
|
6913
|
+
\`\`\`
|
|
6914
|
+
|
|
6915
|
+
**Available EVENT_TYPES Constants:**
|
|
6916
|
+
- \`LOGIN\`, \`LOGOUT\`
|
|
6917
|
+
- \`TOKEN_BUY\`, \`TOKEN_SELL\`, \`TOKEN_SWAP\`
|
|
6918
|
+
- \`STREAM_START\`, \`STREAM_END\`
|
|
6919
|
+
- \`CHAT_MESSAGE_SENT\`, \`COMMENT_CREATED\`
|
|
6920
|
+
- \`PAGE_VIEW\`, \`PAGE_LEAVE\`
|
|
6921
|
+
|
|
6922
|
+
**Related Topics:** \`stream-chat\`, \`streaming\`, \`overseer-invites\`
|
|
6923
|
+
`,
|
|
6924
|
+
'global-bans': `
|
|
6925
|
+
## Global Ban Management (Platform-wide, Overseer Only)
|
|
6926
|
+
|
|
6927
|
+
**Covers Methods:**
|
|
6928
|
+
- \`createGlobalBan(options)\` — Create a platform-wide ban for a user address
|
|
6929
|
+
- \`removeGlobalBan(options)\` — Remove a global ban
|
|
6930
|
+
- \`listGlobalBans(options?)\` — List all platform-wide bans with pagination
|
|
6931
|
+
- \`getGlobalBan(options)\` — Check if a specific user is globally banned
|
|
6932
|
+
|
|
6933
|
+
**Authentication:** All methods require overseer JWT session or admin API key.
|
|
6934
|
+
|
|
6935
|
+
**Distinction from Per-Token Bans:**
|
|
6936
|
+
- **Global bans** (\`createGlobalBan\`) — Platform-wide, applied to ALL tokens
|
|
6937
|
+
- **Per-token bans** (\`createBan\`) — Scoped to a specific token's chat/moderation
|
|
6938
|
+
|
|
6939
|
+
\`\`\`typescript
|
|
6940
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
6941
|
+
|
|
6942
|
+
const sdk = createLaunchpadSDK({ wallet: 'overseer-private-key' });
|
|
6943
|
+
|
|
6944
|
+
// Create a global ban (platform-wide)
|
|
6945
|
+
const ban = await sdk.createGlobalBan({
|
|
6946
|
+
userAddress: 'eth|0x1234...',
|
|
6947
|
+
reason: 'Repeated platform policy violations',
|
|
6948
|
+
expiresAt: new Date(Date.now() + 30 * 24 * 60 * 60 * 1000) // 30 days
|
|
6949
|
+
});
|
|
6950
|
+
console.log('Global ban created:', ban.id);
|
|
6951
|
+
|
|
6952
|
+
// Check if a user is globally banned
|
|
6953
|
+
const banStatus = await sdk.getGlobalBan({ userAddress: 'eth|0x1234...' });
|
|
6954
|
+
if (banStatus) {
|
|
6955
|
+
console.log(\`Banned until: \${banStatus.expiresAt ?? 'permanent'}\`);
|
|
6956
|
+
console.log(\`Reason: \${banStatus.reason}\`);
|
|
6957
|
+
}
|
|
6958
|
+
|
|
6959
|
+
// List all global bans (paginated)
|
|
6960
|
+
const bans = await sdk.listGlobalBans({ page: 1, limit: 20 });
|
|
6961
|
+
console.log(\`\${bans.meta.totalItems} total global bans\`);
|
|
6962
|
+
bans.items.forEach((b) => {
|
|
6963
|
+
console.log(\`\${b.userAddress}: \${b.reason}\`);
|
|
6964
|
+
});
|
|
6965
|
+
|
|
6966
|
+
// Remove a global ban
|
|
6967
|
+
await sdk.removeGlobalBan({ userAddress: 'eth|0x1234...' });
|
|
6968
|
+
console.log('Global ban removed');
|
|
6969
|
+
\`\`\`
|
|
6970
|
+
|
|
6971
|
+
**MCP Tool Equivalents:**
|
|
6972
|
+
- \`gala_launchpad_create_ban\` (global scope)
|
|
6973
|
+
- \`gala_launchpad_remove_ban\` (global scope)
|
|
6974
|
+
- \`gala_launchpad_list_global_flags\`
|
|
6975
|
+
|
|
6976
|
+
**Related Topics:** \`ban-management\`, \`overseer-invites\`, \`content-flag-management\`
|
|
6977
|
+
`,
|
|
6978
|
+
'recent-trades': `
|
|
6979
|
+
## Recent Trades Query (v9.2.0+)
|
|
6980
|
+
|
|
6981
|
+
**Covers Methods:**
|
|
6982
|
+
- \`getRecentTrades(tokenName?, limit?)\` — Get most recent trades (convenience wrapper)
|
|
6983
|
+
- \`getTrades(options)\` — Full paginated trades query with all filter options
|
|
6984
|
+
|
|
6985
|
+
\`getRecentTrades\` is a convenience wrapper around \`getTrades\` for quick access to recent
|
|
6986
|
+
market activity. Use \`getTrades\` directly for advanced filtering (date ranges, addresses, etc.).
|
|
6987
|
+
|
|
6988
|
+
\`\`\`typescript
|
|
6989
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
6990
|
+
|
|
6991
|
+
const sdk = createLaunchpadSDK();
|
|
6992
|
+
|
|
6993
|
+
// Get 50 most recent trades across all tokens
|
|
6994
|
+
const { trades } = await sdk.getRecentTrades();
|
|
6995
|
+
trades.forEach((t) => {
|
|
6996
|
+
console.log(\`\${t.tokenName} \${t.txnType}: \${t.inputAmount} → \${t.outputAmount}\`);
|
|
6997
|
+
});
|
|
6998
|
+
|
|
6999
|
+
// Get last 10 trades for a specific token
|
|
7000
|
+
const { trades: animeTrades } = await sdk.getRecentTrades('anime', 10);
|
|
7001
|
+
console.log(\`Last 10 anime trades:\`, animeTrades.length);
|
|
7002
|
+
|
|
7003
|
+
// Advanced filtering with getTrades()
|
|
7004
|
+
const { trades: filteredTrades, pageInfo } = await sdk.getTrades({
|
|
7005
|
+
tokenName: 'anime',
|
|
7006
|
+
txnType: 'BUY',
|
|
7007
|
+
startDate: '2025-01-01',
|
|
7008
|
+
endDate: '2025-01-31',
|
|
7009
|
+
pageSize: 20,
|
|
7010
|
+
});
|
|
7011
|
+
console.log(\`Page \${pageInfo.currentPage} of \${pageInfo.totalPages}\`);
|
|
7012
|
+
\`\`\`
|
|
7013
|
+
|
|
7014
|
+
**MCP Tool Equivalents:**
|
|
7015
|
+
- \`gala_launchpad_get_recent_trades\` — Recent trades with optional filtering
|
|
7016
|
+
- \`gala_launchpad_get_trades\` — Full trades query
|
|
7017
|
+
|
|
7018
|
+
**Related Topics:** \`trading-analytics\`, \`trade-history\`, \`holders\`
|
|
7019
|
+
`,
|
|
7020
|
+
};
|
|
7021
|
+
/**
|
|
7022
|
+
* All valid SDK example topics as a readonly array
|
|
7023
|
+
*/
|
|
7024
|
+
exports.SDK_EXAMPLE_TOPICS = Object.keys(exports.SDK_EXAMPLES);
|
|
7025
|
+
/**
|
|
7026
|
+
* Type guard to check if a string is a valid SDK example topic
|
|
7027
|
+
*/
|
|
7028
|
+
function isValidSdkTopic(topic) {
|
|
7029
|
+
return typeof topic === 'string' && topic in exports.SDK_EXAMPLES;
|
|
7030
|
+
}
|
|
7031
|
+
/**
|
|
7032
|
+
* SDK Usage Explanation Tool
|
|
7033
|
+
*
|
|
7034
|
+
* Provides detailed SDK code examples organized by topic.
|
|
7035
|
+
* The topic enum is derived from SDK_EXAMPLES keys to ensure type safety.
|
|
5183
7036
|
*/
|
|
5184
7037
|
exports.explainSdkUsageTool = {
|
|
5185
7038
|
name: 'gala_launchpad_explain_sdk_usage',
|
|
5186
|
-
description: 'Get detailed SDK code examples for all
|
|
7039
|
+
description: 'Get detailed SDK code examples for all 310 MCP tools (mapping to 273 SDK methods) organized into 65 composite workflow topics covering: buy-tokens, sell-tokens, pool-graduation, fetch-pools, balances, token-creation, token-status, dex-trading, gdex-stream, liquidity-positions, advanced-dex-analysis, price-history, token-details, token-distribution, profile-management, multi-wallet, transfers, locks, trading-analytics, utilities-and-helpers, utilities-system, error-handling, installation, local-calculations, spot-prices-smart-routing, event-subscriptions, mcp-to-sdk-mapping, DEX leaderboards, bridge-operations, dex-token-discovery, wrap-unwrap-operations, referral-system, account-management, session-auth, streaming, stream-chat, ban-management, api-key-management, moderator-invites, overseer-invites, content-flag-management, content-reactions, trade-history, token-ban-management, nft-collection-management, token-identification, graduation-detection, ai-moderation (AI content analysis - overseer only), weekly-challenge (weekly token competition leaderboard), platform-stats (platform-wide trading metrics), restricted-names (blocked token names list - overseer only), websocket-admin (real-time event broadcasting - admin/overseer), oembed (social media link preview metadata), messages (unified CHAT+COMMENT messages API), and holders (token holder distribution and whale analysis).',
|
|
5187
7040
|
inputSchema: {
|
|
5188
7041
|
type: 'object',
|
|
5189
7042
|
properties: {
|
|
5190
7043
|
topic: {
|
|
5191
7044
|
type: 'string',
|
|
5192
|
-
enum
|
|
5193
|
-
|
|
5194
|
-
'sell-tokens',
|
|
5195
|
-
'pool-graduation',
|
|
5196
|
-
'fetch-pools',
|
|
5197
|
-
'balances',
|
|
5198
|
-
'dex-trading',
|
|
5199
|
-
'liquidity-positions',
|
|
5200
|
-
'advanced-dex-analysis',
|
|
5201
|
-
'price-history',
|
|
5202
|
-
'token-details',
|
|
5203
|
-
'token-distribution',
|
|
5204
|
-
'token-status',
|
|
5205
|
-
'token-creation',
|
|
5206
|
-
'profile-management',
|
|
5207
|
-
'multi-wallet',
|
|
5208
|
-
'transfers',
|
|
5209
|
-
'locks',
|
|
5210
|
-
'trading-analytics',
|
|
5211
|
-
'utilities-and-helpers',
|
|
5212
|
-
'utilities-system',
|
|
5213
|
-
'error-handling',
|
|
5214
|
-
'installation',
|
|
5215
|
-
'local-calculations',
|
|
5216
|
-
'spot-prices-smart-routing',
|
|
5217
|
-
'event-subscriptions',
|
|
5218
|
-
'mcp-to-sdk-mapping',
|
|
5219
|
-
'fetch-all-dex-seasons',
|
|
5220
|
-
'fetch-current-dex-season',
|
|
5221
|
-
'fetch-dex-leaderboard-by-season-id',
|
|
5222
|
-
'fetch-current-dex-leaderboard',
|
|
5223
|
-
'fetch-dex-aggregated-volume-summary',
|
|
5224
|
-
'fetch-dex-pools',
|
|
5225
|
-
'bridge-operations',
|
|
5226
|
-
'dex-token-discovery',
|
|
5227
|
-
'wrap-unwrap-operations',
|
|
5228
|
-
'referral-system',
|
|
5229
|
-
'account-management',
|
|
5230
|
-
'streaming',
|
|
5231
|
-
'stream-chat',
|
|
5232
|
-
'session-auth',
|
|
5233
|
-
'ban-management',
|
|
5234
|
-
'api-key-management',
|
|
5235
|
-
'moderator-invites',
|
|
5236
|
-
'overseer-invites',
|
|
5237
|
-
'content-flag-management',
|
|
5238
|
-
'content-reactions',
|
|
5239
|
-
'trade-history',
|
|
5240
|
-
'token-ban-management',
|
|
5241
|
-
'nft-collection-management',
|
|
5242
|
-
],
|
|
7045
|
+
// Derive enum from SDK_EXAMPLES keys to ensure they're always in sync
|
|
7046
|
+
enum: exports.SDK_EXAMPLE_TOPICS,
|
|
5243
7047
|
description: 'The SDK usage topic to explain.',
|
|
5244
7048
|
},
|
|
5245
7049
|
},
|
|
5246
7050
|
required: ['topic'],
|
|
5247
7051
|
},
|
|
5248
7052
|
handler: (0, error_handler_js_1.withErrorHandling)(async (_sdk, args) => {
|
|
5249
|
-
const
|
|
7053
|
+
const { topic } = args;
|
|
7054
|
+
// Type-safe lookup - topic is already typed as SdkExampleTopic
|
|
7055
|
+
const example = exports.SDK_EXAMPLES[topic];
|
|
5250
7056
|
if (example === undefined || example === '') {
|
|
5251
|
-
throw new Error(
|
|
7057
|
+
throw new Error(`Unknown topic: ${topic}`);
|
|
5252
7058
|
}
|
|
5253
7059
|
return (0, response_formatter_js_1.formatSuccess)({
|
|
5254
|
-
topic
|
|
7060
|
+
topic,
|
|
5255
7061
|
explanation: example,
|
|
5256
|
-
sdkVersion: '5.
|
|
7062
|
+
sdkVersion: '5.0.4-beta.56',
|
|
5257
7063
|
packageName: '@gala-chain/launchpad-sdk',
|
|
5258
7064
|
documentation: 'https://www.npmjs.com/package/@gala-chain/launchpad-sdk',
|
|
5259
7065
|
});
|