@gearbox-protocol/sdk 14.11.3 → 14.12.0-next.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/abi/iZapper.js +62 -24
- package/dist/cjs/common-utils/utils/index.js +2 -0
- package/dist/cjs/{history/trace-utils.js → common-utils/utils/trace.js} +62 -5
- package/dist/cjs/dev/AccountOpener.js +7 -13
- package/dist/cjs/dev/index.js +3 -1
- package/dist/cjs/dev/verifyTestnet.js +52 -0
- package/dist/cjs/history/assembleOperations.js +6 -6
- package/dist/cjs/history/classifyMulticallOperations.js +33 -25
- package/dist/cjs/history/index.js +0 -2
- package/dist/cjs/history/mapOperations.js +7 -0
- package/dist/cjs/history/parseCreditAccountTransaction.js +5 -6
- package/dist/cjs/history/toLegacyOperation.js +5 -1
- package/dist/cjs/plugins/adapters/abi/iConvexV1BoosterAdapter.js +143 -0
- package/dist/cjs/plugins/adapters/abi/index.js +2 -0
- package/dist/cjs/plugins/adapters/contracts/AbstractAdapter.js +61 -37
- package/dist/cjs/plugins/adapters/contracts/AbstractCurveAdapter.js +66 -0
- package/dist/cjs/plugins/adapters/contracts/AccountMigratorAdapterContract.js +9 -0
- package/dist/cjs/plugins/adapters/contracts/BalancerV3RouterAdapterContract.js +19 -0
- package/dist/cjs/plugins/adapters/contracts/BalancerV3WrapperAdapterContract.js +15 -0
- package/dist/cjs/plugins/adapters/contracts/CamelotV3AdapterContract.js +20 -0
- package/dist/cjs/plugins/adapters/contracts/ConvexV1BaseRewardPoolAdapterContract.js +18 -0
- package/dist/cjs/plugins/adapters/contracts/ConvexV1BoosterAdapterContract.js +28 -2
- package/dist/cjs/plugins/adapters/contracts/Curve2AssetsAdapterContract.js +2 -7
- package/dist/cjs/plugins/adapters/contracts/Curve3AssetsAdapterContract.js +2 -7
- package/dist/cjs/plugins/adapters/contracts/Curve4AssetsAdapterContract.js +2 -7
- package/dist/cjs/plugins/adapters/contracts/CurveV1AdapterDeposit.js +2 -2
- package/dist/cjs/plugins/adapters/contracts/CurveV1AdapterStETHContract.js +2 -7
- package/dist/cjs/plugins/adapters/contracts/CurveV1StableNGAdapterContract.js +2 -7
- package/dist/cjs/plugins/adapters/contracts/DaiUsdsAdapterContract.js +14 -0
- package/dist/cjs/plugins/adapters/contracts/ERC4626AdapterContract.js +15 -0
- package/dist/cjs/plugins/adapters/contracts/ERC4626ReferralAdapterContract.js +14 -0
- package/dist/cjs/plugins/adapters/contracts/FluidDexAdapterContract.js +15 -0
- package/dist/cjs/plugins/adapters/contracts/InfinifiGatewayAdapterContract.js +21 -0
- package/dist/cjs/plugins/adapters/contracts/KelpLRTDepositPoolAdapterContract.js +10 -0
- package/dist/cjs/plugins/adapters/contracts/LidoV1AdapterContract.js +11 -0
- package/dist/cjs/plugins/adapters/contracts/MellowDVVAdapterContract.js +15 -0
- package/dist/cjs/plugins/adapters/contracts/MellowERC4626VaultAdapterContract.js +15 -0
- package/dist/cjs/plugins/adapters/contracts/MellowWrapperAdapterContract.js +11 -0
- package/dist/cjs/plugins/adapters/contracts/MidasIssuanceVaultAdapterContract.js +10 -0
- package/dist/cjs/plugins/adapters/contracts/MidasRedemptionVaultAdapterContract.js +12 -0
- package/dist/cjs/plugins/adapters/contracts/PendleRouterAdapterContract.js +58 -0
- package/dist/cjs/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.js +11 -0
- package/dist/cjs/plugins/adapters/contracts/SecuritizeSwapAdapterContract.js +22 -1
- package/dist/cjs/plugins/adapters/contracts/StakingRewardsAdapterContract.js +17 -0
- package/dist/cjs/plugins/adapters/contracts/TraderJoeRouterAdapterContract.js +10 -0
- package/dist/cjs/plugins/adapters/contracts/UniswapV2AdapterContract.js +10 -0
- package/dist/cjs/plugins/adapters/contracts/UniswapV3AdapterContract.js +20 -0
- package/dist/cjs/plugins/adapters/contracts/UniswapV4AdapterContract.js +15 -0
- package/dist/cjs/plugins/adapters/contracts/UpshiftVaultAdapterContract.js +14 -0
- package/dist/cjs/plugins/adapters/contracts/VelodromeV2AdapterContract.js +10 -0
- package/dist/cjs/plugins/adapters/contracts/WstETHV1AdapterContract.js +15 -0
- package/dist/cjs/{history/internal-types.js → plugins/adapters/transfers.js} +2 -2
- package/dist/cjs/preview/index.js +26 -0
- package/dist/cjs/preview/package.json +1 -0
- package/dist/cjs/preview/parse/classifyInnerOperations.js +105 -0
- package/dist/cjs/preview/parse/errors.js +50 -0
- package/dist/cjs/preview/parse/index.js +34 -0
- package/dist/cjs/preview/parse/parseFacadeOperationCalldata.js +108 -0
- package/dist/cjs/preview/parse/parseOperationCalldata.js +85 -0
- package/dist/cjs/preview/parse/parsePoolOperationCalldata.js +89 -0
- package/dist/cjs/preview/parse/parseRWAFactoryOperationCalldata.js +104 -0
- package/dist/cjs/{history/inner-operations.js → preview/parse/types-adapters.js} +2 -2
- package/dist/cjs/preview/parse/types-facades.js +16 -0
- package/dist/cjs/preview/parse/types-pools.js +16 -0
- package/dist/cjs/preview/parse/types-rwa.js +16 -0
- package/dist/cjs/preview/parse/types.js +44 -0
- package/dist/cjs/preview/prerequisites/AllowancePrerequisite.js +78 -0
- package/dist/cjs/preview/prerequisites/BalancePrerequisite.js +95 -0
- package/dist/cjs/preview/prerequisites/Prerequisite.js +85 -0
- package/dist/cjs/preview/prerequisites/RWAOpenRequirementsPrerequisite.js +66 -0
- package/dist/cjs/preview/prerequisites/buildPrerequisites.js +297 -0
- package/dist/cjs/preview/prerequisites/index.js +36 -0
- package/dist/cjs/preview/prerequisites/prepareAction.js +48 -0
- package/dist/cjs/preview/prerequisites/runPrerequisites.js +71 -0
- package/dist/cjs/preview/prerequisites/types.js +16 -0
- package/dist/cjs/preview/preview/applyInnerOperations.js +132 -0
- package/dist/cjs/preview/preview/errors.js +52 -0
- package/dist/cjs/preview/preview/index.js +30 -0
- package/dist/cjs/preview/preview/previewAdjustCreditAccount.js +95 -0
- package/dist/cjs/preview/preview/previewOpenCreditAccount.js +69 -0
- package/dist/cjs/preview/preview/previewOperation.js +45 -0
- package/dist/cjs/preview/preview/previewPoolOperation.js +75 -0
- package/dist/cjs/preview/preview/types.js +16 -0
- package/dist/cjs/preview/preview/unwrapNativeCollateral.js +45 -0
- package/dist/cjs/preview/simulate/errors.js +91 -0
- package/dist/cjs/preview/simulate/index.js +40 -0
- package/dist/cjs/preview/simulate/simulateFacadeOperation.js +30 -0
- package/dist/cjs/preview/simulate/simulateOperation.js +41 -0
- package/dist/cjs/preview/simulate/simulatePoolOperation.js +91 -0
- package/dist/cjs/preview/simulate/simulateRWAOperation.js +30 -0
- package/dist/cjs/preview/simulate/types.js +16 -0
- package/dist/cjs/{history → preview/trace}/errors.js +0 -26
- package/dist/cjs/preview/trace/extractAdapterCallTraces.js +58 -0
- package/dist/cjs/{history → preview/trace}/extractTransfers.js +9 -12
- package/dist/cjs/{history → preview/trace}/findFacadeCalls.js +3 -3
- package/dist/cjs/preview/trace/index.js +30 -0
- package/dist/cjs/preview/trace/types.js +16 -0
- package/dist/cjs/sdk/MultichainSDK.js +1 -0
- package/dist/cjs/sdk/OnchainSDK.js +7 -3
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +157 -4
- package/dist/cjs/sdk/base/BaseContract.js +4 -2
- package/dist/cjs/sdk/base/ChainContractsRegister.js +1 -0
- package/dist/cjs/sdk/market/MarketRegister.js +10 -5
- package/dist/cjs/sdk/market/ZapperRegister.js +54 -0
- package/dist/cjs/sdk/market/rwa/securitize/SecuritizeRWAFactory.js +30 -0
- package/dist/cjs/sdk/market/rwa/types.js +5 -2
- package/dist/cjs/sdk/market/zapper/IERC20ZapperContract.js +3 -38
- package/dist/cjs/sdk/market/zapper/IETHZapperContract.js +3 -38
- package/dist/cjs/sdk/market/zapper/ZapperContract.js +106 -0
- package/dist/cjs/sdk/market/zapper/createZapper.js +12 -4
- package/dist/cjs/sdk/market/zapper/{Zapper.js → errors.js} +13 -23
- package/dist/cjs/sdk/market/zapper/index.js +6 -2
- package/dist/cjs/sdk/market/zapper/types.js +16 -0
- package/dist/cjs/sdk/options.js +41 -17
- package/dist/cjs/sdk/router/AbstractRouterContract.js +21 -27
- package/dist/cjs/sdk/router/RouterV310Contract.js +11 -12
- package/dist/cjs/sdk/router/helpers.js +0 -5
- package/dist/cjs/sdk/utils/AddressMap.js +6 -0
- package/dist/cjs/sdk/utils/AssetsMap.js +62 -0
- package/dist/cjs/sdk/utils/index.js +2 -0
- package/dist/esm/abi/iZapper.js +62 -24
- package/dist/esm/common-utils/utils/index.js +1 -0
- package/dist/esm/common-utils/utils/trace.js +93 -0
- package/dist/esm/dev/AccountOpener.js +8 -13
- package/dist/esm/dev/index.js +1 -0
- package/dist/esm/dev/verifyTestnet.js +27 -0
- package/dist/esm/history/assembleOperations.js +8 -6
- package/dist/esm/history/classifyMulticallOperations.js +31 -23
- package/dist/esm/history/index.js +0 -1
- package/dist/esm/history/mapOperations.js +7 -0
- package/dist/esm/history/parseCreditAccountTransaction.js +3 -4
- package/dist/esm/history/toLegacyOperation.js +5 -1
- package/dist/esm/plugins/adapters/abi/iConvexV1BoosterAdapter.js +119 -0
- package/dist/esm/plugins/adapters/abi/index.js +1 -0
- package/dist/esm/plugins/adapters/contracts/AbstractAdapter.js +64 -38
- package/dist/esm/plugins/adapters/contracts/AbstractCurveAdapter.js +42 -0
- package/dist/esm/plugins/adapters/contracts/AccountMigratorAdapterContract.js +9 -0
- package/dist/esm/plugins/adapters/contracts/BalancerV3RouterAdapterContract.js +22 -1
- package/dist/esm/plugins/adapters/contracts/BalancerV3WrapperAdapterContract.js +18 -1
- package/dist/esm/plugins/adapters/contracts/CamelotV3AdapterContract.js +23 -1
- package/dist/esm/plugins/adapters/contracts/ConvexV1BaseRewardPoolAdapterContract.js +22 -1
- package/dist/esm/plugins/adapters/contracts/ConvexV1BoosterAdapterContract.js +30 -2
- package/dist/esm/plugins/adapters/contracts/Curve2AssetsAdapterContract.js +2 -7
- package/dist/esm/plugins/adapters/contracts/Curve3AssetsAdapterContract.js +2 -7
- package/dist/esm/plugins/adapters/contracts/Curve4AssetsAdapterContract.js +2 -7
- package/dist/esm/plugins/adapters/contracts/CurveV1AdapterDeposit.js +2 -2
- package/dist/esm/plugins/adapters/contracts/CurveV1AdapterStETHContract.js +2 -7
- package/dist/esm/plugins/adapters/contracts/CurveV1StableNGAdapterContract.js +2 -7
- package/dist/esm/plugins/adapters/contracts/DaiUsdsAdapterContract.js +17 -1
- package/dist/esm/plugins/adapters/contracts/ERC4626AdapterContract.js +19 -1
- package/dist/esm/plugins/adapters/contracts/ERC4626ReferralAdapterContract.js +17 -1
- package/dist/esm/plugins/adapters/contracts/FluidDexAdapterContract.js +18 -1
- package/dist/esm/plugins/adapters/contracts/InfinifiGatewayAdapterContract.js +24 -1
- package/dist/esm/plugins/adapters/contracts/KelpLRTDepositPoolAdapterContract.js +13 -1
- package/dist/esm/plugins/adapters/contracts/LidoV1AdapterContract.js +14 -1
- package/dist/esm/plugins/adapters/contracts/MellowDVVAdapterContract.js +18 -1
- package/dist/esm/plugins/adapters/contracts/MellowERC4626VaultAdapterContract.js +18 -1
- package/dist/esm/plugins/adapters/contracts/MellowWrapperAdapterContract.js +14 -1
- package/dist/esm/plugins/adapters/contracts/MidasIssuanceVaultAdapterContract.js +13 -1
- package/dist/esm/plugins/adapters/contracts/MidasRedemptionVaultAdapterContract.js +15 -1
- package/dist/esm/plugins/adapters/contracts/PendleRouterAdapterContract.js +61 -1
- package/dist/esm/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.js +14 -1
- package/dist/esm/plugins/adapters/contracts/SecuritizeSwapAdapterContract.js +25 -2
- package/dist/esm/plugins/adapters/contracts/StakingRewardsAdapterContract.js +20 -1
- package/dist/esm/plugins/adapters/contracts/TraderJoeRouterAdapterContract.js +13 -1
- package/dist/esm/plugins/adapters/contracts/UniswapV2AdapterContract.js +10 -0
- package/dist/esm/plugins/adapters/contracts/UniswapV3AdapterContract.js +20 -0
- package/dist/esm/plugins/adapters/contracts/UniswapV4AdapterContract.js +18 -1
- package/dist/esm/plugins/adapters/contracts/UpshiftVaultAdapterContract.js +17 -1
- package/dist/esm/plugins/adapters/contracts/VelodromeV2AdapterContract.js +13 -1
- package/dist/esm/plugins/adapters/contracts/WstETHV1AdapterContract.js +18 -1
- package/dist/esm/preview/index.js +3 -0
- package/dist/esm/preview/package.json +1 -0
- package/dist/esm/preview/parse/classifyInnerOperations.js +81 -0
- package/dist/esm/preview/parse/errors.js +24 -0
- package/dist/esm/preview/parse/index.js +7 -0
- package/dist/esm/preview/parse/parseFacadeOperationCalldata.js +84 -0
- package/dist/esm/preview/parse/parseOperationCalldata.js +66 -0
- package/dist/esm/preview/parse/parsePoolOperationCalldata.js +65 -0
- package/dist/esm/preview/parse/parseRWAFactoryOperationCalldata.js +85 -0
- package/dist/esm/preview/parse/types-facades.js +0 -0
- package/dist/esm/preview/parse/types-pools.js +0 -0
- package/dist/esm/preview/parse/types-rwa.js +0 -0
- package/dist/esm/preview/parse/types.js +14 -0
- package/dist/esm/preview/prerequisites/AllowancePrerequisite.js +57 -0
- package/dist/esm/preview/prerequisites/BalancePrerequisite.js +74 -0
- package/dist/esm/preview/prerequisites/Prerequisite.js +63 -0
- package/dist/esm/preview/prerequisites/RWAOpenRequirementsPrerequisite.js +42 -0
- package/dist/esm/preview/prerequisites/buildPrerequisites.js +279 -0
- package/dist/esm/preview/prerequisites/index.js +8 -0
- package/dist/esm/preview/prerequisites/prepareAction.js +23 -0
- package/dist/esm/preview/prerequisites/runPrerequisites.js +47 -0
- package/dist/esm/preview/prerequisites/types.js +0 -0
- package/dist/esm/preview/preview/applyInnerOperations.js +110 -0
- package/dist/esm/preview/preview/errors.js +27 -0
- package/dist/esm/preview/preview/index.js +5 -0
- package/dist/esm/preview/preview/previewAdjustCreditAccount.js +79 -0
- package/dist/esm/preview/preview/previewOpenCreditAccount.js +51 -0
- package/dist/esm/preview/preview/previewOperation.js +21 -0
- package/dist/esm/preview/preview/previewPoolOperation.js +53 -0
- package/dist/esm/preview/preview/types.js +0 -0
- package/dist/esm/preview/preview/unwrapNativeCollateral.js +21 -0
- package/dist/esm/preview/simulate/errors.js +69 -0
- package/dist/esm/preview/simulate/index.js +12 -0
- package/dist/esm/preview/simulate/simulateFacadeOperation.js +6 -0
- package/dist/esm/preview/simulate/simulateOperation.js +20 -0
- package/dist/esm/preview/simulate/simulatePoolOperation.js +67 -0
- package/dist/esm/preview/simulate/simulateRWAOperation.js +6 -0
- package/dist/esm/preview/simulate/types.js +0 -0
- package/dist/esm/{history → preview/trace}/errors.js +0 -24
- package/dist/esm/preview/trace/extractAdapterCallTraces.js +40 -0
- package/dist/esm/{history → preview/trace}/extractTransfers.js +9 -12
- package/dist/esm/{history → preview/trace}/findFacadeCalls.js +4 -2
- package/dist/esm/preview/trace/index.js +5 -0
- package/dist/esm/preview/trace/types.js +0 -0
- package/dist/esm/sdk/MultichainSDK.js +1 -0
- package/dist/esm/sdk/OnchainSDK.js +7 -3
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +158 -5
- package/dist/esm/sdk/base/BaseContract.js +4 -2
- package/dist/esm/sdk/base/ChainContractsRegister.js +1 -0
- package/dist/esm/sdk/market/MarketRegister.js +10 -5
- package/dist/esm/sdk/market/ZapperRegister.js +54 -0
- package/dist/esm/sdk/market/rwa/securitize/SecuritizeRWAFactory.js +33 -1
- package/dist/esm/sdk/market/rwa/types.js +5 -2
- package/dist/esm/sdk/market/zapper/IERC20ZapperContract.js +3 -38
- package/dist/esm/sdk/market/zapper/IETHZapperContract.js +3 -38
- package/dist/esm/sdk/market/zapper/ZapperContract.js +82 -0
- package/dist/esm/sdk/market/zapper/createZapper.js +12 -4
- package/dist/esm/sdk/market/zapper/errors.js +13 -0
- package/dist/esm/sdk/market/zapper/index.js +3 -1
- package/dist/esm/sdk/market/zapper/types.js +0 -0
- package/dist/esm/sdk/options.js +39 -15
- package/dist/esm/sdk/router/AbstractRouterContract.js +25 -29
- package/dist/esm/sdk/router/RouterV310Contract.js +11 -12
- package/dist/esm/sdk/router/helpers.js +0 -4
- package/dist/esm/sdk/utils/AddressMap.js +6 -0
- package/dist/esm/sdk/utils/AssetsMap.js +38 -0
- package/dist/esm/sdk/utils/index.js +1 -0
- package/dist/types/abi/iERC20Zapper.d.ts +91 -23
- package/dist/types/abi/iETHZapper.d.ts +91 -23
- package/dist/types/abi/iZapper.d.ts +91 -23
- package/dist/types/common-utils/utils/index.d.ts +1 -0
- package/dist/types/common-utils/utils/strategies/assets/assets.d.ts +1 -1
- package/dist/types/common-utils/utils/strategies/credit-managers/get-wallet-balances-allowed-on-cm.d.ts +1 -1
- package/dist/types/common-utils/utils/strategies/strategy-info/calculate-total-apy.d.ts +1 -1
- package/dist/types/common-utils/utils/strategies/strategy-info/calculate-total-points.d.ts +1 -1
- package/dist/types/common-utils/utils/strategies/tokens/add-amount-in-target.d.ts +1 -1
- package/dist/types/common-utils/utils/strategies/tokens/get-list-with-amount-in-target.d.ts +1 -1
- package/dist/types/common-utils/utils/strategies/types/strategy-earnings.d.ts +1 -1
- package/dist/types/common-utils/utils/trace.d.ts +73 -0
- package/dist/types/common-utils/utils/validation/validate-balances.d.ts +1 -1
- package/dist/types/common-utils/utils/validation/validate-open-account.d.ts +1 -1
- package/dist/types/common-utils/utils/validation/validate-quota.d.ts +1 -1
- package/dist/types/common-utils/utils/validation/validate-token-to-obtain.d.ts +1 -1
- package/dist/types/dev/index.d.ts +1 -0
- package/dist/types/dev/verifyTestnet.d.ts +24 -0
- package/dist/types/history/assembleOperations.d.ts +11 -6
- package/dist/types/history/classifyMulticallOperations.d.ts +21 -9
- package/dist/types/history/index.d.ts +0 -1
- package/dist/types/history/mapOperations.d.ts +7 -9
- package/dist/types/history/types.d.ts +22 -71
- package/dist/types/plugins/adapters/abi/iConvexV1BoosterAdapter.d.ts +204 -0
- package/dist/types/plugins/adapters/abi/index.d.ts +1 -0
- package/dist/types/plugins/adapters/contracts/AbstractAdapter.d.ts +33 -16
- package/dist/types/plugins/adapters/contracts/AbstractCurveAdapter.d.ts +18 -0
- package/dist/types/plugins/adapters/contracts/AccountMigratorAdapterContract.d.ts +10 -1
- package/dist/types/plugins/adapters/contracts/BalancerV3RouterAdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/BalancerV3WrapperAdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/CamelotV3AdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/ConvexV1BaseRewardPoolAdapterContract.d.ts +5 -3
- package/dist/types/plugins/adapters/contracts/ConvexV1BoosterAdapterContract.d.ts +9 -7
- package/dist/types/plugins/adapters/contracts/Curve2AssetsAdapterContract.d.ts +3 -6
- package/dist/types/plugins/adapters/contracts/Curve3AssetsAdapterContract.d.ts +3 -6
- package/dist/types/plugins/adapters/contracts/Curve4AssetsAdapterContract.d.ts +3 -6
- package/dist/types/plugins/adapters/contracts/CurveV1AdapterDeposit.d.ts +3 -3
- package/dist/types/plugins/adapters/contracts/CurveV1AdapterStETHContract.d.ts +3 -6
- package/dist/types/plugins/adapters/contracts/CurveV1StableNGAdapterContract.d.ts +3 -6
- package/dist/types/plugins/adapters/contracts/DaiUsdsAdapterContract.d.ts +5 -3
- package/dist/types/plugins/adapters/contracts/ERC4626AdapterContract.d.ts +5 -3
- package/dist/types/plugins/adapters/contracts/ERC4626ReferralAdapterContract.d.ts +5 -3
- package/dist/types/plugins/adapters/contracts/FluidDexAdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/InfinifiGatewayAdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/KelpLRTDepositPoolAdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/LidoV1AdapterContract.d.ts +5 -3
- package/dist/types/plugins/adapters/contracts/MellowDVVAdapterContract.d.ts +5 -3
- package/dist/types/plugins/adapters/contracts/MellowERC4626VaultAdapterContract.d.ts +5 -3
- package/dist/types/plugins/adapters/contracts/MellowWrapperAdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/MidasIssuanceVaultAdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/MidasRedemptionVaultAdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/PendleRouterAdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/SecuritizeOnRampAdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/SecuritizeSwapAdapterContract.d.ts +15 -3
- package/dist/types/plugins/adapters/contracts/StakingRewardsAdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/TraderJoeRouterAdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/UniswapV2AdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/UniswapV3AdapterContract.d.ts +3 -1
- package/dist/types/plugins/adapters/contracts/UniswapV4AdapterContract.d.ts +5 -3
- package/dist/types/plugins/adapters/contracts/UpshiftVaultAdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/VelodromeV2AdapterContract.d.ts +4 -2
- package/dist/types/plugins/adapters/contracts/WstETHV1AdapterContract.d.ts +5 -3
- package/dist/types/plugins/adapters/transferHelpers.d.ts +1 -1
- package/dist/types/plugins/adapters/transfers.d.ts +17 -0
- package/dist/types/plugins/adapters/types.d.ts +18 -46
- package/dist/types/preview/index.d.ts +3 -0
- package/dist/types/preview/parse/classifyInnerOperations.d.ts +19 -0
- package/dist/types/preview/parse/errors.d.ts +18 -0
- package/dist/types/preview/parse/index.d.ts +7 -0
- package/dist/types/preview/parse/parseFacadeOperationCalldata.d.ts +19 -0
- package/dist/types/preview/parse/parseOperationCalldata.d.ts +23 -0
- package/dist/types/preview/parse/parsePoolOperationCalldata.d.ts +17 -0
- package/dist/types/preview/parse/parseRWAFactoryOperationCalldata.d.ts +22 -0
- package/dist/types/preview/parse/types-adapters.d.ts +73 -0
- package/dist/types/preview/parse/types-facades.d.ts +147 -0
- package/dist/types/preview/parse/types-pools.d.ts +143 -0
- package/dist/types/preview/parse/types-rwa.d.ts +48 -0
- package/dist/types/preview/parse/types.d.ts +49 -0
- package/dist/types/preview/prerequisites/AllowancePrerequisite.d.ts +22 -0
- package/dist/types/preview/prerequisites/BalancePrerequisite.d.ts +26 -0
- package/dist/types/preview/prerequisites/Prerequisite.d.ts +60 -0
- package/dist/types/preview/prerequisites/RWAOpenRequirementsPrerequisite.d.ts +36 -0
- package/dist/types/preview/prerequisites/buildPrerequisites.d.ts +25 -0
- package/dist/types/preview/prerequisites/index.d.ts +8 -0
- package/dist/types/preview/prerequisites/prepareAction.d.ts +52 -0
- package/dist/types/preview/prerequisites/runPrerequisites.d.ts +12 -0
- package/dist/types/preview/prerequisites/types.d.ts +80 -0
- package/dist/types/preview/preview/applyInnerOperations.d.ts +77 -0
- package/dist/types/preview/preview/errors.d.ts +21 -0
- package/dist/types/preview/preview/index.d.ts +5 -0
- package/dist/types/preview/preview/previewAdjustCreditAccount.d.ts +11 -0
- package/dist/types/preview/preview/previewOpenCreditAccount.d.ts +4 -0
- package/dist/types/preview/preview/previewOperation.d.ts +7 -0
- package/dist/types/preview/preview/previewPoolOperation.d.ts +5 -0
- package/dist/types/preview/preview/types.d.ts +177 -0
- package/dist/types/preview/preview/unwrapNativeCollateral.d.ts +20 -0
- package/dist/types/preview/simulate/errors.d.ts +45 -0
- package/dist/types/preview/simulate/index.d.ts +10 -0
- package/dist/types/preview/simulate/simulateFacadeOperation.d.ts +23 -0
- package/dist/types/preview/simulate/simulateOperation.d.ts +18 -0
- package/dist/types/preview/simulate/simulatePoolOperation.d.ts +14 -0
- package/dist/types/preview/simulate/simulateRWAOperation.d.ts +23 -0
- package/dist/types/preview/simulate/types.d.ts +52 -0
- package/dist/types/{history → preview/trace}/errors.d.ts +0 -10
- package/dist/types/preview/trace/extractAdapterCallTraces.d.ts +23 -0
- package/dist/types/{history → preview/trace}/extractTransfers.d.ts +14 -5
- package/dist/types/{history → preview/trace}/findFacadeCalls.d.ts +3 -2
- package/dist/types/preview/trace/index.d.ts +5 -0
- package/dist/types/preview/trace/types.d.ts +21 -0
- package/dist/types/sdk/MultichainSDK.d.ts +5 -0
- package/dist/types/sdk/OnchainSDK.d.ts +4 -0
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +22 -2
- package/dist/types/sdk/accounts/types.d.ts +84 -2
- package/dist/types/sdk/base/BaseContract.d.ts +1 -1
- package/dist/types/sdk/base/TokensMeta.d.ts +1 -1
- package/dist/types/sdk/base/types.d.ts +18 -0
- package/dist/types/sdk/market/MarketRegister.d.ts +15 -6
- package/dist/types/sdk/market/ZapperRegister.d.ts +25 -4
- package/dist/types/sdk/market/rwa/securitize/SecuritizeRWAFactory.d.ts +6 -1
- package/dist/types/sdk/market/rwa/types.d.ts +13 -5
- package/dist/types/sdk/market/zapper/IERC20ZapperContract.d.ts +93 -39
- package/dist/types/sdk/market/zapper/IETHZapperContract.d.ts +93 -39
- package/dist/types/sdk/market/zapper/ZapperContract.d.ts +35 -0
- package/dist/types/sdk/market/zapper/createZapper.d.ts +2 -4
- package/dist/types/sdk/market/zapper/errors.d.ts +10 -0
- package/dist/types/sdk/market/zapper/index.d.ts +3 -1
- package/dist/types/sdk/market/zapper/types.d.ts +64 -0
- package/dist/types/sdk/options.d.ts +10 -5
- package/dist/types/sdk/pools/types.d.ts +4 -4
- package/dist/types/sdk/router/AbstractRouterContract.d.ts +5 -5
- package/dist/types/sdk/router/helpers.d.ts +1 -2
- package/dist/types/sdk/router/types.d.ts +1 -15
- package/dist/types/sdk/types/state-human.d.ts +9 -0
- package/dist/types/sdk/types/state.d.ts +7 -0
- package/dist/types/sdk/utils/AddressMap.d.ts +4 -0
- package/dist/types/sdk/utils/AssetsMap.d.ts +27 -0
- package/dist/types/sdk/utils/index.d.ts +1 -0
- package/package.json +8 -3
- package/dist/cjs/history/extractProtocolCalls.js +0 -53
- package/dist/esm/history/extractProtocolCalls.js +0 -32
- package/dist/esm/history/trace-utils.js +0 -36
- package/dist/esm/sdk/market/zapper/Zapper.js +0 -23
- package/dist/types/history/extractProtocolCalls.d.ts +0 -8
- package/dist/types/history/inner-operations.d.ts +0 -57
- package/dist/types/history/internal-types.d.ts +0 -47
- package/dist/types/history/trace-utils.d.ts +0 -12
- package/dist/types/sdk/market/zapper/Zapper.d.ts +0 -13
- /package/dist/esm/{history/inner-operations.js → plugins/adapters/transfers.js} +0 -0
- /package/dist/esm/{history/internal-types.js → preview/parse/types-adapters.js} +0 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
/**
|
|
3
|
+
* ERC4626 `deposit` into a Gearbox pool.
|
|
4
|
+
*
|
|
5
|
+
* A deposit can reach the pool directly (an ERC4626 call sent straight to the
|
|
6
|
+
* pool contract) or through a zapper (e.g. RWA-default pools and classic zapper
|
|
7
|
+
* pools). When routed through a zapper, `zapper` is the call target and
|
|
8
|
+
* `tokenIn` is the zapper's input token rather than the pool underlying.
|
|
9
|
+
*/
|
|
10
|
+
export interface PoolDepositOperation {
|
|
11
|
+
/** ERC4626 operation kind. */
|
|
12
|
+
operation: "Deposit";
|
|
13
|
+
/** Destination pool the assets are deposited into. */
|
|
14
|
+
pool: Address;
|
|
15
|
+
/** Address credited with the minted pool shares. */
|
|
16
|
+
receiver: Address;
|
|
17
|
+
/** Amount of underlying assets supplied to the pool. */
|
|
18
|
+
assets: bigint;
|
|
19
|
+
/** Underlying token of the destination pool. */
|
|
20
|
+
underlying: Address;
|
|
21
|
+
/**
|
|
22
|
+
* Token actually supplied by the caller: the pool underlying for direct
|
|
23
|
+
* deposits, or the zapper's input token for zapper-routed deposits.
|
|
24
|
+
*/
|
|
25
|
+
tokenIn: Address;
|
|
26
|
+
/**
|
|
27
|
+
* Token minted to the receiver: the pool's diesel token for direct
|
|
28
|
+
* deposits, or the zapper's output token (e.g. a farmed/staked diesel
|
|
29
|
+
* wrapper) for zapper-routed deposits.
|
|
30
|
+
*/
|
|
31
|
+
tokenOut: Address;
|
|
32
|
+
/** Zapper contract the call is sent to; `undefined` for direct deposits. */
|
|
33
|
+
zapper?: Address;
|
|
34
|
+
/** Referral code, present only for `depositWithReferral` calls. */
|
|
35
|
+
referralCode?: bigint;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* ERC4626 `mint` into a Gearbox pool. Unlike `deposit`, the caller specifies the
|
|
39
|
+
* amount of shares to mint; the assets pulled are resolved by the pool.
|
|
40
|
+
*/
|
|
41
|
+
export interface PoolMintOperation {
|
|
42
|
+
/** ERC4626 operation kind. */
|
|
43
|
+
operation: "Mint";
|
|
44
|
+
/** Destination pool the shares are minted from. */
|
|
45
|
+
pool: Address;
|
|
46
|
+
/** Address credited with the minted pool shares. */
|
|
47
|
+
receiver: Address;
|
|
48
|
+
/** Pool shares (diesel) minted to the receiver. */
|
|
49
|
+
shares: bigint;
|
|
50
|
+
/** Underlying token of the destination pool. */
|
|
51
|
+
underlying: Address;
|
|
52
|
+
/**
|
|
53
|
+
* Token actually supplied by the caller: the pool underlying for direct
|
|
54
|
+
* mints, or the zapper's input token for zapper-routed mints.
|
|
55
|
+
*/
|
|
56
|
+
tokenIn: Address;
|
|
57
|
+
/**
|
|
58
|
+
* Token minted to the receiver: the pool's diesel token for direct mints,
|
|
59
|
+
* or the zapper's output token for zapper-routed mints.
|
|
60
|
+
*/
|
|
61
|
+
tokenOut: Address;
|
|
62
|
+
/** Zapper contract the call is sent to; `undefined` for direct mints. */
|
|
63
|
+
zapper?: Address;
|
|
64
|
+
/** Referral code, present only for `mintWithReferral` calls. */
|
|
65
|
+
referralCode?: bigint;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* ERC4626 `withdraw` from a Gearbox pool. Unlike `redeem`, the caller specifies
|
|
69
|
+
* the amount of underlying assets to withdraw; the shares burned are resolved by
|
|
70
|
+
* the pool.
|
|
71
|
+
*/
|
|
72
|
+
export interface PoolWithdrawOperation {
|
|
73
|
+
/** ERC4626 operation kind. */
|
|
74
|
+
operation: "Withdraw";
|
|
75
|
+
/** Source pool the assets are withdrawn from. */
|
|
76
|
+
pool: Address;
|
|
77
|
+
/** Address that receives the withdrawn tokens. */
|
|
78
|
+
receiver: Address;
|
|
79
|
+
/** Address whose pool shares are burned. */
|
|
80
|
+
owner: Address;
|
|
81
|
+
/** Underlying assets withdrawn to the receiver. */
|
|
82
|
+
assets: bigint;
|
|
83
|
+
/** Underlying token of the source pool. */
|
|
84
|
+
underlying: Address;
|
|
85
|
+
/**
|
|
86
|
+
* Token burned from `owner`: the pool's diesel token for direct
|
|
87
|
+
* withdrawals, or the zapper's share-side token for zapper-routed
|
|
88
|
+
* withdrawals.
|
|
89
|
+
*/
|
|
90
|
+
tokenIn: Address;
|
|
91
|
+
/**
|
|
92
|
+
* Token actually returned to the receiver: the pool underlying for direct
|
|
93
|
+
* withdrawals, or the zapper's output token for zapper-routed withdrawals.
|
|
94
|
+
*/
|
|
95
|
+
tokenOut: Address;
|
|
96
|
+
/** Zapper contract the call is sent to; `undefined` for direct withdrawals. */
|
|
97
|
+
zapper?: Address;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* ERC4626 `redeem` from a Gearbox pool.
|
|
101
|
+
*
|
|
102
|
+
* A redeem can reach the pool directly or through a zapper. When routed through
|
|
103
|
+
* a zapper, `zapper` is the call target and `tokenOut` is the zapper's output
|
|
104
|
+
* token rather than the pool underlying.
|
|
105
|
+
*/
|
|
106
|
+
export interface PoolRedeemOperation {
|
|
107
|
+
/** ERC4626 operation kind. */
|
|
108
|
+
operation: "Redeem";
|
|
109
|
+
/** Source pool the shares are redeemed from. */
|
|
110
|
+
pool: Address;
|
|
111
|
+
/** Address that receives the redeemed tokens. */
|
|
112
|
+
receiver: Address;
|
|
113
|
+
/** Address whose pool shares are burned. */
|
|
114
|
+
owner: Address;
|
|
115
|
+
/**
|
|
116
|
+
* Amount of {@link PoolRedeemOperation.tokenIn} burned: pool shares
|
|
117
|
+
* (diesel) for direct redeems, or the zapper's share-side token amount for
|
|
118
|
+
* zapper-routed redeems.
|
|
119
|
+
*/
|
|
120
|
+
shares: bigint;
|
|
121
|
+
/** Underlying token of the source pool. */
|
|
122
|
+
underlying: Address;
|
|
123
|
+
/**
|
|
124
|
+
* Token burned from `owner`: the pool's diesel token for direct redeems, or
|
|
125
|
+
* the zapper's share-side token (e.g. a farmed/staked diesel wrapper) for
|
|
126
|
+
* zapper-routed redeems.
|
|
127
|
+
*/
|
|
128
|
+
tokenIn: Address;
|
|
129
|
+
/**
|
|
130
|
+
* Token actually returned to the receiver: the pool underlying for direct
|
|
131
|
+
* redeems, or the zapper's output token for zapper-routed redeems.
|
|
132
|
+
*/
|
|
133
|
+
tokenOut: Address;
|
|
134
|
+
/** Zapper contract the call is sent to; `undefined` for direct redeems. */
|
|
135
|
+
zapper?: Address;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* ERC4626 pool operations. Each operation may be sent directly to the pool
|
|
139
|
+
* contract or routed through a zapper (indicated by the optional `zapper`
|
|
140
|
+
* field).
|
|
141
|
+
*/
|
|
142
|
+
export type PoolOperation = PoolDepositOperation | PoolMintOperation | PoolWithdrawOperation | PoolRedeemOperation;
|
|
143
|
+
export type PoolOperationType = PoolOperation["operation"];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { SecuritizeRegisterMessage } from "../../sdk/index.js";
|
|
3
|
+
import type { InnerOperation } from "./types-facades.js";
|
|
4
|
+
/**
|
|
5
|
+
* Metadata shared by all RWA factory operations. RWA credit accounts are
|
|
6
|
+
* opened and managed through the market's RWA factory rather than the credit
|
|
7
|
+
* facade, but the inner `calls` still target the facade/adapters, so the
|
|
8
|
+
* credit suite is known.
|
|
9
|
+
*/
|
|
10
|
+
export interface RWAOperationMetadata {
|
|
11
|
+
/** RWA factory contract the transaction is sent to. */
|
|
12
|
+
factory: Address;
|
|
13
|
+
creditManager: Address;
|
|
14
|
+
creditFacade: Address;
|
|
15
|
+
}
|
|
16
|
+
export interface SecuritizeOpenCreditAccountOperation<Ext extends object = {}> extends RWAOperationMetadata {
|
|
17
|
+
operation: "SecuritizeOpenCreditAccount";
|
|
18
|
+
multicall: InnerOperation<Ext>[];
|
|
19
|
+
/**
|
|
20
|
+
* DSToken addresses to register, decoded from calldata. Empty in the
|
|
21
|
+
* template flow, where the real value comes from the factory's open-account
|
|
22
|
+
* requirements.
|
|
23
|
+
*/
|
|
24
|
+
tokensToRegister: Address[];
|
|
25
|
+
/**
|
|
26
|
+
* EIP-712 registration signatures to store on-chain, decoded from calldata.
|
|
27
|
+
* Empty in the template flow.
|
|
28
|
+
*/
|
|
29
|
+
signaturesToCache: SecuritizeRegisterMessage[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* `SecuritizeRWAFactory.multicall` call: like the facade's `multicall`, plus
|
|
33
|
+
* the factory-specific registration args.
|
|
34
|
+
*/
|
|
35
|
+
export interface SecuritizeMulticallOperation<Ext extends object = {}> extends RWAOperationMetadata {
|
|
36
|
+
operation: "SecuritizeMulticall";
|
|
37
|
+
creditAccount: Address;
|
|
38
|
+
multicall: InnerOperation<Ext>[];
|
|
39
|
+
/** DSToken addresses to register, decoded from calldata. */
|
|
40
|
+
tokensToRegister: Address[];
|
|
41
|
+
/** EIP-712 registration signatures to store on-chain, decoded from calldata. */
|
|
42
|
+
signaturesToCache: SecuritizeRegisterMessage[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Discriminated union of all RWA factory operation types. Extend it when
|
|
46
|
+
* adding support for a new RWA factory type.
|
|
47
|
+
*/
|
|
48
|
+
export type RWAOperation<Ext extends object = {}> = SecuritizeOpenCreditAccountOperation<Ext> | SecuritizeMulticallOperation<Ext>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { AdaptersPlugin } from "../../plugins/adapters/index.js";
|
|
2
|
+
import type { OnchainSDK, PluginsMap } from "../../sdk/index.js";
|
|
3
|
+
import type { OuterFacadeOperation } from "./types-facades.js";
|
|
4
|
+
import type { PoolOperation } from "./types-pools.js";
|
|
5
|
+
import type { RWAOperation } from "./types-rwa.js";
|
|
6
|
+
export * from "./types-adapters.js";
|
|
7
|
+
export * from "./types-facades.js";
|
|
8
|
+
export * from "./types-pools.js";
|
|
9
|
+
export * from "./types-rwa.js";
|
|
10
|
+
/**
|
|
11
|
+
* True when the plugin map `P` contains the {@link AdaptersPlugin} under any
|
|
12
|
+
* key. Matched nominally (the plugin's private fields make it non-structural),
|
|
13
|
+
* so unrelated plugins never satisfy it.
|
|
14
|
+
*/
|
|
15
|
+
export type HasAdaptersPlugin<P extends PluginsMap> = Extract<P[keyof P], AdaptersPlugin> extends never ? false : true;
|
|
16
|
+
/**
|
|
17
|
+
* Compile-time guard for the adapters plugin. Resolves to a no-op (`unknown`)
|
|
18
|
+
* when `P` includes the {@link AdaptersPlugin}, otherwise to an error-shaped
|
|
19
|
+
* type that makes the surrounding call fail to type-check.
|
|
20
|
+
*
|
|
21
|
+
* Intended to be intersected with a function argument so callers must pass an
|
|
22
|
+
* SDK whose adapter contracts are registered (required for multicall
|
|
23
|
+
* classification).
|
|
24
|
+
*/
|
|
25
|
+
export type RequireAdaptersPlugin<P extends PluginsMap> = HasAdaptersPlugin<P> extends true ? unknown : {
|
|
26
|
+
"OnchainSDK must be created with the AdaptersPlugin": never;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* {@link OnchainSDK} whose plugin map is guaranteed at compile time to include
|
|
30
|
+
* the {@link AdaptersPlugin}.
|
|
31
|
+
*/
|
|
32
|
+
export type SdkWithAdapters<P extends PluginsMap = PluginsMap> = OnchainSDK<P> & RequireAdaptersPlugin<P>;
|
|
33
|
+
/**
|
|
34
|
+
* Result of decoding a single raw operation calldata: a pool deposit/redeem,
|
|
35
|
+
* one of the credit-facade operations, or an RWA-factory operation.
|
|
36
|
+
*/
|
|
37
|
+
export type Operation = PoolOperation | OuterFacadeOperation | RWAOperation;
|
|
38
|
+
/**
|
|
39
|
+
* Narrows an {@link Operation} to a {@link PoolOperation} (deposit, mint,
|
|
40
|
+
* withdraw or redeem). Used by the UI to decide whether a custom view exists for
|
|
41
|
+
* the parsed result; everything else falls back to the raw JSON view.
|
|
42
|
+
*/
|
|
43
|
+
export declare function isPoolOperation(tx: Operation): tx is PoolOperation;
|
|
44
|
+
/**
|
|
45
|
+
* Narrows an {@link Operation} to an {@link RWAOperation} (an RWA-factory
|
|
46
|
+
* open-account or multicall). Used to route parsed operations to the
|
|
47
|
+
* RWA-specific simulation path.
|
|
48
|
+
*/
|
|
49
|
+
export declare function isRWAOperation(tx: Operation): tx is RWAOperation;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type Address, type ContractFunctionParameters } from "viem";
|
|
2
|
+
import { type MulticallCallResult, Prerequisite } from "./Prerequisite.js";
|
|
3
|
+
import type { PrerequisiteDetail, PrerequisiteResult } from "./types.js";
|
|
4
|
+
export interface AllowancePrerequisiteProps {
|
|
5
|
+
token: Address;
|
|
6
|
+
owner: Address;
|
|
7
|
+
spender: Address;
|
|
8
|
+
required: bigint;
|
|
9
|
+
title?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
}
|
|
12
|
+
/** Checks that `owner` granted `spender` an ERC-20 allowance >= `required`. */
|
|
13
|
+
export declare class AllowancePrerequisite extends Prerequisite<"allowance"> {
|
|
14
|
+
#private;
|
|
15
|
+
constructor(props: AllowancePrerequisiteProps);
|
|
16
|
+
get id(): string;
|
|
17
|
+
get kind(): "allowance";
|
|
18
|
+
get title(): string;
|
|
19
|
+
get detail(): PrerequisiteDetail<"allowance">;
|
|
20
|
+
calls(): ContractFunctionParameters[];
|
|
21
|
+
resolve(slice: MulticallCallResult[]): PrerequisiteResult<"allowance">;
|
|
22
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { type Address, type ContractFunctionParameters } from "viem";
|
|
2
|
+
import { type MulticallCallResult, Prerequisite } from "./Prerequisite.js";
|
|
3
|
+
import type { PrerequisiteContext, PrerequisiteDetail, PrerequisiteResult } from "./types.js";
|
|
4
|
+
export interface BalancePrerequisiteProps {
|
|
5
|
+
token: Address;
|
|
6
|
+
owner: Address;
|
|
7
|
+
required: bigint;
|
|
8
|
+
title?: string;
|
|
9
|
+
id?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Checks that `owner` holds a token balance >= `required`. The token is read
|
|
13
|
+
* as an ERC-20, except for the native pseudo-address ({@link NATIVE_ADDRESS},
|
|
14
|
+
* e.g. ETH-zapper deposits) whose balance is read via multicall3's
|
|
15
|
+
* `getEthBalance`.
|
|
16
|
+
*/
|
|
17
|
+
export declare class BalancePrerequisite extends Prerequisite<"balance"> {
|
|
18
|
+
#private;
|
|
19
|
+
constructor(props: BalancePrerequisiteProps);
|
|
20
|
+
get id(): string;
|
|
21
|
+
get kind(): "balance";
|
|
22
|
+
get title(): string;
|
|
23
|
+
get detail(): PrerequisiteDetail<"balance">;
|
|
24
|
+
calls(ctx: PrerequisiteContext): ContractFunctionParameters[];
|
|
25
|
+
resolve(slice: MulticallCallResult[]): PrerequisiteResult<"balance">;
|
|
26
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { type ContractFunctionParameters } from "viem";
|
|
2
|
+
import type { PrerequisiteContext, PrerequisiteDetail, PrerequisiteError, PrerequisiteKind, PrerequisiteResult } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* One entry of a viem `multicall({ allowFailure: true })` response: either a
|
|
5
|
+
* decoded `result` or the `error` that the call reverted with.
|
|
6
|
+
*/
|
|
7
|
+
export type MulticallCallResult = {
|
|
8
|
+
status: "success";
|
|
9
|
+
result: unknown;
|
|
10
|
+
error?: undefined;
|
|
11
|
+
} | {
|
|
12
|
+
status: "failure";
|
|
13
|
+
result?: undefined;
|
|
14
|
+
error: Error;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* Decodes an unknown error into a {@link PrerequisiteError} with a
|
|
18
|
+
* human-readable revert reason. Mirrors the SDK's `extractCallError`: walk the
|
|
19
|
+
* viem error chain for a {@link ContractFunctionRevertedError} and use its
|
|
20
|
+
* `errorName`, otherwise fall back to the error's short message / name.
|
|
21
|
+
*/
|
|
22
|
+
export declare function toPrerequisiteError(cause: unknown): PrerequisiteError;
|
|
23
|
+
/**
|
|
24
|
+
* A single verifiable prerequisite for a transaction. Subclasses describe the
|
|
25
|
+
* on-chain reads they need ({@link calls}) and how to turn the multicall slice
|
|
26
|
+
* into a {@link PrerequisiteResult} ({@link resolve}).
|
|
27
|
+
*
|
|
28
|
+
* Identity (`id`, `kind`, `title`) and build-time `detail` are exposed as
|
|
29
|
+
* read-only accessors; subclasses back them with private fields. The shared
|
|
30
|
+
* {@link satisfiedResult}/{@link errorResult} helpers are `protected` so each
|
|
31
|
+
* subclass builds results consistently.
|
|
32
|
+
*
|
|
33
|
+
* The same instance can be verified standalone via {@link verify} or batched
|
|
34
|
+
* together with others by `verifyPrerequisites`.
|
|
35
|
+
*/
|
|
36
|
+
export declare abstract class Prerequisite<K extends PrerequisiteKind> {
|
|
37
|
+
/** Stable identifier, used as a React key and for deduplication. */
|
|
38
|
+
abstract get id(): string;
|
|
39
|
+
/** Discriminant tying this check to its detail payload. */
|
|
40
|
+
abstract get kind(): K;
|
|
41
|
+
/** Human-readable label shown in the UI. */
|
|
42
|
+
abstract get title(): string;
|
|
43
|
+
/** Inputs known before reading the chain (no `actual` yet). */
|
|
44
|
+
abstract get detail(): PrerequisiteDetail<K>;
|
|
45
|
+
/** Contract reads this check needs (usually one). */
|
|
46
|
+
abstract calls(ctx: PrerequisiteContext): ContractFunctionParameters[];
|
|
47
|
+
/** Maps this check's slice of the multicall response into a result. */
|
|
48
|
+
abstract resolve(slice: MulticallCallResult[]): PrerequisiteResult<K>;
|
|
49
|
+
/**
|
|
50
|
+
* Verifies this prerequisite on its own using an `allowFailure` multicall.
|
|
51
|
+
* Prefer `verifyPrerequisites` to batch several checks into one round-trip.
|
|
52
|
+
*/
|
|
53
|
+
verify(ctx: PrerequisiteContext): Promise<PrerequisiteResult<K>>;
|
|
54
|
+
/** Builds a successful result; `detail` carries the on-chain `actual`. */
|
|
55
|
+
protected satisfiedResult(satisfied: boolean, detail: PrerequisiteDetail<K>): PrerequisiteResult<K>;
|
|
56
|
+
/** Builds a failed result from a decoded read error. */
|
|
57
|
+
protected errorResult(error: PrerequisiteError): PrerequisiteResult<K>;
|
|
58
|
+
}
|
|
59
|
+
/** Any prerequisite regardless of its kind, used for heterogeneous lists. */
|
|
60
|
+
export type AnyPrerequisite = Prerequisite<PrerequisiteKind>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { Address, ContractFunctionParameters } from "viem";
|
|
2
|
+
import type { RWAOpenAccountRequirements } from "../../sdk/index.js";
|
|
3
|
+
import { Prerequisite } from "./Prerequisite.js";
|
|
4
|
+
import type { PrerequisiteDetail, PrerequisiteResult } from "./types.js";
|
|
5
|
+
export interface RWAOpenRequirementsPrerequisiteProps {
|
|
6
|
+
/** Requirements already resolved via `sdk.accounts.getOpenAccountRequirements`. */
|
|
7
|
+
requirements: RWAOpenAccountRequirements;
|
|
8
|
+
/** RWA token (e.g. Securitize DSToken) the requirements were computed for. */
|
|
9
|
+
token: Address;
|
|
10
|
+
/** RWA factory that produced the requirements. */
|
|
11
|
+
factory: Address;
|
|
12
|
+
title?: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Checks that the borrower has fulfilled the RWA factory's open-account
|
|
17
|
+
* requirements (issuer-side token registration, EIP-712 signatures).
|
|
18
|
+
*
|
|
19
|
+
* Unlike `allowance`/`balance`, the requirements cannot be derived from plain
|
|
20
|
+
* ERC-20 multicall reads: they come from an async compressor read performed by
|
|
21
|
+
* `sdk.accounts.getOpenAccountRequirements`. The prerequisite is therefore
|
|
22
|
+
* *pre-resolved*: it is constructed with the requirements already computed,
|
|
23
|
+
* contributes no calls to the verification multicall, and `resolve` only
|
|
24
|
+
* interprets the stored payload.
|
|
25
|
+
*/
|
|
26
|
+
export declare class RWAOpenRequirementsPrerequisite extends Prerequisite<"rwaOpenRequirements"> {
|
|
27
|
+
#private;
|
|
28
|
+
constructor(props: RWAOpenRequirementsPrerequisiteProps);
|
|
29
|
+
get id(): string;
|
|
30
|
+
get kind(): "rwaOpenRequirements";
|
|
31
|
+
get title(): string;
|
|
32
|
+
get detail(): PrerequisiteDetail<"rwaOpenRequirements">;
|
|
33
|
+
/** Pre-resolved: no on-chain reads to contribute. */
|
|
34
|
+
calls(): ContractFunctionParameters[];
|
|
35
|
+
resolve(): PrerequisiteResult<"rwaOpenRequirements">;
|
|
36
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type PluginsMap } from "../../sdk/index.js";
|
|
2
|
+
import { type ParseOperationCalldataInput } from "../parse/parseOperationCalldata.js";
|
|
3
|
+
import type { AnyPrerequisite } from "./Prerequisite.js";
|
|
4
|
+
/**
|
|
5
|
+
* Input of {@link buildPrerequisites}: the same raw-calldata input as the
|
|
6
|
+
* internal calldata parser, plus an optional block to read at.
|
|
7
|
+
*/
|
|
8
|
+
export type BuildPrerequisitesInput<P extends PluginsMap = PluginsMap> = ParseOperationCalldataInput<P> & {
|
|
9
|
+
/** Block to read at; defaults to latest. Only set for testnet forks. */
|
|
10
|
+
blockNumber?: bigint;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Derives the on-chain prerequisites for an operation given its raw calldata:
|
|
14
|
+
* the conditions that must hold for the call not to revert and that we can
|
|
15
|
+
* verify with the SDK (token approvals, wallet balances). The calldata is
|
|
16
|
+
* decoded internally via `parseOperationCalldata`.
|
|
17
|
+
*
|
|
18
|
+
* Only *sender-actionable* prerequisites belong here: conditions the LP
|
|
19
|
+
* provider or borrower can fix themselves before retrying (e.g. approve a
|
|
20
|
+
* token, top up a balance). Non-actionable protocol/admin state (pool pause,
|
|
21
|
+
* available pool liquidity, health factor, liquidatability, degen NFT gating,
|
|
22
|
+
* bot permissions) is intentionally out of scope, since the user cannot
|
|
23
|
+
* resolve it. New {@link AnyPrerequisite} subclasses must follow the same rule.
|
|
24
|
+
*/
|
|
25
|
+
export declare function buildPrerequisites<P extends PluginsMap>(input: BuildPrerequisitesInput<P>): Promise<AnyPrerequisite[]>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from "./AllowancePrerequisite.js";
|
|
2
|
+
export * from "./BalancePrerequisite.js";
|
|
3
|
+
export * from "./buildPrerequisites.js";
|
|
4
|
+
export * from "./Prerequisite.js";
|
|
5
|
+
export * from "./prepareAction.js";
|
|
6
|
+
export * from "./RWAOpenRequirementsPrerequisite.js";
|
|
7
|
+
export * from "./runPrerequisites.js";
|
|
8
|
+
export * from "./types.js";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { type Address, type Hex } from "viem";
|
|
2
|
+
import type { AnyPrerequisiteResult } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* A single transaction that satisfies a sender-actionable prerequisite.
|
|
5
|
+
*
|
|
6
|
+
* The shape is intentionally minimal (`to`/`data`/optional `value`) so it maps
|
|
7
|
+
* directly onto wallet send primitives (e.g. viem `sendTransaction`, wagmi
|
|
8
|
+
* `useSendTransaction`/`useWriteContract`). It is deliberately *not* the heavier
|
|
9
|
+
* {@link import("../../sdk/types/transactions.js").RawTx} used for Safe batches.
|
|
10
|
+
*
|
|
11
|
+
* The `kind` mirrors the prerequisite kind it remediates, so consumers can label
|
|
12
|
+
* the action (e.g. "Approve") without re-deriving it.
|
|
13
|
+
*/
|
|
14
|
+
export interface PrerequisiteAction {
|
|
15
|
+
/** Prerequisite kind this action remediates. */
|
|
16
|
+
kind: "allowance";
|
|
17
|
+
/** Contract the transaction is sent to (the ERC-20 token for allowances). */
|
|
18
|
+
to: Address;
|
|
19
|
+
/** Encoded calldata (e.g. `approve(spender, required)`). */
|
|
20
|
+
data: Hex;
|
|
21
|
+
/** Native value to send; omitted (treated as 0) for ERC-20 approvals. */
|
|
22
|
+
value?: bigint;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Builds the transaction that resolves an unsatisfied, sender-actionable
|
|
26
|
+
* prerequisite, or returns `null` when the prerequisite cannot be fixed with a
|
|
27
|
+
* single wallet transaction.
|
|
28
|
+
*
|
|
29
|
+
* Currently only `allowance` is actionable: it returns an ERC-20
|
|
30
|
+
* `approve(spender, required)` for the exact required amount. `balance`
|
|
31
|
+
* shortfalls (the user must acquire/free up funds) and errored reads are not
|
|
32
|
+
* actionable and return `null`. New actionable kinds (permits, native unwrap,
|
|
33
|
+
* approve-reset-to-zero for non-standard tokens, ...) should be encoded here so
|
|
34
|
+
* consumers do not have to special-case them.
|
|
35
|
+
*
|
|
36
|
+
* Operates on the serializable {@link AnyPrerequisiteResult} produced by
|
|
37
|
+
* `verifyPrerequisites` (not on {@link import("./Prerequisite.js").Prerequisite}
|
|
38
|
+
* instances), so it works against cached/persisted results.
|
|
39
|
+
*
|
|
40
|
+
* @param result - A verified prerequisite result.
|
|
41
|
+
* @returns The remediation transaction, or `null` if not auto-actionable.
|
|
42
|
+
*/
|
|
43
|
+
export declare function preparePrerequisiteAction(result: AnyPrerequisiteResult): PrerequisiteAction | null;
|
|
44
|
+
/**
|
|
45
|
+
* Whether a prerequisite result represents something the sender can fix with a
|
|
46
|
+
* single wallet transaction (i.e. {@link preparePrerequisiteAction} returns a
|
|
47
|
+
* transaction for it).
|
|
48
|
+
*
|
|
49
|
+
* Useful for UIs that distinguish "approve to continue" (actionable) from hard
|
|
50
|
+
* blocks like an insufficient balance (not actionable).
|
|
51
|
+
*/
|
|
52
|
+
export declare function isActionablePrerequisite(result: AnyPrerequisiteResult): boolean;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { AnyPrerequisite } from "./Prerequisite.js";
|
|
2
|
+
import type { AnyPrerequisiteResult, PrerequisiteContext } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Verifies all prerequisites in a single resilient multicall.
|
|
5
|
+
*
|
|
6
|
+
* Every prereq contributes its reads to one `multicall({ allowFailure: true })`
|
|
7
|
+
* batch, then resolves its own slice of the response. A read that reverts
|
|
8
|
+
* isolates to that prerequisite (an `error` result) without affecting the
|
|
9
|
+
* others; if the whole round-trip fails (RPC/network), every prerequisite
|
|
10
|
+
* resolves to an `error` carrying that reason.
|
|
11
|
+
*/
|
|
12
|
+
export declare function verifyPrerequisites(prereqs: AnyPrerequisite[], ctx: PrerequisiteContext): Promise<AnyPrerequisiteResult[]>;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
2
|
+
import type { OnchainSDK, RWAOpenAccountRequirements } from "../../sdk/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Extension point that ties each prerequisite kind to its detail payload.
|
|
5
|
+
*
|
|
6
|
+
* IMPORTANT: only add prerequisites that are *actionable by the transaction
|
|
7
|
+
* sender* (the LP provider or borrower). A valid prerequisite is one the user
|
|
8
|
+
* can resolve themselves before retrying, e.g. approve a token (`allowance`)
|
|
9
|
+
* or perform offchain KYC verification.
|
|
10
|
+
*
|
|
11
|
+
* Do NOT add protocol- or admin-level state the user cannot change.
|
|
12
|
+
*/
|
|
13
|
+
export interface PrerequisiteDetailMap {
|
|
14
|
+
/** ERC-20 allowance from `owner` to `spender` must cover `required`. */
|
|
15
|
+
allowance: {
|
|
16
|
+
token: Address;
|
|
17
|
+
owner: Address;
|
|
18
|
+
spender: Address;
|
|
19
|
+
required: bigint;
|
|
20
|
+
/** On-chain allowance read; only present when the read succeeded. */
|
|
21
|
+
actual?: bigint;
|
|
22
|
+
};
|
|
23
|
+
/** ERC-20 balance of `owner` must cover `required`. */
|
|
24
|
+
balance: {
|
|
25
|
+
token: Address;
|
|
26
|
+
owner: Address;
|
|
27
|
+
required: bigint;
|
|
28
|
+
/** On-chain balance read; only present when the read succeeded. */
|
|
29
|
+
actual?: bigint;
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* RWA (e.g. Securitize) open-account requirements: off-chain token
|
|
33
|
+
* registration and/or EIP-712 signatures the borrower must provide before
|
|
34
|
+
* opening a credit account in an RWA market.
|
|
35
|
+
*/
|
|
36
|
+
rwaOpenRequirements: RWAOpenAccountRequirements;
|
|
37
|
+
}
|
|
38
|
+
export type PrerequisiteKind = keyof PrerequisiteDetailMap;
|
|
39
|
+
export type PrerequisiteDetail<K extends PrerequisiteKind = PrerequisiteKind> = PrerequisiteDetailMap[K];
|
|
40
|
+
/** Failure of the underlying on-chain read (revert, decode error, RPC error). */
|
|
41
|
+
export interface PrerequisiteError {
|
|
42
|
+
/** Decoded revert reason / error name, human-readable. */
|
|
43
|
+
reason: string;
|
|
44
|
+
/** Original error, kept for debugging. */
|
|
45
|
+
cause?: unknown;
|
|
46
|
+
}
|
|
47
|
+
export interface PrerequisiteBase<K extends PrerequisiteKind> {
|
|
48
|
+
id: string;
|
|
49
|
+
kind: K;
|
|
50
|
+
title: string;
|
|
51
|
+
detail: PrerequisiteDetail<K>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Outcome of verifying a single prerequisite: either the read succeeded (a
|
|
55
|
+
* `satisfied` boolean) or it reverted/failed (an `error` with the revert
|
|
56
|
+
* reason). The two variants are mutually exclusive.
|
|
57
|
+
*/
|
|
58
|
+
export type PrerequisiteResult<K extends PrerequisiteKind = PrerequisiteKind> = PrerequisiteBase<K> & ({
|
|
59
|
+
satisfied: boolean;
|
|
60
|
+
error?: undefined;
|
|
61
|
+
} | {
|
|
62
|
+
satisfied?: undefined;
|
|
63
|
+
error: PrerequisiteError;
|
|
64
|
+
});
|
|
65
|
+
/**
|
|
66
|
+
* Discriminated union over every prerequisite kind. Switching on `kind`
|
|
67
|
+
* narrows `detail` to the matching payload, so React components can render
|
|
68
|
+
* kind-specific details with full type safety.
|
|
69
|
+
*/
|
|
70
|
+
export type AnyPrerequisiteResult = {
|
|
71
|
+
[K in PrerequisiteKind]: PrerequisiteResult<K>;
|
|
72
|
+
}[PrerequisiteKind];
|
|
73
|
+
/** Shared inputs for building and verifying prerequisites. */
|
|
74
|
+
export interface PrerequisiteContext {
|
|
75
|
+
sdk: OnchainSDK;
|
|
76
|
+
/** Address whose balances/allowances are checked (the tx sender). */
|
|
77
|
+
wallet: Address;
|
|
78
|
+
/** Block to read at; defaults to latest. Only set for testnet forks. */
|
|
79
|
+
blockNumber?: bigint;
|
|
80
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { type Asset, AssetsMap, type PluginsMap } from "../../sdk/index.js";
|
|
2
|
+
import type { InnerOperation, SdkWithAdapters } from "../parse/index.js";
|
|
3
|
+
/**
|
|
4
|
+
* Running state threaded through a credit-facade multicall by
|
|
5
|
+
* {@link applyInnerOperations}. Seeded by the caller:
|
|
6
|
+
* - account opening: everything zero/empty (the account doesn't exist yet);
|
|
7
|
+
* - account adjustment: `balances` from the account's current token balances,
|
|
8
|
+
* `debt` from the principal, `totalDebt` from principal + accrued interest +
|
|
9
|
+
* accrued fees.
|
|
10
|
+
*/
|
|
11
|
+
export interface InnerOperationsState {
|
|
12
|
+
/**
|
|
13
|
+
* Cumulative credit-account balances, mutated in facade execution order.
|
|
14
|
+
*/
|
|
15
|
+
balances: AssetsMap;
|
|
16
|
+
/**
|
|
17
|
+
* Debt principal
|
|
18
|
+
*/
|
|
19
|
+
debt: bigint;
|
|
20
|
+
/**
|
|
21
|
+
* Total debt: principal + accrued interest + accrued fees.
|
|
22
|
+
* `decreaseDebt` amounts operate on total debt (interest and fees are repaid
|
|
23
|
+
* before principal), so principal alone is not enough to resolve either the
|
|
24
|
+
* underlying balance decrement or the final principal.
|
|
25
|
+
*/
|
|
26
|
+
totalDebt: bigint;
|
|
27
|
+
/**
|
|
28
|
+
* Cumulative amounts added via `addCollateral`.
|
|
29
|
+
*/
|
|
30
|
+
collateralAdded: AssetsMap;
|
|
31
|
+
/**
|
|
32
|
+
* Cumulative amounts withdrawn via `withdrawCollateral`, with `MAX_UINT256`
|
|
33
|
+
* resolved against the running balance at the point of the call.
|
|
34
|
+
*/
|
|
35
|
+
collateralWithdrawn: AssetsMap;
|
|
36
|
+
/**
|
|
37
|
+
* Raw `updateQuota` changes, one entry per op. Entries are relative signed
|
|
38
|
+
* changes (with the `MIN_INT96` "disable" sentinel kept as-is), not final
|
|
39
|
+
* quotas: folding them requires pre-state quotas, see
|
|
40
|
+
* {@link applyQuotaChanges}.
|
|
41
|
+
*/
|
|
42
|
+
quotaChanges: Asset[];
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Creates an all-zero {@link InnerOperationsState} (the account-opening seed).
|
|
46
|
+
*/
|
|
47
|
+
export declare function makeInnerOperationsState(): InnerOperationsState;
|
|
48
|
+
/**
|
|
49
|
+
* Replays a credit-facade multicall over `state`, mutating it in place in
|
|
50
|
+
* facade execution order. The result is the *minimal guaranteed* post-state:
|
|
51
|
+
* exact deltas for explicit facade calls, exact leftovers for diff-style
|
|
52
|
+
* adapter calls inside `storeExpectedBalances`/`compareBalances` brackets and
|
|
53
|
+
* enforced minimums for bracket targets. Adapter calls outside a bracket are
|
|
54
|
+
* ignored: nothing enforces their outcome on-chain (e.g. reward claims and RWA
|
|
55
|
+
* wrap/unwrap calls emitted by `CreditAccountsServiceV310`), so their
|
|
56
|
+
* guaranteed balance change is zero.
|
|
57
|
+
*
|
|
58
|
+
* @throws On malformed `storeExpectedBalances`/`compareBalances` brackets and
|
|
59
|
+
* on bracketed calls to non-adapter targets.
|
|
60
|
+
*/
|
|
61
|
+
export declare function applyInnerOperations<P extends PluginsMap>(sdk: SdkWithAdapters<P>, multicall: InnerOperation[], state: InnerOperationsState): void;
|
|
62
|
+
/**
|
|
63
|
+
* Applies raw `updateQuota` changes to the account's initial quotas.
|
|
64
|
+
*
|
|
65
|
+
* Each change is applied sequentially: `MIN_INT96` disables the quota, other
|
|
66
|
+
* changes are added to the running quota with the result clamped at zero
|
|
67
|
+
* (quotas cannot go negative on-chain).
|
|
68
|
+
*
|
|
69
|
+
* @param initialQuotas - Per-token quotas before the operation.
|
|
70
|
+
* @param changes - Raw changes recorded by {@link applyInnerOperations}.
|
|
71
|
+
* @returns `quotas` - final non-zero per-token quotas; `quotasChange` -
|
|
72
|
+
* applied (post-clamp) per-token deltas, non-zero entries only.
|
|
73
|
+
*/
|
|
74
|
+
export declare function applyQuotaChanges(initialQuotas: AssetsMap, changes: Asset[]): {
|
|
75
|
+
quotas: Asset[];
|
|
76
|
+
quotasChange: Asset[];
|
|
77
|
+
};
|