@1delta/calldatalib 0.0.31 → 0.0.33
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),
|
|
@@ -257,12 +261,12 @@ function encodeAcrossBridgeToken(spokePool, depositor, sendingAssetId, receiving
|
|
|
257
261
|
"address",
|
|
258
262
|
"address",
|
|
259
263
|
"address",
|
|
260
|
-
"
|
|
264
|
+
"bytes32",
|
|
261
265
|
"uint128",
|
|
262
266
|
"uint128",
|
|
263
267
|
"uint32",
|
|
264
268
|
"uint32",
|
|
265
|
-
"
|
|
269
|
+
"bytes32",
|
|
266
270
|
"uint16",
|
|
267
271
|
"bytes",
|
|
268
272
|
], [
|
|
@@ -289,12 +293,12 @@ function encodeAcrossBridgeNative(spokePool, depositor, sendingAssetId, receivin
|
|
|
289
293
|
"address",
|
|
290
294
|
"address",
|
|
291
295
|
"address",
|
|
292
|
-
"
|
|
296
|
+
"bytes32",
|
|
293
297
|
"uint128",
|
|
294
298
|
"uint128",
|
|
295
299
|
"uint32",
|
|
296
300
|
"uint32",
|
|
297
|
-
"
|
|
301
|
+
"bytes32",
|
|
298
302
|
"uint16",
|
|
299
303
|
"bytes",
|
|
300
304
|
], [
|
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),
|
|
@@ -185,12 +188,12 @@ export function encodeAcrossBridgeToken(spokePool, depositor, sendingAssetId, re
|
|
|
185
188
|
"address",
|
|
186
189
|
"address",
|
|
187
190
|
"address",
|
|
188
|
-
"
|
|
191
|
+
"bytes32",
|
|
189
192
|
"uint128",
|
|
190
193
|
"uint128",
|
|
191
194
|
"uint32",
|
|
192
195
|
"uint32",
|
|
193
|
-
"
|
|
196
|
+
"bytes32",
|
|
194
197
|
"uint16",
|
|
195
198
|
"bytes",
|
|
196
199
|
], [
|
|
@@ -217,12 +220,12 @@ export function encodeAcrossBridgeNative(spokePool, depositor, sendingAssetId, r
|
|
|
217
220
|
"address",
|
|
218
221
|
"address",
|
|
219
222
|
"address",
|
|
220
|
-
"
|
|
223
|
+
"bytes32",
|
|
221
224
|
"uint128",
|
|
222
225
|
"uint128",
|
|
223
226
|
"uint32",
|
|
224
227
|
"uint32",
|
|
225
|
-
"
|
|
228
|
+
"bytes32",
|
|
226
229
|
"uint16",
|
|
227
230
|
"bytes",
|
|
228
231
|
], [
|
|
@@ -112,11 +112,12 @@ 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;
|
|
118
|
-
export declare function encodeAcrossBridgeToken(spokePool: Address, depositor: Address, sendingAssetId: Address, receivingAssetId:
|
|
119
|
-
export declare function encodeAcrossBridgeNative(spokePool: Address, depositor: Address, sendingAssetId: Address, receivingAssetId:
|
|
119
|
+
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
|
+
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;
|
|
120
121
|
export declare function encodePermit2TransferFrom(token: Address, receiver: Address, amount: bigint): Hex;
|
|
121
122
|
export declare function encodeNextGenDexUnlock(singleton: Address, id: bigint, d: Hex): Hex;
|
|
122
123
|
export declare function encodeBalancerV3FlashLoan(singleton: Address, poolId: bigint, asset: Address, receiver: Address, amount: bigint, flashData: Hex): Hex;
|