@gearbox-protocol/sdk 14.11.3 → 14.12.0-next.1
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/common-utils/utils/index.js +2 -0
- package/dist/cjs/{history/trace-utils.js → common-utils/utils/trace.js} +62 -5
- package/dist/cjs/dev/index.js +3 -1
- package/dist/cjs/dev/verifyTestnet.js +52 -0
- package/dist/cjs/history/assembleOperations.js +6 -6
- package/dist/cjs/history/classifyMulticallOperations.js +31 -25
- package/dist/cjs/history/index.js +0 -2
- package/dist/cjs/history/parseCreditAccountTransaction.js +5 -6
- package/dist/cjs/history/toLegacyOperation.js +5 -1
- package/dist/cjs/plugins/adapters/contracts/AbstractAdapter.js +25 -37
- package/dist/cjs/plugins/adapters/contracts/AccountMigratorAdapterContract.js +9 -0
- package/dist/cjs/{history/internal-types.js → plugins/adapters/transfers.js} +2 -2
- package/dist/cjs/preview/index.js +28 -0
- package/dist/cjs/preview/package.json +1 -0
- package/dist/cjs/preview/parse/classifyInnerOperations.js +92 -0
- package/dist/cjs/preview/parse/errors.js +47 -0
- package/dist/cjs/preview/parse/extractExpectedBalanceChanges.js +48 -0
- package/dist/cjs/preview/parse/index.js +34 -0
- package/dist/cjs/preview/parse/parseFacadeOperationCalldata.js +115 -0
- package/dist/cjs/preview/parse/parseOperationCalldata.js +46 -0
- package/dist/cjs/preview/parse/parsePoolOperationCalldata.js +77 -0
- package/dist/cjs/{history/inner-operations.js → preview/parse/types-adapters.js} +2 -2
- package/dist/cjs/preview/parse/types-facades.js +16 -0
- package/dist/cjs/preview/parse/types-pools.js +16 -0
- package/dist/cjs/preview/parse/types.js +37 -0
- package/dist/cjs/preview/prerequisites/AllowancePrerequisite.js +78 -0
- package/dist/cjs/preview/prerequisites/BalancePrerequisite.js +77 -0
- package/dist/cjs/preview/prerequisites/Prerequisite.js +85 -0
- package/dist/cjs/preview/prerequisites/buildPrerequisites.js +187 -0
- package/dist/cjs/preview/prerequisites/index.js +34 -0
- package/dist/cjs/preview/prerequisites/prepareAction.js +48 -0
- package/dist/cjs/preview/prerequisites/runPrerequisites.js +71 -0
- package/dist/cjs/preview/prerequisites/types.js +16 -0
- package/dist/cjs/preview/simulate/constants.js +28 -0
- package/dist/cjs/preview/simulate/errors.js +98 -0
- package/dist/cjs/preview/simulate/extractERC20Transfers.js +47 -0
- package/dist/cjs/preview/simulate/holders.js +45 -0
- package/dist/cjs/preview/simulate/index.js +40 -0
- package/dist/cjs/preview/simulate/simulateFacadeOperation.js +30 -0
- package/dist/cjs/preview/simulate/simulateOperation.js +37 -0
- package/dist/cjs/preview/simulate/simulatePoolOpMulticall.js +155 -0
- package/dist/cjs/preview/simulate/simulatePoolOpV1.js +106 -0
- package/dist/cjs/preview/simulate/simulatePoolOperation.js +62 -0
- package/dist/cjs/preview/simulate/types.js +16 -0
- package/dist/cjs/{history → preview/trace}/errors.js +0 -26
- package/dist/cjs/preview/trace/extractAdapterCallTraces.js +58 -0
- package/dist/cjs/{history → preview/trace}/extractTransfers.js +9 -12
- package/dist/cjs/{history → preview/trace}/findFacadeCalls.js +3 -3
- package/dist/cjs/preview/trace/index.js +30 -0
- package/dist/cjs/preview/trace/types.js +16 -0
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +154 -0
- package/dist/esm/common-utils/utils/index.js +1 -0
- package/dist/esm/common-utils/utils/trace.js +93 -0
- package/dist/esm/dev/index.js +1 -0
- package/dist/esm/dev/verifyTestnet.js +27 -0
- package/dist/esm/history/assembleOperations.js +8 -6
- package/dist/esm/history/classifyMulticallOperations.js +29 -23
- package/dist/esm/history/index.js +0 -1
- package/dist/esm/history/parseCreditAccountTransaction.js +3 -4
- package/dist/esm/history/toLegacyOperation.js +5 -1
- package/dist/esm/plugins/adapters/contracts/AbstractAdapter.js +28 -38
- package/dist/esm/plugins/adapters/contracts/AccountMigratorAdapterContract.js +9 -0
- package/dist/esm/preview/index.js +4 -0
- package/dist/esm/preview/package.json +1 -0
- package/dist/esm/preview/parse/classifyInnerOperations.js +68 -0
- package/dist/esm/preview/parse/errors.js +22 -0
- package/dist/esm/preview/parse/extractExpectedBalanceChanges.js +24 -0
- package/dist/esm/preview/parse/index.js +7 -0
- package/dist/esm/preview/parse/parseFacadeOperationCalldata.js +91 -0
- package/dist/esm/preview/parse/parseOperationCalldata.js +25 -0
- package/dist/esm/preview/parse/parsePoolOperationCalldata.js +53 -0
- package/dist/esm/preview/parse/types-facades.js +0 -0
- package/dist/esm/preview/parse/types-pools.js +0 -0
- package/dist/esm/preview/parse/types.js +9 -0
- package/dist/esm/preview/prerequisites/AllowancePrerequisite.js +57 -0
- package/dist/esm/preview/prerequisites/BalancePrerequisite.js +56 -0
- package/dist/esm/preview/prerequisites/Prerequisite.js +63 -0
- package/dist/esm/preview/prerequisites/buildPrerequisites.js +163 -0
- package/dist/esm/preview/prerequisites/index.js +7 -0
- package/dist/esm/preview/prerequisites/prepareAction.js +23 -0
- package/dist/esm/preview/prerequisites/runPrerequisites.js +47 -0
- package/dist/esm/preview/prerequisites/types.js +0 -0
- package/dist/esm/preview/simulate/constants.js +4 -0
- package/dist/esm/preview/simulate/errors.js +75 -0
- package/dist/esm/preview/simulate/extractERC20Transfers.js +23 -0
- package/dist/esm/preview/simulate/holders.js +21 -0
- package/dist/esm/preview/simulate/index.js +12 -0
- package/dist/esm/preview/simulate/simulateFacadeOperation.js +6 -0
- package/dist/esm/preview/simulate/simulateOperation.js +13 -0
- package/dist/esm/preview/simulate/simulatePoolOpMulticall.js +130 -0
- package/dist/esm/preview/simulate/simulatePoolOpV1.js +82 -0
- package/dist/esm/preview/simulate/simulatePoolOperation.js +41 -0
- package/dist/esm/preview/simulate/types.js +0 -0
- package/dist/esm/{history → preview/trace}/errors.js +0 -24
- package/dist/esm/preview/trace/extractAdapterCallTraces.js +40 -0
- package/dist/esm/{history → preview/trace}/extractTransfers.js +9 -12
- package/dist/esm/{history → preview/trace}/findFacadeCalls.js +4 -2
- package/dist/esm/preview/trace/index.js +5 -0
- package/dist/esm/preview/trace/types.js +0 -0
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +154 -0
- package/dist/types/common-utils/utils/index.d.ts +1 -0
- package/dist/types/common-utils/utils/trace.d.ts +73 -0
- package/dist/types/dev/index.d.ts +1 -0
- package/dist/types/dev/verifyTestnet.d.ts +24 -0
- package/dist/types/history/assembleOperations.d.ts +11 -6
- package/dist/types/history/classifyMulticallOperations.d.ts +21 -9
- package/dist/types/history/index.d.ts +0 -1
- package/dist/types/history/mapOperations.d.ts +7 -9
- package/dist/types/history/types.d.ts +22 -71
- package/dist/types/plugins/adapters/contracts/AbstractAdapter.d.ts +16 -17
- package/dist/types/plugins/adapters/contracts/AccountMigratorAdapterContract.d.ts +10 -1
- package/dist/types/plugins/adapters/contracts/ConvexV1BaseRewardPoolAdapterContract.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/ConvexV1BoosterAdapterContract.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/Curve2AssetsAdapterContract.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/Curve3AssetsAdapterContract.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/Curve4AssetsAdapterContract.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/CurveV1AdapterDeposit.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/CurveV1AdapterStETHContract.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/CurveV1StableNGAdapterContract.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/DaiUsdsAdapterContract.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/ERC4626AdapterContract.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/ERC4626ReferralAdapterContract.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/LidoV1AdapterContract.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/MellowDVVAdapterContract.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/MellowERC4626VaultAdapterContract.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/UniswapV2AdapterContract.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/UniswapV4AdapterContract.d.ts +1 -1
- package/dist/types/plugins/adapters/contracts/WstETHV1AdapterContract.d.ts +1 -1
- package/dist/types/plugins/adapters/transferHelpers.d.ts +1 -1
- package/dist/types/plugins/adapters/transfers.d.ts +17 -0
- package/dist/types/plugins/adapters/types.d.ts +8 -46
- package/dist/types/preview/index.d.ts +4 -0
- package/dist/types/preview/parse/classifyInnerOperations.d.ts +21 -0
- package/dist/types/preview/parse/errors.d.ts +17 -0
- package/dist/types/preview/parse/extractExpectedBalanceChanges.d.ts +22 -0
- package/dist/types/preview/parse/index.d.ts +7 -0
- package/dist/types/preview/parse/parseFacadeOperationCalldata.d.ts +19 -0
- package/dist/types/preview/parse/parseOperationCalldata.d.ts +23 -0
- package/dist/types/preview/parse/parsePoolOperationCalldata.d.ts +17 -0
- package/dist/types/preview/parse/types-adapters.d.ts +69 -0
- package/dist/types/preview/parse/types-facades.d.ts +158 -0
- package/dist/types/preview/parse/types-pools.d.ts +55 -0
- package/dist/types/preview/parse/types.d.ts +44 -0
- package/dist/types/preview/prerequisites/AllowancePrerequisite.d.ts +24 -0
- package/dist/types/preview/prerequisites/BalancePrerequisite.d.ts +23 -0
- package/dist/types/preview/prerequisites/Prerequisite.d.ts +60 -0
- package/dist/types/preview/prerequisites/buildPrerequisites.d.ts +16 -0
- package/dist/types/preview/prerequisites/index.d.ts +7 -0
- package/dist/types/preview/prerequisites/prepareAction.d.ts +52 -0
- package/dist/types/preview/prerequisites/runPrerequisites.d.ts +12 -0
- package/dist/types/preview/prerequisites/types.d.ts +78 -0
- package/dist/types/preview/simulate/constants.d.ts +6 -0
- package/dist/types/preview/simulate/errors.d.ts +51 -0
- package/dist/types/preview/simulate/extractERC20Transfers.d.ts +11 -0
- package/dist/types/preview/simulate/holders.d.ts +7 -0
- package/dist/types/preview/simulate/index.d.ts +9 -0
- package/dist/types/preview/simulate/simulateFacadeOperation.d.ts +25 -0
- package/dist/types/preview/simulate/simulateOperation.d.ts +20 -0
- package/dist/types/preview/simulate/simulatePoolOpMulticall.d.ts +28 -0
- package/dist/types/preview/simulate/simulatePoolOpV1.d.ts +14 -0
- package/dist/types/preview/simulate/simulatePoolOperation.d.ts +8 -0
- package/dist/types/preview/simulate/types.d.ts +79 -0
- package/dist/types/{history → preview/trace}/errors.d.ts +0 -10
- package/dist/types/preview/trace/extractAdapterCallTraces.d.ts +23 -0
- package/dist/types/{history → preview/trace}/extractTransfers.d.ts +14 -5
- package/dist/types/{history → preview/trace}/findFacadeCalls.d.ts +3 -2
- package/dist/types/preview/trace/index.d.ts +5 -0
- package/dist/types/preview/trace/types.d.ts +21 -0
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +21 -1
- package/dist/types/sdk/accounts/types.d.ts +82 -0
- package/package.json +6 -1
- package/dist/cjs/history/extractProtocolCalls.js +0 -53
- package/dist/esm/history/extractProtocolCalls.js +0 -32
- package/dist/esm/history/trace-utils.js +0 -36
- package/dist/types/history/extractProtocolCalls.d.ts +0 -8
- package/dist/types/history/inner-operations.d.ts +0 -57
- package/dist/types/history/internal-types.d.ts +0 -47
- package/dist/types/history/trace-utils.d.ts +0 -12
- /package/dist/esm/{history/inner-operations.js → plugins/adapters/transfers.js} +0 -0
- /package/dist/esm/{history/internal-types.js → preview/parse/types-adapters.js} +0 -0
|
@@ -1547,6 +1547,160 @@ class CreditAccountsServiceV310 extends SDKConstruct {
|
|
|
1547
1547
|
callsWithPrices
|
|
1548
1548
|
);
|
|
1549
1549
|
}
|
|
1550
|
+
/**
|
|
1551
|
+
* {@inheritDoc ICreditAccountsService.prependPriceUpdates}
|
|
1552
|
+
*/
|
|
1553
|
+
async prependPriceUpdates(creditManager, calls, creditAccount, options) {
|
|
1554
|
+
return this.#prependPriceUpdates(
|
|
1555
|
+
creditManager,
|
|
1556
|
+
calls,
|
|
1557
|
+
creditAccount,
|
|
1558
|
+
options
|
|
1559
|
+
);
|
|
1560
|
+
}
|
|
1561
|
+
/**
|
|
1562
|
+
* {@inheritDoc ICreditAccountsService.assembleCaUpdateCalls}
|
|
1563
|
+
*/
|
|
1564
|
+
assembleCaUpdateCalls({
|
|
1565
|
+
operations,
|
|
1566
|
+
routerCallGroups,
|
|
1567
|
+
creditFacade,
|
|
1568
|
+
withdrawTo,
|
|
1569
|
+
creditAccount,
|
|
1570
|
+
underlyingToken
|
|
1571
|
+
}) {
|
|
1572
|
+
const calls = [];
|
|
1573
|
+
let swapGroupIndex = 0;
|
|
1574
|
+
let routerGroupsConsumed = 0;
|
|
1575
|
+
for (const op of operations) {
|
|
1576
|
+
switch (op.type) {
|
|
1577
|
+
case "increaseDebt":
|
|
1578
|
+
calls.push(this.#prepareIncreaseDebt(creditFacade, op.amount));
|
|
1579
|
+
break;
|
|
1580
|
+
case "decreaseDebt":
|
|
1581
|
+
calls.push(this.#prepareChangeDebt(creditFacade, op.amount, true));
|
|
1582
|
+
break;
|
|
1583
|
+
case "addCollateral":
|
|
1584
|
+
calls.push(
|
|
1585
|
+
...this.#prepareAddCollateral(
|
|
1586
|
+
creditFacade,
|
|
1587
|
+
[{ token: op.token, balance: op.amount }],
|
|
1588
|
+
{}
|
|
1589
|
+
)
|
|
1590
|
+
);
|
|
1591
|
+
break;
|
|
1592
|
+
case "withdrawCollateral":
|
|
1593
|
+
calls.push(
|
|
1594
|
+
this.#prepareWithdrawToken(
|
|
1595
|
+
creditFacade,
|
|
1596
|
+
op.token,
|
|
1597
|
+
op.amount,
|
|
1598
|
+
withdrawTo
|
|
1599
|
+
)
|
|
1600
|
+
);
|
|
1601
|
+
break;
|
|
1602
|
+
case "swap": {
|
|
1603
|
+
const routerCalls = routerCallGroups[swapGroupIndex];
|
|
1604
|
+
if (!routerCalls) {
|
|
1605
|
+
throw new Error(
|
|
1606
|
+
`assembleCaUpdateCalls: missing router calls for swap leg ${swapGroupIndex}`
|
|
1607
|
+
);
|
|
1608
|
+
}
|
|
1609
|
+
calls.push(...routerCalls);
|
|
1610
|
+
swapGroupIndex += 1;
|
|
1611
|
+
routerGroupsConsumed += 1;
|
|
1612
|
+
break;
|
|
1613
|
+
}
|
|
1614
|
+
case "changeQuota": {
|
|
1615
|
+
const quotaAssets = [...op.quotaIncrease, ...op.quotaDecrease];
|
|
1616
|
+
if (quotaAssets.length === 0) {
|
|
1617
|
+
break;
|
|
1618
|
+
}
|
|
1619
|
+
calls.push(
|
|
1620
|
+
...this.#prepareUpdateQuotas(creditFacade, {
|
|
1621
|
+
averageQuota: quotaAssets,
|
|
1622
|
+
minQuota: quotaAssets
|
|
1623
|
+
})
|
|
1624
|
+
);
|
|
1625
|
+
break;
|
|
1626
|
+
}
|
|
1627
|
+
case "closeCreditAccount": {
|
|
1628
|
+
for (const group of routerCallGroups) {
|
|
1629
|
+
calls.push(...group);
|
|
1630
|
+
routerGroupsConsumed += 1;
|
|
1631
|
+
}
|
|
1632
|
+
calls.push(
|
|
1633
|
+
...this.#prepareDisableQuotas({
|
|
1634
|
+
creditFacade,
|
|
1635
|
+
tokens: Object.entries(creditAccount.initialQuotas).map(
|
|
1636
|
+
([token, { quota }]) => ({
|
|
1637
|
+
token,
|
|
1638
|
+
quota
|
|
1639
|
+
})
|
|
1640
|
+
)
|
|
1641
|
+
})
|
|
1642
|
+
);
|
|
1643
|
+
if (creditAccount.debt > 0n) {
|
|
1644
|
+
calls.push(
|
|
1645
|
+
...this.#prepareDecreaseDebt({
|
|
1646
|
+
creditFacade,
|
|
1647
|
+
debt: creditAccount.debt
|
|
1648
|
+
})
|
|
1649
|
+
);
|
|
1650
|
+
}
|
|
1651
|
+
const hasAssets = creditAccount.assets.some(
|
|
1652
|
+
(asset) => asset.balance > 0n
|
|
1653
|
+
);
|
|
1654
|
+
if (hasAssets) {
|
|
1655
|
+
calls.push(
|
|
1656
|
+
this.#prepareWithdrawToken(
|
|
1657
|
+
creditFacade,
|
|
1658
|
+
underlyingToken,
|
|
1659
|
+
MAX_UINT256,
|
|
1660
|
+
withdrawTo
|
|
1661
|
+
)
|
|
1662
|
+
);
|
|
1663
|
+
}
|
|
1664
|
+
break;
|
|
1665
|
+
}
|
|
1666
|
+
default: {
|
|
1667
|
+
const _exhaustive = op;
|
|
1668
|
+
throw new Error(
|
|
1669
|
+
`assembleCaUpdateCalls: unsupported operation ${_exhaustive}`
|
|
1670
|
+
);
|
|
1671
|
+
}
|
|
1672
|
+
}
|
|
1673
|
+
}
|
|
1674
|
+
if (routerGroupsConsumed !== routerCallGroups.length) {
|
|
1675
|
+
throw new Error(
|
|
1676
|
+
`assembleCaUpdateCalls: router call group mismatch (consumed ${routerGroupsConsumed}, got ${routerCallGroups.length})`
|
|
1677
|
+
);
|
|
1678
|
+
}
|
|
1679
|
+
return calls;
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* {@inheritDoc ICreditAccountsService.executeCaUpdate}
|
|
1683
|
+
*/
|
|
1684
|
+
async executeCaUpdate(creditAccount, calls, options) {
|
|
1685
|
+
const cm = this.sdk.marketRegister.findCreditManager(
|
|
1686
|
+
creditAccount.creditManager
|
|
1687
|
+
);
|
|
1688
|
+
const callsWithPrices = await this.#prependPriceUpdates(
|
|
1689
|
+
creditAccount.creditManager,
|
|
1690
|
+
calls,
|
|
1691
|
+
creditAccount,
|
|
1692
|
+
{ ignoreReservePrices: options?.ignoreReservePrices }
|
|
1693
|
+
);
|
|
1694
|
+
const tx = await this.#multicallTx(
|
|
1695
|
+
cm,
|
|
1696
|
+
creditAccount.creditAccount,
|
|
1697
|
+
callsWithPrices
|
|
1698
|
+
);
|
|
1699
|
+
if (options?.ethAmount && options.ethAmount > 0n) {
|
|
1700
|
+
tx.value = options.ethAmount.toString(10);
|
|
1701
|
+
}
|
|
1702
|
+
return { tx, calls: callsWithPrices };
|
|
1703
|
+
}
|
|
1550
1704
|
#prepareDisableQuotas(ca) {
|
|
1551
1705
|
const calls = [];
|
|
1552
1706
|
for (const { token, quota } of ca.tokens) {
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { type Address, type Hex } from "viem";
|
|
2
|
+
/**
|
|
3
|
+
* A single frame from Ethereum's `debug_traceTransaction` callTracer output.
|
|
4
|
+
* Recursive: each frame may contain nested sub-calls.
|
|
5
|
+
*/
|
|
6
|
+
export interface CallTrace {
|
|
7
|
+
from: Address;
|
|
8
|
+
to: Address;
|
|
9
|
+
input: Hex;
|
|
10
|
+
output: Hex;
|
|
11
|
+
value: Hex;
|
|
12
|
+
/** "CALL", "DELEGATECALL", "STATICCALL", "CREATE", etc. */
|
|
13
|
+
type: string;
|
|
14
|
+
/** Present when the call reverted (e.g. "execution reverted"). */
|
|
15
|
+
error?: string;
|
|
16
|
+
/** ABI-encoded revert data, if available. */
|
|
17
|
+
revertReason?: Hex;
|
|
18
|
+
calls?: CallTrace[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Selector of `CreditManagerV3.execute(bytes)` (`0x09c5eabe`).
|
|
22
|
+
*
|
|
23
|
+
* This is the authoritative marker of an adapter performing an external
|
|
24
|
+
* protocol call: the adapter calls the credit manager's `execute(bytes)`, which
|
|
25
|
+
* forwards the calldata to the credit account, which in turn CALLs the target
|
|
26
|
+
* (protocol) contract. Adapter approvals use a different selector
|
|
27
|
+
* (`execute(address,bytes)` on the credit account), so matching on this
|
|
28
|
+
* selector isolates the real protocol call.
|
|
29
|
+
*/
|
|
30
|
+
export declare const EXECUTE_BYTES_SELECTOR: "0x09c5eabe";
|
|
31
|
+
/**
|
|
32
|
+
* Finds the shallowest non-reverted `CreditManager.execute(bytes)` call in a
|
|
33
|
+
* trace subtree (breadth-first), or `undefined` if none exists.
|
|
34
|
+
*
|
|
35
|
+
* "Shallowest" matters for account migration: a migrate adapter nests the
|
|
36
|
+
* entire target `openCreditAccount` multicall - including that account's own
|
|
37
|
+
* `execute(bytes)` calls - inside its subtree. The shallowest match is the
|
|
38
|
+
* adapter's own protocol call, not a nested one.
|
|
39
|
+
*/
|
|
40
|
+
export declare function findExecuteBytes(node: CallTrace): CallTrace | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* Finds the first non-reverted CALL in a subtree whose `input` exactly matches
|
|
43
|
+
* `input` (case-insensitive). Used to locate the leaf CALL to the target
|
|
44
|
+
* contract: `execute(bytes)` forwards the calldata unchanged through the credit
|
|
45
|
+
* account proxy DELEGATECALL down to the final CALL to the protocol contract.
|
|
46
|
+
*/
|
|
47
|
+
export declare function findCallWithInput(node: CallTrace, input: Hex): CallTrace | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* Resolves the external protocol call performed by an adapter-level call trace.
|
|
50
|
+
*
|
|
51
|
+
* Locates the shallowest `CreditManager.execute(bytes)`, decodes the forwarded
|
|
52
|
+
* calldata, then finds the leaf CALL whose input matches that calldata to
|
|
53
|
+
* recover the target (protocol) contract address. Returns `undefined` when the
|
|
54
|
+
* subtree does not actually reach an external protocol CALL (e.g. the
|
|
55
|
+
* facade-internal `depositPhantomToken` / `withdrawPhantomToken` accounting
|
|
56
|
+
* calls, which forward calldata but make no external CALL).
|
|
57
|
+
*
|
|
58
|
+
* @param node - direct child node of the upper-level facade call trace
|
|
59
|
+
*/
|
|
60
|
+
export declare function resolveProtocolCall(node: CallTrace): {
|
|
61
|
+
contract: Address;
|
|
62
|
+
calldata: Hex;
|
|
63
|
+
} | undefined;
|
|
64
|
+
/**
|
|
65
|
+
* Finds the first non-reverted CALL to `target` anywhere in a trace subtree.
|
|
66
|
+
*/
|
|
67
|
+
export declare function findCallTo(node: CallTrace, target: Address): CallTrace | undefined;
|
|
68
|
+
/**
|
|
69
|
+
* DFS walk of the call trace tree, collecting non-reverted CALL entries
|
|
70
|
+
* to the given address.
|
|
71
|
+
* Does not recurse into children of matched nodes
|
|
72
|
+
*/
|
|
73
|
+
export declare function collectTraces(node: CallTrace, target: Address): CallTrace[];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Address, PublicClient } from "viem";
|
|
2
|
+
/**
|
|
3
|
+
* Address is stable, contract deployed via create2
|
|
4
|
+
*/
|
|
5
|
+
export declare const ONCHAIN_EXECUTION_ID_ADDRESS: Address;
|
|
6
|
+
export type VerifyTestnetParams = {
|
|
7
|
+
executionId: string;
|
|
8
|
+
} | {
|
|
9
|
+
alias: string;
|
|
10
|
+
} | {
|
|
11
|
+
executionId: string;
|
|
12
|
+
alias: string;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Tries to read the contract that is deployed on every Gearbox testnet
|
|
16
|
+
* and verify that we're on expected testnet.
|
|
17
|
+
*
|
|
18
|
+
* Used to check that wallet is using correct RPC for the testnet.
|
|
19
|
+
*
|
|
20
|
+
* @param client - Public client
|
|
21
|
+
* @param expected - Expected tesnet alias or execution id
|
|
22
|
+
* @returns True if we're on expected testnet
|
|
23
|
+
*/
|
|
24
|
+
export declare function verifyTestnet(client: PublicClient, expected: VerifyTestnetParams): Promise<boolean>;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import type { Address } from "viem";
|
|
2
|
+
import type { TokenTransfer } from "../preview/parse/index.js";
|
|
3
|
+
import { type FacadeParsedCall, type WithdrawCollateralEventInfo } from "../preview/trace/index.js";
|
|
2
4
|
import type { AddressMap, ChainContractsRegister } from "../sdk/index.js";
|
|
3
|
-
import type {
|
|
4
|
-
import type { ExecuteResult, FacadeParsedCall } from "./internal-types.js";
|
|
5
|
-
import type { FacadeOperationMetadata, OuterFacadeOperation } from "./types.js";
|
|
5
|
+
import type { HistoryFacadeMetadata, OuterFacadeOperation } from "./types.js";
|
|
6
6
|
export interface AssembleOperationsInput {
|
|
7
7
|
facadeCalls: FacadeParsedCall[];
|
|
8
|
-
|
|
8
|
+
/**
|
|
9
|
+
* ERC-20 transfers grouped per facade `Execute` event, one inner array per
|
|
10
|
+
* Execute event across the whole transaction, in emission order. Sliced per
|
|
11
|
+
* facade call and consumed one inner array per adapter/unknown inner call.
|
|
12
|
+
*/
|
|
13
|
+
executeTransfers: TokenTransfer[][];
|
|
9
14
|
register: ChainContractsRegister;
|
|
10
15
|
underlying: Address;
|
|
11
16
|
liquidationRemainingFunds?: bigint;
|
|
@@ -17,8 +22,8 @@ export interface AssembleOperationsInput {
|
|
|
17
22
|
* Combines parsed facade calls with per-Execute transfer data into
|
|
18
23
|
* fully classified {@link OuterFacadeOperation} entries.
|
|
19
24
|
*
|
|
20
|
-
* The flat `
|
|
25
|
+
* The flat `executeTransfers` array (one inner array per Execute event across
|
|
21
26
|
* the entire transaction) is sliced per facade call based on how many
|
|
22
27
|
* adapter/unknown inner calls each one contains.
|
|
23
28
|
*/
|
|
24
|
-
export declare function assembleOperations(input: AssembleOperationsInput): Omit<OuterFacadeOperation, keyof
|
|
29
|
+
export declare function assembleOperations(input: AssembleOperationsInput): Omit<OuterFacadeOperation, keyof HistoryFacadeMetadata>[];
|
|
@@ -1,12 +1,23 @@
|
|
|
1
|
-
import { type Address
|
|
1
|
+
import { type Address } from "viem";
|
|
2
|
+
import type { CallTrace } from "../common-utils/utils/trace.js";
|
|
3
|
+
import type { TokenTransfer } from "../preview/parse/index.js";
|
|
4
|
+
import { type WithdrawCollateralEventInfo } from "../preview/trace/index.js";
|
|
2
5
|
import type { AddressMap, ChainContractsRegister, ParsedCallV2 } from "../sdk/index.js";
|
|
3
|
-
import type {
|
|
4
|
-
import type { InnerOperation } from "./inner-operations.js";
|
|
5
|
-
import type { ExecuteResult } from "./internal-types.js";
|
|
6
|
+
import type { InnerOperation } from "./types.js";
|
|
6
7
|
export interface ClassifyMulticallOperationsInput {
|
|
7
8
|
innerCalls: ParsedCallV2[];
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* ERC-20 transfers grouped per facade `Execute` event for this facade call,
|
|
11
|
+
* one inner array per Execute event, in order. One inner array is consumed
|
|
12
|
+
* per adapter/unknown inner call.
|
|
13
|
+
*/
|
|
14
|
+
executeTransfers: TokenTransfer[][];
|
|
15
|
+
/**
|
|
16
|
+
* Adapter-level call traces (one per Execute event, in order) used to recover
|
|
17
|
+
* the protocol-level call for adapter inner calls. See
|
|
18
|
+
* `extractAdapterCallTraces`.
|
|
19
|
+
*/
|
|
20
|
+
adapterTraces: CallTrace[];
|
|
10
21
|
register: ChainContractsRegister;
|
|
11
22
|
creditAccount: Address;
|
|
12
23
|
underlying: Address;
|
|
@@ -17,9 +28,10 @@ export interface ClassifyMulticallOperationsInput {
|
|
|
17
28
|
/**
|
|
18
29
|
* Classifies each multicall inner call into a {@link InnerOperation}:
|
|
19
30
|
*
|
|
20
|
-
* - **Adapter calls** (target registered as an adapter):
|
|
21
|
-
* `adapter.
|
|
22
|
-
*
|
|
31
|
+
* - **Adapter calls** (target registered as an adapter): decodes the
|
|
32
|
+
* protocol-level call via `adapter.parseProtocolCall()`, classifies the
|
|
33
|
+
* legacy operation via `adapter.classifyLegacyOperation()`, and consumes the
|
|
34
|
+
* next entry from `executeTransfers` (one Execute event per adapter call).
|
|
23
35
|
*
|
|
24
36
|
* - **Facade self-calls** (`increaseDebt`, `updateQuota`, etc.): mapped
|
|
25
37
|
* directly from `functionName` / `rawArgs`. No transfer consumed.
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import type { AdapterOperation } from "
|
|
2
|
-
import type { AddCollateralOp, DecreaseDebtOp, IncreaseDebtOp, UpdateQuotaOp, WithdrawCollateralOp } from "./inner-operations.js";
|
|
3
|
-
import type { CloseCreditAccountOperation, CreditAccountOperation, DirectTokenTransferOperation, FacadeOperationMetadata, LiquidateCreditAccountOperation, MulticallOperation, OpenCreditAccountOperation, PartialLiquidationOperation } from "./types.js";
|
|
1
|
+
import type { AdapterOperation, AddCollateralOp, CloseCreditAccountOperation, CreditAccountOperation, DecreaseDebtOp, DirectTokenTransferOperation, HistoryFacadeMetadata, IncreaseDebtOp, LiquidateCreditAccountOperation, MulticallOperation, OpenCreditAccountOperation, PartialLiquidationOperation, UpdateQuotaOp, WithdrawCollateralOp } from "./types.js";
|
|
4
2
|
/**
|
|
5
3
|
* Visitor that maps each operation node in a {@link CreditAccountOperation}
|
|
6
4
|
* tree to a new representation.
|
|
7
5
|
*
|
|
8
6
|
*/
|
|
9
7
|
export interface OperationVisitor<TInner, TOuter> {
|
|
10
|
-
Execute(op: AdapterOperation, ctx:
|
|
11
|
-
IncreaseBorrowedAmount(op: IncreaseDebtOp, ctx:
|
|
12
|
-
DecreaseBorrowedAmount(op: DecreaseDebtOp, ctx:
|
|
13
|
-
AddCollateral(op: AddCollateralOp, ctx:
|
|
14
|
-
WithdrawCollateral(op: WithdrawCollateralOp, ctx:
|
|
15
|
-
UpdateQuota(op: UpdateQuotaOp, ctx:
|
|
8
|
+
Execute(op: AdapterOperation, ctx: HistoryFacadeMetadata): TInner;
|
|
9
|
+
IncreaseBorrowedAmount(op: IncreaseDebtOp, ctx: HistoryFacadeMetadata): TInner;
|
|
10
|
+
DecreaseBorrowedAmount(op: DecreaseDebtOp, ctx: HistoryFacadeMetadata): TInner;
|
|
11
|
+
AddCollateral(op: AddCollateralOp, ctx: HistoryFacadeMetadata): TInner;
|
|
12
|
+
WithdrawCollateral(op: WithdrawCollateralOp, ctx: HistoryFacadeMetadata): TInner;
|
|
13
|
+
UpdateQuota(op: UpdateQuotaOp, ctx: HistoryFacadeMetadata): TInner;
|
|
16
14
|
DirectTokenTransfer(op: DirectTokenTransferOperation): TOuter;
|
|
17
15
|
MultiCall(op: MulticallOperation, multicall: TInner[]): TOuter;
|
|
18
16
|
OpenCreditAccount(op: OpenCreditAccountOperation, multicall: TInner[]): TOuter;
|
|
@@ -1,77 +1,28 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { InnerOperation } from "
|
|
1
|
+
import type { LegacyAdapterOperation } from "../plugins/adapters/index.js";
|
|
2
|
+
import type { AdapterOperation as BaseAdapterOperation, CloseCreditAccountOperation as BaseCloseCreditAccountOperation, DirectTokenTransferOperation as BaseDirectTokenTransferOperation, InnerOperation as BaseInnerOperation, LiquidateCreditAccountOperation as BaseLiquidateCreditAccountOperation, MulticallOperation as BaseMulticallOperation, OpenCreditAccountOperation as BaseOpenCreditAccountOperation, PartialLiquidationOperation as BasePartialLiquidationOperation, FacadeOperationMetadata, OperationMetadata, TraceAdapterExt } from "../preview/parse/index.js";
|
|
3
|
+
export type { AddCollateralOp, DecreaseDebtOp, FacadeOperationMetadata, IncreaseDebtOp, InnerFacadeOperation, OperationMetadata, UpdateQuotaOp, WithdrawCollateralOp, } from "../preview/parse/index.js";
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
* `
|
|
8
|
-
* top-up / deposit) has `to` == the credit account, an outbound transfer
|
|
9
|
-
* (direct withdrawal) has `from` == the credit account.
|
|
5
|
+
* History-specific adapter-operation extension: trace-derived data
|
|
6
|
+
* ({@link TraceAdapterExt}) plus the backward-compatible `legacy` classification
|
|
7
|
+
* used by charts_server serialization. The `legacy` field lives only in
|
|
8
|
+
* `history`; the base `preview` operations carry no `legacy`.
|
|
10
9
|
*/
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
to: Address;
|
|
15
|
-
amount: bigint;
|
|
16
|
-
}
|
|
17
|
-
export interface OperationMetadata {
|
|
18
|
-
txHash: Hex;
|
|
19
|
-
blockNumber: number;
|
|
20
|
-
timestamp: number;
|
|
21
|
-
}
|
|
22
|
-
export interface FacadeOperationMetadata extends OperationMetadata {
|
|
23
|
-
creditManager: Address;
|
|
24
|
-
creditFacade: Address;
|
|
25
|
-
}
|
|
26
|
-
export interface MulticallOperation extends FacadeOperationMetadata {
|
|
27
|
-
operation: "MultiCall" | "BotMulticall";
|
|
28
|
-
creditAccount: Address;
|
|
29
|
-
multicall: InnerOperation[];
|
|
30
|
-
}
|
|
31
|
-
export interface OpenCreditAccountOperation extends FacadeOperationMetadata {
|
|
32
|
-
operation: "OpenCreditAccount";
|
|
33
|
-
creditAccount: Address;
|
|
34
|
-
onBehalfOf: Address;
|
|
35
|
-
referralCode: bigint;
|
|
36
|
-
multicall: InnerOperation[];
|
|
37
|
-
}
|
|
38
|
-
export interface CloseCreditAccountOperation extends FacadeOperationMetadata {
|
|
39
|
-
operation: "CloseCreditAccount";
|
|
40
|
-
creditAccount: Address;
|
|
41
|
-
multicall: InnerOperation[];
|
|
42
|
-
}
|
|
43
|
-
export interface LiquidateCreditAccountOperation extends FacadeOperationMetadata {
|
|
44
|
-
operation: "LiquidateCreditAccount";
|
|
45
|
-
creditAccount: Address;
|
|
46
|
-
to: Address;
|
|
47
|
-
token: Address;
|
|
48
|
-
remainingFunds: bigint;
|
|
49
|
-
multicall: InnerOperation[];
|
|
50
|
-
}
|
|
51
|
-
export interface PartialLiquidationOperation extends FacadeOperationMetadata {
|
|
52
|
-
operation: "PartiallyLiquidateCreditAccount";
|
|
53
|
-
creditAccount: Address;
|
|
54
|
-
token: Address;
|
|
55
|
-
repaidAmount: bigint;
|
|
56
|
-
minSeizedAmount: bigint;
|
|
57
|
-
to: Address;
|
|
58
|
-
}
|
|
59
|
-
export interface DirectTokenTransferOperation extends OperationMetadata {
|
|
60
|
-
operation: "DirectTokenTransfer";
|
|
61
|
-
protocol: Address;
|
|
62
|
-
token: Address;
|
|
63
|
-
from: Address;
|
|
64
|
-
to: Address;
|
|
65
|
-
creditAccount: Address;
|
|
66
|
-
amount: bigint;
|
|
67
|
-
}
|
|
10
|
+
export type HistoryAdapterExt = TraceAdapterExt & {
|
|
11
|
+
legacy: LegacyAdapterOperation;
|
|
12
|
+
};
|
|
68
13
|
/**
|
|
69
|
-
*
|
|
70
|
-
*
|
|
14
|
+
* Facade context available in `history` mode: the base facade metadata
|
|
15
|
+
* (`creditManager`/`creditFacade`) plus the transaction-level
|
|
16
|
+
* {@link OperationMetadata} that is only known once the transaction is mined.
|
|
71
17
|
*/
|
|
18
|
+
export type HistoryFacadeMetadata = FacadeOperationMetadata & OperationMetadata;
|
|
19
|
+
export type AdapterOperation = BaseAdapterOperation<HistoryAdapterExt>;
|
|
20
|
+
export type InnerOperation = BaseInnerOperation<HistoryAdapterExt>;
|
|
21
|
+
export type MulticallOperation = Omit<BaseMulticallOperation<HistoryAdapterExt>, "expectedBalanceChanges"> & OperationMetadata;
|
|
22
|
+
export type OpenCreditAccountOperation = Omit<BaseOpenCreditAccountOperation<HistoryAdapterExt>, "expectedBalanceChanges"> & OperationMetadata;
|
|
23
|
+
export type CloseCreditAccountOperation = Omit<BaseCloseCreditAccountOperation<HistoryAdapterExt>, "expectedBalanceChanges"> & OperationMetadata;
|
|
24
|
+
export type LiquidateCreditAccountOperation = Omit<BaseLiquidateCreditAccountOperation<HistoryAdapterExt>, "expectedBalanceChanges"> & OperationMetadata;
|
|
25
|
+
export type PartialLiquidationOperation = BasePartialLiquidationOperation & OperationMetadata;
|
|
26
|
+
export type DirectTokenTransferOperation = BaseDirectTokenTransferOperation & OperationMetadata;
|
|
72
27
|
export type OuterFacadeOperation = MulticallOperation | OpenCreditAccountOperation | CloseCreditAccountOperation | LiquidateCreditAccountOperation | PartialLiquidationOperation;
|
|
73
|
-
/**
|
|
74
|
-
* Discriminated union of all credit account operation types
|
|
75
|
-
* (facade operations + direct token transfers).
|
|
76
|
-
*/
|
|
77
28
|
export type CreditAccountOperation = OuterFacadeOperation | DirectTokenTransferOperation;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { type Abi, type Address
|
|
1
|
+
import { type Abi, type Address } from "viem";
|
|
2
|
+
import { type CallTrace } from "../../../common-utils/utils/trace.js";
|
|
2
3
|
import type { ConstructOptions, ParsedCallV2, RelaxedBaseParams } from "../../../sdk/index.js";
|
|
3
4
|
import { BaseContract } from "../../../sdk/index.js";
|
|
4
5
|
import type { LegacyAdapterOperation, Transfers } from "../legacyAdapterOperations.js";
|
|
5
|
-
import type { AdapterContractStateHuman, AdapterContractType,
|
|
6
|
+
import type { AdapterContractStateHuman, AdapterContractType, AdapterProtocolOperation } from "../types.js";
|
|
6
7
|
export interface ConcreteAdapterContractOptions {
|
|
7
8
|
baseParams: RelaxedBaseParams;
|
|
8
9
|
}
|
|
@@ -22,23 +23,19 @@ export declare class AbstractAdapterContract<const abi extends Abi | readonly un
|
|
|
22
23
|
get adapterType(): AdapterContractType;
|
|
23
24
|
stateHuman(raw?: boolean): AdapterContractStateHuman;
|
|
24
25
|
/**
|
|
25
|
-
*
|
|
26
|
+
* Decodes the protocol-level call (target contract + function name + args)
|
|
27
|
+
* performed by this adapter, recovered from its adapter-level call trace.
|
|
26
28
|
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
+
* Both the `targetContract` and the protocol calldata are taken from the
|
|
30
|
+
* execution trace.
|
|
29
31
|
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
* Decodes protocol-level function name and args from the raw calldata
|
|
36
|
-
* sent to targetContract.
|
|
32
|
+
* Returns `undefined` (in non-strict mode) when no external protocol call can
|
|
33
|
+
* be recovered, in strict mode throws instead.
|
|
34
|
+
*
|
|
35
|
+
* @param trace Adapter-level call trace (a direct child of the facade trace)
|
|
36
|
+
* @param strict When true, throws instead of returning `undefined`
|
|
37
37
|
*/
|
|
38
|
-
|
|
39
|
-
protocolFunctionName: string;
|
|
40
|
-
protocolArgs: Record<string, unknown>;
|
|
41
|
-
};
|
|
38
|
+
parseProtocolCall(trace: CallTrace, strict?: boolean): AdapterProtocolOperation | undefined;
|
|
42
39
|
/**
|
|
43
40
|
* Classifies an adapter call into a {@link LegacyAdapterOperation} using the
|
|
44
41
|
* parsed call and credit-account transfer deltas.
|
|
@@ -50,6 +47,8 @@ export declare class AbstractAdapterContract<const abi extends Abi | readonly un
|
|
|
50
47
|
* Override in protocol-specific subclasses for richer classification.
|
|
51
48
|
*
|
|
52
49
|
* @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/account_operation.go#L238-L264
|
|
50
|
+
*
|
|
51
|
+
* @deprecated Eventually will be gone, exists to produce output that legacy UI can display
|
|
53
52
|
*/
|
|
54
|
-
|
|
53
|
+
classifyLegacyOperation(_parsed: ParsedCallV2, transfers: Transfers): LegacyAdapterOperation;
|
|
55
54
|
}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import type { CallTrace } from "../../../common-utils/utils/trace.js";
|
|
1
2
|
import type { ConstructOptions, ParsedCallV2 } from "../../../sdk/index.js";
|
|
2
3
|
import type { LegacyAdapterOperation, Transfers } from "../legacyAdapterOperations.js";
|
|
4
|
+
import type { AdapterProtocolOperation } from "../types.js";
|
|
3
5
|
import type { ConcreteAdapterContractOptions } from "./AbstractAdapter.js";
|
|
4
6
|
import { AbstractAdapterContract } from "./AbstractAdapter.js";
|
|
5
7
|
declare const abi: readonly [{
|
|
@@ -467,6 +469,13 @@ type protocolAbi = typeof protocolAbi;
|
|
|
467
469
|
export declare class AccountMigratorAdapterContract extends AbstractAdapterContract<abi, protocolAbi> {
|
|
468
470
|
constructor(options: ConstructOptions, args: ConcreteAdapterContractOptions);
|
|
469
471
|
/** Legacy adapter not present in integrations-v3. */
|
|
470
|
-
|
|
472
|
+
classifyLegacyOperation(_parsed: ParsedCallV2, _transfers: Transfers): LegacyAdapterOperation;
|
|
473
|
+
/**
|
|
474
|
+
* The account-migrator adapter's `execute` targets the migrator bot, not an
|
|
475
|
+
* external protocol, so there is no protocol-level call to recover. Returning
|
|
476
|
+
* `undefined` keeps the `protocol` field aligned with its external-protocol
|
|
477
|
+
* semantics (see {@link TraceAdapterExt}).
|
|
478
|
+
*/
|
|
479
|
+
parseProtocolCall(_trace: CallTrace, _strict?: boolean): AdapterProtocolOperation | undefined;
|
|
471
480
|
}
|
|
472
481
|
export {};
|
|
@@ -689,6 +689,6 @@ export declare class ConvexV1BaseRewardPoolAdapterContract extends AbstractAdapt
|
|
|
689
689
|
* @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type.go#L200-L262
|
|
690
690
|
* @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type_v3.go#L76-L83
|
|
691
691
|
*/
|
|
692
|
-
|
|
692
|
+
classifyLegacyOperation(parsed: ParsedCallV2, transfers: Transfers): LegacyAdapterOperation;
|
|
693
693
|
}
|
|
694
694
|
export {};
|
|
@@ -420,6 +420,6 @@ export declare class ConvexV1BoosterAdapterContract extends AbstractAdapterContr
|
|
|
420
420
|
* @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type.go#L166-L199
|
|
421
421
|
* @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type_v3.go#L84-L91
|
|
422
422
|
*/
|
|
423
|
-
|
|
423
|
+
classifyLegacyOperation(parsed: ParsedCallV2, transfers: Transfers): LegacyAdapterOperation;
|
|
424
424
|
}
|
|
425
425
|
export {};
|
|
@@ -1776,6 +1776,6 @@ export declare class Curve2AssetsAdapterContract extends AbstractAdapterContract
|
|
|
1776
1776
|
contractType?: string;
|
|
1777
1777
|
};
|
|
1778
1778
|
/** @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type.go#L132-L164 */
|
|
1779
|
-
|
|
1779
|
+
classifyLegacyOperation(parsed: ParsedCallV2, transfers: Transfers): LegacyAdapterOperation;
|
|
1780
1780
|
}
|
|
1781
1781
|
export {};
|
|
@@ -1776,6 +1776,6 @@ export declare class Curve3AssetsAdapterContract extends AbstractAdapterContract
|
|
|
1776
1776
|
contractType?: string;
|
|
1777
1777
|
};
|
|
1778
1778
|
/** @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type.go#L132-L164 */
|
|
1779
|
-
|
|
1779
|
+
classifyLegacyOperation(parsed: ParsedCallV2, transfers: Transfers): LegacyAdapterOperation;
|
|
1780
1780
|
}
|
|
1781
1781
|
export {};
|
|
@@ -1776,6 +1776,6 @@ export declare class Curve4AssetsAdapterContract extends AbstractAdapterContract
|
|
|
1776
1776
|
contractType?: string;
|
|
1777
1777
|
};
|
|
1778
1778
|
/** @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type.go#L132-L164 */
|
|
1779
|
-
|
|
1779
|
+
classifyLegacyOperation(parsed: ParsedCallV2, transfers: Transfers): LegacyAdapterOperation;
|
|
1780
1780
|
}
|
|
1781
1781
|
export {};
|
|
@@ -1040,6 +1040,6 @@ export declare class CurveV1AdapterDeposit extends AbstractAdapterContract<abi,
|
|
|
1040
1040
|
get tokens(): [Address, Address, Address, Address];
|
|
1041
1041
|
get underlyings(): [Address, Address, Address, Address];
|
|
1042
1042
|
/** Legacy adapter not present in integrations-v3. Go: Curve operations via operation_type.go L132-L164 */
|
|
1043
|
-
|
|
1043
|
+
classifyLegacyOperation(_parsed: ParsedCallV2, _transfers: Transfers): LegacyAdapterOperation;
|
|
1044
1044
|
}
|
|
1045
1045
|
export {};
|
|
@@ -1763,6 +1763,6 @@ export declare class CurveV1AdapterStETHContract extends AbstractAdapterContract
|
|
|
1763
1763
|
get use256(): boolean;
|
|
1764
1764
|
get tokens(): [Address, Address];
|
|
1765
1765
|
/** @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type.go#L132-L164 */
|
|
1766
|
-
|
|
1766
|
+
classifyLegacyOperation(parsed: ParsedCallV2, transfers: Transfers): LegacyAdapterOperation;
|
|
1767
1767
|
}
|
|
1768
1768
|
export {};
|
|
@@ -1746,6 +1746,6 @@ export declare class CurveV1StableNGAdapterContract extends AbstractAdapterContr
|
|
|
1746
1746
|
contractType?: string;
|
|
1747
1747
|
};
|
|
1748
1748
|
/** @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type.go#L132-L164 */
|
|
1749
|
-
|
|
1749
|
+
classifyLegacyOperation(parsed: ParsedCallV2, transfers: Transfers): LegacyAdapterOperation;
|
|
1750
1750
|
}
|
|
1751
1751
|
export {};
|
|
@@ -204,6 +204,6 @@ export declare class DaiUsdsAdapterContract extends AbstractAdapterContract<abi,
|
|
|
204
204
|
contractType?: string;
|
|
205
205
|
};
|
|
206
206
|
/** @see https://github.com/Gearbox-protocol/charts_server/blob/master/core/operation_type_v3.go#L51-L68 */
|
|
207
|
-
|
|
207
|
+
classifyLegacyOperation(parsed: ParsedCallV2, transfers: Transfers): LegacyAdapterOperation;
|
|
208
208
|
}
|
|
209
209
|
export {};
|