@gearbox-protocol/sdk 3.0.0-vfour.49 → 3.0.0-vfour.50
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 +40 -58
- package/dist/cjs/sdk/index.d.ts +32 -46
- package/dist/esm/sdk/index.d.mts +32 -46
- package/dist/esm/sdk/index.mjs +41 -60
- package/package.json +1 -1
package/dist/cjs/sdk/index.cjs
CHANGED
|
@@ -19867,14 +19867,12 @@ function createAdapter(sdk, args) {
|
|
|
19867
19867
|
// src/sdk/market/CreditConfiguratorContract.ts
|
|
19868
19868
|
var CreditConfiguratorContract = class extends BaseContract {
|
|
19869
19869
|
adapters = [];
|
|
19870
|
-
|
|
19871
|
-
constructor(sdk, { creditConfigurator, creditManager }, emergencyLiquidators) {
|
|
19870
|
+
constructor(sdk, { creditConfigurator, creditManager }) {
|
|
19872
19871
|
super(sdk, {
|
|
19873
19872
|
...creditConfigurator.baseParams,
|
|
19874
19873
|
name: `CreditConfigurator(${creditManager.name})`,
|
|
19875
19874
|
abi: creditConfiguratorV3Abi
|
|
19876
19875
|
});
|
|
19877
|
-
this.emergencyLiquidators = [...emergencyLiquidators];
|
|
19878
19876
|
}
|
|
19879
19877
|
processLog(log) {
|
|
19880
19878
|
switch (log.eventName) {
|
|
@@ -19906,13 +19904,6 @@ var CreditConfiguratorContract = class extends BaseContract {
|
|
|
19906
19904
|
break;
|
|
19907
19905
|
}
|
|
19908
19906
|
}
|
|
19909
|
-
stateHuman(raw) {
|
|
19910
|
-
return {
|
|
19911
|
-
...super.stateHuman(raw),
|
|
19912
|
-
// TODO: this was moved to market data
|
|
19913
|
-
emergencyLiquidators: []
|
|
19914
|
-
};
|
|
19915
|
-
}
|
|
19916
19907
|
parseFunctionParams(params) {
|
|
19917
19908
|
switch (params.functionName) {
|
|
19918
19909
|
case "addCollateralToken":
|
|
@@ -20297,7 +20288,7 @@ var CreditFactory = class extends SDKConstruct {
|
|
|
20297
20288
|
creditConfigurator;
|
|
20298
20289
|
constructor(sdk, marketData, index) {
|
|
20299
20290
|
super(sdk);
|
|
20300
|
-
const { creditManagers, pool
|
|
20291
|
+
const { creditManagers, pool } = marketData;
|
|
20301
20292
|
const creditManager = creditManagers[index];
|
|
20302
20293
|
const { name, collateralTokens, liquidationThresholds } = creditManager.creditManager;
|
|
20303
20294
|
this.name = name;
|
|
@@ -20314,8 +20305,7 @@ var CreditFactory = class extends SDKConstruct {
|
|
|
20314
20305
|
}
|
|
20315
20306
|
this.creditConfigurator = new CreditConfiguratorContract(
|
|
20316
20307
|
sdk,
|
|
20317
|
-
creditManager
|
|
20318
|
-
emergencyLiquidators
|
|
20308
|
+
creditManager
|
|
20319
20309
|
);
|
|
20320
20310
|
}
|
|
20321
20311
|
async tvl() {
|
|
@@ -20676,8 +20666,15 @@ var chains = {
|
|
|
20676
20666
|
Optimism: chains$1.optimism,
|
|
20677
20667
|
Base: chains$1.base
|
|
20678
20668
|
};
|
|
20669
|
+
function createTransport(opts) {
|
|
20670
|
+
const { timeout = 12e4, retryCount } = opts;
|
|
20671
|
+
if ("transport" in opts) {
|
|
20672
|
+
return opts.transport;
|
|
20673
|
+
}
|
|
20674
|
+
const rpcs = opts.rpcURLs.map((url) => viem.http(url, { timeout, retryCount }));
|
|
20675
|
+
return rpcs.length ? viem.fallback(rpcs) : rpcs[0];
|
|
20676
|
+
}
|
|
20679
20677
|
var Provider = class {
|
|
20680
|
-
account;
|
|
20681
20678
|
chainId;
|
|
20682
20679
|
chain;
|
|
20683
20680
|
networkType;
|
|
@@ -20685,23 +20682,14 @@ var Provider = class {
|
|
|
20685
20682
|
addressLabels;
|
|
20686
20683
|
transport;
|
|
20687
20684
|
constructor(opts) {
|
|
20688
|
-
const {
|
|
20689
|
-
account,
|
|
20690
|
-
chainId,
|
|
20691
|
-
networkType,
|
|
20692
|
-
rpcURLs,
|
|
20693
|
-
timeout = 12e4,
|
|
20694
|
-
retryCount
|
|
20695
|
-
} = opts;
|
|
20696
|
-
this.account = account;
|
|
20685
|
+
const { chainId, networkType } = opts;
|
|
20697
20686
|
this.chainId = chainId;
|
|
20698
20687
|
this.networkType = networkType;
|
|
20699
20688
|
this.chain = viem.defineChain({
|
|
20700
20689
|
...chains[networkType],
|
|
20701
20690
|
id: chainId
|
|
20702
20691
|
});
|
|
20703
|
-
|
|
20704
|
-
this.transport = rpcs.length ? viem.fallback(rpcs) : rpcs[0];
|
|
20692
|
+
this.transport = createTransport(opts);
|
|
20705
20693
|
this.publicClient = viem.createPublicClient({
|
|
20706
20694
|
chain: this.chain,
|
|
20707
20695
|
transport: this.transport
|
|
@@ -21866,6 +21854,9 @@ var MarketFactory = class extends SDKConstruct {
|
|
|
21866
21854
|
poolFactory;
|
|
21867
21855
|
priceOracle;
|
|
21868
21856
|
creditManagers = [];
|
|
21857
|
+
pausableAdmins;
|
|
21858
|
+
unpausableAdmins;
|
|
21859
|
+
emergencyLiquidators;
|
|
21869
21860
|
constructor(sdk, marketData) {
|
|
21870
21861
|
super(sdk);
|
|
21871
21862
|
this.riskCurator = marketData.owner;
|
|
@@ -21882,6 +21873,9 @@ var MarketFactory = class extends SDKConstruct {
|
|
|
21882
21873
|
marketData.priceOracleData,
|
|
21883
21874
|
marketData.pool.underlying
|
|
21884
21875
|
);
|
|
21876
|
+
this.pausableAdmins = marketData.pausableAdmins;
|
|
21877
|
+
this.unpausableAdmins = marketData.unpausableAdmins;
|
|
21878
|
+
this.emergencyLiquidators = marketData.emergencyLiquidators;
|
|
21885
21879
|
}
|
|
21886
21880
|
get dirty() {
|
|
21887
21881
|
return this.poolFactory.dirty || this.priceOracle.dirty || this.creditManagers.some((cm) => cm.dirty);
|
|
@@ -21890,7 +21884,12 @@ var MarketFactory = class extends SDKConstruct {
|
|
|
21890
21884
|
return {
|
|
21891
21885
|
pool: this.poolFactory.stateHuman(raw),
|
|
21892
21886
|
creditManagers: this.creditManagers.map((cm) => cm.stateHuman(raw)),
|
|
21893
|
-
priceOracle: this.priceOracle.stateHuman(raw)
|
|
21887
|
+
priceOracle: this.priceOracle.stateHuman(raw),
|
|
21888
|
+
pausableAdmins: this.pausableAdmins.map((a) => this.labelAddress(a)),
|
|
21889
|
+
unpausableAdmins: this.unpausableAdmins.map((a) => this.labelAddress(a)),
|
|
21890
|
+
emergencyLiquidators: this.emergencyLiquidators.map(
|
|
21891
|
+
(a) => this.labelAddress(a)
|
|
21892
|
+
)
|
|
21894
21893
|
};
|
|
21895
21894
|
}
|
|
21896
21895
|
};
|
|
@@ -22078,7 +22077,6 @@ var CreditAccountsService = class extends SDKConstruct {
|
|
|
22078
22077
|
}
|
|
22079
22078
|
const { txs: priceUpdateTxs, timestamp: _ } = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs();
|
|
22080
22079
|
const resp = await simulateMulticall(this.provider.publicClient, {
|
|
22081
|
-
account: this.provider.account,
|
|
22082
22080
|
contracts: [
|
|
22083
22081
|
...priceUpdateTxs.map(rawTxToMulticallPriceUpdate),
|
|
22084
22082
|
{
|
|
@@ -22159,15 +22157,10 @@ var CreditAccountsService = class extends SDKConstruct {
|
|
|
22159
22157
|
slippage
|
|
22160
22158
|
);
|
|
22161
22159
|
const priceUpdates = await this.getPriceUpdatesForFacade(account);
|
|
22162
|
-
|
|
22163
|
-
|
|
22164
|
-
|
|
22165
|
-
|
|
22166
|
-
return cm.creditFacade.liquidateCreditAccount(
|
|
22167
|
-
account.creditAccount,
|
|
22168
|
-
recipient,
|
|
22169
|
-
[...priceUpdates, ...preview.calls]
|
|
22170
|
-
);
|
|
22160
|
+
return cm.creditFacade.liquidateCreditAccount(account.creditAccount, to, [
|
|
22161
|
+
...priceUpdates,
|
|
22162
|
+
...preview.calls
|
|
22163
|
+
]);
|
|
22171
22164
|
}
|
|
22172
22165
|
/**
|
|
22173
22166
|
* Closes credit account or sets debt to zero (but keep account)
|
|
@@ -22180,15 +22173,11 @@ var CreditAccountsService = class extends SDKConstruct {
|
|
|
22180
22173
|
*/
|
|
22181
22174
|
async closeCreditAccount(operation, ca, assetsToKeep, to, slippage = 50n) {
|
|
22182
22175
|
const cm = this.sdk.marketRegister.findCreditManager(ca.creditManager);
|
|
22183
|
-
const recipient = to ?? this.sdk.provider.account;
|
|
22184
|
-
if (!recipient) {
|
|
22185
|
-
throw new Error("close account: assets recipient not specied");
|
|
22186
|
-
}
|
|
22187
22176
|
const calls = await this.#prepareCloseCreditAccount(
|
|
22188
22177
|
ca,
|
|
22189
22178
|
cm,
|
|
22190
22179
|
assetsToKeep,
|
|
22191
|
-
|
|
22180
|
+
to,
|
|
22192
22181
|
slippage
|
|
22193
22182
|
);
|
|
22194
22183
|
return operation === "close" ? cm.creditFacade.closeCreditAccount(ca.creditAccount, calls) : cm.creditFacade.multicall(ca.creditAccount, calls);
|
|
@@ -22204,7 +22193,6 @@ var CreditAccountsService = class extends SDKConstruct {
|
|
|
22204
22193
|
const blockNumber = options?.blockNumber;
|
|
22205
22194
|
if (priceUpdateTxs?.length) {
|
|
22206
22195
|
const resp = await simulateMulticall(this.provider.publicClient, {
|
|
22207
|
-
account: this.provider.account,
|
|
22208
22196
|
contracts: [
|
|
22209
22197
|
...priceUpdateTxs.map(rawTxToMulticallPriceUpdate),
|
|
22210
22198
|
{
|
|
@@ -22918,13 +22906,10 @@ var GearboxSDK = class _GearboxSDK {
|
|
|
22918
22906
|
*/
|
|
22919
22907
|
contracts = new AddressMap();
|
|
22920
22908
|
static async attach(options) {
|
|
22921
|
-
const {
|
|
22909
|
+
const { logger, riskCurators } = options;
|
|
22922
22910
|
let { networkType, addressProvider, chainId } = options;
|
|
22923
|
-
if (rpcURLs.length === 0) {
|
|
22924
|
-
throw new Error("please specify at least one rpc url");
|
|
22925
|
-
}
|
|
22926
22911
|
const attachClient = viem.createPublicClient({
|
|
22927
|
-
transport:
|
|
22912
|
+
transport: createTransport(options)
|
|
22928
22913
|
});
|
|
22929
22914
|
if (!networkType) {
|
|
22930
22915
|
networkType = await detectNetwork(attachClient);
|
|
@@ -22936,10 +22921,9 @@ var GearboxSDK = class _GearboxSDK {
|
|
|
22936
22921
|
addressProvider = ADDRESS_PROVIDER[networkType];
|
|
22937
22922
|
}
|
|
22938
22923
|
const provider = new Provider({
|
|
22924
|
+
...options,
|
|
22939
22925
|
chainId,
|
|
22940
|
-
networkType
|
|
22941
|
-
rpcURLs,
|
|
22942
|
-
timeout
|
|
22926
|
+
networkType
|
|
22943
22927
|
});
|
|
22944
22928
|
logger?.debug(
|
|
22945
22929
|
{ networkType, chainId, addressProvider },
|
|
@@ -22957,7 +22941,11 @@ var GearboxSDK = class _GearboxSDK {
|
|
|
22957
22941
|
}
|
|
22958
22942
|
async #attach(addressProviderAddress, riskCurators) {
|
|
22959
22943
|
const time = Date.now();
|
|
22960
|
-
await this.
|
|
22944
|
+
const block = await this.provider.publicClient.getBlock({
|
|
22945
|
+
blockTag: "latest"
|
|
22946
|
+
});
|
|
22947
|
+
this.#currentBlock = block.number;
|
|
22948
|
+
this.#timestamp = block.timestamp;
|
|
22961
22949
|
this.logger?.info("Attaching to address provider", addressProviderAddress);
|
|
22962
22950
|
this.#addressProvider = new AddressProviderContractV3_1(
|
|
22963
22951
|
this,
|
|
@@ -23010,13 +22998,6 @@ var GearboxSDK = class _GearboxSDK {
|
|
|
23010
22998
|
(call) => this.parseFunctionData(call.target, call.callData)
|
|
23011
22999
|
);
|
|
23012
23000
|
}
|
|
23013
|
-
async updateBlock() {
|
|
23014
|
-
const block = await this.provider.publicClient.getBlock({
|
|
23015
|
-
blockTag: "latest"
|
|
23016
|
-
});
|
|
23017
|
-
this.#currentBlock = block.number;
|
|
23018
|
-
this.#timestamp = block.timestamp;
|
|
23019
|
-
}
|
|
23020
23001
|
stateHuman(raw = true) {
|
|
23021
23002
|
return {
|
|
23022
23003
|
block: Number(this.currentBlock),
|
|
@@ -23240,6 +23221,7 @@ exports.chains = chains;
|
|
|
23240
23221
|
exports.childLogger = childLogger;
|
|
23241
23222
|
exports.createAdapter = createAdapter;
|
|
23242
23223
|
exports.createRawTx = createRawTx;
|
|
23224
|
+
exports.createTransport = createTransport;
|
|
23243
23225
|
exports.detectNetwork = detectNetwork;
|
|
23244
23226
|
exports.etherscanUrl = etherscanUrl;
|
|
23245
23227
|
exports.filterDust = filterDust;
|
package/dist/cjs/sdk/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, Chain,
|
|
1
|
+
import { Address, Chain, Transport, PublicClient, Abi, Log, ContractEventName, DecodeFunctionDataReturnType, Hex, ContractFunctionName, EncodeFunctionDataParameters, TransactionReceipt, UnionOmit, GetContractReturnType, Client, ContractFunctionParameters, CallParameters, MulticallContracts, Narrow, AbiStateMutability, MulticallResults, GetChainContractAddressErrorType, ReadContractErrorType, GetContractErrorReturnType, EncodeFunctionDataErrorType, DecodeFunctionResultErrorType } from 'viem';
|
|
2
2
|
import { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from 'abitype';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -24,15 +24,28 @@ declare const SUPPORTED_CHAINS: readonly ["Mainnet", "Arbitrum", "Optimism", "Ba
|
|
|
24
24
|
type NetworkType = (typeof SUPPORTED_CHAINS)[number];
|
|
25
25
|
declare const chains: Record<NetworkType, Chain>;
|
|
26
26
|
|
|
27
|
-
interface
|
|
27
|
+
interface NetworkOptions {
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Chain Id needs to be set, because we sometimemes use forked testnets with different chain ids
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
chainId: number;
|
|
32
|
+
/**
|
|
33
|
+
* NetworkType needs to be set, because we sometimemes use forked testnets with different chain ids
|
|
34
|
+
*/
|
|
35
|
+
networkType: NetworkType;
|
|
36
|
+
}
|
|
37
|
+
type TransportOptions = {
|
|
32
38
|
/**
|
|
33
39
|
* RPC URL (and fallbacks) to use.
|
|
34
40
|
*/
|
|
35
41
|
rpcURLs: string[];
|
|
42
|
+
} | {
|
|
43
|
+
/**
|
|
44
|
+
* Alternatively, can pass entire viem transport
|
|
45
|
+
*/
|
|
46
|
+
transport: Transport;
|
|
47
|
+
};
|
|
48
|
+
interface ConnectionOptions {
|
|
36
49
|
/**
|
|
37
50
|
* RPC client timeout in milliseconds
|
|
38
51
|
*/
|
|
@@ -41,24 +54,16 @@ interface ProviderOptions {
|
|
|
41
54
|
* Retry count for RPC
|
|
42
55
|
*/
|
|
43
56
|
retryCount?: number;
|
|
44
|
-
/**
|
|
45
|
-
* Chain Id needs to be set, because we sometimemes use forked testnets with different chain ids
|
|
46
|
-
*/
|
|
47
|
-
chainId: number;
|
|
48
|
-
/**
|
|
49
|
-
* NetworkType needs to be set, because we sometimemes use forked testnets with different chain ids
|
|
50
|
-
*/
|
|
51
|
-
networkType: NetworkType;
|
|
52
57
|
}
|
|
58
|
+
declare function createTransport(opts: TransportOptions & ConnectionOptions): Transport;
|
|
53
59
|
declare class Provider {
|
|
54
|
-
readonly account?: Address;
|
|
55
60
|
readonly chainId: number;
|
|
56
61
|
readonly chain: Chain;
|
|
57
62
|
readonly networkType: NetworkType;
|
|
58
63
|
readonly publicClient: PublicClient;
|
|
59
64
|
readonly addressLabels: IAddressLabeller;
|
|
60
65
|
readonly transport: Transport;
|
|
61
|
-
constructor(opts:
|
|
66
|
+
constructor(opts: NetworkOptions & TransportOptions & ConnectionOptions);
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
declare const iAddressProviderV3_1Abi: readonly [{
|
|
@@ -22043,10 +22048,8 @@ declare class YearnV2RouterAdapterContract extends AbstractAdapterContract<typeo
|
|
|
22043
22048
|
type abi$r = typeof creditConfiguratorV3Abi;
|
|
22044
22049
|
declare class CreditConfiguratorContract extends BaseContract<abi$r> {
|
|
22045
22050
|
readonly adapters: Address[];
|
|
22046
|
-
|
|
22047
|
-
constructor(sdk: GearboxSDK, { creditConfigurator, creditManager }: CreditManagerData, emergencyLiquidators: readonly Address[]);
|
|
22051
|
+
constructor(sdk: GearboxSDK, { creditConfigurator, creditManager }: CreditManagerData);
|
|
22048
22052
|
processLog(log: Log<bigint, number, false, undefined, undefined, abi$r, ContractEventName<abi$r>>): void;
|
|
22049
|
-
stateHuman(raw?: boolean): CreditConfiguratorStateHuman;
|
|
22050
22053
|
parseFunctionParams(params: DecodeFunctionDataReturnType<abi$r>): Array<string> | undefined;
|
|
22051
22054
|
}
|
|
22052
22055
|
|
|
@@ -23978,6 +23981,9 @@ declare class MarketFactory extends SDKConstruct {
|
|
|
23978
23981
|
readonly poolFactory: PoolFactory;
|
|
23979
23982
|
readonly priceOracle: PriceOracleContract;
|
|
23980
23983
|
readonly creditManagers: CreditFactory[];
|
|
23984
|
+
readonly pausableAdmins: readonly Address[];
|
|
23985
|
+
readonly unpausableAdmins: readonly Address[];
|
|
23986
|
+
readonly emergencyLiquidators: readonly Address[];
|
|
23981
23987
|
constructor(sdk: GearboxSDK, marketData: MarketData);
|
|
23982
23988
|
get dirty(): boolean;
|
|
23983
23989
|
stateHuman(raw?: boolean): MarketStateHuman;
|
|
@@ -24305,9 +24311,7 @@ interface CreditManagerStateHuman extends BaseContractStateHuman {
|
|
|
24305
24311
|
contractsToAdapters: Record<string, string>;
|
|
24306
24312
|
creditAccounts: Array<Address>;
|
|
24307
24313
|
}
|
|
24308
|
-
|
|
24309
|
-
emergencyLiquidators: Array<string>;
|
|
24310
|
-
}
|
|
24314
|
+
type CreditConfiguratorStateHuman = BaseContractStateHuman;
|
|
24311
24315
|
interface CreditFactoryStateHuman {
|
|
24312
24316
|
creditFacade: CreditFacadeStateHuman;
|
|
24313
24317
|
creditManager: CreditManagerStateHuman;
|
|
@@ -24379,6 +24383,9 @@ interface MarketStateHuman {
|
|
|
24379
24383
|
pool: PoolFactoryStateHuman;
|
|
24380
24384
|
creditManagers: CreditFactoryStateHuman[];
|
|
24381
24385
|
priceOracle: PriceOracleV3StateHuman;
|
|
24386
|
+
pausableAdmins: string[];
|
|
24387
|
+
unpausableAdmins: string[];
|
|
24388
|
+
emergencyLiquidators: string[];
|
|
24382
24389
|
}
|
|
24383
24390
|
interface GearboxStateHuman {
|
|
24384
24391
|
block: number;
|
|
@@ -24608,27 +24615,7 @@ declare class RouterV3Contract extends BaseContract<abi> implements IHooks<Route
|
|
|
24608
24615
|
getAvailableConnectors(collateralTokens: Address[]): Address[];
|
|
24609
24616
|
}
|
|
24610
24617
|
|
|
24611
|
-
interface
|
|
24612
|
-
/**
|
|
24613
|
-
* Account address for contract write simulations
|
|
24614
|
-
*/
|
|
24615
|
-
account?: Address;
|
|
24616
|
-
/**
|
|
24617
|
-
* RPC URL (and fallbacks) to use
|
|
24618
|
-
*/
|
|
24619
|
-
rpcURLs: string[];
|
|
24620
|
-
/**
|
|
24621
|
-
* RPC client timeout in milliseconds
|
|
24622
|
-
*/
|
|
24623
|
-
timeout?: number;
|
|
24624
|
-
/**
|
|
24625
|
-
* Actual chain id of rpc, if not set, will be determined
|
|
24626
|
-
*/
|
|
24627
|
-
chainId?: number;
|
|
24628
|
-
/**
|
|
24629
|
-
* If not set, will be detected automatically
|
|
24630
|
-
*/
|
|
24631
|
-
networkType?: NetworkType;
|
|
24618
|
+
interface SDKOptions {
|
|
24632
24619
|
/**
|
|
24633
24620
|
* If not set, address provider address is determinted automatically from networkType
|
|
24634
24621
|
*/
|
|
@@ -24662,7 +24649,7 @@ declare class GearboxSDK {
|
|
|
24662
24649
|
* All contracts known to sdk
|
|
24663
24650
|
*/
|
|
24664
24651
|
readonly contracts: AddressMap<BaseContract<any>>;
|
|
24665
|
-
static attach(options:
|
|
24652
|
+
static attach(options: SDKOptions & Partial<NetworkOptions> & ConnectionOptions & TransportOptions): Promise<GearboxSDK>;
|
|
24666
24653
|
private constructor();
|
|
24667
24654
|
/**
|
|
24668
24655
|
* Converts contract call into some human-friendly string
|
|
@@ -24678,7 +24665,6 @@ declare class GearboxSDK {
|
|
|
24678
24665
|
* @returns
|
|
24679
24666
|
*/
|
|
24680
24667
|
parseMultiCall(calls: MultiCall[]): string[];
|
|
24681
|
-
updateBlock(): Promise<void>;
|
|
24682
24668
|
stateHuman(raw?: boolean): GearboxStateHuman;
|
|
24683
24669
|
tvl(): Promise<void>;
|
|
24684
24670
|
/**
|
|
@@ -24799,7 +24785,7 @@ declare class CreditAccountsService extends SDKConstruct {
|
|
|
24799
24785
|
* @param slippage
|
|
24800
24786
|
* @returns
|
|
24801
24787
|
*/
|
|
24802
|
-
fullyLiquidate(account: CreditAccountData, to
|
|
24788
|
+
fullyLiquidate(account: CreditAccountData, to: Address, slippage?: bigint): Promise<RawTx>;
|
|
24803
24789
|
/**
|
|
24804
24790
|
* Closes credit account or sets debt to zero (but keep account)
|
|
24805
24791
|
* @param operation
|
|
@@ -24809,7 +24795,7 @@ declare class CreditAccountsService extends SDKConstruct {
|
|
|
24809
24795
|
* @param slippage
|
|
24810
24796
|
* @returns
|
|
24811
24797
|
*/
|
|
24812
|
-
closeCreditAccount(operation: "close" | "zeroDebt", ca: CreditAccountData, assetsToKeep: Address[], to
|
|
24798
|
+
closeCreditAccount(operation: "close" | "zeroDebt", ca: CreditAccountData, assetsToKeep: Address[], to: Address, slippage?: bigint): Promise<RawTx>;
|
|
24813
24799
|
/**
|
|
24814
24800
|
* Returns raw txs that are needed to update all price feeds so that all credit accounts (possibly from different markets) compute
|
|
24815
24801
|
* @param accounts
|
|
@@ -24936,4 +24922,4 @@ type MulticallErrorType = GetChainContractAddressErrorType | ReadContractErrorTy
|
|
|
24936
24922
|
*/
|
|
24937
24923
|
declare function simulateMulticall<const contracts extends readonly unknown[], chain extends Chain | undefined, allowFailure extends boolean = true>(client: Client<Transport, chain>, parameters: MulticallParameters<contracts, allowFailure>): Promise<MulticallReturnType<contracts, allowFailure>>;
|
|
24938
24924
|
|
|
24939
|
-
export { ADDRESS_0X0, ADDRESS_PROVIDER, AP_ACCOUNT_FACTORY, AP_ACL, AP_ADAPTER_COMPRESSOR, AP_BOT_LIST, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DEGEN_DISTRIBUTOR, AP_DEGEN_NFT, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_ORACLE, AP_ROUTER, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractPriceFeedContract, type AdapterContractType, type AdapterData, AddressLabeller, AddressMap, AddressProviderContractV3_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, BotListContract, type BotListStateHuman, BotPermissions, type BoundedOracleStateHuman, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, type ContractMethod, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, type CoreStateHuman, type CreditAccountData, type CreditAccountFilter, CreditAccountsService, CreditConfiguratorContract, type CreditConfiguratorState, type CreditConfiguratorStateHuman, type CreditFacadeState, type CreditFacadeStateHuman, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, type CreditFactoryStateHuman, CreditManagerContract, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerState, type CreditManagerStateHuman, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, type CurvePoolStruct, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, LinearModelContract, type LinearModelStateHuman, type LogFn, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, type MultiCall, type MulticallErrorType, type MulticallParameters, type MulticallReturnType, NOT_DEPLOYED, NO_VERSION, type NetworkType, type OnDemandPriceUpdate, type OpenStrategyResult, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PRICE_DECIMALS, PRICE_DECIMALS_POW, type PathOption, type PathOptionSerie, PoolContract, type PoolData, PoolFactory, type PoolFactoryStateHuman, PoolQuotaKeeperContract, type PoolQuotaKeeperData, type PoolQuotaKeeperStateHuman, type PoolStateHuman, type PriceFeedConstructorArgs, type PriceFeedContractType, type PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, type PriceFeedRegisterHooks, type PriceFeedStateHuman, type PriceFeedTreeNode, type PriceFeedUsageType, PriceOracleContract, type PriceOracleData, type PriceOracleV3StateHuman, Provider, type
|
|
24925
|
+
export { ADDRESS_0X0, ADDRESS_PROVIDER, AP_ACCOUNT_FACTORY, AP_ACL, AP_ADAPTER_COMPRESSOR, AP_BOT_LIST, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DEGEN_DISTRIBUTOR, AP_DEGEN_NFT, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_ORACLE, AP_ROUTER, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractPriceFeedContract, type AdapterContractType, type AdapterData, AddressLabeller, AddressMap, AddressProviderContractV3_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, BotListContract, type BotListStateHuman, BotPermissions, type BoundedOracleStateHuman, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, type ConnectionOptions, type ContractMethod, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, type CoreStateHuman, type CreditAccountData, type CreditAccountFilter, CreditAccountsService, CreditConfiguratorContract, type CreditConfiguratorState, type CreditConfiguratorStateHuman, type CreditFacadeState, type CreditFacadeStateHuman, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, type CreditFactoryStateHuman, CreditManagerContract, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerState, type CreditManagerStateHuman, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, type CurvePoolStruct, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, LinearModelContract, type LinearModelStateHuman, type LogFn, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, type MultiCall, type MulticallErrorType, type MulticallParameters, type MulticallReturnType, NOT_DEPLOYED, NO_VERSION, type NetworkOptions, type NetworkType, type OnDemandPriceUpdate, type OpenStrategyResult, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PRICE_DECIMALS, PRICE_DECIMALS_POW, type PathOption, type PathOptionSerie, PoolContract, type PoolData, PoolFactory, type PoolFactoryStateHuman, PoolQuotaKeeperContract, type PoolQuotaKeeperData, type PoolQuotaKeeperStateHuman, type PoolStateHuman, type PriceFeedConstructorArgs, type PriceFeedContractType, type PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, type PriceFeedRegisterHooks, type PriceFeedStateHuman, type PriceFeedTreeNode, type PriceFeedUsageType, PriceOracleContract, type PriceOracleData, type PriceOracleV3StateHuman, Provider, type QuotaParamsHuman, type QuotaState, RAY, RAY_DECIMALS_POW, type RateKeeperData, type RawTx, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RouterCloseResult, type RouterHooks, type RouterResult, RouterV3Contract, SDKConstruct, type SDKOptions, SUPPORTED_CHAINS, type SwapOperation, type SwapTask, type SyncStateOptions, TIMELOCK, type TVL, type TokenMetaData, type TransportOptions, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, type UpdatePriceFeedsResult, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, ZeroPriceFeedContract, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createRawTx, createTransport, detectNetwork, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, halfRAY, json_parse, json_stringify, numberWithCommas, percentFmt, rawTxToMulticallPriceUpdate, simulateMulticall, toHumanFormat };
|
package/dist/esm/sdk/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Address, Chain,
|
|
1
|
+
import { Address, Chain, Transport, PublicClient, Abi, Log, ContractEventName, DecodeFunctionDataReturnType, Hex, ContractFunctionName, EncodeFunctionDataParameters, TransactionReceipt, UnionOmit, GetContractReturnType, Client, ContractFunctionParameters, CallParameters, MulticallContracts, Narrow, AbiStateMutability, MulticallResults, GetChainContractAddressErrorType, ReadContractErrorType, GetContractErrorReturnType, EncodeFunctionDataErrorType, DecodeFunctionResultErrorType } from 'viem';
|
|
2
2
|
import { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from 'abitype';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -24,15 +24,28 @@ declare const SUPPORTED_CHAINS: readonly ["Mainnet", "Arbitrum", "Optimism", "Ba
|
|
|
24
24
|
type NetworkType = (typeof SUPPORTED_CHAINS)[number];
|
|
25
25
|
declare const chains: Record<NetworkType, Chain>;
|
|
26
26
|
|
|
27
|
-
interface
|
|
27
|
+
interface NetworkOptions {
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Chain Id needs to be set, because we sometimemes use forked testnets with different chain ids
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
chainId: number;
|
|
32
|
+
/**
|
|
33
|
+
* NetworkType needs to be set, because we sometimemes use forked testnets with different chain ids
|
|
34
|
+
*/
|
|
35
|
+
networkType: NetworkType;
|
|
36
|
+
}
|
|
37
|
+
type TransportOptions = {
|
|
32
38
|
/**
|
|
33
39
|
* RPC URL (and fallbacks) to use.
|
|
34
40
|
*/
|
|
35
41
|
rpcURLs: string[];
|
|
42
|
+
} | {
|
|
43
|
+
/**
|
|
44
|
+
* Alternatively, can pass entire viem transport
|
|
45
|
+
*/
|
|
46
|
+
transport: Transport;
|
|
47
|
+
};
|
|
48
|
+
interface ConnectionOptions {
|
|
36
49
|
/**
|
|
37
50
|
* RPC client timeout in milliseconds
|
|
38
51
|
*/
|
|
@@ -41,24 +54,16 @@ interface ProviderOptions {
|
|
|
41
54
|
* Retry count for RPC
|
|
42
55
|
*/
|
|
43
56
|
retryCount?: number;
|
|
44
|
-
/**
|
|
45
|
-
* Chain Id needs to be set, because we sometimemes use forked testnets with different chain ids
|
|
46
|
-
*/
|
|
47
|
-
chainId: number;
|
|
48
|
-
/**
|
|
49
|
-
* NetworkType needs to be set, because we sometimemes use forked testnets with different chain ids
|
|
50
|
-
*/
|
|
51
|
-
networkType: NetworkType;
|
|
52
57
|
}
|
|
58
|
+
declare function createTransport(opts: TransportOptions & ConnectionOptions): Transport;
|
|
53
59
|
declare class Provider {
|
|
54
|
-
readonly account?: Address;
|
|
55
60
|
readonly chainId: number;
|
|
56
61
|
readonly chain: Chain;
|
|
57
62
|
readonly networkType: NetworkType;
|
|
58
63
|
readonly publicClient: PublicClient;
|
|
59
64
|
readonly addressLabels: IAddressLabeller;
|
|
60
65
|
readonly transport: Transport;
|
|
61
|
-
constructor(opts:
|
|
66
|
+
constructor(opts: NetworkOptions & TransportOptions & ConnectionOptions);
|
|
62
67
|
}
|
|
63
68
|
|
|
64
69
|
declare const iAddressProviderV3_1Abi: readonly [{
|
|
@@ -22043,10 +22048,8 @@ declare class YearnV2RouterAdapterContract extends AbstractAdapterContract<typeo
|
|
|
22043
22048
|
type abi$r = typeof creditConfiguratorV3Abi;
|
|
22044
22049
|
declare class CreditConfiguratorContract extends BaseContract<abi$r> {
|
|
22045
22050
|
readonly adapters: Address[];
|
|
22046
|
-
|
|
22047
|
-
constructor(sdk: GearboxSDK, { creditConfigurator, creditManager }: CreditManagerData, emergencyLiquidators: readonly Address[]);
|
|
22051
|
+
constructor(sdk: GearboxSDK, { creditConfigurator, creditManager }: CreditManagerData);
|
|
22048
22052
|
processLog(log: Log<bigint, number, false, undefined, undefined, abi$r, ContractEventName<abi$r>>): void;
|
|
22049
|
-
stateHuman(raw?: boolean): CreditConfiguratorStateHuman;
|
|
22050
22053
|
parseFunctionParams(params: DecodeFunctionDataReturnType<abi$r>): Array<string> | undefined;
|
|
22051
22054
|
}
|
|
22052
22055
|
|
|
@@ -23978,6 +23981,9 @@ declare class MarketFactory extends SDKConstruct {
|
|
|
23978
23981
|
readonly poolFactory: PoolFactory;
|
|
23979
23982
|
readonly priceOracle: PriceOracleContract;
|
|
23980
23983
|
readonly creditManagers: CreditFactory[];
|
|
23984
|
+
readonly pausableAdmins: readonly Address[];
|
|
23985
|
+
readonly unpausableAdmins: readonly Address[];
|
|
23986
|
+
readonly emergencyLiquidators: readonly Address[];
|
|
23981
23987
|
constructor(sdk: GearboxSDK, marketData: MarketData);
|
|
23982
23988
|
get dirty(): boolean;
|
|
23983
23989
|
stateHuman(raw?: boolean): MarketStateHuman;
|
|
@@ -24305,9 +24311,7 @@ interface CreditManagerStateHuman extends BaseContractStateHuman {
|
|
|
24305
24311
|
contractsToAdapters: Record<string, string>;
|
|
24306
24312
|
creditAccounts: Array<Address>;
|
|
24307
24313
|
}
|
|
24308
|
-
|
|
24309
|
-
emergencyLiquidators: Array<string>;
|
|
24310
|
-
}
|
|
24314
|
+
type CreditConfiguratorStateHuman = BaseContractStateHuman;
|
|
24311
24315
|
interface CreditFactoryStateHuman {
|
|
24312
24316
|
creditFacade: CreditFacadeStateHuman;
|
|
24313
24317
|
creditManager: CreditManagerStateHuman;
|
|
@@ -24379,6 +24383,9 @@ interface MarketStateHuman {
|
|
|
24379
24383
|
pool: PoolFactoryStateHuman;
|
|
24380
24384
|
creditManagers: CreditFactoryStateHuman[];
|
|
24381
24385
|
priceOracle: PriceOracleV3StateHuman;
|
|
24386
|
+
pausableAdmins: string[];
|
|
24387
|
+
unpausableAdmins: string[];
|
|
24388
|
+
emergencyLiquidators: string[];
|
|
24382
24389
|
}
|
|
24383
24390
|
interface GearboxStateHuman {
|
|
24384
24391
|
block: number;
|
|
@@ -24608,27 +24615,7 @@ declare class RouterV3Contract extends BaseContract<abi> implements IHooks<Route
|
|
|
24608
24615
|
getAvailableConnectors(collateralTokens: Address[]): Address[];
|
|
24609
24616
|
}
|
|
24610
24617
|
|
|
24611
|
-
interface
|
|
24612
|
-
/**
|
|
24613
|
-
* Account address for contract write simulations
|
|
24614
|
-
*/
|
|
24615
|
-
account?: Address;
|
|
24616
|
-
/**
|
|
24617
|
-
* RPC URL (and fallbacks) to use
|
|
24618
|
-
*/
|
|
24619
|
-
rpcURLs: string[];
|
|
24620
|
-
/**
|
|
24621
|
-
* RPC client timeout in milliseconds
|
|
24622
|
-
*/
|
|
24623
|
-
timeout?: number;
|
|
24624
|
-
/**
|
|
24625
|
-
* Actual chain id of rpc, if not set, will be determined
|
|
24626
|
-
*/
|
|
24627
|
-
chainId?: number;
|
|
24628
|
-
/**
|
|
24629
|
-
* If not set, will be detected automatically
|
|
24630
|
-
*/
|
|
24631
|
-
networkType?: NetworkType;
|
|
24618
|
+
interface SDKOptions {
|
|
24632
24619
|
/**
|
|
24633
24620
|
* If not set, address provider address is determinted automatically from networkType
|
|
24634
24621
|
*/
|
|
@@ -24662,7 +24649,7 @@ declare class GearboxSDK {
|
|
|
24662
24649
|
* All contracts known to sdk
|
|
24663
24650
|
*/
|
|
24664
24651
|
readonly contracts: AddressMap<BaseContract<any>>;
|
|
24665
|
-
static attach(options:
|
|
24652
|
+
static attach(options: SDKOptions & Partial<NetworkOptions> & ConnectionOptions & TransportOptions): Promise<GearboxSDK>;
|
|
24666
24653
|
private constructor();
|
|
24667
24654
|
/**
|
|
24668
24655
|
* Converts contract call into some human-friendly string
|
|
@@ -24678,7 +24665,6 @@ declare class GearboxSDK {
|
|
|
24678
24665
|
* @returns
|
|
24679
24666
|
*/
|
|
24680
24667
|
parseMultiCall(calls: MultiCall[]): string[];
|
|
24681
|
-
updateBlock(): Promise<void>;
|
|
24682
24668
|
stateHuman(raw?: boolean): GearboxStateHuman;
|
|
24683
24669
|
tvl(): Promise<void>;
|
|
24684
24670
|
/**
|
|
@@ -24799,7 +24785,7 @@ declare class CreditAccountsService extends SDKConstruct {
|
|
|
24799
24785
|
* @param slippage
|
|
24800
24786
|
* @returns
|
|
24801
24787
|
*/
|
|
24802
|
-
fullyLiquidate(account: CreditAccountData, to
|
|
24788
|
+
fullyLiquidate(account: CreditAccountData, to: Address, slippage?: bigint): Promise<RawTx>;
|
|
24803
24789
|
/**
|
|
24804
24790
|
* Closes credit account or sets debt to zero (but keep account)
|
|
24805
24791
|
* @param operation
|
|
@@ -24809,7 +24795,7 @@ declare class CreditAccountsService extends SDKConstruct {
|
|
|
24809
24795
|
* @param slippage
|
|
24810
24796
|
* @returns
|
|
24811
24797
|
*/
|
|
24812
|
-
closeCreditAccount(operation: "close" | "zeroDebt", ca: CreditAccountData, assetsToKeep: Address[], to
|
|
24798
|
+
closeCreditAccount(operation: "close" | "zeroDebt", ca: CreditAccountData, assetsToKeep: Address[], to: Address, slippage?: bigint): Promise<RawTx>;
|
|
24813
24799
|
/**
|
|
24814
24800
|
* Returns raw txs that are needed to update all price feeds so that all credit accounts (possibly from different markets) compute
|
|
24815
24801
|
* @param accounts
|
|
@@ -24936,4 +24922,4 @@ type MulticallErrorType = GetChainContractAddressErrorType | ReadContractErrorTy
|
|
|
24936
24922
|
*/
|
|
24937
24923
|
declare function simulateMulticall<const contracts extends readonly unknown[], chain extends Chain | undefined, allowFailure extends boolean = true>(client: Client<Transport, chain>, parameters: MulticallParameters<contracts, allowFailure>): Promise<MulticallReturnType<contracts, allowFailure>>;
|
|
24938
24924
|
|
|
24939
|
-
export { ADDRESS_0X0, ADDRESS_PROVIDER, AP_ACCOUNT_FACTORY, AP_ACL, AP_ADAPTER_COMPRESSOR, AP_BOT_LIST, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DEGEN_DISTRIBUTOR, AP_DEGEN_NFT, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_ORACLE, AP_ROUTER, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractPriceFeedContract, type AdapterContractType, type AdapterData, AddressLabeller, AddressMap, AddressProviderContractV3_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, BotListContract, type BotListStateHuman, BotPermissions, type BoundedOracleStateHuman, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, type ContractMethod, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, type CoreStateHuman, type CreditAccountData, type CreditAccountFilter, CreditAccountsService, CreditConfiguratorContract, type CreditConfiguratorState, type CreditConfiguratorStateHuman, type CreditFacadeState, type CreditFacadeStateHuman, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, type CreditFactoryStateHuman, CreditManagerContract, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerState, type CreditManagerStateHuman, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, type CurvePoolStruct, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, LinearModelContract, type LinearModelStateHuman, type LogFn, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, type MultiCall, type MulticallErrorType, type MulticallParameters, type MulticallReturnType, NOT_DEPLOYED, NO_VERSION, type NetworkType, type OnDemandPriceUpdate, type OpenStrategyResult, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PRICE_DECIMALS, PRICE_DECIMALS_POW, type PathOption, type PathOptionSerie, PoolContract, type PoolData, PoolFactory, type PoolFactoryStateHuman, PoolQuotaKeeperContract, type PoolQuotaKeeperData, type PoolQuotaKeeperStateHuman, type PoolStateHuman, type PriceFeedConstructorArgs, type PriceFeedContractType, type PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, type PriceFeedRegisterHooks, type PriceFeedStateHuman, type PriceFeedTreeNode, type PriceFeedUsageType, PriceOracleContract, type PriceOracleData, type PriceOracleV3StateHuman, Provider, type
|
|
24925
|
+
export { ADDRESS_0X0, ADDRESS_PROVIDER, AP_ACCOUNT_FACTORY, AP_ACL, AP_ADAPTER_COMPRESSOR, AP_BOT_LIST, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DEGEN_DISTRIBUTOR, AP_DEGEN_NFT, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_ORACLE, AP_ROUTER, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractPriceFeedContract, type AdapterContractType, type AdapterData, AddressLabeller, AddressMap, AddressProviderContractV3_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, BotListContract, type BotListStateHuman, BotPermissions, type BoundedOracleStateHuman, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, type ConnectionOptions, type ContractMethod, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, type CoreStateHuman, type CreditAccountData, type CreditAccountFilter, CreditAccountsService, CreditConfiguratorContract, type CreditConfiguratorState, type CreditConfiguratorStateHuman, type CreditFacadeState, type CreditFacadeStateHuman, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, type CreditFactoryStateHuman, CreditManagerContract, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerState, type CreditManagerStateHuman, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, type CurvePoolStruct, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, LinearModelContract, type LinearModelStateHuman, type LogFn, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, type MultiCall, type MulticallErrorType, type MulticallParameters, type MulticallReturnType, NOT_DEPLOYED, NO_VERSION, type NetworkOptions, type NetworkType, type OnDemandPriceUpdate, type OpenStrategyResult, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PRICE_DECIMALS, PRICE_DECIMALS_POW, type PathOption, type PathOptionSerie, PoolContract, type PoolData, PoolFactory, type PoolFactoryStateHuman, PoolQuotaKeeperContract, type PoolQuotaKeeperData, type PoolQuotaKeeperStateHuman, type PoolStateHuman, type PriceFeedConstructorArgs, type PriceFeedContractType, type PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, type PriceFeedRegisterHooks, type PriceFeedStateHuman, type PriceFeedTreeNode, type PriceFeedUsageType, PriceOracleContract, type PriceOracleData, type PriceOracleV3StateHuman, Provider, type QuotaParamsHuman, type QuotaState, RAY, RAY_DECIMALS_POW, type RateKeeperData, type RawTx, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RouterCloseResult, type RouterHooks, type RouterResult, RouterV3Contract, SDKConstruct, type SDKOptions, SUPPORTED_CHAINS, type SwapOperation, type SwapTask, type SyncStateOptions, TIMELOCK, type TVL, type TokenMetaData, type TransportOptions, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, type UpdatePriceFeedsResult, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, ZeroPriceFeedContract, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createRawTx, createTransport, detectNetwork, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, halfRAY, json_parse, json_stringify, numberWithCommas, percentFmt, rawTxToMulticallPriceUpdate, simulateMulticall, toHumanFormat };
|
package/dist/esm/sdk/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isAddress, bytesToString, toBytes, prepareEncodeFunctionData, encodeAbiParameters, concatHex, getContract, isHex, decodeFunctionData, encodeFunctionData, decodeAbiParameters,
|
|
1
|
+
import { isAddress, bytesToString, toBytes, prepareEncodeFunctionData, encodeAbiParameters, concatHex, getContract, isHex, decodeFunctionData, encodeFunctionData, decodeAbiParameters, http, fallback, defineChain, createPublicClient, getChainContractAddress, getContractError, multicall3Abi, AbiDecodingZeroDataError, RawContractError, decodeFunctionResult, BaseError, erc4626Abi, parseEventLogs, 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';
|
|
@@ -19865,14 +19865,12 @@ function createAdapter(sdk, args) {
|
|
|
19865
19865
|
// src/sdk/market/CreditConfiguratorContract.ts
|
|
19866
19866
|
var CreditConfiguratorContract = class extends BaseContract {
|
|
19867
19867
|
adapters = [];
|
|
19868
|
-
|
|
19869
|
-
constructor(sdk, { creditConfigurator, creditManager }, emergencyLiquidators) {
|
|
19868
|
+
constructor(sdk, { creditConfigurator, creditManager }) {
|
|
19870
19869
|
super(sdk, {
|
|
19871
19870
|
...creditConfigurator.baseParams,
|
|
19872
19871
|
name: `CreditConfigurator(${creditManager.name})`,
|
|
19873
19872
|
abi: creditConfiguratorV3Abi
|
|
19874
19873
|
});
|
|
19875
|
-
this.emergencyLiquidators = [...emergencyLiquidators];
|
|
19876
19874
|
}
|
|
19877
19875
|
processLog(log) {
|
|
19878
19876
|
switch (log.eventName) {
|
|
@@ -19904,13 +19902,6 @@ var CreditConfiguratorContract = class extends BaseContract {
|
|
|
19904
19902
|
break;
|
|
19905
19903
|
}
|
|
19906
19904
|
}
|
|
19907
|
-
stateHuman(raw) {
|
|
19908
|
-
return {
|
|
19909
|
-
...super.stateHuman(raw),
|
|
19910
|
-
// TODO: this was moved to market data
|
|
19911
|
-
emergencyLiquidators: []
|
|
19912
|
-
};
|
|
19913
|
-
}
|
|
19914
19905
|
parseFunctionParams(params) {
|
|
19915
19906
|
switch (params.functionName) {
|
|
19916
19907
|
case "addCollateralToken":
|
|
@@ -20295,7 +20286,7 @@ var CreditFactory = class extends SDKConstruct {
|
|
|
20295
20286
|
creditConfigurator;
|
|
20296
20287
|
constructor(sdk, marketData, index) {
|
|
20297
20288
|
super(sdk);
|
|
20298
|
-
const { creditManagers, pool
|
|
20289
|
+
const { creditManagers, pool } = marketData;
|
|
20299
20290
|
const creditManager = creditManagers[index];
|
|
20300
20291
|
const { name, collateralTokens, liquidationThresholds } = creditManager.creditManager;
|
|
20301
20292
|
this.name = name;
|
|
@@ -20312,8 +20303,7 @@ var CreditFactory = class extends SDKConstruct {
|
|
|
20312
20303
|
}
|
|
20313
20304
|
this.creditConfigurator = new CreditConfiguratorContract(
|
|
20314
20305
|
sdk,
|
|
20315
|
-
creditManager
|
|
20316
|
-
emergencyLiquidators
|
|
20306
|
+
creditManager
|
|
20317
20307
|
);
|
|
20318
20308
|
}
|
|
20319
20309
|
async tvl() {
|
|
@@ -20674,8 +20664,15 @@ var chains = {
|
|
|
20674
20664
|
Optimism: optimism,
|
|
20675
20665
|
Base: base
|
|
20676
20666
|
};
|
|
20667
|
+
function createTransport(opts) {
|
|
20668
|
+
const { timeout = 12e4, retryCount } = opts;
|
|
20669
|
+
if ("transport" in opts) {
|
|
20670
|
+
return opts.transport;
|
|
20671
|
+
}
|
|
20672
|
+
const rpcs = opts.rpcURLs.map((url) => http(url, { timeout, retryCount }));
|
|
20673
|
+
return rpcs.length ? fallback(rpcs) : rpcs[0];
|
|
20674
|
+
}
|
|
20677
20675
|
var Provider = class {
|
|
20678
|
-
account;
|
|
20679
20676
|
chainId;
|
|
20680
20677
|
chain;
|
|
20681
20678
|
networkType;
|
|
@@ -20683,23 +20680,14 @@ var Provider = class {
|
|
|
20683
20680
|
addressLabels;
|
|
20684
20681
|
transport;
|
|
20685
20682
|
constructor(opts) {
|
|
20686
|
-
const {
|
|
20687
|
-
account,
|
|
20688
|
-
chainId,
|
|
20689
|
-
networkType,
|
|
20690
|
-
rpcURLs,
|
|
20691
|
-
timeout = 12e4,
|
|
20692
|
-
retryCount
|
|
20693
|
-
} = opts;
|
|
20694
|
-
this.account = account;
|
|
20683
|
+
const { chainId, networkType } = opts;
|
|
20695
20684
|
this.chainId = chainId;
|
|
20696
20685
|
this.networkType = networkType;
|
|
20697
20686
|
this.chain = defineChain({
|
|
20698
20687
|
...chains[networkType],
|
|
20699
20688
|
id: chainId
|
|
20700
20689
|
});
|
|
20701
|
-
|
|
20702
|
-
this.transport = rpcs.length ? fallback(rpcs) : rpcs[0];
|
|
20690
|
+
this.transport = createTransport(opts);
|
|
20703
20691
|
this.publicClient = createPublicClient({
|
|
20704
20692
|
chain: this.chain,
|
|
20705
20693
|
transport: this.transport
|
|
@@ -21864,6 +21852,9 @@ var MarketFactory = class extends SDKConstruct {
|
|
|
21864
21852
|
poolFactory;
|
|
21865
21853
|
priceOracle;
|
|
21866
21854
|
creditManagers = [];
|
|
21855
|
+
pausableAdmins;
|
|
21856
|
+
unpausableAdmins;
|
|
21857
|
+
emergencyLiquidators;
|
|
21867
21858
|
constructor(sdk, marketData) {
|
|
21868
21859
|
super(sdk);
|
|
21869
21860
|
this.riskCurator = marketData.owner;
|
|
@@ -21880,6 +21871,9 @@ var MarketFactory = class extends SDKConstruct {
|
|
|
21880
21871
|
marketData.priceOracleData,
|
|
21881
21872
|
marketData.pool.underlying
|
|
21882
21873
|
);
|
|
21874
|
+
this.pausableAdmins = marketData.pausableAdmins;
|
|
21875
|
+
this.unpausableAdmins = marketData.unpausableAdmins;
|
|
21876
|
+
this.emergencyLiquidators = marketData.emergencyLiquidators;
|
|
21883
21877
|
}
|
|
21884
21878
|
get dirty() {
|
|
21885
21879
|
return this.poolFactory.dirty || this.priceOracle.dirty || this.creditManagers.some((cm) => cm.dirty);
|
|
@@ -21888,7 +21882,12 @@ var MarketFactory = class extends SDKConstruct {
|
|
|
21888
21882
|
return {
|
|
21889
21883
|
pool: this.poolFactory.stateHuman(raw),
|
|
21890
21884
|
creditManagers: this.creditManagers.map((cm) => cm.stateHuman(raw)),
|
|
21891
|
-
priceOracle: this.priceOracle.stateHuman(raw)
|
|
21885
|
+
priceOracle: this.priceOracle.stateHuman(raw),
|
|
21886
|
+
pausableAdmins: this.pausableAdmins.map((a) => this.labelAddress(a)),
|
|
21887
|
+
unpausableAdmins: this.unpausableAdmins.map((a) => this.labelAddress(a)),
|
|
21888
|
+
emergencyLiquidators: this.emergencyLiquidators.map(
|
|
21889
|
+
(a) => this.labelAddress(a)
|
|
21890
|
+
)
|
|
21892
21891
|
};
|
|
21893
21892
|
}
|
|
21894
21893
|
};
|
|
@@ -22076,7 +22075,6 @@ var CreditAccountsService = class extends SDKConstruct {
|
|
|
22076
22075
|
}
|
|
22077
22076
|
const { txs: priceUpdateTxs, timestamp: _ } = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs();
|
|
22078
22077
|
const resp = await simulateMulticall(this.provider.publicClient, {
|
|
22079
|
-
account: this.provider.account,
|
|
22080
22078
|
contracts: [
|
|
22081
22079
|
...priceUpdateTxs.map(rawTxToMulticallPriceUpdate),
|
|
22082
22080
|
{
|
|
@@ -22157,15 +22155,10 @@ var CreditAccountsService = class extends SDKConstruct {
|
|
|
22157
22155
|
slippage
|
|
22158
22156
|
);
|
|
22159
22157
|
const priceUpdates = await this.getPriceUpdatesForFacade(account);
|
|
22160
|
-
|
|
22161
|
-
|
|
22162
|
-
|
|
22163
|
-
|
|
22164
|
-
return cm.creditFacade.liquidateCreditAccount(
|
|
22165
|
-
account.creditAccount,
|
|
22166
|
-
recipient,
|
|
22167
|
-
[...priceUpdates, ...preview.calls]
|
|
22168
|
-
);
|
|
22158
|
+
return cm.creditFacade.liquidateCreditAccount(account.creditAccount, to, [
|
|
22159
|
+
...priceUpdates,
|
|
22160
|
+
...preview.calls
|
|
22161
|
+
]);
|
|
22169
22162
|
}
|
|
22170
22163
|
/**
|
|
22171
22164
|
* Closes credit account or sets debt to zero (but keep account)
|
|
@@ -22178,15 +22171,11 @@ var CreditAccountsService = class extends SDKConstruct {
|
|
|
22178
22171
|
*/
|
|
22179
22172
|
async closeCreditAccount(operation, ca, assetsToKeep, to, slippage = 50n) {
|
|
22180
22173
|
const cm = this.sdk.marketRegister.findCreditManager(ca.creditManager);
|
|
22181
|
-
const recipient = to ?? this.sdk.provider.account;
|
|
22182
|
-
if (!recipient) {
|
|
22183
|
-
throw new Error("close account: assets recipient not specied");
|
|
22184
|
-
}
|
|
22185
22174
|
const calls = await this.#prepareCloseCreditAccount(
|
|
22186
22175
|
ca,
|
|
22187
22176
|
cm,
|
|
22188
22177
|
assetsToKeep,
|
|
22189
|
-
|
|
22178
|
+
to,
|
|
22190
22179
|
slippage
|
|
22191
22180
|
);
|
|
22192
22181
|
return operation === "close" ? cm.creditFacade.closeCreditAccount(ca.creditAccount, calls) : cm.creditFacade.multicall(ca.creditAccount, calls);
|
|
@@ -22202,7 +22191,6 @@ var CreditAccountsService = class extends SDKConstruct {
|
|
|
22202
22191
|
const blockNumber = options?.blockNumber;
|
|
22203
22192
|
if (priceUpdateTxs?.length) {
|
|
22204
22193
|
const resp = await simulateMulticall(this.provider.publicClient, {
|
|
22205
|
-
account: this.provider.account,
|
|
22206
22194
|
contracts: [
|
|
22207
22195
|
...priceUpdateTxs.map(rawTxToMulticallPriceUpdate),
|
|
22208
22196
|
{
|
|
@@ -22916,13 +22904,10 @@ var GearboxSDK = class _GearboxSDK {
|
|
|
22916
22904
|
*/
|
|
22917
22905
|
contracts = new AddressMap();
|
|
22918
22906
|
static async attach(options) {
|
|
22919
|
-
const {
|
|
22907
|
+
const { logger, riskCurators } = options;
|
|
22920
22908
|
let { networkType, addressProvider, chainId } = options;
|
|
22921
|
-
if (rpcURLs.length === 0) {
|
|
22922
|
-
throw new Error("please specify at least one rpc url");
|
|
22923
|
-
}
|
|
22924
22909
|
const attachClient = createPublicClient({
|
|
22925
|
-
transport:
|
|
22910
|
+
transport: createTransport(options)
|
|
22926
22911
|
});
|
|
22927
22912
|
if (!networkType) {
|
|
22928
22913
|
networkType = await detectNetwork(attachClient);
|
|
@@ -22934,10 +22919,9 @@ var GearboxSDK = class _GearboxSDK {
|
|
|
22934
22919
|
addressProvider = ADDRESS_PROVIDER[networkType];
|
|
22935
22920
|
}
|
|
22936
22921
|
const provider = new Provider({
|
|
22922
|
+
...options,
|
|
22937
22923
|
chainId,
|
|
22938
|
-
networkType
|
|
22939
|
-
rpcURLs,
|
|
22940
|
-
timeout
|
|
22924
|
+
networkType
|
|
22941
22925
|
});
|
|
22942
22926
|
logger?.debug(
|
|
22943
22927
|
{ networkType, chainId, addressProvider },
|
|
@@ -22955,7 +22939,11 @@ var GearboxSDK = class _GearboxSDK {
|
|
|
22955
22939
|
}
|
|
22956
22940
|
async #attach(addressProviderAddress, riskCurators) {
|
|
22957
22941
|
const time = Date.now();
|
|
22958
|
-
await this.
|
|
22942
|
+
const block = await this.provider.publicClient.getBlock({
|
|
22943
|
+
blockTag: "latest"
|
|
22944
|
+
});
|
|
22945
|
+
this.#currentBlock = block.number;
|
|
22946
|
+
this.#timestamp = block.timestamp;
|
|
22959
22947
|
this.logger?.info("Attaching to address provider", addressProviderAddress);
|
|
22960
22948
|
this.#addressProvider = new AddressProviderContractV3_1(
|
|
22961
22949
|
this,
|
|
@@ -23008,13 +22996,6 @@ var GearboxSDK = class _GearboxSDK {
|
|
|
23008
22996
|
(call) => this.parseFunctionData(call.target, call.callData)
|
|
23009
22997
|
);
|
|
23010
22998
|
}
|
|
23011
|
-
async updateBlock() {
|
|
23012
|
-
const block = await this.provider.publicClient.getBlock({
|
|
23013
|
-
blockTag: "latest"
|
|
23014
|
-
});
|
|
23015
|
-
this.#currentBlock = block.number;
|
|
23016
|
-
this.#timestamp = block.timestamp;
|
|
23017
|
-
}
|
|
23018
22999
|
stateHuman(raw = true) {
|
|
23019
23000
|
return {
|
|
23020
23001
|
block: Number(this.currentBlock),
|
|
@@ -23128,4 +23109,4 @@ var GearboxSDK = class _GearboxSDK {
|
|
|
23128
23109
|
}
|
|
23129
23110
|
};
|
|
23130
23111
|
|
|
23131
|
-
export { ADDRESS_0X0, ADDRESS_PROVIDER, AP_ACCOUNT_FACTORY, AP_ACL, AP_ADAPTER_COMPRESSOR, AP_BOT_LIST, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DEGEN_DISTRIBUTOR, AP_DEGEN_NFT, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_ORACLE, AP_ROUTER, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractPriceFeedContract, AddressLabeller, AddressMap, AddressProviderContractV3_1, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, BotListContract, BotPermissions, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditAccountsService, CreditConfiguratorContract, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, CreditManagerContract, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, ERC4626AdapterContract, Erc4626PriceFeedContract, GaugeContract, GearStakingContract, GearboxSDK, LinearModelContract, MAX_UINT256, MIN_INT96, MarketFactory, MarketRegister, MellowLRTPriceFeedContract, NOT_DEPLOYED, NO_VERSION, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PRICE_DECIMALS, PRICE_DECIMALS_POW, PoolContract, PoolFactory, PoolQuotaKeeperContract, PriceFeedRef, PriceFeedRegister, PriceOracleContract, Provider, RAY, RAY_DECIMALS_POW, RedstonePriceFeedContract, RouterV3Contract, SDKConstruct, SUPPORTED_CHAINS, TIMELOCK, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, ZeroPriceFeedContract, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createRawTx, detectNetwork, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, halfRAY, json_parse, json_stringify, numberWithCommas, percentFmt, rawTxToMulticallPriceUpdate, simulateMulticall, toHumanFormat };
|
|
23112
|
+
export { ADDRESS_0X0, ADDRESS_PROVIDER, AP_ACCOUNT_FACTORY, AP_ACL, AP_ADAPTER_COMPRESSOR, AP_BOT_LIST, AP_CONTRACTS_REGISTER, AP_CONTROLLER_TIMELOCK, AP_CREDIT_ACCOUNT_COMPRESSOR, AP_DATA_COMPRESSOR, AP_DEGEN_DISTRIBUTOR, AP_DEGEN_NFT, AP_DELEVERAGE_BOT_HV, AP_DELEVERAGE_BOT_LV, AP_DELEVERAGE_BOT_PEGGED, AP_GEAR_STAKING, AP_GEAR_TOKEN, AP_INFLATION_ATTACK_BLOCKER, AP_INSOLVENCY_CHECKER, AP_MARKET_COMPRESSOR, AP_MARKET_CONFIGURATOR, AP_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, AP_PRICE_FEED_COMPRESSOR, AP_PRICE_ORACLE, AP_ROUTER, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractPriceFeedContract, AddressLabeller, AddressMap, AddressProviderContractV3_1, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, BotListContract, BotPermissions, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditAccountsService, CreditConfiguratorContract, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, CreditManagerContract, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, ERC4626AdapterContract, Erc4626PriceFeedContract, GaugeContract, GearStakingContract, GearboxSDK, LinearModelContract, MAX_UINT256, MIN_INT96, MarketFactory, MarketRegister, MellowLRTPriceFeedContract, NOT_DEPLOYED, NO_VERSION, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PRICE_DECIMALS, PRICE_DECIMALS_POW, PoolContract, PoolFactory, PoolQuotaKeeperContract, PriceFeedRef, PriceFeedRegister, PriceOracleContract, Provider, RAY, RAY_DECIMALS_POW, RedstonePriceFeedContract, RouterV3Contract, SDKConstruct, SUPPORTED_CHAINS, TIMELOCK, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, ZeroPriceFeedContract, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createRawTx, createTransport, detectNetwork, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, halfRAY, json_parse, json_stringify, numberWithCommas, percentFmt, rawTxToMulticallPriceUpdate, simulateMulticall, toHumanFormat };
|