@1delta/calldatalib 0.0.30 → 0.0.32
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
|
@@ -4,6 +4,7 @@ exports.DexForkMappings = exports.DexTypeMappings = exports.BridgeIds = exports.
|
|
|
4
4
|
exports.encodeExternalCall = encodeExternalCall;
|
|
5
5
|
exports.encodeTryExternalCall = encodeTryExternalCall;
|
|
6
6
|
exports.encodeStargateV2Bridge = encodeStargateV2Bridge;
|
|
7
|
+
exports.encodePermit = encodePermit;
|
|
7
8
|
exports.encodeStargateV2BridgePartial = encodeStargateV2BridgePartial;
|
|
8
9
|
exports.encodeStargateV2BridgeSimpleTaxi = encodeStargateV2BridgeSimpleTaxi;
|
|
9
10
|
exports.encodeStargateV2BridgeSimpleBus = encodeStargateV2BridgeSimpleBus;
|
|
@@ -232,6 +233,9 @@ function encodeStargateV2Bridge(asset, stargatePool, dstEid, receiver, refundRec
|
|
|
232
233
|
partialData,
|
|
233
234
|
]);
|
|
234
235
|
}
|
|
236
|
+
function encodePermit(permitId, target, data) {
|
|
237
|
+
return (0, utils_js_1.encodePacked)(["uint8", "uint8", "address", "uint16", "bytes"], [(0, utils_js_1.uint8)(ComposerCommands.PERMIT), (0, utils_js_1.uint8)(permitId), target, (0, utils_js_1.uint16)(data.length / 2 - 1), data]);
|
|
238
|
+
}
|
|
235
239
|
function encodeStargateV2BridgePartial(amount, slippage, fee, isBusMode, isNative, composeMsg, extraOptions) {
|
|
236
240
|
return (0, utils_js_1.encodePacked)(["uint128", "uint32", "uint128", "uint8", "uint16", "uint16", "bytes", "bytes"], [
|
|
237
241
|
(0, utils_js_1.generateAmountBitmap)((0, utils_js_1.uint128)(amount), false, false, isNative),
|
package/dist/esm/CalldataLib.js
CHANGED
|
@@ -160,6 +160,9 @@ export function encodeStargateV2Bridge(asset, stargatePool, dstEid, receiver, re
|
|
|
160
160
|
partialData,
|
|
161
161
|
]);
|
|
162
162
|
}
|
|
163
|
+
export function encodePermit(permitId, target, data) {
|
|
164
|
+
return encodePacked(["uint8", "uint8", "address", "uint16", "bytes"], [uint8(ComposerCommands.PERMIT), uint8(permitId), target, uint16(data.length / 2 - 1), data]);
|
|
165
|
+
}
|
|
163
166
|
export function encodeStargateV2BridgePartial(amount, slippage, fee, isBusMode, isNative, composeMsg, extraOptions) {
|
|
164
167
|
return encodePacked(["uint128", "uint32", "uint128", "uint8", "uint16", "uint16", "bytes", "bytes"], [
|
|
165
168
|
generateAmountBitmap(uint128(amount), false, false, isNative),
|
|
@@ -112,6 +112,7 @@ export declare enum DexForkMappings {
|
|
|
112
112
|
export declare function encodeExternalCall(target: Address, value: bigint, useSelfBalance: boolean, data: Hex): Hex;
|
|
113
113
|
export declare function encodeTryExternalCall(target: Address, value: bigint, useSelfBalance: boolean, rOnFailure: boolean, data: Hex, catchData: Hex): Hex;
|
|
114
114
|
export declare function encodeStargateV2Bridge(asset: Address, stargatePool: Address, dstEid: number, receiver: Hex, refundReceiver: Address, amount: bigint, slippage: number, fee: bigint, isBusMode: boolean, isNative: boolean, composeMsg: Hex, extraOptions: Hex): Hex;
|
|
115
|
+
export declare function encodePermit(permitId: bigint, target: Address, data: Hex): Hex;
|
|
115
116
|
export declare function encodeStargateV2BridgePartial(amount: bigint, slippage: number, fee: bigint, isBusMode: boolean, isNative: boolean, composeMsg: Hex, extraOptions: Hex): Hex;
|
|
116
117
|
export declare function encodeStargateV2BridgeSimpleTaxi(asset: Address, stargatePool: Address, dstEid: number, receiver: Hex, refundReceiver: Address, amount: bigint, isNative: boolean, slippage: number, fee: bigint): Hex;
|
|
117
118
|
export declare function encodeStargateV2BridgeSimpleBus(asset: Address, stargatePool: Address, dstEid: number, receiver: Hex, refundReceiver: Address, amount: bigint, isNative: boolean, slippage: number, fee: bigint): Hex;
|