@1delta/calldatalib 0.0.49 → 0.0.51
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/CalldataLib.js
CHANGED
|
@@ -57,6 +57,7 @@ exports.encodeFlashLoan = encodeFlashLoan;
|
|
|
57
57
|
exports.encodeUint8AndBytes = encodeUint8AndBytes;
|
|
58
58
|
exports.encodeMorphoMarket = encodeMorphoMarket;
|
|
59
59
|
exports.encodeMorphoDepositCollateral = encodeMorphoDepositCollateral;
|
|
60
|
+
exports.encodeListaSupplyCollateralViaProvider = encodeListaSupplyCollateralViaProvider;
|
|
60
61
|
exports.encodeMorphoDeposit = encodeMorphoDeposit;
|
|
61
62
|
exports.encodeErc4626Deposit = encodeErc4626Deposit;
|
|
62
63
|
exports.encodeErc4646Withdraw = encodeErc4646Withdraw;
|
|
@@ -191,8 +192,10 @@ var CompoundV2Selector;
|
|
|
191
192
|
(function (CompoundV2Selector) {
|
|
192
193
|
CompoundV2Selector[CompoundV2Selector["MINT_BEHALF"] = 0] = "MINT_BEHALF";
|
|
193
194
|
CompoundV2Selector[CompoundV2Selector["MINT"] = 1] = "MINT";
|
|
195
|
+
CompoundV2Selector[CompoundV2Selector["MINT_ITOKEN"] = 2] = "MINT_ITOKEN";
|
|
194
196
|
CompoundV2Selector[CompoundV2Selector["REDEEM"] = 0] = "REDEEM";
|
|
195
197
|
CompoundV2Selector[CompoundV2Selector["REDEEM_BEHALF"] = 1] = "REDEEM_BEHALF";
|
|
198
|
+
CompoundV2Selector[CompoundV2Selector["REDEEM_ITOKEN"] = 2] = "REDEEM_ITOKEN";
|
|
196
199
|
})(CompoundV2Selector || (exports.CompoundV2Selector = CompoundV2Selector = {}));
|
|
197
200
|
var SiloV2CollateralType;
|
|
198
201
|
(function (SiloV2CollateralType) {
|
|
@@ -711,6 +714,19 @@ function encodeMorphoDepositCollateral(market, assets, receiver, data, morphoB,
|
|
|
711
714
|
data.length / 2 - 1 === 0 ? (0, utils_js_1.newbytes)(0) : encodeUint8AndBytes((0, utils_js_1.uint8)(pId), data),
|
|
712
715
|
]);
|
|
713
716
|
}
|
|
717
|
+
function encodeListaSupplyCollateralViaProvider(market, assets, receiver, data, provider, pId) {
|
|
718
|
+
return (0, utils_js_1.encodePacked)(["uint8", "uint8", "uint16", "bytes", "uint128", "address", "address", "uint16", "bytes"], [
|
|
719
|
+
(0, utils_js_1.uint8)(ComposerCommands.LENDING),
|
|
720
|
+
(0, utils_js_1.uint8)(LenderOps.DEPOSIT),
|
|
721
|
+
(0, utils_js_1.uint16)(LenderIds.UP_TO_MORPHO - 1),
|
|
722
|
+
market,
|
|
723
|
+
(0, utils_js_1.generateAmountBitmap)((0, utils_js_1.uint128)(assets), false, true),
|
|
724
|
+
receiver,
|
|
725
|
+
provider,
|
|
726
|
+
(0, utils_js_1.uint16)(data.length / 2 - 1 > 0 ? data.length / 2 - 1 + 1 : 0),
|
|
727
|
+
data.length / 2 - 1 === 0 ? (0, utils_js_1.newbytes)(0) : encodeUint8AndBytes((0, utils_js_1.uint8)(pId), data),
|
|
728
|
+
]);
|
|
729
|
+
}
|
|
714
730
|
function encodeMorphoDeposit(market, isShares, assets, receiver, data, morphoB, pId) {
|
|
715
731
|
return (0, utils_js_1.encodePacked)(["bytes", "uint8", "uint8", "uint16", "bytes", "uint128", "address", "address", "uint16", "bytes"], [
|
|
716
732
|
encodeApprove((0, utils_js_1.getMorphoLoanAsset)(market), morphoB),
|
package/dist/esm/CalldataLib.js
CHANGED
|
@@ -105,8 +105,10 @@ export var CompoundV2Selector;
|
|
|
105
105
|
(function (CompoundV2Selector) {
|
|
106
106
|
CompoundV2Selector[CompoundV2Selector["MINT_BEHALF"] = 0] = "MINT_BEHALF";
|
|
107
107
|
CompoundV2Selector[CompoundV2Selector["MINT"] = 1] = "MINT";
|
|
108
|
+
CompoundV2Selector[CompoundV2Selector["MINT_ITOKEN"] = 2] = "MINT_ITOKEN";
|
|
108
109
|
CompoundV2Selector[CompoundV2Selector["REDEEM"] = 0] = "REDEEM";
|
|
109
110
|
CompoundV2Selector[CompoundV2Selector["REDEEM_BEHALF"] = 1] = "REDEEM_BEHALF";
|
|
111
|
+
CompoundV2Selector[CompoundV2Selector["REDEEM_ITOKEN"] = 2] = "REDEEM_ITOKEN";
|
|
110
112
|
})(CompoundV2Selector || (CompoundV2Selector = {}));
|
|
111
113
|
export var SiloV2CollateralType;
|
|
112
114
|
(function (SiloV2CollateralType) {
|
|
@@ -625,6 +627,19 @@ export function encodeMorphoDepositCollateral(market, assets, receiver, data, mo
|
|
|
625
627
|
data.length / 2 - 1 === 0 ? newbytes(0) : encodeUint8AndBytes(uint8(pId), data),
|
|
626
628
|
]);
|
|
627
629
|
}
|
|
630
|
+
export function encodeListaSupplyCollateralViaProvider(market, assets, receiver, data, provider, pId) {
|
|
631
|
+
return encodePacked(["uint8", "uint8", "uint16", "bytes", "uint128", "address", "address", "uint16", "bytes"], [
|
|
632
|
+
uint8(ComposerCommands.LENDING),
|
|
633
|
+
uint8(LenderOps.DEPOSIT),
|
|
634
|
+
uint16(LenderIds.UP_TO_MORPHO - 1),
|
|
635
|
+
market,
|
|
636
|
+
generateAmountBitmap(uint128(assets), false, true),
|
|
637
|
+
receiver,
|
|
638
|
+
provider,
|
|
639
|
+
uint16(data.length / 2 - 1 > 0 ? data.length / 2 - 1 + 1 : 0),
|
|
640
|
+
data.length / 2 - 1 === 0 ? newbytes(0) : encodeUint8AndBytes(uint8(pId), data),
|
|
641
|
+
]);
|
|
642
|
+
}
|
|
628
643
|
export function encodeMorphoDeposit(market, isShares, assets, receiver, data, morphoB, pId) {
|
|
629
644
|
return encodePacked(["bytes", "uint8", "uint8", "uint16", "bytes", "uint128", "address", "address", "uint16", "bytes"], [
|
|
630
645
|
encodeApprove(getMorphoLoanAsset(market), morphoB),
|
|
@@ -89,8 +89,10 @@ export declare enum BridgeIds {
|
|
|
89
89
|
export declare enum CompoundV2Selector {
|
|
90
90
|
MINT_BEHALF = 0,
|
|
91
91
|
MINT = 1,
|
|
92
|
+
MINT_ITOKEN = 2,
|
|
92
93
|
REDEEM = 0,
|
|
93
|
-
REDEEM_BEHALF = 1
|
|
94
|
+
REDEEM_BEHALF = 1,
|
|
95
|
+
REDEEM_ITOKEN = 2
|
|
94
96
|
}
|
|
95
97
|
export declare enum SiloV2CollateralType {
|
|
96
98
|
PROTECTED = 0,
|
|
@@ -181,6 +183,7 @@ export declare function encodeFlashLoan(asset: Address, amount: bigint, pool: Ad
|
|
|
181
183
|
export declare function encodeUint8AndBytes(poolId: number, data: Hex): Hex;
|
|
182
184
|
export declare function encodeMorphoMarket(loanToken: Address, collateralToken: Address, oracle: Address, irm: Address, lltv: bigint): Hex;
|
|
183
185
|
export declare function encodeMorphoDepositCollateral(market: Hex, assets: bigint, receiver: Address, data: Hex, morphoB: Address, pId: bigint): Hex;
|
|
186
|
+
export declare function encodeListaSupplyCollateralViaProvider(market: Hex, assets: bigint, receiver: Address, data: Hex, provider: Address, pId: bigint): Hex;
|
|
184
187
|
export declare function encodeMorphoDeposit(market: Hex, isShares: boolean, assets: bigint, receiver: Address, data: Hex, morphoB: Address, pId: bigint): Hex;
|
|
185
188
|
export declare function encodeErc4626Deposit(asset: Address, vault: Address, isShares: boolean, assets: bigint, receiver: Address): Hex;
|
|
186
189
|
export declare function encodeErc4646Withdraw(vault: Address, isShares: boolean, assets: bigint, receiver: Address): Hex;
|