@gearbox-protocol/sdk 18.4.0 → 18.4.1-aave.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/model/index.js +1 -4
- package/dist/cjs/offchain/GearboxAPI.js +0 -7
- package/dist/cjs/offchain/index.js +0 -3
- package/dist/cjs/onchain/accounts/bots/AccountBotsService.js +29 -0
- package/dist/cjs/onchain/accounts/bots/PeripheryCompressorV310Contract.js +2 -1
- package/dist/cjs/onchain/accounts/intents/index.js +1 -0
- package/dist/cjs/onchain/accounts/intents/operations.js +21 -0
- package/dist/cjs/onchain/accounts/intents/plan.js +33 -0
- package/dist/cjs/onchain/accounts/intents/realize.js +44 -0
- package/dist/cjs/onchain/accounts/intents/testing/market.js +1 -0
- package/dist/cjs/onchain/accounts/intents/testing/sdk-mock.js +2 -1
- package/dist/cjs/onchain/accounts/intents/utils/ledger.js +8 -0
- package/dist/cjs/onchain/chain/chains.js +4 -0
- package/dist/cjs/onchain/index.js +16 -0
- package/dist/cjs/onchain/market/ZapperRegister.js +1 -1
- package/dist/cjs/onchain/market/adapters/abi/aave/iAaveHorizonBridge.js +94 -0
- package/dist/cjs/onchain/market/adapters/abi/aave/iAaveOracle.js +20 -0
- package/dist/cjs/onchain/market/adapters/abi/aave/iAaveV3Pool.js +278 -0
- package/dist/cjs/onchain/market/adapters/abi/aave/iPoolAddressesProvider.js +11 -0
- package/dist/cjs/onchain/market/adapters/abi/aave/index.js +9 -0
- package/dist/cjs/onchain/market/adapters/abi/actionAbi.js +1 -0
- package/dist/cjs/onchain/market/adapters/abi/adapters/iAaveHorizonBridgeAdapter.js +224 -0
- package/dist/cjs/onchain/market/adapters/abi/adapters/iAaveV3PoolAdapter.js +177 -0
- package/dist/cjs/onchain/market/adapters/abi/adapters/index.js +4 -0
- package/dist/cjs/onchain/market/adapters/abi/conctructorAbi.js +2 -0
- package/dist/cjs/onchain/market/adapters/abi/index.js +13 -0
- package/dist/cjs/onchain/market/adapters/contracts/AaveHorizonBridgeAdapterContract.js +171 -0
- package/dist/cjs/onchain/market/adapters/contracts/AaveV3PoolAdapterContract.js +199 -0
- package/dist/cjs/onchain/market/adapters/contracts/AbstractAdapter.js +8 -0
- package/dist/cjs/onchain/market/adapters/contracts/index.js +4 -0
- package/dist/cjs/onchain/market/adapters/createAdapter.js +4 -0
- package/dist/cjs/onchain/market/adapters/index.js +16 -0
- package/dist/cjs/onchain/market/adapters/types.js +2 -0
- package/dist/cjs/onchain/market/index.js +16 -0
- package/dist/cjs/onchain/positions/projectAavePosition.js +175 -0
- package/dist/cjs/onchain/preview/preview/loadAdapterReplayState.js +17 -0
- package/dist/cjs/onchain/preview/preview/previewOperation.js +2 -0
- package/dist/cjs/sdk/GearboxSDK.js +0 -9
- package/dist/cjs/sdk/prepare/PrepareApi.js +56 -0
- package/dist/cjs/sdk/preview/PreviewNamespace.js +42 -0
- package/dist/esm/model/index.js +2 -3
- package/dist/esm/offchain/GearboxAPI.js +0 -7
- package/dist/esm/offchain/index.js +1 -3
- package/dist/esm/onchain/accounts/bots/AccountBotsService.js +29 -0
- package/dist/esm/onchain/accounts/bots/PeripheryCompressorV310Contract.js +1 -1
- package/dist/esm/onchain/accounts/intents/index.js +2 -1
- package/dist/esm/onchain/accounts/intents/operations.js +20 -1
- package/dist/esm/onchain/accounts/intents/plan.js +33 -1
- package/dist/esm/onchain/accounts/intents/realize.js +46 -2
- package/dist/esm/onchain/accounts/intents/testing/market.js +1 -0
- package/dist/esm/onchain/accounts/intents/testing/sdk-mock.js +2 -1
- package/dist/esm/onchain/accounts/intents/utils/ledger.js +8 -0
- package/dist/esm/onchain/chain/chains.js +4 -0
- package/dist/esm/onchain/index.js +9 -1
- package/dist/esm/onchain/market/ZapperRegister.js +1 -1
- package/dist/esm/onchain/market/adapters/abi/aave/iAaveHorizonBridge.js +93 -0
- package/dist/esm/onchain/market/adapters/abi/aave/iAaveOracle.js +19 -0
- package/dist/esm/onchain/market/adapters/abi/aave/iAaveV3Pool.js +277 -0
- package/dist/esm/onchain/market/adapters/abi/aave/iPoolAddressesProvider.js +10 -0
- package/dist/esm/onchain/market/adapters/abi/aave/index.js +5 -0
- package/dist/esm/onchain/market/adapters/abi/actionAbi.js +1 -0
- package/dist/esm/onchain/market/adapters/abi/adapters/iAaveHorizonBridgeAdapter.js +223 -0
- package/dist/esm/onchain/market/adapters/abi/adapters/iAaveV3PoolAdapter.js +176 -0
- package/dist/esm/onchain/market/adapters/abi/adapters/index.js +3 -1
- package/dist/esm/onchain/market/adapters/abi/conctructorAbi.js +2 -0
- package/dist/esm/onchain/market/adapters/abi/index.js +8 -1
- package/dist/esm/onchain/market/adapters/contracts/AaveHorizonBridgeAdapterContract.js +170 -0
- package/dist/esm/onchain/market/adapters/contracts/AaveV3PoolAdapterContract.js +198 -0
- package/dist/esm/onchain/market/adapters/contracts/AbstractAdapter.js +8 -0
- package/dist/esm/onchain/market/adapters/contracts/index.js +3 -1
- package/dist/esm/onchain/market/adapters/createAdapter.js +4 -0
- package/dist/esm/onchain/market/adapters/index.js +9 -1
- package/dist/esm/onchain/market/adapters/types.js +2 -0
- package/dist/esm/onchain/market/index.js +9 -1
- package/dist/esm/onchain/positions/projectAavePosition.js +174 -0
- package/dist/esm/onchain/preview/preview/loadAdapterReplayState.js +16 -0
- package/dist/esm/onchain/preview/preview/previewOperation.js +2 -0
- package/dist/esm/sdk/GearboxSDK.js +0 -9
- package/dist/esm/sdk/prepare/PrepareApi.js +57 -1
- package/dist/esm/sdk/preview/PreviewNamespace.js +42 -0
- package/dist/types/model/aave.d.ts +34 -0
- package/dist/types/model/analytics.d.ts +2 -2
- package/dist/types/model/index.d.ts +6 -7
- package/dist/types/model/opportunities.d.ts +1 -1
- package/dist/types/model/positions.d.ts +1 -1
- package/dist/types/model/previews.d.ts +15 -0
- package/dist/types/offchain/AbstractOffchainNamespace.d.ts +1 -1
- package/dist/types/offchain/GearboxAPI.d.ts +0 -6
- package/dist/types/offchain/analytics/OffchainAnalytics.d.ts +1 -1
- package/dist/types/offchain/analytics/types.d.ts +1 -1
- package/dist/types/offchain/index.d.ts +1 -3
- package/dist/types/offchain/opportunities/OffchainOpportunities.d.ts +1 -1
- package/dist/types/offchain/opportunities/types.d.ts +1 -1
- package/dist/types/offchain/positions/OffchainPositions.d.ts +1 -1
- package/dist/types/offchain/positions/types.d.ts +1 -1
- package/dist/types/onchain/accounts/bots/AccountBotsService.d.ts +11 -1
- package/dist/types/onchain/accounts/bots/index.d.ts +2 -2
- package/dist/types/onchain/accounts/bots/types.d.ts +7 -1
- package/dist/types/onchain/accounts/index.d.ts +2 -2
- package/dist/types/onchain/accounts/intents/operations.d.ts +43 -1
- package/dist/types/onchain/accounts/intents/plan.d.ts +26 -1
- package/dist/types/onchain/accounts/intents/testing/market.d.ts +4 -0
- package/dist/types/onchain/accounts/intents/testing/sdk-mock.d.ts +4 -0
- package/dist/types/onchain/accounts/intents/types.d.ts +20 -1
- package/dist/types/onchain/index.d.ts +10 -2
- package/dist/types/onchain/market/adapters/abi/aave/iAaveHorizonBridge.d.ts +83 -0
- package/dist/types/onchain/market/adapters/abi/aave/iAaveOracle.d.ts +22 -0
- package/dist/types/onchain/market/adapters/abi/aave/iAaveV3Pool.d.ts +229 -0
- package/dist/types/onchain/market/adapters/abi/aave/iPoolAddressesProvider.d.ts +11 -0
- package/dist/types/onchain/market/adapters/abi/aave/index.d.ts +5 -0
- package/dist/types/onchain/market/adapters/abi/adapters/iAaveHorizonBridgeAdapter.d.ts +207 -0
- package/dist/types/onchain/market/adapters/abi/adapters/iAaveV3PoolAdapter.d.ts +172 -0
- package/dist/types/onchain/market/adapters/abi/adapters/index.d.ts +3 -1
- package/dist/types/onchain/market/adapters/abi/index.d.ts +8 -1
- package/dist/types/onchain/market/adapters/contracts/AaveHorizonBridgeAdapterContract.d.ts +341 -0
- package/dist/types/onchain/market/adapters/contracts/AaveV3PoolAdapterContract.d.ts +450 -0
- package/dist/types/onchain/market/adapters/contracts/AbstractAdapter.d.ts +8 -0
- package/dist/types/onchain/market/adapters/contracts/index.d.ts +3 -1
- package/dist/types/onchain/market/adapters/index.d.ts +9 -1
- package/dist/types/onchain/market/adapters/types.d.ts +3 -1
- package/dist/types/onchain/market/index.d.ts +9 -1
- package/dist/types/onchain/positions/projectAavePosition.d.ts +45 -0
- package/dist/types/onchain/preview/preview/loadAdapterReplayState.d.ts +13 -0
- package/dist/types/sdk/GearboxSDK.d.ts +1 -8
- package/dist/types/sdk/analytics/AnalyticsNamespace.d.ts +1 -1
- package/dist/types/sdk/analytics/types.d.ts +1 -1
- package/dist/types/sdk/index.d.ts +3 -3
- package/dist/types/sdk/opportunities/OpportunitiesNamespace.d.ts +1 -1
- package/dist/types/sdk/opportunities/types.d.ts +1 -1
- package/dist/types/sdk/positions/PositionsNamespace.d.ts +1 -1
- package/dist/types/sdk/positions/types.d.ts +1 -1
- package/dist/types/sdk/prepare/PrepareApi.d.ts +11 -3
- package/dist/types/sdk/prepare/index.d.ts +2 -2
- package/dist/types/sdk/prepare/types.d.ts +83 -1
- package/dist/types/sdk/preview/PreviewNamespace.d.ts +5 -1
- package/dist/types/sdk/preview/types.d.ts +12 -1
- package/dist/types/sdk/types.d.ts +0 -20
- package/package.json +1 -1
- package/dist/cjs/model/notices.schema.js +0 -25
- package/dist/cjs/offchain/notices/OffchainNotices.js +0 -27
- package/dist/cjs/offchain/notices/index.js +0 -3
- package/dist/esm/model/notices.schema.js +0 -23
- package/dist/esm/offchain/notices/OffchainNotices.js +0 -26
- package/dist/esm/offchain/notices/index.js +0 -1
- package/dist/types/model/notices.d.ts +0 -28
- package/dist/types/model/notices.schema.d.ts +0 -22
- package/dist/types/offchain/notices/OffchainNotices.d.ts +0 -18
- package/dist/types/offchain/notices/index.d.ts +0 -2
- /package/dist/cjs/model/{notices.js → aave.js} +0 -0
- /package/dist/esm/model/{notices.js → aave.js} +0 -0
package/dist/cjs/model/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
require("./aave.js");
|
|
2
3
|
require("./analytics.js");
|
|
3
4
|
const require_model_charts = require("./charts.js");
|
|
4
5
|
const require_model_compare_schema = require("./compare.schema.js");
|
|
@@ -22,8 +23,6 @@ const require_model_errors_prepare_errors = require("./errors/prepare-errors.js"
|
|
|
22
23
|
const require_model_errors_preview_errors = require("./errors/preview-errors.js");
|
|
23
24
|
require("./errors/index.js");
|
|
24
25
|
const require_model_liquidations = require("./liquidations.js");
|
|
25
|
-
require("./notices.js");
|
|
26
|
-
const require_model_notices_schema = require("./notices.schema.js");
|
|
27
26
|
const require_model_opportunities = require("./opportunities.js");
|
|
28
27
|
const require_model_positions = require("./positions.js");
|
|
29
28
|
const require_model_previews = require("./previews.js");
|
|
@@ -129,8 +128,6 @@ exports.noDelayedRoute = require_model_errors_prepare_errors.noDelayedRoute;
|
|
|
129
128
|
exports.noRecordedIntent = require_model_errors_prepare_errors.noRecordedIntent;
|
|
130
129
|
exports.noStrategyTargetCollateral = require_model_errors_prepare_errors.noStrategyTargetCollateral;
|
|
131
130
|
exports.notEmergencyLiquidator = require_model_errors_liquidation_errors.notEmergencyLiquidator;
|
|
132
|
-
exports.noticeKindSchema = require_model_notices_schema.noticeKindSchema;
|
|
133
|
-
exports.noticeSchema = require_model_notices_schema.noticeSchema;
|
|
134
131
|
exports.offchainOnly = require_model_compare_schema.offchainOnly;
|
|
135
132
|
exports.onchainOnly = require_model_compare_schema.onchainOnly;
|
|
136
133
|
exports.opportunityBaseSchema = require_model_opportunities_schema.opportunityBaseSchema;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_offchain_analytics_OffchainAnalytics = require("./analytics/OffchainAnalytics.js");
|
|
3
3
|
require("./analytics/index.js");
|
|
4
|
-
const require_offchain_notices_OffchainNotices = require("./notices/OffchainNotices.js");
|
|
5
|
-
require("./notices/index.js");
|
|
6
4
|
const require_offchain_opportunities_OffchainOpportunities = require("./opportunities/OffchainOpportunities.js");
|
|
7
5
|
require("./opportunities/index.js");
|
|
8
6
|
const require_offchain_positions_OffchainPositions = require("./positions/OffchainPositions.js");
|
|
@@ -40,16 +38,11 @@ var GearboxAPI = class {
|
|
|
40
38
|
* Namespace for the positions a wallet holds.
|
|
41
39
|
**/
|
|
42
40
|
positions;
|
|
43
|
-
/**
|
|
44
|
-
* Namespace for the notices the backend attaches to entities.
|
|
45
|
-
**/
|
|
46
|
-
notices;
|
|
47
41
|
constructor(options) {
|
|
48
42
|
this.chainIds = [...options.chainIds];
|
|
49
43
|
this.analytics = new require_offchain_analytics_OffchainAnalytics.OffchainAnalytics(options);
|
|
50
44
|
this.opportunities = new require_offchain_opportunities_OffchainOpportunities.OffchainOpportunities(options);
|
|
51
45
|
this.positions = new require_offchain_positions_OffchainPositions.OffchainPositions(options);
|
|
52
|
-
this.notices = new require_offchain_notices_OffchainNotices.OffchainNotices(options);
|
|
53
46
|
}
|
|
54
47
|
};
|
|
55
48
|
//#endregion
|
|
@@ -14,8 +14,6 @@ const require_offchain_AbstractOffchainNamespace = require("./AbstractOffchainNa
|
|
|
14
14
|
const require_offchain_analytics_OffchainAnalyticsPositions = require("./analytics/OffchainAnalyticsPositions.js");
|
|
15
15
|
const require_offchain_analytics_OffchainAnalytics = require("./analytics/OffchainAnalytics.js");
|
|
16
16
|
require("./analytics/index.js");
|
|
17
|
-
const require_offchain_notices_OffchainNotices = require("./notices/OffchainNotices.js");
|
|
18
|
-
require("./notices/index.js");
|
|
19
17
|
const require_offchain_opportunities_OffchainOpportunities = require("./opportunities/OffchainOpportunities.js");
|
|
20
18
|
require("./opportunities/index.js");
|
|
21
19
|
const require_offchain_positions_OffchainPositions = require("./positions/OffchainPositions.js");
|
|
@@ -29,7 +27,6 @@ exports.OffchainAnalyticsPositions = require_offchain_analytics_OffchainAnalytic
|
|
|
29
27
|
exports.OffchainInvalidJsonError = require_offchain_errors_OffchainInvalidJsonError.OffchainInvalidJsonError;
|
|
30
28
|
exports.OffchainNotConfiguredError = require_offchain_errors_OffchainNotConfiguredError.OffchainNotConfiguredError;
|
|
31
29
|
exports.OffchainNotImplementedError = require_offchain_errors_OffchainNotImplementedError.OffchainNotImplementedError;
|
|
32
|
-
exports.OffchainNotices = require_offchain_notices_OffchainNotices.OffchainNotices;
|
|
33
30
|
exports.OffchainOpportunities = require_offchain_opportunities_OffchainOpportunities.OffchainOpportunities;
|
|
34
31
|
exports.OffchainPositions = require_offchain_positions_OffchainPositions.OffchainPositions;
|
|
35
32
|
exports.OffchainRequestFailedError = require_offchain_errors_OffchainRequestFailedError.OffchainRequestFailedError;
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_abi_310_generated = require("../../../abi/310/generated.js");
|
|
3
|
+
const require_abi_compressors_peripheryCompressor = require("../../../abi/compressors/peripheryCompressor.js");
|
|
4
|
+
const require_onchain_utils_AddressMap = require("../../utils/AddressMap.js");
|
|
3
5
|
const require_onchain_constants_address_provider = require("../../constants/address-provider.js");
|
|
4
6
|
const require_onchain_constants_versions = require("../../constants/versions.js");
|
|
5
7
|
require("../../constants/index.js");
|
|
8
|
+
require("../../utils/index.js");
|
|
6
9
|
const require_onchain_base_SDKConstruct = require("../../base/SDKConstruct.js");
|
|
7
10
|
require("../../base/index.js");
|
|
8
11
|
const require_onchain_accounts_bots_abi = require("./abi.js");
|
|
@@ -15,6 +18,32 @@ const require_onchain_accounts_bots_PeripheryCompressorV310Contract = require(".
|
|
|
15
18
|
* and builds the transactions that connect or disconnect one.
|
|
16
19
|
**/
|
|
17
20
|
var AccountBotsService = class extends require_onchain_base_SDKConstruct.SDKConstruct {
|
|
21
|
+
#marketBots = new require_onchain_utils_AddressMap.AddressMap(void 0, "marketBots");
|
|
22
|
+
/**
|
|
23
|
+
* The bots a market configurator lists among its periphery contracts.
|
|
24
|
+
*
|
|
25
|
+
* Read once per configurator and kept for the service's lifetime: the list
|
|
26
|
+
* changes only when the curator adds or removes a bot. A failed read is not
|
|
27
|
+
* kept, so the next call tries again.
|
|
28
|
+
*
|
|
29
|
+
* @param marketConfigurator - Configurator to list the bots of.
|
|
30
|
+
**/
|
|
31
|
+
getMarketBots(marketConfigurator) {
|
|
32
|
+
let bots = this.#marketBots.get(marketConfigurator);
|
|
33
|
+
if (!bots) {
|
|
34
|
+
bots = this.client.readContract({
|
|
35
|
+
address: this.#compressor.address,
|
|
36
|
+
abi: require_abi_compressors_peripheryCompressor.peripheryCompressorAbi,
|
|
37
|
+
functionName: "getBots",
|
|
38
|
+
args: [marketConfigurator]
|
|
39
|
+
}).catch((e) => {
|
|
40
|
+
this.#marketBots.delete(marketConfigurator);
|
|
41
|
+
throw e;
|
|
42
|
+
});
|
|
43
|
+
this.#marketBots.upsert(marketConfigurator, bots);
|
|
44
|
+
}
|
|
45
|
+
return bots;
|
|
46
|
+
}
|
|
18
47
|
/**
|
|
19
48
|
* Reads the bots connected to each of the given credit accounts.
|
|
20
49
|
*
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_abi_compressors_peripheryCompressor = require("../../../abi/compressors/peripheryCompressor.js");
|
|
2
3
|
const require_onchain_base_BaseContract = require("../../base/BaseContract.js");
|
|
3
4
|
require("../../base/index.js");
|
|
4
5
|
//#region src/onchain/accounts/bots/PeripheryCompressorV310Contract.ts
|
|
5
|
-
const abi =
|
|
6
|
+
const abi = require_abi_compressors_peripheryCompressor.peripheryCompressorAbi;
|
|
6
7
|
var PeripheryCompressorV310Contract = class extends require_onchain_base_BaseContract.BaseContract {
|
|
7
8
|
constructor(sdk, address) {
|
|
8
9
|
super(sdk, {
|
|
@@ -66,6 +66,7 @@ var CreditAccountOperationsService = class extends require_onchain_base_SDKConst
|
|
|
66
66
|
case "ADJUST_LEVERAGE": return require_onchain_accounts_intents_plan.planAdjustLeverage(intent, view);
|
|
67
67
|
case "DEPOSIT": return require_onchain_accounts_intents_plan.planDeposit(intent, view);
|
|
68
68
|
case "REPAY": return require_onchain_accounts_intents_plan.planRepay(intent, view);
|
|
69
|
+
case "MOVE_TO_AAVE": return require_onchain_accounts_intents_plan.planMoveToAave(intent, view);
|
|
69
70
|
case "WITHDRAW": return require_onchain_accounts_intents_plan.planWithdraw(intent, view);
|
|
70
71
|
case "UPDATE_QUOTA": return require_onchain_accounts_intents_plan.planUpdateQuota(intent, view);
|
|
71
72
|
default: throw new Error(`${intent.type} - not implemented`);
|
|
@@ -135,6 +135,25 @@ function buildClaimDelayedWithdrawalOperation(input) {
|
|
|
135
135
|
})
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
|
+
function buildAaveSupplyOperation(input) {
|
|
139
|
+
return {
|
|
140
|
+
type: "aaveSupply",
|
|
141
|
+
token: input.token,
|
|
142
|
+
aToken: input.aToken,
|
|
143
|
+
amount: input.amount,
|
|
144
|
+
calls: [input.adapter.supplyDiffCall(input.token, 0n)]
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function buildAaveOpenPositionOperation(input) {
|
|
148
|
+
return {
|
|
149
|
+
type: "aaveOpenPosition",
|
|
150
|
+
aToken: input.aToken,
|
|
151
|
+
aTokenAmount: input.aTokenAmount,
|
|
152
|
+
debtToken: input.debtToken,
|
|
153
|
+
borrowAmount: input.borrowAmount,
|
|
154
|
+
calls: [input.adapter.openPositionDiffCall(input.aToken, input.debtToken, 0n, input.borrowAmount)]
|
|
155
|
+
};
|
|
156
|
+
}
|
|
138
157
|
/**
|
|
139
158
|
* What a request or a claim puts on the account right away, as opposed to what
|
|
140
159
|
* only the phantom token represents.
|
|
@@ -150,6 +169,8 @@ function instantOutput(outputs, token) {
|
|
|
150
169
|
}
|
|
151
170
|
}
|
|
152
171
|
//#endregion
|
|
172
|
+
exports.buildAaveOpenPositionOperation = buildAaveOpenPositionOperation;
|
|
173
|
+
exports.buildAaveSupplyOperation = buildAaveSupplyOperation;
|
|
153
174
|
exports.buildAddCollateralOperation = buildAddCollateralOperation;
|
|
154
175
|
exports.buildClaimDelayedWithdrawalOperation = buildClaimDelayedWithdrawalOperation;
|
|
155
176
|
exports.buildCloseSwapOperation = buildCloseSwapOperation;
|
|
@@ -105,6 +105,38 @@ function planRepay(intent, view) {
|
|
|
105
105
|
];
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
108
|
+
* The position leaves for Aave Horizon: the RWA is supplied to the Aave pool,
|
|
109
|
+
* its aTokens go to the owner with a loan against them, and that loan settles
|
|
110
|
+
* the account's own.
|
|
111
|
+
*
|
|
112
|
+
* Aave lends the debt plus the {@link SETTLE_MARGIN} headroom, since the facade
|
|
113
|
+
* is told to repay everything outstanding by the time the transaction lands;
|
|
114
|
+
* what it does not take stays on the account.
|
|
115
|
+
*/
|
|
116
|
+
function planMoveToAave(intent, view) {
|
|
117
|
+
const amount = view.balanceOf(intent.token);
|
|
118
|
+
if (require_onchain_accounts_intents_utils_common.eq(intent.token, view.underlying) || require_onchain_constants_math.isZeroBalance(amount)) throw new require_onchain_validation_raise.IntentPreviewError(require_model_errors_prepare_errors.unsupportedCollateralToken(require_onchain_validation_helpers_token.toToken(view.sdk, intent.token)), `moveToAave: ${intent.token} is the underlying or not held by the account`);
|
|
119
|
+
if (view.debt <= 0n) throw new require_onchain_validation_raise.IntentPreviewError(require_model_errors_operation_errors.debtOutOfRange({
|
|
120
|
+
requested: require_onchain_validation_helpers_token.toTokenAmount(view.sdk, view.underlying, view.debt),
|
|
121
|
+
minDebt: require_onchain_validation_helpers_token.toTokenAmount(view.sdk, view.underlying, view.debtLimits.minDebt),
|
|
122
|
+
maxDebt: require_onchain_validation_helpers_token.toTokenAmount(view.sdk, view.underlying, view.debtLimits.maxDebt)
|
|
123
|
+
}), "moveToAave: the account owes nothing");
|
|
124
|
+
return [
|
|
125
|
+
{
|
|
126
|
+
kind: "aaveSupply",
|
|
127
|
+
token: intent.token,
|
|
128
|
+
amount
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
kind: "aaveOpenPosition",
|
|
132
|
+
token: intent.token,
|
|
133
|
+
borrow: withMargin(view.debt)
|
|
134
|
+
},
|
|
135
|
+
clearQuotas(),
|
|
136
|
+
repay(view.debt)
|
|
137
|
+
];
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
108
140
|
* One token's quota changes; no balance moves and debt is untouched.
|
|
109
141
|
*
|
|
110
142
|
* Only a token the account holds can be quoted here, and only on an account
|
|
@@ -456,6 +488,7 @@ exports.planFinishClaimOnly = planFinishClaimOnly;
|
|
|
456
488
|
exports.planFinishCloseAccount = planFinishCloseAccount;
|
|
457
489
|
exports.planFinishDecreaseLeverage = planFinishDecreaseLeverage;
|
|
458
490
|
exports.planFinishWithdraw = planFinishWithdraw;
|
|
491
|
+
exports.planMoveToAave = planMoveToAave;
|
|
459
492
|
exports.planRepay = planRepay;
|
|
460
493
|
exports.planUpdateQuota = planUpdateQuota;
|
|
461
494
|
exports.planWithdraw = planWithdraw;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_onchain_chain_chains = require("../../chain/chains.js");
|
|
3
3
|
const require_onchain_constants_math = require("../../constants/math.js");
|
|
4
|
+
const require_onchain_market_adapters_contracts_AaveHorizonBridgeAdapterContract = require("../../market/adapters/contracts/AaveHorizonBridgeAdapterContract.js");
|
|
5
|
+
const require_onchain_market_adapters_contracts_AaveV3PoolAdapterContract = require("../../market/adapters/contracts/AaveV3PoolAdapterContract.js");
|
|
4
6
|
const require_model_errors_operation_errors = require("../../../model/errors/operation-errors.js");
|
|
5
7
|
const require_model_errors_prepare_errors = require("../../../model/errors/prepare-errors.js");
|
|
6
8
|
require("../../../model/index.js");
|
|
@@ -354,6 +356,33 @@ async function realize(steps, props) {
|
|
|
354
356
|
}
|
|
355
357
|
break;
|
|
356
358
|
}
|
|
359
|
+
case "aaveSupply": {
|
|
360
|
+
assertHolds(step.token, step.amount, "aaveSupply");
|
|
361
|
+
const adapter = aavePoolAdapter(sdk, suite, step.token);
|
|
362
|
+
push(require_onchain_accounts_intents_operations.buildAaveSupplyOperation({
|
|
363
|
+
adapter,
|
|
364
|
+
token: step.token,
|
|
365
|
+
aToken: await adapter.aToken(step.token),
|
|
366
|
+
amount: step.amount
|
|
367
|
+
}));
|
|
368
|
+
break;
|
|
369
|
+
}
|
|
370
|
+
case "aaveOpenPosition": {
|
|
371
|
+
const aToken = await aavePoolAdapter(sdk, suite, step.token).aToken(step.token);
|
|
372
|
+
const aTokenAmount = ledger.balanceOf(aToken);
|
|
373
|
+
assertHolds(aToken, aTokenAmount, "aaveOpenPosition");
|
|
374
|
+
push(require_onchain_accounts_intents_operations.buildAaveOpenPositionOperation({
|
|
375
|
+
adapter: aaveBridgeAdapter(sdk, suite, step.token, {
|
|
376
|
+
aToken,
|
|
377
|
+
debtToken: underlying
|
|
378
|
+
}),
|
|
379
|
+
aToken,
|
|
380
|
+
aTokenAmount,
|
|
381
|
+
debtToken: underlying,
|
|
382
|
+
borrowAmount: step.borrow
|
|
383
|
+
}));
|
|
384
|
+
break;
|
|
385
|
+
}
|
|
357
386
|
}
|
|
358
387
|
const floor = ledger.snapshot();
|
|
359
388
|
const { assets, debt } = floor;
|
|
@@ -476,6 +505,21 @@ async function delayedConfig(sdk, creditAccount, token) {
|
|
|
476
505
|
if (assets.length > 1) throw new require_onchain_validation_raise.IntentPreviewError(require_model_errors_prepare_errors.multipleDelayedWithdrawals(require_onchain_validation_helpers_token.toToken(sdk, token), assets.length), `request: ${token} has ${assets.length} delayed withdrawal configs`);
|
|
477
506
|
return assets[0];
|
|
478
507
|
}
|
|
508
|
+
/** The credit manager's Aave pool adapter that lists `token`. */
|
|
509
|
+
function aavePoolAdapter(sdk, suite, token) {
|
|
510
|
+
const adapter = suite.creditManager.adapters.values().find((a) => a instanceof require_onchain_market_adapters_contracts_AaveV3PoolAdapterContract.AaveV3PoolAdapterContract && a.isAssetAllowed(token));
|
|
511
|
+
if (!adapter) throw new require_onchain_validation_raise.IntentPreviewError(require_model_errors_prepare_errors.unsupportedCollateralToken(require_onchain_validation_helpers_token.toToken(sdk, token)), `aaveSupply: no Aave pool adapter lists ${token}`);
|
|
512
|
+
return adapter;
|
|
513
|
+
}
|
|
514
|
+
/**
|
|
515
|
+
* The credit manager's Horizon bridge adapter that takes `aToken` and lends
|
|
516
|
+
* `debtToken`. Refused on `token`, the collateral the aToken stands for.
|
|
517
|
+
*/
|
|
518
|
+
function aaveBridgeAdapter(sdk, suite, token, pair) {
|
|
519
|
+
const adapter = suite.creditManager.adapters.values().find((a) => a instanceof require_onchain_market_adapters_contracts_AaveHorizonBridgeAdapterContract.AaveHorizonBridgeAdapterContract && a.isATokenAllowed(pair.aToken) && a.isDebtTokenAllowed(pair.debtToken));
|
|
520
|
+
if (!adapter) throw new require_onchain_validation_raise.IntentPreviewError(require_model_errors_prepare_errors.unsupportedCollateralToken(require_onchain_validation_helpers_token.toToken(sdk, token)), `aaveOpenPosition: no Horizon bridge adapter takes ${pair.aToken} against ${pair.debtToken}`);
|
|
521
|
+
return adapter;
|
|
522
|
+
}
|
|
479
523
|
const callsOf = (operations) => operations.flatMap((op) => op.calls);
|
|
480
524
|
const min = (a, b) => a < b ? a : b;
|
|
481
525
|
/** Balance the router's close path refuses to route, and leaves in place. */
|
|
@@ -114,6 +114,7 @@ function buildMarketSdk(extras) {
|
|
|
114
114
|
debtLimitAvailable: extras?.debtLimitAvailable,
|
|
115
115
|
maxDebtPerBlockMultiplier: extras?.maxDebtPerBlockMultiplier,
|
|
116
116
|
forbiddenTokens: extras?.forbiddenTokens,
|
|
117
|
+
adapters: extras?.adapters,
|
|
117
118
|
strategyTargetCollateral: POS
|
|
118
119
|
});
|
|
119
120
|
}
|
|
@@ -211,7 +211,8 @@ function buildMockSdk(args) {
|
|
|
211
211
|
collateralTokens,
|
|
212
212
|
feeInterest: args.feeInterest ?? 0,
|
|
213
213
|
maxEnabledTokens: args.maxEnabledTokens ?? 4,
|
|
214
|
-
maxLeverage: (collateral, targetHF) => require_onchain_market_math.calcMaxLeverage(liquidationThresholds.get(collateral) ?? 0, targetHF)
|
|
214
|
+
maxLeverage: (collateral, targetHF) => require_onchain_market_math.calcMaxLeverage(liquidationThresholds.get(collateral) ?? 0, targetHF),
|
|
215
|
+
adapters: { values: () => args.adapters ?? [] }
|
|
215
216
|
},
|
|
216
217
|
creditFacade: {
|
|
217
218
|
address: args.creditFacade,
|
|
@@ -80,6 +80,14 @@ var OperationLedger = class {
|
|
|
80
80
|
case "claimDelayedWithdrawal":
|
|
81
81
|
this.#add(op.withdrawalPhantomToken, -op.withdrawalTokenSpent);
|
|
82
82
|
for (const out of op.outputs) this.#add(out.token, out.amount);
|
|
83
|
+
break;
|
|
84
|
+
case "aaveSupply":
|
|
85
|
+
this.#add(op.token, -op.amount);
|
|
86
|
+
this.#add(op.aToken, op.amount);
|
|
87
|
+
break;
|
|
88
|
+
case "aaveOpenPosition":
|
|
89
|
+
this.#add(op.aToken, -op.aTokenAmount);
|
|
90
|
+
this.#add(op.debtToken, op.borrowAmount);
|
|
83
91
|
}
|
|
84
92
|
return this;
|
|
85
93
|
}
|
|
@@ -355,6 +355,10 @@ const chains = {
|
|
|
355
355
|
}),
|
|
356
356
|
Lisk: (0, viem.defineChain)({
|
|
357
357
|
...viem_chains.lisk,
|
|
358
|
+
rpcUrls: {
|
|
359
|
+
...viem_chains.lisk.rpcUrls,
|
|
360
|
+
tenderly: { http: ["https://lisk.gateway.tenderly.co"] }
|
|
361
|
+
},
|
|
358
362
|
network: "Lisk",
|
|
359
363
|
defaultMarketConfigurators: require_onchain_utils_AddressMap.AddressMap.fromRecord({ "0x25778dbf0e56b7feb8358c4aa2f6f9e19a1c145a": "Re7" }),
|
|
360
364
|
rwaFactories: [],
|
|
@@ -46,9 +46,15 @@ const require_onchain_base_types = require("./base/types.js");
|
|
|
46
46
|
require("./base/index.js");
|
|
47
47
|
const require_onchain_accounts_bots_PeripheryCompressorV310Contract = require("./accounts/bots/PeripheryCompressorV310Contract.js");
|
|
48
48
|
const require_onchain_accounts_bots_AccountBotsService = require("./accounts/bots/AccountBotsService.js");
|
|
49
|
+
const require_onchain_market_adapters_abi_aave_iAaveHorizonBridge = require("./market/adapters/abi/aave/iAaveHorizonBridge.js");
|
|
50
|
+
const require_onchain_market_adapters_abi_aave_iAaveOracle = require("./market/adapters/abi/aave/iAaveOracle.js");
|
|
51
|
+
const require_onchain_market_adapters_abi_aave_iAaveV3Pool = require("./market/adapters/abi/aave/iAaveV3Pool.js");
|
|
52
|
+
const require_onchain_market_adapters_abi_aave_iPoolAddressesProvider = require("./market/adapters/abi/aave/iPoolAddressesProvider.js");
|
|
49
53
|
const require_onchain_market_adapters_types = require("./market/adapters/types.js");
|
|
50
54
|
const require_onchain_market_adapters_abi_actionAbi = require("./market/adapters/abi/actionAbi.js");
|
|
51
55
|
const require_onchain_market_adapters_abi_adapters_erc4626ReferralAdapter = require("./market/adapters/abi/adapters/erc4626ReferralAdapter.js");
|
|
56
|
+
const require_onchain_market_adapters_abi_adapters_iAaveHorizonBridgeAdapter = require("./market/adapters/abi/adapters/iAaveHorizonBridgeAdapter.js");
|
|
57
|
+
const require_onchain_market_adapters_abi_adapters_iAaveV3PoolAdapter = require("./market/adapters/abi/adapters/iAaveV3PoolAdapter.js");
|
|
52
58
|
const require_onchain_market_adapters_abi_adapters_iBalancerV3RouterAdapter = require("./market/adapters/abi/adapters/iBalancerV3RouterAdapter.js");
|
|
53
59
|
const require_onchain_market_adapters_abi_adapters_iBalancerV3WrapperAdapter = require("./market/adapters/abi/adapters/iBalancerV3WrapperAdapter.js");
|
|
54
60
|
const require_onchain_market_adapters_abi_adapters_iCamelotV3Adapter = require("./market/adapters/abi/adapters/iCamelotV3Adapter.js");
|
|
@@ -98,6 +104,8 @@ const require_onchain_market_adapters_abi_treehouse_iTreehouseRouter = require("
|
|
|
98
104
|
const require_onchain_market_adapters_abi_utils = require("./market/adapters/abi/utils.js");
|
|
99
105
|
const require_onchain_market_adapters_transferHelpers = require("./market/adapters/transferHelpers.js");
|
|
100
106
|
const require_onchain_market_adapters_contracts_AbstractAdapter = require("./market/adapters/contracts/AbstractAdapter.js");
|
|
107
|
+
const require_onchain_market_adapters_contracts_AaveHorizonBridgeAdapterContract = require("./market/adapters/contracts/AaveHorizonBridgeAdapterContract.js");
|
|
108
|
+
const require_onchain_market_adapters_contracts_AaveV3PoolAdapterContract = require("./market/adapters/contracts/AaveV3PoolAdapterContract.js");
|
|
101
109
|
const require_onchain_market_adapters_contracts_AccountMigratorAdapterContract = require("./market/adapters/contracts/AccountMigratorAdapterContract.js");
|
|
102
110
|
const require_onchain_market_adapters_contracts_BalancerV3RouterAdapterContract = require("./market/adapters/contracts/BalancerV3RouterAdapterContract.js");
|
|
103
111
|
const require_onchain_market_adapters_contracts_BalancerV3WrapperAdapterContract = require("./market/adapters/contracts/BalancerV3WrapperAdapterContract.js");
|
|
@@ -356,6 +364,8 @@ exports.AP_WETH_GATEWAY = require_onchain_constants_address_provider.AP_WETH_GAT
|
|
|
356
364
|
exports.AP_WETH_TOKEN = require_onchain_constants_address_provider.AP_WETH_TOKEN;
|
|
357
365
|
exports.AP_ZAPPER_REGISTER = require_onchain_constants_address_provider.AP_ZAPPER_REGISTER;
|
|
358
366
|
exports.AP_ZERO_PRICE_FEED = require_onchain_constants_address_provider.AP_ZERO_PRICE_FEED;
|
|
367
|
+
exports.AaveHorizonBridgeAdapterContract = require_onchain_market_adapters_contracts_AaveHorizonBridgeAdapterContract.AaveHorizonBridgeAdapterContract;
|
|
368
|
+
exports.AaveV3PoolAdapterContract = require_onchain_market_adapters_contracts_AaveV3PoolAdapterContract.AaveV3PoolAdapterContract;
|
|
359
369
|
exports.AbstractAdapterContract = require_onchain_market_adapters_contracts_AbstractAdapter.AbstractAdapterContract;
|
|
360
370
|
exports.AbstractLPPriceFeedContract = require_onchain_market_pricefeeds_AbstractLPPriceFeed.AbstractLPPriceFeedContract;
|
|
361
371
|
exports.AbstractPriceFeedContract = require_onchain_market_pricefeeds_AbstractPriceFeed.AbstractPriceFeedContract;
|
|
@@ -698,6 +708,11 @@ exports.hasAdapterDeployParamsAbi = require_onchain_market_adapters_abi_utils.ha
|
|
|
698
708
|
exports.healthFactorBps = require_onchain_market_math.healthFactorBps;
|
|
699
709
|
exports.hexEq = require_onchain_utils_hex.hexEq;
|
|
700
710
|
exports.hydrateAddressProvider = require_onchain_core_createAddressProvider.hydrateAddressProvider;
|
|
711
|
+
exports.iAaveHorizonBridgeAbi = require_onchain_market_adapters_abi_aave_iAaveHorizonBridge.iAaveHorizonBridgeAbi;
|
|
712
|
+
exports.iAaveHorizonBridgeAdapterAbi = require_onchain_market_adapters_abi_adapters_iAaveHorizonBridgeAdapter.iAaveHorizonBridgeAdapterAbi;
|
|
713
|
+
exports.iAaveOracleAbi = require_onchain_market_adapters_abi_aave_iAaveOracle.iAaveOracleAbi;
|
|
714
|
+
exports.iAaveV3PoolAbi = require_onchain_market_adapters_abi_aave_iAaveV3Pool.iAaveV3PoolAbi;
|
|
715
|
+
exports.iAaveV3PoolAdapterAbi = require_onchain_market_adapters_abi_adapters_iAaveV3PoolAdapter.iAaveV3PoolAdapterAbi;
|
|
701
716
|
exports.iBalancerV3RouterAbi = require_onchain_market_adapters_abi_targetContractAbi.iBalancerV3RouterAbi;
|
|
702
717
|
exports.iBalancerV3RouterAdapterAbi = require_onchain_market_adapters_abi_adapters_iBalancerV3RouterAdapter.iBalancerV3RouterAdapterAbi;
|
|
703
718
|
exports.iBalancerV3WrapperAbi = require_onchain_market_adapters_abi_targetContractAbi.iBalancerV3WrapperAbi;
|
|
@@ -749,6 +764,7 @@ exports.iMidasRedemptionVaultAdapterV310Abi = require_onchain_market_adapters_ab
|
|
|
749
764
|
exports.iMidasRedemptionVaultGatewayV310Abi = require_onchain_market_adapters_abi_adapters_iMidasRedemptionVaultAdapterV310.iMidasRedemptionVaultGatewayV310Abi;
|
|
750
765
|
exports.iPendleRouterAbi = require_onchain_market_adapters_abi_targetContractAbi.iPendleRouterAbi;
|
|
751
766
|
exports.iPendleRouterAdapterAbi = require_onchain_market_adapters_abi_adapters_iPendleRouterAdapter.iPendleRouterAdapterAbi;
|
|
767
|
+
exports.iPoolAddressesProviderAbi = require_onchain_market_adapters_abi_aave_iPoolAddressesProvider.iPoolAddressesProviderAbi;
|
|
752
768
|
exports.iSecuritizeOnRampAbi = require_onchain_market_adapters_abi_securitize_iSecuritizeOnRamp.iSecuritizeOnRampAbi;
|
|
753
769
|
exports.iSecuritizeOnRampAdapterV310Abi = require_onchain_market_adapters_abi_adapters_iSecuritizeOnRampAdapterV310.iSecuritizeOnRampAdapterV310Abi;
|
|
754
770
|
exports.iSecuritizeRedemptionGatewayAdapterV311Abi = require_onchain_market_adapters_abi_adapters_iSecuritizeRedemptionGatewayAdapterV311.iSecuritizeRedemptionGatewayAdapterV311Abi;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_abi_compressors_peripheryCompressor = require("../../abi/compressors/peripheryCompressor.js");
|
|
2
3
|
const require_onchain_utils_AddressMap = require("../utils/AddressMap.js");
|
|
3
4
|
const require_onchain_constants_address_provider = require("../constants/address-provider.js");
|
|
4
5
|
const require_onchain_constants_versions = require("../constants/versions.js");
|
|
@@ -8,7 +9,6 @@ require("../utils/index.js");
|
|
|
8
9
|
const require_onchain_utils_viem_executeMulticallBatches = require("../utils/viem/executeMulticallBatches.js");
|
|
9
10
|
const require_onchain_base_SDKConstruct = require("../base/SDKConstruct.js");
|
|
10
11
|
require("../base/index.js");
|
|
11
|
-
const require_abi_compressors_peripheryCompressor = require("../../abi/compressors/peripheryCompressor.js");
|
|
12
12
|
require("../utils/viem/index.js");
|
|
13
13
|
const require_onchain_market_zapper_createZapper = require("./zapper/createZapper.js");
|
|
14
14
|
require("./zapper/index.js");
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/onchain/market/adapters/abi/aave/iAaveHorizonBridge.ts
|
|
3
|
+
const iAaveHorizonBridgeAbi = [
|
|
4
|
+
{
|
|
5
|
+
name: "contractType",
|
|
6
|
+
type: "function",
|
|
7
|
+
stateMutability: "view",
|
|
8
|
+
inputs: [],
|
|
9
|
+
outputs: [{ type: "bytes32" }]
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
name: "version",
|
|
13
|
+
type: "function",
|
|
14
|
+
stateMutability: "view",
|
|
15
|
+
inputs: [],
|
|
16
|
+
outputs: [{ type: "uint256" }]
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
name: "pool",
|
|
20
|
+
type: "function",
|
|
21
|
+
stateMutability: "view",
|
|
22
|
+
inputs: [],
|
|
23
|
+
outputs: [{ type: "address" }]
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: "rwaATokenManager",
|
|
27
|
+
type: "function",
|
|
28
|
+
stateMutability: "view",
|
|
29
|
+
inputs: [],
|
|
30
|
+
outputs: [{ type: "address" }]
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: "referralCode",
|
|
34
|
+
type: "function",
|
|
35
|
+
stateMutability: "view",
|
|
36
|
+
inputs: [],
|
|
37
|
+
outputs: [{ type: "uint16" }]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "openPosition",
|
|
41
|
+
type: "function",
|
|
42
|
+
stateMutability: "nonpayable",
|
|
43
|
+
inputs: [
|
|
44
|
+
{
|
|
45
|
+
type: "address",
|
|
46
|
+
name: "aToken"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
type: "address",
|
|
50
|
+
name: "debtToken"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
type: "uint256",
|
|
54
|
+
name: "aTokenAmount"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
type: "uint256",
|
|
58
|
+
name: "borrowAmount"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
outputs: []
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "closePosition",
|
|
65
|
+
type: "function",
|
|
66
|
+
stateMutability: "nonpayable",
|
|
67
|
+
inputs: [
|
|
68
|
+
{
|
|
69
|
+
type: "address",
|
|
70
|
+
name: "aToken"
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
type: "address",
|
|
74
|
+
name: "debtToken"
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
type: "uint256",
|
|
78
|
+
name: "repayAmount"
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
type: "uint256",
|
|
82
|
+
name: "aTokenAmount"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
outputs: []
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "CreditAccountOwnerIsCreditAccountException",
|
|
89
|
+
type: "error",
|
|
90
|
+
inputs: []
|
|
91
|
+
}
|
|
92
|
+
];
|
|
93
|
+
//#endregion
|
|
94
|
+
exports.iAaveHorizonBridgeAbi = iAaveHorizonBridgeAbi;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/onchain/market/adapters/abi/aave/iAaveOracle.ts
|
|
3
|
+
const iAaveOracleAbi = [{
|
|
4
|
+
name: "BASE_CURRENCY_UNIT",
|
|
5
|
+
type: "function",
|
|
6
|
+
stateMutability: "view",
|
|
7
|
+
inputs: [],
|
|
8
|
+
outputs: [{ type: "uint256" }]
|
|
9
|
+
}, {
|
|
10
|
+
name: "getAssetsPrices",
|
|
11
|
+
type: "function",
|
|
12
|
+
stateMutability: "view",
|
|
13
|
+
inputs: [{
|
|
14
|
+
type: "address[]",
|
|
15
|
+
name: "assets"
|
|
16
|
+
}],
|
|
17
|
+
outputs: [{ type: "uint256[]" }]
|
|
18
|
+
}];
|
|
19
|
+
//#endregion
|
|
20
|
+
exports.iAaveOracleAbi = iAaveOracleAbi;
|