@gearbox-protocol/sdk 3.0.0-vfour.40 → 3.0.0-vfour.41
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 +29 -12
- package/dist/cjs/sdk/index.d.ts +145 -138
- package/dist/esm/sdk/index.d.mts +145 -138
- package/dist/esm/sdk/index.mjs +30 -13
- package/package.json +1 -1
package/dist/cjs/sdk/index.cjs
CHANGED
|
@@ -19631,8 +19631,6 @@ var CreditConfiguratorContract = class extends BaseContract {
|
|
|
19631
19631
|
}
|
|
19632
19632
|
}
|
|
19633
19633
|
};
|
|
19634
|
-
|
|
19635
|
-
// src/sdk/market/CreditFacadeV300Contract.ts
|
|
19636
19634
|
var CreditFacadeV300Contract = class extends BaseContract {
|
|
19637
19635
|
state;
|
|
19638
19636
|
constructor(sdk, { creditFacade, creditManager }) {
|
|
@@ -19659,6 +19657,16 @@ var CreditFacadeV300Contract = class extends BaseContract {
|
|
|
19659
19657
|
isPaused: creditFacade.isPaused
|
|
19660
19658
|
};
|
|
19661
19659
|
}
|
|
19660
|
+
encodeOnDemandPriceUpdates(updates) {
|
|
19661
|
+
return updates.map((u) => ({
|
|
19662
|
+
target: this.address,
|
|
19663
|
+
callData: viem.encodeFunctionData({
|
|
19664
|
+
abi: iCreditFacadeV3MulticallAbi,
|
|
19665
|
+
functionName: "onDemandPriceUpdate",
|
|
19666
|
+
args: [u.token, u.reserve, u.data]
|
|
19667
|
+
})
|
|
19668
|
+
}));
|
|
19669
|
+
}
|
|
19662
19670
|
liquidateCreditAccount(ca, to, calls) {
|
|
19663
19671
|
return this.createRawTx({
|
|
19664
19672
|
functionName: "liquidateCreditAccount",
|
|
@@ -19715,8 +19723,6 @@ var CreditFacadeV300Contract = class extends BaseContract {
|
|
|
19715
19723
|
}
|
|
19716
19724
|
}
|
|
19717
19725
|
};
|
|
19718
|
-
|
|
19719
|
-
// src/sdk/market/CreditFacadeV310Contract.ts
|
|
19720
19726
|
var CreditFacadeV310Contract = class extends BaseContract {
|
|
19721
19727
|
state;
|
|
19722
19728
|
constructor(sdk, { creditFacade, creditManager }) {
|
|
@@ -19743,6 +19749,23 @@ var CreditFacadeV310Contract = class extends BaseContract {
|
|
|
19743
19749
|
isPaused: creditFacade.isPaused
|
|
19744
19750
|
};
|
|
19745
19751
|
}
|
|
19752
|
+
encodeOnDemandPriceUpdates(updates) {
|
|
19753
|
+
return [
|
|
19754
|
+
{
|
|
19755
|
+
target: this.address,
|
|
19756
|
+
callData: viem.encodeFunctionData({
|
|
19757
|
+
abi: iCreditFacadeV310MulticallAbi,
|
|
19758
|
+
functionName: "onDemandPriceUpdates",
|
|
19759
|
+
args: [
|
|
19760
|
+
updates.map((u) => ({
|
|
19761
|
+
priceFeed: u.priceFeed,
|
|
19762
|
+
data: u.data
|
|
19763
|
+
}))
|
|
19764
|
+
]
|
|
19765
|
+
})
|
|
19766
|
+
}
|
|
19767
|
+
];
|
|
19768
|
+
}
|
|
19746
19769
|
liquidateCreditAccount(ca, to, calls) {
|
|
19747
19770
|
return this.createRawTx({
|
|
19748
19771
|
functionName: "liquidateCreditAccount",
|
|
@@ -21252,6 +21275,7 @@ var PriceOracleContract = class extends BaseContract {
|
|
|
21252
21275
|
});
|
|
21253
21276
|
const data = args[0];
|
|
21254
21277
|
result.push({
|
|
21278
|
+
priceFeed,
|
|
21255
21279
|
token,
|
|
21256
21280
|
reserve,
|
|
21257
21281
|
data
|
|
@@ -21766,14 +21790,7 @@ var CreditAccountsService = class extends SDKConstruct {
|
|
|
21766
21790
|
async getPriceUpdatesForFacade(acc) {
|
|
21767
21791
|
const cm = this.sdk.marketRegister.findCreditManager(acc.creditManager);
|
|
21768
21792
|
const updates = await this.getOnDemandPriceUpdates(acc);
|
|
21769
|
-
return
|
|
21770
|
-
target: cm.creditFacade.address,
|
|
21771
|
-
callData: viem.encodeFunctionData({
|
|
21772
|
-
abi: iCreditFacadeV3MulticallAbi,
|
|
21773
|
-
functionName: "onDemandPriceUpdate",
|
|
21774
|
-
args: [token, reserve, data]
|
|
21775
|
-
})
|
|
21776
|
-
}));
|
|
21793
|
+
return cm.creditFacade.encodeOnDemandPriceUpdates(updates);
|
|
21777
21794
|
}
|
|
21778
21795
|
async #prepareCloseCreditAccount(ca, cm, assetsToKeep, to, slippage = 50n) {
|
|
21779
21796
|
const closePath = await this.sdk.router.findBestClosePath(
|
package/dist/cjs/sdk/index.d.ts
CHANGED
|
@@ -16163,24 +16163,107 @@ declare class CreditConfiguratorContract extends BaseContract<abi$o> {
|
|
|
16163
16163
|
parseFunctionParams(params: DecodeFunctionDataReturnType<abi$o>): Array<string> | undefined;
|
|
16164
16164
|
}
|
|
16165
16165
|
|
|
16166
|
-
type abi$n = typeof
|
|
16167
|
-
|
|
16166
|
+
type abi$n = typeof priceOracleV3Abi;
|
|
16167
|
+
interface PriceFeedsForTokensOptions {
|
|
16168
|
+
main?: boolean;
|
|
16169
|
+
reserve?: boolean;
|
|
16170
|
+
}
|
|
16171
|
+
/**
|
|
16172
|
+
* Data to be passed to credit facade's multicall
|
|
16173
|
+
* Compatible with both v300 and v310 facades
|
|
16174
|
+
*/
|
|
16175
|
+
interface OnDemandPriceUpdate {
|
|
16176
|
+
priceFeed: Address;
|
|
16177
|
+
token: Address;
|
|
16178
|
+
reserve: boolean;
|
|
16179
|
+
data: Hex;
|
|
16180
|
+
}
|
|
16181
|
+
declare class PriceOracleContract extends BaseContract<abi$n> {
|
|
16182
|
+
#private;
|
|
16183
|
+
/**
|
|
16184
|
+
* Underlying token of market to which this price oracle belongs
|
|
16185
|
+
*/
|
|
16186
|
+
readonly underlying: Address;
|
|
16187
|
+
/**
|
|
16188
|
+
* Mapping Token => [PriceFeed Address, stalenessPeriod]
|
|
16189
|
+
*/
|
|
16190
|
+
readonly mainPriceFeeds: Record<Address, PriceFeedRef>;
|
|
16191
|
+
/**
|
|
16192
|
+
* Mapping Token => [PriceFeed Address, stalenessPeriod]
|
|
16193
|
+
*/
|
|
16194
|
+
readonly reservePriceFeeds: Record<Address, PriceFeedRef>;
|
|
16195
|
+
/**
|
|
16196
|
+
* Mapping Token => Price in underlying
|
|
16197
|
+
*/
|
|
16198
|
+
readonly mainPrices: AddressMap<bigint>;
|
|
16199
|
+
/**
|
|
16200
|
+
* Mapping Token => Price in underlying
|
|
16201
|
+
*/
|
|
16202
|
+
readonly reservePrices: AddressMap<bigint>;
|
|
16203
|
+
constructor(sdk: GearboxSDK, data: PriceOracleData, underlying: Address);
|
|
16204
|
+
/**
|
|
16205
|
+
* Returns main and reserve price feeds for given tokens
|
|
16206
|
+
* @param tokens
|
|
16207
|
+
* @param opts Option to include main/reserve feeds only, defaults to both
|
|
16208
|
+
* @returns
|
|
16209
|
+
*/
|
|
16210
|
+
priceFeedsForTokens(tokens: Address[], opts?: PriceFeedsForTokensOptions): IPriceFeedContract[];
|
|
16211
|
+
/**
|
|
16212
|
+
* Generates updates for all updateable price feeds in this oracle (including dependencies)
|
|
16213
|
+
* @returns
|
|
16214
|
+
*/
|
|
16215
|
+
updatePriceFeeds(): Promise<UpdatePriceFeedsResult>;
|
|
16216
|
+
/**
|
|
16217
|
+
* Converts previously obtained price updates into CreditFacade multicall entries
|
|
16218
|
+
* @param creditFacade
|
|
16219
|
+
* @param updates
|
|
16220
|
+
* @returns
|
|
16221
|
+
*/
|
|
16222
|
+
onDemandPriceUpdates(updates?: UpdatePriceFeedsResult): OnDemandPriceUpdate[];
|
|
16223
|
+
/**
|
|
16224
|
+
* Tries to convert amount of token into underlying of current market
|
|
16225
|
+
* @param token
|
|
16226
|
+
* @param amount
|
|
16227
|
+
* @param reserve
|
|
16228
|
+
* @returns
|
|
16229
|
+
*/
|
|
16230
|
+
convertToUnderlying(token: Address, amount: bigint, reserve?: boolean): bigint;
|
|
16231
|
+
/**
|
|
16232
|
+
* Tries to convert amount of from one token to another, using latest known prices
|
|
16233
|
+
* @param from
|
|
16234
|
+
* @param to
|
|
16235
|
+
* @param amount
|
|
16236
|
+
* @param reserve
|
|
16237
|
+
*/
|
|
16238
|
+
convert(from: Address, to: Address, amount: bigint, reserve?: boolean): bigint;
|
|
16239
|
+
/**
|
|
16240
|
+
* Loads new prices for this oracle from PriceFeedCompressor
|
|
16241
|
+
* Does not update price feeds, only updates prices
|
|
16242
|
+
*/
|
|
16243
|
+
updatePrices(): Promise<void>;
|
|
16244
|
+
get state(): PriceOracleState;
|
|
16245
|
+
}
|
|
16246
|
+
|
|
16247
|
+
type abi$m = typeof creditFacadeV3Abi;
|
|
16248
|
+
declare class CreditFacadeV300Contract extends BaseContract<abi$m> {
|
|
16168
16249
|
readonly state: CreditFacadeState;
|
|
16169
16250
|
constructor(sdk: GearboxSDK, { creditFacade, creditManager }: CreditManagerData);
|
|
16251
|
+
encodeOnDemandPriceUpdates(updates: OnDemandPriceUpdate[]): MultiCall[];
|
|
16170
16252
|
liquidateCreditAccount(ca: Address, to: Address, calls: MultiCall[]): RawTx;
|
|
16171
16253
|
closeCreditAccount(ca: Address, calls: MultiCall[]): RawTx;
|
|
16172
16254
|
multicall(ca: Address, calls: MultiCall[]): RawTx;
|
|
16173
|
-
parseFunctionParams(params: DecodeFunctionDataReturnType<abi$
|
|
16255
|
+
parseFunctionParams(params: DecodeFunctionDataReturnType<abi$m>): string[] | undefined;
|
|
16174
16256
|
}
|
|
16175
16257
|
|
|
16176
|
-
type abi$
|
|
16177
|
-
declare class CreditFacadeV310Contract extends BaseContract<abi$
|
|
16258
|
+
type abi$l = typeof iCreditFacadeV310Abi;
|
|
16259
|
+
declare class CreditFacadeV310Contract extends BaseContract<abi$l> {
|
|
16178
16260
|
readonly state: CreditFacadeState;
|
|
16179
16261
|
constructor(sdk: GearboxSDK, { creditFacade, creditManager }: CreditManagerData);
|
|
16262
|
+
encodeOnDemandPriceUpdates(updates: OnDemandPriceUpdate[]): MultiCall[];
|
|
16180
16263
|
liquidateCreditAccount(ca: Address, to: Address, calls: MultiCall[]): RawTx;
|
|
16181
16264
|
closeCreditAccount(ca: Address, calls: MultiCall[]): RawTx;
|
|
16182
16265
|
multicall(ca: Address, calls: MultiCall[]): RawTx;
|
|
16183
|
-
parseFunctionParams(params: DecodeFunctionDataReturnType<abi$
|
|
16266
|
+
parseFunctionParams(params: DecodeFunctionDataReturnType<abi$l>): string[] | undefined;
|
|
16184
16267
|
}
|
|
16185
16268
|
|
|
16186
16269
|
type AdapterContractType = "AD_UNISWAP_V2_ROUTER" | "AD_UNISWAP_V3_ROUTER" | "AD_CURVE_V1_EXCHANGE_ONLY" | "AD_YEARN_V2" | "AD_CURVE_V1_2ASSETS" | "AD_CURVE_V1_3ASSETS" | "AD_CURVE_V1_4ASSETS" | "AD_CURVE_V1_STECRV_POOL" | "AD_CURVE_V1_WRAPPER" | "AD_CONVEX_V1_BASE_REWARD_POOL" | "AD_CONVEX_V1_BOOSTER" | "AD_LIDO_V1" | "AD_LIDO_WSTETH_V1" | "AD_BALANCER_VAULT" | "AD_ERC4626_VAULT" | "AD_VELODROME_V2_ROUTER" | "AD_CURVE_STABLE_NG" | "AD_CAMELOT_V3_ROUTER" | "AD_CONVEX_L2_BOOSTER" | "AD_CONVEX_L2_REWARD_POOL" | "AD_AAVE_V3_LENDING_POOL" | "AD_ZIRCUIT_POOL" | "AD_SYMBIOTIC_DEFAULT_COLLATERAL" | "AD_MELLOW_LRT_VAULT" | "AD_PENDLE_ROUTER";
|
|
@@ -16198,7 +16281,7 @@ declare class AbstractAdapterContract<const abi extends Abi | readonly unknown[]
|
|
|
16198
16281
|
get adapterType(): AdapterContractType;
|
|
16199
16282
|
}
|
|
16200
16283
|
|
|
16201
|
-
declare const abi$
|
|
16284
|
+
declare const abi$k: readonly [{
|
|
16202
16285
|
readonly type: "constructor";
|
|
16203
16286
|
readonly inputs: readonly [{
|
|
16204
16287
|
readonly name: "_creditManager";
|
|
@@ -16739,11 +16822,11 @@ declare const abi$l: readonly [{
|
|
|
16739
16822
|
readonly inputs: readonly [];
|
|
16740
16823
|
readonly name: "ZeroAddressException";
|
|
16741
16824
|
}];
|
|
16742
|
-
declare class BalancerV2VaultAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
16743
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
16825
|
+
declare class BalancerV2VaultAdapterContract extends AbstractAdapterContract<typeof abi$k> {
|
|
16826
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$k>, "abi">);
|
|
16744
16827
|
}
|
|
16745
16828
|
|
|
16746
|
-
declare const abi$
|
|
16829
|
+
declare const abi$j: readonly [{
|
|
16747
16830
|
readonly type: "constructor";
|
|
16748
16831
|
readonly inputs: readonly [{
|
|
16749
16832
|
readonly name: "_creditManager";
|
|
@@ -17237,11 +17320,11 @@ declare const abi$k: readonly [{
|
|
|
17237
17320
|
readonly inputs: readonly [];
|
|
17238
17321
|
readonly name: "ZeroAddressException";
|
|
17239
17322
|
}];
|
|
17240
|
-
declare class CamelotV3AdapterContract extends AbstractAdapterContract<typeof abi$
|
|
17241
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
17323
|
+
declare class CamelotV3AdapterContract extends AbstractAdapterContract<typeof abi$j> {
|
|
17324
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$j>, "abi">);
|
|
17242
17325
|
}
|
|
17243
17326
|
|
|
17244
|
-
declare const abi$
|
|
17327
|
+
declare const abi$i: readonly [{
|
|
17245
17328
|
readonly type: "constructor";
|
|
17246
17329
|
readonly inputs: readonly [{
|
|
17247
17330
|
readonly name: "_creditManager";
|
|
@@ -17574,11 +17657,11 @@ declare const abi$j: readonly [{
|
|
|
17574
17657
|
readonly inputs: readonly [];
|
|
17575
17658
|
readonly name: "ZeroAddressException";
|
|
17576
17659
|
}];
|
|
17577
|
-
declare class ConvexV1BaseRewardPoolAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
17578
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
17660
|
+
declare class ConvexV1BaseRewardPoolAdapterContract extends AbstractAdapterContract<typeof abi$i> {
|
|
17661
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$i>, "abi">);
|
|
17579
17662
|
}
|
|
17580
17663
|
|
|
17581
|
-
declare const abi$
|
|
17664
|
+
declare const abi$h: readonly [{
|
|
17582
17665
|
readonly type: "constructor";
|
|
17583
17666
|
readonly inputs: readonly [{
|
|
17584
17667
|
readonly name: "_creditManager";
|
|
@@ -17794,11 +17877,11 @@ declare const abi$i: readonly [{
|
|
|
17794
17877
|
readonly inputs: readonly [];
|
|
17795
17878
|
readonly name: "ZeroAddressException";
|
|
17796
17879
|
}];
|
|
17797
|
-
declare class ConvexV1BoosterAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
17798
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
17880
|
+
declare class ConvexV1BoosterAdapterContract extends AbstractAdapterContract<typeof abi$h> {
|
|
17881
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$h>, "abi">);
|
|
17799
17882
|
}
|
|
17800
17883
|
|
|
17801
|
-
declare const abi$
|
|
17884
|
+
declare const abi$g: readonly [{
|
|
17802
17885
|
readonly type: "constructor";
|
|
17803
17886
|
readonly inputs: readonly [{
|
|
17804
17887
|
readonly name: "_creditManager";
|
|
@@ -18505,11 +18588,11 @@ declare const abi$h: readonly [{
|
|
|
18505
18588
|
readonly inputs: readonly [];
|
|
18506
18589
|
readonly name: "ZeroAddressException";
|
|
18507
18590
|
}];
|
|
18508
|
-
declare class Curve2AssetsAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
18509
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
18591
|
+
declare class Curve2AssetsAdapterContract extends AbstractAdapterContract<typeof abi$g> {
|
|
18592
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$g>, "abi">);
|
|
18510
18593
|
}
|
|
18511
18594
|
|
|
18512
|
-
declare const abi$
|
|
18595
|
+
declare const abi$f: readonly [{
|
|
18513
18596
|
readonly type: "constructor";
|
|
18514
18597
|
readonly inputs: readonly [{
|
|
18515
18598
|
readonly name: "_creditManager";
|
|
@@ -19216,11 +19299,11 @@ declare const abi$g: readonly [{
|
|
|
19216
19299
|
readonly inputs: readonly [];
|
|
19217
19300
|
readonly name: "ZeroAddressException";
|
|
19218
19301
|
}];
|
|
19219
|
-
declare class Curve3AssetsAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
19220
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
19302
|
+
declare class Curve3AssetsAdapterContract extends AbstractAdapterContract<typeof abi$f> {
|
|
19303
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$f>, "abi">);
|
|
19221
19304
|
}
|
|
19222
19305
|
|
|
19223
|
-
declare const abi$
|
|
19306
|
+
declare const abi$e: readonly [{
|
|
19224
19307
|
readonly type: "constructor";
|
|
19225
19308
|
readonly inputs: readonly [{
|
|
19226
19309
|
readonly name: "_creditManager";
|
|
@@ -19927,11 +20010,11 @@ declare const abi$f: readonly [{
|
|
|
19927
20010
|
readonly inputs: readonly [];
|
|
19928
20011
|
readonly name: "ZeroAddressException";
|
|
19929
20012
|
}];
|
|
19930
|
-
declare class Curve4AssetsAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
19931
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
20013
|
+
declare class Curve4AssetsAdapterContract extends AbstractAdapterContract<typeof abi$e> {
|
|
20014
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$e>, "abi">);
|
|
19932
20015
|
}
|
|
19933
20016
|
|
|
19934
|
-
declare const abi$
|
|
20017
|
+
declare const abi$d: readonly [{
|
|
19935
20018
|
readonly type: "constructor";
|
|
19936
20019
|
readonly inputs: readonly [{
|
|
19937
20020
|
readonly name: "_creditManager";
|
|
@@ -20638,11 +20721,11 @@ declare const abi$e: readonly [{
|
|
|
20638
20721
|
readonly inputs: readonly [];
|
|
20639
20722
|
readonly name: "ZeroAddressException";
|
|
20640
20723
|
}];
|
|
20641
|
-
declare class CurveV1AdapterStableNGContract extends AbstractAdapterContract<typeof abi$
|
|
20642
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
20724
|
+
declare class CurveV1AdapterStableNGContract extends AbstractAdapterContract<typeof abi$d> {
|
|
20725
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$d>, "abi">);
|
|
20643
20726
|
}
|
|
20644
20727
|
|
|
20645
|
-
declare const abi$
|
|
20728
|
+
declare const abi$c: readonly [{
|
|
20646
20729
|
readonly type: "constructor";
|
|
20647
20730
|
readonly inputs: readonly [{
|
|
20648
20731
|
readonly name: "_creditManager";
|
|
@@ -21345,11 +21428,11 @@ declare const abi$d: readonly [{
|
|
|
21345
21428
|
readonly inputs: readonly [];
|
|
21346
21429
|
readonly name: "ZeroAddressException";
|
|
21347
21430
|
}];
|
|
21348
|
-
declare class CurveV1AdapterStETHContract extends AbstractAdapterContract<typeof abi$
|
|
21349
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
21431
|
+
declare class CurveV1AdapterStETHContract extends AbstractAdapterContract<typeof abi$c> {
|
|
21432
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$c>, "abi">);
|
|
21350
21433
|
}
|
|
21351
21434
|
|
|
21352
|
-
declare const abi$
|
|
21435
|
+
declare const abi$b: readonly [{
|
|
21353
21436
|
readonly type: "constructor";
|
|
21354
21437
|
readonly inputs: readonly [{
|
|
21355
21438
|
readonly name: "_creditManager";
|
|
@@ -21592,13 +21675,13 @@ declare const abi$c: readonly [{
|
|
|
21592
21675
|
readonly inputs: readonly [];
|
|
21593
21676
|
readonly name: "ZeroAddressException";
|
|
21594
21677
|
}];
|
|
21595
|
-
declare class ERC4626AdapterContract extends AbstractAdapterContract<typeof abi$
|
|
21596
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
21678
|
+
declare class ERC4626AdapterContract extends AbstractAdapterContract<typeof abi$b> {
|
|
21679
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$b>, "abi">);
|
|
21597
21680
|
}
|
|
21598
21681
|
|
|
21599
21682
|
declare function createAdapter(sdk: GearboxSDK, args: AdapterData): IAdapterContract;
|
|
21600
21683
|
|
|
21601
|
-
declare const abi$
|
|
21684
|
+
declare const abi$a: readonly [{
|
|
21602
21685
|
readonly type: "constructor";
|
|
21603
21686
|
readonly inputs: readonly [{
|
|
21604
21687
|
readonly name: "_creditManager";
|
|
@@ -21846,11 +21929,11 @@ declare const abi$b: readonly [{
|
|
|
21846
21929
|
readonly inputs: readonly [];
|
|
21847
21930
|
readonly name: "ZeroAddressException";
|
|
21848
21931
|
}];
|
|
21849
|
-
declare class UniswapV2AdapterContract extends AbstractAdapterContract<typeof abi$
|
|
21850
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
21932
|
+
declare class UniswapV2AdapterContract extends AbstractAdapterContract<typeof abi$a> {
|
|
21933
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$a>, "abi">);
|
|
21851
21934
|
}
|
|
21852
21935
|
|
|
21853
|
-
declare const abi$
|
|
21936
|
+
declare const abi$9: readonly [{
|
|
21854
21937
|
readonly type: "constructor";
|
|
21855
21938
|
readonly inputs: readonly [{
|
|
21856
21939
|
readonly name: "_creditManager";
|
|
@@ -22275,11 +22358,11 @@ declare const abi$a: readonly [{
|
|
|
22275
22358
|
readonly inputs: readonly [];
|
|
22276
22359
|
readonly name: "ZeroAddressException";
|
|
22277
22360
|
}];
|
|
22278
|
-
declare class UniswapV3AdapterContract extends AbstractAdapterContract<typeof abi$
|
|
22279
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
22361
|
+
declare class UniswapV3AdapterContract extends AbstractAdapterContract<typeof abi$9> {
|
|
22362
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$9>, "abi">);
|
|
22280
22363
|
}
|
|
22281
22364
|
|
|
22282
|
-
declare const abi$
|
|
22365
|
+
declare const abi$8: readonly [{
|
|
22283
22366
|
readonly type: "constructor";
|
|
22284
22367
|
readonly inputs: readonly [{
|
|
22285
22368
|
readonly name: "_creditManager";
|
|
@@ -22553,11 +22636,11 @@ declare const abi$9: readonly [{
|
|
|
22553
22636
|
readonly inputs: readonly [];
|
|
22554
22637
|
readonly name: "ZeroAddressException";
|
|
22555
22638
|
}];
|
|
22556
|
-
declare class VelodromeV2RouterAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
22557
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
22639
|
+
declare class VelodromeV2RouterAdapterContract extends AbstractAdapterContract<typeof abi$8> {
|
|
22640
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$8>, "abi">);
|
|
22558
22641
|
}
|
|
22559
22642
|
|
|
22560
|
-
declare const abi$
|
|
22643
|
+
declare const abi$7: readonly [{
|
|
22561
22644
|
readonly type: "constructor";
|
|
22562
22645
|
readonly inputs: readonly [{
|
|
22563
22646
|
readonly name: "_creditManager";
|
|
@@ -22740,11 +22823,11 @@ declare const abi$8: readonly [{
|
|
|
22740
22823
|
readonly inputs: readonly [];
|
|
22741
22824
|
readonly name: "ZeroAddressException";
|
|
22742
22825
|
}];
|
|
22743
|
-
declare class WstETHV1AdapterContract extends AbstractAdapterContract<typeof abi$
|
|
22744
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
22826
|
+
declare class WstETHV1AdapterContract extends AbstractAdapterContract<typeof abi$7> {
|
|
22827
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$7>, "abi">);
|
|
22745
22828
|
}
|
|
22746
22829
|
|
|
22747
|
-
declare const abi$
|
|
22830
|
+
declare const abi$6: readonly [{
|
|
22748
22831
|
readonly type: "constructor";
|
|
22749
22832
|
readonly inputs: readonly [{
|
|
22750
22833
|
readonly name: "_creditManager";
|
|
@@ -22997,12 +23080,12 @@ declare const abi$7: readonly [{
|
|
|
22997
23080
|
readonly inputs: readonly [];
|
|
22998
23081
|
readonly name: "ZeroAddressException";
|
|
22999
23082
|
}];
|
|
23000
|
-
declare class YearnV2RouterAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
23001
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
23083
|
+
declare class YearnV2RouterAdapterContract extends AbstractAdapterContract<typeof abi$6> {
|
|
23084
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$6>, "abi">);
|
|
23002
23085
|
}
|
|
23003
23086
|
|
|
23004
|
-
type abi$
|
|
23005
|
-
declare class CreditManagerContract extends BaseContract<abi$
|
|
23087
|
+
type abi$5 = typeof creditManagerV3Abi;
|
|
23088
|
+
declare class CreditManagerContract extends BaseContract<abi$5> {
|
|
23006
23089
|
#private;
|
|
23007
23090
|
readonly state: CreditManagerState;
|
|
23008
23091
|
constructor(sdk: GearboxSDK, { creditManager, creditFacade }: CreditManagerData, pool: PoolData);
|
|
@@ -23027,19 +23110,19 @@ declare class CreditFactory {
|
|
|
23027
23110
|
get state(): CreditFactoryState;
|
|
23028
23111
|
}
|
|
23029
23112
|
|
|
23030
|
-
type abi$
|
|
23031
|
-
declare class GaugeContract extends BaseContract<abi$
|
|
23113
|
+
type abi$4 = typeof gaugeV3Abi;
|
|
23114
|
+
declare class GaugeContract extends BaseContract<abi$4> {
|
|
23032
23115
|
state: GaugeState;
|
|
23033
23116
|
constructor(sdk: GearboxSDK, pool: PoolData, gauge: RateKeeperData);
|
|
23034
23117
|
}
|
|
23035
23118
|
|
|
23036
|
-
type abi$
|
|
23037
|
-
declare class LinearModelContract extends BaseContract<abi$
|
|
23119
|
+
type abi$3 = typeof linearInterestRateModelV3Abi;
|
|
23120
|
+
declare class LinearModelContract extends BaseContract<abi$3> {
|
|
23038
23121
|
readonly state: LinearModelState;
|
|
23039
23122
|
constructor(sdk: GearboxSDK, { interestRateModel }: MarketData);
|
|
23040
23123
|
}
|
|
23041
23124
|
|
|
23042
|
-
declare const abi$
|
|
23125
|
+
declare const abi$2: readonly [{
|
|
23043
23126
|
readonly type: "constructor";
|
|
23044
23127
|
readonly inputs: readonly [{
|
|
23045
23128
|
readonly name: "addressProvider_";
|
|
@@ -24363,12 +24446,12 @@ declare const abi$3: readonly [{
|
|
|
24363
24446
|
readonly inputs: readonly [];
|
|
24364
24447
|
readonly name: "ZeroAddressException";
|
|
24365
24448
|
}];
|
|
24366
|
-
declare class PoolContract extends BaseContract<typeof abi$
|
|
24449
|
+
declare class PoolContract extends BaseContract<typeof abi$2> {
|
|
24367
24450
|
state: PoolState;
|
|
24368
24451
|
hasOperation: boolean;
|
|
24369
24452
|
constructor(sdk: GearboxSDK, data: PoolData);
|
|
24370
24453
|
parseLog(log: Log): void;
|
|
24371
|
-
parseFunctionParams(params: DecodeFunctionDataReturnType<typeof abi$
|
|
24454
|
+
parseFunctionParams(params: DecodeFunctionDataReturnType<typeof abi$2>): Array<string> | undefined;
|
|
24372
24455
|
}
|
|
24373
24456
|
|
|
24374
24457
|
type Unarray<A> = A extends readonly unknown[] ? Unarray<A[number]> : A;
|
|
@@ -24401,8 +24484,8 @@ declare enum VotingContractStatus {
|
|
|
24401
24484
|
UNVOTE_ONLY = 2
|
|
24402
24485
|
}
|
|
24403
24486
|
|
|
24404
|
-
type abi$
|
|
24405
|
-
declare class PoolQuotaKeeperContract extends BaseContract<abi$
|
|
24487
|
+
type abi$1 = typeof poolQuotaKeeperV3Abi;
|
|
24488
|
+
declare class PoolQuotaKeeperContract extends BaseContract<abi$1> {
|
|
24406
24489
|
readonly decimals: number;
|
|
24407
24490
|
readonly state: PoolQuotaKeeperState;
|
|
24408
24491
|
constructor(sdk: GearboxSDK, pool: PoolData, pqk: PoolQuotaKeeperData);
|
|
@@ -24418,82 +24501,6 @@ declare class PoolFactory {
|
|
|
24418
24501
|
get state(): PoolFactoryState;
|
|
24419
24502
|
}
|
|
24420
24503
|
|
|
24421
|
-
type abi$1 = typeof priceOracleV3Abi;
|
|
24422
|
-
interface PriceFeedsForTokensOptions {
|
|
24423
|
-
main?: boolean;
|
|
24424
|
-
reserve?: boolean;
|
|
24425
|
-
}
|
|
24426
|
-
interface OnDemandPriceUpdate {
|
|
24427
|
-
token: Address;
|
|
24428
|
-
reserve: boolean;
|
|
24429
|
-
data: Hex;
|
|
24430
|
-
}
|
|
24431
|
-
declare class PriceOracleContract extends BaseContract<abi$1> {
|
|
24432
|
-
#private;
|
|
24433
|
-
/**
|
|
24434
|
-
* Underlying token of market to which this price oracle belongs
|
|
24435
|
-
*/
|
|
24436
|
-
readonly underlying: Address;
|
|
24437
|
-
/**
|
|
24438
|
-
* Mapping Token => [PriceFeed Address, stalenessPeriod]
|
|
24439
|
-
*/
|
|
24440
|
-
readonly mainPriceFeeds: Record<Address, PriceFeedRef>;
|
|
24441
|
-
/**
|
|
24442
|
-
* Mapping Token => [PriceFeed Address, stalenessPeriod]
|
|
24443
|
-
*/
|
|
24444
|
-
readonly reservePriceFeeds: Record<Address, PriceFeedRef>;
|
|
24445
|
-
/**
|
|
24446
|
-
* Mapping Token => Price in underlying
|
|
24447
|
-
*/
|
|
24448
|
-
readonly mainPrices: AddressMap<bigint>;
|
|
24449
|
-
/**
|
|
24450
|
-
* Mapping Token => Price in underlying
|
|
24451
|
-
*/
|
|
24452
|
-
readonly reservePrices: AddressMap<bigint>;
|
|
24453
|
-
constructor(sdk: GearboxSDK, data: PriceOracleData, underlying: Address);
|
|
24454
|
-
/**
|
|
24455
|
-
* Returns main and reserve price feeds for given tokens
|
|
24456
|
-
* @param tokens
|
|
24457
|
-
* @param opts Option to include main/reserve feeds only, defaults to both
|
|
24458
|
-
* @returns
|
|
24459
|
-
*/
|
|
24460
|
-
priceFeedsForTokens(tokens: Address[], opts?: PriceFeedsForTokensOptions): IPriceFeedContract[];
|
|
24461
|
-
/**
|
|
24462
|
-
* Generates updates for all updateable price feeds in this oracle (including dependencies)
|
|
24463
|
-
* @returns
|
|
24464
|
-
*/
|
|
24465
|
-
updatePriceFeeds(): Promise<UpdatePriceFeedsResult>;
|
|
24466
|
-
/**
|
|
24467
|
-
* Converts previously obtained price updates into CreditFacade multicall entries
|
|
24468
|
-
* @param creditFacade
|
|
24469
|
-
* @param updates
|
|
24470
|
-
* @returns
|
|
24471
|
-
*/
|
|
24472
|
-
onDemandPriceUpdates(updates?: UpdatePriceFeedsResult): OnDemandPriceUpdate[];
|
|
24473
|
-
/**
|
|
24474
|
-
* Tries to convert amount of token into underlying of current market
|
|
24475
|
-
* @param token
|
|
24476
|
-
* @param amount
|
|
24477
|
-
* @param reserve
|
|
24478
|
-
* @returns
|
|
24479
|
-
*/
|
|
24480
|
-
convertToUnderlying(token: Address, amount: bigint, reserve?: boolean): bigint;
|
|
24481
|
-
/**
|
|
24482
|
-
* Tries to convert amount of from one token to another, using latest known prices
|
|
24483
|
-
* @param from
|
|
24484
|
-
* @param to
|
|
24485
|
-
* @param amount
|
|
24486
|
-
* @param reserve
|
|
24487
|
-
*/
|
|
24488
|
-
convert(from: Address, to: Address, amount: bigint, reserve?: boolean): bigint;
|
|
24489
|
-
/**
|
|
24490
|
-
* Loads new prices for this oracle from PriceFeedCompressor
|
|
24491
|
-
* Does not update price feeds, only updates prices
|
|
24492
|
-
*/
|
|
24493
|
-
updatePrices(): Promise<void>;
|
|
24494
|
-
get state(): PriceOracleState;
|
|
24495
|
-
}
|
|
24496
|
-
|
|
24497
24504
|
declare class MarketFactory {
|
|
24498
24505
|
readonly riskCurator: Address;
|
|
24499
24506
|
readonly poolFactory: PoolFactory;
|
package/dist/esm/sdk/index.d.mts
CHANGED
|
@@ -16163,24 +16163,107 @@ declare class CreditConfiguratorContract extends BaseContract<abi$o> {
|
|
|
16163
16163
|
parseFunctionParams(params: DecodeFunctionDataReturnType<abi$o>): Array<string> | undefined;
|
|
16164
16164
|
}
|
|
16165
16165
|
|
|
16166
|
-
type abi$n = typeof
|
|
16167
|
-
|
|
16166
|
+
type abi$n = typeof priceOracleV3Abi;
|
|
16167
|
+
interface PriceFeedsForTokensOptions {
|
|
16168
|
+
main?: boolean;
|
|
16169
|
+
reserve?: boolean;
|
|
16170
|
+
}
|
|
16171
|
+
/**
|
|
16172
|
+
* Data to be passed to credit facade's multicall
|
|
16173
|
+
* Compatible with both v300 and v310 facades
|
|
16174
|
+
*/
|
|
16175
|
+
interface OnDemandPriceUpdate {
|
|
16176
|
+
priceFeed: Address;
|
|
16177
|
+
token: Address;
|
|
16178
|
+
reserve: boolean;
|
|
16179
|
+
data: Hex;
|
|
16180
|
+
}
|
|
16181
|
+
declare class PriceOracleContract extends BaseContract<abi$n> {
|
|
16182
|
+
#private;
|
|
16183
|
+
/**
|
|
16184
|
+
* Underlying token of market to which this price oracle belongs
|
|
16185
|
+
*/
|
|
16186
|
+
readonly underlying: Address;
|
|
16187
|
+
/**
|
|
16188
|
+
* Mapping Token => [PriceFeed Address, stalenessPeriod]
|
|
16189
|
+
*/
|
|
16190
|
+
readonly mainPriceFeeds: Record<Address, PriceFeedRef>;
|
|
16191
|
+
/**
|
|
16192
|
+
* Mapping Token => [PriceFeed Address, stalenessPeriod]
|
|
16193
|
+
*/
|
|
16194
|
+
readonly reservePriceFeeds: Record<Address, PriceFeedRef>;
|
|
16195
|
+
/**
|
|
16196
|
+
* Mapping Token => Price in underlying
|
|
16197
|
+
*/
|
|
16198
|
+
readonly mainPrices: AddressMap<bigint>;
|
|
16199
|
+
/**
|
|
16200
|
+
* Mapping Token => Price in underlying
|
|
16201
|
+
*/
|
|
16202
|
+
readonly reservePrices: AddressMap<bigint>;
|
|
16203
|
+
constructor(sdk: GearboxSDK, data: PriceOracleData, underlying: Address);
|
|
16204
|
+
/**
|
|
16205
|
+
* Returns main and reserve price feeds for given tokens
|
|
16206
|
+
* @param tokens
|
|
16207
|
+
* @param opts Option to include main/reserve feeds only, defaults to both
|
|
16208
|
+
* @returns
|
|
16209
|
+
*/
|
|
16210
|
+
priceFeedsForTokens(tokens: Address[], opts?: PriceFeedsForTokensOptions): IPriceFeedContract[];
|
|
16211
|
+
/**
|
|
16212
|
+
* Generates updates for all updateable price feeds in this oracle (including dependencies)
|
|
16213
|
+
* @returns
|
|
16214
|
+
*/
|
|
16215
|
+
updatePriceFeeds(): Promise<UpdatePriceFeedsResult>;
|
|
16216
|
+
/**
|
|
16217
|
+
* Converts previously obtained price updates into CreditFacade multicall entries
|
|
16218
|
+
* @param creditFacade
|
|
16219
|
+
* @param updates
|
|
16220
|
+
* @returns
|
|
16221
|
+
*/
|
|
16222
|
+
onDemandPriceUpdates(updates?: UpdatePriceFeedsResult): OnDemandPriceUpdate[];
|
|
16223
|
+
/**
|
|
16224
|
+
* Tries to convert amount of token into underlying of current market
|
|
16225
|
+
* @param token
|
|
16226
|
+
* @param amount
|
|
16227
|
+
* @param reserve
|
|
16228
|
+
* @returns
|
|
16229
|
+
*/
|
|
16230
|
+
convertToUnderlying(token: Address, amount: bigint, reserve?: boolean): bigint;
|
|
16231
|
+
/**
|
|
16232
|
+
* Tries to convert amount of from one token to another, using latest known prices
|
|
16233
|
+
* @param from
|
|
16234
|
+
* @param to
|
|
16235
|
+
* @param amount
|
|
16236
|
+
* @param reserve
|
|
16237
|
+
*/
|
|
16238
|
+
convert(from: Address, to: Address, amount: bigint, reserve?: boolean): bigint;
|
|
16239
|
+
/**
|
|
16240
|
+
* Loads new prices for this oracle from PriceFeedCompressor
|
|
16241
|
+
* Does not update price feeds, only updates prices
|
|
16242
|
+
*/
|
|
16243
|
+
updatePrices(): Promise<void>;
|
|
16244
|
+
get state(): PriceOracleState;
|
|
16245
|
+
}
|
|
16246
|
+
|
|
16247
|
+
type abi$m = typeof creditFacadeV3Abi;
|
|
16248
|
+
declare class CreditFacadeV300Contract extends BaseContract<abi$m> {
|
|
16168
16249
|
readonly state: CreditFacadeState;
|
|
16169
16250
|
constructor(sdk: GearboxSDK, { creditFacade, creditManager }: CreditManagerData);
|
|
16251
|
+
encodeOnDemandPriceUpdates(updates: OnDemandPriceUpdate[]): MultiCall[];
|
|
16170
16252
|
liquidateCreditAccount(ca: Address, to: Address, calls: MultiCall[]): RawTx;
|
|
16171
16253
|
closeCreditAccount(ca: Address, calls: MultiCall[]): RawTx;
|
|
16172
16254
|
multicall(ca: Address, calls: MultiCall[]): RawTx;
|
|
16173
|
-
parseFunctionParams(params: DecodeFunctionDataReturnType<abi$
|
|
16255
|
+
parseFunctionParams(params: DecodeFunctionDataReturnType<abi$m>): string[] | undefined;
|
|
16174
16256
|
}
|
|
16175
16257
|
|
|
16176
|
-
type abi$
|
|
16177
|
-
declare class CreditFacadeV310Contract extends BaseContract<abi$
|
|
16258
|
+
type abi$l = typeof iCreditFacadeV310Abi;
|
|
16259
|
+
declare class CreditFacadeV310Contract extends BaseContract<abi$l> {
|
|
16178
16260
|
readonly state: CreditFacadeState;
|
|
16179
16261
|
constructor(sdk: GearboxSDK, { creditFacade, creditManager }: CreditManagerData);
|
|
16262
|
+
encodeOnDemandPriceUpdates(updates: OnDemandPriceUpdate[]): MultiCall[];
|
|
16180
16263
|
liquidateCreditAccount(ca: Address, to: Address, calls: MultiCall[]): RawTx;
|
|
16181
16264
|
closeCreditAccount(ca: Address, calls: MultiCall[]): RawTx;
|
|
16182
16265
|
multicall(ca: Address, calls: MultiCall[]): RawTx;
|
|
16183
|
-
parseFunctionParams(params: DecodeFunctionDataReturnType<abi$
|
|
16266
|
+
parseFunctionParams(params: DecodeFunctionDataReturnType<abi$l>): string[] | undefined;
|
|
16184
16267
|
}
|
|
16185
16268
|
|
|
16186
16269
|
type AdapterContractType = "AD_UNISWAP_V2_ROUTER" | "AD_UNISWAP_V3_ROUTER" | "AD_CURVE_V1_EXCHANGE_ONLY" | "AD_YEARN_V2" | "AD_CURVE_V1_2ASSETS" | "AD_CURVE_V1_3ASSETS" | "AD_CURVE_V1_4ASSETS" | "AD_CURVE_V1_STECRV_POOL" | "AD_CURVE_V1_WRAPPER" | "AD_CONVEX_V1_BASE_REWARD_POOL" | "AD_CONVEX_V1_BOOSTER" | "AD_LIDO_V1" | "AD_LIDO_WSTETH_V1" | "AD_BALANCER_VAULT" | "AD_ERC4626_VAULT" | "AD_VELODROME_V2_ROUTER" | "AD_CURVE_STABLE_NG" | "AD_CAMELOT_V3_ROUTER" | "AD_CONVEX_L2_BOOSTER" | "AD_CONVEX_L2_REWARD_POOL" | "AD_AAVE_V3_LENDING_POOL" | "AD_ZIRCUIT_POOL" | "AD_SYMBIOTIC_DEFAULT_COLLATERAL" | "AD_MELLOW_LRT_VAULT" | "AD_PENDLE_ROUTER";
|
|
@@ -16198,7 +16281,7 @@ declare class AbstractAdapterContract<const abi extends Abi | readonly unknown[]
|
|
|
16198
16281
|
get adapterType(): AdapterContractType;
|
|
16199
16282
|
}
|
|
16200
16283
|
|
|
16201
|
-
declare const abi$
|
|
16284
|
+
declare const abi$k: readonly [{
|
|
16202
16285
|
readonly type: "constructor";
|
|
16203
16286
|
readonly inputs: readonly [{
|
|
16204
16287
|
readonly name: "_creditManager";
|
|
@@ -16739,11 +16822,11 @@ declare const abi$l: readonly [{
|
|
|
16739
16822
|
readonly inputs: readonly [];
|
|
16740
16823
|
readonly name: "ZeroAddressException";
|
|
16741
16824
|
}];
|
|
16742
|
-
declare class BalancerV2VaultAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
16743
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
16825
|
+
declare class BalancerV2VaultAdapterContract extends AbstractAdapterContract<typeof abi$k> {
|
|
16826
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$k>, "abi">);
|
|
16744
16827
|
}
|
|
16745
16828
|
|
|
16746
|
-
declare const abi$
|
|
16829
|
+
declare const abi$j: readonly [{
|
|
16747
16830
|
readonly type: "constructor";
|
|
16748
16831
|
readonly inputs: readonly [{
|
|
16749
16832
|
readonly name: "_creditManager";
|
|
@@ -17237,11 +17320,11 @@ declare const abi$k: readonly [{
|
|
|
17237
17320
|
readonly inputs: readonly [];
|
|
17238
17321
|
readonly name: "ZeroAddressException";
|
|
17239
17322
|
}];
|
|
17240
|
-
declare class CamelotV3AdapterContract extends AbstractAdapterContract<typeof abi$
|
|
17241
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
17323
|
+
declare class CamelotV3AdapterContract extends AbstractAdapterContract<typeof abi$j> {
|
|
17324
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$j>, "abi">);
|
|
17242
17325
|
}
|
|
17243
17326
|
|
|
17244
|
-
declare const abi$
|
|
17327
|
+
declare const abi$i: readonly [{
|
|
17245
17328
|
readonly type: "constructor";
|
|
17246
17329
|
readonly inputs: readonly [{
|
|
17247
17330
|
readonly name: "_creditManager";
|
|
@@ -17574,11 +17657,11 @@ declare const abi$j: readonly [{
|
|
|
17574
17657
|
readonly inputs: readonly [];
|
|
17575
17658
|
readonly name: "ZeroAddressException";
|
|
17576
17659
|
}];
|
|
17577
|
-
declare class ConvexV1BaseRewardPoolAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
17578
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
17660
|
+
declare class ConvexV1BaseRewardPoolAdapterContract extends AbstractAdapterContract<typeof abi$i> {
|
|
17661
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$i>, "abi">);
|
|
17579
17662
|
}
|
|
17580
17663
|
|
|
17581
|
-
declare const abi$
|
|
17664
|
+
declare const abi$h: readonly [{
|
|
17582
17665
|
readonly type: "constructor";
|
|
17583
17666
|
readonly inputs: readonly [{
|
|
17584
17667
|
readonly name: "_creditManager";
|
|
@@ -17794,11 +17877,11 @@ declare const abi$i: readonly [{
|
|
|
17794
17877
|
readonly inputs: readonly [];
|
|
17795
17878
|
readonly name: "ZeroAddressException";
|
|
17796
17879
|
}];
|
|
17797
|
-
declare class ConvexV1BoosterAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
17798
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
17880
|
+
declare class ConvexV1BoosterAdapterContract extends AbstractAdapterContract<typeof abi$h> {
|
|
17881
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$h>, "abi">);
|
|
17799
17882
|
}
|
|
17800
17883
|
|
|
17801
|
-
declare const abi$
|
|
17884
|
+
declare const abi$g: readonly [{
|
|
17802
17885
|
readonly type: "constructor";
|
|
17803
17886
|
readonly inputs: readonly [{
|
|
17804
17887
|
readonly name: "_creditManager";
|
|
@@ -18505,11 +18588,11 @@ declare const abi$h: readonly [{
|
|
|
18505
18588
|
readonly inputs: readonly [];
|
|
18506
18589
|
readonly name: "ZeroAddressException";
|
|
18507
18590
|
}];
|
|
18508
|
-
declare class Curve2AssetsAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
18509
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
18591
|
+
declare class Curve2AssetsAdapterContract extends AbstractAdapterContract<typeof abi$g> {
|
|
18592
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$g>, "abi">);
|
|
18510
18593
|
}
|
|
18511
18594
|
|
|
18512
|
-
declare const abi$
|
|
18595
|
+
declare const abi$f: readonly [{
|
|
18513
18596
|
readonly type: "constructor";
|
|
18514
18597
|
readonly inputs: readonly [{
|
|
18515
18598
|
readonly name: "_creditManager";
|
|
@@ -19216,11 +19299,11 @@ declare const abi$g: readonly [{
|
|
|
19216
19299
|
readonly inputs: readonly [];
|
|
19217
19300
|
readonly name: "ZeroAddressException";
|
|
19218
19301
|
}];
|
|
19219
|
-
declare class Curve3AssetsAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
19220
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
19302
|
+
declare class Curve3AssetsAdapterContract extends AbstractAdapterContract<typeof abi$f> {
|
|
19303
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$f>, "abi">);
|
|
19221
19304
|
}
|
|
19222
19305
|
|
|
19223
|
-
declare const abi$
|
|
19306
|
+
declare const abi$e: readonly [{
|
|
19224
19307
|
readonly type: "constructor";
|
|
19225
19308
|
readonly inputs: readonly [{
|
|
19226
19309
|
readonly name: "_creditManager";
|
|
@@ -19927,11 +20010,11 @@ declare const abi$f: readonly [{
|
|
|
19927
20010
|
readonly inputs: readonly [];
|
|
19928
20011
|
readonly name: "ZeroAddressException";
|
|
19929
20012
|
}];
|
|
19930
|
-
declare class Curve4AssetsAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
19931
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
20013
|
+
declare class Curve4AssetsAdapterContract extends AbstractAdapterContract<typeof abi$e> {
|
|
20014
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$e>, "abi">);
|
|
19932
20015
|
}
|
|
19933
20016
|
|
|
19934
|
-
declare const abi$
|
|
20017
|
+
declare const abi$d: readonly [{
|
|
19935
20018
|
readonly type: "constructor";
|
|
19936
20019
|
readonly inputs: readonly [{
|
|
19937
20020
|
readonly name: "_creditManager";
|
|
@@ -20638,11 +20721,11 @@ declare const abi$e: readonly [{
|
|
|
20638
20721
|
readonly inputs: readonly [];
|
|
20639
20722
|
readonly name: "ZeroAddressException";
|
|
20640
20723
|
}];
|
|
20641
|
-
declare class CurveV1AdapterStableNGContract extends AbstractAdapterContract<typeof abi$
|
|
20642
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
20724
|
+
declare class CurveV1AdapterStableNGContract extends AbstractAdapterContract<typeof abi$d> {
|
|
20725
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$d>, "abi">);
|
|
20643
20726
|
}
|
|
20644
20727
|
|
|
20645
|
-
declare const abi$
|
|
20728
|
+
declare const abi$c: readonly [{
|
|
20646
20729
|
readonly type: "constructor";
|
|
20647
20730
|
readonly inputs: readonly [{
|
|
20648
20731
|
readonly name: "_creditManager";
|
|
@@ -21345,11 +21428,11 @@ declare const abi$d: readonly [{
|
|
|
21345
21428
|
readonly inputs: readonly [];
|
|
21346
21429
|
readonly name: "ZeroAddressException";
|
|
21347
21430
|
}];
|
|
21348
|
-
declare class CurveV1AdapterStETHContract extends AbstractAdapterContract<typeof abi$
|
|
21349
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
21431
|
+
declare class CurveV1AdapterStETHContract extends AbstractAdapterContract<typeof abi$c> {
|
|
21432
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$c>, "abi">);
|
|
21350
21433
|
}
|
|
21351
21434
|
|
|
21352
|
-
declare const abi$
|
|
21435
|
+
declare const abi$b: readonly [{
|
|
21353
21436
|
readonly type: "constructor";
|
|
21354
21437
|
readonly inputs: readonly [{
|
|
21355
21438
|
readonly name: "_creditManager";
|
|
@@ -21592,13 +21675,13 @@ declare const abi$c: readonly [{
|
|
|
21592
21675
|
readonly inputs: readonly [];
|
|
21593
21676
|
readonly name: "ZeroAddressException";
|
|
21594
21677
|
}];
|
|
21595
|
-
declare class ERC4626AdapterContract extends AbstractAdapterContract<typeof abi$
|
|
21596
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
21678
|
+
declare class ERC4626AdapterContract extends AbstractAdapterContract<typeof abi$b> {
|
|
21679
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$b>, "abi">);
|
|
21597
21680
|
}
|
|
21598
21681
|
|
|
21599
21682
|
declare function createAdapter(sdk: GearboxSDK, args: AdapterData): IAdapterContract;
|
|
21600
21683
|
|
|
21601
|
-
declare const abi$
|
|
21684
|
+
declare const abi$a: readonly [{
|
|
21602
21685
|
readonly type: "constructor";
|
|
21603
21686
|
readonly inputs: readonly [{
|
|
21604
21687
|
readonly name: "_creditManager";
|
|
@@ -21846,11 +21929,11 @@ declare const abi$b: readonly [{
|
|
|
21846
21929
|
readonly inputs: readonly [];
|
|
21847
21930
|
readonly name: "ZeroAddressException";
|
|
21848
21931
|
}];
|
|
21849
|
-
declare class UniswapV2AdapterContract extends AbstractAdapterContract<typeof abi$
|
|
21850
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
21932
|
+
declare class UniswapV2AdapterContract extends AbstractAdapterContract<typeof abi$a> {
|
|
21933
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$a>, "abi">);
|
|
21851
21934
|
}
|
|
21852
21935
|
|
|
21853
|
-
declare const abi$
|
|
21936
|
+
declare const abi$9: readonly [{
|
|
21854
21937
|
readonly type: "constructor";
|
|
21855
21938
|
readonly inputs: readonly [{
|
|
21856
21939
|
readonly name: "_creditManager";
|
|
@@ -22275,11 +22358,11 @@ declare const abi$a: readonly [{
|
|
|
22275
22358
|
readonly inputs: readonly [];
|
|
22276
22359
|
readonly name: "ZeroAddressException";
|
|
22277
22360
|
}];
|
|
22278
|
-
declare class UniswapV3AdapterContract extends AbstractAdapterContract<typeof abi$
|
|
22279
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
22361
|
+
declare class UniswapV3AdapterContract extends AbstractAdapterContract<typeof abi$9> {
|
|
22362
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$9>, "abi">);
|
|
22280
22363
|
}
|
|
22281
22364
|
|
|
22282
|
-
declare const abi$
|
|
22365
|
+
declare const abi$8: readonly [{
|
|
22283
22366
|
readonly type: "constructor";
|
|
22284
22367
|
readonly inputs: readonly [{
|
|
22285
22368
|
readonly name: "_creditManager";
|
|
@@ -22553,11 +22636,11 @@ declare const abi$9: readonly [{
|
|
|
22553
22636
|
readonly inputs: readonly [];
|
|
22554
22637
|
readonly name: "ZeroAddressException";
|
|
22555
22638
|
}];
|
|
22556
|
-
declare class VelodromeV2RouterAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
22557
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
22639
|
+
declare class VelodromeV2RouterAdapterContract extends AbstractAdapterContract<typeof abi$8> {
|
|
22640
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$8>, "abi">);
|
|
22558
22641
|
}
|
|
22559
22642
|
|
|
22560
|
-
declare const abi$
|
|
22643
|
+
declare const abi$7: readonly [{
|
|
22561
22644
|
readonly type: "constructor";
|
|
22562
22645
|
readonly inputs: readonly [{
|
|
22563
22646
|
readonly name: "_creditManager";
|
|
@@ -22740,11 +22823,11 @@ declare const abi$8: readonly [{
|
|
|
22740
22823
|
readonly inputs: readonly [];
|
|
22741
22824
|
readonly name: "ZeroAddressException";
|
|
22742
22825
|
}];
|
|
22743
|
-
declare class WstETHV1AdapterContract extends AbstractAdapterContract<typeof abi$
|
|
22744
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
22826
|
+
declare class WstETHV1AdapterContract extends AbstractAdapterContract<typeof abi$7> {
|
|
22827
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$7>, "abi">);
|
|
22745
22828
|
}
|
|
22746
22829
|
|
|
22747
|
-
declare const abi$
|
|
22830
|
+
declare const abi$6: readonly [{
|
|
22748
22831
|
readonly type: "constructor";
|
|
22749
22832
|
readonly inputs: readonly [{
|
|
22750
22833
|
readonly name: "_creditManager";
|
|
@@ -22997,12 +23080,12 @@ declare const abi$7: readonly [{
|
|
|
22997
23080
|
readonly inputs: readonly [];
|
|
22998
23081
|
readonly name: "ZeroAddressException";
|
|
22999
23082
|
}];
|
|
23000
|
-
declare class YearnV2RouterAdapterContract extends AbstractAdapterContract<typeof abi$
|
|
23001
|
-
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$
|
|
23083
|
+
declare class YearnV2RouterAdapterContract extends AbstractAdapterContract<typeof abi$6> {
|
|
23084
|
+
constructor(sdk: GearboxSDK, args: Omit<AbstractAdapterContractOptions<typeof abi$6>, "abi">);
|
|
23002
23085
|
}
|
|
23003
23086
|
|
|
23004
|
-
type abi$
|
|
23005
|
-
declare class CreditManagerContract extends BaseContract<abi$
|
|
23087
|
+
type abi$5 = typeof creditManagerV3Abi;
|
|
23088
|
+
declare class CreditManagerContract extends BaseContract<abi$5> {
|
|
23006
23089
|
#private;
|
|
23007
23090
|
readonly state: CreditManagerState;
|
|
23008
23091
|
constructor(sdk: GearboxSDK, { creditManager, creditFacade }: CreditManagerData, pool: PoolData);
|
|
@@ -23027,19 +23110,19 @@ declare class CreditFactory {
|
|
|
23027
23110
|
get state(): CreditFactoryState;
|
|
23028
23111
|
}
|
|
23029
23112
|
|
|
23030
|
-
type abi$
|
|
23031
|
-
declare class GaugeContract extends BaseContract<abi$
|
|
23113
|
+
type abi$4 = typeof gaugeV3Abi;
|
|
23114
|
+
declare class GaugeContract extends BaseContract<abi$4> {
|
|
23032
23115
|
state: GaugeState;
|
|
23033
23116
|
constructor(sdk: GearboxSDK, pool: PoolData, gauge: RateKeeperData);
|
|
23034
23117
|
}
|
|
23035
23118
|
|
|
23036
|
-
type abi$
|
|
23037
|
-
declare class LinearModelContract extends BaseContract<abi$
|
|
23119
|
+
type abi$3 = typeof linearInterestRateModelV3Abi;
|
|
23120
|
+
declare class LinearModelContract extends BaseContract<abi$3> {
|
|
23038
23121
|
readonly state: LinearModelState;
|
|
23039
23122
|
constructor(sdk: GearboxSDK, { interestRateModel }: MarketData);
|
|
23040
23123
|
}
|
|
23041
23124
|
|
|
23042
|
-
declare const abi$
|
|
23125
|
+
declare const abi$2: readonly [{
|
|
23043
23126
|
readonly type: "constructor";
|
|
23044
23127
|
readonly inputs: readonly [{
|
|
23045
23128
|
readonly name: "addressProvider_";
|
|
@@ -24363,12 +24446,12 @@ declare const abi$3: readonly [{
|
|
|
24363
24446
|
readonly inputs: readonly [];
|
|
24364
24447
|
readonly name: "ZeroAddressException";
|
|
24365
24448
|
}];
|
|
24366
|
-
declare class PoolContract extends BaseContract<typeof abi$
|
|
24449
|
+
declare class PoolContract extends BaseContract<typeof abi$2> {
|
|
24367
24450
|
state: PoolState;
|
|
24368
24451
|
hasOperation: boolean;
|
|
24369
24452
|
constructor(sdk: GearboxSDK, data: PoolData);
|
|
24370
24453
|
parseLog(log: Log): void;
|
|
24371
|
-
parseFunctionParams(params: DecodeFunctionDataReturnType<typeof abi$
|
|
24454
|
+
parseFunctionParams(params: DecodeFunctionDataReturnType<typeof abi$2>): Array<string> | undefined;
|
|
24372
24455
|
}
|
|
24373
24456
|
|
|
24374
24457
|
type Unarray<A> = A extends readonly unknown[] ? Unarray<A[number]> : A;
|
|
@@ -24401,8 +24484,8 @@ declare enum VotingContractStatus {
|
|
|
24401
24484
|
UNVOTE_ONLY = 2
|
|
24402
24485
|
}
|
|
24403
24486
|
|
|
24404
|
-
type abi$
|
|
24405
|
-
declare class PoolQuotaKeeperContract extends BaseContract<abi$
|
|
24487
|
+
type abi$1 = typeof poolQuotaKeeperV3Abi;
|
|
24488
|
+
declare class PoolQuotaKeeperContract extends BaseContract<abi$1> {
|
|
24406
24489
|
readonly decimals: number;
|
|
24407
24490
|
readonly state: PoolQuotaKeeperState;
|
|
24408
24491
|
constructor(sdk: GearboxSDK, pool: PoolData, pqk: PoolQuotaKeeperData);
|
|
@@ -24418,82 +24501,6 @@ declare class PoolFactory {
|
|
|
24418
24501
|
get state(): PoolFactoryState;
|
|
24419
24502
|
}
|
|
24420
24503
|
|
|
24421
|
-
type abi$1 = typeof priceOracleV3Abi;
|
|
24422
|
-
interface PriceFeedsForTokensOptions {
|
|
24423
|
-
main?: boolean;
|
|
24424
|
-
reserve?: boolean;
|
|
24425
|
-
}
|
|
24426
|
-
interface OnDemandPriceUpdate {
|
|
24427
|
-
token: Address;
|
|
24428
|
-
reserve: boolean;
|
|
24429
|
-
data: Hex;
|
|
24430
|
-
}
|
|
24431
|
-
declare class PriceOracleContract extends BaseContract<abi$1> {
|
|
24432
|
-
#private;
|
|
24433
|
-
/**
|
|
24434
|
-
* Underlying token of market to which this price oracle belongs
|
|
24435
|
-
*/
|
|
24436
|
-
readonly underlying: Address;
|
|
24437
|
-
/**
|
|
24438
|
-
* Mapping Token => [PriceFeed Address, stalenessPeriod]
|
|
24439
|
-
*/
|
|
24440
|
-
readonly mainPriceFeeds: Record<Address, PriceFeedRef>;
|
|
24441
|
-
/**
|
|
24442
|
-
* Mapping Token => [PriceFeed Address, stalenessPeriod]
|
|
24443
|
-
*/
|
|
24444
|
-
readonly reservePriceFeeds: Record<Address, PriceFeedRef>;
|
|
24445
|
-
/**
|
|
24446
|
-
* Mapping Token => Price in underlying
|
|
24447
|
-
*/
|
|
24448
|
-
readonly mainPrices: AddressMap<bigint>;
|
|
24449
|
-
/**
|
|
24450
|
-
* Mapping Token => Price in underlying
|
|
24451
|
-
*/
|
|
24452
|
-
readonly reservePrices: AddressMap<bigint>;
|
|
24453
|
-
constructor(sdk: GearboxSDK, data: PriceOracleData, underlying: Address);
|
|
24454
|
-
/**
|
|
24455
|
-
* Returns main and reserve price feeds for given tokens
|
|
24456
|
-
* @param tokens
|
|
24457
|
-
* @param opts Option to include main/reserve feeds only, defaults to both
|
|
24458
|
-
* @returns
|
|
24459
|
-
*/
|
|
24460
|
-
priceFeedsForTokens(tokens: Address[], opts?: PriceFeedsForTokensOptions): IPriceFeedContract[];
|
|
24461
|
-
/**
|
|
24462
|
-
* Generates updates for all updateable price feeds in this oracle (including dependencies)
|
|
24463
|
-
* @returns
|
|
24464
|
-
*/
|
|
24465
|
-
updatePriceFeeds(): Promise<UpdatePriceFeedsResult>;
|
|
24466
|
-
/**
|
|
24467
|
-
* Converts previously obtained price updates into CreditFacade multicall entries
|
|
24468
|
-
* @param creditFacade
|
|
24469
|
-
* @param updates
|
|
24470
|
-
* @returns
|
|
24471
|
-
*/
|
|
24472
|
-
onDemandPriceUpdates(updates?: UpdatePriceFeedsResult): OnDemandPriceUpdate[];
|
|
24473
|
-
/**
|
|
24474
|
-
* Tries to convert amount of token into underlying of current market
|
|
24475
|
-
* @param token
|
|
24476
|
-
* @param amount
|
|
24477
|
-
* @param reserve
|
|
24478
|
-
* @returns
|
|
24479
|
-
*/
|
|
24480
|
-
convertToUnderlying(token: Address, amount: bigint, reserve?: boolean): bigint;
|
|
24481
|
-
/**
|
|
24482
|
-
* Tries to convert amount of from one token to another, using latest known prices
|
|
24483
|
-
* @param from
|
|
24484
|
-
* @param to
|
|
24485
|
-
* @param amount
|
|
24486
|
-
* @param reserve
|
|
24487
|
-
*/
|
|
24488
|
-
convert(from: Address, to: Address, amount: bigint, reserve?: boolean): bigint;
|
|
24489
|
-
/**
|
|
24490
|
-
* Loads new prices for this oracle from PriceFeedCompressor
|
|
24491
|
-
* Does not update price feeds, only updates prices
|
|
24492
|
-
*/
|
|
24493
|
-
updatePrices(): Promise<void>;
|
|
24494
|
-
get state(): PriceOracleState;
|
|
24495
|
-
}
|
|
24496
|
-
|
|
24497
24504
|
declare class MarketFactory {
|
|
24498
24505
|
readonly riskCurator: Address;
|
|
24499
24506
|
readonly poolFactory: PoolFactory;
|
package/dist/esm/sdk/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isAddress, bytesToString, toBytes, prepareEncodeFunctionData, encodeAbiParameters, concatHex, getContract, isHex, decodeFunctionData, decodeAbiParameters, parseEventLogs, defineChain, http, fallback, createPublicClient, getChainContractAddress,
|
|
1
|
+
import { isAddress, bytesToString, toBytes, prepareEncodeFunctionData, encodeAbiParameters, concatHex, getContract, isHex, decodeFunctionData, encodeFunctionData, decodeAbiParameters, parseEventLogs, defineChain, http, fallback, createPublicClient, getChainContractAddress, getContractError, multicall3Abi, AbiDecodingZeroDataError, RawContractError, decodeFunctionResult, BaseError, erc4626Abi, hexToBytes } from 'viem';
|
|
2
2
|
import { formatAbiItem, getAction } from 'viem/utils';
|
|
3
3
|
import { intervalToDuration, formatDuration as formatDuration$1 } from 'date-fns';
|
|
4
4
|
import { mainnet, arbitrum, optimism, base } from 'viem/chains';
|
|
@@ -19629,8 +19629,6 @@ var CreditConfiguratorContract = class extends BaseContract {
|
|
|
19629
19629
|
}
|
|
19630
19630
|
}
|
|
19631
19631
|
};
|
|
19632
|
-
|
|
19633
|
-
// src/sdk/market/CreditFacadeV300Contract.ts
|
|
19634
19632
|
var CreditFacadeV300Contract = class extends BaseContract {
|
|
19635
19633
|
state;
|
|
19636
19634
|
constructor(sdk, { creditFacade, creditManager }) {
|
|
@@ -19657,6 +19655,16 @@ var CreditFacadeV300Contract = class extends BaseContract {
|
|
|
19657
19655
|
isPaused: creditFacade.isPaused
|
|
19658
19656
|
};
|
|
19659
19657
|
}
|
|
19658
|
+
encodeOnDemandPriceUpdates(updates) {
|
|
19659
|
+
return updates.map((u) => ({
|
|
19660
|
+
target: this.address,
|
|
19661
|
+
callData: encodeFunctionData({
|
|
19662
|
+
abi: iCreditFacadeV3MulticallAbi,
|
|
19663
|
+
functionName: "onDemandPriceUpdate",
|
|
19664
|
+
args: [u.token, u.reserve, u.data]
|
|
19665
|
+
})
|
|
19666
|
+
}));
|
|
19667
|
+
}
|
|
19660
19668
|
liquidateCreditAccount(ca, to, calls) {
|
|
19661
19669
|
return this.createRawTx({
|
|
19662
19670
|
functionName: "liquidateCreditAccount",
|
|
@@ -19713,8 +19721,6 @@ var CreditFacadeV300Contract = class extends BaseContract {
|
|
|
19713
19721
|
}
|
|
19714
19722
|
}
|
|
19715
19723
|
};
|
|
19716
|
-
|
|
19717
|
-
// src/sdk/market/CreditFacadeV310Contract.ts
|
|
19718
19724
|
var CreditFacadeV310Contract = class extends BaseContract {
|
|
19719
19725
|
state;
|
|
19720
19726
|
constructor(sdk, { creditFacade, creditManager }) {
|
|
@@ -19741,6 +19747,23 @@ var CreditFacadeV310Contract = class extends BaseContract {
|
|
|
19741
19747
|
isPaused: creditFacade.isPaused
|
|
19742
19748
|
};
|
|
19743
19749
|
}
|
|
19750
|
+
encodeOnDemandPriceUpdates(updates) {
|
|
19751
|
+
return [
|
|
19752
|
+
{
|
|
19753
|
+
target: this.address,
|
|
19754
|
+
callData: encodeFunctionData({
|
|
19755
|
+
abi: iCreditFacadeV310MulticallAbi,
|
|
19756
|
+
functionName: "onDemandPriceUpdates",
|
|
19757
|
+
args: [
|
|
19758
|
+
updates.map((u) => ({
|
|
19759
|
+
priceFeed: u.priceFeed,
|
|
19760
|
+
data: u.data
|
|
19761
|
+
}))
|
|
19762
|
+
]
|
|
19763
|
+
})
|
|
19764
|
+
}
|
|
19765
|
+
];
|
|
19766
|
+
}
|
|
19744
19767
|
liquidateCreditAccount(ca, to, calls) {
|
|
19745
19768
|
return this.createRawTx({
|
|
19746
19769
|
functionName: "liquidateCreditAccount",
|
|
@@ -21250,6 +21273,7 @@ var PriceOracleContract = class extends BaseContract {
|
|
|
21250
21273
|
});
|
|
21251
21274
|
const data = args[0];
|
|
21252
21275
|
result.push({
|
|
21276
|
+
priceFeed,
|
|
21253
21277
|
token,
|
|
21254
21278
|
reserve,
|
|
21255
21279
|
data
|
|
@@ -21764,14 +21788,7 @@ var CreditAccountsService = class extends SDKConstruct {
|
|
|
21764
21788
|
async getPriceUpdatesForFacade(acc) {
|
|
21765
21789
|
const cm = this.sdk.marketRegister.findCreditManager(acc.creditManager);
|
|
21766
21790
|
const updates = await this.getOnDemandPriceUpdates(acc);
|
|
21767
|
-
return
|
|
21768
|
-
target: cm.creditFacade.address,
|
|
21769
|
-
callData: encodeFunctionData({
|
|
21770
|
-
abi: iCreditFacadeV3MulticallAbi,
|
|
21771
|
-
functionName: "onDemandPriceUpdate",
|
|
21772
|
-
args: [token, reserve, data]
|
|
21773
|
-
})
|
|
21774
|
-
}));
|
|
21791
|
+
return cm.creditFacade.encodeOnDemandPriceUpdates(updates);
|
|
21775
21792
|
}
|
|
21776
21793
|
async #prepareCloseCreditAccount(ca, cm, assetsToKeep, to, slippage = 50n) {
|
|
21777
21794
|
const closePath = await this.sdk.router.findBestClosePath(
|