@gearbox-protocol/sdk 16.0.0-next.44 → 16.0.0-next.45
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/onchain/market/adapters/contracts/BalancerV3RouterAdapterContract.js +33 -1
- package/dist/esm/dev/AccountOpener.js +1 -1
- package/dist/esm/dev/withdrawalUtils.js +1 -1
- package/dist/esm/onchain/accounts/CreditAccountsServiceV310.js +2 -2
- package/dist/esm/onchain/accounts/liquidations/LiquidationsService.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.js +1 -1
- package/dist/esm/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.js +1 -1
- package/dist/esm/onchain/base/TokensMeta.js +3 -3
- package/dist/esm/onchain/core/createAddressProvider.js +1 -1
- package/dist/esm/onchain/market/adapters/contracts/AccountMigratorAdapterContract.js +1 -1
- package/dist/esm/onchain/market/adapters/contracts/BalancerV3RouterAdapterContract.js +33 -1
- package/dist/esm/onchain/market/adapters/contracts/ERC4626AdapterContract.js +1 -1
- package/dist/esm/onchain/market/credit/CreditFacadeV310BaseContract.js +1 -1
- package/dist/esm/onchain/market/pool/PoolV310Contract.js +1 -1
- package/dist/esm/onchain/market/zapper/IETHZapperContract.js +1 -1
- package/dist/esm/onchain/market/zapper/ZapperContract.js +1 -1
- package/dist/esm/onchain/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/dist/esm/preview/simulate/simulatePoolOperation.js +1 -1
- package/dist/esm/preview/trace/extractTransfers.js +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_onchain_utils_AddressMap = require("../../../utils/AddressMap.js");
|
|
3
|
+
require("../../../utils/index.js");
|
|
2
4
|
const require_onchain_base_errors = require("../../../base/errors.js");
|
|
3
5
|
require("../../../base/index.js");
|
|
4
6
|
const require_onchain_market_adapters_abi_adapters_iBalancerV3RouterAdapter = require("../abi/adapters/iBalancerV3RouterAdapter.js");
|
|
@@ -7,6 +9,30 @@ const require_onchain_market_adapters_abi_targetContractAbi = require("../abi/ta
|
|
|
7
9
|
const require_onchain_market_adapters_contracts_AbstractAdapter = require("./AbstractAdapter.js");
|
|
8
10
|
let viem = require("viem");
|
|
9
11
|
//#region src/onchain/market/adapters/contracts/BalancerV3RouterAdapterContract.ts
|
|
12
|
+
const BALANCER_V3_POOL_TOKENS = {
|
|
13
|
+
Mainnet: new require_onchain_utils_AddressMap.AddressMap([
|
|
14
|
+
["0x121edB0bADc036F5FC610D015EE14093C142313B", ["0x775F661b0bD1739349b9A2A3EF60be277c5d2D29", "0x7a4EffD87C2f3C55CA251080b1343b605f327E3a"]],
|
|
15
|
+
["0x1ea5870f7C037930CE1d5d8d9317c670e89e13E3", ["0x0bfc9d54Fc184518A81162F8fB99c2eACa081202", "0xae78736Cd615f374D3085123A210448E74Fc6393"]],
|
|
16
|
+
["0x57c23c58B1D8C3292c15BEcF07c62C5c52457A42", ["0x0bfc9d54Fc184518A81162F8fB99c2eACa081202", "0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38"]],
|
|
17
|
+
["0x6b31a94029fd7840d780191B6D63Fa0D269bd883", ["0x2411802D8BEA09be0aF8fD8D08314a63e706b29C", "0x90551c1795392094FE6D29B758EcCD233cFAa260"]],
|
|
18
|
+
["0x85B2b559bC2D21104C4DEFdd6EFcA8A20343361D", [
|
|
19
|
+
"0x7Bc3485026Ac48b6cf9BaF0A377477Fff5703Af8",
|
|
20
|
+
"0xC71Ea051a5F82c67ADcF634c36FFE6334793D24C",
|
|
21
|
+
"0xD4fa2D31b7968E448877f69A96DE69f5de8cD23E"
|
|
22
|
+
]],
|
|
23
|
+
["0x9ED5175aeCB6653C1BDaa19793c16fd74fBeEB37", ["0x775F661b0bD1739349b9A2A3EF60be277c5d2D29", "0xD11c452fc99cF405034ee446803b6F6c1F6d5ED8"]],
|
|
24
|
+
["0xc4Ce391d82D164c166dF9c8336DDF84206b2F812", ["0x0FE906e030a44eF24CA8c7dC7B7c53A6C4F00ce9", "0x775F661b0bD1739349b9A2A3EF60be277c5d2D29"]]
|
|
25
|
+
]),
|
|
26
|
+
Plasma: new require_onchain_utils_AddressMap.AddressMap([
|
|
27
|
+
["0x01E2C7fCde2B8D5d1413732c4e274Ba5B06B1E54", ["0x0A1a1A107E45b7Ced86833863f482BC5f4ed82EF", "0xE0126F0c4451B2B917064A93040fd4770D6774b5"]],
|
|
28
|
+
["0x694c009aa31B3F80EE18C218B02390ca2D7151e7", ["0x6eAf19b2FC24552925dB245F9Ff613157a7dbb4C", "0xE0126F0c4451B2B917064A93040fd4770D6774b5"]],
|
|
29
|
+
["0x6a74BE33B5393D8A3EbA4D69B78f9D9da947C48c", ["0xC63F1a8c0cD4493E18f6f3371182BE01Ce0BeF02", "0xE0126F0c4451B2B917064A93040fd4770D6774b5"]],
|
|
30
|
+
["0xB3Ca3ead1c59dEd552cD30a6992038284B418b65", ["0x0B2b2B2076d95dda7817e785989fE353fe955ef9", "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb"]],
|
|
31
|
+
["0xD931775d9AcA9859c9fDc53C63ae32EF21551492", ["0x9c46EE1f01d2b551048F5fF99a4659D98d04BED1", "0xC8A8DF9B210243c55D31c73090F06787aD0A1Bf6"]],
|
|
32
|
+
["0xd9c4e277c93374a9f8C877a9D06707a88092E8F0", ["0x211Cc4DD073734dA055fbF44a2b4667d5E5fE5d2", "0xE0126F0c4451B2B917064A93040fd4770D6774b5"]],
|
|
33
|
+
["0xDE0cfD933D2036d99048a04acF5Bacfb45492377", ["0x76309A9a56309104518847BbA321c261B7B4a43f", "0xA29420057F3e3B9512D4786df135Da1674BD74D4"]]
|
|
34
|
+
])
|
|
35
|
+
};
|
|
10
36
|
let BalancerV3PoolStatus = /* @__PURE__ */ function(BalancerV3PoolStatus) {
|
|
11
37
|
BalancerV3PoolStatus[BalancerV3PoolStatus["NOT_ALLOWED"] = 0] = "NOT_ALLOWED";
|
|
12
38
|
BalancerV3PoolStatus[BalancerV3PoolStatus["ALLOWED"] = 1] = "ALLOWED";
|
|
@@ -99,7 +125,13 @@ var BalancerV3RouterAdapterContract = class extends require_onchain_market_adapt
|
|
|
99
125
|
this.setLeftover(balances, pool, leftoverAmount);
|
|
100
126
|
break;
|
|
101
127
|
}
|
|
102
|
-
case "addLiquidityUnbalancedDiff":
|
|
128
|
+
case "addLiquidityUnbalancedDiff": {
|
|
129
|
+
const [pool, leftoverAmounts] = decoded.args;
|
|
130
|
+
const tokens = BALANCER_V3_POOL_TOKENS[this.networkType]?.get(pool);
|
|
131
|
+
if (!tokens || tokens.length !== leftoverAmounts.length) throw new Error(`previewBalanceChanges cannot resolve pool tokens for addLiquidityUnbalancedDiff on ${this.contractType} adapter at ${this.address} (pool ${pool})`);
|
|
132
|
+
for (let i = 0; i < leftoverAmounts.length; i++) this.setLeftover(balances, tokens[i], leftoverAmounts[i]);
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
103
135
|
default: super.applyBalanceChanges(balances, decoded);
|
|
104
136
|
}
|
|
105
137
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { iCreditFacadeV310Abi } from "../abi/310/generated.js";
|
|
2
1
|
import { ierc20Abi } from "../abi/iERC20.js";
|
|
2
|
+
import { iCreditFacadeV310Abi } from "../abi/310/generated.js";
|
|
3
3
|
import { AddressMap } from "../onchain/utils/AddressMap.js";
|
|
4
4
|
import { AddressSet } from "../onchain/utils/AddressSet.js";
|
|
5
5
|
import { AssetsMap } from "../onchain/utils/AssetsMap.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { iWithdrawalCompressorV313Abi } from "../abi/IWithdrawalCompressorV313.js";
|
|
1
2
|
import { getNetworkType } from "../onchain/chain/chains.js";
|
|
2
3
|
import { getWithdrawalCompressorAddress } from "../onchain/accounts/withdrawal-compressor/addresses.js";
|
|
3
|
-
import { iWithdrawalCompressorV313Abi } from "../abi/IWithdrawalCompressorV313.js";
|
|
4
4
|
import "../onchain/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";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { iBaseRewardPoolAbi } from "../../abi/iBaseRewardPool.js";
|
|
2
|
+
import { ierc4626AdapterAbi } from "../../abi/ierc4626Adapter.js";
|
|
1
3
|
import { AP_REWARDS_COMPRESSOR } from "../constants/address-provider.js";
|
|
2
4
|
import { ADDRESS_0X0 } from "../constants/addresses.js";
|
|
3
5
|
import { MAX_UINT256 } from "../constants/math.js";
|
|
@@ -8,8 +10,6 @@ import "../base/index.js";
|
|
|
8
10
|
import { AccountBotsService } from "./bots/AccountBotsService.js";
|
|
9
11
|
import "./bots/index.js";
|
|
10
12
|
import { rewardsCompressorAbi } from "../../abi/compressors/rewardsCompressor.js";
|
|
11
|
-
import { iBaseRewardPoolAbi } from "../../abi/iBaseRewardPool.js";
|
|
12
|
-
import { ierc4626AdapterAbi } from "../../abi/ierc4626Adapter.js";
|
|
13
13
|
import { expectedBalanceDeltas } from "../market/credit/expectedBalanceDeltas.js";
|
|
14
14
|
import "../market/index.js";
|
|
15
15
|
import { CreditAccountCompressor } from "./credit-account-compressor/CreditAccountCompressor.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";
|
|
@@ -19,7 +20,6 @@ import { SecuritizeLiquidatorContract } from "../../market/rwa/securitize/Securi
|
|
|
19
20
|
import "../../market/rwa/securitize/index.js";
|
|
20
21
|
import "../../market/index.js";
|
|
21
22
|
import { LIQUIDATION_APPROVAL_BUFFER, LIQUIDATION_COMPRESSOR_V313_ADDRESS } from "./constants.js";
|
|
22
|
-
import { iLiquidationCompressorV313Abi } from "../../../abi/ILiquidationCompressorV313.js";
|
|
23
23
|
import { skipLiquidatableAccount } from "./skipLiquidatableAccount.js";
|
|
24
24
|
//#region src/onchain/accounts/liquidations/LiquidationsService.ts
|
|
25
25
|
/**
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { iRedemptionLoggerV310Abi } from "../../../abi/iRedemptionLoggerV310.js";
|
|
1
2
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
2
3
|
import "../../base/index.js";
|
|
3
4
|
import { sdkErr, sdkOk } from "../../../model/result.js";
|
|
4
5
|
import "../../../model/index.js";
|
|
5
6
|
import { decodeDelayedIntent } from "./intent-codec.js";
|
|
6
|
-
import { iRedemptionLoggerV310Abi } from "../../../abi/iRedemptionLoggerV310.js";
|
|
7
7
|
//#region src/onchain/accounts/withdrawal-compressor/RedemptionLoggerV310Contract.ts
|
|
8
8
|
const abi = iRedemptionLoggerV310Abi;
|
|
9
9
|
/**
|
|
@@ -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/onchain/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/onchain/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/onchain/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.ts
|
|
6
6
|
const abi = iWithdrawalCompressorV313Abi;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import { iExpirableAbi } from "../../abi/iExpirable.js";
|
|
2
|
+
import { iStateSerializerAbi } from "../../abi/iStateSerializer.js";
|
|
3
|
+
import { iVersionAbi } from "../../abi/iVersion.js";
|
|
1
4
|
import { AddressMap } from "../utils/AddressMap.js";
|
|
2
5
|
import { AddressSet } from "../utils/AddressSet.js";
|
|
3
6
|
import { bytes32ToString } from "../utils/bytes32ToString.js";
|
|
4
7
|
import { getAssetType } from "../chain/chains.js";
|
|
5
8
|
import { formatBN } from "../utils/formatter.js";
|
|
6
9
|
import "../utils/index.js";
|
|
7
|
-
import { iExpirableAbi } from "../../abi/iExpirable.js";
|
|
8
|
-
import { iStateSerializerAbi } from "../../abi/iStateSerializer.js";
|
|
9
|
-
import { iVersionAbi } from "../../abi/iVersion.js";
|
|
10
10
|
import { SdkRWADataNotLoadedError } from "../core/errors.js";
|
|
11
11
|
import { executeMulticallBatches } from "../utils/viem/executeMulticallBatches.js";
|
|
12
12
|
//#region src/onchain/base/TokensMeta.ts
|
|
@@ -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/onchain/core/createAddressProvider.ts
|
|
8
8
|
const OVERRIDE_ADDRESSES = { Mainnet: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
2
1
|
import { accountMigratorAbi } from "../../../../abi/AccountMigrator.js";
|
|
2
|
+
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
3
3
|
//#region src/onchain/market/adapters/contracts/AccountMigratorAdapterContract.ts
|
|
4
4
|
const abi = accountMigratorAbi;
|
|
5
5
|
const protocolAbi = accountMigratorAbi;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { AddressMap } from "../../../utils/AddressMap.js";
|
|
2
|
+
import "../../../utils/index.js";
|
|
1
3
|
import { MissingSerializedParamsError } from "../../../base/errors.js";
|
|
2
4
|
import "../../../base/index.js";
|
|
3
5
|
import { iBalancerV3RouterAdapterAbi } from "../abi/adapters/iBalancerV3RouterAdapter.js";
|
|
@@ -6,6 +8,30 @@ import { iBalancerV3RouterAbi } from "../abi/targetContractAbi.js";
|
|
|
6
8
|
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
7
9
|
import { decodeAbiParameters } from "viem";
|
|
8
10
|
//#region src/onchain/market/adapters/contracts/BalancerV3RouterAdapterContract.ts
|
|
11
|
+
const BALANCER_V3_POOL_TOKENS = {
|
|
12
|
+
Mainnet: new AddressMap([
|
|
13
|
+
["0x121edB0bADc036F5FC610D015EE14093C142313B", ["0x775F661b0bD1739349b9A2A3EF60be277c5d2D29", "0x7a4EffD87C2f3C55CA251080b1343b605f327E3a"]],
|
|
14
|
+
["0x1ea5870f7C037930CE1d5d8d9317c670e89e13E3", ["0x0bfc9d54Fc184518A81162F8fB99c2eACa081202", "0xae78736Cd615f374D3085123A210448E74Fc6393"]],
|
|
15
|
+
["0x57c23c58B1D8C3292c15BEcF07c62C5c52457A42", ["0x0bfc9d54Fc184518A81162F8fB99c2eACa081202", "0xf1C9acDc66974dFB6dEcB12aA385b9cD01190E38"]],
|
|
16
|
+
["0x6b31a94029fd7840d780191B6D63Fa0D269bd883", ["0x2411802D8BEA09be0aF8fD8D08314a63e706b29C", "0x90551c1795392094FE6D29B758EcCD233cFAa260"]],
|
|
17
|
+
["0x85B2b559bC2D21104C4DEFdd6EFcA8A20343361D", [
|
|
18
|
+
"0x7Bc3485026Ac48b6cf9BaF0A377477Fff5703Af8",
|
|
19
|
+
"0xC71Ea051a5F82c67ADcF634c36FFE6334793D24C",
|
|
20
|
+
"0xD4fa2D31b7968E448877f69A96DE69f5de8cD23E"
|
|
21
|
+
]],
|
|
22
|
+
["0x9ED5175aeCB6653C1BDaa19793c16fd74fBeEB37", ["0x775F661b0bD1739349b9A2A3EF60be277c5d2D29", "0xD11c452fc99cF405034ee446803b6F6c1F6d5ED8"]],
|
|
23
|
+
["0xc4Ce391d82D164c166dF9c8336DDF84206b2F812", ["0x0FE906e030a44eF24CA8c7dC7B7c53A6C4F00ce9", "0x775F661b0bD1739349b9A2A3EF60be277c5d2D29"]]
|
|
24
|
+
]),
|
|
25
|
+
Plasma: new AddressMap([
|
|
26
|
+
["0x01E2C7fCde2B8D5d1413732c4e274Ba5B06B1E54", ["0x0A1a1A107E45b7Ced86833863f482BC5f4ed82EF", "0xE0126F0c4451B2B917064A93040fd4770D6774b5"]],
|
|
27
|
+
["0x694c009aa31B3F80EE18C218B02390ca2D7151e7", ["0x6eAf19b2FC24552925dB245F9Ff613157a7dbb4C", "0xE0126F0c4451B2B917064A93040fd4770D6774b5"]],
|
|
28
|
+
["0x6a74BE33B5393D8A3EbA4D69B78f9D9da947C48c", ["0xC63F1a8c0cD4493E18f6f3371182BE01Ce0BeF02", "0xE0126F0c4451B2B917064A93040fd4770D6774b5"]],
|
|
29
|
+
["0xB3Ca3ead1c59dEd552cD30a6992038284B418b65", ["0x0B2b2B2076d95dda7817e785989fE353fe955ef9", "0xB8CE59FC3717ada4C02eaDF9682A9e934F625ebb"]],
|
|
30
|
+
["0xD931775d9AcA9859c9fDc53C63ae32EF21551492", ["0x9c46EE1f01d2b551048F5fF99a4659D98d04BED1", "0xC8A8DF9B210243c55D31c73090F06787aD0A1Bf6"]],
|
|
31
|
+
["0xd9c4e277c93374a9f8C877a9D06707a88092E8F0", ["0x211Cc4DD073734dA055fbF44a2b4667d5E5fE5d2", "0xE0126F0c4451B2B917064A93040fd4770D6774b5"]],
|
|
32
|
+
["0xDE0cfD933D2036d99048a04acF5Bacfb45492377", ["0x76309A9a56309104518847BbA321c261B7B4a43f", "0xA29420057F3e3B9512D4786df135Da1674BD74D4"]]
|
|
33
|
+
])
|
|
34
|
+
};
|
|
9
35
|
let BalancerV3PoolStatus = /* @__PURE__ */ function(BalancerV3PoolStatus) {
|
|
10
36
|
BalancerV3PoolStatus[BalancerV3PoolStatus["NOT_ALLOWED"] = 0] = "NOT_ALLOWED";
|
|
11
37
|
BalancerV3PoolStatus[BalancerV3PoolStatus["ALLOWED"] = 1] = "ALLOWED";
|
|
@@ -98,7 +124,13 @@ var BalancerV3RouterAdapterContract = class extends AbstractAdapterContract {
|
|
|
98
124
|
this.setLeftover(balances, pool, leftoverAmount);
|
|
99
125
|
break;
|
|
100
126
|
}
|
|
101
|
-
case "addLiquidityUnbalancedDiff":
|
|
127
|
+
case "addLiquidityUnbalancedDiff": {
|
|
128
|
+
const [pool, leftoverAmounts] = decoded.args;
|
|
129
|
+
const tokens = BALANCER_V3_POOL_TOKENS[this.networkType]?.get(pool);
|
|
130
|
+
if (!tokens || tokens.length !== leftoverAmounts.length) throw new Error(`previewBalanceChanges cannot resolve pool tokens for addLiquidityUnbalancedDiff on ${this.contractType} adapter at ${this.address} (pool ${pool})`);
|
|
131
|
+
for (let i = 0; i < leftoverAmounts.length; i++) this.setLeftover(balances, tokens[i], leftoverAmounts[i]);
|
|
132
|
+
break;
|
|
133
|
+
}
|
|
102
134
|
default: super.applyBalanceChanges(balances, decoded);
|
|
103
135
|
}
|
|
104
136
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { ierc4626AdapterAbi } from "../../../../abi/ierc4626Adapter.js";
|
|
1
2
|
import { MissingSerializedParamsError } from "../../../base/errors.js";
|
|
2
3
|
import "../../../base/index.js";
|
|
3
|
-
import { ierc4626AdapterAbi } from "../../../../abi/ierc4626Adapter.js";
|
|
4
4
|
import { iERC4626Abi } from "../abi/targetContractAbi.js";
|
|
5
5
|
import { fnSigToName, swapFromTransfers } from "../transferHelpers.js";
|
|
6
6
|
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
@@ -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/onchain/market/credit/CreditFacadeV310BaseContract.ts
|
|
6
6
|
const abi = [
|
|
7
7
|
...iCreditFacadeV310Abi,
|
|
@@ -1,3 +1,4 @@
|
|
|
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 { RAY } from "../../constants/math.js";
|
|
@@ -7,7 +8,6 @@ import "../../utils/index.js";
|
|
|
7
8
|
import { SdkRWADataNotLoadedError } from "../../core/errors.js";
|
|
8
9
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
9
10
|
import "../../base/index.js";
|
|
10
|
-
import { iPausableAbi } from "../../../abi/iPausable.js";
|
|
11
11
|
//#region src/onchain/market/pool/PoolV310Contract.ts
|
|
12
12
|
const abi = [...iPoolV310Abi, ...iPausableAbi];
|
|
13
13
|
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/onchain/market/zapper/IETHZapperContract.ts
|
|
4
4
|
const abi = iethZapperAbi;
|
|
5
5
|
var IETHZapperContract = class extends ZapperContract {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import { iZapperAbi } from "../../../abi/iZapper.js";
|
|
1
2
|
import { BaseContract } from "../../base/BaseContract.js";
|
|
2
3
|
import "../../base/index.js";
|
|
3
4
|
import { sdkErr, sdkOk } from "../../../model/result.js";
|
|
4
5
|
import "../../../model/index.js";
|
|
5
|
-
import { iZapperAbi } from "../../../abi/iZapper.js";
|
|
6
6
|
//#region src/onchain/market/zapper/ZapperContract.ts
|
|
7
7
|
/**
|
|
8
8
|
* Base contract for every Gearbox zapper. Specialized zappers (e.g.
|
|
@@ -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";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { iZapperAbi } from "../../abi/iZapper.js";
|
|
1
2
|
import { iPoolV310Abi } from "../../abi/310/generated.js";
|
|
2
3
|
import { sdkErr, sdkOk } from "../../model/result.js";
|
|
3
4
|
import "../../model/index.js";
|
|
4
|
-
import { iZapperAbi } from "../../abi/iZapper.js";
|
|
5
5
|
import { asPreviewSimulationError } from "./errors.js";
|
|
6
6
|
//#region src/preview/simulate/simulatePoolOperation.ts
|
|
7
7
|
function previewRead(operation) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { iCreditFacadeV310Abi } from "../../abi/310/generated.js";
|
|
2
1
|
import { ierc20Abi } from "../../abi/iERC20.js";
|
|
2
|
+
import { iCreditFacadeV310Abi } from "../../abi/310/generated.js";
|
|
3
3
|
import { AddressMap } from "../../onchain/utils/AddressMap.js";
|
|
4
4
|
import "../../onchain/index.js";
|
|
5
5
|
import { UnexpectedFacadeEventOrderError } from "./errors.js";
|