@gearbox-protocol/sdk 3.0.0-vfour.222 → 3.0.0-vfour.224

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.
@@ -56971,7 +56971,7 @@ var CreditSuite = class extends SDKConstruct {
56971
56971
  var GaugeContract = class extends BaseContract {
56972
56972
  quotaParams;
56973
56973
  epochFrozen;
56974
- currentEpoch;
56974
+ epochLastUpdate;
56975
56975
  rates;
56976
56976
  constructor(sdk, pool, gauge) {
56977
56977
  super(sdk, {
@@ -56979,40 +56979,38 @@ var GaugeContract = class extends BaseContract {
56979
56979
  name: `Gauge(${pool.name})`,
56980
56980
  abi: gaugeV3Abi
56981
56981
  });
56982
- const [_voter, currentEpoch, epochFrozen, gaugeParams] = viem.decodeAbiParameters(
56982
+ const [_voter, epochLastUpdate, epochFrozen, gaugeTokens, gaugeParams] = viem.decodeAbiParameters(
56983
56983
  [
56984
56984
  { name: "voter", type: "address" },
56985
- { name: "currentEpoch", type: "uint16" },
56985
+ { name: "epochLastUpdate", type: "uint16" },
56986
56986
  { name: "epochFrozen", type: "bool" },
56987
+ { name: "tokens", type: "address[]" },
56987
56988
  {
56988
56989
  name: "quotaParams",
56989
56990
  type: "tuple[]",
56990
56991
  components: [
56991
- { name: "token", type: "address" },
56992
56992
  { name: "minRate", type: "uint16" },
56993
56993
  { name: "maxRate", type: "uint16" },
56994
56994
  { name: "totalVotesLpSide", type: "uint96" },
56995
- { name: "totalVotesCaSide", type: "uint96" },
56996
- { name: "stakerVotesLpSide", type: "uint96" },
56997
- { name: "stakerVotesCaSide", type: "uint96" }
56995
+ { name: "totalVotesCaSide", type: "uint96" }
56998
56996
  ]
56999
56997
  }
57000
56998
  ],
57001
56999
  gauge.baseParams.serializedParams
57002
57000
  );
57003
57001
  this.epochFrozen = epochFrozen;
57004
- this.currentEpoch = currentEpoch;
57002
+ this.epochLastUpdate = epochLastUpdate;
57005
57003
  this.rates = new AddressMap(gauge.rates.map((r) => [r.token, r.rate]));
57006
57004
  this.quotaParams = new AddressMap();
57007
- for (const g of gaugeParams) {
57008
- this.quotaParams.upsert(g.token, {
57009
- minRate: g.minRate,
57010
- maxRate: g.maxRate,
57011
- totalVotesLpSide: g.totalVotesLpSide,
57012
- totalVotesCaSide: g.totalVotesCaSide,
57013
- stakerVotesLpSide: g.stakerVotesLpSide,
57014
- stakerVotesCaSide: g.stakerVotesCaSide,
57015
- rate: this.rates.get(g.token) ?? 0
57005
+ for (let i = 0; i < gaugeParams.length; i++) {
57006
+ const token = gaugeTokens[i];
57007
+ const params = gaugeParams[i];
57008
+ this.quotaParams.upsert(token, {
57009
+ minRate: params.minRate,
57010
+ maxRate: params.maxRate,
57011
+ totalVotesLpSide: params.totalVotesLpSide,
57012
+ totalVotesCaSide: params.totalVotesCaSide,
57013
+ rate: this.rates.get(token) ?? 0
57016
57014
  });
57017
57015
  }
57018
57016
  }
@@ -57034,12 +57032,12 @@ var GaugeContract = class extends BaseContract {
57034
57032
  stateHuman(raw) {
57035
57033
  return {
57036
57034
  ...super.stateHuman(raw),
57037
- currentEpoch: Number(this.currentEpoch),
57035
+ epochLastUpdate: Number(this.epochLastUpdate),
57038
57036
  epochFrozen: this.epochFrozen,
57039
57037
  quotaParams: this.quotaParams.entries().reduce(
57040
57038
  (acc, [address, params]) => ({
57041
57039
  ...acc,
57042
- [address]: {
57040
+ [this.labelAddress(address)]: {
57043
57041
  minRate: percentFmt(params.minRate, raw),
57044
57042
  maxRate: percentFmt(params.maxRate, raw),
57045
57043
  totalVotesLpSide: params.totalVotesLpSide / WAD,
@@ -89954,14 +89954,12 @@ interface GaugeParams {
89954
89954
  maxRate: number;
89955
89955
  totalVotesLpSide: bigint;
89956
89956
  totalVotesCaSide: bigint;
89957
- stakerVotesLpSide: bigint;
89958
- stakerVotesCaSide: bigint;
89959
89957
  rate: number;
89960
89958
  }
89961
89959
  declare class GaugeContract extends BaseContract<abi$b> {
89962
89960
  readonly quotaParams: AddressMap<GaugeParams>;
89963
89961
  readonly epochFrozen: boolean;
89964
- readonly currentEpoch: number;
89962
+ readonly epochLastUpdate: number;
89965
89963
  readonly rates: AddressMap<number>;
89966
89964
  constructor(sdk: GearboxSDK, pool: PoolData, gauge: RateKeeperData);
89967
89965
  processLog(log: Log<bigint, number, false, undefined, undefined, abi$b, ContractEventName<abi$b>>): void;
@@ -91758,7 +91756,7 @@ interface GaugeParamsHuman {
91758
91756
  rate: string;
91759
91757
  }
91760
91758
  interface GaugeStateHuman extends BaseContractStateHuman {
91761
- currentEpoch: number;
91759
+ epochLastUpdate: number;
91762
91760
  epochFrozen: boolean;
91763
91761
  quotaParams: Record<Address, GaugeParamsHuman>;
91764
91762
  }
@@ -89954,14 +89954,12 @@ interface GaugeParams {
89954
89954
  maxRate: number;
89955
89955
  totalVotesLpSide: bigint;
89956
89956
  totalVotesCaSide: bigint;
89957
- stakerVotesLpSide: bigint;
89958
- stakerVotesCaSide: bigint;
89959
89957
  rate: number;
89960
89958
  }
89961
89959
  declare class GaugeContract extends BaseContract<abi$b> {
89962
89960
  readonly quotaParams: AddressMap<GaugeParams>;
89963
89961
  readonly epochFrozen: boolean;
89964
- readonly currentEpoch: number;
89962
+ readonly epochLastUpdate: number;
89965
89963
  readonly rates: AddressMap<number>;
89966
89964
  constructor(sdk: GearboxSDK, pool: PoolData, gauge: RateKeeperData);
89967
89965
  processLog(log: Log<bigint, number, false, undefined, undefined, abi$b, ContractEventName<abi$b>>): void;
@@ -91758,7 +91756,7 @@ interface GaugeParamsHuman {
91758
91756
  rate: string;
91759
91757
  }
91760
91758
  interface GaugeStateHuman extends BaseContractStateHuman {
91761
- currentEpoch: number;
91759
+ epochLastUpdate: number;
91762
91760
  epochFrozen: boolean;
91763
91761
  quotaParams: Record<Address, GaugeParamsHuman>;
91764
91762
  }
@@ -56964,7 +56964,7 @@ var CreditSuite = class extends SDKConstruct {
56964
56964
  var GaugeContract = class extends BaseContract {
56965
56965
  quotaParams;
56966
56966
  epochFrozen;
56967
- currentEpoch;
56967
+ epochLastUpdate;
56968
56968
  rates;
56969
56969
  constructor(sdk, pool, gauge) {
56970
56970
  super(sdk, {
@@ -56972,40 +56972,38 @@ var GaugeContract = class extends BaseContract {
56972
56972
  name: `Gauge(${pool.name})`,
56973
56973
  abi: gaugeV3Abi
56974
56974
  });
56975
- const [_voter, currentEpoch, epochFrozen, gaugeParams] = decodeAbiParameters(
56975
+ const [_voter, epochLastUpdate, epochFrozen, gaugeTokens, gaugeParams] = decodeAbiParameters(
56976
56976
  [
56977
56977
  { name: "voter", type: "address" },
56978
- { name: "currentEpoch", type: "uint16" },
56978
+ { name: "epochLastUpdate", type: "uint16" },
56979
56979
  { name: "epochFrozen", type: "bool" },
56980
+ { name: "tokens", type: "address[]" },
56980
56981
  {
56981
56982
  name: "quotaParams",
56982
56983
  type: "tuple[]",
56983
56984
  components: [
56984
- { name: "token", type: "address" },
56985
56985
  { name: "minRate", type: "uint16" },
56986
56986
  { name: "maxRate", type: "uint16" },
56987
56987
  { name: "totalVotesLpSide", type: "uint96" },
56988
- { name: "totalVotesCaSide", type: "uint96" },
56989
- { name: "stakerVotesLpSide", type: "uint96" },
56990
- { name: "stakerVotesCaSide", type: "uint96" }
56988
+ { name: "totalVotesCaSide", type: "uint96" }
56991
56989
  ]
56992
56990
  }
56993
56991
  ],
56994
56992
  gauge.baseParams.serializedParams
56995
56993
  );
56996
56994
  this.epochFrozen = epochFrozen;
56997
- this.currentEpoch = currentEpoch;
56995
+ this.epochLastUpdate = epochLastUpdate;
56998
56996
  this.rates = new AddressMap(gauge.rates.map((r) => [r.token, r.rate]));
56999
56997
  this.quotaParams = new AddressMap();
57000
- for (const g of gaugeParams) {
57001
- this.quotaParams.upsert(g.token, {
57002
- minRate: g.minRate,
57003
- maxRate: g.maxRate,
57004
- totalVotesLpSide: g.totalVotesLpSide,
57005
- totalVotesCaSide: g.totalVotesCaSide,
57006
- stakerVotesLpSide: g.stakerVotesLpSide,
57007
- stakerVotesCaSide: g.stakerVotesCaSide,
57008
- rate: this.rates.get(g.token) ?? 0
56998
+ for (let i = 0; i < gaugeParams.length; i++) {
56999
+ const token = gaugeTokens[i];
57000
+ const params = gaugeParams[i];
57001
+ this.quotaParams.upsert(token, {
57002
+ minRate: params.minRate,
57003
+ maxRate: params.maxRate,
57004
+ totalVotesLpSide: params.totalVotesLpSide,
57005
+ totalVotesCaSide: params.totalVotesCaSide,
57006
+ rate: this.rates.get(token) ?? 0
57009
57007
  });
57010
57008
  }
57011
57009
  }
@@ -57027,12 +57025,12 @@ var GaugeContract = class extends BaseContract {
57027
57025
  stateHuman(raw) {
57028
57026
  return {
57029
57027
  ...super.stateHuman(raw),
57030
- currentEpoch: Number(this.currentEpoch),
57028
+ epochLastUpdate: Number(this.epochLastUpdate),
57031
57029
  epochFrozen: this.epochFrozen,
57032
57030
  quotaParams: this.quotaParams.entries().reduce(
57033
57031
  (acc, [address, params]) => ({
57034
57032
  ...acc,
57035
- [address]: {
57033
+ [this.labelAddress(address)]: {
57036
57034
  minRate: percentFmt(params.minRate, raw),
57037
57035
  maxRate: percentFmt(params.maxRate, raw),
57038
57036
  totalVotesLpSide: params.totalVotesLpSide / WAD,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "3.0.0-vfour.222",
3
+ "version": "3.0.0-vfour.224",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.cjs",