@gala-chain/launchpad-sdk 5.0.4-beta.0 → 5.0.4-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/README.md +5 -0
- package/dist/ai-docs.json +647 -290
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +5 -1
- 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 +79 -0
- package/dist/src/LaunchpadSDK.d.ts.map +1 -1
- package/dist/src/constants/nft-fees.d.ts +30 -0
- package/dist/src/constants/nft-fees.d.ts.map +1 -0
- package/dist/src/constants/version.generated.d.ts +1 -1
- package/dist/src/index.d.ts +5 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/schemas/files.d.ts +22 -22
- package/dist/src/schemas/files.d.ts.map +1 -1
- package/dist/src/schemas/launchpad.d.ts +45 -170
- package/dist/src/schemas/launchpad.d.ts.map +1 -1
- package/dist/src/schemas/pagination.d.ts +21 -103
- package/dist/src/schemas/pagination.d.ts.map +1 -1
- package/dist/src/schemas/primitives.d.ts +13 -6
- package/dist/src/schemas/primitives.d.ts.map +1 -1
- package/dist/src/schemas/trade.d.ts +53 -105
- package/dist/src/schemas/trade.d.ts.map +1 -1
- package/dist/src/schemas/user.d.ts +26 -170
- package/dist/src/schemas/user.d.ts.map +1 -1
- package/dist/src/schemas/validators.d.ts +21 -21
- package/dist/src/services/NftCollectionService.d.ts +123 -0
- package/dist/src/services/NftCollectionService.d.ts.map +1 -0
- package/dist/src/types/nft.dto.d.ts +155 -0
- package/dist/src/types/nft.dto.d.ts.map +1 -0
- package/dist/src/utils/nft-helpers.d.ts +62 -0
- package/dist/src/utils/nft-helpers.d.ts.map +1 -0
- package/package.json +12 -8
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NFT Collection Service
|
|
3
|
+
*
|
|
4
|
+
* Handles all NFT collection operations on GalaChain including:
|
|
5
|
+
* - Claiming collections
|
|
6
|
+
* - Creating token classes
|
|
7
|
+
* - Minting NFTs
|
|
8
|
+
* - Fetching NFT data and balances
|
|
9
|
+
*
|
|
10
|
+
* @category Services
|
|
11
|
+
* @since 5.12.0
|
|
12
|
+
*/
|
|
13
|
+
import { BaseService } from './BaseService';
|
|
14
|
+
import { GalaChainGatewayClient } from './GalaChainGatewayClient';
|
|
15
|
+
import { HttpClient } from '../utils/http';
|
|
16
|
+
import type { ClaimCollectionParams, ClaimCollectionResult, CreateTokenClassParams, CreateTokenClassResult, MintNftParams, MintNftResult, NftBalance, NftCollectionAuthorization, NftTokenClassWithSupply, EstimateMintFeeParams, EstimateNftFeesParams, NftFeeEstimate, FetchTokenClassesParams } from '../types/nft.dto';
|
|
17
|
+
/**
|
|
18
|
+
* NFT Collection Service
|
|
19
|
+
*
|
|
20
|
+
* Manages all NFT-related operations including collection claims,
|
|
21
|
+
* token class creation, and NFT minting on GalaChain.
|
|
22
|
+
*
|
|
23
|
+
* **Fee Structure:**
|
|
24
|
+
* - Collection Claim: 10,000 GALA
|
|
25
|
+
* - Token Class Create: 1,000 GALA
|
|
26
|
+
* - Mint NFT: Dynamic fee (estimated via DryRun)
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```typescript
|
|
30
|
+
* const service = new NftCollectionService(httpClient, galaChainClient);
|
|
31
|
+
*
|
|
32
|
+
* // Get collection claim fee
|
|
33
|
+
* const fee = service.getCollectionClaimFee(); // "10000"
|
|
34
|
+
*
|
|
35
|
+
* // Claim a collection
|
|
36
|
+
* const result = await service.claimCollection({
|
|
37
|
+
* collectionName: 'my-collection'
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare class NftCollectionService extends BaseService {
|
|
42
|
+
private readonly galaChainClient;
|
|
43
|
+
constructor(httpClient: HttpClient, galaChainClient: GalaChainGatewayClient);
|
|
44
|
+
/**
|
|
45
|
+
* Get the fee to claim an NFT collection
|
|
46
|
+
* @returns Fee amount in GALA as string ("10000")
|
|
47
|
+
*/
|
|
48
|
+
getCollectionClaimFee(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Get the fee to create a token class
|
|
51
|
+
* @returns Fee amount in GALA as string ("1000")
|
|
52
|
+
*/
|
|
53
|
+
getTokenClassCreateFee(): string;
|
|
54
|
+
/**
|
|
55
|
+
* Estimate minting fee for NFTs via DryRun
|
|
56
|
+
*
|
|
57
|
+
* @param params - Mint parameters (collection, type, category, quantity, owner)
|
|
58
|
+
* @returns Estimated fee in GALA
|
|
59
|
+
* @throws Error if DryRun fails
|
|
60
|
+
*/
|
|
61
|
+
estimateMintFee(params: EstimateMintFeeParams): Promise<string>;
|
|
62
|
+
/**
|
|
63
|
+
* Calculate total fees for multiple NFT operations
|
|
64
|
+
*
|
|
65
|
+
* @param params - Operations to estimate (claimCollection, createTokenClasses count)
|
|
66
|
+
* @returns Fee breakdown with total
|
|
67
|
+
*/
|
|
68
|
+
estimateNftOperationFees(params: EstimateNftFeesParams): NftFeeEstimate;
|
|
69
|
+
/**
|
|
70
|
+
* Claim an NFT collection name
|
|
71
|
+
*
|
|
72
|
+
* @param params - Collection claim parameters
|
|
73
|
+
* @returns Claim result with transaction ID
|
|
74
|
+
* @throws Error if collection name is invalid or already claimed
|
|
75
|
+
*/
|
|
76
|
+
claimCollection(params: ClaimCollectionParams): Promise<ClaimCollectionResult>;
|
|
77
|
+
/**
|
|
78
|
+
* Fetch all NFT collections authorized to a user
|
|
79
|
+
*
|
|
80
|
+
* @param walletAddress - Wallet address to fetch collections for
|
|
81
|
+
* @returns List of authorized collections
|
|
82
|
+
*/
|
|
83
|
+
fetchUserCollections(walletAddress: string): Promise<NftCollectionAuthorization[]>;
|
|
84
|
+
/**
|
|
85
|
+
* Check if an NFT collection name is available
|
|
86
|
+
*
|
|
87
|
+
* @param collectionName - Collection name to check
|
|
88
|
+
* @returns True if available, false if already claimed
|
|
89
|
+
*/
|
|
90
|
+
isCollectionAvailable(collectionName: string): Promise<boolean>;
|
|
91
|
+
/**
|
|
92
|
+
* Create a token class within an NFT collection
|
|
93
|
+
*
|
|
94
|
+
* @param params - Token class creation parameters
|
|
95
|
+
* @returns Creation result with transaction ID
|
|
96
|
+
* @throws Error if parameters are invalid or user lacks authorization
|
|
97
|
+
*/
|
|
98
|
+
createTokenClass(params: CreateTokenClassParams): Promise<CreateTokenClassResult>;
|
|
99
|
+
/**
|
|
100
|
+
* Fetch token classes for a collection
|
|
101
|
+
*
|
|
102
|
+
* @param params - Query parameters (collection, type, category)
|
|
103
|
+
* @returns List of token classes with supply info
|
|
104
|
+
*/
|
|
105
|
+
fetchTokenClasses(params: FetchTokenClassesParams): Promise<NftTokenClassWithSupply[]>;
|
|
106
|
+
/**
|
|
107
|
+
* Mint NFTs from a token class
|
|
108
|
+
*
|
|
109
|
+
* @param params - Minting parameters
|
|
110
|
+
* @returns Minting result with transaction ID
|
|
111
|
+
* @throws Error if parameters invalid or user lacks balance
|
|
112
|
+
*/
|
|
113
|
+
mintNft(params: MintNftParams): Promise<MintNftResult>;
|
|
114
|
+
/**
|
|
115
|
+
* Fetch NFT balances for an owner
|
|
116
|
+
*
|
|
117
|
+
* @param ownerAddress - Owner wallet address
|
|
118
|
+
* @param collectionFilter - Optional collection name to filter by
|
|
119
|
+
* @returns List of NFT balances
|
|
120
|
+
*/
|
|
121
|
+
fetchNftBalances(ownerAddress: string, collectionFilter?: string): Promise<NftBalance[]>;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=NftCollectionService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NftCollectionService.d.ts","sourceRoot":"","sources":["../../../src/services/NftCollectionService.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,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AgB,CACpB,YAAY,EAAE,MAAM,EACpB,gBAAgB,CAAC,EAAE,MAAM,GACxB,OAAO,CAAC,UAAU,EAAE,CAAC;CAoBzB"}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NFT Collection and Token Class Data Transfer Objects
|
|
3
|
+
*
|
|
4
|
+
* Type definitions for all NFT operations on GalaChain including
|
|
5
|
+
* collection management, token class creation, and NFT minting.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Breakdown of fees for NFT operations
|
|
9
|
+
*/
|
|
10
|
+
export interface NftFeeBreakdown {
|
|
11
|
+
collectionClaim?: string;
|
|
12
|
+
tokenClassCreate?: string;
|
|
13
|
+
tokenClassCount?: number;
|
|
14
|
+
mintFee?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Total fee estimate with breakdown
|
|
18
|
+
*/
|
|
19
|
+
export interface NftFeeEstimate {
|
|
20
|
+
totalFee: string;
|
|
21
|
+
breakdown: NftFeeBreakdown;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Parameters for estimating NFT operation fees
|
|
25
|
+
*/
|
|
26
|
+
export interface EstimateNftFeesParams {
|
|
27
|
+
claimCollection?: boolean;
|
|
28
|
+
createTokenClasses?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Parameters for estimating mint fees via DryRun
|
|
32
|
+
*/
|
|
33
|
+
export interface EstimateMintFeeParams {
|
|
34
|
+
collection: string;
|
|
35
|
+
type: string;
|
|
36
|
+
category: string;
|
|
37
|
+
quantity: string;
|
|
38
|
+
ownerAddress: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Parameters to claim an NFT collection name
|
|
42
|
+
*/
|
|
43
|
+
export interface ClaimCollectionParams {
|
|
44
|
+
collectionName: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Result of collection claim operation
|
|
48
|
+
*/
|
|
49
|
+
export interface ClaimCollectionResult {
|
|
50
|
+
transactionId: string;
|
|
51
|
+
collection: string;
|
|
52
|
+
authorizedUser: string;
|
|
53
|
+
status: 'pending' | 'completed' | 'failed';
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* NFT collection authorization from GalaChain
|
|
57
|
+
*/
|
|
58
|
+
export interface NftCollectionAuthorization {
|
|
59
|
+
authorizedUser: string;
|
|
60
|
+
collection: string;
|
|
61
|
+
created?: number;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Parameters to create a token class within an NFT collection
|
|
65
|
+
*/
|
|
66
|
+
export interface CreateTokenClassParams {
|
|
67
|
+
collection: string;
|
|
68
|
+
type: string;
|
|
69
|
+
category: string;
|
|
70
|
+
name?: string;
|
|
71
|
+
description?: string;
|
|
72
|
+
image?: string;
|
|
73
|
+
symbol?: string;
|
|
74
|
+
rarity?: string;
|
|
75
|
+
maxSupply?: string;
|
|
76
|
+
maxCapacity?: string;
|
|
77
|
+
additionalKey?: string;
|
|
78
|
+
metadataAddress?: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Result of token class creation
|
|
82
|
+
*/
|
|
83
|
+
export interface CreateTokenClassResult {
|
|
84
|
+
transactionId: string;
|
|
85
|
+
tokenClass: {
|
|
86
|
+
collection: string;
|
|
87
|
+
type: string;
|
|
88
|
+
category: string;
|
|
89
|
+
additionalKey: string;
|
|
90
|
+
};
|
|
91
|
+
status: 'pending' | 'completed' | 'failed';
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Token class with supply information (NFT-specific)
|
|
95
|
+
*/
|
|
96
|
+
export interface NftTokenClassWithSupply {
|
|
97
|
+
collection: string;
|
|
98
|
+
type: string;
|
|
99
|
+
category: string;
|
|
100
|
+
additionalKey: string;
|
|
101
|
+
totalSupply: string;
|
|
102
|
+
maxSupply?: string;
|
|
103
|
+
isNonFungible: boolean;
|
|
104
|
+
name?: string;
|
|
105
|
+
description?: string;
|
|
106
|
+
image?: string;
|
|
107
|
+
symbol?: string;
|
|
108
|
+
rarity?: string;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Parameters to fetch token classes
|
|
112
|
+
*/
|
|
113
|
+
export interface FetchTokenClassesParams {
|
|
114
|
+
collection: string;
|
|
115
|
+
type?: string;
|
|
116
|
+
category?: string;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Parameters to mint NFTs from a token class
|
|
120
|
+
*/
|
|
121
|
+
export interface MintNftParams {
|
|
122
|
+
collection: string;
|
|
123
|
+
type: string;
|
|
124
|
+
category: string;
|
|
125
|
+
quantity: string;
|
|
126
|
+
ownerAddress: string;
|
|
127
|
+
additionalKey?: string;
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Result of NFT minting operation
|
|
131
|
+
*/
|
|
132
|
+
export interface MintNftResult {
|
|
133
|
+
transactionId: string;
|
|
134
|
+
mintedQuantity: string;
|
|
135
|
+
owner: string;
|
|
136
|
+
tokenInstances: number[];
|
|
137
|
+
tokenClass: {
|
|
138
|
+
collection: string;
|
|
139
|
+
type: string;
|
|
140
|
+
category: string;
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* NFT balance for a user holding specific token class instances
|
|
145
|
+
*/
|
|
146
|
+
export interface NftBalance {
|
|
147
|
+
owner: string;
|
|
148
|
+
collection: string;
|
|
149
|
+
category: string;
|
|
150
|
+
type: string;
|
|
151
|
+
additionalKey: string;
|
|
152
|
+
instanceIds: string[];
|
|
153
|
+
totalOwned: number;
|
|
154
|
+
}
|
|
155
|
+
//# sourceMappingURL=nft.dto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nft.dto.d.ts","sourceRoot":"","sources":["../../../src/types/nft.dto.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB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EAAE,MAAM,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,aAAa,EAAE,MAAM,CAAC;IACtB,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,UAAU,EAAE;QACV,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAMD;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NFT Utility Helper Functions
|
|
3
|
+
*
|
|
4
|
+
* Utilities for NFT operations including validation, formatting,
|
|
5
|
+
* and unique key generation for transactions.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Generate unique key for NFT transactions
|
|
9
|
+
* Used for idempotency in GalaChain operations
|
|
10
|
+
*
|
|
11
|
+
* @param prefix - Operation type prefix: 'auth' (authorize), 'create' (token class), 'mint'
|
|
12
|
+
* @returns Unique key in format: {prefix}-{timestamp}-{random}
|
|
13
|
+
*/
|
|
14
|
+
export declare function generateNftUniqueKey(prefix: 'auth' | 'create' | 'mint'): string;
|
|
15
|
+
/**
|
|
16
|
+
* Get DTO expiration timestamp
|
|
17
|
+
* GalaChain DTOs expire after 60 seconds
|
|
18
|
+
*
|
|
19
|
+
* @returns Current timestamp + 60 seconds in milliseconds
|
|
20
|
+
*/
|
|
21
|
+
export declare function getNftDtoExpiration(): number;
|
|
22
|
+
/**
|
|
23
|
+
* Validate NFT collection name format
|
|
24
|
+
* Rules: alphanumeric (a-z, A-Z, 0-9), 3-50 characters
|
|
25
|
+
*
|
|
26
|
+
* @param name - Collection name to validate
|
|
27
|
+
* @returns True if name is valid format
|
|
28
|
+
*/
|
|
29
|
+
export declare function validateCollectionName(name: string): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Validate token symbol format
|
|
32
|
+
* Rules: letters only (a-z, A-Z), 1-8 characters
|
|
33
|
+
*
|
|
34
|
+
* @param symbol - Token symbol to validate
|
|
35
|
+
* @returns True if symbol is valid format
|
|
36
|
+
*/
|
|
37
|
+
export declare function validateTokenSymbol(symbol: string): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Format number as whole number string for GalaChain
|
|
40
|
+
* Truncates decimals and converts to string
|
|
41
|
+
*
|
|
42
|
+
* @param value - Number or string value to format
|
|
43
|
+
* @returns Whole number as string (e.g., "1000")
|
|
44
|
+
*/
|
|
45
|
+
export declare function formatWholeNumber(value: string | number): string;
|
|
46
|
+
/**
|
|
47
|
+
* Check if string is valid hex
|
|
48
|
+
* Used for additionalKey validation
|
|
49
|
+
*
|
|
50
|
+
* @param str - String to check
|
|
51
|
+
* @returns True if string is valid hex
|
|
52
|
+
*/
|
|
53
|
+
export declare function isValidHex(str: string): boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Validate GalaChain address format
|
|
56
|
+
* Supports eth|{hex} format
|
|
57
|
+
*
|
|
58
|
+
* @param address - Address to validate
|
|
59
|
+
* @returns True if address is valid format
|
|
60
|
+
*/
|
|
61
|
+
export declare function validateGalaChainAddress(address: string): boolean;
|
|
62
|
+
//# sourceMappingURL=nft-helpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nft-helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/nft-helpers.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAI/E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAE5C;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAK5D;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAK3D;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAOhE;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAK/C;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAKjE"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gala-chain/launchpad-sdk",
|
|
3
|
-
"version": "5.0.4-beta.
|
|
4
|
-
"description": "TypeScript SDK for Gala Launchpad Backend API -
|
|
3
|
+
"version": "5.0.4-beta.2",
|
|
4
|
+
"description": "TypeScript SDK for Gala Launchpad Backend API - 217 public methods 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, streaming, chat, bans, moderator invites, 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",
|
|
@@ -147,7 +147,6 @@
|
|
|
147
147
|
"demo:bridge:bridgeable": "tsx examples/bridge/bridgeable-tokens.ts",
|
|
148
148
|
"demo:bridge:tx-status": "tsx examples/bridge/transaction-status.ts",
|
|
149
149
|
"demo:bridge:check-balances": "tsx examples/bridge/check-balances.ts",
|
|
150
|
-
"demo:bridge:debug-fee": "tsx examples/bridge/debug-fee.ts",
|
|
151
150
|
"demo:bridge:test-debug-unwrap": "tsx examples/bridge/test-debug-unwrap.ts",
|
|
152
151
|
"demo:bridge:test-unwrap-execution": "tsx examples/bridge/test-unwrap-execution.ts",
|
|
153
152
|
"demo:bridge:test-wrap-debug": "tsx examples/bridge/test-wrap-debug.ts",
|
|
@@ -190,6 +189,11 @@
|
|
|
190
189
|
"demo:api-keys:lifecycle": "tsx examples/api-keys/complete-lifecycle.ts",
|
|
191
190
|
"demo:api-keys:delegation": "tsx examples/api-keys/token-delegation.ts",
|
|
192
191
|
"demo:api-keys:advanced-config": "tsx examples/api-keys/advanced-configuration.ts",
|
|
192
|
+
"demo:nft": "tsx examples/nft/demo-orchestrator.ts",
|
|
193
|
+
"demo:nft:fees": "tsx examples/nft/demo-fee-calculations.ts",
|
|
194
|
+
"demo:nft:collection": "tsx examples/nft/demo-collection-management.ts",
|
|
195
|
+
"demo:nft:minting": "tsx examples/nft/demo-minting.ts",
|
|
196
|
+
"demo:nft:portfolio": "tsx examples/nft/demo-portfolio-query.ts",
|
|
193
197
|
"test:demos:core": "npm run demo && npm run demo:read-only && npm run demo:authenticated && npm run demo:privatekey-override",
|
|
194
198
|
"test:demos:dex": "npm run demo:dex:pools && npm run demo:dex:pricing && npm run demo:dex:quotes && npm run demo:dex && npm run demo:dex:roundtrip",
|
|
195
199
|
"test:demos:liquidity": "npm run demo:liquidity:all",
|
|
@@ -306,13 +310,13 @@
|
|
|
306
310
|
"not ie 11"
|
|
307
311
|
],
|
|
308
312
|
"dependencies": {
|
|
309
|
-
"@gala-chain/api": "^2.
|
|
313
|
+
"@gala-chain/api": "^2.7.0",
|
|
310
314
|
"@gala-chain/connect": "^2.7.0",
|
|
311
315
|
"@gala-chain/dex": "^1.0.26",
|
|
312
316
|
"@modelcontextprotocol/sdk": "1.25.2",
|
|
313
|
-
"@solana/spl-token": "^0.
|
|
317
|
+
"@solana/spl-token": "^0.4.14",
|
|
314
318
|
"@solana/web3.js": "^1.98.4",
|
|
315
|
-
"@types/uuid": "^
|
|
319
|
+
"@types/uuid": "^11.0.0",
|
|
316
320
|
"axios": "^1.13.2",
|
|
317
321
|
"bignumber.js": "^9.3.1",
|
|
318
322
|
"bs58": "^6.0.0",
|
|
@@ -320,9 +324,9 @@
|
|
|
320
324
|
"ethers": "^6.16.0",
|
|
321
325
|
"json-stringify-deterministic": "^1.0.12",
|
|
322
326
|
"socket.io-client": "^4.8.3",
|
|
323
|
-
"uuid": "^
|
|
327
|
+
"uuid": "^13.0.0",
|
|
324
328
|
"web-file-polyfill": "^1.0.4",
|
|
325
|
-
"zod": "^3.
|
|
329
|
+
"zod": "^4.3.5"
|
|
326
330
|
},
|
|
327
331
|
"size-limit": [
|
|
328
332
|
{
|