@gearbox-protocol/sdk 15.1.0-next.8 → 15.1.0-next.9
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/creditAccount/get-time-to-liquidation.js +3 -1
- package/dist/cjs/sdk/accounts/intents/intents/resume/add-collateral/add-collateral.fixtures.js +23 -23
- package/dist/cjs/sdk/accounts/intents/intents/resume/close/close.fixtures.js +14 -14
- package/dist/cjs/sdk/accounts/intents/intents/resume/decrease-leverage/decrease-leverage.fixtures.js +12 -12
- package/dist/cjs/sdk/accounts/intents/intents/resume/deposit/deposit.fixtures.js +17 -17
- package/dist/cjs/sdk/accounts/intents/intents/resume/increase-leverage/increase-leverage.fixtures.js +12 -12
- package/dist/cjs/sdk/accounts/intents/intents/resume/withdraw/withdraw.fixtures.js +9 -9
- package/dist/cjs/sdk/accounts/intents/testing/resume.js +3 -18
- package/dist/cjs/sdk/accounts/intents/testing/sdk-mock.js +0 -1
- package/dist/cjs/sdk/positions/calcTimeToLiquidationMs.js +6 -5
- package/dist/esm/common-utils/utils/creditAccount/get-time-to-liquidation.js +3 -1
- package/dist/esm/dev/AccountOpener.js +1 -1
- package/dist/esm/dev/withdrawalUtils.js +1 -1
- package/dist/esm/plugins/adapters/contracts/ERC4626AdapterContract.js +1 -1
- 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/intents/testing/resume.js +1 -13
- package/dist/esm/sdk/accounts/liquidations/LiquidationsService.js +1 -1
- 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 +3 -3
- 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/positions/calcTimeToLiquidationMs.js +7 -6
- package/dist/esm/sdk/utils/viem/simulateWithPriceUpdates.js +1 -1
- package/dist/types/common-utils/utils/creditAccount/get-time-to-liquidation.d.ts +3 -1
- package/dist/types/sdk/accounts/intents/testing/expect.d.ts +1 -1
- package/dist/types/sdk/accounts/intents/testing/resume.d.ts +1 -1
- package/dist/types/sdk/positions/calcTimeToLiquidationMs.d.ts +5 -4
- package/package.json +1 -1
- package/dist/cjs/sdk/accounts/intents/testing/expect.js +0 -167
- package/dist/esm/sdk/accounts/intents/testing/expect.js +0 -162
- package/dist/types/sdk/accounts/intents/testing/sdk-mock.d.ts +0 -96
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { MultiCall } from "../../../types/transactions.js";
|
|
2
|
-
import { OnchainSDK } from "../../../OnchainSDK.js";
|
|
3
|
-
import "../../../index.js";
|
|
4
|
-
import { Address } from "viem";
|
|
5
|
-
//#region src/sdk/accounts/intents/testing/sdk-mock.d.ts
|
|
6
|
-
/**
|
|
7
|
-
* Test kit for intent-service specs.
|
|
8
|
-
*
|
|
9
|
-
* The service resolves all market data through `OnchainSDK`
|
|
10
|
-
* (`marketRegister`, `tokensMeta`, `accounts`). `buildMockSdk` builds a mock
|
|
11
|
-
* from plain records; assemble mocks ECHO recognizable sentinel calls derived
|
|
12
|
-
* from their inputs, so `result.instant.calls` pins down which ops reached the
|
|
13
|
-
* assembler and in which order.
|
|
14
|
-
*/
|
|
15
|
-
/** Fixture `claimableWithdrawal.claimCalls` content; echoes through claim ops. */
|
|
16
|
-
declare const MOCK_CLAIM_CALL: MultiCall;
|
|
17
|
-
/** Recognizable router call embedded in close path results. */
|
|
18
|
-
declare const MOCK_ROUTER_CALL: MultiCall;
|
|
19
|
-
/** Returned by the `getRWAWrapCalls` mock; passes through per wrap op. */
|
|
20
|
-
declare const MOCK_RWA_WRAP_CALL: MultiCall;
|
|
21
|
-
/** Router-produced call for an RWA underlying → asset unwrap leg. */
|
|
22
|
-
declare const MOCK_RWA_UNWRAP_CALL: MultiCall;
|
|
23
|
-
/** Returned by the `assembleCloseCreditAccountCalls` mock. */
|
|
24
|
-
declare const MOCK_CLOSE_CALL: MultiCall;
|
|
25
|
-
/** One sentinel call per plain encodable op type. */
|
|
26
|
-
declare const CA_OP_CALLS: {
|
|
27
|
-
readonly addCollateral: {
|
|
28
|
-
readonly target: Address;
|
|
29
|
-
readonly callData: "0x";
|
|
30
|
-
};
|
|
31
|
-
readonly increaseDebt: {
|
|
32
|
-
readonly target: Address;
|
|
33
|
-
readonly callData: "0x";
|
|
34
|
-
};
|
|
35
|
-
readonly decreaseDebt: {
|
|
36
|
-
readonly target: Address;
|
|
37
|
-
readonly callData: "0x";
|
|
38
|
-
};
|
|
39
|
-
readonly withdrawCollateral: {
|
|
40
|
-
readonly target: Address;
|
|
41
|
-
readonly callData: "0x";
|
|
42
|
-
};
|
|
43
|
-
readonly changeQuota: {
|
|
44
|
-
readonly target: Address;
|
|
45
|
-
readonly callData: "0x";
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
interface MockQuotaEntry {
|
|
49
|
-
token: Address;
|
|
50
|
-
rate: bigint;
|
|
51
|
-
limit: bigint;
|
|
52
|
-
totalQuoted?: bigint;
|
|
53
|
-
quotaIncreaseFee?: bigint;
|
|
54
|
-
isActive: boolean;
|
|
55
|
-
}
|
|
56
|
-
interface BuildMockSdkArgs {
|
|
57
|
-
/** Price per token (PRICE_DECIMALS_POW-scaled), like legacy `prices`. */
|
|
58
|
-
prices: Record<Address, bigint>;
|
|
59
|
-
/** Token decimals; used by `tokensMeta` and the price conversion. */
|
|
60
|
-
decimals: Record<Address, number>;
|
|
61
|
-
/** Pool quota params (AddressMap values shape). */
|
|
62
|
-
quotas: Record<Address, MockQuotaEntry>;
|
|
63
|
-
liquidationThresholds: Record<Address, number>;
|
|
64
|
-
maxDebt: bigint;
|
|
65
|
-
/** Facade `minDebt`; defaults to 0n so debt-range checks stay opt-in. */
|
|
66
|
-
minDebt?: bigint;
|
|
67
|
-
/** Pool base rate in ray; feeds `calcBorrowApy` of position metrics. */
|
|
68
|
-
baseInterestRate?: bigint;
|
|
69
|
-
/** Credit manager interest fee in Bps; feeds position metrics. */
|
|
70
|
-
feeInterest?: number;
|
|
71
|
-
creditManager: Address;
|
|
72
|
-
creditFacade: Address;
|
|
73
|
-
/** Market underlying token (`market.pool.underlying`). */
|
|
74
|
-
underlying: Address;
|
|
75
|
-
/**
|
|
76
|
-
* Close resume: router `findBestClosePath` result. When set, the mock
|
|
77
|
-
* provides `routerFor` and `assembleCloseCreditAccountCalls`.
|
|
78
|
-
*/
|
|
79
|
-
closePath?: {
|
|
80
|
-
amount: bigint;
|
|
81
|
-
minAmount: bigint;
|
|
82
|
-
underlyingBalance: bigint;
|
|
83
|
-
calls: MultiCall[];
|
|
84
|
-
};
|
|
85
|
-
/** RWA markets: underlying → rwa.asset (`tokensMeta.rwaUnderlyings`). */
|
|
86
|
-
rwaAssets?: Record<Address, Address>;
|
|
87
|
-
}
|
|
88
|
-
/**
|
|
89
|
-
* Mock `OnchainSDK` covering exactly what the intent-service touches:
|
|
90
|
-
* price conversion, quota params, CM/facade lookup and call assembly.
|
|
91
|
-
* Conversion mirrors the legacy price-based math:
|
|
92
|
-
* `amount * price[from] * 10^dec(to) / (price[to] * 10^dec(from))`.
|
|
93
|
-
*/
|
|
94
|
-
declare function buildMockSdk(args: BuildMockSdkArgs): OnchainSDK;
|
|
95
|
-
//#endregion
|
|
96
|
-
export { CA_OP_CALLS, MOCK_CLAIM_CALL, MOCK_CLOSE_CALL, MOCK_ROUTER_CALL, MOCK_RWA_UNWRAP_CALL, MOCK_RWA_WRAP_CALL, MockQuotaEntry, buildMockSdk };
|