@gearbox-protocol/sdk 18.4.1 → 18.5.0-next.2

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.
Files changed (74) hide show
  1. package/dist/cjs/onchain/abi/index.js +2 -0
  2. package/dist/cjs/onchain/abi/oracles.js +617 -0
  3. package/dist/cjs/onchain/index.js +4 -0
  4. package/dist/cjs/onchain/market/index.js +4 -0
  5. package/dist/cjs/onchain/market/pricefeeds/PriceFeedRegistry.js +4 -0
  6. package/dist/cjs/onchain/market/pricefeeds/feeds/FixedRateWindowPriceFeed.js +15 -0
  7. package/dist/cjs/onchain/market/pricefeeds/feeds/MedianPriceFeed.js +15 -0
  8. package/dist/cjs/onchain/market/pricefeeds/feeds/index.js +4 -0
  9. package/dist/cjs/onchain/market/pricefeeds/index.js +4 -0
  10. package/dist/cjs/permissionless/bindings/price-feed-store.js +1 -0
  11. package/dist/cjs/permissionless/bindings/pricefeeds/fix-rate-window.js +53 -0
  12. package/dist/cjs/permissionless/bindings/pricefeeds/index.js +7 -3
  13. package/dist/cjs/permissionless/bindings/pricefeeds/median.js +22 -0
  14. package/dist/esm/onchain/abi/index.js +1 -1
  15. package/dist/esm/onchain/abi/oracles.js +616 -1
  16. package/dist/esm/onchain/index.js +3 -1
  17. package/dist/esm/onchain/market/index.js +3 -1
  18. package/dist/esm/onchain/market/pricefeeds/PriceFeedRegistry.js +4 -0
  19. package/dist/esm/onchain/market/pricefeeds/feeds/FixedRateWindowPriceFeed.js +14 -0
  20. package/dist/esm/onchain/market/pricefeeds/feeds/MedianPriceFeed.js +14 -0
  21. package/dist/esm/onchain/market/pricefeeds/feeds/index.js +3 -1
  22. package/dist/esm/onchain/market/pricefeeds/index.js +3 -1
  23. package/dist/esm/permissionless/bindings/price-feed-store.js +1 -0
  24. package/dist/esm/permissionless/bindings/pricefeeds/fix-rate-window.js +52 -0
  25. package/dist/esm/permissionless/bindings/pricefeeds/index.js +7 -3
  26. package/dist/esm/permissionless/bindings/pricefeeds/median.js +21 -0
  27. package/dist/types/onchain/abi/index.d.mts +2 -2
  28. package/dist/types/onchain/abi/oracles.d.mts +536 -0
  29. package/dist/types/onchain/index.d.mts +3 -1
  30. package/dist/types/onchain/market/index.d.mts +3 -1
  31. package/dist/types/onchain/market/pricefeeds/feeds/FixedRateWindowPriceFeed.d.mts +9 -0
  32. package/dist/types/onchain/market/pricefeeds/feeds/MedianPriceFeed.d.mts +9 -0
  33. package/dist/types/onchain/market/pricefeeds/feeds/index.d.mts +3 -1
  34. package/dist/types/onchain/market/pricefeeds/index.d.mts +3 -1
  35. package/dist/types/onchain/market/pricefeeds/types.d.mts +1 -1
  36. package/dist/types/permissionless/bindings/pricefeeds/fix-rate-window.d.mts +3 -0
  37. package/dist/types/permissionless/bindings/pricefeeds/median.d.mts +3 -0
  38. package/dist/types/permissionless/core/pricefeed-builder.d.mts +2 -0
  39. package/package.json +1 -6
  40. package/dist/cjs/testnets/TestnetsAPI.js +0 -178
  41. package/dist/cjs/testnets/errors/TestnetNotFoundError.js +0 -14
  42. package/dist/cjs/testnets/errors/TestnetRequestFailedError.js +0 -23
  43. package/dist/cjs/testnets/errors/TestnetStatusError.js +0 -18
  44. package/dist/cjs/testnets/errors/TestnetValidationError.js +0 -23
  45. package/dist/cjs/testnets/errors/TestnetWaitTimeoutError.js +0 -29
  46. package/dist/cjs/testnets/errors/TestnetsError.js +0 -33
  47. package/dist/cjs/testnets/errors/index.js +0 -13
  48. package/dist/cjs/testnets/index.js +0 -32
  49. package/dist/cjs/testnets/package.json +0 -1
  50. package/dist/cjs/testnets/schemas.js +0 -241
  51. package/dist/cjs/testnets/types.js +0 -1
  52. package/dist/esm/testnets/TestnetsAPI.js +0 -177
  53. package/dist/esm/testnets/errors/TestnetNotFoundError.js +0 -13
  54. package/dist/esm/testnets/errors/TestnetRequestFailedError.js +0 -22
  55. package/dist/esm/testnets/errors/TestnetStatusError.js +0 -17
  56. package/dist/esm/testnets/errors/TestnetValidationError.js +0 -22
  57. package/dist/esm/testnets/errors/TestnetWaitTimeoutError.js +0 -28
  58. package/dist/esm/testnets/errors/TestnetsError.js +0 -32
  59. package/dist/esm/testnets/errors/index.js +0 -7
  60. package/dist/esm/testnets/index.js +0 -11
  61. package/dist/esm/testnets/package.json +0 -1
  62. package/dist/esm/testnets/schemas.js +0 -227
  63. package/dist/esm/testnets/types.js +0 -1
  64. package/dist/types/testnets/TestnetsAPI.d.mts +0 -106
  65. package/dist/types/testnets/errors/TestnetNotFoundError.d.mts +0 -10
  66. package/dist/types/testnets/errors/TestnetRequestFailedError.d.mts +0 -9
  67. package/dist/types/testnets/errors/TestnetStatusError.d.mts +0 -13
  68. package/dist/types/testnets/errors/TestnetValidationError.d.mts +0 -14
  69. package/dist/types/testnets/errors/TestnetWaitTimeoutError.d.mts +0 -19
  70. package/dist/types/testnets/errors/TestnetsError.d.mts +0 -45
  71. package/dist/types/testnets/errors/index.d.mts +0 -7
  72. package/dist/types/testnets/index.d.mts +0 -17
  73. package/dist/types/testnets/schemas.d.mts +0 -552
  74. package/dist/types/testnets/types.d.mts +0 -715
@@ -120,6 +120,8 @@ import { CurveStablePriceFeedContract } from "./pricefeeds/feeds/CurveStablePric
120
120
  import { CurveUSDPriceFeedContract } from "./pricefeeds/feeds/CurveUSDPriceFeed.mjs";
121
121
  import { Erc4626PriceFeedContract } from "./pricefeeds/feeds/Erc4626PriceFeed.mjs";
122
122
  import { ExternalPriceFeedContract } from "./pricefeeds/feeds/ExternalPriceFeed.mjs";
123
+ import { FixedRateWindowPriceFeedContract } from "./pricefeeds/feeds/FixedRateWindowPriceFeed.mjs";
124
+ import { MedianPriceFeedContract } from "./pricefeeds/feeds/MedianPriceFeed.mjs";
123
125
  import { MellowLRTPriceFeedContract } from "./pricefeeds/feeds/MellowLRTPriceFeed.mjs";
124
126
  import { PendleTWAPPTPriceFeed } from "./pricefeeds/feeds/PendleTWAPPTPriceFeed.mjs";
125
127
  import { PythPriceFeed } from "./pricefeeds/feeds/PythPriceFeed.mjs";
@@ -167,4 +169,4 @@ import "./rwa/index.mjs";
167
169
  import { strategyName } from "./strategyName.mjs";
168
170
  import { CompressorZapperData, ZapperData } from "./types.mjs";
169
171
  import "./zapper/index.mjs";
170
- export { AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterContractStateHuman, AdapterContractType, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BasicSwapCall, BoundedPriceFeedContract, CamelotPool, CamelotV3AdapterContract, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConstantPriceFeedContract, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, CreditAccountTokenQuota, CreditConfiguratorV310Contract, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, CreditSuiteStrategy, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DStokenData, DaiUsdsAdapterContract, DelayedWithdrawalClaim, DelayedWithdrawalRequest, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, FluidDexAdapterContract, GaugeContract, GaugeParams, GetInvestorOptions, GetOpenAccountRequirementsProps, GetReward, IAdapterContract, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IDegenNFT, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, IPoolContract, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTask, type IPriceUpdater, IRWAFactory, IRateKeeperContract, type IUpdatablePriceFeedContract, IZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InterestRateModelType, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, type LatestUpdate, LegacyAdapterOperation, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationFees, MAX_LEVERAGE_BUFFER_BPS, MakerDeposit, MakerRedeem, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketSuite, MaxBorrowAmount, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, OptimalPartialLiquidationAmounts, OptimalPartialLiquidationAmountsProps, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolQuotaKeeperContract, PoolSuite, PoolV310Contract, PrepareUpdateQuotasProps, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegistry, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleV310Contract, PriceUpdate, PriceUpdatesCache, PythPriceFeed, QuotaMode, QuotaSlice, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWAFactoryData, RWAFactoryProtocol, RWAFactoryStateHuman, RWAInvestorData, RWARegistry, RWAState, RWAStateHuman, RWAUnderlyingData, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RampEvent, RateKeeperType, RedstonePriceFeedContract, SecuritizeCreditAccountData, SecuritizeDegenNFT, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, StrategyCollateralProps, StrategyRateInputs, Swap, type TimestampedCalldata, TokenAmount, TokenTransfer, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, TreehouseFastlaneAdapterContract, TreehouseRedemptionGatewayAdapterContract, TreehouseRouterAdapterContract, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, UpshiftVaultAdapterContract, VaultDeposit, VelodromeV2RouterAdapterContract, VersionedAbi, WithdrawCollateral, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, classifyCurveOperation, collateralPriceInUnderlying, createAdapter, createPriceOracle, createZapper, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, dominantCollateral, erc4626ReferralAdapterAbi, expectedBalanceDeltas, fnSigToName, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getRawPriceUpdates, hasAdapterDeployParamsAbi, healthFactorBps, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iTreehouseFastlaneAbi, iTreehouseFastlaneAdapterAbi, iTreehouseRedemptionGatewayAbi, iTreehouseRedemptionGatewayAdapterAbi, iTreehouseRouterAbi, iTreehouseRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isLPPriceFeed, isRWAFactory, isStrategyCollateral, isUpdatablePriceFeed, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, optimalHFForPartialLiquidation, optimalPartialLiquidationAmounts, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, pickStrategyTargetCollateral, rayToBps, rewardsFromTransfers, strategyName, swapFromTransfers, toNetTransfers, updatableDependencies, usdToNumber };
172
+ export { AbstractAdapterContract, AbstractAdapterContractOptions, AbstractLPPriceFeedContract, AbstractPriceFeedContract, AccountMigratorAdapterContract, AdapterContractStateHuman, AdapterContractType, AdapterFactoryArgs, AdapterProtocolOperation, AdapterType, BalanceDelta, BalancerStablePriceFeedContract, BalancerSwap, BalancerV3Pool, BalancerV3PoolStatus, BalancerV3RouterAdapterContract, BalancerV3WrapperAdapterContract, BalancerWeightedPriceFeedContract, BasicSwapCall, BoundedPriceFeedContract, CamelotPool, CamelotV3AdapterContract, CompositePriceFeedContract, CompressorZapperData, ConcreteAdapterContractOptions, ConstantPriceFeedContract, ConvertFn, ConvexDeposit, ConvexDepositAndStake, ConvexStake, ConvexV1BaseRewardPoolAdapterContract, ConvexV1BoosterAdapterContract, ConvexWithdraw, ConvexWithdrawAndClaim, CreditAccountTokenQuota, CreditConfiguratorV310Contract, type abi as CreditFacadeV310Abi, abi as creditFacadeV310Abi, CreditFacadeV310BaseContract, CreditFacadeV310Contract, CreditManagerV310Contract, CreditSuite, CreditSuiteStrategy, Curve2AssetsAdapterContract, Curve3AssetsAdapterContract, Curve4AssetsAdapterContract, CurveAddLiquidity, CurveClaims, CurveCryptoPriceFeedContract, CurveExchange, CurveRemoveLiquidity, CurveRemoveLiquidityOneCoin, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, CurveV1AdapterStETHContract, CurveV1StableNGAdapterContract, CurveWithdrawal, DEFAULT_QUOTA_BUFFER_BPS, DEGEN_NFT_MIDAS, DEGEN_NFT_SECURITIZE, DStokenData, DaiUsdsAdapterContract, DelayedWithdrawalClaim, DelayedWithdrawalRequest, ERC4626AdapterContract, ERC4626ReferralAdapterContract, Erc4626PriceFeedContract, ExpectedBalanceDeltasProps, ExpectedOutput, ExternalPriceFeedContract, FixedRateWindowPriceFeedContract, FluidDexAdapterContract, GaugeContract, GaugeParams, GetInvestorOptions, GetOpenAccountRequirementsProps, GetReward, IAdapterContract, ICreditConfiguratorContract, ICreditFacadeContract, ICreditManagerContract, IDegenNFT, IERC20ZapperContract, IETHZapperContract, IInterestRateModelContract, IPoolContract, IPriceFeedContract, IPriceOracleContract, type IPriceUpdateTask, type IPriceUpdater, IRWAFactory, IRateKeeperContract, type IUpdatablePriceFeedContract, IZapperContract, InfinifiGatewayAdapterContract, InfinifiUnwindingGatewayAdapterContract, InterestRateModelType, KelpLRTDepositPoolAdapterContract, KelpLRTWithdrawalManagerAdapterContract, type LatestUpdate, LegacyAdapterOperation, LidoSubmit, LidoV1AdapterContract, LinearInterestRateModelContract, LiquidationFees, MAX_LEVERAGE_BUFFER_BPS, MakerDeposit, MakerRedeem, MarketRegister, MarketRegistryState, MarketRegistryStateHuman, MarketSuite, MaxBorrowAmount, MedianPriceFeedContract, MellowClaimerAdapterContract, MellowDVVAdapterContract, MellowERC4626VaultAdapterContract, MellowLRTPriceFeedContract, MellowWrapperAdapterContract, MidasDegenNFT, MidasGatewayAdapterContract, MidasIssuanceVaultAdapterContract, MidasLiquidatorContract, MidasRedemptionVaultAdapterContract, OptimalPartialLiquidationAmounts, OptimalPartialLiquidationAmountsProps, PARTIAL_LIQUIDATION_BUFFER_BPS, PHANTOM_TOKEN_MIDAS_REDEMPTION, PHANTOM_TOKEN_SECURITIZE_REDEMPTION, ParsedZapperDeposit, ParsedZapperOperation, ParsedZapperRedeem, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendlePair, PendlePairStatus, PendleRouterAdapterContract, PendleTWAPPTPriceFeed, PendleTokenType, PoolQuotaKeeperContract, PoolSuite, PoolV310Contract, PrepareUpdateQuotasProps, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegistry, PriceFeedUsageType, PriceFeedsForAccountOptions, PriceFeedsForTokensOptions, PriceOracleV310Contract, PriceUpdate, PriceUpdatesCache, PythPriceFeed, QuotaMode, QuotaSlice, RWACompressorCall, RWACompressorInvestorData, RWACompressorResponse, RWAFactoryData, RWAFactoryProtocol, RWAFactoryStateHuman, RWAInvestorData, RWARegistry, RWAState, RWAStateHuman, RWAUnderlyingData, RWA_COMPRESSOR_ADDRESS, RWA_LIQUIDATOR_MIDAS, RWA_LIQUIDATOR_SECURITIZE, RampEvent, RateKeeperType, RedstonePriceFeedContract, SecuritizeCreditAccountData, SecuritizeDegenNFT, SecuritizeInvestorData, SecuritizeLiquidatorContract, SecuritizeOnRampAdapterContract, SecuritizeRWAFactory, SecuritizeRWAFactoryStateHuman, SecuritizeRedemptionGatewayAdapterContract, StakingRewardsAdapterContract, StrategyCollateralProps, StrategyRateInputs, Swap, type TimestampedCalldata, TokenAmount, TokenTransfer, TraderJoePool, TraderJoePoolVersion, TraderJoeRouterAdapterContract, Transfers, TreehouseFastlaneAdapterContract, TreehouseRedemptionGatewayAdapterContract, TreehouseRouterAdapterContract, UniswapSwap, UniswapV2AdapterContract, UniswapV3AdapterContract, UniswapV4AdapterContract, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, UpshiftVaultAdapterContract, VaultDeposit, VelodromeV2RouterAdapterContract, VersionedAbi, WithdrawCollateral, WstETHPriceFeedContract, WstETHUnwrap, WstETHV1AdapterContract, WstETHWrap, YearnPriceFeedContract, ZapperContract, ZapperData, ZeroPriceFeedContract, adapterActionAbi, adapterActionSelectors, adapterActionSignatures, adapterConstructorAbi, allTransfersAsTokenAmounts, bpsToRay, calcBorrowApy, calcEffectiveBorrowApy, calcMaxLeverage, calcNetStrategyApy, calcPositionLeverage, calcQuotaRate, calcUtilization, calcUtilizationRaw, classifyCurveOperation, collateralPriceInUnderlying, createAdapter, createPriceOracle, createZapper, curveAddLiquidityFromTransfers, curveRemoveLiquidityFromTransfers, dominantCollateral, erc4626ReferralAdapterAbi, expectedBalanceDeltas, fnSigToName, getAdapterActionAbi, getAdapterDeployParamsAbi, getAdapterType, getRawPriceUpdates, hasAdapterDeployParamsAbi, healthFactorBps, iBalancerV3RouterAbi, iBalancerV3RouterAdapterAbi, iBalancerV3WrapperAbi, iBalancerV3WrapperAdapterAbi, iBaseOnRampAbi, iBaseRewardPoolAbi, iBoosterAbi, iCamelotV3AdapterAbi, iCamelotV3RouterAbi, iConvexV1BaseRewardPoolAdapterAbi, iConvexV1BoosterAdapterAbi, iCurvePoolAbi, iCurvePoolStableNGAbi, iCurvePool_2Abi, iCurvePool_3Abi, iCurvePool_4Abi, iCurveV1StableNgAdapterAbi, iCurveV1_2AssetsAdapterAbi, iCurveV1_3AssetsAdapterAbi, iCurveV1_4AssetsAdapterAbi, iDaiUsdsAbi, iDaiUsdsAdapterAbi, iERC4626Abi, iERC4626ReferralAbi, iFluidDexAbi, iFluidDexAdapterAbi, iInfinifiGatewayAbi, iInfinifiGatewayAdapterAbi, iInfinifiUnwindingGatewayAbi, iInfinifiUnwindingGatewayAdapterAbi, iKelpLRTDepositPoolGatewayAbi, iKelpLRTWithdrawalManagerGatewayAbi, iKelpLrtDepositPoolAdapterAbi, iKelpLrtDepositPoolGatewayAbi, iKelpLrtWithdrawalManagerAdapterAbi, iKelpLrtWithdrawalManagerGatewayAbi, iLidoV1AdapterAbi, iMellow4626VaultAdapterAbi, iMellowClaimerAbi, iMellowClaimerAdapterAbi, iMellowWrapperAbi, iMellowWrapperAdapterAbi, iMidasGatewayAdapterV311Abi, iMidasGatewayV311Abi, iMidasIssuanceVaultAdapterV310Abi, iMidasIssuanceVaultV310Abi, iMidasRedemptionVaultAdapterV310Abi, iMidasRedemptionVaultGatewayV310Abi, iPendleRouterAbi, iPendleRouterAdapterAbi, iSecuritizeOnRampAbi, iSecuritizeOnRampAdapterV310Abi, iSecuritizeRedemptionGatewayAdapterV311Abi, iSecuritizeRedemptionGatewayV311Abi, iStakingRewardsAbi, iStakingRewardsAdapterAbi, iTraderJoeRouterAbi, iTraderJoeRouterAdapterAbi, iTreehouseFastlaneAbi, iTreehouseFastlaneAdapterAbi, iTreehouseRedemptionGatewayAbi, iTreehouseRedemptionGatewayAdapterAbi, iTreehouseRouterAbi, iTreehouseRouterAdapterAbi, iUniswapV2AdapterAbi, iUniswapV2Router02Abi, iUniswapV3Abi, iUniswapV3AdapterAbi, iUniswapV4AdapterAbi, iUniswapV4GatewayAbi, iUpshiftVaultAdapterAbi, iUpshiftVaultGatewayAbi, iVelodromeV2RouterAbi, iVelodromeV2RouterAdapterAbi, isLPPriceFeed, isRWAFactory, isStrategyCollateral, isUpdatablePriceFeed, iwstETHAbi, iwstEthv1AdapterAbi, lidoV1_WETHGatewayAbi, mellowDvvAdapterAbi, minSeizedAmount, optimalHFForPartialLiquidation, optimalPartialLiquidationAmounts, parseAdapterAction, parseAdapterDeployParams, parsePosNegAmount, pickStrategyTargetCollateral, rayToBps, rewardsFromTransfers, strategyName, swapFromTransfers, toNetTransfers, updatableDependencies, usdToNumber };
@@ -0,0 +1,9 @@
1
+ import "../../../abi/index.mjs";
2
+ import { fixedRateWindowPriceFeedAbi } from "../../../abi/oracles.mjs";
3
+ import { ConstructOptions } from "../../../base/Construct.mjs";
4
+ import { AbstractPriceFeedContract, PartialPriceFeedTreeNode } from "../AbstractPriceFeed.mjs";
5
+ type abi = typeof fixedRateWindowPriceFeedAbi;
6
+ export declare class FixedRateWindowPriceFeedContract extends AbstractPriceFeedContract<abi> {
7
+ constructor(options: ConstructOptions, args: PartialPriceFeedTreeNode);
8
+ }
9
+ export {};
@@ -0,0 +1,9 @@
1
+ import "../../../abi/index.mjs";
2
+ import { medianPriceFeedAbi } from "../../../abi/oracles.mjs";
3
+ import { ConstructOptions } from "../../../base/Construct.mjs";
4
+ import { AbstractPriceFeedContract, PartialPriceFeedTreeNode } from "../AbstractPriceFeed.mjs";
5
+ type abi = typeof medianPriceFeedAbi;
6
+ export declare class MedianPriceFeedContract extends AbstractPriceFeedContract<abi> {
7
+ constructor(options: ConstructOptions, args: PartialPriceFeedTreeNode);
8
+ }
9
+ export {};
@@ -8,6 +8,8 @@ import { CurveStablePriceFeedContract } from "./CurveStablePriceFeed.mjs";
8
8
  import { CurveUSDPriceFeedContract } from "./CurveUSDPriceFeed.mjs";
9
9
  import { Erc4626PriceFeedContract } from "./Erc4626PriceFeed.mjs";
10
10
  import { ExternalPriceFeedContract } from "./ExternalPriceFeed.mjs";
11
+ import { FixedRateWindowPriceFeedContract } from "./FixedRateWindowPriceFeed.mjs";
12
+ import { MedianPriceFeedContract } from "./MedianPriceFeed.mjs";
11
13
  import { MellowLRTPriceFeedContract } from "./MellowLRTPriceFeed.mjs";
12
14
  import { PendleTWAPPTPriceFeed } from "./PendleTWAPPTPriceFeed.mjs";
13
15
  import { PythPriceFeed } from "./PythPriceFeed.mjs";
@@ -15,4 +17,4 @@ import { RedstonePriceFeedContract } from "./RedstonePriceFeed.mjs";
15
17
  import { WstETHPriceFeedContract } from "./WstETHPriceFeed.mjs";
16
18
  import { YearnPriceFeedContract } from "./YearnPriceFeed.mjs";
17
19
  import { ZeroPriceFeedContract } from "./ZeroPriceFeed.mjs";
18
- export { BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CompositePriceFeedContract, ConstantPriceFeedContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, Erc4626PriceFeedContract, ExternalPriceFeedContract, MellowLRTPriceFeedContract, PendleTWAPPTPriceFeed, PythPriceFeed, RedstonePriceFeedContract, WstETHPriceFeedContract, YearnPriceFeedContract, ZeroPriceFeedContract };
20
+ export { BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CompositePriceFeedContract, ConstantPriceFeedContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, Erc4626PriceFeedContract, ExternalPriceFeedContract, FixedRateWindowPriceFeedContract, MedianPriceFeedContract, MellowLRTPriceFeedContract, PendleTWAPPTPriceFeed, PythPriceFeed, RedstonePriceFeedContract, WstETHPriceFeedContract, YearnPriceFeedContract, ZeroPriceFeedContract };
@@ -12,6 +12,8 @@ import { CurveStablePriceFeedContract } from "./feeds/CurveStablePriceFeed.mjs";
12
12
  import { CurveUSDPriceFeedContract } from "./feeds/CurveUSDPriceFeed.mjs";
13
13
  import { Erc4626PriceFeedContract } from "./feeds/Erc4626PriceFeed.mjs";
14
14
  import { ExternalPriceFeedContract } from "./feeds/ExternalPriceFeed.mjs";
15
+ import { FixedRateWindowPriceFeedContract } from "./feeds/FixedRateWindowPriceFeed.mjs";
16
+ import { MedianPriceFeedContract } from "./feeds/MedianPriceFeed.mjs";
15
17
  import { MellowLRTPriceFeedContract } from "./feeds/MellowLRTPriceFeed.mjs";
16
18
  import { PendleTWAPPTPriceFeed } from "./feeds/PendleTWAPPTPriceFeed.mjs";
17
19
  import { PythPriceFeed } from "./feeds/PythPriceFeed.mjs";
@@ -28,4 +30,4 @@ import { PriceUpdatesCache } from "./updates/PriceUpdatesCache.mjs";
28
30
  import { UpdatablePriceFeedRegistry } from "./updates/UpdatablePriceFeedRegistry.mjs";
29
31
  import { updatableDependencies } from "./updates/updatableDependencies.mjs";
30
32
  import "./updates/index.mjs";
31
- export { AbstractLPPriceFeedContract, AbstractPriceFeedContract, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CompositePriceFeedContract, ConstantPriceFeedContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, Erc4626PriceFeedContract, ExternalPriceFeedContract, IPriceFeedContract, type IPriceUpdateTask, type IPriceUpdater, type IUpdatablePriceFeedContract, type LatestUpdate, MellowLRTPriceFeedContract, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendleTWAPPTPriceFeed, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegistry, PriceFeedUsageType, PriceUpdate, PriceUpdatesCache, PythPriceFeed, RedstonePriceFeedContract, type TimestampedCalldata, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, WstETHPriceFeedContract, YearnPriceFeedContract, ZeroPriceFeedContract, getRawPriceUpdates, isLPPriceFeed, isUpdatablePriceFeed, updatableDependencies };
33
+ export { AbstractLPPriceFeedContract, AbstractPriceFeedContract, BalancerStablePriceFeedContract, BalancerWeightedPriceFeedContract, BoundedPriceFeedContract, CompositePriceFeedContract, ConstantPriceFeedContract, CurveCryptoPriceFeedContract, CurveStablePriceFeedContract, CurveUSDPriceFeedContract, Erc4626PriceFeedContract, ExternalPriceFeedContract, FixedRateWindowPriceFeedContract, IPriceFeedContract, type IPriceUpdateTask, type IPriceUpdater, type IUpdatablePriceFeedContract, type LatestUpdate, MedianPriceFeedContract, MellowLRTPriceFeedContract, PartialPriceFeedInitError, PartialPriceFeedTreeNode, PendleTWAPPTPriceFeed, PriceFeedConstructorArgs, PriceFeedContractType, PriceFeedRef, PriceFeedRegistry, PriceFeedUsageType, PriceUpdate, PriceUpdatesCache, PythPriceFeed, RedstonePriceFeedContract, type TimestampedCalldata, UpdatablePriceFeedRegistry, type UpdatablePriceFeedRegistryHooks, type UpdatePriceFeedsResult, WstETHPriceFeedContract, YearnPriceFeedContract, ZeroPriceFeedContract, getRawPriceUpdates, isLPPriceFeed, isUpdatablePriceFeed, updatableDependencies };
@@ -17,7 +17,7 @@ export type PriceFeedUsageType = "Main" | "Reserve";
17
17
  * Discriminator for the various on-chain price feed contract implementations
18
18
  * (e.g. Curve LP, Balancer, Pyth, Redstone).
19
19
  **/
20
- export type PriceFeedContractType = "PRICE_FEED::BALANCER_STABLE" | "PRICE_FEED::BALANCER_WEIGHTED" | "PRICE_FEED::BOUNDED" | "PRICE_FEED::COMPOSITE" | "PRICE_FEED::CONSTANT" | "PRICE_FEED::CURVE_CRYPTO" | "PRICE_FEED::CURVE_STABLE" | "PRICE_FEED::CURVE_USD" | "PRICE_FEED::ERC4626" | "PRICE_FEED::EXTERNAL" | "PRICE_FEED::MELLOW_LRT" | "PRICE_FEED::PENDLE_PT_TWAP" | "PRICE_FEED::PYTH" | "PRICE_FEED::REDSTONE" | "PRICE_FEED::WSTETH" | "PRICE_FEED::YEARN" | "PRICE_FEED::ZERO";
20
+ export type PriceFeedContractType = "PRICE_FEED::BALANCER_STABLE" | "PRICE_FEED::BALANCER_WEIGHTED" | "PRICE_FEED::BOUNDED" | "PRICE_FEED::COMPOSITE" | "PRICE_FEED::CONSTANT" | "PRICE_FEED::CURVE_CRYPTO" | "PRICE_FEED::CURVE_STABLE" | "PRICE_FEED::CURVE_USD" | "PRICE_FEED::ERC4626" | "PRICE_FEED::EXTERNAL" | "PRICE_FEED::MELLOW_LRT" | "PRICE_FEED::PENDLE_PT_TWAP" | "PRICE_FEED::PYTH" | "PRICE_FEED::REDSTONE" | "PRICE_FEED::WSTETH" | "PRICE_FEED::YEARN" | "PRICE_FEED::ZERO" | "PRICE_FEED::FIXED_RATE_WINDOW" | "PRICE_FEED::MEDIAN";
21
21
  /**
22
22
  * Public interface for a single price feed contract.
23
23
  *
@@ -0,0 +1,3 @@
1
+ import { PriceFeedSetupParams } from "../../core/pricefeed-builder.mjs";
2
+ import "../../core/index.mjs";
3
+ export declare const fixRateWindowPriceFeed: PriceFeedSetupParams;
@@ -0,0 +1,3 @@
1
+ import { PriceFeedSetupParams } from "../../core/pricefeed-builder.mjs";
2
+ import "../../core/index.mjs";
3
+ export declare const medianPriceFeed: PriceFeedSetupParams;
@@ -12,6 +12,8 @@ export type PriceFeedParamType = {
12
12
  decimals?: number;
13
13
  } | {
14
14
  type: "uint32";
15
+ } | {
16
+ type: "uint16";
15
17
  } | {
16
18
  type: "uint8";
17
19
  } | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "18.4.1",
3
+ "version": "18.5.0-next.2",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -58,11 +58,6 @@
58
58
  "types": "./dist/types/permissionless/index.d.ts",
59
59
  "import": "./dist/esm/permissionless/index.js",
60
60
  "default": "./dist/cjs/permissionless/index.js"
61
- },
62
- "./testnets": {
63
- "types": "./dist/types/testnets/index.d.ts",
64
- "import": "./dist/esm/testnets/index.js",
65
- "default": "./dist/cjs/testnets/index.js"
66
61
  }
67
62
  },
68
63
  "files": [
@@ -1,178 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_testnets_errors_TestnetStatusError = require("./errors/TestnetStatusError.js");
3
- const require_testnets_errors_TestnetNotFoundError = require("./errors/TestnetNotFoundError.js");
4
- const require_testnets_errors_TestnetRequestFailedError = require("./errors/TestnetRequestFailedError.js");
5
- const require_testnets_errors_TestnetValidationError = require("./errors/TestnetValidationError.js");
6
- const require_testnets_errors_TestnetWaitTimeoutError = require("./errors/TestnetWaitTimeoutError.js");
7
- require("./errors/index.js");
8
- const require_testnets_schemas = require("./schemas.js");
9
- let zod_v4 = require("zod/v4");
10
- // src/testnets/TestnetsAPI.ts
11
- const DEFAULT_BASE_URL = "https://anvil.gearbox.foundation";
12
- const DEFAULT_TIMEOUT = 3e4;
13
- const DEFAULT_WAIT_TIMEOUT = 6e5;
14
- const DEFAULT_WAIT_INTERVAL = 5e3;
15
- const errorBodySchema = zod_v4.z.object({ error: zod_v4.z.string() });
16
- /**
17
- * Client for anvil-manager, which runs the anvil forks Gearbox calls
18
- * testnets. It manages non-persistent testnets only, addressed by their
19
- * execution id.
20
- *
21
- * ```ts
22
- * const testnets = new TestnetsAPI({ apiKey: process.env.ANVIL_MANAGER_API_KEY });
23
- * const { executionId } = await testnets.create({ network: "Mainnet", timeout: "2h" });
24
- * const status = await testnets.waitUntilReady(executionId);
25
- * // ... use status.rpcUrl ...
26
- * await testnets.kill(executionId);
27
- * ```
28
- *
29
- * Every method throws a {@link TestnetsError} subclass when it fails, except
30
- * when a response body is not JSON: then it rejects with the error of
31
- * `response.json()`.
32
- **/
33
- var TestnetsAPI = class {
34
- logger;
35
- #baseUrl;
36
- #apiKey;
37
- #timeout;
38
- constructor(options = {}) {
39
- this.#baseUrl = (options.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
40
- this.#apiKey = options.apiKey;
41
- this.#timeout = options.timeout ?? DEFAULT_TIMEOUT;
42
- this.logger = options.logger?.child?.({ name: "TestnetsAPI" }) ?? options.logger;
43
- }
44
- /**
45
- * Base URL every request of this client is sent to.
46
- **/
47
- get baseUrl() {
48
- return this.#baseUrl;
49
- }
50
- /**
51
- * Every testnet anvil-manager knows of, persistent ones included.
52
- **/
53
- async list() {
54
- const url = this.#url("/api/v1/forks");
55
- const response = await this.#fetch(url, { method: "GET" });
56
- return this.#decode(url, response, zod_v4.z.array(require_testnets_schemas.testnetSchema));
57
- }
58
- /**
59
- * Status of one testnet.
60
- *
61
- * @param id - Execution id of the testnet.
62
- * @throws {@link TestnetNotFoundError} when there is no such testnet.
63
- **/
64
- async get(id) {
65
- const url = this.#forkUrl(id);
66
- const response = await this.#fetch(url, { method: "GET" });
67
- return this.#decode(url, response, require_testnets_schemas.testnetStatusSchema);
68
- }
69
- /**
70
- * Starts a testnet. It answers as soon as the testnet is created, long
71
- * before it is {@link TestnetStatus.ready}.
72
- *
73
- * @param files - Saved in the testnet's shared dir, where scripts and tasks
74
- * can read them.
75
- **/
76
- async create(request, files) {
77
- const url = this.#url("/api/v1/forks");
78
- const response = await this.#fetch(url, {
79
- method: "POST",
80
- ...createBody(request, files)
81
- });
82
- return this.#decode(url, response, require_testnets_schemas.testnetStatusSchema);
83
- }
84
- /**
85
- * Stops a testnet. Stopping one that is already stopped succeeds.
86
- *
87
- * @param id - Execution id of the testnet.
88
- * @throws {@link TestnetNotFoundError} when there is no such testnet.
89
- * @throws {@link TestnetStatusError} with status 400 when the testnet is
90
- * persistent.
91
- **/
92
- async kill(id) {
93
- await this.#fetch(this.#forkUrl(id), { method: "DELETE" });
94
- }
95
- /**
96
- * Polls a testnet's status until it is {@link TestnetStatus.ready}.
97
- *
98
- * @param id - Execution id of the testnet.
99
- * @returns The first status that is ready.
100
- * @throws {@link TestnetWaitTimeoutError} when the testnet is not ready in
101
- * time. Any error of a poll is thrown as is, without retrying.
102
- **/
103
- async waitUntilReady(id, options = {}) {
104
- const { timeout = DEFAULT_WAIT_TIMEOUT, interval = DEFAULT_WAIT_INTERVAL } = options;
105
- const deadline = Date.now() + timeout;
106
- while (true) {
107
- const status = await this.get(id);
108
- if (status.ready) return status;
109
- const remaining = deadline - Date.now();
110
- if (remaining <= 0) throw new require_testnets_errors_TestnetWaitTimeoutError.TestnetWaitTimeoutError(this.#forkUrl(id), id, timeout);
111
- this.logger?.debug(`testnet ${id} is not ready yet`);
112
- await new Promise((resolve) => setTimeout(resolve, Math.min(interval, remaining)));
113
- }
114
- }
115
- #url(path) {
116
- return `${this.#baseUrl}${path}`;
117
- }
118
- #forkUrl(id) {
119
- return this.#url(`/api/v1/forks/${encodeURIComponent(id)}`);
120
- }
121
- /**
122
- * Sends one request and returns its response once it is known to be 2xx.
123
- **/
124
- async #fetch(url, init) {
125
- const headers = new Headers(init.headers);
126
- headers.set("accept", "application/json");
127
- if (this.#apiKey) headers.set("authorization", `Bearer ${this.#apiKey}`);
128
- let response;
129
- try {
130
- response = await fetch(url, {
131
- ...init,
132
- headers,
133
- signal: AbortSignal.timeout(this.#timeout)
134
- });
135
- } catch (error) {
136
- throw new require_testnets_errors_TestnetRequestFailedError.TestnetRequestFailedError(url, error);
137
- }
138
- if (!response.ok) {
139
- const responseBody = await response.text();
140
- const details = errorBodySchema.safeParse(responseBody).data?.error;
141
- throw response.status === 404 ? new require_testnets_errors_TestnetNotFoundError.TestnetNotFoundError(url, details) : new require_testnets_errors_TestnetStatusError.TestnetStatusError(url, response.status, details);
142
- }
143
- return response;
144
- }
145
- /**
146
- * Body of a 2xx response, decoded.
147
- **/
148
- async #decode(url, response, schema) {
149
- const payload = await response.json();
150
- const parsed = schema.safeParse(payload);
151
- if (!parsed.success) {
152
- const error = new require_testnets_errors_TestnetValidationError.TestnetValidationError(url, parsed.error);
153
- this.logger?.error(error, "anvil-manager response does not match the testnet schemas");
154
- throw error;
155
- }
156
- return parsed.data;
157
- }
158
- };
159
- /**
160
- * Body and content type of a create request: JSON alone, or a multipart form
161
- * with the JSON in its `json` field when there are files to upload.
162
- **/
163
- function createBody(request, files) {
164
- const json = JSON.stringify(request);
165
- if (!files || Object.keys(files).length === 0) return {
166
- body: json,
167
- headers: { "content-type": "application/json" }
168
- };
169
- const form = new FormData();
170
- form.append("json", json);
171
- for (const [name, contents] of Object.entries(files)) form.append("file", toBlob(contents), name);
172
- return { body: form };
173
- }
174
- function toBlob(contents) {
175
- if (contents instanceof Blob) return contents;
176
- return new Blob([typeof contents === "string" ? contents : new Uint8Array(contents)]);
177
- }
178
- exports.TestnetsAPI = TestnetsAPI;
@@ -1,14 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_testnets_errors_TestnetStatusError = require("./TestnetStatusError.js");
3
- // src/testnets/errors/TestnetNotFoundError.ts
4
- /**
5
- * Thrown when anvil-manager answered 404: there is no testnet with that
6
- * execution id.
7
- **/
8
- var TestnetNotFoundError = class extends require_testnets_errors_TestnetStatusError.TestnetStatusError {
9
- name = "TestnetNotFoundError";
10
- constructor(url, details) {
11
- super(url, 404, details);
12
- }
13
- };
14
- exports.TestnetNotFoundError = TestnetNotFoundError;
@@ -1,23 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_testnets_errors_TestnetsError = require("./TestnetsError.js");
3
- // src/testnets/errors/TestnetRequestFailedError.ts
4
- /**
5
- * Thrown when a request to anvil-manager never completed: the network was
6
- * down, or it took longer than the client's timeout.
7
- **/
8
- var TestnetRequestFailedError = class extends require_testnets_errors_TestnetsError.TestnetsError {
9
- name = "TestnetRequestFailedError";
10
- constructor(url, cause) {
11
- super(timedOut(cause) ? "The request to anvil-manager timed out." : "The request to anvil-manager failed.", {
12
- url,
13
- cause
14
- });
15
- }
16
- };
17
- /**
18
- * Whether a caught value is the rejection `AbortSignal.timeout` produces.
19
- **/
20
- function timedOut(error) {
21
- return error instanceof Error && error.name === "TimeoutError";
22
- }
23
- exports.TestnetRequestFailedError = TestnetRequestFailedError;
@@ -1,18 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_testnets_errors_TestnetsError = require("./TestnetsError.js");
3
- // src/testnets/errors/TestnetStatusError.ts
4
- /**
5
- * Thrown when anvil-manager answered with a status outside the 2xx range. What
6
- * it said about it, when it said anything, is the `details` of the error.
7
- **/
8
- var TestnetStatusError = class extends require_testnets_errors_TestnetsError.TestnetsError {
9
- name = "TestnetStatusError";
10
- constructor(url, status, details) {
11
- super(`anvil-manager answered ${status}.`, {
12
- url,
13
- status,
14
- details
15
- });
16
- }
17
- };
18
- exports.TestnetStatusError = TestnetStatusError;
@@ -1,23 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_testnets_errors_TestnetsError = require("./TestnetsError.js");
3
- let zod_v4 = require("zod/v4");
4
- // src/testnets/errors/TestnetValidationError.ts
5
- /**
6
- * Thrown when anvil-manager answered, but with a payload the testnet schemas
7
- * do not describe, i.e. the two are of different versions.
8
- **/
9
- var TestnetValidationError = class extends require_testnets_errors_TestnetsError.TestnetsError {
10
- name = "TestnetValidationError";
11
- /**
12
- * The zod failure itself, e.g. for `z.treeifyError(error.zodError)`.
13
- **/
14
- zodError;
15
- constructor(url, zodError) {
16
- super("The anvil-manager response does not match the testnet schemas.", {
17
- url,
18
- metaMessages: zod_v4.z.prettifyError(zodError).split("\n")
19
- });
20
- this.zodError = zodError;
21
- }
22
- };
23
- exports.TestnetValidationError = TestnetValidationError;
@@ -1,29 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_testnets_errors_TestnetsError = require("./TestnetsError.js");
3
- // src/testnets/errors/TestnetWaitTimeoutError.ts
4
- /**
5
- * Thrown when a testnet did not become ready before the wait for it ran out.
6
- **/
7
- var TestnetWaitTimeoutError = class extends require_testnets_errors_TestnetsError.TestnetsError {
8
- name = "TestnetWaitTimeoutError";
9
- /**
10
- * Execution id of the testnet that was waited for.
11
- **/
12
- id;
13
- /**
14
- * How long the wait lasted, in milliseconds.
15
- **/
16
- timeout;
17
- /**
18
- * @param url - Status URL that was polled.
19
- **/
20
- constructor(url, id, timeout) {
21
- super(`Testnet ${id} did not become ready within ${timeout} ms.`, {
22
- url,
23
- metaMessages: [`Execution id: ${id}`, `Timeout: ${timeout} ms`]
24
- });
25
- this.id = id;
26
- this.timeout = timeout;
27
- }
28
- };
29
- exports.TestnetWaitTimeoutError = TestnetWaitTimeoutError;
@@ -1,33 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- let viem = require("viem");
3
- // src/testnets/errors/TestnetsError.ts
4
- /**
5
- * Thrown by every testnet API call that fails. Its subclasses say how it
6
- * failed; catch this one to catch all of them.
7
- **/
8
- var TestnetsError = class extends viem.BaseError {
9
- /**
10
- * URL that was requested.
11
- **/
12
- url;
13
- /**
14
- * Status anvil-manager answered with, absent when the request never
15
- * completed.
16
- **/
17
- status;
18
- constructor(summary, params) {
19
- const { cause, details } = params;
20
- super(summary, {
21
- cause: cause instanceof Error ? cause : void 0,
22
- details: cause === void 0 || cause instanceof Error ? details : String(cause),
23
- metaMessages: [
24
- `URL: ${params.url}`,
25
- ...params.status === void 0 ? [] : [`Status: ${params.status}`],
26
- ...params.metaMessages ?? []
27
- ]
28
- });
29
- this.url = params.url;
30
- this.status = params.status;
31
- }
32
- };
33
- exports.TestnetsError = TestnetsError;
@@ -1,13 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_testnets_errors_TestnetNotFoundError = require("./TestnetNotFoundError.js");
3
- const require_testnets_errors_TestnetRequestFailedError = require("./TestnetRequestFailedError.js");
4
- const require_testnets_errors_TestnetStatusError = require("./TestnetStatusError.js");
5
- const require_testnets_errors_TestnetsError = require("./TestnetsError.js");
6
- const require_testnets_errors_TestnetValidationError = require("./TestnetValidationError.js");
7
- const require_testnets_errors_TestnetWaitTimeoutError = require("./TestnetWaitTimeoutError.js");
8
- exports.TestnetNotFoundError = require_testnets_errors_TestnetNotFoundError.TestnetNotFoundError;
9
- exports.TestnetRequestFailedError = require_testnets_errors_TestnetRequestFailedError.TestnetRequestFailedError;
10
- exports.TestnetStatusError = require_testnets_errors_TestnetStatusError.TestnetStatusError;
11
- exports.TestnetValidationError = require_testnets_errors_TestnetValidationError.TestnetValidationError;
12
- exports.TestnetWaitTimeoutError = require_testnets_errors_TestnetWaitTimeoutError.TestnetWaitTimeoutError;
13
- exports.TestnetsError = require_testnets_errors_TestnetsError.TestnetsError;
@@ -1,32 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_testnets_errors_TestnetsError = require("./errors/TestnetsError.js");
3
- const require_testnets_errors_TestnetStatusError = require("./errors/TestnetStatusError.js");
4
- const require_testnets_errors_TestnetNotFoundError = require("./errors/TestnetNotFoundError.js");
5
- const require_testnets_errors_TestnetRequestFailedError = require("./errors/TestnetRequestFailedError.js");
6
- const require_testnets_errors_TestnetValidationError = require("./errors/TestnetValidationError.js");
7
- const require_testnets_errors_TestnetWaitTimeoutError = require("./errors/TestnetWaitTimeoutError.js");
8
- require("./errors/index.js");
9
- const require_testnets_schemas = require("./schemas.js");
10
- const require_testnets_TestnetsAPI = require("./TestnetsAPI.js");
11
- require("./types.js");
12
- exports.TestnetNotFoundError = require_testnets_errors_TestnetNotFoundError.TestnetNotFoundError;
13
- exports.TestnetRequestFailedError = require_testnets_errors_TestnetRequestFailedError.TestnetRequestFailedError;
14
- exports.TestnetStatusError = require_testnets_errors_TestnetStatusError.TestnetStatusError;
15
- exports.TestnetValidationError = require_testnets_errors_TestnetValidationError.TestnetValidationError;
16
- exports.TestnetWaitTimeoutError = require_testnets_errors_TestnetWaitTimeoutError.TestnetWaitTimeoutError;
17
- exports.TestnetsAPI = require_testnets_TestnetsAPI.TestnetsAPI;
18
- exports.TestnetsError = require_testnets_errors_TestnetsError.TestnetsError;
19
- exports.testnetBackendOptionsSchema = require_testnets_schemas.testnetBackendOptionsSchema;
20
- exports.testnetBackendStateSchema = require_testnets_schemas.testnetBackendStateSchema;
21
- exports.testnetBackendStatusSchema = require_testnets_schemas.testnetBackendStatusSchema;
22
- exports.testnetBlockSchema = require_testnets_schemas.testnetBlockSchema;
23
- exports.testnetOptionsSchema = require_testnets_schemas.testnetOptionsSchema;
24
- exports.testnetSchema = require_testnets_schemas.testnetSchema;
25
- exports.testnetScriptBlockSchema = require_testnets_schemas.testnetScriptBlockSchema;
26
- exports.testnetScriptOptionsSchema = require_testnets_schemas.testnetScriptOptionsSchema;
27
- exports.testnetScriptSchema = require_testnets_schemas.testnetScriptSchema;
28
- exports.testnetStageStatusSchema = require_testnets_schemas.testnetStageStatusSchema;
29
- exports.testnetStatusSchema = require_testnets_schemas.testnetStatusSchema;
30
- exports.testnetTaskDefinitionSchema = require_testnets_schemas.testnetTaskDefinitionSchema;
31
- exports.testnetTaskProgressSchema = require_testnets_schemas.testnetTaskProgressSchema;
32
- exports.testnetTaskSchema = require_testnets_schemas.testnetTaskSchema;
@@ -1 +0,0 @@
1
- {"type": "commonjs"}