@gainsnetwork/sdk 1.5.0-rc5 → 1.6.0-rc1
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/LICENSE +21 -0
- package/lib/backend/tradingVariables/backend.types.d.ts +16 -4
- package/lib/backend/tradingVariables/converter.js +14 -0
- package/lib/constants.d.ts +7 -0
- package/lib/constants.js +10 -4
- package/lib/contracts/types/generated/GNSMultiCollatDiamond.d.ts +298 -1
- package/lib/contracts/types/generated/factories/GNSMultiCollatDiamond__factory.js +565 -0
- package/lib/contracts/utils/pairs.js +7 -0
- package/lib/trade/fees/tiers/converter.d.ts +16 -6
- package/lib/trade/fees/tiers/converter.js +26 -7
- package/lib/trade/fees/tiers/index.d.ts +8 -1
- package/lib/trade/fees/tiers/index.js +22 -5
- package/lib/trade/fees/tiers/types.d.ts +7 -0
- package/lib/trade/types.d.ts +13 -2
- package/lib/trade/types.js +7 -0
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Ingenium Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -253,12 +253,20 @@ export type TraderInfoBackend = {
|
|
|
253
253
|
lastDayUpdated: number;
|
|
254
254
|
trailingPoints: string;
|
|
255
255
|
};
|
|
256
|
+
export type StakingInfoBackend = {
|
|
257
|
+
stakedGns: string;
|
|
258
|
+
stakedVaultGns: string;
|
|
259
|
+
bonusAmount: string;
|
|
260
|
+
stakeTimestamp: number;
|
|
261
|
+
feeMultiplierCache: string;
|
|
262
|
+
};
|
|
256
263
|
export type TraderEnrollmentBackend = {
|
|
257
264
|
status: number;
|
|
258
265
|
};
|
|
259
266
|
export type TraderFeeTiersBackend = {
|
|
260
267
|
traderEnrollment: TraderEnrollmentBackend;
|
|
261
268
|
traderInfo: TraderInfoBackend;
|
|
269
|
+
stakingInfo: StakingInfoBackend;
|
|
262
270
|
lastDayUpdatedPoints: string;
|
|
263
271
|
inboundPoints: string;
|
|
264
272
|
outboundPoints: string;
|
|
@@ -304,13 +312,17 @@ export type CollateralConfigBackend = {
|
|
|
304
312
|
precisionDelta: string;
|
|
305
313
|
decimals: number;
|
|
306
314
|
};
|
|
315
|
+
export type FeeTierBackend = {
|
|
316
|
+
feeMultiplier: string;
|
|
317
|
+
pointsThreshold: string;
|
|
318
|
+
};
|
|
307
319
|
export type FeeTiersBackend = {
|
|
308
|
-
tiers:
|
|
309
|
-
feeMultiplier: string;
|
|
310
|
-
pointsThreshold: string;
|
|
311
|
-
}>;
|
|
320
|
+
tiers: FeeTierBackend[];
|
|
312
321
|
multipliers: string[];
|
|
313
322
|
currentDay: number;
|
|
323
|
+
stakingTiers: FeeTierBackend[];
|
|
324
|
+
gnsVaultAddress: string;
|
|
325
|
+
useGnsVaultBalance: boolean;
|
|
314
326
|
};
|
|
315
327
|
export type GlobalTradeFeeParamsBackend = {
|
|
316
328
|
referralFeeP: string;
|
|
@@ -305,6 +305,13 @@ const convertFeeTiers = (feeTiersBackend) => ({
|
|
|
305
305
|
})),
|
|
306
306
|
multipliers: feeTiersBackend?.multipliers?.map(mult => parseFloat(mult) / 1e3) || [],
|
|
307
307
|
currentDay: feeTiersBackend?.currentDay || 0,
|
|
308
|
+
stakingTiers: feeTiersBackend?.stakingTiers.map(tier => ({
|
|
309
|
+
feeMultiplier: Number(tier.feeMultiplier) / 1e3,
|
|
310
|
+
pointsThreshold: parseFloat(tier.pointsThreshold),
|
|
311
|
+
})) || [],
|
|
312
|
+
gnsVaultAddress: feeTiersBackend?.gnsVaultAddress ||
|
|
313
|
+
"0x0000000000000000000000000000000000000000",
|
|
314
|
+
useGnsVaultBalance: feeTiersBackend?.useGnsVaultBalance || false,
|
|
308
315
|
});
|
|
309
316
|
exports.convertFeeTiers = convertFeeTiers;
|
|
310
317
|
const convertTraderFeeTiers = (traderFeeTiers) => ({
|
|
@@ -315,6 +322,13 @@ const convertTraderFeeTiers = (traderFeeTiers) => ({
|
|
|
315
322
|
lastDayUpdated: traderFeeTiers.traderInfo.lastDayUpdated,
|
|
316
323
|
trailingPoints: parseFloat(traderFeeTiers.traderInfo.trailingPoints) / 1e18,
|
|
317
324
|
},
|
|
325
|
+
stakingInfo: {
|
|
326
|
+
stakedGns: parseFloat(traderFeeTiers.stakingInfo.stakedGns) / 1e18,
|
|
327
|
+
stakedVaultGns: parseFloat(traderFeeTiers.stakingInfo.stakedVaultGns) / 1e18,
|
|
328
|
+
bonusAmount: Number(traderFeeTiers.stakingInfo.bonusAmount),
|
|
329
|
+
stakeTimestamp: traderFeeTiers.stakingInfo.stakeTimestamp,
|
|
330
|
+
feeMultiplierCache: parseFloat(traderFeeTiers.stakingInfo.feeMultiplierCache) / 1e3,
|
|
331
|
+
},
|
|
318
332
|
inboundPoints: parseFloat(traderFeeTiers.inboundPoints) / 1e18,
|
|
319
333
|
outboundPoints: parseFloat(traderFeeTiers.outboundPoints) / 1e18,
|
|
320
334
|
lastDayUpdatedPoints: parseFloat(traderFeeTiers.lastDayUpdatedPoints) / 1e18,
|
package/lib/constants.d.ts
CHANGED
|
@@ -424,6 +424,13 @@ export declare const pairs: {
|
|
|
424
424
|
"DRIFT/USD": string;
|
|
425
425
|
"MYX/USD": string;
|
|
426
426
|
"NOM/USD": string;
|
|
427
|
+
"FLUID/USD": string;
|
|
428
|
+
"LQTY/USD": string;
|
|
429
|
+
"L3/USD": string;
|
|
430
|
+
"CAMP/USD": string;
|
|
431
|
+
"SOMI/USD": string;
|
|
432
|
+
"HEMI/USD": string;
|
|
433
|
+
"FF/USD": string;
|
|
427
434
|
};
|
|
428
435
|
export declare const syntheticPairs: Set<string>;
|
|
429
436
|
export declare const parentToSyntheticPairMap: Map<string, string>;
|
package/lib/constants.js
CHANGED
|
@@ -432,6 +432,13 @@ exports.pairs = {
|
|
|
432
432
|
"DRIFT/USD": CRYPTO,
|
|
433
433
|
"MYX/USD": CRYPTO,
|
|
434
434
|
"NOM/USD": CRYPTO,
|
|
435
|
+
"FLUID/USD": CRYPTO,
|
|
436
|
+
"LQTY/USD": CRYPTO,
|
|
437
|
+
"L3/USD": CRYPTO,
|
|
438
|
+
"CAMP/USD": CRYPTO,
|
|
439
|
+
"SOMI/USD": CRYPTO,
|
|
440
|
+
"HEMI/USD": CRYPTO,
|
|
441
|
+
"FF/USD": CRYPTO,
|
|
435
442
|
};
|
|
436
443
|
exports.syntheticPairs = new Set([
|
|
437
444
|
"BTCDEGEN/USD",
|
|
@@ -479,13 +486,12 @@ exports.stockSplits = {
|
|
|
479
486
|
"TSLA_1/USD": { date: "8/25/2022", split: 3 },
|
|
480
487
|
};
|
|
481
488
|
exports.delistedPairIxs = new Set([
|
|
482
|
-
4, 6, 12, 15,
|
|
489
|
+
4, 6, 12, 15, 24, 25, 27, 28, 30, 31, 36, 48, 51, 52, 53, 54, 56, 59, 60,
|
|
483
490
|
61, 63, 66, 67, 68, 69, 70, 71, 72, 73, 75, 76, 77, 78, 79, 95, 96, 97, 98,
|
|
484
491
|
99, 101, 106, 111, 113, 114, 116, 118, 120, 122, 123, 125, 127, 130, 147, 152,
|
|
485
492
|
160, 163, 170, 179, 182, 183, 188, 189, 190, 208, 209, 225, 229, 230, 231,
|
|
486
|
-
238, 239, 241, 250, 253, 254, 258, 270, 275, 276, 278, 279,
|
|
487
|
-
|
|
488
|
-
424,
|
|
493
|
+
238, 239, 241, 250, 253, 254, 258, 270, 275, 276, 278, 279, 285, 290, 294,
|
|
494
|
+
296, 305, 311, 330, 349, 352, 353, 354, 355, 357, 365, 366, 395, 396,
|
|
489
495
|
]);
|
|
490
496
|
exports.delistedGroupsIxs = new Set([]);
|
|
491
497
|
exports.DEFAULT_PROTECTION_CLOSE_FACTOR = 1;
|