@gala-chain/launchpad-sdk 3.22.6 → 3.23.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 +102 -0
- package/README.md +140 -4
- package/dist/LaunchpadSDK.d.ts +148 -2
- package/dist/LaunchpadSDK.d.ts.map +1 -1
- package/dist/api/LaunchpadAPI.d.ts +2 -0
- package/dist/api/LaunchpadAPI.d.ts.map +1 -1
- package/dist/auth/SignatureAuth.d.ts +27 -7
- package/dist/auth/SignatureAuth.d.ts.map +1 -1
- package/dist/auth/types.d.ts +2 -2
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/constants/counts.d.ts +69 -0
- package/dist/constants/counts.d.ts.map +1 -0
- package/dist/constants/version.generated.d.ts +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/schemas/launchpad.d.ts +2 -2
- package/dist/schemas/validators.d.ts +1 -1
- package/dist/services/GalaChainService.d.ts +2 -2
- package/dist/services/GalaChainService.d.ts.map +1 -1
- package/dist/types/transfer.dto.d.ts +2 -1
- package/dist/types/transfer.dto.d.ts.map +1 -1
- package/dist/utils/agent-config.d.ts +72 -0
- package/dist/utils/agent-config.d.ts.map +1 -1
- package/dist/utils/http.d.ts +5 -2
- package/dist/utils/http.d.ts.map +1 -1
- package/package.json +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,107 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 3.23.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- **BREAKING CHANGE:** Default environment changed from `development` to `production`
|
|
8
|
+
|
|
9
|
+
All SDK and MCP initialization now defaults to production environment
|
|
10
|
+
(`lpad-backend-prod1.defi.gala.com`) instead of development. To use development environment,
|
|
11
|
+
explicitly set `env: 'DEVELOPMENT'` or `ENVIRONMENT=development`.
|
|
12
|
+
|
|
13
|
+
Changes include:
|
|
14
|
+
- SDK `AgentConfig.detectEnvironment()` defaults to 'production'
|
|
15
|
+
- MCP Server environment defaults to 'production'
|
|
16
|
+
- All examples and documentation updated to show production as default
|
|
17
|
+
- All installation instructions updated accordingly
|
|
18
|
+
|
|
19
|
+
Users relying on implicit development environment must now explicitly set the environment
|
|
20
|
+
variable.
|
|
21
|
+
|
|
22
|
+
## 3.22.7
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Add comprehensive read-only operations example demonstrating SDK usage without wallet requirement.
|
|
27
|
+
Includes graceful degradation for production environments where pools may be unavailable.
|
|
28
|
+
|
|
29
|
+
## 3.23.0
|
|
30
|
+
|
|
31
|
+
### Minor Changes
|
|
32
|
+
|
|
33
|
+
- feat: Implement optional wallet support for read-only and full-access operational modes (59
|
|
34
|
+
methods across both modes)
|
|
35
|
+
|
|
36
|
+
## Overview
|
|
37
|
+
|
|
38
|
+
Wallet parameter is now optional in LaunchpadSDKConfig, enabling two distinct operational modes:
|
|
39
|
+
- **Read-Only Mode**: Query pools, prices, token details without wallet (30+ methods available)
|
|
40
|
+
- **Full-Access Mode**: Execute trades, create tokens, sign transactions with wallet (20+
|
|
41
|
+
additional methods)
|
|
42
|
+
|
|
43
|
+
## New Wallet Management Methods
|
|
44
|
+
- **`hasWallet(): boolean`** - Check if wallet is currently configured
|
|
45
|
+
- **`getWallet(): Wallet | null`** - Retrieve the configured wallet instance
|
|
46
|
+
- **`setWallet(wallet: string | Wallet): void`** - Configure wallet for signing operations
|
|
47
|
+
- **`validateWallet(): Wallet`** - Type guard that throws ValidationError if wallet required but
|
|
48
|
+
missing
|
|
49
|
+
|
|
50
|
+
## Key Features
|
|
51
|
+
- **Lazy Validation**: Wallet validation deferred to signing operations, not constructor
|
|
52
|
+
- **Progressive Enhancement**: Start with read-only, upgrade to full-access by calling
|
|
53
|
+
`setWallet()`
|
|
54
|
+
- **Smart HTTP Authentication**: HttpClient conditionally adds signature headers based on wallet
|
|
55
|
+
presence
|
|
56
|
+
- **AgentConfig Helpers**: New `readOnlySetup()` method for AI agents requiring data-only access
|
|
57
|
+
- **Type Safety**: `validateWallet()` enables TypeScript narrowing for wallet-dependent code paths
|
|
58
|
+
- **Backward Compatible**: Existing code with wallet parameter continues to work unchanged
|
|
59
|
+
|
|
60
|
+
## Configuration Examples
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
// Read-only mode - no wallet required
|
|
64
|
+
const sdk = createLaunchpadSDK({});
|
|
65
|
+
const pools = await sdk.fetchPools(); // Works!
|
|
66
|
+
await sdk.buyTokens('token'); // Throws: WALLET_REQUIRED
|
|
67
|
+
|
|
68
|
+
// Full-access mode - wallet provided
|
|
69
|
+
const sdk = createLaunchpadSDK({
|
|
70
|
+
wallet: process.env.PRIVATE_KEY,
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// Dynamic upgrade from read-only to full-access
|
|
74
|
+
const sdk = createLaunchpadSDK({});
|
|
75
|
+
sdk.setWallet(process.env.PRIVATE_KEY);
|
|
76
|
+
const wallet = sdk.validateWallet(); // Type: Wallet
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## AgentConfig Updates
|
|
80
|
+
- Added `readOnlySetup()` static method for AI agents
|
|
81
|
+
- Both full-access and read-only modes return identical validation objects
|
|
82
|
+
- Unified configuration interface across both modes
|
|
83
|
+
|
|
84
|
+
## Test Coverage
|
|
85
|
+
- Unit tests for optional wallet behavior (constructor, method validation, wallet switching)
|
|
86
|
+
- Integration tests for read-only mode operations (pool queries, price fetches)
|
|
87
|
+
- Integration tests for full-access mode with wallet operations (trades, transfers)
|
|
88
|
+
- 100+ new test cases covering all wallet scenarios
|
|
89
|
+
|
|
90
|
+
## Deprecations
|
|
91
|
+
- **`fetchLaunchpadTokenSpotPrice()`** - Deprecated in favor of `fetchTokenSpotPrice()`. The new
|
|
92
|
+
method provides smart routing and automatically handles both launchpad and DEX tokens. Will be
|
|
93
|
+
removed in v4.0.0.
|
|
94
|
+
|
|
95
|
+
Migration:
|
|
96
|
+
|
|
97
|
+
```typescript
|
|
98
|
+
// ❌ Old way (deprecated)
|
|
99
|
+
const price = await sdk.fetchLaunchpadTokenSpotPrice('galadog');
|
|
100
|
+
|
|
101
|
+
// ✅ New way (recommended)
|
|
102
|
+
const price = await sdk.fetchTokenSpotPrice({ tokenName: 'galadog' });
|
|
103
|
+
```
|
|
104
|
+
|
|
3
105
|
## 3.22.5
|
|
4
106
|
|
|
5
107
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -168,23 +168,158 @@ Node.js automatically selects the correct module format based on your project:
|
|
|
168
168
|
|
|
169
169
|
**No configuration needed** - Node.js and bundlers automatically select the optimal format via the package exports field!
|
|
170
170
|
|
|
171
|
+
## Wallet Configuration Modes
|
|
172
|
+
|
|
173
|
+
The SDK supports **two operational modes** with optional wallet configuration:
|
|
174
|
+
|
|
175
|
+
### Full-Access Mode (with Wallet)
|
|
176
|
+
|
|
177
|
+
**For executing trades, creating tokens, and managing funds:**
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
181
|
+
|
|
182
|
+
// Initialize with wallet - enables signing operations
|
|
183
|
+
const sdk = createLaunchpadSDK({
|
|
184
|
+
wallet: 'your-private-key-or-mnemonic'
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
// Now you can execute trades
|
|
188
|
+
const result = await sdk.buy({
|
|
189
|
+
tokenName: 'anime',
|
|
190
|
+
amount: '100',
|
|
191
|
+
type: 'native',
|
|
192
|
+
slippageToleranceFactor: 0.01
|
|
193
|
+
});
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
**Capabilities:**
|
|
197
|
+
- ✅ Execute token trades (buy/sell)
|
|
198
|
+
- ✅ Create new tokens
|
|
199
|
+
- ✅ Transfer GALA and tokens
|
|
200
|
+
- ✅ Update user profile
|
|
201
|
+
- ✅ Post comments
|
|
202
|
+
- ✅ All read operations (fetch pools, prices, etc.)
|
|
203
|
+
|
|
204
|
+
### Read-Only Mode (without Wallet)
|
|
205
|
+
|
|
206
|
+
**For querying data without wallet authentication:**
|
|
207
|
+
|
|
208
|
+
```typescript
|
|
209
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
210
|
+
|
|
211
|
+
// Initialize without wallet - read-only operations only
|
|
212
|
+
const sdk = createLaunchpadSDK({});
|
|
213
|
+
|
|
214
|
+
// Query operations work fine
|
|
215
|
+
const pools = await sdk.fetchPools({ type: 'recent' });
|
|
216
|
+
const prices = await sdk.fetchTokenSpotPrice('anime');
|
|
217
|
+
const balance = await sdk.fetchGalaBalance();
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**Capabilities:**
|
|
221
|
+
- ✅ Fetch token pools and details
|
|
222
|
+
- ✅ Get real-time prices and price history
|
|
223
|
+
- ✅ Check balances and portfolio
|
|
224
|
+
- ✅ Browse comments and token information
|
|
225
|
+
- ✅ Explore token metadata and distributions
|
|
226
|
+
- ❌ Cannot: Execute trades, create tokens, transfer funds (require signatures)
|
|
227
|
+
|
|
228
|
+
### Dynamic Wallet Configuration
|
|
229
|
+
|
|
230
|
+
**Upgrade from read-only to full-access mode at runtime:**
|
|
231
|
+
|
|
232
|
+
```typescript
|
|
233
|
+
import { createLaunchpadSDK } from '@gala-chain/launchpad-sdk';
|
|
234
|
+
|
|
235
|
+
// Start in read-only mode
|
|
236
|
+
const sdk = createLaunchpadSDK({});
|
|
237
|
+
console.log(sdk.hasWallet()); // false
|
|
238
|
+
|
|
239
|
+
// Later, upgrade to full-access
|
|
240
|
+
sdk.setWallet('your-private-key-or-mnemonic');
|
|
241
|
+
console.log(sdk.hasWallet()); // true
|
|
242
|
+
|
|
243
|
+
// Now signing operations work
|
|
244
|
+
const result = await sdk.buy({
|
|
245
|
+
tokenName: 'anime',
|
|
246
|
+
amount: '100',
|
|
247
|
+
type: 'native',
|
|
248
|
+
slippageToleranceFactor: 0.01
|
|
249
|
+
});
|
|
250
|
+
```
|
|
251
|
+
|
|
252
|
+
**Wallet Management Methods:**
|
|
253
|
+
- `hasWallet()` - Check if wallet is configured
|
|
254
|
+
- `getWallet()` - Retrieve current wallet instance
|
|
255
|
+
- `setWallet(wallet)` - Configure wallet for signing operations
|
|
256
|
+
- `validateWallet()` - Type guard that throws if wallet not present
|
|
257
|
+
|
|
258
|
+
### Method Categorization: Wallet Requirements
|
|
259
|
+
|
|
260
|
+
**Methods that DON'T require a wallet (Read-Only Operations):**
|
|
261
|
+
|
|
262
|
+
| Category | Methods | Notes |
|
|
263
|
+
|----------|---------|-------|
|
|
264
|
+
| **Pool Queries** | `fetchPools`, `fetchAllPools`, `fetchPoolDetails`, `fetchPoolDetailsForCalculation`, `isTokenGraduated`, `isTokenNameAvailable`, `isTokenSymbolAvailable` | Query pool data and token availability |
|
|
265
|
+
| **Token Data** | `fetchTokenDetails`, `fetchTokenDistribution`, `fetchTokenBadges` | Get token metadata and holder information |
|
|
266
|
+
| **Pricing** | `fetchTokenSpotPrice`, `fetchGalaSpotPrice`, `fetchLaunchpadTokenSpotPrice`, `fetchVolumeData` | Get current prices and OHLCV data |
|
|
267
|
+
| **Price History** | `fetchPriceHistory`, `fetchAllPriceHistory` | Get historical price snapshots (Node.js only) |
|
|
268
|
+
| **Balance Info** | `fetchGalaBalance`, `fetchTokenBalance` | Check GALA and token balances (your own only) |
|
|
269
|
+
| **Portfolio** | `fetchTokensHeld`, `fetchTokensCreated` | View your token portfolio and created tokens |
|
|
270
|
+
| **Profile** | `fetchProfile` | Retrieve user profile information |
|
|
271
|
+
| **Comments** | `fetchComments` | View comments on token pools |
|
|
272
|
+
| **Trade History** | `fetchTrades` | View your past trades |
|
|
273
|
+
| **Utilities** | `getAddress`, `getEthereumAddress`, `getConfig`, `getVersion`, `getUrlByTokenName`, `getCacheInfo`, `clearCache`, `cleanup`, `cleanupAll` | Utility and configuration methods |
|
|
274
|
+
| **Reference** | `resolveTokenClassKey`, `resolveVaultAddress`, `calculateInitialBuyAmount` | Resolve IDs and get reference data |
|
|
275
|
+
|
|
276
|
+
**Methods that REQUIRE a wallet (Signing Operations):**
|
|
277
|
+
|
|
278
|
+
| Category | Methods | Error When Missing |
|
|
279
|
+
|----------|---------|-------------------|
|
|
280
|
+
| **Trading** | `buy`, `sell`, `calculateBuyAmount`, `calculateSellAmount`, `calculateBuyAmountLocal`, `calculateBuyAmountExternal`, `calculateSellAmountLocal`, `calculateSellAmountExternal` | `ValidationError: Wallet is required` |
|
|
281
|
+
| **Token Creation** | `launchToken`, `uploadTokenImage`, `uploadProfileImage`, `calculateBuyAmountForGraduation`, `graduateToken` | `ValidationError: Wallet is required` |
|
|
282
|
+
| **Account Management** | `updateProfile`, `postComment` | `ValidationError: Wallet is required` |
|
|
283
|
+
| **Transfers** | `transferGala`, `transferToken` | `ValidationError: Wallet is required` |
|
|
284
|
+
| **Admin** | `getBundlerTransactionResult` | May require wallet for certain operations |
|
|
285
|
+
|
|
286
|
+
**Key Points:**
|
|
287
|
+
- ✅ All read operations work in **read-only mode** without a wallet
|
|
288
|
+
- ✅ Wallet can be added later via `setWallet()` to enable signing operations
|
|
289
|
+
- ✅ Missing wallet throws `ValidationError` with code `WALLET_REQUIRED`
|
|
290
|
+
- ⚠️ Only methods that sign transactions require a wallet
|
|
291
|
+
|
|
171
292
|
## AI Agent Integration
|
|
172
293
|
|
|
173
294
|
### For Claude Desktop Users
|
|
174
295
|
|
|
175
296
|
Install the MCP server to enable Claude to interact with Gala Launchpad directly:
|
|
176
297
|
|
|
298
|
+
**Full-Access Mode** (with wallet for executing trades):
|
|
177
299
|
```bash
|
|
178
300
|
claude mcp add "galachain-launchpad" -- env PRIVATE_KEY=<YOUR_PRIVATE_KEY> ENVIRONMENT=development npx -y @gala-chain/launchpad-mcp-server@latest
|
|
179
301
|
```
|
|
180
302
|
|
|
303
|
+
**Read-Only Mode** (query data without wallet):
|
|
304
|
+
```bash
|
|
305
|
+
claude mcp add "galachain-launchpad-readonly" -- env ENVIRONMENT=development npx -y @gala-chain/launchpad-mcp-server@latest
|
|
306
|
+
```
|
|
307
|
+
|
|
181
308
|
**Environment Variables:**
|
|
182
|
-
- `PRIVATE_KEY` - Your wallet private key (
|
|
183
|
-
- `ENVIRONMENT` - Backend environment: `development` | `production` (default:
|
|
309
|
+
- `PRIVATE_KEY` (optional) - Your wallet private key (omit for read-only mode)
|
|
310
|
+
- `ENVIRONMENT` - Backend environment: `development` | `production` (default: production)
|
|
184
311
|
- `DEBUG` - Enable debug logging: `true` | `false` (default: false)
|
|
185
312
|
- `TIMEOUT` - Request timeout in milliseconds (default: 30000)
|
|
186
313
|
|
|
187
|
-
**Features**:
|
|
314
|
+
**Features**: 57 tools for complete Gala Launchpad operations including:
|
|
315
|
+
- Pool management, pricing, and token discovery
|
|
316
|
+
- Token trading with slippage protection
|
|
317
|
+
- Token creation and management
|
|
318
|
+
- Balance and portfolio queries
|
|
319
|
+
- Wallet status checking and configuration
|
|
320
|
+
- Price history and analysis (Node.js only)
|
|
321
|
+
- Comments and social features
|
|
322
|
+
- Transfers and transactions
|
|
188
323
|
|
|
189
324
|
See: [MCP Server Documentation](../../mcp-server/README.md)
|
|
190
325
|
|
|
@@ -200,7 +335,8 @@ See: [MCP Server Documentation](../../mcp-server/README.md)
|
|
|
200
335
|
Need help with SDK integration, trading bots, or MCP server development?
|
|
201
336
|
|
|
202
337
|
Ask **[@agent-galachain-launchpad-developer](../../@agent-galachain-launchpad-developer.md)** - a specialized AI agent with expertise in:
|
|
203
|
-
- Complete SDK API (
|
|
338
|
+
- Complete SDK API (59 methods)
|
|
339
|
+
- Optional wallet configuration and dual operational modes
|
|
204
340
|
- Trading patterns and DeFi best practices
|
|
205
341
|
- MCP server architecture
|
|
206
342
|
- Error handling strategies
|
package/dist/LaunchpadSDK.d.ts
CHANGED
|
@@ -40,8 +40,14 @@ import { FetchPriceHistoryOptions, PriceHistoryResult } from './types/priceHisto
|
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
42
42
|
export interface LaunchpadSDKConfig extends SDKConfig {
|
|
43
|
-
/**
|
|
44
|
-
|
|
43
|
+
/**
|
|
44
|
+
* The ethers wallet for authentication (optional)
|
|
45
|
+
* - Required for: Trading (buy/sell), transfers, token creation, profile updates, comments
|
|
46
|
+
* - Optional for: Pool queries, price fetches, balance checks, calculations, metadata retrieval
|
|
47
|
+
*
|
|
48
|
+
* If not provided, SDK operates in read-only mode. Call setWallet() later to enable signing operations.
|
|
49
|
+
*/
|
|
50
|
+
wallet: Wallet | undefined;
|
|
45
51
|
/** Optional GalaChain gateway URL override - defaults based on main API environment */
|
|
46
52
|
galaChainBaseUrl?: string;
|
|
47
53
|
/** Optional Bundle service URL override - defaults based on main API environment */
|
|
@@ -135,6 +141,7 @@ export declare class LaunchpadSDK {
|
|
|
135
141
|
static readonly DEFAULT_LAUNCHPAD_TOKEN_MAX_SUPPLY = 10000000;
|
|
136
142
|
/** Default calculation mode for all amount calculations - 'local' for instant client-side bonding curve calculations */
|
|
137
143
|
static readonly DEFAULT_CALCULATE_AMOUNT_MODE: 'local' | 'external';
|
|
144
|
+
private wallet;
|
|
138
145
|
private readonly auth;
|
|
139
146
|
private readonly http;
|
|
140
147
|
private readonly galaChainHttp;
|
|
@@ -177,6 +184,7 @@ export declare class LaunchpadSDK {
|
|
|
177
184
|
* @category Address Management
|
|
178
185
|
* @returns The address in eth|{40-hex-chars} format required by the backend
|
|
179
186
|
* @since 1.0.0
|
|
187
|
+
* @throws ValidationError if wallet is not configured
|
|
180
188
|
*
|
|
181
189
|
* @example Get backend address format
|
|
182
190
|
* ```typescript
|
|
@@ -207,6 +215,7 @@ export declare class LaunchpadSDK {
|
|
|
207
215
|
* @category Address Management
|
|
208
216
|
* @returns Standard Ethereum address with 0x prefix
|
|
209
217
|
* @since 1.0.0
|
|
218
|
+
* @throws ValidationError if wallet is not configured
|
|
210
219
|
*
|
|
211
220
|
* @example Display user address
|
|
212
221
|
* ```typescript
|
|
@@ -229,6 +238,141 @@ export declare class LaunchpadSDK {
|
|
|
229
238
|
* @see {@link getAddress} - Get backend-compatible address format
|
|
230
239
|
*/
|
|
231
240
|
getEthereumAddress(): string;
|
|
241
|
+
/**
|
|
242
|
+
* Type guard that validates a wallet is configured
|
|
243
|
+
*
|
|
244
|
+
* Throws a ValidationError if the SDK is not configured with a wallet.
|
|
245
|
+
* Use this method to ensure wallet-dependent operations can proceed safely.
|
|
246
|
+
*
|
|
247
|
+
* @category Wallet Management
|
|
248
|
+
* @returns The configured wallet
|
|
249
|
+
* @throws ValidationError if no wallet is configured
|
|
250
|
+
* @since 3.23.0
|
|
251
|
+
*
|
|
252
|
+
* @example Validate wallet before trading
|
|
253
|
+
* ```typescript
|
|
254
|
+
* const sdk = createLaunchpadSDK({}); // No wallet
|
|
255
|
+
*
|
|
256
|
+
* try {
|
|
257
|
+
* sdk.validateWallet(); // Throws ValidationError
|
|
258
|
+
* } catch (error) {
|
|
259
|
+
* console.log('Wallet required for trading operations');
|
|
260
|
+
* }
|
|
261
|
+
* ```
|
|
262
|
+
*
|
|
263
|
+
* @example Use in async function
|
|
264
|
+
* ```typescript
|
|
265
|
+
* async function buyTokens(amount: string) {
|
|
266
|
+
* const wallet = sdk.validateWallet(); // Throws if not configured
|
|
267
|
+
* const result = await sdk.buyTokens('token', amount, 'native', 0.05);
|
|
268
|
+
* return result;
|
|
269
|
+
* }
|
|
270
|
+
* ```
|
|
271
|
+
*/
|
|
272
|
+
validateWallet(): Wallet;
|
|
273
|
+
/**
|
|
274
|
+
* Sets or updates the wallet for the SDK
|
|
275
|
+
*
|
|
276
|
+
* Allows dynamic wallet configuration after SDK initialization.
|
|
277
|
+
* Useful for switching between different wallets or upgrading from read-only to signing mode.
|
|
278
|
+
*
|
|
279
|
+
* @category Wallet Management
|
|
280
|
+
* @param wallet - The new wallet to configure
|
|
281
|
+
* @throws ValidationError if wallet is invalid
|
|
282
|
+
* @since 3.23.0
|
|
283
|
+
*
|
|
284
|
+
* @example Set wallet after initialization
|
|
285
|
+
* ```typescript
|
|
286
|
+
* const sdk = createLaunchpadSDK({}); // Start in read-only mode
|
|
287
|
+
*
|
|
288
|
+
* // Later, when user authenticates...
|
|
289
|
+
* const userWallet = new ethers.Wallet(process.env.PRIVATE_KEY);
|
|
290
|
+
* sdk.setWallet(userWallet);
|
|
291
|
+
*
|
|
292
|
+
* // Now trading operations are available
|
|
293
|
+
* const result = await sdk.buyTokens('anime', '10', 'native', 0.05);
|
|
294
|
+
* ```
|
|
295
|
+
*
|
|
296
|
+
* @example Switch wallets
|
|
297
|
+
* ```typescript
|
|
298
|
+
* const wallet1 = new ethers.Wallet(key1);
|
|
299
|
+
* sdk.setWallet(wallet1);
|
|
300
|
+
* await sdk.buyTokens('token', '100', 'native', 0.05);
|
|
301
|
+
*
|
|
302
|
+
* // Switch to different wallet
|
|
303
|
+
* const wallet2 = new ethers.Wallet(key2);
|
|
304
|
+
* sdk.setWallet(wallet2);
|
|
305
|
+
* await sdk.buyTokens('token', '50', 'native', 0.05);
|
|
306
|
+
* ```
|
|
307
|
+
*/
|
|
308
|
+
setWallet(wallet: Wallet): void;
|
|
309
|
+
/**
|
|
310
|
+
* Gets the currently configured wallet
|
|
311
|
+
*
|
|
312
|
+
* Returns the wallet if configured, or undefined if in read-only mode.
|
|
313
|
+
*
|
|
314
|
+
* @category Wallet Management
|
|
315
|
+
* @returns The configured wallet, or undefined if not set
|
|
316
|
+
* @since 3.23.0
|
|
317
|
+
*
|
|
318
|
+
* @example Check wallet and get address
|
|
319
|
+
* ```typescript
|
|
320
|
+
* const wallet = sdk.getWallet();
|
|
321
|
+
* if (wallet) {
|
|
322
|
+
* console.log('Authenticated as:', wallet.address);
|
|
323
|
+
* } else {
|
|
324
|
+
* console.log('Running in read-only mode');
|
|
325
|
+
* }
|
|
326
|
+
* ```
|
|
327
|
+
*
|
|
328
|
+
* @example Conditionally perform operations
|
|
329
|
+
* ```typescript
|
|
330
|
+
* const wallet = sdk.getWallet();
|
|
331
|
+
*
|
|
332
|
+
* if (wallet) {
|
|
333
|
+
* // Perform authenticated operations
|
|
334
|
+
* await sdk.buyTokens('anime', '10', 'native', 0.05);
|
|
335
|
+
* } else {
|
|
336
|
+
* // Perform read-only operations only
|
|
337
|
+
* const pools = await sdk.fetchPools();
|
|
338
|
+
* const price = await sdk.fetchTokenSpotPrice('anime');
|
|
339
|
+
* }
|
|
340
|
+
* ```
|
|
341
|
+
*/
|
|
342
|
+
getWallet(): Wallet | undefined;
|
|
343
|
+
/**
|
|
344
|
+
* Checks if a wallet is configured
|
|
345
|
+
*
|
|
346
|
+
* Useful for conditionally enabling trading operations in UI
|
|
347
|
+
* or determining which operations are available.
|
|
348
|
+
*
|
|
349
|
+
* @category Wallet Management
|
|
350
|
+
* @returns true if wallet is configured, false otherwise
|
|
351
|
+
* @since 3.23.0
|
|
352
|
+
*
|
|
353
|
+
* @example Enable/disable trading UI
|
|
354
|
+
* ```typescript
|
|
355
|
+
* if (sdk.hasWallet()) {
|
|
356
|
+
* // Show trading interface
|
|
357
|
+
* renderTradingPanel();
|
|
358
|
+
* } else {
|
|
359
|
+
* // Show connect wallet prompt
|
|
360
|
+
* renderConnectWalletPrompt();
|
|
361
|
+
* }
|
|
362
|
+
* ```
|
|
363
|
+
*
|
|
364
|
+
* @example Graceful fallback
|
|
365
|
+
* ```typescript
|
|
366
|
+
* async function buyOrAlert(tokenName: string) {
|
|
367
|
+
* if (!sdk.hasWallet()) {
|
|
368
|
+
* alert('Please connect wallet to trade');
|
|
369
|
+
* return;
|
|
370
|
+
* }
|
|
371
|
+
* return await sdk.buyTokens(tokenName, '10', 'native', 0.05);
|
|
372
|
+
* }
|
|
373
|
+
* ```
|
|
374
|
+
*/
|
|
375
|
+
hasWallet(): boolean;
|
|
232
376
|
/**
|
|
233
377
|
* Gets the current SDK configuration
|
|
234
378
|
*
|
|
@@ -517,6 +661,8 @@ export declare class LaunchpadSDK {
|
|
|
517
661
|
* @param tokenNameOrOptions Token name string OR FetchLaunchpadTokenSpotPriceOptions object
|
|
518
662
|
* @returns Promise<TokenSpotPrice> Spot price with symbol and USD price
|
|
519
663
|
*
|
|
664
|
+
* @deprecated Use {@link fetchTokenSpotPrice} instead - provides smart routing for both launchpad and DEX tokens
|
|
665
|
+
*
|
|
520
666
|
* @example Use the new smart router instead
|
|
521
667
|
* ```typescript
|
|
522
668
|
* // ❌ OLD (deprecated)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LaunchpadSDK.d.ts","sourceRoot":"","sources":["../src/LaunchpadSDK.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKhC,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAclF,OAAO,EAAwB,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,iBAAiB,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC/H,OAAO,EAAE,iBAAiB,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,kBAAkB,CAAC;AAC1G,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAC3E,OAAO,EACL,iBAAiB,EACjB,WAAW,EAEZ,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,sBAAsB,EACvB,MAAM,0BAA0B,CAAC;AAmBlC,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,sBAAsB,GACvB,CAAC;AACF,OAAO,EACL,oBAAoB,EACpB,kBAAkB,EAClB,sBAAsB,EACtB,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC1B,8BAA8B,EAC9B,+BAA+B,EAC/B,eAAe,EACf,gBAAgB,EAChB,6BAA6B,EAC7B,sBAAsB,EACtB,yBAAyB,EACzB,oBAAoB,EACpB,mCAAmC,EAC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;;;;;;;;;OAqBG;IACG,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,CAAC;IAqB7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAiCG;IACG,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;IAQrE;;;;;OAKG;IACG,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAIpE;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,YAAY,IAAI;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,SAAS,EAAE,MAAM,CAAC;QAClB,WAAW,EAAE,MAAM,CAAC;KACrB;IAID;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,UAAU,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;IAQpC;;;OAGG;IACH,OAAO,CAAC,qBAAqB;IAuD7B;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IASpC;;;OAGG;IACH,OAAO,CAAC,sBAAsB;IAS9B;;;OAGG;YACW,yBAAyB;IAOvC;;;;;;;OAOG;YACW,mBAAmB;IAuDjC;;;;;;;;;OASG;YACW,kBAAkB;IA0BhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAmB9B;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH,MAAM,CAAC,UAAU,CAAC,KAAK,GAAE,OAAe,GAAG,IAAI;CAUhD"}
|
|
@@ -816,6 +816,8 @@ export declare class LaunchpadAPI {
|
|
|
816
816
|
* @param tokenNameOrOptions Token name string OR FetchLaunchpadTokenSpotPriceOptions object
|
|
817
817
|
* @returns Promise<TokenSpotPrice> Spot price with symbol and USD price
|
|
818
818
|
*
|
|
819
|
+
* @deprecated Use {@link DexService.fetchTokenSpotPrice} instead - provides smart routing for both launchpad and DEX tokens
|
|
820
|
+
*
|
|
819
821
|
* @example Legacy string usage
|
|
820
822
|
* ```typescript
|
|
821
823
|
* const price = await launchpadAPI.fetchLaunchpadTokenSpotPrice('dragnrkti');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LaunchpadAPI.d.ts","sourceRoot":"","sources":["../../src/api/LaunchpadAPI.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAIzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAqBxE,OAAO,EAEL,gBAAgB,EAGhB,WAAW,EAGX,uBAAuB,EACvB,gBAAgB,EAIhB,eAAe,EAEf,uBAAuB,EACvB,eAAe,EAKf,iBAAiB,EAMjB,cAAc,EAEf,MAAM,wBAAwB,CAAC;AAIhC,OAAO,EACL,oBAAoB,EAIrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,sBAAsB,EACtB,yBAAyB,EACzB,0BAA0B,EAC1B,8BAA8B,EAC9B,+BAA+B,EAC/B,oBAAoB,EACpB,6BAA6B,EAE7B,mCAAmC,EACnC,sCAAsC,EAGvC,MAAM,sBAAsB,CAAC;AAI9B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,qBAAa,YAAY;IAIrB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;IAC5B,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAC;IAC/B,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC;IAC5B,OAAO,CAAC,QAAQ,CAAC,0BAA0B;IAT7C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAqB;gBAGhC,IAAI,EAAE,UAAU,EAChB,aAAa,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCG;IACI,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC,OAAO,gCAAgC,EAAE,aAAa,CAAC,GAAG,IAAI;IAIhI;;;;;;;;;;;;;;;;;;;OAmBG;IACI,aAAa,IAAI,OAAO,gCAAgC,EAAE,UAAU;IAI3E;;;;;;;;;;;;;;;;;;;;OAoBG;IACI,UAAU,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI;CAI5C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Wallet } from 'ethers';
|
|
1
2
|
import { AuthConfig, SignatureResult } from './types';
|
|
2
3
|
import type { EIP712Domain, EIP712Types } from '../types/trade.dto.js';
|
|
3
4
|
/**
|
|
@@ -5,11 +6,28 @@ import type { EIP712Domain, EIP712Types } from '../types/trade.dto.js';
|
|
|
5
6
|
*
|
|
6
7
|
* This class generates signatures that are used in the `Sign` header
|
|
7
8
|
* for authenticating requests to the backend API.
|
|
9
|
+
*
|
|
10
|
+
* Supports optional wallet configuration for read-only operations.
|
|
8
11
|
*/
|
|
9
12
|
export declare class SignatureAuth {
|
|
10
|
-
private
|
|
13
|
+
private wallet;
|
|
11
14
|
private readonly messagePrefix;
|
|
12
15
|
constructor(config: AuthConfig);
|
|
16
|
+
/**
|
|
17
|
+
* Checks if a wallet is configured
|
|
18
|
+
*
|
|
19
|
+
* @returns true if wallet is configured, false otherwise
|
|
20
|
+
*/
|
|
21
|
+
hasWallet(): boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Sets or updates the wallet
|
|
24
|
+
*
|
|
25
|
+
* Allows dynamic wallet configuration after initialization.
|
|
26
|
+
*
|
|
27
|
+
* @param wallet The new wallet to configure
|
|
28
|
+
* @throws AuthError if wallet is invalid
|
|
29
|
+
*/
|
|
30
|
+
setWallet(wallet: Wallet | undefined): void;
|
|
13
31
|
/**
|
|
14
32
|
* Generates a signature for the current timestamp
|
|
15
33
|
*
|
|
@@ -17,26 +35,28 @@ export declare class SignatureAuth {
|
|
|
17
35
|
* This signature is used in the `Sign` header for API authentication.
|
|
18
36
|
*
|
|
19
37
|
* @returns Promise<SignatureResult> The signature data
|
|
20
|
-
* @throws AuthError If signature generation fails
|
|
38
|
+
* @throws AuthError If signature generation fails or wallet is not configured
|
|
21
39
|
*/
|
|
22
40
|
generateSignature(): Promise<SignatureResult>;
|
|
23
41
|
/**
|
|
24
42
|
* Gets the wallet address in the required eth|{address} format
|
|
25
43
|
*
|
|
26
44
|
* @returns The formatted address
|
|
45
|
+
* @throws AuthError if wallet is not configured
|
|
27
46
|
*/
|
|
28
47
|
getAddress(): string;
|
|
29
48
|
/**
|
|
30
49
|
* Gets the raw Ethereum wallet address (0x prefixed)
|
|
31
50
|
*
|
|
32
51
|
* @returns The Ethereum address with 0x prefix
|
|
52
|
+
* @throws AuthError if wallet is not configured
|
|
33
53
|
*/
|
|
34
54
|
getEthereumAddress(): string;
|
|
35
55
|
/**
|
|
36
56
|
* Gets the wallet's private key for @gala-chain signing operations
|
|
37
57
|
*
|
|
38
58
|
* @returns The wallet's private key (0x prefixed)
|
|
39
|
-
* @throws AuthError If private key is not available
|
|
59
|
+
* @throws AuthError If wallet is not configured or private key is not available
|
|
40
60
|
*/
|
|
41
61
|
getPrivateKey(): string;
|
|
42
62
|
/**
|
|
@@ -51,7 +71,7 @@ export declare class SignatureAuth {
|
|
|
51
71
|
*
|
|
52
72
|
* @param message The message to sign
|
|
53
73
|
* @returns Promise<SignatureResult> The signature data with Ethereum addresses
|
|
54
|
-
* @throws AuthError If signature generation fails
|
|
74
|
+
* @throws AuthError If signature generation fails or wallet is not configured
|
|
55
75
|
*/
|
|
56
76
|
signMessage(message: string): Promise<SignatureResult>;
|
|
57
77
|
/**
|
|
@@ -60,7 +80,7 @@ export declare class SignatureAuth {
|
|
|
60
80
|
* @param url The request URL path
|
|
61
81
|
* @param method The HTTP method
|
|
62
82
|
* @returns Promise<Record<string, string>> Authentication headers
|
|
63
|
-
* @throws AuthError If header generation fails
|
|
83
|
+
* @throws AuthError If header generation fails or wallet is not configured
|
|
64
84
|
*/
|
|
65
85
|
generateAuthHeaders(url: string, method: string): Promise<Record<string, string>>;
|
|
66
86
|
/**
|
|
@@ -70,7 +90,7 @@ export declare class SignatureAuth {
|
|
|
70
90
|
* @param types The EIP-712 types
|
|
71
91
|
* @param message The message to sign
|
|
72
92
|
* @returns Promise<string> The signature
|
|
73
|
-
* @throws AuthError If signature generation fails
|
|
93
|
+
* @throws AuthError If signature generation fails or wallet is not configured
|
|
74
94
|
*/
|
|
75
95
|
signTypedData(domain: EIP712Domain, types: EIP712Types, message: Record<string, unknown>): Promise<string>;
|
|
76
96
|
/**
|
|
@@ -81,7 +101,7 @@ export declare class SignatureAuth {
|
|
|
81
101
|
*
|
|
82
102
|
* @param message The custom message to sign
|
|
83
103
|
* @returns Promise<SignatureResult> The signature data
|
|
84
|
-
* @throws AuthError If signature generation fails
|
|
104
|
+
* @throws AuthError If signature generation fails or wallet is not configured
|
|
85
105
|
*
|
|
86
106
|
* @example
|
|
87
107
|
* ```typescript
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureAuth.d.ts","sourceRoot":"","sources":["../../src/auth/SignatureAuth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SignatureAuth.d.ts","sourceRoot":"","sources":["../../src/auth/SignatureAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,eAAe,EAA4B,MAAM,SAAS,CAAC;AAChF,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEvE;;;;;;;GAOG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,MAAM,CAAqB;IACnC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;gBAE3B,MAAM,EAAE,UAAU;IAgB9B;;;;OAIG;IACH,SAAS,IAAI,OAAO;IAIpB;;;;;;;OAOG;IACH,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI;IAmB3C;;;;;;;;OAQG;IACG,iBAAiB,IAAI,OAAO,CAAC,eAAe,CAAC;IA6BnD;;;;;OAKG;IACH,UAAU,IAAI,MAAM;IAKpB;;;;;OAKG;IACH,kBAAkB,IAAI,MAAM;IAK5B;;;;;OAKG;IACH,aAAa,IAAI,MAAM;IAWvB;;;;;OAKG;IACH,OAAO,CAAC,aAAa;IAerB;;;;;;OAMG;IACG,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IA0B5D;;;;;;;OAOG;IACG,mBAAmB,CACvB,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IA8BlC;;;;;;;;OAQG;IACG,aAAa,CACjB,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,WAAW,EAClB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAAC,MAAM,CAAC;IAiBlB;;;;;;;;;;;;;;;;;OAiBG;IACG,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC;IAuCxE;;OAEG;IACH,OAAO,CAAC,cAAc;CAuBvB"}
|
package/dist/auth/types.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { Wallet } from 'ethers';
|
|
|
3
3
|
* Configuration for signature-based authentication
|
|
4
4
|
*/
|
|
5
5
|
export interface AuthConfig {
|
|
6
|
-
/** The ethers wallet used for signing messages */
|
|
7
|
-
wallet: Wallet;
|
|
6
|
+
/** The ethers wallet used for signing messages (optional for read-only operations) */
|
|
7
|
+
wallet: Wallet | undefined;
|
|
8
8
|
/** Optional custom message prefix (defaults to "Create a GalaChain Wallet") */
|
|
9
9
|
messagePrefix?: string;
|
|
10
10
|
}
|
package/dist/auth/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/auth/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,sFAAsF;IACtF,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,+EAA+E;IAC/E,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,OAAO,EAAE,MAAM,CAAC;IAChB,+CAA+C;IAC/C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,oBAAY,aAAa;IACvB,oBAAoB,yBAAyB;IAC7C,gBAAgB,qBAAqB;IACrC,eAAe,oBAAoB;IACnC,yBAAyB,8BAA8B;CACxD;AAED;;GAEG;AACH,qBAAa,SAAU,SAAQ,KAAK;aAEhB,IAAI,EAAE,aAAa;aAEnB,aAAa,CAAC,EAAE,KAAK;gBAFrB,IAAI,EAAE,aAAa,EACnC,OAAO,EAAE,MAAM,EACC,aAAa,CAAC,EAAE,KAAK,YAAA;CAKxC"}
|