@gearbox-protocol/sdk 3.0.0-vfour.103 → 3.0.0-vfour.105

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.
@@ -25787,7 +25787,7 @@ var CreditAccountsService = class extends SDKConstruct {
25787
25787
  to,
25788
25788
  calls
25789
25789
  );
25790
- return { tx, calls, routerCloseResult };
25790
+ return { tx, calls, routerCloseResult, creditFacade: cm.creditFacade };
25791
25791
  }
25792
25792
  /**
25793
25793
  * Closes credit account or sets debt to zero (but keep account)
@@ -25823,7 +25823,7 @@ var CreditAccountsService = class extends SDKConstruct {
25823
25823
  )
25824
25824
  ];
25825
25825
  const tx = operation === "close" ? cm.creditFacade.closeCreditAccount(ca.creditAccount, calls) : cm.creditFacade.multicall(ca.creditAccount, calls);
25826
- return { tx, calls, routerCloseResult };
25826
+ return { tx, calls, routerCloseResult, creditFacade: cm.creditFacade };
25827
25827
  }
25828
25828
  /**
25829
25829
  * Repays credit account or sets debt to zero (but keep account)
@@ -25857,7 +25857,7 @@ var CreditAccountsService = class extends SDKConstruct {
25857
25857
  )
25858
25858
  ];
25859
25859
  const tx = operation === "close" ? cm.creditFacade.closeCreditAccount(ca.creditAccount, calls) : cm.creditFacade.multicall(ca.creditAccount, calls);
25860
- return { tx, calls };
25860
+ return { tx, calls, creditFacade: cm.creditFacade };
25861
25861
  }
25862
25862
  /**
25863
25863
  * Repays liquidatable credit account
@@ -25894,7 +25894,7 @@ var CreditAccountsService = class extends SDKConstruct {
25894
25894
  to,
25895
25895
  calls
25896
25896
  );
25897
- return { tx, calls };
25897
+ return { tx, calls, creditFacade: cm.creditFacade };
25898
25898
  }
25899
25899
  async updateQuotas(props) {
25900
25900
  const { creditAccount } = props;
@@ -25914,10 +25914,7 @@ var CreditAccountsService = class extends SDKConstruct {
25914
25914
  ...priceUpdates,
25915
25915
  ...this.#prepareUpdateQuotas(props.creditAccount.creditFacade, props)
25916
25916
  ]);
25917
- return {
25918
- tx,
25919
- calls
25920
- };
25917
+ return { tx, calls, creditFacade: cm.creditFacade };
25921
25918
  }
25922
25919
  async addCollateral(props) {
25923
25920
  const { creditAccount, asset, permit, ethAmount } = props;
@@ -25940,7 +25937,7 @@ var CreditAccountsService = class extends SDKConstruct {
25940
25937
  ];
25941
25938
  const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
25942
25939
  tx.value = ethAmount.toString(10);
25943
- return { tx, calls };
25940
+ return { tx, calls, creditFacade: cm.creditFacade };
25944
25941
  }
25945
25942
  async changeDebt({
25946
25943
  creditAccount,
@@ -25969,7 +25966,7 @@ var CreditAccountsService = class extends SDKConstruct {
25969
25966
  this.#prepareChangeDebt(creditAccount.creditFacade, change, isDecrease)
25970
25967
  ];
25971
25968
  const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
25972
- return { tx, calls };
25969
+ return { tx, calls, creditFacade: cm.creditFacade };
25973
25970
  }
25974
25971
  async withdrawCollateral(props) {
25975
25972
  const { creditAccount, assetsToWithdraw, to } = props;
@@ -25994,7 +25991,7 @@ var CreditAccountsService = class extends SDKConstruct {
25994
25991
  ...this.#prepareUpdateQuotas(creditAccount.creditFacade, props)
25995
25992
  ];
25996
25993
  const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
25997
- return { tx, calls };
25994
+ return { tx, calls, creditFacade: cm.creditFacade };
25998
25995
  }
25999
25996
  async executeSwap(props) {
26000
25997
  const { creditAccount, calls: swapCalls } = props;
@@ -26013,7 +26010,7 @@ var CreditAccountsService = class extends SDKConstruct {
26013
26010
  ...this.#prepareUpdateQuotas(creditAccount.creditFacade, props)
26014
26011
  ];
26015
26012
  const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
26016
- return { tx, calls };
26013
+ return { tx, calls, creditFacade: cm.creditFacade };
26017
26014
  }
26018
26015
  async claimFarmRewards(props) {
26019
26016
  const { tokensToDisable, calls: claimCalls, creditAccount: ca } = props;
@@ -26033,7 +26030,7 @@ var CreditAccountsService = class extends SDKConstruct {
26033
26030
  ...this.#prepareUpdateQuotas(ca.creditFacade, props)
26034
26031
  ];
26035
26032
  const tx = cm.creditFacade.multicall(ca.creditAccount, calls);
26036
- return { tx, calls };
26033
+ return { tx, calls, creditFacade: cm.creditFacade };
26037
26034
  }
26038
26035
  async openCA(props) {
26039
26036
  const {
@@ -26068,10 +26065,7 @@ var CreditAccountsService = class extends SDKConstruct {
26068
26065
  referralCode
26069
26066
  );
26070
26067
  tx.value = ethAmount.toString(10);
26071
- return {
26072
- calls,
26073
- tx
26074
- };
26068
+ return { calls, tx, creditFacade: cmFactory.creditFacade };
26075
26069
  }
26076
26070
  /**
26077
26071
  * Internal wrapper for CreditAccountCompressor.getCreditAccounts + price updates wrapped into multicall
@@ -26555,6 +26549,36 @@ var GearStakingContract = class extends BaseContract {
26555
26549
  migrator: this.labelAddress(ADDRESS_0X0)
26556
26550
  };
26557
26551
  }
26552
+ deposit(amount, votes) {
26553
+ return this.createRawTx({
26554
+ functionName: "deposit",
26555
+ args: [amount, votes]
26556
+ });
26557
+ }
26558
+ depositWithPermit(amount, votes, permit) {
26559
+ return this.createRawTx({
26560
+ functionName: "depositWithPermit",
26561
+ args: [amount, votes, permit.deadline, permit.v, permit.r, permit.s]
26562
+ });
26563
+ }
26564
+ withdraw(amount, to, votes) {
26565
+ return this.createRawTx({
26566
+ functionName: "withdraw",
26567
+ args: [amount, to, votes]
26568
+ });
26569
+ }
26570
+ claimWithdrawals(to) {
26571
+ return this.createRawTx({
26572
+ functionName: "claimWithdrawals",
26573
+ args: [to]
26574
+ });
26575
+ }
26576
+ multivote(votes) {
26577
+ return this.createRawTx({
26578
+ functionName: "multivote",
26579
+ args: [votes]
26580
+ });
26581
+ }
26558
26582
  };
26559
26583
  var GearboxSDK = class _GearboxSDK {
26560
26584
  #hooks = new Hooks();
@@ -30096,10 +30096,21 @@ declare class BotListContract extends BaseContract<abi$2> {
30096
30096
  }
30097
30097
 
30098
30098
  type abi$1 = typeof gearStakingV3Abi;
30099
+ interface MultiVote {
30100
+ votingContract: Address;
30101
+ voteAmount: bigint;
30102
+ isIncrease: boolean;
30103
+ extraData: Address;
30104
+ }
30099
30105
  declare class GearStakingContract extends BaseContract<abi$1> {
30100
30106
  constructor(sdk: GearboxSDK, address: Address);
30101
30107
  parseFunctionParams(params: DecodeFunctionDataReturnType<abi$1>): Array<string> | undefined;
30102
30108
  stateHuman(raw?: boolean): GearStakingV3StateHuman;
30109
+ deposit(amount: bigint, votes: Array<MultiVote>): RawTx;
30110
+ depositWithPermit(amount: bigint, votes: Array<MultiVote>, permit: PermitResult): RawTx;
30111
+ withdraw(amount: bigint, to: Address, votes: Array<MultiVote>): RawTx;
30112
+ claimWithdrawals(to: Address): RawTx;
30113
+ multivote(votes: Array<MultiVote>): RawTx;
30103
30114
  }
30104
30115
 
30105
30116
  type Unarray<A> = A extends readonly unknown[] ? Unarray<A[number]> : A;
@@ -30503,6 +30514,7 @@ interface CloseCreditAccountResult extends CommonResult {
30503
30514
  interface CommonResult {
30504
30515
  tx: RawTx;
30505
30516
  calls: Array<MultiCall>;
30517
+ creditFacade: CreditFactory["creditFacade"];
30506
30518
  }
30507
30519
  type CloseOptions = "close" | "zeroDebt";
30508
30520
  interface CloseCreditAccountProps {
@@ -30645,10 +30657,7 @@ declare class CreditAccountsService extends SDKConstruct {
30645
30657
  changeDebt({ creditAccount, amount, }: ChangeDeptProps): Promise<CommonResult>;
30646
30658
  withdrawCollateral(props: WithdrawCollateralProps): Promise<CommonResult>;
30647
30659
  executeSwap(props: ExecuteSwapProps): Promise<CommonResult>;
30648
- claimFarmRewards(props: ClaimFarmRewardsProps): Promise<{
30649
- tx: RawTx;
30650
- calls: MultiCall[];
30651
- }>;
30660
+ claimFarmRewards(props: ClaimFarmRewardsProps): Promise<CommonResult>;
30652
30661
  openCA(props: OpenCAProps): Promise<CommonResult>;
30653
30662
  /**
30654
30663
  * Returns raw txs that are needed to update all price feeds so that all credit accounts (possibly from different markets) compute
@@ -30785,4 +30794,4 @@ type MulticallErrorType = GetChainContractAddressErrorType | ReadContractErrorTy
30785
30794
  */
30786
30795
  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>>;
30787
30796
 
30788
- 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_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, BotListContract, type BotListStateHuman, BotPermissions, 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, 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, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, type IPriceOracleContract, LinearModelContract, type LinearModelStateHuman, type LogFn, MAX_UINT16, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, type MultiCall, type MulticallErrorType, type MulticallParameters, type MulticallReturnType, NOT_DEPLOYED, NO_VERSION, type NetworkOptions, type NetworkType, type OnDemandPriceUpdate, type OpenStrategyResult, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PRICE_DECIMALS, PRICE_DECIMALS_POW, type PartialPriceFeedTreeNode, type PathOption, type PathOptionSerie, 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 SwapOperation, type SwapTask, type SyncStateOptions, TIMELOCK, type TVL, type TokenMetaData, TokensMeta, type TransportOptions, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, type UpdatePriceFeedsResult, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, type ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, assetsMap, balancesMap, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createRawTx, createTransport, detectNetwork, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, halfRAY, json_parse, json_stringify, numberWithCommas, percentFmt, rawTxToMulticallPriceUpdate, simulateMulticall, toHumanFormat, tokenToTicker };
30797
+ 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_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, BotListContract, type BotListStateHuman, BotPermissions, 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, 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, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, type IPriceOracleContract, LinearModelContract, type LinearModelStateHuman, type LogFn, MAX_UINT16, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, 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, 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 SwapOperation, type SwapTask, type SyncStateOptions, TIMELOCK, type TVL, type TokenMetaData, TokensMeta, type TransportOptions, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, type UpdatePriceFeedsResult, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, type ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, assetsMap, balancesMap, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createRawTx, createTransport, detectNetwork, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, halfRAY, json_parse, json_stringify, numberWithCommas, percentFmt, rawTxToMulticallPriceUpdate, simulateMulticall, toHumanFormat, tokenToTicker };
@@ -30096,10 +30096,21 @@ declare class BotListContract extends BaseContract<abi$2> {
30096
30096
  }
30097
30097
 
30098
30098
  type abi$1 = typeof gearStakingV3Abi;
30099
+ interface MultiVote {
30100
+ votingContract: Address;
30101
+ voteAmount: bigint;
30102
+ isIncrease: boolean;
30103
+ extraData: Address;
30104
+ }
30099
30105
  declare class GearStakingContract extends BaseContract<abi$1> {
30100
30106
  constructor(sdk: GearboxSDK, address: Address);
30101
30107
  parseFunctionParams(params: DecodeFunctionDataReturnType<abi$1>): Array<string> | undefined;
30102
30108
  stateHuman(raw?: boolean): GearStakingV3StateHuman;
30109
+ deposit(amount: bigint, votes: Array<MultiVote>): RawTx;
30110
+ depositWithPermit(amount: bigint, votes: Array<MultiVote>, permit: PermitResult): RawTx;
30111
+ withdraw(amount: bigint, to: Address, votes: Array<MultiVote>): RawTx;
30112
+ claimWithdrawals(to: Address): RawTx;
30113
+ multivote(votes: Array<MultiVote>): RawTx;
30103
30114
  }
30104
30115
 
30105
30116
  type Unarray<A> = A extends readonly unknown[] ? Unarray<A[number]> : A;
@@ -30503,6 +30514,7 @@ interface CloseCreditAccountResult extends CommonResult {
30503
30514
  interface CommonResult {
30504
30515
  tx: RawTx;
30505
30516
  calls: Array<MultiCall>;
30517
+ creditFacade: CreditFactory["creditFacade"];
30506
30518
  }
30507
30519
  type CloseOptions = "close" | "zeroDebt";
30508
30520
  interface CloseCreditAccountProps {
@@ -30645,10 +30657,7 @@ declare class CreditAccountsService extends SDKConstruct {
30645
30657
  changeDebt({ creditAccount, amount, }: ChangeDeptProps): Promise<CommonResult>;
30646
30658
  withdrawCollateral(props: WithdrawCollateralProps): Promise<CommonResult>;
30647
30659
  executeSwap(props: ExecuteSwapProps): Promise<CommonResult>;
30648
- claimFarmRewards(props: ClaimFarmRewardsProps): Promise<{
30649
- tx: RawTx;
30650
- calls: MultiCall[];
30651
- }>;
30660
+ claimFarmRewards(props: ClaimFarmRewardsProps): Promise<CommonResult>;
30652
30661
  openCA(props: OpenCAProps): Promise<CommonResult>;
30653
30662
  /**
30654
30663
  * Returns raw txs that are needed to update all price feeds so that all credit accounts (possibly from different markets) compute
@@ -30785,4 +30794,4 @@ type MulticallErrorType = GetChainContractAddressErrorType | ReadContractErrorTy
30785
30794
  */
30786
30795
  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>>;
30787
30796
 
30788
- 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_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, BotListContract, type BotListStateHuman, BotPermissions, 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, 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, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, type IPriceOracleContract, LinearModelContract, type LinearModelStateHuman, type LogFn, MAX_UINT16, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, type MultiCall, type MulticallErrorType, type MulticallParameters, type MulticallReturnType, NOT_DEPLOYED, NO_VERSION, type NetworkOptions, type NetworkType, type OnDemandPriceUpdate, type OpenStrategyResult, PERCENTAGE_DECIMALS, PERCENTAGE_FACTOR, PRICE_DECIMALS, PRICE_DECIMALS_POW, type PartialPriceFeedTreeNode, type PathOption, type PathOptionSerie, 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 SwapOperation, type SwapTask, type SyncStateOptions, TIMELOCK, type TVL, type TokenMetaData, TokensMeta, type TransportOptions, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, type UpdatePriceFeedsResult, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, type ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, assetsMap, balancesMap, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createRawTx, createTransport, detectNetwork, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, halfRAY, json_parse, json_stringify, numberWithCommas, percentFmt, rawTxToMulticallPriceUpdate, simulateMulticall, toHumanFormat, tokenToTicker };
30797
+ 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_1, type AddressProviderV3StateHuman, type Asset, type AssetPriceFeedStateHuman, BLOCKS_PER_WEEK_BY_NETWORK, BalancerStablePriceFeedContract, BalancerV2VaultAdapterContract, BalancerWeightedPriceFeedContract, BaseContract, type BaseContractOptions, type BaseContractStateHuman, type BaseParams, type BasePriceFeedStateHuman, BotListContract, type BotListStateHuman, BotPermissions, 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, 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, ERC4626AdapterContract, Erc4626PriceFeedContract, type EtherscanURLParam, type FindClosePathInput, GaugeContract, type GaugeParams, type GaugeParamsHuman, type GaugeStateHuman, GearStakingContract, type GearStakingV3StateHuman, GearboxSDK, type GearboxStateHuman, type IAdapterContract, type IBaseContract, type ILPPriceFeedContract, type ILogger, type IPriceFeedContract, type IPriceOracleContract, LinearModelContract, type LinearModelStateHuman, type LogFn, MAX_UINT16, MAX_UINT256, MIN_INT96, type MarketData, MarketFactory, MarketRegister, type MarketStateHuman, MellowLRTPriceFeedContract, 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, 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 SwapOperation, type SwapTask, type SyncStateOptions, TIMELOCK, type TVL, type TokenMetaData, TokensMeta, type TransportOptions, USDC, UniswapV2AdapterContract, UniswapV3AdapterContract, type UpdatePriceFeedsResult, VelodromeV2RouterAdapterContract, VotingContractStatus, WAD, WAD_DECIMALS_POW, WstETHPriceFeedContract, WstETHV1AdapterContract, YearnPriceFeedContract, YearnV2RouterAdapterContract, type ZapperData, type ZapperStateHuman, ZeroPriceFeedContract, assetsMap, balancesMap, botPermissionsToString, bytes32ToString, chains, childLogger, createAdapter, createRawTx, createTransport, detectNetwork, etherscanUrl, filterDust, fmtBinaryMask, formatBN, formatBNvalue, formatBn4dig, formatDuration, formatNumberToString_, halfRAY, json_parse, json_stringify, numberWithCommas, percentFmt, rawTxToMulticallPriceUpdate, simulateMulticall, toHumanFormat, tokenToTicker };
@@ -25785,7 +25785,7 @@ var CreditAccountsService = class extends SDKConstruct {
25785
25785
  to,
25786
25786
  calls
25787
25787
  );
25788
- return { tx, calls, routerCloseResult };
25788
+ return { tx, calls, routerCloseResult, creditFacade: cm.creditFacade };
25789
25789
  }
25790
25790
  /**
25791
25791
  * Closes credit account or sets debt to zero (but keep account)
@@ -25821,7 +25821,7 @@ var CreditAccountsService = class extends SDKConstruct {
25821
25821
  )
25822
25822
  ];
25823
25823
  const tx = operation === "close" ? cm.creditFacade.closeCreditAccount(ca.creditAccount, calls) : cm.creditFacade.multicall(ca.creditAccount, calls);
25824
- return { tx, calls, routerCloseResult };
25824
+ return { tx, calls, routerCloseResult, creditFacade: cm.creditFacade };
25825
25825
  }
25826
25826
  /**
25827
25827
  * Repays credit account or sets debt to zero (but keep account)
@@ -25855,7 +25855,7 @@ var CreditAccountsService = class extends SDKConstruct {
25855
25855
  )
25856
25856
  ];
25857
25857
  const tx = operation === "close" ? cm.creditFacade.closeCreditAccount(ca.creditAccount, calls) : cm.creditFacade.multicall(ca.creditAccount, calls);
25858
- return { tx, calls };
25858
+ return { tx, calls, creditFacade: cm.creditFacade };
25859
25859
  }
25860
25860
  /**
25861
25861
  * Repays liquidatable credit account
@@ -25892,7 +25892,7 @@ var CreditAccountsService = class extends SDKConstruct {
25892
25892
  to,
25893
25893
  calls
25894
25894
  );
25895
- return { tx, calls };
25895
+ return { tx, calls, creditFacade: cm.creditFacade };
25896
25896
  }
25897
25897
  async updateQuotas(props) {
25898
25898
  const { creditAccount } = props;
@@ -25912,10 +25912,7 @@ var CreditAccountsService = class extends SDKConstruct {
25912
25912
  ...priceUpdates,
25913
25913
  ...this.#prepareUpdateQuotas(props.creditAccount.creditFacade, props)
25914
25914
  ]);
25915
- return {
25916
- tx,
25917
- calls
25918
- };
25915
+ return { tx, calls, creditFacade: cm.creditFacade };
25919
25916
  }
25920
25917
  async addCollateral(props) {
25921
25918
  const { creditAccount, asset, permit, ethAmount } = props;
@@ -25938,7 +25935,7 @@ var CreditAccountsService = class extends SDKConstruct {
25938
25935
  ];
25939
25936
  const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
25940
25937
  tx.value = ethAmount.toString(10);
25941
- return { tx, calls };
25938
+ return { tx, calls, creditFacade: cm.creditFacade };
25942
25939
  }
25943
25940
  async changeDebt({
25944
25941
  creditAccount,
@@ -25967,7 +25964,7 @@ var CreditAccountsService = class extends SDKConstruct {
25967
25964
  this.#prepareChangeDebt(creditAccount.creditFacade, change, isDecrease)
25968
25965
  ];
25969
25966
  const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
25970
- return { tx, calls };
25967
+ return { tx, calls, creditFacade: cm.creditFacade };
25971
25968
  }
25972
25969
  async withdrawCollateral(props) {
25973
25970
  const { creditAccount, assetsToWithdraw, to } = props;
@@ -25992,7 +25989,7 @@ var CreditAccountsService = class extends SDKConstruct {
25992
25989
  ...this.#prepareUpdateQuotas(creditAccount.creditFacade, props)
25993
25990
  ];
25994
25991
  const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
25995
- return { tx, calls };
25992
+ return { tx, calls, creditFacade: cm.creditFacade };
25996
25993
  }
25997
25994
  async executeSwap(props) {
25998
25995
  const { creditAccount, calls: swapCalls } = props;
@@ -26011,7 +26008,7 @@ var CreditAccountsService = class extends SDKConstruct {
26011
26008
  ...this.#prepareUpdateQuotas(creditAccount.creditFacade, props)
26012
26009
  ];
26013
26010
  const tx = cm.creditFacade.multicall(creditAccount.creditAccount, calls);
26014
- return { tx, calls };
26011
+ return { tx, calls, creditFacade: cm.creditFacade };
26015
26012
  }
26016
26013
  async claimFarmRewards(props) {
26017
26014
  const { tokensToDisable, calls: claimCalls, creditAccount: ca } = props;
@@ -26031,7 +26028,7 @@ var CreditAccountsService = class extends SDKConstruct {
26031
26028
  ...this.#prepareUpdateQuotas(ca.creditFacade, props)
26032
26029
  ];
26033
26030
  const tx = cm.creditFacade.multicall(ca.creditAccount, calls);
26034
- return { tx, calls };
26031
+ return { tx, calls, creditFacade: cm.creditFacade };
26035
26032
  }
26036
26033
  async openCA(props) {
26037
26034
  const {
@@ -26066,10 +26063,7 @@ var CreditAccountsService = class extends SDKConstruct {
26066
26063
  referralCode
26067
26064
  );
26068
26065
  tx.value = ethAmount.toString(10);
26069
- return {
26070
- calls,
26071
- tx
26072
- };
26066
+ return { calls, tx, creditFacade: cmFactory.creditFacade };
26073
26067
  }
26074
26068
  /**
26075
26069
  * Internal wrapper for CreditAccountCompressor.getCreditAccounts + price updates wrapped into multicall
@@ -26553,6 +26547,36 @@ var GearStakingContract = class extends BaseContract {
26553
26547
  migrator: this.labelAddress(ADDRESS_0X0)
26554
26548
  };
26555
26549
  }
26550
+ deposit(amount, votes) {
26551
+ return this.createRawTx({
26552
+ functionName: "deposit",
26553
+ args: [amount, votes]
26554
+ });
26555
+ }
26556
+ depositWithPermit(amount, votes, permit) {
26557
+ return this.createRawTx({
26558
+ functionName: "depositWithPermit",
26559
+ args: [amount, votes, permit.deadline, permit.v, permit.r, permit.s]
26560
+ });
26561
+ }
26562
+ withdraw(amount, to, votes) {
26563
+ return this.createRawTx({
26564
+ functionName: "withdraw",
26565
+ args: [amount, to, votes]
26566
+ });
26567
+ }
26568
+ claimWithdrawals(to) {
26569
+ return this.createRawTx({
26570
+ functionName: "claimWithdrawals",
26571
+ args: [to]
26572
+ });
26573
+ }
26574
+ multivote(votes) {
26575
+ return this.createRawTx({
26576
+ functionName: "multivote",
26577
+ args: [votes]
26578
+ });
26579
+ }
26556
26580
  };
26557
26581
  var GearboxSDK = class _GearboxSDK {
26558
26582
  #hooks = new Hooks();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "3.0.0-vfour.103",
3
+ "version": "3.0.0-vfour.105",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.cjs",