@gala-chain/launchpad-sdk 8.0.2 → 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 +150 -419
- package/dist/LaunchpadSDK.d.ts.map +1 -1
- package/dist/api/LaunchpadAPI.d.ts +37 -43
- package/dist/api/LaunchpadAPI.d.ts.map +1 -1
- package/dist/auth/SessionAuthService.d.ts.map +1 -1
- package/dist/auth/SignatureAuth.d.ts +2 -2
- package/dist/auth/SignatureAuth.d.ts.map +1 -1
- package/dist/auth/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 +11 -23
- 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/sell-fee-ceiling.d.ts +66 -0
- package/dist/launchpad/sell-fee-ceiling.d.ts.map +1 -0
- package/dist/launchpad/transport.d.ts +2 -1
- package/dist/launchpad/transport.d.ts.map +1 -1
- package/dist/launchpad/writes.d.ts +30 -2
- package/dist/launchpad/writes.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/launchpad.d.ts +4 -4
- package/dist/schemas/launchpad.d.ts.map +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/BundleService.d.ts +9 -1
- package/dist/services/BundleService.d.ts.map +1 -1
- 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 -64
- 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/TradingQuotesService.d.ts +3 -5
- package/dist/services/TradingQuotesService.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 +23 -11
- 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 -269
- 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/session-auth.dto.d.ts +2 -4
- package/dist/types/session-auth.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/trade-quote.d.ts +32 -0
- package/dist/utils/trade-quote.d.ts.map +1 -0
- 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/signing/eip712.d.ts +0 -13
- package/dist/signing/eip712.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
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
import type { GalaChainSigner } from '../signing/signers.js';
|
|
2
|
-
import type { HttpRequestor } from '../launchpad/bundle-submission.js';
|
|
3
|
-
/** A four-part GalaChain token class key. */
|
|
4
|
-
export interface TokenClassKey {
|
|
5
|
-
collection: string;
|
|
6
|
-
category: string;
|
|
7
|
-
type: string;
|
|
8
|
-
additionalKey: string;
|
|
9
|
-
}
|
|
10
|
-
/** Token identifier accepted by token writes. */
|
|
11
|
-
export type TokenIdentifier = TokenClassKey | string;
|
|
12
|
-
/** Common input for a single token mutation. */
|
|
13
|
-
export interface TokenAmountInput {
|
|
14
|
-
/**
|
|
15
|
-
* The token's explicit class key: an object, or a `|`- / `$`-delimited string. A symbol is
|
|
16
|
-
* never accepted: a class key cannot be derived from a symbol. Resolve a launchpad token name
|
|
17
|
-
* with `sdk.resolveTokenClassKey(tokenName)` first.
|
|
18
|
-
*/
|
|
19
|
-
tokenClassKey: TokenIdentifier;
|
|
20
|
-
quantity: string;
|
|
21
|
-
instance?: string;
|
|
22
|
-
uniqueKey?: string;
|
|
23
|
-
}
|
|
24
|
-
/** Input for a token transfer. */
|
|
25
|
-
export interface TransferInput extends TokenAmountInput {
|
|
26
|
-
to: string;
|
|
27
|
-
}
|
|
28
|
-
/** Lock-specific token write input. */
|
|
29
|
-
export interface LockInput extends TokenAmountInput {
|
|
30
|
-
lockAuthority?: string;
|
|
31
|
-
expires?: number;
|
|
32
|
-
name?: string;
|
|
33
|
-
}
|
|
34
|
-
/** Result returned by direct gateway token writes. */
|
|
35
|
-
export interface ChainResult<T = unknown> {
|
|
36
|
-
status: 'PROCESSED';
|
|
37
|
-
data: T;
|
|
38
|
-
transactionId?: string;
|
|
39
|
-
blockNumber?: number;
|
|
40
|
-
}
|
|
41
|
-
/** Native-signed token-contract write client. */
|
|
42
|
-
export declare class TokenWrites {
|
|
43
|
-
private readonly gatewayBaseUrl;
|
|
44
|
-
private readonly signer;
|
|
45
|
-
private readonly walletAddress;
|
|
46
|
-
private readonly requestor;
|
|
47
|
-
/** Create a token write client with a native signer and injectable HTTP. */
|
|
48
|
-
constructor(options: {
|
|
49
|
-
gatewayBaseUrl: string;
|
|
50
|
-
dexBackendBaseUrl: string;
|
|
51
|
-
signer: GalaChainSigner;
|
|
52
|
-
walletAddress: string;
|
|
53
|
-
httpRequestor?: HttpRequestor;
|
|
54
|
-
});
|
|
55
|
-
/**
|
|
56
|
-
* Transfer a token through the direct token-contract gateway endpoint.
|
|
57
|
-
* @example
|
|
58
|
-
* ```typescript
|
|
59
|
-
* const result = await sdk.tokens.transfer({ to: 'client|recipient', tokenClassKey: 'GALA|Unit|none|none', quantity: '1' });
|
|
60
|
-
* console.log(result.transactionId, result.blockNumber);
|
|
61
|
-
* ```
|
|
62
|
-
*/
|
|
63
|
-
transfer(input: TransferInput): Promise<ChainResult>;
|
|
64
|
-
/**
|
|
65
|
-
* Burn tokens through the direct public gateway endpoint.
|
|
66
|
-
* @example
|
|
67
|
-
* ```typescript
|
|
68
|
-
* const result = await sdk.tokens.burn({ tokenClassKey: 'GALA|Unit|none|none', quantity: '1' });
|
|
69
|
-
* console.log(result.status);
|
|
70
|
-
* ```
|
|
71
|
-
*/
|
|
72
|
-
burn(input: TokenAmountInput): Promise<ChainResult>;
|
|
73
|
-
/**
|
|
74
|
-
* Lock tokens through the direct public gateway endpoint.
|
|
75
|
-
* @example
|
|
76
|
-
* ```typescript
|
|
77
|
-
* await sdk.tokens.lock({ tokenClassKey: 'GALA|Unit|none|none', quantity: '1' });
|
|
78
|
-
* ```
|
|
79
|
-
*/
|
|
80
|
-
lock(input: LockInput): Promise<ChainResult>;
|
|
81
|
-
/**
|
|
82
|
-
* Unlock tokens through the direct public gateway endpoint.
|
|
83
|
-
* @example
|
|
84
|
-
* ```typescript
|
|
85
|
-
* await sdk.tokens.unlock({ tokenClassKey: 'GALA|Unit|none|none', quantity: '1' });
|
|
86
|
-
* ```
|
|
87
|
-
*/
|
|
88
|
-
unlock(input: TokenAmountInput & {
|
|
89
|
-
name?: string;
|
|
90
|
-
}): Promise<ChainResult>;
|
|
91
|
-
private direct;
|
|
92
|
-
private post;
|
|
93
|
-
private signNative;
|
|
94
|
-
}
|
|
95
|
-
//# sourceMappingURL=transfers.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transfers.d.ts","sourceRoot":"","sources":["../../src/tokens/transfers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAgB,MAAM,mCAAmC,CAAC;AAGrF,6CAA6C;AAC7C,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,iDAAiD;AACjD,MAAM,MAAM,eAAe,GAAG,aAAa,GAAG,MAAM,CAAC;AAErD,gDAAgD;AAChD,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,aAAa,EAAE,eAAe,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,kCAAkC;AAClC,MAAM,WAAW,aAAc,SAAQ,gBAAgB;IACrD,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,uCAAuC;AACvC,MAAM,WAAW,SAAU,SAAQ,gBAAgB;IACjD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,sDAAsD;AACtD,MAAM,WAAW,WAAW,CAAC,CAAC,GAAG,OAAO;IACtC,MAAM,EAAE,WAAW,CAAC;IACpB,IAAI,EAAE,CAAC,CAAC;IACR,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAcD,iDAAiD;AACjD,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgB;IAE1C,4EAA4E;gBACzD,OAAO,EAAE;QAC1B,cAAc,EAAE,MAAM,CAAC;QACvB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,MAAM,EAAE,eAAe,CAAC;QACxB,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,CAAC,EAAE,aAAa,CAAC;KAC/B;IAOD;;;;;;;OAOG;IACI,QAAQ,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC;IAY3D;;;;;;;OAOG;IACI,IAAI,CAAC,KAAK,EAAE,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC;IAQ1D;;;;;;OAMG;IACI,IAAI,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC;IAenD;;;;;;OAMG;IACI,MAAM,CAAC,KAAK,EAAE,gBAAgB,GAAG;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,WAAW,CAAC;YAalE,MAAM;IA4BpB,OAAO,CAAC,IAAI;YAUE,UAAU;CASzB"}
|
|
@@ -1,297 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* GalaChain Gateway and DEX Backend API Type Definitions
|
|
3
|
-
*
|
|
4
|
-
* Comprehensive, fully-typed definitions for all API responses from:
|
|
5
|
-
* - GalaChain Gateway (DEX contract endpoints)
|
|
6
|
-
* - DEX Backend API
|
|
7
|
-
*
|
|
8
|
-
* Zero `any` types, complete type safety across all API operations.
|
|
9
|
-
*/
|
|
10
|
-
import type BigNumber from 'bignumber.js';
|
|
11
|
-
/**
|
|
12
|
-
* GalaChain Gateway response wrapper
|
|
13
|
-
* All Gateway responses wrap the actual data in this structure
|
|
14
|
-
*/
|
|
15
|
-
export interface GalaChainGatewayResponse<T> {
|
|
16
|
-
Data: T;
|
|
17
|
-
Status: number;
|
|
18
|
-
Message?: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Token class key structure used in API responses
|
|
22
|
-
*/
|
|
23
|
-
export interface TokenClassKey {
|
|
24
|
-
collection: string;
|
|
25
|
-
category: string;
|
|
26
|
-
type: string;
|
|
27
|
-
additionalKey: string;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* Pool data from GetPoolData endpoint
|
|
31
|
-
* Complete Uniswap V3 pool state including tick, liquidity, fees
|
|
32
|
-
*/
|
|
33
|
-
export interface GalaChainPoolData {
|
|
34
|
-
token0: string;
|
|
35
|
-
token1: string;
|
|
36
|
-
token0ClassKey: TokenClassKey;
|
|
37
|
-
token1ClassKey: TokenClassKey;
|
|
38
|
-
fee: number;
|
|
39
|
-
tickSpacing: number;
|
|
40
|
-
liquidity: string;
|
|
41
|
-
sqrtPrice: string;
|
|
42
|
-
tick: number;
|
|
43
|
-
feeGrowthGlobal0: string;
|
|
44
|
-
feeGrowthGlobal1: string;
|
|
45
|
-
bitmap?: Record<string, string>;
|
|
46
|
-
creator?: string;
|
|
47
|
-
grossPoolLiquidity?: string;
|
|
48
|
-
isPrivate?: boolean;
|
|
49
|
-
maxLiquidityPerTick?: string;
|
|
50
|
-
protocolFees?: number;
|
|
51
|
-
protocolFeesToken0?: string;
|
|
52
|
-
protocolFeesToken1?: string;
|
|
53
|
-
whitelist?: unknown[];
|
|
54
|
-
observations?: Array<{
|
|
55
|
-
blockTimestamp: number;
|
|
56
|
-
tickCumulative: number;
|
|
57
|
-
secondsPerLiquidityCumulativeX128: string;
|
|
58
|
-
initialized: boolean;
|
|
59
|
-
}>;
|
|
60
|
-
currentPrice?: string;
|
|
61
|
-
token0Decimals?: number;
|
|
62
|
-
token1Decimals?: number;
|
|
63
|
-
initialized?: boolean;
|
|
64
|
-
poolAddress?: string;
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Individual position data from GetPositions endpoint
|
|
68
|
-
* Represents a concentrated liquidity position in a pool
|
|
69
|
-
*
|
|
70
|
-
* IMPORTANT: API returns token0ClassKey/token1ClassKey, NOT token0/token1
|
|
71
|
-
* API does NOT return owner in the response (owner is in request only)
|
|
72
|
-
*/
|
|
73
|
-
export interface GalaChainPosition {
|
|
74
|
-
positionId: string;
|
|
75
|
-
poolHash?: string;
|
|
76
|
-
token0ClassKey: TokenClassKey;
|
|
77
|
-
token1ClassKey: TokenClassKey;
|
|
78
|
-
fee: number;
|
|
79
|
-
tickLower: number;
|
|
80
|
-
tickUpper: number;
|
|
81
|
-
liquidity: string;
|
|
82
|
-
feeGrowthInside0Last: string;
|
|
83
|
-
feeGrowthInside1Last: string;
|
|
84
|
-
tokensOwed0: string;
|
|
85
|
-
tokensOwed1: string;
|
|
86
|
-
owner?: string;
|
|
87
|
-
amount0?: string;
|
|
88
|
-
amount1?: string;
|
|
89
|
-
feeAmount0?: string;
|
|
90
|
-
feeAmount1?: string;
|
|
91
|
-
createdAt?: number;
|
|
92
|
-
updatedAt?: number;
|
|
93
|
-
operator?: string;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* Response from GetPositions endpoint
|
|
97
|
-
* Can return multiple positions for a wallet/criteria
|
|
98
|
-
*/
|
|
99
|
-
export interface GalaChainGetPositionsResponse {
|
|
100
|
-
positions: GalaChainPosition[];
|
|
101
|
-
count: number;
|
|
102
|
-
totalLiquidity?: string;
|
|
103
|
-
totalValue?: string;
|
|
104
|
-
nextBookMark?: string;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Estimated amounts when removing liquidity
|
|
108
|
-
* From GetRemoveLiquidityEstimation endpoint
|
|
109
|
-
*
|
|
110
|
-
* IMPORTANT: API only returns amount0 and amount1.
|
|
111
|
-
* Other fields are enriched by SDK or optional.
|
|
112
|
-
*/
|
|
113
|
-
export interface GalaChainRemoveLiquidityEstimation {
|
|
114
|
-
amount0: string;
|
|
115
|
-
amount1: string;
|
|
116
|
-
fee0?: string;
|
|
117
|
-
fee1?: string;
|
|
118
|
-
liquidity?: string;
|
|
119
|
-
tickLower?: number;
|
|
120
|
-
tickUpper?: number;
|
|
121
|
-
currentPrice?: string;
|
|
122
|
-
token0Symbol?: string;
|
|
123
|
-
token1Symbol?: string;
|
|
124
|
-
}
|
|
125
|
-
/**
|
|
126
|
-
* User asset from DEX Backend API
|
|
127
|
-
* Represents a token in a user's wallet on the DEX
|
|
128
|
-
*/
|
|
129
|
-
export interface DexBackendUserAsset {
|
|
130
|
-
tokenId: TokenClassKey | string;
|
|
131
|
-
symbol: string;
|
|
132
|
-
name: string;
|
|
133
|
-
decimals: number;
|
|
134
|
-
balance: string | BigNumber;
|
|
135
|
-
contractAddress?: string;
|
|
136
|
-
imageUrl?: string;
|
|
137
|
-
verified?: boolean;
|
|
138
|
-
trading?: boolean;
|
|
139
|
-
walletAddress?: string;
|
|
140
|
-
}
|
|
141
|
-
/**
|
|
142
|
-
* Response from DEX Backend getUserAssets endpoint
|
|
143
|
-
* List of all tokens user holds on the DEX
|
|
144
|
-
*/
|
|
145
|
-
export interface DexBackendUserAssetsResponse {
|
|
146
|
-
tokens: DexBackendUserAsset[];
|
|
147
|
-
count: number;
|
|
148
|
-
totalValue?: string;
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Raw token from DEX Backend /user/token-list endpoint
|
|
152
|
-
* Contains full token metadata and optional balance
|
|
153
|
-
* @since 4.1.0
|
|
154
|
-
*/
|
|
155
|
-
export interface DexBackendRawToken {
|
|
156
|
-
image: string;
|
|
157
|
-
name: string;
|
|
158
|
-
symbol: string;
|
|
159
|
-
decimals: string;
|
|
160
|
-
description: string;
|
|
161
|
-
verify: boolean;
|
|
162
|
-
compositeKey: string;
|
|
163
|
-
additionalKey: string;
|
|
164
|
-
category: string;
|
|
165
|
-
type: string;
|
|
166
|
-
collection: string;
|
|
167
|
-
subscribePrice: boolean;
|
|
168
|
-
quantity: string;
|
|
169
|
-
}
|
|
170
|
-
/**
|
|
171
|
-
* Response from DEX Backend /user/token-list endpoint
|
|
172
|
-
* @since 4.1.0
|
|
173
|
-
*/
|
|
174
|
-
export interface DexBackendTokenListResponse {
|
|
175
|
-
token: DexBackendRawToken[];
|
|
176
|
-
count: number;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* Request to GetPoolData endpoint
|
|
180
|
-
*/
|
|
181
|
-
export interface GalaChainGetPoolDataRequest {
|
|
182
|
-
token0: TokenClassKey;
|
|
183
|
-
token1: TokenClassKey;
|
|
184
|
-
fee: number;
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Request to GetPositions endpoint
|
|
188
|
-
* Multiple query filters supported
|
|
189
|
-
*
|
|
190
|
-
* IMPORTANT: Backend expects:
|
|
191
|
-
* - token0/token1 (NOT tokenA/tokenB)
|
|
192
|
-
* - fee (NOT feeTier)
|
|
193
|
-
* - TokenClassKey objects (NOT pipe-delimited strings)
|
|
194
|
-
* - tickLower/tickUpper for single position fetch
|
|
195
|
-
*/
|
|
196
|
-
export interface GalaChainGetPositionsRequest {
|
|
197
|
-
owner?: string;
|
|
198
|
-
token0?: TokenClassKey;
|
|
199
|
-
token1?: TokenClassKey;
|
|
200
|
-
fee?: number;
|
|
201
|
-
tickLower?: number;
|
|
202
|
-
tickUpper?: number;
|
|
203
|
-
positionId?: string;
|
|
204
|
-
limit?: number;
|
|
205
|
-
bookmark?: string;
|
|
206
|
-
}
|
|
207
|
-
/**
|
|
208
|
-
* Slot0 pool state data from GetSlot0 endpoint
|
|
209
|
-
* Contains minimal pool state required for pricing and liquidity calculations
|
|
210
|
-
*
|
|
211
|
-
* @since 5.16.0
|
|
212
|
-
*/
|
|
213
|
-
export interface GalaChainSlot0Data {
|
|
214
|
-
sqrtPrice: string;
|
|
215
|
-
tick: number;
|
|
216
|
-
liquidity: string;
|
|
217
|
-
grossPoolLiquidity?: string;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Request to GetSlot0 endpoint
|
|
221
|
-
*
|
|
222
|
-
* IMPORTANT: Backend expects:
|
|
223
|
-
* - token0/token1 (NOT tokenA/tokenB)
|
|
224
|
-
* - TokenClassKey objects (NOT pipe-delimited strings)
|
|
225
|
-
*
|
|
226
|
-
* @since 5.16.0
|
|
227
|
-
*/
|
|
228
|
-
export interface GalaChainGetSlot0Request {
|
|
229
|
-
token0: TokenClassKey;
|
|
230
|
-
token1: TokenClassKey;
|
|
231
|
-
fee: number;
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Request to GetRemoveLiquidityEstimation endpoint
|
|
235
|
-
*
|
|
236
|
-
* IMPORTANT: Backend expects:
|
|
237
|
-
* - token0/token1 (NOT tokenA/tokenB)
|
|
238
|
-
* - TokenClassKey objects (NOT pipe-delimited strings)
|
|
239
|
-
* - owner: User reference (eth|0x... or client|...)
|
|
240
|
-
* - amount: Liquidity amount to estimate removal for (NOT 'liquidity')
|
|
241
|
-
*/
|
|
242
|
-
export interface GalaChainGetRemoveLiquidityEstimationRequest {
|
|
243
|
-
token0: TokenClassKey;
|
|
244
|
-
token1: TokenClassKey;
|
|
245
|
-
fee: number;
|
|
246
|
-
tickLower: number;
|
|
247
|
-
tickUpper: number;
|
|
248
|
-
amount: string;
|
|
249
|
-
owner: string;
|
|
250
|
-
}
|
|
251
|
-
/**
|
|
252
|
-
* Request to DEX Backend getUserAssets endpoint
|
|
253
|
-
*/
|
|
254
|
-
export interface DexBackendGetUserAssetsRequest {
|
|
255
|
-
walletAddress: string;
|
|
256
|
-
limit?: number;
|
|
257
|
-
offset?: number;
|
|
258
|
-
}
|
|
259
|
-
/**
|
|
260
|
-
* Standard API error response
|
|
261
|
-
*/
|
|
262
|
-
export interface ApiErrorResponse {
|
|
263
|
-
Status: number;
|
|
264
|
-
Message: string;
|
|
265
|
-
Data?: Record<string, unknown>;
|
|
266
|
-
}
|
|
267
|
-
/**
|
|
268
|
-
* Parsed error with context
|
|
269
|
-
*/
|
|
270
|
-
export declare class ApiError extends Error {
|
|
271
|
-
readonly status: number;
|
|
272
|
-
readonly message: string;
|
|
273
|
-
readonly details?: Record<string, unknown> | undefined;
|
|
274
|
-
constructor(status: number, message: string, details?: Record<string, unknown> | undefined);
|
|
275
|
-
}
|
|
276
|
-
/**
|
|
277
|
-
* Check if value is a TokenClassKey
|
|
278
|
-
*/
|
|
279
|
-
export declare function isTokenClassKey(value: unknown): value is TokenClassKey;
|
|
280
|
-
/**
|
|
281
|
-
* Check if value is a GalaChainPoolData response
|
|
282
|
-
*/
|
|
283
|
-
export declare function isGalaChainPoolData(value: unknown): value is GalaChainPoolData;
|
|
284
|
-
/**
|
|
285
|
-
* Check if value is GalaChainSlot0Data
|
|
286
|
-
*/
|
|
287
|
-
export declare function isGalaChainSlot0Data(value: unknown): value is GalaChainSlot0Data;
|
|
288
|
-
/**
|
|
289
|
-
* Check if value is a GalaChainPosition
|
|
290
|
-
* Validates against actual API response format with token0ClassKey/token1ClassKey
|
|
291
|
-
*/
|
|
292
|
-
export declare function isGalaChainPosition(value: unknown): value is GalaChainPosition;
|
|
293
|
-
/**
|
|
294
|
-
* Check if value is a DexBackendUserAsset
|
|
295
|
-
*/
|
|
296
|
-
export declare function isDexBackendUserAsset(value: unknown): value is DexBackendUserAsset;
|
|
297
|
-
//# sourceMappingURL=galachain-api.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"galachain-api.types.d.ts","sourceRoot":"","sources":["../../src/types/galachain-api.types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,SAAS,MAAM,c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ots from DEX Backend API.
|
|
5
|
-
* Price history is only available for DEX tokens and requires Node.js environment.
|
|
6
|
-
*
|
|
7
|
-
* @category Price History
|
|
8
|
-
* @since 3.13.0
|
|
9
|
-
*/
|
|
10
|
-
import type { TokenId } from './common.js';
|
|
11
|
-
/**
|
|
12
|
-
* Sort order for price history results
|
|
13
|
-
* @since 3.13.0
|
|
14
|
-
*/
|
|
15
|
-
export type PriceSortOrder = 'ASC' | 'DESC';
|
|
16
|
-
/** Time windows accepted by the DEX market price-series endpoint. */
|
|
17
|
-
export type PriceSeriesTimeframe = '1D' | '1W' | '1M' | '1Y' | 'ALL';
|
|
18
|
-
/**
|
|
19
|
-
* Options for fetching price history
|
|
20
|
-
*
|
|
21
|
-
* Supports flexible token identification via either:
|
|
22
|
-
* - `tokenName`: Simple launchpad token name (e.g., "demonkpop", "shoewars")
|
|
23
|
-
* - `tokenId`: Full token class key in format "collection|category|type|additionalKey"
|
|
24
|
-
*
|
|
25
|
-
* Exactly one of `tokenName` or `tokenId` must be provided (mutually exclusive).
|
|
26
|
-
*
|
|
27
|
-
* When `tokenName` is provided, the SDK automatically resolves it to the full tokenId
|
|
28
|
-
* by calling fetchPoolDetails() internally.
|
|
29
|
-
*
|
|
30
|
-
* @since 3.13.0 (tokenId parameter)
|
|
31
|
-
* @since 3.20.0 (tokenName parameter added)
|
|
32
|
-
*/
|
|
33
|
-
export interface FetchPriceHistoryOptions {
|
|
34
|
-
/** Simple token name for convenience (e.g., "demonkpop") - automatically resolves to full tokenId */
|
|
35
|
-
tokenName?: string;
|
|
36
|
-
/** Flexible token identifier - accepts string, TokenClassKey, or TokenInstanceKey */
|
|
37
|
-
tokenId?: TokenId;
|
|
38
|
-
/** Start date for filtering price snapshots (optional, defaults to 30 days ago) */
|
|
39
|
-
from?: Date;
|
|
40
|
-
/** End date for filtering price snapshots (optional, defaults to now) */
|
|
41
|
-
to?: Date;
|
|
42
|
-
/** Sort order for results (default: DESC for newest-first) */
|
|
43
|
-
sortOrder?: PriceSortOrder;
|
|
44
|
-
/** Market series time window (default: 1M) */
|
|
45
|
-
timeframe?: PriceSeriesTimeframe;
|
|
46
|
-
/** Cursor token for fetching the next page (omit for first page) - for cursor-based pagination */
|
|
47
|
-
cursor?: string;
|
|
48
|
-
/** Page size for pagination (defaults to 10, max 50 - DEX Backend API constraint) */
|
|
49
|
-
pageSize?: number;
|
|
50
|
-
/** Offset into results (0-based, defaults to 0) - DEPRECATED, use cursor/pageSize instead */
|
|
51
|
-
offset?: number;
|
|
52
|
-
/** Number of items per page (DEPRECATED, use pageSize instead) */
|
|
53
|
-
limit?: number;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Single price snapshot from the database
|
|
57
|
-
*
|
|
58
|
-
* Represents a point-in-time price record for a token.
|
|
59
|
-
*
|
|
60
|
-
* @since 3.13.0
|
|
61
|
-
*/
|
|
62
|
-
export interface PriceSnapshot {
|
|
63
|
-
/** Token price as a decimal string (uses BigNumber-safe precision) */
|
|
64
|
-
price: string;
|
|
65
|
-
/** Timestamp of the price snapshot (created_at from database) */
|
|
66
|
-
timestamp: Date;
|
|
67
|
-
/** Token ID in pipe-delimited format: "collection|category|type|additionalKey" */
|
|
68
|
-
tokenId: string;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Result of fetching price history with pagination metadata
|
|
72
|
-
*
|
|
73
|
-
* Follows the same pagination pattern as other pageable queries in the SDK.
|
|
74
|
-
*
|
|
75
|
-
* @since 3.13.0
|
|
76
|
-
* @example
|
|
77
|
-
* ```typescript
|
|
78
|
-
* // Object format
|
|
79
|
-
* const result = await sdk.fetchPriceHistory({
|
|
80
|
-
* tokenId: {
|
|
81
|
-
* collection: 'GUSDC',
|
|
82
|
-
* category: 'Unit',
|
|
83
|
-
* type: 'none',
|
|
84
|
-
* additionalKey: 'none'
|
|
85
|
-
* },
|
|
86
|
-
* from: new Date('2024-01-01'),
|
|
87
|
-
* to: new Date('2024-01-31'),
|
|
88
|
-
* page: 1,
|
|
89
|
-
* limit: 20
|
|
90
|
-
* });
|
|
91
|
-
*
|
|
92
|
-
* // String format
|
|
93
|
-
* const result = await sdk.fetchPriceHistory({
|
|
94
|
-
* tokenId: 'GUSDC|Unit|none|none',
|
|
95
|
-
* page: 1,
|
|
96
|
-
* limit: 20
|
|
97
|
-
* });
|
|
98
|
-
*
|
|
99
|
-
* console.log(`Found ${result.snapshots.length} snapshots`);
|
|
100
|
-
* result.snapshots.forEach(snap => {
|
|
101
|
-
* console.log(`${snap.tokenId}: $${snap.price} at ${snap.timestamp}`);
|
|
102
|
-
* });
|
|
103
|
-
* console.log(`Total: ${result.total}, Page ${result.page} of ${result.totalPages}`);
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
export interface PriceHistoryResult {
|
|
107
|
-
/** Array of price snapshots for the requested period */
|
|
108
|
-
snapshots: PriceSnapshot[];
|
|
109
|
-
/** Current page number (1-based) */
|
|
110
|
-
page: number;
|
|
111
|
-
/** Number of items per page */
|
|
112
|
-
limit: number;
|
|
113
|
-
/** Total number of snapshots matching the filter */
|
|
114
|
-
total: number;
|
|
115
|
-
/** Total number of pages available */
|
|
116
|
-
totalPages: number;
|
|
117
|
-
/** Whether there are more pages after this one */
|
|
118
|
-
hasNext: boolean;
|
|
119
|
-
/** Whether there are pages before this one */
|
|
120
|
-
hasPrevious: boolean;
|
|
121
|
-
}
|
|
122
|
-
/** Raw response from GET /market/price-series. */
|
|
123
|
-
export interface MarketPriceSeriesResponse {
|
|
124
|
-
/** Dense Unix-second price points. */
|
|
125
|
-
prices: Array<{
|
|
126
|
-
time: number;
|
|
127
|
-
price: number;
|
|
128
|
-
}>;
|
|
129
|
-
/** Most recent price, or null when no data exists. */
|
|
130
|
-
currentPrice: number | null;
|
|
131
|
-
/** 24-hour percentage change, or null when unavailable. */
|
|
132
|
-
change24h: number | null;
|
|
133
|
-
}
|
|
134
|
-
//# sourceMappingURL=priceHistory.dto.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
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