@gainsnetwork/sdk 1.5.0-rc6 → 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.
@@ -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: Array<{
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,