@skip-go/client 1.5.1 → 1.5.3-alpha.0
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/api/getAssets.cjs +5 -5
- package/dist/cjs/api/getAssetsBetweenChains.cjs +4 -4
- package/dist/cjs/api/getBridges.cjs +4 -4
- package/dist/cjs/api/getChains.cjs +4 -4
- package/dist/cjs/api/getVenues.cjs +4 -4
- package/dist/cjs/api/postAssetsFromSource.cjs +5 -5
- package/dist/cjs/api/postBalances.cjs +4 -4
- package/dist/cjs/api/postIbcOriginAssets.cjs +4 -4
- package/dist/cjs/api/postMessages.cjs +4 -4
- package/dist/cjs/api/postMessagesDirect.cjs +4 -4
- package/dist/cjs/api/postRecommendAssets.cjs +4 -4
- package/dist/cjs/api/postRoute.cjs +4 -4
- package/dist/cjs/api/postSubmitTransaction.cjs +4 -4
- package/dist/cjs/api/postTrackTransaction.cjs +4 -4
- package/dist/cjs/api/postTransactionStatus.cjs +4 -4
- package/dist/cjs/{chunk-5HDKZVOL.cjs → chunk-262HFM6V.cjs} +2 -2
- package/dist/cjs/{chunk-OZUCMWNE.cjs → chunk-3NHW3XWK.cjs} +2 -2
- package/dist/cjs/{chunk-LHY62HPI.cjs → chunk-4MV4GLIA.cjs} +2 -2
- package/dist/cjs/{chunk-FNB244QI.cjs → chunk-4NGHNHAS.cjs} +6 -6
- package/dist/cjs/{chunk-JBKNEFXB.cjs → chunk-7SZZBUBD.cjs} +3 -3
- package/dist/cjs/{chunk-EZGHN6ZL.cjs → chunk-ARCCHERF.cjs} +55 -55
- package/dist/cjs/{chunk-ZBPDDVQ2.cjs → chunk-AW6IQ7JH.cjs} +2 -2
- package/dist/cjs/{chunk-KHJQE3DI.cjs → chunk-BCX2D6TE.cjs} +91 -18
- package/dist/cjs/{chunk-NDSHB4I6.cjs → chunk-BQDOKZFX.cjs} +15 -15
- package/dist/cjs/{chunk-V3FWWJG2.cjs → chunk-CZKIE576.cjs} +10 -10
- package/dist/cjs/chunk-EVEVOW2U.cjs +2179 -0
- package/dist/cjs/{chunk-A26H4FVN.cjs → chunk-FF5UWES6.cjs} +4 -4
- package/dist/cjs/chunk-GGSF5JZH.cjs +101 -0
- package/dist/cjs/chunk-GWRZ6MPC.cjs +2179 -0
- package/dist/cjs/{chunk-N5V3YW5K.cjs → chunk-H2T4LMS2.cjs} +10 -10
- package/dist/cjs/{chunk-ERGJBZUC.cjs → chunk-HFEMNOJS.cjs} +12 -18
- package/dist/cjs/chunk-I6VYDEUV.cjs +454 -0
- package/dist/cjs/{chunk-RVXCF6AL.cjs → chunk-J7HZ6VJE.cjs} +10 -10
- package/dist/cjs/{chunk-QPM7H2YL.cjs → chunk-JWWJIJUE.cjs} +2 -2
- package/dist/cjs/{chunk-RCGCQD6T.cjs → chunk-KWH6S7PB.cjs} +8 -6
- package/dist/cjs/{chunk-QZ2BGX6O.cjs → chunk-MOWOIPUG.cjs} +4 -4
- package/dist/cjs/{chunk-LUVMRHAJ.cjs → chunk-PLO5CVGN.cjs} +2 -2
- package/dist/cjs/{chunk-N4UW74AG.cjs → chunk-QAHHTQ7V.cjs} +4 -4
- package/dist/cjs/{chunk-X5AJHZ2J.cjs → chunk-RBM66GW6.cjs} +2 -2
- package/dist/cjs/{chunk-AXYRULAI.cjs → chunk-S3BKLN4L.cjs} +2 -2
- package/dist/cjs/{chunk-5AYPH3ZR.cjs → chunk-T5EGKQAT.cjs} +2 -2
- package/dist/cjs/{chunk-5CB6SPCX.cjs → chunk-UY5LWG5D.cjs} +2 -2
- package/dist/cjs/chunk-W6ID22B6.cjs +24 -0
- package/dist/{esm/chunk-VQ5SIQWU.js → cjs/chunk-WKYP2NMS.cjs} +11 -7
- package/dist/cjs/{chunk-23YF4LFI.cjs → chunk-XCFPRLX3.cjs} +10 -7
- package/dist/cjs/{chunk-EJMC4JXF.cjs → chunk-ZBJZTBIW.cjs} +2 -2
- package/dist/cjs/index.cjs +188 -250
- package/dist/cjs/public-functions/executeMultipleRoutes.cjs +26 -16
- package/dist/cjs/public-functions/executeRoute.cjs +26 -16
- package/dist/cjs/public-functions/getEvmGasAmountForMessage.cjs +1 -1
- package/dist/cjs/public-functions/getFeeInfoForChain.cjs +5 -6
- package/dist/cjs/public-functions/getRecommendedGasPrice.cjs +7 -8
- package/dist/cjs/public-functions/getRouteWithGasOnReceive.cjs +39 -0
- package/dist/cjs/public-functions/getSigningStargateClient.cjs +5 -5
- package/dist/cjs/public-functions/setApiOptions.cjs +4 -4
- package/dist/cjs/public-functions/setClientOptions.cjs +5 -5
- package/dist/cjs/public-functions/subscribeToRouteStatus.cjs +9 -9
- package/dist/cjs/public-functions/validateCosmosGasBalance.cjs +7 -7
- package/dist/cjs/public-functions/waitForTransaction.cjs +6 -6
- package/dist/esm/api/getAssets.d.ts +2 -2
- package/dist/esm/api/getAssets.js +3 -3
- package/dist/esm/api/getAssetsBetweenChains.d.ts +22 -22
- package/dist/esm/api/getAssetsBetweenChains.js +3 -3
- package/dist/esm/api/getBridges.d.ts +2 -2
- package/dist/esm/api/getBridges.js +3 -3
- package/dist/esm/api/getChains.d.ts +2 -2
- package/dist/esm/api/getChains.js +3 -3
- package/dist/esm/api/getVenues.d.ts +1 -1
- package/dist/esm/api/getVenues.js +3 -3
- package/dist/esm/api/postAssetsFromSource.d.ts +2 -2
- package/dist/esm/api/postAssetsFromSource.js +4 -4
- package/dist/esm/api/postBalances.d.ts +3 -3
- package/dist/esm/api/postBalances.js +3 -3
- package/dist/esm/api/postIbcOriginAssets.d.ts +11 -11
- package/dist/esm/api/postIbcOriginAssets.js +3 -3
- package/dist/esm/api/postMessages.d.ts +13 -13
- package/dist/esm/api/postMessages.js +3 -3
- package/dist/esm/api/postMessagesDirect.d.ts +164 -162
- package/dist/esm/api/postMessagesDirect.js +3 -3
- package/dist/esm/api/postRecommendAssets.d.ts +12 -12
- package/dist/esm/api/postRecommendAssets.js +3 -3
- package/dist/esm/api/postRoute.d.ts +162 -160
- package/dist/esm/api/postRoute.js +3 -3
- package/dist/esm/api/postSubmitTransaction.d.ts +3 -3
- package/dist/esm/api/postSubmitTransaction.js +3 -3
- package/dist/esm/api/postTrackTransaction.d.ts +3 -3
- package/dist/esm/api/postTrackTransaction.js +3 -3
- package/dist/esm/api/postTransactionStatus.d.ts +37 -37
- package/dist/esm/api/postTransactionStatus.js +3 -3
- package/dist/esm/{apiState-DwZhwVul.d.ts → apiState-1VvikVK-.d.ts} +1 -0
- package/dist/esm/{callbacks-DCqqd0D9.d.ts → callbacks-C-KUJnDv.d.ts} +34 -4
- package/dist/esm/{chunk-APRMN34M.js → chunk-3WFXBPS2.js} +1 -1
- package/dist/esm/{chunk-3XOGEVJL.js → chunk-44IX6KPJ.js} +1 -1
- package/dist/esm/{chunk-VZGOU6MB.js → chunk-47HN6VKU.js} +3 -3
- package/dist/esm/{chunk-XYYXRVFN.js → chunk-5IXH2QPF.js} +86 -16
- package/dist/esm/{chunk-WBZVMPPV.js → chunk-6M7N6EAO.js} +7 -4
- package/dist/esm/{chunk-7X4ERB3R.js → chunk-AUNRER4I.js} +1 -1
- package/dist/esm/{chunk-562J5DCB.js → chunk-DL374PFE.js} +4 -4
- package/dist/esm/chunk-FDRLM2JD.js +431 -0
- package/dist/esm/{chunk-52PEBJRQ.js → chunk-FNTPI2AV.js} +1 -1
- package/dist/esm/{chunk-3J5IMMMB.js → chunk-H3MY23AH.js} +1 -1
- package/dist/esm/{chunk-JQ4F4WBG.js → chunk-HDW6XFWX.js} +1 -1
- package/dist/esm/{chunk-LHNGF5J2.js → chunk-HELQO7PA.js} +2 -2
- package/dist/esm/{chunk-W5EGS2G4.js → chunk-IGK7LJCM.js} +8 -8
- package/dist/esm/{chunk-AND7HVIU.js → chunk-IHSSWY3M.js} +1 -1
- package/dist/esm/{chunk-2DD5F6PK.js → chunk-JNVGNIOE.js} +2 -2
- package/dist/{cjs/chunk-4R6OCWRR.cjs → esm/chunk-JYYCFKB4.js} +8 -9
- package/dist/esm/chunk-KNXMSLOB.js +1 -1
- package/dist/esm/{chunk-Y2YCODZK.js → chunk-KXQ2ASHQ.js} +1 -1
- package/dist/esm/{chunk-ZOUYAZU6.js → chunk-MYGJGC62.js} +1 -1
- package/dist/esm/{chunk-ZI3SYUQH.js → chunk-RFJYCJK4.js} +1 -1
- package/dist/esm/{chunk-FVQFGEL2.js → chunk-RHLE3EW7.js} +6 -6
- package/dist/esm/chunk-RJ35JBT4.js +2154 -0
- package/dist/esm/{chunk-BZDVQMHK.js → chunk-SOVU5NCL.js} +2 -2
- package/dist/esm/{chunk-QIS6ILPS.js → chunk-TNIGHYH2.js} +3 -3
- package/dist/esm/{chunk-FH2YHZVV.js → chunk-UBVBVJPY.js} +5 -3
- package/dist/esm/chunk-UIDIKXMB.js +1 -1
- package/dist/esm/{chunk-A6KSECAH.js → chunk-VGCTTJO7.js} +12 -18
- package/dist/esm/{chunk-OTS5KO43.js → chunk-VWOMKMH2.js} +1 -1
- package/dist/esm/chunk-X2IBEHMZ.js +2154 -0
- package/dist/esm/chunk-XHLXJGVB.js +22 -0
- package/dist/esm/{chunk-S4RO2LHD.js → chunk-YGQ4NKTM.js} +1 -1
- package/dist/esm/{chunk-UI3SIFZN.js → chunk-YLVUKXLR.js} +1 -1
- package/dist/esm/chunk-YWG4XR5A.js +98 -0
- package/dist/esm/{client-types-BSZasIDd.d.ts → client-types-CGMuZ3zo.d.ts} +2 -2
- package/dist/esm/{generateApi-CwM4Ca30.d.ts → generateApi-D_-Gso-x.d.ts} +1 -1
- package/dist/esm/index.d.ts +167 -144
- package/dist/esm/index.js +25 -174
- package/dist/esm/public-functions/executeMultipleRoutes.d.ts +31 -11
- package/dist/esm/public-functions/executeMultipleRoutes.js +25 -15
- package/dist/esm/public-functions/executeRoute.d.ts +5 -5
- package/dist/esm/public-functions/executeRoute.js +25 -15
- package/dist/esm/public-functions/getCosmosGasAmountForMessage.d.ts +1 -1
- package/dist/esm/public-functions/getEvmGasAmountForMessage.d.ts +4 -4
- package/dist/esm/public-functions/getEvmGasAmountForMessage.js +1 -1
- package/dist/esm/public-functions/getFeeInfoForChain.d.ts +2 -2
- package/dist/esm/public-functions/getFeeInfoForChain.js +4 -5
- package/dist/esm/public-functions/getRecommendedGasPrice.d.ts +1 -1
- package/dist/esm/public-functions/getRecommendedGasPrice.js +6 -7
- package/dist/esm/public-functions/getRouteWithGasOnReceive.d.ts +20 -0
- package/dist/esm/public-functions/getRouteWithGasOnReceive.js +30 -0
- package/dist/esm/public-functions/getSigningStargateClient.js +4 -4
- package/dist/esm/public-functions/setApiOptions.d.ts +3 -3
- package/dist/esm/public-functions/setApiOptions.js +3 -3
- package/dist/esm/public-functions/setClientOptions.d.ts +5 -5
- package/dist/esm/public-functions/setClientOptions.js +4 -4
- package/dist/esm/public-functions/subscribeToRouteStatus.d.ts +5 -5
- package/dist/esm/public-functions/subscribeToRouteStatus.js +5 -5
- package/dist/esm/public-functions/validateCosmosGasBalance.d.ts +5 -5
- package/dist/esm/public-functions/validateCosmosGasBalance.js +6 -6
- package/dist/esm/public-functions/waitForTransaction.d.ts +39 -39
- package/dist/esm/public-functions/waitForTransaction.js +5 -5
- package/dist/esm/setClientOptions-C8g92xTm.d.ts +76 -0
- package/dist/esm/{swaggerTypes-Bh6hu5Q-.d.ts → swaggerTypes-B_jKfpvz.d.ts} +154 -132
- package/package.json +1 -1
- package/dist/esm/setClientOptions-0DYCj_A5.d.ts +0 -19
- package/dist/cjs/{chunk-IDDRJJO5.cjs → chunk-DLT6Q6RB.cjs} +1 -1
- package/dist/esm/{chunk-OQDBWVET.js → chunk-QL423UEF.js} +1 -1
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkBCX2D6TE_cjs = require('./chunk-BCX2D6TE.cjs');
|
|
4
|
+
var chunkCZKIE576_cjs = require('./chunk-CZKIE576.cjs');
|
|
5
5
|
var chunkKM2D7PJL_cjs = require('./chunk-KM2D7PJL.cjs');
|
|
6
6
|
var chunkF3EB2AQG_cjs = require('./chunk-F3EB2AQG.cjs');
|
|
7
|
-
var
|
|
7
|
+
var chunkWKYP2NMS_cjs = require('./chunk-WKYP2NMS.cjs');
|
|
8
8
|
var chunkKZOSEIWH_cjs = require('./chunk-KZOSEIWH.cjs');
|
|
9
|
-
var
|
|
9
|
+
var chunkJ7HZ6VJE_cjs = require('./chunk-J7HZ6VJE.cjs');
|
|
10
10
|
var chunkKSJ5QYMR_cjs = require('./chunk-KSJ5QYMR.cjs');
|
|
11
|
-
var
|
|
12
|
-
var
|
|
13
|
-
var
|
|
14
|
-
var
|
|
11
|
+
var chunk262HFM6V_cjs = require('./chunk-262HFM6V.cjs');
|
|
12
|
+
var chunkT5EGKQAT_cjs = require('./chunk-T5EGKQAT.cjs');
|
|
13
|
+
var chunkQAHHTQ7V_cjs = require('./chunk-QAHHTQ7V.cjs');
|
|
14
|
+
var chunkHFEMNOJS_cjs = require('./chunk-HFEMNOJS.cjs');
|
|
15
15
|
var stargate = require('@cosmjs/stargate');
|
|
16
16
|
var tx_js = require('cosmjs-types/cosmos/tx/v1beta1/tx.js');
|
|
17
17
|
var protoSigning = require('@cosmjs/proto-signing');
|
|
@@ -27,11 +27,11 @@ var bech32 = require('bech32');
|
|
|
27
27
|
|
|
28
28
|
// src/private-functions/getRestEndpointForChain.ts
|
|
29
29
|
var getRestEndpointForChain = async (chainId) => {
|
|
30
|
-
if (
|
|
31
|
-
return
|
|
30
|
+
if (chunkQAHHTQ7V_cjs.ClientState.endpointOptions.getRestEndpointForChain) {
|
|
31
|
+
return chunkQAHHTQ7V_cjs.ClientState.endpointOptions.getRestEndpointForChain(chainId);
|
|
32
32
|
}
|
|
33
|
-
if (
|
|
34
|
-
const endpointOptions =
|
|
33
|
+
if (chunkQAHHTQ7V_cjs.ClientState.endpointOptions.endpoints && chunkQAHHTQ7V_cjs.ClientState.endpointOptions.endpoints[chainId]) {
|
|
34
|
+
const endpointOptions = chunkQAHHTQ7V_cjs.ClientState.endpointOptions.endpoints[chainId];
|
|
35
35
|
if (endpointOptions?.rest) {
|
|
36
36
|
return endpointOptions.rest;
|
|
37
37
|
}
|
|
@@ -62,9 +62,9 @@ var getAccountNumberAndSequence = async (address, chainId) => {
|
|
|
62
62
|
if (chainId.includes("dymension")) {
|
|
63
63
|
return getAccountNumberAndSequenceFromDymension(address, chainId);
|
|
64
64
|
}
|
|
65
|
-
const endpoint = await
|
|
66
|
-
const client =
|
|
67
|
-
accountParser:
|
|
65
|
+
const endpoint = await chunkJ7HZ6VJE_cjs.getRpcEndpointForChain(chainId);
|
|
66
|
+
const client = chunkQAHHTQ7V_cjs.ClientState.signingStargateClientByChainId[chainId] ?? await stargate.StargateClient.connect(endpoint, {
|
|
67
|
+
accountParser: chunkJ7HZ6VJE_cjs.accountParser
|
|
68
68
|
});
|
|
69
69
|
const account = await client.getAccount(address);
|
|
70
70
|
if (!account) {
|
|
@@ -90,7 +90,7 @@ var getAccountNumberAndSequenceFromDymension = async (address, chainId) => {
|
|
|
90
90
|
throw new Error(`Failed to fetch account data: ${res.statusText}`);
|
|
91
91
|
}
|
|
92
92
|
const jsonResponse = await res.json();
|
|
93
|
-
const response =
|
|
93
|
+
const response = chunkHFEMNOJS_cjs.toCamel(jsonResponse);
|
|
94
94
|
let sequence = 0;
|
|
95
95
|
let accountNumber = 0;
|
|
96
96
|
if (response.account.baseAccount) {
|
|
@@ -180,7 +180,7 @@ var signCosmosMessageDirect = async (options) => {
|
|
|
180
180
|
messages
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
|
-
const txBodyBytes =
|
|
183
|
+
const txBodyBytes = chunkQAHHTQ7V_cjs.ClientState.registry.encode(txBodyEncodeObject);
|
|
184
184
|
const gasLimit = math.Int53.fromString(fee.gas).toNumber();
|
|
185
185
|
const pubkeyAny = makePubkeyAnyFromAccount(accountFromSigner, chainId);
|
|
186
186
|
const authInfoBytes = protoSigning.makeAuthInfoBytes(
|
|
@@ -220,7 +220,7 @@ var signCosmosMessageAmino = async (options) => {
|
|
|
220
220
|
(cosmosMsg) => chunkKM2D7PJL_cjs.getEncodeObjectFromCosmosMessage(cosmosMsg)
|
|
221
221
|
);
|
|
222
222
|
const signMode = signing_js.SignMode.SIGN_MODE_LEGACY_AMINO_JSON;
|
|
223
|
-
const msgs = messages.map((msg) =>
|
|
223
|
+
const msgs = messages.map((msg) => chunkQAHHTQ7V_cjs.ClientState.aminoTypes.toAmino(msg));
|
|
224
224
|
const signDoc = amino.makeSignDoc(
|
|
225
225
|
msgs,
|
|
226
226
|
fee,
|
|
@@ -231,7 +231,7 @@ var signCosmosMessageAmino = async (options) => {
|
|
|
231
231
|
);
|
|
232
232
|
const { signature, signed } = await signer.signAmino(signerAddress, signDoc);
|
|
233
233
|
const signedTxBody = {
|
|
234
|
-
messages: signed.msgs.map((msg) =>
|
|
234
|
+
messages: signed.msgs.map((msg) => chunkQAHHTQ7V_cjs.ClientState.aminoTypes.fromAmino(msg)),
|
|
235
235
|
memo: signed.memo
|
|
236
236
|
};
|
|
237
237
|
signedTxBody.messages[0].value.memo = messages[0].value.memo;
|
|
@@ -239,7 +239,7 @@ var signCosmosMessageAmino = async (options) => {
|
|
|
239
239
|
typeUrl: "/cosmos.tx.v1beta1.TxBody",
|
|
240
240
|
value: signedTxBody
|
|
241
241
|
};
|
|
242
|
-
const signedTxBodyBytes =
|
|
242
|
+
const signedTxBodyBytes = chunkQAHHTQ7V_cjs.ClientState.registry.encode(
|
|
243
243
|
signedTxBodyEncodeObject
|
|
244
244
|
);
|
|
245
245
|
const signedGasLimit = math.Int53.fromString(signed.fee.gas).toNumber();
|
|
@@ -274,7 +274,7 @@ var signCosmosTransaction = async ({
|
|
|
274
274
|
const chainId = tx.cosmosTx?.chainId;
|
|
275
275
|
const messages = tx.cosmosTx?.msgs;
|
|
276
276
|
const currentUserAddress = userAddresses.find((x) => x.chainId === tx.cosmosTx?.chainId)?.address;
|
|
277
|
-
const gasArray =
|
|
277
|
+
const gasArray = chunkQAHHTQ7V_cjs.ClientState.validateGasResults;
|
|
278
278
|
const gas = gasArray?.find((gas2) => gas2?.error !== null && gas2?.error !== void 0);
|
|
279
279
|
if (typeof gas?.error === "string") {
|
|
280
280
|
throw new Error(gas?.error);
|
|
@@ -289,7 +289,7 @@ var signCosmosTransaction = async ({
|
|
|
289
289
|
if (messages === void 0) {
|
|
290
290
|
throw new Error("no messages found for tx");
|
|
291
291
|
}
|
|
292
|
-
const { signer } = await
|
|
292
|
+
const { signer } = await chunkJ7HZ6VJE_cjs.getSigningStargateClient({
|
|
293
293
|
chainId,
|
|
294
294
|
getOfflineSigner: options?.getCosmosSigner
|
|
295
295
|
});
|
|
@@ -328,7 +328,7 @@ var signCosmosTransaction = async ({
|
|
|
328
328
|
txIndex: index,
|
|
329
329
|
signerAddress: currentUserAddress
|
|
330
330
|
});
|
|
331
|
-
|
|
331
|
+
chunkBCX2D6TE_cjs.updateRouteDetails({
|
|
332
332
|
status: "signing",
|
|
333
333
|
routeId,
|
|
334
334
|
options
|
|
@@ -344,7 +344,7 @@ var signCosmosTransaction = async ({
|
|
|
344
344
|
options?.onTransactionSigned?.({
|
|
345
345
|
chainId
|
|
346
346
|
});
|
|
347
|
-
|
|
347
|
+
chunkBCX2D6TE_cjs.updateRouteDetails({
|
|
348
348
|
status: "pending",
|
|
349
349
|
routeId,
|
|
350
350
|
options
|
|
@@ -371,7 +371,7 @@ var executeCosmosTransaction = async ({
|
|
|
371
371
|
routeId
|
|
372
372
|
});
|
|
373
373
|
const chainId = tx.cosmosTx?.chainId;
|
|
374
|
-
const txResponse = await
|
|
374
|
+
const txResponse = await chunk262HFM6V_cjs.submitTransaction({
|
|
375
375
|
chainId,
|
|
376
376
|
tx: rawTxBase64
|
|
377
377
|
});
|
|
@@ -584,7 +584,7 @@ var erc20ABI = /* @__PURE__ */ createAbi([
|
|
|
584
584
|
|
|
585
585
|
// src/private-functions/evm/executeEvmTransaction.ts
|
|
586
586
|
var executeEvmTransaction = async (message, options, index, routeId) => {
|
|
587
|
-
const gasArray =
|
|
587
|
+
const gasArray = chunkQAHHTQ7V_cjs.ClientState.validateGasResults;
|
|
588
588
|
const gas = gasArray?.find((gas2) => gas2?.error !== null && gas2?.error !== void 0);
|
|
589
589
|
if (typeof gas?.error === "string") {
|
|
590
590
|
throw new Error(gas?.error);
|
|
@@ -630,7 +630,7 @@ var executeEvmTransaction = async (message, options, index, routeId) => {
|
|
|
630
630
|
status: "pending",
|
|
631
631
|
allowance: requiredApproval
|
|
632
632
|
});
|
|
633
|
-
|
|
633
|
+
chunkBCX2D6TE_cjs.updateRouteDetails({
|
|
634
634
|
status: "allowance",
|
|
635
635
|
routeId,
|
|
636
636
|
options
|
|
@@ -664,7 +664,7 @@ var executeEvmTransaction = async (message, options, index, routeId) => {
|
|
|
664
664
|
signerAddress: evmSigner.account.address,
|
|
665
665
|
txIndex: index
|
|
666
666
|
});
|
|
667
|
-
|
|
667
|
+
chunkBCX2D6TE_cjs.updateRouteDetails({
|
|
668
668
|
status: "signing",
|
|
669
669
|
routeId,
|
|
670
670
|
options
|
|
@@ -676,7 +676,7 @@ var executeEvmTransaction = async (message, options, index, routeId) => {
|
|
|
676
676
|
chain: evmSigner.chain,
|
|
677
677
|
value: evmTx.value === "" ? void 0 : BigInt(evmTx.value)
|
|
678
678
|
});
|
|
679
|
-
|
|
679
|
+
chunkBCX2D6TE_cjs.updateRouteDetails({
|
|
680
680
|
status: "pending",
|
|
681
681
|
routeId,
|
|
682
682
|
options
|
|
@@ -695,7 +695,7 @@ var signSvmTransaction = async ({
|
|
|
695
695
|
index,
|
|
696
696
|
routeId
|
|
697
697
|
}) => {
|
|
698
|
-
const gasArray =
|
|
698
|
+
const gasArray = chunkQAHHTQ7V_cjs.ClientState.validateGasResults;
|
|
699
699
|
if (tx === void 0) {
|
|
700
700
|
throw new Error("executeSvmTransaction error: tx is undefined");
|
|
701
701
|
}
|
|
@@ -732,14 +732,14 @@ var signSvmTransaction = async ({
|
|
|
732
732
|
signerAddress: signer.publicKey?.toBase58(),
|
|
733
733
|
txIndex: index
|
|
734
734
|
});
|
|
735
|
-
|
|
735
|
+
chunkBCX2D6TE_cjs.updateRouteDetails({
|
|
736
736
|
status: "signing",
|
|
737
737
|
routeId,
|
|
738
738
|
options
|
|
739
739
|
});
|
|
740
740
|
const signedTx = await signer.signTransaction(transaction);
|
|
741
741
|
options?.onTransactionSigned?.({ chainId: svmTx.chainId });
|
|
742
|
-
|
|
742
|
+
chunkBCX2D6TE_cjs.updateRouteDetails({
|
|
743
743
|
status: "pending",
|
|
744
744
|
routeId,
|
|
745
745
|
options
|
|
@@ -758,10 +758,10 @@ var executeSvmTransaction = async (tx, options, index, routeId) => {
|
|
|
758
758
|
if (!signedTx) {
|
|
759
759
|
throw new Error("executeSvmTransaction error: signedTx is undefined");
|
|
760
760
|
}
|
|
761
|
-
const endpoint = await
|
|
761
|
+
const endpoint = await chunkJ7HZ6VJE_cjs.getRpcEndpointForChain(svmTx.chainId);
|
|
762
762
|
const connection = new web3_js.Connection(endpoint);
|
|
763
763
|
let signature;
|
|
764
|
-
const submitTxResponse = await
|
|
764
|
+
const submitTxResponse = await chunk262HFM6V_cjs.submitTransaction({
|
|
765
765
|
chainId: svmTx.chainId,
|
|
766
766
|
tx: signedTx.toString("base64")
|
|
767
767
|
});
|
|
@@ -789,13 +789,13 @@ var executeSvmTransaction = async (tx, options, index, routeId) => {
|
|
|
789
789
|
};
|
|
790
790
|
}
|
|
791
791
|
if (getStatusCount > 12) {
|
|
792
|
-
await
|
|
792
|
+
await chunkHFEMNOJS_cjs.wait(3e3);
|
|
793
793
|
throw new Error(
|
|
794
794
|
`executeSvmTransaction error: waiting finalized status timed out for ${signature}`
|
|
795
795
|
);
|
|
796
796
|
}
|
|
797
797
|
getStatusCount++;
|
|
798
|
-
await
|
|
798
|
+
await chunkHFEMNOJS_cjs.wait(3e3);
|
|
799
799
|
} catch (error) {
|
|
800
800
|
errorCount++;
|
|
801
801
|
if (errorCount > 12) {
|
|
@@ -829,7 +829,7 @@ var validateEvmTokenApproval = async ({
|
|
|
829
829
|
const fee = await extendedSigner.estimateFeesPerGas();
|
|
830
830
|
const allowanceGasFee = BigInt(fee.maxFeePerGas) * BigInt(1e5);
|
|
831
831
|
if (!gasBalance) {
|
|
832
|
-
const chainAssets = (await
|
|
832
|
+
const chainAssets = (await chunkQAHHTQ7V_cjs.ClientState.getSkipAssets({ chainId: tx.chainId }))[tx.chainId];
|
|
833
833
|
const nativeAsset = chainAssets?.find((x) => x.denom.includes("-native"));
|
|
834
834
|
const zeroAddressAsset = chainAssets?.find(
|
|
835
835
|
(x) => x.denom.toLowerCase() === "0x0000000000000000000000000000000000000000"
|
|
@@ -845,8 +845,8 @@ var validateEvmTokenApproval = async ({
|
|
|
845
845
|
`Insufficient balance for gas on ${chain.prettyName}. Need ${formattedGasAmount} ${asset.symbol}.`
|
|
846
846
|
);
|
|
847
847
|
}
|
|
848
|
-
if (
|
|
849
|
-
const chainAssets = (await
|
|
848
|
+
if (chunkWKYP2NMS_cjs.BigNumber(gasBalance.amount).lt(Number(allowanceGasFee))) {
|
|
849
|
+
const chainAssets = (await chunkQAHHTQ7V_cjs.ClientState.getSkipAssets({ chainId: tx.chainId }))[tx.chainId];
|
|
850
850
|
const asset = chainAssets?.find(
|
|
851
851
|
(x) => x.denom.includes("-native") || x.denom.toLowerCase() === "0x0000000000000000000000000000000000000000"
|
|
852
852
|
);
|
|
@@ -895,8 +895,8 @@ var validateEvmGasBalance = async ({
|
|
|
895
895
|
bypassApprovalCheck
|
|
896
896
|
}) => {
|
|
897
897
|
const chainId = tx?.chainId ?? "";
|
|
898
|
-
const skipAssets = (await
|
|
899
|
-
const skipChains = await
|
|
898
|
+
const skipAssets = (await chunkQAHHTQ7V_cjs.ClientState.getSkipAssets({ chainId }))?.[chainId];
|
|
899
|
+
const skipChains = await chunkQAHHTQ7V_cjs.ClientState.getSkipChains();
|
|
900
900
|
const chain = skipChains?.find?.((chain2) => chain2.chainId === chainId);
|
|
901
901
|
if (!chain) {
|
|
902
902
|
throw new Error(`failed to find chain for chainId: '${chainId}'`);
|
|
@@ -904,7 +904,7 @@ var validateEvmGasBalance = async ({
|
|
|
904
904
|
if (!signer.account?.address) {
|
|
905
905
|
throw new Error("validateEvmGasBalance: Signer address not found");
|
|
906
906
|
}
|
|
907
|
-
const skipBalances = (await
|
|
907
|
+
const skipBalances = (await chunkQAHHTQ7V_cjs.balances({
|
|
908
908
|
chains: {
|
|
909
909
|
[tx?.chainId ?? ""]: {
|
|
910
910
|
address: signer.account?.address
|
|
@@ -957,7 +957,7 @@ var validateEvmGasBalance = async ({
|
|
|
957
957
|
fee: null
|
|
958
958
|
};
|
|
959
959
|
}
|
|
960
|
-
if (
|
|
960
|
+
if (chunkWKYP2NMS_cjs.BigNumber(gasBalance.amount ?? "").lt(Number(gasAmount))) {
|
|
961
961
|
const asset = skipAssets?.find(
|
|
962
962
|
(x) => x.denom?.includes("-native") || x.denom?.toLowerCase() === "0x0000000000000000000000000000000000000000"
|
|
963
963
|
);
|
|
@@ -990,7 +990,7 @@ var validateSvmGasBalance = async ({
|
|
|
990
990
|
fee: null
|
|
991
991
|
};
|
|
992
992
|
}
|
|
993
|
-
const endpoint = await
|
|
993
|
+
const endpoint = await chunkJ7HZ6VJE_cjs.getRpcEndpointForChain(tx.chainId ?? "");
|
|
994
994
|
const connection = new web3_js.Connection(endpoint);
|
|
995
995
|
if (!connection) throw new Error(`Failed to connect to ${tx.chainId}`);
|
|
996
996
|
if (!tx.tx) {
|
|
@@ -1068,7 +1068,7 @@ var validateGasBalances = async ({
|
|
|
1068
1068
|
onValidateGasBalance?.({
|
|
1069
1069
|
status: "pending"
|
|
1070
1070
|
});
|
|
1071
|
-
|
|
1071
|
+
chunkBCX2D6TE_cjs.updateRouteDetails({
|
|
1072
1072
|
status: "validating",
|
|
1073
1073
|
routeId,
|
|
1074
1074
|
options
|
|
@@ -1077,7 +1077,7 @@ var validateGasBalances = async ({
|
|
|
1077
1077
|
throw new Error(`invalid msgs ${tx?.cosmosTx?.msgs}`);
|
|
1078
1078
|
}
|
|
1079
1079
|
try {
|
|
1080
|
-
const res = await
|
|
1080
|
+
const res = await chunkCZKIE576_cjs.validateCosmosGasBalance({
|
|
1081
1081
|
chainId: tx.cosmosTx.chainId ?? "",
|
|
1082
1082
|
signerAddress: tx.cosmosTx.signerAddress ?? "",
|
|
1083
1083
|
messages: tx.cosmosTx.msgs,
|
|
@@ -1102,7 +1102,7 @@ var validateGasBalances = async ({
|
|
|
1102
1102
|
onValidateGasBalance?.({
|
|
1103
1103
|
status: "pending"
|
|
1104
1104
|
});
|
|
1105
|
-
|
|
1105
|
+
chunkBCX2D6TE_cjs.updateRouteDetails({
|
|
1106
1106
|
status: "validating",
|
|
1107
1107
|
routeId,
|
|
1108
1108
|
options
|
|
@@ -1135,7 +1135,7 @@ var validateGasBalances = async ({
|
|
|
1135
1135
|
onValidateGasBalance?.({
|
|
1136
1136
|
status: "pending"
|
|
1137
1137
|
});
|
|
1138
|
-
|
|
1138
|
+
chunkBCX2D6TE_cjs.updateRouteDetails({
|
|
1139
1139
|
status: "validating",
|
|
1140
1140
|
routeId,
|
|
1141
1141
|
options
|
|
@@ -1165,13 +1165,13 @@ var validateGasBalances = async ({
|
|
|
1165
1165
|
onValidateGasBalance?.({
|
|
1166
1166
|
status: "error"
|
|
1167
1167
|
});
|
|
1168
|
-
|
|
1168
|
+
chunkQAHHTQ7V_cjs.ClientState.validateGasResults = validateResult;
|
|
1169
1169
|
throw new Error(`${txError.error}`);
|
|
1170
1170
|
}
|
|
1171
1171
|
onValidateGasBalance?.({
|
|
1172
1172
|
status: "completed"
|
|
1173
1173
|
});
|
|
1174
|
-
|
|
1174
|
+
chunkQAHHTQ7V_cjs.ClientState.validateGasResults = validateResult;
|
|
1175
1175
|
};
|
|
1176
1176
|
|
|
1177
1177
|
// src/private-functions/getChainIdsFromTxs.ts
|
|
@@ -1231,7 +1231,7 @@ var executeTransactions = async (options) => {
|
|
|
1231
1231
|
throw new Error("executeRoute error: invalid message type");
|
|
1232
1232
|
}
|
|
1233
1233
|
});
|
|
1234
|
-
|
|
1234
|
+
chunkBCX2D6TE_cjs.updateRouteDetails({
|
|
1235
1235
|
transactionDetails,
|
|
1236
1236
|
routeId,
|
|
1237
1237
|
options
|
|
@@ -1239,7 +1239,7 @@ var executeTransactions = async (options) => {
|
|
|
1239
1239
|
const isGasStationSourceEVM = chainIds.find((item, i, array) => {
|
|
1240
1240
|
return chunkKZOSEIWH_cjs.GAS_STATION_CHAIN_IDS.includes(item?.chainId ?? "") && array[i - 1]?.chainType === "evm" /* Evm */;
|
|
1241
1241
|
});
|
|
1242
|
-
|
|
1242
|
+
chunkQAHHTQ7V_cjs.ClientState.validateGasResults = void 0;
|
|
1243
1243
|
const validateChainIds = !batchSimulate ? chainIds.map((x) => x?.chainId ?? "") : isGasStationSourceEVM ? chunkKZOSEIWH_cjs.GAS_STATION_CHAIN_IDS : [];
|
|
1244
1244
|
await validateGasBalances({
|
|
1245
1245
|
txs,
|
|
@@ -1342,7 +1342,7 @@ var executeTransactions = async (options) => {
|
|
|
1342
1342
|
let txResult;
|
|
1343
1343
|
const txSigned = signedTxs.find((item) => item.index === index);
|
|
1344
1344
|
if (txSigned) {
|
|
1345
|
-
const txResponse = await
|
|
1345
|
+
const txResponse = await chunk262HFM6V_cjs.submitTransaction({
|
|
1346
1346
|
chainId: txSigned.chainId,
|
|
1347
1347
|
tx: txSigned.tx
|
|
1348
1348
|
});
|
|
@@ -1398,7 +1398,7 @@ var getDefaultFallbackGasAmount = async (chainId, chainType) => {
|
|
|
1398
1398
|
return EVM_GAS_AMOUNT;
|
|
1399
1399
|
}
|
|
1400
1400
|
if (chainType !== "cosmos" /* Cosmos */) return void 0;
|
|
1401
|
-
const venuesResult = await
|
|
1401
|
+
const venuesResult = await chunkT5EGKQAT_cjs.venues();
|
|
1402
1402
|
const isSwapChain = venuesResult?.some(
|
|
1403
1403
|
(venue) => venue.chainId === chainId
|
|
1404
1404
|
) ?? false;
|
|
@@ -1411,7 +1411,7 @@ var getDefaultFallbackGasAmount = async (chainId, chainType) => {
|
|
|
1411
1411
|
return defaultGasAmount;
|
|
1412
1412
|
};
|
|
1413
1413
|
var validateUserAddresses = async (userAddresses) => {
|
|
1414
|
-
const chains2 = await
|
|
1414
|
+
const chains2 = await chunkQAHHTQ7V_cjs.ClientState.getSkipChains();
|
|
1415
1415
|
const validations = userAddresses.map((userAddress) => {
|
|
1416
1416
|
const chain = chains2.find((chain2) => chain2.chainId === userAddress.chainId);
|
|
1417
1417
|
switch (chain?.chainType) {
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHFEMNOJS_cjs = require('./chunk-HFEMNOJS.cjs');
|
|
4
4
|
|
|
5
5
|
// src/api/postMessagesDirect.ts
|
|
6
|
-
var messagesDirect =
|
|
6
|
+
var messagesDirect = chunkHFEMNOJS_cjs.api({
|
|
7
7
|
methodName: "msgsDirect",
|
|
8
8
|
method: "post",
|
|
9
9
|
path: "v2/fungible/msgs_direct"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkPLO5CVGN_cjs = require('./chunk-PLO5CVGN.cjs');
|
|
4
|
+
var chunkJWWJIJUE_cjs = require('./chunk-JWWJIJUE.cjs');
|
|
5
|
+
var chunkHFEMNOJS_cjs = require('./chunk-HFEMNOJS.cjs');
|
|
6
6
|
var uuid = require('uuid');
|
|
7
7
|
|
|
8
8
|
// src/utils/clientType.ts
|
|
@@ -37,30 +37,71 @@ function getClientTransferEvent(transferEvent) {
|
|
|
37
37
|
} else if (layerZeroTransfer) {
|
|
38
38
|
transferType = "layerZeroTransfer" /* layerZeroTransfer */;
|
|
39
39
|
}
|
|
40
|
-
const
|
|
40
|
+
const getTxHashAndExplorerLink = (type) => {
|
|
41
41
|
switch (transferType) {
|
|
42
42
|
case "ibcTransfer" /* ibcTransfer */:
|
|
43
43
|
if (type === "send") {
|
|
44
|
-
return
|
|
44
|
+
return {
|
|
45
|
+
explorerLink: ibcTransfer.packetTxs.sendTx?.explorerLink,
|
|
46
|
+
txHash: ibcTransfer.packetTxs.sendTx?.txHash
|
|
47
|
+
};
|
|
45
48
|
}
|
|
46
|
-
return
|
|
49
|
+
return {
|
|
50
|
+
explorerLink: ibcTransfer.packetTxs.receiveTx?.explorerLink,
|
|
51
|
+
txHash: ibcTransfer.packetTxs.receiveTx?.txHash
|
|
52
|
+
};
|
|
47
53
|
case "eurekaTransfer" /* eurekaTransfer */:
|
|
48
54
|
if (type === "send") {
|
|
49
|
-
return
|
|
55
|
+
return {
|
|
56
|
+
explorerLink: eurekaTransfer.packetTxs.sendTx?.explorerLink,
|
|
57
|
+
txHash: eurekaTransfer.packetTxs.sendTx?.txHash
|
|
58
|
+
};
|
|
50
59
|
}
|
|
51
|
-
return
|
|
60
|
+
return {
|
|
61
|
+
explorerLink: eurekaTransfer.packetTxs.receiveTx?.explorerLink,
|
|
62
|
+
txHash: eurekaTransfer.packetTxs.receiveTx?.txHash
|
|
63
|
+
};
|
|
52
64
|
case "goFastTransfer" /* goFastTransfer */:
|
|
53
65
|
if (type === "send") {
|
|
54
|
-
return
|
|
66
|
+
return {
|
|
67
|
+
explorerLink: goFastTransfer.txs.orderSubmittedTx?.explorerLink,
|
|
68
|
+
txHash: goFastTransfer.txs.orderSubmittedTx?.txHash
|
|
69
|
+
};
|
|
55
70
|
}
|
|
56
|
-
return
|
|
71
|
+
return {
|
|
72
|
+
explorerLink: goFastTransfer.txs.orderFilledTx?.explorerLink,
|
|
73
|
+
txHash: goFastTransfer.txs.orderFilledTx?.txHash
|
|
74
|
+
};
|
|
57
75
|
case "axelarTransfer" /* axelarTransfer */:
|
|
58
|
-
return
|
|
76
|
+
return {
|
|
77
|
+
explorerLink: axelarTransfer?.axelarScanLink,
|
|
78
|
+
txHash: axelarTransfer?.txs?.sendTx?.txHash
|
|
79
|
+
};
|
|
59
80
|
default:
|
|
60
81
|
if (type === "send") {
|
|
61
|
-
return
|
|
82
|
+
return {
|
|
83
|
+
explorerLink: combinedTransferEvent[transferType]?.txs?.sendTx?.explorerLink,
|
|
84
|
+
txHash: combinedTransferEvent[transferType]?.txs?.sendTx?.txHash
|
|
85
|
+
};
|
|
62
86
|
}
|
|
63
|
-
return
|
|
87
|
+
return {
|
|
88
|
+
explorerLink: combinedTransferEvent[transferType]?.txs?.receiveTx?.explorerLink,
|
|
89
|
+
txHash: combinedTransferEvent[transferType]?.txs?.receiveTx?.txHash
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
const getDuration = () => {
|
|
94
|
+
switch (transferType) {
|
|
95
|
+
case "ibcTransfer" /* ibcTransfer */:
|
|
96
|
+
return new Date(ibcTransfer.packetTxs.receiveTx?.onChainAt ?? 0).getTime() - new Date(ibcTransfer.packetTxs.sendTx?.onChainAt ?? 0).getTime();
|
|
97
|
+
case "eurekaTransfer" /* eurekaTransfer */:
|
|
98
|
+
return new Date(eurekaTransfer.packetTxs.receiveTx?.onChainAt ?? 0).getTime() - new Date(eurekaTransfer.packetTxs.sendTx?.onChainAt ?? 0).getTime();
|
|
99
|
+
case "goFastTransfer" /* goFastTransfer */:
|
|
100
|
+
return new Date(goFastTransfer.txs.orderFilledTx?.onChainAt ?? 0).getTime() - new Date(goFastTransfer.txs.orderSubmittedTx?.onChainAt ?? 0).getTime();
|
|
101
|
+
case "axelarTransfer" /* axelarTransfer */:
|
|
102
|
+
return new Date(axelarTransfer?.txs?.confirmTx?.onChainAt ?? 0).getTime() - new Date(axelarTransfer?.txs?.sendTx?.onChainAt ?? 0).getTime();
|
|
103
|
+
default:
|
|
104
|
+
return new Date(combinedTransferEvent[transferType]?.txs?.receiveTx?.onChainAt ?? 0).getTime() - new Date(combinedTransferEvent[transferType]?.txs?.sendTx?.onChainAt ?? 0).getTime();
|
|
64
105
|
}
|
|
65
106
|
};
|
|
66
107
|
const _result = {
|
|
@@ -75,8 +116,12 @@ function getClientTransferEvent(transferEvent) {
|
|
|
75
116
|
...stargateTransfer,
|
|
76
117
|
...eurekaTransfer,
|
|
77
118
|
...layerZeroTransfer,
|
|
78
|
-
|
|
79
|
-
|
|
119
|
+
transferType,
|
|
120
|
+
fromExplorerLink: getTxHashAndExplorerLink("send")?.explorerLink,
|
|
121
|
+
toExplorerLink: getTxHashAndExplorerLink("receive")?.explorerLink,
|
|
122
|
+
fromTxHash: getTxHashAndExplorerLink("send")?.txHash,
|
|
123
|
+
toTxHash: getTxHashAndExplorerLink("receive")?.txHash,
|
|
124
|
+
durationInMs: getDuration()
|
|
80
125
|
};
|
|
81
126
|
const status = getSimpleStatus(_result.state);
|
|
82
127
|
const result = {
|
|
@@ -93,6 +138,19 @@ function getTransferEventsFromTxStatusResponse(txStatusResponse) {
|
|
|
93
138
|
});
|
|
94
139
|
});
|
|
95
140
|
}
|
|
141
|
+
function getSimpleOverallStatus(state) {
|
|
142
|
+
switch (state) {
|
|
143
|
+
case "STATE_SUBMITTED":
|
|
144
|
+
case "STATE_PENDING":
|
|
145
|
+
return "pending";
|
|
146
|
+
case "STATE_COMPLETED_SUCCESS":
|
|
147
|
+
return "success";
|
|
148
|
+
case "STATE_COMPLETED_ERROR":
|
|
149
|
+
case "STATE_PENDING_ERROR":
|
|
150
|
+
default:
|
|
151
|
+
return "failed";
|
|
152
|
+
}
|
|
153
|
+
}
|
|
96
154
|
function getSimpleStatus(state) {
|
|
97
155
|
switch (state) {
|
|
98
156
|
case "TRANSFER_PENDING":
|
|
@@ -121,6 +179,18 @@ function getSimpleStatus(state) {
|
|
|
121
179
|
return "failed";
|
|
122
180
|
}
|
|
123
181
|
}
|
|
182
|
+
var TransferType = /* @__PURE__ */ ((TransferType2) => {
|
|
183
|
+
TransferType2["ibcTransfer"] = "ibcTransfer";
|
|
184
|
+
TransferType2["axelarTransfer"] = "axelarTransfer";
|
|
185
|
+
TransferType2["cctpTransfer"] = "cctpTransfer";
|
|
186
|
+
TransferType2["hyperlaneTransfer"] = "hyperlaneTransfer";
|
|
187
|
+
TransferType2["opInitTransfer"] = "opInitTransfer";
|
|
188
|
+
TransferType2["goFastTransfer"] = "goFastTransfer";
|
|
189
|
+
TransferType2["stargateTransfer"] = "stargateTransfer";
|
|
190
|
+
TransferType2["eurekaTransfer"] = "eurekaTransfer";
|
|
191
|
+
TransferType2["layerZeroTransfer"] = "layerZeroTransfer";
|
|
192
|
+
return TransferType2;
|
|
193
|
+
})(TransferType || {});
|
|
124
194
|
function getTransactionStatus(state) {
|
|
125
195
|
switch (state) {
|
|
126
196
|
case "STATE_SUBMITTED":
|
|
@@ -218,7 +288,7 @@ var executeAndSubscribeToRouteStatus = async ({
|
|
|
218
288
|
let { txHash, explorerLink } = await executeTransaction?.(transactionIndex);
|
|
219
289
|
transaction.txHash = txHash;
|
|
220
290
|
if (!explorerLink) {
|
|
221
|
-
const trackResponse = await
|
|
291
|
+
const trackResponse = await chunkPLO5CVGN_cjs.trackTransaction({
|
|
222
292
|
chainId: transaction.chainId,
|
|
223
293
|
txHash: transaction.txHash,
|
|
224
294
|
...trackTxPollingOptions
|
|
@@ -262,7 +332,7 @@ var executeAndSubscribeToRouteStatus = async ({
|
|
|
262
332
|
break;
|
|
263
333
|
}
|
|
264
334
|
try {
|
|
265
|
-
const statusResponse = await
|
|
335
|
+
const statusResponse = await chunkJWWJIJUE_cjs.transactionStatus({
|
|
266
336
|
chainId: transaction.chainId,
|
|
267
337
|
txHash: transaction.txHash
|
|
268
338
|
});
|
|
@@ -302,7 +372,7 @@ var executeAndSubscribeToRouteStatus = async ({
|
|
|
302
372
|
} catch (error) {
|
|
303
373
|
console.error(error);
|
|
304
374
|
} finally {
|
|
305
|
-
await
|
|
375
|
+
await chunkHFEMNOJS_cjs.wait(1e3);
|
|
306
376
|
}
|
|
307
377
|
}
|
|
308
378
|
}
|
|
@@ -462,7 +532,10 @@ var updateRelatedRoutes = ({
|
|
|
462
532
|
return updatedRelatedRoutes;
|
|
463
533
|
};
|
|
464
534
|
|
|
535
|
+
exports.TransferType = TransferType;
|
|
465
536
|
exports.executeAndSubscribeToRouteStatus = executeAndSubscribeToRouteStatus;
|
|
537
|
+
exports.getSimpleOverallStatus = getSimpleOverallStatus;
|
|
466
538
|
exports.getTransactionStatus = getTransactionStatus;
|
|
539
|
+
exports.getTransferEventsFromTxStatusResponse = getTransferEventsFromTxStatusResponse;
|
|
467
540
|
exports.subscribeToRouteStatus = subscribeToRouteStatus;
|
|
468
541
|
exports.updateRouteDetails = updateRouteDetails;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
require('uuid');
|
|
3
|
+
var chunkARCCHERF_cjs = require('./chunk-ARCCHERF.cjs');
|
|
4
|
+
var chunkBCX2D6TE_cjs = require('./chunk-BCX2D6TE.cjs');
|
|
5
|
+
var chunk3NHW3XWK_cjs = require('./chunk-3NHW3XWK.cjs');
|
|
6
|
+
var chunkPLO5CVGN_cjs = require('./chunk-PLO5CVGN.cjs');
|
|
7
|
+
var chunkHFEMNOJS_cjs = require('./chunk-HFEMNOJS.cjs');
|
|
9
8
|
|
|
9
|
+
// src/public-functions/executeMultipleRoutes.ts
|
|
10
10
|
var executeMultipleRoutes = async (options) => {
|
|
11
11
|
const {
|
|
12
12
|
route,
|
|
@@ -24,7 +24,7 @@ var executeMultipleRoutes = async (options) => {
|
|
|
24
24
|
`executeMultipleRoutes error: no user addresses found for route: ${routeKey}`
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
|
-
const routeAddressList = await
|
|
27
|
+
const routeAddressList = await chunkARCCHERF_cjs.createValidAddressList({
|
|
28
28
|
userAddresses: _userAddresses,
|
|
29
29
|
route: routeValue
|
|
30
30
|
});
|
|
@@ -38,7 +38,7 @@ var executeMultipleRoutes = async (options) => {
|
|
|
38
38
|
`executeMultipleRoutes error: address list not found for route ${routeKey}`
|
|
39
39
|
);
|
|
40
40
|
}
|
|
41
|
-
return await
|
|
41
|
+
return await chunk3NHW3XWK_cjs.messages({
|
|
42
42
|
timeoutSeconds: options.timeoutSeconds,
|
|
43
43
|
amountIn: routeValue?.amountIn,
|
|
44
44
|
amountOut: routeValue.estimatedAmountOut || "0",
|
|
@@ -49,7 +49,7 @@ var executeMultipleRoutes = async (options) => {
|
|
|
49
49
|
operations: routeValue?.operations,
|
|
50
50
|
addressList: routeAddressList,
|
|
51
51
|
slippageTolerancePercent: slippageTolerancePercent?.[routeKey] || "1",
|
|
52
|
-
chainIdsToAffiliates:
|
|
52
|
+
chainIdsToAffiliates: chunkHFEMNOJS_cjs.ApiState.chainIdsToAffiliates,
|
|
53
53
|
postRouteHandler: postRouteHandler?.[routeKey],
|
|
54
54
|
feePayerAddress: options.svmFeePayer?.address
|
|
55
55
|
});
|
|
@@ -119,7 +119,7 @@ var executeMultipleRoutes = async (options) => {
|
|
|
119
119
|
const executeTransactionList = {};
|
|
120
120
|
const mergedMainAndSecondaryRoutes = Object.entries(msgsRecord).length !== Object.entries(route).length;
|
|
121
121
|
for (const [routeKey, msgsResponse] of Object.entries(msgsRecord)) {
|
|
122
|
-
const { id: routeId } =
|
|
122
|
+
const { id: routeId } = chunkBCX2D6TE_cjs.updateRouteDetails({
|
|
123
123
|
status: "unconfirmed",
|
|
124
124
|
options: {
|
|
125
125
|
route: route[routeKey],
|
|
@@ -132,7 +132,7 @@ var executeMultipleRoutes = async (options) => {
|
|
|
132
132
|
if (routeKey === "mainRoute") {
|
|
133
133
|
mainRouteId = routeId;
|
|
134
134
|
}
|
|
135
|
-
const { transactionDetails, executeTransaction: _executeTransaction } = await
|
|
135
|
+
const { transactionDetails, executeTransaction: _executeTransaction } = await chunkARCCHERF_cjs.executeTransactions({
|
|
136
136
|
...restOptions,
|
|
137
137
|
routeId,
|
|
138
138
|
txs: msgsResponse?.txs,
|
|
@@ -144,7 +144,7 @@ var executeMultipleRoutes = async (options) => {
|
|
|
144
144
|
const txResult = await _executeTransaction(index2);
|
|
145
145
|
if (routeKey !== "mainRoute" || mergedMainAndSecondaryRoutes) {
|
|
146
146
|
const relatedRoutes = Object.entries(route).filter(([key]) => key !== "mainRoute").map(([key, route2]) => ({ route: route2, routeKey: key, status: "pending" }));
|
|
147
|
-
|
|
147
|
+
chunkBCX2D6TE_cjs.updateRouteDetails({
|
|
148
148
|
options: {
|
|
149
149
|
route: route[routeKey],
|
|
150
150
|
...restOptions
|
|
@@ -160,7 +160,7 @@ var executeMultipleRoutes = async (options) => {
|
|
|
160
160
|
for (const [index2, transactionDetail] of transactionDetails.entries()) {
|
|
161
161
|
const txResult = await executeTransaction(index2);
|
|
162
162
|
if (txResult.txHash) {
|
|
163
|
-
const trackResponse = await
|
|
163
|
+
const trackResponse = await chunkPLO5CVGN_cjs.trackTransaction({
|
|
164
164
|
chainId: transactionDetail.chainId,
|
|
165
165
|
txHash: txResult.txHash,
|
|
166
166
|
...options.trackTxPollingOptions
|
|
@@ -182,7 +182,7 @@ var executeMultipleRoutes = async (options) => {
|
|
|
182
182
|
}
|
|
183
183
|
await Promise.all(
|
|
184
184
|
Object.entries(msgsRecord).map(([routeKey, msgsResponse], index2) => {
|
|
185
|
-
return
|
|
185
|
+
return chunkBCX2D6TE_cjs.executeAndSubscribeToRouteStatus({
|
|
186
186
|
transactionDetails: transactionDetailsList[index2],
|
|
187
187
|
executeTransaction: executeTransactionList[index2],
|
|
188
188
|
routeId: msgsRecordIndexToRouteId[index2],
|
|
@@ -193,7 +193,7 @@ var executeMultipleRoutes = async (options) => {
|
|
|
193
193
|
onRouteStatusUpdated: (routeStatus) => {
|
|
194
194
|
const relatedRoutes = Object.entries(route).filter(([key]) => key !== "mainRoute").map(([key, route2]) => ({ route: route2, routeKey: key, status: routeStatus.status }));
|
|
195
195
|
if (routeKey !== "mainRoute") {
|
|
196
|
-
|
|
196
|
+
chunkBCX2D6TE_cjs.updateRouteDetails({
|
|
197
197
|
options: {
|
|
198
198
|
route: route[routeKey],
|
|
199
199
|
...restOptions
|