@gearbox-protocol/sdk 3.0.0-vfour.6 → 3.0.0-vfour.8
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/index.cjs +7 -6
- package/dist/cjs/index.d.ts +18 -1
- package/dist/esm/index.d.mts +18 -1
- package/dist/esm/index.mjs +8 -8
- package/package.json +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -15519,7 +15519,7 @@ var GearboxSDK = class _GearboxSDK extends eventemitter3.EventEmitter {
|
|
|
15519
15519
|
*/
|
|
15520
15520
|
contracts = new AddressMap();
|
|
15521
15521
|
static async attach(options) {
|
|
15522
|
-
const { rpcURL, timeout, logger } = options;
|
|
15522
|
+
const { rpcURL, timeout, logger, riskCurators } = options;
|
|
15523
15523
|
let { networkType, addressProvider, chainId } = options;
|
|
15524
15524
|
const attachClient = createAnvilClient({
|
|
15525
15525
|
transport: viem.http(rpcURL, { timeout })
|
|
@@ -15546,7 +15546,7 @@ var GearboxSDK = class _GearboxSDK extends eventemitter3.EventEmitter {
|
|
|
15546
15546
|
return new _GearboxSDK({
|
|
15547
15547
|
provider,
|
|
15548
15548
|
logger
|
|
15549
|
-
}).#attach(addressProvider);
|
|
15549
|
+
}).#attach(addressProvider, riskCurators);
|
|
15550
15550
|
}
|
|
15551
15551
|
constructor(options) {
|
|
15552
15552
|
super();
|
|
@@ -15554,7 +15554,7 @@ var GearboxSDK = class _GearboxSDK extends eventemitter3.EventEmitter {
|
|
|
15554
15554
|
this.logger = options.logger;
|
|
15555
15555
|
this.priceFeeds = new PriceFeedRegister(this);
|
|
15556
15556
|
}
|
|
15557
|
-
async #attach(addressProviderAddress) {
|
|
15557
|
+
async #attach(addressProviderAddress, riskCurators) {
|
|
15558
15558
|
const time = Date.now();
|
|
15559
15559
|
await this.updateBlock();
|
|
15560
15560
|
this.logger?.info("Attaching to address provider", addressProviderAddress);
|
|
@@ -15576,9 +15576,9 @@ var GearboxSDK = class _GearboxSDK extends eventemitter3.EventEmitter {
|
|
|
15576
15576
|
gearStakingAddress
|
|
15577
15577
|
);
|
|
15578
15578
|
this.#marketRegister = new MarketRegister(this);
|
|
15579
|
-
await this.#marketRegister.loadMarkets(
|
|
15580
|
-
TIMELOCK[this.provider.networkType]
|
|
15581
|
-
|
|
15579
|
+
await this.#marketRegister.loadMarkets(
|
|
15580
|
+
riskCurators ?? [TIMELOCK[this.provider.networkType]]
|
|
15581
|
+
);
|
|
15582
15582
|
try {
|
|
15583
15583
|
const router = this.#addressProvider.getLatestVersion(AP_ROUTER);
|
|
15584
15584
|
this.#router = new RouterV3Contract(this, router);
|
|
@@ -16143,6 +16143,7 @@ exports.PriceFeedRegister = PriceFeedRegister;
|
|
|
16143
16143
|
exports.PriceOracleContract = PriceOracleContract;
|
|
16144
16144
|
exports.Provider = Provider;
|
|
16145
16145
|
exports.RedstonePriceFeedContract = RedstonePriceFeedContract;
|
|
16146
|
+
exports.RouterV3Contract = RouterV3Contract;
|
|
16146
16147
|
exports.SDKConstruct = SDKConstruct;
|
|
16147
16148
|
exports.SUPPORTED_CHAINS = SUPPORTED_CHAINS;
|
|
16148
16149
|
exports.TIMELOCK = TIMELOCK;
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -16872,6 +16872,15 @@ interface PathOption {
|
|
|
16872
16872
|
totalOptions: number;
|
|
16873
16873
|
}
|
|
16874
16874
|
type PathOptionSerie = PathOption[];
|
|
16875
|
+
interface SwapTask {
|
|
16876
|
+
swapOperation: bigint;
|
|
16877
|
+
creditAccount: Address;
|
|
16878
|
+
tokenIn: Address;
|
|
16879
|
+
tokenOut: Address;
|
|
16880
|
+
connectors: Address[];
|
|
16881
|
+
amount: bigint;
|
|
16882
|
+
leftoverAmount: bigint;
|
|
16883
|
+
}
|
|
16875
16884
|
interface RouterResult {
|
|
16876
16885
|
amount: bigint;
|
|
16877
16886
|
minAmount: bigint;
|
|
@@ -16884,6 +16893,10 @@ interface OpenStrategyResult extends RouterResult {
|
|
|
16884
16893
|
interface RouterCloseResult extends RouterResult {
|
|
16885
16894
|
underlyingBalance: bigint;
|
|
16886
16895
|
}
|
|
16896
|
+
interface CurvePoolStruct {
|
|
16897
|
+
curvePool: Address;
|
|
16898
|
+
metapoolBase: Address;
|
|
16899
|
+
}
|
|
16887
16900
|
interface Asset {
|
|
16888
16901
|
token: Address;
|
|
16889
16902
|
balance: bigint;
|
|
@@ -16992,6 +17005,10 @@ interface SDKAttachOptions {
|
|
|
16992
17005
|
* If not set, address provider address is determinted automatically from networkType
|
|
16993
17006
|
*/
|
|
16994
17007
|
addressProvider?: Address;
|
|
17008
|
+
/**
|
|
17009
|
+
* Risk curators, defaults to gearbox own
|
|
17010
|
+
*/
|
|
17011
|
+
riskCurators?: Address[];
|
|
16995
17012
|
/**
|
|
16996
17013
|
* Bring your own logger
|
|
16997
17014
|
*/
|
|
@@ -17206,4 +17223,4 @@ declare function botPermissionsToString(value: bigint): string;
|
|
|
17206
17223
|
declare const MIN_INT96 = -39614081257132168796771975168n;
|
|
17207
17224
|
declare const MAX_UINT256 = 115792089237316195423570985008687907853269984665640564039457584007913129639935n;
|
|
17208
17225
|
|
|
17209
|
-
export { type ACLState, type ACLStateHuman, ADDRESS_0X0, ADDRESS_PROVIDER, AP_ACCOUNT_FACTORY, AP_ACL, 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_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, AP_PRICE_ORACLE, AP_ROUTER, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractPriceFeedContract, type AccountFactoryStateHuman, AddressLabeller, AddressMap, AddressProviderContractV3_1, type AddressProviderV3State, type AddressProviderV3StateHuman, type AssetPriceFeedState, type AssetPriceFeedStateHuman, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractState, type BaseContractStateHuman, type BasePriceFeedState, type BasePriceFeedStateHuman, BotListContract, type BotListState, type BotListStateHuman, BotPermissions, type BoundedOracleState, type BoundedOracleStateHuman, BoundedPriceFeedContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, type ContractMethod, type ContractsRegisterState, type ContractsRegisterStateHuman, type ControllerTimelockV3State, type ControllerTimelockV3StateHuman, type CoreState, type CoreStateHuman, type CreditAccountData, type CreditAccountFilter, CreditAccountsService, CreditConfiguratorContract, type CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditFacadeContract, type CreditFacadeState, type CreditFacadeStateHuman, CreditFactory, type CreditFactoryState, type CreditFactoryStateHuman, CreditManagerContract, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerDebtParamsStruct, type CreditManagerState, type CreditManagerStateHuman, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, type DataCompressorV3State, type DegenDistributorState, type DegenDistributorStateHuman, type DegenNFT2State, type DegenNFT2StateHuman, Erc4626PriceFeedContract, type EtherscanURLParam, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeState, type GaugeStateHuman, GearStakingContract, type GearStakingV3State, type GearStakingV3StateHuman, GearboxSDK, type GearboxState, type GearboxStateHuman, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, LinearModelContract, type LinearModelState, type LinearModelStateHuman, type LogFn, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketState, type MarketStateHuman, MellowLRTPriceFeedContract, type MultiCall, type MultiPauseState, NOT_DEPLOYED, NO_VERSION, type NetworkType, type PeripheryState, type PeripheryStateHuman, type PolicyStruct, type PolicyStructHuman, PoolContract, type PoolData, PoolFactory, type PoolFactoryState, type PoolFactoryStateHuman, PoolQuotaKeeperContract, type PoolQuotaKeeperData, type PoolQuotaKeeperState, type PoolQuotaKeeperStateHuman, type PoolState, type PoolStateHuman, type PriceFactoryStateHuman, type PriceFeedConstructorArgs, type PriceFeedContractType, type PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, type PriceFeedState, type PriceFeedStateHuman, type PriceFeedTreeNode, type PriceFeedUsageType, PriceOracleContract, type PriceOracleData, type PriceOracleState, type PriceOracleV3State, type PriceOracleV3StateHuman, Provider, type ProviderOptions, type QuotaParams, type QuotaParamsHuman, type RateKeeperData, type RawTx, RedstonePriceFeedContract, type RedstonePriceFeedState, type RedstonePriceFeedStateHuman, type RouterComponentRegisterHuman, type RouterState, type RouterStateHuman, type RouterV3ContractState, type RouterV3ContractStateHuman, type SDKAttachOptions, SDKConstruct, type SDKEventsMap, SUPPORTED_CHAINS, TIMELOCK, type TVL, type TokenMetaData, type TokenTypeToResolverHuman, USDC, type UpdatePriceFeedsResult, VotingContractStatus, WstETHPriceFeedContract, YearnPriceFeedContract, type ZapperInfo, type ZapperInfoHuman, type ZapperRegisterState, type ZapperRegisterStateHuman, ZeroPriceFeedContract, botPermissionsToString, bytes32ToString, chains, childLogger, convertBaseContractState, convertCoreStateToHuman, convertCreditFactoryStateToHuman, convertGaugeStateToHuman, convertGearboxStateToHuman, convertGearboxStateToHumanLA, convertLinearModelStateToHuman, convertPeripheryStateToHuman, convertPoolFactoryStateToHuman, convertPoolQuotaKeeperStateToHuman, convertPoolStateToHuman, convertPriceFeedStateToHuman, convertPriceOracleStateToHuman, convertRouterStateToHuman, convertRouterV3StateToHuman, convertZapperRegisterStateToHuman, createRawTx, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, json_parse, json_stringify, numberWithCommas, percentFmt, toHumanFormat };
|
|
17226
|
+
export { type ACLState, type ACLStateHuman, ADDRESS_0X0, ADDRESS_PROVIDER, AP_ACCOUNT_FACTORY, AP_ACL, 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_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, AP_PRICE_ORACLE, AP_ROUTER, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractPriceFeedContract, type AccountFactoryStateHuman, AddressLabeller, AddressMap, AddressProviderContractV3_1, type AddressProviderV3State, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedState, type AssetPriceFeedStateHuman, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractState, type BaseContractStateHuman, type BasePriceFeedState, type BasePriceFeedStateHuman, BotListContract, type BotListState, type BotListStateHuman, BotPermissions, type BoundedOracleState, type BoundedOracleStateHuman, BoundedPriceFeedContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, type ContractMethod, type ContractsRegisterState, type ContractsRegisterStateHuman, type ControllerTimelockV3State, type ControllerTimelockV3StateHuman, type CoreState, type CoreStateHuman, type CreditAccountData, type CreditAccountFilter, CreditAccountsService, CreditConfiguratorContract, type CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditFacadeContract, type CreditFacadeState, type CreditFacadeStateHuman, CreditFactory, type CreditFactoryState, type CreditFactoryStateHuman, CreditManagerContract, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerDebtParamsStruct, type CreditManagerState, type CreditManagerStateHuman, CurveCryptoPriceFeedContract, type CurvePoolStruct, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, type DataCompressorV3State, type DegenDistributorState, type DegenDistributorStateHuman, type DegenNFT2State, type DegenNFT2StateHuman, Erc4626PriceFeedContract, type EtherscanURLParam, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeState, type GaugeStateHuman, GearStakingContract, type GearStakingV3State, type GearStakingV3StateHuman, GearboxSDK, type GearboxState, type GearboxStateHuman, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, LinearModelContract, type LinearModelState, type LinearModelStateHuman, type LogFn, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketState, type MarketStateHuman, MellowLRTPriceFeedContract, type MultiCall, type MultiPauseState, NOT_DEPLOYED, NO_VERSION, type NetworkType, type OpenStrategyResult, type PathOption, type PathOptionSerie, type PeripheryState, type PeripheryStateHuman, type PolicyStruct, type PolicyStructHuman, PoolContract, type PoolData, PoolFactory, type PoolFactoryState, type PoolFactoryStateHuman, PoolQuotaKeeperContract, type PoolQuotaKeeperData, type PoolQuotaKeeperState, type PoolQuotaKeeperStateHuman, type PoolState, type PoolStateHuman, type PriceFactoryStateHuman, type PriceFeedConstructorArgs, type PriceFeedContractType, type PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, type PriceFeedState, type PriceFeedStateHuman, type PriceFeedTreeNode, type PriceFeedUsageType, PriceOracleContract, type PriceOracleData, type PriceOracleState, type PriceOracleV3State, type PriceOracleV3StateHuman, Provider, type ProviderOptions, type QuotaParams, type QuotaParamsHuman, type RateKeeperData, type RawTx, RedstonePriceFeedContract, type RedstonePriceFeedState, type RedstonePriceFeedStateHuman, type RouterCloseResult, type RouterComponentRegisterHuman, type RouterResult, type RouterState, type RouterStateHuman, RouterV3Contract, type RouterV3ContractState, type RouterV3ContractStateHuman, type SDKAttachOptions, SDKConstruct, type SDKEventsMap, SUPPORTED_CHAINS, type SwapOperation, type SwapTask, TIMELOCK, type TVL, type TokenMetaData, type TokenTypeToResolverHuman, USDC, type UpdatePriceFeedsResult, VotingContractStatus, WstETHPriceFeedContract, YearnPriceFeedContract, type ZapperInfo, type ZapperInfoHuman, type ZapperRegisterState, type ZapperRegisterStateHuman, ZeroPriceFeedContract, botPermissionsToString, bytes32ToString, chains, childLogger, convertBaseContractState, convertCoreStateToHuman, convertCreditFactoryStateToHuman, convertGaugeStateToHuman, convertGearboxStateToHuman, convertGearboxStateToHumanLA, convertLinearModelStateToHuman, convertPeripheryStateToHuman, convertPoolFactoryStateToHuman, convertPoolQuotaKeeperStateToHuman, convertPoolStateToHuman, convertPriceFeedStateToHuman, convertPriceOracleStateToHuman, convertRouterStateToHuman, convertRouterV3StateToHuman, convertZapperRegisterStateToHuman, createRawTx, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, json_parse, json_stringify, numberWithCommas, percentFmt, toHumanFormat };
|
package/dist/esm/index.d.mts
CHANGED
|
@@ -16872,6 +16872,15 @@ interface PathOption {
|
|
|
16872
16872
|
totalOptions: number;
|
|
16873
16873
|
}
|
|
16874
16874
|
type PathOptionSerie = PathOption[];
|
|
16875
|
+
interface SwapTask {
|
|
16876
|
+
swapOperation: bigint;
|
|
16877
|
+
creditAccount: Address;
|
|
16878
|
+
tokenIn: Address;
|
|
16879
|
+
tokenOut: Address;
|
|
16880
|
+
connectors: Address[];
|
|
16881
|
+
amount: bigint;
|
|
16882
|
+
leftoverAmount: bigint;
|
|
16883
|
+
}
|
|
16875
16884
|
interface RouterResult {
|
|
16876
16885
|
amount: bigint;
|
|
16877
16886
|
minAmount: bigint;
|
|
@@ -16884,6 +16893,10 @@ interface OpenStrategyResult extends RouterResult {
|
|
|
16884
16893
|
interface RouterCloseResult extends RouterResult {
|
|
16885
16894
|
underlyingBalance: bigint;
|
|
16886
16895
|
}
|
|
16896
|
+
interface CurvePoolStruct {
|
|
16897
|
+
curvePool: Address;
|
|
16898
|
+
metapoolBase: Address;
|
|
16899
|
+
}
|
|
16887
16900
|
interface Asset {
|
|
16888
16901
|
token: Address;
|
|
16889
16902
|
balance: bigint;
|
|
@@ -16992,6 +17005,10 @@ interface SDKAttachOptions {
|
|
|
16992
17005
|
* If not set, address provider address is determinted automatically from networkType
|
|
16993
17006
|
*/
|
|
16994
17007
|
addressProvider?: Address;
|
|
17008
|
+
/**
|
|
17009
|
+
* Risk curators, defaults to gearbox own
|
|
17010
|
+
*/
|
|
17011
|
+
riskCurators?: Address[];
|
|
16995
17012
|
/**
|
|
16996
17013
|
* Bring your own logger
|
|
16997
17014
|
*/
|
|
@@ -17206,4 +17223,4 @@ declare function botPermissionsToString(value: bigint): string;
|
|
|
17206
17223
|
declare const MIN_INT96 = -39614081257132168796771975168n;
|
|
17207
17224
|
declare const MAX_UINT256 = 115792089237316195423570985008687907853269984665640564039457584007913129639935n;
|
|
17208
17225
|
|
|
17209
|
-
export { type ACLState, type ACLStateHuman, ADDRESS_0X0, ADDRESS_PROVIDER, AP_ACCOUNT_FACTORY, AP_ACL, 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_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, AP_PRICE_ORACLE, AP_ROUTER, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractPriceFeedContract, type AccountFactoryStateHuman, AddressLabeller, AddressMap, AddressProviderContractV3_1, type AddressProviderV3State, type AddressProviderV3StateHuman, type AssetPriceFeedState, type AssetPriceFeedStateHuman, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractState, type BaseContractStateHuman, type BasePriceFeedState, type BasePriceFeedStateHuman, BotListContract, type BotListState, type BotListStateHuman, BotPermissions, type BoundedOracleState, type BoundedOracleStateHuman, BoundedPriceFeedContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, type ContractMethod, type ContractsRegisterState, type ContractsRegisterStateHuman, type ControllerTimelockV3State, type ControllerTimelockV3StateHuman, type CoreState, type CoreStateHuman, type CreditAccountData, type CreditAccountFilter, CreditAccountsService, CreditConfiguratorContract, type CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditFacadeContract, type CreditFacadeState, type CreditFacadeStateHuman, CreditFactory, type CreditFactoryState, type CreditFactoryStateHuman, CreditManagerContract, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerDebtParamsStruct, type CreditManagerState, type CreditManagerStateHuman, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, type DataCompressorV3State, type DegenDistributorState, type DegenDistributorStateHuman, type DegenNFT2State, type DegenNFT2StateHuman, Erc4626PriceFeedContract, type EtherscanURLParam, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeState, type GaugeStateHuman, GearStakingContract, type GearStakingV3State, type GearStakingV3StateHuman, GearboxSDK, type GearboxState, type GearboxStateHuman, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, LinearModelContract, type LinearModelState, type LinearModelStateHuman, type LogFn, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketState, type MarketStateHuman, MellowLRTPriceFeedContract, type MultiCall, type MultiPauseState, NOT_DEPLOYED, NO_VERSION, type NetworkType, type PeripheryState, type PeripheryStateHuman, type PolicyStruct, type PolicyStructHuman, PoolContract, type PoolData, PoolFactory, type PoolFactoryState, type PoolFactoryStateHuman, PoolQuotaKeeperContract, type PoolQuotaKeeperData, type PoolQuotaKeeperState, type PoolQuotaKeeperStateHuman, type PoolState, type PoolStateHuman, type PriceFactoryStateHuman, type PriceFeedConstructorArgs, type PriceFeedContractType, type PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, type PriceFeedState, type PriceFeedStateHuman, type PriceFeedTreeNode, type PriceFeedUsageType, PriceOracleContract, type PriceOracleData, type PriceOracleState, type PriceOracleV3State, type PriceOracleV3StateHuman, Provider, type ProviderOptions, type QuotaParams, type QuotaParamsHuman, type RateKeeperData, type RawTx, RedstonePriceFeedContract, type RedstonePriceFeedState, type RedstonePriceFeedStateHuman, type RouterComponentRegisterHuman, type RouterState, type RouterStateHuman, type RouterV3ContractState, type RouterV3ContractStateHuman, type SDKAttachOptions, SDKConstruct, type SDKEventsMap, SUPPORTED_CHAINS, TIMELOCK, type TVL, type TokenMetaData, type TokenTypeToResolverHuman, USDC, type UpdatePriceFeedsResult, VotingContractStatus, WstETHPriceFeedContract, YearnPriceFeedContract, type ZapperInfo, type ZapperInfoHuman, type ZapperRegisterState, type ZapperRegisterStateHuman, ZeroPriceFeedContract, botPermissionsToString, bytes32ToString, chains, childLogger, convertBaseContractState, convertCoreStateToHuman, convertCreditFactoryStateToHuman, convertGaugeStateToHuman, convertGearboxStateToHuman, convertGearboxStateToHumanLA, convertLinearModelStateToHuman, convertPeripheryStateToHuman, convertPoolFactoryStateToHuman, convertPoolQuotaKeeperStateToHuman, convertPoolStateToHuman, convertPriceFeedStateToHuman, convertPriceOracleStateToHuman, convertRouterStateToHuman, convertRouterV3StateToHuman, convertZapperRegisterStateToHuman, createRawTx, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, json_parse, json_stringify, numberWithCommas, percentFmt, toHumanFormat };
|
|
17226
|
+
export { type ACLState, type ACLStateHuman, ADDRESS_0X0, ADDRESS_PROVIDER, AP_ACCOUNT_FACTORY, AP_ACL, 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_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, AP_PRICE_ORACLE, AP_ROUTER, AP_TREASURY, AP_WETH_GATEWAY, AP_WETH_TOKEN, AP_ZAPPER_REGISTER, AP_ZERO_PRICE_FEED, AbstractPriceFeedContract, type AccountFactoryStateHuman, AddressLabeller, AddressMap, AddressProviderContractV3_1, type AddressProviderV3State, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedState, type AssetPriceFeedStateHuman, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractState, type BaseContractStateHuman, type BasePriceFeedState, type BasePriceFeedStateHuman, BotListContract, type BotListState, type BotListStateHuman, BotPermissions, type BoundedOracleState, type BoundedOracleStateHuman, BoundedPriceFeedContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, type ContractMethod, type ContractsRegisterState, type ContractsRegisterStateHuman, type ControllerTimelockV3State, type ControllerTimelockV3StateHuman, type CoreState, type CoreStateHuman, type CreditAccountData, type CreditAccountFilter, CreditAccountsService, CreditConfiguratorContract, type CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditFacadeContract, type CreditFacadeState, type CreditFacadeStateHuman, CreditFactory, type CreditFactoryState, type CreditFactoryStateHuman, CreditManagerContract, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerDebtParamsStruct, type CreditManagerState, type CreditManagerStateHuman, CurveCryptoPriceFeedContract, type CurvePoolStruct, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, type DataCompressorV3State, type DegenDistributorState, type DegenDistributorStateHuman, type DegenNFT2State, type DegenNFT2StateHuman, Erc4626PriceFeedContract, type EtherscanURLParam, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeState, type GaugeStateHuman, GearStakingContract, type GearStakingV3State, type GearStakingV3StateHuman, GearboxSDK, type GearboxState, type GearboxStateHuman, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, LinearModelContract, type LinearModelState, type LinearModelStateHuman, type LogFn, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketState, type MarketStateHuman, MellowLRTPriceFeedContract, type MultiCall, type MultiPauseState, NOT_DEPLOYED, NO_VERSION, type NetworkType, type OpenStrategyResult, type PathOption, type PathOptionSerie, type PeripheryState, type PeripheryStateHuman, type PolicyStruct, type PolicyStructHuman, PoolContract, type PoolData, PoolFactory, type PoolFactoryState, type PoolFactoryStateHuman, PoolQuotaKeeperContract, type PoolQuotaKeeperData, type PoolQuotaKeeperState, type PoolQuotaKeeperStateHuman, type PoolState, type PoolStateHuman, type PriceFactoryStateHuman, type PriceFeedConstructorArgs, type PriceFeedContractType, type PriceFeedMapEntry, PriceFeedRef, PriceFeedRegister, type PriceFeedState, type PriceFeedStateHuman, type PriceFeedTreeNode, type PriceFeedUsageType, PriceOracleContract, type PriceOracleData, type PriceOracleState, type PriceOracleV3State, type PriceOracleV3StateHuman, Provider, type ProviderOptions, type QuotaParams, type QuotaParamsHuman, type RateKeeperData, type RawTx, RedstonePriceFeedContract, type RedstonePriceFeedState, type RedstonePriceFeedStateHuman, type RouterCloseResult, type RouterComponentRegisterHuman, type RouterResult, type RouterState, type RouterStateHuman, RouterV3Contract, type RouterV3ContractState, type RouterV3ContractStateHuman, type SDKAttachOptions, SDKConstruct, type SDKEventsMap, SUPPORTED_CHAINS, type SwapOperation, type SwapTask, TIMELOCK, type TVL, type TokenMetaData, type TokenTypeToResolverHuman, USDC, type UpdatePriceFeedsResult, VotingContractStatus, WstETHPriceFeedContract, YearnPriceFeedContract, type ZapperInfo, type ZapperInfoHuman, type ZapperRegisterState, type ZapperRegisterStateHuman, ZeroPriceFeedContract, botPermissionsToString, bytes32ToString, chains, childLogger, convertBaseContractState, convertCoreStateToHuman, convertCreditFactoryStateToHuman, convertGaugeStateToHuman, convertGearboxStateToHuman, convertGearboxStateToHumanLA, convertLinearModelStateToHuman, convertPeripheryStateToHuman, convertPoolFactoryStateToHuman, convertPoolQuotaKeeperStateToHuman, convertPoolStateToHuman, convertPriceFeedStateToHuman, convertPriceOracleStateToHuman, convertRouterStateToHuman, convertRouterV3StateToHuman, convertZapperRegisterStateToHuman, createRawTx, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, json_parse, json_stringify, numberWithCommas, percentFmt, toHumanFormat };
|
package/dist/esm/index.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { simulateContract } from 'viem/actions';
|
|
|
6
6
|
import { EventEmitter } from 'eventemitter3';
|
|
7
7
|
import { DataServiceWrapper } from '@redstone-finance/evm-connector';
|
|
8
8
|
import { RedstonePayload } from 'redstone-protocol';
|
|
9
|
-
import { decimals, getTokenSymbol, RouterComponent, TokenType,
|
|
9
|
+
import { getConnectors, decimals, getTokenSymbol, RouterComponent, TokenType, tokenDataByNetwork, contractParams, curveTokens, balancerLpTokens, isCurveLPToken, yearnTokens, convexTokens, isBalancerLPToken } from '@gearbox-protocol/sdk-gov';
|
|
10
10
|
import { auraTokens } from '@gearbox-protocol/sdk-gov/lib/tokens/aura';
|
|
11
11
|
|
|
12
12
|
// src/accounts/CreditAccountsService.ts
|
|
@@ -15517,7 +15517,7 @@ var GearboxSDK = class _GearboxSDK extends EventEmitter {
|
|
|
15517
15517
|
*/
|
|
15518
15518
|
contracts = new AddressMap();
|
|
15519
15519
|
static async attach(options) {
|
|
15520
|
-
const { rpcURL, timeout, logger } = options;
|
|
15520
|
+
const { rpcURL, timeout, logger, riskCurators } = options;
|
|
15521
15521
|
let { networkType, addressProvider, chainId } = options;
|
|
15522
15522
|
const attachClient = createAnvilClient({
|
|
15523
15523
|
transport: http(rpcURL, { timeout })
|
|
@@ -15544,7 +15544,7 @@ var GearboxSDK = class _GearboxSDK extends EventEmitter {
|
|
|
15544
15544
|
return new _GearboxSDK({
|
|
15545
15545
|
provider,
|
|
15546
15546
|
logger
|
|
15547
|
-
}).#attach(addressProvider);
|
|
15547
|
+
}).#attach(addressProvider, riskCurators);
|
|
15548
15548
|
}
|
|
15549
15549
|
constructor(options) {
|
|
15550
15550
|
super();
|
|
@@ -15552,7 +15552,7 @@ var GearboxSDK = class _GearboxSDK extends EventEmitter {
|
|
|
15552
15552
|
this.logger = options.logger;
|
|
15553
15553
|
this.priceFeeds = new PriceFeedRegister(this);
|
|
15554
15554
|
}
|
|
15555
|
-
async #attach(addressProviderAddress) {
|
|
15555
|
+
async #attach(addressProviderAddress, riskCurators) {
|
|
15556
15556
|
const time = Date.now();
|
|
15557
15557
|
await this.updateBlock();
|
|
15558
15558
|
this.logger?.info("Attaching to address provider", addressProviderAddress);
|
|
@@ -15574,9 +15574,9 @@ var GearboxSDK = class _GearboxSDK extends EventEmitter {
|
|
|
15574
15574
|
gearStakingAddress
|
|
15575
15575
|
);
|
|
15576
15576
|
this.#marketRegister = new MarketRegister(this);
|
|
15577
|
-
await this.#marketRegister.loadMarkets(
|
|
15578
|
-
TIMELOCK[this.provider.networkType]
|
|
15579
|
-
|
|
15577
|
+
await this.#marketRegister.loadMarkets(
|
|
15578
|
+
riskCurators ?? [TIMELOCK[this.provider.networkType]]
|
|
15579
|
+
);
|
|
15580
15580
|
try {
|
|
15581
15581
|
const router = this.#addressProvider.getLatestVersion(AP_ROUTER);
|
|
15582
15582
|
this.#router = new RouterV3Contract(this, router);
|
|
@@ -16073,4 +16073,4 @@ function convertZapperRegisterStateToHuman(state, labelAddress, _raw = true) {
|
|
|
16073
16073
|
};
|
|
16074
16074
|
}
|
|
16075
16075
|
|
|
16076
|
-
export { ADDRESS_0X0, ADDRESS_PROVIDER, AP_ACCOUNT_FACTORY, AP_ACL, 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_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, 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, BalancerWeightedPriceFeedContract, BaseContract, BotListContract, BotPermissions, BoundedPriceFeedContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, CreditAccountsService, CreditConfiguratorContract, CreditFacadeContract, CreditFactory, CreditManagerContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, Erc4626PriceFeedContract, GaugeContract, GearStakingContract, GearboxSDK, LinearModelContract, MAX_UINT256, MIN_INT96, MarketFactory, MarketRegister, MellowLRTPriceFeedContract, NOT_DEPLOYED, NO_VERSION, PoolContract, PoolFactory, PoolQuotaKeeperContract, PriceFeedRef, PriceFeedRegister, PriceOracleContract, Provider, RedstonePriceFeedContract, SDKConstruct, SUPPORTED_CHAINS, TIMELOCK, USDC, VotingContractStatus, WstETHPriceFeedContract, YearnPriceFeedContract, ZeroPriceFeedContract, botPermissionsToString, bytes32ToString, chains, childLogger, convertBaseContractState, convertCoreStateToHuman, convertCreditFactoryStateToHuman, convertGaugeStateToHuman, convertGearboxStateToHuman, convertGearboxStateToHumanLA, convertLinearModelStateToHuman, convertPeripheryStateToHuman, convertPoolFactoryStateToHuman, convertPoolQuotaKeeperStateToHuman, convertPoolStateToHuman, convertPriceFeedStateToHuman, convertPriceOracleStateToHuman, convertRouterStateToHuman, convertRouterV3StateToHuman, convertZapperRegisterStateToHuman, createRawTx, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, json_parse, json_stringify, numberWithCommas, percentFmt, toHumanFormat };
|
|
16076
|
+
export { ADDRESS_0X0, ADDRESS_PROVIDER, AP_ACCOUNT_FACTORY, AP_ACL, 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_MULTI_PAUSE, AP_PARTIAL_LIQUIDATION_BOT, 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, BalancerWeightedPriceFeedContract, BaseContract, BotListContract, BotPermissions, BoundedPriceFeedContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, CreditAccountsService, CreditConfiguratorContract, CreditFacadeContract, CreditFactory, CreditManagerContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, Erc4626PriceFeedContract, GaugeContract, GearStakingContract, GearboxSDK, LinearModelContract, MAX_UINT256, MIN_INT96, MarketFactory, MarketRegister, MellowLRTPriceFeedContract, NOT_DEPLOYED, NO_VERSION, PoolContract, PoolFactory, PoolQuotaKeeperContract, PriceFeedRef, PriceFeedRegister, PriceOracleContract, Provider, RedstonePriceFeedContract, RouterV3Contract, SDKConstruct, SUPPORTED_CHAINS, TIMELOCK, USDC, VotingContractStatus, WstETHPriceFeedContract, YearnPriceFeedContract, ZeroPriceFeedContract, botPermissionsToString, bytes32ToString, chains, childLogger, convertBaseContractState, convertCoreStateToHuman, convertCreditFactoryStateToHuman, convertGaugeStateToHuman, convertGearboxStateToHuman, convertGearboxStateToHumanLA, convertLinearModelStateToHuman, convertPeripheryStateToHuman, convertPoolFactoryStateToHuman, convertPoolQuotaKeeperStateToHuman, convertPoolStateToHuman, convertPriceFeedStateToHuman, convertPriceOracleStateToHuman, convertRouterStateToHuman, convertRouterV3StateToHuman, convertZapperRegisterStateToHuman, createRawTx, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, json_parse, json_stringify, numberWithCommas, percentFmt, toHumanFormat };
|