@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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,367 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 9.0.0-rc.0
|
|
4
|
+
|
|
5
|
+
launchpad-sdk is launchpad-only. Everything that speaks to the GalaChain gateway generically is
|
|
6
|
+
`@gala-chain/gala-core-sdk`'s (a peer dependency: install it beside launchpad-sdk); everything that
|
|
7
|
+
speaks to the swap backend (dex-backend) is `@gala-chain/gswap-sdk`'s, and launchpad-sdk no longer
|
|
8
|
+
depends on it in any way. **[MIGRATING-TO-9.0.md](./MIGRATING-TO-9.0.md)** lists every export and
|
|
9
|
+
`LaunchpadSDK` member 8.1.0 had that 9.0.0 does not, with its new home; it is generated from the
|
|
10
|
+
built declarations of both versions (`pnpm docs:migration`).
|
|
11
|
+
|
|
12
|
+
### BREAKING CHANGES (9.0 cut)
|
|
13
|
+
|
|
14
|
+
- **The `Sign` header goes to the launchpad backend only.** The clients for the GalaChain gateway,
|
|
15
|
+
dex-api (referrals, bridgeable and wrappable token lists), the swap backend (prices) and the
|
|
16
|
+
bundler no longer send it: none of those hosts reads it (the gateway's own signature is in each
|
|
17
|
+
write's body; dex-api reads `x-wallet-address`), and every header cost a wallet signature per
|
|
18
|
+
request, a prompt for browser wallets. The clients keep the wallet identity (`getAddress`,
|
|
19
|
+
`signTypedData`) services read from them. `HttpClient` takes `{ signRequests }` as its third
|
|
20
|
+
constructor argument (default true: the launchpad backend client). Gateway read goldens
|
|
21
|
+
(`gateway-reads`, `token-discovery`) lost exactly their recorded `Sign` header and nothing else;
|
|
22
|
+
`tests/http-client-sign-header.test.ts` pins both behaviours.
|
|
23
|
+
- **No DEX at all, not even as a devDependency.** The 46 DEX demos and their npm scripts (`demo:dex*`,
|
|
24
|
+
`demo:liquidity*`, `demo:fees*`, the pool watchers, `test:demos:dex`, `test:demos:fees`) moved to
|
|
25
|
+
`packages/gswap-sdk/examples/demos` (on gswap-sdk's own client, type-checked by its
|
|
26
|
+
`check:examples`), and the stage live test's DEX checks to gswap-sdk's live test.
|
|
27
|
+
`tests/product-boundary.test.ts` scans `src`, `tests`, `examples` and `scripts` with the TypeScript
|
|
28
|
+
scanner, refuses gswap-sdk in every dependency field and resolves it from the package with plain
|
|
29
|
+
Node (MODULE_NOT_FOUND); the CI dist check refuses it in every bundle.
|
|
30
|
+
- **Prices: launchpad tokens only.** Of the two swap-backend price readers launchpad-sdk had, only the
|
|
31
|
+
launchpad-token one stays: `fetchTokenPrice({ tokenName })` (the bonding-curve price, or the
|
|
32
|
+
token's swap-backend price once it graduated; GALA's USD price and a graduated token's price are
|
|
33
|
+
read with a thin `GET /market/price` documented as launchpad-backend-adjacent). REMOVED, as
|
|
34
|
+
generic swap-backend reads that gswap-sdk's `market` already makes:
|
|
35
|
+
`fetchTokenPrice({ tokenId })` (a `tokenId` is now refused with a `ValidationError` before
|
|
36
|
+
anything is sent) and its 400/404 "launchpad fallback" (the recorded golden vector shows it never
|
|
37
|
+
fired: the 404 was wrapped before the check), `fetchGalaPrice()`, `fetchPriceHistory()`,
|
|
38
|
+
`fetchAllPriceHistory()` and their types (`FetchPriceHistoryOptions`, `PriceHistoryResult`,
|
|
39
|
+
`PriceSnapshot`, `PriceSortOrder`). Use `gSwap.market.getPrice(tokenId)` and
|
|
40
|
+
`gSwap.market.getPriceSeries(await sdk.resolveTokenClassKey(name), timeframe)`.
|
|
41
|
+
Decision and evidence (callers grepped in mcp-server, the apps, examples and docs): the only
|
|
42
|
+
callers of the removed reads were the MCP price tools, the examples and the docs. The MCP tools
|
|
43
|
+
(`gala_launchpad_fetch_token_spot_price` with `tokenId`, `..._fetch_gala_spot_price`,
|
|
44
|
+
`..._fetch_price_history`, `..._fetch_all_price_history`) keep their names, inputs and outputs on
|
|
45
|
+
the MCP server's own GSwap client, and replay the 13 recorded 8.1 vectors of these reads (same
|
|
46
|
+
endpoint and query, same outputs). What differs on the wire: no launchpad `Sign` header on these
|
|
47
|
+
public reads, the `$` of a class key sent as `%24`, and a backend failure's inner text (gswap-sdk's).
|
|
48
|
+
- **Dependencies are the source's import graph** (`tests/dependency-graph.test.ts`): `@gala-chain/api`,
|
|
49
|
+
`axios`, `bignumber.js`, `ethers`, `socket.io-client`, `uuid`, `web-file-polyfill`; peers
|
|
50
|
+
`@gala-chain/gala-core-sdk` (`>=1.0.0-rc.3 <2`), `zod` (now `^4.3.6`: the peer said `^3` while the
|
|
51
|
+
schemas are zod 4, and it is no longer also a dependency) and the shared libraries. No longer
|
|
52
|
+
dependencies: `@solana/web3.js`, `@solana/spl-token`, `dotenv`, `@modelcontextprotocol/sdk` (and,
|
|
53
|
+
since the bridge move, `bs58` and `json-stringify-deterministic`).
|
|
54
|
+
- **The bridge loads Solana only when used.** The bridge, balance-on-chain, token-list and wrap methods
|
|
55
|
+
load `@gala-chain/gala-core-sdk/bridge` (the one core entry that loads `ethers`,
|
|
56
|
+
`@solana/web3.js` and `@solana/spl-token`, core's optional peers) with `import()` at their first
|
|
57
|
+
call: an app that never bridges never loads Solana and need not install it; an app that bridges
|
|
58
|
+
installs those peers (a missing one is a `ConfigurationError` naming them). The CommonJS bundles
|
|
59
|
+
`require` it and the UMD bundle requires it or takes the `GalaCoreSDKBridge` global, so there is
|
|
60
|
+
one core copy in every build. A bridge or wrap call made with one wallet is refused
|
|
61
|
+
(`ConfigurationError`, nothing sent) if `setWallet` / `setWalletProvider` runs while `/bridge`
|
|
62
|
+
loads, rather than running as the next wallet. `getSupportedBridgeTokens()` is `async`.
|
|
63
|
+
- **The public surface re-exports nothing** (`tests/public-surface.test.ts` pins both entries' export
|
|
64
|
+
lists and fails on any export declared outside `src/`). Removed from the main and `/native`
|
|
65
|
+
entries: `generateEIP712Types` and `GalaChainSigner` (core's), the duplicate EIP-712 types
|
|
66
|
+
`EIP712Types`, `EIP712TypeField`, `EIP712Domain` (core's `EIP712Types`, `EIP712DomainValue`),
|
|
67
|
+
`HttpRequestor` (the bundler transport takes core's `HttpRequestor` type), `GALA_TOKEN_CLASS_KEY`
|
|
68
|
+
(core's), `generateUniqueKey` (core's `createUniqueKey`), and the demo `.env` loaders `getEnv`,
|
|
69
|
+
`getEnvOrThrow`, `loadEnvWithFallback`.
|
|
70
|
+
|
|
71
|
+
### Fixes
|
|
72
|
+
|
|
73
|
+
- `graduateToken` bought `calculateBuyAmountForGraduation`'s `amount` (the GALA cost of the
|
|
74
|
+
remaining tokens) as the exact-buy token quantity. It buys `remainingTokens`, with the GALA cost
|
|
75
|
+
as `expectedAmount` (the slippage cap).
|
|
76
|
+
- `subscribeToTokenCreations`: an event field that is missing or not a string is its fallback
|
|
77
|
+
(`''`, `preBuyQuantity` `'0'`), never `undefined`; `isFinalized` is `true` only for `true`.
|
|
78
|
+
- Demo tooling: `demo:run` ran every selection interactively and counted failed demos as
|
|
79
|
+
successes (booleans tested with `!= null`); the registry maps each demo's SDK methods, leaves
|
|
80
|
+
the tooling out (130 demos) and `demo:run:method` / `demo:run:endpoint` exist. 131 more boolean
|
|
81
|
+
`!= null` tests in the demos and tests (write demos ran their transfer, wrap and unwrap whatever
|
|
82
|
+
their `EXECUTE_*` flag said) are plain boolean tests, and `tests/constant-boolean-null-check.test.ts`
|
|
83
|
+
refuses the shape.
|
|
84
|
+
|
|
85
|
+
### The `/bundle` signing schemes (unchanged bytes; for Andy)
|
|
86
|
+
|
|
87
|
+
Two schemes post to the bundler's `/bundle`, and both have callers, so both stay:
|
|
88
|
+
`sdk.launchpad.buyWithNative / buyExactToken / sellWithNative / sellExactToken / createSale`
|
|
89
|
+
(`BundlerTransport`) signs EIP-712 typed data (`signTypedData`, the GalaChain domain; pinned by
|
|
90
|
+
`tests/golden/bundler-typed-data.golden.json`): what the live launchpad frontend
|
|
91
|
+
(launchpad-frontend-v3, `signTypedData` / `eth_signTypedData`) and the MCP trading tools send.
|
|
92
|
+
`sdk.buy()` / `sdk.sell()` (`BundleService.buyToken / sellToken`) sign with the signer's
|
|
93
|
+
`signObject` (native for a private key, personal-sign for a browser wallet): the native app calls
|
|
94
|
+
these (`src/sdk/facades/trade.ts`), as do the examples. Retiring `BundleService`'s trade methods
|
|
95
|
+
needs the native app moved to `sdk.launchpad.*` first (which changes the bytes it sends).
|
|
96
|
+
|
|
97
|
+
### What moved to gala-core-sdk (the extraction steps, from the 8.1.0 baseline)
|
|
98
|
+
|
|
99
|
+
The gateway token writes (transfer GALA, transfer a token, burn, lock, unlock) moved to
|
|
100
|
+
`@gala-chain/gala-core-sdk` 1.0.0-rc.1 (`GatewayWrites`). `transferGala`, `transferToken`,
|
|
101
|
+
`burnTokens`, `lockTokens` and `unlockTokens` keep their names, signatures, input checks, result
|
|
102
|
+
shapes and error classes and delegate to it; their requests are byte-identical (golden vectors)
|
|
103
|
+
and still go through the SDK's gateway `HttpClient` (the `Sign` header included).
|
|
104
|
+
|
|
105
|
+
The gateway token READS moved to `@gala-chain/gala-core-sdk` 1.0.0-rc.2 (`GatewayReads`):
|
|
106
|
+
`fetchGalaBalance`, `fetchTokenBalance` (tokenId and MUSIC/GMUSIC routes), `fetchTokenDetails`,
|
|
107
|
+
`fetchTokenClassesWithSupply` and the NFT reads keep their names and signatures and delegate to it,
|
|
108
|
+
through the same clients as before (balances and NFT reads through the gateway `HttpClient` with
|
|
109
|
+
its `Sign` header, token classes through the unauthenticated gateway axios instance). The core peer
|
|
110
|
+
range is now `>=1.0.0-rc.3 <2`.
|
|
111
|
+
|
|
112
|
+
The wallet providers and the React hooks moved to `@gala-chain/gala-core-sdk` 1.0.0-rc.3
|
|
113
|
+
(`/providers`, `/react`). `LaunchpadSDKConfig.walletProvider`, `setWalletProvider` and
|
|
114
|
+
`SignatureAuth` take core's `WalletProvider`; a core `PrivateKeyProvider` still gives the SDK's
|
|
115
|
+
services their key.
|
|
116
|
+
|
|
117
|
+
The bridge moved to `@gala-chain/gala-core-sdk` 1.0.0-rc.3 (`/bridge`): `BridgeService`, the
|
|
118
|
+
Ethereum and Solana strategies, `GalaConnectClient`, the bridgeable and wrappable token services
|
|
119
|
+
(with their caches and the offset pagination), `WrapService`, the bridge constants and types, and
|
|
120
|
+
`createSolanaWallet`. `src/bridge/` and those services are gone from launchpad-sdk; the SDK's
|
|
121
|
+
bridge, balance, token-list and wrap methods build core's services (from the SDK's wallet, its
|
|
122
|
+
native signer and its DEX API client) and keep their names. The bridge-out signed payloads are
|
|
123
|
+
byte-identical (golden vectors, unchanged); every GalaConnect request, Ethereum and Solana
|
|
124
|
+
transaction, token-list read and wrap request replays the recorded vectors, and
|
|
125
|
+
`LaunchpadSDK.wrapToken` sends exactly the recorded wrap. `/native` is 337,915 bytes (was 403,450).
|
|
126
|
+
|
|
127
|
+
#### Breaking (the moves)
|
|
128
|
+
|
|
129
|
+
- **The bridge is gala-core-sdk's.** Every bridge export of the browser and node entries is
|
|
130
|
+
REMOVED; import it from `@gala-chain/gala-core-sdk/bridge` (same name unless listed):
|
|
131
|
+
|
|
132
|
+
| Was (launchpad-sdk) | Now (`@gala-chain/gala-core-sdk/bridge`) |
|
|
133
|
+
| --- | --- |
|
|
134
|
+
| `BaseBridgeStrategy`, `EthereumBridgeStrategy`, `SolanaBridgeStrategy`, `GalaConnectClient`, `BridgeStatusCode`, the constants (`CHAIN_IDS`, `GALACHAIN_CHANNELS`, `ETHEREUM_TOKENS_PROD` / `_STAGE`, `DEFAULT_SOLANA_TOKENS`, `ERC20_ABI`, `BRIDGE_CONTRACT_ABI`, ...), the EIP-712 constants, the token math (`toBaseUnits`, `fromBaseUnits`, `formatTokenAmount`, `compareAmounts`), `stripHexPrefix`, and every bridge, bridgeable-token and wrappable-token type | the same name |
|
|
135
|
+
| `BRIDGE_TOKEN_METADATA` | `STATIC_TOKEN_METADATA` |
|
|
136
|
+
| `BridgeRateLimiter` | `RateLimiter` |
|
|
137
|
+
| `DEFAULT_ETHEREUM_TOKENS` (deprecated alias) | `ETHEREUM_TOKENS_PROD` |
|
|
138
|
+
| `GalaConnectHttpError` | `GalaSDKError` with code `GALACONNECT_HTTP_ERROR` (`error.status`, `params.serverMessage`) |
|
|
139
|
+
| `createSolanaWallet`, `GeneratedSolanaWallet` | the same name (it was in the browser and node entries) |
|
|
140
|
+
| `WrapUnwrapStatus`, `WrapUnwrapStatusResult` | removed: a wrap resolves only once completed |
|
|
141
|
+
|
|
142
|
+
`BridgeService`, `BridgeableTokenService`, `WrappableTokenService` and `WrapService`, which
|
|
143
|
+
launchpad-sdk did not export, are exported there too.
|
|
144
|
+
- **Bridge and wrap failures are typed `GalaSDKError`s** (`isGalaError(error, code)`), not
|
|
145
|
+
`ValidationError` / `NetworkError` / `TransactionError` / `GalaConnectHttpError` or a text:
|
|
146
|
+
`INVALID_BRIDGE_AMOUNT`, `INVALID_WALLET_ADDRESS`, `INVALID_TOKEN_REFERENCE`,
|
|
147
|
+
`UNSUPPORTED_BRIDGE_TOKEN`, `BRIDGE_NOT_CONFIGURED`, `INVALID_BRIDGE_OPTION`,
|
|
148
|
+
`INSUFFICIENT_BRIDGE_BALANCE`, `GALACONNECT_HTTP_ERROR`, `BRIDGE_REQUEST_REJECTED`,
|
|
149
|
+
`BRIDGE_RESPONSE_INVALID`, `BRIDGE_READ_RESPONSE_INVALID`, `BRIDGE_TOKEN_NOT_FOUND`,
|
|
150
|
+
`TOKEN_NOT_WRAPPABLE`, `INVALID_WRAP_DIRECTION`, `BRIDGE_CHAIN_READ_FAILED`, and, once something
|
|
151
|
+
may have moved (never repeat it), `BRIDGE_WRITE_OUTCOME_UNKNOWN`, `BRIDGE_OUT_OUTCOME_UNKNOWN`
|
|
152
|
+
(with the bridge request id and the `uniqueKey`), `BRIDGE_DEPOSIT_OUTCOME_UNKNOWN`,
|
|
153
|
+
`BRIDGE_STATUS_TIMEOUT`.
|
|
154
|
+
- **`wrapToken` / `unwrapToken` throw instead of returning `success: false`**: `WrapUnwrapResult`
|
|
155
|
+
is the completed result (`success: true`, `transactionId` and `completedAt` always set; `error`
|
|
156
|
+
and `fee` removed). Their options have no `memo` (it was never sent). **`getWrapStatus` is
|
|
157
|
+
REMOVED** (it always answered "completed" for any id).
|
|
158
|
+
- **`getBridgeStatus(hash)`** takes no chain hint (one GalaConnect read answers for either chain);
|
|
159
|
+
**`estimateBridgeFee`** takes no `amount` (the fee never depended on it).
|
|
160
|
+
- Behaviour on the way: a GalaConnect write is sent again only after a 429 (a 5xx or a failure in
|
|
161
|
+
transit may have been applied: outcome unknown); an `eth|0x...` recipient is accepted; the
|
|
162
|
+
caller's own input (token id, amount, recipient, an unconfigured chain) is refused before any
|
|
163
|
+
read; a malformed RPC URL, contract, wallet address or program id option is refused when the
|
|
164
|
+
service is built.
|
|
165
|
+
- `bs58` and `json-stringify-deterministic` are no longer dependencies (nor, with the 9.0 cut above,
|
|
166
|
+
`@solana/web3.js` and `@solana/spl-token`: core's `/bridge` loads them, at the first bridge
|
|
167
|
+
call). `LaunchpadSDK`'s own
|
|
168
|
+
declarations need no Node types (a consumer of it compiles with TypeScript 6 and 7 without
|
|
169
|
+
them); an app that imports `/bridge` types naming `@solana/web3.js` (e.g. `BridgeServiceConfig`)
|
|
170
|
+
needs Node's types, since `@solana/web3.js`'s declarations import `http` / `https`.
|
|
171
|
+
|
|
172
|
+
- **`@gala-chain/launchpad-sdk/wallet` and `@gala-chain/launchpad-sdk/react` are REMOVED**, and so
|
|
173
|
+
are the wallet exports of the browser entry. Import from core instead (same names unless listed):
|
|
174
|
+
|
|
175
|
+
| Was (launchpad-sdk) | Now (gala-core-sdk) |
|
|
176
|
+
| --- | --- |
|
|
177
|
+
| `/wallet` and the browser entry: `PrivateKeyProvider`, `ExternalWalletProvider`, `GalaWalletProvider`, `detectWallets`, `getWalletByRdns`, `hasAnyWallet`, `isWalletAvailable`, `subscribeToWalletChanges`, `getInjectedEip1193Provider`, `KNOWN_WALLET_RDNS`, `createWalletProvider`, `createProviderFromEip1193`, `ensureConnected`, `getPrivateKeyIfAvailable`, `isPrivateKeyProvider`, `isExternalProvider`, `isEip1193Provider` and the types (`WalletProvider`, `Eip1193Provider`, `DetectedWallet`, ...) | `@gala-chain/gala-core-sdk/providers` |
|
|
178
|
+
| `WalletProviderError`, `WalletProviderErrorCode` | `GalaSDKError` from `@gala-chain/gala-core-sdk`, branched with `isGalaError(error, 'WALLET_CONNECTION_FAILED' \| 'WALLET_NOT_CONNECTED' \| 'SIGNING_FAILED' \| ...)` |
|
|
179
|
+
| `createProviderFromWallet(wallet)`, `walletToProvider(wallet)` | `PrivateKeyProvider.fromWallet(wallet)` |
|
|
180
|
+
| `providerToWallet(provider)` | `isPrivateKeyProvider(p) ? new Wallet(p.exportPrivateKey()) : undefined` (ethers stays the app's) |
|
|
181
|
+
| `/react`: `WalletProvider`, `WalletContext`, `useWallet`, `useWalletContext`, `useWalletConnection`, `useWalletDetection`, `useWalletAddress`, `useGalaAddress`, `useWalletProvider`, `useIsWalletConnected` and their types | `@gala-chain/gala-core-sdk/react` |
|
|
182
|
+
| `/react`'s re-exports `detectWallets`, `ExternalWalletProvider`, `KNOWN_WALLET_RDNS`, `PrivateKeyProvider`, type `WalletProviderInterface` | `@gala-chain/gala-core-sdk/providers` (`WalletProviderInterface` is `WalletProvider`) |
|
|
183
|
+
|
|
184
|
+
A custom `WalletProvider` now needs `getSigner()` (core's interface). `react` is no longer a peer
|
|
185
|
+
of launchpad-sdk (it is an optional peer of core's `/react`).
|
|
186
|
+
- **The Ethereum wallet helpers are gala-core-sdk's.** `createWallet`, `getPublicKeyFromPrivateKey`,
|
|
187
|
+
`getEthereumAddressFromPrivateKey` and the type `PublicKeyResult` are REMOVED from launchpad-sdk
|
|
188
|
+
(browser, node and `/native` entries): import them from `@gala-chain/gala-core-sdk`. Core's
|
|
189
|
+
`createWallet` returns `{ privateKey, address, galaAddress, mnemonic }` without the ethers
|
|
190
|
+
`.wallet`: `new Wallet(createWallet(input).privateKey)`. Refusals are core `GalaSDKError`s
|
|
191
|
+
(`INVALID_WALLET_INPUT`, `INVALID_PRIVATE_KEY`) instead of `ValidationError` / ethers errors; the
|
|
192
|
+
test-mode fake key (`NODE_ENV=test`) is gone. `createSolanaWallet` moved with the bridge (above).
|
|
193
|
+
`AgentConfig` builds its wallets with core's `createWallet`; its wallet type is exported as
|
|
194
|
+
`AgentWallet` (core's wallet plus the ethers `wallet`). The internal `WalletUtils` is gone.
|
|
195
|
+
|
|
196
|
+
- **The token-class and hold types are gala-core-sdk's.** `fetchTokenClassesWithSupply` returns
|
|
197
|
+
`GalaChainTokenClass[]` (was `TokenClassWithSupply`, whose `authorities` were typed as objects:
|
|
198
|
+
GalaChain sends user refs, strings) and `fetchTokenDetails` returns `GalaChainTokenDetails` (was
|
|
199
|
+
launchpad's `GalaChainTokenDetails`, whose `chatEnabled` was never set: a token's chat status is
|
|
200
|
+
`getTokenConfig(tokenName).chatEnabled`). A hold in `TokenBalanceResult` / `LockedBalanceResult`
|
|
201
|
+
is `GalaChainTokenHold` (`name` and `vestingPeriodStart` are optional, as GalaChain stores them).
|
|
202
|
+
Removed exports: `TokenClassWithSupply`, `TokenHold`, the zod `tokenHoldSchema`; import the types
|
|
203
|
+
from `@gala-chain/gala-core-sdk`. A token class carries GalaChain's documented fields only (an
|
|
204
|
+
undocumented field is no longer passed on).
|
|
205
|
+
- **`TokenClassKey` and `TokenInstanceKey` REMOVED**: every signature uses gala-core-sdk's
|
|
206
|
+
`GalaChainTokenClassKey` / `GalaChainTokenInstanceKey` (same four fields, plus `instance`), so
|
|
207
|
+
import those from `@gala-chain/gala-core-sdk`. `TokenId` stays (`string | GalaChainTokenClassKey
|
|
208
|
+
| GalaChainTokenInstanceKey`). The bridge's `isTokenClassKey` export is removed: use core's
|
|
209
|
+
`isTokenClassKey` (the same check: four non-empty strings).
|
|
210
|
+
- `ENVIRONMENT_URLS` takes `gatewayBaseUrl` and `dexApiBaseUrl` from core's
|
|
211
|
+
`GALA_CHAIN_ENVIRONMENTS` (same URLs); `Environment` is core's `GalaChainEnv` (`'prod' | 'stage'`).
|
|
212
|
+
- **The DEX is gswap-sdk's, not launchpad-sdk's.** launchpad-sdk no longer depends on
|
|
213
|
+
`@gala-chain/gswap-sdk` (product SDKs never import each other). Removed: `sdk.dex` (the `GSwap`
|
|
214
|
+
client) and the `GSwap` re-export; the swap-backend reads `fetchAllDexSeasons`,
|
|
215
|
+
`fetchCurrentDexSeason`, `fetchDexLeaderboardBySeasonId`, `fetchCurrentDexLeaderboard`,
|
|
216
|
+
`fetchDexAggregatedVolumeSummary` and the pool poller `onDexPoolCreation`; the types `DexSeason`,
|
|
217
|
+
`LeaderboardEntry`, `LeaderboardResult`, `MasteryTitle`, `DexAggregatedVolumeSummary`. Migration:
|
|
218
|
+
|
|
219
|
+
```typescript
|
|
220
|
+
import { PrivateKeySigner } from '@gala-chain/gala-core-sdk';
|
|
221
|
+
import { GSwap } from '@gala-chain/gswap-sdk';
|
|
222
|
+
|
|
223
|
+
const gSwap = new GSwap({ env, signer: new PrivateKeySigner(key), walletAddress: sdk.getAddress() });
|
|
224
|
+
// sdk.dex.quoting / swaps / pools / positions / symbols / assets -> gSwap.quoting / swaps / ...
|
|
225
|
+
// sdk.fetchAllDexSeasons() -> gSwap.leaderboard.getSeasons()
|
|
226
|
+
// sdk.fetchCurrentDexSeason() -> gSwap.leaderboard.getCurrentSeason()
|
|
227
|
+
// sdk.fetchDexLeaderboardBySeasonId(id) -> gSwap.leaderboard.getLeaderboard(id) ({ seasonId, entries })
|
|
228
|
+
// sdk.fetchCurrentDexLeaderboard() -> gSwap.leaderboard.getCurrentLeaderboard()
|
|
229
|
+
// sdk.fetchDexAggregatedVolumeSummary() -> gSwap.market.getVolumeSummary() (8 fields)
|
|
230
|
+
// sdk.onDexPoolCreation(cb, { minTVL }) -> gSwap.pools.watchNewPools(cb, { minTvl })
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
The gswap reads follow the backend's real answers: an answer of another shape is an error, not
|
|
234
|
+
`[]`; an unusable row is skipped (reported to `onInvalidEntry`), not filled with `''` / `0`; a
|
|
235
|
+
leaderboard has no `totalEntries` (`entries.length`) and a wallet without an XP breakdown has
|
|
236
|
+
`totalXp: null` (was `'0'`). `sdk.dex` was also never rebuilt by `setWallet` (it kept the first
|
|
237
|
+
wallet's signer): an app's own `GSwap` is built from the signer it means.
|
|
238
|
+
(The price reads went with the 9.0 cut above: only `fetchTokenPrice({ tokenName })` stays.)
|
|
239
|
+
|
|
240
|
+
- **`sdk.tokens` and `TokenWrites` REMOVED**, with the types `ChainResult`, `TransferInput`,
|
|
241
|
+
`LockInput`, `TokenAmountInput` and `TokenIdentifier`. They were a second implementation of the
|
|
242
|
+
same writes. Migration:
|
|
243
|
+
|
|
244
|
+
```typescript
|
|
245
|
+
// Removed
|
|
246
|
+
const result = await sdk.tokens.transfer({ to, tokenClassKey: 'GALA|Unit|none|none', quantity: '1' });
|
|
247
|
+
|
|
248
|
+
// Now (the SDK's wallet, or a { signer, walletAddress } SDK)
|
|
249
|
+
const { transactionId, blockNumber } = await sdk.transferToken({ to, tokenId: 'GALA|Unit|none|none', amount: '1' });
|
|
250
|
+
// sdk.tokens.burn / lock / unlock -> sdk.burnTokens / lockTokens / unlockTokens({ tokens: [...] })
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
What the services do not take that `sdk.tokens` did: a `client|` or `eth|0x...` recipient (spell
|
|
254
|
+
an Ethereum recipient `eth|<40 hex>` or `0x<40 hex>`), any `uniqueKey` (transfer keys keep the
|
|
255
|
+
`galaswap-operation-` / `galaconnect-operation-` prefix rule), a `$`-joined `tokenId`. For
|
|
256
|
+
those, use `GatewayWrites` from `@gala-chain/gala-core-sdk` directly.
|
|
257
|
+
|
|
258
|
+
#### Added
|
|
259
|
+
|
|
260
|
+
- An SDK configured with `{ signer, walletAddress }` (no `wallet`) can make token writes through
|
|
261
|
+
the five methods: signed by that signer and made as the declared identity (an `eth|` account or
|
|
262
|
+
a `client|` alias). With a `wallet` nothing changed.
|
|
263
|
+
- `LockTokensResult`, `UnlockTokensResult` and `BurnTokensResult` carry the gateway's
|
|
264
|
+
`x-transaction-id` as `transactionId` (preferred over a `Data` item's id) and `blockNumber`
|
|
265
|
+
from `x-block-number`, like the transfer receipts.
|
|
266
|
+
|
|
267
|
+
#### Changed
|
|
268
|
+
|
|
269
|
+
- Auto-generated `uniqueKey`s are `galaconnect-operation-<uuid v4>` (58 characters, CSPRNG) instead
|
|
270
|
+
of `galaconnect-operation-<ms>_<26 hex>` (62). An empty `uniqueKey` means "none" (a key is
|
|
271
|
+
minted); it used to be signed as `""` and refused by the chain.
|
|
272
|
+
- A caller's `uniqueKey` on `lockTokens` / `unlockTokens` / `burnTokens` (never checked before), and
|
|
273
|
+
one with characters outside `A-Za-z0-9._:-` on a transfer, is refused before signing.
|
|
274
|
+
- Quantities must be plain decimal strings (no exponent, hex or spaces); they are still signed as
|
|
275
|
+
written, never scaled.
|
|
276
|
+
- A pipe `tokenId` with a non-decimal fifth part (`Token|Unit|X|client|launchpad`, read as instance
|
|
277
|
+
`launchpad`) or a `TokenInstanceKey` with a non-decimal `instance` is refused before signing
|
|
278
|
+
instead of being signed as a different token.
|
|
279
|
+
- Token writes go through the SDK's gateway `HttpClient` (axios, the `Sign` header) as the five
|
|
280
|
+
methods always did; `config.httpRequestor`, which `sdk.tokens` used, is not used for them (it
|
|
281
|
+
still serves the bundler path). An app that must send token writes through its own
|
|
282
|
+
requestor uses core's `GatewayWrites` (`httpRequestor` option).
|
|
283
|
+
- `setWallet` / `setWalletProvider` now rebuild the token-write services, so a transfer, burn,
|
|
284
|
+
lock or unlock signs as the new wallet (before, the services kept signing as the wallet the SDK
|
|
285
|
+
was constructed with); a declared `{ signer, walletAddress }` identity no longer applies once the
|
|
286
|
+
wallet changes.
|
|
287
|
+
- A refusal of the core write before anything is sent maps to the service's error class
|
|
288
|
+
(`SIGNING_FAILED` -> `SIGNATURE_FAILED`, a token reference -> `TOKEN_NOT_FOUND`, a quantity ->
|
|
289
|
+
`INVALID_AMOUNT`, others -> the validation type).
|
|
290
|
+
|
|
291
|
+
#### Fixed (wallet changes)
|
|
292
|
+
|
|
293
|
+
- After `setWallet` / `setWalletProvider` nothing signs as, or sends from, the previous wallet:
|
|
294
|
+
the bundle trades (`buyTokens`, `sellTokens`) are rebuilt for the new wallet (they kept the
|
|
295
|
+
construction wallet, so an SDK started read-only could never trade), and the bridge service, the
|
|
296
|
+
wrap service and the GalaConnect client (built at first use with that wallet's address and key,
|
|
297
|
+
then kept forever) are dropped and rebuilt for the new wallet at their next use.
|
|
298
|
+
- An identity declared at construction (`walletAddress`, `galaChainAddress`, e.g. a `client|`
|
|
299
|
+
alias) named the construction key and is dropped on a wallet change: `getAddress()` was still
|
|
300
|
+
the old one, so the rebuilt services would have paired the new key with the old identity.
|
|
301
|
+
- `SignatureAuth.setWalletProvider` with a key-holding provider (`PrivateKeyProvider`) knows the
|
|
302
|
+
address at once, as `setWallet` does (the synchronous getters threw until `cacheAddress()`); a
|
|
303
|
+
wallet-backed provider still needs `cacheAddress()` and never reports the previous account.
|
|
304
|
+
|
|
305
|
+
#### Fixed (gateway reads)
|
|
306
|
+
|
|
307
|
+
- `fetchGalaBalance` and `fetchTokenBalance` (tokenId and MUSIC/GMUSIC routes) work against the
|
|
308
|
+
real gateway again: their `FetchBalances` body carried `instance: "0"`, which mainnet and testnet
|
|
309
|
+
refuse with HTTP 400 ("whitelistValidation: property instance should not exist", recorded
|
|
310
|
+
2026-10-13), so every such call threw a `NetworkError`. The body is now the chain DTO
|
|
311
|
+
(`owner, collection, category, type, additionalKey`).
|
|
312
|
+
- A balance record of another owner than the one asked for is never reported as theirs (the read
|
|
313
|
+
answers `null`); a missing owner is refused instead of reading every owner's balances.
|
|
314
|
+
- `availableQuantity` / `lockedQuantity` / `inUseQuantity` are never in exponent form
|
|
315
|
+
(`0.00000001`, not `1e-8`).
|
|
316
|
+
- `fetchNftCollections`, `isNftCollectionAvailable`, `fetchNftTokenClasses` and `fetchNftBalances`
|
|
317
|
+
read GalaChain (`FetchNftCollectionAuthorizationsWithPagination`,
|
|
318
|
+
`FetchTokenClassesWithPagination`, `FetchBalances`, page by page and bounded); they were
|
|
319
|
+
placeholders that always answered `[]` / `true`. `isNftCollectionAvailable` throws when the read
|
|
320
|
+
fails (never "available"), so `claimNftCollection` refuses a name that is already claimed. The
|
|
321
|
+
NFT writes (`claimNftCollection`, `createNftTokenClass`, `mintNft`) still do not reach GalaChain:
|
|
322
|
+
they return a locally made transaction id with status `pending`.
|
|
323
|
+
|
|
324
|
+
#### Fixed (price history; these reads are now the MCP server's, on gswap-sdk, which keeps the fixes)
|
|
325
|
+
|
|
326
|
+
- `fetchAllPriceHistory` reads the series once. It paged it through `fetchPriceHistory` with the
|
|
327
|
+
page NUMBER as the offset (0, 1, 2, ... with 50 per page), so a series over 50 points was
|
|
328
|
+
refetched in full per page (a 120-point series: about 100 requests) and came back with
|
|
329
|
+
overlapping, repeated snapshots; a series that changed between two requests shifted the pages.
|
|
330
|
+
A caller's `offset` / `limit` do not apply to it.
|
|
331
|
+
- `fetchPriceHistory` refuses a `limit` or `pageSize` outside 1-50 and a negative or fractional
|
|
332
|
+
`offset` before any request (`ValidationError`). A `limit` of 0 used to answer `page: NaN`,
|
|
333
|
+
`totalPages: Infinity` (JSON `null`).
|
|
334
|
+
|
|
335
|
+
#### Changed (gateway reads)
|
|
336
|
+
|
|
337
|
+
- A `FetchBalances` / `FetchTokenClasses` answer that is not GalaChain's (a numeric quantity, a hold
|
|
338
|
+
or class missing its fields) is refused whole: a balance is then `null` (as for any unusable
|
|
339
|
+
answer), a token class a `NetworkError`. A token-class answer without the class asked for is a
|
|
340
|
+
`NetworkError` ("Token not found on GalaChain", 404) instead of returning another class.
|
|
341
|
+
`fetchTokenClassesWithSupply` answers one class per key in the order asked (1 to 1000 keys).
|
|
342
|
+
|
|
343
|
+
#### Removed (internal)
|
|
344
|
+
|
|
345
|
+
- `api/dto/{TransferTokenDto,BurnTokensDto,LockTokenDto,UnlockTokenDto}` (and with them
|
|
346
|
+
`@gala-chain/api`'s `ChainCallDTO` on these paths), `utils/token-instance-key.ts`.
|
|
347
|
+
- `GalaChainBalanceService`'s `sumHoldQuantities` / `filterHolds` / `calculateAvailableQuantity`
|
|
348
|
+
(core totals the holds), the `GalaChainTokenBalance` / `InternalGalaChainFetchBalancesResponse` /
|
|
349
|
+
`InternalFetchTokenClassesWithSupplyResponse` types, `BalanceQueryParams.instance`, and
|
|
350
|
+
`@gala-chain/api`'s `TokenClass` on the token-class paths.
|
|
351
|
+
- Dead code: `utils/token-parser` `parseToken` (no caller), `isDelimited`, `isValidTokenFormat`,
|
|
352
|
+
`isPlainTokenSymbol` and its `isTokenClassKey`; `delimiter-parser` `validateTokenObject` (only
|
|
353
|
+
`parseToken` used it); `tokenNormalizer`'s `isTokenClassKeyStrict` re-export, `isTokenInstanceKey`
|
|
354
|
+
and `isTokenIdString`; `unique-key-generator` `generateOperationKey` (no caller; its keys held a
|
|
355
|
+
`|` and exceeded 64 characters); the unimported modules `types/token.types.ts` and
|
|
356
|
+
`types/galachain-api.types.ts` (a third and fourth `TokenClassKey` / `isTokenClassKey`).
|
|
357
|
+
- The GSwap error wrappers `GSwapQuoteError`, `GSwapSwapError`, `GSwapPoolError`,
|
|
358
|
+
`GSwapAssetError`, `GSwapPositionError`, `DexQuoteError`, `DexPoolNotFoundError` and
|
|
359
|
+
`handleGSwapErrorGeneric` (not exported, never thrown: gswap-sdk's `GSwapSDKError` is the DEX
|
|
360
|
+
error); `DexService`'s season, leaderboard and volume reads; `scripts/stage-verify-dex-reads.ts`
|
|
361
|
+
(`verify:stage-dex-reads`, which checked `sdk.dex`).
|
|
362
|
+
- `@gala-chain/gswap-sdk` was then a devDependency only (the examples and the live stage test); with
|
|
363
|
+
the 9.0 cut above it is no dependency of any kind.
|
|
364
|
+
|
|
3
365
|
## 6.0.0
|
|
4
366
|
|
|
5
367
|
### BREAKING CHANGES
|