@gearbox-protocol/sdk 3.0.0-vfour.140 → 3.0.0-vfour.141

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.
@@ -51784,6 +51784,124 @@ var yearnWithdrawerAbi = [
51784
51784
  name: "UnknownToken"
51785
51785
  }
51786
51786
  ];
51787
+ var iSwapperAbi = [
51788
+ {
51789
+ type: "function",
51790
+ name: "getBestDirectPairSwap",
51791
+ inputs: [
51792
+ {
51793
+ name: "swapTask",
51794
+ type: "tuple",
51795
+ internalType: "struct SwapTask",
51796
+ components: [
51797
+ {
51798
+ name: "swapOperation",
51799
+ type: "uint8",
51800
+ internalType: "enum SwapOperation"
51801
+ },
51802
+ {
51803
+ name: "creditAccount",
51804
+ type: "address",
51805
+ internalType: "address"
51806
+ },
51807
+ {
51808
+ name: "tokenIn",
51809
+ type: "address",
51810
+ internalType: "address"
51811
+ },
51812
+ {
51813
+ name: "tokenOut",
51814
+ type: "address",
51815
+ internalType: "address"
51816
+ },
51817
+ {
51818
+ name: "connectors",
51819
+ type: "address[]",
51820
+ internalType: "address[]"
51821
+ },
51822
+ {
51823
+ name: "amount",
51824
+ type: "uint256",
51825
+ internalType: "uint256"
51826
+ },
51827
+ {
51828
+ name: "leftoverAmount",
51829
+ type: "uint256",
51830
+ internalType: "uint256"
51831
+ }
51832
+ ]
51833
+ },
51834
+ {
51835
+ name: "adapter",
51836
+ type: "address",
51837
+ internalType: "address"
51838
+ }
51839
+ ],
51840
+ outputs: [
51841
+ {
51842
+ name: "quote",
51843
+ type: "tuple",
51844
+ internalType: "struct SwapQuote",
51845
+ components: [
51846
+ {
51847
+ name: "multiCall",
51848
+ type: "tuple",
51849
+ internalType: "struct MultiCall",
51850
+ components: [
51851
+ {
51852
+ name: "target",
51853
+ type: "address",
51854
+ internalType: "address"
51855
+ },
51856
+ {
51857
+ name: "callData",
51858
+ type: "bytes",
51859
+ internalType: "bytes"
51860
+ }
51861
+ ]
51862
+ },
51863
+ {
51864
+ name: "amount",
51865
+ type: "uint256",
51866
+ internalType: "uint256"
51867
+ },
51868
+ {
51869
+ name: "found",
51870
+ type: "bool",
51871
+ internalType: "bool"
51872
+ }
51873
+ ]
51874
+ }
51875
+ ],
51876
+ stateMutability: "nonpayable"
51877
+ },
51878
+ {
51879
+ type: "function",
51880
+ name: "getComponentId",
51881
+ inputs: [],
51882
+ outputs: [
51883
+ {
51884
+ name: "",
51885
+ type: "uint8",
51886
+ internalType: "uint8"
51887
+ }
51888
+ ],
51889
+ stateMutability: "view"
51890
+ },
51891
+ {
51892
+ type: "function",
51893
+ name: "version",
51894
+ inputs: [],
51895
+ outputs: [
51896
+ {
51897
+ name: "",
51898
+ type: "uint256",
51899
+ internalType: "uint256"
51900
+ }
51901
+ ],
51902
+ stateMutability: "view"
51903
+ }
51904
+ ];
51787
51905
 
51788
51906
  // src/sdk/abi/v310.ts
51789
51907
  var iAddressProviderV3_1Abi = [
@@ -64942,6 +65060,13 @@ var SWAP_OPERATIONS = {
64942
65060
  EXACT_INPUT_ALL: 1,
64943
65061
  EXACT_OUTPUT: 2
64944
65062
  };
65063
+ var PT_IN = {
65064
+ ["0xEe9085fC268F6727d5D4293dBABccF901ffDCC29".toLowerCase()]: "PT_sUSDe_26DEC2024",
65065
+ ["0xE00bd3Df25fb187d6ABBB620b3dfd19839947b81".toLowerCase()]: "PT_sUSDe_27MAR20251"
65066
+ };
65067
+ var OUT = {
65068
+ ["0x9D39A5DE30e57443BfF2A8307A4256c8797A3497".toLowerCase()]: "sUSDe"
65069
+ };
64945
65070
  var RouterV3Contract = class extends BaseContract {
64946
65071
  #connectors;
64947
65072
  #hooks = new Hooks();
@@ -65014,34 +65139,98 @@ var RouterV3Contract = class extends BaseContract {
65014
65139
  * @param slippage
65015
65140
  * @returns
65016
65141
  */
65017
- async findOneTokenPath({
65018
- creditAccount: ca,
65019
- creditManager: cm,
65020
- tokenIn,
65021
- tokenOut,
65022
- amount,
65023
- slippage
65024
- }) {
65025
- const connectors2 = this.getAvailableConnectors(cm.collateralTokens);
65026
- const { result } = await this.contract.simulate.findOneTokenPath(
65142
+ async findOneTokenPath(props) {
65143
+ const {
65144
+ creditAccount,
65145
+ creditManager,
65146
+ tokenIn,
65147
+ tokenOut,
65148
+ amount,
65149
+ slippage
65150
+ } = props;
65151
+ const connectors2 = this.getAvailableConnectors(
65152
+ creditManager.collateralTokens
65153
+ );
65154
+ const isPTOverrideRedeem = PT_IN[tokenIn.toLowerCase()] && OUT[tokenOut.toLowerCase()];
65155
+ const { result } = await (isPTOverrideRedeem ? this.overridePTRedeem(props) : this.contract.simulate.findOneTokenPath(
65027
65156
  [
65028
65157
  tokenIn,
65029
65158
  amount,
65030
65159
  tokenOut,
65031
- ca.creditAccount,
65160
+ creditAccount.creditAccount,
65032
65161
  connectors2,
65033
65162
  BigInt(slippage)
65034
65163
  ],
65035
65164
  {
65036
65165
  gas: GAS_PER_BLOCK
65037
65166
  }
65038
- );
65167
+ ));
65039
65168
  return {
65040
65169
  amount: result.amount,
65041
65170
  minAmount: result.minAmount,
65042
65171
  calls: [...result.calls]
65043
65172
  };
65044
65173
  }
65174
+ async overridePTRedeem({
65175
+ creditAccount,
65176
+ creditManager,
65177
+ tokenIn,
65178
+ tokenOut,
65179
+ amount,
65180
+ slippage
65181
+ }) {
65182
+ const pendleSwapperAddress = await this.contract.read.componentAddressById([
65183
+ 37
65184
+ ]);
65185
+ const cm = this.sdk.marketRegister.findCreditManager(creditManager.address);
65186
+ const pendleRouter = contractsByNetwork[this.sdk.provider.networkType].PENDLE_ROUTER;
65187
+ const pendleAdapter = cm.creditManager.adapters.mustGet(pendleRouter);
65188
+ const pendleSwapper = viem.getContract({
65189
+ address: pendleSwapperAddress,
65190
+ abi: iSwapperAbi,
65191
+ client: this.sdk.provider.publicClient
65192
+ });
65193
+ const result = await pendleSwapper.simulate.getBestDirectPairSwap([
65194
+ {
65195
+ swapOperation: 1,
65196
+ creditAccount: creditAccount.creditAccount,
65197
+ tokenIn,
65198
+ tokenOut,
65199
+ connectors: [],
65200
+ amount,
65201
+ leftoverAmount: 0n
65202
+ },
65203
+ pendleAdapter.address
65204
+ ]);
65205
+ const minAmount = result.result.amount * (PERCENTAGE_FACTOR - BigInt(slippage)) / PERCENTAGE_FACTOR;
65206
+ const storeExpectedBalances = {
65207
+ target: creditManager.creditFacade,
65208
+ callData: viem.encodeFunctionData({
65209
+ abi: iCreditFacadeV3MulticallAbi,
65210
+ functionName: "storeExpectedBalances",
65211
+ args: [[{ token: tokenOut, amount: minAmount }]]
65212
+ })
65213
+ };
65214
+ const compareBalances = {
65215
+ target: creditManager.creditFacade,
65216
+ callData: viem.encodeFunctionData({
65217
+ abi: iCreditFacadeV3MulticallAbi,
65218
+ functionName: "compareBalances",
65219
+ args: []
65220
+ })
65221
+ };
65222
+ return {
65223
+ result: {
65224
+ amount: result.result.amount,
65225
+ minAmount,
65226
+ calls: [
65227
+ storeExpectedBalances,
65228
+ result.result.multiCall,
65229
+ compareBalances
65230
+ ]
65231
+ }
65232
+ };
65233
+ }
65045
65234
  /**
65046
65235
  * @dev Finds the best path for opening Credit Account and converting all NORMAL tokens and LP token in the way to TARGET
65047
65236
  * @param creditManager CreditManagerData which represents credit manager you want to use to open Credit Account
@@ -66941,6 +67130,7 @@ exports.iRedstonePriceFeedEventsAbi = iRedstonePriceFeedEventsAbi;
66941
67130
  exports.iRedstonePriceFeedExceptionsAbi = iRedstonePriceFeedExceptionsAbi;
66942
67131
  exports.iRouterV3ErrorsAbi = iRouterV3ErrorsAbi;
66943
67132
  exports.iStakingRewardsAdapterAbi = iStakingRewardsAdapterAbi;
67133
+ exports.iSwapperAbi = iSwapperAbi;
66944
67134
  exports.iUpdatablePriceFeedAbi = iUpdatablePriceFeedAbi;
66945
67135
  exports.iVersionAbi = iVersionAbi;
66946
67136
  exports.iZapperAbi = iZapperAbi;
@@ -70931,6 +70931,96 @@ declare const yearnWithdrawerAbi: readonly [{
70931
70931
  }];
70932
70932
  readonly name: "UnknownToken";
70933
70933
  }];
70934
+ declare const iSwapperAbi: readonly [{
70935
+ readonly type: "function";
70936
+ readonly name: "getBestDirectPairSwap";
70937
+ readonly inputs: readonly [{
70938
+ readonly name: "swapTask";
70939
+ readonly type: "tuple";
70940
+ readonly internalType: "struct SwapTask";
70941
+ readonly components: readonly [{
70942
+ readonly name: "swapOperation";
70943
+ readonly type: "uint8";
70944
+ readonly internalType: "enum SwapOperation";
70945
+ }, {
70946
+ readonly name: "creditAccount";
70947
+ readonly type: "address";
70948
+ readonly internalType: "address";
70949
+ }, {
70950
+ readonly name: "tokenIn";
70951
+ readonly type: "address";
70952
+ readonly internalType: "address";
70953
+ }, {
70954
+ readonly name: "tokenOut";
70955
+ readonly type: "address";
70956
+ readonly internalType: "address";
70957
+ }, {
70958
+ readonly name: "connectors";
70959
+ readonly type: "address[]";
70960
+ readonly internalType: "address[]";
70961
+ }, {
70962
+ readonly name: "amount";
70963
+ readonly type: "uint256";
70964
+ readonly internalType: "uint256";
70965
+ }, {
70966
+ readonly name: "leftoverAmount";
70967
+ readonly type: "uint256";
70968
+ readonly internalType: "uint256";
70969
+ }];
70970
+ }, {
70971
+ readonly name: "adapter";
70972
+ readonly type: "address";
70973
+ readonly internalType: "address";
70974
+ }];
70975
+ readonly outputs: readonly [{
70976
+ readonly name: "quote";
70977
+ readonly type: "tuple";
70978
+ readonly internalType: "struct SwapQuote";
70979
+ readonly components: readonly [{
70980
+ readonly name: "multiCall";
70981
+ readonly type: "tuple";
70982
+ readonly internalType: "struct MultiCall";
70983
+ readonly components: readonly [{
70984
+ readonly name: "target";
70985
+ readonly type: "address";
70986
+ readonly internalType: "address";
70987
+ }, {
70988
+ readonly name: "callData";
70989
+ readonly type: "bytes";
70990
+ readonly internalType: "bytes";
70991
+ }];
70992
+ }, {
70993
+ readonly name: "amount";
70994
+ readonly type: "uint256";
70995
+ readonly internalType: "uint256";
70996
+ }, {
70997
+ readonly name: "found";
70998
+ readonly type: "bool";
70999
+ readonly internalType: "bool";
71000
+ }];
71001
+ }];
71002
+ readonly stateMutability: "nonpayable";
71003
+ }, {
71004
+ readonly type: "function";
71005
+ readonly name: "getComponentId";
71006
+ readonly inputs: readonly [];
71007
+ readonly outputs: readonly [{
71008
+ readonly name: "";
71009
+ readonly type: "uint8";
71010
+ readonly internalType: "uint8";
71011
+ }];
71012
+ readonly stateMutability: "view";
71013
+ }, {
71014
+ readonly type: "function";
71015
+ readonly name: "version";
71016
+ readonly inputs: readonly [];
71017
+ readonly outputs: readonly [{
71018
+ readonly name: "";
71019
+ readonly type: "uint256";
71020
+ readonly internalType: "uint256";
71021
+ }];
71022
+ readonly stateMutability: "view";
71023
+ }];
70934
71024
 
70935
71025
  declare const iAddressProviderV3_1Abi: readonly [{
70936
71026
  readonly type: "constructor";
@@ -91542,6 +91632,7 @@ type RouterHooks = {
91542
91632
  */
91543
91633
  interface CreditManagerSlice {
91544
91634
  address: Address;
91635
+ creditFacade: Address;
91545
91636
  collateralTokens: Array<Address>;
91546
91637
  }
91547
91638
  type CreditAccountDataSlice = Pick<CreditAccountData, "tokens" | "enabledTokensMask" | "underlying" | "creditAccount" | "creditFacade" | "debt" | "creditManager">;
@@ -91573,7 +91664,17 @@ declare class RouterV3Contract extends BaseContract<abi> implements IHooks<Route
91573
91664
  * @param slippage
91574
91665
  * @returns
91575
91666
  */
91576
- findOneTokenPath({ creditAccount: ca, creditManager: cm, tokenIn, tokenOut, amount, slippage, }: FindOneTokenPathProps): Promise<RouterResult>;
91667
+ findOneTokenPath(props: FindOneTokenPathProps): Promise<RouterResult>;
91668
+ overridePTRedeem({ creditAccount, creditManager, tokenIn, tokenOut, amount, slippage, }: FindOneTokenPathProps): Promise<{
91669
+ result: {
91670
+ amount: bigint;
91671
+ minAmount: bigint;
91672
+ calls: {
91673
+ target: `0x${string}`;
91674
+ callData: `0x${string}`;
91675
+ }[];
91676
+ };
91677
+ }>;
91577
91678
  /**
91578
91679
  * @dev Finds the best path for opening Credit Account and converting all NORMAL tokens and LP token in the way to TARGET
91579
91680
  * @param creditManager CreditManagerData which represents credit manager you want to use to open Credit Account
@@ -92168,4 +92269,4 @@ type MulticallErrorType = GetChainContractAddressErrorType | ReadContractErrorTy
92168
92269
  */
92169
92270
  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>>;
92170
92271
 
92171
- export { ADDRESS_0X0, ADDRESS_PROVIDER, ADDRESS_PROVIDER_BLOCK, 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, AddressProviderContractV3_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, type BotAddresses, type BotBaseType, type BotDataPayload, type BotDetailedType, BotListContract, type BotListStateHuman, BotPermissions, BotsService, type BoundedOracleStateHuman, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, type ClaimFarmRewardsProps, type CloseCreditAccountResult, type ClosePathBalances, type CommonResult, CompositePriceFeedContract, type ConnectionOptions, type ContractMethod, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, type CoreStateHuman, type CreditAccountData, type CreditAccountDataSlice, type CreditAccountFilter, type CreditAccountServiceOptions, CreditAccountsService, type CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV300Contract, CreditConfiguratorV310Contract, type CreditFacadeState, type CreditFacadeStateHuman, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, type CreditFactoryStateHuman, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerState, type CreditManagerStateHuman, CreditManagerV300Contract, CreditManagerV310Contract, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, type CurvePoolStruct, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, DaiUsdsAdapterContract, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GEARBOX_MULTISIG, GEARBOX_RISK_CURATORS, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStakingDataPayload, GaugeStakingService, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IAddressProviderContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, type IPriceOracleContract, type LPPriceFeedStateHuman, LinearModelContract, type LinearModelStateHuman, type LiquidationBotType, type LogFn, MAX_UINT16, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, MellowVaultAdapterContract, type MultiCall, type MultiVote, 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 PartialPriceFeedTreeNode, type PathOption, type PathOptionSerie, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, type PermitResult, 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, type PriceOracleData, PriceOracleV300Contract, PriceOracleV310Contract, type PriceOracleV3StateHuman, Provider, type QuotaParamsHuman, type QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, type RampEvent, type RateKeeperData, type RawTx, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RouterCloseResult, type RouterHooks, type RouterResult, RouterV3Contract, SDKConstruct, type SDKHooks, type SDKOptions, SUPPORTED_CHAINS, type SendRawTxParameters, StakingRewardsAdapterContract, type SwapOperation, type SwapTask, type SyncStateOptions, TIMELOCK, type TVL, type TokenMetaData, TokensMeta, type TransportOptions, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, type UpdatePriceFeedsResult, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WETH, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, type ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, aaveV2WrapperAbi, accountFactoryV3Abi, aclAbi, aclNonReentrantTraitAbi, assetsMap, auraDepositorAbi, auraPathResolverAbi, auraWithdrawerAbi, balancerLpDepositorAbi, balancerLpPathResolverAbi, balancerLpWithdrawerAbi, balancerSwapperAbi, balancerV2VaultAdapterAbi, balancesMap, batchLiquidationEstimatorAbi, batchesChainAbi, botListV3Abi, botPermissionsToString, boundedPriceFeedAbi, bptStablePriceFeedAbi, bptWeightedPriceFeedAbi, bytes32ToString, camelotV3AdapterAbi, camelotV3SwapperAbi, chainlinkReadableAggregatorAbi, chains, childLogger, closePathResolverAbi, compositePriceFeedAbi, compoundV2WrapperAbi, contractsRegisterAbi, controllerTimelockV3Abi, convexDepositorAbi, convexPathResolverAbi, convexV1BaseRewardPoolAdapterAbi, convexV1BoosterAdapterAbi, convexWithdrawerAbi, createAdapter, createRawTx, createTransport, creditConfiguratorV3Abi, creditFacadeV3Abi, creditManagerV3Abi, creditManagerV3UsdtAbi, curveCryptoLpPriceFeedAbi, curveLpDepositorAbi, curveLpPathResolverAbi, curveLpWithdrawerAbi, curveStableLpPriceFeedAbi, curveSwapperAbi, curveUsdPriceFeedAbi, curveV1Adapter2AssetsAbi, curveV1Adapter3AssetsAbi, curveV1Adapter4AssetsAbi, curveV1AdapterDepositAbi, curveV1AdapterStEthAbi, curveV1AdapterStableNgAbi, dataCompressorV3Abi, degenDistributorV3Abi, degenNftv2Abi, detectChain, detectNetwork, erc20Abi, erc4626AdapterAbi, erc4626DepositorAbi, erc4626PathResolverAbi, erc4626PriceFeedAbi, erc4626WithdrawerAbi, errorAbis, etherscanUrl, faucetAbi, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, gaugeV3Abi, gearStakingV3Abi, getAddressProvider, halfRAY, iAdapterAbi, iAddressProviderV3Abi, iAddressProviderV3_1Abi, iArbTokenAbi, iBalancerStablePoolAbi, iBalancerWeightedPoolAbi, iCamelotV3QuoterAbi, iCreditAccountCompressorAbi, iCreditConfiguratorV310Abi, iCreditFacadeV2Abi, iCreditFacadeV2EventsAbi, iCreditFacadeV2ExceptionsAbi, iCreditFacadeV2ExtendedAbi, iCreditFacadeV2V2Abi, iCreditFacadeV310Abi, iCreditFacadeV310MulticallAbi, iCreditFacadeV3Abi, iCreditFacadeV3EventsAbi, iCreditFacadeV3MulticallAbi, iCreditManagerV310Abi, iCurvePoolAbi, iDaiUsdsAdapterAbi, iDegenNftv2Abi, iDegenNftv2EventsAbi, iDegenNftv2ExceptionsAbi, iExceptionsAbi, iLegacyMintableErc20Abi, iMarketCompressorAbi, iMarketConfiguratorV310Abi, iMellowVaultAbi, iMellowVaultAdapterAbi, iOptimismMintableErc20Abi, iPendleRouterAdapterAbi, iPoolV3Abi, iPoolV3EventsAbi, iPriceFeedAbi, iPriceFeedCompressorAbi, iPriceOracleV310Abi, iPriceOracleV3Abi, iPriceOracleV3EventsAbi, iRedstoneErrorsAbi, iRedstonePriceFeedEventsAbi, iRedstonePriceFeedExceptionsAbi, iRouterV3ErrorsAbi, iStakingRewardsAdapterAbi, iUpdatablePriceFeedAbi, iVersionAbi, iZapperAbi, ierc20Abi, ierc20MetadataAbi, ilpPriceFeedAbi, ilpPriceFeedEventsAbi, ilpPriceFeedExceptionsAbi, inflationAttackBlockerAbi, insolvencyCheckerAbi, iwstEthAbi, iyVaultAbi, json_parse, json_stringify, lidoSwapperAbi, lidoV1AdapterAbi, linearInterestRateModelV3Abi, mellowLrtPriceFeedAbi, multiPauseAbi, numberWithCommas, overrideAggregatorAbi, partialLiquidationBotV3Abi, pendleTWAPPTPriceFeedAbi, percentFmt, poolQuotaKeeperV3Abi, poolV3Abi, poolV3UsdtAbi, priceFeedMultiplierAbi, priceOracleV3Abi, rawTxToMulticallPriceUpdate, redstonePriceFeedAbi, routerV3Abi, sendRawTx, simulateMulticall, susdeOverriderAbi, swapAggregatorAbi, toHumanFormat, tokenStealerAbi, tokenToTicker, underlyingDepositZapperAbi, underlyingFarmingZapperAbi, uniswapV2AdapterAbi, uniswapV2SwapperAbi, uniswapV3AdapterAbi, uniswapV3SwapperAbi, velodromeV2RouterAdapterAbi, velodromeV2SwapperAbi, wethDepositZapperAbi, wethFarmingZapperAbi, wrapAggregatorAbi, wstEthPriceFeedAbi, wstEthSwapperAbi, wstEthv1AdapterAbi, yearnDepositorAbi, yearnPathResolverAbi, yearnPriceFeedAbi, yearnV2AdapterAbi, yearnWithdrawerAbi, zapperRegisterAbi, zeroPriceFeedAbi };
92272
+ export { ADDRESS_0X0, ADDRESS_PROVIDER, ADDRESS_PROVIDER_BLOCK, 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, AddressProviderContractV3_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, type BotAddresses, type BotBaseType, type BotDataPayload, type BotDetailedType, BotListContract, type BotListStateHuman, BotPermissions, BotsService, type BoundedOracleStateHuman, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, type ClaimFarmRewardsProps, type CloseCreditAccountResult, type ClosePathBalances, type CommonResult, CompositePriceFeedContract, type ConnectionOptions, type ContractMethod, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, type CoreStateHuman, type CreditAccountData, type CreditAccountDataSlice, type CreditAccountFilter, type CreditAccountServiceOptions, CreditAccountsService, type CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV300Contract, CreditConfiguratorV310Contract, type CreditFacadeState, type CreditFacadeStateHuman, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, type CreditFactoryStateHuman, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerState, type CreditManagerStateHuman, CreditManagerV300Contract, CreditManagerV310Contract, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, type CurvePoolStruct, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, DaiUsdsAdapterContract, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GEARBOX_MULTISIG, GEARBOX_RISK_CURATORS, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStakingDataPayload, GaugeStakingService, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IAddressProviderContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, type IPriceOracleContract, type LPPriceFeedStateHuman, LinearModelContract, type LinearModelStateHuman, type LiquidationBotType, type LogFn, MAX_UINT16, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, MellowVaultAdapterContract, type MultiCall, type MultiVote, 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 PartialPriceFeedTreeNode, type PathOption, type PathOptionSerie, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, type PermitResult, 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, type PriceOracleData, PriceOracleV300Contract, PriceOracleV310Contract, type PriceOracleV3StateHuman, Provider, type QuotaParamsHuman, type QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, type RampEvent, type RateKeeperData, type RawTx, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RouterCloseResult, type RouterHooks, type RouterResult, RouterV3Contract, SDKConstruct, type SDKHooks, type SDKOptions, SUPPORTED_CHAINS, type SendRawTxParameters, StakingRewardsAdapterContract, type SwapOperation, type SwapTask, type SyncStateOptions, TIMELOCK, type TVL, type TokenMetaData, TokensMeta, type TransportOptions, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, type UpdatePriceFeedsResult, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WETH, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, type ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, aaveV2WrapperAbi, accountFactoryV3Abi, aclAbi, aclNonReentrantTraitAbi, assetsMap, auraDepositorAbi, auraPathResolverAbi, auraWithdrawerAbi, balancerLpDepositorAbi, balancerLpPathResolverAbi, balancerLpWithdrawerAbi, balancerSwapperAbi, balancerV2VaultAdapterAbi, balancesMap, batchLiquidationEstimatorAbi, batchesChainAbi, botListV3Abi, botPermissionsToString, boundedPriceFeedAbi, bptStablePriceFeedAbi, bptWeightedPriceFeedAbi, bytes32ToString, camelotV3AdapterAbi, camelotV3SwapperAbi, chainlinkReadableAggregatorAbi, chains, childLogger, closePathResolverAbi, compositePriceFeedAbi, compoundV2WrapperAbi, contractsRegisterAbi, controllerTimelockV3Abi, convexDepositorAbi, convexPathResolverAbi, convexV1BaseRewardPoolAdapterAbi, convexV1BoosterAdapterAbi, convexWithdrawerAbi, createAdapter, createRawTx, createTransport, creditConfiguratorV3Abi, creditFacadeV3Abi, creditManagerV3Abi, creditManagerV3UsdtAbi, curveCryptoLpPriceFeedAbi, curveLpDepositorAbi, curveLpPathResolverAbi, curveLpWithdrawerAbi, curveStableLpPriceFeedAbi, curveSwapperAbi, curveUsdPriceFeedAbi, curveV1Adapter2AssetsAbi, curveV1Adapter3AssetsAbi, curveV1Adapter4AssetsAbi, curveV1AdapterDepositAbi, curveV1AdapterStEthAbi, curveV1AdapterStableNgAbi, dataCompressorV3Abi, degenDistributorV3Abi, degenNftv2Abi, detectChain, detectNetwork, erc20Abi, erc4626AdapterAbi, erc4626DepositorAbi, erc4626PathResolverAbi, erc4626PriceFeedAbi, erc4626WithdrawerAbi, errorAbis, etherscanUrl, faucetAbi, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, gaugeV3Abi, gearStakingV3Abi, getAddressProvider, halfRAY, iAdapterAbi, iAddressProviderV3Abi, iAddressProviderV3_1Abi, iArbTokenAbi, iBalancerStablePoolAbi, iBalancerWeightedPoolAbi, iCamelotV3QuoterAbi, iCreditAccountCompressorAbi, iCreditConfiguratorV310Abi, iCreditFacadeV2Abi, iCreditFacadeV2EventsAbi, iCreditFacadeV2ExceptionsAbi, iCreditFacadeV2ExtendedAbi, iCreditFacadeV2V2Abi, iCreditFacadeV310Abi, iCreditFacadeV310MulticallAbi, iCreditFacadeV3Abi, iCreditFacadeV3EventsAbi, iCreditFacadeV3MulticallAbi, iCreditManagerV310Abi, iCurvePoolAbi, iDaiUsdsAdapterAbi, iDegenNftv2Abi, iDegenNftv2EventsAbi, iDegenNftv2ExceptionsAbi, iExceptionsAbi, iLegacyMintableErc20Abi, iMarketCompressorAbi, iMarketConfiguratorV310Abi, iMellowVaultAbi, iMellowVaultAdapterAbi, iOptimismMintableErc20Abi, iPendleRouterAdapterAbi, iPoolV3Abi, iPoolV3EventsAbi, iPriceFeedAbi, iPriceFeedCompressorAbi, iPriceOracleV310Abi, iPriceOracleV3Abi, iPriceOracleV3EventsAbi, iRedstoneErrorsAbi, iRedstonePriceFeedEventsAbi, iRedstonePriceFeedExceptionsAbi, iRouterV3ErrorsAbi, iStakingRewardsAdapterAbi, iSwapperAbi, iUpdatablePriceFeedAbi, iVersionAbi, iZapperAbi, ierc20Abi, ierc20MetadataAbi, ilpPriceFeedAbi, ilpPriceFeedEventsAbi, ilpPriceFeedExceptionsAbi, inflationAttackBlockerAbi, insolvencyCheckerAbi, iwstEthAbi, iyVaultAbi, json_parse, json_stringify, lidoSwapperAbi, lidoV1AdapterAbi, linearInterestRateModelV3Abi, mellowLrtPriceFeedAbi, multiPauseAbi, numberWithCommas, overrideAggregatorAbi, partialLiquidationBotV3Abi, pendleTWAPPTPriceFeedAbi, percentFmt, poolQuotaKeeperV3Abi, poolV3Abi, poolV3UsdtAbi, priceFeedMultiplierAbi, priceOracleV3Abi, rawTxToMulticallPriceUpdate, redstonePriceFeedAbi, routerV3Abi, sendRawTx, simulateMulticall, susdeOverriderAbi, swapAggregatorAbi, toHumanFormat, tokenStealerAbi, tokenToTicker, underlyingDepositZapperAbi, underlyingFarmingZapperAbi, uniswapV2AdapterAbi, uniswapV2SwapperAbi, uniswapV3AdapterAbi, uniswapV3SwapperAbi, velodromeV2RouterAdapterAbi, velodromeV2SwapperAbi, wethDepositZapperAbi, wethFarmingZapperAbi, wrapAggregatorAbi, wstEthPriceFeedAbi, wstEthSwapperAbi, wstEthv1AdapterAbi, yearnDepositorAbi, yearnPathResolverAbi, yearnPriceFeedAbi, yearnV2AdapterAbi, yearnWithdrawerAbi, zapperRegisterAbi, zeroPriceFeedAbi };
@@ -70931,6 +70931,96 @@ declare const yearnWithdrawerAbi: readonly [{
70931
70931
  }];
70932
70932
  readonly name: "UnknownToken";
70933
70933
  }];
70934
+ declare const iSwapperAbi: readonly [{
70935
+ readonly type: "function";
70936
+ readonly name: "getBestDirectPairSwap";
70937
+ readonly inputs: readonly [{
70938
+ readonly name: "swapTask";
70939
+ readonly type: "tuple";
70940
+ readonly internalType: "struct SwapTask";
70941
+ readonly components: readonly [{
70942
+ readonly name: "swapOperation";
70943
+ readonly type: "uint8";
70944
+ readonly internalType: "enum SwapOperation";
70945
+ }, {
70946
+ readonly name: "creditAccount";
70947
+ readonly type: "address";
70948
+ readonly internalType: "address";
70949
+ }, {
70950
+ readonly name: "tokenIn";
70951
+ readonly type: "address";
70952
+ readonly internalType: "address";
70953
+ }, {
70954
+ readonly name: "tokenOut";
70955
+ readonly type: "address";
70956
+ readonly internalType: "address";
70957
+ }, {
70958
+ readonly name: "connectors";
70959
+ readonly type: "address[]";
70960
+ readonly internalType: "address[]";
70961
+ }, {
70962
+ readonly name: "amount";
70963
+ readonly type: "uint256";
70964
+ readonly internalType: "uint256";
70965
+ }, {
70966
+ readonly name: "leftoverAmount";
70967
+ readonly type: "uint256";
70968
+ readonly internalType: "uint256";
70969
+ }];
70970
+ }, {
70971
+ readonly name: "adapter";
70972
+ readonly type: "address";
70973
+ readonly internalType: "address";
70974
+ }];
70975
+ readonly outputs: readonly [{
70976
+ readonly name: "quote";
70977
+ readonly type: "tuple";
70978
+ readonly internalType: "struct SwapQuote";
70979
+ readonly components: readonly [{
70980
+ readonly name: "multiCall";
70981
+ readonly type: "tuple";
70982
+ readonly internalType: "struct MultiCall";
70983
+ readonly components: readonly [{
70984
+ readonly name: "target";
70985
+ readonly type: "address";
70986
+ readonly internalType: "address";
70987
+ }, {
70988
+ readonly name: "callData";
70989
+ readonly type: "bytes";
70990
+ readonly internalType: "bytes";
70991
+ }];
70992
+ }, {
70993
+ readonly name: "amount";
70994
+ readonly type: "uint256";
70995
+ readonly internalType: "uint256";
70996
+ }, {
70997
+ readonly name: "found";
70998
+ readonly type: "bool";
70999
+ readonly internalType: "bool";
71000
+ }];
71001
+ }];
71002
+ readonly stateMutability: "nonpayable";
71003
+ }, {
71004
+ readonly type: "function";
71005
+ readonly name: "getComponentId";
71006
+ readonly inputs: readonly [];
71007
+ readonly outputs: readonly [{
71008
+ readonly name: "";
71009
+ readonly type: "uint8";
71010
+ readonly internalType: "uint8";
71011
+ }];
71012
+ readonly stateMutability: "view";
71013
+ }, {
71014
+ readonly type: "function";
71015
+ readonly name: "version";
71016
+ readonly inputs: readonly [];
71017
+ readonly outputs: readonly [{
71018
+ readonly name: "";
71019
+ readonly type: "uint256";
71020
+ readonly internalType: "uint256";
71021
+ }];
71022
+ readonly stateMutability: "view";
71023
+ }];
70934
71024
 
70935
71025
  declare const iAddressProviderV3_1Abi: readonly [{
70936
71026
  readonly type: "constructor";
@@ -91542,6 +91632,7 @@ type RouterHooks = {
91542
91632
  */
91543
91633
  interface CreditManagerSlice {
91544
91634
  address: Address;
91635
+ creditFacade: Address;
91545
91636
  collateralTokens: Array<Address>;
91546
91637
  }
91547
91638
  type CreditAccountDataSlice = Pick<CreditAccountData, "tokens" | "enabledTokensMask" | "underlying" | "creditAccount" | "creditFacade" | "debt" | "creditManager">;
@@ -91573,7 +91664,17 @@ declare class RouterV3Contract extends BaseContract<abi> implements IHooks<Route
91573
91664
  * @param slippage
91574
91665
  * @returns
91575
91666
  */
91576
- findOneTokenPath({ creditAccount: ca, creditManager: cm, tokenIn, tokenOut, amount, slippage, }: FindOneTokenPathProps): Promise<RouterResult>;
91667
+ findOneTokenPath(props: FindOneTokenPathProps): Promise<RouterResult>;
91668
+ overridePTRedeem({ creditAccount, creditManager, tokenIn, tokenOut, amount, slippage, }: FindOneTokenPathProps): Promise<{
91669
+ result: {
91670
+ amount: bigint;
91671
+ minAmount: bigint;
91672
+ calls: {
91673
+ target: `0x${string}`;
91674
+ callData: `0x${string}`;
91675
+ }[];
91676
+ };
91677
+ }>;
91577
91678
  /**
91578
91679
  * @dev Finds the best path for opening Credit Account and converting all NORMAL tokens and LP token in the way to TARGET
91579
91680
  * @param creditManager CreditManagerData which represents credit manager you want to use to open Credit Account
@@ -92168,4 +92269,4 @@ type MulticallErrorType = GetChainContractAddressErrorType | ReadContractErrorTy
92168
92269
  */
92169
92270
  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>>;
92170
92271
 
92171
- export { ADDRESS_0X0, ADDRESS_PROVIDER, ADDRESS_PROVIDER_BLOCK, 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, AddressProviderContractV3_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, type BotAddresses, type BotBaseType, type BotDataPayload, type BotDetailedType, BotListContract, type BotListStateHuman, BotPermissions, BotsService, type BoundedOracleStateHuman, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, type ClaimFarmRewardsProps, type CloseCreditAccountResult, type ClosePathBalances, type CommonResult, CompositePriceFeedContract, type ConnectionOptions, type ContractMethod, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, type CoreStateHuman, type CreditAccountData, type CreditAccountDataSlice, type CreditAccountFilter, type CreditAccountServiceOptions, CreditAccountsService, type CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV300Contract, CreditConfiguratorV310Contract, type CreditFacadeState, type CreditFacadeStateHuman, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, type CreditFactoryStateHuman, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerState, type CreditManagerStateHuman, CreditManagerV300Contract, CreditManagerV310Contract, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, type CurvePoolStruct, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, DaiUsdsAdapterContract, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GEARBOX_MULTISIG, GEARBOX_RISK_CURATORS, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStakingDataPayload, GaugeStakingService, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IAddressProviderContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, type IPriceOracleContract, type LPPriceFeedStateHuman, LinearModelContract, type LinearModelStateHuman, type LiquidationBotType, type LogFn, MAX_UINT16, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, MellowVaultAdapterContract, type MultiCall, type MultiVote, 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 PartialPriceFeedTreeNode, type PathOption, type PathOptionSerie, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, type PermitResult, 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, type PriceOracleData, PriceOracleV300Contract, PriceOracleV310Contract, type PriceOracleV3StateHuman, Provider, type QuotaParamsHuman, type QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, type RampEvent, type RateKeeperData, type RawTx, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RouterCloseResult, type RouterHooks, type RouterResult, RouterV3Contract, SDKConstruct, type SDKHooks, type SDKOptions, SUPPORTED_CHAINS, type SendRawTxParameters, StakingRewardsAdapterContract, type SwapOperation, type SwapTask, type SyncStateOptions, TIMELOCK, type TVL, type TokenMetaData, TokensMeta, type TransportOptions, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, type UpdatePriceFeedsResult, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WETH, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, type ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, aaveV2WrapperAbi, accountFactoryV3Abi, aclAbi, aclNonReentrantTraitAbi, assetsMap, auraDepositorAbi, auraPathResolverAbi, auraWithdrawerAbi, balancerLpDepositorAbi, balancerLpPathResolverAbi, balancerLpWithdrawerAbi, balancerSwapperAbi, balancerV2VaultAdapterAbi, balancesMap, batchLiquidationEstimatorAbi, batchesChainAbi, botListV3Abi, botPermissionsToString, boundedPriceFeedAbi, bptStablePriceFeedAbi, bptWeightedPriceFeedAbi, bytes32ToString, camelotV3AdapterAbi, camelotV3SwapperAbi, chainlinkReadableAggregatorAbi, chains, childLogger, closePathResolverAbi, compositePriceFeedAbi, compoundV2WrapperAbi, contractsRegisterAbi, controllerTimelockV3Abi, convexDepositorAbi, convexPathResolverAbi, convexV1BaseRewardPoolAdapterAbi, convexV1BoosterAdapterAbi, convexWithdrawerAbi, createAdapter, createRawTx, createTransport, creditConfiguratorV3Abi, creditFacadeV3Abi, creditManagerV3Abi, creditManagerV3UsdtAbi, curveCryptoLpPriceFeedAbi, curveLpDepositorAbi, curveLpPathResolverAbi, curveLpWithdrawerAbi, curveStableLpPriceFeedAbi, curveSwapperAbi, curveUsdPriceFeedAbi, curveV1Adapter2AssetsAbi, curveV1Adapter3AssetsAbi, curveV1Adapter4AssetsAbi, curveV1AdapterDepositAbi, curveV1AdapterStEthAbi, curveV1AdapterStableNgAbi, dataCompressorV3Abi, degenDistributorV3Abi, degenNftv2Abi, detectChain, detectNetwork, erc20Abi, erc4626AdapterAbi, erc4626DepositorAbi, erc4626PathResolverAbi, erc4626PriceFeedAbi, erc4626WithdrawerAbi, errorAbis, etherscanUrl, faucetAbi, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, gaugeV3Abi, gearStakingV3Abi, getAddressProvider, halfRAY, iAdapterAbi, iAddressProviderV3Abi, iAddressProviderV3_1Abi, iArbTokenAbi, iBalancerStablePoolAbi, iBalancerWeightedPoolAbi, iCamelotV3QuoterAbi, iCreditAccountCompressorAbi, iCreditConfiguratorV310Abi, iCreditFacadeV2Abi, iCreditFacadeV2EventsAbi, iCreditFacadeV2ExceptionsAbi, iCreditFacadeV2ExtendedAbi, iCreditFacadeV2V2Abi, iCreditFacadeV310Abi, iCreditFacadeV310MulticallAbi, iCreditFacadeV3Abi, iCreditFacadeV3EventsAbi, iCreditFacadeV3MulticallAbi, iCreditManagerV310Abi, iCurvePoolAbi, iDaiUsdsAdapterAbi, iDegenNftv2Abi, iDegenNftv2EventsAbi, iDegenNftv2ExceptionsAbi, iExceptionsAbi, iLegacyMintableErc20Abi, iMarketCompressorAbi, iMarketConfiguratorV310Abi, iMellowVaultAbi, iMellowVaultAdapterAbi, iOptimismMintableErc20Abi, iPendleRouterAdapterAbi, iPoolV3Abi, iPoolV3EventsAbi, iPriceFeedAbi, iPriceFeedCompressorAbi, iPriceOracleV310Abi, iPriceOracleV3Abi, iPriceOracleV3EventsAbi, iRedstoneErrorsAbi, iRedstonePriceFeedEventsAbi, iRedstonePriceFeedExceptionsAbi, iRouterV3ErrorsAbi, iStakingRewardsAdapterAbi, iUpdatablePriceFeedAbi, iVersionAbi, iZapperAbi, ierc20Abi, ierc20MetadataAbi, ilpPriceFeedAbi, ilpPriceFeedEventsAbi, ilpPriceFeedExceptionsAbi, inflationAttackBlockerAbi, insolvencyCheckerAbi, iwstEthAbi, iyVaultAbi, json_parse, json_stringify, lidoSwapperAbi, lidoV1AdapterAbi, linearInterestRateModelV3Abi, mellowLrtPriceFeedAbi, multiPauseAbi, numberWithCommas, overrideAggregatorAbi, partialLiquidationBotV3Abi, pendleTWAPPTPriceFeedAbi, percentFmt, poolQuotaKeeperV3Abi, poolV3Abi, poolV3UsdtAbi, priceFeedMultiplierAbi, priceOracleV3Abi, rawTxToMulticallPriceUpdate, redstonePriceFeedAbi, routerV3Abi, sendRawTx, simulateMulticall, susdeOverriderAbi, swapAggregatorAbi, toHumanFormat, tokenStealerAbi, tokenToTicker, underlyingDepositZapperAbi, underlyingFarmingZapperAbi, uniswapV2AdapterAbi, uniswapV2SwapperAbi, uniswapV3AdapterAbi, uniswapV3SwapperAbi, velodromeV2RouterAdapterAbi, velodromeV2SwapperAbi, wethDepositZapperAbi, wethFarmingZapperAbi, wrapAggregatorAbi, wstEthPriceFeedAbi, wstEthSwapperAbi, wstEthv1AdapterAbi, yearnDepositorAbi, yearnPathResolverAbi, yearnPriceFeedAbi, yearnV2AdapterAbi, yearnWithdrawerAbi, zapperRegisterAbi, zeroPriceFeedAbi };
92272
+ export { ADDRESS_0X0, ADDRESS_PROVIDER, ADDRESS_PROVIDER_BLOCK, 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, AddressProviderContractV3_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, type BalancerWeightedPriceFeedStateHuman, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, type BotAddresses, type BotBaseType, type BotDataPayload, type BotDetailedType, BotListContract, type BotListStateHuman, BotPermissions, BotsService, type BoundedOracleStateHuman, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, type ClaimFarmRewardsProps, type CloseCreditAccountResult, type ClosePathBalances, type CommonResult, CompositePriceFeedContract, type ConnectionOptions, type ContractMethod, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, type CoreStateHuman, type CreditAccountData, type CreditAccountDataSlice, type CreditAccountFilter, type CreditAccountServiceOptions, CreditAccountsService, type CreditConfiguratorState, type CreditConfiguratorStateHuman, CreditConfiguratorV300Contract, CreditConfiguratorV310Contract, type CreditFacadeState, type CreditFacadeStateHuman, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, type CreditFactoryStateHuman, type CreditManagerData, type CreditManagerDebtParams, type CreditManagerDebtParamsHuman, type CreditManagerState, type CreditManagerStateHuman, CreditManagerV300Contract, CreditManagerV310Contract, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, type CurvePoolStruct, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, DaiUsdsAdapterContract, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GEARBOX_MULTISIG, GEARBOX_RISK_CURATORS, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStakingDataPayload, GaugeStakingService, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IAddressProviderContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, type IPriceOracleContract, type LPPriceFeedStateHuman, LinearModelContract, type LinearModelStateHuman, type LiquidationBotType, type LogFn, MAX_UINT16, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, MellowVaultAdapterContract, type MultiCall, type MultiVote, 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 PartialPriceFeedTreeNode, type PathOption, type PathOptionSerie, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, type PermitResult, 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, type PriceOracleData, PriceOracleV300Contract, PriceOracleV310Contract, type PriceOracleV3StateHuman, Provider, type QuotaParamsHuman, type QuotaState, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, type RampEvent, type RateKeeperData, type RawTx, RedstonePriceFeedContract, type RedstonePriceFeedStateHuman, type RouterCloseResult, type RouterHooks, type RouterResult, RouterV3Contract, SDKConstruct, type SDKHooks, type SDKOptions, SUPPORTED_CHAINS, type SendRawTxParameters, StakingRewardsAdapterContract, type SwapOperation, type SwapTask, type SyncStateOptions, TIMELOCK, type TVL, type TokenMetaData, TokensMeta, type TransportOptions, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, type UpdatePriceFeedsResult, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WETH, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, type ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, aaveV2WrapperAbi, accountFactoryV3Abi, aclAbi, aclNonReentrantTraitAbi, assetsMap, auraDepositorAbi, auraPathResolverAbi, auraWithdrawerAbi, balancerLpDepositorAbi, balancerLpPathResolverAbi, balancerLpWithdrawerAbi, balancerSwapperAbi, balancerV2VaultAdapterAbi, balancesMap, batchLiquidationEstimatorAbi, batchesChainAbi, botListV3Abi, botPermissionsToString, boundedPriceFeedAbi, bptStablePriceFeedAbi, bptWeightedPriceFeedAbi, bytes32ToString, camelotV3AdapterAbi, camelotV3SwapperAbi, chainlinkReadableAggregatorAbi, chains, childLogger, closePathResolverAbi, compositePriceFeedAbi, compoundV2WrapperAbi, contractsRegisterAbi, controllerTimelockV3Abi, convexDepositorAbi, convexPathResolverAbi, convexV1BaseRewardPoolAdapterAbi, convexV1BoosterAdapterAbi, convexWithdrawerAbi, createAdapter, createRawTx, createTransport, creditConfiguratorV3Abi, creditFacadeV3Abi, creditManagerV3Abi, creditManagerV3UsdtAbi, curveCryptoLpPriceFeedAbi, curveLpDepositorAbi, curveLpPathResolverAbi, curveLpWithdrawerAbi, curveStableLpPriceFeedAbi, curveSwapperAbi, curveUsdPriceFeedAbi, curveV1Adapter2AssetsAbi, curveV1Adapter3AssetsAbi, curveV1Adapter4AssetsAbi, curveV1AdapterDepositAbi, curveV1AdapterStEthAbi, curveV1AdapterStableNgAbi, dataCompressorV3Abi, degenDistributorV3Abi, degenNftv2Abi, detectChain, detectNetwork, erc20Abi, erc4626AdapterAbi, erc4626DepositorAbi, erc4626PathResolverAbi, erc4626PriceFeedAbi, erc4626WithdrawerAbi, errorAbis, etherscanUrl, faucetAbi, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, gaugeV3Abi, gearStakingV3Abi, getAddressProvider, halfRAY, iAdapterAbi, iAddressProviderV3Abi, iAddressProviderV3_1Abi, iArbTokenAbi, iBalancerStablePoolAbi, iBalancerWeightedPoolAbi, iCamelotV3QuoterAbi, iCreditAccountCompressorAbi, iCreditConfiguratorV310Abi, iCreditFacadeV2Abi, iCreditFacadeV2EventsAbi, iCreditFacadeV2ExceptionsAbi, iCreditFacadeV2ExtendedAbi, iCreditFacadeV2V2Abi, iCreditFacadeV310Abi, iCreditFacadeV310MulticallAbi, iCreditFacadeV3Abi, iCreditFacadeV3EventsAbi, iCreditFacadeV3MulticallAbi, iCreditManagerV310Abi, iCurvePoolAbi, iDaiUsdsAdapterAbi, iDegenNftv2Abi, iDegenNftv2EventsAbi, iDegenNftv2ExceptionsAbi, iExceptionsAbi, iLegacyMintableErc20Abi, iMarketCompressorAbi, iMarketConfiguratorV310Abi, iMellowVaultAbi, iMellowVaultAdapterAbi, iOptimismMintableErc20Abi, iPendleRouterAdapterAbi, iPoolV3Abi, iPoolV3EventsAbi, iPriceFeedAbi, iPriceFeedCompressorAbi, iPriceOracleV310Abi, iPriceOracleV3Abi, iPriceOracleV3EventsAbi, iRedstoneErrorsAbi, iRedstonePriceFeedEventsAbi, iRedstonePriceFeedExceptionsAbi, iRouterV3ErrorsAbi, iStakingRewardsAdapterAbi, iSwapperAbi, iUpdatablePriceFeedAbi, iVersionAbi, iZapperAbi, ierc20Abi, ierc20MetadataAbi, ilpPriceFeedAbi, ilpPriceFeedEventsAbi, ilpPriceFeedExceptionsAbi, inflationAttackBlockerAbi, insolvencyCheckerAbi, iwstEthAbi, iyVaultAbi, json_parse, json_stringify, lidoSwapperAbi, lidoV1AdapterAbi, linearInterestRateModelV3Abi, mellowLrtPriceFeedAbi, multiPauseAbi, numberWithCommas, overrideAggregatorAbi, partialLiquidationBotV3Abi, pendleTWAPPTPriceFeedAbi, percentFmt, poolQuotaKeeperV3Abi, poolV3Abi, poolV3UsdtAbi, priceFeedMultiplierAbi, priceOracleV3Abi, rawTxToMulticallPriceUpdate, redstonePriceFeedAbi, routerV3Abi, sendRawTx, simulateMulticall, susdeOverriderAbi, swapAggregatorAbi, toHumanFormat, tokenStealerAbi, tokenToTicker, underlyingDepositZapperAbi, underlyingFarmingZapperAbi, uniswapV2AdapterAbi, uniswapV2SwapperAbi, uniswapV3AdapterAbi, uniswapV3SwapperAbi, velodromeV2RouterAdapterAbi, velodromeV2SwapperAbi, wethDepositZapperAbi, wethFarmingZapperAbi, wrapAggregatorAbi, wstEthPriceFeedAbi, wstEthSwapperAbi, wstEthv1AdapterAbi, yearnDepositorAbi, yearnPathResolverAbi, yearnPriceFeedAbi, yearnV2AdapterAbi, yearnWithdrawerAbi, zapperRegisterAbi, zeroPriceFeedAbi };
@@ -51782,6 +51782,124 @@ var yearnWithdrawerAbi = [
51782
51782
  name: "UnknownToken"
51783
51783
  }
51784
51784
  ];
51785
+ var iSwapperAbi = [
51786
+ {
51787
+ type: "function",
51788
+ name: "getBestDirectPairSwap",
51789
+ inputs: [
51790
+ {
51791
+ name: "swapTask",
51792
+ type: "tuple",
51793
+ internalType: "struct SwapTask",
51794
+ components: [
51795
+ {
51796
+ name: "swapOperation",
51797
+ type: "uint8",
51798
+ internalType: "enum SwapOperation"
51799
+ },
51800
+ {
51801
+ name: "creditAccount",
51802
+ type: "address",
51803
+ internalType: "address"
51804
+ },
51805
+ {
51806
+ name: "tokenIn",
51807
+ type: "address",
51808
+ internalType: "address"
51809
+ },
51810
+ {
51811
+ name: "tokenOut",
51812
+ type: "address",
51813
+ internalType: "address"
51814
+ },
51815
+ {
51816
+ name: "connectors",
51817
+ type: "address[]",
51818
+ internalType: "address[]"
51819
+ },
51820
+ {
51821
+ name: "amount",
51822
+ type: "uint256",
51823
+ internalType: "uint256"
51824
+ },
51825
+ {
51826
+ name: "leftoverAmount",
51827
+ type: "uint256",
51828
+ internalType: "uint256"
51829
+ }
51830
+ ]
51831
+ },
51832
+ {
51833
+ name: "adapter",
51834
+ type: "address",
51835
+ internalType: "address"
51836
+ }
51837
+ ],
51838
+ outputs: [
51839
+ {
51840
+ name: "quote",
51841
+ type: "tuple",
51842
+ internalType: "struct SwapQuote",
51843
+ components: [
51844
+ {
51845
+ name: "multiCall",
51846
+ type: "tuple",
51847
+ internalType: "struct MultiCall",
51848
+ components: [
51849
+ {
51850
+ name: "target",
51851
+ type: "address",
51852
+ internalType: "address"
51853
+ },
51854
+ {
51855
+ name: "callData",
51856
+ type: "bytes",
51857
+ internalType: "bytes"
51858
+ }
51859
+ ]
51860
+ },
51861
+ {
51862
+ name: "amount",
51863
+ type: "uint256",
51864
+ internalType: "uint256"
51865
+ },
51866
+ {
51867
+ name: "found",
51868
+ type: "bool",
51869
+ internalType: "bool"
51870
+ }
51871
+ ]
51872
+ }
51873
+ ],
51874
+ stateMutability: "nonpayable"
51875
+ },
51876
+ {
51877
+ type: "function",
51878
+ name: "getComponentId",
51879
+ inputs: [],
51880
+ outputs: [
51881
+ {
51882
+ name: "",
51883
+ type: "uint8",
51884
+ internalType: "uint8"
51885
+ }
51886
+ ],
51887
+ stateMutability: "view"
51888
+ },
51889
+ {
51890
+ type: "function",
51891
+ name: "version",
51892
+ inputs: [],
51893
+ outputs: [
51894
+ {
51895
+ name: "",
51896
+ type: "uint256",
51897
+ internalType: "uint256"
51898
+ }
51899
+ ],
51900
+ stateMutability: "view"
51901
+ }
51902
+ ];
51785
51903
 
51786
51904
  // src/sdk/abi/v310.ts
51787
51905
  var iAddressProviderV3_1Abi = [
@@ -64940,6 +65058,13 @@ var SWAP_OPERATIONS = {
64940
65058
  EXACT_INPUT_ALL: 1,
64941
65059
  EXACT_OUTPUT: 2
64942
65060
  };
65061
+ var PT_IN = {
65062
+ ["0xEe9085fC268F6727d5D4293dBABccF901ffDCC29".toLowerCase()]: "PT_sUSDe_26DEC2024",
65063
+ ["0xE00bd3Df25fb187d6ABBB620b3dfd19839947b81".toLowerCase()]: "PT_sUSDe_27MAR20251"
65064
+ };
65065
+ var OUT = {
65066
+ ["0x9D39A5DE30e57443BfF2A8307A4256c8797A3497".toLowerCase()]: "sUSDe"
65067
+ };
64943
65068
  var RouterV3Contract = class extends BaseContract {
64944
65069
  #connectors;
64945
65070
  #hooks = new Hooks();
@@ -65012,34 +65137,98 @@ var RouterV3Contract = class extends BaseContract {
65012
65137
  * @param slippage
65013
65138
  * @returns
65014
65139
  */
65015
- async findOneTokenPath({
65016
- creditAccount: ca,
65017
- creditManager: cm,
65018
- tokenIn,
65019
- tokenOut,
65020
- amount,
65021
- slippage
65022
- }) {
65023
- const connectors2 = this.getAvailableConnectors(cm.collateralTokens);
65024
- const { result } = await this.contract.simulate.findOneTokenPath(
65140
+ async findOneTokenPath(props) {
65141
+ const {
65142
+ creditAccount,
65143
+ creditManager,
65144
+ tokenIn,
65145
+ tokenOut,
65146
+ amount,
65147
+ slippage
65148
+ } = props;
65149
+ const connectors2 = this.getAvailableConnectors(
65150
+ creditManager.collateralTokens
65151
+ );
65152
+ const isPTOverrideRedeem = PT_IN[tokenIn.toLowerCase()] && OUT[tokenOut.toLowerCase()];
65153
+ const { result } = await (isPTOverrideRedeem ? this.overridePTRedeem(props) : this.contract.simulate.findOneTokenPath(
65025
65154
  [
65026
65155
  tokenIn,
65027
65156
  amount,
65028
65157
  tokenOut,
65029
- ca.creditAccount,
65158
+ creditAccount.creditAccount,
65030
65159
  connectors2,
65031
65160
  BigInt(slippage)
65032
65161
  ],
65033
65162
  {
65034
65163
  gas: GAS_PER_BLOCK
65035
65164
  }
65036
- );
65165
+ ));
65037
65166
  return {
65038
65167
  amount: result.amount,
65039
65168
  minAmount: result.minAmount,
65040
65169
  calls: [...result.calls]
65041
65170
  };
65042
65171
  }
65172
+ async overridePTRedeem({
65173
+ creditAccount,
65174
+ creditManager,
65175
+ tokenIn,
65176
+ tokenOut,
65177
+ amount,
65178
+ slippage
65179
+ }) {
65180
+ const pendleSwapperAddress = await this.contract.read.componentAddressById([
65181
+ 37
65182
+ ]);
65183
+ const cm = this.sdk.marketRegister.findCreditManager(creditManager.address);
65184
+ const pendleRouter = contractsByNetwork[this.sdk.provider.networkType].PENDLE_ROUTER;
65185
+ const pendleAdapter = cm.creditManager.adapters.mustGet(pendleRouter);
65186
+ const pendleSwapper = getContract({
65187
+ address: pendleSwapperAddress,
65188
+ abi: iSwapperAbi,
65189
+ client: this.sdk.provider.publicClient
65190
+ });
65191
+ const result = await pendleSwapper.simulate.getBestDirectPairSwap([
65192
+ {
65193
+ swapOperation: 1,
65194
+ creditAccount: creditAccount.creditAccount,
65195
+ tokenIn,
65196
+ tokenOut,
65197
+ connectors: [],
65198
+ amount,
65199
+ leftoverAmount: 0n
65200
+ },
65201
+ pendleAdapter.address
65202
+ ]);
65203
+ const minAmount = result.result.amount * (PERCENTAGE_FACTOR - BigInt(slippage)) / PERCENTAGE_FACTOR;
65204
+ const storeExpectedBalances = {
65205
+ target: creditManager.creditFacade,
65206
+ callData: encodeFunctionData({
65207
+ abi: iCreditFacadeV3MulticallAbi,
65208
+ functionName: "storeExpectedBalances",
65209
+ args: [[{ token: tokenOut, amount: minAmount }]]
65210
+ })
65211
+ };
65212
+ const compareBalances = {
65213
+ target: creditManager.creditFacade,
65214
+ callData: encodeFunctionData({
65215
+ abi: iCreditFacadeV3MulticallAbi,
65216
+ functionName: "compareBalances",
65217
+ args: []
65218
+ })
65219
+ };
65220
+ return {
65221
+ result: {
65222
+ amount: result.result.amount,
65223
+ minAmount,
65224
+ calls: [
65225
+ storeExpectedBalances,
65226
+ result.result.multiCall,
65227
+ compareBalances
65228
+ ]
65229
+ }
65230
+ };
65231
+ }
65043
65232
  /**
65044
65233
  * @dev Finds the best path for opening Credit Account and converting all NORMAL tokens and LP token in the way to TARGET
65045
65234
  * @param creditManager CreditManagerData which represents credit manager you want to use to open Credit Account
@@ -66689,4 +66878,4 @@ var GearboxSDK = class _GearboxSDK {
66689
66878
  }
66690
66879
  };
66691
66880
 
66692
- export { ADDRESS_0X0, ADDRESS_PROVIDER, ADDRESS_PROVIDER_BLOCK, 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, AddressProviderContractV3_1, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, BotListContract, BotPermissions, BotsService, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditAccountsService, CreditConfiguratorV300Contract, CreditConfiguratorV310Contract, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, CreditManagerV300Contract, CreditManagerV310Contract, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, DaiUsdsAdapterContract, ERC4626AdapterContract, Erc4626PriceFeedContract, GEARBOX_MULTISIG, GEARBOX_RISK_CURATORS, GaugeContract, GaugeStakingService, GearStakingContract, GearboxSDK, LinearModelContract, MAX_UINT16, MAX_UINT256, MIN_INT96, MarketFactory, MarketRegister, MellowLRTPriceFeedContract, MellowVaultAdapterContract, NOT_DEPLOYED, NO_VERSION, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PRICE_DECIMALS, PRICE_DECIMALS_POW, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PoolContract, PoolFactory, PoolQuotaKeeperContract, PriceFeedRef, PriceFeedRegister, PriceOracleV300Contract, PriceOracleV310Contract, Provider, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RedstonePriceFeedContract, RouterV3Contract, SDKConstruct, SUPPORTED_CHAINS, StakingRewardsAdapterContract, TIMELOCK, TokensMeta, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WETH, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, ZeroPriceFeedContract, aaveV2WrapperAbi, accountFactoryV3Abi, aclAbi, aclNonReentrantTraitAbi, assetsMap, auraDepositorAbi, auraPathResolverAbi, auraWithdrawerAbi, balancerLpDepositorAbi, balancerLpPathResolverAbi, balancerLpWithdrawerAbi, balancerSwapperAbi, balancerV2VaultAdapterAbi, balancesMap, batchLiquidationEstimatorAbi, batchesChainAbi, botListV3Abi, botPermissionsToString, boundedPriceFeedAbi, bptStablePriceFeedAbi, bptWeightedPriceFeedAbi, bytes32ToString, camelotV3AdapterAbi, camelotV3SwapperAbi, chainlinkReadableAggregatorAbi, chains, childLogger, closePathResolverAbi, compositePriceFeedAbi, compoundV2WrapperAbi, contractsRegisterAbi, controllerTimelockV3Abi, convexDepositorAbi, convexPathResolverAbi, convexV1BaseRewardPoolAdapterAbi, convexV1BoosterAdapterAbi, convexWithdrawerAbi, createAdapter, createRawTx, createTransport, creditConfiguratorV3Abi, creditFacadeV3Abi, creditManagerV3Abi, creditManagerV3UsdtAbi, curveCryptoLpPriceFeedAbi, curveLpDepositorAbi, curveLpPathResolverAbi, curveLpWithdrawerAbi, curveStableLpPriceFeedAbi, curveSwapperAbi, curveUsdPriceFeedAbi, curveV1Adapter2AssetsAbi, curveV1Adapter3AssetsAbi, curveV1Adapter4AssetsAbi, curveV1AdapterDepositAbi, curveV1AdapterStEthAbi, curveV1AdapterStableNgAbi, dataCompressorV3Abi, degenDistributorV3Abi, degenNftv2Abi, detectChain, detectNetwork, erc20Abi, erc4626AdapterAbi, erc4626DepositorAbi, erc4626PathResolverAbi, erc4626PriceFeedAbi, erc4626WithdrawerAbi, errorAbis, etherscanUrl, faucetAbi, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, gaugeV3Abi, gearStakingV3Abi, getAddressProvider, halfRAY, iAdapterAbi, iAddressProviderV3Abi, iAddressProviderV3_1Abi, iArbTokenAbi, iBalancerStablePoolAbi, iBalancerWeightedPoolAbi, iCamelotV3QuoterAbi, iCreditAccountCompressorAbi, iCreditConfiguratorV310Abi, iCreditFacadeV2Abi, iCreditFacadeV2EventsAbi, iCreditFacadeV2ExceptionsAbi, iCreditFacadeV2ExtendedAbi, iCreditFacadeV2V2Abi, iCreditFacadeV310Abi, iCreditFacadeV310MulticallAbi, iCreditFacadeV3Abi, iCreditFacadeV3EventsAbi, iCreditFacadeV3MulticallAbi, iCreditManagerV310Abi, iCurvePoolAbi, iDaiUsdsAdapterAbi, iDegenNftv2Abi, iDegenNftv2EventsAbi, iDegenNftv2ExceptionsAbi, iExceptionsAbi, iLegacyMintableErc20Abi, iMarketCompressorAbi, iMarketConfiguratorV310Abi, iMellowVaultAbi, iMellowVaultAdapterAbi, iOptimismMintableErc20Abi, iPendleRouterAdapterAbi, iPoolV3Abi, iPoolV3EventsAbi, iPriceFeedAbi, iPriceFeedCompressorAbi, iPriceOracleV310Abi, iPriceOracleV3Abi, iPriceOracleV3EventsAbi, iRedstoneErrorsAbi, iRedstonePriceFeedEventsAbi, iRedstonePriceFeedExceptionsAbi, iRouterV3ErrorsAbi, iStakingRewardsAdapterAbi, iUpdatablePriceFeedAbi, iVersionAbi, iZapperAbi, ierc20Abi, ierc20MetadataAbi, ilpPriceFeedAbi, ilpPriceFeedEventsAbi, ilpPriceFeedExceptionsAbi, inflationAttackBlockerAbi, insolvencyCheckerAbi, iwstEthAbi, iyVaultAbi, json_parse, json_stringify, lidoSwapperAbi, lidoV1AdapterAbi, linearInterestRateModelV3Abi, mellowLrtPriceFeedAbi, multiPauseAbi, numberWithCommas, overrideAggregatorAbi, partialLiquidationBotV3Abi, pendleTWAPPTPriceFeedAbi, percentFmt, poolQuotaKeeperV3Abi, poolV3Abi, poolV3UsdtAbi, priceFeedMultiplierAbi, priceOracleV3Abi, rawTxToMulticallPriceUpdate, redstonePriceFeedAbi, routerV3Abi, sendRawTx, simulateMulticall, susdeOverriderAbi, swapAggregatorAbi, toHumanFormat, tokenStealerAbi, tokenToTicker, underlyingDepositZapperAbi, underlyingFarmingZapperAbi, uniswapV2AdapterAbi, uniswapV2SwapperAbi, uniswapV3AdapterAbi, uniswapV3SwapperAbi, velodromeV2RouterAdapterAbi, velodromeV2SwapperAbi, wethDepositZapperAbi, wethFarmingZapperAbi, wrapAggregatorAbi, wstEthPriceFeedAbi, wstEthSwapperAbi, wstEthv1AdapterAbi, yearnDepositorAbi, yearnPathResolverAbi, yearnPriceFeedAbi, yearnV2AdapterAbi, yearnWithdrawerAbi, zapperRegisterAbi, zeroPriceFeedAbi };
66881
+ export { ADDRESS_0X0, ADDRESS_PROVIDER, ADDRESS_PROVIDER_BLOCK, 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, AddressProviderContractV3_1, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, BotListContract, BotPermissions, BotsService, BoundedPriceFeedContract, CamelotV3AdapterContract, ChainlinkPriceFeedContract, CompositePriceFeedContract, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, CreditAccountsService, CreditConfiguratorV300Contract, CreditConfiguratorV310Contract, CreditFacadeV300Contract, CreditFacadeV310Contract, CreditFactory, CreditManagerV300Contract, CreditManagerV310Contract, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1AdapterStableNGContract, DaiUsdsAdapterContract, ERC4626AdapterContract, Erc4626PriceFeedContract, GEARBOX_MULTISIG, GEARBOX_RISK_CURATORS, GaugeContract, GaugeStakingService, GearStakingContract, GearboxSDK, LinearModelContract, MAX_UINT16, MAX_UINT256, MIN_INT96, MarketFactory, MarketRegister, MellowLRTPriceFeedContract, MellowVaultAdapterContract, NOT_DEPLOYED, NO_VERSION, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PRICE_DECIMALS, PRICE_DECIMALS_POW, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PoolContract, PoolFactory, PoolQuotaKeeperContract, PriceFeedRef, PriceFeedRegister, PriceOracleV300Contract, PriceOracleV310Contract, Provider, RAMP_DURATION_BY_NETWORK, RAY, RAY_DECIMALS_POW, RedstonePriceFeedContract, RouterV3Contract, SDKConstruct, SUPPORTED_CHAINS, StakingRewardsAdapterContract, TIMELOCK, TokensMeta, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WETH, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, ZeroPriceFeedContract, aaveV2WrapperAbi, accountFactoryV3Abi, aclAbi, aclNonReentrantTraitAbi, assetsMap, auraDepositorAbi, auraPathResolverAbi, auraWithdrawerAbi, balancerLpDepositorAbi, balancerLpPathResolverAbi, balancerLpWithdrawerAbi, balancerSwapperAbi, balancerV2VaultAdapterAbi, balancesMap, batchLiquidationEstimatorAbi, batchesChainAbi, botListV3Abi, botPermissionsToString, boundedPriceFeedAbi, bptStablePriceFeedAbi, bptWeightedPriceFeedAbi, bytes32ToString, camelotV3AdapterAbi, camelotV3SwapperAbi, chainlinkReadableAggregatorAbi, chains, childLogger, closePathResolverAbi, compositePriceFeedAbi, compoundV2WrapperAbi, contractsRegisterAbi, controllerTimelockV3Abi, convexDepositorAbi, convexPathResolverAbi, convexV1BaseRewardPoolAdapterAbi, convexV1BoosterAdapterAbi, convexWithdrawerAbi, createAdapter, createRawTx, createTransport, creditConfiguratorV3Abi, creditFacadeV3Abi, creditManagerV3Abi, creditManagerV3UsdtAbi, curveCryptoLpPriceFeedAbi, curveLpDepositorAbi, curveLpPathResolverAbi, curveLpWithdrawerAbi, curveStableLpPriceFeedAbi, curveSwapperAbi, curveUsdPriceFeedAbi, curveV1Adapter2AssetsAbi, curveV1Adapter3AssetsAbi, curveV1Adapter4AssetsAbi, curveV1AdapterDepositAbi, curveV1AdapterStEthAbi, curveV1AdapterStableNgAbi, dataCompressorV3Abi, degenDistributorV3Abi, degenNftv2Abi, detectChain, detectNetwork, erc20Abi, erc4626AdapterAbi, erc4626DepositorAbi, erc4626PathResolverAbi, erc4626PriceFeedAbi, erc4626WithdrawerAbi, errorAbis, etherscanUrl, faucetAbi, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, gaugeV3Abi, gearStakingV3Abi, getAddressProvider, halfRAY, iAdapterAbi, iAddressProviderV3Abi, iAddressProviderV3_1Abi, iArbTokenAbi, iBalancerStablePoolAbi, iBalancerWeightedPoolAbi, iCamelotV3QuoterAbi, iCreditAccountCompressorAbi, iCreditConfiguratorV310Abi, iCreditFacadeV2Abi, iCreditFacadeV2EventsAbi, iCreditFacadeV2ExceptionsAbi, iCreditFacadeV2ExtendedAbi, iCreditFacadeV2V2Abi, iCreditFacadeV310Abi, iCreditFacadeV310MulticallAbi, iCreditFacadeV3Abi, iCreditFacadeV3EventsAbi, iCreditFacadeV3MulticallAbi, iCreditManagerV310Abi, iCurvePoolAbi, iDaiUsdsAdapterAbi, iDegenNftv2Abi, iDegenNftv2EventsAbi, iDegenNftv2ExceptionsAbi, iExceptionsAbi, iLegacyMintableErc20Abi, iMarketCompressorAbi, iMarketConfiguratorV310Abi, iMellowVaultAbi, iMellowVaultAdapterAbi, iOptimismMintableErc20Abi, iPendleRouterAdapterAbi, iPoolV3Abi, iPoolV3EventsAbi, iPriceFeedAbi, iPriceFeedCompressorAbi, iPriceOracleV310Abi, iPriceOracleV3Abi, iPriceOracleV3EventsAbi, iRedstoneErrorsAbi, iRedstonePriceFeedEventsAbi, iRedstonePriceFeedExceptionsAbi, iRouterV3ErrorsAbi, iStakingRewardsAdapterAbi, iSwapperAbi, iUpdatablePriceFeedAbi, iVersionAbi, iZapperAbi, ierc20Abi, ierc20MetadataAbi, ilpPriceFeedAbi, ilpPriceFeedEventsAbi, ilpPriceFeedExceptionsAbi, inflationAttackBlockerAbi, insolvencyCheckerAbi, iwstEthAbi, iyVaultAbi, json_parse, json_stringify, lidoSwapperAbi, lidoV1AdapterAbi, linearInterestRateModelV3Abi, mellowLrtPriceFeedAbi, multiPauseAbi, numberWithCommas, overrideAggregatorAbi, partialLiquidationBotV3Abi, pendleTWAPPTPriceFeedAbi, percentFmt, poolQuotaKeeperV3Abi, poolV3Abi, poolV3UsdtAbi, priceFeedMultiplierAbi, priceOracleV3Abi, rawTxToMulticallPriceUpdate, redstonePriceFeedAbi, routerV3Abi, sendRawTx, simulateMulticall, susdeOverriderAbi, swapAggregatorAbi, toHumanFormat, tokenStealerAbi, tokenToTicker, underlyingDepositZapperAbi, underlyingFarmingZapperAbi, uniswapV2AdapterAbi, uniswapV2SwapperAbi, uniswapV3AdapterAbi, uniswapV3SwapperAbi, velodromeV2RouterAdapterAbi, velodromeV2SwapperAbi, wethDepositZapperAbi, wethFarmingZapperAbi, wrapAggregatorAbi, wstEthPriceFeedAbi, wstEthSwapperAbi, wstEthv1AdapterAbi, yearnDepositorAbi, yearnPathResolverAbi, yearnPriceFeedAbi, yearnV2AdapterAbi, yearnWithdrawerAbi, zapperRegisterAbi, zeroPriceFeedAbi };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "3.0.0-vfour.140",
3
+ "version": "3.0.0-vfour.141",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.cjs",