@1delta/calldatalib 0.0.37 → 0.0.39
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 +562 -68
- package/dist/cjs/utils.js +3 -5
- package/dist/esm/CalldataLib.js +560 -68
- package/dist/esm/utils.js +3 -5
- package/dist/types/CalldataLib.d.ts +4 -1
- 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) {
|
|
@@ -78,7 +78,8 @@ export declare enum ComposerCommands {
|
|
|
78
78
|
}
|
|
79
79
|
export declare enum BridgeIds {
|
|
80
80
|
STARGATE_V2 = 0,
|
|
81
|
-
ACROSS = 10
|
|
81
|
+
ACROSS = 10,
|
|
82
|
+
SQUID_ROUTER = 20
|
|
82
83
|
}
|
|
83
84
|
export declare enum DexTypeMappings {
|
|
84
85
|
UNISWAP_V3_ID = 0,
|
|
@@ -118,6 +119,8 @@ export declare function encodeStargateV2BridgeSimpleTaxi(asset: Address, stargat
|
|
|
118
119
|
export declare function encodeStargateV2BridgeSimpleBus(asset: Address, stargatePool: Address, dstEid: number, receiver: Hex, refundReceiver: Address, amount: bigint, isNative: boolean, slippage: number, fee: bigint): Hex;
|
|
119
120
|
export declare function encodeAcrossBridgeToken(spokePool: Address, depositor: Address, sendingAssetId: Address, receivingAssetId: Hex, amount: bigint, fixedFee: bigint, feePercentage: number, destinationChainId: number, receiver: Hex, message: Hex): Hex;
|
|
120
121
|
export declare function encodeAcrossBridgeNative(spokePool: Address, depositor: Address, sendingAssetId: Address, receivingAssetId: Hex, amount: bigint, fixedFee: bigint, feePercentage: number, destinationChainId: number, receiver: Hex, message: Hex): Hex;
|
|
122
|
+
export declare function encodeSquidRouterCall(asset: Address, gateway: Address, bridgedTokenSymbol: Hex, amount: bigint, destinationChain: Hex, destinationAddress: Hex, payload: Hex, gasRefundRecipient: Address, enableExpress: boolean, nativeAmount: bigint): Hex;
|
|
123
|
+
export declare function encodeSquidRouterCallPartial(asset: Address, gateway: Address, bridgedTokenSymbol: Hex, amount: bigint, destinationChain: Hex, destinationAddress: Hex, payload: Hex): Hex;
|
|
121
124
|
export declare function encodePermit2TransferFrom(token: Address, receiver: Address, amount: bigint): Hex;
|
|
122
125
|
export declare function encodeNextGenDexUnlock(singleton: Address, id: bigint, d: Hex): Hex;
|
|
123
126
|
export declare function encodeBalancerV3FlashLoan(singleton: Address, poolId: bigint, asset: Address, receiver: Address, amount: bigint, flashData: Hex): Hex;
|
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;
|