@eulerxyz/euler-v2-sdk 0.1.0-beta
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/LICENSE +21 -0
- package/README.md +115 -0
- package/dist/src/entities/Account.d.ts +242 -0
- package/dist/src/entities/Account.js +509 -0
- package/dist/src/entities/Account.js.map +1 -0
- package/dist/src/entities/ERC4626Vault.d.ts +56 -0
- package/dist/src/entities/ERC4626Vault.js +94 -0
- package/dist/src/entities/ERC4626Vault.js.map +1 -0
- package/dist/src/entities/EVault.d.ts +159 -0
- package/dist/src/entities/EVault.js +224 -0
- package/dist/src/entities/EVault.js.map +1 -0
- package/dist/src/entities/EulerEarn.d.ts +69 -0
- package/dist/src/entities/EulerEarn.js +89 -0
- package/dist/src/entities/EulerEarn.js.map +1 -0
- package/dist/src/entities/EulerLabels.d.ts +53 -0
- package/dist/src/entities/EulerLabels.js +2 -0
- package/dist/src/entities/EulerLabels.js.map +1 -0
- package/dist/src/entities/SecuritizeCollateralVault.d.ts +16 -0
- package/dist/src/entities/SecuritizeCollateralVault.js +22 -0
- package/dist/src/entities/SecuritizeCollateralVault.js.map +1 -0
- package/dist/src/entities/Wallet.d.ts +27 -0
- package/dist/src/entities/Wallet.js +21 -0
- package/dist/src/entities/Wallet.js.map +1 -0
- package/dist/src/index.d.ts +43 -0
- package/dist/src/index.js +46 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/plugins/batchSimulation.d.ts +34 -0
- package/dist/src/plugins/batchSimulation.js +83 -0
- package/dist/src/plugins/batchSimulation.js.map +1 -0
- package/dist/src/plugins/index.d.ts +4 -0
- package/dist/src/plugins/index.js +5 -0
- package/dist/src/plugins/index.js.map +1 -0
- package/dist/src/plugins/keyring/index.d.ts +1 -0
- package/dist/src/plugins/keyring/index.js +2 -0
- package/dist/src/plugins/keyring/index.js.map +1 -0
- package/dist/src/plugins/keyring/keyringPlugin.d.ts +41 -0
- package/dist/src/plugins/keyring/keyringPlugin.js +182 -0
- package/dist/src/plugins/keyring/keyringPlugin.js.map +1 -0
- package/dist/src/plugins/pyth/index.d.ts +1 -0
- package/dist/src/plugins/pyth/index.js +2 -0
- package/dist/src/plugins/pyth/index.js.map +1 -0
- package/dist/src/plugins/pyth/pythPlugin.d.ts +29 -0
- package/dist/src/plugins/pyth/pythPlugin.js +190 -0
- package/dist/src/plugins/pyth/pythPlugin.js.map +1 -0
- package/dist/src/plugins/types.d.ts +39 -0
- package/dist/src/plugins/types.js +16 -0
- package/dist/src/plugins/types.js.map +1 -0
- package/dist/src/sdk/buildSDK.d.ts +77 -0
- package/dist/src/sdk/buildSDK.js +366 -0
- package/dist/src/sdk/buildSDK.js.map +1 -0
- package/dist/src/sdk/defaultConfig.d.ts +26 -0
- package/dist/src/sdk/defaultConfig.js +68 -0
- package/dist/src/sdk/defaultConfig.js.map +1 -0
- package/dist/src/sdk/sdk.d.ts +73 -0
- package/dist/src/sdk/sdk.js +67 -0
- package/dist/src/sdk/sdk.js.map +1 -0
- package/dist/src/services/abiService/abiService.d.ts +13 -0
- package/dist/src/services/abiService/abiService.js +25 -0
- package/dist/src/services/abiService/abiService.js.map +1 -0
- package/dist/src/services/abiService/index.d.ts +2 -0
- package/dist/src/services/abiService/index.js +2 -0
- package/dist/src/services/abiService/index.js.map +1 -0
- package/dist/src/services/accountService/accountService.d.ts +44 -0
- package/dist/src/services/accountService/accountService.js +193 -0
- package/dist/src/services/accountService/accountService.js.map +1 -0
- package/dist/src/services/accountService/accountServiceConfig.d.ts +15 -0
- package/dist/src/services/accountService/accountServiceConfig.js +2 -0
- package/dist/src/services/accountService/accountServiceConfig.js.map +1 -0
- package/dist/src/services/accountService/adapters/accountOnchainAdapter/abis/accountLensAbi.d.ts +960 -0
- package/dist/src/services/accountService/adapters/accountOnchainAdapter/abis/accountLensAbi.js +1230 -0
- package/dist/src/services/accountService/adapters/accountOnchainAdapter/abis/accountLensAbi.js.map +1 -0
- package/dist/src/services/accountService/adapters/accountOnchainAdapter/accountInfoConverter.d.ts +17 -0
- package/dist/src/services/accountService/adapters/accountOnchainAdapter/accountInfoConverter.js +158 -0
- package/dist/src/services/accountService/adapters/accountOnchainAdapter/accountInfoConverter.js.map +1 -0
- package/dist/src/services/accountService/adapters/accountOnchainAdapter/accountLensTypes.d.ts +48 -0
- package/dist/src/services/accountService/adapters/accountOnchainAdapter/accountLensTypes.js +2 -0
- package/dist/src/services/accountService/adapters/accountOnchainAdapter/accountLensTypes.js.map +1 -0
- package/dist/src/services/accountService/adapters/accountOnchainAdapter/accountOnchainAdapter.d.ts +210 -0
- package/dist/src/services/accountService/adapters/accountOnchainAdapter/accountOnchainAdapter.js +287 -0
- package/dist/src/services/accountService/adapters/accountOnchainAdapter/accountOnchainAdapter.js.map +1 -0
- package/dist/src/services/accountService/adapters/accountOnchainAdapter/accountVaultsSubgraphAdapter.d.ts +22 -0
- package/dist/src/services/accountService/adapters/accountOnchainAdapter/accountVaultsSubgraphAdapter.js +80 -0
- package/dist/src/services/accountService/adapters/accountOnchainAdapter/accountVaultsSubgraphAdapter.js.map +1 -0
- package/dist/src/services/accountService/adapters/accountOutputNormalization.d.ts +8 -0
- package/dist/src/services/accountService/adapters/accountOutputNormalization.js +50 -0
- package/dist/src/services/accountService/adapters/accountOutputNormalization.js.map +1 -0
- package/dist/src/services/accountService/adapters/accountV3Adapter/accountV3Adapter.d.ts +62 -0
- package/dist/src/services/accountService/adapters/accountV3Adapter/accountV3Adapter.js +287 -0
- package/dist/src/services/accountService/adapters/accountV3Adapter/accountV3Adapter.js.map +1 -0
- package/dist/src/services/accountService/adapters/accountVaultsSubgraphAdapter/accountVaultsSubgraphAdapter.d.ts +1 -0
- package/dist/src/services/accountService/adapters/accountVaultsSubgraphAdapter/accountVaultsSubgraphAdapter.js +2 -0
- package/dist/src/services/accountService/adapters/accountVaultsSubgraphAdapter/accountVaultsSubgraphAdapter.js.map +1 -0
- package/dist/src/services/accountService/index.d.ts +5 -0
- package/dist/src/services/accountService/index.js +4 -0
- package/dist/src/services/accountService/index.js.map +1 -0
- package/dist/src/services/deploymentService/deploymentService.d.ts +116 -0
- package/dist/src/services/deploymentService/deploymentService.js +44 -0
- package/dist/src/services/deploymentService/deploymentService.js.map +1 -0
- package/dist/src/services/deploymentService/index.d.ts +2 -0
- package/dist/src/services/deploymentService/index.js +2 -0
- package/dist/src/services/deploymentService/index.js.map +1 -0
- package/dist/src/services/eulerLabelsService/eulerLabelsService.d.ts +54 -0
- package/dist/src/services/eulerLabelsService/eulerLabelsService.js +178 -0
- package/dist/src/services/eulerLabelsService/eulerLabelsService.js.map +1 -0
- package/dist/src/services/eulerLabelsService/index.d.ts +2 -0
- package/dist/src/services/eulerLabelsService/index.js +2 -0
- package/dist/src/services/eulerLabelsService/index.js.map +1 -0
- package/dist/src/services/executionService/abis/eVaultAbi.d.ts +1948 -0
- package/dist/src/services/executionService/abis/eVaultAbi.js +2517 -0
- package/dist/src/services/executionService/abis/eVaultAbi.js.map +1 -0
- package/dist/src/services/executionService/abis/ethereumVaultConnectorAbi.d.ts +1070 -0
- package/dist/src/services/executionService/abis/ethereumVaultConnectorAbi.js +1387 -0
- package/dist/src/services/executionService/abis/ethereumVaultConnectorAbi.js.map +1 -0
- package/dist/src/services/executionService/abis/permit2PermitAbi.d.ts +52 -0
- package/dist/src/services/executionService/abis/permit2PermitAbi.js +36 -0
- package/dist/src/services/executionService/abis/permit2PermitAbi.js.map +1 -0
- package/dist/src/services/executionService/abis/swapVerifierAbi.d.ts +139 -0
- package/dist/src/services/executionService/abis/swapVerifierAbi.js +70 -0
- package/dist/src/services/executionService/abis/swapVerifierAbi.js.map +1 -0
- package/dist/src/services/executionService/abis/swapperAbi.d.ts +270 -0
- package/dist/src/services/executionService/abis/swapperAbi.js +152 -0
- package/dist/src/services/executionService/abis/swapperAbi.js.map +1 -0
- package/dist/src/services/executionService/executionService.d.ts +619 -0
- package/dist/src/services/executionService/executionService.js +2037 -0
- package/dist/src/services/executionService/executionService.js.map +1 -0
- package/dist/src/services/executionService/executionServiceTypes.d.ts +423 -0
- package/dist/src/services/executionService/executionServiceTypes.js +14 -0
- package/dist/src/services/executionService/executionServiceTypes.js.map +1 -0
- package/dist/src/services/executionService/index.d.ts +7 -0
- package/dist/src/services/executionService/index.js +7 -0
- package/dist/src/services/executionService/index.js.map +1 -0
- package/dist/src/services/feeFlowService/feeFlowService.d.ts +22 -0
- package/dist/src/services/feeFlowService/feeFlowService.js +239 -0
- package/dist/src/services/feeFlowService/feeFlowService.js.map +1 -0
- package/dist/src/services/feeFlowService/feeFlowServiceTypes.d.ts +42 -0
- package/dist/src/services/feeFlowService/feeFlowServiceTypes.js +2 -0
- package/dist/src/services/feeFlowService/feeFlowServiceTypes.js.map +1 -0
- package/dist/src/services/feeFlowService/index.d.ts +2 -0
- package/dist/src/services/feeFlowService/index.js +2 -0
- package/dist/src/services/feeFlowService/index.js.map +1 -0
- package/dist/src/services/intrinsicApyService/adapters/intrinsicApyV3Adapter/index.d.ts +2 -0
- package/dist/src/services/intrinsicApyService/adapters/intrinsicApyV3Adapter/index.js +2 -0
- package/dist/src/services/intrinsicApyService/adapters/intrinsicApyV3Adapter/index.js.map +1 -0
- package/dist/src/services/intrinsicApyService/adapters/intrinsicApyV3Adapter/intrinsicApyV3Adapter.d.ts +21 -0
- package/dist/src/services/intrinsicApyService/adapters/intrinsicApyV3Adapter/intrinsicApyV3Adapter.js +125 -0
- package/dist/src/services/intrinsicApyService/adapters/intrinsicApyV3Adapter/intrinsicApyV3Adapter.js.map +1 -0
- package/dist/src/services/intrinsicApyService/adapters/intrinsicApyV3Adapter/intrinsicApyV3AdapterTypes.d.ts +30 -0
- package/dist/src/services/intrinsicApyService/adapters/intrinsicApyV3Adapter/intrinsicApyV3AdapterTypes.js +2 -0
- package/dist/src/services/intrinsicApyService/adapters/intrinsicApyV3Adapter/intrinsicApyV3AdapterTypes.js.map +1 -0
- package/dist/src/services/intrinsicApyService/index.d.ts +4 -0
- package/dist/src/services/intrinsicApyService/index.js +3 -0
- package/dist/src/services/intrinsicApyService/index.js.map +1 -0
- package/dist/src/services/intrinsicApyService/intrinsicApyService.d.ts +28 -0
- package/dist/src/services/intrinsicApyService/intrinsicApyService.js +42 -0
- package/dist/src/services/intrinsicApyService/intrinsicApyService.js.map +1 -0
- package/dist/src/services/oracleAdapterService/index.d.ts +1 -0
- package/dist/src/services/oracleAdapterService/index.js +2 -0
- package/dist/src/services/oracleAdapterService/index.js.map +1 -0
- package/dist/src/services/oracleAdapterService/oracleAdapterService.d.ts +40 -0
- package/dist/src/services/oracleAdapterService/oracleAdapterService.js +65 -0
- package/dist/src/services/oracleAdapterService/oracleAdapterService.js.map +1 -0
- package/dist/src/services/priceService/backendClient.d.ts +70 -0
- package/dist/src/services/priceService/backendClient.js +108 -0
- package/dist/src/services/priceService/backendClient.js.map +1 -0
- package/dist/src/services/priceService/index.d.ts +2 -0
- package/dist/src/services/priceService/index.js +3 -0
- package/dist/src/services/priceService/index.js.map +1 -0
- package/dist/src/services/priceService/priceService.d.ts +133 -0
- package/dist/src/services/priceService/priceService.js +499 -0
- package/dist/src/services/priceService/priceService.js.map +1 -0
- package/dist/src/services/priceService/utilsLensPriceAbi.d.ts +60 -0
- package/dist/src/services/priceService/utilsLensPriceAbi.js +31 -0
- package/dist/src/services/priceService/utilsLensPriceAbi.js.map +1 -0
- package/dist/src/services/providerService/index.d.ts +2 -0
- package/dist/src/services/providerService/index.js +2 -0
- package/dist/src/services/providerService/index.js.map +1 -0
- package/dist/src/services/providerService/providerService.d.ts +11 -0
- package/dist/src/services/providerService/providerService.js +61 -0
- package/dist/src/services/providerService/providerService.js.map +1 -0
- package/dist/src/services/rewardsService/adapters/rewardsDirectAdapter/index.d.ts +2 -0
- package/dist/src/services/rewardsService/adapters/rewardsDirectAdapter/index.js +2 -0
- package/dist/src/services/rewardsService/adapters/rewardsDirectAdapter/index.js.map +1 -0
- package/dist/src/services/rewardsService/adapters/rewardsDirectAdapter/rewardsDirectAdapter.d.ts +48 -0
- package/dist/src/services/rewardsService/adapters/rewardsDirectAdapter/rewardsDirectAdapter.js +391 -0
- package/dist/src/services/rewardsService/adapters/rewardsDirectAdapter/rewardsDirectAdapter.js.map +1 -0
- package/dist/src/services/rewardsService/adapters/rewardsV3Adapter/index.d.ts +2 -0
- package/dist/src/services/rewardsService/adapters/rewardsV3Adapter/index.js +2 -0
- package/dist/src/services/rewardsService/adapters/rewardsV3Adapter/index.js.map +1 -0
- package/dist/src/services/rewardsService/adapters/rewardsV3Adapter/rewardsV3Adapter.d.ts +23 -0
- package/dist/src/services/rewardsService/adapters/rewardsV3Adapter/rewardsV3Adapter.js +296 -0
- package/dist/src/services/rewardsService/adapters/rewardsV3Adapter/rewardsV3Adapter.js.map +1 -0
- package/dist/src/services/rewardsService/adapters/rewardsV3Adapter/rewardsV3AdapterTypes.d.ts +110 -0
- package/dist/src/services/rewardsService/adapters/rewardsV3Adapter/rewardsV3AdapterTypes.js +2 -0
- package/dist/src/services/rewardsService/adapters/rewardsV3Adapter/rewardsV3AdapterTypes.js.map +1 -0
- package/dist/src/services/rewardsService/index.d.ts +5 -0
- package/dist/src/services/rewardsService/index.js +4 -0
- package/dist/src/services/rewardsService/index.js.map +1 -0
- package/dist/src/services/rewardsService/rewardsService.d.ts +34 -0
- package/dist/src/services/rewardsService/rewardsService.js +298 -0
- package/dist/src/services/rewardsService/rewardsService.js.map +1 -0
- package/dist/src/services/rewardsService/rewardsServiceTypes.d.ts +270 -0
- package/dist/src/services/rewardsService/rewardsServiceTypes.js +2 -0
- package/dist/src/services/rewardsService/rewardsServiceTypes.js.map +1 -0
- package/dist/src/services/simulationService/index.d.ts +2 -0
- package/dist/src/services/simulationService/index.js +2 -0
- package/dist/src/services/simulationService/index.js.map +1 -0
- package/dist/src/services/simulationService/simulationService.d.ts +88 -0
- package/dist/src/services/simulationService/simulationService.js +497 -0
- package/dist/src/services/simulationService/simulationService.js.map +1 -0
- package/dist/src/services/swapService/index.d.ts +3 -0
- package/dist/src/services/swapService/index.js +3 -0
- package/dist/src/services/swapService/index.js.map +1 -0
- package/dist/src/services/swapService/swapService.d.ts +121 -0
- package/dist/src/services/swapService/swapService.js +329 -0
- package/dist/src/services/swapService/swapService.js.map +1 -0
- package/dist/src/services/swapService/swapServiceTypes.d.ts +130 -0
- package/dist/src/services/swapService/swapServiceTypes.js +16 -0
- package/dist/src/services/swapService/swapServiceTypes.js.map +1 -0
- package/dist/src/services/swapService/swapVerifierAbi.d.ts +139 -0
- package/dist/src/services/swapService/swapVerifierAbi.js +178 -0
- package/dist/src/services/swapService/swapVerifierAbi.js.map +1 -0
- package/dist/src/services/tokenlistService/index.d.ts +3 -0
- package/dist/src/services/tokenlistService/index.js +2 -0
- package/dist/src/services/tokenlistService/index.js.map +1 -0
- package/dist/src/services/tokenlistService/tokenlistService.d.ts +31 -0
- package/dist/src/services/tokenlistService/tokenlistService.js +56 -0
- package/dist/src/services/tokenlistService/tokenlistService.js.map +1 -0
- package/dist/src/services/tokenlistService/tokenlistServiceTypes.d.ts +33 -0
- package/dist/src/services/tokenlistService/tokenlistServiceTypes.js +2 -0
- package/dist/src/services/tokenlistService/tokenlistServiceTypes.js.map +1 -0
- package/dist/src/services/vaults/IVaultService.d.ts +47 -0
- package/dist/src/services/vaults/IVaultService.js +2 -0
- package/dist/src/services/vaults/IVaultService.js.map +1 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultOnchainAdapter/abis/vaultLensAbi.d.ts +1280 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultOnchainAdapter/abis/vaultLensAbi.js +1640 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultOnchainAdapter/abis/vaultLensAbi.js.map +1 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultOnchainAdapter/eVaultLensTypes.d.ts +97 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultOnchainAdapter/eVaultLensTypes.js +9 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultOnchainAdapter/eVaultLensTypes.js.map +1 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultOnchainAdapter/eVaultOnchainAdapter.d.ts +141 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultOnchainAdapter/eVaultOnchainAdapter.js +189 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultOnchainAdapter/eVaultOnchainAdapter.js.map +1 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultOnchainAdapter/vaultInfoConverter.d.ts +10 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultOnchainAdapter/vaultInfoConverter.js +454 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultOnchainAdapter/vaultInfoConverter.js.map +1 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultV3Adapter/eVaultV3Adapter.d.ts +25 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultV3Adapter/eVaultV3Adapter.js +214 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultV3Adapter/eVaultV3Adapter.js.map +1 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultV3Adapter/eVaultV3AdapterConversions.d.ts +5 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultV3Adapter/eVaultV3AdapterConversions.js +795 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultV3Adapter/eVaultV3AdapterConversions.js.map +1 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultV3Adapter/eVaultV3AdapterTypes.d.ts +146 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultV3Adapter/eVaultV3AdapterTypes.js +2 -0
- package/dist/src/services/vaults/eVaultService/adapters/eVaultV3Adapter/eVaultV3AdapterTypes.js.map +1 -0
- package/dist/src/services/vaults/eVaultService/eVaultService.d.ts +74 -0
- package/dist/src/services/vaults/eVaultService/eVaultService.js +362 -0
- package/dist/src/services/vaults/eVaultService/eVaultService.js.map +1 -0
- package/dist/src/services/vaults/eVaultService/eVaultServiceConfig.d.ts +15 -0
- package/dist/src/services/vaults/eVaultService/eVaultServiceConfig.js +2 -0
- package/dist/src/services/vaults/eVaultService/eVaultServiceConfig.js.map +1 -0
- package/dist/src/services/vaults/eVaultService/index.d.ts +5 -0
- package/dist/src/services/vaults/eVaultService/index.js +4 -0
- package/dist/src/services/vaults/eVaultService/index.js.map +1 -0
- package/dist/src/services/vaults/eulerEarnService/adapters/abis/eulerEarnVaultLensAbi.d.ts +468 -0
- package/dist/src/services/vaults/eulerEarnService/adapters/abis/eulerEarnVaultLensAbi.js +600 -0
- package/dist/src/services/vaults/eulerEarnService/adapters/abis/eulerEarnVaultLensAbi.js.map +1 -0
- package/dist/src/services/vaults/eulerEarnService/adapters/eulerEarnInfoConverter.d.ts +10 -0
- package/dist/src/services/vaults/eulerEarnService/adapters/eulerEarnInfoConverter.js +151 -0
- package/dist/src/services/vaults/eulerEarnService/adapters/eulerEarnInfoConverter.js.map +1 -0
- package/dist/src/services/vaults/eulerEarnService/adapters/eulerEarnLensTypes.d.ts +55 -0
- package/dist/src/services/vaults/eulerEarnService/adapters/eulerEarnLensTypes.js +2 -0
- package/dist/src/services/vaults/eulerEarnService/adapters/eulerEarnLensTypes.js.map +1 -0
- package/dist/src/services/vaults/eulerEarnService/adapters/eulerEarnOnchainAdapter.d.ts +109 -0
- package/dist/src/services/vaults/eulerEarnService/adapters/eulerEarnOnchainAdapter.js +238 -0
- package/dist/src/services/vaults/eulerEarnService/adapters/eulerEarnOnchainAdapter.js.map +1 -0
- package/dist/src/services/vaults/eulerEarnService/adapters/eulerEarnV3Adapter.d.ts +100 -0
- package/dist/src/services/vaults/eulerEarnService/adapters/eulerEarnV3Adapter.js +373 -0
- package/dist/src/services/vaults/eulerEarnService/adapters/eulerEarnV3Adapter.js.map +1 -0
- package/dist/src/services/vaults/eulerEarnService/eulerEarnService.d.ts +77 -0
- package/dist/src/services/vaults/eulerEarnService/eulerEarnService.js +298 -0
- package/dist/src/services/vaults/eulerEarnService/eulerEarnService.js.map +1 -0
- package/dist/src/services/vaults/eulerEarnService/eulerEarnServiceConfig.d.ts +13 -0
- package/dist/src/services/vaults/eulerEarnService/eulerEarnServiceConfig.js +2 -0
- package/dist/src/services/vaults/eulerEarnService/eulerEarnServiceConfig.js.map +1 -0
- package/dist/src/services/vaults/eulerEarnService/index.d.ts +5 -0
- package/dist/src/services/vaults/eulerEarnService/index.js +4 -0
- package/dist/src/services/vaults/eulerEarnService/index.js.map +1 -0
- package/dist/src/services/vaults/index.d.ts +1 -0
- package/dist/src/services/vaults/index.js +2 -0
- package/dist/src/services/vaults/index.js.map +1 -0
- package/dist/src/services/vaults/securitizeVaultService/adapters/abis/erc4626EvcCollateralSecuritizeAbi.d.ts +22 -0
- package/dist/src/services/vaults/securitizeVaultService/adapters/abis/erc4626EvcCollateralSecuritizeAbi.js +18 -0
- package/dist/src/services/vaults/securitizeVaultService/adapters/abis/erc4626EvcCollateralSecuritizeAbi.js.map +1 -0
- package/dist/src/services/vaults/securitizeVaultService/adapters/abis/utilsLensAbi.d.ts +64 -0
- package/dist/src/services/vaults/securitizeVaultService/adapters/abis/utilsLensAbi.js +30 -0
- package/dist/src/services/vaults/securitizeVaultService/adapters/abis/utilsLensAbi.js.map +1 -0
- package/dist/src/services/vaults/securitizeVaultService/adapters/securitizeVaultInfoConverter.d.ts +4 -0
- package/dist/src/services/vaults/securitizeVaultService/adapters/securitizeVaultInfoConverter.js +53 -0
- package/dist/src/services/vaults/securitizeVaultService/adapters/securitizeVaultInfoConverter.js.map +1 -0
- package/dist/src/services/vaults/securitizeVaultService/adapters/securitizeVaultLensTypes.d.ts +16 -0
- package/dist/src/services/vaults/securitizeVaultService/adapters/securitizeVaultLensTypes.js +2 -0
- package/dist/src/services/vaults/securitizeVaultService/adapters/securitizeVaultLensTypes.js.map +1 -0
- package/dist/src/services/vaults/securitizeVaultService/adapters/securitizeVaultOnchainAdapter.d.ts +37 -0
- package/dist/src/services/vaults/securitizeVaultService/adapters/securitizeVaultOnchainAdapter.js +113 -0
- package/dist/src/services/vaults/securitizeVaultService/adapters/securitizeVaultOnchainAdapter.js.map +1 -0
- package/dist/src/services/vaults/securitizeVaultService/index.d.ts +2 -0
- package/dist/src/services/vaults/securitizeVaultService/index.js +3 -0
- package/dist/src/services/vaults/securitizeVaultService/index.js.map +1 -0
- package/dist/src/services/vaults/securitizeVaultService/securitizeVaultService.d.ts +52 -0
- package/dist/src/services/vaults/securitizeVaultService/securitizeVaultService.js +190 -0
- package/dist/src/services/vaults/securitizeVaultService/securitizeVaultService.js.map +1 -0
- package/dist/src/services/vaults/vaultMetaService/adapters/IVaultTypeAdapter.d.ts +29 -0
- package/dist/src/services/vaults/vaultMetaService/adapters/IVaultTypeAdapter.js +2 -0
- package/dist/src/services/vaults/vaultMetaService/adapters/IVaultTypeAdapter.js.map +1 -0
- package/dist/src/services/vaults/vaultMetaService/adapters/VaultTypeSubgraphAdapter.d.ts +18 -0
- package/dist/src/services/vaults/vaultMetaService/adapters/VaultTypeSubgraphAdapter.js +82 -0
- package/dist/src/services/vaults/vaultMetaService/adapters/VaultTypeSubgraphAdapter.js.map +1 -0
- package/dist/src/services/vaults/vaultMetaService/adapters/VaultTypeV3Adapter.d.ts +35 -0
- package/dist/src/services/vaults/vaultMetaService/adapters/VaultTypeV3Adapter.js +154 -0
- package/dist/src/services/vaults/vaultMetaService/adapters/VaultTypeV3Adapter.js.map +1 -0
- package/dist/src/services/vaults/vaultMetaService/index.d.ts +4 -0
- package/dist/src/services/vaults/vaultMetaService/index.js +4 -0
- package/dist/src/services/vaults/vaultMetaService/index.js.map +1 -0
- package/dist/src/services/vaults/vaultMetaService/vaultMetaService.d.ts +71 -0
- package/dist/src/services/vaults/vaultMetaService/vaultMetaService.js +283 -0
- package/dist/src/services/vaults/vaultMetaService/vaultMetaService.js.map +1 -0
- package/dist/src/services/walletService/adapters/walletOnchainAdapter.d.ts +20 -0
- package/dist/src/services/walletService/adapters/walletOnchainAdapter.js +222 -0
- package/dist/src/services/walletService/adapters/walletOnchainAdapter.js.map +1 -0
- package/dist/src/services/walletService/index.d.ts +3 -0
- package/dist/src/services/walletService/index.js +2 -0
- package/dist/src/services/walletService/index.js.map +1 -0
- package/dist/src/services/walletService/walletService.d.ts +19 -0
- package/dist/src/services/walletService/walletService.js +37 -0
- package/dist/src/services/walletService/walletService.js.map +1 -0
- package/dist/src/utils/accountComputations.d.ts +96 -0
- package/dist/src/utils/accountComputations.js +297 -0
- package/dist/src/utils/accountComputations.js.map +1 -0
- package/dist/src/utils/batch.d.ts +2 -0
- package/dist/src/utils/batch.js +51 -0
- package/dist/src/utils/batch.js.map +1 -0
- package/dist/src/utils/buildQuery.d.ts +19 -0
- package/dist/src/utils/buildQuery.js +72 -0
- package/dist/src/utils/buildQuery.js.map +1 -0
- package/dist/src/utils/callBundler.d.ts +32 -0
- package/dist/src/utils/callBundler.js +93 -0
- package/dist/src/utils/callBundler.js.map +1 -0
- package/dist/src/utils/decodeSmartContractErrors.d.ts +13 -0
- package/dist/src/utils/decodeSmartContractErrors.js +311 -0
- package/dist/src/utils/decodeSmartContractErrors.js.map +1 -0
- package/dist/src/utils/entityDiagnostics.d.ts +28 -0
- package/dist/src/utils/entityDiagnostics.js +72 -0
- package/dist/src/utils/entityDiagnostics.js.map +1 -0
- package/dist/src/utils/eulerErrorSelectors.d.ts +226 -0
- package/dist/src/utils/eulerErrorSelectors.js +227 -0
- package/dist/src/utils/eulerErrorSelectors.js.map +1 -0
- package/dist/src/utils/irm.d.ts +60 -0
- package/dist/src/utils/irm.js +213 -0
- package/dist/src/utils/irm.js.map +1 -0
- package/dist/src/utils/normalization.d.ts +30 -0
- package/dist/src/utils/normalization.js +79 -0
- package/dist/src/utils/normalization.js.map +1 -0
- package/dist/src/utils/oracle.d.ts +107 -0
- package/dist/src/utils/oracle.js +437 -0
- package/dist/src/utils/oracle.js.map +1 -0
- package/dist/src/utils/parsing.d.ts +29 -0
- package/dist/src/utils/parsing.js +199 -0
- package/dist/src/utils/parsing.js.map +1 -0
- package/dist/src/utils/queryNames.d.ts +28 -0
- package/dist/src/utils/queryNames.js +2 -0
- package/dist/src/utils/queryNames.js.map +1 -0
- package/dist/src/utils/stateOverrides/accessList.d.ts +14 -0
- package/dist/src/utils/stateOverrides/accessList.js +24 -0
- package/dist/src/utils/stateOverrides/accessList.js.map +1 -0
- package/dist/src/utils/stateOverrides/approvalOverrides.d.ts +20 -0
- package/dist/src/utils/stateOverrides/approvalOverrides.js +111 -0
- package/dist/src/utils/stateOverrides/approvalOverrides.js.map +1 -0
- package/dist/src/utils/stateOverrides/balanceOverrides.d.ts +13 -0
- package/dist/src/utils/stateOverrides/balanceOverrides.js +145 -0
- package/dist/src/utils/stateOverrides/balanceOverrides.js.map +1 -0
- package/dist/src/utils/stateOverrides/getStateOverrides.d.ts +31 -0
- package/dist/src/utils/stateOverrides/getStateOverrides.js +86 -0
- package/dist/src/utils/stateOverrides/getStateOverrides.js.map +1 -0
- package/dist/src/utils/stateOverrides/index.d.ts +4 -0
- package/dist/src/utils/stateOverrides/index.js +5 -0
- package/dist/src/utils/stateOverrides/index.js.map +1 -0
- package/dist/src/utils/stateOverrides/mergeStateOverrides.d.ts +6 -0
- package/dist/src/utils/stateOverrides/mergeStateOverrides.js +40 -0
- package/dist/src/utils/stateOverrides/mergeStateOverrides.js.map +1 -0
- package/dist/src/utils/stateOverrides/types.d.ts +5 -0
- package/dist/src/utils/stateOverrides/types.js +2 -0
- package/dist/src/utils/stateOverrides/types.js.map +1 -0
- package/dist/src/utils/subAccounts.d.ts +6 -0
- package/dist/src/utils/subAccounts.js +24 -0
- package/dist/src/utils/subAccounts.js.map +1 -0
- package/dist/src/utils/types.d.ts +20 -0
- package/dist/src/utils/types.js +8 -0
- package/dist/src/utils/types.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,619 @@
|
|
|
1
|
+
import { type Hex, type Address, type Abi } from "viem";
|
|
2
|
+
import type { DeploymentService } from "../deploymentService/index.js";
|
|
3
|
+
import type { IWalletService } from "../walletService/index.js";
|
|
4
|
+
import type { EulerPlugin } from "../../plugins/types.js";
|
|
5
|
+
import { type EVCBatchItem, type EncodeDepositArgs, type EncodeMintArgs, type EncodeWithdrawArgs, type EncodeRedeemArgs, type EncodeBorrowArgs, type EncodeLiquidationArgs, type EncodePullDebtArgs, type EncodeRepayWithSwapArgs, type EncodeRepayFromWalletArgs, type EncodeRepayFromDepositArgs, type EncodeSwapDebtArgs, type EncodeTransferArgs, type EncodeDepositWithSwapFromWalletArgs, type EncodeSwapCollateralArgs, type EncodePermit2CallArgs, type GetPermit2TypedDataArgs, type TransactionPlanItem, type TransactionPlan, type PlanDepositArgs, type PlanMintArgs, type PlanWithdrawArgs, type PlanRedeemArgs, type PlanBorrowArgs, type PlanLiquidationArgs, type PlanRepayFromWalletArgs, type PlanRepayFromDepositArgs, type PlanRepayWithSwapArgs, type PlanDepositWithSwapFromWalletArgs, type PlanSwapCollateralArgs, type PlanSwapDebtArgs, type PlanTransferArgs, type PlanPullDebtArgs, type BatchItemDescription, type EncodeMultiplyWithSwapArgs, type EncodeMultiplySameAssetArgs, type PlanMultiplyWithSwapArgs, type PlanMultiplySameAssetArgs, type PermitSingleTypedData, type ResolveRequiredApprovalsArgs, type ResolveRequiredApprovalsWithWalletArgs } from "./executionServiceTypes.js";
|
|
6
|
+
export interface IExecutionService {
|
|
7
|
+
encodeBatch(items: EVCBatchItem[]): Hex;
|
|
8
|
+
encodeDeposit(args: EncodeDepositArgs): EVCBatchItem[];
|
|
9
|
+
encodeMint(args: EncodeMintArgs): EVCBatchItem[];
|
|
10
|
+
encodeWithdraw(args: EncodeWithdrawArgs): EVCBatchItem[];
|
|
11
|
+
encodeRedeem(args: EncodeRedeemArgs): EVCBatchItem[];
|
|
12
|
+
encodeBorrow(args: EncodeBorrowArgs): EVCBatchItem[];
|
|
13
|
+
encodeLiquidation(args: EncodeLiquidationArgs): EVCBatchItem[];
|
|
14
|
+
encodePullDebt(args: EncodePullDebtArgs): EVCBatchItem[];
|
|
15
|
+
encodeRepayFromWallet(args: EncodeRepayFromWalletArgs): EVCBatchItem[];
|
|
16
|
+
encodeRepayFromDeposit(args: EncodeRepayFromDepositArgs): EVCBatchItem[];
|
|
17
|
+
encodeRepayWithSwap(args: EncodeRepayWithSwapArgs): EVCBatchItem[];
|
|
18
|
+
encodeDepositWithSwapFromWallet(args: EncodeDepositWithSwapFromWalletArgs): EVCBatchItem[];
|
|
19
|
+
encodeSwapCollateral(args: EncodeSwapCollateralArgs): EVCBatchItem[];
|
|
20
|
+
encodeSwapDebt(args: EncodeSwapDebtArgs): EVCBatchItem[];
|
|
21
|
+
encodeTransfer(args: EncodeTransferArgs): EVCBatchItem[];
|
|
22
|
+
encodeMultiplyWithSwap(args: EncodeMultiplyWithSwapArgs): EVCBatchItem[];
|
|
23
|
+
encodeMultiplySameAsset(args: EncodeMultiplySameAssetArgs): EVCBatchItem[];
|
|
24
|
+
encodePermit2Call(args: EncodePermit2CallArgs): EVCBatchItem;
|
|
25
|
+
/** Transaction plan functions: build plan items (approvals + EVC batch) for each operation. See implementation JSDoc for argument details. */
|
|
26
|
+
planDeposit(args: PlanDepositArgs): TransactionPlan;
|
|
27
|
+
planMint(args: PlanMintArgs): TransactionPlan;
|
|
28
|
+
planWithdraw(args: PlanWithdrawArgs): TransactionPlan;
|
|
29
|
+
planRedeem(args: PlanRedeemArgs): TransactionPlan;
|
|
30
|
+
planBorrow(args: PlanBorrowArgs): TransactionPlan;
|
|
31
|
+
planLiquidation(args: PlanLiquidationArgs): TransactionPlan;
|
|
32
|
+
planRepayFromWallet(args: PlanRepayFromWalletArgs): TransactionPlan;
|
|
33
|
+
planRepayFromDeposit(args: PlanRepayFromDepositArgs): TransactionPlan;
|
|
34
|
+
planRepayWithSwap(args: PlanRepayWithSwapArgs): TransactionPlan;
|
|
35
|
+
planDepositWithSwapFromWallet(args: PlanDepositWithSwapFromWalletArgs): TransactionPlan;
|
|
36
|
+
planSwapCollateral(args: PlanSwapCollateralArgs): TransactionPlan;
|
|
37
|
+
planSwapDebt(args: PlanSwapDebtArgs): TransactionPlan;
|
|
38
|
+
planTransfer(args: PlanTransferArgs): TransactionPlan;
|
|
39
|
+
planPullDebt(args: PlanPullDebtArgs): TransactionPlan;
|
|
40
|
+
planMultiplyWithSwap(args: PlanMultiplyWithSwapArgs): TransactionPlan;
|
|
41
|
+
planMultiplySameAsset(args: PlanMultiplySameAssetArgs): TransactionPlan;
|
|
42
|
+
resolveRequiredApprovalsWithWallet(args: ResolveRequiredApprovalsWithWalletArgs): TransactionPlan;
|
|
43
|
+
resolveRequiredApprovals(args: ResolveRequiredApprovalsArgs): Promise<TransactionPlan>;
|
|
44
|
+
getPermit2TypedData(args: GetPermit2TypedDataArgs): PermitSingleTypedData;
|
|
45
|
+
describeBatch(batch: EVCBatchItem[], extraAbis?: Abi[]): BatchItemDescription[];
|
|
46
|
+
/** Merges multiple plans into one: required approvals for the same (token, owner, spender) are summed; executable items are preserved in order and adjacent EVC batches are concatenated. */
|
|
47
|
+
mergePlans(plans: TransactionPlan[]): TransactionPlan;
|
|
48
|
+
/** Converts EVC batch items into a transaction plan (single evcBatch, no required approvals). */
|
|
49
|
+
convertBatchItemsToPlan(items: EVCBatchItem[]): TransactionPlan;
|
|
50
|
+
}
|
|
51
|
+
export declare class ExecutionService implements IExecutionService {
|
|
52
|
+
private deploymentService;
|
|
53
|
+
private walletService;
|
|
54
|
+
private plugins;
|
|
55
|
+
constructor(deploymentService: DeploymentService, walletService: IWalletService);
|
|
56
|
+
setWalletService(walletService: IWalletService): void;
|
|
57
|
+
setPlugins(plugins: EulerPlugin[]): void;
|
|
58
|
+
/**
|
|
59
|
+
* Encodes an array of EVC batch items into a single calldata hex for `EVC.batch()`.
|
|
60
|
+
*
|
|
61
|
+
* @param items - Array of batch items (targetContract, onBehalfOfAccount, value, data) to execute atomically
|
|
62
|
+
* @returns Encoded calldata hex for the EVC batch call
|
|
63
|
+
*/
|
|
64
|
+
encodeBatch(items: EVCBatchItem[]): Hex;
|
|
65
|
+
/**
|
|
66
|
+
* Encodes EVC batch items for depositing underlying assets into a vault (mints shares to receiver).
|
|
67
|
+
*
|
|
68
|
+
* @param args - Deposit encoding arguments
|
|
69
|
+
* @param args.chainId - Chain ID (used for EVC/permit2 addresses)
|
|
70
|
+
* @param args.vault - Address of the vault to deposit into
|
|
71
|
+
* @param args.amount - Amount of underlying assets to deposit
|
|
72
|
+
* @param args.receiver - Sub-account address that receives the vault shares
|
|
73
|
+
* @param args.owner - Address that owns the assets and authorizes the deposit (onBehalfOfAccount)
|
|
74
|
+
* @param args.enableCollateral - If true, prepends enableCollateral( receiver, vault ) via EVC
|
|
75
|
+
* @param args.permit2 - Optional Permit2 message + signature; if set, prepends a permit2 permit call so transferFrom can be used
|
|
76
|
+
* @returns Array of EVC batch items (optional permit2, optional enableCollateral, deposit)
|
|
77
|
+
*/
|
|
78
|
+
encodeDeposit({ chainId, vault, amount, receiver, owner, enableCollateral, permit2, }: EncodeDepositArgs): EVCBatchItem[];
|
|
79
|
+
/**
|
|
80
|
+
* Encodes EVC batch items for minting vault shares by depositing underlying assets.
|
|
81
|
+
*
|
|
82
|
+
* @param args - Mint encoding arguments
|
|
83
|
+
* @param args.chainId - Chain ID (used for EVC/permit2 addresses)
|
|
84
|
+
* @param args.vault - Address of the vault to mint from
|
|
85
|
+
* @param args.shares - Number of vault shares to mint
|
|
86
|
+
* @param args.receiver - Sub-account address that receives the shares
|
|
87
|
+
* @param args.owner - Address that owns the assets and authorizes the mint (onBehalfOfAccount)
|
|
88
|
+
* @param args.enableCollateral - If true, prepends enableCollateral( receiver, vault ) via EVC
|
|
89
|
+
* @param args.permit2 - Optional Permit2 message + signature for transferFrom
|
|
90
|
+
* @returns Array of EVC batch items (optional permit2, optional enableCollateral, mint)
|
|
91
|
+
*/
|
|
92
|
+
encodeMint({ chainId, vault, shares, receiver, owner, enableCollateral, permit2, }: EncodeMintArgs): EVCBatchItem[];
|
|
93
|
+
/**
|
|
94
|
+
* Encodes EVC batch items for withdrawing underlying assets from a vault (burns shares).
|
|
95
|
+
*
|
|
96
|
+
* @param args - Withdraw encoding arguments
|
|
97
|
+
* @param args.chainId - Chain ID (used for EVC when disabling collateral)
|
|
98
|
+
* @param args.vault - Address of the vault to withdraw from
|
|
99
|
+
* @param args.assets - Amount of underlying assets to withdraw
|
|
100
|
+
* @param args.receiver - Address that receives the withdrawn underlying assets
|
|
101
|
+
* @param args.owner - Sub-account address whose vault shares are withdrawn (onBehalfOfAccount)
|
|
102
|
+
* @param args.disableCollateral - If true, appends disableCollateral( owner, vault ) via EVC before withdraw
|
|
103
|
+
* @returns Array of EVC batch items (optional disableCollateral, withdraw)
|
|
104
|
+
*/
|
|
105
|
+
encodeWithdraw({ chainId, vault, assets, receiver, owner, disableCollateral, }: EncodeWithdrawArgs): EVCBatchItem[];
|
|
106
|
+
/**
|
|
107
|
+
* Encodes EVC batch items for redeeming vault shares for underlying assets.
|
|
108
|
+
*
|
|
109
|
+
* @param args - Redeem encoding arguments
|
|
110
|
+
* @param args.chainId - Chain ID (used for EVC when disabling collateral)
|
|
111
|
+
* @param args.vault - Address of the vault to redeem from
|
|
112
|
+
* @param args.shares - Number of vault shares to redeem
|
|
113
|
+
* @param args.receiver - Address that receives the underlying assets
|
|
114
|
+
* @param args.owner - Sub-account address whose shares are redeemed (onBehalfOfAccount)
|
|
115
|
+
* @param args.disableCollateral - If true, prepends disableCollateral( owner, vault ) via EVC
|
|
116
|
+
* @returns Array of EVC batch items (optional disableCollateral, redeem)
|
|
117
|
+
*/
|
|
118
|
+
encodeRedeem({ chainId, vault, shares, receiver, owner, disableCollateral, }: EncodeRedeemArgs): EVCBatchItem[];
|
|
119
|
+
/**
|
|
120
|
+
* Encodes EVC batch items for borrowing from a liability vault, optionally depositing collateral in the same batch.
|
|
121
|
+
*
|
|
122
|
+
* @param args - Borrow encoding arguments
|
|
123
|
+
* @param args.chainId - Chain ID (used for EVC and optional deposit)
|
|
124
|
+
* @param args.vault - Address of the liability (borrow) vault to borrow from
|
|
125
|
+
* @param args.amount - Amount of underlying assets to borrow
|
|
126
|
+
* @param args.owner - Address that owns collateral assets when depositing (onBehalfOfAccount for deposit)
|
|
127
|
+
* @param args.borrowAccount - Sub-account that takes the debt and receives collateral if any
|
|
128
|
+
* @param args.receiver - Address that receives the borrowed assets
|
|
129
|
+
* @param args.enableController - If true, enables this vault as controller for borrowAccount via EVC before borrow (default true)
|
|
130
|
+
* @param args.currentController - If set and different from vault, disables it before enabling the new controller
|
|
131
|
+
* @param args.collateralVault - Optional vault to deposit collateral into (same batch)
|
|
132
|
+
* @param args.collateralAmount - Optional amount of collateral to deposit (requires collateralVault)
|
|
133
|
+
* @param args.enableCollateral - When depositing collateral, whether to enable it for borrowAccount (default true)
|
|
134
|
+
* @param args.collateralPermit2 - Optional Permit2 data for the collateral deposit
|
|
135
|
+
* @returns Array of EVC batch items (optional deposit, optional disableController, optional enableController, borrow)
|
|
136
|
+
*/
|
|
137
|
+
encodeBorrow(args: EncodeBorrowArgs): EVCBatchItem[];
|
|
138
|
+
/**
|
|
139
|
+
* Encodes EVC batch items for liquidating an undercollateralized account (repay debt, seize collateral).
|
|
140
|
+
*
|
|
141
|
+
* @param args - Liquidation encoding arguments
|
|
142
|
+
* @param args.chainId - Chain ID (used for EVC enableController/enableCollateral)
|
|
143
|
+
* @param args.vault - Address of the liability vault (debt is repaid to this vault)
|
|
144
|
+
* @param args.violator - Sub-account address of the account being liquidated
|
|
145
|
+
* @param args.collateral - Address of the collateral vault from which collateral is seized
|
|
146
|
+
* @param args.repayAssets - Amount of liability asset the liquidator repays
|
|
147
|
+
* @param args.minYieldBalance - Minimum yield balance the liquidator requires; liquidation can revert if not met
|
|
148
|
+
* @param args.liquidatorSubAccountAddress - Sub-account that repays and receives seized collateral (onBehalfOfAccount)
|
|
149
|
+
* @param args.enableController - If true, enables vault as controller for liquidator sub-account before liquidate (default true)
|
|
150
|
+
* @param args.enableCollateral - If true, enables collateral vault for liquidator sub-account after liquidate (default true)
|
|
151
|
+
* @returns Array of EVC batch items (optional enableController, liquidate, optional enableCollateral)
|
|
152
|
+
*/
|
|
153
|
+
encodeLiquidation({ chainId, vault, violator, collateral, repayAssets, minYieldBalance, liquidatorSubAccountAddress, enableCollateral, enableController, }: EncodeLiquidationArgs): EVCBatchItem[];
|
|
154
|
+
/**
|
|
155
|
+
* Encodes EVC batch items for pulling debt from one sub-account to another on the same liability vault.
|
|
156
|
+
*
|
|
157
|
+
* @param args - Pull-debt encoding arguments
|
|
158
|
+
* @param args.chainId - Chain ID (used for EVC when enabling controller)
|
|
159
|
+
* @param args.vault - Address of the liability vault
|
|
160
|
+
* @param args.amount - Amount of debt to pull
|
|
161
|
+
* @param args.from - Sub-account address from which debt is pulled
|
|
162
|
+
* @param args.to - Sub-account address that receives the debt (onBehalfOfAccount)
|
|
163
|
+
* @param args.enableController - If true, enables vault as controller for `to` via EVC before pullDebt (default true)
|
|
164
|
+
* @returns Array of EVC batch items (optional enableController, pullDebt)
|
|
165
|
+
*/
|
|
166
|
+
encodePullDebt({ chainId, vault, amount, from, to, enableController, }: EncodePullDebtArgs): EVCBatchItem[];
|
|
167
|
+
/**
|
|
168
|
+
* Encodes EVC batch items for a multiply/leverage operation when liability and long asset differ (swap required).
|
|
169
|
+
* Order: optional permit2 → optional deposit + enable collateral → optional disableController → enableController → borrow → swap → verify/skim → optional enableCollateral on long vault.
|
|
170
|
+
*
|
|
171
|
+
* @param args - Multiply-with-swap encoding arguments
|
|
172
|
+
* @param args.chainId - Chain ID (used for EVC and permit2)
|
|
173
|
+
* @param args.collateralVault - Vault to deposit initial collateral into (can use 0n amount to skip)
|
|
174
|
+
* @param args.collateralAmount - Amount of collateral to deposit (0n to skip)
|
|
175
|
+
* @param args.liabilityVault - Vault to borrow from (liability)
|
|
176
|
+
* @param args.liabilityAmount - Amount to borrow (sent to swapper)
|
|
177
|
+
* @param args.longVault - Vault that receives the swapped assets (verify type must be skimMin)
|
|
178
|
+
* @param args.owner - Address that owns collateral (onBehalfOfAccount for deposit)
|
|
179
|
+
* @param args.receiver - Sub-account that holds the position (receives collateral, long and debt)
|
|
180
|
+
* @param args.enableCollateral - When depositing collateral, whether to enable it for receiver (default true)
|
|
181
|
+
* @param args.enableCollateralLong - Whether to enable long vault as collateral for receiver (default true)
|
|
182
|
+
* @param args.currentController - If set and different from liabilityVault, disables it first
|
|
183
|
+
* @param args.enableController - Whether to enable liability vault as controller for receiver (default true)
|
|
184
|
+
* @param args.collateralPermit2 - Optional Permit2 data for collateral deposit
|
|
185
|
+
* @param args.swapQuote - Quote with swap and verify (skimMin) steps; borrow is sent to swapQuote.swap.swapperAddress
|
|
186
|
+
* @returns Array of EVC batch items
|
|
187
|
+
*/
|
|
188
|
+
encodeMultiplyWithSwap(args: EncodeMultiplyWithSwapArgs): EVCBatchItem[];
|
|
189
|
+
/**
|
|
190
|
+
* Encodes EVC batch items for a multiply/leverage operation when liability and long asset are the same (no swap).
|
|
191
|
+
* Order: optional permit2 → optional deposit + enable collateral → optional disableController → enableController → borrow to longVault → skim → enableCollateral on long vault.
|
|
192
|
+
*
|
|
193
|
+
* @param args - Multiply-same-asset encoding arguments
|
|
194
|
+
* @param args.chainId - Chain ID (used for EVC and permit2)
|
|
195
|
+
* @param args.collateralVault - Vault to deposit initial collateral into (can use 0n to skip)
|
|
196
|
+
* @param args.collateralAmount - Amount of collateral to deposit (0n to skip)
|
|
197
|
+
* @param args.liabilityVault - Vault to borrow from (same asset as longVault)
|
|
198
|
+
* @param args.liabilityAmount - Amount to borrow (sent to longVault)
|
|
199
|
+
* @param args.longVault - Vault that receives the borrowed assets (skim + enable collateral)
|
|
200
|
+
* @param args.owner - Address that owns collateral (onBehalfOfAccount for deposit)
|
|
201
|
+
* @param args.receiver - Sub-account that holds the position
|
|
202
|
+
* @param args.enableCollateral - When depositing collateral, whether to enable it (default true)
|
|
203
|
+
* @param args.enableCollateralLong - Whether to enable long vault as collateral (default true)
|
|
204
|
+
* @param args.currentController - If set and different from liabilityVault, disables it first
|
|
205
|
+
* @param args.enableController - Whether to enable liability vault as controller (default true)
|
|
206
|
+
* @param args.collateralPermit2 - Optional Permit2 data for collateral deposit
|
|
207
|
+
* @returns Array of EVC batch items
|
|
208
|
+
*/
|
|
209
|
+
encodeMultiplySameAsset(args: EncodeMultiplySameAssetArgs): EVCBatchItem[];
|
|
210
|
+
/**
|
|
211
|
+
* Encodes EVC batch items for repaying debt using assets from the sender's wallet (transferFrom to vault then repay).
|
|
212
|
+
*
|
|
213
|
+
* @param args - Repay-from-wallet encoding arguments
|
|
214
|
+
* @param args.chainId - Chain ID (used for permit2 when provided)
|
|
215
|
+
* @param args.sender - Address that sends the liability asset and authorizes the repay (onBehalfOfAccount)
|
|
216
|
+
* @param args.liabilityVault - Vault (liability) to repay debt to
|
|
217
|
+
* @param args.liabilityAmount - Amount to repay (use maxUint256 with isMax for "repay all")
|
|
218
|
+
* @param args.receiver - Sub-account whose debt is repaid
|
|
219
|
+
* @param args.disableControllerOnMax - If true and isMax, appends disableController for receiver on liabilityVault (default true)
|
|
220
|
+
* @param args.isMax - If true, repays max (amount is ignored and maxUint256 is passed to repay)
|
|
221
|
+
* @param args.permit2 - Optional Permit2 message + signature so transferFrom can be used without prior approve
|
|
222
|
+
* @returns Array of EVC batch items (optional permit2, repay, optional disableController)
|
|
223
|
+
*/
|
|
224
|
+
encodeRepayFromWallet(args: EncodeRepayFromWalletArgs): EVCBatchItem[];
|
|
225
|
+
/**
|
|
226
|
+
* Encodes EVC batch items for repaying debt from a deposit (same-asset only).
|
|
227
|
+
* Path 1: same asset and same vault → repayWithShares. Path 2: same asset, different vault → withdraw then repay/skim/repayWithShares as needed.
|
|
228
|
+
*
|
|
229
|
+
* @param args - Repay-from-deposit encoding arguments
|
|
230
|
+
* @param args.chainId - Chain ID (used for EVC and optional permit2)
|
|
231
|
+
* @param args.liabilityVault - Vault (liability) to repay debt to
|
|
232
|
+
* @param args.liabilityAsset - Underlying asset address of the liability vault
|
|
233
|
+
* @param args.liabilityAmount - Amount of liability to repay (maxUint256 with isMax for full repay)
|
|
234
|
+
* @param args.from - Sub-account address that holds the source deposit (withdraw/shares source)
|
|
235
|
+
* @param args.receiver - Sub-account whose debt is repaid
|
|
236
|
+
* @param args.fromVault - Vault to withdraw/source assets from (must be same asset as liability for this encoder)
|
|
237
|
+
* @param args.fromAsset - Underlying asset of fromVault (must equal liabilityAsset)
|
|
238
|
+
* @param args.disableControllerOnMax - When isMax, whether to disable controller for receiver (default true)
|
|
239
|
+
* @param args.isMax - If true, repays full debt (amount used for withdraw sizing where applicable)
|
|
240
|
+
* @param args.liabilityPermit2 - Optional Permit2 for liability asset when path uses transfer/repay
|
|
241
|
+
* @returns Array of EVC batch items. Throws if fromAsset !== liabilityAsset.
|
|
242
|
+
*/
|
|
243
|
+
encodeRepayFromDeposit(args: EncodeRepayFromDepositArgs): EVCBatchItem[];
|
|
244
|
+
/**
|
|
245
|
+
* Encodes EVC batch items for repaying debt by swapping collateral (withdraw from vaultIn → swap → verify/repay debtMax).
|
|
246
|
+
* Swap quote must come from swapService.fetchRepayQuotes() or match the same structure (verify type debtMax).
|
|
247
|
+
*
|
|
248
|
+
* @param args - Repay-with-swap encoding arguments
|
|
249
|
+
* @param args.chainId - Chain ID (used for EVC disableController when applicable)
|
|
250
|
+
* @param args.swapQuote - Quote with vaultIn, accountIn, accountOut, receiver, swap and verify (debtMax) steps
|
|
251
|
+
* @param args.maxWithdraw - Optional cap on withdraw amount (e.g. available collateral); if less than quote amountInMax, that value is used
|
|
252
|
+
* @param args.isMax - If true, disables controller on max repay when disableControllerOnMax is true (default true)
|
|
253
|
+
* @param args.disableControllerOnMax - When isMax, whether to append disableController for accountOut on receiver (default true)
|
|
254
|
+
* @returns Array of EVC batch items (withdraw, swap, verify/repay, optional disableController)
|
|
255
|
+
*/
|
|
256
|
+
encodeRepayWithSwap(args: EncodeRepayWithSwapArgs): EVCBatchItem[];
|
|
257
|
+
/**
|
|
258
|
+
* Encodes EVC batch items for depositing into a vault using tokens from the user's wallet, going through a swap.
|
|
259
|
+
* The approval is given to SwapVerifier, then transferFromSender pulls tokens to Swapper, swap executes, and output is deposited.
|
|
260
|
+
*
|
|
261
|
+
* @param args - Deposit-with-swap-from-wallet encoding arguments
|
|
262
|
+
* @param args.chainId - Chain ID (used for EVC and deployment addresses)
|
|
263
|
+
* @param args.swapQuote - Quote with swap and verify steps (verify type skimMin or transferMin)
|
|
264
|
+
* @param args.amount - Amount of input token to transfer from wallet to swapper
|
|
265
|
+
* @param args.sender - Wallet address providing the tokens (onBehalfOfAccount for transferFromSender)
|
|
266
|
+
* @param args.enableCollateral - If true, enables receiver vault as collateral for accountOut (default true)
|
|
267
|
+
* @returns Array of EVC batch items (transferFromSender, swap, verify, optional enableCollateral)
|
|
268
|
+
*/
|
|
269
|
+
encodeDepositWithSwapFromWallet(args: EncodeDepositWithSwapFromWalletArgs): EVCBatchItem[];
|
|
270
|
+
/**
|
|
271
|
+
* Encodes EVC batch items for swapping collateral: withdraw from vaultIn → swap → verify/skim to receiver; optional enable/disable collateral.
|
|
272
|
+
* Swap quote should come from swapService.fetchDepositQuote() or match the same structure (verify type skimMin).
|
|
273
|
+
*
|
|
274
|
+
* @param args - Swap-collateral encoding arguments
|
|
275
|
+
* @param args.chainId - Chain ID (used for EVC enableCollateral/disableCollateral)
|
|
276
|
+
* @param args.swapQuote - Quote with vaultIn, accountIn, accountOut, receiver, swap and verify (skimMin) steps
|
|
277
|
+
* @param args.enableCollateral - If true, enables receiver vault as collateral for accountOut (default true)
|
|
278
|
+
* @param args.disableCollateralOnMax - When isMax, whether to disable collateral for accountIn on vaultIn (default true)
|
|
279
|
+
* @param args.isMax - If true, treats as full swap (can trigger disableCollateralOnMax)
|
|
280
|
+
* @returns Array of EVC batch items (withdraw, swap, verify/skim, optional disableCollateral, optional enableCollateral)
|
|
281
|
+
*/
|
|
282
|
+
encodeSwapCollateral(args: EncodeSwapCollateralArgs): EVCBatchItem[];
|
|
283
|
+
/**
|
|
284
|
+
* Encodes EVC batch items for swapping debt: enableController → borrow from vaultIn → swap → verify/repay (debtMax).
|
|
285
|
+
* Swap quote should come from swapService.fetchRepayQuotes() or match the same structure (verify type debtMax).
|
|
286
|
+
*
|
|
287
|
+
* @param args - Swap-debt encoding arguments
|
|
288
|
+
* @param args.chainId - Chain ID (used for EVC enableController/disableController)
|
|
289
|
+
* @param args.swapQuote - Quote with vaultIn, accountIn, accountOut, receiver, swap and verify (debtMax) steps
|
|
290
|
+
* @param args.enableController - If true, enables vaultIn as controller for accountOut before borrow (default true)
|
|
291
|
+
* @param args.disableControllerOnMax - When isMax, whether to disable controller for accountIn on receiver (default true)
|
|
292
|
+
* @param args.isMax - If true, treats as full debt swap (can trigger disableControllerOnMax)
|
|
293
|
+
* @returns Array of EVC batch items (optional enableController, borrow, swap, verify/repay, optional disableController)
|
|
294
|
+
*/
|
|
295
|
+
encodeSwapDebt({ chainId, swapQuote, enableController, disableControllerOnMax, isMax, }: EncodeSwapDebtArgs): EVCBatchItem[];
|
|
296
|
+
/**
|
|
297
|
+
* Encodes EVC batch items for transferring vault shares between sub-accounts.
|
|
298
|
+
*
|
|
299
|
+
* @param args - Transfer encoding arguments
|
|
300
|
+
* @param args.chainId - Chain ID (used for EVC when enabling/disabling collateral)
|
|
301
|
+
* @param args.vault - Address of the vault
|
|
302
|
+
* @param args.from - Sub-account address sending the shares (onBehalfOfAccount)
|
|
303
|
+
* @param args.to - Sub-account address receiving the shares
|
|
304
|
+
* @param args.amount - Amount of vault shares to transfer
|
|
305
|
+
* @param args.enableCollateralTo - If true, appends enableCollateral( to, vault ) via EVC after transfer
|
|
306
|
+
* @param args.disableCollateralFrom - If true, prepends disableCollateral( from, vault ) via EVC before transfer
|
|
307
|
+
* @returns Array of EVC batch items (optional disableCollateralFrom, transfer, optional enableCollateralTo)
|
|
308
|
+
*/
|
|
309
|
+
encodeTransfer({ chainId, vault, to, amount, from, enableCollateralTo, disableCollateralFrom, }: EncodeTransferArgs): EVCBatchItem[];
|
|
310
|
+
/**
|
|
311
|
+
* Encodes a single EVC batch item that calls Permit2's `permit` with the given message and signature.
|
|
312
|
+
* Used to authorize a token transfer for a subsequent contract call in the same batch.
|
|
313
|
+
*
|
|
314
|
+
* @param args - Permit2 call encoding arguments
|
|
315
|
+
* @param args.chainId - Chain ID (used to resolve Permit2 contract address)
|
|
316
|
+
* @param args.owner - Token owner that signed the permit (onBehalfOfAccount)
|
|
317
|
+
* @param args.message - Permit2 PermitSingle message (details + spender + sigDeadline)
|
|
318
|
+
* @param args.signature - Signature over the permit message
|
|
319
|
+
* @returns Single EVC batch item (targetContract = Permit2, permit call)
|
|
320
|
+
*/
|
|
321
|
+
encodePermit2Call(args: EncodePermit2CallArgs): EVCBatchItem;
|
|
322
|
+
encodeEnableCollateral(chainId: number, account: Address, vault: Address): EVCBatchItem;
|
|
323
|
+
encodeDisableCollateral(chainId: number, account: Address, vault: Address): EVCBatchItem;
|
|
324
|
+
encodeEnableController(chainId: number, account: Address, vault: Address): EVCBatchItem;
|
|
325
|
+
encodeDisableController(vault: Address, account: Address): EVCBatchItem;
|
|
326
|
+
/**
|
|
327
|
+
* Builds EIP-712 typed data for a Permit2 PermitSingle signature (token approval for a spender).
|
|
328
|
+
* Use with signTypedData (e.g. wagmi) then pass the signed message to encodePermit2Call or plan flows.
|
|
329
|
+
*
|
|
330
|
+
* @param args - Permit2 typed data arguments
|
|
331
|
+
* @param args.chainId - Chain ID (used to resolve Permit2 contract for domain)
|
|
332
|
+
* @param args.token - Token address to approve
|
|
333
|
+
* @param args.amount - Amount to approve (capped to maxUint160 in the message if larger)
|
|
334
|
+
* @param args.spender - Address that will be allowed to transfer the token (e.g. vault or Permit2)
|
|
335
|
+
* @param args.nonce - Unique nonce for this permit (e.g. from Permit2 nonce(owner, token, spender))
|
|
336
|
+
* @param args.sigDeadline - Signature deadline (defaults to now + 1 hour if omitted)
|
|
337
|
+
* @param args.expiration - Permit expiration (defaults to maxUint48 if omitted)
|
|
338
|
+
* @returns EIP-712 typed data (domain, types, primaryType, message) for signing
|
|
339
|
+
*/
|
|
340
|
+
getPermit2TypedData(args: GetPermit2TypedDataArgs): PermitSingleTypedData;
|
|
341
|
+
/**
|
|
342
|
+
* Decodes EVC batch items into human-readable function names and named arguments.
|
|
343
|
+
* Tries known ABIs (EVC, eVault, Permit2, swapper, swapVerifier) to decode each item's data.
|
|
344
|
+
*
|
|
345
|
+
* @param batch - Array of EVC batch items (targetContract, onBehalfOfAccount, value, data) to decode
|
|
346
|
+
* @param extraAbis - Optional extra ABIs to try first when decoding unknown batch items.
|
|
347
|
+
* @returns Array of decoded items with targetContract, onBehalfOfAccount, functionName, and args (record of param name to value). Throws if any item cannot be decoded.
|
|
348
|
+
* @example
|
|
349
|
+
* const batchItems = executionService.encodeDeposit({ ... });
|
|
350
|
+
* const described = executionService.describeBatch(batchItems);
|
|
351
|
+
* console.log(described[0].functionName); // "deposit"
|
|
352
|
+
* console.log(described[0].args); // { amount: 1000n, receiver: "0x..." }
|
|
353
|
+
*/
|
|
354
|
+
describeBatch(batch: EVCBatchItem[], extraAbis?: Abi[]): BatchItemDescription[];
|
|
355
|
+
/**
|
|
356
|
+
* Merges multiple transaction plans into a single plan.
|
|
357
|
+
* Required approvals for the same (token, owner, spender) are summed.
|
|
358
|
+
* Executable items are preserved in order; adjacent EVC batch items are concatenated.
|
|
359
|
+
* Can be used to construct a transaction queue.
|
|
360
|
+
*
|
|
361
|
+
* @param plans - Array of transaction plans to merge
|
|
362
|
+
* @returns Single plan: summed required approvals first, followed by executable items in order
|
|
363
|
+
*/
|
|
364
|
+
mergePlans(plans: TransactionPlan[]): TransactionPlan;
|
|
365
|
+
/**
|
|
366
|
+
* Converts EVC batch items into a transaction plan.
|
|
367
|
+
* Returns a plan with a single evcBatch containing the given items (no required approvals).
|
|
368
|
+
* Returns an empty plan if items is empty.
|
|
369
|
+
*
|
|
370
|
+
* @param items - EVC batch items to wrap in a plan
|
|
371
|
+
* @returns Transaction plan containing one evcBatch with the items
|
|
372
|
+
*/
|
|
373
|
+
convertBatchItemsToPlan(items: EVCBatchItem[]): TransactionPlan;
|
|
374
|
+
/**
|
|
375
|
+
* Encodes batch items for repaying with shares from the same asset and vault
|
|
376
|
+
*/
|
|
377
|
+
private encodeRepayWithSharesSameAssetAndVault;
|
|
378
|
+
/**
|
|
379
|
+
* Encodes batch items for repaying with shares from same asset but different vault
|
|
380
|
+
*/
|
|
381
|
+
private encodeRepayWithSharesSameAssetDifferentVault;
|
|
382
|
+
/**
|
|
383
|
+
* Resolves RequiredApproval items in a transaction plan by filling in each item's `resolved` field.
|
|
384
|
+
* Uses wallet allowances (and optional Permit2 state) to decide whether to add approve/permit2 steps.
|
|
385
|
+
* Mutates the plan in place and returns it.
|
|
386
|
+
*
|
|
387
|
+
* @param args - Resolve-with-wallet arguments
|
|
388
|
+
* @param args.plan - Transaction plan containing requiredApproval items (e.g. from planDeposit, planBorrow)
|
|
389
|
+
* @param args.chainId - Chain ID (used to resolve Permit2 address when usePermit2 is true)
|
|
390
|
+
* @param args.wallet - Wallet entity with token balances and allowances (assetForVault, assetForPermit2, etc.)
|
|
391
|
+
* @param args.usePermit2 - If true, prefer Permit2 path (approve Permit2 + sign PermitSingle) when allowance is insufficient (default true)
|
|
392
|
+
* @param args.unlimitedApproval - If true, approval/permit amounts use maxUint256/maxUint160 (default true)
|
|
393
|
+
* @returns The same plan array with requiredApproval[].resolved populated (approve and/or permit2 data to sign)
|
|
394
|
+
*/
|
|
395
|
+
resolveRequiredApprovalsWithWallet(args: ResolveRequiredApprovalsWithWalletArgs): TransactionPlanItem[];
|
|
396
|
+
/**
|
|
397
|
+
* Resolves RequiredApproval items in a transaction plan by fetching wallet data then filling in approvals.
|
|
398
|
+
* Collects (token, spender) from plan's requiredApproval items, fetches wallet via WalletService, then calls resolveRequiredApprovalsWithWallet.
|
|
399
|
+
*
|
|
400
|
+
* @param args - Resolve arguments
|
|
401
|
+
* @param args.plan - Transaction plan containing requiredApproval items
|
|
402
|
+
* @param args.chainId - Chain ID (used for deployment and wallet fetch)
|
|
403
|
+
* @param args.account - Account address (owner) used to fetch wallet and allowances
|
|
404
|
+
* @param args.usePermit2 - If true, use Permit2 path when needed (default true)
|
|
405
|
+
* @param args.unlimitedApproval - If true, use max amounts for approvals (default false)
|
|
406
|
+
* @returns Promise of the plan with requiredApproval[].resolved populated
|
|
407
|
+
*/
|
|
408
|
+
resolveRequiredApprovals(args: ResolveRequiredApprovalsArgs): Promise<TransactionPlanItem[]>;
|
|
409
|
+
/**
|
|
410
|
+
* Builds a transaction plan for depositing assets into a vault.
|
|
411
|
+
* Use `maxUint256` for `amount` to deposit all available assets from the wallet.
|
|
412
|
+
*
|
|
413
|
+
* @param args - Deposit plan arguments
|
|
414
|
+
* @param args.vault - Address of the vault to deposit into
|
|
415
|
+
* @param args.amount - Amount of underlying assets to deposit (use maxUint256 for "deposit all")
|
|
416
|
+
* @param args.receiver - Sub-account address that will receive the vault shares (and count as collateral if enabled)
|
|
417
|
+
* @param args.account - Account entity (owner + positions); used for chainId, owner, and collateral state
|
|
418
|
+
* @param args.asset - Address of the underlying ERC20 asset being deposited (used for approval requirement)
|
|
419
|
+
* @param args.enableCollateral - If true, enables this vault as collateral for `receiver` when not already enabled
|
|
420
|
+
* @returns Array of transaction plan items (required approvals + EVC batch)
|
|
421
|
+
*/
|
|
422
|
+
planDeposit(args: PlanDepositArgs): TransactionPlanItem[];
|
|
423
|
+
/**
|
|
424
|
+
* Builds a transaction plan for minting vault shares by depositing assets.
|
|
425
|
+
*
|
|
426
|
+
* @param args - Mint plan arguments
|
|
427
|
+
* @param args.vault - Address of the vault to mint shares from
|
|
428
|
+
* @param args.shares - Number of vault shares to mint
|
|
429
|
+
* @param args.receiver - Sub-account address that will receive the shares (and count as collateral if enabled)
|
|
430
|
+
* @param args.account - Account entity (owner + positions); used for chainId, owner, and collateral state
|
|
431
|
+
* @param args.asset - Address of the underlying ERC20 asset (used for approval requirement)
|
|
432
|
+
* @param args.enableCollateral - If true, enables this vault as collateral for `receiver` when not already enabled
|
|
433
|
+
* @param args.sharesToAssetsExchangeRateWad - Optional exchange rate (WAD) to estimate asset amount for approval when minting by shares. Default 1.
|
|
434
|
+
* @returns Array of transaction plan items (required approvals + EVC batch)
|
|
435
|
+
*/
|
|
436
|
+
planMint(args: PlanMintArgs): TransactionPlan;
|
|
437
|
+
/**
|
|
438
|
+
* Builds a transaction plan for withdrawing assets from a vault.
|
|
439
|
+
*
|
|
440
|
+
* @param args - Withdraw plan arguments
|
|
441
|
+
* @param args.vault - Address of the vault to withdraw from
|
|
442
|
+
* @param args.assets - Amount of underlying assets to withdraw
|
|
443
|
+
* @param args.owner - Sub-account address whose vault shares are being withdrawn
|
|
444
|
+
* @param args.receiver - Address that will receive the withdrawn underlying assets
|
|
445
|
+
* @param args.account - Account entity; used for chainId and position/collateral state
|
|
446
|
+
* @param args.disableCollateral - If true, disables this vault as collateral for `owner` when the position is fully withdrawn and was collateral
|
|
447
|
+
* @returns Array of transaction plan items (EVC batch; no approvals needed for withdraw)
|
|
448
|
+
*/
|
|
449
|
+
planWithdraw(args: PlanWithdrawArgs): TransactionPlan;
|
|
450
|
+
/**
|
|
451
|
+
* Builds a transaction plan for redeeming vault shares for underlying assets.
|
|
452
|
+
* Use `maxUint256` for `shares` to redeem all available shares.
|
|
453
|
+
*
|
|
454
|
+
* @param args - Redeem plan arguments
|
|
455
|
+
* @param args.vault - Address of the vault to redeem shares from
|
|
456
|
+
* @param args.shares - Number of vault shares to redeem (use maxUint256 for "redeem all")
|
|
457
|
+
* @param args.owner - Sub-account address whose shares are being redeemed
|
|
458
|
+
* @param args.receiver - Address that will receive the underlying assets
|
|
459
|
+
* @param args.account - Account entity; used for chainId and position/collateral state
|
|
460
|
+
* @param args.disableCollateral - If true, disables this vault as collateral for `owner` when the position is fully redeemed and was collateral
|
|
461
|
+
* @returns Array of transaction plan items (EVC batch; no approvals needed for redeem)
|
|
462
|
+
*/
|
|
463
|
+
planRedeem(args: PlanRedeemArgs): TransactionPlan;
|
|
464
|
+
/**
|
|
465
|
+
* Builds a transaction plan for borrowing from a liability vault.
|
|
466
|
+
* Use `maxUint256` for `collateral.amount` to deposit all available collateral asset from the wallet.
|
|
467
|
+
*
|
|
468
|
+
* @param args - Borrow plan arguments
|
|
469
|
+
* @param args.vault - Address of the liability (borrow) vault to borrow from
|
|
470
|
+
* @param args.amount - Amount of underlying assets to borrow
|
|
471
|
+
* @param args.borrowAccount - Sub-account address that will take the debt (and hold collateral if any)
|
|
472
|
+
* @param args.receiver - Address that will receive the borrowed assets
|
|
473
|
+
* @param args.account - Account entity; used for chainId, owner, controller/collateral state
|
|
474
|
+
* @param args.collateral - Optional: deposit collateral in the same batch; use maxUint256 for amount to deposit all available
|
|
475
|
+
* @param args.collateral.vault - Collateral vault to deposit into
|
|
476
|
+
* @param args.collateral.amount - Amount of collateral asset to deposit
|
|
477
|
+
* @param args.collateral.asset - Underlying asset address of the collateral (for approval)
|
|
478
|
+
* @returns Array of transaction plan items (optional approval + EVC batch)
|
|
479
|
+
*/
|
|
480
|
+
planBorrow(args: PlanBorrowArgs): TransactionPlan;
|
|
481
|
+
/**
|
|
482
|
+
* Builds a transaction plan for liquidating an undercollateralized account.
|
|
483
|
+
*
|
|
484
|
+
* @param args - Liquidation plan arguments
|
|
485
|
+
* @param args.account - Liquidator's account entity; used for chainId, owner, and controller/collateral state on liquidator sub-account
|
|
486
|
+
* @param args.liquidatorSubAccountAddress - Sub-account address that will repay debt and receive seized collateral
|
|
487
|
+
* @param args.vault - Address of the liability vault (debt is repaid to this vault)
|
|
488
|
+
* @param args.asset - Address of the liability vault's underlying asset (used for approval of repay amount)
|
|
489
|
+
* @param args.violator - Sub-account address of the undercollateralized account being liquidated
|
|
490
|
+
* @param args.collateral - Address of the collateral vault from which collateral is seized
|
|
491
|
+
* @param args.repayAssets - Amount of liability asset the liquidator will repay (and receive collateral up to the liquidation incentive)
|
|
492
|
+
* @param args.minYieldBalance - Minimum yield balance the liquidator requires; liquidation may revert if not met
|
|
493
|
+
* @returns Array of transaction plan items (approval for repay asset + EVC batch)
|
|
494
|
+
*/
|
|
495
|
+
planLiquidation(args: PlanLiquidationArgs): TransactionPlan;
|
|
496
|
+
/**
|
|
497
|
+
* Builds a transaction plan for repaying debt using assets from the wallet.
|
|
498
|
+
* Use `maxUint256` for `liabilityAmount` to repay all available debt.
|
|
499
|
+
*
|
|
500
|
+
* @param args - Repay-from-wallet plan arguments
|
|
501
|
+
* @param args.liabilityVault - Address of the liability vault (debt is repaid to this vault)
|
|
502
|
+
* @param args.liabilityAmount - Amount of liability asset to repay (use maxUint256 for "repay all")
|
|
503
|
+
* @param args.receiver - Sub-account address whose debt is being repaid
|
|
504
|
+
* @param args.account - Account entity; used for chainId, owner, and position (to resolve liability asset)
|
|
505
|
+
* @returns Array of transaction plan items (approval + EVC batch)
|
|
506
|
+
*/
|
|
507
|
+
planRepayFromWallet(args: PlanRepayFromWalletArgs): TransactionPlan;
|
|
508
|
+
/**
|
|
509
|
+
* Builds a transaction plan for repaying debt using assets from another vault deposit (same asset only).
|
|
510
|
+
* Use `maxUint256` for `liabilityAmount` to repay all available debt or up to the available deposit.
|
|
511
|
+
*
|
|
512
|
+
* @param args - Repay-from-deposit plan arguments
|
|
513
|
+
* @param args.liabilityVault - Address of the liability vault (debt is repaid to this vault)
|
|
514
|
+
* @param args.liabilityAmount - Amount of liability to repay (use maxUint256 for max repay)
|
|
515
|
+
* @param args.receiver - Sub-account address whose debt is being repaid (and from whose deposit we may withdraw when fromAccount === receiver)
|
|
516
|
+
* @param args.fromVault - Vault to withdraw assets from (must be same underlying asset as liability for this plan)
|
|
517
|
+
* @param args.fromAccount - Sub-account that holds the deposit in `fromVault`
|
|
518
|
+
* @param args.account - Account entity; used for chainId, owner, and positions (to resolve assets and eligibility)
|
|
519
|
+
* @returns Array of transaction plan items (optional approval + EVC batch). Throws if asset differs between fromVault and liabilityVault; use planRepayWithSwap for cross-asset.
|
|
520
|
+
*/
|
|
521
|
+
planRepayFromDeposit(args: PlanRepayFromDepositArgs): TransactionPlan;
|
|
522
|
+
/**
|
|
523
|
+
* Builds a transaction plan for repaying debt by swapping collateral (e.g. withdraw collateral → swap → repay).
|
|
524
|
+
* Use when the repayment asset differs from the collateral asset.
|
|
525
|
+
*
|
|
526
|
+
* @param args - Repay-with-swap plan arguments
|
|
527
|
+
* @param args.swapQuote - Quote from swap service (e.g. fetchRepayQuotes); defines vaultIn, accountIn, accountOut, receiver, swap and verify steps
|
|
528
|
+
* @param args.account - Account entity; used for chainId and positions (to compute isMax and maxWithdraw)
|
|
529
|
+
* @returns Array of transaction plan items (EVC batch: withdraw, swap, verify/repay). Throws if positions not found or liability is zero.
|
|
530
|
+
*/
|
|
531
|
+
planRepayWithSwap(args: PlanRepayWithSwapArgs): TransactionPlan;
|
|
532
|
+
/**
|
|
533
|
+
* Builds a transaction plan for depositing into a vault using tokens from the user's wallet, going through a swap.
|
|
534
|
+
* The approval is given to SwapVerifier (not the vault), then transferFromSender is used in the batch
|
|
535
|
+
* to provide the tokens to the Swapper from the user's wallet.
|
|
536
|
+
*
|
|
537
|
+
* @param args - Deposit-with-swap-from-wallet plan arguments
|
|
538
|
+
* @param args.swapQuote - Quote from swap service; defines swap and verify steps
|
|
539
|
+
* @param args.amount - Amount of input token to transfer from wallet
|
|
540
|
+
* @param args.tokenIn - Input token address (for approval to SwapVerifier)
|
|
541
|
+
* @param args.account - Account entity; used for chainId, owner, and collateral state
|
|
542
|
+
* @param args.enableCollateral - If true, enables receiver vault as collateral for accountOut
|
|
543
|
+
* @returns Array of transaction plan items (approval to SwapVerifier + EVC batch)
|
|
544
|
+
*/
|
|
545
|
+
planDepositWithSwapFromWallet(args: PlanDepositWithSwapFromWalletArgs): TransactionPlan;
|
|
546
|
+
/**
|
|
547
|
+
* Builds a transaction plan for swapping collateral from one vault to another (withdraw → swap → deposit/skim).
|
|
548
|
+
*
|
|
549
|
+
* @param args - Swap-collateral plan arguments
|
|
550
|
+
* @param args.swapQuote - Quote from swap service (e.g. fetchDepositQuote); defines vaultIn, accountIn, accountOut, receiver, swap and verify (skimMin) steps
|
|
551
|
+
* @param args.account - Account entity; used for chainId and positions (to determine isMax and whether to enable collateral on destination)
|
|
552
|
+
* @returns Array of transaction plan items (EVC batch: withdraw, swap, verify/skim, optional enable/disable collateral)
|
|
553
|
+
*/
|
|
554
|
+
planSwapCollateral(args: PlanSwapCollateralArgs): TransactionPlan;
|
|
555
|
+
/**
|
|
556
|
+
* Builds a transaction plan for swapping debt from one liability vault to another (borrow from source → swap → repay to destination).
|
|
557
|
+
*
|
|
558
|
+
* @param args - Swap-debt plan arguments
|
|
559
|
+
* @param args.swapQuote - Quote from swap service (e.g. fetchRepayQuotes for the new debt); defines vaultIn, accountIn, accountOut, swap and verify (debtMax) steps
|
|
560
|
+
* @param args.account - Account entity; used for chainId and controller state (enableController, isMax, disableControllerOnMax)
|
|
561
|
+
* @returns Array of transaction plan items (EVC batch: enableController, borrow, swap, verify/repay, optional disableController)
|
|
562
|
+
*/
|
|
563
|
+
planSwapDebt(args: PlanSwapDebtArgs): TransactionPlan;
|
|
564
|
+
/**
|
|
565
|
+
* Builds a transaction plan for transferring vault shares between sub-accounts.
|
|
566
|
+
*
|
|
567
|
+
* @param args - Transfer plan arguments
|
|
568
|
+
* @param args.vault - Address of the vault
|
|
569
|
+
* @param args.from - Sub-account address sending the shares
|
|
570
|
+
* @param args.to - Sub-account address receiving the shares
|
|
571
|
+
* @param args.amount - Amount of vault shares to transfer
|
|
572
|
+
* @param args.account - Account entity; used for chainId and collateral state for from/to
|
|
573
|
+
* @param args.enableCollateralTo - If true, enables the vault as collateral for `to` when not already enabled
|
|
574
|
+
* @param args.disableCollateralFrom - If true, disables the vault as collateral for `from` when it was enabled
|
|
575
|
+
* @returns Array of transaction plan items (EVC batch; no approvals needed)
|
|
576
|
+
*/
|
|
577
|
+
planTransfer(args: PlanTransferArgs): TransactionPlan;
|
|
578
|
+
/**
|
|
579
|
+
* Builds a transaction plan for pulling debt from one sub-account to another (same liability vault).
|
|
580
|
+
*
|
|
581
|
+
* @param args - Pull-debt plan arguments
|
|
582
|
+
* @param args.vault - Address of the liability vault
|
|
583
|
+
* @param args.amount - Amount of debt to pull
|
|
584
|
+
* @param args.from - Sub-account address from which debt is pulled
|
|
585
|
+
* @param args.to - Sub-account address that will receive the debt (and receive the borrowed assets if any)
|
|
586
|
+
* @param args.account - Account entity; used for chainId and controller state (enableController for `to` if needed)
|
|
587
|
+
* @returns Array of transaction plan items (EVC batch: optional enableController + pullDebt)
|
|
588
|
+
*/
|
|
589
|
+
planPullDebt(args: PlanPullDebtArgs): TransactionPlan;
|
|
590
|
+
/**
|
|
591
|
+
* Builds a transaction plan for a multiply/leverage position when liability and long asset differ (requires a swap).
|
|
592
|
+
* Flow: optional collateral deposit → enable controller → borrow → swap → enable collateral on long vault.
|
|
593
|
+
*
|
|
594
|
+
* @param args - Multiply-with-swap plan arguments
|
|
595
|
+
* @param args.collateralVault - Vault to deposit initial collateral into (optional; omit amount or use 0 to skip)
|
|
596
|
+
* @param args.collateralAmount - Amount of collateral asset to deposit (0n to skip deposit)
|
|
597
|
+
* @param args.collateralAsset - Underlying asset address of collateral (for approval when collateralAmount > 0)
|
|
598
|
+
* @param args.swapQuote - Quote describing borrow vault (vaultIn), long vault (receiver), amounts, swap and verify (skimMin) steps; accountIn must equal accountOut
|
|
599
|
+
* @param args.account - Account entity; used for chainId, owner, and collateral/controller state
|
|
600
|
+
* @returns Array of transaction plan items (optional approval + EVC batch). Throws if swapQuote.accountIn !== swapQuote.accountOut.
|
|
601
|
+
*/
|
|
602
|
+
planMultiplyWithSwap(args: PlanMultiplyWithSwapArgs): TransactionPlan;
|
|
603
|
+
/**
|
|
604
|
+
* Builds a transaction plan for a multiply/leverage position when liability and long asset are the same (no swap).
|
|
605
|
+
* Flow: optional collateral deposit → enable controller → borrow to long vault → skim → enable collateral on long vault.
|
|
606
|
+
*
|
|
607
|
+
* @param args - Multiply-same-asset plan arguments
|
|
608
|
+
* @param args.collateralVault - Vault to deposit initial collateral into (optional; use 0n for collateralAmount to skip)
|
|
609
|
+
* @param args.collateralAmount - Amount of collateral asset to deposit (0n to skip)
|
|
610
|
+
* @param args.collateralAsset - Underlying asset address of collateral (for approval when collateralAmount > 0)
|
|
611
|
+
* @param args.liabilityVault - Liability vault to borrow from
|
|
612
|
+
* @param args.liabilityAmount - Amount to borrow (same asset as long vault)
|
|
613
|
+
* @param args.longVault - Vault to deposit borrowed assets into (same asset as liability)
|
|
614
|
+
* @param args.receiver - Sub-account address that holds the position (collateral + debt)
|
|
615
|
+
* @param args.account - Account entity; used for chainId, owner, and collateral/controller state
|
|
616
|
+
* @returns Array of transaction plan items (optional approval + EVC batch)
|
|
617
|
+
*/
|
|
618
|
+
planMultiplySameAsset(args: PlanMultiplySameAssetArgs): TransactionPlan;
|
|
619
|
+
}
|