@gearbox-protocol/sdk 14.12.0-next.61 → 14.12.0-next.63
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/permissionless/bindings/factory/credit-factory.js +1 -1
- package/dist/cjs/plugins/adapters/abi/conctructorAbi.js +2 -2
- package/dist/cjs/sdk/accounts/liquidations/LiquidationsService.js +1 -1
- package/dist/cjs/sdk/accounts/liquidations/helpers.js +18 -7
- package/dist/esm/dev/AccountOpener.js +1 -1
- package/dist/esm/dev/withdrawalUtils.js +1 -1
- package/dist/esm/plugins/adapters/abi/conctructorAbi.js +2 -2
- package/dist/esm/preview/simulate/simulatePoolOperation.js +1 -1
- package/dist/esm/preview/trace/extractTransfers.js +1 -1
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +2 -2
- package/dist/esm/sdk/accounts/liquidations/LiquidationsService.js +2 -2
- package/dist/esm/sdk/accounts/liquidations/helpers.js +18 -7
- package/dist/esm/sdk/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.js +1 -1
- package/dist/esm/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +1 -1
- package/dist/esm/sdk/base/TokensMeta.js +2 -2
- package/dist/esm/sdk/chain/detectNetwork.js +1 -1
- package/dist/esm/sdk/core/createAddressProvider.js +1 -1
- package/dist/esm/sdk/market/credit/CreditFacadeV310BaseContract.js +1 -1
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +1 -1
- package/dist/esm/sdk/market/zapper/IETHZapperContract.js +1 -1
- package/dist/esm/sdk/market/zapper/ZapperContract.js +1 -1
- package/dist/esm/sdk/pools/PoolService.js +1 -1
- package/dist/esm/sdk/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/dist/types/sdk/accounts/liquidations/helpers.d.ts +1 -1
- package/dist/types/sdk/accounts/liquidations/types.d.ts +11 -3
- package/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_abi_310_configure_iCreditConfigureActions = require("../../../abi/310/configure/iCreditConfigureActions.js");
|
|
3
2
|
const require_plugins_adapters_abi_conctructorAbi = require("../../../plugins/adapters/abi/conctructorAbi.js");
|
|
4
3
|
const require_plugins_adapters_abi_utils = require("../../../plugins/adapters/abi/utils.js");
|
|
5
4
|
require("../../../plugins/adapters/index.js");
|
|
5
|
+
const require_abi_310_configure_iCreditConfigureActions = require("../../../abi/310/configure/iCreditConfigureActions.js");
|
|
6
6
|
const require_permissionless_bindings_factory_abstract_factory = require("./abstract-factory.js");
|
|
7
7
|
let viem = require("viem");
|
|
8
8
|
//#region src/permissionless/bindings/factory/credit-factory.ts
|
|
@@ -20,6 +20,7 @@ const adapterConstructorAbi = {
|
|
|
20
20
|
["INFINIFI_GATEWAY"]: { 310: require_plugins_adapters_abi_conctructorAbiPatterns.BASIC_ADAPTER_ABI },
|
|
21
21
|
["LIDO_V1"]: { 310: require_plugins_adapters_abi_conctructorAbiPatterns.BASIC_ADAPTER_ABI },
|
|
22
22
|
["LIDO_WSTETH_V1"]: { 310: require_plugins_adapters_abi_conctructorAbiPatterns.BASIC_ADAPTER_ABI },
|
|
23
|
+
["MIDAS_GATEWAY"]: { 311: require_plugins_adapters_abi_conctructorAbiPatterns.REFERER_ID_ADAPTER_ABI },
|
|
23
24
|
["MIDAS_REDEMPTION_VAULT"]: {
|
|
24
25
|
310: require_plugins_adapters_abi_conctructorAbiPatterns.BASIC_ADAPTER_ABI,
|
|
25
26
|
311: require_plugins_adapters_abi_conctructorAbiPatterns.BASIC_ADAPTER_ABI
|
|
@@ -71,8 +72,7 @@ const adapterConstructorAbi = {
|
|
|
71
72
|
["MIDAS_ISSUANCE_VAULT"]: {
|
|
72
73
|
310: require_plugins_adapters_abi_conctructorAbiPatterns.REFERER_ID_ADAPTER_ABI,
|
|
73
74
|
311: require_plugins_adapters_abi_conctructorAbiPatterns.REFERER_ID_ADAPTER_ABI
|
|
74
|
-
}
|
|
75
|
-
["MIDAS_GATEWAY"]: { 311: require_plugins_adapters_abi_conctructorAbiPatterns.REFERER_ID_ADAPTER_ABI }
|
|
75
|
+
}
|
|
76
76
|
};
|
|
77
77
|
//#endregion
|
|
78
78
|
exports.adapterConstructorAbi = adapterConstructorAbi;
|
|
@@ -101,7 +101,7 @@ var LiquidationsService = class extends require_sdk_base_SDKConstruct.SDKConstru
|
|
|
101
101
|
await compressor.loadWithdrawableAssets();
|
|
102
102
|
const phantomTokens = new require_sdk_utils_AddressSet.AddressSet(compressor.getWithdrawableAssets().map((a) => a.withdrawalPhantomToken));
|
|
103
103
|
const current = await compressor.getExternalAccountCurrentWithdrawals(props.liquidator, ...phantomTokens.asArray());
|
|
104
|
-
return require_sdk_accounts_liquidations_helpers.toLiquidatorWithdrawals(current, this.sdk.networkType);
|
|
104
|
+
return require_sdk_accounts_liquidations_helpers.toLiquidatorWithdrawals(current, this.sdk.networkType, this.sdk.chainId);
|
|
105
105
|
}
|
|
106
106
|
/**
|
|
107
107
|
* {@inheritDoc ILiquidationsService.loadRWALiquidators}
|
|
@@ -70,20 +70,31 @@ function pickMainAsset(ca, convert) {
|
|
|
70
70
|
* @param current - Claimable and pending withdrawals from the withdrawal compressor
|
|
71
71
|
* @param network - Network the withdrawals live on
|
|
72
72
|
**/
|
|
73
|
-
function toLiquidatorWithdrawals(current, network) {
|
|
73
|
+
function toLiquidatorWithdrawals(current, network, chainId) {
|
|
74
74
|
const rows = [];
|
|
75
|
-
for (const w of current.claimable)
|
|
75
|
+
for (const w of current.claimable) rows.push({
|
|
76
76
|
network,
|
|
77
|
+
chainId,
|
|
77
78
|
sourceToken: w.token,
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
outputs: w.outputs.map((o) => {
|
|
80
|
+
return {
|
|
81
|
+
balance: o.amount,
|
|
82
|
+
token: o.token
|
|
83
|
+
};
|
|
84
|
+
}),
|
|
85
|
+
claimCalls: w.claimCalls,
|
|
80
86
|
redeemer: w.redeemer
|
|
81
87
|
});
|
|
82
|
-
for (const w of current.pending)
|
|
88
|
+
for (const w of current.pending) rows.push({
|
|
83
89
|
network,
|
|
90
|
+
chainId,
|
|
84
91
|
sourceToken: w.token,
|
|
85
|
-
|
|
86
|
-
|
|
92
|
+
outputs: w.expectedOutputs.map((o) => {
|
|
93
|
+
return {
|
|
94
|
+
balance: o.amount,
|
|
95
|
+
token: o.token
|
|
96
|
+
};
|
|
97
|
+
}),
|
|
87
98
|
claimableAt: w.claimableAt,
|
|
88
99
|
redeemer: w.redeemer
|
|
89
100
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { ierc20Abi } from "../abi/iERC20.js";
|
|
1
2
|
import { iCreditFacadeV310Abi } from "../abi/310/generated.js";
|
|
2
3
|
import { AddressMap } from "../sdk/utils/AddressMap.js";
|
|
3
4
|
import { AddressSet } from "../sdk/utils/AddressSet.js";
|
|
4
5
|
import { AssetsMap } from "../sdk/utils/AssetsMap.js";
|
|
5
6
|
import { childLogger } from "../sdk/utils/childLogger.js";
|
|
6
|
-
import { ierc20Abi } from "../abi/iERC20.js";
|
|
7
7
|
import "../sdk/constants/addresses.js";
|
|
8
8
|
import { MAX_UINT256, PERCENTAGE_FACTOR } from "../sdk/constants/math.js";
|
|
9
9
|
import { SDKConstruct } from "../sdk/base/SDKConstruct.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { iWithdrawalCompressorV313Abi } from "../abi/IWithdrawalCompressorV313.js";
|
|
1
2
|
import { getNetworkType } from "../sdk/chain/chains.js";
|
|
2
3
|
import { getWithdrawalCompressorAddress } from "../sdk/accounts/withdrawal-compressor/addresses.js";
|
|
3
|
-
import { iWithdrawalCompressorV313Abi } from "../abi/IWithdrawalCompressorV313.js";
|
|
4
4
|
import "../sdk/index.js";
|
|
5
5
|
import { iMidasDataFeedAbi, iMidasRedemptionVaultAbi, midasGatewayAbi, midasRedeemerAbi, midasRedemptionVaultPhantomTokenAbi, securitizeRedeemerAbi, securitizeRedemptionGatewayAbi, securitizeRedemptionPhantomTokenAbi } from "./withdrawalAbi.js";
|
|
6
6
|
import { erc20Abi, hexToString, parseAbi, parseEther } from "viem";
|
|
@@ -19,6 +19,7 @@ const adapterConstructorAbi = {
|
|
|
19
19
|
["INFINIFI_GATEWAY"]: { 310: BASIC_ADAPTER_ABI },
|
|
20
20
|
["LIDO_V1"]: { 310: BASIC_ADAPTER_ABI },
|
|
21
21
|
["LIDO_WSTETH_V1"]: { 310: BASIC_ADAPTER_ABI },
|
|
22
|
+
["MIDAS_GATEWAY"]: { 311: REFERER_ID_ADAPTER_ABI },
|
|
22
23
|
["MIDAS_REDEMPTION_VAULT"]: {
|
|
23
24
|
310: BASIC_ADAPTER_ABI,
|
|
24
25
|
311: BASIC_ADAPTER_ABI
|
|
@@ -70,8 +71,7 @@ const adapterConstructorAbi = {
|
|
|
70
71
|
["MIDAS_ISSUANCE_VAULT"]: {
|
|
71
72
|
310: REFERER_ID_ADAPTER_ABI,
|
|
72
73
|
311: REFERER_ID_ADAPTER_ABI
|
|
73
|
-
}
|
|
74
|
-
["MIDAS_GATEWAY"]: { 311: REFERER_ID_ADAPTER_ABI }
|
|
74
|
+
}
|
|
75
75
|
};
|
|
76
76
|
//#endregion
|
|
77
77
|
export { adapterConstructorAbi };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { iPoolV310Abi } from "../../abi/310/generated.js";
|
|
2
1
|
import { iZapperAbi } from "../../abi/iZapper.js";
|
|
2
|
+
import { iPoolV310Abi } from "../../abi/310/generated.js";
|
|
3
3
|
import { asPreviewSimulationError } from "./errors.js";
|
|
4
4
|
//#region src/preview/simulate/simulatePoolOperation.ts
|
|
5
5
|
function previewRead(operation) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
1
2
|
import { iCreditFacadeV310Abi } from "../../abi/310/generated.js";
|
|
2
3
|
import { AddressMap } from "../../sdk/utils/AddressMap.js";
|
|
3
|
-
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
4
4
|
import "../../sdk/index.js";
|
|
5
5
|
import { UnexpectedFacadeEventOrderError } from "./errors.js";
|
|
6
6
|
import { getAddress, isAddressEqual, parseEventLogs } from "viem";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { iBaseRewardPoolAbi } from "../../abi/iBaseRewardPool.js";
|
|
2
|
+
import { ierc4626AdapterAbi } from "../../abi/ierc4626Adapter.js";
|
|
1
3
|
import { iBotListV310Abi, iCreditFacadeMulticallV310Abi } from "../../abi/310/generated.js";
|
|
2
4
|
import { creditAccountCompressorAbi } from "../../abi/compressors/creditAccountCompressor.js";
|
|
3
5
|
import { peripheryCompressorAbi } from "../../abi/compressors/peripheryCompressor.js";
|
|
4
6
|
import { rewardsCompressorAbi } from "../../abi/compressors/rewardsCompressor.js";
|
|
5
|
-
import { iBaseRewardPoolAbi } from "../../abi/iBaseRewardPool.js";
|
|
6
|
-
import { ierc4626AdapterAbi } from "../../abi/ierc4626Adapter.js";
|
|
7
7
|
import { iRWAFactoryAbi } from "../../abi/rwa/iRWAFactory.js";
|
|
8
8
|
import { AddressMap } from "../utils/AddressMap.js";
|
|
9
9
|
import { AddressSet } from "../utils/AddressSet.js";
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { iLiquidationCompressorV313Abi } from "../../../abi/ILiquidationCompressorV313.js";
|
|
1
2
|
import { AddressSet } from "../../utils/AddressSet.js";
|
|
2
3
|
import { bytes32ToString } from "../../utils/bytes32ToString.js";
|
|
3
4
|
import { ADDRESS_0X0 } from "../../constants/addresses.js";
|
|
@@ -14,7 +15,6 @@ import { RWA_LIQUIDATOR_SECURITIZE } from "../../market/rwa/securitize/constants
|
|
|
14
15
|
import { SecuritizeLiquidatorContract } from "../../market/rwa/securitize/SecuritizeLiquidatorContract.js";
|
|
15
16
|
import "../../market/rwa/securitize/index.js";
|
|
16
17
|
import { LIQUIDATION_COMPRESSOR_V313_ADDRESS } from "./constants.js";
|
|
17
|
-
import { iLiquidationCompressorV313Abi } from "../../../abi/ILiquidationCompressorV313.js";
|
|
18
18
|
import { calcEstimatedProfit, calcRepaymentAmount, liquidationCallToRawTx, pickMainAsset, toLiquidationApproval, toLiquidatorWithdrawals, toReceivedAssets } from "./helpers.js";
|
|
19
19
|
//#region src/sdk/accounts/liquidations/LiquidationsService.ts
|
|
20
20
|
/**
|
|
@@ -100,7 +100,7 @@ var LiquidationsService = class extends SDKConstruct {
|
|
|
100
100
|
await compressor.loadWithdrawableAssets();
|
|
101
101
|
const phantomTokens = new AddressSet(compressor.getWithdrawableAssets().map((a) => a.withdrawalPhantomToken));
|
|
102
102
|
const current = await compressor.getExternalAccountCurrentWithdrawals(props.liquidator, ...phantomTokens.asArray());
|
|
103
|
-
return toLiquidatorWithdrawals(current, this.sdk.networkType);
|
|
103
|
+
return toLiquidatorWithdrawals(current, this.sdk.networkType, this.sdk.chainId);
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
106
106
|
* {@inheritDoc ILiquidationsService.loadRWALiquidators}
|
|
@@ -69,20 +69,31 @@ function pickMainAsset(ca, convert) {
|
|
|
69
69
|
* @param current - Claimable and pending withdrawals from the withdrawal compressor
|
|
70
70
|
* @param network - Network the withdrawals live on
|
|
71
71
|
**/
|
|
72
|
-
function toLiquidatorWithdrawals(current, network) {
|
|
72
|
+
function toLiquidatorWithdrawals(current, network, chainId) {
|
|
73
73
|
const rows = [];
|
|
74
|
-
for (const w of current.claimable)
|
|
74
|
+
for (const w of current.claimable) rows.push({
|
|
75
75
|
network,
|
|
76
|
+
chainId,
|
|
76
77
|
sourceToken: w.token,
|
|
77
|
-
|
|
78
|
-
|
|
78
|
+
outputs: w.outputs.map((o) => {
|
|
79
|
+
return {
|
|
80
|
+
balance: o.amount,
|
|
81
|
+
token: o.token
|
|
82
|
+
};
|
|
83
|
+
}),
|
|
84
|
+
claimCalls: w.claimCalls,
|
|
79
85
|
redeemer: w.redeemer
|
|
80
86
|
});
|
|
81
|
-
for (const w of current.pending)
|
|
87
|
+
for (const w of current.pending) rows.push({
|
|
82
88
|
network,
|
|
89
|
+
chainId,
|
|
83
90
|
sourceToken: w.token,
|
|
84
|
-
|
|
85
|
-
|
|
91
|
+
outputs: w.expectedOutputs.map((o) => {
|
|
92
|
+
return {
|
|
93
|
+
balance: o.amount,
|
|
94
|
+
token: o.token
|
|
95
|
+
};
|
|
96
|
+
}),
|
|
86
97
|
claimableAt: w.claimableAt,
|
|
87
98
|
redeemer: w.redeemer
|
|
88
99
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { iRedemptionLoggerV310Abi } from "../../../abi/iRedemptionLoggerV310.js";
|
|
1
2
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
2
3
|
import "../../base/index.js";
|
|
3
4
|
import { decodeDelayedIntent } from "./intent-codec.js";
|
|
4
|
-
import { iRedemptionLoggerV310Abi } from "../../../abi/iRedemptionLoggerV310.js";
|
|
5
5
|
import { InvalidDelayedIntentError } from "./errors.js";
|
|
6
6
|
//#region src/sdk/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.ts
|
|
7
7
|
const abi = iRedemptionLoggerV310Abi;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractWithdrawalCompressorContract } from "./AbstractWithdrawalCompressorContract.js";
|
|
2
1
|
import { iWithdrawalCompressorV310Abi } from "../../../abi/IWithdrawalCompressorV310.js";
|
|
2
|
+
import { AbstractWithdrawalCompressorContract } from "./AbstractWithdrawalCompressorContract.js";
|
|
3
3
|
//#region src/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.ts
|
|
4
4
|
const abi = iWithdrawalCompressorV310Abi;
|
|
5
5
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractWithdrawalCompressorContract } from "./AbstractWithdrawalCompressorContract.js";
|
|
2
1
|
import { iWithdrawalCompressorV311Abi } from "../../../abi/IWithdrawalCompressorV311.js";
|
|
2
|
+
import { AbstractWithdrawalCompressorContract } from "./AbstractWithdrawalCompressorContract.js";
|
|
3
3
|
//#region src/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.ts
|
|
4
4
|
const abi = iWithdrawalCompressorV311Abi;
|
|
5
5
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { iWithdrawalCompressorV313Abi } from "../../../abi/IWithdrawalCompressorV313.js";
|
|
1
2
|
import { encodeDelayedIntent } from "./intent-codec.js";
|
|
2
3
|
import { AbstractWithdrawalCompressorContract, iCreditAccountAbi, toClaimableWithdrawal, toPendingWithdrawal, toRequestableWithdrawal } from "./AbstractWithdrawalCompressorContract.js";
|
|
3
|
-
import { iWithdrawalCompressorV313Abi } from "../../../abi/IWithdrawalCompressorV313.js";
|
|
4
4
|
import { toWithdrawalStatus } from "./types.js";
|
|
5
5
|
//#region src/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.ts
|
|
6
6
|
const abi = iWithdrawalCompressorV313Abi;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { iStateSerializerAbi } from "../../abi/iStateSerializer.js";
|
|
2
|
+
import { iVersionAbi } from "../../abi/iVersion.js";
|
|
1
3
|
import { AddressMap } from "../utils/AddressMap.js";
|
|
2
4
|
import { AddressSet } from "../utils/AddressSet.js";
|
|
3
5
|
import { bytes32ToString } from "../utils/bytes32ToString.js";
|
|
4
6
|
import { formatBN } from "../utils/formatter.js";
|
|
5
7
|
import "../utils/index.js";
|
|
6
|
-
import { iStateSerializerAbi } from "../../abi/iStateSerializer.js";
|
|
7
|
-
import { iVersionAbi } from "../../abi/iVersion.js";
|
|
8
8
|
//#region src/sdk/base/TokensMeta.ts
|
|
9
9
|
/**
|
|
10
10
|
* Registry of token metadata (symbol, decimals, phantom type) keyed by address.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { iVersionAbi } from "../../abi/iVersion.js";
|
|
1
2
|
import { AP_MARKET_COMPRESSOR, AP_PRICE_FEED_COMPRESSOR } from "../constants/address-provider.js";
|
|
2
3
|
import { isV310 } from "../constants/versions.js";
|
|
3
4
|
import "../constants/index.js";
|
|
4
5
|
import { hexEq } from "../utils/hex.js";
|
|
5
|
-
import { iVersionAbi } from "../../abi/iVersion.js";
|
|
6
6
|
import { AddressProviderV310Contract } from "./AddressProviderV310Contract.js";
|
|
7
7
|
//#region src/sdk/core/createAddressProvider.ts
|
|
8
8
|
const OVERRIDE_ADDRESSES = { Mainnet: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
1
2
|
import { iCreditFacadeMulticallV310Abi, iCreditFacadeV310Abi } from "../../../abi/310/generated.js";
|
|
2
3
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
3
4
|
import "../../base/index.js";
|
|
4
|
-
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
5
5
|
//#region src/sdk/market/credit/CreditFacadeV310BaseContract.ts
|
|
6
6
|
const abi = [
|
|
7
7
|
...iCreditFacadeV310Abi,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
+
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
1
2
|
import { iPoolV310Abi } from "../../../abi/310/generated.js";
|
|
2
3
|
import { AddressMap } from "../../utils/AddressMap.js";
|
|
3
4
|
import { formatBN, formatBNvalue, percentFmt } from "../../utils/formatter.js";
|
|
4
5
|
import "../../utils/index.js";
|
|
5
6
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
6
7
|
import "../../base/index.js";
|
|
7
|
-
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
8
8
|
//#region src/sdk/market/pool/PoolV310Contract.ts
|
|
9
9
|
const abi = [...iPoolV310Abi, ...iPausableAbi];
|
|
10
10
|
var PoolV310Contract = class extends BaseContract {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ZapperContract } from "./ZapperContract.js";
|
|
2
1
|
import { iethZapperAbi } from "../../../abi/iETHZapper.js";
|
|
2
|
+
import { ZapperContract } from "./ZapperContract.js";
|
|
3
3
|
//#region src/sdk/market/zapper/IETHZapperContract.ts
|
|
4
4
|
const abi = iethZapperAbi;
|
|
5
5
|
var IETHZapperContract = class extends ZapperContract {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { iZapperAbi } from "../../../abi/iZapper.js";
|
|
1
2
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
2
3
|
import "../../base/index.js";
|
|
3
|
-
import { iZapperAbi } from "../../../abi/iZapper.js";
|
|
4
4
|
import { UnsupportedZapperFunctionError } from "./errors.js";
|
|
5
5
|
//#region src/sdk/market/zapper/ZapperContract.ts
|
|
6
6
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AddressSet } from "../utils/AddressSet.js";
|
|
2
1
|
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
2
|
+
import { AddressSet } from "../utils/AddressSet.js";
|
|
3
3
|
import "../constants/addresses.js";
|
|
4
4
|
import "../constants/index.js";
|
|
5
5
|
import { hexEq } from "../utils/hex.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { errorAbis } from "../../../abi/errors.js";
|
|
2
|
-
import { generateCastTraceCall } from "./cast.js";
|
|
3
2
|
import { iUpdatablePriceFeedAbi } from "../../../abi/iUpdatablePriceFeed.js";
|
|
3
|
+
import { generateCastTraceCall } from "./cast.js";
|
|
4
4
|
import { simulateMulticall } from "./simulateMulticall.js";
|
|
5
5
|
import { BaseError, CallExecutionError, ContractFunctionRevertedError, decodeFunctionData, decodeFunctionResult, encodeFunctionData, parseAbi } from "viem";
|
|
6
6
|
import { getAction, parseAccount } from "viem/utils";
|
|
@@ -75,7 +75,7 @@ declare function pickMainAsset(ca: CreditAccountData, convert: (token: Address,
|
|
|
75
75
|
* @param current - Claimable and pending withdrawals from the withdrawal compressor
|
|
76
76
|
* @param network - Network the withdrawals live on
|
|
77
77
|
**/
|
|
78
|
-
declare function toLiquidatorWithdrawals(current: CurrentWithdrawals, network: NetworkType): LiquidatorWithdrawal[];
|
|
78
|
+
declare function toLiquidatorWithdrawals(current: CurrentWithdrawals, network: NetworkType, chainId: number): LiquidatorWithdrawal[];
|
|
79
79
|
/**
|
|
80
80
|
* Normalizes the liquidation compressor outputs into assets the liquidator
|
|
81
81
|
* receives. Zero `redeemerAddress` and `claimableAt` (used by the contracts
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { NetworkType } from "../../chain/chains.js";
|
|
2
2
|
import "../../chain/index.js";
|
|
3
3
|
import { Asset } from "../../base/types.js";
|
|
4
|
-
import { RawTx } from "../../types/transactions.js";
|
|
4
|
+
import { MultiCall, RawTx } from "../../types/transactions.js";
|
|
5
5
|
import "../../types/index.js";
|
|
6
6
|
import "../../base/index.js";
|
|
7
7
|
import { Address } from "viem";
|
|
@@ -224,6 +224,10 @@ interface LiquidatorWithdrawal {
|
|
|
224
224
|
* Network the withdrawal lives on.
|
|
225
225
|
**/
|
|
226
226
|
network: NetworkType;
|
|
227
|
+
/**
|
|
228
|
+
* Chain id the withdrawal lives on.
|
|
229
|
+
**/
|
|
230
|
+
chainId: number;
|
|
227
231
|
/**
|
|
228
232
|
* Source asset spent by the delayed withdrawal (e.g. ACRED).
|
|
229
233
|
**/
|
|
@@ -231,17 +235,21 @@ interface LiquidatorWithdrawal {
|
|
|
231
235
|
/**
|
|
232
236
|
* Receivable asset (e.g. USDC).
|
|
233
237
|
**/
|
|
234
|
-
token: Address;
|
|
235
238
|
/**
|
|
236
239
|
* Amount of `token` receivable: exact for claimable withdrawals, estimated
|
|
237
240
|
* for pending ones.
|
|
238
241
|
**/
|
|
239
|
-
|
|
242
|
+
outputs: Array<Asset>;
|
|
240
243
|
/**
|
|
241
244
|
* Estimated unix timestamp (in seconds) when a pending withdrawal becomes
|
|
242
245
|
* claimable. `undefined` means the withdrawal is claimable now.
|
|
243
246
|
**/
|
|
244
247
|
claimableAt?: bigint;
|
|
248
|
+
/**
|
|
249
|
+
* Estimated unix timestamp (in seconds) when a pending withdrawal becomes
|
|
250
|
+
* claimable. `undefined` means the withdrawal is claimable now.
|
|
251
|
+
**/
|
|
252
|
+
claimCalls?: Array<MultiCall>;
|
|
245
253
|
/**
|
|
246
254
|
* Redeemer contract the withdrawal is claimed from, owned by the liquidator.
|
|
247
255
|
* `undefined` on compressor versions below 313, which do not report it.
|