@gala-chain/launchpad-sdk 4.0.22-beta.0 → 4.0.22-beta.2
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/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +5 -3
- 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 +109 -49
- package/dist/src/LaunchpadSDK.d.ts.map +1 -1
- package/dist/src/api/dto/BurnTokensDto.d.ts +89 -0
- package/dist/src/api/dto/BurnTokensDto.d.ts.map +1 -0
- package/dist/src/constants/version.generated.d.ts +1 -1
- package/dist/src/index.d.ts +5 -3
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/services/GalaChainService.d.ts +95 -32
- package/dist/src/services/GalaChainService.d.ts.map +1 -1
- package/dist/src/types/burn.dto.d.ts +149 -0
- package/dist/src/types/burn.dto.d.ts.map +1 -0
- package/dist/src/types/lock.dto.d.ts +154 -24
- package/dist/src/types/lock.dto.d.ts.map +1 -1
- package/dist/src/utils/SignatureHelper.d.ts +16 -0
- package/dist/src/utils/SignatureHelper.d.ts.map +1 -1
- package/package.json +3 -1
|
@@ -52,7 +52,8 @@ import { BaseService } from './BaseService';
|
|
|
52
52
|
import { FetchPoolDetailsData, InternalFetchPoolDetailsResponse } from '../types/trade.dto';
|
|
53
53
|
import { TokenBalanceResult } from '../types/user.dto';
|
|
54
54
|
import { TransferGalaData, TransferTokenData } from '../types/transfer.dto';
|
|
55
|
-
import {
|
|
55
|
+
import { LockTokensData, LockTokensResult, UnlockTokensData, UnlockTokensResult } from '../types/lock.dto';
|
|
56
|
+
import { BurnTokensData, BurnTokensResult } from '../types/burn.dto';
|
|
56
57
|
import { TokenClassWithSupply } from '../types/launchpad.dto';
|
|
57
58
|
/**
|
|
58
59
|
* GalaChain Service for blockchain operations
|
|
@@ -317,65 +318,127 @@ export declare class GalaChainService extends BaseService {
|
|
|
317
318
|
*/
|
|
318
319
|
resolveTokenClassKey(tokenName: string): Promise<TokenClassKey>;
|
|
319
320
|
/**
|
|
320
|
-
* Lock tokens on GalaChain
|
|
321
|
+
* Lock tokens on GalaChain (batch operation)
|
|
321
322
|
*
|
|
322
|
-
*
|
|
323
|
+
* Supports locking multiple token types in a single transaction.
|
|
324
|
+
* Places holds on tokens, making them non-transferable
|
|
323
325
|
* until unlocked by the lock authority. Useful for staking, escrow, vesting,
|
|
324
326
|
* or other hold scenarios.
|
|
325
327
|
*
|
|
326
|
-
* @param data - Lock parameters
|
|
327
|
-
* @returns
|
|
328
|
+
* @param data - Lock parameters containing array of tokens to lock
|
|
329
|
+
* @returns LockTokensResult with transaction ID and locked token details
|
|
328
330
|
*
|
|
329
331
|
* @example
|
|
330
332
|
* ```typescript
|
|
331
|
-
* // Lock
|
|
332
|
-
* const
|
|
333
|
-
* tokenName: '
|
|
334
|
-
* amount: '100'
|
|
333
|
+
* // Lock a single token
|
|
334
|
+
* const result = await galaChainService.lockTokens({
|
|
335
|
+
* tokens: [{ tokenName: 'anime', amount: '100' }]
|
|
335
336
|
* });
|
|
336
337
|
*
|
|
337
|
-
* // Lock tokens with
|
|
338
|
-
* const
|
|
339
|
-
*
|
|
340
|
-
*
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
* name: 'staking-lock-v1'
|
|
338
|
+
* // Lock multiple tokens with different settings
|
|
339
|
+
* const result = await galaChainService.lockTokens({
|
|
340
|
+
* tokens: [
|
|
341
|
+
* { tokenName: 'anime', amount: '100', lockAuthority: 'eth|0x1234...' },
|
|
342
|
+
* { tokenName: 'dragon', amount: '50', expires: Date.now() + 86400000 }
|
|
343
|
+
* ]
|
|
344
344
|
* });
|
|
345
345
|
* ```
|
|
346
346
|
*
|
|
347
|
-
* @throws {
|
|
347
|
+
* @throws {LockError} When validation fails or lock operation is rejected
|
|
348
348
|
*/
|
|
349
|
-
|
|
349
|
+
lockTokens(data: LockTokensData): Promise<LockTokensResult>;
|
|
350
350
|
/**
|
|
351
|
-
* Unlock previously locked tokens on GalaChain
|
|
351
|
+
* Unlock previously locked tokens on GalaChain (batch operation)
|
|
352
352
|
*
|
|
353
|
+
* Supports unlocking multiple token types in a single transaction.
|
|
353
354
|
* Releases locked tokens, making them available for transfer again.
|
|
354
355
|
* Must be signed by the lock authority (the address that created the lock
|
|
355
356
|
* or was designated as lock authority).
|
|
356
357
|
*
|
|
357
|
-
* @param data - Unlock parameters
|
|
358
|
-
* @returns
|
|
358
|
+
* @param data - Unlock parameters containing array of tokens to unlock
|
|
359
|
+
* @returns UnlockTokensResult with transaction ID and unlocked token details
|
|
359
360
|
*
|
|
360
361
|
* @example
|
|
361
362
|
* ```typescript
|
|
362
|
-
* // Unlock
|
|
363
|
-
* const
|
|
364
|
-
* tokenName: '
|
|
365
|
-
* amount: '50'
|
|
363
|
+
* // Unlock a single token
|
|
364
|
+
* const result = await galaChainService.unlockTokens({
|
|
365
|
+
* tokens: [{ tokenName: 'anime', amount: '50' }]
|
|
366
366
|
* });
|
|
367
367
|
*
|
|
368
|
-
* // Unlock tokens
|
|
369
|
-
* const
|
|
370
|
-
*
|
|
371
|
-
*
|
|
372
|
-
*
|
|
368
|
+
* // Unlock multiple tokens
|
|
369
|
+
* const result = await galaChainService.unlockTokens({
|
|
370
|
+
* tokens: [
|
|
371
|
+
* { tokenName: 'anime', amount: '50' },
|
|
372
|
+
* { tokenName: 'dragon', amount: '25', name: 'staking-lock-v1' }
|
|
373
|
+
* ]
|
|
373
374
|
* });
|
|
374
375
|
* ```
|
|
375
376
|
*
|
|
376
|
-
* @throws {
|
|
377
|
+
* @throws {LockError} When validation fails or unlock operation is rejected
|
|
377
378
|
*/
|
|
378
|
-
|
|
379
|
+
unlockTokens(data: UnlockTokensData): Promise<UnlockTokensResult>;
|
|
380
|
+
/**
|
|
381
|
+
* Permanently burn tokens on GalaChain
|
|
382
|
+
*
|
|
383
|
+
* ⚠️ WARNING: THIS OPERATION IS IRREVERSIBLE ⚠️
|
|
384
|
+
* Burned tokens cannot be recovered or recreated.
|
|
385
|
+
* This reduces the total supply of the token.
|
|
386
|
+
*
|
|
387
|
+
* Supports batch burning of multiple token types in a single transaction.
|
|
388
|
+
*
|
|
389
|
+
* @param data - Burn data containing tokens array with amounts
|
|
390
|
+
* @returns Result with transaction ID and burned token details
|
|
391
|
+
* @throws {BurnError} When validation fails or burn operation is rejected
|
|
392
|
+
*
|
|
393
|
+
* @example
|
|
394
|
+
* ```typescript
|
|
395
|
+
* // Burn a single token type
|
|
396
|
+
* const result = await galaChainService.burnTokens({
|
|
397
|
+
* tokens: [{ tokenName: 'anime', amount: '100' }]
|
|
398
|
+
* });
|
|
399
|
+
*
|
|
400
|
+
* // Burn multiple token types in one transaction
|
|
401
|
+
* const result = await galaChainService.burnTokens({
|
|
402
|
+
* tokens: [
|
|
403
|
+
* { tokenName: 'anime', amount: '50' },
|
|
404
|
+
* { tokenName: 'doge', amount: '25' }
|
|
405
|
+
* ]
|
|
406
|
+
* });
|
|
407
|
+
* ```
|
|
408
|
+
*/
|
|
409
|
+
burnTokens(data: BurnTokensData): Promise<BurnTokensResult>;
|
|
410
|
+
/**
|
|
411
|
+
* Extract burn result from GalaChain response
|
|
412
|
+
*/
|
|
413
|
+
private extractBurnResult;
|
|
414
|
+
/**
|
|
415
|
+
* Validate burn tokens data
|
|
416
|
+
*/
|
|
417
|
+
private validateBurnTokensData;
|
|
418
|
+
/**
|
|
419
|
+
* Handle burn operation errors
|
|
420
|
+
*/
|
|
421
|
+
private handleBurnError;
|
|
422
|
+
/**
|
|
423
|
+
* Validate lock tokens data (batch operation)
|
|
424
|
+
*/
|
|
425
|
+
private validateLockTokensData;
|
|
426
|
+
/**
|
|
427
|
+
* Validate unlock tokens data (batch operation)
|
|
428
|
+
*/
|
|
429
|
+
private validateUnlockTokensData;
|
|
430
|
+
/**
|
|
431
|
+
* Extract lock result from GalaChain response
|
|
432
|
+
*/
|
|
433
|
+
private extractLockResult;
|
|
434
|
+
/**
|
|
435
|
+
* Extract unlock result from GalaChain response
|
|
436
|
+
*/
|
|
437
|
+
private extractUnlockResult;
|
|
438
|
+
/**
|
|
439
|
+
* Handle lock/unlock operation errors
|
|
440
|
+
*/
|
|
441
|
+
private handleLockError;
|
|
379
442
|
/**
|
|
380
443
|
* Validate GALA transfer data
|
|
381
444
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GalaChainService.d.ts","sourceRoot":"","sources":["../../../src/services/GalaChainService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"GalaChainService.d.ts","sourceRoot":"","sources":["../../../src/services/GalaChainService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAS3C,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChC,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAAO,EACL,oBAAoB,EACpB,gCAAgC,EAGjC,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAEL,kBAAkB,EAEnB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EAQlB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,cAAc,EACd,gBA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AC,sBAAsB;IAsC9B;;OAEG;IACH,OAAO,CAAC,eAAe;IA8CvB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAgE9B;;OAEG;IACH,OAAO,CAAC,wBAAwB;IA+ChC;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAuBzB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAuB3B;;OAEG;IACH,OAAO,CAAC,eAAe;IA0DvB;;OAEG;IACH,OAAO,CAAC,wBAAwB;IAuBhC;;OAEG;IACH,OAAO,CAAC,yBAAyB;IA4CjC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAiD7B;;OAEG;IACH,OAAO,CAAC,uBAAuB;IA+B/B;;;OAGG;YACW,oBAAoB;IAqDlC;;;;OAIG;IACH,OAAO,CAAC,oCAAoC;IAwB5C;;;;;;;;;OASG;IACH,OAAO,CAAC,gCAAgC;IAyCxC;;OAEG;IACH,OAAO,CAAC,mBAAmB;CAiE5B"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Burn API Data Transfer Objects and Types
|
|
3
|
+
*
|
|
4
|
+
* This module contains all types and interfaces related to token burning
|
|
5
|
+
* operations on GalaChain.
|
|
6
|
+
*
|
|
7
|
+
* Burn operations permanently destroy tokens. THIS IS IRREVERSIBLE.
|
|
8
|
+
* Once burned, tokens cannot be recovered or recreated.
|
|
9
|
+
*/
|
|
10
|
+
import type { TokenId } from '../types/common';
|
|
11
|
+
/**
|
|
12
|
+
* Token entry for batch burn operations
|
|
13
|
+
*/
|
|
14
|
+
export interface BurnTokenEntry {
|
|
15
|
+
/** Flexible token identifier - accepts string, TokenClassKey, or TokenInstanceKey */
|
|
16
|
+
tokenId?: TokenId;
|
|
17
|
+
/** Token name for lookup (e.g., 'tinyevil', 'dragnrkti') - used if tokenId not provided */
|
|
18
|
+
tokenName?: string;
|
|
19
|
+
/** Amount of tokens to burn in decimal format */
|
|
20
|
+
amount: string;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Data required for burning tokens on GalaChain
|
|
24
|
+
*
|
|
25
|
+
* IRREVERSIBLE: Burned tokens are permanently destroyed and cannot be recovered.
|
|
26
|
+
* Use with caution. This operation reduces total supply.
|
|
27
|
+
*
|
|
28
|
+
* **Batch Behavior:** Each token in the batch is processed as part of a single GalaChain
|
|
29
|
+
* transaction. The transaction either succeeds completely (all tokens burned) or fails
|
|
30
|
+
* completely (no tokens burned). However, network errors after submission may require
|
|
31
|
+
* checking transaction status to confirm the outcome.
|
|
32
|
+
*
|
|
33
|
+
* **Batch Limits:** Maximum {@link MAX_BURN_BATCH_SIZE} tokens per operation (default: 50).
|
|
34
|
+
* This conservative limit exists due to the irreversible nature of burn operations.
|
|
35
|
+
*/
|
|
36
|
+
export interface BurnTokensData {
|
|
37
|
+
/** Array of tokens to burn - supports multiple token types in single transaction */
|
|
38
|
+
tokens: BurnTokenEntry[];
|
|
39
|
+
/** Optional unique key for idempotency - auto-generated if not provided */
|
|
40
|
+
uniqueKey?: string;
|
|
41
|
+
/** Optional private key override for this operation (format: '0x' + 64 hex characters) */
|
|
42
|
+
privateKey?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Entry in the burn result showing details of each burned token
|
|
46
|
+
*/
|
|
47
|
+
export interface TokenBurnEntry {
|
|
48
|
+
/** Token collection (usually 'Token') */
|
|
49
|
+
collection: string;
|
|
50
|
+
/** Token category (usually 'Unit') */
|
|
51
|
+
category: string;
|
|
52
|
+
/** Token type/symbol */
|
|
53
|
+
type: string;
|
|
54
|
+
/** Additional key for the token class */
|
|
55
|
+
additionalKey: string;
|
|
56
|
+
/** Instance identifier */
|
|
57
|
+
instance: string;
|
|
58
|
+
/** Quantity burned (in base units) */
|
|
59
|
+
quantity: string;
|
|
60
|
+
/** Address that burned the tokens */
|
|
61
|
+
burnedBy: string;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Result of a burn operation
|
|
65
|
+
*/
|
|
66
|
+
export interface BurnTokensResult {
|
|
67
|
+
/** Transaction ID if available */
|
|
68
|
+
transactionId?: string;
|
|
69
|
+
/** Array of burned token entries */
|
|
70
|
+
burned: TokenBurnEntry[];
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* GalaChain response data item structure for burn operations
|
|
74
|
+
*/
|
|
75
|
+
export interface GalaChainBurnDataItem {
|
|
76
|
+
additionalKey?: string;
|
|
77
|
+
category?: string;
|
|
78
|
+
collection?: string;
|
|
79
|
+
type?: string;
|
|
80
|
+
instance?: string;
|
|
81
|
+
quantity?: string;
|
|
82
|
+
burnedBy?: string;
|
|
83
|
+
txnId?: string;
|
|
84
|
+
transactionId?: string;
|
|
85
|
+
id?: string;
|
|
86
|
+
TxnId?: string;
|
|
87
|
+
[key: string]: unknown;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* GalaChain response format structure for burn operations
|
|
91
|
+
*/
|
|
92
|
+
export interface GalaChainBurnResponse {
|
|
93
|
+
Status: number;
|
|
94
|
+
Data: GalaChainBurnDataItem[];
|
|
95
|
+
Message?: string;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Internal response from burn endpoint
|
|
99
|
+
*/
|
|
100
|
+
export type InternalBurnResponse = GalaChainBurnResponse;
|
|
101
|
+
/**
|
|
102
|
+
* Type guard to check if an object is a valid BurnTokenEntry
|
|
103
|
+
*/
|
|
104
|
+
export declare function isBurnTokenEntry(obj: unknown): obj is BurnTokenEntry;
|
|
105
|
+
/**
|
|
106
|
+
* Type guard to check if an object is valid BurnTokensData
|
|
107
|
+
*/
|
|
108
|
+
export declare function isBurnTokensData(obj: unknown): obj is BurnTokensData;
|
|
109
|
+
/**
|
|
110
|
+
* Maximum batch size for burn operations
|
|
111
|
+
*
|
|
112
|
+
* Burn operations are limited to this many tokens per transaction
|
|
113
|
+
* to prevent DoS and ensure reasonable transaction sizes.
|
|
114
|
+
* The limit is conservative due to the irreversible nature of burns.
|
|
115
|
+
*/
|
|
116
|
+
export declare const MAX_BURN_BATCH_SIZE = 50;
|
|
117
|
+
/**
|
|
118
|
+
* Burn-specific error types
|
|
119
|
+
*/
|
|
120
|
+
export declare enum BurnErrorType {
|
|
121
|
+
TOKEN_NOT_FOUND = "TOKEN_NOT_FOUND",
|
|
122
|
+
INVALID_AMOUNT = "INVALID_AMOUNT",
|
|
123
|
+
INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
|
|
124
|
+
SIGNATURE_FAILED = "SIGNATURE_FAILED",
|
|
125
|
+
NETWORK_ERROR = "NETWORK_ERROR",
|
|
126
|
+
WALLET_REQUIRED = "WALLET_REQUIRED",
|
|
127
|
+
VALIDATION_ERROR = "VALIDATION_ERROR"
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Burn error with detailed information
|
|
131
|
+
*/
|
|
132
|
+
export declare class BurnError extends Error {
|
|
133
|
+
readonly type: BurnErrorType;
|
|
134
|
+
readonly details?: {
|
|
135
|
+
tokenName?: string;
|
|
136
|
+
tokenId?: TokenId;
|
|
137
|
+
amount?: string;
|
|
138
|
+
balance?: string;
|
|
139
|
+
uniqueKey?: string;
|
|
140
|
+
} | undefined;
|
|
141
|
+
constructor(message: string, type: BurnErrorType, details?: {
|
|
142
|
+
tokenName?: string;
|
|
143
|
+
tokenId?: TokenId;
|
|
144
|
+
amount?: string;
|
|
145
|
+
balance?: string;
|
|
146
|
+
uniqueKey?: string;
|
|
147
|
+
} | undefined);
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=burn.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"burn.dto.d.ts","sourceRoot":"","sources":["../../../src/types/burn.dto.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IA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E,MAAM,CAAC;KACpB,YAAA;CAKJ"}
|
|
@@ -6,17 +6,18 @@
|
|
|
6
6
|
*
|
|
7
7
|
* Lock operations place holds on tokens, preventing transfers until unlocked.
|
|
8
8
|
* Useful for staking, escrow, vesting, or other hold scenarios.
|
|
9
|
+
*
|
|
10
|
+
* BATCH OPERATIONS: Both lockTokens() and unlockTokens() support multiple tokens
|
|
11
|
+
* in a single transaction for efficiency.
|
|
9
12
|
*/
|
|
13
|
+
import type { TokenId, TokenClassKey } from '../types/common';
|
|
10
14
|
/**
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* Locked tokens cannot be transferred until unlocked by the lock authority.
|
|
14
|
-
* Useful for staking, escrow, vesting, or other hold scenarios.
|
|
15
|
+
* Token entry for batch lock operations
|
|
15
16
|
*/
|
|
16
|
-
export interface
|
|
17
|
+
export interface LockTokenEntry {
|
|
17
18
|
/** Flexible token identifier - accepts string, TokenClassKey, or TokenInstanceKey */
|
|
18
|
-
tokenId?:
|
|
19
|
-
/** Token name for lookup (e.g., '
|
|
19
|
+
tokenId?: TokenId;
|
|
20
|
+
/** Token name for lookup (e.g., 'anime', 'dragon') - used if tokenId not provided */
|
|
20
21
|
tokenName?: string;
|
|
21
22
|
/** Amount of tokens to lock in decimal format */
|
|
22
23
|
amount: string;
|
|
@@ -26,35 +27,109 @@ export interface LockTokenData {
|
|
|
26
27
|
expires?: number;
|
|
27
28
|
/** Optional name/identifier for the lock - can be used to match during unlock */
|
|
28
29
|
name?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Token entry for batch unlock operations
|
|
33
|
+
*/
|
|
34
|
+
export interface UnlockTokenEntry {
|
|
35
|
+
/** Flexible token identifier - accepts string, TokenClassKey, or TokenInstanceKey */
|
|
36
|
+
tokenId?: TokenId;
|
|
37
|
+
/** Token name for lookup (e.g., 'anime', 'dragon') - used if tokenId not provided */
|
|
38
|
+
tokenName?: string;
|
|
39
|
+
/** Amount of tokens to unlock in decimal format */
|
|
40
|
+
amount: string;
|
|
41
|
+
/** Optional lock name to match (if a name was used during the lock operation) */
|
|
42
|
+
name?: string;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Data required for locking tokens on GalaChain (batch operation)
|
|
46
|
+
*
|
|
47
|
+
* Supports locking multiple token types in a single transaction.
|
|
48
|
+
* Locked tokens cannot be transferred until unlocked by the lock authority.
|
|
49
|
+
* Useful for staking, escrow, vesting, or other hold scenarios.
|
|
50
|
+
*
|
|
51
|
+
* **Batch Behavior:** Each token in the batch is processed as part of a single GalaChain
|
|
52
|
+
* transaction. The transaction either succeeds completely (all tokens locked) or fails
|
|
53
|
+
* completely (no tokens locked). However, network errors after submission may require
|
|
54
|
+
* checking transaction status to confirm the outcome.
|
|
55
|
+
*
|
|
56
|
+
* **Batch Limits:** Maximum {@link MAX_LOCK_BATCH_SIZE} tokens per operation (default: 100).
|
|
57
|
+
*
|
|
58
|
+
* **Note:** Lock parameters (lockAuthority, expires, name) from the first token with those
|
|
59
|
+
* fields set apply to the entire batch - GalaChain locks support only one set of parameters per transaction.
|
|
60
|
+
*/
|
|
61
|
+
export interface LockTokensData {
|
|
62
|
+
/** Array of tokens to lock (each with tokenId or tokenName, amount, and optional lock parameters) */
|
|
63
|
+
tokens: LockTokenEntry[];
|
|
29
64
|
/** Optional unique key for idempotency - auto-generated if not provided */
|
|
30
65
|
uniqueKey?: string;
|
|
31
66
|
/** Optional private key override for this operation (format: '0x' + 64 hex characters) */
|
|
32
67
|
privateKey?: string;
|
|
33
68
|
}
|
|
34
69
|
/**
|
|
35
|
-
* Data required for unlocking previously locked tokens on GalaChain
|
|
70
|
+
* Data required for unlocking previously locked tokens on GalaChain (batch operation)
|
|
36
71
|
*
|
|
72
|
+
* Supports unlocking multiple token types in a single transaction.
|
|
37
73
|
* Must be signed by the lock authority (the address that locked the tokens
|
|
38
74
|
* or was designated as lock authority during the lock operation).
|
|
75
|
+
*
|
|
76
|
+
* **Batch Behavior:** Each token in the batch is processed as part of a single GalaChain
|
|
77
|
+
* transaction. The transaction either succeeds completely (all tokens unlocked) or fails
|
|
78
|
+
* completely (no tokens unlocked). However, network errors after submission may require
|
|
79
|
+
* checking transaction status to confirm the outcome.
|
|
80
|
+
*
|
|
81
|
+
* **Batch Limits:** Maximum {@link MAX_UNLOCK_BATCH_SIZE} tokens per operation (default: 100).
|
|
39
82
|
*/
|
|
40
|
-
export interface
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
/** Token name for lookup (e.g., 'tinyevil', 'dragnrkti') - used if tokenId not provided */
|
|
44
|
-
tokenName?: string;
|
|
45
|
-
/** Amount of tokens to unlock in decimal format */
|
|
46
|
-
amount: string;
|
|
47
|
-
/** Optional lock name to match (if a name was used during the lock operation) */
|
|
48
|
-
name?: string;
|
|
83
|
+
export interface UnlockTokensData {
|
|
84
|
+
/** Array of tokens to unlock (each with tokenId or tokenName, amount, and optional name) */
|
|
85
|
+
tokens: UnlockTokenEntry[];
|
|
49
86
|
/** Optional unique key for idempotency - auto-generated if not provided */
|
|
50
87
|
uniqueKey?: string;
|
|
51
88
|
/** Optional private key override for this operation (format: '0x' + 64 hex characters) */
|
|
52
89
|
privateKey?: string;
|
|
53
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Entry in the lock result showing details of each locked token
|
|
93
|
+
*/
|
|
94
|
+
export interface TokenLockEntry {
|
|
95
|
+
/** Token class key identifying the locked token */
|
|
96
|
+
tokenClassKey: TokenClassKey;
|
|
97
|
+
/** Quantity locked (in base units) */
|
|
98
|
+
quantity: string;
|
|
99
|
+
/** Address that can unlock these tokens */
|
|
100
|
+
lockAuthority: string;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Entry in the unlock result showing details of each unlocked token
|
|
104
|
+
*/
|
|
105
|
+
export interface TokenUnlockEntry {
|
|
106
|
+
/** Token class key identifying the unlocked token */
|
|
107
|
+
tokenClassKey: TokenClassKey;
|
|
108
|
+
/** Quantity unlocked (in base units) */
|
|
109
|
+
quantity: string;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Result of a lock operation
|
|
113
|
+
*/
|
|
114
|
+
export interface LockTokensResult {
|
|
115
|
+
/** Transaction ID if available */
|
|
116
|
+
transactionId?: string;
|
|
117
|
+
/** Array of locked token entries */
|
|
118
|
+
locked: TokenLockEntry[];
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Result of an unlock operation
|
|
122
|
+
*/
|
|
123
|
+
export interface UnlockTokensResult {
|
|
124
|
+
/** Transaction ID if available */
|
|
125
|
+
transactionId?: string;
|
|
126
|
+
/** Array of unlocked token entries */
|
|
127
|
+
unlocked: TokenUnlockEntry[];
|
|
128
|
+
}
|
|
54
129
|
/**
|
|
55
130
|
* GalaChain response data item structure for lock/unlock operations
|
|
56
131
|
*/
|
|
57
|
-
interface GalaChainLockDataItem {
|
|
132
|
+
export interface GalaChainLockDataItem {
|
|
58
133
|
additionalKey?: string;
|
|
59
134
|
category?: string;
|
|
60
135
|
collection?: string;
|
|
@@ -73,22 +148,45 @@ interface GalaChainLockDataItem {
|
|
|
73
148
|
/**
|
|
74
149
|
* GalaChain response format structure for lock/unlock operations
|
|
75
150
|
*/
|
|
76
|
-
interface GalaChainLockResponse {
|
|
151
|
+
export interface GalaChainLockResponse {
|
|
77
152
|
Status: number;
|
|
78
153
|
Data: GalaChainLockDataItem[];
|
|
154
|
+
Message?: string;
|
|
79
155
|
}
|
|
80
156
|
/**
|
|
81
157
|
* Internal response from lock/unlock endpoints
|
|
82
158
|
*/
|
|
83
159
|
export type InternalLockResponse = GalaChainLockResponse;
|
|
84
160
|
/**
|
|
85
|
-
* Type guard to check if an object is valid
|
|
161
|
+
* Type guard to check if an object is a valid LockTokenEntry
|
|
86
162
|
*/
|
|
87
|
-
export declare function
|
|
163
|
+
export declare function isLockTokenEntry(obj: unknown): obj is LockTokenEntry;
|
|
88
164
|
/**
|
|
89
|
-
* Type guard to check if an object is valid
|
|
165
|
+
* Type guard to check if an object is a valid UnlockTokenEntry
|
|
90
166
|
*/
|
|
91
|
-
export declare function
|
|
167
|
+
export declare function isUnlockTokenEntry(obj: unknown): obj is UnlockTokenEntry;
|
|
168
|
+
/**
|
|
169
|
+
* Type guard to check if an object is valid LockTokensData
|
|
170
|
+
*/
|
|
171
|
+
export declare function isLockTokensData(obj: unknown): obj is LockTokensData;
|
|
172
|
+
/**
|
|
173
|
+
* Type guard to check if an object is valid UnlockTokensData
|
|
174
|
+
*/
|
|
175
|
+
export declare function isUnlockTokensData(obj: unknown): obj is UnlockTokensData;
|
|
176
|
+
/**
|
|
177
|
+
* Maximum batch size for lock operations
|
|
178
|
+
*
|
|
179
|
+
* Lock operations are limited to this many tokens per transaction
|
|
180
|
+
* to prevent DoS and ensure reasonable transaction sizes.
|
|
181
|
+
*/
|
|
182
|
+
export declare const MAX_LOCK_BATCH_SIZE = 100;
|
|
183
|
+
/**
|
|
184
|
+
* Maximum batch size for unlock operations
|
|
185
|
+
*
|
|
186
|
+
* Unlock operations are limited to this many tokens per transaction
|
|
187
|
+
* to prevent DoS and ensure reasonable transaction sizes.
|
|
188
|
+
*/
|
|
189
|
+
export declare const MAX_UNLOCK_BATCH_SIZE = 100;
|
|
92
190
|
/**
|
|
93
191
|
* Validation constraints for lock/unlock operations
|
|
94
192
|
*/
|
|
@@ -103,6 +201,10 @@ export declare const LOCK_CONSTRAINTS: {
|
|
|
103
201
|
readonly ETH_ADDRESS_PATTERN: RegExp;
|
|
104
202
|
/** Pattern for valid backend addresses (eth| format) - imported from centralized ADDRESS_PATTERNS */
|
|
105
203
|
readonly BACKEND_ADDRESS_PATTERN: RegExp;
|
|
204
|
+
/** Maximum tokens per lock batch */
|
|
205
|
+
readonly MAX_LOCK_BATCH_SIZE: 100;
|
|
206
|
+
/** Maximum tokens per unlock batch */
|
|
207
|
+
readonly MAX_UNLOCK_BATCH_SIZE: 100;
|
|
106
208
|
};
|
|
107
209
|
/**
|
|
108
210
|
* Lock/Unlock specific error types
|
|
@@ -114,6 +216,7 @@ export declare enum LockErrorType {
|
|
|
114
216
|
SIGNATURE_FAILED = "SIGNATURE_FAILED",
|
|
115
217
|
NETWORK_ERROR = "NETWORK_ERROR",
|
|
116
218
|
WALLET_REQUIRED = "WALLET_REQUIRED",
|
|
219
|
+
VALIDATION_ERROR = "VALIDATION_ERROR",
|
|
117
220
|
LOCK_NOT_FOUND = "LOCK_NOT_FOUND",
|
|
118
221
|
LOCK_EXPIRED = "LOCK_EXPIRED",
|
|
119
222
|
INSUFFICIENT_LOCKED_BALANCE = "INSUFFICIENT_LOCKED_BALANCE",
|
|
@@ -127,6 +230,7 @@ export declare class LockError extends Error {
|
|
|
127
230
|
readonly type: LockErrorType;
|
|
128
231
|
readonly details?: {
|
|
129
232
|
tokenName?: string;
|
|
233
|
+
tokenId?: TokenId;
|
|
130
234
|
amount?: string;
|
|
131
235
|
balance?: string;
|
|
132
236
|
lockAuthority?: string;
|
|
@@ -135,6 +239,7 @@ export declare class LockError extends Error {
|
|
|
135
239
|
} | undefined;
|
|
136
240
|
constructor(message: string, type: LockErrorType, details?: {
|
|
137
241
|
tokenName?: string;
|
|
242
|
+
tokenId?: TokenId;
|
|
138
243
|
amount?: string;
|
|
139
244
|
balance?: string;
|
|
140
245
|
lockAuthority?: string;
|
|
@@ -142,5 +247,30 @@ export declare class LockError extends Error {
|
|
|
142
247
|
uniqueKey?: string;
|
|
143
248
|
} | undefined);
|
|
144
249
|
}
|
|
145
|
-
|
|
250
|
+
/**
|
|
251
|
+
* @deprecated Use LockTokensData instead. Will be removed in v5.0.0.
|
|
252
|
+
*
|
|
253
|
+
* Migration: `sdk.lockToken(data)` → `sdk.lockTokens({ tokens: [data] })`
|
|
254
|
+
*/
|
|
255
|
+
export type LockTokenData = LockTokenEntry & {
|
|
256
|
+
uniqueKey?: string;
|
|
257
|
+
privateKey?: string;
|
|
258
|
+
};
|
|
259
|
+
/**
|
|
260
|
+
* @deprecated Use UnlockTokensData instead. Will be removed in v5.0.0.
|
|
261
|
+
*
|
|
262
|
+
* Migration: `sdk.unlockToken(data)` → `sdk.unlockTokens({ tokens: [data] })`
|
|
263
|
+
*/
|
|
264
|
+
export type UnlockTokenData = UnlockTokenEntry & {
|
|
265
|
+
uniqueKey?: string;
|
|
266
|
+
privateKey?: string;
|
|
267
|
+
};
|
|
268
|
+
/**
|
|
269
|
+
* @deprecated Use isLockTokensData instead. Will be removed in v5.0.0.
|
|
270
|
+
*/
|
|
271
|
+
export declare function isLockTokenData(obj: unknown): obj is LockTokenData;
|
|
272
|
+
/**
|
|
273
|
+
* @deprecated Use isUnlockTokensData instead. Will be removed in v5.0.0.
|
|
274
|
+
*/
|
|
275
|
+
export declare function isUnlockTokenData(obj: unknown): obj is UnlockTokenData;
|
|
146
276
|
//# sourceMappingURL=lock.dto.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.dto.d.ts","sourceRoot":"","sources":["../../../src/types/lock.dto.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lock.dto.d.ts","sourceRoot":"","sources":["../../../src/types/lock.dto.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAG9D;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,qFAAqF;IACrF,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,iDAAiD;IACjD,MAAM,EAAE,MAAM,CAAC;IAEf,+FAA+F;IAC/F,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,+FAA+F;IAC/F,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,iFAAiF;IACjF,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,qFAAqF;IACrF,OAAO,CAAC,EAAE,OAAO,CAAC;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CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,eAAe,GAAG,gBAAgB,GAAG;IAC/C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,aAAa,CAclE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,eAAe,CAYtE"}
|
|
@@ -65,6 +65,22 @@ export declare class SignatureHelper {
|
|
|
65
65
|
name?: string;
|
|
66
66
|
uniqueKey: string;
|
|
67
67
|
}): Promise<SignedPayload>;
|
|
68
|
+
/**
|
|
69
|
+
* Sign a BurnTokens payload using EIP-712
|
|
70
|
+
*/
|
|
71
|
+
signBurnTokens(payload: {
|
|
72
|
+
tokenInstances: Array<{
|
|
73
|
+
quantity: string;
|
|
74
|
+
tokenInstanceKey: {
|
|
75
|
+
collection: string;
|
|
76
|
+
category: string;
|
|
77
|
+
type: string;
|
|
78
|
+
additionalKey: string;
|
|
79
|
+
instance: string;
|
|
80
|
+
};
|
|
81
|
+
}>;
|
|
82
|
+
uniqueKey: string;
|
|
83
|
+
}): Promise<SignedPayload>;
|
|
68
84
|
/**
|
|
69
85
|
* Sign an UnlockToken payload using EIP-712
|
|
70
86
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SignatureHelper.d.ts","sourceRoot":"","sources":["../../../src/utils/SignatureHelper.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OA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