@gearbox-protocol/sdk 3.0.0-vfour.221 → 3.0.0-vfour.223
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 +15 -13
- package/dist/cjs/sdk/index.d.ts +2 -2
- package/dist/esm/sdk/index.d.mts +2 -2
- package/dist/esm/sdk/index.mjs +15 -13
- 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,16 +56979,16 @@ 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" },
|
|
@@ -56999,16 +56999,18 @@ var GaugeContract = class extends BaseContract {
|
|
|
56999
56999
|
gauge.baseParams.serializedParams
|
|
57000
57000
|
);
|
|
57001
57001
|
this.epochFrozen = epochFrozen;
|
|
57002
|
-
this.
|
|
57002
|
+
this.epochLastUpdate = epochLastUpdate;
|
|
57003
57003
|
this.rates = new AddressMap(gauge.rates.map((r) => [r.token, r.rate]));
|
|
57004
57004
|
this.quotaParams = new AddressMap();
|
|
57005
|
-
for (
|
|
57006
|
-
|
|
57007
|
-
|
|
57008
|
-
|
|
57009
|
-
|
|
57010
|
-
|
|
57011
|
-
|
|
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
|
|
57012
57014
|
});
|
|
57013
57015
|
}
|
|
57014
57016
|
}
|
|
@@ -57030,7 +57032,7 @@ var GaugeContract = class extends BaseContract {
|
|
|
57030
57032
|
stateHuman(raw) {
|
|
57031
57033
|
return {
|
|
57032
57034
|
...super.stateHuman(raw),
|
|
57033
|
-
|
|
57035
|
+
epochLastUpdate: Number(this.epochLastUpdate),
|
|
57034
57036
|
epochFrozen: this.epochFrozen,
|
|
57035
57037
|
quotaParams: this.quotaParams.entries().reduce(
|
|
57036
57038
|
(acc, [address, params]) => ({
|
package/dist/cjs/sdk/index.d.ts
CHANGED
|
@@ -89959,7 +89959,7 @@ interface GaugeParams {
|
|
|
89959
89959
|
declare class GaugeContract extends BaseContract<abi$b> {
|
|
89960
89960
|
readonly quotaParams: AddressMap<GaugeParams>;
|
|
89961
89961
|
readonly epochFrozen: boolean;
|
|
89962
|
-
readonly
|
|
89962
|
+
readonly epochLastUpdate: number;
|
|
89963
89963
|
readonly rates: AddressMap<number>;
|
|
89964
89964
|
constructor(sdk: GearboxSDK, pool: PoolData, gauge: RateKeeperData);
|
|
89965
89965
|
processLog(log: Log<bigint, number, false, undefined, undefined, abi$b, ContractEventName<abi$b>>): void;
|
|
@@ -91756,7 +91756,7 @@ interface GaugeParamsHuman {
|
|
|
91756
91756
|
rate: string;
|
|
91757
91757
|
}
|
|
91758
91758
|
interface GaugeStateHuman extends BaseContractStateHuman {
|
|
91759
|
-
|
|
91759
|
+
epochLastUpdate: number;
|
|
91760
91760
|
epochFrozen: boolean;
|
|
91761
91761
|
quotaParams: Record<Address, GaugeParamsHuman>;
|
|
91762
91762
|
}
|
package/dist/esm/sdk/index.d.mts
CHANGED
|
@@ -89959,7 +89959,7 @@ interface GaugeParams {
|
|
|
89959
89959
|
declare class GaugeContract extends BaseContract<abi$b> {
|
|
89960
89960
|
readonly quotaParams: AddressMap<GaugeParams>;
|
|
89961
89961
|
readonly epochFrozen: boolean;
|
|
89962
|
-
readonly
|
|
89962
|
+
readonly epochLastUpdate: number;
|
|
89963
89963
|
readonly rates: AddressMap<number>;
|
|
89964
89964
|
constructor(sdk: GearboxSDK, pool: PoolData, gauge: RateKeeperData);
|
|
89965
89965
|
processLog(log: Log<bigint, number, false, undefined, undefined, abi$b, ContractEventName<abi$b>>): void;
|
|
@@ -91756,7 +91756,7 @@ interface GaugeParamsHuman {
|
|
|
91756
91756
|
rate: string;
|
|
91757
91757
|
}
|
|
91758
91758
|
interface GaugeStateHuman extends BaseContractStateHuman {
|
|
91759
|
-
|
|
91759
|
+
epochLastUpdate: number;
|
|
91760
91760
|
epochFrozen: boolean;
|
|
91761
91761
|
quotaParams: Record<Address, GaugeParamsHuman>;
|
|
91762
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,16 +56972,16 @@ 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" },
|
|
@@ -56992,16 +56992,18 @@ var GaugeContract = class extends BaseContract {
|
|
|
56992
56992
|
gauge.baseParams.serializedParams
|
|
56993
56993
|
);
|
|
56994
56994
|
this.epochFrozen = epochFrozen;
|
|
56995
|
-
this.
|
|
56995
|
+
this.epochLastUpdate = epochLastUpdate;
|
|
56996
56996
|
this.rates = new AddressMap(gauge.rates.map((r) => [r.token, r.rate]));
|
|
56997
56997
|
this.quotaParams = new AddressMap();
|
|
56998
|
-
for (
|
|
56999
|
-
|
|
57000
|
-
|
|
57001
|
-
|
|
57002
|
-
|
|
57003
|
-
|
|
57004
|
-
|
|
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
|
|
57005
57007
|
});
|
|
57006
57008
|
}
|
|
57007
57009
|
}
|
|
@@ -57023,7 +57025,7 @@ var GaugeContract = class extends BaseContract {
|
|
|
57023
57025
|
stateHuman(raw) {
|
|
57024
57026
|
return {
|
|
57025
57027
|
...super.stateHuman(raw),
|
|
57026
|
-
|
|
57028
|
+
epochLastUpdate: Number(this.epochLastUpdate),
|
|
57027
57029
|
epochFrozen: this.epochFrozen,
|
|
57028
57030
|
quotaParams: this.quotaParams.entries().reduce(
|
|
57029
57031
|
(acc, [address, params]) => ({
|