@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.
- package/dist/cjs/sdk/index.cjs +17 -19
- package/dist/cjs/sdk/index.d.ts +2 -4
- package/dist/esm/sdk/index.d.mts +2 -4
- package/dist/esm/sdk/index.mjs +17 -19
- package/package.json +1 -1
package/dist/cjs/sdk/index.cjs
CHANGED
|
@@ -56971,7 +56971,7 @@ var CreditSuite = class extends SDKConstruct {
|
|
|
56971
56971
|
var GaugeContract = class extends BaseContract {
|
|
56972
56972
|
quotaParams;
|
|
56973
56973
|
epochFrozen;
|
|
56974
|
-
|
|
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,
|
|
56982
|
+
const [_voter, epochLastUpdate, epochFrozen, gaugeTokens, gaugeParams] = viem.decodeAbiParameters(
|
|
56983
56983
|
[
|
|
56984
56984
|
{ name: "voter", type: "address" },
|
|
56985
|
-
{ name: "
|
|
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.
|
|
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 (
|
|
57008
|
-
|
|
57009
|
-
|
|
57010
|
-
|
|
57011
|
-
|
|
57012
|
-
|
|
57013
|
-
|
|
57014
|
-
|
|
57015
|
-
rate: this.rates.get(
|
|
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
|
-
|
|
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,
|
package/dist/cjs/sdk/index.d.ts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
91759
|
+
epochLastUpdate: number;
|
|
91762
91760
|
epochFrozen: boolean;
|
|
91763
91761
|
quotaParams: Record<Address, GaugeParamsHuman>;
|
|
91764
91762
|
}
|
package/dist/esm/sdk/index.d.mts
CHANGED
|
@@ -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
|
|
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
|
-
|
|
91759
|
+
epochLastUpdate: number;
|
|
91762
91760
|
epochFrozen: boolean;
|
|
91763
91761
|
quotaParams: Record<Address, GaugeParamsHuman>;
|
|
91764
91762
|
}
|
package/dist/esm/sdk/index.mjs
CHANGED
|
@@ -56964,7 +56964,7 @@ var CreditSuite = class extends SDKConstruct {
|
|
|
56964
56964
|
var GaugeContract = class extends BaseContract {
|
|
56965
56965
|
quotaParams;
|
|
56966
56966
|
epochFrozen;
|
|
56967
|
-
|
|
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,
|
|
56975
|
+
const [_voter, epochLastUpdate, epochFrozen, gaugeTokens, gaugeParams] = decodeAbiParameters(
|
|
56976
56976
|
[
|
|
56977
56977
|
{ name: "voter", type: "address" },
|
|
56978
|
-
{ name: "
|
|
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.
|
|
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 (
|
|
57001
|
-
|
|
57002
|
-
|
|
57003
|
-
|
|
57004
|
-
|
|
57005
|
-
|
|
57006
|
-
|
|
57007
|
-
|
|
57008
|
-
rate: this.rates.get(
|
|
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
|
-
|
|
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,
|