@gearbox-protocol/sdk 14.12.0-next.54 → 14.12.0-next.55
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/abi/rwa/iMidasLiquidatorV311.js +96 -0
- package/dist/cjs/abi/rwa/iSecuritizeLiquidatorV311.js +111 -0
- package/dist/cjs/sdk/base/BaseContract.js +26 -0
- package/dist/cjs/sdk/base/ChainContractsRegister.js +24 -0
- package/dist/cjs/sdk/index.js +12 -1
- package/dist/cjs/sdk/market/credit/CreditFacadeV310BaseContract.js +3 -3
- package/dist/cjs/sdk/market/index.js +7 -0
- package/dist/cjs/sdk/market/rwa/index.js +8 -0
- package/dist/cjs/sdk/market/rwa/midas/MidasLiquidator.js +43 -0
- package/dist/cjs/sdk/market/rwa/midas/constants.js +5 -0
- package/dist/cjs/sdk/market/rwa/midas/index.js +5 -0
- package/dist/cjs/sdk/market/rwa/securitize/SecuritizeLiquidator.js +31 -0
- package/dist/cjs/sdk/market/rwa/securitize/constants.js +2 -0
- package/dist/cjs/sdk/market/rwa/securitize/index.js +3 -0
- package/dist/cjs/sdk/utils/viem/cast.js +20 -15
- package/dist/cjs/sdk/utils/viem/index.js +4 -0
- package/dist/cjs/sdk/utils/viem/simulateCall.js +82 -0
- package/dist/esm/abi/rwa/iMidasLiquidatorV311.js +95 -0
- package/dist/esm/abi/rwa/iSecuritizeLiquidatorV311.js +110 -0
- package/dist/esm/permissionless/bindings/factory/credit-factory.js +1 -1
- package/dist/esm/preview/index.js +5 -5
- package/dist/esm/sdk/base/BaseContract.js +26 -0
- package/dist/esm/sdk/base/ChainContractsRegister.js +24 -0
- package/dist/esm/sdk/index.js +7 -3
- package/dist/esm/sdk/market/credit/CreditFacadeV310BaseContract.js +3 -3
- package/dist/esm/sdk/market/index.js +5 -2
- package/dist/esm/sdk/market/rwa/index.js +6 -2
- package/dist/esm/sdk/market/rwa/midas/MidasLiquidator.js +43 -0
- package/dist/esm/sdk/market/rwa/midas/constants.js +4 -0
- package/dist/esm/sdk/market/rwa/midas/index.js +3 -0
- package/dist/esm/sdk/market/rwa/securitize/SecuritizeLiquidator.js +31 -0
- package/dist/esm/sdk/market/rwa/securitize/constants.js +2 -1
- package/dist/esm/sdk/market/rwa/securitize/index.js +3 -2
- package/dist/esm/sdk/utils/viem/cast.js +20 -16
- package/dist/esm/sdk/utils/viem/index.js +3 -2
- package/dist/esm/sdk/utils/viem/simulateCall.js +80 -0
- package/dist/types/abi/rwa/iMidasLiquidatorV311.d.ts +83 -0
- package/dist/types/abi/rwa/iSecuritizeLiquidatorV311.d.ts +95 -0
- package/dist/types/sdk/base/BaseContract.d.ts +13 -0
- package/dist/types/sdk/base/ChainContractsRegister.d.ts +15 -0
- package/dist/types/sdk/index.d.ts +7 -3
- package/dist/types/sdk/market/index.d.ts +5 -2
- package/dist/types/sdk/market/rwa/index.d.ts +6 -2
- package/dist/types/sdk/market/rwa/midas/MidasLiquidator.d.ts +93 -0
- package/dist/types/sdk/market/rwa/midas/constants.d.ts +4 -0
- package/dist/types/sdk/market/rwa/midas/index.d.ts +3 -0
- package/dist/types/sdk/market/rwa/securitize/SecuritizeLiquidator.d.ts +104 -0
- package/dist/types/sdk/market/rwa/securitize/constants.d.ts +2 -1
- package/dist/types/sdk/market/rwa/securitize/index.d.ts +3 -2
- package/dist/types/sdk/utils/viem/cast.d.ts +6 -1
- package/dist/types/sdk/utils/viem/index.d.ts +3 -2
- package/dist/types/sdk/utils/viem/simulateCall.d.ts +57 -0
- package/package.json +1 -1
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/abi/rwa/iMidasLiquidatorV311.ts
|
|
3
|
+
const iMidasLiquidatorV311Abi = [
|
|
4
|
+
{
|
|
5
|
+
type: "function",
|
|
6
|
+
name: "contractType",
|
|
7
|
+
inputs: [],
|
|
8
|
+
outputs: [{
|
|
9
|
+
name: "",
|
|
10
|
+
type: "bytes32",
|
|
11
|
+
internalType: "bytes32"
|
|
12
|
+
}],
|
|
13
|
+
stateMutability: "view"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
type: "function",
|
|
17
|
+
name: "isTransferAllowed",
|
|
18
|
+
inputs: [{
|
|
19
|
+
name: "redeemerOwner",
|
|
20
|
+
type: "address",
|
|
21
|
+
internalType: "address"
|
|
22
|
+
}],
|
|
23
|
+
outputs: [{
|
|
24
|
+
name: "",
|
|
25
|
+
type: "bool",
|
|
26
|
+
internalType: "bool"
|
|
27
|
+
}],
|
|
28
|
+
stateMutability: "view"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: "function",
|
|
32
|
+
name: "liquidateWithRedeemerTransfers",
|
|
33
|
+
inputs: [
|
|
34
|
+
{
|
|
35
|
+
name: "creditAccount",
|
|
36
|
+
type: "address",
|
|
37
|
+
internalType: "address"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "gateway",
|
|
41
|
+
type: "address",
|
|
42
|
+
internalType: "address"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "calls",
|
|
46
|
+
type: "tuple[]",
|
|
47
|
+
internalType: "struct MultiCall[]",
|
|
48
|
+
components: [{
|
|
49
|
+
name: "target",
|
|
50
|
+
type: "address",
|
|
51
|
+
internalType: "address"
|
|
52
|
+
}, {
|
|
53
|
+
name: "callData",
|
|
54
|
+
type: "bytes",
|
|
55
|
+
internalType: "bytes"
|
|
56
|
+
}]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "lossPolicyData",
|
|
60
|
+
type: "bytes",
|
|
61
|
+
internalType: "bytes"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
outputs: [],
|
|
65
|
+
stateMutability: "nonpayable"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: "function",
|
|
69
|
+
name: "transferableRedeemerOwner",
|
|
70
|
+
inputs: [],
|
|
71
|
+
outputs: [{
|
|
72
|
+
name: "",
|
|
73
|
+
type: "address",
|
|
74
|
+
internalType: "address"
|
|
75
|
+
}],
|
|
76
|
+
stateMutability: "view"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: "function",
|
|
80
|
+
name: "version",
|
|
81
|
+
inputs: [],
|
|
82
|
+
outputs: [{
|
|
83
|
+
name: "",
|
|
84
|
+
type: "uint256",
|
|
85
|
+
internalType: "uint256"
|
|
86
|
+
}],
|
|
87
|
+
stateMutability: "view"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: "error",
|
|
91
|
+
name: "NotValidGatewayException",
|
|
92
|
+
inputs: []
|
|
93
|
+
}
|
|
94
|
+
];
|
|
95
|
+
//#endregion
|
|
96
|
+
exports.iMidasLiquidatorV311Abi = iMidasLiquidatorV311Abi;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
//#region src/abi/rwa/iSecuritizeLiquidatorV311.ts
|
|
3
|
+
const iSecuritizeLiquidatorV311Abi = [
|
|
4
|
+
{
|
|
5
|
+
type: "function",
|
|
6
|
+
name: "contractType",
|
|
7
|
+
inputs: [],
|
|
8
|
+
outputs: [{
|
|
9
|
+
name: "",
|
|
10
|
+
type: "bytes32",
|
|
11
|
+
internalType: "bytes32"
|
|
12
|
+
}],
|
|
13
|
+
stateMutability: "view"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
type: "function",
|
|
17
|
+
name: "isTransferAllowed",
|
|
18
|
+
inputs: [{
|
|
19
|
+
name: "redeemerOwner",
|
|
20
|
+
type: "address",
|
|
21
|
+
internalType: "address"
|
|
22
|
+
}],
|
|
23
|
+
outputs: [{
|
|
24
|
+
name: "",
|
|
25
|
+
type: "bool",
|
|
26
|
+
internalType: "bool"
|
|
27
|
+
}],
|
|
28
|
+
stateMutability: "view"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
type: "function",
|
|
32
|
+
name: "liquidatePendingRedemption",
|
|
33
|
+
inputs: [
|
|
34
|
+
{
|
|
35
|
+
name: "creditAccount",
|
|
36
|
+
type: "address",
|
|
37
|
+
internalType: "address"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "redemptionGateway",
|
|
41
|
+
type: "address",
|
|
42
|
+
internalType: "address"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: "priceUpdates",
|
|
46
|
+
type: "tuple[]",
|
|
47
|
+
internalType: "struct PriceUpdate[]",
|
|
48
|
+
components: [{
|
|
49
|
+
name: "priceFeed",
|
|
50
|
+
type: "address",
|
|
51
|
+
internalType: "address"
|
|
52
|
+
}, {
|
|
53
|
+
name: "data",
|
|
54
|
+
type: "bytes",
|
|
55
|
+
internalType: "bytes"
|
|
56
|
+
}]
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: "lossPolicyData",
|
|
60
|
+
type: "bytes",
|
|
61
|
+
internalType: "bytes"
|
|
62
|
+
}
|
|
63
|
+
],
|
|
64
|
+
outputs: [],
|
|
65
|
+
stateMutability: "nonpayable"
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
type: "function",
|
|
69
|
+
name: "transferableRedeemerOwner",
|
|
70
|
+
inputs: [],
|
|
71
|
+
outputs: [{
|
|
72
|
+
name: "",
|
|
73
|
+
type: "address",
|
|
74
|
+
internalType: "address"
|
|
75
|
+
}],
|
|
76
|
+
stateMutability: "view"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
type: "function",
|
|
80
|
+
name: "version",
|
|
81
|
+
inputs: [],
|
|
82
|
+
outputs: [{
|
|
83
|
+
name: "",
|
|
84
|
+
type: "uint256",
|
|
85
|
+
internalType: "uint256"
|
|
86
|
+
}],
|
|
87
|
+
stateMutability: "view"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
type: "error",
|
|
91
|
+
name: "AccountHasSufficientLiquidityException",
|
|
92
|
+
inputs: []
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
type: "error",
|
|
96
|
+
name: "NotValidGatewayException",
|
|
97
|
+
inputs: []
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
type: "error",
|
|
101
|
+
name: "StableCoinIsNotConvertibleException",
|
|
102
|
+
inputs: []
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
type: "error",
|
|
106
|
+
name: "UnknownCreditAccountException",
|
|
107
|
+
inputs: []
|
|
108
|
+
}
|
|
109
|
+
];
|
|
110
|
+
//#endregion
|
|
111
|
+
exports.iSecuritizeLiquidatorV311Abi = iSecuritizeLiquidatorV311Abi;
|
|
@@ -5,6 +5,7 @@ const require_sdk_utils_abi_decode = require("../utils/abi-decode.js");
|
|
|
5
5
|
const require_sdk_utils_bytes32ToString = require("../utils/bytes32ToString.js");
|
|
6
6
|
const require_sdk_utils_createRawTx = require("../utils/createRawTx.js");
|
|
7
7
|
require("../utils/index.js");
|
|
8
|
+
const require_sdk_utils_viem_simulateCall = require("../utils/viem/simulateCall.js");
|
|
8
9
|
const require_sdk_base_Construct = require("./Construct.js");
|
|
9
10
|
let viem = require("viem");
|
|
10
11
|
//#region src/sdk/base/BaseContract.ts
|
|
@@ -262,6 +263,31 @@ var BaseContract = class extends require_sdk_base_Construct.Construct {
|
|
|
262
263
|
return tx;
|
|
263
264
|
}
|
|
264
265
|
/**
|
|
266
|
+
* Simulates calldata against this contract with `eth_call`, returning the raw response.
|
|
267
|
+
*
|
|
268
|
+
* Nothing is encoded or decoded on success: pass calldata that already exists (e.g. from
|
|
269
|
+
* {@link createRawTx}) instead of decoding it into a function name and arguments first.
|
|
270
|
+
* On revert, this contract's abi and the shared exception abis are used to decode the error.
|
|
271
|
+
*
|
|
272
|
+
* @param callData - Encoded calldata, passed to the node as-is.
|
|
273
|
+
* @param options - Call options, plus any extra `abis` needed to decode custom errors.
|
|
274
|
+
* @throws {@link SimulationError} when the call reverts or the request fails.
|
|
275
|
+
*/
|
|
276
|
+
async simulateCall(callData, options = {}) {
|
|
277
|
+
const { abis = [], ...rest } = options;
|
|
278
|
+
const { data } = await require_sdk_utils_viem_simulateCall.simulateCall(this.client, {
|
|
279
|
+
...rest,
|
|
280
|
+
to: this.address,
|
|
281
|
+
data: callData,
|
|
282
|
+
abis: [
|
|
283
|
+
this.abi,
|
|
284
|
+
require_abi_errors.errorAbis,
|
|
285
|
+
...abis
|
|
286
|
+
]
|
|
287
|
+
});
|
|
288
|
+
return data;
|
|
289
|
+
}
|
|
290
|
+
/**
|
|
265
291
|
* Get events in safe manner, by bisecting block range if needed
|
|
266
292
|
*
|
|
267
293
|
* @deprecated TODO: this should be moved to viem transport
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_sdk_utils_AddressMap = require("../utils/AddressMap.js");
|
|
3
3
|
require("../constants/addresses.js");
|
|
4
|
+
const require_sdk_utils_viem_simulateCall = require("../utils/viem/simulateCall.js");
|
|
4
5
|
const require_sdk_base_TokensMeta = require("./TokensMeta.js");
|
|
5
6
|
//#region src/sdk/base/ChainContractsRegister.ts
|
|
6
7
|
/**
|
|
@@ -104,6 +105,29 @@ var ChainContractsRegister = class {
|
|
|
104
105
|
return contract ? contract.stringifyFunctionData(calldata) : `unknown: ${address}.${calldata.slice(0, 10)}`;
|
|
105
106
|
}
|
|
106
107
|
/**
|
|
108
|
+
* Simulates a transaction with `eth_call`, without encoding or decoding anything on success.
|
|
109
|
+
*
|
|
110
|
+
* When the target is a known contract, its abi and the shared exception abis are used to decode
|
|
111
|
+
* a revert. For an unknown target only `options.abis` are used, so pass the exception abis you
|
|
112
|
+
* care about when simulating contracts the SDK does not know.
|
|
113
|
+
*
|
|
114
|
+
* @param target - Target address.
|
|
115
|
+
* @param callData - Calldata to simulate.
|
|
116
|
+
* @param options - Call options, plus any extra `abis` needed to decode custom errors.
|
|
117
|
+
* @returns Raw bytes returned by the call, `0x` when the function returns nothing.
|
|
118
|
+
* @throws {@link SimulationError} when the call reverts or the request fails.
|
|
119
|
+
*/
|
|
120
|
+
async simulateCall(target, callData, options = {}) {
|
|
121
|
+
const contract = this.contracts.get(target);
|
|
122
|
+
if (contract) return contract.simulateCall(callData, options);
|
|
123
|
+
const { data } = await require_sdk_utils_viem_simulateCall.simulateCall(this.client, {
|
|
124
|
+
...options,
|
|
125
|
+
to: target,
|
|
126
|
+
data: callData
|
|
127
|
+
});
|
|
128
|
+
return data;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
107
131
|
* Converts multicalls into some human-friendly strings
|
|
108
132
|
* This method is safe and should not throw
|
|
109
133
|
* @param address
|
package/dist/cjs/sdk/index.js
CHANGED
|
@@ -28,6 +28,8 @@ const require_sdk_utils_retry = require("./utils/retry.js");
|
|
|
28
28
|
const require_sdk_utils_toAddress = require("./utils/toAddress.js");
|
|
29
29
|
const require_sdk_utils_zod = require("./utils/zod.js");
|
|
30
30
|
require("./utils/index.js");
|
|
31
|
+
const require_sdk_utils_viem_cast = require("./utils/viem/cast.js");
|
|
32
|
+
const require_sdk_utils_viem_simulateCall = require("./utils/viem/simulateCall.js");
|
|
31
33
|
const require_sdk_base_TokensMeta = require("./base/TokensMeta.js");
|
|
32
34
|
const require_sdk_base_ChainContractsRegister = require("./base/ChainContractsRegister.js");
|
|
33
35
|
const require_sdk_base_Construct = require("./base/Construct.js");
|
|
@@ -45,7 +47,6 @@ const require_sdk_market_credit_CreditFacadeV310BaseContract = require("./market
|
|
|
45
47
|
const require_sdk_market_credit_CreditFacadeV310Contract = require("./market/credit/CreditFacadeV310Contract.js");
|
|
46
48
|
const require_sdk_market_credit_CreditManagerV310Contract = require("./market/credit/CreditManagerV310Contract.js");
|
|
47
49
|
const require_sdk_market_credit_CreditSuite = require("./market/credit/CreditSuite.js");
|
|
48
|
-
const require_sdk_utils_viem_cast = require("./utils/viem/cast.js");
|
|
49
50
|
const require_sdk_utils_viem_simulateMulticall = require("./utils/viem/simulateMulticall.js");
|
|
50
51
|
const require_sdk_utils_viem_simulateWithPriceUpdates = require("./utils/viem/simulateWithPriceUpdates.js");
|
|
51
52
|
const require_sdk_utils_viem_executeDelegatedMulticalls = require("./utils/viem/executeDelegatedMulticalls.js");
|
|
@@ -89,7 +90,10 @@ const require_sdk_market_zapper_IERC20ZapperContract = require("./market/zapper/
|
|
|
89
90
|
const require_sdk_market_zapper_IETHZapperContract = require("./market/zapper/IETHZapperContract.js");
|
|
90
91
|
const require_sdk_market_zapper_createZapper = require("./market/zapper/createZapper.js");
|
|
91
92
|
const require_sdk_market_MarketRegister = require("./market/MarketRegister.js");
|
|
93
|
+
const require_sdk_market_rwa_midas_constants = require("./market/rwa/midas/constants.js");
|
|
94
|
+
const require_sdk_market_rwa_midas_MidasLiquidator = require("./market/rwa/midas/MidasLiquidator.js");
|
|
92
95
|
const require_sdk_market_rwa_securitize_constants = require("./market/rwa/securitize/constants.js");
|
|
96
|
+
const require_sdk_market_rwa_securitize_SecuritizeLiquidator = require("./market/rwa/securitize/SecuritizeLiquidator.js");
|
|
93
97
|
const require_sdk_market_rwa_securitize_types = require("./market/rwa/securitize/types.js");
|
|
94
98
|
const require_sdk_market_rwa_securitize_SecuritizeRWAFactory = require("./market/rwa/securitize/SecuritizeRWAFactory.js");
|
|
95
99
|
const require_sdk_market_rwa_RWARegistry = require("./market/rwa/RWARegistry.js");
|
|
@@ -211,6 +215,7 @@ exports.MULTICALL_ADDRESS = require_sdk_constants_addresses.MULTICALL_ADDRESS;
|
|
|
211
215
|
exports.MarketRegister = require_sdk_market_MarketRegister.MarketRegister;
|
|
212
216
|
exports.MarketSuite = require_sdk_market_MarketSuite.MarketSuite;
|
|
213
217
|
exports.MellowLRTPriceFeedContract = require_sdk_market_pricefeeds_MellowLRTPriceFeed.MellowLRTPriceFeedContract;
|
|
218
|
+
exports.MidasLiquidator = require_sdk_market_rwa_midas_MidasLiquidator.MidasLiquidator;
|
|
214
219
|
exports.MissingSerializedParamsError = require_sdk_base_errors.MissingSerializedParamsError;
|
|
215
220
|
exports.MultichainLiquidationsService = require_sdk_accounts_liquidations_MultichainLiquidationsService.MultichainLiquidationsService;
|
|
216
221
|
exports.MultichainSDK = require_sdk_MultichainSDK.MultichainSDK;
|
|
@@ -244,6 +249,8 @@ exports.RAY_DECIMALS_POW = require_sdk_constants_math.RAY_DECIMALS_POW;
|
|
|
244
249
|
exports.RWARegistry = require_sdk_market_rwa_RWARegistry.RWARegistry;
|
|
245
250
|
exports.RWA_FACTORY_SECURITIZE = require_sdk_market_rwa_securitize_constants.RWA_FACTORY_SECURITIZE;
|
|
246
251
|
exports.RWA_FACTORY_TYPES = require_sdk_market_rwa_types.RWA_FACTORY_TYPES;
|
|
252
|
+
exports.RWA_LIQUIDATOR_MIDAS = require_sdk_market_rwa_midas_constants.RWA_LIQUIDATOR_MIDAS;
|
|
253
|
+
exports.RWA_LIQUIDATOR_SECURITIZE = require_sdk_market_rwa_securitize_constants.RWA_LIQUIDATOR_SECURITIZE;
|
|
247
254
|
exports.RWA_ON_DEMAND_LP_MONOPOLIZED = require_sdk_base_token_types.RWA_ON_DEMAND_LP_MONOPOLIZED;
|
|
248
255
|
exports.RWA_UNDERLYING_DEFAULT = require_sdk_base_token_types.RWA_UNDERLYING_DEFAULT;
|
|
249
256
|
exports.RWA_UNDERLYING_ON_DEMAND = require_sdk_base_token_types.RWA_UNDERLYING_ON_DEMAND;
|
|
@@ -262,8 +269,10 @@ exports.SdkMissingChainStateError = require_sdk_core_errors.SdkMissingChainState
|
|
|
262
269
|
exports.SdkNotAttachedError = require_sdk_core_errors.SdkNotAttachedError;
|
|
263
270
|
exports.SdkStateVersionMismatchError = require_sdk_core_errors.SdkStateVersionMismatchError;
|
|
264
271
|
exports.SdkSyncFailedError = require_sdk_core_errors.SdkSyncFailedError;
|
|
272
|
+
exports.SecuritizeLiquidator = require_sdk_market_rwa_securitize_SecuritizeLiquidator.SecuritizeLiquidator;
|
|
265
273
|
exports.SecuritizeRWAFactory = require_sdk_market_rwa_securitize_SecuritizeRWAFactory.SecuritizeRWAFactory;
|
|
266
274
|
exports.SimulateWithPriceUpdatesError = require_sdk_utils_viem_simulateWithPriceUpdates.SimulateWithPriceUpdatesError;
|
|
275
|
+
exports.SimulationError = require_sdk_utils_viem_simulateCall.SimulationError;
|
|
267
276
|
exports.TokensMeta = require_sdk_base_TokensMeta.TokensMeta;
|
|
268
277
|
exports.TypedObjectUtils = require_sdk_utils_mappers.TypedObjectUtils;
|
|
269
278
|
exports.UnsupportedZapperFunctionError = require_sdk_market_zapper_errors.UnsupportedZapperFunctionError;
|
|
@@ -317,6 +326,7 @@ exports.formatTimestamp = require_sdk_utils_formatter.formatTimestamp;
|
|
|
317
326
|
exports.functionArgsToMap = require_sdk_utils_abi_decode.functionArgsToMap;
|
|
318
327
|
exports.functionArgsToRecord = require_sdk_utils_abi_decode.functionArgsToRecord;
|
|
319
328
|
exports.generateCastTraceCall = require_sdk_utils_viem_cast.generateCastTraceCall;
|
|
329
|
+
exports.getCastTraceArgs = require_sdk_utils_viem_cast.getCastTraceArgs;
|
|
320
330
|
exports.getChain = require_sdk_chain_chains.getChain;
|
|
321
331
|
exports.getCuratorName = require_sdk_chain_chains.getCuratorName;
|
|
322
332
|
exports.getFunctionSignature = require_sdk_utils_abi_decode.getFunctionSignature;
|
|
@@ -346,6 +356,7 @@ exports.retry = require_sdk_utils_retry.retry;
|
|
|
346
356
|
exports.sendRawTx = require_sdk_utils_viem_sendRawTx.sendRawTx;
|
|
347
357
|
exports.shortAddress = require_sdk_utils_formatter.shortAddress;
|
|
348
358
|
exports.shortHash = require_sdk_utils_formatter.shortHash;
|
|
359
|
+
exports.simulateCall = require_sdk_utils_viem_simulateCall.simulateCall;
|
|
349
360
|
exports.simulateMulticall = require_sdk_utils_viem_simulateMulticall.simulateMulticall;
|
|
350
361
|
exports.simulateWithPriceUpdates = require_sdk_utils_viem_simulateWithPriceUpdates.simulateWithPriceUpdates;
|
|
351
362
|
exports.toAddress = require_sdk_utils_toAddress.toAddress;
|
|
@@ -61,20 +61,20 @@ var CreditFacadeV310BaseContract = class extends require_sdk_base_BaseContract.B
|
|
|
61
61
|
const [onBehalfOf, calls, referralCode] = params.args;
|
|
62
62
|
return [
|
|
63
63
|
this.labelAddress(onBehalfOf),
|
|
64
|
-
this.register.
|
|
64
|
+
this.register.stringifyMultiCall([...calls]).join(", "),
|
|
65
65
|
`${referralCode}`
|
|
66
66
|
];
|
|
67
67
|
}
|
|
68
68
|
case "closeCreditAccount": {
|
|
69
69
|
const [creditAccount, calls] = params.args;
|
|
70
|
-
return [this.labelAddress(creditAccount), this.register.
|
|
70
|
+
return [this.labelAddress(creditAccount), this.register.stringifyMultiCall([...calls]).join(", ")];
|
|
71
71
|
}
|
|
72
72
|
case "liquidateCreditAccount": {
|
|
73
73
|
const [creditAccount, to, calls] = params.args;
|
|
74
74
|
return [
|
|
75
75
|
this.labelAddress(creditAccount),
|
|
76
76
|
this.labelAddress(to),
|
|
77
|
-
this.register.
|
|
77
|
+
this.register.stringifyMultiCall([...calls]).join(", ")
|
|
78
78
|
];
|
|
79
79
|
}
|
|
80
80
|
default: return super.stringifyFunctionParams(params);
|
|
@@ -49,7 +49,10 @@ const require_sdk_market_zapper_IETHZapperContract = require("./zapper/IETHZappe
|
|
|
49
49
|
const require_sdk_market_zapper_createZapper = require("./zapper/createZapper.js");
|
|
50
50
|
require("./zapper/index.js");
|
|
51
51
|
const require_sdk_market_MarketRegister = require("./MarketRegister.js");
|
|
52
|
+
const require_sdk_market_rwa_midas_constants = require("./rwa/midas/constants.js");
|
|
53
|
+
const require_sdk_market_rwa_midas_MidasLiquidator = require("./rwa/midas/MidasLiquidator.js");
|
|
52
54
|
const require_sdk_market_rwa_securitize_constants = require("./rwa/securitize/constants.js");
|
|
55
|
+
const require_sdk_market_rwa_securitize_SecuritizeLiquidator = require("./rwa/securitize/SecuritizeLiquidator.js");
|
|
53
56
|
const require_sdk_market_rwa_securitize_types = require("./rwa/securitize/types.js");
|
|
54
57
|
const require_sdk_market_rwa_securitize_SecuritizeRWAFactory = require("./rwa/securitize/SecuritizeRWAFactory.js");
|
|
55
58
|
const require_sdk_market_rwa_RWARegistry = require("./rwa/RWARegistry.js");
|
|
@@ -79,6 +82,7 @@ exports.LinearInterestRateModelContract = require_sdk_market_pool_LinearInterest
|
|
|
79
82
|
exports.MarketRegister = require_sdk_market_MarketRegister.MarketRegister;
|
|
80
83
|
exports.MarketSuite = require_sdk_market_MarketSuite.MarketSuite;
|
|
81
84
|
exports.MellowLRTPriceFeedContract = require_sdk_market_pricefeeds_MellowLRTPriceFeed.MellowLRTPriceFeedContract;
|
|
85
|
+
exports.MidasLiquidator = require_sdk_market_rwa_midas_MidasLiquidator.MidasLiquidator;
|
|
82
86
|
exports.PartialPriceFeedInitError = require_sdk_market_pricefeeds_AbstractPriceFeed.PartialPriceFeedInitError;
|
|
83
87
|
exports.PendleTWAPPTPriceFeed = require_sdk_market_pricefeeds_PendleTWAPPTPriceFeed.PendleTWAPPTPriceFeed;
|
|
84
88
|
exports.PlaceholderAdapterContract = require_sdk_market_adapters_PlaceholderAdapterContracts.PlaceholderAdapterContract;
|
|
@@ -91,8 +95,11 @@ exports.PythPriceFeed = require_sdk_market_pricefeeds_PythPriceFeed.PythPriceFee
|
|
|
91
95
|
exports.RWARegistry = require_sdk_market_rwa_RWARegistry.RWARegistry;
|
|
92
96
|
exports.RWA_FACTORY_SECURITIZE = require_sdk_market_rwa_securitize_constants.RWA_FACTORY_SECURITIZE;
|
|
93
97
|
exports.RWA_FACTORY_TYPES = require_sdk_market_rwa_types.RWA_FACTORY_TYPES;
|
|
98
|
+
exports.RWA_LIQUIDATOR_MIDAS = require_sdk_market_rwa_midas_constants.RWA_LIQUIDATOR_MIDAS;
|
|
99
|
+
exports.RWA_LIQUIDATOR_SECURITIZE = require_sdk_market_rwa_securitize_constants.RWA_LIQUIDATOR_SECURITIZE;
|
|
94
100
|
exports.RedstonePriceFeedContract = require_sdk_market_pricefeeds_RedstonePriceFeed.RedstonePriceFeedContract;
|
|
95
101
|
exports.SECURITIZE_REGISTER_VAULT_TYPES = require_sdk_market_rwa_securitize_types.SECURITIZE_REGISTER_VAULT_TYPES;
|
|
102
|
+
exports.SecuritizeLiquidator = require_sdk_market_rwa_securitize_SecuritizeLiquidator.SecuritizeLiquidator;
|
|
96
103
|
exports.SecuritizeRWAFactory = require_sdk_market_rwa_securitize_SecuritizeRWAFactory.SecuritizeRWAFactory;
|
|
97
104
|
exports.UnsupportedZapperFunctionError = require_sdk_market_zapper_errors.UnsupportedZapperFunctionError;
|
|
98
105
|
exports.WstETHPriceFeedContract = require_sdk_market_pricefeeds_WstETHPriceFeed.WstETHPriceFeedContract;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_sdk_market_rwa_midas_constants = require("./midas/constants.js");
|
|
3
|
+
const require_sdk_market_rwa_midas_MidasLiquidator = require("./midas/MidasLiquidator.js");
|
|
4
|
+
require("./midas/index.js");
|
|
2
5
|
const require_sdk_market_rwa_securitize_constants = require("./securitize/constants.js");
|
|
6
|
+
const require_sdk_market_rwa_securitize_SecuritizeLiquidator = require("./securitize/SecuritizeLiquidator.js");
|
|
3
7
|
const require_sdk_market_rwa_securitize_types = require("./securitize/types.js");
|
|
4
8
|
const require_sdk_market_rwa_securitize_SecuritizeRWAFactory = require("./securitize/SecuritizeRWAFactory.js");
|
|
5
9
|
require("./securitize/index.js");
|
|
6
10
|
const require_sdk_market_rwa_RWARegistry = require("./RWARegistry.js");
|
|
7
11
|
const require_sdk_market_rwa_types = require("./types.js");
|
|
12
|
+
exports.MidasLiquidator = require_sdk_market_rwa_midas_MidasLiquidator.MidasLiquidator;
|
|
8
13
|
exports.RWARegistry = require_sdk_market_rwa_RWARegistry.RWARegistry;
|
|
9
14
|
exports.RWA_FACTORY_SECURITIZE = require_sdk_market_rwa_securitize_constants.RWA_FACTORY_SECURITIZE;
|
|
10
15
|
exports.RWA_FACTORY_TYPES = require_sdk_market_rwa_types.RWA_FACTORY_TYPES;
|
|
16
|
+
exports.RWA_LIQUIDATOR_MIDAS = require_sdk_market_rwa_midas_constants.RWA_LIQUIDATOR_MIDAS;
|
|
17
|
+
exports.RWA_LIQUIDATOR_SECURITIZE = require_sdk_market_rwa_securitize_constants.RWA_LIQUIDATOR_SECURITIZE;
|
|
11
18
|
exports.SECURITIZE_REGISTER_VAULT_TYPES = require_sdk_market_rwa_securitize_types.SECURITIZE_REGISTER_VAULT_TYPES;
|
|
19
|
+
exports.SecuritizeLiquidator = require_sdk_market_rwa_securitize_SecuritizeLiquidator.SecuritizeLiquidator;
|
|
12
20
|
exports.SecuritizeRWAFactory = require_sdk_market_rwa_securitize_SecuritizeRWAFactory.SecuritizeRWAFactory;
|
|
13
21
|
exports.isRWAFactory = require_sdk_market_rwa_types.isRWAFactory;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_sdk_base_BaseContract = require("../../../base/BaseContract.js");
|
|
3
|
+
require("../../../base/index.js");
|
|
4
|
+
const require_sdk_market_rwa_midas_constants = require("./constants.js");
|
|
5
|
+
//#region src/sdk/market/rwa/midas/MidasLiquidator.ts
|
|
6
|
+
const abi = require("../../../../abi/rwa/iMidasLiquidatorV311.js").iMidasLiquidatorV311Abi;
|
|
7
|
+
var MidasLiquidator = class extends require_sdk_base_BaseContract.BaseContract {
|
|
8
|
+
constructor(options, address) {
|
|
9
|
+
super(options, {
|
|
10
|
+
addr: address,
|
|
11
|
+
contractType: require_sdk_market_rwa_midas_constants.RWA_LIQUIDATOR_MIDAS,
|
|
12
|
+
version: 311,
|
|
13
|
+
name: "MidasLiquidator",
|
|
14
|
+
abi
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
stringifyFunctionParams(params) {
|
|
18
|
+
if (params.functionName === "liquidateWithRedeemerTransfers") {
|
|
19
|
+
const [creditAccount, gateway, calls, lossPolicyData] = params.args;
|
|
20
|
+
return [
|
|
21
|
+
this.labelAddress(creditAccount),
|
|
22
|
+
this.labelAddress(gateway),
|
|
23
|
+
`[${this.register.stringifyMultiCall([...calls]).join(", ")}]`,
|
|
24
|
+
lossPolicyData === "0x" ? "none" : lossPolicyData
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
return super.stringifyFunctionParams(params);
|
|
28
|
+
}
|
|
29
|
+
parseFunctionParamsV2(params, strict) {
|
|
30
|
+
if (params.functionName === "liquidateWithRedeemerTransfers") {
|
|
31
|
+
const [creditAccount, gateway, calls, lossPolicyData] = params.args;
|
|
32
|
+
return {
|
|
33
|
+
creditAccount,
|
|
34
|
+
gateway,
|
|
35
|
+
calls: this.register.parseMultiCallV2([...calls], strict),
|
|
36
|
+
lossPolicyData
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
return super.parseFunctionParamsV2(params, strict);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
//#endregion
|
|
43
|
+
exports.MidasLiquidator = MidasLiquidator;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_sdk_market_rwa_midas_constants = require("./constants.js");
|
|
3
|
+
const require_sdk_market_rwa_midas_MidasLiquidator = require("./MidasLiquidator.js");
|
|
4
|
+
exports.MidasLiquidator = require_sdk_market_rwa_midas_MidasLiquidator.MidasLiquidator;
|
|
5
|
+
exports.RWA_LIQUIDATOR_MIDAS = require_sdk_market_rwa_midas_constants.RWA_LIQUIDATOR_MIDAS;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
+
const require_sdk_base_BaseContract = require("../../../base/BaseContract.js");
|
|
3
|
+
require("../../../base/index.js");
|
|
4
|
+
const require_sdk_market_rwa_securitize_constants = require("./constants.js");
|
|
5
|
+
//#region src/sdk/market/rwa/securitize/SecuritizeLiquidator.ts
|
|
6
|
+
const abi = require("../../../../abi/rwa/iSecuritizeLiquidatorV311.js").iSecuritizeLiquidatorV311Abi;
|
|
7
|
+
var SecuritizeLiquidator = class extends require_sdk_base_BaseContract.BaseContract {
|
|
8
|
+
constructor(options, address) {
|
|
9
|
+
super(options, {
|
|
10
|
+
addr: address,
|
|
11
|
+
contractType: require_sdk_market_rwa_securitize_constants.RWA_LIQUIDATOR_SECURITIZE,
|
|
12
|
+
version: 311,
|
|
13
|
+
name: "SecuritizeLiquidator",
|
|
14
|
+
abi
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
stringifyFunctionParams(params) {
|
|
18
|
+
if (params.functionName === "liquidatePendingRedemption") {
|
|
19
|
+
const [creditAccount, redemptionGateway, priceUpdates, lossPolicyData] = params.args;
|
|
20
|
+
return [
|
|
21
|
+
this.labelAddress(creditAccount),
|
|
22
|
+
this.labelAddress(redemptionGateway),
|
|
23
|
+
`${priceUpdates.length} price updates`,
|
|
24
|
+
lossPolicyData === "0x" ? "none" : lossPolicyData
|
|
25
|
+
];
|
|
26
|
+
}
|
|
27
|
+
return super.stringifyFunctionParams(params);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
exports.SecuritizeLiquidator = SecuritizeLiquidator;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region src/sdk/market/rwa/securitize/constants.ts
|
|
3
3
|
const RWA_FACTORY_SECURITIZE = "RWA_FACTORY::SECURITIZE";
|
|
4
|
+
const RWA_LIQUIDATOR_SECURITIZE = "RWA_LIQUIDATOR::SECURITIZE";
|
|
4
5
|
//#endregion
|
|
5
6
|
exports.RWA_FACTORY_SECURITIZE = RWA_FACTORY_SECURITIZE;
|
|
7
|
+
exports.RWA_LIQUIDATOR_SECURITIZE = RWA_LIQUIDATOR_SECURITIZE;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_sdk_market_rwa_securitize_constants = require("./constants.js");
|
|
3
|
+
const require_sdk_market_rwa_securitize_SecuritizeLiquidator = require("./SecuritizeLiquidator.js");
|
|
3
4
|
const require_sdk_market_rwa_securitize_types = require("./types.js");
|
|
4
5
|
const require_sdk_market_rwa_securitize_SecuritizeRWAFactory = require("./SecuritizeRWAFactory.js");
|
|
5
6
|
exports.RWA_FACTORY_SECURITIZE = require_sdk_market_rwa_securitize_constants.RWA_FACTORY_SECURITIZE;
|
|
7
|
+
exports.RWA_LIQUIDATOR_SECURITIZE = require_sdk_market_rwa_securitize_constants.RWA_LIQUIDATOR_SECURITIZE;
|
|
6
8
|
exports.SECURITIZE_REGISTER_VAULT_TYPES = require_sdk_market_rwa_securitize_types.SECURITIZE_REGISTER_VAULT_TYPES;
|
|
9
|
+
exports.SecuritizeLiquidator = require_sdk_market_rwa_securitize_SecuritizeLiquidator.SecuritizeLiquidator;
|
|
7
10
|
exports.SecuritizeRWAFactory = require_sdk_market_rwa_securitize_SecuritizeRWAFactory.SecuritizeRWAFactory;
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
//#region src/sdk/utils/viem/cast.ts
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
];
|
|
10
|
-
if (rpcUrl)
|
|
11
|
-
if (
|
|
12
|
-
if (
|
|
13
|
-
if (
|
|
14
|
-
if (
|
|
15
|
-
if (
|
|
3
|
+
/**
|
|
4
|
+
* Builds the argument list of a `cast call --trace` command reproducing the call,
|
|
5
|
+
* without the leading `cast` binary, so that it can be spawned directly.
|
|
6
|
+
*/
|
|
7
|
+
function getCastTraceArgs(params, rpcUrl) {
|
|
8
|
+
const { to, data, account, blockNumber, gas, gasPrice, maxPriorityFeePerGas, value } = params;
|
|
9
|
+
const args = ["call", "--trace"];
|
|
10
|
+
if (rpcUrl) args.push("--rpc-url", rpcUrl);
|
|
11
|
+
if (account) args.push("--from", typeof account === "string" ? account : account.address);
|
|
12
|
+
if (blockNumber) args.push("--block", blockNumber.toString());
|
|
13
|
+
if (gas) args.push("--gas-limit", gas.toString());
|
|
14
|
+
if (gasPrice) args.push("--gas-price", gasPrice.toString());
|
|
15
|
+
if (maxPriorityFeePerGas) args.push("--priority-gas-price", maxPriorityFeePerGas.toString());
|
|
16
|
+
if (value) args.push("--value", value.toString());
|
|
16
17
|
return [
|
|
17
|
-
...
|
|
18
|
+
...args,
|
|
18
19
|
to,
|
|
19
20
|
data
|
|
20
|
-
].
|
|
21
|
+
].filter(Boolean);
|
|
22
|
+
}
|
|
23
|
+
function generateCastTraceCall(params, rpcUrl) {
|
|
24
|
+
return ["cast", ...getCastTraceArgs(params, rpcUrl)].join(" ");
|
|
21
25
|
}
|
|
22
26
|
//#endregion
|
|
23
27
|
exports.generateCastTraceCall = generateCastTraceCall;
|
|
28
|
+
exports.getCastTraceArgs = getCastTraceArgs;
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_sdk_utils_viem_cast = require("./cast.js");
|
|
3
|
+
const require_sdk_utils_viem_simulateCall = require("./simulateCall.js");
|
|
3
4
|
const require_sdk_utils_viem_simulateMulticall = require("./simulateMulticall.js");
|
|
4
5
|
const require_sdk_utils_viem_simulateWithPriceUpdates = require("./simulateWithPriceUpdates.js");
|
|
5
6
|
const require_sdk_utils_viem_executeDelegatedMulticalls = require("./executeDelegatedMulticalls.js");
|
|
6
7
|
const require_sdk_utils_viem_sendRawTx = require("./sendRawTx.js");
|
|
7
8
|
const require_sdk_utils_viem_watchBlocksAsync = require("./watchBlocksAsync.js");
|
|
8
9
|
exports.SimulateWithPriceUpdatesError = require_sdk_utils_viem_simulateWithPriceUpdates.SimulateWithPriceUpdatesError;
|
|
10
|
+
exports.SimulationError = require_sdk_utils_viem_simulateCall.SimulationError;
|
|
9
11
|
exports.estimateRawTxGas = require_sdk_utils_viem_sendRawTx.estimateRawTxGas;
|
|
10
12
|
exports.executeDelegatedMulticalls = require_sdk_utils_viem_executeDelegatedMulticalls.executeDelegatedMulticalls;
|
|
11
13
|
exports.generateCastTraceCall = require_sdk_utils_viem_cast.generateCastTraceCall;
|
|
14
|
+
exports.getCastTraceArgs = require_sdk_utils_viem_cast.getCastTraceArgs;
|
|
12
15
|
exports.getSimulateWithPriceUpdatesError = require_sdk_utils_viem_simulateWithPriceUpdates.getSimulateWithPriceUpdatesError;
|
|
13
16
|
exports.sendRawTx = require_sdk_utils_viem_sendRawTx.sendRawTx;
|
|
17
|
+
exports.simulateCall = require_sdk_utils_viem_simulateCall.simulateCall;
|
|
14
18
|
exports.simulateMulticall = require_sdk_utils_viem_simulateMulticall.simulateMulticall;
|
|
15
19
|
exports.simulateWithPriceUpdates = require_sdk_utils_viem_simulateWithPriceUpdates.simulateWithPriceUpdates;
|
|
16
20
|
exports.watchBlocksAsync = require_sdk_utils_viem_watchBlocksAsync.watchBlocksAsync;
|