@gala-chain/launchpad-sdk 4.0.15-beta.0 → 4.0.15-beta.10
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/README.md +49 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/src/LaunchpadSDK.d.ts +183 -16
- package/dist/src/LaunchpadSDK.d.ts.map +1 -1
- package/dist/src/bridge/GalaConnectClient.d.ts +6 -0
- package/dist/src/bridge/GalaConnectClient.d.ts.map +1 -1
- package/dist/src/bridge/types/bridgeable-token.dto.d.ts +13 -3
- package/dist/src/bridge/types/bridgeable-token.dto.d.ts.map +1 -1
- package/dist/src/constants/version.generated.d.ts +1 -1
- package/dist/src/constants/version.generated.d.ts.map +1 -1
- package/dist/src/helpers/wallet.d.ts +90 -0
- package/dist/src/helpers/wallet.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/services/BridgeableTokenService.d.ts +74 -7
- package/dist/src/services/BridgeableTokenService.d.ts.map +1 -1
- package/dist/src/utils/agent-config.d.ts +7 -0
- package/dist/src/utils/agent-config.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
*/
|
|
23
23
|
import { HttpClient } from '../utils/http.js';
|
|
24
24
|
import { BridgeableTokenCache } from './BridgeableTokenCache.js';
|
|
25
|
+
import type { TokenId } from '../types/common.js';
|
|
25
26
|
import type { BridgeableToken, BridgeableNetwork, FetchBridgeableTokensOptions, FetchBridgeableTokensResult, IsTokenBridgeableOptions, IsTokenBridgeableResult } from '../bridge/types/bridgeable-token.dto.js';
|
|
26
27
|
/**
|
|
27
28
|
* BridgeableTokenService
|
|
@@ -37,13 +38,18 @@ import type { BridgeableToken, BridgeableNetwork, FetchBridgeableTokensOptions,
|
|
|
37
38
|
* const result = await service.fetchAllBridgeableTokensByNetwork('ETHEREUM');
|
|
38
39
|
* console.log(`Found ${result.tokenCount} tokens`);
|
|
39
40
|
*
|
|
40
|
-
* // Check if a specific token is bridgeable
|
|
41
|
+
* // Check if a specific token is bridgeable (pipe-delimited format)
|
|
41
42
|
* const isBridgeable = await service.isTokenBridgeableToNetwork({
|
|
42
|
-
*
|
|
43
|
+
* tokenId: 'GALA|Unit|none|none',
|
|
43
44
|
* network: 'ETHEREUM'
|
|
44
45
|
* });
|
|
45
46
|
* console.log(`GALA bridgeable to Ethereum: ${isBridgeable.isBridgeable}`);
|
|
46
47
|
*
|
|
48
|
+
* // Or use TokenClassKey object format
|
|
49
|
+
* const result = await service.isTokenBridgeableToEthereum({
|
|
50
|
+
* collection: 'Token', category: 'Unit', type: 'GALA', additionalKey: 'none'
|
|
51
|
+
* });
|
|
52
|
+
*
|
|
47
53
|
* // Get contract address for a token
|
|
48
54
|
* const address = await service.getContractAddress('GWETH', 'ETHEREUM');
|
|
49
55
|
* console.log(`GWETH Ethereum address: ${address}`);
|
|
@@ -54,6 +60,30 @@ export declare class BridgeableTokenService {
|
|
|
54
60
|
private readonly logger;
|
|
55
61
|
private readonly cache;
|
|
56
62
|
constructor(dexApiHttp: HttpClient, debugMode?: boolean);
|
|
63
|
+
/**
|
|
64
|
+
* Resolve tokenId to symbol for cache/lookup operations.
|
|
65
|
+
*
|
|
66
|
+
* STRICT: Only accepts pipe-delimited strings or TokenClassKey objects.
|
|
67
|
+
* Simple strings like "GALA" are REJECTED.
|
|
68
|
+
*
|
|
69
|
+
* @param tokenId - Must be "collection|category|type|additionalKey" OR TokenClassKey object
|
|
70
|
+
* @returns Extracted token symbol (e.g., "GALA")
|
|
71
|
+
* @throws ValidationError if tokenId is invalid format (e.g., just "GALA")
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
74
|
+
* ```typescript
|
|
75
|
+
* // Pipe-delimited string
|
|
76
|
+
* resolveTokenSymbol('GALA|Unit|none|none') // → 'GALA'
|
|
77
|
+
* resolveTokenSymbol('Token|Unit|GWETH|eth:0x...') // → 'GWETH'
|
|
78
|
+
*
|
|
79
|
+
* // TokenClassKey object
|
|
80
|
+
* resolveTokenSymbol({ collection: 'Token', category: 'Unit', type: 'GALA', additionalKey: 'none' }) // → 'GALA'
|
|
81
|
+
*
|
|
82
|
+
* // Invalid - throws error
|
|
83
|
+
* resolveTokenSymbol('GALA') // ❌ ValidationError
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
private resolveTokenSymbol;
|
|
57
87
|
/**
|
|
58
88
|
* Fetch bridgeable tokens for a network with pagination
|
|
59
89
|
*
|
|
@@ -90,24 +120,61 @@ export declare class BridgeableTokenService {
|
|
|
90
120
|
*
|
|
91
121
|
* Uses cache for efficient lookup. If network not cached, fetches first.
|
|
92
122
|
*
|
|
93
|
-
* @param options - Token
|
|
123
|
+
* @param options - Token identifier and target network
|
|
94
124
|
* @returns Promise resolving to bridgeability result
|
|
125
|
+
*
|
|
126
|
+
* @example
|
|
127
|
+
* ```typescript
|
|
128
|
+
* // Pipe-delimited format (REQUIRED for strings)
|
|
129
|
+
* await service.isTokenBridgeableToNetwork({
|
|
130
|
+
* tokenId: 'GALA|Unit|none|none',
|
|
131
|
+
* network: 'ETHEREUM'
|
|
132
|
+
* });
|
|
133
|
+
*
|
|
134
|
+
* // TokenClassKey object format
|
|
135
|
+
* await service.isTokenBridgeableToNetwork({
|
|
136
|
+
* tokenId: { collection: 'Token', category: 'Unit', type: 'GALA', additionalKey: 'none' },
|
|
137
|
+
* network: 'SOLANA'
|
|
138
|
+
* });
|
|
139
|
+
* ```
|
|
95
140
|
*/
|
|
96
141
|
isTokenBridgeableToNetwork(options: IsTokenBridgeableOptions): Promise<IsTokenBridgeableResult>;
|
|
97
142
|
/**
|
|
98
143
|
* Convenience: Check if token is bridgeable to Ethereum
|
|
99
144
|
*
|
|
100
|
-
* @param
|
|
145
|
+
* @param tokenId - Token identifier (pipe-delimited string or TokenClassKey object)
|
|
101
146
|
* @returns Promise resolving to bridgeability result
|
|
147
|
+
*
|
|
148
|
+
* @example
|
|
149
|
+
* ```typescript
|
|
150
|
+
* // Pipe-delimited format
|
|
151
|
+
* await service.isTokenBridgeableToEthereum('GALA|Unit|none|none');
|
|
152
|
+
*
|
|
153
|
+
* // TokenClassKey object
|
|
154
|
+
* await service.isTokenBridgeableToEthereum({
|
|
155
|
+
* collection: 'Token', category: 'Unit', type: 'GWETH', additionalKey: 'eth:0x...'
|
|
156
|
+
* });
|
|
157
|
+
* ```
|
|
102
158
|
*/
|
|
103
|
-
isTokenBridgeableToEthereum(
|
|
159
|
+
isTokenBridgeableToEthereum(tokenId: TokenId): Promise<IsTokenBridgeableResult>;
|
|
104
160
|
/**
|
|
105
161
|
* Convenience: Check if token is bridgeable to Solana
|
|
106
162
|
*
|
|
107
|
-
* @param
|
|
163
|
+
* @param tokenId - Token identifier (pipe-delimited string or TokenClassKey object)
|
|
108
164
|
* @returns Promise resolving to bridgeability result
|
|
165
|
+
*
|
|
166
|
+
* @example
|
|
167
|
+
* ```typescript
|
|
168
|
+
* // Pipe-delimited format
|
|
169
|
+
* await service.isTokenBridgeableToSolana('GALA|Unit|none|none');
|
|
170
|
+
*
|
|
171
|
+
* // TokenClassKey object
|
|
172
|
+
* await service.isTokenBridgeableToSolana({
|
|
173
|
+
* collection: 'Token', category: 'Unit', type: 'GSOL', additionalKey: 'sol:...'
|
|
174
|
+
* });
|
|
175
|
+
* ```
|
|
109
176
|
*/
|
|
110
|
-
isTokenBridgeableToSolana(
|
|
177
|
+
isTokenBridgeableToSolana(tokenId: TokenId): Promise<IsTokenBridgeableResult>;
|
|
111
178
|
/**
|
|
112
179
|
* Get token by symbol from cache (or fetch if not cached)
|
|
113
180
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BridgeableTokenService.d.ts","sourceRoot":"","sources":["../../../src/services/BridgeableTokenService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;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AC9B,OAAO,EAAE,wBAAwB,GAChC,OAAO,CAAC,uBAAuB,CAAC;IA+BnC;;;;;;;;;;;;;;;;OAgBG;IACG,2BAA2B,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAIrF;;;;;;;;;;;;;;;;OAgBG;IACG,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAInF;;;;;;OAMG;IACG,gBAAgB,CACpB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAUvC;;;;;;OAMG;IACG,iBAAiB,CACrB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC;IAUvC;;;;;;OAMG;IACG,kBAAkB,CACtB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAS9B;;;;;OAKG;IACG,wBAAwB,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IAQ7E;;;;;OAKG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAS9B;;;;OAIG;IACH,aAAa,IAAI,UAAU,CAAC,oBAAoB,CAAC,UAAU,CAAC,CAAC;IAI7D;;;;OAIG;IACH,UAAU,CAAC,OAAO,CAAC,EAAE,iBAAiB,GAAG,IAAI;IAI7C;;;;;;OAMG;IACH,OAAO,CAAC,eAAe;CAuDxB"}
|
|
@@ -48,6 +48,13 @@ export interface AgentSDKConfig {
|
|
|
48
48
|
autoValidate?: boolean;
|
|
49
49
|
/** Additional SDK configuration options to merge with defaults (e.g., timeout, headers) */
|
|
50
50
|
config?: Partial<LaunchpadSDKConfig>;
|
|
51
|
+
/**
|
|
52
|
+
* Optional GalaChain address override.
|
|
53
|
+
* If not provided, reads from WALLET_ADDRESS env var.
|
|
54
|
+
* If neither is set, derives from wallet private key as eth|{address}.
|
|
55
|
+
* Use for non-standard addresses like 'client|ops-admin'.
|
|
56
|
+
*/
|
|
57
|
+
galaChainAddress?: string;
|
|
51
58
|
}
|
|
52
59
|
/**
|
|
53
60
|
* Setup validation result
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-config.d.ts","sourceRoot":"","sources":["../../../src/utils/agent-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAe,eAAe,EAAE,MAAM,UAAU,CAAC;AAExD;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG,YAAY,GAAG,aAAa,GAAG,SAAS,CAAC;AAExE;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,2DAA2D;IAC3D,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,GAAG,UAAU,CAAC;IACjC,+BAA+B;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2BAA2B;IAC3B,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,2FAA2F;IAC3F,MAAM,CAAC,EAAE,OAAO,CAAC,kBAAkB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"agent-config.d.ts","sourceRoot":"","sources":["../../../src/utils/agent-config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAe,eAAe,EAAE,MAAM,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AC3B,UAAU,CAAC,EAAE,eAAe,CAAC;KAC9B,CAAC;IAwCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmEG;WACU,aAAa,CAAC,MAAM,GAAE,OAAO,CAAC,cAAc,CAAM,GAAG,OAAO,CAAC;QACxE,GAAG,EAAE,YAAY,CAAC;QAClB,MAAM,EAAE,kBAAkB,CAAC;KAC5B,CAAC;IA8BF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAkCG;WACU,aAAa,CACxB,GAAG,EAAE,YAAY,EACjB,MAAM,CAAC,EAAE,eAAe,GACvB,OAAO,CAAC,eAAe,CAAC;IAyE3B;;;;;;;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,oBAAoB,CACzB,WAAW,EAAE,gBAAgB,EAC7B,OAAO,GAAE,SAAS,GAAG,UAAU,GAAG,YAAY,GAAG,SAAqB,GACrE,cAAc;IA4CjB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;WACU,gBAAgB,CAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EAC/B,WAAW,GAAE,gBAAgC,GAC5C,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAkBxC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAQhC,OAAO,CAAC,MAAM,CAAC,WAAW;IAoB1B,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAWhC,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAahC,OAAO,CAAC,MAAM,CAAC,sBAAsB;CAuBtC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gala-chain/launchpad-sdk",
|
|
3
|
-
"version": "4.0.15-beta.
|
|
3
|
+
"version": "4.0.15-beta.10",
|
|
4
4
|
"description": "TypeScript SDK for Gala Launchpad Backend API - 100+ public methods with 373+ fully documented APIs supporting optional wallet (read-only and full-access modes). Production-ready DeFi token launchpad integration with AgentConfig setup, GalaChain trading, GSwap DEX integration, price history, token creation, DEX pool discovery, WebSocket event watchers, and comprehensive user operations. Multi-format output (ESM, CJS, UMD).",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -64,6 +64,7 @@
|
|
|
64
64
|
"demo:cache": "tsx examples/utilities/demo-cache.ts",
|
|
65
65
|
"demo:utilities:balance": "tsx examples/utilities/balance.ts",
|
|
66
66
|
"demo:utilities:balances": "tsx examples/utilities/balances.ts",
|
|
67
|
+
"demo:utilities:key-derivation": "tsx examples/utilities/key-derivation.ts",
|
|
67
68
|
"demo:utilities:price-history": "tsx examples/utilities/price-history.ts",
|
|
68
69
|
"demo:dex": "tsx examples/dex/swap-workflow.ts",
|
|
69
70
|
"demo:dex:pools": "tsx examples/dex/pool-discovery.ts",
|