@gala-chain/launchpad-sdk 4.0.3 → 4.0.4-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/EXAMPLES.md +96 -35
- package/README.md +2 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/src/LaunchpadSDK.d.ts +750 -72
- package/dist/src/LaunchpadSDK.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/services/DexBackendClient.d.ts +139 -10
- package/dist/src/services/DexBackendClient.d.ts.map +1 -1
- package/dist/src/services/DexQuoteService.d.ts +181 -22
- package/dist/src/services/DexQuoteService.d.ts.map +1 -1
- package/dist/src/services/DexService.d.ts +274 -38
- package/dist/src/services/DexService.d.ts.map +1 -1
- package/dist/src/services/GSwapService.d.ts +555 -246
- package/dist/src/services/GSwapService.d.ts.map +1 -1
- package/dist/src/services/GalaChainGatewayClient.d.ts +139 -41
- package/dist/src/services/GalaChainGatewayClient.d.ts.map +1 -1
- package/dist/src/services/ImageService.d.ts +101 -12
- package/dist/src/services/ImageService.d.ts.map +1 -1
- package/dist/src/services/PoolCacheManager.d.ts +125 -31
- package/dist/src/services/PoolCacheManager.d.ts.map +1 -1
- package/dist/src/services/SignatureService.d.ts +35 -5
- package/dist/src/services/SignatureService.d.ts.map +1 -1
- package/dist/src/services/SwapEventQueue.d.ts +79 -10
- package/dist/src/services/SwapEventQueue.d.ts.map +1 -1
- package/dist/src/services/TokenClassKeyService.d.ts +56 -10
- package/dist/src/services/TokenClassKeyService.d.ts.map +1 -1
- package/dist/src/services/TokenMetadataService.d.ts +407 -31
- package/dist/src/services/TokenMetadataService.d.ts.map +1 -1
- package/dist/src/services/TradeService.d.ts +168 -6
- package/dist/src/services/TradeService.d.ts.map +1 -1
- package/dist/src/services/UserService.d.ts +117 -15
- package/dist/src/services/UserService.d.ts.map +1 -1
- package/package.json +12 -2
- package/API.md +0 -1475
|
@@ -36,11 +36,29 @@ import { GetTokenListOptions, UserTokenListResult, UpdateProfileData, UploadProf
|
|
|
36
36
|
export declare class UserService extends BaseService {
|
|
37
37
|
constructor(http: HttpClient, debugMode?: boolean);
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Fetch user profile information from launchpad backend
|
|
40
40
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
41
|
+
* Retrieves complete profile data including display name, avatar, token statistics,
|
|
42
|
+
* and social links. If no address is provided, fetches profile for the authenticated wallet.
|
|
43
|
+
*
|
|
44
|
+
* @param address Optional wallet address in eth|[40-hex-chars] format (defaults to SDK wallet)
|
|
45
|
+
* @returns Promise<any> User profile data including name, image, bio, and token stats
|
|
46
|
+
* @throws ValidationError if address format is invalid
|
|
47
|
+
* @category User Management
|
|
48
|
+
* @since 2.0.0
|
|
49
|
+
*
|
|
50
|
+
* @example Fetch authenticated user's profile
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const profile = await userService.fetchProfile();
|
|
53
|
+
* console.log('User:', profile.data.fullName);
|
|
54
|
+
* console.log('Avatar:', profile.data.profileImage);
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @example Fetch another user's profile
|
|
58
|
+
* ```typescript
|
|
59
|
+
* const otherProfile = await userService.fetchProfile('eth|1234567890abcdef...');
|
|
60
|
+
* console.log('User:', otherProfile.data.fullName);
|
|
61
|
+
* ```
|
|
44
62
|
*/
|
|
45
63
|
fetchProfile(address?: string): Promise<any>;
|
|
46
64
|
/**
|
|
@@ -66,26 +84,110 @@ export declare class UserService extends BaseService {
|
|
|
66
84
|
*/
|
|
67
85
|
uploadProfileImage(options: UploadProfileImageOptions): Promise<string>;
|
|
68
86
|
/**
|
|
69
|
-
*
|
|
87
|
+
* Fetch paginated token list for a user with filtering
|
|
70
88
|
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
89
|
+
* Queries user's token holdings or created tokens with optional search and pagination.
|
|
90
|
+
* Supports both exact tokenName matching (fast) and fuzzy search across all fields.
|
|
91
|
+
*
|
|
92
|
+
* @param options Filtering and pagination options (address, search, tokenName, type, page, limit)
|
|
93
|
+
* @returns Promise<UserTokenListResult> Paginated token list with metadata and navigation flags
|
|
94
|
+
* @throws ValidationError if pagination or filter parameters are invalid
|
|
95
|
+
* @category User Management
|
|
96
|
+
* @since 2.0.0
|
|
97
|
+
*
|
|
98
|
+
* @example Search user's token holdings
|
|
99
|
+
* ```typescript
|
|
100
|
+
* const tokens = await userService.fetchTokenList({
|
|
101
|
+
* address: 'eth|1234...',
|
|
102
|
+
* search: 'dragon',
|
|
103
|
+
* type: 'DEFI',
|
|
104
|
+
* page: 1,
|
|
105
|
+
* limit: 20
|
|
106
|
+
* });
|
|
107
|
+
* console.log(`Found ${tokens.total} matching tokens`);
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* @example Exact token lookup (fastest)
|
|
111
|
+
* ```typescript
|
|
112
|
+
* const result = await userService.fetchTokenList({
|
|
113
|
+
* tokenName: 'anime',
|
|
114
|
+
* limit: 1
|
|
115
|
+
* });
|
|
116
|
+
* // Reduces payload by ~99% vs search
|
|
117
|
+
* ```
|
|
74
118
|
*/
|
|
75
119
|
fetchTokenList(options: GetTokenListOptions): Promise<UserTokenListResult>;
|
|
76
120
|
/**
|
|
77
|
-
*
|
|
121
|
+
* Fetch tokens currently held by a user (non-zero balances)
|
|
78
122
|
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
123
|
+
* Retrieves all tokens where the user has a non-zero balance, with optional filtering.
|
|
124
|
+
* Useful for portfolio displays and wallet balance summaries. If no address is provided,
|
|
125
|
+
* defaults to the authenticated wallet.
|
|
126
|
+
*
|
|
127
|
+
* **Performance Tip**: Use exact tokenName match instead of search to reduce payload by ~99%.
|
|
128
|
+
*
|
|
129
|
+
* @param options Token held filtering options (address defaults to authenticated wallet)
|
|
130
|
+
* @returns Promise<UserTokenListResult> Paginated list of held tokens with balances
|
|
131
|
+
* @throws ValidationError if address format or pagination parameters are invalid
|
|
132
|
+
* @category User Management
|
|
133
|
+
* @since 2.0.0
|
|
134
|
+
*
|
|
135
|
+
* @example Get authenticated user's portfolio
|
|
136
|
+
* ```typescript
|
|
137
|
+
* const holdings = await userService.fetchTokensHeld({
|
|
138
|
+
* page: 1,
|
|
139
|
+
* limit: 50
|
|
140
|
+
* });
|
|
141
|
+
* console.log(`User holds ${holdings.total} different tokens`);
|
|
142
|
+
* holdings.tokens.forEach(token => {
|
|
143
|
+
* console.log(`${token.tokenName}: ${token.balance}`);
|
|
144
|
+
* });
|
|
145
|
+
* ```
|
|
146
|
+
*
|
|
147
|
+
* @example Check specific token balance
|
|
148
|
+
* ```typescript
|
|
149
|
+
* const result = await userService.fetchTokensHeld({
|
|
150
|
+
* tokenName: 'anime',
|
|
151
|
+
* limit: 1
|
|
152
|
+
* });
|
|
153
|
+
* const hasToken = result.tokens.length > 0;
|
|
154
|
+
* ```
|
|
82
155
|
*/
|
|
83
156
|
fetchTokensHeld(options: GetTokenListOptions): Promise<UserTokenListResult>;
|
|
84
157
|
/**
|
|
85
|
-
*
|
|
158
|
+
* Fetch tokens created by the authenticated user
|
|
159
|
+
*
|
|
160
|
+
* Retrieves all tokens launched by the currently authenticated wallet, with optional
|
|
161
|
+
* search filtering. Automatically uses the wallet address from SDK configuration.
|
|
162
|
+
*
|
|
163
|
+
* **Use Cases**: Creator dashboards, portfolio tracking, launch history
|
|
164
|
+
*
|
|
165
|
+
* @param options Pagination and search options (page, limit, search, tokenName)
|
|
166
|
+
* @returns Promise<UserTokenListResult> Paginated list of user-created tokens
|
|
167
|
+
* @throws ValidationError if wallet is not configured or pagination parameters invalid
|
|
168
|
+
* @category User Management
|
|
169
|
+
* @since 2.0.0
|
|
170
|
+
*
|
|
171
|
+
* @example Get all tokens created by user
|
|
172
|
+
* ```typescript
|
|
173
|
+
* const created = await userService.fetchTokensCreated({
|
|
174
|
+
* page: 1,
|
|
175
|
+
* limit: 20
|
|
176
|
+
* });
|
|
177
|
+
* console.log(`User created ${created.total} tokens`);
|
|
178
|
+
* created.tokens.forEach(token => {
|
|
179
|
+
* console.log(`${token.tokenName}: ${token.marketCap} market cap`);
|
|
180
|
+
* });
|
|
181
|
+
* ```
|
|
86
182
|
*
|
|
87
|
-
* @
|
|
88
|
-
*
|
|
183
|
+
* @example Search user's created tokens
|
|
184
|
+
* ```typescript
|
|
185
|
+
* const searchResult = await userService.fetchTokensCreated({
|
|
186
|
+
* search: 'dragon',
|
|
187
|
+
* limit: 10
|
|
188
|
+
* });
|
|
189
|
+
* console.log(`Found ${searchResult.tokens.length} tokens matching "dragon"`);
|
|
190
|
+
* ```
|
|
89
191
|
*/
|
|
90
192
|
fetchTokensCreated(options?: {
|
|
91
193
|
page?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../../src/services/UserService.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EACL,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EAEjB,yBAAyB,EAO1B,MAAM,mBAAmB,CAAC;AAQ3B;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,WAAY,SAAQ,WAAW;gBAC9B,IAAI,EAAE,UAAU,EAAE,SAAS,GAAE,OAAe;IAIxD
|
|
1
|
+
{"version":3,"file":"UserService.d.ts","sourceRoot":"","sources":["../../../src/services/UserService.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAU3C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EACL,mBAAmB,EACn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
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gala-chain/launchpad-sdk",
|
|
3
|
-
"version": "4.0.
|
|
4
|
-
"description": "TypeScript SDK for Gala Launchpad Backend API -
|
|
3
|
+
"version": "4.0.4-beta.1",
|
|
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",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -45,6 +45,13 @@
|
|
|
45
45
|
"demo:authenticated": "tsx examples/core/authenticated-operations.ts",
|
|
46
46
|
"demo:privatekey-override": "tsx examples/core/privatekey-override-pattern.ts",
|
|
47
47
|
"demo:trades": "tsx examples/bonding-curve/basic-trading.ts",
|
|
48
|
+
"demo:bonding:orchestrator": "tsx examples/bonding-curve/orchestrator.ts",
|
|
49
|
+
"demo:bonding:graduation": "tsx examples/bonding-curve/graduation-workflow.ts",
|
|
50
|
+
"demo:bonding:pool-discovery": "tsx examples/bonding-curve/pool-discovery.ts",
|
|
51
|
+
"demo:bonding:pool-analysis": "tsx examples/bonding-curve/pool-analysis.ts",
|
|
52
|
+
"demo:bonding:price-impact": "tsx examples/bonding-curve/price-impact.ts",
|
|
53
|
+
"demo:bonding:token-launch": "tsx examples/bonding-curve/token-launch.ts",
|
|
54
|
+
"demo:bonding:volume-trading": "tsx examples/bonding-curve/volume-trading.ts",
|
|
48
55
|
"demo:liquidity": "tsx examples/liquidity/positions-cli.ts",
|
|
49
56
|
"demo:liquidity:all": "tsx examples/liquidity/orchestrator.ts",
|
|
50
57
|
"demo:liquidity:detailed": "tsx examples/liquidity/detailed.ts",
|
|
@@ -55,6 +62,9 @@
|
|
|
55
62
|
"demo:liquidity:fetch-all": "tsx examples/liquidity/demo-fetch-all-positions.ts",
|
|
56
63
|
"demo:liquidity:positions-with-prices": "tsx examples/liquidity/demo-positions-with-chunked-pricing.ts",
|
|
57
64
|
"demo:cache": "tsx examples/utilities/demo-cache.ts",
|
|
65
|
+
"demo:utilities:balance": "tsx examples/utilities/balance.ts",
|
|
66
|
+
"demo:utilities:balances": "tsx examples/utilities/balances.ts",
|
|
67
|
+
"demo:utilities:price-history": "tsx examples/utilities/price-history.ts",
|
|
58
68
|
"demo:dex": "tsx examples/dex/swap-workflow.ts",
|
|
59
69
|
"demo:dex:pools": "tsx examples/dex/pool-discovery.ts",
|
|
60
70
|
"demo:dex:pricing": "tsx examples/dex/pools-with-pricing.ts",
|