@gala-chain/launchpad-sdk 8.1.0 → 9.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +837 -0
- package/EXAMPLES.md +95 -681
- package/MIGRATING-TO-9.0.md +343 -0
- package/README.md +46 -17
- package/dist/LaunchpadSDK.d.ts +536 -616
- package/dist/LaunchpadSDK.d.ts.map +1 -1
- package/dist/api/LaunchpadAPI.d.ts +6 -176
- package/dist/api/LaunchpadAPI.d.ts.map +1 -1
- package/dist/auth/SessionAuthService.d.ts +32 -2
- package/dist/auth/SessionAuthService.d.ts.map +1 -1
- package/dist/auth/SignatureAuth.d.ts +2 -2
- package/dist/auth/SignatureAuth.d.ts.map +1 -1
- package/dist/auth/session.d.ts +59 -0
- package/dist/auth/session.d.ts.map +1 -0
- package/dist/auth/types.d.ts +7 -2
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/config/environments.d.ts +7 -2
- package/dist/config/environments.d.ts.map +1 -1
- package/dist/constants/decimals.d.ts +0 -23
- package/dist/constants/decimals.d.ts.map +1 -1
- package/dist/constants/endpoints.d.ts +19 -8
- package/dist/constants/endpoints.d.ts.map +1 -1
- package/dist/constants/enums.d.ts +19 -0
- package/dist/constants/enums.d.ts.map +1 -1
- package/dist/constants/version.generated.d.ts +1 -1
- package/dist/constants/version.generated.d.ts.map +1 -1
- package/dist/errors/LaunchpadSDKError.d.ts +18 -0
- package/dist/errors/LaunchpadSDKError.d.ts.map +1 -1
- package/dist/helpers/sdk.d.ts.map +1 -1
- package/dist/index.browser.d.ts +40 -45
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.esm.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/index.node.d.ts +4 -5
- package/dist/index.node.d.ts.map +1 -1
- package/dist/launchpad/bundle-submission.d.ts +57 -10
- package/dist/launchpad/bundle-submission.d.ts.map +1 -1
- package/dist/launchpad/create-sale-validation.d.ts +19 -0
- package/dist/launchpad/create-sale-validation.d.ts.map +1 -0
- package/dist/launchpad/transport.d.ts +33 -2
- package/dist/launchpad/transport.d.ts.map +1 -1
- package/dist/launchpad/writes.d.ts +37 -11
- package/dist/launchpad/writes.d.ts.map +1 -1
- package/dist/native.cjs +1 -1
- package/dist/native.d.ts +4 -5
- package/dist/native.d.ts.map +1 -1
- package/dist/native.esm.js +1 -1
- package/dist/schemas/launchpad.d.ts +3 -2
- package/dist/schemas/launchpad.d.ts.map +1 -1
- package/dist/schemas/primitives.d.ts +12 -2
- package/dist/schemas/primitives.d.ts.map +1 -1
- package/dist/schemas/user.d.ts +3 -18
- package/dist/schemas/user.d.ts.map +1 -1
- package/dist/schemas/validators.d.ts +3 -3
- package/dist/services/AbstractCacheService.d.ts +2 -2
- package/dist/services/ApiKeyService.d.ts +1 -1
- package/dist/services/BanService.d.ts +1 -1
- package/dist/services/ChartService.d.ts.map +1 -1
- package/dist/services/ContentReactionService.d.ts +6 -18
- package/dist/services/ContentReactionService.d.ts.map +1 -1
- package/dist/services/EventsQueryService.d.ts +47 -0
- package/dist/services/EventsQueryService.d.ts.map +1 -0
- package/dist/services/GalaChainBalanceService.d.ts +17 -89
- package/dist/services/GalaChainBalanceService.d.ts.map +1 -1
- package/dist/services/GalaChainLockService.d.ts +19 -20
- package/dist/services/GalaChainLockService.d.ts.map +1 -1
- package/dist/services/GalaChainService.d.ts +28 -15
- package/dist/services/GalaChainService.d.ts.map +1 -1
- package/dist/services/GalaChainTokenService.d.ts +25 -53
- package/dist/services/GalaChainTokenService.d.ts.map +1 -1
- package/dist/services/GalaChainTransferService.d.ts +42 -41
- package/dist/services/GalaChainTransferService.d.ts.map +1 -1
- package/dist/services/HealthService.d.ts +33 -0
- package/dist/services/HealthService.d.ts.map +1 -0
- package/dist/services/ImageService.d.ts +3 -3
- package/dist/services/ImageService.d.ts.map +1 -1
- package/dist/services/LaunchpadPriceService.d.ts +66 -0
- package/dist/services/LaunchpadPriceService.d.ts.map +1 -0
- package/dist/services/LaunchpadService.d.ts +34 -42
- package/dist/services/LaunchpadService.d.ts.map +1 -1
- package/dist/services/MessagesService.d.ts +12 -44
- package/dist/services/MessagesService.d.ts.map +1 -1
- package/dist/services/ModeratorService.d.ts +2 -2
- package/dist/services/ModeratorService.d.ts.map +1 -1
- package/dist/services/NftCollectionService.d.ts +22 -6
- package/dist/services/NftCollectionService.d.ts.map +1 -1
- package/dist/services/OverseerService.d.ts +3 -3
- package/dist/services/OverseerService.d.ts.map +1 -1
- package/dist/services/PlatformStatsService.d.ts +1 -2
- package/dist/services/PlatformStatsService.d.ts.map +1 -1
- package/dist/services/PoolService.d.ts +28 -65
- package/dist/services/PoolService.d.ts.map +1 -1
- package/dist/services/RestrictedNamesService.d.ts +1 -1
- package/dist/services/RestrictedNamesService.d.ts.map +1 -1
- package/dist/services/StreamChatService.d.ts +8 -19
- package/dist/services/StreamChatService.d.ts.map +1 -1
- package/dist/services/StreamTokenServiceBase.d.ts +2 -1
- package/dist/services/StreamTokenServiceBase.d.ts.map +1 -1
- package/dist/services/StreamWebSocketService.d.ts +423 -451
- package/dist/services/StreamWebSocketService.d.ts.map +1 -1
- package/dist/services/StreamingService.d.ts +14 -15
- package/dist/services/StreamingService.d.ts.map +1 -1
- package/dist/services/TokenBanService.d.ts +1 -1
- package/dist/services/TokenResolverService.d.ts +5 -5
- package/dist/services/TokenResolverService.d.ts.map +1 -1
- package/dist/services/TradeService.d.ts +13 -9
- package/dist/services/TradeService.d.ts.map +1 -1
- package/dist/services/TradingQuotesService.d.ts.map +1 -1
- package/dist/services/UserService.d.ts +64 -20
- package/dist/services/UserService.d.ts.map +1 -1
- package/dist/services/gateway-transport.d.ts +32 -0
- package/dist/services/gateway-transport.d.ts.map +1 -0
- package/dist/services/gateway-writes.d.ts +83 -0
- package/dist/services/gateway-writes.d.ts.map +1 -0
- package/dist/services/realtime/event-catalog.d.ts +456 -0
- package/dist/services/realtime/event-catalog.d.ts.map +1 -0
- package/dist/services/shared/pagination-helpers.d.ts +22 -5
- package/dist/services/shared/pagination-helpers.d.ts.map +1 -1
- package/dist/services/shared/service-validators.d.ts.map +1 -1
- package/dist/signing/index.d.ts +2 -3
- package/dist/signing/index.d.ts.map +1 -1
- package/dist/signing/signers.d.ts +64 -9
- package/dist/signing/signers.d.ts.map +1 -1
- package/dist/signing/types.d.ts +7 -10
- package/dist/signing/types.d.ts.map +1 -1
- package/dist/types/api-key.dto.d.ts +1 -1
- package/dist/types/ban.dto.d.ts +21 -16
- package/dist/types/ban.dto.d.ts.map +1 -1
- package/dist/types/burn.dto.d.ts +4 -2
- package/dist/types/burn.dto.d.ts.map +1 -1
- package/dist/types/chat-messages.dto.d.ts +10 -72
- package/dist/types/chat-messages.dto.d.ts.map +1 -1
- package/dist/types/comments.dto.d.ts +8 -78
- package/dist/types/comments.dto.d.ts.map +1 -1
- package/dist/types/common.d.ts +42 -85
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/constraints.d.ts +47 -23
- package/dist/types/constraints.d.ts.map +1 -1
- package/dist/types/content-flag.dto.d.ts +5 -1
- package/dist/types/content-flag.dto.d.ts.map +1 -1
- package/dist/types/content-reactions.dto.d.ts +0 -4
- package/dist/types/content-reactions.dto.d.ts.map +1 -1
- package/dist/types/dto.d.ts +0 -5
- package/dist/types/dto.d.ts.map +1 -1
- package/dist/types/engagement-stats.dto.d.ts +16 -27
- package/dist/types/engagement-stats.dto.d.ts.map +1 -1
- package/dist/types/events.dto.d.ts +89 -0
- package/dist/types/events.dto.d.ts.map +1 -1
- package/dist/types/global-feed.dto.d.ts +23 -164
- package/dist/types/global-feed.dto.d.ts.map +1 -1
- package/dist/types/health.dto.d.ts +32 -0
- package/dist/types/health.dto.d.ts.map +1 -0
- package/dist/types/launchpad.dto.d.ts +77 -323
- package/dist/types/launchpad.dto.d.ts.map +1 -1
- package/dist/types/lock.dto.d.ts +12 -7
- package/dist/types/lock.dto.d.ts.map +1 -1
- package/dist/types/messages.dto.d.ts +168 -118
- package/dist/types/messages.dto.d.ts.map +1 -1
- package/dist/types/moderator.dto.d.ts +1 -1
- package/dist/types/options.dto.d.ts +8 -36
- package/dist/types/options.dto.d.ts.map +1 -1
- package/dist/types/overseer.dto.d.ts +2 -1
- package/dist/types/overseer.dto.d.ts.map +1 -1
- package/dist/types/platform-stats.dto.d.ts +3 -3
- package/dist/types/realtime-events.dto.d.ts +340 -0
- package/dist/types/realtime-events.dto.d.ts.map +1 -0
- package/dist/types/restricted-names.dto.d.ts +2 -2
- package/dist/types/restricted-names.dto.d.ts.map +1 -1
- package/dist/types/stream-chat.dto.d.ts +15 -14
- package/dist/types/stream-chat.dto.d.ts.map +1 -1
- package/dist/types/streaming.dto.d.ts +73 -104
- package/dist/types/streaming.dto.d.ts.map +1 -1
- package/dist/types/token-ban.dto.d.ts.map +1 -1
- package/dist/types/token-config.dto.d.ts +34 -19
- package/dist/types/token-config.dto.d.ts.map +1 -1
- package/dist/types/trades-query.dto.d.ts +8 -24
- package/dist/types/trades-query.dto.d.ts.map +1 -1
- package/dist/types/user.dto.d.ts +133 -112
- package/dist/types/user.dto.d.ts.map +1 -1
- package/dist/types/websocket-events.dto.d.ts +5 -5
- package/dist/types/websocket-events.dto.d.ts.map +1 -1
- package/dist/utils/address-formatter.d.ts +25 -2
- package/dist/utils/address-formatter.d.ts.map +1 -1
- package/dist/utils/agent-config.d.ts +9 -4
- package/dist/utils/agent-config.d.ts.map +1 -1
- package/dist/utils/auto-pagination.d.ts +7 -240
- package/dist/utils/auto-pagination.d.ts.map +1 -1
- package/dist/utils/bignumber-helpers.d.ts +3 -2
- package/dist/utils/bignumber-helpers.d.ts.map +1 -1
- package/dist/utils/delimiter-parser.d.ts +0 -13
- package/dist/utils/delimiter-parser.d.ts.map +1 -1
- package/dist/utils/error-factories.d.ts +4 -3
- package/dist/utils/error-factories.d.ts.map +1 -1
- package/dist/utils/error-patterns.d.ts +0 -47
- package/dist/utils/error-patterns.d.ts.map +1 -1
- package/dist/utils/error-wrapper.d.ts +5 -5
- package/dist/utils/errors.d.ts +53 -318
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/http.d.ts +36 -3
- package/dist/utils/http.d.ts.map +1 -1
- package/dist/utils/message-validators.d.ts.map +1 -1
- package/dist/utils/pagination-helpers.d.ts +17 -0
- package/dist/utils/pagination-helpers.d.ts.map +1 -1
- package/dist/utils/pagination-validation.d.ts +2 -2
- package/dist/utils/response-handlers.d.ts.map +1 -1
- package/dist/utils/service-validators.d.ts +6 -6
- package/dist/utils/service-validators.d.ts.map +1 -1
- package/dist/utils/token-format-converter.d.ts +1 -1
- package/dist/utils/token-parser.d.ts +6 -127
- package/dist/utils/token-parser.d.ts.map +1 -1
- package/dist/utils/token-stringification.d.ts +7 -7
- package/dist/utils/token-stringification.d.ts.map +1 -1
- package/dist/utils/tokenNameNormalizer.d.ts +2 -2
- package/dist/utils/tokenNormalizer.d.ts +5 -29
- package/dist/utils/tokenNormalizer.d.ts.map +1 -1
- package/dist/utils/unique-key-generator.d.ts +7 -134
- package/dist/utils/unique-key-generator.d.ts.map +1 -1
- package/dist/utils/validation-helpers.d.ts +21 -64
- package/dist/utils/validation-helpers.d.ts.map +1 -1
- package/dist/utils/validation.d.ts +4 -1
- package/dist/utils/validation.d.ts.map +1 -1
- package/package.json +47 -87
- package/dist/api/dto/BurnTokensDto.d.ts +0 -77
- package/dist/api/dto/BurnTokensDto.d.ts.map +0 -1
- package/dist/api/dto/LockTokenDto.d.ts +0 -85
- package/dist/api/dto/LockTokenDto.d.ts.map +0 -1
- package/dist/api/dto/TransferTokenDto.d.ts +0 -64
- package/dist/api/dto/TransferTokenDto.d.ts.map +0 -1
- package/dist/api/dto/UnlockTokenDto.d.ts +0 -74
- package/dist/api/dto/UnlockTokenDto.d.ts.map +0 -1
- package/dist/bridge/BridgeService.d.ts +0 -484
- package/dist/bridge/BridgeService.d.ts.map +0 -1
- package/dist/bridge/GalaConnectClient.d.ts +0 -170
- package/dist/bridge/GalaConnectClient.d.ts.map +0 -1
- package/dist/bridge/constants/index.d.ts +0 -7
- package/dist/bridge/constants/index.d.ts.map +0 -1
- package/dist/bridge/constants/tokens.d.ts +0 -212
- package/dist/bridge/constants/tokens.d.ts.map +0 -1
- package/dist/bridge/index.d.ts +0 -24
- package/dist/bridge/index.d.ts.map +0 -1
- package/dist/bridge/public-types.d.ts +0 -2
- package/dist/bridge/public-types.d.ts.map +0 -1
- package/dist/bridge/strategies/BridgeStrategy.d.ts +0 -204
- package/dist/bridge/strategies/BridgeStrategy.d.ts.map +0 -1
- package/dist/bridge/strategies/EthereumBridgeStrategy.d.ts +0 -178
- package/dist/bridge/strategies/EthereumBridgeStrategy.d.ts.map +0 -1
- package/dist/bridge/strategies/SolanaBridgeStrategy.d.ts +0 -236
- package/dist/bridge/strategies/SolanaBridgeStrategy.d.ts.map +0 -1
- package/dist/bridge/types/bridge.dto.d.ts +0 -772
- package/dist/bridge/types/bridge.dto.d.ts.map +0 -1
- package/dist/bridge/types/bridgeable-token.dto.d.ts +0 -209
- package/dist/bridge/types/bridgeable-token.dto.d.ts.map +0 -1
- package/dist/bridge/types/eip712.d.ts +0 -66
- package/dist/bridge/types/eip712.d.ts.map +0 -1
- package/dist/bridge/types/index.d.ts +0 -8
- package/dist/bridge/types/index.d.ts.map +0 -1
- package/dist/bridge/utils/RateLimiter.d.ts +0 -34
- package/dist/bridge/utils/RateLimiter.d.ts.map +0 -1
- package/dist/bridge/utils/address-formatter.d.ts +0 -25
- package/dist/bridge/utils/address-formatter.d.ts.map +0 -1
- package/dist/bridge/utils/addressValidation.d.ts +0 -200
- package/dist/bridge/utils/addressValidation.d.ts.map +0 -1
- package/dist/bridge/utils/balanceHelpers.d.ts +0 -215
- package/dist/bridge/utils/balanceHelpers.d.ts.map +0 -1
- package/dist/bridge/utils/bridgeErrors.d.ts +0 -98
- package/dist/bridge/utils/bridgeErrors.d.ts.map +0 -1
- package/dist/bridge/utils/bridgeOutHelpers.d.ts +0 -68
- package/dist/bridge/utils/bridgeOutHelpers.d.ts.map +0 -1
- package/dist/bridge/utils/bridgePayload.d.ts +0 -98
- package/dist/bridge/utils/bridgePayload.d.ts.map +0 -1
- package/dist/bridge/utils/bridgeStatusParser.d.ts +0 -76
- package/dist/bridge/utils/bridgeStatusParser.d.ts.map +0 -1
- package/dist/bridge/utils/eip712Helpers.d.ts +0 -66
- package/dist/bridge/utils/eip712Helpers.d.ts.map +0 -1
- package/dist/bridge/utils/index.d.ts +0 -19
- package/dist/bridge/utils/index.d.ts.map +0 -1
- package/dist/bridge/utils/retry.d.ts +0 -112
- package/dist/bridge/utils/retry.d.ts.map +0 -1
- package/dist/bridge/utils/strategyDelegation.d.ts +0 -126
- package/dist/bridge/utils/strategyDelegation.d.ts.map +0 -1
- package/dist/bridge/utils/tokenIdUtils.d.ts +0 -86
- package/dist/bridge/utils/tokenIdUtils.d.ts.map +0 -1
- package/dist/bridge/utils/tokenMath.d.ts +0 -39
- package/dist/bridge/utils/tokenMath.d.ts.map +0 -1
- package/dist/bridge/utils/tokenMetadataResolver.d.ts +0 -97
- package/dist/bridge/utils/tokenMetadataResolver.d.ts.map +0 -1
- package/dist/helpers/wallet.d.ts +0 -151
- package/dist/helpers/wallet.d.ts.map +0 -1
- package/dist/react/WalletContext.d.ts +0 -60
- package/dist/react/WalletContext.d.ts.map +0 -1
- package/dist/react/index.d.ts +0 -65
- package/dist/react/index.d.ts.map +0 -1
- package/dist/react/types.d.ts +0 -76
- package/dist/react/types.d.ts.map +0 -1
- package/dist/react/useWallet.d.ts +0 -123
- package/dist/react/useWallet.d.ts.map +0 -1
- package/dist/react/useWalletConnection.d.ts +0 -89
- package/dist/react/useWalletConnection.d.ts.map +0 -1
- package/dist/react/useWalletDetection.d.ts +0 -81
- package/dist/react/useWalletDetection.d.ts.map +0 -1
- package/dist/react.cjs +0 -1
- package/dist/react.esm.js +0 -1
- package/dist/services/AbstractTokenFetchService.d.ts +0 -150
- package/dist/services/AbstractTokenFetchService.d.ts.map +0 -1
- package/dist/services/BatchedCacheService.d.ts +0 -133
- package/dist/services/BatchedCacheService.d.ts.map +0 -1
- package/dist/services/BridgeableTokenCache.d.ts +0 -120
- package/dist/services/BridgeableTokenCache.d.ts.map +0 -1
- package/dist/services/BridgeableTokenService.d.ts +0 -218
- package/dist/services/BridgeableTokenService.d.ts.map +0 -1
- package/dist/services/DexService.d.ts +0 -440
- package/dist/services/DexService.d.ts.map +0 -1
- package/dist/services/NetworkKeyedCacheService.d.ts +0 -185
- package/dist/services/NetworkKeyedCacheService.d.ts.map +0 -1
- package/dist/services/PriceHistoryService.d.ts +0 -209
- package/dist/services/PriceHistoryService.d.ts.map +0 -1
- package/dist/services/StreamingEventService.d.ts +0 -441
- package/dist/services/StreamingEventService.d.ts.map +0 -1
- package/dist/services/WrapService.d.ts +0 -171
- package/dist/services/WrapService.d.ts.map +0 -1
- package/dist/services/WrappableTokenCache.d.ts +0 -100
- package/dist/services/WrappableTokenCache.d.ts.map +0 -1
- package/dist/services/WrappableTokenService.d.ts +0 -130
- package/dist/services/WrappableTokenService.d.ts.map +0 -1
- package/dist/setup.d.ts +0 -8
- package/dist/setup.d.ts.map +0 -1
- package/dist/tokens/transfers.d.ts +0 -95
- package/dist/tokens/transfers.d.ts.map +0 -1
- package/dist/types/comment.dto.d.ts +0 -176
- package/dist/types/comment.dto.d.ts.map +0 -1
- package/dist/types/galachain-api.types.d.ts +0 -297
- package/dist/types/galachain-api.types.d.ts.map +0 -1
- package/dist/types/priceHistory.dto.d.ts +0 -134
- package/dist/types/priceHistory.dto.d.ts.map +0 -1
- package/dist/types/streaming-events.dto.d.ts +0 -605
- package/dist/types/streaming-events.dto.d.ts.map +0 -1
- package/dist/types/token.types.d.ts +0 -359
- package/dist/types/token.types.d.ts.map +0 -1
- package/dist/types/wrappable-token.dto.d.ts +0 -305
- package/dist/types/wrappable-token.dto.d.ts.map +0 -1
- package/dist/utils/crypto-compat.d.ts +0 -40
- package/dist/utils/crypto-compat.d.ts.map +0 -1
- package/dist/utils/load-env.d.ts +0 -31
- package/dist/utils/load-env.d.ts.map +0 -1
- package/dist/utils/token-instance-key.d.ts +0 -57
- package/dist/utils/token-instance-key.d.ts.map +0 -1
- package/dist/utils/wallet.d.ts +0 -166
- package/dist/utils/wallet.d.ts.map +0 -1
- package/dist/wallet/ExternalWalletProvider.d.ts +0 -90
- package/dist/wallet/ExternalWalletProvider.d.ts.map +0 -1
- package/dist/wallet/GalaWalletProvider.d.ts +0 -122
- package/dist/wallet/GalaWalletProvider.d.ts.map +0 -1
- package/dist/wallet/PrivateKeyProvider.d.ts +0 -90
- package/dist/wallet/PrivateKeyProvider.d.ts.map +0 -1
- package/dist/wallet/detection.d.ts +0 -107
- package/dist/wallet/detection.d.ts.map +0 -1
- package/dist/wallet/event-handlers.d.ts +0 -50
- package/dist/wallet/event-handlers.d.ts.map +0 -1
- package/dist/wallet/index.d.ts +0 -51
- package/dist/wallet/index.d.ts.map +0 -1
- package/dist/wallet/signing-operation.d.ts +0 -19
- package/dist/wallet/signing-operation.d.ts.map +0 -1
- package/dist/wallet/typed-data-helpers.d.ts +0 -68
- package/dist/wallet/typed-data-helpers.d.ts.map +0 -1
- package/dist/wallet/types.d.ts +0 -267
- package/dist/wallet/types.d.ts.map +0 -1
- package/dist/wallet/utils.d.ts +0 -117
- package/dist/wallet/utils.d.ts.map +0 -1
- package/dist/wallet.cjs +0 -1
- package/dist/wallet.esm.js +0 -1
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Ethereum Bridge Strategy
|
|
3
|
-
*
|
|
4
|
-
* Implements bridging between GalaChain and Ethereum networks.
|
|
5
|
-
* Handles ERC-20 approvals, EIP-712 signing, and bridge contract interactions.
|
|
6
|
-
*/
|
|
7
|
-
import type { GalaConnectClient } from '../GalaConnectClient.js';
|
|
8
|
-
import type { BridgeFeeEstimate, BridgeInParams, BridgeOutParams, BridgeTransaction, EthereumTokenConfig, EthereumTransactionStatus, ExternalNetwork } from '../types/index.js';
|
|
9
|
-
import { ConfiguredBridgeStrategy } from './BridgeStrategy.js';
|
|
10
|
-
/**
|
|
11
|
-
* Configuration for Ethereum bridge strategy.
|
|
12
|
-
*/
|
|
13
|
-
export interface EthereumBridgeConfig {
|
|
14
|
-
/** GalaConnect API client */
|
|
15
|
-
galaConnectClient: GalaConnectClient;
|
|
16
|
-
/** GalaChain wallet address (eth|0x...) */
|
|
17
|
-
galaChainWalletAddress: string;
|
|
18
|
-
/** Ethereum private key for signing */
|
|
19
|
-
ethereumPrivateKey: string;
|
|
20
|
-
/** Ethereum RPC URL */
|
|
21
|
-
ethereumRpcUrl?: string;
|
|
22
|
-
/** Ethereum bridge contract address */
|
|
23
|
-
ethereumBridgeContract?: string;
|
|
24
|
-
/** Ethereum wallet address (derived from private key if not provided) */
|
|
25
|
-
ethereumWalletAddress?: string;
|
|
26
|
-
/** Token configurations */
|
|
27
|
-
tokenConfigs?: EthereumTokenConfig[];
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Bridge strategy for GalaChain ↔ Ethereum transfers.
|
|
31
|
-
*
|
|
32
|
-
* Supports 6 tokens: GALA, GWETH, GUSDC, GUSDT, GWTRX, GWBTC
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```typescript
|
|
36
|
-
* const strategy = new EthereumBridgeStrategy({
|
|
37
|
-
* galaConnectClient,
|
|
38
|
-
* galaChainWalletAddress: 'eth|0x1234...',
|
|
39
|
-
* ethereumPrivateKey: '0xabcd...',
|
|
40
|
-
* });
|
|
41
|
-
*
|
|
42
|
-
* // Bridge out (GalaChain → Ethereum)
|
|
43
|
-
* const tx = await strategy.bridgeOut({
|
|
44
|
-
* tokenSymbol: 'GALA',
|
|
45
|
-
* amount: '100',
|
|
46
|
-
* destinationChain: 'Ethereum',
|
|
47
|
-
* recipientAddress: '0x5678...',
|
|
48
|
-
* });
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
export declare class EthereumBridgeStrategy extends ConfiguredBridgeStrategy<EthereumTokenConfig> {
|
|
52
|
-
readonly network: ExternalNetwork;
|
|
53
|
-
/**
|
|
54
|
-
* Ethereum finality threshold (number of confirmations).
|
|
55
|
-
* 12+ confirmations is the practical finality threshold for Ethereum mainnet.
|
|
56
|
-
*/
|
|
57
|
-
static readonly ETHEREUM_FINALITY_THRESHOLD = 12;
|
|
58
|
-
private readonly galaChainWalletAddress;
|
|
59
|
-
private readonly ethereumProvider;
|
|
60
|
-
private readonly ethereumWallet;
|
|
61
|
-
private readonly ethereumBridgeContract;
|
|
62
|
-
private readonly ethereumWalletAddress;
|
|
63
|
-
private readonly tokenMetadataResolver;
|
|
64
|
-
/**
|
|
65
|
-
* Creates a new Ethereum bridge strategy.
|
|
66
|
-
*
|
|
67
|
-
* @param config - Strategy configuration
|
|
68
|
-
* @throws Error if ethereumPrivateKey is invalid format
|
|
69
|
-
*/
|
|
70
|
-
constructor(config: EthereumBridgeConfig);
|
|
71
|
-
/**
|
|
72
|
-
* Estimate bridge fees for a transfer to Ethereum.
|
|
73
|
-
*
|
|
74
|
-
* @param tokenSymbol - Token symbol (e.g., 'GALA', 'GWETH')
|
|
75
|
-
* @param amount - Amount in decimal format
|
|
76
|
-
* @returns Fee estimate with breakdown
|
|
77
|
-
*/
|
|
78
|
-
estimateFee(tokenSymbol: string, amount: string): Promise<BridgeFeeEstimate>;
|
|
79
|
-
/**
|
|
80
|
-
* Bridge tokens from GalaChain to Ethereum.
|
|
81
|
-
*
|
|
82
|
-
* @param params - Bridge out parameters
|
|
83
|
-
* @returns Transaction details
|
|
84
|
-
*/
|
|
85
|
-
bridgeOut(params: BridgeOutParams): Promise<BridgeTransaction>;
|
|
86
|
-
/**
|
|
87
|
-
* Bridge tokens from Ethereum to GalaChain.
|
|
88
|
-
*
|
|
89
|
-
* @param params - Bridge in parameters
|
|
90
|
-
* @returns Transaction details
|
|
91
|
-
*/
|
|
92
|
-
bridgeIn(params: BridgeInParams): Promise<BridgeTransaction>;
|
|
93
|
-
/**
|
|
94
|
-
* Validate an Ethereum address.
|
|
95
|
-
*
|
|
96
|
-
* @param address - Address to validate
|
|
97
|
-
* @returns True if valid Ethereum address
|
|
98
|
-
*/
|
|
99
|
-
isValidAddress(address: string): boolean;
|
|
100
|
-
/**
|
|
101
|
-
* Get the configured Ethereum wallet address.
|
|
102
|
-
*
|
|
103
|
-
* @returns Ethereum wallet address (0x format)
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* ```typescript
|
|
107
|
-
* const address = strategy.getWalletAddress();
|
|
108
|
-
* console.log(`Wallet: ${address}`);
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
getWalletAddress(): string;
|
|
112
|
-
/**
|
|
113
|
-
* Get ERC-20 token balance for an Ethereum address.
|
|
114
|
-
*
|
|
115
|
-
* @param tokenSymbol - Token symbol (e.g., 'GALA', 'GWETH', 'GUSDC')
|
|
116
|
-
* @param address - Optional Ethereum address (defaults to configured wallet)
|
|
117
|
-
* @returns Token balance as decimal string (e.g., "123.45678901")
|
|
118
|
-
* @throws Error if token not supported or address invalid
|
|
119
|
-
*
|
|
120
|
-
* @example
|
|
121
|
-
* ```typescript
|
|
122
|
-
* const balance = await strategy.getEthereumTokenBalance('GALA');
|
|
123
|
-
* console.log(`Balance: ${balance} GALA`);
|
|
124
|
-
*
|
|
125
|
-
* // Check another address
|
|
126
|
-
* const otherBalance = await strategy.getEthereumTokenBalance('GUSDC', '0x1234...');
|
|
127
|
-
* ```
|
|
128
|
-
*/
|
|
129
|
-
getEthereumTokenBalance(tokenSymbol: string, address?: string): Promise<string>;
|
|
130
|
-
/**
|
|
131
|
-
* Get native ETH balance for an Ethereum address.
|
|
132
|
-
*
|
|
133
|
-
* @param address - Optional Ethereum address (defaults to configured wallet)
|
|
134
|
-
* @returns ETH balance as decimal string (18 decimals)
|
|
135
|
-
* @throws Error if address invalid
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* ```typescript
|
|
139
|
-
* const ethBalance = await strategy.getEthereumNativeBalance();
|
|
140
|
-
* console.log(`ETH Balance: ${ethBalance} ETH`);
|
|
141
|
-
* ```
|
|
142
|
-
*/
|
|
143
|
-
getEthereumNativeBalance(address?: string): Promise<string>;
|
|
144
|
-
/**
|
|
145
|
-
* Get the status of an Ethereum transaction by hash.
|
|
146
|
-
*
|
|
147
|
-
* Queries Ethereum RPC directly using `getTransactionReceipt()` and `getTransaction()`.
|
|
148
|
-
* Use this to verify if a bridge or any Ethereum transaction succeeded after submission.
|
|
149
|
-
*
|
|
150
|
-
* @param transactionHash - Ethereum transaction hash (0x-prefixed, 64 hex characters)
|
|
151
|
-
* @returns Transaction status with confirmation details
|
|
152
|
-
* @throws Error if hash format is invalid
|
|
153
|
-
*
|
|
154
|
-
* @example
|
|
155
|
-
* ```typescript
|
|
156
|
-
* const status = await strategy.getEthereumTransactionStatus('0x1234...');
|
|
157
|
-
* console.log(`Status: ${status.status}`);
|
|
158
|
-
* console.log(`Confirmations: ${status.confirmations}`);
|
|
159
|
-
* if (status.status === 'finalized') {
|
|
160
|
-
* console.log('Transaction is final (12+ confirmations)');
|
|
161
|
-
* }
|
|
162
|
-
* ```
|
|
163
|
-
*/
|
|
164
|
-
getEthereumTransactionStatus(transactionHash: string): Promise<EthereumTransactionStatus>;
|
|
165
|
-
/**
|
|
166
|
-
* Execute bridge deposit on Ethereum.
|
|
167
|
-
*/
|
|
168
|
-
private executeBridgeDeposit;
|
|
169
|
-
/**
|
|
170
|
-
* Bridge using ERC-20 Permit for gas-less approval.
|
|
171
|
-
*/
|
|
172
|
-
private bridgeWithPermit;
|
|
173
|
-
/**
|
|
174
|
-
* Bridge using traditional ERC-20 approval.
|
|
175
|
-
*/
|
|
176
|
-
private bridgeWithApproval;
|
|
177
|
-
}
|
|
178
|
-
//# sourceMappingURL=EthereumBridgeStrategy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"EthereumBridgeStrategy.d.ts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;OAKG;gBACS,MAAM,EAAE,oBAAoB;IA2BxC;;;;;;OAMG;IACG,WAAW,CACf,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC;IAI7B;;;;;OAKG;IACG,SAAS,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAWpE;;;;;OAKG;IACG,QAAQ,CAAC,MAAM,EAAE,cAAc,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAkFlE;;;;;OAKG;IACH,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAQxC;;;;;;;;;;OAUG;IACH,gBAAgB,IAAI,MAAM;IAQ1B;;;;;;;;;;;;;;;;OAgBG;IACG,uBAAuB,CAC3B,WAAW,EAAE,MAAM,EACnB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,MAAM,CAAC;IA6BlB;;;;;;;;;;;;OAYG;IACG,wBAAwB,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAkBjE;;;;;;;;;;;;;;;;;;;OAmBG;IACG,4BAA4B,CAChC,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,yBAAyB,CAAC;IAmFrC;;OAEG;YACW,oBAAoB;IAyElC;;OAEG;YACW,gBAAgB;IA6D9B;;OAEG;YACW,kBAAkB;CAkCjC"}
|
|
@@ -1,236 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Solana Bridge Strategy
|
|
3
|
-
*
|
|
4
|
-
* Implements bridging between GalaChain and Solana networks.
|
|
5
|
-
* Handles SPL token accounts, PDA derivation, and Solana program interactions.
|
|
6
|
-
*/
|
|
7
|
-
import type { GalaConnectClient } from '../GalaConnectClient.js';
|
|
8
|
-
import type { BridgeFeeEstimate, BridgeInParams, BridgeOutParams, BridgeTransaction, ExternalNetwork, SolanaTokenConfig, SolanaTransactionStatus } from '../types/index.js';
|
|
9
|
-
import { ConfiguredBridgeStrategy } from './BridgeStrategy.js';
|
|
10
|
-
/**
|
|
11
|
-
* Configuration for Solana bridge strategy.
|
|
12
|
-
*/
|
|
13
|
-
export interface SolanaBridgeConfig {
|
|
14
|
-
/** GalaConnect API client */
|
|
15
|
-
galaConnectClient: GalaConnectClient;
|
|
16
|
-
/** GalaChain wallet address (eth|0x...) */
|
|
17
|
-
galaChainWalletAddress: string;
|
|
18
|
-
/** Ethereum private key for EIP-712 signing (GalaChain uses Ethereum signatures) */
|
|
19
|
-
ethereumPrivateKey: string;
|
|
20
|
-
/** Solana private key in base58 format */
|
|
21
|
-
solanaPrivateKeyBase58: string;
|
|
22
|
-
/** Solana RPC URL */
|
|
23
|
-
solanaRpcUrl?: string;
|
|
24
|
-
/** Solana bridge program ID */
|
|
25
|
-
solanaBridgeProgram?: string;
|
|
26
|
-
/** Token configurations */
|
|
27
|
-
tokenConfigs?: SolanaTokenConfig[];
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Bridge strategy for GalaChain ↔ Solana transfers.
|
|
31
|
-
*
|
|
32
|
-
* Supports 2 tokens: GALA, GSOL
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* ```typescript
|
|
36
|
-
* const strategy = new SolanaBridgeStrategy({
|
|
37
|
-
* galaConnectClient,
|
|
38
|
-
* galaChainWalletAddress: 'eth|0x1234...',
|
|
39
|
-
* ethereumPrivateKey: '0xabcd...',
|
|
40
|
-
* solanaPrivateKeyBase58: 'base58EncodedKey...',
|
|
41
|
-
* });
|
|
42
|
-
*
|
|
43
|
-
* // Bridge out (GalaChain → Solana)
|
|
44
|
-
* const tx = await strategy.bridgeOut({
|
|
45
|
-
* tokenSymbol: 'GALA',
|
|
46
|
-
* amount: '100',
|
|
47
|
-
* destinationChain: 'Solana',
|
|
48
|
-
* recipientAddress: 'SolanaAddress...',
|
|
49
|
-
* });
|
|
50
|
-
* ```
|
|
51
|
-
*/
|
|
52
|
-
export declare class SolanaBridgeStrategy extends ConfiguredBridgeStrategy<SolanaTokenConfig> {
|
|
53
|
-
readonly network: ExternalNetwork;
|
|
54
|
-
private readonly galaChainWalletAddress;
|
|
55
|
-
private readonly ethereumWallet;
|
|
56
|
-
private readonly solanaConnection;
|
|
57
|
-
private readonly solanaKeypair;
|
|
58
|
-
private readonly solanaBridgeProgramId;
|
|
59
|
-
private readonly solanaBridgeTokenAuthority;
|
|
60
|
-
private readonly solanaBridgeConfigPda;
|
|
61
|
-
private readonly solanaNativeBridgePda;
|
|
62
|
-
private readonly solanaBridgeAccountCache;
|
|
63
|
-
private readonly tokenMetadataResolver;
|
|
64
|
-
/**
|
|
65
|
-
* Creates a new Solana bridge strategy.
|
|
66
|
-
*
|
|
67
|
-
* @param config - Strategy configuration
|
|
68
|
-
* @throws Error if ethereumPrivateKey or solanaPrivateKeyBase58 is invalid format
|
|
69
|
-
*/
|
|
70
|
-
constructor(config: SolanaBridgeConfig);
|
|
71
|
-
/**
|
|
72
|
-
* Estimate bridge fees for a transfer to Solana.
|
|
73
|
-
*
|
|
74
|
-
* @param tokenSymbol - Token symbol (e.g., 'GALA', 'GSOL')
|
|
75
|
-
* @param amount - Amount in decimal format
|
|
76
|
-
* @returns Fee estimate with breakdown
|
|
77
|
-
*/
|
|
78
|
-
estimateFee(tokenSymbol: string, amount: string): Promise<BridgeFeeEstimate>;
|
|
79
|
-
/**
|
|
80
|
-
* Bridge tokens from GalaChain to Solana.
|
|
81
|
-
*
|
|
82
|
-
* @param params - Bridge out parameters
|
|
83
|
-
* @returns Transaction details
|
|
84
|
-
*/
|
|
85
|
-
bridgeOut(params: BridgeOutParams): Promise<BridgeTransaction>;
|
|
86
|
-
/**
|
|
87
|
-
* Bridge tokens from Solana to GalaChain.
|
|
88
|
-
*
|
|
89
|
-
* @param params - Bridge in parameters
|
|
90
|
-
* @returns Transaction details
|
|
91
|
-
*/
|
|
92
|
-
bridgeIn(params: BridgeInParams): Promise<BridgeTransaction>;
|
|
93
|
-
/**
|
|
94
|
-
* Validate a Solana address.
|
|
95
|
-
*
|
|
96
|
-
* @param address - Address to validate
|
|
97
|
-
* @returns True if valid Solana address
|
|
98
|
-
*/
|
|
99
|
-
isValidAddress(address: string): boolean;
|
|
100
|
-
/**
|
|
101
|
-
* Get the configured Solana wallet address.
|
|
102
|
-
*
|
|
103
|
-
* @returns Solana wallet address (base58 format)
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* ```typescript
|
|
107
|
-
* const address = strategy.getWalletAddress();
|
|
108
|
-
* console.log(`Wallet: ${address}`);
|
|
109
|
-
* ```
|
|
110
|
-
*/
|
|
111
|
-
getWalletAddress(): string;
|
|
112
|
-
/**
|
|
113
|
-
* Get SPL token balance for a Solana address.
|
|
114
|
-
*
|
|
115
|
-
* @param tokenSymbol - Token symbol ('GALA' or 'GSOL')
|
|
116
|
-
* @param address - Optional Solana address (defaults to configured wallet)
|
|
117
|
-
* @returns Token balance as decimal string (returns "0" for zero balance)
|
|
118
|
-
* @throws Error if token not supported or address invalid
|
|
119
|
-
*
|
|
120
|
-
* @remarks
|
|
121
|
-
* If the token account does not exist, this method returns "0" rather than
|
|
122
|
-
* throwing an error, as non-existent accounts are equivalent to zero balance.
|
|
123
|
-
*
|
|
124
|
-
* @example
|
|
125
|
-
* ```typescript
|
|
126
|
-
* const balance = await strategy.getSolanaTokenBalance('GALA');
|
|
127
|
-
* console.log(`Balance: ${balance} GALA`);
|
|
128
|
-
*
|
|
129
|
-
* // Check another address
|
|
130
|
-
* const otherBalance = await strategy.getSolanaTokenBalance('GALA', 'SolanaAddress...');
|
|
131
|
-
* ```
|
|
132
|
-
*/
|
|
133
|
-
getSolanaTokenBalance(tokenSymbol: string, address?: string): Promise<string>;
|
|
134
|
-
/**
|
|
135
|
-
* Get native SOL balance for a Solana address.
|
|
136
|
-
*
|
|
137
|
-
* @param address - Optional Solana address (defaults to configured wallet)
|
|
138
|
-
* @returns SOL balance as decimal string (9 decimals)
|
|
139
|
-
* @throws Error if address invalid
|
|
140
|
-
*
|
|
141
|
-
* @example
|
|
142
|
-
* ```typescript
|
|
143
|
-
* const solBalance = await strategy.getSolanaNativeBalance();
|
|
144
|
-
* console.log(`SOL Balance: ${solBalance} SOL`);
|
|
145
|
-
* ```
|
|
146
|
-
*/
|
|
147
|
-
getSolanaNativeBalance(address?: string): Promise<string>;
|
|
148
|
-
/**
|
|
149
|
-
* Request SOL airdrop from Solana devnet faucet.
|
|
150
|
-
*
|
|
151
|
-
* Only works on Solana devnet (STAGE environment). Will throw an error
|
|
152
|
-
* if called when connected to mainnet.
|
|
153
|
-
*
|
|
154
|
-
* @param amount - Amount of SOL to request (default: 1, max: 2 per request)
|
|
155
|
-
* @param address - Optional recipient address (defaults to configured wallet)
|
|
156
|
-
* @returns Transaction signature
|
|
157
|
-
* @throws Error if not on devnet or airdrop fails
|
|
158
|
-
*
|
|
159
|
-
* @example
|
|
160
|
-
* ```typescript
|
|
161
|
-
* // Airdrop 1 SOL to configured wallet
|
|
162
|
-
* const signature = await strategy.requestDevnetAirdrop();
|
|
163
|
-
*
|
|
164
|
-
* // Airdrop 0.5 SOL to specific address
|
|
165
|
-
* const signature = await strategy.requestDevnetAirdrop(0.5, 'SomeAddress...');
|
|
166
|
-
* ```
|
|
167
|
-
*/
|
|
168
|
-
requestDevnetAirdrop(amount?: number, address?: string): Promise<string>;
|
|
169
|
-
/**
|
|
170
|
-
* Get the status of a Solana transaction by signature.
|
|
171
|
-
*
|
|
172
|
-
* This method queries the Solana RPC directly using getSignatureStatuses,
|
|
173
|
-
* which doesn't require WebSockets and works in Node.js environments.
|
|
174
|
-
*
|
|
175
|
-
* @param signature - Base58-encoded Solana transaction signature (87-88 characters)
|
|
176
|
-
* @returns Transaction status with:
|
|
177
|
-
* - confirmed: Whether transaction has been processed on-chain
|
|
178
|
-
* - status: Confirmation level ('confirmed' | 'finalized' | 'processed' | 'not_found' | 'failed')
|
|
179
|
-
* - slot: Block slot number (present when transaction is found)
|
|
180
|
-
* - error: Error details if transaction failed
|
|
181
|
-
*
|
|
182
|
-
* @throws Error if signature format is invalid
|
|
183
|
-
*
|
|
184
|
-
* @example Basic usage
|
|
185
|
-
* ```typescript
|
|
186
|
-
* const signature = await strategy.requestDevnetAirdrop(1);
|
|
187
|
-
* // Wait a moment for transaction to propagate
|
|
188
|
-
* await new Promise(r => setTimeout(r, 2000));
|
|
189
|
-
* const status = await strategy.getSolanaTransactionStatus(signature);
|
|
190
|
-
* console.log(status);
|
|
191
|
-
* // { confirmed: true, status: 'confirmed', slot: 123456789 }
|
|
192
|
-
* ```
|
|
193
|
-
*
|
|
194
|
-
* @example Polling pattern for confirmation
|
|
195
|
-
* ```typescript
|
|
196
|
-
* async function waitForConfirmation(signature: string, maxAttempts = 30) {
|
|
197
|
-
* for (let i = 0; i < maxAttempts; i++) {
|
|
198
|
-
* const status = await strategy.getSolanaTransactionStatus(signature);
|
|
199
|
-
* if (status.confirmed) return status;
|
|
200
|
-
* if (status.status === 'failed') throw new Error(status.error);
|
|
201
|
-
* await new Promise(r => setTimeout(r, 2000));
|
|
202
|
-
* }
|
|
203
|
-
* throw new Error('Transaction confirmation timeout');
|
|
204
|
-
* }
|
|
205
|
-
* ```
|
|
206
|
-
*/
|
|
207
|
-
getSolanaTransactionStatus(signature: string): Promise<SolanaTransactionStatus>;
|
|
208
|
-
/**
|
|
209
|
-
* Execute Solana bridge out transaction.
|
|
210
|
-
*/
|
|
211
|
-
private executeSolanaBridgeOut;
|
|
212
|
-
/**
|
|
213
|
-
* Send and confirm a Solana transaction with WebSocket primary, polling fallback.
|
|
214
|
-
* Tries WebSocket-based confirmation first (preferred for real-time feedback),
|
|
215
|
-
* falls back to polling if WebSocket fails with block height exceeded.
|
|
216
|
-
*
|
|
217
|
-
* @param transaction - The transaction to send (without blockhash/signature)
|
|
218
|
-
* @param keypair - The keypair to sign with
|
|
219
|
-
* @param maxRetries - Maximum number of retry attempts (default: 3)
|
|
220
|
-
* @returns The transaction signature
|
|
221
|
-
*/
|
|
222
|
-
private sendAndConfirmWithFallback;
|
|
223
|
-
/**
|
|
224
|
-
* Build instruction for native SOL bridging.
|
|
225
|
-
*/
|
|
226
|
-
private buildNativeBridgeInstruction;
|
|
227
|
-
/**
|
|
228
|
-
* Build instruction for SPL token bridging.
|
|
229
|
-
*/
|
|
230
|
-
private buildTokenBridgeInstruction;
|
|
231
|
-
/**
|
|
232
|
-
* Get cached Solana bridge accounts for a mint.
|
|
233
|
-
*/
|
|
234
|
-
private getSolanaBridgeAccounts;
|
|
235
|
-
}
|
|
236
|
-
//# sourceMappingURL=SolanaBridgeStrategy.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SolanaBridgeStrategy.d.ts","sourceRoot":"","sources":["../../../src/bridge/strategies/SolanaBridgeStrategy.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgCH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,eAAe,EAEf,iBAAiB,EACjB,eAAe,EACf,iBAAiB,EACjB,uBAAuB,EACxB,MAAM,mBAAmB,CAAC;AAiB3B,OAAO,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AAE/D;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,6BAA6B;IAC7B,iBAAiB,EAAE,iBAAiB,CAAC;IACrC,2CAA2C;IAC3C,sBAAsB,EAAE,MAAM,CAAC;IAC/B,oFAAoF;IACpF,kBAAkB,EAAE,MAAM,CAAC;IAC3B,0CAA0C;IAC1C,sBAAsB,EAAE,MAAM,CAAC;IAC/B,qBAAqB;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+BAA+B;IAC/B,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,2BAA2B;IAC3B,YAAY,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACpC;AAmED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,oBAAqB,S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