damm-sdk 1.4.18 → 1.4.21
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/index.cjs +689 -46
- package/dist/index.cjs.map +18 -3
- package/dist/index.js +47397 -40297
- package/dist/index.js.map +134 -72
- package/dist/integrations/ccip/ccip.router.abi.d.ts +85 -0
- package/dist/integrations/ccip/ccip.router.abi.d.ts.map +1 -0
- package/dist/integrations/ccip/ccip.router.d.ts +72 -0
- package/dist/integrations/ccip/ccip.router.d.ts.map +1 -0
- package/dist/integrations/ccip/index.d.ts +3 -0
- package/dist/integrations/ccip/index.d.ts.map +1 -0
- package/dist/integrations/index.d.ts +2 -0
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/wormhole/axelar.gmp.api.d.ts +47 -0
- package/dist/integrations/wormhole/axelar.gmp.api.d.ts.map +1 -0
- package/dist/integrations/wormhole/executor.quote.api.d.ts +100 -0
- package/dist/integrations/wormhole/executor.quote.api.d.ts.map +1 -0
- package/dist/integrations/wormhole/gmp.manager.abi.d.ts +32 -0
- package/dist/integrations/wormhole/gmp.manager.abi.d.ts.map +1 -0
- package/dist/integrations/wormhole/gmp.manager.d.ts +65 -0
- package/dist/integrations/wormhole/gmp.manager.d.ts.map +1 -0
- package/dist/integrations/wormhole/index.d.ts +10 -0
- package/dist/integrations/wormhole/index.d.ts.map +1 -0
- package/dist/integrations/wormhole/wormhole.multi.ntt.abi.d.ts +101 -0
- package/dist/integrations/wormhole/wormhole.multi.ntt.abi.d.ts.map +1 -0
- package/dist/integrations/wormhole/wormhole.multi.ntt.d.ts +149 -0
- package/dist/integrations/wormhole/wormhole.multi.ntt.d.ts.map +1 -0
- package/dist/integrations/wormhole/wormhole.scan.api.d.ts +56 -0
- package/dist/integrations/wormhole/wormhole.scan.api.d.ts.map +1 -0
- package/dist/integrations/wormhole/wormhole.transceiver.abi.d.ts +23 -0
- package/dist/integrations/wormhole/wormhole.transceiver.abi.d.ts.map +1 -0
- package/dist/integrations/wormhole/wormhole.transceiver.d.ts +28 -0
- package/dist/integrations/wormhole/wormhole.transceiver.d.ts.map +1 -0
- package/package.json +3 -2
- package/src/integrations/ccip/ccip.router.abi.ts +62 -0
- package/src/integrations/ccip/ccip.router.ts +172 -0
- package/src/integrations/ccip/index.ts +19 -0
- package/src/integrations/index.ts +2 -0
- package/src/integrations/wormhole/axelar.gmp.api.ts +85 -0
- package/src/integrations/wormhole/executor.quote.api.ts +182 -0
- package/src/integrations/wormhole/gmp.manager.abi.ts +26 -0
- package/src/integrations/wormhole/gmp.manager.ts +129 -0
- package/src/integrations/wormhole/index.ts +68 -0
- package/src/integrations/wormhole/wormhole.multi.ntt.abi.ts +68 -0
- package/src/integrations/wormhole/wormhole.multi.ntt.ts +259 -0
- package/src/integrations/wormhole/wormhole.scan.api.ts +95 -0
- package/src/integrations/wormhole/wormhole.transceiver.abi.ts +20 -0
- package/src/integrations/wormhole/wormhole.transceiver.ts +46 -0
- package/src/lib/contractsRegistry.json +6 -2
package/dist/index.cjs
CHANGED
|
@@ -150,9 +150,14 @@ var init_base = __esm(() => {
|
|
|
150
150
|
});
|
|
151
151
|
|
|
152
152
|
// node_modules/viem/_esm/errors/data.js
|
|
153
|
-
var SizeExceedsPaddingSizeError;
|
|
153
|
+
var SliceOffsetOutOfBoundsError, SizeExceedsPaddingSizeError;
|
|
154
154
|
var init_data = __esm(() => {
|
|
155
155
|
init_base();
|
|
156
|
+
SliceOffsetOutOfBoundsError = class SliceOffsetOutOfBoundsError extends BaseError {
|
|
157
|
+
constructor({ offset, position, size: size2 }) {
|
|
158
|
+
super(`Slice ${position === "start" ? "starting" : "ending"} at offset "${offset}" is out-of-bounds (size: ${size2}).`, { name: "SliceOffsetOutOfBoundsError" });
|
|
159
|
+
}
|
|
160
|
+
};
|
|
156
161
|
SizeExceedsPaddingSizeError = class SizeExceedsPaddingSizeError extends BaseError {
|
|
157
162
|
constructor({ size: size2, targetSize, type }) {
|
|
158
163
|
super(`${type.charAt(0).toUpperCase()}${type.slice(1).toLowerCase()} size (${size2}) exceeds padding size (${targetSize}).`, { name: "SizeExceedsPaddingSizeError" });
|
|
@@ -214,6 +219,25 @@ var init_encoding = __esm(() => {
|
|
|
214
219
|
};
|
|
215
220
|
});
|
|
216
221
|
|
|
222
|
+
// node_modules/viem/_esm/utils/data/trim.js
|
|
223
|
+
function trim(hexOrBytes, { dir = "left" } = {}) {
|
|
224
|
+
let data = typeof hexOrBytes === "string" ? hexOrBytes.replace("0x", "") : hexOrBytes;
|
|
225
|
+
let sliceLength = 0;
|
|
226
|
+
for (let i = 0;i < data.length - 1; i++) {
|
|
227
|
+
if (data[dir === "left" ? i : data.length - i - 1].toString() === "0")
|
|
228
|
+
sliceLength++;
|
|
229
|
+
else
|
|
230
|
+
break;
|
|
231
|
+
}
|
|
232
|
+
data = dir === "left" ? data.slice(sliceLength) : data.slice(0, data.length - sliceLength);
|
|
233
|
+
if (typeof hexOrBytes === "string") {
|
|
234
|
+
if (data.length === 1 && dir === "right")
|
|
235
|
+
data = `${data}0`;
|
|
236
|
+
return `0x${data.length % 2 === 1 ? `0${data}` : data}`;
|
|
237
|
+
}
|
|
238
|
+
return data;
|
|
239
|
+
}
|
|
240
|
+
|
|
217
241
|
// node_modules/viem/_esm/utils/encoding/fromHex.js
|
|
218
242
|
function assertSize(hexOrBytes, { size: size2 }) {
|
|
219
243
|
if (size(hexOrBytes) > size2)
|
|
@@ -795,6 +819,67 @@ var init_isAddress = __esm(() => {
|
|
|
795
819
|
isAddressCache = /* @__PURE__ */ new LruMap(8192);
|
|
796
820
|
});
|
|
797
821
|
|
|
822
|
+
// node_modules/viem/_esm/utils/data/concat.js
|
|
823
|
+
function concatHex(values) {
|
|
824
|
+
return `0x${values.reduce((acc, x) => acc + x.replace("0x", ""), "")}`;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
// node_modules/viem/_esm/utils/data/slice.js
|
|
828
|
+
function assertStartOffset(value, start) {
|
|
829
|
+
if (typeof start === "number" && start > 0 && start > size(value) - 1)
|
|
830
|
+
throw new SliceOffsetOutOfBoundsError({
|
|
831
|
+
offset: start,
|
|
832
|
+
position: "start",
|
|
833
|
+
size: size(value)
|
|
834
|
+
});
|
|
835
|
+
}
|
|
836
|
+
function assertEndOffset(value, start, end) {
|
|
837
|
+
if (typeof start === "number" && typeof end === "number" && size(value) !== end - start) {
|
|
838
|
+
throw new SliceOffsetOutOfBoundsError({
|
|
839
|
+
offset: end,
|
|
840
|
+
position: "end",
|
|
841
|
+
size: size(value)
|
|
842
|
+
});
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
function sliceHex(value_, start, end, { strict } = {}) {
|
|
846
|
+
assertStartOffset(value_, start);
|
|
847
|
+
const value = `0x${value_.replace("0x", "").slice((start ?? 0) * 2, (end ?? value_.length) * 2)}`;
|
|
848
|
+
if (strict)
|
|
849
|
+
assertEndOffset(value, start, end);
|
|
850
|
+
return value;
|
|
851
|
+
}
|
|
852
|
+
var init_slice = __esm(() => {
|
|
853
|
+
init_data();
|
|
854
|
+
init_size();
|
|
855
|
+
});
|
|
856
|
+
|
|
857
|
+
// node_modules/viem/_esm/utils/encoding/fromBytes.js
|
|
858
|
+
function bytesToBigInt(bytes, opts = {}) {
|
|
859
|
+
if (typeof opts.size !== "undefined")
|
|
860
|
+
assertSize(bytes, { size: opts.size });
|
|
861
|
+
const hex = bytesToHex(bytes, opts);
|
|
862
|
+
return hexToBigInt(hex, opts);
|
|
863
|
+
}
|
|
864
|
+
function bytesToNumber(bytes, opts = {}) {
|
|
865
|
+
if (typeof opts.size !== "undefined")
|
|
866
|
+
assertSize(bytes, { size: opts.size });
|
|
867
|
+
const hex = bytesToHex(bytes, opts);
|
|
868
|
+
return hexToNumber(hex, opts);
|
|
869
|
+
}
|
|
870
|
+
function bytesToString(bytes_, opts = {}) {
|
|
871
|
+
let bytes = bytes_;
|
|
872
|
+
if (typeof opts.size !== "undefined") {
|
|
873
|
+
assertSize(bytes, { size: opts.size });
|
|
874
|
+
bytes = trim(bytes, { dir: "right" });
|
|
875
|
+
}
|
|
876
|
+
return new TextDecoder().decode(bytes);
|
|
877
|
+
}
|
|
878
|
+
var init_fromBytes = __esm(() => {
|
|
879
|
+
init_fromHex();
|
|
880
|
+
init_toHex();
|
|
881
|
+
});
|
|
882
|
+
|
|
798
883
|
// node_modules/viem/_esm/constants/number.js
|
|
799
884
|
var maxInt8, maxInt16, maxInt24, maxInt32, maxInt40, maxInt48, maxInt56, maxInt64, maxInt72, maxInt80, maxInt88, maxInt96, maxInt104, maxInt112, maxInt120, maxInt128, maxInt136, maxInt144, maxInt152, maxInt160, maxInt168, maxInt176, maxInt184, maxInt192, maxInt200, maxInt208, maxInt216, maxInt224, maxInt232, maxInt240, maxInt248, maxInt256, minInt8, minInt16, minInt24, minInt32, minInt40, minInt48, minInt56, minInt64, minInt72, minInt80, minInt88, minInt96, minInt104, minInt112, minInt120, minInt128, minInt136, minInt144, minInt152, minInt160, minInt168, minInt176, minInt184, minInt192, minInt200, minInt208, minInt216, minInt224, minInt232, minInt240, minInt248, minInt256, maxUint8, maxUint16, maxUint24, maxUint32, maxUint40, maxUint48, maxUint56, maxUint64, maxUint72, maxUint80, maxUint88, maxUint96, maxUint104, maxUint112, maxUint120, maxUint128, maxUint136, maxUint144, maxUint152, maxUint160, maxUint168, maxUint176, maxUint184, maxUint192, maxUint200, maxUint208, maxUint216, maxUint224, maxUint232, maxUint240, maxUint248, maxUint256;
|
|
800
885
|
var init_number = __esm(() => {
|
|
@@ -1686,7 +1771,7 @@ var init_buffer = __esm(() => {
|
|
|
1686
1771
|
return false;
|
|
1687
1772
|
}
|
|
1688
1773
|
};
|
|
1689
|
-
Buffer2.concat = function
|
|
1774
|
+
Buffer2.concat = function concat2(list, length) {
|
|
1690
1775
|
if (!Array.isArray(list))
|
|
1691
1776
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
1692
1777
|
if (list.length === 0)
|
|
@@ -1857,7 +1942,7 @@ var init_buffer = __esm(() => {
|
|
|
1857
1942
|
Buffer2.prototype.toJSON = function toJSON() {
|
|
1858
1943
|
return { type: "Buffer", data: Array.prototype.slice.call(this._arr || this, 0) };
|
|
1859
1944
|
};
|
|
1860
|
-
Buffer2.prototype.slice = function
|
|
1945
|
+
Buffer2.prototype.slice = function slice2(start, end) {
|
|
1861
1946
|
let len2 = this.length;
|
|
1862
1947
|
if (start = ~~start, end = end === undefined ? len2 : ~~end, start < 0) {
|
|
1863
1948
|
if (start += len2, start < 0)
|
|
@@ -7369,7 +7454,7 @@ var require_hash = __commonJS((exports2) => {
|
|
|
7369
7454
|
hash.ripemd160 = hash.ripemd.ripemd160;
|
|
7370
7455
|
});
|
|
7371
7456
|
|
|
7372
|
-
// node_modules/aes-js/index.js
|
|
7457
|
+
// node_modules/@ethersproject/json-wallets/node_modules/aes-js/index.js
|
|
7373
7458
|
var require_aes_js = __commonJS((exports2, module2) => {
|
|
7374
7459
|
(function(root) {
|
|
7375
7460
|
function checkInt2(value) {
|
|
@@ -7436,7 +7521,7 @@ var require_aes_js = __commonJS((exports2, module2) => {
|
|
|
7436
7521
|
}
|
|
7437
7522
|
return coerceArray(result);
|
|
7438
7523
|
}
|
|
7439
|
-
function
|
|
7524
|
+
function fromBytes2(bytes) {
|
|
7440
7525
|
var result = [], i2 = 0;
|
|
7441
7526
|
while (i2 < bytes.length) {
|
|
7442
7527
|
var c = bytes[i2];
|
|
@@ -7455,7 +7540,7 @@ var require_aes_js = __commonJS((exports2, module2) => {
|
|
|
7455
7540
|
}
|
|
7456
7541
|
return {
|
|
7457
7542
|
toBytes: toBytes3,
|
|
7458
|
-
fromBytes
|
|
7543
|
+
fromBytes: fromBytes2
|
|
7459
7544
|
};
|
|
7460
7545
|
}();
|
|
7461
7546
|
var convertHex = function() {
|
|
@@ -7467,7 +7552,7 @@ var require_aes_js = __commonJS((exports2, module2) => {
|
|
|
7467
7552
|
return result;
|
|
7468
7553
|
}
|
|
7469
7554
|
var Hex = "0123456789abcdef";
|
|
7470
|
-
function
|
|
7555
|
+
function fromBytes2(bytes) {
|
|
7471
7556
|
var result = [];
|
|
7472
7557
|
for (var i2 = 0;i2 < bytes.length; i2++) {
|
|
7473
7558
|
var v = bytes[i2];
|
|
@@ -7477,7 +7562,7 @@ var require_aes_js = __commonJS((exports2, module2) => {
|
|
|
7477
7562
|
}
|
|
7478
7563
|
return {
|
|
7479
7564
|
toBytes: toBytes3,
|
|
7480
|
-
fromBytes
|
|
7565
|
+
fromBytes: fromBytes2
|
|
7481
7566
|
};
|
|
7482
7567
|
}();
|
|
7483
7568
|
var numberOfRounds = { 16: 10, 24: 12, 32: 14 };
|
|
@@ -11832,7 +11917,7 @@ var require_lib2 = __commonJS((exports2) => {
|
|
|
11832
11917
|
return logger47.throwArgumentError("invalid arrayify value", "value", value);
|
|
11833
11918
|
}
|
|
11834
11919
|
exports2.arrayify = arrayify2;
|
|
11835
|
-
function
|
|
11920
|
+
function concat4(items) {
|
|
11836
11921
|
var objects = items.map(function(item) {
|
|
11837
11922
|
return arrayify2(item);
|
|
11838
11923
|
});
|
|
@@ -11846,7 +11931,7 @@ var require_lib2 = __commonJS((exports2) => {
|
|
|
11846
11931
|
}, 0);
|
|
11847
11932
|
return addSlice2(result);
|
|
11848
11933
|
}
|
|
11849
|
-
exports2.concat =
|
|
11934
|
+
exports2.concat = concat4;
|
|
11850
11935
|
function stripZeros2(value) {
|
|
11851
11936
|
var result = arrayify2(value);
|
|
11852
11937
|
if (result.length === 0) {
|
|
@@ -12120,7 +12205,7 @@ var require_lib2 = __commonJS((exports2) => {
|
|
|
12120
12205
|
exports2.splitSignature = splitSignature2;
|
|
12121
12206
|
function joinSignature2(signature2) {
|
|
12122
12207
|
signature2 = splitSignature2(signature2);
|
|
12123
|
-
return hexlify2(
|
|
12208
|
+
return hexlify2(concat4([
|
|
12124
12209
|
signature2.r,
|
|
12125
12210
|
signature2.s,
|
|
12126
12211
|
signature2.recoveryParam ? "0x1c" : "0x1b"
|
|
@@ -23219,8 +23304,8 @@ var require_stream = __commonJS((exports2, module2) => {
|
|
|
23219
23304
|
consume(n, hasStrings) {
|
|
23220
23305
|
let data = this.head.data;
|
|
23221
23306
|
if (n < data.length) {
|
|
23222
|
-
let
|
|
23223
|
-
return this.head.data = data.slice(n),
|
|
23307
|
+
let slice3 = data.slice(0, n);
|
|
23308
|
+
return this.head.data = data.slice(n), slice3;
|
|
23224
23309
|
}
|
|
23225
23310
|
if (n === data.length)
|
|
23226
23311
|
return this.shift();
|
|
@@ -44813,6 +44898,8 @@ var require_utils6 = __commonJS((exports2) => {
|
|
|
44813
44898
|
var exports_src = {};
|
|
44814
44899
|
__export(exports_src, {
|
|
44815
44900
|
wrapEthTrx: () => wrapEthTrx,
|
|
44901
|
+
wormholeTransferTrx: () => wormholeTransferTrx,
|
|
44902
|
+
wormholeReceiveMessageTrx: () => wormholeReceiveMessageTrx,
|
|
44816
44903
|
withdrawMorphoVaultTrx: () => withdrawMorphoVaultTrx,
|
|
44817
44904
|
withdrawMorphoVaultAssetTrx: () => withdrawMorphoVaultAssetTrx,
|
|
44818
44905
|
withdrawMorphoBlueTrx: () => withdrawMorphoBlueTrx,
|
|
@@ -44890,6 +44977,8 @@ __export(exports_src, {
|
|
|
44890
44977
|
pendleMerkleClaimTrx: () => pendleMerkleClaimTrx,
|
|
44891
44978
|
pendleMerkleClaimCalldata: () => pendleMerkleClaimCalldata,
|
|
44892
44979
|
pauseVaultTrx: () => pauseVaultTrx,
|
|
44980
|
+
parseSignedQuote: () => parseSignedQuote,
|
|
44981
|
+
normalizeEmitterForVaaLookup: () => normalizeEmitterForVaaLookup,
|
|
44893
44982
|
merklClaimTrx: () => merklClaimTrx,
|
|
44894
44983
|
merklClaimCalldata: () => merklClaimCalldata,
|
|
44895
44984
|
merklAbi: () => merkl_distributor_abi_default,
|
|
@@ -44899,9 +44988,18 @@ __export(exports_src, {
|
|
|
44899
44988
|
lagoonV1FactoryAbi: () => factory_abi_default,
|
|
44900
44989
|
initiateVaultClosingTrx: () => initiateVaultClosingTrx,
|
|
44901
44990
|
gnosisTrx: () => gnosisTrx,
|
|
44991
|
+
getWormholeScanApiUrl: () => getWormholeScanApiUrl,
|
|
44992
|
+
getWormholeChainId: () => getWormholeChainId,
|
|
44902
44993
|
getGnosisTrxSimulationResult: () => getGnosisTrxSimulationResult,
|
|
44994
|
+
getExecutorApiUrl: () => getExecutorApiUrl,
|
|
44995
|
+
getCCIPChainSelector: () => getCCIPChainSelector,
|
|
44996
|
+
getAxelarGmpApiUrl: () => getAxelarGmpApiUrl,
|
|
44903
44997
|
getAddressOrThrow: () => getAddressOrThrow,
|
|
44904
44998
|
getAddressNameOrThrow: () => getAddressNameOrThrow,
|
|
44999
|
+
fetchWormholeVAA: () => fetchWormholeVAA,
|
|
45000
|
+
fetchExecutorTxStatus: () => fetchExecutorTxStatus,
|
|
45001
|
+
fetchExecutorQuote: () => fetchExecutorQuote,
|
|
45002
|
+
fetchAxelarGmpStatus: () => fetchAxelarGmpStatus,
|
|
44905
45003
|
executeTrx: () => executeTrx,
|
|
44906
45004
|
executeNextTx: () => executeNextTx,
|
|
44907
45005
|
executeGnosisTrx: () => executeGnosisTrx,
|
|
@@ -44909,6 +45007,7 @@ __export(exports_src, {
|
|
|
44909
45007
|
execWithRoleReturnDataTrx: () => execWithRoleReturnDataTrx,
|
|
44910
45008
|
execTransactionWithDelay: () => execTransactionWithDelay,
|
|
44911
45009
|
execTransactionFromModuleTrx: () => execTransactionFromModuleTrx,
|
|
45010
|
+
encodeTransceiverInstructions: () => encodeTransceiverInstructions,
|
|
44912
45011
|
depositToLendleTrx: () => depositToLendleTrx,
|
|
44913
45012
|
depositSyrupVaultTrx: () => depositSyrupVaultTrx,
|
|
44914
45013
|
depositOriginArmWethTrx: () => depositOriginArmWethTrx,
|
|
@@ -44919,14 +45018,21 @@ __export(exports_src, {
|
|
|
44919
45018
|
depositGearboxVaultTrx: () => depositGearboxVaultTrx,
|
|
44920
45019
|
depositForBurnToCctpTrx: () => depositForBurnToCctpTrx,
|
|
44921
45020
|
depositFluidLiteTrx: () => depositFluidLiteTrx,
|
|
45021
|
+
decodeVaaBase64: () => decodeVaaBase64,
|
|
45022
|
+
decodeQuoteDeliveryPriceResult: () => decodeQuoteDeliveryPriceResult,
|
|
44922
45023
|
createVaultProxyTrx: () => createVaultProxyTrx,
|
|
44923
45024
|
createOrderTrx: () => createOrderTrx,
|
|
44924
45025
|
createCall: () => createCall,
|
|
44925
45026
|
closeVaultTrx: () => closeVaultTrx,
|
|
44926
45027
|
claimRedeemOriginArmTrx: () => claimRedeemOriginArmTrx,
|
|
44927
45028
|
claimFundingFeesTrx: () => claimFundingFeesTrx,
|
|
45029
|
+
ccipSendTrx: () => ccipSendTrx,
|
|
44928
45030
|
cancelOrderTrx: () => cancelOrderTrx,
|
|
44929
45031
|
calculateDeterministicVaultAddress: () => calculateDeterministicVaultAddress,
|
|
45032
|
+
buildWormholeTransferArgsFromAvatar: () => buildWormholeTransferArgsFromAvatar,
|
|
45033
|
+
buildRelayInstructions: () => buildRelayInstructions,
|
|
45034
|
+
buildMonadDefaultTransceiverInstructions: () => buildMonadDefaultTransceiverInstructions,
|
|
45035
|
+
buildCCIPMessage: () => buildCCIPMessage,
|
|
44930
45036
|
borrowMorphoBlueTrx: () => borrowMorphoBlueTrx,
|
|
44931
45037
|
borrowFromLendleTrx: () => borrowFromLendleTrx,
|
|
44932
45038
|
borrowFromAaveV3Trx: () => borrowFromAaveV3Trx,
|
|
@@ -44934,11 +45040,18 @@ __export(exports_src, {
|
|
|
44934
45040
|
approveTokenThroughPermit2: () => approveTokenThroughPermit2,
|
|
44935
45041
|
approveErc721Trx: () => approveErc721Trx,
|
|
44936
45042
|
approveERC20Trx: () => approveERC20Trx,
|
|
45043
|
+
addressToBytes32: () => addressToBytes32,
|
|
44937
45044
|
addToVaultWhitelistTrx: () => addToVaultWhitelistTrx,
|
|
44938
45045
|
ZodiacRolesAbi: () => zodiac_roles_abi_default,
|
|
44939
45046
|
ZodiacDelayAbi: () => zodiac_delay_abi_default,
|
|
44940
45047
|
ZERO_ADDRESS: () => ZERO_ADDRESS,
|
|
44941
45048
|
WrapEthCalldata: () => WrapEthCalldata,
|
|
45049
|
+
WormholeTransferCalldata: () => WormholeTransferCalldata,
|
|
45050
|
+
WormholeTransceiverAbi: () => wormhole_transceiver_abi_default,
|
|
45051
|
+
WormholeReceiveMessageCalldata: () => WormholeReceiveMessageCalldata,
|
|
45052
|
+
WormholeMultiNttAbi: () => wormhole_multi_ntt_abi_default,
|
|
45053
|
+
WormholeGmpManagerAbi: () => gmp_manager_abi_default,
|
|
45054
|
+
WormholeCalculateFeeCalldata: () => WormholeCalculateFeeCalldata,
|
|
44942
45055
|
WithdrawMorphoVaultCalldata: () => WithdrawMorphoVaultCalldata,
|
|
44943
45056
|
WithdrawMorphoVaultAssetCalldata: () => WithdrawMorphoVaultAssetCalldata,
|
|
44944
45057
|
WithdrawMorphoBlueCalldata: () => WithdrawMorphoBlueCalldata,
|
|
@@ -44950,6 +45063,11 @@ __export(exports_src, {
|
|
|
44950
45063
|
WithdrawFluidLiteCalldata: () => WithdrawFluidLiteCalldata,
|
|
44951
45064
|
WithdrawCollateralMorphoBlueCalldata: () => WithdrawCollateralMorphoBlueCalldata,
|
|
44952
45065
|
WethAbi: () => weth_abi_default,
|
|
45066
|
+
WORMHOLE_EXECUTOR_API_TESTNET: () => WORMHOLE_EXECUTOR_API_TESTNET,
|
|
45067
|
+
WORMHOLE_EXECUTOR_API_MAINNET: () => WORMHOLE_EXECUTOR_API_MAINNET,
|
|
45068
|
+
WORMHOLE_CHAIN_IDS: () => WORMHOLE_CHAIN_IDS,
|
|
45069
|
+
WORMHOLESCAN_API_TESTNET: () => WORMHOLESCAN_API_TESTNET,
|
|
45070
|
+
WORMHOLESCAN_API_MAINNET: () => WORMHOLESCAN_API_MAINNET,
|
|
44953
45071
|
UpdateTotalAssetsLifespanCalldata: () => UpdateTotalAssetsLifespanCalldata,
|
|
44954
45072
|
UpdateOrderCalldata: () => UpdateOrderCalldata,
|
|
44955
45073
|
UnwrapWethCalldata: () => UnwrapWethCalldata,
|
|
@@ -45033,6 +45151,8 @@ __export(exports_src, {
|
|
|
45033
45151
|
MorphoBlueAbi: () => morpho_blue_abi_default,
|
|
45034
45152
|
LendlePoolAbi: () => lendle_pool_abi_default,
|
|
45035
45153
|
InitiateClosingCalldata: () => InitiateClosingCalldata,
|
|
45154
|
+
GmpManagerQuoteDeliveryPriceTrx: () => GmpManagerQuoteDeliveryPriceTrx,
|
|
45155
|
+
GmpManagerQuoteDeliveryPriceCalldata: () => GmpManagerQuoteDeliveryPriceCalldata,
|
|
45036
45156
|
GMX_EXCHANGE_ROUTER_ARB: () => GMX_EXCHANGE_ROUTER_ARB,
|
|
45037
45157
|
GMXExchangeRouterAbi: () => exchange_router_abi_default,
|
|
45038
45158
|
FluidLiteAbi: () => fluid_lite_abi_default,
|
|
@@ -45052,6 +45172,7 @@ __export(exports_src, {
|
|
|
45052
45172
|
DelayedTransactionCalldata: () => DelayedTransactionCalldata,
|
|
45053
45173
|
DecreasePositionSwapType: () => DecreasePositionSwapType,
|
|
45054
45174
|
DELEGATE_CALL_OP_CODE: () => DELEGATE_CALL_OP_CODE,
|
|
45175
|
+
DEFAULT_NTT_REDEMPTION_GAS_LIMIT: () => DEFAULT_NTT_REDEMPTION_GAS_LIMIT,
|
|
45055
45176
|
DAI_ARB: () => DAI_ARB,
|
|
45056
45177
|
CreateVaultProxyCalldata: () => CreateVaultProxyCalldata,
|
|
45057
45178
|
CreateOrderCalldata: () => CreateOrderCalldata,
|
|
@@ -45062,6 +45183,11 @@ __export(exports_src, {
|
|
|
45062
45183
|
CctpTokenMessengerV2Abi: () => token_messenger_v2_abi_default,
|
|
45063
45184
|
CctpMessageTransmitterV2Abi: () => message_transmitter_v2_abi_default,
|
|
45064
45185
|
CancelOrderCalldata: () => CancelOrderCalldata,
|
|
45186
|
+
CCIP_CHAIN_SELECTORS: () => CCIP_CHAIN_SELECTORS,
|
|
45187
|
+
CCIPSendCalldata: () => CCIPSendCalldata,
|
|
45188
|
+
CCIPRouterAbi: () => ccip_router_abi_default,
|
|
45189
|
+
CCIPGetFeeTrx: () => CCIPGetFeeTrx,
|
|
45190
|
+
CCIPGetFeeCalldata: () => CCIPGetFeeCalldata,
|
|
45065
45191
|
CALL_OP_CODE: () => CALL_OP_CODE,
|
|
45066
45192
|
BorrowMorphoBlueCalldata: () => BorrowMorphoBlueCalldata,
|
|
45067
45193
|
BorrowFromLendleCalldata: () => BorrowFromLendleCalldata,
|
|
@@ -45071,7 +45197,9 @@ __export(exports_src, {
|
|
|
45071
45197
|
AddToVaultWhitelistCalldata: () => AddToVaultWhitelistCalldata,
|
|
45072
45198
|
Actions: () => Actions2,
|
|
45073
45199
|
AaveL2PoolAbi: () => aave_pool_L2_abi_default,
|
|
45074
|
-
AaveL1PoolAbi: () => aave_pool_abi_default
|
|
45200
|
+
AaveL1PoolAbi: () => aave_pool_abi_default,
|
|
45201
|
+
AXELAR_GMP_API_TESTNET: () => AXELAR_GMP_API_TESTNET,
|
|
45202
|
+
AXELAR_GMP_API_MAINNET: () => AXELAR_GMP_API_MAINNET
|
|
45075
45203
|
});
|
|
45076
45204
|
module.exports = __toCommonJS(exports_src);
|
|
45077
45205
|
|
|
@@ -45468,10 +45596,14 @@ var erc721_abi_default = [
|
|
|
45468
45596
|
var zeroAddress = "0x0000000000000000000000000000000000000000";
|
|
45469
45597
|
// node_modules/viem/_esm/index.js
|
|
45470
45598
|
init_number();
|
|
45599
|
+
init_toBytes();
|
|
45471
45600
|
init_toHex();
|
|
45601
|
+
init_fromBytes();
|
|
45472
45602
|
init_fromHex();
|
|
45473
45603
|
init_getAddress();
|
|
45474
45604
|
init_pad();
|
|
45605
|
+
init_size();
|
|
45606
|
+
init_slice();
|
|
45475
45607
|
|
|
45476
45608
|
// src/types/primitives.ts
|
|
45477
45609
|
var createCall = (call) => {
|
|
@@ -45891,7 +46023,7 @@ function arrayify(value, options) {
|
|
|
45891
46023
|
}
|
|
45892
46024
|
return logger.throwArgumentError("invalid arrayify value", "value", value);
|
|
45893
46025
|
}
|
|
45894
|
-
function
|
|
46026
|
+
function concat3(items) {
|
|
45895
46027
|
const objects = items.map((item) => arrayify(item));
|
|
45896
46028
|
const length = objects.reduce((accum, item) => accum + item.length, 0);
|
|
45897
46029
|
const result = new Uint8Array(length);
|
|
@@ -46163,7 +46295,7 @@ function splitSignature(signature) {
|
|
|
46163
46295
|
}
|
|
46164
46296
|
function joinSignature(signature) {
|
|
46165
46297
|
signature = splitSignature(signature);
|
|
46166
|
-
return hexlify(
|
|
46298
|
+
return hexlify(concat3([
|
|
46167
46299
|
signature.r,
|
|
46168
46300
|
signature.s,
|
|
46169
46301
|
signature.recoveryParam ? "0x1c" : "0x1b"
|
|
@@ -47777,13 +47909,13 @@ class Writer {
|
|
|
47777
47909
|
return data.length;
|
|
47778
47910
|
}
|
|
47779
47911
|
appendWriter(writer) {
|
|
47780
|
-
return this._writeData(
|
|
47912
|
+
return this._writeData(concat3(writer._data));
|
|
47781
47913
|
}
|
|
47782
47914
|
writeBytes(value) {
|
|
47783
47915
|
let bytes = arrayify(value);
|
|
47784
47916
|
const paddingOffset = bytes.length % this.wordSize;
|
|
47785
47917
|
if (paddingOffset) {
|
|
47786
|
-
bytes =
|
|
47918
|
+
bytes = concat3([bytes, this._padding.slice(paddingOffset)]);
|
|
47787
47919
|
}
|
|
47788
47920
|
return this._writeData(bytes);
|
|
47789
47921
|
}
|
|
@@ -47796,7 +47928,7 @@ class Writer {
|
|
|
47796
47928
|
});
|
|
47797
47929
|
}
|
|
47798
47930
|
if (bytes.length % this.wordSize) {
|
|
47799
|
-
bytes =
|
|
47931
|
+
bytes = concat3([this._padding.slice(bytes.length % this.wordSize), bytes]);
|
|
47800
47932
|
}
|
|
47801
47933
|
return bytes;
|
|
47802
47934
|
}
|
|
@@ -48108,7 +48240,7 @@ function getCreate2Address(from2, salt, initCodeHash) {
|
|
|
48108
48240
|
if (hexDataLength(initCodeHash) !== 32) {
|
|
48109
48241
|
logger8.throwArgumentError("initCodeHash must be 32 bytes", "initCodeHash", initCodeHash);
|
|
48110
48242
|
}
|
|
48111
|
-
return getAddress2(hexDataSlice(keccak2562(
|
|
48243
|
+
return getAddress2(hexDataSlice(keccak2562(concat3(["0xff", getAddress2(from2), salt, initCodeHash])), 12));
|
|
48112
48244
|
}
|
|
48113
48245
|
|
|
48114
48246
|
// node_modules/@ethersproject/abi/lib.esm/coders/address.js
|
|
@@ -48700,7 +48832,7 @@ function formatBytes32String(text) {
|
|
|
48700
48832
|
if (bytes.length > 31) {
|
|
48701
48833
|
throw new Error("bytes32 string must be less than 32 bytes");
|
|
48702
48834
|
}
|
|
48703
|
-
return hexlify(
|
|
48835
|
+
return hexlify(concat3([bytes, HashZero]).slice(0, 32));
|
|
48704
48836
|
}
|
|
48705
48837
|
function parseBytes32String(bytes) {
|
|
48706
48838
|
const data = arrayify(bytes);
|
|
@@ -49441,12 +49573,12 @@ function namehash(name) {
|
|
|
49441
49573
|
let result = Zeros;
|
|
49442
49574
|
const comps = ensNameSplit(name);
|
|
49443
49575
|
while (comps.length) {
|
|
49444
|
-
result = keccak2562(
|
|
49576
|
+
result = keccak2562(concat3([result, keccak2562(comps.pop())]));
|
|
49445
49577
|
}
|
|
49446
49578
|
return hexlify(result);
|
|
49447
49579
|
}
|
|
49448
49580
|
function dnsEncode(name) {
|
|
49449
|
-
return hexlify(
|
|
49581
|
+
return hexlify(concat3(ensNameSplit(name).map((comp) => {
|
|
49450
49582
|
if (comp.length > 63) {
|
|
49451
49583
|
throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");
|
|
49452
49584
|
}
|
|
@@ -49464,7 +49596,7 @@ function hashMessage(message) {
|
|
|
49464
49596
|
if (typeof message === "string") {
|
|
49465
49597
|
message = toUtf8Bytes(message);
|
|
49466
49598
|
}
|
|
49467
|
-
return keccak2562(
|
|
49599
|
+
return keccak2562(concat3([
|
|
49468
49600
|
toUtf8Bytes(messagePrefix),
|
|
49469
49601
|
toUtf8Bytes(String(message.length)),
|
|
49470
49602
|
message
|
|
@@ -50118,7 +50250,7 @@ class Interface {
|
|
|
50118
50250
|
if (typeof fragment === "string") {
|
|
50119
50251
|
fragment = this.getError(fragment);
|
|
50120
50252
|
}
|
|
50121
|
-
return hexlify(
|
|
50253
|
+
return hexlify(concat3([
|
|
50122
50254
|
this.getSighash(fragment),
|
|
50123
50255
|
this._encodeParams(fragment.inputs, values || [])
|
|
50124
50256
|
]));
|
|
@@ -50137,7 +50269,7 @@ class Interface {
|
|
|
50137
50269
|
if (typeof functionFragment === "string") {
|
|
50138
50270
|
functionFragment = this.getFunction(functionFragment);
|
|
50139
50271
|
}
|
|
50140
|
-
return hexlify(
|
|
50272
|
+
return hexlify(concat3([
|
|
50141
50273
|
this.getSighash(functionFragment),
|
|
50142
50274
|
this._encodeParams(functionFragment.inputs, values || [])
|
|
50143
50275
|
]));
|
|
@@ -50316,7 +50448,7 @@ class Interface {
|
|
|
50316
50448
|
dynamic.push(false);
|
|
50317
50449
|
}
|
|
50318
50450
|
});
|
|
50319
|
-
let resultIndexed = topics != null ? this._abiCoder.decode(indexed,
|
|
50451
|
+
let resultIndexed = topics != null ? this._abiCoder.decode(indexed, concat3(topics)) : null;
|
|
50320
50452
|
let resultNonIndexed = this._abiCoder.decode(nonIndexed, data, true);
|
|
50321
50453
|
let result = [];
|
|
50322
50454
|
let nonIndexedIndex = 0, indexedIndex = 0;
|
|
@@ -53899,7 +54031,7 @@ class ContractFactory {
|
|
|
53899
54031
|
}
|
|
53900
54032
|
}
|
|
53901
54033
|
logger19.checkArgumentCount(args.length, this.interface.deploy.inputs.length, " in Contract constructor");
|
|
53902
|
-
tx.data = hexlify(
|
|
54034
|
+
tx.data = hexlify(concat3([
|
|
53903
54035
|
this.bytecode,
|
|
53904
54036
|
this.interface.encodeDeploy(args)
|
|
53905
54037
|
]));
|
|
@@ -54198,7 +54330,7 @@ function bytes32(value) {
|
|
|
54198
54330
|
return hexZeroPad(hexlify(value), 32);
|
|
54199
54331
|
}
|
|
54200
54332
|
function base58check(data) {
|
|
54201
|
-
return Base58.encode(
|
|
54333
|
+
return Base58.encode(concat3([data, hexDataSlice(sha256(sha256(data)), 0, 4)]));
|
|
54202
54334
|
}
|
|
54203
54335
|
function getWordlist(wordlist2) {
|
|
54204
54336
|
if (wordlist2 == null) {
|
|
@@ -54250,13 +54382,13 @@ class HDNode {
|
|
|
54250
54382
|
if (this.depth >= 256) {
|
|
54251
54383
|
throw new Error("Depth too large!");
|
|
54252
54384
|
}
|
|
54253
|
-
return base58check(
|
|
54385
|
+
return base58check(concat3([
|
|
54254
54386
|
this.privateKey != null ? "0x0488ADE4" : "0x0488B21E",
|
|
54255
54387
|
hexlify(this.depth),
|
|
54256
54388
|
this.parentFingerprint,
|
|
54257
54389
|
hexZeroPad(hexlify(this.index), 4),
|
|
54258
54390
|
this.chainCode,
|
|
54259
|
-
this.privateKey != null ?
|
|
54391
|
+
this.privateKey != null ? concat3(["0x00", this.privateKey]) : this.publicKey
|
|
54260
54392
|
]));
|
|
54261
54393
|
}
|
|
54262
54394
|
neuter() {
|
|
@@ -54689,7 +54821,7 @@ function _decrypt(data, key2, ciphertext) {
|
|
|
54689
54821
|
}
|
|
54690
54822
|
function _getAccount(data, key2) {
|
|
54691
54823
|
const ciphertext = looseArrayify(searchPath(data, "crypto/ciphertext"));
|
|
54692
|
-
const computedMAC = hexlify(keccak2562(
|
|
54824
|
+
const computedMAC = hexlify(keccak2562(concat3([key2.slice(16, 32), ciphertext]))).substring(2);
|
|
54693
54825
|
if (computedMAC !== searchPath(data, "crypto/mac").toLowerCase()) {
|
|
54694
54826
|
throw new Error("invalid password");
|
|
54695
54827
|
}
|
|
@@ -54881,7 +55013,7 @@ function encrypt(account, password, options, progressCallback) {
|
|
|
54881
55013
|
const counter = new import_aes_js2.default.Counter(iv);
|
|
54882
55014
|
const aesCtr = new import_aes_js2.default.ModeOfOperation.ctr(derivedKey, counter);
|
|
54883
55015
|
const ciphertext = arrayify(aesCtr.encrypt(privateKey));
|
|
54884
|
-
const mac = keccak2562(
|
|
55016
|
+
const mac = keccak2562(concat3([macPrefix, ciphertext]));
|
|
54885
55017
|
const data = {
|
|
54886
55018
|
address: account.address.substring(2).toLowerCase(),
|
|
54887
55019
|
id: uuidV4(uuidRandom),
|
|
@@ -55104,7 +55236,7 @@ class Wallet extends Signer {
|
|
|
55104
55236
|
options = {};
|
|
55105
55237
|
}
|
|
55106
55238
|
if (options.extraEntropy) {
|
|
55107
|
-
entropy = arrayify(hexDataSlice(keccak2562(
|
|
55239
|
+
entropy = arrayify(hexDataSlice(keccak2562(concat3([entropy, options.extraEntropy])), 0, 16));
|
|
55108
55240
|
}
|
|
55109
55241
|
const mnemonic = entropyToMnemonic(entropy, options.locale);
|
|
55110
55242
|
return Wallet.fromMnemonic(mnemonic, options.path, options.locale);
|
|
@@ -56425,7 +56557,7 @@ function bytes32ify(value) {
|
|
|
56425
56557
|
return hexZeroPad(BigNumber.from(value).toHexString(), 32);
|
|
56426
56558
|
}
|
|
56427
56559
|
function base58Encode(data) {
|
|
56428
|
-
return Base58.encode(
|
|
56560
|
+
return Base58.encode(concat3([data, hexDataSlice(sha256(sha256(data)), 0, 4)]));
|
|
56429
56561
|
}
|
|
56430
56562
|
var matcherIpfs = new RegExp("^(ipfs)://(.*)$", "i");
|
|
56431
56563
|
var matchers = [
|
|
@@ -56573,7 +56705,7 @@ class Resolver {
|
|
|
56573
56705
|
if (p2pkh) {
|
|
56574
56706
|
const length = parseInt(p2pkh[1], 16);
|
|
56575
56707
|
if (p2pkh[2].length === length * 2 && length >= 1 && length <= 75) {
|
|
56576
|
-
return base58Encode(
|
|
56708
|
+
return base58Encode(concat3([[coinInfo.p2pkh], "0x" + p2pkh[2]]));
|
|
56577
56709
|
}
|
|
56578
56710
|
}
|
|
56579
56711
|
}
|
|
@@ -56582,7 +56714,7 @@ class Resolver {
|
|
|
56582
56714
|
if (p2sh) {
|
|
56583
56715
|
const length = parseInt(p2sh[1], 16);
|
|
56584
56716
|
if (p2sh[2].length === length * 2 && length >= 1 && length <= 75) {
|
|
56585
|
-
return base58Encode(
|
|
56717
|
+
return base58Encode(concat3([[coinInfo.p2sh], "0x" + p2sh[2]]));
|
|
56586
56718
|
}
|
|
56587
56719
|
}
|
|
56588
56720
|
}
|
|
@@ -56778,9 +56910,9 @@ class Resolver {
|
|
|
56778
56910
|
getText(key2) {
|
|
56779
56911
|
return __awaiter10(this, undefined, undefined, function* () {
|
|
56780
56912
|
let keyBytes = toUtf8Bytes(key2);
|
|
56781
|
-
keyBytes =
|
|
56913
|
+
keyBytes = concat3([bytes32ify(64), bytes32ify(keyBytes.length), keyBytes]);
|
|
56782
56914
|
if (keyBytes.length % 32 !== 0) {
|
|
56783
|
-
keyBytes =
|
|
56915
|
+
keyBytes = concat3([keyBytes, hexZeroPad("0x", 32 - key2.length % 32)]);
|
|
56784
56916
|
}
|
|
56785
56917
|
const hexBytes = yield this._fetchBytes("0x59d1d43c", hexlify(keyBytes));
|
|
56786
56918
|
if (hexBytes == null || hexBytes === "0x") {
|
|
@@ -60726,7 +60858,7 @@ __export(exports_utils, {
|
|
|
60726
60858
|
defaultPath: () => defaultPath,
|
|
60727
60859
|
defaultAbiCoder: () => defaultAbiCoder,
|
|
60728
60860
|
deepCopy: () => deepCopy,
|
|
60729
|
-
concat: () =>
|
|
60861
|
+
concat: () => concat3,
|
|
60730
60862
|
computePublicKey: () => computePublicKey,
|
|
60731
60863
|
computeHmac: () => computeHmac,
|
|
60732
60864
|
computeAddress: () => computeAddress,
|
|
@@ -60827,7 +60959,7 @@ function _pack(type, value, isArray) {
|
|
|
60827
60959
|
value.forEach(function(value2) {
|
|
60828
60960
|
result.push(_pack(baseType, value2, true));
|
|
60829
60961
|
});
|
|
60830
|
-
return
|
|
60962
|
+
return concat3(result);
|
|
60831
60963
|
}
|
|
60832
60964
|
return logger44.throwArgumentError("invalid type", "type", type);
|
|
60833
60965
|
}
|
|
@@ -60839,7 +60971,7 @@ function pack2(types, values) {
|
|
|
60839
60971
|
types.forEach(function(type, index) {
|
|
60840
60972
|
tight.push(_pack(type, values[index]));
|
|
60841
60973
|
});
|
|
60842
|
-
return hexlify(
|
|
60974
|
+
return hexlify(concat3(tight));
|
|
60843
60975
|
}
|
|
60844
60976
|
function keccak2563(types, values) {
|
|
60845
60977
|
return keccak2562(pack2(types, values));
|
|
@@ -62057,7 +62189,9 @@ var contractsRegistry_default = {
|
|
|
62057
62189
|
wormhole: {
|
|
62058
62190
|
executor: "0x84EEe8dBa37C36947397E1E11251cA9A06Fc6F8a",
|
|
62059
62191
|
multiTokenNTT: "0x556790e948b9920A8868bCAFcC87D25e82e8a075",
|
|
62060
|
-
multiNTTWithExecutor: "0x03dB430D830601DB368991eE55DAa9A708df7912"
|
|
62192
|
+
multiNTTWithExecutor: "0x03dB430D830601DB368991eE55DAa9A708df7912",
|
|
62193
|
+
gmpManager: "0xc6793a32761a11e96c97A3D18fC6545ea931F0E9",
|
|
62194
|
+
genericWormholeTransceiver: "0x9D0eADF3fc10380C4D2F5ba79499C6194549C7D2"
|
|
62061
62195
|
},
|
|
62062
62196
|
"1inch": {
|
|
62063
62197
|
aggregatorV6: "0x111111125421cA6dc452d289314280a0f8842A65"
|
|
@@ -62451,7 +62585,9 @@ var contractsRegistry_default = {
|
|
|
62451
62585
|
wormhole: {
|
|
62452
62586
|
executor: "0xC04dE634982cAdF2A677310b73630B7Ac56A3f65",
|
|
62453
62587
|
multiTokenNTT: "0x36878C6FCa7e0E8a88F90dc410CfBBcA5B695C95",
|
|
62454
|
-
multiNTTWithExecutor: "0xFEA937F7124E19124671f1685671d3f04a9Af4E4"
|
|
62588
|
+
multiNTTWithExecutor: "0xFEA937F7124E19124671f1685671d3f04a9Af4E4",
|
|
62589
|
+
gmpManager: "0x92957b3D0CaB3eA7110fEd1ccc4eF564981a59Fc",
|
|
62590
|
+
genericWormholeTransceiver: "0x1a0f31492Ca69DF6A82906Ce88613AeCD9245C44"
|
|
62455
62591
|
},
|
|
62456
62592
|
enso: {
|
|
62457
62593
|
routerV2: "0xCfBAa9Cfce952Ca4F4069874fF1Df8c05e37a3c7"
|
|
@@ -73654,7 +73790,7 @@ function computeZksyncCreate2Address(sender, bytecodeHash, salt, input) {
|
|
|
73654
73790
|
}
|
|
73655
73791
|
var prefix2 = keccak2562(toUtf8Bytes("zksyncCreate2"));
|
|
73656
73792
|
var inputHash = keccak2562(input);
|
|
73657
|
-
var addressBytes = keccak2562(
|
|
73793
|
+
var addressBytes = keccak2562(concat3([prefix2, hexZeroPad(sender, 32), salt, bytecodeHash, inputHash])).slice(26);
|
|
73658
73794
|
return getAddress2(addressBytes);
|
|
73659
73795
|
}
|
|
73660
73796
|
var MAX_SAFE_INTEGER3 = /* @__PURE__ */ import_jsbi3.default.BigInt(Number.MAX_SAFE_INTEGER);
|
|
@@ -93908,6 +94044,147 @@ var sendOFTTrx = ({
|
|
|
93908
94044
|
value: args.nativeFee
|
|
93909
94045
|
});
|
|
93910
94046
|
};
|
|
94047
|
+
// src/integrations/ccip/ccip.router.abi.ts
|
|
94048
|
+
var ccip_router_abi_default = [
|
|
94049
|
+
{
|
|
94050
|
+
inputs: [
|
|
94051
|
+
{ name: "destinationChainSelector", type: "uint64" },
|
|
94052
|
+
{
|
|
94053
|
+
name: "message",
|
|
94054
|
+
type: "tuple",
|
|
94055
|
+
components: [
|
|
94056
|
+
{ name: "receiver", type: "bytes" },
|
|
94057
|
+
{ name: "data", type: "bytes" },
|
|
94058
|
+
{
|
|
94059
|
+
name: "tokenAmounts",
|
|
94060
|
+
type: "tuple[]",
|
|
94061
|
+
components: [
|
|
94062
|
+
{ name: "token", type: "address" },
|
|
94063
|
+
{ name: "amount", type: "uint256" }
|
|
94064
|
+
]
|
|
94065
|
+
},
|
|
94066
|
+
{ name: "feeToken", type: "address" },
|
|
94067
|
+
{ name: "extraArgs", type: "bytes" }
|
|
94068
|
+
]
|
|
94069
|
+
}
|
|
94070
|
+
],
|
|
94071
|
+
name: "ccipSend",
|
|
94072
|
+
outputs: [{ name: "messageId", type: "bytes32" }],
|
|
94073
|
+
stateMutability: "payable",
|
|
94074
|
+
type: "function"
|
|
94075
|
+
},
|
|
94076
|
+
{
|
|
94077
|
+
inputs: [
|
|
94078
|
+
{ name: "destinationChainSelector", type: "uint64" },
|
|
94079
|
+
{
|
|
94080
|
+
name: "message",
|
|
94081
|
+
type: "tuple",
|
|
94082
|
+
components: [
|
|
94083
|
+
{ name: "receiver", type: "bytes" },
|
|
94084
|
+
{ name: "data", type: "bytes" },
|
|
94085
|
+
{
|
|
94086
|
+
name: "tokenAmounts",
|
|
94087
|
+
type: "tuple[]",
|
|
94088
|
+
components: [
|
|
94089
|
+
{ name: "token", type: "address" },
|
|
94090
|
+
{ name: "amount", type: "uint256" }
|
|
94091
|
+
]
|
|
94092
|
+
},
|
|
94093
|
+
{ name: "feeToken", type: "address" },
|
|
94094
|
+
{ name: "extraArgs", type: "bytes" }
|
|
94095
|
+
]
|
|
94096
|
+
}
|
|
94097
|
+
],
|
|
94098
|
+
name: "getFee",
|
|
94099
|
+
outputs: [{ name: "fee", type: "uint256" }],
|
|
94100
|
+
stateMutability: "view",
|
|
94101
|
+
type: "function"
|
|
94102
|
+
}
|
|
94103
|
+
];
|
|
94104
|
+
// src/integrations/ccip/ccip.router.ts
|
|
94105
|
+
var ccipRouterInterface = new exports_ethers.utils.Interface(ccip_router_abi_default);
|
|
94106
|
+
var CCIP_CHAIN_SELECTORS = Object.freeze({
|
|
94107
|
+
1: "5009297550715157269",
|
|
94108
|
+
42161: "4949039107694359620",
|
|
94109
|
+
8453: "15971525489660198786",
|
|
94110
|
+
10: "3734403246176062136",
|
|
94111
|
+
137: "4051577828743386545",
|
|
94112
|
+
56: "11344663589394136015",
|
|
94113
|
+
143: "8481857512324358265"
|
|
94114
|
+
});
|
|
94115
|
+
var getCCIPChainSelector = (chainId) => {
|
|
94116
|
+
const selector = CCIP_CHAIN_SELECTORS[chainId];
|
|
94117
|
+
if (!selector) {
|
|
94118
|
+
throw new Error(`CCIP: No chain selector for chainId ${chainId}`);
|
|
94119
|
+
}
|
|
94120
|
+
return selector;
|
|
94121
|
+
};
|
|
94122
|
+
var CCIPGetFeeCalldata = (args) => {
|
|
94123
|
+
return ccipRouterInterface.encodeFunctionData("getFee", [
|
|
94124
|
+
args.destinationChainSelector,
|
|
94125
|
+
{
|
|
94126
|
+
receiver: args.message.receiver,
|
|
94127
|
+
data: args.message.data,
|
|
94128
|
+
tokenAmounts: args.message.tokenAmounts.map((t) => ({
|
|
94129
|
+
token: t.token,
|
|
94130
|
+
amount: t.amount
|
|
94131
|
+
})),
|
|
94132
|
+
feeToken: args.message.feeToken,
|
|
94133
|
+
extraArgs: args.message.extraArgs
|
|
94134
|
+
}
|
|
94135
|
+
]);
|
|
94136
|
+
};
|
|
94137
|
+
var CCIPGetFeeTrx = ({
|
|
94138
|
+
routerAddress,
|
|
94139
|
+
args
|
|
94140
|
+
}) => {
|
|
94141
|
+
return createCall({
|
|
94142
|
+
operation: 0,
|
|
94143
|
+
to: routerAddress,
|
|
94144
|
+
data: CCIPGetFeeCalldata(args),
|
|
94145
|
+
value: 0n
|
|
94146
|
+
});
|
|
94147
|
+
};
|
|
94148
|
+
var CCIPSendCalldata = (args) => {
|
|
94149
|
+
return ccipRouterInterface.encodeFunctionData("ccipSend", [
|
|
94150
|
+
args.destinationChainSelector,
|
|
94151
|
+
{
|
|
94152
|
+
receiver: args.message.receiver,
|
|
94153
|
+
data: args.message.data,
|
|
94154
|
+
tokenAmounts: args.message.tokenAmounts.map((t) => ({
|
|
94155
|
+
token: t.token,
|
|
94156
|
+
amount: t.amount
|
|
94157
|
+
})),
|
|
94158
|
+
feeToken: args.message.feeToken,
|
|
94159
|
+
extraArgs: args.message.extraArgs
|
|
94160
|
+
}
|
|
94161
|
+
]);
|
|
94162
|
+
};
|
|
94163
|
+
var ccipSendTrx = ({
|
|
94164
|
+
routerAddress,
|
|
94165
|
+
args
|
|
94166
|
+
}) => {
|
|
94167
|
+
return createCall({
|
|
94168
|
+
operation: 0,
|
|
94169
|
+
to: routerAddress,
|
|
94170
|
+
data: CCIPSendCalldata(args),
|
|
94171
|
+
value: args.nativeFee
|
|
94172
|
+
});
|
|
94173
|
+
};
|
|
94174
|
+
var buildCCIPMessage = ({
|
|
94175
|
+
receiver,
|
|
94176
|
+
token,
|
|
94177
|
+
amount
|
|
94178
|
+
}) => {
|
|
94179
|
+
const receiverEncoded = "0x" + receiver.slice(2).padStart(64, "0");
|
|
94180
|
+
return Object.freeze({
|
|
94181
|
+
receiver: receiverEncoded,
|
|
94182
|
+
data: "0x",
|
|
94183
|
+
tokenAmounts: Object.freeze([Object.freeze({ token, amount })]),
|
|
94184
|
+
feeToken: "0x0000000000000000000000000000000000000000",
|
|
94185
|
+
extraArgs: "0x"
|
|
94186
|
+
});
|
|
94187
|
+
};
|
|
93911
94188
|
// src/integrations/cctp/token.messenger.v2.abi.ts
|
|
93912
94189
|
var token_messenger_v2_abi_default = [
|
|
93913
94190
|
{
|
|
@@ -95521,6 +95798,372 @@ var pendleMerkleClaimTrx = ({
|
|
|
95521
95798
|
value: 0n
|
|
95522
95799
|
});
|
|
95523
95800
|
};
|
|
95801
|
+
// src/integrations/wormhole/wormhole.multi.ntt.abi.ts
|
|
95802
|
+
var wormhole_multi_ntt_abi_default = [
|
|
95803
|
+
{
|
|
95804
|
+
inputs: [
|
|
95805
|
+
{ name: "multiTokenNtt", type: "address" },
|
|
95806
|
+
{ name: "token", type: "address" },
|
|
95807
|
+
{ name: "amount", type: "uint256" },
|
|
95808
|
+
{ name: "recipientChain", type: "uint16" },
|
|
95809
|
+
{ name: "recipient", type: "bytes32" },
|
|
95810
|
+
{ name: "refundAddress", type: "bytes32" },
|
|
95811
|
+
{ name: "transceiverInstructions", type: "bytes" },
|
|
95812
|
+
{
|
|
95813
|
+
name: "executorArgs",
|
|
95814
|
+
type: "tuple",
|
|
95815
|
+
components: [
|
|
95816
|
+
{ name: "value", type: "uint256" },
|
|
95817
|
+
{ name: "refundAddress", type: "address" },
|
|
95818
|
+
{ name: "signedQuote", type: "bytes" },
|
|
95819
|
+
{ name: "instructions", type: "bytes" }
|
|
95820
|
+
]
|
|
95821
|
+
},
|
|
95822
|
+
{
|
|
95823
|
+
name: "feeArgs",
|
|
95824
|
+
type: "tuple",
|
|
95825
|
+
components: [
|
|
95826
|
+
{ name: "dbps", type: "uint16" },
|
|
95827
|
+
{ name: "payee", type: "address" }
|
|
95828
|
+
]
|
|
95829
|
+
}
|
|
95830
|
+
],
|
|
95831
|
+
name: "transfer",
|
|
95832
|
+
outputs: [{ name: "sequence", type: "uint64" }],
|
|
95833
|
+
stateMutability: "payable",
|
|
95834
|
+
type: "function"
|
|
95835
|
+
},
|
|
95836
|
+
{
|
|
95837
|
+
inputs: [
|
|
95838
|
+
{ name: "amount", type: "uint256" },
|
|
95839
|
+
{ name: "dbps", type: "uint16" }
|
|
95840
|
+
],
|
|
95841
|
+
name: "calculateFee",
|
|
95842
|
+
outputs: [{ name: "", type: "uint256" }],
|
|
95843
|
+
stateMutability: "view",
|
|
95844
|
+
type: "function"
|
|
95845
|
+
},
|
|
95846
|
+
{
|
|
95847
|
+
inputs: [],
|
|
95848
|
+
name: "executor",
|
|
95849
|
+
outputs: [{ name: "", type: "address" }],
|
|
95850
|
+
stateMutability: "view",
|
|
95851
|
+
type: "function"
|
|
95852
|
+
},
|
|
95853
|
+
{
|
|
95854
|
+
inputs: [],
|
|
95855
|
+
name: "chainId",
|
|
95856
|
+
outputs: [{ name: "", type: "uint16" }],
|
|
95857
|
+
stateMutability: "view",
|
|
95858
|
+
type: "function"
|
|
95859
|
+
}
|
|
95860
|
+
];
|
|
95861
|
+
// src/integrations/wormhole/gmp.manager.abi.ts
|
|
95862
|
+
var gmp_manager_abi_default = [
|
|
95863
|
+
{
|
|
95864
|
+
inputs: [
|
|
95865
|
+
{ name: "recipientChain", type: "uint16" },
|
|
95866
|
+
{ name: "transceiverInstructions", type: "bytes" }
|
|
95867
|
+
],
|
|
95868
|
+
name: "quoteDeliveryPrice",
|
|
95869
|
+
outputs: [
|
|
95870
|
+
{ name: "", type: "uint256[]" },
|
|
95871
|
+
{ name: "", type: "uint256" }
|
|
95872
|
+
],
|
|
95873
|
+
stateMutability: "view",
|
|
95874
|
+
type: "function"
|
|
95875
|
+
}
|
|
95876
|
+
];
|
|
95877
|
+
// src/integrations/wormhole/wormhole.transceiver.abi.ts
|
|
95878
|
+
var wormhole_transceiver_abi_default = [
|
|
95879
|
+
{
|
|
95880
|
+
inputs: [{ name: "encodedMessage", type: "bytes" }],
|
|
95881
|
+
name: "receiveMessage",
|
|
95882
|
+
outputs: [],
|
|
95883
|
+
stateMutability: "nonpayable",
|
|
95884
|
+
type: "function"
|
|
95885
|
+
}
|
|
95886
|
+
];
|
|
95887
|
+
// src/integrations/wormhole/gmp.manager.ts
|
|
95888
|
+
var gmpManagerInterface = new exports_ethers.utils.Interface(gmp_manager_abi_default);
|
|
95889
|
+
var GmpManagerQuoteDeliveryPriceCalldata = (args) => {
|
|
95890
|
+
return gmpManagerInterface.encodeFunctionData("quoteDeliveryPrice", [
|
|
95891
|
+
args.recipientChain,
|
|
95892
|
+
args.transceiverInstructions
|
|
95893
|
+
]);
|
|
95894
|
+
};
|
|
95895
|
+
var GmpManagerQuoteDeliveryPriceTrx = ({
|
|
95896
|
+
gmpManagerAddress,
|
|
95897
|
+
args
|
|
95898
|
+
}) => {
|
|
95899
|
+
return createCall({
|
|
95900
|
+
operation: 0,
|
|
95901
|
+
to: gmpManagerAddress,
|
|
95902
|
+
data: GmpManagerQuoteDeliveryPriceCalldata(args),
|
|
95903
|
+
value: 0n
|
|
95904
|
+
});
|
|
95905
|
+
};
|
|
95906
|
+
var decodeQuoteDeliveryPriceResult = (resultHex) => {
|
|
95907
|
+
const decoded = gmpManagerInterface.decodeFunctionResult("quoteDeliveryPrice", resultHex);
|
|
95908
|
+
const perTransceiver = decoded[0].map((v) => BigInt(v.toString()));
|
|
95909
|
+
const total = BigInt(decoded[1].toString());
|
|
95910
|
+
return { perTransceiver, total };
|
|
95911
|
+
};
|
|
95912
|
+
var encodeTransceiverInstruction = (index, payload) => {
|
|
95913
|
+
if (index < 0 || index > 255)
|
|
95914
|
+
throw new Error(`encodeTransceiverInstruction: index out of range: ${index}`);
|
|
95915
|
+
const payloadLen = size(payload);
|
|
95916
|
+
if (payloadLen > 255)
|
|
95917
|
+
throw new Error(`encodeTransceiverInstruction: payload length ${payloadLen} exceeds uint8 max`);
|
|
95918
|
+
return concatHex([toHex(index, { size: 1 }), toHex(payloadLen, { size: 1 }), payload]);
|
|
95919
|
+
};
|
|
95920
|
+
var encodeTransceiverInstructions = (instructions) => {
|
|
95921
|
+
if (instructions.length > 255)
|
|
95922
|
+
throw new Error(`encodeTransceiverInstructions: too many instructions: ${instructions.length}`);
|
|
95923
|
+
return concatHex([
|
|
95924
|
+
toHex(instructions.length, { size: 1 }),
|
|
95925
|
+
...instructions.map((i2) => encodeTransceiverInstruction(i2.index, i2.payload))
|
|
95926
|
+
]);
|
|
95927
|
+
};
|
|
95928
|
+
var buildMonadDefaultTransceiverInstructions = ({
|
|
95929
|
+
axelarMaxFee
|
|
95930
|
+
}) => {
|
|
95931
|
+
if (axelarMaxFee < 0n)
|
|
95932
|
+
throw new Error("buildMonadDefaultTransceiverInstructions: negative axelarMaxFee");
|
|
95933
|
+
return encodeTransceiverInstructions([
|
|
95934
|
+
{ index: 0, payload: "0x01" },
|
|
95935
|
+
{ index: 1, payload: toHex(axelarMaxFee, { size: 32 }) }
|
|
95936
|
+
]);
|
|
95937
|
+
};
|
|
95938
|
+
// src/integrations/wormhole/wormhole.transceiver.ts
|
|
95939
|
+
var transceiverInterface = new exports_ethers.utils.Interface(wormhole_transceiver_abi_default);
|
|
95940
|
+
var WormholeReceiveMessageCalldata = ({ vaa }) => {
|
|
95941
|
+
return transceiverInterface.encodeFunctionData("receiveMessage", [vaa]);
|
|
95942
|
+
};
|
|
95943
|
+
var wormholeReceiveMessageTrx = ({
|
|
95944
|
+
transceiverAddress,
|
|
95945
|
+
vaa
|
|
95946
|
+
}) => {
|
|
95947
|
+
return createCall({
|
|
95948
|
+
operation: 0,
|
|
95949
|
+
to: transceiverAddress,
|
|
95950
|
+
data: WormholeReceiveMessageCalldata({ vaa }),
|
|
95951
|
+
value: 0n
|
|
95952
|
+
});
|
|
95953
|
+
};
|
|
95954
|
+
// src/integrations/wormhole/wormhole.scan.api.ts
|
|
95955
|
+
var WORMHOLESCAN_API_MAINNET = "https://api.wormholescan.io";
|
|
95956
|
+
var WORMHOLESCAN_API_TESTNET = "https://api.testnet.wormholescan.io";
|
|
95957
|
+
var getWormholeScanApiUrl = (network = "Mainnet") => network === "Mainnet" ? WORMHOLESCAN_API_MAINNET : WORMHOLESCAN_API_TESTNET;
|
|
95958
|
+
var normalizeEmitterForVaaLookup = (emitter) => {
|
|
95959
|
+
const byteLen = size(emitter);
|
|
95960
|
+
if (byteLen !== 20 && byteLen !== 32) {
|
|
95961
|
+
throw new Error(`normalizeEmitterForVaaLookup: expected 20- or 32-byte hex, got ${byteLen} bytes`);
|
|
95962
|
+
}
|
|
95963
|
+
return pad(emitter, { size: 32 }).slice(2).toLowerCase();
|
|
95964
|
+
};
|
|
95965
|
+
var fetchWormholeVAA = async (args, network = "Mainnet") => {
|
|
95966
|
+
const emitterPadded = normalizeEmitterForVaaLookup(args.emitterAddress);
|
|
95967
|
+
const url = `${getWormholeScanApiUrl(network)}/api/v1/vaas/${args.emitterChain}/${emitterPadded}/${args.sequence.toString()}`;
|
|
95968
|
+
const response = await fetch(url);
|
|
95969
|
+
if (!response.ok) {
|
|
95970
|
+
const body = await response.text().catch(() => "");
|
|
95971
|
+
throw new Error(`WormholeScan VAA lookup returned ${response.status} ${response.statusText}: ${body}`);
|
|
95972
|
+
}
|
|
95973
|
+
const parsed = await response.json();
|
|
95974
|
+
if (!parsed.data) {
|
|
95975
|
+
throw new Error(`WormholeScan VAA lookup returned 200 but no data for chain=${args.emitterChain} emitter=${args.emitterAddress} sequence=${args.sequence}`);
|
|
95976
|
+
}
|
|
95977
|
+
return parsed.data;
|
|
95978
|
+
};
|
|
95979
|
+
var decodeVaaBase64 = (base64) => bytesToHex(Uint8Array.from(atob(base64), (c) => c.charCodeAt(0)));
|
|
95980
|
+
// src/integrations/wormhole/axelar.gmp.api.ts
|
|
95981
|
+
var AXELAR_GMP_API_MAINNET = "https://api.axelarscan.io";
|
|
95982
|
+
var AXELAR_GMP_API_TESTNET = "https://testnet.api.axelarscan.io";
|
|
95983
|
+
var getAxelarGmpApiUrl = (network = "Mainnet") => network === "Mainnet" ? AXELAR_GMP_API_MAINNET : AXELAR_GMP_API_TESTNET;
|
|
95984
|
+
var fetchAxelarGmpStatus = async ({ sourceTxHash }, network = "Mainnet") => {
|
|
95985
|
+
const response = await fetch(`${getAxelarGmpApiUrl(network)}/gmp/searchGMP`, {
|
|
95986
|
+
method: "POST",
|
|
95987
|
+
headers: { "Content-Type": "application/json" },
|
|
95988
|
+
body: JSON.stringify({ txHash: sourceTxHash })
|
|
95989
|
+
});
|
|
95990
|
+
if (!response.ok) {
|
|
95991
|
+
const body = await response.text().catch(() => "");
|
|
95992
|
+
throw new Error(`Axelar GMP status API returned ${response.status} ${response.statusText}: ${body}`);
|
|
95993
|
+
}
|
|
95994
|
+
const parsed = await response.json();
|
|
95995
|
+
const entry = parsed.data?.[0];
|
|
95996
|
+
if (!entry)
|
|
95997
|
+
return null;
|
|
95998
|
+
const executedEntry = entry["executed"];
|
|
95999
|
+
return Object.freeze({
|
|
96000
|
+
status: String(entry["status"] ?? "unknown"),
|
|
96001
|
+
simplifiedStatus: entry["simplified_status"],
|
|
96002
|
+
executed: Boolean(entry["executed"]),
|
|
96003
|
+
approved: Boolean(entry["approved"]),
|
|
96004
|
+
destinationTxHash: executedEntry?.transactionHash,
|
|
96005
|
+
destinationBlockNumber: executedEntry?.blockNumber,
|
|
96006
|
+
raw: entry
|
|
96007
|
+
});
|
|
96008
|
+
};
|
|
96009
|
+
// src/integrations/wormhole/wormhole.multi.ntt.ts
|
|
96010
|
+
var wormholeMultiNttInterface = new exports_ethers.utils.Interface(wormhole_multi_ntt_abi_default);
|
|
96011
|
+
var WORMHOLE_CHAIN_IDS = Object.freeze({
|
|
96012
|
+
1: 2,
|
|
96013
|
+
143: 48
|
|
96014
|
+
});
|
|
96015
|
+
var getWormholeChainId = (chainId) => {
|
|
96016
|
+
const whChainId = WORMHOLE_CHAIN_IDS[chainId];
|
|
96017
|
+
if (whChainId === undefined) {
|
|
96018
|
+
throw new Error(`Wormhole: No chain ID mapping for chainId ${chainId}`);
|
|
96019
|
+
}
|
|
96020
|
+
return whChainId;
|
|
96021
|
+
};
|
|
96022
|
+
var addressToBytes32 = (addr) => pad(addr, { size: 32 }).toLowerCase();
|
|
96023
|
+
var WormholeTransferCalldata = (args) => {
|
|
96024
|
+
return wormholeMultiNttInterface.encodeFunctionData("transfer", [
|
|
96025
|
+
args.multiTokenNtt,
|
|
96026
|
+
args.token,
|
|
96027
|
+
args.amount,
|
|
96028
|
+
args.recipientChain,
|
|
96029
|
+
args.recipient,
|
|
96030
|
+
args.refundAddress,
|
|
96031
|
+
args.transceiverInstructions,
|
|
96032
|
+
{
|
|
96033
|
+
value: args.executorArgs.value,
|
|
96034
|
+
refundAddress: args.executorArgs.refundAddress,
|
|
96035
|
+
signedQuote: args.executorArgs.signedQuote,
|
|
96036
|
+
instructions: args.executorArgs.instructions
|
|
96037
|
+
},
|
|
96038
|
+
{
|
|
96039
|
+
dbps: args.feeArgs.dbps,
|
|
96040
|
+
payee: args.feeArgs.payee
|
|
96041
|
+
}
|
|
96042
|
+
]);
|
|
96043
|
+
};
|
|
96044
|
+
var wormholeTransferTrx = ({
|
|
96045
|
+
wrapperAddress,
|
|
96046
|
+
args,
|
|
96047
|
+
transceiverFee = 0n
|
|
96048
|
+
}) => {
|
|
96049
|
+
return createCall({
|
|
96050
|
+
operation: 0,
|
|
96051
|
+
to: wrapperAddress,
|
|
96052
|
+
data: WormholeTransferCalldata(args),
|
|
96053
|
+
value: args.executorArgs.value + transceiverFee
|
|
96054
|
+
});
|
|
96055
|
+
};
|
|
96056
|
+
var DEFAULT_NTT_REDEMPTION_GAS_LIMIT = 1000000n;
|
|
96057
|
+
var buildRelayInstructions = ({
|
|
96058
|
+
gasLimit = DEFAULT_NTT_REDEMPTION_GAS_LIMIT,
|
|
96059
|
+
msgValue = 0n
|
|
96060
|
+
} = {}) => {
|
|
96061
|
+
if (gasLimit < 0n)
|
|
96062
|
+
throw new Error("buildRelayInstructions: negative gasLimit");
|
|
96063
|
+
if (msgValue < 0n)
|
|
96064
|
+
throw new Error("buildRelayInstructions: negative msgValue");
|
|
96065
|
+
return concatHex([
|
|
96066
|
+
"0x01",
|
|
96067
|
+
toHex(gasLimit, { size: 16 }),
|
|
96068
|
+
toHex(msgValue, { size: 16 })
|
|
96069
|
+
]);
|
|
96070
|
+
};
|
|
96071
|
+
var WormholeCalculateFeeCalldata = ({ amount, dbps }) => {
|
|
96072
|
+
return wormholeMultiNttInterface.encodeFunctionData("calculateFee", [amount, dbps]);
|
|
96073
|
+
};
|
|
96074
|
+
var buildWormholeTransferArgsFromAvatar = ({
|
|
96075
|
+
multiTokenNtt,
|
|
96076
|
+
token,
|
|
96077
|
+
amount,
|
|
96078
|
+
recipientChain,
|
|
96079
|
+
avatar,
|
|
96080
|
+
relayFee,
|
|
96081
|
+
signedQuote,
|
|
96082
|
+
relayInstructions,
|
|
96083
|
+
transceiverInstructions = "0x",
|
|
96084
|
+
dbps = 0,
|
|
96085
|
+
payee
|
|
96086
|
+
}) => {
|
|
96087
|
+
const avatarBytes32 = addressToBytes32(avatar);
|
|
96088
|
+
return Object.freeze({
|
|
96089
|
+
multiTokenNtt,
|
|
96090
|
+
token,
|
|
96091
|
+
amount,
|
|
96092
|
+
recipientChain,
|
|
96093
|
+
recipient: avatarBytes32,
|
|
96094
|
+
refundAddress: avatarBytes32,
|
|
96095
|
+
transceiverInstructions,
|
|
96096
|
+
executorArgs: Object.freeze({
|
|
96097
|
+
value: relayFee,
|
|
96098
|
+
refundAddress: avatar,
|
|
96099
|
+
signedQuote,
|
|
96100
|
+
instructions: relayInstructions
|
|
96101
|
+
}),
|
|
96102
|
+
feeArgs: Object.freeze({
|
|
96103
|
+
dbps,
|
|
96104
|
+
payee: payee ?? "0x0000000000000000000000000000000000000000"
|
|
96105
|
+
})
|
|
96106
|
+
});
|
|
96107
|
+
};
|
|
96108
|
+
// src/integrations/wormhole/executor.quote.api.ts
|
|
96109
|
+
var WORMHOLE_EXECUTOR_API_MAINNET = "https://executor.labsapis.com";
|
|
96110
|
+
var WORMHOLE_EXECUTOR_API_TESTNET = "https://executor-testnet.labsapis.com";
|
|
96111
|
+
var getExecutorApiUrl = (network = "Mainnet") => network === "Mainnet" ? WORMHOLE_EXECUTOR_API_MAINNET : WORMHOLE_EXECUTOR_API_TESTNET;
|
|
96112
|
+
var fetchExecutorQuote = async (args, network = "Mainnet") => {
|
|
96113
|
+
const url = `${getExecutorApiUrl(network)}/v0/quote`;
|
|
96114
|
+
const response = await fetch(url, {
|
|
96115
|
+
method: "POST",
|
|
96116
|
+
headers: { "Content-Type": "application/json" },
|
|
96117
|
+
body: JSON.stringify({
|
|
96118
|
+
srcChain: args.srcChain,
|
|
96119
|
+
dstChain: args.dstChain,
|
|
96120
|
+
relayInstructions: args.relayInstructions
|
|
96121
|
+
})
|
|
96122
|
+
});
|
|
96123
|
+
if (!response.ok) {
|
|
96124
|
+
const body = await response.text().catch(() => "");
|
|
96125
|
+
throw new Error(`Wormhole executor quote API returned ${response.status} ${response.statusText}: ${body}`);
|
|
96126
|
+
}
|
|
96127
|
+
return await response.json();
|
|
96128
|
+
};
|
|
96129
|
+
var parseSignedQuote = (signedQuote) => {
|
|
96130
|
+
if (size(signedQuote) !== 165) {
|
|
96131
|
+
throw new Error(`parseSignedQuote: expected 165 bytes, got ${size(signedQuote)}`);
|
|
96132
|
+
}
|
|
96133
|
+
const prefixBytes = hexToBytes(sliceHex(signedQuote, 0, 4));
|
|
96134
|
+
const prefix2 = bytesToString(prefixBytes);
|
|
96135
|
+
if (prefix2 !== "EQ01") {
|
|
96136
|
+
throw new Error(`parseSignedQuote: invalid prefix '${prefix2}', expected 'EQ01'`);
|
|
96137
|
+
}
|
|
96138
|
+
return Object.freeze({
|
|
96139
|
+
prefix: "EQ01",
|
|
96140
|
+
quoterAddress: sliceHex(signedQuote, 4, 24),
|
|
96141
|
+
payeeAddress: sliceHex(signedQuote, 24, 56),
|
|
96142
|
+
srcChain: bytesToNumber(hexToBytes(sliceHex(signedQuote, 56, 58))),
|
|
96143
|
+
dstChain: bytesToNumber(hexToBytes(sliceHex(signedQuote, 58, 60))),
|
|
96144
|
+
expiryTimeSeconds: bytesToBigInt(hexToBytes(sliceHex(signedQuote, 60, 68))),
|
|
96145
|
+
baseFee: bytesToBigInt(hexToBytes(sliceHex(signedQuote, 68, 76))),
|
|
96146
|
+
dstGasPrice: bytesToBigInt(hexToBytes(sliceHex(signedQuote, 76, 84))),
|
|
96147
|
+
srcPrice: bytesToBigInt(hexToBytes(sliceHex(signedQuote, 84, 92))),
|
|
96148
|
+
dstPrice: bytesToBigInt(hexToBytes(sliceHex(signedQuote, 92, 100)))
|
|
96149
|
+
});
|
|
96150
|
+
};
|
|
96151
|
+
var fetchExecutorTxStatus = async ({
|
|
96152
|
+
txHash,
|
|
96153
|
+
chainId
|
|
96154
|
+
}, network = "Mainnet") => {
|
|
96155
|
+
const url = `${getExecutorApiUrl(network)}/v0/status/tx`;
|
|
96156
|
+
const response = await fetch(url, {
|
|
96157
|
+
method: "POST",
|
|
96158
|
+
headers: { "Content-Type": "application/json" },
|
|
96159
|
+
body: JSON.stringify({ txHash, chainId })
|
|
96160
|
+
});
|
|
96161
|
+
if (!response.ok) {
|
|
96162
|
+
const body = await response.text().catch(() => "");
|
|
96163
|
+
throw new Error(`Wormhole executor status API returned ${response.status} ${response.statusText}: ${body}`);
|
|
96164
|
+
}
|
|
96165
|
+
return await response.json();
|
|
96166
|
+
};
|
|
95524
96167
|
// src/lib/utils.ts
|
|
95525
96168
|
var executeTrx = ({
|
|
95526
96169
|
client,
|
|
@@ -95615,4 +96258,4 @@ var simulateOrThrow = async (env2) => {
|
|
|
95615
96258
|
};
|
|
95616
96259
|
};
|
|
95617
96260
|
|
|
95618
|
-
//# debugId=
|
|
96261
|
+
//# debugId=A0C783FEF91F3ABA64756E2164756E21
|