@gala-chain/launchpad-sdk 5.0.4-beta.6 → 5.0.4-beta.60
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/CHANGELOG.md +82 -0
- package/EXAMPLES.md +99 -0
- package/README.md +163 -49
- package/README.md.bak +3174 -0
- package/dist/LaunchpadSDK.d.ts +10615 -0
- package/dist/LaunchpadSDK.d.ts.map +1 -0
- package/dist/ai-docs.json +5081 -1052
- package/dist/api/LaunchpadAPI.d.ts +930 -0
- package/dist/api/LaunchpadAPI.d.ts.map +1 -0
- package/dist/api/dto/BondingCurveDTOs.d.ts +145 -0
- package/dist/api/dto/BondingCurveDTOs.d.ts.map +1 -0
- package/dist/api/dto/BurnTokensDto.d.ts +89 -0
- package/dist/api/dto/BurnTokensDto.d.ts.map +1 -0
- package/dist/api/dto/LockTokenDto.d.ts +97 -0
- package/dist/api/dto/LockTokenDto.d.ts.map +1 -0
- package/dist/api/dto/TransferTokenDto.d.ts +76 -0
- package/dist/api/dto/TransferTokenDto.d.ts.map +1 -0
- package/dist/api/dto/UnlockTokenDto.d.ts +86 -0
- package/dist/api/dto/UnlockTokenDto.d.ts.map +1 -0
- package/dist/auth/JwtAuth.d.ts +183 -0
- package/dist/auth/JwtAuth.d.ts.map +1 -0
- package/dist/auth/SessionAuthService.d.ts +151 -0
- package/dist/auth/SessionAuthService.d.ts.map +1 -0
- package/dist/auth/SignatureAuth.d.ts +181 -0
- package/dist/auth/SignatureAuth.d.ts.map +1 -0
- package/dist/auth/storage.d.ts +66 -0
- package/dist/auth/storage.d.ts.map +1 -0
- package/dist/auth/types.d.ts +50 -0
- package/dist/auth/types.d.ts.map +1 -0
- package/dist/bridge/BridgeService.d.ts +484 -0
- package/dist/bridge/BridgeService.d.ts.map +1 -0
- package/dist/bridge/GalaConnectClient.d.ts +170 -0
- package/dist/bridge/GalaConnectClient.d.ts.map +1 -0
- package/dist/bridge/constants/index.d.ts +7 -0
- package/dist/bridge/constants/index.d.ts.map +1 -0
- package/dist/bridge/constants/tokens.d.ts +212 -0
- package/dist/bridge/constants/tokens.d.ts.map +1 -0
- package/dist/bridge/index.d.ts +24 -0
- package/dist/bridge/index.d.ts.map +1 -0
- package/dist/bridge/strategies/BridgeStrategy.d.ts +160 -0
- package/dist/bridge/strategies/BridgeStrategy.d.ts.map +1 -0
- package/dist/bridge/strategies/EthereumBridgeStrategy.d.ts +200 -0
- package/dist/bridge/strategies/EthereumBridgeStrategy.d.ts.map +1 -0
- package/dist/bridge/strategies/SolanaBridgeStrategy.d.ts +258 -0
- package/dist/bridge/strategies/SolanaBridgeStrategy.d.ts.map +1 -0
- package/dist/bridge/types/bridge.dto.d.ts +772 -0
- package/dist/bridge/types/bridge.dto.d.ts.map +1 -0
- package/dist/bridge/types/bridgeable-token.dto.d.ts +205 -0
- package/dist/bridge/types/bridgeable-token.dto.d.ts.map +1 -0
- package/dist/bridge/types/eip712.d.ts +66 -0
- package/dist/bridge/types/eip712.d.ts.map +1 -0
- package/dist/bridge/types/index.d.ts +8 -0
- package/dist/bridge/types/index.d.ts.map +1 -0
- package/dist/bridge/utils/RateLimiter.d.ts +34 -0
- package/dist/bridge/utils/RateLimiter.d.ts.map +1 -0
- package/dist/bridge/utils/address-formatter.d.ts +25 -0
- package/dist/bridge/utils/address-formatter.d.ts.map +1 -0
- package/dist/bridge/utils/addressValidation.d.ts +200 -0
- package/dist/bridge/utils/addressValidation.d.ts.map +1 -0
- package/dist/bridge/utils/balanceHelpers.d.ts +215 -0
- package/dist/bridge/utils/balanceHelpers.d.ts.map +1 -0
- package/dist/bridge/utils/bridgeErrors.d.ts +98 -0
- package/dist/bridge/utils/bridgeErrors.d.ts.map +1 -0
- package/dist/bridge/utils/bridgeOutHelpers.d.ts +68 -0
- package/dist/bridge/utils/bridgeOutHelpers.d.ts.map +1 -0
- package/dist/bridge/utils/bridgePayload.d.ts +98 -0
- package/dist/bridge/utils/bridgePayload.d.ts.map +1 -0
- package/dist/bridge/utils/bridgeStatusParser.d.ts +75 -0
- package/dist/bridge/utils/bridgeStatusParser.d.ts.map +1 -0
- package/dist/bridge/utils/eip712Helpers.d.ts +66 -0
- package/dist/bridge/utils/eip712Helpers.d.ts.map +1 -0
- package/dist/bridge/utils/index.d.ts +19 -0
- package/dist/bridge/utils/index.d.ts.map +1 -0
- package/dist/bridge/utils/retry.d.ts +112 -0
- package/dist/bridge/utils/retry.d.ts.map +1 -0
- package/dist/bridge/utils/strategyDelegation.d.ts +69 -0
- package/dist/bridge/utils/strategyDelegation.d.ts.map +1 -0
- package/dist/bridge/utils/tokenIdUtils.d.ts +86 -0
- package/dist/bridge/utils/tokenIdUtils.d.ts.map +1 -0
- package/dist/bridge/utils/tokenMath.d.ts +39 -0
- package/dist/bridge/utils/tokenMath.d.ts.map +1 -0
- package/dist/bridge/utils/tokenMetadataResolver.d.ts +97 -0
- package/dist/bridge/utils/tokenMetadataResolver.d.ts.map +1 -0
- package/dist/config/environments.d.ts +49 -0
- package/dist/config/environments.d.ts.map +1 -0
- package/dist/constants/bondingCurve.d.ts +102 -0
- package/dist/constants/bondingCurve.d.ts.map +1 -0
- package/dist/constants/config.d.ts +30 -0
- package/dist/constants/config.d.ts.map +1 -0
- package/dist/constants/decimals.d.ts +63 -0
- package/dist/constants/decimals.d.ts.map +1 -0
- package/dist/constants/endpoints.d.ts +776 -0
- package/dist/constants/endpoints.d.ts.map +1 -0
- package/dist/constants/enums.d.ts +65 -0
- package/dist/constants/enums.d.ts.map +1 -0
- package/dist/constants/error-messages.d.ts +61 -0
- package/dist/constants/error-messages.d.ts.map +1 -0
- package/dist/constants/events.d.ts +53 -0
- package/dist/constants/events.d.ts.map +1 -0
- package/dist/constants/jwt.d.ts +41 -0
- package/dist/constants/jwt.d.ts.map +1 -0
- package/dist/constants/nft-fees.d.ts +30 -0
- package/dist/constants/nft-fees.d.ts.map +1 -0
- package/dist/constants/pagination.d.ts +66 -0
- package/dist/constants/pagination.d.ts.map +1 -0
- package/dist/constants/query-fields.d.ts +51 -0
- package/dist/constants/query-fields.d.ts.map +1 -0
- package/dist/constants/sdk-defaults.d.ts +37 -0
- package/dist/constants/sdk-defaults.d.ts.map +1 -0
- package/dist/constants/version.d.ts +6 -0
- package/dist/constants/version.d.ts.map +1 -0
- package/dist/constants/version.generated.d.ts +7 -0
- package/dist/constants/version.generated.d.ts.map +1 -0
- package/dist/examples/admin/api-key-advanced.d.ts +43 -0
- package/dist/examples/admin/api-key-advanced.d.ts.map +1 -0
- package/dist/examples/admin/moderator-invite-complete.d.ts +41 -0
- package/dist/examples/admin/moderator-invite-complete.d.ts.map +1 -0
- package/dist/examples/admin/overseer-management-advanced.d.ts +38 -0
- package/dist/examples/admin/overseer-management-advanced.d.ts.map +1 -0
- package/dist/examples/admin/overseer-page-stats.d.ts +26 -0
- package/dist/examples/admin/overseer-page-stats.d.ts.map +1 -0
- package/dist/examples/admin/token-ban-complete.d.ts +44 -0
- package/dist/examples/admin/token-ban-complete.d.ts.map +1 -0
- package/dist/examples/ai-moderation/ai-moderation-demo.d.ts +32 -0
- package/dist/examples/ai-moderation/ai-moderation-demo.d.ts.map +1 -0
- package/dist/examples/ai-moderation/flag-ai-verdicts-demo.d.ts +30 -0
- package/dist/examples/ai-moderation/flag-ai-verdicts-demo.d.ts.map +1 -0
- package/dist/examples/analytics/index.d.ts +23 -0
- package/dist/examples/analytics/index.d.ts.map +1 -0
- package/dist/examples/analytics/market-analysis-tools.d.ts +28 -0
- package/dist/examples/analytics/market-analysis-tools.d.ts.map +1 -0
- package/dist/examples/analytics/portfolio-performance-tracking.d.ts +25 -0
- package/dist/examples/analytics/portfolio-performance-tracking.d.ts.map +1 -0
- package/dist/examples/analytics/trading-analytics-advanced.d.ts +27 -0
- package/dist/examples/analytics/trading-analytics-advanced.d.ts.map +1 -0
- package/dist/examples/api-keys/advanced-configuration.d.ts +19 -0
- package/dist/examples/api-keys/advanced-configuration.d.ts.map +1 -0
- package/dist/examples/api-keys/complete-lifecycle.d.ts +18 -0
- package/dist/examples/api-keys/complete-lifecycle.d.ts.map +1 -0
- package/dist/examples/api-keys/crud.d.ts +22 -0
- package/dist/examples/api-keys/crud.d.ts.map +1 -0
- package/dist/examples/api-keys/token-delegation.d.ts +24 -0
- package/dist/examples/api-keys/token-delegation.d.ts.map +1 -0
- package/dist/examples/api-keys/user-api-key-auth.d.ts +24 -0
- package/dist/examples/api-keys/user-api-key-auth.d.ts.map +1 -0
- package/dist/examples/auth/auth-permissions-checking.d.ts +32 -0
- package/dist/examples/auth/auth-permissions-checking.d.ts.map +1 -0
- package/dist/examples/auth/auth-token-management.d.ts +32 -0
- package/dist/examples/auth/auth-token-management.d.ts.map +1 -0
- package/dist/examples/auth/auth-validation-workflows.d.ts +32 -0
- package/dist/examples/auth/auth-validation-workflows.d.ts.map +1 -0
- package/dist/examples/bans/ban-management.d.ts +24 -0
- package/dist/examples/bans/ban-management.d.ts.map +1 -0
- package/dist/examples/bans/demo-global-user-bans.d.ts +27 -0
- package/dist/examples/bans/demo-global-user-bans.d.ts.map +1 -0
- package/dist/examples/bonding/token-graduation-workflow.d.ts +21 -0
- package/dist/examples/bonding/token-graduation-workflow.d.ts.map +1 -0
- package/dist/examples/bonding-curve/basic-trading.d.ts +20 -0
- package/dist/examples/bonding-curve/basic-trading.d.ts.map +1 -0
- package/dist/examples/bonding-curve/graduation-workflow.d.ts +18 -0
- package/dist/examples/bonding-curve/graduation-workflow.d.ts.map +1 -0
- package/dist/examples/bonding-curve/pagination-variants.d.ts +17 -0
- package/dist/examples/bonding-curve/pagination-variants.d.ts.map +1 -0
- package/dist/examples/bonding-curve/pool-analysis.d.ts +18 -0
- package/dist/examples/bonding-curve/pool-analysis.d.ts.map +1 -0
- package/dist/examples/bonding-curve/pool-creator-filtering.d.ts +17 -0
- package/dist/examples/bonding-curve/pool-creator-filtering.d.ts.map +1 -0
- package/dist/examples/bonding-curve/pool-discovery.d.ts +19 -0
- package/dist/examples/bonding-curve/pool-discovery.d.ts.map +1 -0
- package/dist/examples/bonding-curve/price-impact.d.ts +18 -0
- package/dist/examples/bonding-curve/price-impact.d.ts.map +1 -0
- package/dist/examples/bonding-curve/token-launch.d.ts +18 -0
- package/dist/examples/bonding-curve/token-launch.d.ts.map +1 -0
- package/dist/examples/bonding-curve/user-holder-context.d.ts +18 -0
- package/dist/examples/bonding-curve/user-holder-context.d.ts.map +1 -0
- package/dist/examples/bonding-curve/volume-trading.d.ts +18 -0
- package/dist/examples/bonding-curve/volume-trading.d.ts.map +1 -0
- package/dist/examples/bridge/bridge-ethereum-specific.d.ts +18 -0
- package/dist/examples/bridge/bridge-ethereum-specific.d.ts.map +1 -0
- package/dist/examples/bridge/bridge-generic-operations.d.ts +18 -0
- package/dist/examples/bridge/bridge-generic-operations.d.ts.map +1 -0
- package/dist/examples/bridge/bridge-multi-chain-routing.d.ts +31 -0
- package/dist/examples/bridge/bridge-multi-chain-routing.d.ts.map +1 -0
- package/dist/examples/bridge/bridge-network-methods.d.ts +31 -0
- package/dist/examples/bridge/bridge-network-methods.d.ts.map +1 -0
- package/dist/examples/bridge/bridge-network-tokens.d.ts +18 -0
- package/dist/examples/bridge/bridge-network-tokens.d.ts.map +1 -0
- package/dist/examples/bridge/bridge-network-validation.d.ts +33 -0
- package/dist/examples/bridge/bridge-network-validation.d.ts.map +1 -0
- package/dist/examples/bridge/bridge-operations.d.ts +27 -0
- package/dist/examples/bridge/bridge-operations.d.ts.map +1 -0
- package/dist/examples/bridge/bridge-solana-specific.d.ts +18 -0
- package/dist/examples/bridge/bridge-solana-specific.d.ts.map +1 -0
- package/dist/examples/bridge/bridge-status-monitoring.d.ts +30 -0
- package/dist/examples/bridge/bridge-status-monitoring.d.ts.map +1 -0
- package/dist/examples/bridge/bridge-wrapped-token-operations.d.ts +30 -0
- package/dist/examples/bridge/bridge-wrapped-token-operations.d.ts.map +1 -0
- package/dist/examples/bridge/bridgeable-tokens.d.ts +27 -0
- package/dist/examples/bridge/bridgeable-tokens.d.ts.map +1 -0
- package/dist/examples/bridge/check-balances.d.ts +13 -0
- package/dist/examples/bridge/check-balances.d.ts.map +1 -0
- package/dist/examples/bridge/ethereum-in.d.ts +17 -0
- package/dist/examples/bridge/ethereum-in.d.ts.map +1 -0
- package/dist/examples/bridge/ethereum-out.d.ts +17 -0
- package/dist/examples/bridge/ethereum-out.d.ts.map +1 -0
- package/dist/examples/bridge/ethereum-roundtrip.d.ts +20 -0
- package/dist/examples/bridge/ethereum-roundtrip.d.ts.map +1 -0
- package/dist/examples/bridge/external-balances.d.ts +29 -0
- package/dist/examples/bridge/external-balances.d.ts.map +1 -0
- package/dist/examples/bridge/fee-estimation.d.ts +14 -0
- package/dist/examples/bridge/fee-estimation.d.ts.map +1 -0
- package/dist/examples/bridge/solana-in.d.ts +18 -0
- package/dist/examples/bridge/solana-in.d.ts.map +1 -0
- package/dist/examples/bridge/solana-out.d.ts +18 -0
- package/dist/examples/bridge/solana-out.d.ts.map +1 -0
- package/dist/examples/bridge/solana-roundtrip.d.ts +21 -0
- package/dist/examples/bridge/solana-roundtrip.d.ts.map +1 -0
- package/dist/examples/bridge/status-tracking.d.ts +16 -0
- package/dist/examples/bridge/status-tracking.d.ts.map +1 -0
- package/dist/examples/bridge/supported-tokens.d.ts +14 -0
- package/dist/examples/bridge/supported-tokens.d.ts.map +1 -0
- package/dist/examples/bridge/test-debug-unwrap.d.ts +13 -0
- package/dist/examples/bridge/test-debug-unwrap.d.ts.map +1 -0
- package/dist/examples/bridge/test-unwrap-execution.d.ts +13 -0
- package/dist/examples/bridge/test-unwrap-execution.d.ts.map +1 -0
- package/dist/examples/bridge/test-wrap-debug.d.ts +13 -0
- package/dist/examples/bridge/test-wrap-debug.d.ts.map +1 -0
- package/dist/examples/bridge/test-wrap-execution.d.ts +13 -0
- package/dist/examples/bridge/test-wrap-execution.d.ts.map +1 -0
- package/dist/examples/bridge/test-wrap-roundtrip.d.ts +13 -0
- package/dist/examples/bridge/test-wrap-roundtrip.d.ts.map +1 -0
- package/dist/examples/bridge/transaction-status.d.ts +26 -0
- package/dist/examples/bridge/transaction-status.d.ts.map +1 -0
- package/dist/examples/bridge/wallet-balances.d.ts +24 -0
- package/dist/examples/bridge/wallet-balances.d.ts.map +1 -0
- package/dist/examples/bridge/wrap-discovery.d.ts +16 -0
- package/dist/examples/bridge/wrap-discovery.d.ts.map +1 -0
- package/dist/examples/bridge/wrap-fee-estimation.d.ts +16 -0
- package/dist/examples/bridge/wrap-fee-estimation.d.ts.map +1 -0
- package/dist/examples/bridge/wrap-unwrap.d.ts +18 -0
- package/dist/examples/bridge/wrap-unwrap.d.ts.map +1 -0
- package/dist/examples/bridge/wrap-utilities.d.ts +21 -0
- package/dist/examples/bridge/wrap-utilities.d.ts.map +1 -0
- package/dist/examples/calculations/calculation-methods-comprehensive.d.ts +24 -0
- package/dist/examples/calculations/calculation-methods-comprehensive.d.ts.map +1 -0
- package/dist/examples/calculations/external-calculations-demo.d.ts +23 -0
- package/dist/examples/calculations/external-calculations-demo.d.ts.map +1 -0
- package/dist/examples/calculations/local-calculations-demo.d.ts +24 -0
- package/dist/examples/calculations/local-calculations-demo.d.ts.map +1 -0
- package/dist/examples/calculations/pool-calculation-context.d.ts +19 -0
- package/dist/examples/calculations/pool-calculation-context.d.ts.map +1 -0
- package/dist/examples/chat/basic-chat.d.ts +17 -0
- package/dist/examples/chat/basic-chat.d.ts.map +1 -0
- package/dist/examples/chat/chat-admin-controls.d.ts +41 -0
- package/dist/examples/chat/chat-admin-controls.d.ts.map +1 -0
- package/dist/examples/chat/chat-demo.d.ts +25 -0
- package/dist/examples/chat/chat-demo.d.ts.map +1 -0
- package/dist/examples/chat/chat-engagement-stats.d.ts +44 -0
- package/dist/examples/chat/chat-engagement-stats.d.ts.map +1 -0
- package/dist/examples/chat/chat-lifecycle.d.ts +26 -0
- package/dist/examples/chat/chat-lifecycle.d.ts.map +1 -0
- package/dist/examples/chat/chat-message-management.d.ts +18 -0
- package/dist/examples/chat/chat-message-management.d.ts.map +1 -0
- package/dist/examples/chat/chat-pinning-workflow.d.ts +37 -0
- package/dist/examples/chat/chat-pinning-workflow.d.ts.map +1 -0
- package/dist/examples/chat/demo-pin-messages.d.ts +17 -0
- package/dist/examples/chat/demo-pin-messages.d.ts.map +1 -0
- package/dist/examples/chat/multi-user-chat-test.d.ts +19 -0
- package/dist/examples/chat/multi-user-chat-test.d.ts.map +1 -0
- package/dist/examples/chat/quick-reaction-test.d.ts +4 -0
- package/dist/examples/chat/quick-reaction-test.d.ts.map +1 -0
- package/dist/examples/chat/typing-indicators.d.ts +23 -0
- package/dist/examples/chat/typing-indicators.d.ts.map +1 -0
- package/dist/examples/chat/websocket-chat.d.ts +21 -0
- package/dist/examples/chat/websocket-chat.d.ts.map +1 -0
- package/dist/examples/comments/basic-comments.d.ts +19 -0
- package/dist/examples/comments/basic-comments.d.ts.map +1 -0
- package/dist/examples/comments/comments-demo.d.ts +34 -0
- package/dist/examples/comments/comments-demo.d.ts.map +1 -0
- package/dist/examples/comments/comments-lifecycle.d.ts +24 -0
- package/dist/examples/comments/comments-lifecycle.d.ts.map +1 -0
- package/dist/examples/comments/comments-update-workflow.d.ts +35 -0
- package/dist/examples/comments/comments-update-workflow.d.ts.map +1 -0
- package/dist/examples/content/content-categorization.d.ts +51 -0
- package/dist/examples/content/content-categorization.d.ts.map +1 -0
- package/dist/examples/content/content-publishing-workflow.d.ts +45 -0
- package/dist/examples/content/content-publishing-workflow.d.ts.map +1 -0
- package/dist/examples/content/content-versioning.d.ts +52 -0
- package/dist/examples/content/content-versioning.d.ts.map +1 -0
- package/dist/examples/content-flags/comprehensive-flag-workflow.d.ts +40 -0
- package/dist/examples/content-flags/comprehensive-flag-workflow.d.ts.map +1 -0
- package/dist/examples/content-flags/flag-management.d.ts +28 -0
- package/dist/examples/content-flags/flag-management.d.ts.map +1 -0
- package/dist/examples/content-reactions/advanced-reactions.d.ts +24 -0
- package/dist/examples/content-reactions/advanced-reactions.d.ts.map +1 -0
- package/dist/examples/content-reactions/basic-reactions.d.ts +21 -0
- package/dist/examples/content-reactions/basic-reactions.d.ts.map +1 -0
- package/dist/examples/content-reactions/comprehensive-reactions-workflow.d.ts +41 -0
- package/dist/examples/content-reactions/comprehensive-reactions-workflow.d.ts.map +1 -0
- package/dist/examples/content-reactions/content-reactions-advanced.d.ts +40 -0
- package/dist/examples/content-reactions/content-reactions-advanced.d.ts.map +1 -0
- package/dist/examples/core/authenticated-operations.d.ts +14 -0
- package/dist/examples/core/authenticated-operations.d.ts.map +1 -0
- package/dist/examples/core/complete-sdk-demo.d.ts +22 -0
- package/dist/examples/core/complete-sdk-demo.d.ts.map +1 -0
- package/dist/examples/core/image-uploads.d.ts +28 -0
- package/dist/examples/core/image-uploads.d.ts.map +1 -0
- package/dist/examples/core/privatekey-override-pattern.d.ts +16 -0
- package/dist/examples/core/privatekey-override-pattern.d.ts.map +1 -0
- package/dist/examples/core/read-only-operations.d.ts +16 -0
- package/dist/examples/core/read-only-operations.d.ts.map +1 -0
- package/dist/examples/core/session-auth-demo.d.ts +15 -0
- package/dist/examples/core/session-auth-demo.d.ts.map +1 -0
- package/dist/examples/core/session-auth-lifecycle.d.ts +19 -0
- package/dist/examples/core/session-auth-lifecycle.d.ts.map +1 -0
- package/dist/examples/core/test-pagination-fix.d.ts +14 -0
- package/dist/examples/core/test-pagination-fix.d.ts.map +1 -0
- package/dist/examples/core/token-refresh-utilities.d.ts +18 -0
- package/dist/examples/core/token-refresh-utilities.d.ts.map +1 -0
- package/dist/examples/core/token-validation.d.ts +18 -0
- package/dist/examples/core/token-validation.d.ts.map +1 -0
- package/dist/examples/core/wallet-management.d.ts +23 -0
- package/dist/examples/core/wallet-management.d.ts.map +1 -0
- package/dist/examples/debug/check-recorded-bridge-tx.d.ts +8 -0
- package/dist/examples/debug/check-recorded-bridge-tx.d.ts.map +1 -0
- package/dist/examples/debug/debug-comment.d.ts +2 -0
- package/dist/examples/debug/debug-comment.d.ts.map +1 -0
- package/dist/examples/debug/test-volume-data-bounds-prod.d.ts +15 -0
- package/dist/examples/debug/test-volume-data-bounds-prod.d.ts.map +1 -0
- package/dist/examples/debug/test-volume-data-bounds.d.ts +14 -0
- package/dist/examples/debug/test-volume-data-bounds.d.ts.map +1 -0
- package/dist/examples/debug/websocket-event-discovery.d.ts +26 -0
- package/dist/examples/debug/websocket-event-discovery.d.ts.map +1 -0
- package/dist/examples/debug/websocket-monitor.d.ts +15 -0
- package/dist/examples/debug/websocket-monitor.d.ts.map +1 -0
- package/dist/examples/debug-single-trade.d.ts +6 -0
- package/dist/examples/debug-single-trade.d.ts.map +1 -0
- package/dist/examples/demo-librarian.d.ts +18 -0
- package/dist/examples/demo-librarian.d.ts.map +1 -0
- package/dist/examples/demo-runner.d.ts +22 -0
- package/dist/examples/demo-runner.d.ts.map +1 -0
- package/dist/examples/dex/demo-roundtrip-liquidity.d.ts +16 -0
- package/dist/examples/dex/demo-roundtrip-liquidity.d.ts.map +1 -0
- package/dist/examples/dex/dex-impermanent-loss-analysis.d.ts +28 -0
- package/dist/examples/dex/dex-impermanent-loss-analysis.d.ts.map +1 -0
- package/dist/examples/dex/dex-liquidity-management-advanced.d.ts +27 -0
- package/dist/examples/dex/dex-liquidity-management-advanced.d.ts.map +1 -0
- package/dist/examples/dex/dex-multi-hop-swaps.d.ts +32 -0
- package/dist/examples/dex/dex-multi-hop-swaps.d.ts.map +1 -0
- package/dist/examples/dex/dex-pool-pricing.d.ts +20 -0
- package/dist/examples/dex/dex-pool-pricing.d.ts.map +1 -0
- package/dist/examples/dex/dex-quote-calculations.d.ts +21 -0
- package/dist/examples/dex/dex-quote-calculations.d.ts.map +1 -0
- package/dist/examples/dex/dex-seasons-leaderboard.d.ts +22 -0
- package/dist/examples/dex/dex-seasons-leaderboard.d.ts.map +1 -0
- package/dist/examples/dex/dex-slippage-protection.d.ts +28 -0
- package/dist/examples/dex/dex-slippage-protection.d.ts.map +1 -0
- package/dist/examples/dex/dex-tokens-discovery.d.ts +20 -0
- package/dist/examples/dex/dex-tokens-discovery.d.ts.map +1 -0
- package/dist/examples/dex/dex-volume-analytics.d.ts +19 -0
- package/dist/examples/dex/dex-volume-analytics.d.ts.map +1 -0
- package/dist/examples/dex/leaderboard.d.ts +12 -0
- package/dist/examples/dex/leaderboard.d.ts.map +1 -0
- package/dist/examples/dex/pool-discovery.d.ts +25 -0
- package/dist/examples/dex/pool-discovery.d.ts.map +1 -0
- package/dist/examples/dex/pools-with-pricing.d.ts +28 -0
- package/dist/examples/dex/pools-with-pricing.d.ts.map +1 -0
- package/dist/examples/dex/quote-comparison.d.ts +16 -0
- package/dist/examples/dex/quote-comparison.d.ts.map +1 -0
- package/dist/examples/dex/swap-user-assets-comprehensive.d.ts +20 -0
- package/dist/examples/dex/swap-user-assets-comprehensive.d.ts.map +1 -0
- package/dist/examples/dex/swap-workflow.d.ts +20 -0
- package/dist/examples/dex/swap-workflow.d.ts.map +1 -0
- package/dist/examples/dex/token-discovery.d.ts +27 -0
- package/dist/examples/dex/token-discovery.d.ts.map +1 -0
- package/dist/examples/dex/volume-summary.d.ts +12 -0
- package/dist/examples/dex/volume-summary.d.ts.map +1 -0
- package/dist/examples/error-handling/error-recovery-patterns.d.ts +42 -0
- package/dist/examples/error-handling/error-recovery-patterns.d.ts.map +1 -0
- package/dist/examples/error-handling/timeout-management.d.ts +43 -0
- package/dist/examples/error-handling/timeout-management.d.ts.map +1 -0
- package/dist/examples/events/event-aggregation-analysis.d.ts +40 -0
- package/dist/examples/events/event-aggregation-analysis.d.ts.map +1 -0
- package/dist/examples/events/event-emission-patterns.d.ts +35 -0
- package/dist/examples/events/event-emission-patterns.d.ts.map +1 -0
- package/dist/examples/events/subscription-management-advanced.d.ts +38 -0
- package/dist/examples/events/subscription-management-advanced.d.ts.map +1 -0
- package/dist/examples/fees/complete-fee-test.d.ts +13 -0
- package/dist/examples/fees/complete-fee-test.d.ts.map +1 -0
- package/dist/examples/fees/demo-fee-generation-and-collection.d.ts +27 -0
- package/dist/examples/fees/demo-fee-generation-and-collection.d.ts.map +1 -0
- package/dist/examples/fees/demo-fees-high-volume.d.ts +13 -0
- package/dist/examples/fees/demo-fees-high-volume.d.ts.map +1 -0
- package/dist/examples/fees/demo-multi-wallet-fee-generation.d.ts +13 -0
- package/dist/examples/fees/demo-multi-wallet-fee-generation.d.ts.map +1 -0
- package/dist/examples/fees/trade-and-collect-fees.d.ts +13 -0
- package/dist/examples/fees/trade-and-collect-fees.d.ts.map +1 -0
- package/dist/examples/galachain/bundler-transactions.d.ts +28 -0
- package/dist/examples/galachain/bundler-transactions.d.ts.map +1 -0
- package/dist/examples/galachain/galachain-token-resolution.d.ts +28 -0
- package/dist/examples/galachain/galachain-token-resolution.d.ts.map +1 -0
- package/dist/examples/galachain/galachain-tokens.d.ts +28 -0
- package/dist/examples/galachain/galachain-tokens.d.ts.map +1 -0
- package/dist/examples/galachain/galachain-transfers.d.ts +25 -0
- package/dist/examples/galachain/galachain-transfers.d.ts.map +1 -0
- package/dist/examples/global-feed-demo.d.ts +17 -0
- package/dist/examples/global-feed-demo.d.ts.map +1 -0
- package/dist/examples/global-feed-filtering-demo.d.ts +20 -0
- package/dist/examples/global-feed-filtering-demo.d.ts.map +1 -0
- package/dist/examples/launchpad/demo-socials.d.ts +16 -0
- package/dist/examples/launchpad/demo-socials.d.ts.map +1 -0
- package/dist/examples/launchpad/fetch-token-stats.d.ts +18 -0
- package/dist/examples/launchpad/fetch-token-stats.d.ts.map +1 -0
- package/dist/examples/launchpad/update-token-config.d.ts +17 -0
- package/dist/examples/launchpad/update-token-config.d.ts.map +1 -0
- package/dist/examples/liquidity/apr-calculator.d.ts +18 -0
- package/dist/examples/liquidity/apr-calculator.d.ts.map +1 -0
- package/dist/examples/liquidity/demo-bundler-operations.d.ts +15 -0
- package/dist/examples/liquidity/demo-bundler-operations.d.ts.map +1 -0
- package/dist/examples/liquidity/demo-fetch-all-positions.d.ts +2 -0
- package/dist/examples/liquidity/demo-fetch-all-positions.d.ts.map +1 -0
- package/dist/examples/liquidity/demo-position-direct.d.ts +14 -0
- package/dist/examples/liquidity/demo-position-direct.d.ts.map +1 -0
- package/dist/examples/liquidity/demo-positions-with-chunked-pricing.d.ts +26 -0
- package/dist/examples/liquidity/demo-positions-with-chunked-pricing.d.ts.map +1 -0
- package/dist/examples/liquidity/demo-roundtrip-remove.d.ts +21 -0
- package/dist/examples/liquidity/demo-roundtrip-remove.d.ts.map +1 -0
- package/dist/examples/liquidity/detailed.d.ts +21 -0
- package/dist/examples/liquidity/detailed.d.ts.map +1 -0
- package/dist/examples/liquidity/errors.d.ts +18 -0
- package/dist/examples/liquidity/errors.d.ts.map +1 -0
- package/dist/examples/liquidity/fee-collection.d.ts +22 -0
- package/dist/examples/liquidity/fee-collection.d.ts.map +1 -0
- package/dist/examples/liquidity/liquidity-position-details.d.ts +21 -0
- package/dist/examples/liquidity/liquidity-position-details.d.ts.map +1 -0
- package/dist/examples/liquidity/liquidity-removal-estimation.d.ts +19 -0
- package/dist/examples/liquidity/liquidity-removal-estimation.d.ts.map +1 -0
- package/dist/examples/liquidity/multi-position.d.ts +22 -0
- package/dist/examples/liquidity/multi-position.d.ts.map +1 -0
- package/dist/examples/liquidity/positions-cli.d.ts +41 -0
- package/dist/examples/liquidity/positions-cli.d.ts.map +1 -0
- package/dist/examples/liquidity/ticks.d.ts +18 -0
- package/dist/examples/liquidity/ticks.d.ts.map +1 -0
- package/dist/examples/locks/burn-tokens.d.ts +25 -0
- package/dist/examples/locks/burn-tokens.d.ts.map +1 -0
- package/dist/examples/locks/lock-unlock-workflow.d.ts +20 -0
- package/dist/examples/locks/lock-unlock-workflow.d.ts.map +1 -0
- package/dist/examples/messages/messages-lifecycle.d.ts +37 -0
- package/dist/examples/messages/messages-lifecycle.d.ts.map +1 -0
- package/dist/examples/messages/messages-pinning.d.ts +37 -0
- package/dist/examples/messages/messages-pinning.d.ts.map +1 -0
- package/dist/examples/moderators/claim-invite.d.ts +28 -0
- package/dist/examples/moderators/claim-invite.d.ts.map +1 -0
- package/dist/examples/moderators/invite-management.d.ts +30 -0
- package/dist/examples/moderators/invite-management.d.ts.map +1 -0
- package/dist/examples/moderators/moderated-tokens-portfolio.d.ts +18 -0
- package/dist/examples/moderators/moderated-tokens-portfolio.d.ts.map +1 -0
- package/dist/examples/monitoring/demo-stream-events.d.ts +17 -0
- package/dist/examples/monitoring/demo-stream-events.d.ts.map +1 -0
- package/dist/examples/monitoring/demo-watch-pools.d.ts +18 -0
- package/dist/examples/monitoring/demo-watch-pools.d.ts.map +1 -0
- package/dist/examples/monitoring/demo-watch-tokens.d.ts +18 -0
- package/dist/examples/monitoring/demo-watch-tokens.d.ts.map +1 -0
- package/dist/examples/monitoring/fees-collection-e2e.d.ts +36 -0
- package/dist/examples/monitoring/fees-collection-e2e.d.ts.map +1 -0
- package/dist/examples/monitoring/fees-collection-guaranteed.d.ts +49 -0
- package/dist/examples/monitoring/fees-collection-guaranteed.d.ts.map +1 -0
- package/dist/examples/monitoring/liquidity-e2e-test.d.ts +15 -0
- package/dist/examples/monitoring/liquidity-e2e-test.d.ts.map +1 -0
- package/dist/examples/monitoring/liquidity-monitor.d.ts +17 -0
- package/dist/examples/monitoring/liquidity-monitor.d.ts.map +1 -0
- package/dist/examples/monitoring/pool-creation-integration.d.ts +27 -0
- package/dist/examples/monitoring/pool-creation-integration.d.ts.map +1 -0
- package/dist/examples/monitoring/pool-liquidity-tracker.d.ts +15 -0
- package/dist/examples/monitoring/pool-liquidity-tracker.d.ts.map +1 -0
- package/dist/examples/monitoring/subscribe-liquidity-added.d.ts +30 -0
- package/dist/examples/monitoring/subscribe-liquidity-added.d.ts.map +1 -0
- package/dist/examples/monitoring/subscribe-liquidity-removed.d.ts +30 -0
- package/dist/examples/monitoring/subscribe-liquidity-removed.d.ts.map +1 -0
- package/dist/examples/monitoring/subscribe-pool-creations.d.ts +29 -0
- package/dist/examples/monitoring/subscribe-pool-creations.d.ts.map +1 -0
- package/dist/examples/monitoring/subscribe-token-creations.d.ts +21 -0
- package/dist/examples/monitoring/subscribe-token-creations.d.ts.map +1 -0
- package/dist/examples/monitoring/token-creation-integration.d.ts +32 -0
- package/dist/examples/monitoring/token-creation-integration.d.ts.map +1 -0
- package/dist/examples/monitoring/websocket-event-handlers.d.ts +22 -0
- package/dist/examples/monitoring/websocket-event-handlers.d.ts.map +1 -0
- package/dist/examples/nft/demo-collection-management.d.ts +13 -0
- package/dist/examples/nft/demo-collection-management.d.ts.map +1 -0
- package/dist/examples/nft/demo-fee-calculations.d.ts +14 -0
- package/dist/examples/nft/demo-fee-calculations.d.ts.map +1 -0
- package/dist/examples/nft/demo-minting.d.ts +13 -0
- package/dist/examples/nft/demo-minting.d.ts.map +1 -0
- package/dist/examples/nft/demo-portfolio-query.d.ts +14 -0
- package/dist/examples/nft/demo-portfolio-query.d.ts.map +1 -0
- package/dist/examples/nft/nft-collection-lifecycle.d.ts +22 -0
- package/dist/examples/nft/nft-collection-lifecycle.d.ts.map +1 -0
- package/dist/examples/nft/nft-data-queries.d.ts +22 -0
- package/dist/examples/nft/nft-data-queries.d.ts.map +1 -0
- package/dist/examples/nft/nft-fee-estimation.d.ts +23 -0
- package/dist/examples/nft/nft-fee-estimation.d.ts.map +1 -0
- package/dist/examples/nft/nft-token-creation.d.ts +22 -0
- package/dist/examples/nft/nft-token-creation.d.ts.map +1 -0
- package/dist/examples/nft/nft-utilities.d.ts +23 -0
- package/dist/examples/nft/nft-utilities.d.ts.map +1 -0
- package/dist/examples/orchestrator-master.d.ts +22 -0
- package/dist/examples/orchestrator-master.d.ts.map +1 -0
- package/dist/examples/orchestrator-tasks.d.ts +38 -0
- package/dist/examples/orchestrator-tasks.d.ts.map +1 -0
- package/dist/examples/overseers/claim-invite.d.ts +31 -0
- package/dist/examples/overseers/claim-invite.d.ts.map +1 -0
- package/dist/examples/overseers/demo-list-users.d.ts +19 -0
- package/dist/examples/overseers/demo-list-users.d.ts.map +1 -0
- package/dist/examples/overseers/direct-promotion.d.ts +39 -0
- package/dist/examples/overseers/direct-promotion.d.ts.map +1 -0
- package/dist/examples/overseers/invite-management.d.ts +38 -0
- package/dist/examples/overseers/invite-management.d.ts.map +1 -0
- package/dist/examples/overseers/restricted-names-management.d.ts +27 -0
- package/dist/examples/overseers/restricted-names-management.d.ts.map +1 -0
- package/dist/examples/performance/caching-strategies-advanced.d.ts +28 -0
- package/dist/examples/performance/caching-strategies-advanced.d.ts.map +1 -0
- package/dist/examples/performance/performance-optimization-patterns.d.ts +28 -0
- package/dist/examples/performance/performance-optimization-patterns.d.ts.map +1 -0
- package/dist/examples/persistence/data-backup-recovery.d.ts +119 -0
- package/dist/examples/persistence/data-backup-recovery.d.ts.map +1 -0
- package/dist/examples/persistence/local-storage-patterns.d.ts +86 -0
- package/dist/examples/persistence/local-storage-patterns.d.ts.map +1 -0
- package/dist/examples/queries/advanced-sorting.d.ts +28 -0
- package/dist/examples/queries/advanced-sorting.d.ts.map +1 -0
- package/dist/examples/queries/complex-filtering.d.ts +27 -0
- package/dist/examples/queries/complex-filtering.d.ts.map +1 -0
- package/dist/examples/security/security-audit-trail.d.ts +42 -0
- package/dist/examples/security/security-audit-trail.d.ts.map +1 -0
- package/dist/examples/security/security-content-moderation-advanced.d.ts +42 -0
- package/dist/examples/security/security-content-moderation-advanced.d.ts.map +1 -0
- package/dist/examples/security/security-token-safety-checks.d.ts +41 -0
- package/dist/examples/security/security-token-safety-checks.d.ts.map +1 -0
- package/dist/examples/security/security-user-restrictions-advanced.d.ts +42 -0
- package/dist/examples/security/security-user-restrictions-advanced.d.ts.map +1 -0
- package/dist/examples/site-config-demo.d.ts +20 -0
- package/dist/examples/site-config-demo.d.ts.map +1 -0
- package/dist/examples/streaming/admin-controls.d.ts +30 -0
- package/dist/examples/streaming/admin-controls.d.ts.map +1 -0
- package/dist/examples/streaming/advanced-stream-demo.d.ts +28 -0
- package/dist/examples/streaming/advanced-stream-demo.d.ts.map +1 -0
- package/dist/examples/streaming/basic-stream.d.ts +17 -0
- package/dist/examples/streaming/basic-stream.d.ts.map +1 -0
- package/dist/examples/streaming/demo-countdown.d.ts +16 -0
- package/dist/examples/streaming/demo-countdown.d.ts.map +1 -0
- package/dist/examples/streaming/demo-get-stream-credentials.d.ts +29 -0
- package/dist/examples/streaming/demo-get-stream-credentials.d.ts.map +1 -0
- package/dist/examples/streaming/demo-platform-config.d.ts +20 -0
- package/dist/examples/streaming/demo-platform-config.d.ts.map +1 -0
- package/dist/examples/streaming/engagement-stats.d.ts +25 -0
- package/dist/examples/streaming/engagement-stats.d.ts.map +1 -0
- package/dist/examples/streaming/recordings.d.ts +16 -0
- package/dist/examples/streaming/recordings.d.ts.map +1 -0
- package/dist/examples/streaming/simulcast.d.ts +19 -0
- package/dist/examples/streaming/simulcast.d.ts.map +1 -0
- package/dist/examples/streaming/stream-access-control.d.ts +30 -0
- package/dist/examples/streaming/stream-access-control.d.ts.map +1 -0
- package/dist/examples/streaming/stream-control.d.ts +25 -0
- package/dist/examples/streaming/stream-control.d.ts.map +1 -0
- package/dist/examples/streaming/stream-countdown.d.ts +31 -0
- package/dist/examples/streaming/stream-countdown.d.ts.map +1 -0
- package/dist/examples/streaming/stream-enable-disable.d.ts +31 -0
- package/dist/examples/streaming/stream-enable-disable.d.ts.map +1 -0
- package/dist/examples/streaming/stream-key-management.d.ts +21 -0
- package/dist/examples/streaming/stream-key-management.d.ts.map +1 -0
- package/dist/examples/streaming/stream-recording-management.d.ts +29 -0
- package/dist/examples/streaming/stream-recording-management.d.ts.map +1 -0
- package/dist/examples/streaming/stream-simulcast-multi-platform.d.ts +38 -0
- package/dist/examples/streaming/stream-simulcast-multi-platform.d.ts.map +1 -0
- package/dist/examples/streaming/stream-viewer-analytics.d.ts +43 -0
- package/dist/examples/streaming/stream-viewer-analytics.d.ts.map +1 -0
- package/dist/examples/streaming/streaming-lifecycle.d.ts +26 -0
- package/dist/examples/streaming/streaming-lifecycle.d.ts.map +1 -0
- package/dist/examples/streaming-premium/stream-monetization-setup.d.ts +47 -0
- package/dist/examples/streaming-premium/stream-monetization-setup.d.ts.map +1 -0
- package/dist/examples/streaming-premium/stream-revenue-analytics.d.ts +56 -0
- package/dist/examples/streaming-premium/stream-revenue-analytics.d.ts.map +1 -0
- package/dist/examples/streaming-premium/stream-vip-management.d.ts +56 -0
- package/dist/examples/streaming-premium/stream-vip-management.d.ts.map +1 -0
- package/dist/examples/swap-monitoring/arbitrage-monitor.d.ts +20 -0
- package/dist/examples/swap-monitoring/arbitrage-monitor.d.ts.map +1 -0
- package/dist/examples/swap-monitoring/e2e-trading-demo.d.ts +50 -0
- package/dist/examples/swap-monitoring/e2e-trading-demo.d.ts.map +1 -0
- package/dist/examples/swap-monitoring/health-monitor.d.ts +10 -0
- package/dist/examples/swap-monitoring/health-monitor.d.ts.map +1 -0
- package/dist/examples/swap-monitoring/volume-monitor.d.ts +20 -0
- package/dist/examples/swap-monitoring/volume-monitor.d.ts.map +1 -0
- package/dist/examples/testing/demo-test-runner.d.ts +33 -0
- package/dist/examples/testing/demo-test-runner.d.ts.map +1 -0
- package/dist/examples/testing/error-classifier.d.ts +23 -0
- package/dist/examples/testing/error-classifier.d.ts.map +1 -0
- package/dist/examples/testing/index.d.ts +14 -0
- package/dist/examples/testing/index.d.ts.map +1 -0
- package/dist/examples/testing/memory-manager.d.ts +31 -0
- package/dist/examples/testing/memory-manager.d.ts.map +1 -0
- package/dist/examples/testing/report-generator.d.ts +31 -0
- package/dist/examples/testing/report-generator.d.ts.map +1 -0
- package/dist/examples/testing/test-result-types.d.ts +158 -0
- package/dist/examples/testing/test-result-types.d.ts.map +1 -0
- package/dist/examples/token-bans/token-ban-management.d.ts +32 -0
- package/dist/examples/token-bans/token-ban-management.d.ts.map +1 -0
- package/dist/examples/token-creation/token-launch-complete.d.ts +20 -0
- package/dist/examples/token-creation/token-launch-complete.d.ts.map +1 -0
- package/dist/examples/token-creation/token-validation-comprehensive.d.ts +22 -0
- package/dist/examples/token-creation/token-validation-comprehensive.d.ts.map +1 -0
- package/dist/examples/token-info/token-name-resolution.d.ts +30 -0
- package/dist/examples/token-info/token-name-resolution.d.ts.map +1 -0
- package/dist/examples/token-info/token-operations-comprehensive.d.ts +22 -0
- package/dist/examples/token-info/token-operations-comprehensive.d.ts.map +1 -0
- package/dist/examples/token-metadata/token-description-versioning.d.ts +33 -0
- package/dist/examples/token-metadata/token-description-versioning.d.ts.map +1 -0
- package/dist/examples/token-metadata/token-image-management.d.ts +34 -0
- package/dist/examples/token-metadata/token-image-management.d.ts.map +1 -0
- package/dist/examples/token-metadata/token-social-links-management.d.ts +34 -0
- package/dist/examples/token-metadata/token-social-links-management.d.ts.map +1 -0
- package/dist/examples/trading/buy-sell-aliases.d.ts +20 -0
- package/dist/examples/trading/buy-sell-aliases.d.ts.map +1 -0
- package/dist/examples/trading/volume-data-demo.d.ts +20 -0
- package/dist/examples/trading/volume-data-demo.d.ts.map +1 -0
- package/dist/examples/trading-advanced/dollar-cost-averaging.d.ts +35 -0
- package/dist/examples/trading-advanced/dollar-cost-averaging.d.ts.map +1 -0
- package/dist/examples/trading-advanced/limit-orders-advanced.d.ts +34 -0
- package/dist/examples/trading-advanced/limit-orders-advanced.d.ts.map +1 -0
- package/dist/examples/trading-advanced/stop-loss-orders.d.ts +34 -0
- package/dist/examples/trading-advanced/stop-loss-orders.d.ts.map +1 -0
- package/dist/examples/trading-advanced/trading-history-analysis.d.ts +35 -0
- package/dist/examples/trading-advanced/trading-history-analysis.d.ts.map +1 -0
- package/dist/examples/users/balance-queries.d.ts +28 -0
- package/dist/examples/users/balance-queries.d.ts.map +1 -0
- package/dist/examples/users/fetch-user-balances.d.ts +19 -0
- package/dist/examples/users/fetch-user-balances.d.ts.map +1 -0
- package/dist/examples/users/fetch-user-report.d.ts +21 -0
- package/dist/examples/users/fetch-user-report.d.ts.map +1 -0
- package/dist/examples/users/profile-images.d.ts +24 -0
- package/dist/examples/users/profile-images.d.ts.map +1 -0
- package/dist/examples/users/profile-management.d.ts +22 -0
- package/dist/examples/users/profile-management.d.ts.map +1 -0
- package/dist/examples/users/referrals-comprehensive.d.ts +26 -0
- package/dist/examples/users/referrals-comprehensive.d.ts.map +1 -0
- package/dist/examples/users/wallet-balances-external.d.ts +28 -0
- package/dist/examples/users/wallet-balances-external.d.ts.map +1 -0
- package/dist/examples/utilities/account.d.ts +19 -0
- package/dist/examples/utilities/account.d.ts.map +1 -0
- package/dist/examples/utilities/balance.d.ts +5 -0
- package/dist/examples/utilities/balance.d.ts.map +1 -0
- package/dist/examples/utilities/balances.d.ts +7 -0
- package/dist/examples/utilities/balances.d.ts.map +1 -0
- package/dist/examples/utilities/demo-cache.d.ts +13 -0
- package/dist/examples/utilities/demo-cache.d.ts.map +1 -0
- package/dist/examples/utilities/demo-token-supply.d.ts +14 -0
- package/dist/examples/utilities/demo-token-supply.d.ts.map +1 -0
- package/dist/examples/utilities/key-derivation.d.ts +12 -0
- package/dist/examples/utilities/key-derivation.d.ts.map +1 -0
- package/dist/examples/utilities/multi-token-portfolio.d.ts +18 -0
- package/dist/examples/utilities/multi-token-portfolio.d.ts.map +1 -0
- package/dist/examples/utilities/pool-discovery-advanced.d.ts +36 -0
- package/dist/examples/utilities/pool-discovery-advanced.d.ts.map +1 -0
- package/dist/examples/utilities/pool-pair-analysis.d.ts +37 -0
- package/dist/examples/utilities/pool-pair-analysis.d.ts.map +1 -0
- package/dist/examples/utilities/price-history.d.ts +22 -0
- package/dist/examples/utilities/price-history.d.ts.map +1 -0
- package/dist/examples/utilities/referrals.d.ts +21 -0
- package/dist/examples/utilities/referrals.d.ts.map +1 -0
- package/dist/examples/utilities/token-classification.d.ts +38 -0
- package/dist/examples/utilities/token-classification.d.ts.map +1 -0
- package/dist/examples/utilities/token-discovery.d.ts +26 -0
- package/dist/examples/utilities/token-discovery.d.ts.map +1 -0
- package/dist/examples/utilities/token-metadata-advanced.d.ts +37 -0
- package/dist/examples/utilities/token-metadata-advanced.d.ts.map +1 -0
- package/dist/examples/utilities/token-validation-complete.d.ts +41 -0
- package/dist/examples/utilities/token-validation-complete.d.ts.map +1 -0
- package/dist/examples/utilities/trade-history.d.ts +19 -0
- package/dist/examples/utilities/trade-history.d.ts.map +1 -0
- package/dist/examples/utilities/transfers.d.ts +29 -0
- package/dist/examples/utilities/transfers.d.ts.map +1 -0
- package/dist/examples/utilities/validation-and-error-handling.d.ts +27 -0
- package/dist/examples/utilities/validation-and-error-handling.d.ts.map +1 -0
- package/dist/examples/utilities/wrappable-tokens.d.ts +27 -0
- package/dist/examples/utilities/wrappable-tokens.d.ts.map +1 -0
- package/dist/examples/utility/auth-utilities.d.ts +30 -0
- package/dist/examples/utility/auth-utilities.d.ts.map +1 -0
- package/dist/examples/utility/pool-utilities.d.ts +29 -0
- package/dist/examples/utility/pool-utilities.d.ts.map +1 -0
- package/dist/examples/utility/sdk-configuration.d.ts +29 -0
- package/dist/examples/utility/sdk-configuration.d.ts.map +1 -0
- package/dist/examples/utility/wallet-management-advanced.d.ts +32 -0
- package/dist/examples/utility/wallet-management-advanced.d.ts.map +1 -0
- package/dist/examples/utils/auth-bootstrap.d.ts +123 -0
- package/dist/examples/utils/auth-bootstrap.d.ts.map +1 -0
- package/dist/examples/utils/balance-checking.d.ts +158 -0
- package/dist/examples/utils/balance-checking.d.ts.map +1 -0
- package/dist/examples/utils/bridge-formatters.d.ts +188 -0
- package/dist/examples/utils/bridge-formatters.d.ts.map +1 -0
- package/dist/examples/utils/bridge-setup.d.ts +235 -0
- package/dist/examples/utils/bridge-setup.d.ts.map +1 -0
- package/dist/examples/utils/bridge-transaction-logger.d.ts +42 -0
- package/dist/examples/utils/bridge-transaction-logger.d.ts.map +1 -0
- package/dist/examples/utils/cli-input.d.ts +41 -0
- package/dist/examples/utils/cli-input.d.ts.map +1 -0
- package/dist/examples/utils/demo-config.d.ts +155 -0
- package/dist/examples/utils/demo-config.d.ts.map +1 -0
- package/dist/examples/utils/demo-registry.d.ts +155 -0
- package/dist/examples/utils/demo-registry.d.ts.map +1 -0
- package/dist/examples/utils/error-handler.d.ts +85 -0
- package/dist/examples/utils/error-handler.d.ts.map +1 -0
- package/dist/examples/utils/formatting.d.ts +195 -0
- package/dist/examples/utils/formatting.d.ts.map +1 -0
- package/dist/examples/utils/get-environment.d.ts +17 -0
- package/dist/examples/utils/get-environment.d.ts.map +1 -0
- package/dist/examples/utils/index.d.ts +44 -0
- package/dist/examples/utils/index.d.ts.map +1 -0
- package/dist/examples/utils/indexing.d.ts +48 -0
- package/dist/examples/utils/indexing.d.ts.map +1 -0
- package/dist/examples/utils/load-env.d.ts +90 -0
- package/dist/examples/utils/load-env.d.ts.map +1 -0
- package/dist/examples/utils/logger.d.ts +52 -0
- package/dist/examples/utils/logger.d.ts.map +1 -0
- package/dist/examples/utils/pool-helpers.d.ts +226 -0
- package/dist/examples/utils/pool-helpers.d.ts.map +1 -0
- package/dist/examples/utils/punchlist.d.ts +104 -0
- package/dist/examples/utils/punchlist.d.ts.map +1 -0
- package/dist/examples/utils/sdk-setup.d.ts +423 -0
- package/dist/examples/utils/sdk-setup.d.ts.map +1 -0
- package/dist/examples/utils/suppress-logging.d.ts +11 -0
- package/dist/examples/utils/suppress-logging.d.ts.map +1 -0
- package/dist/examples/utils/token-naming.d.ts +117 -0
- package/dist/examples/utils/token-naming.d.ts.map +1 -0
- package/dist/examples/utils/trade-helpers.d.ts +195 -0
- package/dist/examples/utils/trade-helpers.d.ts.map +1 -0
- package/dist/examples/utils/transaction-helpers.d.ts +92 -0
- package/dist/examples/utils/transaction-helpers.d.ts.map +1 -0
- package/dist/examples/wallet/wallet-initialization-complete.d.ts +31 -0
- package/dist/examples/wallet/wallet-initialization-complete.d.ts.map +1 -0
- package/dist/examples/wallet/wallet-key-rotation.d.ts +28 -0
- package/dist/examples/wallet/wallet-key-rotation.d.ts.map +1 -0
- package/dist/examples/wallet/wallet-recovery-patterns.d.ts +29 -0
- package/dist/examples/wallet/wallet-recovery-patterns.d.ts.map +1 -0
- package/dist/examples/wallet/wallet-signature-operations.d.ts +28 -0
- package/dist/examples/wallet/wallet-signature-operations.d.ts.map +1 -0
- package/dist/examples/wallet-tracking/wallet-balance-monitoring.d.ts +21 -0
- package/dist/examples/wallet-tracking/wallet-balance-monitoring.d.ts.map +1 -0
- package/dist/examples/wallet-tracking/wallet-portfolio-alerts.d.ts +21 -0
- package/dist/examples/wallet-tracking/wallet-portfolio-alerts.d.ts.map +1 -0
- package/dist/examples/wallet-tracking/wallet-transaction-tracking.d.ts +21 -0
- package/dist/examples/wallet-tracking/wallet-transaction-tracking.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-chat-advanced.d.ts +26 -0
- package/dist/examples/websocket/websocket-chat-advanced.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-chat-events-detailed.d.ts +28 -0
- package/dist/examples/websocket/websocket-chat-events-detailed.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-chat-events.d.ts +26 -0
- package/dist/examples/websocket/websocket-chat-events.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-combined-events.d.ts +28 -0
- package/dist/examples/websocket/websocket-combined-events.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-comprehensive.d.ts +25 -0
- package/dist/examples/websocket/websocket-comprehensive.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-connected-clients.d.ts +30 -0
- package/dist/examples/websocket/websocket-connected-clients.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-connection-management.d.ts +28 -0
- package/dist/examples/websocket/websocket-connection-management.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-content-events.d.ts +28 -0
- package/dist/examples/websocket/websocket-content-events.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-core-events.d.ts +27 -0
- package/dist/examples/websocket/websocket-core-events.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-dex-events.d.ts +40 -0
- package/dist/examples/websocket/websocket-dex-events.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-dex-pools.d.ts +23 -0
- package/dist/examples/websocket/websocket-dex-pools.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-download-recording.d.ts +26 -0
- package/dist/examples/websocket/websocket-download-recording.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-interactions.d.ts +25 -0
- package/dist/examples/websocket/websocket-interactions.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-moderation-events.d.ts +26 -0
- package/dist/examples/websocket/websocket-moderation-events.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-recording-events.d.ts +24 -0
- package/dist/examples/websocket/websocket-recording-events.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-room-events.d.ts +27 -0
- package/dist/examples/websocket/websocket-room-events.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-room-management.d.ts +27 -0
- package/dist/examples/websocket/websocket-room-management.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-simulcast-events.d.ts +26 -0
- package/dist/examples/websocket/websocket-simulcast-events.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-stream-auth.d.ts +23 -0
- package/dist/examples/websocket/websocket-stream-auth.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-stream-countdown.d.ts +38 -0
- package/dist/examples/websocket/websocket-stream-countdown.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-stream-events.d.ts +26 -0
- package/dist/examples/websocket/websocket-stream-events.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-stream-status.d.ts +39 -0
- package/dist/examples/websocket/websocket-stream-status.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-subscription-management.d.ts +27 -0
- package/dist/examples/websocket/websocket-subscription-management.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-token-creation-events.d.ts +22 -0
- package/dist/examples/websocket/websocket-token-creation-events.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-token-events.d.ts +24 -0
- package/dist/examples/websocket/websocket-token-events.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-token-subscription.d.ts +26 -0
- package/dist/examples/websocket/websocket-token-subscription.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-token-viewers.d.ts +29 -0
- package/dist/examples/websocket/websocket-token-viewers.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-unsubscribe.d.ts +25 -0
- package/dist/examples/websocket/websocket-unsubscribe.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-user-events.d.ts +40 -0
- package/dist/examples/websocket/websocket-user-events.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-user-presence.d.ts +29 -0
- package/dist/examples/websocket/websocket-user-presence.d.ts.map +1 -0
- package/dist/examples/websocket/websocket-viewer-analytics.d.ts +38 -0
- package/dist/examples/websocket/websocket-viewer-analytics.d.ts.map +1 -0
- package/dist/examples/wrap/wrap-status-tracking.d.ts +19 -0
- package/dist/examples/wrap/wrap-status-tracking.d.ts.map +1 -0
- package/dist/examples/wrap/wrap-token-discovery.d.ts +20 -0
- package/dist/examples/wrap/wrap-token-discovery.d.ts.map +1 -0
- package/dist/helpers/sdk.d.ts +87 -0
- package/dist/helpers/sdk.d.ts.map +1 -0
- package/dist/helpers/wallet.d.ts +151 -0
- package/dist/helpers/wallet.d.ts.map +1 -0
- package/dist/index.browser.d.ts +147 -0
- package/dist/index.browser.d.ts.map +1 -0
- package/dist/index.browser.esm.js +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.ts +6 -115
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.node.d.ts +13 -0
- package/dist/index.node.d.ts.map +1 -0
- package/dist/polyfills/file-global.d.ts +12 -0
- package/dist/polyfills/file-global.d.ts.map +1 -0
- package/dist/react/WalletContext.d.ts +60 -0
- package/dist/react/WalletContext.d.ts.map +1 -0
- package/dist/react/index.d.ts +65 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/types.d.ts +76 -0
- package/dist/react/types.d.ts.map +1 -0
- package/dist/react/useWallet.d.ts +123 -0
- package/dist/react/useWallet.d.ts.map +1 -0
- package/dist/react/useWalletConnection.d.ts +89 -0
- package/dist/react/useWalletConnection.d.ts.map +1 -0
- package/dist/react/useWalletDetection.d.ts +81 -0
- package/dist/react/useWalletDetection.d.ts.map +1 -0
- package/dist/react.cjs +1 -0
- package/dist/react.esm.js +1 -0
- package/dist/schemas/files.d.ts +83 -0
- package/dist/schemas/files.d.ts.map +1 -0
- package/dist/schemas/index.d.ts +83 -0
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/launchpad.d.ts +135 -0
- package/dist/schemas/launchpad.d.ts.map +1 -0
- package/dist/schemas/pagination.d.ts +107 -0
- package/dist/schemas/pagination.d.ts.map +1 -0
- package/dist/schemas/primitives.d.ts +142 -0
- package/dist/schemas/primitives.d.ts.map +1 -0
- package/dist/schemas/trade.d.ts +140 -0
- package/dist/schemas/trade.d.ts.map +1 -0
- package/dist/schemas/user.d.ts +99 -0
- package/dist/schemas/user.d.ts.map +1 -0
- package/dist/schemas/validators.d.ts +332 -0
- package/dist/schemas/validators.d.ts.map +1 -0
- package/dist/scripts/derive-public-key-from-private-key.d.ts +8 -0
- package/dist/scripts/derive-public-key-from-private-key.d.ts.map +1 -0
- package/dist/scripts/eslint-fixer.d.ts +7 -0
- package/dist/scripts/eslint-fixer.d.ts.map +1 -0
- package/dist/scripts/final-fixer.d.ts +7 -0
- package/dist/scripts/final-fixer.d.ts.map +1 -0
- package/dist/scripts/fix-all-remaining-boolean.d.ts +7 -0
- package/dist/scripts/fix-all-remaining-boolean.d.ts.map +1 -0
- package/dist/scripts/fix-boolean-expressions-advanced.d.ts +7 -0
- package/dist/scripts/fix-boolean-expressions-advanced.d.ts.map +1 -0
- package/dist/scripts/fix-boolean-expressions-ast.d.ts +9 -0
- package/dist/scripts/fix-boolean-expressions-ast.d.ts.map +1 -0
- package/dist/scripts/fix-boolean-expressions-auto.d.ts +7 -0
- package/dist/scripts/fix-boolean-expressions-auto.d.ts.map +1 -0
- package/dist/scripts/fix-final-aggressive.d.ts +6 -0
- package/dist/scripts/fix-final-aggressive.d.ts.map +1 -0
- package/dist/scripts/fix-final-boolean.d.ts +7 -0
- package/dist/scripts/fix-final-boolean.d.ts.map +1 -0
- package/dist/scripts/fix-remaining-boolean.d.ts +7 -0
- package/dist/scripts/fix-remaining-boolean.d.ts.map +1 -0
- package/dist/scripts/fix-strict-boolean-comprehensive.d.ts +3 -0
- package/dist/scripts/fix-strict-boolean-comprehensive.d.ts.map +1 -0
- package/dist/scripts/fix-strict-boolean-expressions.d.ts +2 -0
- package/dist/scripts/fix-strict-boolean-expressions.d.ts.map +1 -0
- package/dist/scripts/fix-strict-boolean-final.d.ts +13 -0
- package/dist/scripts/fix-strict-boolean-final.d.ts.map +1 -0
- package/dist/scripts/fixer-aggressive.d.ts +7 -0
- package/dist/scripts/fixer-aggressive.d.ts.map +1 -0
- package/dist/scripts/fixer-conservative.d.ts +7 -0
- package/dist/scripts/fixer-conservative.d.ts.map +1 -0
- package/dist/scripts/fixer-direct.d.ts +7 -0
- package/dist/scripts/fixer-direct.d.ts.map +1 -0
- package/dist/scripts/generate-demo-registry.d.ts +14 -0
- package/dist/scripts/generate-demo-registry.d.ts.map +1 -0
- package/dist/scripts/inject-version.d.ts +8 -0
- package/dist/scripts/inject-version.d.ts.map +1 -0
- package/dist/scripts/strict-boolean-fixer.d.ts +9 -0
- package/dist/scripts/strict-boolean-fixer.d.ts.map +1 -0
- package/dist/scripts/validate-demo-registry.d.ts +17 -0
- package/dist/scripts/validate-demo-registry.d.ts.map +1 -0
- package/dist/services/AIModerationService.d.ts +217 -0
- package/dist/services/AIModerationService.d.ts.map +1 -0
- package/dist/services/AbstractCacheService.d.ts +227 -0
- package/dist/services/AbstractCacheService.d.ts.map +1 -0
- package/dist/services/AbstractTokenFetchService.d.ts +150 -0
- package/dist/services/AbstractTokenFetchService.d.ts.map +1 -0
- package/dist/services/ApiKeyService.d.ts +211 -0
- package/dist/services/ApiKeyService.d.ts.map +1 -0
- package/dist/services/BanService.d.ts +312 -0
- package/dist/services/BanService.d.ts.map +1 -0
- package/dist/services/BaseService.d.ts +116 -0
- package/dist/services/BaseService.d.ts.map +1 -0
- package/dist/services/BatchedCacheService.d.ts +133 -0
- package/dist/services/BatchedCacheService.d.ts.map +1 -0
- package/dist/services/BridgeableTokenCache.d.ts +120 -0
- package/dist/services/BridgeableTokenCache.d.ts.map +1 -0
- package/dist/services/BridgeableTokenService.d.ts +218 -0
- package/dist/services/BridgeableTokenService.d.ts.map +1 -0
- package/dist/services/BundleService.d.ts +245 -0
- package/dist/services/BundleService.d.ts.map +1 -0
- package/dist/services/BundlerClientFactory.d.ts +32 -0
- package/dist/services/BundlerClientFactory.d.ts.map +1 -0
- package/dist/services/ChartService.d.ts +106 -0
- package/dist/services/ChartService.d.ts.map +1 -0
- package/dist/services/ContentFlagService.d.ts +218 -0
- package/dist/services/ContentFlagService.d.ts.map +1 -0
- package/dist/services/ContentReactionService.d.ts +175 -0
- package/dist/services/ContentReactionService.d.ts.map +1 -0
- package/dist/services/DexBackendClient.d.ts +225 -0
- package/dist/services/DexBackendClient.d.ts.map +1 -0
- package/dist/services/DexPoolService.d.ts +137 -0
- package/dist/services/DexPoolService.d.ts.map +1 -0
- package/dist/services/DexQuoteService.d.ts +446 -0
- package/dist/services/DexQuoteService.d.ts.map +1 -0
- package/dist/services/DexService.d.ts +433 -0
- package/dist/services/DexService.d.ts.map +1 -0
- package/dist/services/EventsBatcherService.d.ts +111 -0
- package/dist/services/EventsBatcherService.d.ts.map +1 -0
- package/dist/services/GSwapAssetService.d.ts +96 -0
- package/dist/services/GSwapAssetService.d.ts.map +1 -0
- package/dist/services/GSwapLiquidityMutationService.d.ts +138 -0
- package/dist/services/GSwapLiquidityMutationService.d.ts.map +1 -0
- package/dist/services/GSwapLiquidityQueryService.d.ts +75 -0
- package/dist/services/GSwapLiquidityQueryService.d.ts.map +1 -0
- package/dist/services/GSwapPoolCalculationService.d.ts +187 -0
- package/dist/services/GSwapPoolCalculationService.d.ts.map +1 -0
- package/dist/services/GSwapPoolQueryService.d.ts +115 -0
- package/dist/services/GSwapPoolQueryService.d.ts.map +1 -0
- package/dist/services/GSwapService.d.ts +1207 -0
- package/dist/services/GSwapService.d.ts.map +1 -0
- package/dist/services/GSwapSwapService.d.ts +68 -0
- package/dist/services/GSwapSwapService.d.ts.map +1 -0
- package/dist/services/GalaChainBalanceService.d.ts +155 -0
- package/dist/services/GalaChainBalanceService.d.ts.map +1 -0
- package/dist/services/GalaChainGatewayClient.d.ts +227 -0
- package/dist/services/GalaChainGatewayClient.d.ts.map +1 -0
- package/dist/services/GalaChainLockService.d.ts +144 -0
- package/dist/services/GalaChainLockService.d.ts.map +1 -0
- package/dist/services/GalaChainService.d.ts +399 -0
- package/dist/services/GalaChainService.d.ts.map +1 -0
- package/dist/services/GalaChainTokenService.d.ts +108 -0
- package/dist/services/GalaChainTokenService.d.ts.map +1 -0
- package/dist/services/GalaChainTransferService.d.ts +205 -0
- package/dist/services/GalaChainTransferService.d.ts.map +1 -0
- package/dist/services/HolderService.d.ts +181 -0
- package/dist/services/HolderService.d.ts.map +1 -0
- package/dist/services/ImageService.d.ts +173 -0
- package/dist/services/ImageService.d.ts.map +1 -0
- package/dist/services/LaunchpadService.d.ts +343 -0
- package/dist/services/LaunchpadService.d.ts.map +1 -0
- package/dist/services/MessagesService.d.ts +251 -0
- package/dist/services/MessagesService.d.ts.map +1 -0
- package/dist/services/ModeratorService.d.ts +311 -0
- package/dist/services/ModeratorService.d.ts.map +1 -0
- package/dist/services/MultiPoolStateManager.d.ts +289 -0
- package/dist/services/MultiPoolStateManager.d.ts.map +1 -0
- package/dist/services/NetworkKeyedCacheService.d.ts +185 -0
- package/dist/services/NetworkKeyedCacheService.d.ts.map +1 -0
- package/dist/services/NftCollectionService.d.ts +121 -0
- package/dist/services/NftCollectionService.d.ts.map +1 -0
- package/dist/services/OEmbedService.d.ts +152 -0
- package/dist/services/OEmbedService.d.ts.map +1 -0
- package/dist/services/OverseerService.d.ts +524 -0
- package/dist/services/OverseerService.d.ts.map +1 -0
- package/dist/services/PlatformConfigService.d.ts +149 -0
- package/dist/services/PlatformConfigService.d.ts.map +1 -0
- package/dist/services/PlatformStatsService.d.ts +72 -0
- package/dist/services/PlatformStatsService.d.ts.map +1 -0
- package/dist/services/PoolCacheManager.d.ts +258 -0
- package/dist/services/PoolCacheManager.d.ts.map +1 -0
- package/dist/services/PoolService.d.ts +316 -0
- package/dist/services/PoolService.d.ts.map +1 -0
- package/dist/services/PoolStateManager.d.ts +176 -0
- package/dist/services/PoolStateManager.d.ts.map +1 -0
- package/dist/services/PriceHistoryService.d.ts +207 -0
- package/dist/services/PriceHistoryService.d.ts.map +1 -0
- package/dist/services/RestrictedNamesService.d.ts +80 -0
- package/dist/services/RestrictedNamesService.d.ts.map +1 -0
- package/dist/services/SignatureService.d.ts +113 -0
- package/dist/services/SignatureService.d.ts.map +1 -0
- package/dist/services/StreamChatService.d.ts +259 -0
- package/dist/services/StreamChatService.d.ts.map +1 -0
- package/dist/services/StreamTokenServiceBase.d.ts +404 -0
- package/dist/services/StreamTokenServiceBase.d.ts.map +1 -0
- package/dist/services/StreamWebSocketService.d.ts +586 -0
- package/dist/services/StreamWebSocketService.d.ts.map +1 -0
- package/dist/services/StreamingEventService.d.ts +441 -0
- package/dist/services/StreamingEventService.d.ts.map +1 -0
- package/dist/services/StreamingService.d.ts +573 -0
- package/dist/services/StreamingService.d.ts.map +1 -0
- package/dist/services/SwapEventQueue.d.ts +192 -0
- package/dist/services/SwapEventQueue.d.ts.map +1 -0
- package/dist/services/TokenBanService.d.ts +217 -0
- package/dist/services/TokenBanService.d.ts.map +1 -0
- package/dist/services/TokenClassKeyService.d.ts +162 -0
- package/dist/services/TokenClassKeyService.d.ts.map +1 -0
- package/dist/services/TokenMetadataCache.d.ts +310 -0
- package/dist/services/TokenMetadataCache.d.ts.map +1 -0
- package/dist/services/TokenMetadataService.d.ts +509 -0
- package/dist/services/TokenMetadataService.d.ts.map +1 -0
- package/dist/services/TokenResolverService.d.ts +329 -0
- package/dist/services/TokenResolverService.d.ts.map +1 -0
- package/dist/services/TradeService.d.ts +286 -0
- package/dist/services/TradeService.d.ts.map +1 -0
- package/dist/services/TradingQuotesService.d.ts +162 -0
- package/dist/services/TradingQuotesService.d.ts.map +1 -0
- package/dist/services/UserService.d.ts +352 -0
- package/dist/services/UserService.d.ts.map +1 -0
- package/dist/services/WebSocketAdminService.d.ts +587 -0
- package/dist/services/WebSocketAdminService.d.ts.map +1 -0
- package/dist/services/WebSocketService.d.ts +189 -0
- package/dist/services/WebSocketService.d.ts.map +1 -0
- package/dist/services/WeeklyChallengeService.d.ts +114 -0
- package/dist/services/WeeklyChallengeService.d.ts.map +1 -0
- package/dist/services/WrapService.d.ts +172 -0
- package/dist/services/WrapService.d.ts.map +1 -0
- package/dist/services/WrappableTokenCache.d.ts +100 -0
- package/dist/services/WrappableTokenCache.d.ts.map +1 -0
- package/dist/services/WrappableTokenService.d.ts +130 -0
- package/dist/services/WrappableTokenService.d.ts.map +1 -0
- package/dist/services/__mocks__/logger.mock.d.ts +24 -0
- package/dist/services/__mocks__/logger.mock.d.ts.map +1 -0
- package/dist/services/shared/cache-helpers.d.ts +188 -0
- package/dist/services/shared/cache-helpers.d.ts.map +1 -0
- package/dist/services/shared/http-helpers.d.ts +146 -0
- package/dist/services/shared/http-helpers.d.ts.map +1 -0
- package/dist/services/shared/pagination-helpers.d.ts +167 -0
- package/dist/services/shared/pagination-helpers.d.ts.map +1 -0
- package/dist/services/shared/service-validators.d.ts +137 -0
- package/dist/services/shared/service-validators.d.ts.map +1 -0
- package/dist/services/shared/websocket-helpers.d.ts +158 -0
- package/dist/services/shared/websocket-helpers.d.ts.map +1 -0
- package/dist/setup.d.ts +8 -0
- package/dist/setup.d.ts.map +1 -0
- package/dist/src/LaunchpadSDK.d.ts +2192 -404
- package/dist/src/LaunchpadSDK.d.ts.map +1 -1
- package/dist/src/api/LaunchpadAPI.d.ts +15 -8
- package/dist/src/api/LaunchpadAPI.d.ts.map +1 -1
- package/dist/src/api/dto/BondingCurveDTOs.d.ts.map +1 -1
- package/dist/src/api/dto/BurnTokensDto.d.ts +1 -1
- package/dist/src/api/dto/BurnTokensDto.d.ts.map +1 -1
- package/dist/src/api/dto/LockTokenDto.d.ts +1 -1
- package/dist/src/api/dto/LockTokenDto.d.ts.map +1 -1
- package/dist/src/api/dto/TransferTokenDto.d.ts +1 -1
- package/dist/src/api/dto/TransferTokenDto.d.ts.map +1 -1
- package/dist/src/api/dto/UnlockTokenDto.d.ts +1 -1
- package/dist/src/api/dto/UnlockTokenDto.d.ts.map +1 -1
- package/dist/src/auth/JwtAuth.d.ts +43 -5
- package/dist/src/auth/JwtAuth.d.ts.map +1 -1
- package/dist/src/auth/SessionAuthService.d.ts +11 -6
- package/dist/src/auth/SessionAuthService.d.ts.map +1 -1
- package/dist/src/auth/SignatureAuth.d.ts +64 -3
- package/dist/src/auth/SignatureAuth.d.ts.map +1 -1
- package/dist/src/auth/storage.d.ts +66 -0
- package/dist/src/auth/storage.d.ts.map +1 -0
- package/dist/src/auth/types.d.ts +11 -2
- package/dist/src/auth/types.d.ts.map +1 -1
- package/dist/src/bridge/BridgeService.d.ts +1 -1
- package/dist/src/bridge/BridgeService.d.ts.map +1 -1
- package/dist/src/bridge/GalaConnectClient.d.ts +1 -1
- package/dist/src/bridge/GalaConnectClient.d.ts.map +1 -1
- package/dist/src/bridge/constants/tokens.d.ts +1 -1
- package/dist/src/bridge/constants/tokens.d.ts.map +1 -1
- package/dist/src/bridge/index.d.ts +10 -10
- package/dist/src/bridge/index.d.ts.map +1 -1
- package/dist/src/bridge/strategies/BridgeStrategy.d.ts.map +1 -1
- package/dist/src/bridge/strategies/EthereumBridgeStrategy.d.ts +1 -1
- package/dist/src/bridge/strategies/EthereumBridgeStrategy.d.ts.map +1 -1
- package/dist/src/bridge/strategies/SolanaBridgeStrategy.d.ts +1 -1
- package/dist/src/bridge/strategies/SolanaBridgeStrategy.d.ts.map +1 -1
- package/dist/src/bridge/utils/addressValidation.d.ts.map +1 -1
- package/dist/src/bridge/utils/balanceHelpers.d.ts +1 -1
- package/dist/src/bridge/utils/balanceHelpers.d.ts.map +1 -1
- package/dist/src/bridge/utils/bridgeErrors.d.ts.map +1 -1
- package/dist/src/bridge/utils/bridgeOutHelpers.d.ts +1 -1
- package/dist/src/bridge/utils/bridgeOutHelpers.d.ts.map +1 -1
- package/dist/src/bridge/utils/bridgePayload.d.ts +2 -11
- package/dist/src/bridge/utils/bridgePayload.d.ts.map +1 -1
- package/dist/src/bridge/utils/bridgeStatusParser.d.ts.map +1 -1
- package/dist/src/bridge/utils/eip712Helpers.d.ts.map +1 -1
- package/dist/src/bridge/utils/index.d.ts +9 -9
- package/dist/src/bridge/utils/index.d.ts.map +1 -1
- package/dist/src/bridge/utils/tokenIdUtils.d.ts +1 -1
- package/dist/src/bridge/utils/tokenIdUtils.d.ts.map +1 -1
- package/dist/src/bridge/utils/tokenMetadataResolver.d.ts +1 -1
- package/dist/src/bridge/utils/tokenMetadataResolver.d.ts.map +1 -1
- package/dist/src/config/environments.d.ts +1 -1
- package/dist/src/config/environments.d.ts.map +1 -1
- package/dist/src/constants/endpoints.d.ts +522 -260
- package/dist/src/constants/endpoints.d.ts.map +1 -1
- package/dist/src/constants/events.d.ts +53 -0
- package/dist/src/constants/events.d.ts.map +1 -0
- package/dist/src/constants/pagination.d.ts +23 -13
- package/dist/src/constants/pagination.d.ts.map +1 -1
- package/dist/src/constants/version.generated.d.ts +1 -1
- package/dist/src/constants/version.generated.d.ts.map +1 -1
- package/dist/src/helpers/sdk.d.ts.map +1 -1
- package/dist/src/helpers/wallet.d.ts.map +1 -1
- package/dist/src/index.browser.d.ts +147 -0
- package/dist/src/index.browser.d.ts.map +1 -0
- package/dist/src/index.d.ts +6 -115
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.node.d.ts +13 -0
- package/dist/src/index.node.d.ts.map +1 -0
- package/dist/src/react/WalletContext.d.ts +60 -0
- package/dist/src/react/WalletContext.d.ts.map +1 -0
- package/dist/src/react/index.d.ts +65 -0
- package/dist/src/react/index.d.ts.map +1 -0
- package/dist/src/react/types.d.ts +76 -0
- package/dist/src/react/types.d.ts.map +1 -0
- package/dist/src/react/useWallet.d.ts +123 -0
- package/dist/src/react/useWallet.d.ts.map +1 -0
- package/dist/src/react/useWalletConnection.d.ts +89 -0
- package/dist/src/react/useWalletConnection.d.ts.map +1 -0
- package/dist/src/react/useWalletDetection.d.ts +81 -0
- package/dist/src/react/useWalletDetection.d.ts.map +1 -0
- package/dist/src/schemas/files.d.ts.map +1 -1
- package/dist/src/schemas/index.d.ts +4 -3
- package/dist/src/schemas/index.d.ts.map +1 -1
- package/dist/src/schemas/launchpad.d.ts +1 -0
- package/dist/src/schemas/launchpad.d.ts.map +1 -1
- package/dist/src/schemas/pagination.d.ts +16 -19
- package/dist/src/schemas/pagination.d.ts.map +1 -1
- package/dist/src/schemas/primitives.d.ts +1 -1
- package/dist/src/schemas/primitives.d.ts.map +1 -1
- package/dist/src/schemas/trade.d.ts +2 -2
- package/dist/src/schemas/trade.d.ts.map +1 -1
- package/dist/src/schemas/user.d.ts +2 -2
- package/dist/src/schemas/user.d.ts.map +1 -1
- package/dist/src/schemas/validators.d.ts +6 -5
- package/dist/src/schemas/validators.d.ts.map +1 -1
- package/dist/src/services/AIModerationService.d.ts +217 -0
- package/dist/src/services/AIModerationService.d.ts.map +1 -0
- package/dist/src/services/AbstractTokenFetchService.d.ts +1 -1
- package/dist/src/services/AbstractTokenFetchService.d.ts.map +1 -1
- package/dist/src/services/ApiKeyService.d.ts +14 -9
- package/dist/src/services/ApiKeyService.d.ts.map +1 -1
- package/dist/src/services/BanService.d.ts +132 -16
- package/dist/src/services/BanService.d.ts.map +1 -1
- package/dist/src/services/BaseService.d.ts +1 -1
- package/dist/src/services/BaseService.d.ts.map +1 -1
- package/dist/src/services/BatchedCacheService.d.ts.map +1 -1
- package/dist/src/services/BridgeableTokenCache.d.ts +1 -1
- package/dist/src/services/BridgeableTokenCache.d.ts.map +1 -1
- package/dist/src/services/BridgeableTokenService.d.ts +4 -4
- package/dist/src/services/BridgeableTokenService.d.ts.map +1 -1
- package/dist/src/services/BundleService.d.ts +5 -5
- package/dist/src/services/BundleService.d.ts.map +1 -1
- package/dist/src/services/BundlerClientFactory.d.ts.map +1 -1
- package/dist/src/services/ChartService.d.ts +106 -0
- package/dist/src/services/ChartService.d.ts.map +1 -0
- package/dist/src/services/ContentFlagService.d.ts +13 -7
- package/dist/src/services/ContentFlagService.d.ts.map +1 -1
- package/dist/src/services/ContentReactionService.d.ts +3 -3
- package/dist/src/services/ContentReactionService.d.ts.map +1 -1
- package/dist/src/services/DexBackendClient.d.ts +1 -1
- package/dist/src/services/DexBackendClient.d.ts.map +1 -1
- package/dist/src/services/DexPoolService.d.ts +9 -11
- package/dist/src/services/DexPoolService.d.ts.map +1 -1
- package/dist/src/services/DexQuoteService.d.ts +5 -6
- package/dist/src/services/DexQuoteService.d.ts.map +1 -1
- package/dist/src/services/DexService.d.ts +6 -6
- package/dist/src/services/DexService.d.ts.map +1 -1
- package/dist/src/services/EventsBatcherService.d.ts +111 -0
- package/dist/src/services/EventsBatcherService.d.ts.map +1 -0
- package/dist/src/services/GSwapAssetService.d.ts +18 -2
- package/dist/src/services/GSwapAssetService.d.ts.map +1 -1
- package/dist/src/services/GSwapLiquidityMutationService.d.ts +4 -6
- package/dist/src/services/GSwapLiquidityMutationService.d.ts.map +1 -1
- package/dist/src/services/GSwapLiquidityQueryService.d.ts +2 -14
- package/dist/src/services/GSwapLiquidityQueryService.d.ts.map +1 -1
- package/dist/src/services/GSwapPoolCalculationService.d.ts +0 -13
- package/dist/src/services/GSwapPoolCalculationService.d.ts.map +1 -1
- package/dist/src/services/GSwapPoolQueryService.d.ts +2 -3
- package/dist/src/services/GSwapPoolQueryService.d.ts.map +1 -1
- package/dist/src/services/GSwapService.d.ts +11 -11
- package/dist/src/services/GSwapService.d.ts.map +1 -1
- package/dist/src/services/GSwapSwapService.d.ts +2 -2
- package/dist/src/services/GSwapSwapService.d.ts.map +1 -1
- package/dist/src/services/GalaChainBalanceService.d.ts +2 -2
- package/dist/src/services/GalaChainBalanceService.d.ts.map +1 -1
- package/dist/src/services/GalaChainGatewayClient.d.ts +3 -3
- package/dist/src/services/GalaChainGatewayClient.d.ts.map +1 -1
- package/dist/src/services/GalaChainLockService.d.ts +3 -3
- package/dist/src/services/GalaChainLockService.d.ts.map +1 -1
- package/dist/src/services/GalaChainService.d.ts +10 -13
- package/dist/src/services/GalaChainService.d.ts.map +1 -1
- package/dist/src/services/GalaChainTokenService.d.ts +3 -3
- package/dist/src/services/GalaChainTokenService.d.ts.map +1 -1
- package/dist/src/services/GalaChainTransferService.d.ts +4 -4
- package/dist/src/services/GalaChainTransferService.d.ts.map +1 -1
- package/dist/src/services/HolderService.d.ts +181 -0
- package/dist/src/services/HolderService.d.ts.map +1 -0
- package/dist/src/services/ImageService.d.ts +2 -15
- package/dist/src/services/ImageService.d.ts.map +1 -1
- package/dist/src/services/LaunchpadService.d.ts +67 -24
- package/dist/src/services/LaunchpadService.d.ts.map +1 -1
- package/dist/src/services/MessagesService.d.ts +251 -0
- package/dist/src/services/MessagesService.d.ts.map +1 -0
- package/dist/src/services/ModeratorService.d.ts +58 -22
- package/dist/src/services/ModeratorService.d.ts.map +1 -1
- package/dist/src/services/MultiPoolStateManager.d.ts +17 -10
- package/dist/src/services/MultiPoolStateManager.d.ts.map +1 -1
- package/dist/src/services/NetworkKeyedCacheService.d.ts.map +1 -1
- package/dist/src/services/NftCollectionService.d.ts +3 -5
- package/dist/src/services/NftCollectionService.d.ts.map +1 -1
- package/dist/src/services/OEmbedService.d.ts +152 -0
- package/dist/src/services/OEmbedService.d.ts.map +1 -0
- package/dist/src/services/OverseerService.d.ts +230 -35
- package/dist/src/services/OverseerService.d.ts.map +1 -1
- package/dist/src/services/PlatformConfigService.d.ts +149 -0
- package/dist/src/services/PlatformConfigService.d.ts.map +1 -0
- package/dist/src/services/PlatformStatsService.d.ts +72 -0
- package/dist/src/services/PlatformStatsService.d.ts.map +1 -0
- package/dist/src/services/PoolCacheManager.d.ts +3 -10
- package/dist/src/services/PoolCacheManager.d.ts.map +1 -1
- package/dist/src/services/PoolService.d.ts +108 -25
- package/dist/src/services/PoolService.d.ts.map +1 -1
- package/dist/src/services/PoolStateManager.d.ts +2 -2
- package/dist/src/services/PoolStateManager.d.ts.map +1 -1
- package/dist/src/services/PriceHistoryService.d.ts +11 -12
- package/dist/src/services/PriceHistoryService.d.ts.map +1 -1
- package/dist/src/services/RestrictedNamesService.d.ts +80 -0
- package/dist/src/services/RestrictedNamesService.d.ts.map +1 -0
- package/dist/src/services/SignatureService.d.ts.map +1 -1
- package/dist/src/services/StreamChatService.d.ts +68 -187
- package/dist/src/services/StreamChatService.d.ts.map +1 -1
- package/dist/src/services/StreamTokenServiceBase.d.ts +45 -12
- package/dist/src/services/StreamTokenServiceBase.d.ts.map +1 -1
- package/dist/src/services/StreamWebSocketService.d.ts +335 -17
- package/dist/src/services/StreamWebSocketService.d.ts.map +1 -1
- package/dist/src/services/StreamingEventService.d.ts +16 -6
- package/dist/src/services/StreamingEventService.d.ts.map +1 -1
- package/dist/src/services/StreamingService.d.ts +66 -40
- package/dist/src/services/StreamingService.d.ts.map +1 -1
- package/dist/src/services/SwapEventQueue.d.ts +1 -1
- package/dist/src/services/SwapEventQueue.d.ts.map +1 -1
- package/dist/src/services/TokenBanService.d.ts +18 -16
- package/dist/src/services/TokenBanService.d.ts.map +1 -1
- package/dist/src/services/TokenClassKeyService.d.ts.map +1 -1
- package/dist/src/services/TokenMetadataCache.d.ts.map +1 -1
- package/dist/src/services/TokenMetadataService.d.ts +4 -4
- package/dist/src/services/TokenMetadataService.d.ts.map +1 -1
- package/dist/src/services/TokenResolverService.d.ts +197 -24
- package/dist/src/services/TokenResolverService.d.ts.map +1 -1
- package/dist/src/services/TradeService.d.ts +19 -19
- package/dist/src/services/TradeService.d.ts.map +1 -1
- package/dist/src/services/TradingQuotesService.d.ts +162 -0
- package/dist/src/services/TradingQuotesService.d.ts.map +1 -0
- package/dist/src/services/UserService.d.ts +83 -23
- package/dist/src/services/UserService.d.ts.map +1 -1
- package/dist/src/services/WebSocketAdminService.d.ts +587 -0
- package/dist/src/services/WebSocketAdminService.d.ts.map +1 -0
- package/dist/src/services/WebSocketService.d.ts +7 -1
- package/dist/src/services/WebSocketService.d.ts.map +1 -1
- package/dist/src/services/WeeklyChallengeService.d.ts +114 -0
- package/dist/src/services/WeeklyChallengeService.d.ts.map +1 -0
- package/dist/src/services/WrapService.d.ts +5 -5
- package/dist/src/services/WrapService.d.ts.map +1 -1
- package/dist/src/services/WrappableTokenService.d.ts +3 -3
- package/dist/src/services/WrappableTokenService.d.ts.map +1 -1
- package/dist/src/services/__mocks__/logger.mock.d.ts +14 -7
- package/dist/src/services/__mocks__/logger.mock.d.ts.map +1 -1
- package/dist/src/services/shared/cache-helpers.d.ts.map +1 -1
- package/dist/src/services/shared/http-helpers.d.ts.map +1 -1
- package/dist/src/services/shared/pagination-helpers.d.ts +19 -19
- package/dist/src/services/shared/pagination-helpers.d.ts.map +1 -1
- package/dist/src/services/shared/service-validators.d.ts +1 -1
- package/dist/src/services/shared/service-validators.d.ts.map +1 -1
- package/dist/src/setup.d.ts +2 -2
- package/dist/src/types/ai-moderation.dto.d.ts +294 -0
- package/dist/src/types/ai-moderation.dto.d.ts.map +1 -0
- package/dist/src/types/api-key.dto.d.ts +82 -9
- package/dist/src/types/api-key.dto.d.ts.map +1 -1
- package/dist/src/types/ban.dto.d.ts +174 -3
- package/dist/src/types/ban.dto.d.ts.map +1 -1
- package/dist/src/types/cache-management.dto.d.ts +44 -0
- package/dist/src/types/cache-management.dto.d.ts.map +1 -0
- package/dist/src/types/chat-messages.dto.d.ts +7 -7
- package/dist/src/types/chat-messages.dto.d.ts.map +1 -1
- package/dist/src/types/comment.dto.d.ts +3 -7
- package/dist/src/types/comment.dto.d.ts.map +1 -1
- package/dist/src/types/comments.dto.d.ts +9 -9
- package/dist/src/types/comments.dto.d.ts.map +1 -1
- package/dist/src/types/common.d.ts +115 -27
- package/dist/src/types/common.d.ts.map +1 -1
- package/dist/src/types/composite-pool.dto.d.ts +4 -4
- package/dist/src/types/composite-pool.dto.d.ts.map +1 -1
- package/dist/src/types/constraints.d.ts +6 -2
- package/dist/src/types/constraints.d.ts.map +1 -1
- package/dist/src/types/content-flag.dto.d.ts +43 -4
- package/dist/src/types/content-flag.dto.d.ts.map +1 -1
- package/dist/src/types/content-reactions.dto.d.ts +4 -4
- package/dist/src/types/content-reactions.dto.d.ts.map +1 -1
- package/dist/src/types/dex-pool.dto.d.ts +20 -7
- package/dist/src/types/dex-pool.dto.d.ts.map +1 -1
- package/dist/src/types/dto.d.ts +5 -1
- package/dist/src/types/dto.d.ts.map +1 -1
- package/dist/src/types/engagement-stats.dto.d.ts +62 -0
- package/dist/src/types/engagement-stats.dto.d.ts.map +1 -0
- package/dist/src/types/events.dto.d.ts +80 -0
- package/dist/src/types/events.dto.d.ts.map +1 -0
- package/dist/src/types/global-feed.dto.d.ts +203 -0
- package/dist/src/types/global-feed.dto.d.ts.map +1 -0
- package/dist/src/types/gswap-responses.types.d.ts +14 -14
- package/dist/src/types/gswap-responses.types.d.ts.map +1 -1
- package/dist/src/types/gswap.dto.d.ts +12 -5
- package/dist/src/types/gswap.dto.d.ts.map +1 -1
- package/dist/src/types/holder.types.d.ts +106 -0
- package/dist/src/types/holder.types.d.ts.map +1 -0
- package/dist/src/types/launchpad.dto.d.ts +154 -77
- package/dist/src/types/launchpad.dto.d.ts.map +1 -1
- package/dist/src/types/launchpad.validation.d.ts.map +1 -1
- package/dist/src/types/lock.dto.d.ts +1 -1
- package/dist/src/types/lock.dto.d.ts.map +1 -1
- package/dist/src/types/messages.dto.d.ts +386 -0
- package/dist/src/types/messages.dto.d.ts.map +1 -0
- package/dist/src/types/moderator.dto.d.ts +38 -5
- package/dist/src/types/moderator.dto.d.ts.map +1 -1
- package/dist/src/types/oembed.dto.d.ts +160 -0
- package/dist/src/types/oembed.dto.d.ts.map +1 -0
- package/dist/src/types/options.dto.d.ts +9 -1
- package/dist/src/types/options.dto.d.ts.map +1 -1
- package/dist/src/types/overseer.dto.d.ts +152 -35
- package/dist/src/types/overseer.dto.d.ts.map +1 -1
- package/dist/src/types/platform-config.dto.d.ts +89 -0
- package/dist/src/types/platform-config.dto.d.ts.map +1 -0
- package/dist/src/types/platform-stats.dto.d.ts +40 -0
- package/dist/src/types/platform-stats.dto.d.ts.map +1 -0
- package/dist/src/types/pool-state-delta.dto.d.ts.map +1 -1
- package/dist/src/types/pool.dto.d.ts +6 -1
- package/dist/src/types/pool.dto.d.ts.map +1 -1
- package/dist/src/types/priceHistory.dto.d.ts +6 -2
- package/dist/src/types/priceHistory.dto.d.ts.map +1 -1
- package/dist/src/types/restricted-names.dto.d.ts +50 -0
- package/dist/src/types/restricted-names.dto.d.ts.map +1 -0
- package/dist/src/types/session-auth.dto.d.ts +9 -1
- package/dist/src/types/session-auth.dto.d.ts.map +1 -1
- package/dist/src/types/stream-chat.dto.d.ts +4 -9
- package/dist/src/types/stream-chat.dto.d.ts.map +1 -1
- package/dist/src/types/streaming-events.dto.d.ts +20 -1
- package/dist/src/types/streaming-events.dto.d.ts.map +1 -1
- package/dist/src/types/streaming.dto.d.ts +64 -20
- package/dist/src/types/streaming.dto.d.ts.map +1 -1
- package/dist/src/types/token-ban.dto.d.ts +7 -8
- package/dist/src/types/token-ban.dto.d.ts.map +1 -1
- package/dist/src/types/token-config.dto.d.ts +117 -0
- package/dist/src/types/token-config.dto.d.ts.map +1 -0
- package/dist/src/types/token.types.d.ts +336 -0
- package/dist/src/types/token.types.d.ts.map +1 -0
- package/dist/src/types/trade.dto.d.ts +5 -1
- package/dist/src/types/trade.dto.d.ts.map +1 -1
- package/dist/src/types/trades-query.dto.d.ts +8 -2
- package/dist/src/types/trades-query.dto.d.ts.map +1 -1
- package/dist/src/types/transfer.dto.d.ts.map +1 -1
- package/dist/src/types/user.dto.d.ts +218 -48
- package/dist/src/types/user.dto.d.ts.map +1 -1
- package/dist/src/types/websocket-admin.dto.d.ts +390 -0
- package/dist/src/types/websocket-admin.dto.d.ts.map +1 -0
- package/dist/src/types/websocket-events.dto.d.ts +472 -0
- package/dist/src/types/websocket-events.dto.d.ts.map +1 -0
- package/dist/src/types/weekly-challenge.dto.d.ts +130 -0
- package/dist/src/types/weekly-challenge.dto.d.ts.map +1 -0
- package/dist/src/types/wrappable-token.dto.d.ts +1 -1
- package/dist/src/types/wrappable-token.dto.d.ts.map +1 -1
- package/dist/src/utils/LiquidityEventExtractor.d.ts +7 -0
- package/dist/src/utils/LiquidityEventExtractor.d.ts.map +1 -1
- package/dist/src/utils/Logger.d.ts.map +1 -1
- package/dist/src/utils/MonitoringMetrics.d.ts +0 -1
- package/dist/src/utils/MonitoringMetrics.d.ts.map +1 -1
- package/dist/src/utils/SignatureHelper.d.ts.map +1 -1
- package/dist/src/utils/SwapEventExtractor.d.ts.map +1 -1
- package/dist/src/utils/adapters.d.ts +1 -1
- package/dist/src/utils/adapters.d.ts.map +1 -1
- package/dist/src/utils/address-formatter.d.ts +7 -6
- package/dist/src/utils/address-formatter.d.ts.map +1 -1
- package/dist/src/utils/agent-config.d.ts.map +1 -1
- package/dist/src/utils/amount-validator.d.ts.map +1 -1
- package/dist/src/utils/api-patterns.d.ts +1 -1
- package/dist/src/utils/api-patterns.d.ts.map +1 -1
- package/dist/src/utils/assetUrls.d.ts +450 -0
- package/dist/src/utils/assetUrls.d.ts.map +1 -0
- package/dist/src/utils/auto-pagination.d.ts +89 -0
- package/dist/src/utils/auto-pagination.d.ts.map +1 -1
- package/dist/src/utils/bignumber-helpers.d.ts.map +1 -1
- package/dist/src/utils/bignumber-pool-cache.d.ts.map +1 -1
- package/dist/src/utils/composite-pool-converter.d.ts +4 -4
- package/dist/src/utils/composite-pool-converter.d.ts.map +1 -1
- package/dist/src/utils/crypto-compat.d.ts +40 -0
- package/dist/src/utils/crypto-compat.d.ts.map +1 -0
- package/dist/src/utils/delimiter-parser.d.ts +1 -1
- package/dist/src/utils/delimiter-parser.d.ts.map +1 -1
- package/dist/src/utils/error-factories.d.ts +1 -1
- package/dist/src/utils/error-factories.d.ts.map +1 -1
- package/dist/src/utils/error-handling-patterns.d.ts +1 -1
- package/dist/src/utils/error-handling-patterns.d.ts.map +1 -1
- package/dist/src/utils/error-patterns.d.ts.map +1 -1
- package/dist/src/utils/error-utils.d.ts +1 -1
- package/dist/src/utils/error-utils.d.ts.map +1 -1
- package/dist/src/utils/errors.d.ts +2 -2
- package/dist/src/utils/errors.d.ts.map +1 -1
- package/dist/src/utils/http.d.ts +2 -2
- package/dist/src/utils/http.d.ts.map +1 -1
- package/dist/src/utils/load-env.d.ts.map +1 -1
- package/dist/src/utils/multipart.d.ts.map +1 -1
- package/dist/src/utils/nft-helpers.d.ts.map +1 -1
- package/dist/src/utils/numeric-patterns.d.ts.map +1 -1
- package/dist/src/utils/numeric-wrappers.d.ts +3 -0
- package/dist/src/utils/numeric-wrappers.d.ts.map +1 -1
- package/dist/src/utils/pagination-validation.d.ts +88 -0
- package/dist/src/utils/pagination-validation.d.ts.map +1 -0
- package/dist/src/utils/pool-state-validator.d.ts +1 -1
- package/dist/src/utils/pool-state-validator.d.ts.map +1 -1
- package/dist/src/utils/primitives.d.ts +76 -0
- package/dist/src/utils/primitives.d.ts.map +1 -0
- package/dist/src/utils/query-params.d.ts +6 -6
- package/dist/src/utils/query-params.d.ts.map +1 -1
- package/dist/src/utils/response-handlers.d.ts.map +1 -1
- package/dist/src/utils/response-normalizers.d.ts.map +1 -1
- package/dist/src/utils/safe-parsers.d.ts.map +1 -1
- package/dist/src/utils/service-validators.d.ts.map +1 -1
- package/dist/src/utils/slippage-utils.d.ts.map +1 -1
- package/dist/src/utils/string-patterns.d.ts +3 -3
- package/dist/src/utils/string-patterns.d.ts.map +1 -1
- package/dist/src/utils/swap-delta-calculator.d.ts +2 -2
- package/dist/src/utils/swap-delta-calculator.d.ts.map +1 -1
- package/dist/src/utils/tick-crossing-handler.d.ts.map +1 -1
- package/dist/src/utils/token-format-converter.d.ts +1 -1
- package/dist/src/utils/token-format-converter.d.ts.map +1 -1
- package/dist/src/utils/token-stringification.d.ts.map +1 -1
- package/dist/src/utils/tokenNormalizer.d.ts +1 -1
- package/dist/src/utils/tokenNormalizer.d.ts.map +1 -1
- package/dist/src/utils/trade-transformers.d.ts +1 -1
- package/dist/src/utils/trade-transformers.d.ts.map +1 -1
- package/dist/src/utils/validation-helpers.d.ts +5 -97
- package/dist/src/utils/validation-helpers.d.ts.map +1 -1
- package/dist/src/utils/validation-patterns.d.ts.map +1 -1
- package/dist/src/utils/validation.d.ts +1 -1
- package/dist/src/utils/validation.d.ts.map +1 -1
- package/dist/src/utils/wallet.d.ts.map +1 -1
- package/dist/src/utils/websocket-patterns.d.ts +1 -2
- package/dist/src/utils/websocket-patterns.d.ts.map +1 -1
- package/dist/src/utils/websocket-validators.d.ts +1 -1
- package/dist/src/utils/websocket-validators.d.ts.map +1 -1
- package/dist/src/wallet/ExternalWalletProvider.d.ts +109 -0
- package/dist/src/wallet/ExternalWalletProvider.d.ts.map +1 -0
- package/dist/src/wallet/GalaChainConnectProvider.d.ts +125 -0
- package/dist/src/wallet/GalaChainConnectProvider.d.ts.map +1 -0
- package/dist/src/wallet/GalaWalletProvider.d.ts +139 -0
- package/dist/src/wallet/GalaWalletProvider.d.ts.map +1 -0
- package/dist/src/wallet/PrivateKeyProvider.d.ts +90 -0
- package/dist/src/wallet/PrivateKeyProvider.d.ts.map +1 -0
- package/dist/src/wallet/detection.d.ts +107 -0
- package/dist/src/wallet/detection.d.ts.map +1 -0
- package/dist/src/wallet/index.d.ts +52 -0
- package/dist/src/wallet/index.d.ts.map +1 -0
- package/dist/src/wallet/types.d.ts +267 -0
- package/dist/src/wallet/types.d.ts.map +1 -0
- package/dist/src/wallet/utils.d.ts +117 -0
- package/dist/src/wallet/utils.d.ts.map +1 -0
- package/dist/test-constants.d.ts +29 -0
- package/dist/test-constants.d.ts.map +1 -0
- package/dist/types/ai-moderation.dto.d.ts +294 -0
- package/dist/types/ai-moderation.dto.d.ts.map +1 -0
- package/dist/types/api-key.dto.d.ts +373 -0
- package/dist/types/api-key.dto.d.ts.map +1 -0
- package/dist/types/backend-responses.d.ts +235 -0
- package/dist/types/backend-responses.d.ts.map +1 -0
- package/dist/types/ban.dto.d.ts +577 -0
- package/dist/types/ban.dto.d.ts.map +1 -0
- package/dist/types/burn.dto.d.ts +170 -0
- package/dist/types/burn.dto.d.ts.map +1 -0
- package/dist/types/cache-management.dto.d.ts +44 -0
- package/dist/types/cache-management.dto.d.ts.map +1 -0
- package/dist/types/chat-messages.dto.d.ts +193 -0
- package/dist/types/chat-messages.dto.d.ts.map +1 -0
- package/dist/types/comment.dto.d.ts +176 -0
- package/dist/types/comment.dto.d.ts.map +1 -0
- package/dist/types/comments.dto.d.ts +198 -0
- package/dist/types/comments.dto.d.ts.map +1 -0
- package/dist/types/common.d.ts +602 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/composite-pool.dto.d.ts +103 -0
- package/dist/types/composite-pool.dto.d.ts.map +1 -0
- package/dist/types/constraints.d.ts +378 -0
- package/dist/types/constraints.d.ts.map +1 -0
- package/dist/types/content-flag.dto.d.ts +337 -0
- package/dist/types/content-flag.dto.d.ts.map +1 -0
- package/dist/types/content-reactions.dto.d.ts +132 -0
- package/dist/types/content-reactions.dto.d.ts.map +1 -0
- package/dist/types/dex-pool.dto.d.ts +214 -0
- package/dist/types/dex-pool.dto.d.ts.map +1 -0
- package/dist/types/dto.d.ts +183 -0
- package/dist/types/dto.d.ts.map +1 -0
- package/dist/types/engagement-stats.dto.d.ts +62 -0
- package/dist/types/engagement-stats.dto.d.ts.map +1 -0
- package/dist/types/events.dto.d.ts +80 -0
- package/dist/types/events.dto.d.ts.map +1 -0
- package/dist/types/galachain-api.types.d.ts +297 -0
- package/dist/types/galachain-api.types.d.ts.map +1 -0
- package/dist/types/global-feed.dto.d.ts +203 -0
- package/dist/types/global-feed.dto.d.ts.map +1 -0
- package/dist/types/gswap-responses.types.d.ts +369 -0
- package/dist/types/gswap-responses.types.d.ts.map +1 -0
- package/dist/types/gswap.dto.d.ts +448 -0
- package/dist/types/gswap.dto.d.ts.map +1 -0
- package/dist/types/holder.types.d.ts +106 -0
- package/dist/types/holder.types.d.ts.map +1 -0
- package/dist/types/launchpad.dto.d.ts +1264 -0
- package/dist/types/launchpad.dto.d.ts.map +1 -0
- package/dist/types/launchpad.validation.d.ts +43 -0
- package/dist/types/launchpad.validation.d.ts.map +1 -0
- package/dist/types/liquidity-monitor.dto.d.ts +177 -0
- package/dist/types/liquidity-monitor.dto.d.ts.map +1 -0
- package/dist/types/lock.dto.d.ts +261 -0
- package/dist/types/lock.dto.d.ts.map +1 -0
- package/dist/types/messages.dto.d.ts +386 -0
- package/dist/types/messages.dto.d.ts.map +1 -0
- package/dist/types/moderator.dto.d.ts +607 -0
- package/dist/types/moderator.dto.d.ts.map +1 -0
- package/dist/types/nft.dto.d.ts +155 -0
- package/dist/types/nft.dto.d.ts.map +1 -0
- package/dist/types/oembed.dto.d.ts +160 -0
- package/dist/types/oembed.dto.d.ts.map +1 -0
- package/dist/types/options.dto.d.ts +485 -0
- package/dist/types/options.dto.d.ts.map +1 -0
- package/dist/types/overseer.dto.d.ts +530 -0
- package/dist/types/overseer.dto.d.ts.map +1 -0
- package/dist/types/platform-config.dto.d.ts +89 -0
- package/dist/types/platform-config.dto.d.ts.map +1 -0
- package/dist/types/platform-stats.dto.d.ts +40 -0
- package/dist/types/platform-stats.dto.d.ts.map +1 -0
- package/dist/types/pool-state-delta.dto.d.ts +246 -0
- package/dist/types/pool-state-delta.dto.d.ts.map +1 -0
- package/dist/types/pool.dto.d.ts +111 -0
- package/dist/types/pool.dto.d.ts.map +1 -0
- package/dist/types/priceHistory.dto.d.ts +165 -0
- package/dist/types/priceHistory.dto.d.ts.map +1 -0
- package/dist/types/restricted-names.dto.d.ts +50 -0
- package/dist/types/restricted-names.dto.d.ts.map +1 -0
- package/dist/types/result.types.d.ts +104 -0
- package/dist/types/result.types.d.ts.map +1 -0
- package/dist/types/session-auth.dto.d.ts +99 -0
- package/dist/types/session-auth.dto.d.ts.map +1 -0
- package/dist/types/stream-chat.dto.d.ts +810 -0
- package/dist/types/stream-chat.dto.d.ts.map +1 -0
- package/dist/types/streaming-events.dto.d.ts +605 -0
- package/dist/types/streaming-events.dto.d.ts.map +1 -0
- package/dist/types/streaming.dto.d.ts +1178 -0
- package/dist/types/streaming.dto.d.ts.map +1 -0
- package/dist/types/swap-monitor.dto.d.ts +256 -0
- package/dist/types/swap-monitor.dto.d.ts.map +1 -0
- package/dist/types/token-ban.dto.d.ts +194 -0
- package/dist/types/token-ban.dto.d.ts.map +1 -0
- package/dist/types/token-config.dto.d.ts +117 -0
- package/dist/types/token-config.dto.d.ts.map +1 -0
- package/dist/types/token.types.d.ts +336 -0
- package/dist/types/token.types.d.ts.map +1 -0
- package/dist/types/trade.dto.d.ts +457 -0
- package/dist/types/trade.dto.d.ts.map +1 -0
- package/dist/types/trades-query.dto.d.ts +133 -0
- package/dist/types/trades-query.dto.d.ts.map +1 -0
- package/dist/types/transfer.dto.d.ts +156 -0
- package/dist/types/transfer.dto.d.ts.map +1 -0
- package/dist/types/user.dto.d.ts +880 -0
- package/dist/types/user.dto.d.ts.map +1 -0
- package/dist/types/websocket-admin.dto.d.ts +390 -0
- package/dist/types/websocket-admin.dto.d.ts.map +1 -0
- package/dist/types/websocket-data.types.d.ts +35 -0
- package/dist/types/websocket-data.types.d.ts.map +1 -0
- package/dist/types/websocket-events.dto.d.ts +472 -0
- package/dist/types/websocket-events.dto.d.ts.map +1 -0
- package/dist/types/websocket.types.d.ts +118 -0
- package/dist/types/websocket.types.d.ts.map +1 -0
- package/dist/types/weekly-challenge.dto.d.ts +130 -0
- package/dist/types/weekly-challenge.dto.d.ts.map +1 -0
- package/dist/types/wrappable-token.dto.d.ts +305 -0
- package/dist/types/wrappable-token.dto.d.ts.map +1 -0
- package/dist/utils/LiquidityEventExtractor.d.ts +106 -0
- package/dist/utils/LiquidityEventExtractor.d.ts.map +1 -0
- package/dist/utils/Logger.d.ts +136 -0
- package/dist/utils/Logger.d.ts.map +1 -0
- package/dist/utils/MonitoringMetrics.d.ts +151 -0
- package/dist/utils/MonitoringMetrics.d.ts.map +1 -0
- package/dist/utils/PoolKeyNormalizer.d.ts +135 -0
- package/dist/utils/PoolKeyNormalizer.d.ts.map +1 -0
- package/dist/utils/ReconnectionManager.d.ts +142 -0
- package/dist/utils/ReconnectionManager.d.ts.map +1 -0
- package/dist/utils/SignatureHelper.d.ts +140 -0
- package/dist/utils/SignatureHelper.d.ts.map +1 -0
- package/dist/utils/SwapEventExtractor.d.ts +152 -0
- package/dist/utils/SwapEventExtractor.d.ts.map +1 -0
- package/dist/utils/adapters.d.ts +111 -0
- package/dist/utils/adapters.d.ts.map +1 -0
- package/dist/utils/address-formatter.d.ts +318 -0
- package/dist/utils/address-formatter.d.ts.map +1 -0
- package/dist/utils/agent-config.d.ts +288 -0
- package/dist/utils/agent-config.d.ts.map +1 -0
- package/dist/utils/amount-validator.d.ts +268 -0
- package/dist/utils/amount-validator.d.ts.map +1 -0
- package/dist/utils/api-patterns.d.ts +347 -0
- package/dist/utils/api-patterns.d.ts.map +1 -0
- package/dist/utils/array-helpers.d.ts +115 -0
- package/dist/utils/array-helpers.d.ts.map +1 -0
- package/dist/utils/assetUrls.d.ts +450 -0
- package/dist/utils/assetUrls.d.ts.map +1 -0
- package/dist/utils/async-patterns.d.ts +272 -0
- package/dist/utils/async-patterns.d.ts.map +1 -0
- package/dist/utils/auto-pagination.d.ts +549 -0
- package/dist/utils/auto-pagination.d.ts.map +1 -0
- package/dist/utils/bignumber-helpers.d.ts +446 -0
- package/dist/utils/bignumber-helpers.d.ts.map +1 -0
- package/dist/utils/bignumber-pool-cache.d.ts +169 -0
- package/dist/utils/bignumber-pool-cache.d.ts.map +1 -0
- package/dist/utils/bondingCurveCalculations.d.ts +144 -0
- package/dist/utils/bondingCurveCalculations.d.ts.map +1 -0
- package/dist/utils/cacheWarmingHelpers.d.ts +110 -0
- package/dist/utils/cacheWarmingHelpers.d.ts.map +1 -0
- package/dist/utils/composite-pool-converter.d.ts +121 -0
- package/dist/utils/composite-pool-converter.d.ts.map +1 -0
- package/dist/utils/crypto-compat.d.ts +40 -0
- package/dist/utils/crypto-compat.d.ts.map +1 -0
- package/dist/utils/data-transform-patterns.d.ts +393 -0
- package/dist/utils/data-transform-patterns.d.ts.map +1 -0
- package/dist/utils/date-utils.d.ts +205 -0
- package/dist/utils/date-utils.d.ts.map +1 -0
- package/dist/utils/delimiter-parser.d.ts +139 -0
- package/dist/utils/delimiter-parser.d.ts.map +1 -0
- package/dist/utils/error-factories.d.ts +701 -0
- package/dist/utils/error-factories.d.ts.map +1 -0
- package/dist/utils/error-handling-patterns.d.ts +390 -0
- package/dist/utils/error-handling-patterns.d.ts.map +1 -0
- package/dist/utils/error-patterns.d.ts +360 -0
- package/dist/utils/error-patterns.d.ts.map +1 -0
- package/dist/utils/error-utils.d.ts +458 -0
- package/dist/utils/error-utils.d.ts.map +1 -0
- package/dist/utils/error-wrapper.d.ts +208 -0
- package/dist/utils/error-wrapper.d.ts.map +1 -0
- package/dist/utils/errors.d.ts +548 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/http-factory.d.ts +36 -0
- package/dist/utils/http-factory.d.ts.map +1 -0
- package/dist/utils/http.d.ts +97 -0
- package/dist/utils/http.d.ts.map +1 -0
- package/dist/utils/load-env.d.ts +31 -0
- package/dist/utils/load-env.d.ts.map +1 -0
- package/dist/utils/multipart-helpers.d.ts +38 -0
- package/dist/utils/multipart-helpers.d.ts.map +1 -0
- package/dist/utils/multipart.d.ts +63 -0
- package/dist/utils/multipart.d.ts.map +1 -0
- package/dist/utils/nft-helpers.d.ts +62 -0
- package/dist/utils/nft-helpers.d.ts.map +1 -0
- package/dist/utils/numeric-patterns.d.ts +289 -0
- package/dist/utils/numeric-patterns.d.ts.map +1 -0
- package/dist/utils/numeric-wrappers.d.ts +149 -0
- package/dist/utils/numeric-wrappers.d.ts.map +1 -0
- package/dist/utils/object-extractors.d.ts +115 -0
- package/dist/utils/object-extractors.d.ts.map +1 -0
- package/dist/utils/object-patterns.d.ts +81 -0
- package/dist/utils/object-patterns.d.ts.map +1 -0
- package/dist/utils/pagination-helpers.d.ts +161 -0
- package/dist/utils/pagination-helpers.d.ts.map +1 -0
- package/dist/utils/pagination-validation.d.ts +88 -0
- package/dist/utils/pagination-validation.d.ts.map +1 -0
- package/dist/utils/pool-pair-parser.d.ts +57 -0
- package/dist/utils/pool-pair-parser.d.ts.map +1 -0
- package/dist/utils/pool-state-validator.d.ts +207 -0
- package/dist/utils/pool-state-validator.d.ts.map +1 -0
- package/dist/utils/position-filters.d.ts +252 -0
- package/dist/utils/position-filters.d.ts.map +1 -0
- package/dist/utils/primitives.d.ts +76 -0
- package/dist/utils/primitives.d.ts.map +1 -0
- package/dist/utils/query-params.d.ts +89 -0
- package/dist/utils/query-params.d.ts.map +1 -0
- package/dist/utils/response-handlers.d.ts +225 -0
- package/dist/utils/response-handlers.d.ts.map +1 -0
- package/dist/utils/response-helpers.d.ts +28 -0
- package/dist/utils/response-helpers.d.ts.map +1 -0
- package/dist/utils/response-normalizers.d.ts +115 -0
- package/dist/utils/response-normalizers.d.ts.map +1 -0
- package/dist/utils/safe-parsers.d.ts +487 -0
- package/dist/utils/safe-parsers.d.ts.map +1 -0
- package/dist/utils/service-validators.d.ts +268 -0
- package/dist/utils/service-validators.d.ts.map +1 -0
- package/dist/utils/slippage-utils.d.ts +70 -0
- package/dist/utils/slippage-utils.d.ts.map +1 -0
- package/dist/utils/string-patterns.d.ts +404 -0
- package/dist/utils/string-patterns.d.ts.map +1 -0
- package/dist/utils/string-transforms.d.ts +89 -0
- package/dist/utils/string-transforms.d.ts.map +1 -0
- package/dist/utils/string-utils.d.ts +108 -0
- package/dist/utils/string-utils.d.ts.map +1 -0
- package/dist/utils/swap-delta-calculator.d.ts +231 -0
- package/dist/utils/swap-delta-calculator.d.ts.map +1 -0
- package/dist/utils/tick-crossing-handler.d.ts +250 -0
- package/dist/utils/tick-crossing-handler.d.ts.map +1 -0
- package/dist/utils/token-format-converter.d.ts +175 -0
- package/dist/utils/token-format-converter.d.ts.map +1 -0
- package/dist/utils/token-parser.d.ts +235 -0
- package/dist/utils/token-parser.d.ts.map +1 -0
- package/dist/utils/token-stringification.d.ts +168 -0
- package/dist/utils/token-stringification.d.ts.map +1 -0
- package/dist/utils/tokenNameNormalizer.d.ts +96 -0
- package/dist/utils/tokenNameNormalizer.d.ts.map +1 -0
- package/dist/utils/tokenNormalizer.d.ts +167 -0
- package/dist/utils/tokenNormalizer.d.ts.map +1 -0
- package/dist/utils/trade-transformers.d.ts +28 -0
- package/dist/utils/trade-transformers.d.ts.map +1 -0
- package/dist/utils/transfer-validation.d.ts +58 -0
- package/dist/utils/transfer-validation.d.ts.map +1 -0
- package/dist/utils/type-guard-factory.d.ts +260 -0
- package/dist/utils/type-guard-factory.d.ts.map +1 -0
- package/dist/utils/unique-key-generator.d.ts +148 -0
- package/dist/utils/unique-key-generator.d.ts.map +1 -0
- package/dist/utils/validation-helpers.d.ts +1074 -0
- package/dist/utils/validation-helpers.d.ts.map +1 -0
- package/dist/utils/validation-patterns.d.ts +768 -0
- package/dist/utils/validation-patterns.d.ts.map +1 -0
- package/dist/utils/validation.d.ts +140 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/wallet.d.ts +185 -0
- package/dist/utils/wallet.d.ts.map +1 -0
- package/dist/utils/websocket-errors.d.ts +30 -0
- package/dist/utils/websocket-errors.d.ts.map +1 -0
- package/dist/utils/websocket-patterns.d.ts +680 -0
- package/dist/utils/websocket-patterns.d.ts.map +1 -0
- package/dist/utils/websocket-validators.d.ts +30 -0
- package/dist/utils/websocket-validators.d.ts.map +1 -0
- package/dist/wallet/ExternalWalletProvider.d.ts +109 -0
- package/dist/wallet/ExternalWalletProvider.d.ts.map +1 -0
- package/dist/wallet/GalaChainConnectProvider.d.ts +125 -0
- package/dist/wallet/GalaChainConnectProvider.d.ts.map +1 -0
- package/dist/wallet/GalaWalletProvider.d.ts +139 -0
- package/dist/wallet/GalaWalletProvider.d.ts.map +1 -0
- package/dist/wallet/PrivateKeyProvider.d.ts +90 -0
- package/dist/wallet/PrivateKeyProvider.d.ts.map +1 -0
- package/dist/wallet/detection.d.ts +107 -0
- package/dist/wallet/detection.d.ts.map +1 -0
- package/dist/wallet/index.d.ts +52 -0
- package/dist/wallet/index.d.ts.map +1 -0
- package/dist/wallet/types.d.ts +267 -0
- package/dist/wallet/types.d.ts.map +1 -0
- package/dist/wallet/utils.d.ts +117 -0
- package/dist/wallet/utils.d.ts.map +1 -0
- package/dist/wallet.cjs +1 -0
- package/dist/wallet.esm.js +1 -0
- package/package.json +131 -33
- package/dist/index.cjs.js +0 -1
- package/dist/src/services/ChatMessagesService.d.ts +0 -152
- package/dist/src/services/ChatMessagesService.d.ts.map +0 -1
- package/dist/src/services/CommentService.d.ts +0 -119
- package/dist/src/services/CommentService.d.ts.map +0 -1
- package/dist/src/services/CommentsService.d.ts +0 -155
- package/dist/src/services/CommentsService.d.ts.map +0 -1
package/README.md.bak
ADDED
|
@@ -0,0 +1,3174 @@
|
|
|
1
|
+
# Gala Launchpad SDK
|
|
2
|
+
|
|
3
|
+
**Version: 5.0.3 (Latest)**
|
|
4
|
+
|
|
5
|
+
A comprehensive TypeScript SDK for the Gala Launchpad Backend API, providing type-safe authentication, trading, and real-time features for DeFi applications.
|
|
6
|
+
|
|
7
|
+
> **⚠️ BREAKING CHANGE (v3.33.0+)**: Token format parsing now **ONLY accepts delimited formats** (`GALA|Unit|none|none` or `GALA$Unit$none$none`). Plain token strings (`'GALA'`, `'GUSDC'`) are **permanently rejected** for security. See [Migration Guide](#token-format-migration-v330) below.
|
|
8
|
+
|
|
9
|
+
[](https://badge.fury.io/js/@gala-chain%2Flaunchpad-sdk)
|
|
10
|
+
[](https://opensource.org/licenses/MIT)
|
|
11
|
+
[](http://www.typescriptlang.org/)
|
|
12
|
+
[](./docs/API-REFERENCE.md)
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
**Clean Result Types with No Wrapper Overhead:**
|
|
17
|
+
|
|
18
|
+
- **Direct Result Access**: Get clean, typed results without wrapper objects
|
|
19
|
+
- **Semantic Type Conversion**: Dates as Date objects, numbers as numbers, strings for precision
|
|
20
|
+
- **Comprehensive Type Safety**: Full TypeScript support with precise result interfaces
|
|
21
|
+
- **Zero Wrapper Overhead**: No more `result.data.success` - direct property access
|
|
22
|
+
- **Options Object Pattern**: All methods with 2+ parameters use clean options objects
|
|
23
|
+
- **Auto-Pagination**: Automatic multi-page fetching with configurable concurrency
|
|
24
|
+
|
|
25
|
+
### Developer Experience
|
|
26
|
+
|
|
27
|
+
```typescript
|
|
28
|
+
import { createLaunchpadSDK, createWallet } from '@gala-chain/launchpad-sdk';
|
|
29
|
+
|
|
30
|
+
// Auto-detect wallet format and create SDK
|
|
31
|
+
const sdk = createLaunchpadSDK({
|
|
32
|
+
wallet: 'your-private-key-or-mnemonic' // Auto-detects format!
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// Direct result access - no wrapper objects!
|
|
36
|
+
const pools = await sdk.fetchPools({ type: 'recent' });
|
|
37
|
+
console.log(`Found ${pools.total} pools`); // Direct property access
|
|
38
|
+
console.log(`Page ${pools.page} of ${pools.totalPages}`); // Clean pagination
|
|
39
|
+
console.log(`Has next: ${pools.hasNext}`); // Boolean convenience properties
|
|
40
|
+
|
|
41
|
+
// Clean typed results everywhere
|
|
42
|
+
const balance = await sdk.fetchGalaBalance();
|
|
43
|
+
console.log(`Balance: ${balance.balance} GALA`); // Direct balance access
|
|
44
|
+
console.log(`Last updated: ${balance.lastUpdated.toISOString()}`); // Date object
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Clean API Architecture
|
|
48
|
+
|
|
49
|
+
**Direct result access with no wrapper overhead:**
|
|
50
|
+
|
|
51
|
+
```typescript
|
|
52
|
+
// Get pools with direct property access
|
|
53
|
+
const pools = await sdk.fetchPools({ type: 'recent' });
|
|
54
|
+
console.log(pools.items); // Direct access to pool array
|
|
55
|
+
console.log(pools.meta.total); // Immediate pagination info
|
|
56
|
+
console.log(pools.meta.page < pools.meta.totalPages); // Has more pages
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Key Features
|
|
60
|
+
|
|
61
|
+
- **Type-Safe API Client**: Full TypeScript support with comprehensive type definitions
|
|
62
|
+
- **Clean Result Types**: Direct property access without wrapper objects
|
|
63
|
+
- **Options Object Pattern**: All multi-parameter methods use clean options objects
|
|
64
|
+
- **Auto-Pagination**: Automatic multi-page fetching for large result sets
|
|
65
|
+
- **Signature Authentication**: Ethereum wallet-based authentication with automatic signature generation
|
|
66
|
+
- **Helper Functions**: Auto-detecting wallet creation and SDK factory functions
|
|
67
|
+
- **Pool Management**: Create, fetch, and check token pools on the launchpad
|
|
68
|
+
- **Token Trading**: Buy and sell tokens with slippage protection via GalaChain
|
|
69
|
+
- **DEX Pool Discovery**: Discover and explore GalaSwap liquidity pools with filtering, sorting, and pagination
|
|
70
|
+
- **DEX Trading**: Real-time token swaps on GalaSwap DEX with quote generation and slippage protection
|
|
71
|
+
- **Liquidity Management**: Manage liquidity positions on GalaSwap (add, remove, collect fees) with filtering and organization utilities
|
|
72
|
+
- **Token Transfers**: Transfer GALA and launchpad tokens between wallets with EIP-712 signatures
|
|
73
|
+
- **User Operations**: Portfolio management, token balances, and account management
|
|
74
|
+
- **Comment System**: Post and retrieve comments on token pools
|
|
75
|
+
- **Price History**: Fetch historical price data for DEX tokens with pagination (Node.js only)
|
|
76
|
+
- **Cross-Chain Bridging**: Transfer tokens between GalaChain, Ethereum, and Solana with fee estimation
|
|
77
|
+
- **External Wallet Balances**: Query Ethereum and Solana wallet balances (single-token or full portfolio)
|
|
78
|
+
- **Live Streaming**: Start/stop streams, manage recordings and simulcast targets for token pools (v5.1.0+)
|
|
79
|
+
- **Stream Chat**: Real-time chat messaging via REST and WebSocket with admin controls (v5.1.0+)
|
|
80
|
+
- **Global Feed**: Unified real-time event stream for token updates and site configuration changes (v7.0.0+)
|
|
81
|
+
- **Overseer System**: Global platform oversight with CCTV dashboard, invite management, and platform summary (v5.9.0+)
|
|
82
|
+
- **Moderator System**: Token-scoped moderation with magic link invites (v5.7.0+)
|
|
83
|
+
- **Content Flags**: Report and manage flagged content with two-tier review system (v5.8.0+)
|
|
84
|
+
- **User Bans**: Per-token and global user banning with active user tracking (v5.5.0+)
|
|
85
|
+
- **Comprehensive Validation**: Input validation and error handling for all operations
|
|
86
|
+
- **Multi-Environment Support**: Production, staging, and custom backend URLs
|
|
87
|
+
|
|
88
|
+
## Installation
|
|
89
|
+
|
|
90
|
+
### NPM
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
npm install @gala-chain/launchpad-sdk
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Yarn
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
yarn add @gala-chain/launchpad-sdk
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Peer Dependencies
|
|
103
|
+
|
|
104
|
+
This SDK requires the following peer dependencies to be installed:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npm install ethers@^6.15.0 @gala-chain/api@^2.4.3 @gala-chain/connect@^2.4.3 socket.io-client@^4.8.1 axios@^1.12.2 bignumber.js@^9.1.2 zod@^3.25.76
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**Or with yarn:**
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
yarn add ethers@^6.15.0 @gala-chain/api@^2.4.3 @gala-chain/connect@^2.4.3 socket.io-client@^4.8.1 axios@^1.12.2 bignumber.js@^9.1.2 zod@^3.25.76
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**All peer dependencies are required** - this includes `socket.io-client` which is needed for transaction verification via WebSocket.
|
|
117
|
+
|
|
118
|
+
## Module Formats
|
|
119
|
+
|
|
120
|
+
The SDK is distributed in **three module formats** to support both modern and legacy projects:
|
|
121
|
+
|
|
122
|
+
### ESM (ES Modules) - Primary Format
|
|
123
|
+
|
|
124
|
+
**For modern bundlers and Node.js 16+:**
|
|
125
|
+
|
|
126
|
+
```typescript
|
|
127
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
128
|
+
|
|
129
|
+
const sdk = createLaunchpadSDK({
|
|
130
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
131
|
+
});
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**When to use:**
|
|
135
|
+
- ✅ React, Vue, Svelte, Angular applications
|
|
136
|
+
- ✅ Next.js, Nuxt, SvelteKit
|
|
137
|
+
- ✅ Vite, Webpack, esbuild bundlers
|
|
138
|
+
- ✅ Modern Node.js projects with `"type": "module"`
|
|
139
|
+
|
|
140
|
+
### CommonJS - Legacy Support
|
|
141
|
+
|
|
142
|
+
**For CommonJS projects and older Node.js environments:**
|
|
143
|
+
|
|
144
|
+
```javascript
|
|
145
|
+
const { createLaunchpadSDK } = require('@gala-chain/launchpad-sdk');
|
|
146
|
+
|
|
147
|
+
const sdk = createLaunchpadSDK({
|
|
148
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
149
|
+
});
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
**When to use:**
|
|
153
|
+
- ✅ Legacy Node.js projects with CommonJS modules
|
|
154
|
+
- ✅ Older tooling that doesn't support ESM
|
|
155
|
+
- ✅ Express.js, Nest.js (CommonJS mode)
|
|
156
|
+
- ✅ Projects without build tools
|
|
157
|
+
|
|
158
|
+
### UMD (Universal Module Definition) - Browser Legacy
|
|
159
|
+
|
|
160
|
+
**For browser globals and legacy environments:**
|
|
161
|
+
|
|
162
|
+
```html
|
|
163
|
+
<script src="node_modules/@gala-chain/launchpad-sdk/dist/index.js"></script>
|
|
164
|
+
<script>
|
|
165
|
+
const sdk = window.GalaLaunchpadSDK.createLaunchpadSDK({
|
|
166
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
167
|
+
});
|
|
168
|
+
</script>
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
**When to use:**
|
|
172
|
+
- ✅ Direct browser `<script>` tags
|
|
173
|
+
- ✅ Older browser environments
|
|
174
|
+
- ✅ CDN delivery
|
|
175
|
+
|
|
176
|
+
### Module Resolution
|
|
177
|
+
|
|
178
|
+
Node.js automatically selects the correct module format based on your project:
|
|
179
|
+
|
|
180
|
+
| Project Type | Method | Format Used | File |
|
|
181
|
+
|---|---|---|---|
|
|
182
|
+
| ESM Module | `import` | ESM | `dist/index.esm.js` |
|
|
183
|
+
| CommonJS | `require()` | CommonJS | `dist/index.cjs.js` |
|
|
184
|
+
| Legacy Tools | Direct Include | UMD | `dist/index.js` |
|
|
185
|
+
|
|
186
|
+
**No configuration needed** - Node.js and bundlers automatically select the optimal format via the package exports field!
|
|
187
|
+
|
|
188
|
+
## Wallet Configuration Modes
|
|
189
|
+
|
|
190
|
+
The SDK supports **two operational modes** with optional wallet configuration:
|
|
191
|
+
|
|
192
|
+
### Full-Access Mode (with Wallet)
|
|
193
|
+
|
|
194
|
+
**For executing trades, creating tokens, and managing funds:**
|
|
195
|
+
|
|
196
|
+
```typescript
|
|
197
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
198
|
+
|
|
199
|
+
// Initialize with wallet - enables signing operations
|
|
200
|
+
const sdk = createLaunchpadSDK({
|
|
201
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
202
|
+
});
|
|
203
|
+
|
|
204
|
+
// Now you can execute trades
|
|
205
|
+
const result = await sdk.buy({
|
|
206
|
+
tokenName: 'anime',
|
|
207
|
+
amount: '100',
|
|
208
|
+
type: 'native',
|
|
209
|
+
slippageToleranceFactor: 0.01
|
|
210
|
+
});
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
**Capabilities:**
|
|
214
|
+
- ✅ Execute token trades (buy/sell)
|
|
215
|
+
- ✅ Create new tokens
|
|
216
|
+
- ✅ Transfer GALA and tokens
|
|
217
|
+
- ✅ Update user profile
|
|
218
|
+
- ✅ Post comments
|
|
219
|
+
- ✅ All read operations (fetch pools, prices, etc.)
|
|
220
|
+
|
|
221
|
+
### Read-Only Mode (without Wallet)
|
|
222
|
+
|
|
223
|
+
**For querying data without wallet authentication:**
|
|
224
|
+
|
|
225
|
+
```typescript
|
|
226
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
227
|
+
|
|
228
|
+
// Initialize without wallet - read-only operations only
|
|
229
|
+
const sdk = createLaunchpadSDK({});
|
|
230
|
+
|
|
231
|
+
// Query operations work fine
|
|
232
|
+
const pools = await sdk.fetchPools({ type: 'recent' });
|
|
233
|
+
const prices = await sdk.fetchTokenSpotPrice('anime');
|
|
234
|
+
const balance = await sdk.fetchGalaBalance();
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
**Capabilities:**
|
|
238
|
+
- ✅ Fetch token pools and details
|
|
239
|
+
- ✅ Get real-time prices and price history
|
|
240
|
+
- ✅ Check balances and portfolio
|
|
241
|
+
- ✅ Browse comments and token information
|
|
242
|
+
- ✅ Explore token metadata and distributions
|
|
243
|
+
- ❌ Cannot: Execute trades, create tokens, transfer funds (require signatures)
|
|
244
|
+
|
|
245
|
+
### Dynamic Wallet Configuration
|
|
246
|
+
|
|
247
|
+
**Upgrade from read-only to full-access mode at runtime:**
|
|
248
|
+
|
|
249
|
+
```typescript
|
|
250
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
251
|
+
|
|
252
|
+
// Start in read-only mode
|
|
253
|
+
const sdk = createLaunchpadSDK({});
|
|
254
|
+
console.log(sdk.hasWallet()); // false
|
|
255
|
+
|
|
256
|
+
// Later, upgrade to full-access
|
|
257
|
+
sdk.setWallet('your-private-key-or-mnemonic');
|
|
258
|
+
console.log(sdk.hasWallet()); // true
|
|
259
|
+
|
|
260
|
+
// Now signing operations work
|
|
261
|
+
const result = await sdk.buy({
|
|
262
|
+
tokenName: 'anime',
|
|
263
|
+
amount: '100',
|
|
264
|
+
type: 'native',
|
|
265
|
+
slippageToleranceFactor: 0.01
|
|
266
|
+
});
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
**Wallet Management Methods:**
|
|
270
|
+
- `hasWallet()` - Check if wallet is configured
|
|
271
|
+
- `getWallet()` - Retrieve current wallet instance
|
|
272
|
+
- `setWallet(wallet)` - Configure wallet for signing operations
|
|
273
|
+
- `validateWallet()` - Type guard that throws if wallet not present
|
|
274
|
+
|
|
275
|
+
### Method Categorization: Wallet Requirements
|
|
276
|
+
|
|
277
|
+
**Methods that DON'T require a wallet (Read-Only Operations):**
|
|
278
|
+
|
|
279
|
+
| Category | Methods | Notes |
|
|
280
|
+
|----------|---------|-------|
|
|
281
|
+
| **Pool Queries** | `fetchPools`, `fetchAllPools`, `fetchPoolDetails`, `fetchPoolDetailsForCalculation`, `isTokenGraduated`, `isTokenNameAvailable`, `isTokenSymbolAvailable` | Query pool data and token availability |
|
|
282
|
+
| **Token Data** | `fetchTokenDetails`, `fetchTokenDistribution`, `fetchTokenBadges` | Get token metadata and holder information |
|
|
283
|
+
| **Pricing** | `fetchTokenSpotPrice`, `fetchGalaSpotPrice`, `fetchLaunchpadTokenSpotPrice`, `fetchVolumeData` | Get current prices and OHLCV data |
|
|
284
|
+
| **Price History** | `fetchPriceHistory`, `fetchAllPriceHistory` | Get historical price snapshots (Node.js only) |
|
|
285
|
+
| **Balance Info** | `fetchGalaBalance`, `fetchTokenBalance` | Check GALA and token balances (your own only) |
|
|
286
|
+
| **Portfolio** | `fetchTokensHeld`, `fetchTokensCreated` | View your token portfolio and created tokens |
|
|
287
|
+
| **Profile** | `fetchProfile` | Retrieve user profile information |
|
|
288
|
+
| **Comments** | `fetchComments` | View comments on token pools |
|
|
289
|
+
| **Trade History** | `fetchTrades` | View your past trades |
|
|
290
|
+
| **Utilities** | `getAddress`, `getEthereumAddress`, `getConfig`, `getVersion`, `getUrlByTokenName`, `getCacheInfo`, `clearCache`, `cleanup`, `cleanupAll` | Utility and configuration methods |
|
|
291
|
+
| **Reference** | `resolveTokenClassKey`, `resolveVaultAddress`, `calculateInitialBuyAmount` | Resolve IDs and get reference data |
|
|
292
|
+
|
|
293
|
+
**Methods that REQUIRE a wallet (Signing Operations):**
|
|
294
|
+
|
|
295
|
+
| Category | Methods | Error When Missing |
|
|
296
|
+
|----------|---------|-------------------|
|
|
297
|
+
| **Trading** | `buy`, `sell`, `calculateBuyAmount`, `calculateSellAmount`, `calculateBuyAmountLocal`, `calculateBuyAmountExternal`, `calculateSellAmountLocal`, `calculateSellAmountExternal` | `ValidationError: Wallet is required` |
|
|
298
|
+
| **Token Creation** | `launchToken`, `uploadTokenImage`, `uploadProfileImage`, `calculateBuyAmountForGraduation`, `graduateToken` | `ValidationError: Wallet is required` |
|
|
299
|
+
| **Account Management** | `updateProfile`, `postComment` | `ValidationError: Wallet is required` |
|
|
300
|
+
| **Transfers** | `transferGala`, `transferToken` | `ValidationError: Wallet is required` |
|
|
301
|
+
| **Admin** | `getBundlerTransactionResult` | May require wallet for certain operations |
|
|
302
|
+
|
|
303
|
+
**Key Points:**
|
|
304
|
+
- ✅ All read operations work in **read-only mode** without a wallet
|
|
305
|
+
- ✅ Wallet can be added later via `setWallet()` to enable signing operations
|
|
306
|
+
- ✅ Missing wallet throws `ValidationError` with code `WALLET_REQUIRED`
|
|
307
|
+
- ⚠️ Only methods that sign transactions require a wallet
|
|
308
|
+
|
|
309
|
+
## Environment Configuration
|
|
310
|
+
|
|
311
|
+
The SDK supports multiple environments (STAGE and PROD). All demo scripts and examples use a **centralized environment configuration pattern** via `.env` file.
|
|
312
|
+
|
|
313
|
+
### Quick Setup
|
|
314
|
+
|
|
315
|
+
Create/edit `.env` in the repository root:
|
|
316
|
+
|
|
317
|
+
```bash
|
|
318
|
+
# .env
|
|
319
|
+
ENVIRONMENT=STAGE # Switch between STAGE and PROD
|
|
320
|
+
WALLET_PRIVATE_KEY=0x... # Your wallet private key (optional)
|
|
321
|
+
```
|
|
322
|
+
|
|
323
|
+
All demo scripts automatically read from this `.env` file:
|
|
324
|
+
|
|
325
|
+
```bash
|
|
326
|
+
npm run demo:read-only # Uses ENVIRONMENT from .env
|
|
327
|
+
npm run demo:dex # Uses ENVIRONMENT from .env
|
|
328
|
+
npm run demo:liquidity # Uses ENVIRONMENT from .env
|
|
329
|
+
```
|
|
330
|
+
|
|
331
|
+
### Environment Values
|
|
332
|
+
|
|
333
|
+
| Value | Accepts | Use Case |
|
|
334
|
+
|-------|---------|----------|
|
|
335
|
+
| `STAGE` | `STAGE`, `STAGING` | Development/staging |
|
|
336
|
+
| `PROD` | `PROD`, `PRODUCTION` | Production |
|
|
337
|
+
| Default | (if not set) | Defaults to `STAGE` with warning |
|
|
338
|
+
|
|
339
|
+
### SDK Initialization
|
|
340
|
+
|
|
341
|
+
When using demo scripts or examples, the environment is automatically loaded:
|
|
342
|
+
|
|
343
|
+
```typescript
|
|
344
|
+
import { getEnvironment } from './examples/utils/get-environment';
|
|
345
|
+
|
|
346
|
+
const environment = getEnvironment(); // Reads from .env
|
|
347
|
+
const sdk = new LaunchpadSDK({
|
|
348
|
+
env: environment,
|
|
349
|
+
wallet: undefined // Optional
|
|
350
|
+
});
|
|
351
|
+
```
|
|
352
|
+
|
|
353
|
+
### Validation
|
|
354
|
+
|
|
355
|
+
Prevent hardcoded environment values:
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
npm run validate:env # Validates no hardcoded 'STAGE' or 'PROD'
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
### Full Documentation
|
|
362
|
+
|
|
363
|
+
See [docs/ENVIRONMENT_CONFIGURATION.md](./docs/ENVIRONMENT_CONFIGURATION.md) for:
|
|
364
|
+
- Architecture and implementation details
|
|
365
|
+
- Pattern for adding new scripts
|
|
366
|
+
- Troubleshooting guide
|
|
367
|
+
- Migration guide for existing scripts
|
|
368
|
+
|
|
369
|
+
## Token Format Migration (v3.33.0)
|
|
370
|
+
|
|
371
|
+
### Breaking Change: Strict Token Format Enforcement
|
|
372
|
+
|
|
373
|
+
**v3.33.0 removes support for plain token strings** and requires all tokens to use **delimited format**.
|
|
374
|
+
|
|
375
|
+
#### Old Behavior (v3.32.x and below) - DEPRECATED
|
|
376
|
+
|
|
377
|
+
Plain token strings were accepted:
|
|
378
|
+
```typescript
|
|
379
|
+
// ❌ NO LONGER WORKS (v3.33.0+)
|
|
380
|
+
await sdk.addSwapLiquidityByPrice({
|
|
381
|
+
token0: 'GALA', // Plain string
|
|
382
|
+
token1: 'GUSDC', // Plain string
|
|
383
|
+
fee: 3000,
|
|
384
|
+
minPrice: '0.95',
|
|
385
|
+
maxPrice: '1.05',
|
|
386
|
+
amount0Desired: '100',
|
|
387
|
+
amount1Desired: '100'
|
|
388
|
+
});
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
#### New Behavior (v3.33.0+) - REQUIRED
|
|
392
|
+
|
|
393
|
+
All tokens must use **pipe-delimited** (`|`) or **dollar-delimited** (`$`) format:
|
|
394
|
+
|
|
395
|
+
```typescript
|
|
396
|
+
// ✅ REQUIRED FORMAT (v3.33.0+)
|
|
397
|
+
await sdk.addSwapLiquidityByPrice({
|
|
398
|
+
token0: 'GALA|Unit|none|none', // Delimited format
|
|
399
|
+
token1: 'GUSDC|Unit|none|none', // Delimited format
|
|
400
|
+
fee: 3000,
|
|
401
|
+
minPrice: '0.95',
|
|
402
|
+
maxPrice: '1.05',
|
|
403
|
+
amount0Desired: '100',
|
|
404
|
+
amount1Desired: '100'
|
|
405
|
+
});
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
#### Format Options
|
|
409
|
+
|
|
410
|
+
**Pipe-Delimited (Recommended):**
|
|
411
|
+
```typescript
|
|
412
|
+
'GALA|Unit|none|none'
|
|
413
|
+
'GUSDC|Unit|none|none'
|
|
414
|
+
'MYTOKEN|Unit|none|none'
|
|
415
|
+
```
|
|
416
|
+
|
|
417
|
+
**Dollar-Delimited (Alternative):**
|
|
418
|
+
```typescript
|
|
419
|
+
'GALA$Unit$none$none'
|
|
420
|
+
'GUSDC$Unit$none$none'
|
|
421
|
+
'MYTOKEN$Unit$none$none'
|
|
422
|
+
```
|
|
423
|
+
|
|
424
|
+
#### Migration Checklist
|
|
425
|
+
|
|
426
|
+
- [ ] Search codebase for plain token strings: `'GALA'`, `'GUSDC'`, etc.
|
|
427
|
+
- [ ] Replace with delimited format: `'GALA|Unit|none|none'`, `'GUSDC|Unit|none|none'`
|
|
428
|
+
- [ ] Update all SDK method calls that pass token parameters
|
|
429
|
+
- [ ] Test thoroughly - TypeScript strict mode will catch most issues
|
|
430
|
+
- [ ] Update internal token handling code
|
|
431
|
+
|
|
432
|
+
#### Affected Methods
|
|
433
|
+
|
|
434
|
+
The following methods now require delimited token format:
|
|
435
|
+
- `getSwapQuoteExactInput(token0, token1, amount)`
|
|
436
|
+
- `getSwapQuoteExactOutput(token0, token1, amount)`
|
|
437
|
+
- `executeSwap(token0, token1, ...)`
|
|
438
|
+
- `addSwapLiquidityByPrice({token0, token1, ...})`
|
|
439
|
+
- `addSwapLiquidityByTicks({token0, token1, ...})`
|
|
440
|
+
- `removeSwapLiquidity({token0, token1, ...})`
|
|
441
|
+
- `getSwapPoolInfo(token0, token1)`
|
|
442
|
+
|
|
443
|
+
#### Security Rationale
|
|
444
|
+
|
|
445
|
+
This breaking change enforces **strict token format validation** to:
|
|
446
|
+
- ✅ **Prevent injection attacks** via token string manipulation
|
|
447
|
+
- ✅ **Ensure deterministic parsing** with no ambiguous fallbacks
|
|
448
|
+
- ✅ **Eliminate security gaps** from loose string handling
|
|
449
|
+
- ✅ **Force explicit token specification** with full TokenClassKey structure
|
|
450
|
+
|
|
451
|
+
Plain string support created a dangerous "escape hatch" where ambiguous token identifiers could be accepted. v3.33.0 eliminates this by requiring all tokens be properly delimited.
|
|
452
|
+
|
|
453
|
+
## Upgrading to v4.0.0
|
|
454
|
+
|
|
455
|
+
### Breaking Changes: Removed Deprecated Methods
|
|
456
|
+
|
|
457
|
+
**v4.0.0 removes one deprecated method** that was superseded in v3.22.7. This is a clean removal with **minimal migration effort** - most users will not be affected.
|
|
458
|
+
|
|
459
|
+
#### Removed Method: `fetchLaunchpadTokenSpotPrice()`
|
|
460
|
+
|
|
461
|
+
This method was deprecated in v3.22.7 in favor of the more flexible `fetchTokenPrice()` method.
|
|
462
|
+
|
|
463
|
+
**Old Code (v3.35.x and below) - NO LONGER WORKS:**
|
|
464
|
+
```typescript
|
|
465
|
+
// ❌ REMOVED in v4.0.0
|
|
466
|
+
const price = await sdk.fetchLaunchpadTokenSpotPrice('anime');
|
|
467
|
+
console.log(`Price: ${price} USD`);
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
**New Code (v4.0.0+) - REQUIRED:**
|
|
471
|
+
```typescript
|
|
472
|
+
// ✅ REQUIRED - Works for both launchpad and DEX tokens
|
|
473
|
+
const price = await sdk.fetchTokenPrice('anime');
|
|
474
|
+
console.log(`Price: ${price} USD`);
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
#### Why This Change?
|
|
478
|
+
|
|
479
|
+
The new `fetchTokenPrice()` method:
|
|
480
|
+
- ✅ **Unified pricing** - Works for both launchpad tokens and DEX-graduated tokens
|
|
481
|
+
- ✅ **Automatic routing** - Detects token type and fetches from correct backend
|
|
482
|
+
- ✅ **Better performance** - Single method instead of specialized variants
|
|
483
|
+
- ✅ **Cleaner API** - Less method duplication in SDK
|
|
484
|
+
|
|
485
|
+
#### Migration Checklist
|
|
486
|
+
|
|
487
|
+
- [ ] Search codebase for `fetchLaunchpadTokenSpotPrice(`
|
|
488
|
+
- [ ] Replace all occurrences with `fetchTokenPrice(`
|
|
489
|
+
- [ ] Test with both launchpad tokens (e.g., `'anime'`) and DEX tokens
|
|
490
|
+
- [ ] Verify price results haven't changed (same calculation logic)
|
|
491
|
+
|
|
492
|
+
#### Impact Assessment
|
|
493
|
+
|
|
494
|
+
**Affected Users:**
|
|
495
|
+
- ⚠️ **Only if you explicitly called** `fetchLaunchpadTokenSpotPrice()`
|
|
496
|
+
- ✅ **Not affected if you** used `fetchTokenPrice()` or `fetchTokenSpotPrice()` methods
|
|
497
|
+
- ✅ **Not affected if you** never queried token prices
|
|
498
|
+
|
|
499
|
+
**Migration Effort:**
|
|
500
|
+
- ⏱️ **5 minutes** - Simple find/replace across codebase
|
|
501
|
+
- ⚙️ **Zero logic changes** - Functionality remains identical
|
|
502
|
+
- 🎯 **Low risk** - Price calculation algorithm unchanged
|
|
503
|
+
|
|
504
|
+
### New Features: Service Clients Documentation
|
|
505
|
+
|
|
506
|
+
v4.0.0 adds internal service client documentation for advanced users who need direct access to underlying blockchain services.
|
|
507
|
+
|
|
508
|
+
```typescript
|
|
509
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
510
|
+
|
|
511
|
+
const sdk = createLaunchpadSDK({
|
|
512
|
+
wallet: 'your-private-key'
|
|
513
|
+
});
|
|
514
|
+
|
|
515
|
+
// Advanced: Direct access to DEX Backend API
|
|
516
|
+
// Use case: Custom swap parameters or debugging
|
|
517
|
+
const quote = await sdk.dexBackendClient.querySwapQuote({
|
|
518
|
+
orderedTokens: [...],
|
|
519
|
+
zeroForOne: false,
|
|
520
|
+
inputAmount: '10',
|
|
521
|
+
// ... additional parameters
|
|
522
|
+
});
|
|
523
|
+
|
|
524
|
+
// Advanced: Direct access to GalaChain Gateway
|
|
525
|
+
// Use case: Custom transaction building
|
|
526
|
+
const result = await sdk.galaChainGatewayClient.callContract({
|
|
527
|
+
address: 'contract-address',
|
|
528
|
+
method: 'transfer',
|
|
529
|
+
// ... parameters
|
|
530
|
+
});
|
|
531
|
+
```
|
|
532
|
+
|
|
533
|
+
**⚠️ Important:** Service clients are internal implementation details. For standard operations, always use public SDK methods:
|
|
534
|
+
- ✅ Use `sdk.buy()` instead of `sdk.galaChainGatewayClient`
|
|
535
|
+
- ✅ Use `sdk.executeSwap()` instead of `sdk.dexBackendClient`
|
|
536
|
+
- ✅ These public methods provide better error handling and validation
|
|
537
|
+
|
|
538
|
+
For detailed service client documentation, see [docs/API-REFERENCE.md#service-clients](./docs/API-REFERENCE.md#service-clients).
|
|
539
|
+
|
|
540
|
+
### Migration Summary
|
|
541
|
+
|
|
542
|
+
**For Most Users:** Nothing to do! v4.0.0 is backward compatible except for the removal of `fetchLaunchpadTokenSpotPrice()`.
|
|
543
|
+
|
|
544
|
+
**If You Used `fetchLaunchpadTokenSpotPrice()`:** Replace with `fetchTokenPrice()` - identical functionality, better flexibility.
|
|
545
|
+
|
|
546
|
+
**If You Need Service Client Access:** They're now documented and available for advanced use cases, but use public SDK methods when possible.
|
|
547
|
+
|
|
548
|
+
## DEX Pool Discovery & Analysis
|
|
549
|
+
|
|
550
|
+
### Overview
|
|
551
|
+
|
|
552
|
+
The SDK provides complete DEX liquidity pool discovery for GalaSwap with filtering, sorting, and pagination. Perfect for finding trading pairs, analyzing pool metrics, and discovering investment opportunities.
|
|
553
|
+
|
|
554
|
+
```typescript
|
|
555
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
556
|
+
|
|
557
|
+
const sdk = createLaunchpadSDK({});
|
|
558
|
+
|
|
559
|
+
// Discover DEX pools with filtering
|
|
560
|
+
const pools = await sdk.fetchDexPools({
|
|
561
|
+
search: 'GALA', // Filter by token symbol
|
|
562
|
+
sortBy: 'tvl', // Sort options: tvl, volume30d, volume1d
|
|
563
|
+
sortOrder: 'desc', // asc or desc
|
|
564
|
+
page: 1, // Pagination (default: 1)
|
|
565
|
+
limit: 10 // Results per page (default: 10, max: 20)
|
|
566
|
+
});
|
|
567
|
+
|
|
568
|
+
console.log(`Found ${pools.meta.total} total pools`);
|
|
569
|
+
console.log(`Showing ${pools.items.length} pools on page ${pools.meta.page}`);
|
|
570
|
+
|
|
571
|
+
// Fetch ALL pools with automatic pagination
|
|
572
|
+
const allPools = await sdk.fetchAllDexPools({
|
|
573
|
+
search: 'GUSDC',
|
|
574
|
+
sortBy: 'volume30d',
|
|
575
|
+
sortOrder: 'asc'
|
|
576
|
+
});
|
|
577
|
+
|
|
578
|
+
console.log(`Retrieved ${allPools.items.length} total pools`);
|
|
579
|
+
```
|
|
580
|
+
|
|
581
|
+
### Pool Data Structure
|
|
582
|
+
|
|
583
|
+
Each DEX pool includes comprehensive trading metrics:
|
|
584
|
+
|
|
585
|
+
```typescript
|
|
586
|
+
interface DexPoolData {
|
|
587
|
+
poolPair: string; // e.g., "GALA/GUSDC"
|
|
588
|
+
poolHash: string; // Unique pool identifier
|
|
589
|
+
token0: string; // Token A symbol
|
|
590
|
+
token1: string; // Token B symbol
|
|
591
|
+
token0Price: string; // Token A USD price
|
|
592
|
+
token1Price: string; // Token B USD price
|
|
593
|
+
fee: string; // Fee tier (0.05%, 0.30%, 1.00%)
|
|
594
|
+
fee24h: number; // 24h accumulated fees
|
|
595
|
+
tvl: number; // Total Value Locked (USD)
|
|
596
|
+
token0Tvl: number; // TVL in Token A
|
|
597
|
+
token1Tvl: number; // TVL in Token B
|
|
598
|
+
token0TvlUsd: number; // Token A TVL in USD
|
|
599
|
+
token1TvlUsd: number; // Token B TVL in USD
|
|
600
|
+
volume1d: number; // 24h trading volume
|
|
601
|
+
volume30d: number; // 30d trading volume
|
|
602
|
+
apr1d: number; // 24h APR for liquidity providers
|
|
603
|
+
dayPerTvl: number; // Fee ratio (volume/TVL)
|
|
604
|
+
}
|
|
605
|
+
```
|
|
606
|
+
|
|
607
|
+
### Common Use Cases
|
|
608
|
+
|
|
609
|
+
**Find high-volume pools:**
|
|
610
|
+
```typescript
|
|
611
|
+
const highVolumePoolsAsc = await sdk.fetchAllDexPools({
|
|
612
|
+
sortBy: 'volume1d',
|
|
613
|
+
sortOrder: 'desc'
|
|
614
|
+
});
|
|
615
|
+
|
|
616
|
+
const topPool = highVolumePoolsAsc.items[0];
|
|
617
|
+
console.log(`Highest volume pair: ${topPool.poolPair}`);
|
|
618
|
+
console.log(`24h Volume: $${topPool.volume1d}`);
|
|
619
|
+
console.log(`APR: ${topPool.apr1d.toFixed(2)}%`);
|
|
620
|
+
```
|
|
621
|
+
|
|
622
|
+
**Discover GALA trading pairs:**
|
|
623
|
+
```typescript
|
|
624
|
+
const galaPools = await sdk.fetchDexPools({
|
|
625
|
+
search: 'GALA',
|
|
626
|
+
sortBy: 'tvl',
|
|
627
|
+
limit: 20
|
|
628
|
+
});
|
|
629
|
+
|
|
630
|
+
galaPools.items.forEach(pool => {
|
|
631
|
+
console.log(`${pool.poolPair}: $${pool.tvl.toLocaleString()} TVL`);
|
|
632
|
+
});
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
**Analyze liquidity provider opportunities:**
|
|
636
|
+
```typescript
|
|
637
|
+
const liquidityOpportunities = await sdk.fetchAllDexPools({
|
|
638
|
+
sortBy: 'apr1d',
|
|
639
|
+
sortOrder: 'desc'
|
|
640
|
+
});
|
|
641
|
+
|
|
642
|
+
// Find pools with highest APR
|
|
643
|
+
const bestAprPools = liquidityOpportunities.items.slice(0, 10);
|
|
644
|
+
bestAprPools.forEach(pool => {
|
|
645
|
+
console.log(`${pool.poolPair}: ${pool.apr1d.toFixed(2)}% APR`);
|
|
646
|
+
});
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
### Sorting Options
|
|
650
|
+
|
|
651
|
+
| Sort Value | Description | Best For |
|
|
652
|
+
|-----------|-------------|----------|
|
|
653
|
+
| `tvl` (default) | Total Value Locked | Finding main liquidity pools |
|
|
654
|
+
| `volume1d` | 24-hour trading volume | High-activity pairs |
|
|
655
|
+
| `volume30d` | 30-day trading volume | Trend analysis |
|
|
656
|
+
|
|
657
|
+
### Pagination
|
|
658
|
+
|
|
659
|
+
The SDK enforces a **maximum of 20 items per page** (backend limit). Use `fetchAllDexPools()` for complete enumeration:
|
|
660
|
+
|
|
661
|
+
```typescript
|
|
662
|
+
// Page-by-page discovery (20 max per page)
|
|
663
|
+
const page1 = await sdk.fetchDexPools({ page: 1, limit: 20 });
|
|
664
|
+
console.log(`Page 1: ${page1.items.length} pools`);
|
|
665
|
+
console.log(`Total pages: ${page1.meta.totalPages}`);
|
|
666
|
+
console.log(`Has next: ${page1.meta.page < page1.meta.totalPages}`);
|
|
667
|
+
|
|
668
|
+
// Automatic pagination - get all at once
|
|
669
|
+
const allAtOnce = await sdk.fetchAllDexPools();
|
|
670
|
+
console.log(`All pools: ${allAtOnce.items.length}`);
|
|
671
|
+
```
|
|
672
|
+
|
|
673
|
+
### Development vs Production Environments
|
|
674
|
+
|
|
675
|
+
The SDK automatically uses the correct DEX backend based on your environment configuration:
|
|
676
|
+
|
|
677
|
+
```typescript
|
|
678
|
+
// Production (default)
|
|
679
|
+
const prodSdk = createLaunchpadSDK({
|
|
680
|
+
environment: 'production' // Uses prod DEX backend
|
|
681
|
+
});
|
|
682
|
+
|
|
683
|
+
// Development
|
|
684
|
+
const devSdk = createLaunchpadSDK({
|
|
685
|
+
environment: 'development' // Uses dev DEX backend
|
|
686
|
+
});
|
|
687
|
+
|
|
688
|
+
// Custom URL
|
|
689
|
+
const customSdk = createLaunchpadSDK({
|
|
690
|
+
dexBackendBaseUrl: 'https://custom-dex.example.com'
|
|
691
|
+
});
|
|
692
|
+
```
|
|
693
|
+
|
|
694
|
+
## WebSocket Event Watchers (v3.29.0+)
|
|
695
|
+
|
|
696
|
+
Real-time event monitoring for DEX pools and launchpad tokens using polling-based watchers with automatic deduplication.
|
|
697
|
+
|
|
698
|
+
### Public WebSocket Methods
|
|
699
|
+
|
|
700
|
+
Connect and manage WebSocket connections for real-time event subscriptions:
|
|
701
|
+
|
|
702
|
+
```typescript
|
|
703
|
+
// Connect to WebSocket
|
|
704
|
+
sdk.connectWebSocket();
|
|
705
|
+
|
|
706
|
+
// Check connection status
|
|
707
|
+
if (sdk.isWebSocketConnected()) {
|
|
708
|
+
console.log('✅ WebSocket connected');
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
// Subscribe to custom WebSocket events
|
|
712
|
+
const unsubscribe = sdk.subscribeToEvent<MyEventType>('custom-channel', (data) => {
|
|
713
|
+
console.log('Event received:', data);
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
// Cleanup when done
|
|
717
|
+
unsubscribe();
|
|
718
|
+
|
|
719
|
+
// Disconnect from WebSocket
|
|
720
|
+
sdk.disconnectWebSocket();
|
|
721
|
+
```
|
|
722
|
+
|
|
723
|
+
### Event Watchers: Real-Time Pool & Token Discovery
|
|
724
|
+
|
|
725
|
+
Watch for new DEX pools and launchpad tokens with optional filtering and automatic deduplication.
|
|
726
|
+
|
|
727
|
+
#### Watch DEX Pool Creation
|
|
728
|
+
|
|
729
|
+
Monitor new liquidity pool creation with TVL and token pair filtering:
|
|
730
|
+
|
|
731
|
+
```typescript
|
|
732
|
+
const unsubscribe = sdk.onDexPoolCreation(
|
|
733
|
+
(pool) => {
|
|
734
|
+
console.log(`✨ New pool: ${pool.poolName}`);
|
|
735
|
+
console.log(` Pair: ${pool.token0} / ${pool.token1}`);
|
|
736
|
+
console.log(` TVL: $${pool.tvl.toFixed(2)}`);
|
|
737
|
+
console.log(` 24h Volume: $${pool.volume1d.toFixed(2)}`);
|
|
738
|
+
},
|
|
739
|
+
{
|
|
740
|
+
minTVL: 10000, // Only notify for pools with TVL >= $10,000
|
|
741
|
+
tokens: ['GALA', 'GUSDC'], // Only GALA or GUSDC pairs
|
|
742
|
+
intervalMs: 30000 // Poll every 30 seconds (default)
|
|
743
|
+
}
|
|
744
|
+
);
|
|
745
|
+
|
|
746
|
+
// Stop watching after some time
|
|
747
|
+
setTimeout(() => {
|
|
748
|
+
unsubscribe();
|
|
749
|
+
console.log('Stopped watching for new pools');
|
|
750
|
+
}, 300000); // 5 minutes
|
|
751
|
+
```
|
|
752
|
+
|
|
753
|
+
#### Watch Launchpad Token Creation
|
|
754
|
+
|
|
755
|
+
Monitor new token launches with optional creator filtering:
|
|
756
|
+
|
|
757
|
+
```typescript
|
|
758
|
+
const unsubscribe = sdk.onLaunchpadTokenCreation(
|
|
759
|
+
(token) => {
|
|
760
|
+
console.log(`🚀 New token: ${token.tokenName}`);
|
|
761
|
+
console.log(` Symbol: ${token.symbol}`);
|
|
762
|
+
console.log(` Creator: ${token.creatorAddress}`);
|
|
763
|
+
console.log(` Created: ${new Date(token.createdAt).toISOString()}`);
|
|
764
|
+
},
|
|
765
|
+
{
|
|
766
|
+
creatorAddress: 'eth|0x1234...', // Only watch specific creator (optional)
|
|
767
|
+
intervalMs: 30000 // Poll every 30 seconds (default)
|
|
768
|
+
}
|
|
769
|
+
);
|
|
770
|
+
|
|
771
|
+
// Example: Watch all tokens for 2 minutes
|
|
772
|
+
setTimeout(() => {
|
|
773
|
+
unsubscribe();
|
|
774
|
+
console.log('Stopped watching for new tokens');
|
|
775
|
+
}, 120000);
|
|
776
|
+
```
|
|
777
|
+
|
|
778
|
+
### Key Characteristics
|
|
779
|
+
|
|
780
|
+
- **Polling-Based**: Intelligent polling with configurable intervals (recommended minimum: 5 seconds)
|
|
781
|
+
- **Automatic Deduplication**: Prevents duplicate callbacks for the same pool/token
|
|
782
|
+
- **Client-Side Filtering**: Minimizes API calls with local filtering (minTVL, token pairs, creator address)
|
|
783
|
+
- **Cleanup Functions**: All watchers return cleanup functions for proper resource management
|
|
784
|
+
- **Error Resilience**: Watchers continue polling after errors without blocking
|
|
785
|
+
- **Long-Running Support**: Suitable for background monitoring in production applications
|
|
786
|
+
|
|
787
|
+
### Demo Scripts
|
|
788
|
+
|
|
789
|
+
Try the event watcher examples:
|
|
790
|
+
|
|
791
|
+
```bash
|
|
792
|
+
# Watch for new DEX pools
|
|
793
|
+
npm run demo:watch-pools
|
|
794
|
+
|
|
795
|
+
# Watch for new launchpad tokens
|
|
796
|
+
npm run demo:watch-tokens
|
|
797
|
+
```
|
|
798
|
+
|
|
799
|
+
## AI Agent Integration
|
|
800
|
+
|
|
801
|
+
### For Claude Desktop Users
|
|
802
|
+
|
|
803
|
+
Install the MCP server to enable Claude to interact with Gala Launchpad directly:
|
|
804
|
+
|
|
805
|
+
**Full-Access Mode** (with wallet for executing trades):
|
|
806
|
+
```bash
|
|
807
|
+
claude mcp add "galachain-launchpad" -- env PRIVATE_KEY=<YOUR_PRIVATE_KEY> ENVIRONMENT=development npx -y @gala-chain/launchpad-mcp-server@latest
|
|
808
|
+
```
|
|
809
|
+
|
|
810
|
+
**Read-Only Mode** (query data without wallet):
|
|
811
|
+
```bash
|
|
812
|
+
claude mcp add "galachain-launchpad-readonly" -- env ENVIRONMENT=development npx -y @gala-chain/launchpad-mcp-server@latest
|
|
813
|
+
```
|
|
814
|
+
|
|
815
|
+
**Environment Variables:**
|
|
816
|
+
- `PRIVATE_KEY` (optional) - Your wallet private key (omit for read-only mode)
|
|
817
|
+
- `ENVIRONMENT` - Backend environment: `development` | `production` (default: production)
|
|
818
|
+
- `DEBUG` - Enable debug logging: `true` | `false` (default: false)
|
|
819
|
+
- `TIMEOUT` - Request timeout in milliseconds (default: 30000)
|
|
820
|
+
|
|
821
|
+
**Features**: 224 tools for complete Gala Launchpad operations including:
|
|
822
|
+
- Pool management, pricing, and token discovery
|
|
823
|
+
- Token trading with slippage protection
|
|
824
|
+
- Token creation and management
|
|
825
|
+
- Balance and portfolio queries
|
|
826
|
+
- Wallet status checking and configuration
|
|
827
|
+
- Price history and analysis (Node.js only)
|
|
828
|
+
- Comments and social features
|
|
829
|
+
- Transfers and transactions
|
|
830
|
+
|
|
831
|
+
See: [MCP Server Documentation](../../mcp-server/README.md)
|
|
832
|
+
|
|
833
|
+
**Try slash commands** (MCP v1.4.0+):
|
|
834
|
+
```
|
|
835
|
+
/galachain-launchpad:analyze-token tokenName=anime
|
|
836
|
+
/galachain-launchpad:portfolio
|
|
837
|
+
/galachain-launchpad:buy-tokens tokenName=anime galaAmount=100
|
|
838
|
+
```
|
|
839
|
+
|
|
840
|
+
### For AI Developers
|
|
841
|
+
|
|
842
|
+
Need help with SDK integration, trading bots, or MCP server development?
|
|
843
|
+
|
|
844
|
+
Ask **[@agent-galachain-launchpad-developer](../../@agent-galachain-launchpad-developer.md)** - a specialized AI agent with expertise in:
|
|
845
|
+
- Complete SDK API (230+ methods)
|
|
846
|
+
- Optional wallet configuration and dual operational modes
|
|
847
|
+
- Trading patterns and DeFi best practices
|
|
848
|
+
- MCP server architecture
|
|
849
|
+
- Error handling strategies
|
|
850
|
+
- Performance optimization
|
|
851
|
+
|
|
852
|
+
**Full Integration Guide**: [AI Agent Guide](./docs/AI-AGENT-GUIDE.md)
|
|
853
|
+
|
|
854
|
+
## Quick Start
|
|
855
|
+
|
|
856
|
+
### Using Helper Functions (Recommended)
|
|
857
|
+
|
|
858
|
+
```typescript
|
|
859
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
860
|
+
|
|
861
|
+
// Auto-detecting SDK creation (easiest method)
|
|
862
|
+
const sdk = createLaunchpadSDK({
|
|
863
|
+
wallet: 'your-private-key-or-mnemonic' // Auto-detects format!
|
|
864
|
+
});
|
|
865
|
+
|
|
866
|
+
// Clean, direct result access - All methods use options objects
|
|
867
|
+
|
|
868
|
+
// Pool Management - Direct result properties
|
|
869
|
+
const pools = await sdk.fetchPools({ type: 'recent', limit: 10 });
|
|
870
|
+
console.log(`Found ${pools.total} pools across ${pools.totalPages} pages`);
|
|
871
|
+
console.log(`Current page: ${pools.page}, Has next: ${pools.hasNext}`);
|
|
872
|
+
|
|
873
|
+
const badges = await sdk.fetchTokenBadges('dragnrkti');
|
|
874
|
+
console.log(`Volume badges: ${badges.volumeBadges.length}`);
|
|
875
|
+
console.log(`Engagement badges: ${badges.engagementBadges.length}`);
|
|
876
|
+
|
|
877
|
+
const details = await sdk.fetchPoolDetails('dragnrkti');
|
|
878
|
+
console.log(`Sale status: ${details.saleStatus}`);
|
|
879
|
+
console.log(`Native token quantity: ${details.nativeTokenQuantity}`);
|
|
880
|
+
|
|
881
|
+
// Price Calculations - Direct amount access
|
|
882
|
+
const buyAmount = await sdk.calculateBuyAmount({
|
|
883
|
+
tokenName: 'dragnrkti',
|
|
884
|
+
amount: '1', // 1 GALA
|
|
885
|
+
type: 'native'
|
|
886
|
+
});
|
|
887
|
+
console.log(`Buy amount: ${buyAmount.amount}`);
|
|
888
|
+
console.log(`Transaction fee: ${buyAmount.transactionFee}`);
|
|
889
|
+
|
|
890
|
+
// Trading Operations - Required expectedAmount and slippageToleranceFactor
|
|
891
|
+
const buyResult = await sdk.buy({
|
|
892
|
+
tokenName: 'dragnrkti',
|
|
893
|
+
amount: '1',
|
|
894
|
+
type: 'native',
|
|
895
|
+
expectedAmount: buyAmount.amount, // Required: from calculation
|
|
896
|
+
slippageToleranceFactor: 0.05 // Required: decimal format (5% slippage)
|
|
897
|
+
});
|
|
898
|
+
console.log(`Transaction ID: ${buyResult.transactionId}`);
|
|
899
|
+
|
|
900
|
+
// Data & Analytics - Clean pagination
|
|
901
|
+
const trades = await sdk.fetchTrades({ tokenName: 'dragnrkti' });
|
|
902
|
+
console.log(`Found ${trades.meta.total} trades`);
|
|
903
|
+
console.log(`Page ${trades.meta.page} of ${trades.meta.totalPages}`);
|
|
904
|
+
trades.items.forEach(trade => {
|
|
905
|
+
console.log(`Trade: ${trade.tradeType} ${trade.tokenAmount} at ${trade.createdAt.toISOString()}`);
|
|
906
|
+
});
|
|
907
|
+
|
|
908
|
+
const comments = await sdk.fetchComments({ tokenName: 'dragnrkti' });
|
|
909
|
+
console.log(`${comments.meta.total} comments found`);
|
|
910
|
+
|
|
911
|
+
// User Operations - Direct balance access
|
|
912
|
+
const galaBalance = await sdk.fetchGalaBalance();
|
|
913
|
+
console.log(`GALA Balance: ${galaBalance.balance}`);
|
|
914
|
+
console.log(`Last updated: ${galaBalance.lastUpdated.toISOString()}`);
|
|
915
|
+
|
|
916
|
+
const tokenBalance = await sdk.fetchTokenBalance({
|
|
917
|
+
tokenName: 'dragnrkti',
|
|
918
|
+
address: sdk.getAddress()
|
|
919
|
+
});
|
|
920
|
+
console.log(`Token balance: ${tokenBalance.quantity}`);
|
|
921
|
+
console.log(`USD value: $${tokenBalance.holdingPriceUsd}`);
|
|
922
|
+
|
|
923
|
+
// Profile - Direct user data
|
|
924
|
+
const profile = await sdk.fetchProfile();
|
|
925
|
+
console.log(`Profile name: ${profile.fullName || 'Not set'}`);
|
|
926
|
+
|
|
927
|
+
// URL Utilities - Generate frontend URLs
|
|
928
|
+
const tokenUrl = sdk.getUrlByTokenName('dragnrkti');
|
|
929
|
+
console.log(`View token: ${tokenUrl}`);
|
|
930
|
+
// Output: https://lpad-frontend-test1.defi.gala.com/buy-sell/dragnrkti
|
|
931
|
+
```
|
|
932
|
+
|
|
933
|
+
## Auto-Pagination Feature
|
|
934
|
+
|
|
935
|
+
The SDK now supports automatic pagination for pool fetching with three powerful modes:
|
|
936
|
+
|
|
937
|
+
### Three Pagination Modes
|
|
938
|
+
|
|
939
|
+
```typescript
|
|
940
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
941
|
+
|
|
942
|
+
const sdk = createLaunchpadSDK({
|
|
943
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
944
|
+
});
|
|
945
|
+
|
|
946
|
+
// MODE 1: Single Page (backward compatible)
|
|
947
|
+
// Limit <= 20: Single API call
|
|
948
|
+
const recent = await sdk.fetchPools({ type: 'recent', limit: 20 });
|
|
949
|
+
console.log(`Fetched ${recent.items.length} pools in one request`);
|
|
950
|
+
|
|
951
|
+
// MODE 2: Multi-Page Auto-Fetch
|
|
952
|
+
// Limit > 20: Automatic concurrent multi-page fetching
|
|
953
|
+
const large = await sdk.fetchPools({ type: 'popular', limit: 100 });
|
|
954
|
+
console.log(`Fetched ${large.items.length} pools across multiple pages`);
|
|
955
|
+
// Internally fetches 5 pages concurrently: 20+20+20+20+20 = 100 pools
|
|
956
|
+
|
|
957
|
+
// MODE 3: Infinite Fetch
|
|
958
|
+
// Limit = 0: Fetches ALL available pools
|
|
959
|
+
const all = await sdk.fetchPools({ limit: 0 });
|
|
960
|
+
console.log(`Fetched all ${all.items.length} pools from the platform`);
|
|
961
|
+
|
|
962
|
+
// Convenience method for "fetch all" pattern
|
|
963
|
+
const allRecent = await sdk.fetchAllPools({ type: 'recent' });
|
|
964
|
+
console.log(`Total pools: ${allRecent.meta.total}`);
|
|
965
|
+
```
|
|
966
|
+
|
|
967
|
+
### Concurrency Configuration
|
|
968
|
+
|
|
969
|
+
The SDK uses `MAX_CONCURRENT_POOL_FETCHES` to control parallel API requests:
|
|
970
|
+
|
|
971
|
+
```typescript
|
|
972
|
+
import { MAX_CONCURRENT_POOL_FETCHES } from '@gala-chain/launchpad-sdk';
|
|
973
|
+
|
|
974
|
+
console.log(`SDK fetches up to ${MAX_CONCURRENT_POOL_FETCHES} pages concurrently`);
|
|
975
|
+
// Output: "SDK fetches up to 5 pages concurrently"
|
|
976
|
+
```
|
|
977
|
+
|
|
978
|
+
**Default**: 5 concurrent requests
|
|
979
|
+
**Benefit**: Balances speed with API rate limits
|
|
980
|
+
|
|
981
|
+
### Performance Benefits
|
|
982
|
+
|
|
983
|
+
| Scenario | Pages Fetched | Network Calls | Time (Sequential) | Time (Concurrent) | Improvement |
|
|
984
|
+
|----------|---------------|---------------|-------------------|-------------------|-------------|
|
|
985
|
+
| 20 pools | 1 page | 1 call | ~200ms | ~200ms | No change |
|
|
986
|
+
| 100 pools | 5 pages | 5 calls | ~1000ms | ~200ms | 5x faster |
|
|
987
|
+
| 500 pools | 25 pages | 25 calls | ~5000ms | ~1000ms | 5x faster |
|
|
988
|
+
| All pools (1000+) | 50+ pages | 50+ calls | ~10,000ms | ~2000ms | 5x faster |
|
|
989
|
+
|
|
990
|
+
### When to Use Each Mode
|
|
991
|
+
|
|
992
|
+
**Single Page (limit <= 20)**
|
|
993
|
+
- Quick queries
|
|
994
|
+
- UI pagination with next/previous buttons
|
|
995
|
+
- When you only need recent results
|
|
996
|
+
|
|
997
|
+
**Multi-Page (limit > 20)**
|
|
998
|
+
- Analytics dashboards
|
|
999
|
+
- Bulk operations on specific token counts
|
|
1000
|
+
- When you know how many results you need
|
|
1001
|
+
|
|
1002
|
+
**Infinite (limit = 0 or fetchAllPools())**
|
|
1003
|
+
- Complete market scans
|
|
1004
|
+
- Full portfolio analysis
|
|
1005
|
+
- Trading bot initialization
|
|
1006
|
+
- Data exports and backups
|
|
1007
|
+
|
|
1008
|
+
### Example: Market Scanner
|
|
1009
|
+
|
|
1010
|
+
```typescript
|
|
1011
|
+
async function scanEntireMarket() {
|
|
1012
|
+
// Fetch all pools at once (auto-pagination handles everything)
|
|
1013
|
+
const allPools = await sdk.fetchAllPools({ type: 'popular' });
|
|
1014
|
+
|
|
1015
|
+
console.log(`Scanning ${allPools.meta.total} pools...`);
|
|
1016
|
+
|
|
1017
|
+
// Filter for interesting opportunities
|
|
1018
|
+
const highVolume = allPools.items.filter(pool =>
|
|
1019
|
+
parseFloat(pool.volumeGala) > 10000
|
|
1020
|
+
);
|
|
1021
|
+
|
|
1022
|
+
console.log(`Found ${highVolume.length} high-volume pools`);
|
|
1023
|
+
|
|
1024
|
+
return highVolume;
|
|
1025
|
+
}
|
|
1026
|
+
```
|
|
1027
|
+
|
|
1028
|
+
### New Methods
|
|
1029
|
+
|
|
1030
|
+
**fetchAllPools(options?)**
|
|
1031
|
+
|
|
1032
|
+
Convenience method that automatically fetches all available pools:
|
|
1033
|
+
|
|
1034
|
+
```typescript
|
|
1035
|
+
// Fetch all recent pools
|
|
1036
|
+
const allRecent = await sdk.fetchAllPools({ type: 'recent' });
|
|
1037
|
+
|
|
1038
|
+
// Fetch all pools matching search
|
|
1039
|
+
const dragons = await sdk.fetchAllPools({ search: 'dragon' });
|
|
1040
|
+
|
|
1041
|
+
// Fetch specific token across all results
|
|
1042
|
+
const specific = await sdk.fetchAllPools({ tokenName: 'anime' });
|
|
1043
|
+
|
|
1044
|
+
// Equivalent to fetchPools({ limit: 0 })
|
|
1045
|
+
const all = await sdk.fetchAllPools();
|
|
1046
|
+
```
|
|
1047
|
+
|
|
1048
|
+
### Stream Filtering (v5.7.0+)
|
|
1049
|
+
|
|
1050
|
+
Filter pools by streaming activity and language:
|
|
1051
|
+
|
|
1052
|
+
```typescript
|
|
1053
|
+
// Find pools with upcoming scheduled shows
|
|
1054
|
+
const upcomingShows = await sdk.fetchPools({ hasUpcomingShows: true });
|
|
1055
|
+
|
|
1056
|
+
// Find pools that recently went live (last 24 hours)
|
|
1057
|
+
const recentlyLive = await sdk.fetchPools({ recentlyStreamed: 24 });
|
|
1058
|
+
|
|
1059
|
+
// Find active streaming communities (last week)
|
|
1060
|
+
const activeCommunities = await sdk.fetchAllPools({ recentlyStreamed: 168 });
|
|
1061
|
+
|
|
1062
|
+
// Filter by stream language (ISO 639-1 codes)
|
|
1063
|
+
const englishPools = await sdk.fetchPools({ language: 'en' });
|
|
1064
|
+
const spanishPools = await sdk.fetchPools({ language: 'es' });
|
|
1065
|
+
|
|
1066
|
+
// Pool data includes stream stats
|
|
1067
|
+
const pools = await sdk.fetchPools({ type: 'popular' });
|
|
1068
|
+
pools.items.forEach(pool => {
|
|
1069
|
+
console.log(`${pool.tokenName}:`);
|
|
1070
|
+
console.log(` Viewers: ${pool.currentViewerCount || 0}`);
|
|
1071
|
+
console.log(` Peak viewers: ${pool.peakViewerCount || 0}`);
|
|
1072
|
+
console.log(` Last streamed: ${pool.lastStreamedAt || 'Never'}`);
|
|
1073
|
+
});
|
|
1074
|
+
```
|
|
1075
|
+
|
|
1076
|
+
### Manual SDK Creation (Alternative)
|
|
1077
|
+
|
|
1078
|
+
```typescript
|
|
1079
|
+
import { Wallet } from 'ethers';
|
|
1080
|
+
import { LaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
1081
|
+
|
|
1082
|
+
// Create wallet manually
|
|
1083
|
+
const wallet = new Wallet(process.env.PRIVATE_KEY);
|
|
1084
|
+
|
|
1085
|
+
// Initialize SDK
|
|
1086
|
+
const sdk = new LaunchpadSDK({
|
|
1087
|
+
wallet: wallet,
|
|
1088
|
+
baseUrl: 'https://lpad-backend-dev1.defi.gala.com',
|
|
1089
|
+
timeout: 30000,
|
|
1090
|
+
debug: false
|
|
1091
|
+
});
|
|
1092
|
+
|
|
1093
|
+
// Same clean API available
|
|
1094
|
+
const pools = await sdk.fetchPools({ type: 'recent' });
|
|
1095
|
+
console.log(`${pools.total} pools found`);
|
|
1096
|
+
```
|
|
1097
|
+
|
|
1098
|
+
## Complete Example: Trading Flow with Clean Results
|
|
1099
|
+
|
|
1100
|
+
```typescript
|
|
1101
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
1102
|
+
|
|
1103
|
+
// 1. Create SDK with auto-detection
|
|
1104
|
+
const sdk = createLaunchpadSDK({
|
|
1105
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
1106
|
+
});
|
|
1107
|
+
|
|
1108
|
+
// 2. Check available pools - direct access to results
|
|
1109
|
+
const pools = await sdk.fetchPools({
|
|
1110
|
+
type: 'recent',
|
|
1111
|
+
limit: 10
|
|
1112
|
+
});
|
|
1113
|
+
|
|
1114
|
+
console.log(`Found ${pools.meta.total} pools across ${pools.meta.totalPages} pages`);
|
|
1115
|
+
pools.items.forEach(pool => {
|
|
1116
|
+
console.log(`Pool: ${pool.tokenName} created at ${pool.createdAt}`);
|
|
1117
|
+
});
|
|
1118
|
+
|
|
1119
|
+
// 3. Get price quote - direct amount access
|
|
1120
|
+
const quote = await sdk.calculateBuyAmount({
|
|
1121
|
+
tokenName: 'tinyevil',
|
|
1122
|
+
amount: '100',
|
|
1123
|
+
type: 'native'
|
|
1124
|
+
});
|
|
1125
|
+
|
|
1126
|
+
console.log(`Buying 100 GALA worth will get you: ${quote.amount} TINYEVIL`);
|
|
1127
|
+
console.log(`Transaction fee: ${quote.transactionFee} GALA`);
|
|
1128
|
+
console.log(`Reverse bonding curve fee: ${quote.reverseBondingCurveFee} GALA`);
|
|
1129
|
+
|
|
1130
|
+
// 4. Execute trade with slippage protection - requires expectedAmount
|
|
1131
|
+
const buyResult = await sdk.buy({
|
|
1132
|
+
tokenName: 'tinyevil',
|
|
1133
|
+
amount: '100',
|
|
1134
|
+
type: 'native',
|
|
1135
|
+
expectedAmount: quote.amount, // Required: from calculation above
|
|
1136
|
+
slippageToleranceFactor: 0.05 // Required: decimal format for 5% slippage
|
|
1137
|
+
});
|
|
1138
|
+
|
|
1139
|
+
console.log(`Transaction submitted: ${buyResult.transactionId}`);
|
|
1140
|
+
|
|
1141
|
+
// 5. Check trade history - clean pagination
|
|
1142
|
+
const trades = await sdk.fetchTrades({ tokenName: 'tinyevil' });
|
|
1143
|
+
console.log(`Found ${trades.meta.total} trades on page ${trades.meta.page}`);
|
|
1144
|
+
console.log(`Has more pages: ${trades.meta.page < trades.meta.totalPages}`);
|
|
1145
|
+
|
|
1146
|
+
trades.items.forEach(trade => {
|
|
1147
|
+
console.log(`${trade.tradeType}: ${trade.tokenAmount} at ${trade.createdAt.toISOString()}`);
|
|
1148
|
+
});
|
|
1149
|
+
|
|
1150
|
+
// 6. Post a comment about your trade
|
|
1151
|
+
const comment = await sdk.postComment({
|
|
1152
|
+
tokenName: 'tinyevil',
|
|
1153
|
+
content: 'Just bought some tokens! Great project!'
|
|
1154
|
+
});
|
|
1155
|
+
|
|
1156
|
+
console.log(`Comment posted with ID: ${comment.id}`);
|
|
1157
|
+
|
|
1158
|
+
// 7. Check your balance - direct balance access
|
|
1159
|
+
const galaBalance = await sdk.fetchGalaBalance();
|
|
1160
|
+
console.log(`GALA Balance: ${galaBalance.balance}`);
|
|
1161
|
+
console.log(`Decimals: ${galaBalance.decimals}`);
|
|
1162
|
+
console.log(`Last updated: ${galaBalance.lastUpdated.toISOString()}`);
|
|
1163
|
+
|
|
1164
|
+
const tokenBalance = await sdk.fetchTokenBalance({
|
|
1165
|
+
tokenName: 'tinyevil',
|
|
1166
|
+
address: sdk.getAddress()
|
|
1167
|
+
});
|
|
1168
|
+
|
|
1169
|
+
console.log(`TINYEVIL Balance: ${tokenBalance.quantity}`);
|
|
1170
|
+
console.log(`USD Value: $${tokenBalance.holdingPriceUsd}`);
|
|
1171
|
+
console.log(`GALA Value: ${tokenBalance.holdingPriceGala} GALA`);
|
|
1172
|
+
console.log(`Finalized: ${tokenBalance.isFinalized}`);
|
|
1173
|
+
```
|
|
1174
|
+
|
|
1175
|
+
## Transfer Operations
|
|
1176
|
+
|
|
1177
|
+
Transfer GALA and launchpad tokens between wallets with EIP-712 signatures:
|
|
1178
|
+
|
|
1179
|
+
```typescript
|
|
1180
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
1181
|
+
|
|
1182
|
+
const sdk = createLaunchpadSDK({
|
|
1183
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
1184
|
+
});
|
|
1185
|
+
|
|
1186
|
+
// Transfer GALA tokens - direct result access
|
|
1187
|
+
const galaTransfer = await sdk.transferGala({
|
|
1188
|
+
recipientAddress: 'eth|1234567890abcdef1234567890abcdef12345678', // or 0x format
|
|
1189
|
+
amount: '1', // 1 GALA
|
|
1190
|
+
uniqueKey: 'galaconnect-operation-my-transfer-123' // Optional for idempotency
|
|
1191
|
+
});
|
|
1192
|
+
|
|
1193
|
+
console.log(`GALA Transfer ID: ${galaTransfer.transactionId}`);
|
|
1194
|
+
console.log(`Status: ${galaTransfer.status}`);
|
|
1195
|
+
|
|
1196
|
+
// Transfer launchpad tokens - direct result access
|
|
1197
|
+
const tokenTransfer = await sdk.transferToken({
|
|
1198
|
+
to: '0x9876543210fedcba9876543210fedcba98765432', // or eth| format
|
|
1199
|
+
tokenName: 'tinyevil',
|
|
1200
|
+
amount: '1000000', // Token amount in smallest unit
|
|
1201
|
+
uniqueKey: 'galaconnect-operation-token-transfer-456' // Optional for idempotency
|
|
1202
|
+
});
|
|
1203
|
+
|
|
1204
|
+
console.log(`Token Transfer ID: ${tokenTransfer.transactionId}`);
|
|
1205
|
+
console.log(`Status: ${tokenTransfer.status}`);
|
|
1206
|
+
```
|
|
1207
|
+
|
|
1208
|
+
### Transfer Features
|
|
1209
|
+
- **EIP-712 Signatures**: Secure blockchain transactions
|
|
1210
|
+
- **Address Format Handling**: Supports both `0x` and `eth|` formats
|
|
1211
|
+
- **Idempotency**: Optional unique keys prevent duplicate transfers (must use `galaswap-operation-` or `galaconnect-operation-` prefix)
|
|
1212
|
+
- **Comprehensive Validation**: Amount limits, address formats, token names, unique key formats
|
|
1213
|
+
- **GalaChain Integration**: Direct transfers via GalaChain gateway
|
|
1214
|
+
- **Error Handling**: Detailed error types for different failure scenarios
|
|
1215
|
+
|
|
1216
|
+
## Lock/Unlock Operations
|
|
1217
|
+
|
|
1218
|
+
Lock and unlock tokens on GalaChain for staking, escrow, and vesting mechanisms:
|
|
1219
|
+
|
|
1220
|
+
```typescript
|
|
1221
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
1222
|
+
|
|
1223
|
+
const sdk = createLaunchpadSDK({
|
|
1224
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
1225
|
+
});
|
|
1226
|
+
|
|
1227
|
+
// Lock tokens - caller becomes lock authority by default
|
|
1228
|
+
const lockResult = await sdk.lockToken({
|
|
1229
|
+
tokenName: 'tinyevil',
|
|
1230
|
+
amount: '1000' // Token amount in smallest unit
|
|
1231
|
+
});
|
|
1232
|
+
|
|
1233
|
+
console.log(`Locked tokens, tx: ${lockResult.transactionId}`);
|
|
1234
|
+
|
|
1235
|
+
// Lock with custom authority and expiration
|
|
1236
|
+
const escrowLock = await sdk.lockToken({
|
|
1237
|
+
tokenName: 'tinyevil',
|
|
1238
|
+
amount: '5000',
|
|
1239
|
+
lockAuthority: 'eth|0xEscrowContract...', // Third party can unlock
|
|
1240
|
+
expires: Date.now() + 7 * 24 * 60 * 60 * 1000, // Auto-release in 1 week
|
|
1241
|
+
name: 'escrow-deal-123' // Named lock for matching
|
|
1242
|
+
});
|
|
1243
|
+
|
|
1244
|
+
// Unlock tokens - must be called by lock authority
|
|
1245
|
+
const unlockResult = await sdk.unlockToken({
|
|
1246
|
+
tokenName: 'tinyevil',
|
|
1247
|
+
amount: '1000'
|
|
1248
|
+
});
|
|
1249
|
+
|
|
1250
|
+
console.log(`Unlocked tokens, tx: ${unlockResult.transactionId}`);
|
|
1251
|
+
|
|
1252
|
+
// Unlock specific named lock
|
|
1253
|
+
await sdk.unlockToken({
|
|
1254
|
+
tokenName: 'tinyevil',
|
|
1255
|
+
amount: '5000',
|
|
1256
|
+
name: 'escrow-deal-123' // Must match lock name
|
|
1257
|
+
});
|
|
1258
|
+
```
|
|
1259
|
+
|
|
1260
|
+
### Lock Features
|
|
1261
|
+
- **Lock Authority**: Specify who can unlock (defaults to caller)
|
|
1262
|
+
- **Expiration**: Optional auto-release timestamp
|
|
1263
|
+
- **Named Locks**: Identify locks by name for targeted unlocks
|
|
1264
|
+
- **EIP-712 Signatures**: Secure blockchain transactions
|
|
1265
|
+
- **Idempotency**: Optional unique keys prevent duplicate operations
|
|
1266
|
+
|
|
1267
|
+
### Use Cases
|
|
1268
|
+
- **Staking**: Lock tokens for reward programs
|
|
1269
|
+
- **Escrow**: Third-party holds tokens until conditions met
|
|
1270
|
+
- **Vesting**: Time-locked token releases with expiration
|
|
1271
|
+
|
|
1272
|
+
## Cross-Chain Bridge Operations
|
|
1273
|
+
|
|
1274
|
+
The SDK provides comprehensive cross-chain bridging for GalaChain ↔ Ethereum and GalaChain ↔ Solana transfers.
|
|
1275
|
+
|
|
1276
|
+
### Configuration
|
|
1277
|
+
|
|
1278
|
+
```typescript
|
|
1279
|
+
import { LaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
1280
|
+
|
|
1281
|
+
const sdk = new LaunchpadSDK({
|
|
1282
|
+
wallet: process.env.PRIVATE_KEY,
|
|
1283
|
+
// Bridge configuration (optional - enables bridge operations)
|
|
1284
|
+
ethereumPrivateKey: process.env.ETHEREUM_PRIVATE_KEY, // Required for Ethereum bridging
|
|
1285
|
+
solanaPrivateKey: process.env.SOLANA_PRIVATE_KEY, // Required for Solana bridging
|
|
1286
|
+
});
|
|
1287
|
+
```
|
|
1288
|
+
|
|
1289
|
+
### Wallet Balance Queries
|
|
1290
|
+
|
|
1291
|
+
Query Ethereum and Solana wallet balances with two approaches:
|
|
1292
|
+
|
|
1293
|
+
**Single Token Queries (Fast - 1 RPC call)**
|
|
1294
|
+
```typescript
|
|
1295
|
+
// Single ERC-20 token balance
|
|
1296
|
+
const gala = await sdk.fetchEthereumWalletTokenBalance('GALA');
|
|
1297
|
+
// Returns: { symbol: 'GALA', quantity: '1234.56', decimals: 8, contractAddress: '0x...', isNative: false }
|
|
1298
|
+
|
|
1299
|
+
// Native ETH balance
|
|
1300
|
+
const eth = await sdk.fetchEthereumWalletNativeBalance();
|
|
1301
|
+
// Returns: { symbol: 'ETH', quantity: '0.5', decimals: 18, contractAddress: null, isNative: true }
|
|
1302
|
+
|
|
1303
|
+
// Single SPL token balance (Solana)
|
|
1304
|
+
const solGala = await sdk.fetchSolanaWalletTokenBalance('GALA');
|
|
1305
|
+
// Returns: { symbol: 'GALA', quantity: '789.01', decimals: 8, contractAddress: '...', isNative: false }
|
|
1306
|
+
|
|
1307
|
+
// Native SOL balance
|
|
1308
|
+
const sol = await sdk.fetchSolanaWalletNativeBalance();
|
|
1309
|
+
// Returns: { symbol: 'SOL', quantity: '2.5', decimals: 9, contractAddress: null, isNative: true }
|
|
1310
|
+
```
|
|
1311
|
+
|
|
1312
|
+
**All Tokens Queries (Complete portfolio view)**
|
|
1313
|
+
```typescript
|
|
1314
|
+
// Ethereum: ETH + all supported ERC-20s (GALA, GWETH, GUSDC, GUSDT, GWTRX, GWBTC)
|
|
1315
|
+
const allEth = await sdk.fetchEthereumWalletAllBalances();
|
|
1316
|
+
console.log(allEth.native.quantity); // ETH balance
|
|
1317
|
+
console.log(allEth.tokens); // 6 ERC-20 balances
|
|
1318
|
+
console.log(allEth.address); // Wallet address
|
|
1319
|
+
console.log(allEth.timestamp); // Query timestamp
|
|
1320
|
+
|
|
1321
|
+
// Solana: SOL + all supported SPL tokens (GALA, GSOL)
|
|
1322
|
+
const allSol = await sdk.fetchSolanaWalletAllBalances();
|
|
1323
|
+
console.log(allSol.native.quantity); // SOL balance
|
|
1324
|
+
console.log(allSol.tokens); // 2 SPL balances
|
|
1325
|
+
```
|
|
1326
|
+
|
|
1327
|
+
**When to use which:**
|
|
1328
|
+
- **Single-token queries**: Quick checks, performance-critical scenarios, frequent polling
|
|
1329
|
+
- **All-tokens queries**: Portfolio dashboards, wallet UIs, multi-token operations
|
|
1330
|
+
|
|
1331
|
+
### Bridge Operations
|
|
1332
|
+
|
|
1333
|
+
```typescript
|
|
1334
|
+
// Estimate fees before bridging
|
|
1335
|
+
const fee = await sdk.estimateBridgeFee({
|
|
1336
|
+
tokenSymbol: 'GALA',
|
|
1337
|
+
destinationChain: 'Ethereum',
|
|
1338
|
+
amount: '1000',
|
|
1339
|
+
});
|
|
1340
|
+
|
|
1341
|
+
// Bridge OUT: GalaChain → Ethereum/Solana
|
|
1342
|
+
const result = await sdk.bridgeOut({
|
|
1343
|
+
tokenSymbol: 'GALA',
|
|
1344
|
+
amount: '1000',
|
|
1345
|
+
destinationChain: 'Ethereum',
|
|
1346
|
+
recipientAddress: '0x...',
|
|
1347
|
+
});
|
|
1348
|
+
|
|
1349
|
+
// Bridge IN: Ethereum/Solana → GalaChain
|
|
1350
|
+
const result = await sdk.bridgeIn({
|
|
1351
|
+
tokenSymbol: 'GALA',
|
|
1352
|
+
amount: '1000',
|
|
1353
|
+
sourceChain: 'Ethereum',
|
|
1354
|
+
});
|
|
1355
|
+
|
|
1356
|
+
// Check bridge status
|
|
1357
|
+
const status = await sdk.getBridgeStatus(result.transactionHash);
|
|
1358
|
+
```
|
|
1359
|
+
|
|
1360
|
+
### Supported Tokens
|
|
1361
|
+
|
|
1362
|
+
| Token | Symbol | Ethereum | Solana | Decimals |
|
|
1363
|
+
|-------|--------|----------|--------|----------|
|
|
1364
|
+
| GALA | GALA | ✅ | ✅ | 8 |
|
|
1365
|
+
| Wrapped ETH | GWETH | ✅ | - | 18 |
|
|
1366
|
+
| USD Coin | GUSDC | ✅ | - | 6 |
|
|
1367
|
+
| Tether USD | GUSDT | ✅ | - | 6 |
|
|
1368
|
+
| Wrapped TRON | GWTRX | ✅ | - | 6 |
|
|
1369
|
+
| Wrapped BTC | GWBTC | ✅ | - | 8 |
|
|
1370
|
+
| Wrapped SOL | GSOL | - | ✅ | 9 |
|
|
1371
|
+
|
|
1372
|
+
## Multi-Wallet Support
|
|
1373
|
+
|
|
1374
|
+
The SDK supports **per-operation wallet overrides** for testing multi-wallet workflows without creating new SDK instances. This is ideal for:
|
|
1375
|
+
- Testing trading scenarios with multiple wallets
|
|
1376
|
+
- Building multi-user applications
|
|
1377
|
+
- Simulating different user behaviors
|
|
1378
|
+
- Creating automated trading bots
|
|
1379
|
+
|
|
1380
|
+
### Private Key Override Pattern
|
|
1381
|
+
|
|
1382
|
+
All signing operations accept an optional `privateKey` parameter to use a different wallet for that specific operation:
|
|
1383
|
+
|
|
1384
|
+
```typescript
|
|
1385
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
1386
|
+
|
|
1387
|
+
// Create SDK with your main wallet
|
|
1388
|
+
const sdk = createLaunchpadSDK({
|
|
1389
|
+
wallet: 'your-main-private-key'
|
|
1390
|
+
});
|
|
1391
|
+
|
|
1392
|
+
// Different wallet's private key (must be in '0x' + 64 hex format)
|
|
1393
|
+
const busterPrivateKey = '0x1234567890abcdef...'; // Buster's wallet
|
|
1394
|
+
|
|
1395
|
+
// 1. Send GALA from main wallet to Buster
|
|
1396
|
+
await sdk.transferGala({
|
|
1397
|
+
recipientAddress: '0xBusterAddress...',
|
|
1398
|
+
amount: '1000'
|
|
1399
|
+
// Uses main SDK wallet (no privateKey override)
|
|
1400
|
+
});
|
|
1401
|
+
|
|
1402
|
+
// 2. Have Buster buy tokens using his own wallet
|
|
1403
|
+
const buyResult = await sdk.buy({
|
|
1404
|
+
tokenName: 'tinyevil',
|
|
1405
|
+
amount: '100',
|
|
1406
|
+
type: 'native',
|
|
1407
|
+
expectedAmount: '500000',
|
|
1408
|
+
slippageToleranceFactor: 0.05,
|
|
1409
|
+
privateKey: busterPrivateKey // Override to use Buster's wallet
|
|
1410
|
+
});
|
|
1411
|
+
|
|
1412
|
+
// 3. Have Buster post a comment
|
|
1413
|
+
await sdk.postComment({
|
|
1414
|
+
tokenName: 'tinyevil',
|
|
1415
|
+
content: 'Great buy!',
|
|
1416
|
+
privateKey: busterPrivateKey // Buster posts the comment
|
|
1417
|
+
});
|
|
1418
|
+
|
|
1419
|
+
// 4. Main wallet continues operations normally
|
|
1420
|
+
const mainWalletBalance = await sdk.fetchGalaBalance();
|
|
1421
|
+
// Uses main SDK wallet address
|
|
1422
|
+
```
|
|
1423
|
+
|
|
1424
|
+
### Supported Operations with Private Key Override
|
|
1425
|
+
|
|
1426
|
+
All signing operations support the `privateKey` parameter:
|
|
1427
|
+
|
|
1428
|
+
**Trading Operations:**
|
|
1429
|
+
- `buy(options)` - Buy tokens with different wallet
|
|
1430
|
+
- `sell(options)` - Sell tokens with different wallet
|
|
1431
|
+
|
|
1432
|
+
**Token Creation:**
|
|
1433
|
+
- `launchToken(data)` - Create token from different wallet
|
|
1434
|
+
- `uploadTokenImage(options)` - Upload image for token
|
|
1435
|
+
|
|
1436
|
+
**Transfer Operations:**
|
|
1437
|
+
- `transferGala(options)` - Transfer GALA from different wallet
|
|
1438
|
+
- `transferToken(options)` - Transfer tokens from different wallet
|
|
1439
|
+
|
|
1440
|
+
**Social & Profile:**
|
|
1441
|
+
- `postComment(options)` - Post comment from different wallet
|
|
1442
|
+
- `updateProfile(data)` - Update profile for different wallet
|
|
1443
|
+
- `uploadProfileImage(options)` - Upload profile image for different wallet
|
|
1444
|
+
|
|
1445
|
+
### Complete Multi-Wallet Example
|
|
1446
|
+
|
|
1447
|
+
```typescript
|
|
1448
|
+
import { createLaunchpadSDK, createWallet } from '@gala-chain/launchpad-sdk';
|
|
1449
|
+
|
|
1450
|
+
// Main SDK instance
|
|
1451
|
+
const sdk = createLaunchpadSDK({
|
|
1452
|
+
wallet: 'your-main-private-key'
|
|
1453
|
+
});
|
|
1454
|
+
|
|
1455
|
+
// Create a test wallet for "Buster"
|
|
1456
|
+
const busterWallet = createWallet(); // Random wallet
|
|
1457
|
+
const busterPrivateKey = busterWallet.privateKey;
|
|
1458
|
+
const busterAddress = busterWallet.address;
|
|
1459
|
+
|
|
1460
|
+
console.log(`Buster's address: ${busterAddress}`);
|
|
1461
|
+
|
|
1462
|
+
// 1. Fund Buster with GALA from main wallet
|
|
1463
|
+
await sdk.transferGala({
|
|
1464
|
+
recipientAddress: busterAddress,
|
|
1465
|
+
amount: '1000'
|
|
1466
|
+
});
|
|
1467
|
+
|
|
1468
|
+
// 2. Send Buster some tokens from main wallet
|
|
1469
|
+
await sdk.transferToken({
|
|
1470
|
+
to: busterAddress,
|
|
1471
|
+
tokenName: 'tinyevil',
|
|
1472
|
+
amount: '10000'
|
|
1473
|
+
});
|
|
1474
|
+
|
|
1475
|
+
// 3. Have Buster send some tokens back to main wallet
|
|
1476
|
+
await sdk.transferToken({
|
|
1477
|
+
to: sdk.getEthereumAddress(), // Main wallet address
|
|
1478
|
+
tokenName: 'tinyevil',
|
|
1479
|
+
amount: '5000',
|
|
1480
|
+
privateKey: busterPrivateKey // Buster's wallet signs
|
|
1481
|
+
});
|
|
1482
|
+
|
|
1483
|
+
// 4. Have Buster buy more tokens
|
|
1484
|
+
const buyQuote = await sdk.calculateBuyAmount({
|
|
1485
|
+
tokenName: 'tinyevil',
|
|
1486
|
+
amount: '100',
|
|
1487
|
+
type: 'native'
|
|
1488
|
+
});
|
|
1489
|
+
|
|
1490
|
+
await sdk.buy({
|
|
1491
|
+
tokenName: 'tinyevil',
|
|
1492
|
+
amount: '100',
|
|
1493
|
+
type: 'native',
|
|
1494
|
+
expectedAmount: buyQuote.amount,
|
|
1495
|
+
slippageToleranceFactor: 0.05,
|
|
1496
|
+
privateKey: busterPrivateKey // Buster buys
|
|
1497
|
+
});
|
|
1498
|
+
|
|
1499
|
+
// 5. Have Buster sell some tokens
|
|
1500
|
+
const sellQuote = await sdk.calculateSellAmount({
|
|
1501
|
+
tokenName: 'tinyevil',
|
|
1502
|
+
amount: '50',
|
|
1503
|
+
type: 'native'
|
|
1504
|
+
});
|
|
1505
|
+
|
|
1506
|
+
await sdk.sell({
|
|
1507
|
+
tokenName: 'tinyevil',
|
|
1508
|
+
amount: '50',
|
|
1509
|
+
type: 'native',
|
|
1510
|
+
expectedAmount: sellQuote.amount,
|
|
1511
|
+
slippageToleranceFactor: 0.05,
|
|
1512
|
+
privateKey: busterPrivateKey // Buster sells
|
|
1513
|
+
});
|
|
1514
|
+
|
|
1515
|
+
// 6. Check final balances for both wallets
|
|
1516
|
+
const mainBalance = await sdk.fetchGalaBalance(); // Main wallet
|
|
1517
|
+
const busterBalance = await sdk.fetchGalaBalance(busterAddress); // Buster's wallet
|
|
1518
|
+
|
|
1519
|
+
console.log(`Main wallet: ${mainBalance.balance} GALA`);
|
|
1520
|
+
console.log(`Buster wallet: ${busterBalance.balance} GALA`);
|
|
1521
|
+
```
|
|
1522
|
+
|
|
1523
|
+
### Private Key Format Requirements
|
|
1524
|
+
|
|
1525
|
+
The `privateKey` parameter must be a string in the format:
|
|
1526
|
+
- **Format**: `'0x' + 64 hexadecimal characters`
|
|
1527
|
+
- **Example**: `'0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef'`
|
|
1528
|
+
- **Invalid**: Raw hex without '0x' prefix, mnemonic phrases, addresses
|
|
1529
|
+
|
|
1530
|
+
```typescript
|
|
1531
|
+
// ✅ Valid private key formats
|
|
1532
|
+
const validKey1 = '0x' + 'a'.repeat(64); // Correct format
|
|
1533
|
+
const validKey2 = wallet.privateKey; // From ethers.js Wallet
|
|
1534
|
+
|
|
1535
|
+
// ❌ Invalid formats (will throw validation error)
|
|
1536
|
+
const invalidKey1 = 'a'.repeat(64); // Missing '0x' prefix
|
|
1537
|
+
const invalidKey2 = 'word1 word2 ... word24'; // Mnemonic not accepted
|
|
1538
|
+
const invalidKey3 = '0x123'; // Too short
|
|
1539
|
+
```
|
|
1540
|
+
|
|
1541
|
+
## Available Methods & Result Types
|
|
1542
|
+
|
|
1543
|
+
### **Fetch Operations**
|
|
1544
|
+
|
|
1545
|
+
```typescript
|
|
1546
|
+
// Pool Management
|
|
1547
|
+
fetchPools(options?): Promise<PoolsResult>
|
|
1548
|
+
// Returns: { pools, page, limit, total, totalPages, hasNext, hasPrevious }
|
|
1549
|
+
// Supports auto-pagination: limit <= 20 (single page), limit > 20 (multi-page), limit = 0 (all pools)
|
|
1550
|
+
|
|
1551
|
+
fetchAllPools(options?): Promise<PoolsResult>
|
|
1552
|
+
// Returns: { pools, page, limit, total, totalPages, hasNext, hasPrevious }
|
|
1553
|
+
// Convenience method that fetches ALL pools (equivalent to fetchPools({ limit: 0 }))
|
|
1554
|
+
|
|
1555
|
+
fetchTokenDistribution(tokenName): Promise<TokenDistributionResult>
|
|
1556
|
+
// Returns: { holders, totalSupply, totalHolders, lastUpdated }
|
|
1557
|
+
|
|
1558
|
+
fetchTokenBadges(tokenName): Promise<TokenBadgesResult>
|
|
1559
|
+
// Returns: { volumeBadges, engagementBadges }
|
|
1560
|
+
|
|
1561
|
+
fetchPoolDetails(tokenName): Promise<PoolDetailsData>
|
|
1562
|
+
// Returns: { basePrice, maxSupply, saleStatus, nativeTokenQuantity, ... }
|
|
1563
|
+
|
|
1564
|
+
fetchTokenDetails(tokenId): Promise<TokenDetails>
|
|
1565
|
+
// Returns: { symbol, decimals, name, image, verified, network, chainId, contractAddress, tradingEnabled, ... }
|
|
1566
|
+
// Supports flexible tokenId: string ('GUSDC|Unit|none|eth:0x...') or object format
|
|
1567
|
+
|
|
1568
|
+
fetchVolumeData(options): Promise<GraphDataResult>
|
|
1569
|
+
// Returns: { dataPoints }
|
|
1570
|
+
|
|
1571
|
+
// Trade & User Data
|
|
1572
|
+
fetchTrades(options): Promise<TradesResult>
|
|
1573
|
+
// Returns: { trades, page, limit, total, totalPages, hasNext, hasPrevious }
|
|
1574
|
+
|
|
1575
|
+
fetchGalaBalance(address?): Promise<GalaBalanceInfo>
|
|
1576
|
+
// Returns: { userAddress, balance, decimals, lastUpdated }
|
|
1577
|
+
|
|
1578
|
+
fetchTokenBalance(options): Promise<TokenBalanceInfo>
|
|
1579
|
+
// Returns: { quantity, holdingPriceUsd, holdingPriceGala, isFinalized, ... }
|
|
1580
|
+
|
|
1581
|
+
fetchComments(options): Promise<CommentsResult>
|
|
1582
|
+
// Returns: { comments, page, limit, total, totalPages, hasNext, hasPrevious }
|
|
1583
|
+
|
|
1584
|
+
fetchProfile(address?): Promise<UserProfile>
|
|
1585
|
+
// Returns: { fullName, profileImage, address, ... }
|
|
1586
|
+
|
|
1587
|
+
fetchLaunchTokenFee(): Promise<number>
|
|
1588
|
+
// Returns: Current GALA fee required to launch a new token (e.g., 0.001)
|
|
1589
|
+
```
|
|
1590
|
+
|
|
1591
|
+
### **Calculate Operations**
|
|
1592
|
+
|
|
1593
|
+
```typescript
|
|
1594
|
+
// Price Calculations
|
|
1595
|
+
calculateBuyAmount(options): Promise<AmountCalculationResult>
|
|
1596
|
+
// Returns: { amount, reverseBondingCurveFee, transactionFee }
|
|
1597
|
+
|
|
1598
|
+
calculateSellAmount(options): Promise<AmountCalculationResult>
|
|
1599
|
+
// Returns: { amount, reverseBondingCurveFee, transactionFee }
|
|
1600
|
+
|
|
1601
|
+
calculateInitialBuyAmount(options): Promise<AmountCalculationResult>
|
|
1602
|
+
// Returns: { amount, reverseBondingCurveFee, transactionFee }
|
|
1603
|
+
|
|
1604
|
+
calculateBuyAmountForGraduation(tokenName): Promise<AmountCalculationResult>
|
|
1605
|
+
// Returns: { amount, reverseBondingCurveFee, transactionFee }
|
|
1606
|
+
// Calculates exact GALA cost to buy all remaining tokens and graduate pool
|
|
1607
|
+
|
|
1608
|
+
// Local Calculations (Client-Side, No Network)
|
|
1609
|
+
calculateBuyAmountLocal(options): Promise<AmountCalculationResult>
|
|
1610
|
+
// Options: { tokenName, amount, type: 'native' | 'exact' }
|
|
1611
|
+
// Returns: { amount, reverseBondingCurveFee: '0', transactionFee, gasFee }
|
|
1612
|
+
// Instant buy calculation using local bonding curve formulas
|
|
1613
|
+
|
|
1614
|
+
calculateSellAmountLocal(options): Promise<AmountCalculationResult>
|
|
1615
|
+
// Options: { tokenName, amount, type: 'native' | 'exact', maxSupply, minFeePortion, maxFeePortion }
|
|
1616
|
+
// Returns: { amount, reverseBondingCurveFee, transactionFee, gasFee }
|
|
1617
|
+
// Instant sell calculation with reverse bonding curve fees
|
|
1618
|
+
|
|
1619
|
+
// External Calculations (GalaChain Network)
|
|
1620
|
+
calculateBuyAmountExternal(options): Promise<AmountCalculationResult>
|
|
1621
|
+
// Explicit external calculation wrapper (same as calculateBuyAmount)
|
|
1622
|
+
|
|
1623
|
+
calculateSellAmountExternal(options): Promise<AmountCalculationResult>
|
|
1624
|
+
// Explicit external calculation wrapper (same as calculateSellAmount)
|
|
1625
|
+
|
|
1626
|
+
// Note: Pass `calculateAmountMode: 'local' | 'external'` to override SDK default mode
|
|
1627
|
+
|
|
1628
|
+
// Price History Operations (DEX Backend API, Node.js only)
|
|
1629
|
+
fetchPriceHistory(options): Promise<PriceHistoryResult>
|
|
1630
|
+
// Options: { tokenName?, tokenId?, from?, to?, sortOrder?, page?, limit? }
|
|
1631
|
+
// Token identification (provide EXACTLY ONE):
|
|
1632
|
+
// - tokenName: Simple token name (e.g., "demonkpop") - auto-resolves to tokenId
|
|
1633
|
+
// - tokenId: Full token class key (e.g., "Token|Unit|DKP|eth:...")
|
|
1634
|
+
// Returns: { snapshots, page, limit, total, totalPages, hasNext, hasPrevious }
|
|
1635
|
+
// Fetches paginated historical price snapshots from DEX Backend API
|
|
1636
|
+
|
|
1637
|
+
fetchAllPriceHistory(options): Promise<PriceHistoryResult>
|
|
1638
|
+
// Options: { tokenName?, tokenId?, from?, to?, sortOrder? } (no pagination params)
|
|
1639
|
+
// Token identification (provide EXACTLY ONE):
|
|
1640
|
+
// - tokenName: Simple token name (e.g., "demonkpop") - auto-resolves to tokenId
|
|
1641
|
+
// - tokenId: Full token class key (e.g., "Token|Unit|DKP|eth:...")
|
|
1642
|
+
// Returns: All matching snapshots with total count
|
|
1643
|
+
// Convenience method with automatic pagination (returns ALL snapshots)
|
|
1644
|
+
```
|
|
1645
|
+
|
|
1646
|
+
## Performance Optimization
|
|
1647
|
+
|
|
1648
|
+
### Reusing Pool Data to Avoid Redundant Network Calls
|
|
1649
|
+
|
|
1650
|
+
Methods that internally use `calculateBuyAmount`/`calculateSellAmount` now support optional `calculateAmountMode` and `currentSupply` parameters for performance optimization. This allows you to:
|
|
1651
|
+
|
|
1652
|
+
1. **Fetch pool details once** using `fetchPoolDetailsForCalculation`
|
|
1653
|
+
2. **Reuse `currentSupply`** across multiple calculations
|
|
1654
|
+
3. **Eliminate redundant network calls** with local mode calculations
|
|
1655
|
+
4. **Get instant results** when real-time precision isn't required
|
|
1656
|
+
|
|
1657
|
+
### Supported Methods
|
|
1658
|
+
|
|
1659
|
+
The following methods accept optional performance parameters:
|
|
1660
|
+
|
|
1661
|
+
- `fetchLaunchpadTokenSpotPrice(options)` - Pass `calculateAmountMode` and/or `currentSupply`
|
|
1662
|
+
- `calculateBuyAmountForGraduation(options)` - Pass `calculateAmountMode` and/or `currentSupply`
|
|
1663
|
+
- `graduateToken(options)` - Pass `calculateAmountMode` and/or `currentSupply`
|
|
1664
|
+
|
|
1665
|
+
### Using CALCULATION_MODES Constant
|
|
1666
|
+
|
|
1667
|
+
```typescript
|
|
1668
|
+
import { createLaunchpadSDK, CALCULATION_MODES } from '@gala-chain/launchpad-sdk';
|
|
1669
|
+
|
|
1670
|
+
const sdk = createLaunchpadSDK({
|
|
1671
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
1672
|
+
});
|
|
1673
|
+
|
|
1674
|
+
// Use type-safe calculation mode constants
|
|
1675
|
+
console.log(CALCULATION_MODES.LOCAL); // 'local'
|
|
1676
|
+
console.log(CALCULATION_MODES.EXTERNAL); // 'external'
|
|
1677
|
+
```
|
|
1678
|
+
|
|
1679
|
+
### Basic Optimization Pattern
|
|
1680
|
+
|
|
1681
|
+
```typescript
|
|
1682
|
+
import { createLaunchpadSDK, CALCULATION_MODES } from '@gala-chain/launchpad-sdk';
|
|
1683
|
+
|
|
1684
|
+
const sdk = createLaunchpadSDK({
|
|
1685
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
1686
|
+
});
|
|
1687
|
+
|
|
1688
|
+
const tokenName = 'tinyevil';
|
|
1689
|
+
|
|
1690
|
+
// ❌ WITHOUT OPTIMIZATION (3 network calls)
|
|
1691
|
+
const spotPrice1 = await sdk.fetchLaunchpadTokenSpotPrice(tokenName);
|
|
1692
|
+
// → Fetches pool details internally (call #1)
|
|
1693
|
+
|
|
1694
|
+
const graduation1 = await sdk.calculateBuyAmountForGraduation(tokenName);
|
|
1695
|
+
// → Fetches pool details internally (call #2)
|
|
1696
|
+
|
|
1697
|
+
const graduationResult1 = await sdk.graduateToken({ tokenName });
|
|
1698
|
+
// → Fetches pool details internally (call #3)
|
|
1699
|
+
|
|
1700
|
+
// ✅ WITH OPTIMIZATION (1 network call + instant local calculations)
|
|
1701
|
+
// Step 1: Fetch pool details once
|
|
1702
|
+
const poolDetails = await sdk.fetchPoolDetailsForCalculation(tokenName);
|
|
1703
|
+
const currentSupply = poolDetails.currentSupply; // Pre-computed with full precision
|
|
1704
|
+
|
|
1705
|
+
// Step 2: Reuse currentSupply for instant local calculations
|
|
1706
|
+
const spotPrice2 = await sdk.fetchLaunchpadTokenSpotPrice({
|
|
1707
|
+
tokenName,
|
|
1708
|
+
calculateAmountMode: CALCULATION_MODES.LOCAL,
|
|
1709
|
+
currentSupply
|
|
1710
|
+
});
|
|
1711
|
+
// → Uses local bonding curve formulas (instant, no network call)
|
|
1712
|
+
|
|
1713
|
+
const graduation2 = await sdk.calculateBuyAmountForGraduation({
|
|
1714
|
+
tokenName,
|
|
1715
|
+
calculateAmountMode: CALCULATION_MODES.LOCAL,
|
|
1716
|
+
currentSupply
|
|
1717
|
+
});
|
|
1718
|
+
// → Uses local calculation (instant, no network call)
|
|
1719
|
+
|
|
1720
|
+
// Step 3: Graduate with optimized calculation
|
|
1721
|
+
const graduationResult2 = await sdk.graduateToken({
|
|
1722
|
+
tokenName,
|
|
1723
|
+
calculateAmountMode: CALCULATION_MODES.LOCAL,
|
|
1724
|
+
currentSupply,
|
|
1725
|
+
slippageToleranceFactor: 0.01
|
|
1726
|
+
});
|
|
1727
|
+
// → Skips redundant pool fetch, uses local calculation
|
|
1728
|
+
```
|
|
1729
|
+
|
|
1730
|
+
### Performance Comparison
|
|
1731
|
+
|
|
1732
|
+
| Pattern | Network Calls | Speed | Use Case |
|
|
1733
|
+
|---------|--------------|-------|----------|
|
|
1734
|
+
| **Without Optimization** | 3 calls | ~600-900ms | One-off operations |
|
|
1735
|
+
| **With Optimization** | 1 call | ~200ms | Batch operations, price discovery |
|
|
1736
|
+
| **Reduction** | **66% fewer calls** | **~70% faster** | |
|
|
1737
|
+
|
|
1738
|
+
### Complete Optimization Example
|
|
1739
|
+
|
|
1740
|
+
```typescript
|
|
1741
|
+
import { createLaunchpadSDK, CALCULATION_MODES } from '@gala-chain/launchpad-sdk';
|
|
1742
|
+
|
|
1743
|
+
const sdk = createLaunchpadSDK({
|
|
1744
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
1745
|
+
});
|
|
1746
|
+
|
|
1747
|
+
async function optimizedPoolAnalysis(tokenName: string) {
|
|
1748
|
+
console.time('Optimized Analysis');
|
|
1749
|
+
|
|
1750
|
+
// 1. Fetch pool details once (only network call needed)
|
|
1751
|
+
const poolDetails = await sdk.fetchPoolDetailsForCalculation(tokenName);
|
|
1752
|
+
const {
|
|
1753
|
+
currentSupply,
|
|
1754
|
+
maxSupply,
|
|
1755
|
+
reverseBondingCurveMinFeeFactor,
|
|
1756
|
+
reverseBondingCurveMaxFeeFactor
|
|
1757
|
+
} = poolDetails;
|
|
1758
|
+
|
|
1759
|
+
// 2. Get spot price with local calculation (instant)
|
|
1760
|
+
const spotPrice = await sdk.fetchLaunchpadTokenSpotPrice({
|
|
1761
|
+
tokenName,
|
|
1762
|
+
calculateAmountMode: CALCULATION_MODES.LOCAL,
|
|
1763
|
+
currentSupply
|
|
1764
|
+
});
|
|
1765
|
+
console.log(`Spot price: $${spotPrice.usdPrice.toFixed(6)}`);
|
|
1766
|
+
|
|
1767
|
+
// 3. Calculate graduation cost with local calculation (instant)
|
|
1768
|
+
const graduationCost = await sdk.calculateBuyAmountForGraduation({
|
|
1769
|
+
tokenName,
|
|
1770
|
+
calculateAmountMode: CALCULATION_MODES.LOCAL,
|
|
1771
|
+
currentSupply
|
|
1772
|
+
});
|
|
1773
|
+
console.log(`Graduation cost: ${graduationCost.amount} GALA`);
|
|
1774
|
+
|
|
1775
|
+
// 4. Simulate multiple buy scenarios (all instant)
|
|
1776
|
+
const buyAmounts = ['10', '100', '1000'];
|
|
1777
|
+
for (const amount of buyAmounts) {
|
|
1778
|
+
const buyCalc = await sdk.calculateBuyAmount({
|
|
1779
|
+
tokenName,
|
|
1780
|
+
amount,
|
|
1781
|
+
type: 'native',
|
|
1782
|
+
mode: CALCULATION_MODES.LOCAL, // Can also use 'mode' alias
|
|
1783
|
+
currentSupply
|
|
1784
|
+
});
|
|
1785
|
+
console.log(`Buying ${amount} GALA gets you: ${buyCalc.amount} tokens`);
|
|
1786
|
+
}
|
|
1787
|
+
|
|
1788
|
+
// 5. Simulate multiple sell scenarios (all instant)
|
|
1789
|
+
const sellAmounts = ['10', '100', '1000'];
|
|
1790
|
+
for (const amount of sellAmounts) {
|
|
1791
|
+
const sellCalc = await sdk.calculateSellAmountLocal({
|
|
1792
|
+
tokenName,
|
|
1793
|
+
amount,
|
|
1794
|
+
type: 'native',
|
|
1795
|
+
maxSupply,
|
|
1796
|
+
reverseBondingCurveMinFeeFactor,
|
|
1797
|
+
reverseBondingCurveMaxFeeFactor
|
|
1798
|
+
});
|
|
1799
|
+
console.log(`Selling ${amount} GALA worth gets you: ${sellCalc.amount} GALA`);
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
console.timeEnd('Optimized Analysis');
|
|
1803
|
+
// Output: Optimized Analysis: ~200-300ms (vs ~2-3 seconds without optimization)
|
|
1804
|
+
}
|
|
1805
|
+
|
|
1806
|
+
optimizedPoolAnalysis('tinyevil');
|
|
1807
|
+
```
|
|
1808
|
+
|
|
1809
|
+
### When to Use Optimization
|
|
1810
|
+
|
|
1811
|
+
**✅ Use optimization when:**
|
|
1812
|
+
- Performing multiple calculations on the same token
|
|
1813
|
+
- Building price discovery tools or analytics dashboards
|
|
1814
|
+
- Running simulations or backtests
|
|
1815
|
+
- Creating trading bots with frequent calculations
|
|
1816
|
+
- Displaying real-time price feeds (use local mode for smooth updates)
|
|
1817
|
+
|
|
1818
|
+
**❌ Skip optimization when:**
|
|
1819
|
+
- Performing a single calculation
|
|
1820
|
+
- Requiring absolute precision from GalaChain network
|
|
1821
|
+
- Token supply changes frequently between calls
|
|
1822
|
+
|
|
1823
|
+
### Local vs External Calculations
|
|
1824
|
+
|
|
1825
|
+
```typescript
|
|
1826
|
+
// Local mode (client-side, instant, <0.01% difference from external)
|
|
1827
|
+
const localCalc = await sdk.calculateBuyAmount({
|
|
1828
|
+
tokenName: 'tinyevil',
|
|
1829
|
+
amount: '100',
|
|
1830
|
+
type: 'native',
|
|
1831
|
+
mode: CALCULATION_MODES.LOCAL,
|
|
1832
|
+
currentSupply: poolDetails.currentSupply
|
|
1833
|
+
});
|
|
1834
|
+
|
|
1835
|
+
// External mode (GalaChain network, real-time, slower)
|
|
1836
|
+
const externalCalc = await sdk.calculateBuyAmount({
|
|
1837
|
+
tokenName: 'tinyevil',
|
|
1838
|
+
amount: '100',
|
|
1839
|
+
type: 'native',
|
|
1840
|
+
mode: CALCULATION_MODES.EXTERNAL // or omit to use SDK default
|
|
1841
|
+
});
|
|
1842
|
+
|
|
1843
|
+
// Accuracy comparison
|
|
1844
|
+
const difference = Math.abs(
|
|
1845
|
+
parseFloat(localCalc.amount) - parseFloat(externalCalc.amount)
|
|
1846
|
+
);
|
|
1847
|
+
const percentDiff = (difference / parseFloat(externalCalc.amount)) * 100;
|
|
1848
|
+
console.log(`Difference: ${percentDiff.toFixed(4)}%`); // Typically < 0.01%
|
|
1849
|
+
```
|
|
1850
|
+
|
|
1851
|
+
### SDK Configuration for Default Calculation Mode
|
|
1852
|
+
|
|
1853
|
+
```typescript
|
|
1854
|
+
import { createLaunchpadSDK, CALCULATION_MODES } from '@gala-chain/launchpad-sdk';
|
|
1855
|
+
|
|
1856
|
+
// Configure SDK to use local calculations by default
|
|
1857
|
+
const sdk = createLaunchpadSDK({
|
|
1858
|
+
wallet: 'your-private-key-or-mnemonic',
|
|
1859
|
+
config: {
|
|
1860
|
+
calculateAmountMode: CALCULATION_MODES.LOCAL // Default to local mode
|
|
1861
|
+
}
|
|
1862
|
+
});
|
|
1863
|
+
|
|
1864
|
+
// All calculations will use local mode by default
|
|
1865
|
+
const calc1 = await sdk.calculateBuyAmount({
|
|
1866
|
+
tokenName: 'tinyevil',
|
|
1867
|
+
amount: '100',
|
|
1868
|
+
type: 'native'
|
|
1869
|
+
// Uses LOCAL mode from SDK config
|
|
1870
|
+
});
|
|
1871
|
+
|
|
1872
|
+
// Override per-call if needed
|
|
1873
|
+
const calc2 = await sdk.calculateBuyAmount({
|
|
1874
|
+
tokenName: 'tinyevil',
|
|
1875
|
+
amount: '100',
|
|
1876
|
+
type: 'native',
|
|
1877
|
+
mode: CALCULATION_MODES.EXTERNAL // Override to external for this call
|
|
1878
|
+
});
|
|
1879
|
+
```
|
|
1880
|
+
|
|
1881
|
+
## Token Metadata Cache
|
|
1882
|
+
|
|
1883
|
+
The SDK includes an **intelligent metadata cache** that eliminates redundant API calls and enables instant local calculations. The cache stores immutable token metadata (reverse bonding curve fees, vault addresses, max supply) that never changes.
|
|
1884
|
+
|
|
1885
|
+
### How Cache Warming Works
|
|
1886
|
+
|
|
1887
|
+
**Opportunistic & Zero-Cost**: Cache warming happens automatically during normal SDK operations without any additional network requests. When you call `fetchPools()`, the SDK extracts and caches metadata from the pool data that was already fetched.
|
|
1888
|
+
|
|
1889
|
+
```typescript
|
|
1890
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
1891
|
+
|
|
1892
|
+
const sdk = createLaunchpadSDK({
|
|
1893
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
1894
|
+
});
|
|
1895
|
+
|
|
1896
|
+
// Before fetching - cache is empty
|
|
1897
|
+
let cacheInfo = sdk.getCacheInfo();
|
|
1898
|
+
console.log('Cached tokens:', cacheInfo.totalTokens); // 0
|
|
1899
|
+
|
|
1900
|
+
// Fetch pools - automatically warms cache with RBC fees and vault addresses
|
|
1901
|
+
await sdk.fetchPools({ type: 'recent', limit: 20 });
|
|
1902
|
+
|
|
1903
|
+
// After fetching - cache is warmed with 20 tokens
|
|
1904
|
+
cacheInfo = sdk.getCacheInfo();
|
|
1905
|
+
console.log('Cached tokens:', cacheInfo.totalTokens); // 20
|
|
1906
|
+
console.log('Cache size:', (cacheInfo.cacheSize / 1024).toFixed(2), 'KB');
|
|
1907
|
+
|
|
1908
|
+
// Now local calculations are instant (no network calls required)
|
|
1909
|
+
const calc = await sdk.calculateBuyAmountLocal({
|
|
1910
|
+
tokenName: 'anime',
|
|
1911
|
+
amount: '100',
|
|
1912
|
+
type: 'native',
|
|
1913
|
+
currentSupply: '500000'
|
|
1914
|
+
});
|
|
1915
|
+
console.log('Instant result:', calc.amount); // <1ms, used cached RBC fees
|
|
1916
|
+
```
|
|
1917
|
+
|
|
1918
|
+
### Performance Benefits
|
|
1919
|
+
|
|
1920
|
+
**Dramatic Performance Improvements:**
|
|
1921
|
+
|
|
1922
|
+
| Operation | Without Cache | With Cache | Improvement |
|
|
1923
|
+
|-----------|---------------|------------|-------------|
|
|
1924
|
+
| Single calculation | ~200ms | <1ms | **200x faster** |
|
|
1925
|
+
| 10 calculations | ~2000ms | <5ms | **400x faster** |
|
|
1926
|
+
| Price discovery (50 tokens) | ~10,000ms | ~50ms | **200x faster** |
|
|
1927
|
+
|
|
1928
|
+
**Zero Network Overhead**: Cache warming extracts metadata from pool responses you're already receiving - no extra API calls required.
|
|
1929
|
+
|
|
1930
|
+
**Memory Efficient**:
|
|
1931
|
+
- ~220 bytes per cached token (includes RBC fees + vault address)
|
|
1932
|
+
- Max 10,000 tokens = ~2.5 MB total memory
|
|
1933
|
+
- LRU eviction keeps memory bounded
|
|
1934
|
+
|
|
1935
|
+
### Cache Lifecycle
|
|
1936
|
+
|
|
1937
|
+
**Session Lifetime**:
|
|
1938
|
+
- Cache persists for entire MCP server session (survives across conversations)
|
|
1939
|
+
- For direct SDK usage, cache lifetime matches SDK instance lifetime
|
|
1940
|
+
- Call `sdk.cleanup()` to clear cache and release resources
|
|
1941
|
+
|
|
1942
|
+
**LRU Eviction**:
|
|
1943
|
+
- Maximum 10,000 tokens cached
|
|
1944
|
+
- Least Recently Updated (LRU) tokens evicted when limit reached
|
|
1945
|
+
- O(1) get/set/eviction using JavaScript Map insertion order
|
|
1946
|
+
|
|
1947
|
+
```typescript
|
|
1948
|
+
// Cache automatically manages size
|
|
1949
|
+
await sdk.fetchPools({ limit: 100 }); // Warms cache with 100 tokens
|
|
1950
|
+
await sdk.fetchPools({ limit: 100 }); // Warms with 100 more tokens
|
|
1951
|
+
await sdk.fetchPools({ limit: 100 }); // ... continues
|
|
1952
|
+
|
|
1953
|
+
// When 10,000 limit reached, oldest tokens are evicted automatically
|
|
1954
|
+
const stats = sdk.getCacheInfo();
|
|
1955
|
+
console.log('Total tokens:', stats.totalTokens); // Never exceeds 10,000
|
|
1956
|
+
console.log('Oldest entry:', new Date(stats.oldestEntry).toISOString());
|
|
1957
|
+
```
|
|
1958
|
+
|
|
1959
|
+
### Cache Management API
|
|
1960
|
+
|
|
1961
|
+
**Get Cache Statistics:**
|
|
1962
|
+
|
|
1963
|
+
```typescript
|
|
1964
|
+
const stats = sdk.getCacheInfo();
|
|
1965
|
+
console.log('Total tokens cached:', stats.totalTokens);
|
|
1966
|
+
console.log('Memory usage:', stats.cacheSize, 'bytes');
|
|
1967
|
+
console.log('Average per entry:', (stats.cacheSize / stats.totalTokens).toFixed(0), 'bytes');
|
|
1968
|
+
console.log('Oldest entry:', new Date(stats.oldestEntry).toISOString());
|
|
1969
|
+
```
|
|
1970
|
+
|
|
1971
|
+
**Clear Cache (Selective or Complete):**
|
|
1972
|
+
|
|
1973
|
+
```typescript
|
|
1974
|
+
// Clear specific token
|
|
1975
|
+
sdk.clearCache('anime');
|
|
1976
|
+
console.log('Cleared anime from cache');
|
|
1977
|
+
|
|
1978
|
+
// Clear all tokens
|
|
1979
|
+
sdk.clearCache();
|
|
1980
|
+
console.log('Cleared entire cache');
|
|
1981
|
+
|
|
1982
|
+
// Verify cache is empty
|
|
1983
|
+
const stats = sdk.getCacheInfo();
|
|
1984
|
+
console.log('Tokens remaining:', stats.totalTokens); // 0
|
|
1985
|
+
```
|
|
1986
|
+
|
|
1987
|
+
**Manual Cache Warming (Advanced):**
|
|
1988
|
+
|
|
1989
|
+
```typescript
|
|
1990
|
+
// Manually warm cache from pool data (useful for custom caching scenarios)
|
|
1991
|
+
sdk.warmCacheFromPoolData('mytoken', {
|
|
1992
|
+
vaultAddress: 'service|Token$Unit$MYTOKEN$...',
|
|
1993
|
+
reverseBondingCurveMinFeeFactor: 0.0,
|
|
1994
|
+
reverseBondingCurveMaxFeeFactor: 0.5
|
|
1995
|
+
});
|
|
1996
|
+
|
|
1997
|
+
// Cache is now warmed for local calculations
|
|
1998
|
+
const calc = await sdk.calculateBuyAmountLocal({
|
|
1999
|
+
tokenName: 'mytoken',
|
|
2000
|
+
amount: '100',
|
|
2001
|
+
type: 'native',
|
|
2002
|
+
currentSupply: '1000000'
|
|
2003
|
+
});
|
|
2004
|
+
```
|
|
2005
|
+
|
|
2006
|
+
### Complete Cache Example
|
|
2007
|
+
|
|
2008
|
+
```typescript
|
|
2009
|
+
import { createLaunchpadSDK, CALCULATION_MODES } from '@gala-chain/launchpad-sdk';
|
|
2010
|
+
|
|
2011
|
+
const sdk = createLaunchpadSDK({
|
|
2012
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
2013
|
+
});
|
|
2014
|
+
|
|
2015
|
+
// 1. Warm cache by fetching pools
|
|
2016
|
+
console.log('Warming cache...');
|
|
2017
|
+
await sdk.fetchPools({ type: 'popular', limit: 50 });
|
|
2018
|
+
|
|
2019
|
+
// 2. Check cache statistics
|
|
2020
|
+
const stats = sdk.getCacheInfo();
|
|
2021
|
+
console.log(`Cache warmed with ${stats.totalTokens} tokens`);
|
|
2022
|
+
console.log(`Memory: ${(stats.cacheSize / 1024).toFixed(2)} KB`);
|
|
2023
|
+
|
|
2024
|
+
// 3. Perform instant calculations using cached metadata
|
|
2025
|
+
const tokens = ['anime', 'dragnrkti', 'rocketri'];
|
|
2026
|
+
|
|
2027
|
+
console.log('\nCalculating spot prices (instant, no network calls):');
|
|
2028
|
+
console.time('Batch Calculations');
|
|
2029
|
+
|
|
2030
|
+
for (const token of tokens) {
|
|
2031
|
+
// Get pool details once for this token
|
|
2032
|
+
const poolDetails = await sdk.fetchPoolDetailsForCalculation(token);
|
|
2033
|
+
|
|
2034
|
+
// Multiple instant calculations using cached data
|
|
2035
|
+
const [buy10, buy100, buy1000] = await Promise.all([
|
|
2036
|
+
sdk.calculateBuyAmountLocal({
|
|
2037
|
+
tokenName: token,
|
|
2038
|
+
amount: '10',
|
|
2039
|
+
type: 'native',
|
|
2040
|
+
currentSupply: poolDetails.currentSupply
|
|
2041
|
+
}),
|
|
2042
|
+
sdk.calculateBuyAmountLocal({
|
|
2043
|
+
tokenName: token,
|
|
2044
|
+
amount: '100',
|
|
2045
|
+
type: 'native',
|
|
2046
|
+
currentSupply: poolDetails.currentSupply
|
|
2047
|
+
}),
|
|
2048
|
+
sdk.calculateBuyAmountLocal({
|
|
2049
|
+
tokenName: token,
|
|
2050
|
+
amount: '1000',
|
|
2051
|
+
type: 'native',
|
|
2052
|
+
currentSupply: poolDetails.currentSupply
|
|
2053
|
+
})
|
|
2054
|
+
]);
|
|
2055
|
+
|
|
2056
|
+
console.log(`${token}:`);
|
|
2057
|
+
console.log(` 10 GALA → ${buy10.amount} tokens`);
|
|
2058
|
+
console.log(` 100 GALA → ${buy100.amount} tokens`);
|
|
2059
|
+
console.log(` 1000 GALA → ${buy1000.amount} tokens`);
|
|
2060
|
+
}
|
|
2061
|
+
|
|
2062
|
+
console.timeEnd('Batch Calculations');
|
|
2063
|
+
// Output: Batch Calculations: ~50-100ms (vs ~3-5 seconds without cache)
|
|
2064
|
+
|
|
2065
|
+
// 4. Clear cache when done (optional)
|
|
2066
|
+
sdk.clearCache();
|
|
2067
|
+
console.log('\nCache cleared');
|
|
2068
|
+
```
|
|
2069
|
+
|
|
2070
|
+
## Price History with Token Names (v3.20.0+)
|
|
2071
|
+
|
|
2072
|
+
The SDK now supports convenient token name resolution for price history queries. Instead of providing full token class keys, you can now use simple token names like `"demonkpop"` and the SDK automatically resolves them to the full token identifier.
|
|
2073
|
+
|
|
2074
|
+
### Basic Usage
|
|
2075
|
+
|
|
2076
|
+
```typescript
|
|
2077
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
2078
|
+
|
|
2079
|
+
const sdk = createLaunchpadSDK({
|
|
2080
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
2081
|
+
});
|
|
2082
|
+
|
|
2083
|
+
// ✅ NEW: Use simple token name (auto-resolves to full token ID)
|
|
2084
|
+
const recentHistory = await sdk.fetchPriceHistory({
|
|
2085
|
+
tokenName: 'demonkpop', // Simple, intuitive token name
|
|
2086
|
+
page: 1,
|
|
2087
|
+
limit: 20
|
|
2088
|
+
});
|
|
2089
|
+
|
|
2090
|
+
console.log(`Latest price: $${recentHistory.snapshots[0].price}`);
|
|
2091
|
+
console.log(`Total snapshots: ${recentHistory.total}`);
|
|
2092
|
+
|
|
2093
|
+
// ✅ STILL WORKS: Direct token ID (for advanced use cases)
|
|
2094
|
+
const historyWithId = await sdk.fetchPriceHistory({
|
|
2095
|
+
tokenId: 'Token|Unit|DKP|eth:4A65D29213de2939373ff9eB63AC38730F192C84',
|
|
2096
|
+
page: 1,
|
|
2097
|
+
limit: 20
|
|
2098
|
+
});
|
|
2099
|
+
```
|
|
2100
|
+
|
|
2101
|
+
### Advanced Examples
|
|
2102
|
+
|
|
2103
|
+
```typescript
|
|
2104
|
+
// 1. VOLATILITY ANALYSIS - Using token name for convenience
|
|
2105
|
+
const monthlyHistory = await sdk.fetchPriceHistory({
|
|
2106
|
+
tokenName: 'demonkpop',
|
|
2107
|
+
from: new Date('2025-01-01'),
|
|
2108
|
+
to: new Date('2025-02-01'),
|
|
2109
|
+
sortOrder: 'ASC', // Chronological order for analysis
|
|
2110
|
+
limit: 50
|
|
2111
|
+
});
|
|
2112
|
+
|
|
2113
|
+
const prices = monthlyHistory.snapshots.map(s => parseFloat(s.price));
|
|
2114
|
+
const avgPrice = prices.reduce((a, b) => a + b, 0) / prices.length;
|
|
2115
|
+
console.log(`Average price: $${avgPrice.toFixed(6)}`);
|
|
2116
|
+
|
|
2117
|
+
// 2. AUTO-PAGINATION - Fetch complete dataset with token name
|
|
2118
|
+
const completeHistory = await sdk.fetchAllPriceHistory({
|
|
2119
|
+
tokenName: 'demonkpop',
|
|
2120
|
+
from: new Date('2024-01-01'),
|
|
2121
|
+
to: new Date('2024-12-31'),
|
|
2122
|
+
sortOrder: 'DESC' // Newest first
|
|
2123
|
+
});
|
|
2124
|
+
|
|
2125
|
+
console.log(`Total snapshots: ${completeHistory.snapshots.length}`);
|
|
2126
|
+
console.log(`Date range: ${completeHistory.snapshots[0].timestamp} to ${completeHistory.snapshots[completeHistory.snapshots.length - 1].timestamp}`);
|
|
2127
|
+
|
|
2128
|
+
// 3. PRICE TRENDS - Detect moving averages with pagination
|
|
2129
|
+
const recentData = await sdk.fetchPriceHistory({
|
|
2130
|
+
tokenName: 'demonkpop',
|
|
2131
|
+
from: new Date(Date.now() - 7 * 24 * 60 * 60 * 1000), // Last 7 days
|
|
2132
|
+
sortOrder: 'DESC',
|
|
2133
|
+
limit: 20
|
|
2134
|
+
});
|
|
2135
|
+
|
|
2136
|
+
const ma7 = recentData.snapshots
|
|
2137
|
+
.map(s => parseFloat(s.price))
|
|
2138
|
+
.slice(0, 7)
|
|
2139
|
+
.reduce((a, b) => a + b, 0) / 7;
|
|
2140
|
+
|
|
2141
|
+
console.log(`7-day moving average: $${ma7.toFixed(6)}`);
|
|
2142
|
+
```
|
|
2143
|
+
|
|
2144
|
+
### Token Name Resolution Details
|
|
2145
|
+
|
|
2146
|
+
**Supported Token Name Formats:**
|
|
2147
|
+
- Any token created on the launchpad (e.g., `demonkpop`, `anime`, `shoewars`)
|
|
2148
|
+
- Case-sensitive, 3-20 characters
|
|
2149
|
+
- Alphanumeric characters only
|
|
2150
|
+
- The SDK automatically resolves to full token class key: `Token|Unit|SYMBOL|eth:...`
|
|
2151
|
+
|
|
2152
|
+
**Error Handling:**
|
|
2153
|
+
```typescript
|
|
2154
|
+
try {
|
|
2155
|
+
const history = await sdk.fetchPriceHistory({
|
|
2156
|
+
tokenName: 'unknowntoken'
|
|
2157
|
+
});
|
|
2158
|
+
} catch (error) {
|
|
2159
|
+
if (error.message.includes('Token not found')) {
|
|
2160
|
+
console.log('Token does not exist on the launchpad');
|
|
2161
|
+
} else if (error.message.includes('must be a string between 3 and 20 characters')) {
|
|
2162
|
+
console.log('Invalid token name format');
|
|
2163
|
+
} else {
|
|
2164
|
+
console.log('Network or other error');
|
|
2165
|
+
}
|
|
2166
|
+
}
|
|
2167
|
+
```
|
|
2168
|
+
|
|
2169
|
+
### Comparison: Before and After
|
|
2170
|
+
|
|
2171
|
+
```typescript
|
|
2172
|
+
// ❌ BEFORE (v3.19 and earlier) - Had to provide full token class key
|
|
2173
|
+
const history = await sdk.fetchPriceHistory({
|
|
2174
|
+
tokenId: 'Token|Unit|DKP|eth:4A65D29213de2939373ff9eB63AC38730F192C84',
|
|
2175
|
+
page: 1,
|
|
2176
|
+
limit: 10
|
|
2177
|
+
});
|
|
2178
|
+
|
|
2179
|
+
// ✅ AFTER (v3.20+) - Simple token name, auto-resolves internally
|
|
2180
|
+
const history = await sdk.fetchPriceHistory({
|
|
2181
|
+
tokenName: 'demonkpop',
|
|
2182
|
+
page: 1,
|
|
2183
|
+
limit: 10
|
|
2184
|
+
});
|
|
2185
|
+
```
|
|
2186
|
+
|
|
2187
|
+
### Performance Notes
|
|
2188
|
+
|
|
2189
|
+
- **First Call**: Token name resolution involves a vault lookup (~100-200ms)
|
|
2190
|
+
- **Subsequent Calls**: Vault addresses are cached, making repeated calls instant
|
|
2191
|
+
- **Network**: Requires DEX Backend API access (Node.js only)
|
|
2192
|
+
- **Backwards Compatible**: Existing code using `tokenId` continues to work unchanged
|
|
2193
|
+
|
|
2194
|
+
### Cache Design Philosophy
|
|
2195
|
+
|
|
2196
|
+
**Immutable Data Only**: Only caches data that never changes:
|
|
2197
|
+
- ✅ Reverse bonding curve fee factors (set at token creation)
|
|
2198
|
+
- ✅ Vault addresses (permanent token identifiers)
|
|
2199
|
+
- ✅ Max supply (bonding curve constant, typically 10M)
|
|
2200
|
+
- ❌ Current supply (changes with every trade - fetched dynamically)
|
|
2201
|
+
- ❌ Token balances (user-specific and dynamic)
|
|
2202
|
+
|
|
2203
|
+
**Zero-Cost Architecture**: No extra API calls required for cache warming. Metadata is extracted from responses you're already receiving during normal operations.
|
|
2204
|
+
|
|
2205
|
+
**Bounded Memory**: LRU eviction ensures cache never exceeds 10,000 tokens (~2.5 MB), making it safe for long-running applications.
|
|
2206
|
+
|
|
2207
|
+
**Smart Defaults**: Uses 10,000,000 as default max supply for tokens without explicit data (matches 99%+ of launchpad tokens).
|
|
2208
|
+
|
|
2209
|
+
### When to Use the Cache
|
|
2210
|
+
|
|
2211
|
+
**✅ Perfect for:**
|
|
2212
|
+
- Price discovery and analytics dashboards
|
|
2213
|
+
- Trading bots with frequent calculations
|
|
2214
|
+
- Batch operations on multiple tokens
|
|
2215
|
+
- Real-time price feeds and charts
|
|
2216
|
+
- Simulation and backtesting tools
|
|
2217
|
+
|
|
2218
|
+
**❌ Not needed for:**
|
|
2219
|
+
- Single one-off calculations
|
|
2220
|
+
- Operations requiring absolute real-time precision
|
|
2221
|
+
- Scenarios where current supply changes between calls
|
|
2222
|
+
|
|
2223
|
+
### Cache Warming Demo
|
|
2224
|
+
|
|
2225
|
+
Run the complete cache demo to see all features in action:
|
|
2226
|
+
|
|
2227
|
+
```bash
|
|
2228
|
+
npm run demo-cache
|
|
2229
|
+
```
|
|
2230
|
+
|
|
2231
|
+
The demo showcases:
|
|
2232
|
+
- Opportunistic warming from `fetchPools()`
|
|
2233
|
+
- Detailed warming from `fetchPoolDetailsForCalculation()`
|
|
2234
|
+
- Token name normalization (case-insensitive)
|
|
2235
|
+
- Cache hit performance (200x+ faster than network calls)
|
|
2236
|
+
- Memory estimation accuracy
|
|
2237
|
+
- LRU eviction behavior
|
|
2238
|
+
- Clear cache operations
|
|
2239
|
+
|
|
2240
|
+
### **Trading Operations**
|
|
2241
|
+
|
|
2242
|
+
```typescript
|
|
2243
|
+
// Buy/Sell Tokens
|
|
2244
|
+
buy(options): Promise<TransactionResult>
|
|
2245
|
+
// Options: { tokenName, amount, type, expectedAmount, slippageToleranceFactor }
|
|
2246
|
+
// Returns: { transactionId, status, ... }
|
|
2247
|
+
|
|
2248
|
+
sell(options): Promise<TransactionResult>
|
|
2249
|
+
// Options: { tokenName, amount, type, expectedAmount, slippageToleranceFactor }
|
|
2250
|
+
// Returns: { transactionId, status, ... }
|
|
2251
|
+
|
|
2252
|
+
graduateToken(options): Promise<TransactionResult>
|
|
2253
|
+
// Options: { tokenName, slippageToleranceFactor?, maxAcceptableReverseBondingCurveFeeSlippageFactor?, privateKey? }
|
|
2254
|
+
// Returns: { transactionId, status, ... }
|
|
2255
|
+
// One-step pool graduation: calculates cost and buys all remaining tokens
|
|
2256
|
+
```
|
|
2257
|
+
|
|
2258
|
+
### **GSwap DEX Trading Methods**
|
|
2259
|
+
|
|
2260
|
+
```typescript
|
|
2261
|
+
// GSwap Quote Operations (read-only, fast)
|
|
2262
|
+
getSwapQuoteExactInput(fromToken, toToken, amount): Promise<SwapQuoteResult>
|
|
2263
|
+
// Returns: { fromToken, toToken, inputAmount, estimatedOutput, feeTier, priceImpact, executionPrice }
|
|
2264
|
+
// Get quote for known input amount (spend known GALA, get estimated token output)
|
|
2265
|
+
|
|
2266
|
+
getSwapQuoteExactOutput(fromToken, toToken, amount): Promise<SwapQuoteResult>
|
|
2267
|
+
// Returns: { fromToken, toToken, inputAmount, estimatedOutput, feeTier, priceImpact, executionPrice }
|
|
2268
|
+
// Get quote for known output amount (get known token output, estimate GALA cost)
|
|
2269
|
+
|
|
2270
|
+
// GSwap Swap Execution (requires wallet signer)
|
|
2271
|
+
executeSwap(fromToken, toToken, amount, estimatedOutput, feeTier, slippageTolerance): Promise<ExecuteSwapResult>
|
|
2272
|
+
// Options: { fromToken, toToken, inputAmount, estimatedOutput, feeTier, slippageTolerance }
|
|
2273
|
+
// Returns: { transactionId, status, fromToken, toToken, inputAmount, outputAmount, timestamp }
|
|
2274
|
+
// Execute token swap with automatic slippage protection and unified WebSocket monitoring
|
|
2275
|
+
|
|
2276
|
+
// GSwap User Operations
|
|
2277
|
+
getSwapUserAssets(walletAddress): Promise<UserAsset[]>
|
|
2278
|
+
// Returns: [{ tokenId, symbol, name, description, image, balance, decimals, verified, compositeKey }, ...]
|
|
2279
|
+
// Get user token balances with rich metadata (v4.1.0+)
|
|
2280
|
+
|
|
2281
|
+
getAllSwapUserAssets(walletAddress): Promise<UserAsset[]>
|
|
2282
|
+
// Returns: All user tokens with rich metadata (auto-paginated)
|
|
2283
|
+
// Optimized: Stops fetching when zero-balance tokens encountered
|
|
2284
|
+
|
|
2285
|
+
// Token Discovery (no wallet required)
|
|
2286
|
+
fetchAvailableDexTokens({ search?, limit?, page? }): Promise<AvailableDexTokensResult>
|
|
2287
|
+
// Returns: { tokens: DexToken[], count, page, limit, hasMore }
|
|
2288
|
+
// Paginated token discovery with rich metadata
|
|
2289
|
+
|
|
2290
|
+
fetchAllAvailableDexTokens({ search? }): Promise<DexToken[]>
|
|
2291
|
+
// Returns: All available DEX tokens (auto-paginated)
|
|
2292
|
+
// Use for comprehensive token catalogs and listings
|
|
2293
|
+
|
|
2294
|
+
getSwapPoolInfo(tokenA, tokenB): Promise<PoolInfo>
|
|
2295
|
+
// Returns: { tokenA, tokenB, liquidity, feeTiers, swapCount }
|
|
2296
|
+
// Get liquidity and fee tier information for token pair
|
|
2297
|
+
```
|
|
2298
|
+
|
|
2299
|
+
**Key Features:**
|
|
2300
|
+
- ✅ **Strict token format enforcement** (v3.33.0+): All tokens require delimited format (`'GALA|Unit|none|none'` or `'GALA$Unit$none$none'`)
|
|
2301
|
+
- ✅ **Quote pattern**: Always get quote before executing swap for accurate slippage calculations
|
|
2302
|
+
- ✅ **Unified WebSocket**: Real-time transaction monitoring via shared LaunchpadSDK WebSocket connection
|
|
2303
|
+
- ✅ **Environment alignment**: Automatic STAGE/PROD configuration matching
|
|
2304
|
+
- ✅ **Fee tiers**: Standard DEX fees (500 bps = 0.05%, 3000 bps = 0.30%, 10000 bps = 1.00%)
|
|
2305
|
+
- ✅ **Error handling**: Dedicated error types (GSwapQuoteError, GSwapSwapError, GSwapAssetError, GSwapPoolError)
|
|
2306
|
+
|
|
2307
|
+
### **GSwap DEX Trading** (Graduated Tokens)
|
|
2308
|
+
|
|
2309
|
+
For tokens that have graduated from the bonding curve phase, use GSwap SDK integration for full DEX trading:
|
|
2310
|
+
|
|
2311
|
+
```typescript
|
|
2312
|
+
// Access GSwap trading functionality
|
|
2313
|
+
const gswapService = sdk.gswap;
|
|
2314
|
+
|
|
2315
|
+
// Get swap quotes for graduated tokens
|
|
2316
|
+
const quoteParams = {
|
|
2317
|
+
fromToken: 'GALA',
|
|
2318
|
+
toToken: 'GUSDC',
|
|
2319
|
+
amount: '100'
|
|
2320
|
+
};
|
|
2321
|
+
|
|
2322
|
+
// Quote for exact input (spend known amount)
|
|
2323
|
+
const quoteExactInput = await gswapService.getSwapQuoteExactInput(quoteParams);
|
|
2324
|
+
console.log(`Spend 100 GALA, get ~${quoteExactInput.estimatedOutput} GUSDC`);
|
|
2325
|
+
console.log(`Price impact: ${quoteExactInput.priceImpact}%`);
|
|
2326
|
+
console.log(`Execution price: ${quoteExactInput.executionPrice}`);
|
|
2327
|
+
|
|
2328
|
+
// Quote for exact output (receive known amount)
|
|
2329
|
+
const quoteExactOutput = await gswapService.getSwapQuoteExactOutput({
|
|
2330
|
+
fromToken: 'GALA',
|
|
2331
|
+
toToken: 'GUSDC',
|
|
2332
|
+
amount: '100' // Desired output amount
|
|
2333
|
+
});
|
|
2334
|
+
console.log(`To get 100 GUSDC, spend ~${quoteExactOutput.inputAmount} GALA`);
|
|
2335
|
+
|
|
2336
|
+
// Execute swap with slippage protection
|
|
2337
|
+
const swapResult = await gswapService.executeSwap({
|
|
2338
|
+
fromToken: 'GALA',
|
|
2339
|
+
toToken: 'GUSDC',
|
|
2340
|
+
inputAmount: '100',
|
|
2341
|
+
estimatedOutput: quoteExactInput.estimatedOutput,
|
|
2342
|
+
feeTier: quoteExactInput.feeTier,
|
|
2343
|
+
slippageTolerance: 0.01 // 1% slippage tolerance
|
|
2344
|
+
});
|
|
2345
|
+
|
|
2346
|
+
console.log(`Swap completed! TX: ${swapResult.transactionId}`);
|
|
2347
|
+
console.log(`Received: ${swapResult.outputAmount} GUSDC`);
|
|
2348
|
+
|
|
2349
|
+
// Query user assets on DEX (returns rich metadata)
|
|
2350
|
+
const assets = await gswapService.getUserAssets('eth|0x...');
|
|
2351
|
+
assets.forEach(asset => {
|
|
2352
|
+
console.log(`${asset.symbol} (${asset.name}): ${asset.balance}`);
|
|
2353
|
+
console.log(` Image: ${asset.image}`);
|
|
2354
|
+
console.log(` Verified: ${asset.verified}`);
|
|
2355
|
+
});
|
|
2356
|
+
|
|
2357
|
+
// Discover all available DEX tokens (no wallet required)
|
|
2358
|
+
const availableTokens = await sdk.fetchAvailableDexTokens({ limit: 20, page: 1 });
|
|
2359
|
+
console.log(`Found ${availableTokens.count} tokens on DEX`);
|
|
2360
|
+
availableTokens.tokens.forEach(token => {
|
|
2361
|
+
console.log(`${token.symbol}: ${token.name} - ${token.description}`);
|
|
2362
|
+
});
|
|
2363
|
+
|
|
2364
|
+
// Get ALL available tokens (auto-paginated)
|
|
2365
|
+
const allTokens = await sdk.fetchAllAvailableDexTokens();
|
|
2366
|
+
console.log(`Total: ${allTokens.length} tokens available on DEX`);
|
|
2367
|
+
|
|
2368
|
+
// Get pool information for token pair
|
|
2369
|
+
const poolInfo = await gswapService.getPoolInfo('GALA', 'GUSDC');
|
|
2370
|
+
console.log(`Liquidity: ${poolInfo.liquidity}`);
|
|
2371
|
+
console.log(`Available fee tiers: ${poolInfo.feeTiers}`);
|
|
2372
|
+
```
|
|
2373
|
+
|
|
2374
|
+
**GSwap Error Handling:**
|
|
2375
|
+
|
|
2376
|
+
The GSwap service provides specific error types for different failure scenarios:
|
|
2377
|
+
|
|
2378
|
+
```typescript
|
|
2379
|
+
import {
|
|
2380
|
+
GSwapQuoteError,
|
|
2381
|
+
GSwapSwapError,
|
|
2382
|
+
GSwapPoolError,
|
|
2383
|
+
GSwapAssetError
|
|
2384
|
+
} from '@gala-chain/launchpad-sdk';
|
|
2385
|
+
|
|
2386
|
+
try {
|
|
2387
|
+
const quote = await gswapService.getSwapQuoteExactInput({
|
|
2388
|
+
fromToken: 'INVALID',
|
|
2389
|
+
toToken: 'GUSDC',
|
|
2390
|
+
amount: '100'
|
|
2391
|
+
});
|
|
2392
|
+
} catch (error) {
|
|
2393
|
+
if (error instanceof GSwapQuoteError) {
|
|
2394
|
+
console.error(`Quote failed: ${error.message}`);
|
|
2395
|
+
console.error(`Error code: ${error.code}`);
|
|
2396
|
+
console.error(`Original error:`, error.originalError);
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2400
|
+
try {
|
|
2401
|
+
await gswapService.executeSwap({...});
|
|
2402
|
+
} catch (error) {
|
|
2403
|
+
if (error instanceof GSwapSwapError) {
|
|
2404
|
+
console.error(`Swap failed: ${error.message}`);
|
|
2405
|
+
console.error(`Transaction hash: ${error.transactionHash}`);
|
|
2406
|
+
console.error(`Error code: ${error.code}`);
|
|
2407
|
+
}
|
|
2408
|
+
}
|
|
2409
|
+
|
|
2410
|
+
try {
|
|
2411
|
+
await gswapService.getUserAssets(walletAddress);
|
|
2412
|
+
} catch (error) {
|
|
2413
|
+
if (error instanceof GSwapAssetError) {
|
|
2414
|
+
console.error(`Asset query failed for ${error.walletAddress}: ${error.message}`);
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
```
|
|
2418
|
+
|
|
2419
|
+
**GSwap vs Bonding Curve Trading:**
|
|
2420
|
+
|
|
2421
|
+
| Feature | Bonding Curve (buy/sell) | GSwap DEX (swaps) |
|
|
2422
|
+
|---------|-------------------------|-------------------|
|
|
2423
|
+
| **Token Status** | Pre-graduation | Post-graduation |
|
|
2424
|
+
| **Liquidity** | Algorithmic curve | Concentrated liquidity pools |
|
|
2425
|
+
| **Fee Tiers** | Single: reverseBondingCurveFee | Multiple: 500 (0.05%), 3000 (0.30%), 10000 (1.00%) |
|
|
2426
|
+
| **Price Impact** | Linear/exponential | Depends on pool depth |
|
|
2427
|
+
| **Method** | Direct buy/sell | Quote + execute pattern |
|
|
2428
|
+
| **Quote Types** | Exact input/output | Exact input/output |
|
|
2429
|
+
|
|
2430
|
+
**Performance Considerations:**
|
|
2431
|
+
|
|
2432
|
+
- Quotes are fast (typically <100ms)
|
|
2433
|
+
- Socket connection is auto-established on first swap
|
|
2434
|
+
- Socket failures don't block swaps (graceful degradation)
|
|
2435
|
+
- Use BigNumber for precision in calculations
|
|
2436
|
+
- Slippage tolerance typically 0.5% - 2%
|
|
2437
|
+
|
|
2438
|
+
### **Content Operations**
|
|
2439
|
+
|
|
2440
|
+
```typescript
|
|
2441
|
+
// Comments & Content
|
|
2442
|
+
postComment(options): Promise<CommentResult>
|
|
2443
|
+
// Returns: { id, content, createdAt, ... }
|
|
2444
|
+
|
|
2445
|
+
// Token Creation & Management
|
|
2446
|
+
launchToken(data): Promise<LaunchTokenResult>
|
|
2447
|
+
// Returns: { transactionId, status, ... }
|
|
2448
|
+
|
|
2449
|
+
uploadTokenImage(options): Promise<ImageUploadResult>
|
|
2450
|
+
// Returns: { imageUrl, success, ... }
|
|
2451
|
+
|
|
2452
|
+
// Profile Management
|
|
2453
|
+
updateProfile(data): Promise<ProfileUpdateResult>
|
|
2454
|
+
// Returns: { success, data, ... }
|
|
2455
|
+
|
|
2456
|
+
uploadProfileImage(options): Promise<ImageUploadResult>
|
|
2457
|
+
// Returns: { imageUrl, success, ... }
|
|
2458
|
+
```
|
|
2459
|
+
|
|
2460
|
+
### **Token Data & Validation (v6.0.0+)**
|
|
2461
|
+
|
|
2462
|
+
```typescript
|
|
2463
|
+
// Fetch complete token data with streaming information consolidated
|
|
2464
|
+
fetchToken(tokenName: string): Promise<PoolData>
|
|
2465
|
+
// Returns: Complete pool data including streaming fields (playbackId, muxStreamStatus, currentViewerCount, etc.)
|
|
2466
|
+
// Example: const pool = await sdk.fetchToken('mytoken');
|
|
2467
|
+
|
|
2468
|
+
// Validate token name/symbol for creation or form validation
|
|
2469
|
+
validateToken(options: { tokenName?: string, symbol?: string }): Promise<ValidateTokenResponse>
|
|
2470
|
+
// Returns: { nameAvailable, symbolAvailable, nameBlocklisted, symbolBlocklisted, errors }
|
|
2471
|
+
// Example: const result = await sdk.validateToken({ tokenName: 'mytoken', symbol: 'MYT' });
|
|
2472
|
+
```
|
|
2473
|
+
|
|
2474
|
+
**Migration Note (v6.0.0)**: `getStreamInfo()` was removed. Use `fetchToken()` instead - streaming fields now consolidated in PoolData response.
|
|
2475
|
+
|
|
2476
|
+
### **Validation & Utilities**
|
|
2477
|
+
- `isTokenNameAvailable(tokenName: string): Promise<boolean>`
|
|
2478
|
+
- `isTokenSymbolAvailable(symbol: string): Promise<boolean>`
|
|
2479
|
+
- `isTokenGraduated(tokenName: string): Promise<boolean>` - Check if token completed bonding curve phase
|
|
2480
|
+
- `getAddress(): string` - Get backend format address (eth|...)
|
|
2481
|
+
- `getEthereumAddress(): string` - Get Ethereum format address (0x...)
|
|
2482
|
+
- `getUrlByTokenName(tokenName: string): string` - Get frontend URL for token
|
|
2483
|
+
- `resolveVaultAddress(tokenName: string): Promise<string>`
|
|
2484
|
+
- `cleanup(): void` - Cleanup resources
|
|
2485
|
+
|
|
2486
|
+
### **Cross-Chain Bridge Operations**
|
|
2487
|
+
|
|
2488
|
+
```typescript
|
|
2489
|
+
// Bridge Configuration (requires ethereumPrivateKey and/or solanaPrivateKey)
|
|
2490
|
+
|
|
2491
|
+
// Wallet Balance Queries - Single Token (Fast - 1 RPC call)
|
|
2492
|
+
fetchEthereumWalletTokenBalance(symbol, address?): Promise<ExternalChainBalance>
|
|
2493
|
+
// Fetch single ERC-20 balance (GALA, GWETH, GUSDC, GUSDT, GWTRX, GWBTC)
|
|
2494
|
+
|
|
2495
|
+
fetchEthereumWalletNativeBalance(address?): Promise<ExternalChainBalance>
|
|
2496
|
+
// Fetch native ETH balance only
|
|
2497
|
+
|
|
2498
|
+
fetchSolanaWalletTokenBalance(symbol, address?): Promise<ExternalChainBalance>
|
|
2499
|
+
// Fetch single SPL token balance (GALA, GSOL)
|
|
2500
|
+
|
|
2501
|
+
fetchSolanaWalletNativeBalance(address?): Promise<ExternalChainBalance>
|
|
2502
|
+
// Fetch native SOL balance only
|
|
2503
|
+
|
|
2504
|
+
// Wallet Balance Queries - All Tokens (Complete Portfolio)
|
|
2505
|
+
fetchEthereumWalletAllBalances(address?): Promise<EthereumWalletBalanceResult>
|
|
2506
|
+
// Returns: { address, native, tokens[], timestamp } - ETH + 6 ERC-20s
|
|
2507
|
+
|
|
2508
|
+
fetchSolanaWalletAllBalances(address?): Promise<SolanaWalletBalanceResult>
|
|
2509
|
+
// Returns: { address, native, tokens[], timestamp } - SOL + 2 SPL tokens
|
|
2510
|
+
|
|
2511
|
+
// Bridge Operations
|
|
2512
|
+
estimateBridgeFee(options): Promise<BridgeFeeEstimate>
|
|
2513
|
+
// Estimate fees for bridging tokens
|
|
2514
|
+
|
|
2515
|
+
bridgeOut(options): Promise<BridgeResult>
|
|
2516
|
+
// Bridge tokens FROM GalaChain TO Ethereum/Solana
|
|
2517
|
+
|
|
2518
|
+
bridgeIn(options): Promise<BridgeResult>
|
|
2519
|
+
// Bridge tokens FROM Ethereum/Solana TO GalaChain
|
|
2520
|
+
|
|
2521
|
+
getBridgeStatus(transactionHash, chainHint?): Promise<BridgeStatus>
|
|
2522
|
+
// Check status of bridge transaction
|
|
2523
|
+
|
|
2524
|
+
getSupportedBridgeTokens(chain?): BridgeTokenInfo[]
|
|
2525
|
+
// List supported bridge tokens
|
|
2526
|
+
```
|
|
2527
|
+
|
|
2528
|
+
## Configuration
|
|
2529
|
+
|
|
2530
|
+
### Constants
|
|
2531
|
+
|
|
2532
|
+
```typescript
|
|
2533
|
+
import { MAX_CONCURRENT_POOL_FETCHES } from '@gala-chain/launchpad-sdk';
|
|
2534
|
+
|
|
2535
|
+
console.log(`SDK fetches up to ${MAX_CONCURRENT_POOL_FETCHES} pages concurrently`);
|
|
2536
|
+
// Output: "SDK fetches up to 5 pages concurrently"
|
|
2537
|
+
```
|
|
2538
|
+
|
|
2539
|
+
**MAX_CONCURRENT_POOL_FETCHES**
|
|
2540
|
+
- **Type**: `number`
|
|
2541
|
+
- **Value**: `5`
|
|
2542
|
+
- **Purpose**: Controls concurrency for parallel page fetching in auto-pagination
|
|
2543
|
+
- **Balances**: Speed vs API rate limits
|
|
2544
|
+
- **Usage**: Exported constant for reference (not configurable at runtime)
|
|
2545
|
+
|
|
2546
|
+
### SDK Configuration
|
|
2547
|
+
|
|
2548
|
+
```typescript
|
|
2549
|
+
interface LaunchpadSDKConfig {
|
|
2550
|
+
wallet: Wallet; // ethers.js Wallet instance
|
|
2551
|
+
baseUrl?: string; // Backend URL (default: dev environment)
|
|
2552
|
+
galaChainBaseUrl?: string; // GalaChain gateway URL
|
|
2553
|
+
bundleBaseUrl?: string; // Bundle service URL
|
|
2554
|
+
webSocketUrl?: string; // WebSocket URL for monitoring
|
|
2555
|
+
timeout?: number; // Request timeout (default: 30000ms)
|
|
2556
|
+
debug?: boolean; // Enable debug logging
|
|
2557
|
+
maxRetries?: number; // Retry attempts (default: 3)
|
|
2558
|
+
retryDelay?: number; // Retry delay (default: 1000ms)
|
|
2559
|
+
}
|
|
2560
|
+
```
|
|
2561
|
+
|
|
2562
|
+
## Helper Functions
|
|
2563
|
+
|
|
2564
|
+
### **Wallet Creation**
|
|
2565
|
+
```typescript
|
|
2566
|
+
import { createWallet, validateWalletInput } from '@gala-chain/launchpad-sdk';
|
|
2567
|
+
|
|
2568
|
+
// Auto-detect format and create wallet
|
|
2569
|
+
const wallet = createWallet('private-key-or-24-word-mnemonic');
|
|
2570
|
+
const randomWallet = createWallet(); // Generate random wallet
|
|
2571
|
+
|
|
2572
|
+
// Validate input format without creating wallet
|
|
2573
|
+
const isValid = validateWalletInput('0x1234...'); // boolean
|
|
2574
|
+
```
|
|
2575
|
+
|
|
2576
|
+
### **Key Derivation**
|
|
2577
|
+
|
|
2578
|
+
Derive public keys and addresses from private keys without creating a wallet:
|
|
2579
|
+
|
|
2580
|
+
```typescript
|
|
2581
|
+
import {
|
|
2582
|
+
getPublicKeyFromPrivateKey,
|
|
2583
|
+
getEthereumAddressFromPrivateKey
|
|
2584
|
+
} from '@gala-chain/launchpad-sdk';
|
|
2585
|
+
|
|
2586
|
+
// Get public key (both compressed and uncompressed formats)
|
|
2587
|
+
const { publicKey, compressedPublicKey } = getPublicKeyFromPrivateKey('0x...');
|
|
2588
|
+
// publicKey: "0x04..." (132 chars, uncompressed)
|
|
2589
|
+
// compressedPublicKey: "0x02..." or "0x03..." (68 chars)
|
|
2590
|
+
|
|
2591
|
+
// Get Ethereum address from private key
|
|
2592
|
+
const address = getEthereumAddressFromPrivateKey('0x...');
|
|
2593
|
+
// "0x8Ba1f109551bD432803012645Ac136ddd64DBA72" (checksum format)
|
|
2594
|
+
|
|
2595
|
+
// Convert to GalaChain format manually
|
|
2596
|
+
const galaChainAddress = `eth|${address.slice(2).toLowerCase()}`;
|
|
2597
|
+
// "eth|8ba1f109551bd432803012645ac136ddd64dba72"
|
|
2598
|
+
```
|
|
2599
|
+
|
|
2600
|
+
### **GalaChain Address Override**
|
|
2601
|
+
|
|
2602
|
+
For non-standard GalaChain addresses (like `client|ops-admin`), use the `galaChainAddress` config option:
|
|
2603
|
+
|
|
2604
|
+
```typescript
|
|
2605
|
+
import { LaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
2606
|
+
|
|
2607
|
+
// Standard: address derived from wallet
|
|
2608
|
+
const sdk = new LaunchpadSDK({ wallet });
|
|
2609
|
+
sdk.getAddress(); // "eth|a1b2c3d4..."
|
|
2610
|
+
|
|
2611
|
+
// Override: use custom GalaChain address
|
|
2612
|
+
const adminSdk = new LaunchpadSDK({
|
|
2613
|
+
wallet,
|
|
2614
|
+
galaChainAddress: 'client|ops-admin'
|
|
2615
|
+
});
|
|
2616
|
+
adminSdk.getAddress(); // "client|ops-admin"
|
|
2617
|
+
```
|
|
2618
|
+
|
|
2619
|
+
Or via environment variable for MCP/Agent setups:
|
|
2620
|
+
```bash
|
|
2621
|
+
export WALLET_PRIVATE_KEY=0x...
|
|
2622
|
+
export WALLET_ADDRESS=client|ops-admin # Override
|
|
2623
|
+
```
|
|
2624
|
+
|
|
2625
|
+
### **SDK Factory Functions**
|
|
2626
|
+
```typescript
|
|
2627
|
+
import { createLaunchpadSDK, createTestLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
2628
|
+
|
|
2629
|
+
// Main factory with auto-detection
|
|
2630
|
+
const sdk = createLaunchpadSDK({
|
|
2631
|
+
wallet: 'your-private-key-or-mnemonic',
|
|
2632
|
+
config: {
|
|
2633
|
+
baseUrl: 'https://lpad-backend-dev1.defi.gala.com',
|
|
2634
|
+
debug: true
|
|
2635
|
+
}
|
|
2636
|
+
});
|
|
2637
|
+
|
|
2638
|
+
// Test-optimized SDK
|
|
2639
|
+
const testSDK = createTestLaunchpadSDK({
|
|
2640
|
+
wallet: 'test-private-key'
|
|
2641
|
+
});
|
|
2642
|
+
```
|
|
2643
|
+
|
|
2644
|
+
### **Position Filter Utilities**
|
|
2645
|
+
|
|
2646
|
+
Helpers for organizing and filtering liquidity positions by various criteria:
|
|
2647
|
+
|
|
2648
|
+
```typescript
|
|
2649
|
+
import {
|
|
2650
|
+
filterByLiquidity, // Remove positions with zero liquidity
|
|
2651
|
+
filterByMinLiquidity, // Keep positions >= threshold
|
|
2652
|
+
filterByTokenPair, // Match specific token pair
|
|
2653
|
+
filterByToken, // Find positions containing a token
|
|
2654
|
+
filterByFeeTier, // Filter by fee tier (500, 3000, 10000)
|
|
2655
|
+
filterByPoolKey, // Match specific pool (token pair + fee)
|
|
2656
|
+
sortByLiquidity, // Sort positions by liquidity amount
|
|
2657
|
+
groupByTokenPair, // Group by "TOKEN0/TOKEN1"
|
|
2658
|
+
groupByFeeTier, // Group by fee tier
|
|
2659
|
+
groupByPoolKey, // Group by "TOKEN0|TOKEN1|FEETIER"
|
|
2660
|
+
} from '@gala-chain/launchpad-sdk';
|
|
2661
|
+
|
|
2662
|
+
// Example: Find active GALA/GUSDC positions and sort by size
|
|
2663
|
+
const allPositions = await sdk.getAllSwapUserLiquidityPositions(address);
|
|
2664
|
+
const active = filterByLiquidity(allPositions); // Remove zero-liquidity
|
|
2665
|
+
const galaPositions = filterByTokenPair(active, 'GALA', 'GUSDC'); // GALA/GUSDC only
|
|
2666
|
+
const sorted = sortByLiquidity(galaPositions, 'desc'); // Largest first
|
|
2667
|
+
|
|
2668
|
+
// Group positions by token pair for portfolio analysis
|
|
2669
|
+
const grouped = groupByTokenPair(active);
|
|
2670
|
+
grouped.forEach((positions, pair) => {
|
|
2671
|
+
console.log(`${pair}: ${positions.length} positions`);
|
|
2672
|
+
});
|
|
2673
|
+
|
|
2674
|
+
// Find positions with significant liquidity
|
|
2675
|
+
const large = filterByMinLiquidity(active, '1000');
|
|
2676
|
+
|
|
2677
|
+
// Organize by pool (pair + fee tier) for advanced analysis
|
|
2678
|
+
const byPool = groupByPoolKey(active);
|
|
2679
|
+
byPool.forEach((positions, poolKey) => {
|
|
2680
|
+
console.log(`Pool ${poolKey}: ${positions.length} LPs`);
|
|
2681
|
+
});
|
|
2682
|
+
```
|
|
2683
|
+
|
|
2684
|
+
**Use Cases:**
|
|
2685
|
+
- Organize positions by token pair or pool
|
|
2686
|
+
- Filter for active positions (non-zero liquidity)
|
|
2687
|
+
- Find positions above minimum liquidity threshold
|
|
2688
|
+
- Analyze portfolio distribution by token or fee tier
|
|
2689
|
+
- Identify opportunities for fee collection
|
|
2690
|
+
- Locate positions in specific pools
|
|
2691
|
+
|
|
2692
|
+
## Testing
|
|
2693
|
+
|
|
2694
|
+
```bash
|
|
2695
|
+
# Run all tests
|
|
2696
|
+
npm test
|
|
2697
|
+
|
|
2698
|
+
# Run integration tests (requires environment setup)
|
|
2699
|
+
npm run test:integration
|
|
2700
|
+
|
|
2701
|
+
# Run type checking
|
|
2702
|
+
npm run typecheck
|
|
2703
|
+
|
|
2704
|
+
# Run linting
|
|
2705
|
+
npm run lint
|
|
2706
|
+
```
|
|
2707
|
+
|
|
2708
|
+
## Documentation
|
|
2709
|
+
|
|
2710
|
+
- [API Reference](./docs/API-REFERENCE.md) - Complete reference for all SDK methods with examples
|
|
2711
|
+
- [Examples](./examples/) - Code examples and demos
|
|
2712
|
+
- [AI Agent Guide](./docs/AI-AGENT-GUIDE.md) - Building AI agents with the Launchpad SDK
|
|
2713
|
+
|
|
2714
|
+
### GSwap Liquidity Operations
|
|
2715
|
+
|
|
2716
|
+
- [Liquidity Operations Guide](./docs/LIQUIDITY_OPERATIONS.md) - Complete guide for managing liquidity positions (viewing, adding, collecting fees, removing)
|
|
2717
|
+
- [Liquidity Response Structures](./docs/LIQUIDITY_RESPONSES.md) - Detailed reference for all liquidity operation response formats and error handling
|
|
2718
|
+
- [GSwap SDK Integration](./docs/GSWAP_INTEGRATION.md) - Deep dive into GSwap patterns, token formats, and advanced trading workflows
|
|
2719
|
+
|
|
2720
|
+
### NFT Collection Management
|
|
2721
|
+
|
|
2722
|
+
- [NFT Quick Reference](./docs/NFT_QUICK_REFERENCE.md) - Quick lookup for NFT collection, token class, and minting operations with fee schedules
|
|
2723
|
+
- [NFT Operations Guide](./docs/NFT_OPERATIONS.md) - Complete guide for claiming collections, creating token classes, minting NFTs, and querying NFT data
|
|
2724
|
+
|
|
2725
|
+
### WebSocket & Real-Time Events
|
|
2726
|
+
|
|
2727
|
+
- [WebSocket Documentation Hub](./docs/websocket/) - Complete guide to WebSocket connections and real-time events
|
|
2728
|
+
- [Global Feed Quick Start](./docs/websocket/QUICKSTART.md) - Get real-time updates in 5 minutes
|
|
2729
|
+
- [Global Feed Guide](./docs/websocket/GLOBAL-FEED.md) - Comprehensive guide to unified event streaming
|
|
2730
|
+
- [WebSocket Authentication](./docs/websocket/AUTHENTICATION.md) - JWT authentication and security best practices
|
|
2731
|
+
|
|
2732
|
+
### Demo Scripts
|
|
2733
|
+
|
|
2734
|
+
The SDK includes 36 comprehensive demo scripts organized into logical categories for easy discovery and learning.
|
|
2735
|
+
|
|
2736
|
+
#### Organized Directory Structure
|
|
2737
|
+
|
|
2738
|
+
```
|
|
2739
|
+
examples/
|
|
2740
|
+
├── core/ # SDK fundamentals and authentication patterns
|
|
2741
|
+
├── liquidity/ # GalaSwap liquidity position management (9 demos)
|
|
2742
|
+
├── bonding-curve/ # Token bonding curve trading operations
|
|
2743
|
+
├── dex/ # DEX trading and pool discovery (6 demos)
|
|
2744
|
+
├── fees/ # Fee generation and collection workflows (5 demos)
|
|
2745
|
+
├── monitoring/ # Real-time event watching (2 demos)
|
|
2746
|
+
├── utilities/ # Balance checks, cache, token supply (5 demos)
|
|
2747
|
+
└── debug/ # Development and troubleshooting tools
|
|
2748
|
+
```
|
|
2749
|
+
|
|
2750
|
+
#### Quick Start Examples
|
|
2751
|
+
|
|
2752
|
+
**Core SDK Operations:**
|
|
2753
|
+
```bash
|
|
2754
|
+
# Complete SDK feature demonstration
|
|
2755
|
+
npm run demo
|
|
2756
|
+
|
|
2757
|
+
# Read-only operations (no wallet required)
|
|
2758
|
+
npm run demo:read-only
|
|
2759
|
+
|
|
2760
|
+
# Authenticated operations (wallet required)
|
|
2761
|
+
npm run demo:authenticated
|
|
2762
|
+
|
|
2763
|
+
# Multi-wallet private key override pattern
|
|
2764
|
+
npm run demo:privatekey-override
|
|
2765
|
+
```
|
|
2766
|
+
|
|
2767
|
+
#### Liquidity Position Management (9 Demos)
|
|
2768
|
+
|
|
2769
|
+
Comprehensive liquidity provision workflows for GalaSwap DEX:
|
|
2770
|
+
|
|
2771
|
+
```bash
|
|
2772
|
+
# Interactive CLI for position management
|
|
2773
|
+
npm run demo:liquidity
|
|
2774
|
+
|
|
2775
|
+
# Run all 9 liquidity demos sequentially
|
|
2776
|
+
npm run demo:liquidity:all
|
|
2777
|
+
|
|
2778
|
+
# Individual demos
|
|
2779
|
+
npm run demo:liquidity:detailed # Detailed position lifecycle
|
|
2780
|
+
npm run demo:liquidity:ticks # Advanced tick-based positions
|
|
2781
|
+
npm run demo:liquidity:portfolio # Multi-position portfolio management
|
|
2782
|
+
npm run demo:liquidity:apr # APR calculation for LP positions
|
|
2783
|
+
npm run demo:liquidity:errors # Error handling patterns
|
|
2784
|
+
npm run demo:liquidity:fetch-all # Fetch all positions with pagination
|
|
2785
|
+
npm run demo:liquidity:positions-with-prices # Position pricing enrichment
|
|
2786
|
+
|
|
2787
|
+
# Complete roundtrip workflow (legacy, use orchestrator instead)
|
|
2788
|
+
npm run demo:dex:roundtrip
|
|
2789
|
+
```
|
|
2790
|
+
|
|
2791
|
+
**Orchestrator Pattern:**
|
|
2792
|
+
The liquidity orchestrator (`npm run demo:liquidity:all`) runs all demos with intelligent error handling:
|
|
2793
|
+
- Skip individual demos: `--skip=detailed,ticks`
|
|
2794
|
+
- Run specific demos only: `--only=portfolio,apr`
|
|
2795
|
+
- See all available demos: `npm run demo:liquidity:all --help`
|
|
2796
|
+
|
|
2797
|
+
#### Bonding Curve Trading (Launchpad Tokens)
|
|
2798
|
+
|
|
2799
|
+
Pre-graduation token trading on bonding curve pools:
|
|
2800
|
+
|
|
2801
|
+
```bash
|
|
2802
|
+
# Basic buy/sell operations with slippage protection
|
|
2803
|
+
npm run demo:trades
|
|
2804
|
+
```
|
|
2805
|
+
|
|
2806
|
+
**Bonding Curve Focus:**
|
|
2807
|
+
8 additional bonding curve demos are available through the orchestrator (in development):
|
|
2808
|
+
- Pool discovery and filtering
|
|
2809
|
+
- Price calculation methods
|
|
2810
|
+
- Graduation simulation
|
|
2811
|
+
- Multi-token analysis
|
|
2812
|
+
- Fee structure exploration
|
|
2813
|
+
- Slippage testing scenarios
|
|
2814
|
+
|
|
2815
|
+
#### DEX Trading Operations (6 Demos)
|
|
2816
|
+
|
|
2817
|
+
Graduated token trading on GalaSwap DEX with full liquidity pool support:
|
|
2818
|
+
|
|
2819
|
+
```bash
|
|
2820
|
+
# DEX swap workflow (quote → execute → confirm)
|
|
2821
|
+
npm run demo:dex
|
|
2822
|
+
|
|
2823
|
+
# Pool discovery and metrics
|
|
2824
|
+
npm run demo:dex:pools
|
|
2825
|
+
|
|
2826
|
+
# Pool pricing and TVL analysis
|
|
2827
|
+
npm run demo:dex:pricing
|
|
2828
|
+
|
|
2829
|
+
# Quote comparison (exact input vs exact output)
|
|
2830
|
+
npm run demo:dex:quotes
|
|
2831
|
+
|
|
2832
|
+
# Complete swap roundtrip (buy → sell → verify)
|
|
2833
|
+
npm run demo:roundtrip:swap
|
|
2834
|
+
```
|
|
2835
|
+
|
|
2836
|
+
#### Fee Generation and Collection (5 Demos)
|
|
2837
|
+
|
|
2838
|
+
Liquidity provider fee workflows with multi-wallet testing:
|
|
2839
|
+
|
|
2840
|
+
```bash
|
|
2841
|
+
# Basic fee generation and collection
|
|
2842
|
+
npm run demo:fees
|
|
2843
|
+
|
|
2844
|
+
# High-volume trading fee accumulation
|
|
2845
|
+
npm run demo:fees:high-volume
|
|
2846
|
+
|
|
2847
|
+
# Complete fee lifecycle test suite
|
|
2848
|
+
npm run demo:fees:test
|
|
2849
|
+
|
|
2850
|
+
# Trade and collect fees in single workflow
|
|
2851
|
+
npm run demo:fees:trade-collect
|
|
2852
|
+
```
|
|
2853
|
+
|
|
2854
|
+
**Note:** `demo-multi-wallet-fee-generation.ts` is available but not exposed in npm scripts (advanced usage).
|
|
2855
|
+
|
|
2856
|
+
#### Real-Time Monitoring (2 Demos)
|
|
2857
|
+
|
|
2858
|
+
WebSocket-based event watchers for pool and token creation:
|
|
2859
|
+
|
|
2860
|
+
```bash
|
|
2861
|
+
# Watch for new DEX pool creation
|
|
2862
|
+
npm run demo:watch
|
|
2863
|
+
|
|
2864
|
+
# Watch for new launchpad token launches
|
|
2865
|
+
npm run demo:watch:tokens
|
|
2866
|
+
```
|
|
2867
|
+
|
|
2868
|
+
#### Utility Operations (5 Demos)
|
|
2869
|
+
|
|
2870
|
+
Balance queries, caching, and token supply information:
|
|
2871
|
+
|
|
2872
|
+
```bash
|
|
2873
|
+
# Metadata cache warming and performance testing
|
|
2874
|
+
npm run demo:cache
|
|
2875
|
+
|
|
2876
|
+
# Token supply metrics from GalaChain
|
|
2877
|
+
npm run demo:token-supply
|
|
2878
|
+
```
|
|
2879
|
+
|
|
2880
|
+
**Additional utilities:**
|
|
2881
|
+
- `balances.ts` - Multi-token balance queries
|
|
2882
|
+
- `balance.ts` - Single token balance check
|
|
2883
|
+
- `price-history.ts` - Historical price data (Node.js only)
|
|
2884
|
+
|
|
2885
|
+
#### Debug and Development Tools
|
|
2886
|
+
|
|
2887
|
+
Advanced troubleshooting and environment testing:
|
|
2888
|
+
|
|
2889
|
+
```bash
|
|
2890
|
+
# Environment alignment verification
|
|
2891
|
+
tsx examples/debug/test-env-alignment.ts
|
|
2892
|
+
|
|
2893
|
+
# Slot0 data debugging
|
|
2894
|
+
tsx examples/debug/debug-getslot0-test.ts
|
|
2895
|
+
|
|
2896
|
+
# DEX simulation with monkey patching
|
|
2897
|
+
tsx examples/debug/demo-dex-monkey-patch-simulation.ts
|
|
2898
|
+
```
|
|
2899
|
+
|
|
2900
|
+
#### Demo Statistics
|
|
2901
|
+
|
|
2902
|
+
- **Total Demos:** 36 working examples
|
|
2903
|
+
- **npm Scripts:** 25 convenient shortcuts
|
|
2904
|
+
- **Categories:** 8 organized directories
|
|
2905
|
+
- **Coverage:** All major SDK features demonstrated
|
|
2906
|
+
|
|
2907
|
+
#### Recommended Learning Path
|
|
2908
|
+
|
|
2909
|
+
1. **Start Here:** `npm run demo` - Complete SDK overview
|
|
2910
|
+
2. **Liquidity Basics:** `npm run demo:liquidity` - Interactive CLI
|
|
2911
|
+
3. **DEX Trading:** `npm run demo:dex` - Swap workflow
|
|
2912
|
+
4. **Fee Management:** `npm run demo:fees` - LP fee collection
|
|
2913
|
+
5. **Advanced:** Explore individual demos by category
|
|
2914
|
+
|
|
2915
|
+
#### Migration Notes
|
|
2916
|
+
|
|
2917
|
+
**Removed Scripts (v3.32.0+):**
|
|
2918
|
+
- `demo:liquidity:simple` - Merged into `demo:liquidity`
|
|
2919
|
+
- `demo:liquidity:workflow` - Replaced by orchestrator pattern
|
|
2920
|
+
- `demo:dex:swap` - Renamed to `demo:dex` for consistency
|
|
2921
|
+
|
|
2922
|
+
**New in v3.32.0+:**
|
|
2923
|
+
- Organized directory structure with 8 categories
|
|
2924
|
+
- Bonding curve orchestrator (in development)
|
|
2925
|
+
- Fee demo npm scripts now exposed
|
|
2926
|
+
- Symmetry: Both bonding-curve and dex have pool discovery demos
|
|
2927
|
+
|
|
2928
|
+
For detailed migration guide, see [docs/DEMO_MIGRATION_GUIDE.md](./docs/DEMO_MIGRATION_GUIDE.md).
|
|
2929
|
+
|
|
2930
|
+
## Architecture
|
|
2931
|
+
|
|
2932
|
+
The SDK uses a **service-based architecture** with backend-aligned services:
|
|
2933
|
+
|
|
2934
|
+
### Backend-Aligned Services
|
|
2935
|
+
|
|
2936
|
+
```typescript
|
|
2937
|
+
// Each service maps 1:1 to a specific backend
|
|
2938
|
+
import {
|
|
2939
|
+
LaunchpadService, // → launchpad-backend (pools, trades, comments, profiles)
|
|
2940
|
+
GalaChainService, // → galachain-gateway (balances, transfers, pool details)
|
|
2941
|
+
DexService, // → dex-api (spot prices)
|
|
2942
|
+
BundleService, // → bundle-backend (transaction bundling, trading)
|
|
2943
|
+
WebSocketService // → WebSocket endpoint (real-time monitoring)
|
|
2944
|
+
} from '@gala-chain/launchpad-sdk';
|
|
2945
|
+
```
|
|
2946
|
+
|
|
2947
|
+
### Service Responsibilities
|
|
2948
|
+
|
|
2949
|
+
**LaunchpadService** - Launchpad Backend Operations (Facade)
|
|
2950
|
+
|
|
2951
|
+
LaunchpadService uses a **facade pattern** internally, delegating to specialized sub-services:
|
|
2952
|
+
|
|
2953
|
+
```typescript
|
|
2954
|
+
// Internal architecture (v3.6.0+)
|
|
2955
|
+
LaunchpadService (facade)
|
|
2956
|
+
├── PoolService - Pool queries, distribution, badges, volume data
|
|
2957
|
+
│ ├── fetchPools() - Supports auto-pagination (v3.11.0+)
|
|
2958
|
+
│ ├── fetchAllPools() - Convenience method for limit: 0
|
|
2959
|
+
│ └── ...other pool operations
|
|
2960
|
+
├── TradeService - Trade history and queries
|
|
2961
|
+
├── CommentService - Comments with vault resolution
|
|
2962
|
+
├── UserService - Profile management and token lists
|
|
2963
|
+
├── ImageService - Image upload operations
|
|
2964
|
+
└── FaucetService - Faucet transfer operations
|
|
2965
|
+
```
|
|
2966
|
+
|
|
2967
|
+
**Facade Benefits:**
|
|
2968
|
+
- ✅ Single responsibility: Each sub-service has one clear purpose
|
|
2969
|
+
- ✅ Maintainability: 76.8% reduction in main service file (1,657 → 384 lines)
|
|
2970
|
+
- ✅ Code reuse: Shared utilities for query building and response normalization
|
|
2971
|
+
- ✅ Backward compatibility: All public methods unchanged
|
|
2972
|
+
- ✅ Testability: Sub-services can be tested independently
|
|
2973
|
+
|
|
2974
|
+
**Public API (unchanged):**
|
|
2975
|
+
- Pool management (fetch, create, check) with auto-pagination
|
|
2976
|
+
- Trade history
|
|
2977
|
+
- Comments (post, fetch)
|
|
2978
|
+
- User profiles
|
|
2979
|
+
- Token images
|
|
2980
|
+
- Faucet operations
|
|
2981
|
+
|
|
2982
|
+
**GalaChainService** - Blockchain Operations
|
|
2983
|
+
- GALA balance queries
|
|
2984
|
+
- Token balance queries
|
|
2985
|
+
- Token transfers (GALA & launchpad tokens)
|
|
2986
|
+
- Pool details from bonding curve contracts
|
|
2987
|
+
- Token resolution
|
|
2988
|
+
|
|
2989
|
+
**DexService** - Price Queries
|
|
2990
|
+
- Spot price fetching
|
|
2991
|
+
- Multi-token price queries
|
|
2992
|
+
|
|
2993
|
+
**BundleService** - Transaction Bundling
|
|
2994
|
+
- Buy token operations
|
|
2995
|
+
- Sell token operations
|
|
2996
|
+
- Slippage protection
|
|
2997
|
+
- Transaction bundling
|
|
2998
|
+
|
|
2999
|
+
**WebSocketService** - Real-time Features
|
|
3000
|
+
- Transaction monitoring
|
|
3001
|
+
- Status updates
|
|
3002
|
+
- Connection management
|
|
3003
|
+
|
|
3004
|
+
### Benefits of Service Architecture
|
|
3005
|
+
|
|
3006
|
+
✅ **Clear Separation**: Each service has a single backend responsibility
|
|
3007
|
+
✅ **Type Safety**: Full TypeScript support across all services
|
|
3008
|
+
✅ **Testability**: Services can be tested independently
|
|
3009
|
+
✅ **Maintainability**: Easy to locate and update backend-specific logic
|
|
3010
|
+
|
|
3011
|
+
### AI Agent Integration
|
|
3012
|
+
|
|
3013
|
+
The SDK includes comprehensive utilities for AI agent development:
|
|
3014
|
+
|
|
3015
|
+
```typescript
|
|
3016
|
+
import { AgentConfig } from '@gala-chain/launchpad-sdk';
|
|
3017
|
+
|
|
3018
|
+
// Quick setup with intelligent defaults
|
|
3019
|
+
const { sdk, validation } = await AgentConfig.quickSetup({
|
|
3020
|
+
environment: 'development',
|
|
3021
|
+
autoValidate: true
|
|
3022
|
+
});
|
|
3023
|
+
|
|
3024
|
+
console.log(`Ready: ${validation.ready}`);
|
|
3025
|
+
console.log(`Can trade: ${validation.capabilities.canTrade}`);
|
|
3026
|
+
```
|
|
3027
|
+
|
|
3028
|
+
For comprehensive AI agent integration, see:
|
|
3029
|
+
- [AI Agent Integration Guide](./docs/AI-AGENT-GUIDE.md) - Complete guide for agent development
|
|
3030
|
+
- [MCP Tool Specification](./docs/MCP-TOOL-SPECIFICATION.md) - Blueprint for MCP server creation
|
|
3031
|
+
- [Agent Examples](./docs/agent-examples/) - Working code examples
|
|
3032
|
+
|
|
3033
|
+
## Clean Result Types Architecture
|
|
3034
|
+
|
|
3035
|
+
### Key Benefits
|
|
3036
|
+
|
|
3037
|
+
✅ **Direct Property Access**: No more `result.data.success` chains
|
|
3038
|
+
✅ **Type Safety**: Full TypeScript IntelliSense for all result properties
|
|
3039
|
+
✅ **Semantic Types**: Dates as Date objects, numbers as numbers
|
|
3040
|
+
✅ **Computed Properties**: `hasNext`, `hasPrevious` for convenience
|
|
3041
|
+
✅ **Zero Wrapper Overhead**: Clean, direct access to all result data
|
|
3042
|
+
✅ **Options Object Pattern**: All multi-parameter methods use options objects
|
|
3043
|
+
|
|
3044
|
+
### Result Type Examples
|
|
3045
|
+
|
|
3046
|
+
```typescript
|
|
3047
|
+
// Pool results with pagination
|
|
3048
|
+
interface PoolsResult {
|
|
3049
|
+
pools: PoolData[]; // Direct pool array
|
|
3050
|
+
page: number; // Current page
|
|
3051
|
+
total: number; // Total items
|
|
3052
|
+
hasNext: boolean; // Computed convenience
|
|
3053
|
+
// ... more properties
|
|
3054
|
+
}
|
|
3055
|
+
|
|
3056
|
+
// Token balance with typed values
|
|
3057
|
+
interface TokenBalanceInfo {
|
|
3058
|
+
quantity: string; // Token amount (string for precision)
|
|
3059
|
+
holdingPriceUsd: number; // USD value (number for math)
|
|
3060
|
+
lastUpdated: Date; // Date object (not string)
|
|
3061
|
+
isFinalized: boolean; // Boolean flag
|
|
3062
|
+
// ... more properties
|
|
3063
|
+
}
|
|
3064
|
+
|
|
3065
|
+
// Trading results
|
|
3066
|
+
interface AmountCalculationResult {
|
|
3067
|
+
amount: string; // Calculated amount
|
|
3068
|
+
transactionFee: string; // Fee breakdown
|
|
3069
|
+
reverseBondingCurveFee: string; // RBC fee
|
|
3070
|
+
// Direct access to all calculation data
|
|
3071
|
+
}
|
|
3072
|
+
```
|
|
3073
|
+
|
|
3074
|
+
|
|
3075
|
+
## What's New in v7.0.0+
|
|
3076
|
+
|
|
3077
|
+
### Unified Messages API
|
|
3078
|
+
|
|
3079
|
+
All message types (CHAT and COMMENT) are now accessible through a single unified endpoint:
|
|
3080
|
+
|
|
3081
|
+
```typescript
|
|
3082
|
+
// List all message types for a token
|
|
3083
|
+
const result = await sdk.listMessages({ tokenName: 'anime' });
|
|
3084
|
+
|
|
3085
|
+
// Filter by type
|
|
3086
|
+
const chatOnly = await sdk.listMessages({
|
|
3087
|
+
tokenName: 'anime',
|
|
3088
|
+
contentType: 'CHAT'
|
|
3089
|
+
});
|
|
3090
|
+
|
|
3091
|
+
// Create, update, delete messages
|
|
3092
|
+
await sdk.createMessage({
|
|
3093
|
+
tokenName: 'anime',
|
|
3094
|
+
contentType: 'CHAT',
|
|
3095
|
+
content: 'Great project!'
|
|
3096
|
+
});
|
|
3097
|
+
|
|
3098
|
+
// Pin important messages
|
|
3099
|
+
await sdk.pinMessage(messageId);
|
|
3100
|
+
```
|
|
3101
|
+
|
|
3102
|
+
### User Data Access
|
|
3103
|
+
|
|
3104
|
+
New methods for accessing user information:
|
|
3105
|
+
|
|
3106
|
+
```typescript
|
|
3107
|
+
// Fetch user token balances
|
|
3108
|
+
const balances = await sdk.fetchUserBalances({
|
|
3109
|
+
address: '0x...',
|
|
3110
|
+
limit: 50
|
|
3111
|
+
});
|
|
3112
|
+
|
|
3113
|
+
// Get comprehensive user report (Overseer only)
|
|
3114
|
+
const report = await sdk.fetchUserReport({
|
|
3115
|
+
address: '0x...'
|
|
3116
|
+
});
|
|
3117
|
+
```
|
|
3118
|
+
|
|
3119
|
+
### Token Statistics
|
|
3120
|
+
|
|
3121
|
+
Get engagement metrics for tokens:
|
|
3122
|
+
|
|
3123
|
+
```typescript
|
|
3124
|
+
const stats = await sdk.fetchTokenStats('anime');
|
|
3125
|
+
console.log(`Messages: ${stats.messageCount}`);
|
|
3126
|
+
console.log(`Peak viewers: ${stats.peakViewerCount}`);
|
|
3127
|
+
```
|
|
3128
|
+
|
|
3129
|
+
### Simplified Restricted Names Management
|
|
3130
|
+
|
|
3131
|
+
Manage platform restricted words with a simplified API:
|
|
3132
|
+
|
|
3133
|
+
```typescript
|
|
3134
|
+
// Get current list
|
|
3135
|
+
const result = await sdk.getRestrictedNames();
|
|
3136
|
+
const names = result.data.content.split('\n');
|
|
3137
|
+
|
|
3138
|
+
// Update list
|
|
3139
|
+
await sdk.updateRestrictedNames('badword1\nbadword2\nbadword3');
|
|
3140
|
+
```
|
|
3141
|
+
|
|
3142
|
+
## Documentation
|
|
3143
|
+
|
|
3144
|
+
Comprehensive documentation for all SDK features:
|
|
3145
|
+
|
|
3146
|
+
- **[SDK API Updates](../docs/SDK_API_UPDATES.md)** - Complete guide to new v7.0.0+ methods
|
|
3147
|
+
- **[Usage Guide](../docs/USAGE_GUIDE.md)** - Step-by-step examples for all features
|
|
3148
|
+
- **[API Reference](../docs/API-REFERENCE.md)** - Complete method reference with signatures
|
|
3149
|
+
- **[DTO Reference](../docs/DTO_REFERENCE.md)** - All data type definitions
|
|
3150
|
+
- **[Migration Guide](../docs/MIGRATION_GUIDE_SDK.md)** - Upgrading from v6.x to v7.0+
|
|
3151
|
+
- **[Examples](./EXAMPLES.md)** - Practical code examples by category
|
|
3152
|
+
|
|
3153
|
+
## Environment URLs
|
|
3154
|
+
|
|
3155
|
+
- **Development**: `https://lpad-backend-dev1.defi.gala.com`
|
|
3156
|
+
- **Production**: `https://lpad-backend-prod1.defi.gala.com`
|
|
3157
|
+
|
|
3158
|
+
## License
|
|
3159
|
+
|
|
3160
|
+
MIT License - see [LICENSE](../../LICENSE) file for details.
|
|
3161
|
+
|
|
3162
|
+
## Contributing
|
|
3163
|
+
|
|
3164
|
+
Please read [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines on contributing to this project.
|
|
3165
|
+
|
|
3166
|
+
## Support
|
|
3167
|
+
|
|
3168
|
+
- GitHub Issues: [Report bugs and request features](https://github.com/gala-chain/launchpad-sdk/issues)
|
|
3169
|
+
- Documentation: [Full documentation and examples](./docs/)
|
|
3170
|
+
- API Status: All methods working and tested
|
|
3171
|
+
|
|
3172
|
+
---
|
|
3173
|
+
|
|
3174
|
+
**Built with love for the Gala ecosystem**
|