@gala-chain/launchpad-sdk 8.1.0 → 9.0.0-rc.0
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 +362 -0
- package/EXAMPLES.md +95 -681
- package/MIGRATING-TO-9.0.md +301 -0
- package/README.md +46 -17
- package/dist/LaunchpadSDK.d.ts +138 -413
- package/dist/LaunchpadSDK.d.ts.map +1 -1
- package/dist/api/LaunchpadAPI.d.ts +5 -37
- package/dist/api/LaunchpadAPI.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/types.d.ts +1 -1
- 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 +0 -7
- package/dist/constants/endpoints.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/helpers/sdk.d.ts.map +1 -1
- package/dist/index.browser.d.ts +8 -22
- 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 +1 -9
- package/dist/launchpad/bundle-submission.d.ts.map +1 -1
- package/dist/launchpad/transport.d.ts +2 -1
- package/dist/launchpad/transport.d.ts.map +1 -1
- package/dist/native.cjs +1 -1
- package/dist/native.d.ts +3 -4
- package/dist/native.d.ts.map +1 -1
- package/dist/native.esm.js +1 -1
- package/dist/schemas/user.d.ts +0 -15
- package/dist/schemas/user.d.ts.map +1 -1
- package/dist/services/AbstractCacheService.d.ts +2 -2
- 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/LaunchpadPriceService.d.ts +66 -0
- package/dist/services/LaunchpadPriceService.d.ts.map +1 -0
- package/dist/services/NftCollectionService.d.ts +22 -6
- package/dist/services/NftCollectionService.d.ts.map +1 -1
- package/dist/services/TokenResolverService.d.ts +5 -5
- package/dist/services/TokenResolverService.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/signing/index.d.ts +2 -3
- package/dist/signing/index.d.ts.map +1 -1
- package/dist/signing/signers.d.ts +7 -8
- 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/burn.dto.d.ts +4 -2
- package/dist/types/burn.dto.d.ts.map +1 -1
- package/dist/types/common.d.ts +2 -23
- package/dist/types/common.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/launchpad.dto.d.ts +0 -257
- 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/options.dto.d.ts +8 -34
- package/dist/types/options.dto.d.ts.map +1 -1
- package/dist/types/user.dto.d.ts +7 -62
- package/dist/types/user.dto.d.ts.map +1 -1
- package/dist/utils/address-formatter.d.ts +10 -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 +6 -239
- 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-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 +0 -308
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/http.d.ts +15 -3
- package/dist/utils/http.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 +3 -5
- package/dist/utils/validation-helpers.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/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/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/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
|
@@ -4,8 +4,12 @@
|
|
|
4
4
|
* Service responsible for token transfer and burn operations on GalaChain.
|
|
5
5
|
* Extracted from GalaChainService for single responsibility.
|
|
6
6
|
*
|
|
7
|
+
* The writes themselves are `@gala-chain/gala-core-sdk`'s `GatewayWrites` (DTO, signature, the
|
|
8
|
+
* POST and the reading of GalaChain's answer); this service keeps the launchpad API on top of it:
|
|
9
|
+
* its input checks, launchpad token-name resolution, its result shapes and its error classes.
|
|
10
|
+
*
|
|
7
11
|
* Features:
|
|
8
|
-
* - GALA transfers
|
|
12
|
+
* - GALA transfers
|
|
9
13
|
* - Generic token transfers (launchpad and standard tokens)
|
|
10
14
|
* - Token burning (irreversible)
|
|
11
15
|
* - Token class key resolution
|
|
@@ -36,43 +40,28 @@
|
|
|
36
40
|
* @category Services
|
|
37
41
|
* @since 5.15.0
|
|
38
42
|
*/
|
|
39
|
-
import type
|
|
43
|
+
import { type GalaChainTokenClassKey } from '@gala-chain/gala-core-sdk';
|
|
40
44
|
import type { BurnTokensData, BurnTokensResult } from '../types/burn.dto';
|
|
41
|
-
import type { TokenClassKey } from '../types/common';
|
|
42
45
|
import type { GalaChainTransferReceipt, TransferGalaData, TransferTokenData } from '../types/transfer.dto';
|
|
43
|
-
import
|
|
44
|
-
import { BaseService } from './BaseService';
|
|
45
|
-
import type { TokenResolverService } from './TokenResolverService';
|
|
46
|
+
import { GatewayWriteService } from './gateway-writes';
|
|
46
47
|
/**
|
|
47
48
|
* GalaChain Transfer Service
|
|
48
49
|
*
|
|
49
50
|
* Handles all token transfer and burn operations on GalaChain.
|
|
50
51
|
*/
|
|
51
|
-
export declare class GalaChainTransferService extends
|
|
52
|
-
private readonly wallet;
|
|
53
|
-
private readonly tokenResolver;
|
|
54
|
-
private readonly nativeSigner;
|
|
55
|
-
/**
|
|
56
|
-
* Initialize GalaChain Transfer Service
|
|
57
|
-
*
|
|
58
|
-
* @param http - HTTP client configured for GalaChain gateway
|
|
59
|
-
* @param wallet - Ethers wallet for signing transactions (optional for read-only operations)
|
|
60
|
-
* @param tokenResolver - Token resolver service for vault address resolution
|
|
61
|
-
* @param debug - Enable debug logging (default: false)
|
|
62
|
-
*/
|
|
63
|
-
constructor(http: HttpClient, wallet: Wallet | undefined, tokenResolver: TokenResolverService, debug?: boolean);
|
|
52
|
+
export declare class GalaChainTransferService extends GatewayWriteService {
|
|
64
53
|
/**
|
|
65
54
|
* Transfer GALA tokens between wallets
|
|
66
55
|
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
56
|
+
* Signs a TransferToken write for GALA with the wallet's key (native GalaChain signing) and
|
|
57
|
+
* submits it to the GalaChain gateway.
|
|
69
58
|
*
|
|
70
59
|
* @param data - Transfer data including recipient and amount
|
|
71
|
-
* @returns
|
|
60
|
+
* @returns The receipt: the chain transaction id and, when the gateway sends it, the block
|
|
72
61
|
*
|
|
73
62
|
* @example
|
|
74
63
|
* ```typescript
|
|
75
|
-
* const transactionId = await transferService.transferGala({
|
|
64
|
+
* const { transactionId } = await transferService.transferGala({
|
|
76
65
|
* recipientAddress: 'eth|1234567890abcdef1234567890abcdef12345678',
|
|
77
66
|
* amount: '1' // 1 GALA
|
|
78
67
|
* });
|
|
@@ -86,15 +75,15 @@ export declare class GalaChainTransferService extends BaseService {
|
|
|
86
75
|
/**
|
|
87
76
|
* Transfer launchpad tokens between wallets
|
|
88
77
|
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
78
|
+
* Signs a TransferToken write with the wallet's key (native GalaChain signing) and submits it
|
|
79
|
+
* to the GalaChain gateway.
|
|
91
80
|
*
|
|
92
81
|
* @param data - Transfer data including recipient, token name, and amount
|
|
93
|
-
* @returns
|
|
82
|
+
* @returns The receipt: the chain transaction id and, when the gateway sends it, the block
|
|
94
83
|
*
|
|
95
84
|
* @example
|
|
96
85
|
* ```typescript
|
|
97
|
-
* const transactionId = await transferService.transferToken({
|
|
86
|
+
* const { transactionId } = await transferService.transferToken({
|
|
98
87
|
* to: 'eth|9876543210fedcba9876543210fedcba98765432',
|
|
99
88
|
* tokenName: 'tinyevil',
|
|
100
89
|
* amount: '100000000'
|
|
@@ -130,7 +119,7 @@ export declare class GalaChainTransferService extends BaseService {
|
|
|
130
119
|
*
|
|
131
120
|
* @throws {TransferError} When token name cannot be resolved
|
|
132
121
|
*/
|
|
133
|
-
resolveTokenClassKey(tokenName: string): Promise<
|
|
122
|
+
resolveTokenClassKey(tokenName: string): Promise<GalaChainTokenClassKey>;
|
|
134
123
|
/**
|
|
135
124
|
* Permanently burn tokens on GalaChain
|
|
136
125
|
*
|
|
@@ -141,7 +130,7 @@ export declare class GalaChainTransferService extends BaseService {
|
|
|
141
130
|
* Supports batch burning of multiple token types in a single transaction.
|
|
142
131
|
*
|
|
143
132
|
* @param data - Burn data containing tokens array with amounts
|
|
144
|
-
* @returns Result with transaction ID and burned token details
|
|
133
|
+
* @returns Result with transaction ID, block (when the gateway sends it) and burned token details
|
|
145
134
|
* @throws {BurnError} When validation fails or burn operation is rejected
|
|
146
135
|
*
|
|
147
136
|
* @example
|
|
@@ -173,33 +162,45 @@ export declare class GalaChainTransferService extends BaseService {
|
|
|
173
162
|
* Validate burn tokens data
|
|
174
163
|
*/
|
|
175
164
|
private validateBurnTokensData;
|
|
165
|
+
/**
|
|
166
|
+
* The token instance a launchpad input names: `tokenId` (string, class key or instance key)
|
|
167
|
+
* first, else `tokenName` through the launchpad resolver, else `missing()`.
|
|
168
|
+
*/
|
|
169
|
+
private tokenInstanceOf;
|
|
176
170
|
/**
|
|
177
171
|
* Resolve token name to tokenInstance object for transfers
|
|
178
172
|
* Uses TokenResolverService to get vault address, then parses it to extract tokenInstance components
|
|
179
173
|
*/
|
|
180
174
|
private resolveTokenInstance;
|
|
181
175
|
/**
|
|
182
|
-
*
|
|
176
|
+
* The launchpad receipt of a transfer, from the gateway's answer (and core's receipt, when core
|
|
177
|
+
* accepted it). Called with no receipt when core refused the answer: it then throws the error
|
|
178
|
+
* this service has always thrown for that answer.
|
|
183
179
|
*
|
|
184
180
|
* If the body carries GalaChain's `{ Status, Data }` envelope, `Status` is checked FIRST and
|
|
185
|
-
* throws on anything but success (1) -- before
|
|
186
|
-
*
|
|
187
|
-
*
|
|
181
|
+
* throws on anything but success (1) -- before any transaction id is trusted. A gateway proxy can
|
|
182
|
+
* set `x-transaction-id` independent of whether the chain call actually succeeded, so it must
|
|
183
|
+
* never be treated as its own success signal. Checked on `Status` alone, NOT `Status` + `Data`:
|
|
184
|
+
* GalaChain's error envelope (`{ Status, Message, ErrorCode, ErrorKey, ErrorPayload }`) has no
|
|
185
|
+
* `Data`.
|
|
188
186
|
*
|
|
189
187
|
* Priority for transactionId once Status (if present) has passed:
|
|
190
|
-
* 1.
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
188
|
+
* 1. core's: the `x-transaction-id` header (the real chain hash -- use for Chainmeter), else a
|
|
189
|
+
* top-level `transactionId` of the body (legacy)
|
|
190
|
+
* 2. Body.Data[].transactionId / txnId / etc.
|
|
191
|
+
* 3. Operation success stub only if Status:1 with no hash (should be rare)
|
|
194
192
|
*
|
|
195
|
-
* blockNumber from
|
|
193
|
+
* blockNumber from the gateway's `x-block-number` header when present.
|
|
196
194
|
*
|
|
197
195
|
* @private
|
|
198
196
|
*/
|
|
199
197
|
private extractTransferResult;
|
|
200
|
-
/**
|
|
201
|
-
|
|
202
|
-
|
|
198
|
+
/**
|
|
199
|
+
* The launchpad result of a burn, from the gateway's answer (and core's receipt, when core
|
|
200
|
+
* accepted it). Called with no receipt when core refused the answer: it then throws the error
|
|
201
|
+
* this service has always thrown for that answer.
|
|
202
|
+
*/
|
|
203
|
+
private burnResultOf;
|
|
203
204
|
/**
|
|
204
205
|
* Extract burn result from GalaChain response
|
|
205
206
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalaChainTransferService.d.ts","sourceRoot":"","sources":["../../src/services/GalaChainTransferService.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"GalaChainTransferService.d.ts","sourceRoot":"","sources":["../../src/services/GalaChainTransferService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AAEH,OAAO,EAAkE,KAAK,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExI,OAAO,KAAK,EACV,cAAc,EACd,gBAAgB,EAGjB,MAAM,mBAAmB,CAAC;AAI3B,OAAO,KAAK,EACV,wBAAwB,EACxB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,uBAAuB,CAAC;AAsB/B,OAAO,EAEL,mBAAmB,EAIpB,MAAM,kBAAkB,CAAC;AA2B1B;;;;GAIG;AACH,qBAAa,wBAAyB,SAAQ,mBAAmB;IAO/D;;;;;;;;;;;;;;;;;;;;OAoBG;IACG,YAAY,CAAC,IAAI,EAAE,gBAAgB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAgC7E;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAqC/E;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACG,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,sBAAsB,CAAC;IA8B9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACG,UAAU,CAAC,IAAI,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAuCjE;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAuBhC;;OAEG;IACH,OAAO,CAAC,yBAAyB;IAkDjC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IA6C9B;;;OAGG;YACW,eAAe;IAmB7B;;;OAGG;YACW,oBAAoB;IAyBlC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,OAAO,CAAC,qBAAqB;IA8E7B;;;;OAIG;IACH,OAAO,CAAC,YAAY;IAqBpB;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAwCzB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IA2E3B;;OAEG;IACH,OAAO,CAAC,eAAe;CAyCxB"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Launchpad token USD spot price.
|
|
3
|
+
*
|
|
4
|
+
* The one price launchpad-sdk computes itself: a launchpad token's USD price, from the launchpad
|
|
5
|
+
* backend's bonding curve (tokens per 1 GALA) and GALA's USD price, or, once the token graduated,
|
|
6
|
+
* its USD price on the swap backend. The swap backend (dex-backend) `GET /market/price` read here is
|
|
7
|
+
* launchpad-backend-adjacent and deliberately thin: GALA's price and a graduated launchpad token's
|
|
8
|
+
* price, nothing else. Every other DEX price (any token by class key, GALA on its own, price series)
|
|
9
|
+
* is gswap-sdk's `gSwap.market` (`getPrice`, `getPrices`, `getPriceSeries`).
|
|
10
|
+
*/
|
|
11
|
+
import type { GalaChainTokenDetails } from '@gala-chain/gala-core-sdk';
|
|
12
|
+
import type { AmountCalculationResult, TokenSpotPrice } from '../types/launchpad.dto';
|
|
13
|
+
import type { CalculateBuyAmountOptions } from '../types/options.dto';
|
|
14
|
+
import type { HttpClient } from '../utils/http';
|
|
15
|
+
import { LoggerBase } from './BaseService';
|
|
16
|
+
import type { TokenMetadataCache } from './TokenMetadataCache';
|
|
17
|
+
/**
|
|
18
|
+
* Computes launchpad token USD spot prices (bonding curve, or the swap backend once graduated).
|
|
19
|
+
*
|
|
20
|
+
* @category Services
|
|
21
|
+
*/
|
|
22
|
+
export declare class LaunchpadPriceService extends LoggerBase {
|
|
23
|
+
private readonly dexBackendHttp?;
|
|
24
|
+
private readonly cache?;
|
|
25
|
+
private readonly fetchTokenDetails?;
|
|
26
|
+
/**
|
|
27
|
+
* @param dexBackendHttp The swap backend client (`GET /market/price`)
|
|
28
|
+
* @param cache Token symbols already known
|
|
29
|
+
* @param fetchTokenDetails Reads a token's GalaChain token class details (its symbol), at call time
|
|
30
|
+
* @param debugMode Debug logging
|
|
31
|
+
*/
|
|
32
|
+
constructor(dexBackendHttp?: HttpClient | undefined, cache?: TokenMetadataCache | undefined, fetchTokenDetails?: ((tokenId: string) => Promise<GalaChainTokenDetails>) | undefined, debugMode?: boolean);
|
|
33
|
+
/**
|
|
34
|
+
* A launchpad token's USD spot price.
|
|
35
|
+
*
|
|
36
|
+
* - Graduated (`isGraduated` from `fetchPoolDetails`): the token's price on the swap backend.
|
|
37
|
+
* - Otherwise (or when graduation cannot be read): `GALA USD price / tokens bought with 1 GALA`
|
|
38
|
+
* on the bonding curve.
|
|
39
|
+
*
|
|
40
|
+
* @param tokenName Launchpad token name (e.g. 'anime')
|
|
41
|
+
* @param calculateBuyAmount The bonding-curve buy calculation (tokens for 1 GALA)
|
|
42
|
+
* @param fetchPoolDetails Optional pool read used to detect graduation
|
|
43
|
+
* @returns The token's symbol and USD price
|
|
44
|
+
* @throws ValidationError if `tokenName` is empty
|
|
45
|
+
* @throws NetworkError if the calculation or a price read fails
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* const price = await service.fetchLaunchpadTokenSpotPrice('anime', calculateBuyAmount, fetchPoolDetails);
|
|
50
|
+
* console.log(`${price.symbol}: $${price.price}`);
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
fetchLaunchpadTokenSpotPrice(tokenName: string, calculateBuyAmount: (options: CalculateBuyAmountOptions) => Promise<AmountCalculationResult>, fetchPoolDetails?: (tokenName: string) => Promise<unknown>): Promise<TokenSpotPrice>;
|
|
54
|
+
/**
|
|
55
|
+
* The symbol of a token, from the token metadata cache or the GalaChain token class; never
|
|
56
|
+
* derived from the class key. GALA's is fixed.
|
|
57
|
+
*/
|
|
58
|
+
private resolveAuthoritativeSymbol;
|
|
59
|
+
/**
|
|
60
|
+
* A token's USD price on the swap backend (`GET /market/price?assetIds=<$ key>`), with its
|
|
61
|
+
* authoritative symbol. The backend answers each asset under its symbol and under the id asked
|
|
62
|
+
* for (recorded on prod and stage); one asset is asked for, so a sole entry is its entry.
|
|
63
|
+
*/
|
|
64
|
+
private fetchMarketUsdPrice;
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=LaunchpadPriceService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LaunchpadPriceService.d.ts","sourceRoot":"","sources":["../../src/services/LaunchpadPriceService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAA0B,qBAAqB,EAAE,MAAM,2BAA2B,CAAC;AAG/F,OAAO,KAAK,EAAE,uBAAuB,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACtF,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AAItE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAMhD,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAK/D;;;;GAIG;AACH,qBAAa,qBAAsB,SAAQ,UAAU;IAQjD,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAC;IAChC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC;IACvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC;IATrC;;;;;OAKG;gBAEgB,cAAc,CAAC,EAAE,UAAU,YAAA,EAC3B,KAAK,CAAC,EAAE,kBAAkB,YAAA,EAC1B,iBAAiB,CAAC,GAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,CAAC,aAAA,EACxF,SAAS,GAAE,OAAe;IAK5B;;;;;;;;;;;;;;;;;;;OAmBG;IACG,4BAA4B,CAChC,SAAS,EAAE,MAAM,EACjB,kBAAkB,EAAE,CAAC,OAAO,EAAE,yBAAyB,KAAK,OAAO,CAAC,uBAAuB,CAAC,EAC5F,gBAAgB,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,GACzD,OAAO,CAAC,cAAc,CAAC;IA2D1B;;;OAGG;YACW,0BAA0B;IA8BxC;;;;OAIG;YACW,mBAAmB;CA4ClC"}
|
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
* - Minting NFTs
|
|
8
8
|
* - Fetching NFT data and balances
|
|
9
9
|
*
|
|
10
|
+
* The reads (collection authorizations, a collection's token classes, an owner's NFT balances) are
|
|
11
|
+
* `@gala-chain/gala-core-sdk`'s `GatewayReads`, sent through the SDK's gateway `HttpClient`. The
|
|
12
|
+
* writes (claim, create class, mint) do not reach GalaChain yet: they build their DTO and return a
|
|
13
|
+
* locally made transaction id with status `pending`.
|
|
14
|
+
*
|
|
10
15
|
* @category Services
|
|
11
16
|
* @since 5.12.0
|
|
12
17
|
*/
|
|
@@ -73,14 +78,19 @@ export declare class NftCollectionService extends BaseService {
|
|
|
73
78
|
*/
|
|
74
79
|
claimCollection(params: ClaimCollectionParams): Promise<ClaimCollectionResult>;
|
|
75
80
|
/**
|
|
76
|
-
* Fetch all NFT collections authorized to a user
|
|
81
|
+
* Fetch all NFT collections authorized to a user: every collection authorization on GalaChain
|
|
82
|
+
* (`FetchNftCollectionAuthorizationsWithPagination`, page by page, bounded) whose authorized users
|
|
83
|
+
* include `walletAddress`.
|
|
77
84
|
*
|
|
78
|
-
* @param walletAddress - Wallet address to fetch collections for
|
|
85
|
+
* @param walletAddress - Wallet address to fetch collections for (`eth|<40 hex>`)
|
|
79
86
|
* @returns List of authorized collections
|
|
87
|
+
* @throws Error for an address that is not `eth|<40 hex>`; the read's errors otherwise
|
|
80
88
|
*/
|
|
81
89
|
fetchUserCollections(walletAddress: string): Promise<NftCollectionAuthorization[]>;
|
|
82
90
|
/**
|
|
83
|
-
* Check if an NFT collection name is available
|
|
91
|
+
* Check if an NFT collection name is available: no collection authorization on GalaChain names
|
|
92
|
+
* it. A read that fails (or a set of authorizations larger than the read's page bound) throws:
|
|
93
|
+
* it is never reported as "available".
|
|
84
94
|
*
|
|
85
95
|
* @param collectionName - Collection name to check
|
|
86
96
|
* @returns True if available, false if already claimed
|
|
@@ -95,7 +105,8 @@ export declare class NftCollectionService extends BaseService {
|
|
|
95
105
|
*/
|
|
96
106
|
createTokenClass(params: CreateTokenClassParams): Promise<CreateTokenClassResult>;
|
|
97
107
|
/**
|
|
98
|
-
* Fetch token classes
|
|
108
|
+
* Fetch the token classes of a collection (`FetchTokenClassesWithPagination`, page by page,
|
|
109
|
+
* bounded), optionally narrowed by type and category.
|
|
99
110
|
*
|
|
100
111
|
* @param params - Query parameters (collection, type, category)
|
|
101
112
|
* @returns List of token classes with supply info
|
|
@@ -110,12 +121,17 @@ export declare class NftCollectionService extends BaseService {
|
|
|
110
121
|
*/
|
|
111
122
|
mintNft(params: MintNftParams): Promise<MintNftResult>;
|
|
112
123
|
/**
|
|
113
|
-
* Fetch NFT balances for an owner
|
|
124
|
+
* Fetch NFT balances for an owner: the owner's GalaChain balance records (`FetchBalances`) that
|
|
125
|
+
* hold at least one token instance, optionally of one collection.
|
|
114
126
|
*
|
|
115
|
-
* @param ownerAddress - Owner wallet address
|
|
127
|
+
* @param ownerAddress - Owner wallet address (`eth|<40 hex>`)
|
|
116
128
|
* @param collectionFilter - Optional collection name to filter by
|
|
117
129
|
* @returns List of NFT balances
|
|
118
130
|
*/
|
|
119
131
|
fetchNftBalances(ownerAddress: string, collectionFilter?: string): Promise<NftBalance[]>;
|
|
132
|
+
/** Core gateway reads over this service's gateway client (one per read: nothing is shared). */
|
|
133
|
+
private reads;
|
|
134
|
+
/** Every collection authorization on GalaChain (bounded: more pages than allowed throws). */
|
|
135
|
+
private allAuthorizations;
|
|
120
136
|
}
|
|
121
137
|
//# sourceMappingURL=NftCollectionService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NftCollectionService.d.ts","sourceRoot":"","sources":["../../src/services/NftCollectionService.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"NftCollectionService.d.ts","sourceRoot":"","sources":["../../src/services/NftCollectionService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAQH,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,uBAAuB,EACvB,aAAa,EACb,aAAa,EACb,UAAU,EACV,0BAA0B,EAC1B,cAAc,EACd,uBAAuB,EACxB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAShD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAM5C;;;;;;;;;;;;;;;;;;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ala-core-sdk';
|
|
46
46
|
import { LoggerBase } from './BaseService';
|
|
47
47
|
import type { PoolService } from './PoolService';
|
|
48
48
|
/**
|
|
@@ -55,7 +55,7 @@ export interface TokenResolutionEntry {
|
|
|
55
55
|
/** GalaChain vault address (immutable after token creation) */
|
|
56
56
|
vaultAddress: string;
|
|
57
57
|
/** Parsed TokenClassKey from the vault address */
|
|
58
|
-
tokenClassKey:
|
|
58
|
+
tokenClassKey: GalaChainTokenClassKey;
|
|
59
59
|
/** Unix timestamp (ms) when this entry was cached */
|
|
60
60
|
cachedAt: number;
|
|
61
61
|
}
|
|
@@ -218,7 +218,7 @@ export declare class TokenResolverService extends LoggerBase {
|
|
|
218
218
|
* };
|
|
219
219
|
* ```
|
|
220
220
|
*/
|
|
221
|
-
resolveTokenClassKey(tokenName: string): Promise<
|
|
221
|
+
resolveTokenClassKey(tokenName: string): Promise<GalaChainTokenClassKey>;
|
|
222
222
|
/**
|
|
223
223
|
* Gets cached vault address for a token name
|
|
224
224
|
*
|
|
@@ -275,7 +275,7 @@ export declare class TokenResolverService extends LoggerBase {
|
|
|
275
275
|
* @param tokenName Token name to lookup (case-insensitive)
|
|
276
276
|
* @returns Cached TokenClassKey or null if not in cache
|
|
277
277
|
*/
|
|
278
|
-
getCachedTokenClassKey(tokenName: string):
|
|
278
|
+
getCachedTokenClassKey(tokenName: string): GalaChainTokenClassKey | null;
|
|
279
279
|
/**
|
|
280
280
|
* Pre-warms the cache with known tokenName → vaultAddress mappings
|
|
281
281
|
*
|
|
@@ -319,7 +319,7 @@ export declare class TokenResolverService extends LoggerBase {
|
|
|
319
319
|
preWarmWithTokenClassKey(mappings: Array<{
|
|
320
320
|
tokenName: string;
|
|
321
321
|
vaultAddress: string;
|
|
322
|
-
tokenClassKey:
|
|
322
|
+
tokenClassKey: GalaChainTokenClassKey;
|
|
323
323
|
}>): void;
|
|
324
324
|
/**
|
|
325
325
|
* Parses a vault address string to extract TokenClassKey components
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TokenResolverService.d.ts","sourceRoot":"","sources":["../../src/services/TokenResolverService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"TokenResolverService.d.ts","sourceRoot":"","sources":["../../src/services/TokenResolverService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAUxE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,+DAA+D;IAC/D,YAAY,EAAE,MAAM,CAAC;IACrB,kDAAkD;IAClD,aAAa,EAAE,sBAAsB,CAAC;IACtC,qDAAqD;IACrD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,2CAA2C;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,IAAI,EAAE,MAAM,EAAE,CAAC;IACf,6CAA6C;IAC7C,OAAO,EAAE,MAAM,CAAC;IAChB,2BAA2B;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,4CAA4C;IAC5C,OAAO,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,oDAAoD;IACpD,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,qBAAa,oBAAqB,SAAQ,UAAU;IAiCtC,OAAO,CAAC,QAAQ,CAAC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;;;;;;;;;;;;OAkBG;IACH,wBAAwB,CACtB,QAAQ,EAAE,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,YAAY,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,sBAAsB,CAAA;KAAE,CAAC,GAClG,IAAI;IAWP;;;;;;;OAOG;IACH,OAAO,CAAC,gCAAgC;CAkBzC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The launchpad side of the transport of `@gala-chain/gala-core-sdk`'s gateway reads and writes.
|
|
3
|
+
*
|
|
4
|
+
* Core is handed an `HttpRequestor` that sends its request through one of the SDK's own HTTP
|
|
5
|
+
* clients (the gateway `HttpClient` with its interceptors and `Sign` header, or the public gateway
|
|
6
|
+
* axios instance), so the requests launchpad makes are exactly the ones it made before the reads and
|
|
7
|
+
* writes moved to core: same client, same headers (core's own headers are not forwarded), same
|
|
8
|
+
* errors (a client rejection, an HTTP error or a network failure, reaches the caller unchanged:
|
|
9
|
+
* core passes an app requestor's rejection through). Paths are relative: the base URL is the
|
|
10
|
+
* client's. Core arms no timer (`requestTimeoutMs: Infinity`); the client owns request lifetimes.
|
|
11
|
+
*/
|
|
12
|
+
import type { HttpRequestor } from '@gala-chain/gala-core-sdk';
|
|
13
|
+
/** What one of the SDK's HTTP clients answered: the body and, when the client reports them, status and headers. */
|
|
14
|
+
export interface ClientAnswer {
|
|
15
|
+
readonly data: unknown;
|
|
16
|
+
readonly status?: number | undefined;
|
|
17
|
+
readonly headers?: Record<string, string | undefined> | undefined;
|
|
18
|
+
}
|
|
19
|
+
/** Sends a JSON POST through one of the SDK's HTTP clients. */
|
|
20
|
+
export type ClientPost = (url: string, body: unknown) => Promise<ClientAnswer>;
|
|
21
|
+
/** A core requestor over `post`, and the body of the last answer it read. */
|
|
22
|
+
export interface CapturingRequestor {
|
|
23
|
+
readonly requestor: HttpRequestor;
|
|
24
|
+
/** The body the client returned for the request (`undefined` until it answered). */
|
|
25
|
+
readonly answer: () => unknown;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* A core `HttpRequestor` over one of the SDK's HTTP clients, keeping the answer it read. Make one
|
|
29
|
+
* per operation, so the answer it keeps can never be another concurrent operation's.
|
|
30
|
+
*/
|
|
31
|
+
export declare function capturingRequestor(post: ClientPost): CapturingRequestor;
|
|
32
|
+
//# sourceMappingURL=gateway-transport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway-transport.d.ts","sourceRoot":"","sources":["../../src/services/gateway-transport.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,KAAK,EAAgB,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE7E,mHAAmH;AACnH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,SAAS,CAAC;CACnE;AAED,+DAA+D;AAC/D,MAAM,MAAM,UAAU,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,KAAK,OAAO,CAAC,YAAY,CAAC,CAAC;AAE/E,6EAA6E;AAC7E,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,SAAS,EAAE,aAAa,CAAC;IAClC,oFAAoF;IACpF,QAAQ,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,UAAU,GAAG,kBAAkB,CAmBvE"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The launchpad side of the gateway token writes. The writes themselves (building the DTO, signing
|
|
3
|
+
* it, posting it, reading GalaChain's answer) are `@gala-chain/gala-core-sdk`'s `GatewayWrites`;
|
|
4
|
+
* the launchpad services (`GalaChainTransferService`, `GalaChainLockService`) keep their own
|
|
5
|
+
* input checks, token-name resolution, result shapes and error classes on top of it.
|
|
6
|
+
*
|
|
7
|
+
* Every write still goes through the SDK's gateway `HttpClient` (axios, its interceptors and the
|
|
8
|
+
* `Sign` header), exactly as before the writes moved to core: core is handed an `HttpRequestor`
|
|
9
|
+
* that POSTs the signed body with `HttpClient.postWithMeta`, and keeps the answer `HttpClient`
|
|
10
|
+
* returned, so the services can report it the way they always have.
|
|
11
|
+
*/
|
|
12
|
+
import { GatewayWrites, type GalaChainSigner, type GatewayWriteReceipt, type TokenQuantityInput } from '@gala-chain/gala-core-sdk';
|
|
13
|
+
import type { Wallet } from 'ethers';
|
|
14
|
+
import { PrivateKeySigner } from '../signing';
|
|
15
|
+
import type { HttpClient } from '../utils/http';
|
|
16
|
+
import type { TokenInstanceShape } from '../utils/token-instance-resolver';
|
|
17
|
+
import { BaseService } from './BaseService';
|
|
18
|
+
import type { TokenResolverService } from './TokenResolverService';
|
|
19
|
+
/** The prefix of the `uniqueKey`s the launchpad writes mint (`galaconnect-operation-<uuid v4>`). */
|
|
20
|
+
export declare const LAUNCHPAD_UNIQUE_KEY_PREFIX = "galaconnect-operation-";
|
|
21
|
+
/**
|
|
22
|
+
* Who signs a write and who it is made as. For an SDK with a `wallet`: the wallet's key and its
|
|
23
|
+
* `eth|` identity. For an SDK configured with `{ signer, walletAddress }` and no wallet: that
|
|
24
|
+
* signer and the declared identity (an `eth|` account or a `client|` alias), as given.
|
|
25
|
+
*/
|
|
26
|
+
export interface GatewayWriter {
|
|
27
|
+
readonly signer: GalaChainSigner;
|
|
28
|
+
readonly walletAddress: string;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* The base of the launchpad write services (`GalaChainTransferService`, `GalaChainLockService`):
|
|
32
|
+
* their constructor and who their writes are signed by and made as.
|
|
33
|
+
*/
|
|
34
|
+
export declare abstract class GatewayWriteService extends BaseService {
|
|
35
|
+
protected readonly wallet: Wallet | undefined;
|
|
36
|
+
protected readonly tokenResolver: TokenResolverService;
|
|
37
|
+
private readonly writer?;
|
|
38
|
+
protected readonly nativeSigner: PrivateKeySigner | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* @param http - HTTP client configured for GalaChain gateway
|
|
41
|
+
* @param wallet - Ethers wallet for signing transactions (optional for read-only operations)
|
|
42
|
+
* @param tokenResolver - Token resolver service for vault address resolution
|
|
43
|
+
* @param debug - Enable debug logging (default: false)
|
|
44
|
+
* @param writer - For an SDK with no wallet: the signer and declared identity its writes use
|
|
45
|
+
*/
|
|
46
|
+
constructor(http: HttpClient, wallet: Wallet | undefined, tokenResolver: TokenResolverService, debug?: boolean, writer?: GatewayWriter | undefined);
|
|
47
|
+
/**
|
|
48
|
+
* Who signs this service's writes and who they are made as: the wallet's key and `eth|` identity,
|
|
49
|
+
* else (an SDK configured with `{ signer, walletAddress }`) that signer and declared identity.
|
|
50
|
+
*/
|
|
51
|
+
protected writeIdentity(): GatewayWriter | undefined;
|
|
52
|
+
}
|
|
53
|
+
/** A launchpad token instance as the core write input names it (class key + instance). */
|
|
54
|
+
export declare function coreTokenOf(key: TokenInstanceShape, quantity: string): TokenQuantityInput;
|
|
55
|
+
/** One write's core client and the raw answer its request got. */
|
|
56
|
+
export interface LaunchpadGatewayWrite {
|
|
57
|
+
readonly writes: GatewayWrites;
|
|
58
|
+
/** The body `HttpClient` returned for this write (`undefined` until it answered). */
|
|
59
|
+
readonly answer: () => unknown;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* A core `GatewayWrites` for ONE write, over `http` (the gateway `HttpClient`). One per write, so
|
|
63
|
+
* the answer it keeps can never be another concurrent write's. Paths are relative (the base URL
|
|
64
|
+
* is the `HttpClient`'s), core arms no timer (axios owns request lifetimes), and core's own
|
|
65
|
+
* request headers are not forwarded: `HttpClient` sets `Content-Type` and `Sign` as it always did.
|
|
66
|
+
*
|
|
67
|
+
* @param http - The gateway `HttpClient`.
|
|
68
|
+
* @param writer - The signer and the identity the write is made as.
|
|
69
|
+
*/
|
|
70
|
+
export declare function launchpadGatewayWrite(http: HttpClient, { signer, walletAddress }: GatewayWriter): LaunchpadGatewayWrite;
|
|
71
|
+
/** True for a core error about the gateway's ANSWER (core refused what GalaChain returned). */
|
|
72
|
+
export declare function isGatewayAnswerError(error: unknown): boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Runs a core write and hands its receipt and the raw answer to `read`, the service's own result
|
|
75
|
+
* mapping. When core refuses the ANSWER, `read` is given the same answer with no receipt and
|
|
76
|
+
* throws the service's own error for it; should it not, core's error stands (fail closed).
|
|
77
|
+
*/
|
|
78
|
+
export declare function readGatewayWrite<T>(write: LaunchpadGatewayWrite, run: (writes: GatewayWrites) => Promise<GatewayWriteReceipt>, read: (answer: unknown, receipt: GatewayWriteReceipt | undefined) => T): Promise<T>;
|
|
79
|
+
/** A caller's `uniqueKey`, or `undefined` for none: an empty key means "none" (a fresh one is minted). */
|
|
80
|
+
export declare function givenUniqueKey(uniqueKey: string | undefined): {
|
|
81
|
+
uniqueKey?: string;
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=gateway-writes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway-writes.d.ts","sourceRoot":"","sources":["../../src/services/gateway-writes.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EACL,aAAa,EAEb,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACxB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,WAAW,EAAE,M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,EAAE,OAAO,GAAG,OAAO,CAE5D;AAED;;;;GAIG;AACH,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,KAAK,EAAE,qBAAqB,EAC5B,GAAG,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,OAAO,CAAC,mBAAmB,CAAC,EAC5D,IAAI,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,mBAAmB,GAAG,SAAS,KAAK,CAAC,GACrE,OAAO,CAAC,CAAC,CAAC,CASZ;AAED,0GAA0G;AAC1G,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAEpF"}
|
package/dist/signing/index.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
export { generateEIP712Types } from '@gala-chain/gswap-sdk';
|
|
2
1
|
export { BrowserWalletSigner, GalaWalletSigner, PrivateKeySigner, } from './signers';
|
|
3
|
-
export type {
|
|
4
|
-
export type { BrowserWalletProvider
|
|
2
|
+
export type { LaunchpadSigner, SignedTypedDataBody, TypedDataSigner, } from './types';
|
|
3
|
+
export type { BrowserWalletProvider } from './signers';
|
|
5
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signing/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/signing/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,mBAAmB,EACnB,gBAAgB,EAChB,gBAAgB,GACjB,MAAM,WAAW,CAAC;AACnB,YAAY,EACV,eAAe,EACf,mBAAmB,EACnB,eAAe,GAChB,MAAM,SAAS,CAAC;AACjB,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BrowserWalletSigner as
|
|
2
|
-
import type { EIP712Domain,
|
|
1
|
+
import { BrowserWalletSigner as CoreBrowserWalletSigner, GalaWalletSigner as CoreGalaWalletSigner, PrivateKeySigner as CorePrivateKeySigner, type EIP712Types } from '@gala-chain/gala-core-sdk';
|
|
2
|
+
import type { EIP712Domain, LaunchpadSigner, SignedTypedDataBody } from './types';
|
|
3
3
|
interface GalaWalletProvider {
|
|
4
4
|
request(args: {
|
|
5
5
|
method: string;
|
|
@@ -19,7 +19,7 @@ interface BrowserWalletProvider extends GalaWalletProvider {
|
|
|
19
19
|
getSigner(): Promise<BrowserWalletEthersSigner>;
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
|
-
* A private-key signer that supports both native
|
|
22
|
+
* A private-key signer that supports both native GalaChain writes and launchpad
|
|
23
23
|
* bundler typed-data writes.
|
|
24
24
|
*
|
|
25
25
|
* @example
|
|
@@ -27,7 +27,7 @@ interface BrowserWalletProvider extends GalaWalletProvider {
|
|
|
27
27
|
* const body = await signer.signTypedData('BuyWithNative', { amount: '1' });
|
|
28
28
|
* console.log(body.signature);
|
|
29
29
|
*/
|
|
30
|
-
export declare class PrivateKeySigner extends
|
|
30
|
+
export declare class PrivateKeySigner extends CorePrivateKeySigner implements LaunchpadSigner {
|
|
31
31
|
private readonly typedDataWallet;
|
|
32
32
|
/** The GalaChain identity this key signs for (`eth|<checksummed address>`, no `0x`). */
|
|
33
33
|
readonly walletAddress: string;
|
|
@@ -49,7 +49,7 @@ export declare class PrivateKeySigner extends GSwapPrivateKeySigner implements L
|
|
|
49
49
|
* const body = await signer.signTypedData('BuyWithNative', { amount: '1' });
|
|
50
50
|
* console.log(body.signature);
|
|
51
51
|
*/
|
|
52
|
-
export declare class GalaWalletSigner extends
|
|
52
|
+
export declare class GalaWalletSigner extends CoreGalaWalletSigner implements LaunchpadSigner {
|
|
53
53
|
/**
|
|
54
54
|
* Sign a launchpad DTO through Gala Wallet.
|
|
55
55
|
*
|
|
@@ -74,14 +74,14 @@ export declare class GalaWalletSigner extends GSwapGalaWalletSigner implements L
|
|
|
74
74
|
* const body = await signer.signTypedData('BuyWithNative', { amount: '1' });
|
|
75
75
|
* console.log(body.signature);
|
|
76
76
|
*/
|
|
77
|
-
export declare class BrowserWalletSigner extends
|
|
77
|
+
export declare class BrowserWalletSigner extends CoreBrowserWalletSigner implements LaunchpadSigner {
|
|
78
78
|
private readonly typedDataProvider;
|
|
79
79
|
/**
|
|
80
80
|
* @param options - `{ scheme: 'eip712' }` selects `eth_signTypedData_v4` for the DEX methods
|
|
81
81
|
* that support it, which resolves a registered `client|` alias; the default personal-sign
|
|
82
82
|
* resolves the bare `eth|` identity.
|
|
83
83
|
*/
|
|
84
|
-
constructor(provider: BrowserWalletProvider, walletAddress: string, options?: ConstructorParameters<typeof
|
|
84
|
+
constructor(provider: BrowserWalletProvider, walletAddress: string, options?: ConstructorParameters<typeof CoreBrowserWalletSigner>[2]);
|
|
85
85
|
/**
|
|
86
86
|
* Sign typed data with the connected wallet's network domain.
|
|
87
87
|
*
|
|
@@ -91,6 +91,5 @@ export declare class BrowserWalletSigner extends GSwapBrowserWalletSigner implem
|
|
|
91
91
|
*/
|
|
92
92
|
signTypedData(method: string, rawDto: Record<string, unknown>): Promise<SignedTypedDataBody>;
|
|
93
93
|
}
|
|
94
|
-
export type { GalaChainSigner } from '@gala-chain/gswap-sdk';
|
|
95
94
|
export type { BrowserWalletProvider };
|
|
96
95
|
//# sourceMappingURL=signers.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signers.d.ts","sourceRoot":"","sources":["../../src/signing/signers.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,IAAI,
|
|
1
|
+
{"version":3,"file":"signers.d.ts","sourceRoot":"","sources":["../../src/signing/signers.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,IAAI,uBAAuB,EAC9C,gBAAgB,IAAI,oBAAoB,EACxC,gBAAgB,IAAI,oBAAoB,EAExC,KAAK,WAAW,EACjB,MAAM,2BAA2B,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AC9B,OAAO,CAAC,mBAAmB,CAAC;IAiB/B;;;;;OAKG;YACW,gBAAgB;CAU/B;AAED;;;;;;;GAOG;AACH,qBAAa,mBACX,SAAQ,uBACR,YAAW,eAAe;IAE1B,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAwB;IAE1D;;;;OAIG;gBAED,QAAQ,EAAE,qBAAqB,EAC/B,aAAa,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,qBAAqB,CAAC,OAAO,uBAAuB,CAAC,CAAC,CAAC,CAAC;IAMpE;;;;;;OAMG;IACU,aAAa,CACxB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC9B,OAAO,CAAC,mBAAmB,CAAC;CAqBhC;AAED,YAAY,EAAE,qBAAqB,EAAE,CAAC"}
|
package/dist/signing/types.d.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import type { GalaChainSigner } from '@gala-chain/
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/** EIP-712 type definitions keyed by their struct name. */
|
|
8
|
-
export type EIP712Types = Record<string, EIP712TypeField[]>;
|
|
9
|
-
/** EIP-712 domain values sent to a wallet. */
|
|
1
|
+
import type { EIP712Types, GalaChainSigner } from '@gala-chain/gala-core-sdk';
|
|
2
|
+
/**
|
|
3
|
+
* EIP-712 domain values sent to a wallet for a launchpad bundler write (`{ name: 'GalaChain' }`, or
|
|
4
|
+
* the wallet's network `{ name, chainId }`). The EIP-712 type map itself is gala-core-sdk's
|
|
5
|
+
* `EIP712Types` (from its `generateEIP712Types`).
|
|
6
|
+
*/
|
|
10
7
|
export type EIP712Domain = Record<string, unknown>;
|
|
11
8
|
/** DTO plus the signature and metadata required by the launchpad bundler. */
|
|
12
9
|
export type SignedTypedDataBody = Record<string, unknown> & {
|
|
@@ -25,7 +22,7 @@ export interface TypedDataSigner {
|
|
|
25
22
|
*/
|
|
26
23
|
signTypedData(method: string, dto: Record<string, unknown>): Promise<SignedTypedDataBody>;
|
|
27
24
|
}
|
|
28
|
-
/** A
|
|
25
|
+
/** A gala-core-sdk signer with the launchpad bundler typed-data capability. */
|
|
29
26
|
export interface LaunchpadSigner extends GalaChainSigner, TypedDataSigner {
|
|
30
27
|
}
|
|
31
28
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/signing/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/signing/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE9E;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAEnD,6EAA6E;AAC7E,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAC1D,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,WAAW,CAAC;IACnB,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC;AAEF,uEAAuE;AACvE,MAAM,WAAW,eAAe;IAC9B;;;;;;OAMG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAAC;CAC3F;AAED,+EAA+E;AAC/E,MAAM,WAAW,eAAgB,SAAQ,eAAe,EAAE,eAAe;CAAG"}
|