@1delta/calldatalib 0.0.37 → 0.0.38
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 +533 -68
- package/dist/cjs/utils.js +3 -5
- package/dist/esm/CalldataLib.js +533 -68
- package/dist/esm/utils.js +3 -5
- package/dist/types/utils.d.ts +1 -1
- package/package.json +1 -1
package/dist/esm/utils.js
CHANGED
|
@@ -35,14 +35,12 @@ export function encodePacked(types, values) {
|
|
|
35
35
|
}
|
|
36
36
|
return abiEncodePacked(types, values);
|
|
37
37
|
}
|
|
38
|
-
export function generateAmountBitmap(amount, useShares,
|
|
38
|
+
export function generateAmountBitmap(amount, useShares, native) {
|
|
39
39
|
let am = amount;
|
|
40
|
-
if (useShares)
|
|
41
|
-
am = uint128((am & ~BigInt(_SHARES_MASK)) | _SHARES_MASK);
|
|
42
|
-
if (unsafe)
|
|
43
|
-
am = uint128((am & ~BigInt(_UNSAFE_AMOUNT)) | _UNSAFE_AMOUNT);
|
|
44
40
|
if (native)
|
|
45
41
|
am = uint128((am & ~BigInt(_NATIVE_FLAG)) | _NATIVE_FLAG);
|
|
42
|
+
if (useShares)
|
|
43
|
+
am = uint128((am & ~BigInt(_SHARES_MASK)) | _SHARES_MASK);
|
|
46
44
|
return am;
|
|
47
45
|
}
|
|
48
46
|
export function getMorphoCollateral(market) {
|
package/dist/types/utils.d.ts
CHANGED
|
@@ -12,7 +12,7 @@ export declare function uint112(value: number | bigint): bigint;
|
|
|
12
12
|
export declare function uint128(value: number | bigint): bigint;
|
|
13
13
|
export declare function uint256(value: number | bigint): bigint;
|
|
14
14
|
export declare function encodePacked(types: string[], values: any[]): Hex;
|
|
15
|
-
export declare function generateAmountBitmap(amount: bigint, useShares: boolean,
|
|
15
|
+
export declare function generateAmountBitmap(amount: bigint, useShares: boolean, native: boolean): bigint;
|
|
16
16
|
export declare function getMorphoCollateral(market: Hex): Address;
|
|
17
17
|
export declare function getMorphoLoanAsset(market: Hex): Address;
|
|
18
18
|
export declare function newbytes(length: number): Hex;
|