@skip-go/client 1.5.3-alpha.1 → 1.5.4
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-HFEMNOJS.cjs → chunk-2QPPD3BB.cjs} +3 -0
- package/dist/cjs/{chunk-7SZZBUBD.cjs → chunk-2SA3OAIJ.cjs} +3 -3
- package/dist/cjs/{chunk-APJDSXWR.cjs → chunk-3RPOC3AX.cjs} +12 -12
- package/dist/cjs/chunk-4BWE7SOV.cjs +68 -0
- package/dist/cjs/{chunk-FF5UWES6.cjs → chunk-4GHUZDDP.cjs} +4 -4
- package/dist/cjs/{chunk-KM2D7PJL.cjs → chunk-4TBONPD6.cjs} +33 -33
- package/dist/cjs/chunk-5JS6DMVZ.cjs +214 -0
- package/dist/cjs/{chunk-NWD4MAMT.cjs → chunk-5KWNKICM.cjs} +4 -10
- package/dist/cjs/{chunk-I2FDWZZJ.cjs → chunk-67WZP4PA.cjs} +106 -807
- package/dist/cjs/{chunk-WKYP2NMS.cjs → chunk-6W2OIU3O.cjs} +15 -15
- package/dist/cjs/{chunk-PDTIT3JO.cjs → chunk-7CFJPJJ2.cjs} +22 -22
- package/dist/cjs/chunk-7HDLYDAS.cjs +55 -0
- package/dist/cjs/{chunk-AW6IQ7JH.cjs → chunk-A5S6SIYN.cjs} +2 -2
- package/dist/cjs/{chunk-ZBJZTBIW.cjs → chunk-ASDMDYTC.cjs} +2 -2
- package/dist/cjs/{chunk-QAHHTQ7V.cjs → chunk-ATW6UNT5.cjs} +4 -4
- package/dist/cjs/{chunk-PLO5CVGN.cjs → chunk-AUTOIM57.cjs} +2 -2
- package/dist/cjs/{chunk-KWH6S7PB.cjs → chunk-CK6CQWQU.cjs} +6 -6
- package/dist/cjs/{chunk-RC73RNNQ.cjs → chunk-EGFH6FEG.cjs} +4 -4
- package/dist/cjs/{chunk-T5EGKQAT.cjs → chunk-FCTBCHOT.cjs} +2 -2
- package/dist/cjs/{chunk-S3BKLN4L.cjs → chunk-IJIBMN2F.cjs} +2 -2
- package/dist/cjs/{chunk-262HFM6V.cjs → chunk-JRXPJ45U.cjs} +2 -2
- package/dist/cjs/chunk-KZOSEIWH.cjs +10 -0
- package/dist/cjs/{chunk-3M7YYWGL.cjs → chunk-MUJBB64F.cjs} +3 -7
- package/dist/cjs/{chunk-3NHW3XWK.cjs → chunk-NCFH5MGF.cjs} +2 -2
- package/dist/cjs/{chunk-DWOE6N5S.cjs → chunk-NM4PISTQ.cjs} +189 -188
- package/dist/cjs/{chunk-4MV4GLIA.cjs → chunk-OJISEAMX.cjs} +2 -2
- package/dist/cjs/{chunk-JWWJIJUE.cjs → chunk-PDNKS5R2.cjs} +2 -2
- package/dist/cjs/{chunk-RBM66GW6.cjs → chunk-UXW4XVHF.cjs} +2 -2
- package/dist/cjs/chunk-VEEDEDME.cjs +454 -0
- package/dist/cjs/{chunk-DLT6Q6RB.cjs → chunk-WOSAJSJB.cjs} +163 -149
- package/dist/cjs/{chunk-XCFPRLX3.cjs → chunk-WRTBZRHG.cjs} +161 -161
- package/dist/cjs/{chunk-BCX2D6TE.cjs → chunk-ZHV4J6EM.cjs} +55 -23
- package/dist/cjs/index.cjs +123 -115
- package/dist/cjs/public-functions/executeMultipleRoutes.cjs +19 -29
- package/dist/cjs/public-functions/executeRoute.cjs +19 -29
- package/dist/cjs/public-functions/getCosmosGasAmountForMessage.cjs +5 -5
- package/dist/cjs/public-functions/getEvmGasAmountForMessage.cjs +1 -1
- package/dist/cjs/public-functions/getFeeInfoForChain.cjs +6 -5
- package/dist/cjs/public-functions/getRecommendedGasPrice.cjs +8 -7
- package/dist/cjs/public-functions/getRouteWithGasOnReceive.cjs +33 -29
- package/dist/cjs/public-functions/getSigningStargateClient.cjs +6 -6
- package/dist/cjs/public-functions/setApiOptions.cjs +4 -4
- package/dist/cjs/public-functions/setClientOptions.cjs +7 -7
- package/dist/cjs/public-functions/subscribeToRouteStatus.cjs +9 -9
- package/dist/cjs/public-functions/validateCosmosGasBalance.cjs +10 -10
- package/dist/cjs/public-functions/waitForTransaction.cjs +10 -6
- package/dist/esm/api/getAssets.d.ts +1 -1
- package/dist/esm/api/getAssets.js +3 -3
- package/dist/esm/api/getAssetsBetweenChains.d.ts +1 -1
- package/dist/esm/api/getAssetsBetweenChains.js +3 -3
- package/dist/esm/api/getBridges.d.ts +1 -1
- package/dist/esm/api/getBridges.js +3 -3
- package/dist/esm/api/getChains.d.ts +1 -1
- package/dist/esm/api/getChains.js +3 -3
- package/dist/esm/api/getVenues.js +3 -3
- package/dist/esm/api/postAssetsFromSource.d.ts +1 -1
- package/dist/esm/api/postAssetsFromSource.js +4 -4
- package/dist/esm/api/postBalances.d.ts +2 -2
- package/dist/esm/api/postBalances.js +3 -3
- package/dist/esm/api/postIbcOriginAssets.js +3 -3
- package/dist/esm/api/postMessages.d.ts +2 -2
- package/dist/esm/api/postMessages.js +3 -3
- package/dist/esm/api/postMessagesDirect.d.ts +1 -1
- package/dist/esm/api/postMessagesDirect.js +3 -3
- package/dist/esm/api/postRecommendAssets.d.ts +1 -1
- package/dist/esm/api/postRecommendAssets.js +3 -3
- package/dist/esm/api/postRoute.d.ts +2 -2
- package/dist/esm/api/postRoute.js +3 -3
- package/dist/esm/api/postSubmitTransaction.d.ts +2 -2
- package/dist/esm/api/postSubmitTransaction.js +3 -3
- package/dist/esm/api/postTrackTransaction.d.ts +2 -2
- package/dist/esm/api/postTrackTransaction.js +3 -3
- package/dist/esm/api/postTransactionStatus.d.ts +72 -68
- package/dist/esm/api/postTransactionStatus.js +3 -3
- package/dist/esm/{callbacks-C-KUJnDv.d.ts → callbacks-CZNSHCBb.d.ts} +5 -5
- package/dist/esm/chunk-22LYQHMA.js +53 -0
- package/dist/esm/{chunk-YLVUKXLR.js → chunk-3JHLVPRG.js} +1 -1
- package/dist/esm/chunk-763YPOJQ.js +431 -0
- package/dist/esm/chunk-7OHBD7I6.js +212 -0
- package/dist/esm/{chunk-FNTPI2AV.js → chunk-A5NZMSTI.js} +1 -1
- package/dist/esm/{chunk-QRKO56DH.js → chunk-BJKCMEMJ.js} +3 -8
- package/dist/esm/chunk-E4NRDAVO.js +65 -0
- package/dist/esm/{chunk-HDW6XFWX.js → chunk-ETBJVFQP.js} +1 -1
- package/dist/esm/{chunk-UIDIKXMB.js → chunk-F2LQB2DP.js} +6 -5
- package/dist/esm/{chunk-VGCTTJO7.js → chunk-F66EKL3W.js} +3 -0
- package/dist/esm/{chunk-V7VKYD4J.js → chunk-G63PICMU.js} +2 -2
- package/dist/esm/{chunk-KNXMSLOB.js → chunk-GLH7IRLX.js} +2 -2
- package/dist/esm/{chunk-RFJYCJK4.js → chunk-HNU2Y3JI.js} +1 -1
- package/dist/esm/{chunk-QL423UEF.js → chunk-HP5EMWC6.js} +163 -149
- package/dist/esm/{chunk-MYGJGC62.js → chunk-J24LYWJE.js} +1 -1
- package/dist/esm/{chunk-JYYCFKB4.js → chunk-KS764SOZ.js} +15 -15
- package/dist/esm/{chunk-SFWTQBQT.js → chunk-KXS5UH7E.js} +4 -4
- package/dist/esm/{chunk-VWOMKMH2.js → chunk-KZKAL5ZN.js} +1 -1
- package/dist/esm/{chunk-IKWC55JU.js → chunk-LAGER3PR.js} +61 -740
- package/dist/esm/{chunk-3WFXBPS2.js → chunk-N4PTRCNT.js} +1 -1
- package/dist/esm/{chunk-IHSSWY3M.js → chunk-P36PE4CR.js} +1 -1
- package/dist/esm/{chunk-UBVBVJPY.js → chunk-QYXGDTUU.js} +1 -1
- package/dist/esm/{chunk-QO2CYYF5.js → chunk-RTDD7HZ3.js} +4 -7
- package/dist/esm/chunk-SWYON2RG.js +7 -0
- package/dist/esm/{chunk-AUNRER4I.js → chunk-SXBG57J3.js} +1 -1
- package/dist/esm/{chunk-HELQO7PA.js → chunk-TGTOO2ZQ.js} +2 -2
- package/dist/esm/{chunk-6M7N6EAO.js → chunk-TON3V7SK.js} +14 -14
- package/dist/esm/{chunk-KXQ2ASHQ.js → chunk-UHCKOKBM.js} +1 -1
- package/dist/esm/{chunk-YGQ4NKTM.js → chunk-UN46DUOV.js} +1 -1
- package/dist/esm/{chunk-2PWROHHX.js → chunk-VMEHGKH7.js} +2 -2
- package/dist/esm/{chunk-5IXH2QPF.js → chunk-WRPS6WK2.js} +52 -20
- package/dist/esm/{chunk-44IX6KPJ.js → chunk-XNU3TKKM.js} +1 -1
- package/dist/esm/{client-types-CGMuZ3zo.d.ts → client-types-BX_0924O.d.ts} +1 -1
- package/dist/esm/{generateApi-D_-Gso-x.d.ts → generateApi-Clc85Kxw.d.ts} +1 -1
- package/dist/esm/index.d.ts +264 -261
- package/dist/esm/index.js +32 -28
- package/dist/esm/public-functions/executeMultipleRoutes.d.ts +4 -4
- package/dist/esm/public-functions/executeMultipleRoutes.js +18 -28
- package/dist/esm/public-functions/executeRoute.d.ts +4 -4
- package/dist/esm/public-functions/executeRoute.js +18 -28
- package/dist/esm/public-functions/getCosmosGasAmountForMessage.d.ts +1 -1
- package/dist/esm/public-functions/getCosmosGasAmountForMessage.js +3 -3
- package/dist/esm/public-functions/getEvmGasAmountForMessage.d.ts +3 -3
- package/dist/esm/public-functions/getEvmGasAmountForMessage.js +1 -1
- package/dist/esm/public-functions/getFeeInfoForChain.d.ts +1 -1
- package/dist/esm/public-functions/getFeeInfoForChain.js +5 -4
- package/dist/esm/public-functions/getRecommendedGasPrice.js +7 -6
- package/dist/esm/public-functions/getRouteWithGasOnReceive.d.ts +1 -1
- package/dist/esm/public-functions/getRouteWithGasOnReceive.js +32 -28
- package/dist/esm/public-functions/getSigningStargateClient.js +5 -5
- package/dist/esm/public-functions/setApiOptions.d.ts +1 -1
- package/dist/esm/public-functions/setApiOptions.js +3 -3
- package/dist/esm/public-functions/setClientOptions.d.ts +4 -4
- package/dist/esm/public-functions/setClientOptions.js +6 -6
- package/dist/esm/public-functions/subscribeToRouteStatus.d.ts +4 -4
- package/dist/esm/public-functions/subscribeToRouteStatus.js +5 -5
- package/dist/esm/public-functions/validateCosmosGasBalance.d.ts +4 -4
- package/dist/esm/public-functions/validateCosmosGasBalance.js +9 -9
- package/dist/esm/public-functions/waitForTransaction.d.ts +712 -74
- package/dist/esm/public-functions/waitForTransaction.js +5 -5
- package/dist/esm/{setClientOptions-C8g92xTm.d.ts → setClientOptions-DD5Mzkw_.d.ts} +3 -3
- package/dist/esm/{swaggerTypes-B_jKfpvz.d.ts → swaggerTypes-Dr4I6vW2.d.ts} +260 -256
- package/package.json +5 -5
- package/dist/cjs/chunk-4NGHNHAS.cjs +0 -46
- package/dist/esm/chunk-TNIGHYH2.js +0 -44
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var chunk67WZP4PA_cjs = require('./chunk-67WZP4PA.cjs');
|
|
4
|
+
var chunkZHV4J6EM_cjs = require('./chunk-ZHV4J6EM.cjs');
|
|
5
|
+
var chunkNCFH5MGF_cjs = require('./chunk-NCFH5MGF.cjs');
|
|
6
|
+
var chunkAUTOIM57_cjs = require('./chunk-AUTOIM57.cjs');
|
|
7
|
+
var chunk2QPPD3BB_cjs = require('./chunk-2QPPD3BB.cjs');
|
|
8
|
+
|
|
9
|
+
// src/public-functions/executeMultipleRoutes.ts
|
|
10
|
+
var executeMultipleRoutes = async (options) => {
|
|
11
|
+
const {
|
|
12
|
+
route,
|
|
13
|
+
userAddresses,
|
|
14
|
+
appendCosmosMsgs,
|
|
15
|
+
postRouteHandler,
|
|
16
|
+
slippageTolerancePercent,
|
|
17
|
+
...restOptions
|
|
18
|
+
} = options;
|
|
19
|
+
const addressList = {};
|
|
20
|
+
for (const [routeKey, routeValue] of Object.entries(route)) {
|
|
21
|
+
const _userAddresses = userAddresses[routeKey];
|
|
22
|
+
if (_userAddresses === void 0) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
`executeMultipleRoutes error: no user addresses found for route: ${routeKey}`
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
const routeAddressList = await chunk67WZP4PA_cjs.createValidAddressList({
|
|
28
|
+
userAddresses: _userAddresses,
|
|
29
|
+
route: routeValue
|
|
30
|
+
});
|
|
31
|
+
addressList[routeKey] = routeAddressList;
|
|
32
|
+
}
|
|
33
|
+
const msgsResponses = await Promise.all(
|
|
34
|
+
Object.entries(route).map(async ([routeKey, routeValue]) => {
|
|
35
|
+
const routeAddressList = addressList[routeKey];
|
|
36
|
+
if (routeAddressList === void 0) {
|
|
37
|
+
throw new Error(
|
|
38
|
+
`executeMultipleRoutes error: address list not found for route ${routeKey}`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
return await chunkNCFH5MGF_cjs.messages({
|
|
42
|
+
timeoutSeconds: options.timeoutSeconds,
|
|
43
|
+
amountIn: routeValue?.amountIn,
|
|
44
|
+
amountOut: routeValue.estimatedAmountOut || "0",
|
|
45
|
+
sourceAssetChainId: routeValue?.sourceAssetChainId,
|
|
46
|
+
sourceAssetDenom: routeValue?.sourceAssetDenom,
|
|
47
|
+
destAssetChainId: routeValue?.destAssetChainId,
|
|
48
|
+
destAssetDenom: routeValue?.destAssetDenom,
|
|
49
|
+
operations: routeValue?.operations,
|
|
50
|
+
addressList: routeAddressList,
|
|
51
|
+
slippageTolerancePercent: slippageTolerancePercent?.[routeKey] || "1",
|
|
52
|
+
chainIdsToAffiliates: chunk2QPPD3BB_cjs.ApiState.chainIdsToAffiliates,
|
|
53
|
+
postRouteHandler: postRouteHandler?.[routeKey],
|
|
54
|
+
feePayerAddress: options.svmFeePayer?.address
|
|
55
|
+
});
|
|
56
|
+
})
|
|
57
|
+
);
|
|
58
|
+
let msgsRecord = {};
|
|
59
|
+
msgsResponses.forEach((msg, index2) => {
|
|
60
|
+
const routeKey = Object.keys(route)[index2];
|
|
61
|
+
if (!routeKey) {
|
|
62
|
+
throw new Error(
|
|
63
|
+
`executeMultipleRoutes error: route key not found for index ${index2}`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
const addedCosmosMsgs = appendCosmosMsgs?.[routeKey];
|
|
67
|
+
if (addedCosmosMsgs) {
|
|
68
|
+
Object.entries(addedCosmosMsgs).forEach(([chainId, msgs]) => {
|
|
69
|
+
const txIndex = msg?.txs?.findIndex(
|
|
70
|
+
(tx2) => "cosmosTx" in tx2 && tx2.cosmosTx.chainId === chainId
|
|
71
|
+
);
|
|
72
|
+
if (txIndex === void 0 || txIndex === -1) return;
|
|
73
|
+
const tx = msg?.txs?.[txIndex];
|
|
74
|
+
if (tx && "cosmosTx" in tx) {
|
|
75
|
+
tx.cosmosTx.msgs?.unshift(...msgs);
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
msgsRecord[routeKey] = msg;
|
|
80
|
+
});
|
|
81
|
+
let transferIndexToRouteKey = void 0;
|
|
82
|
+
const cosmosTxIndex0Map = /* @__PURE__ */ new Map();
|
|
83
|
+
let transferIndex = 0;
|
|
84
|
+
for (const [routeKey, msgs] of Object.entries(msgsRecord)) {
|
|
85
|
+
const firstTx = msgs?.txs?.[0];
|
|
86
|
+
if (firstTx && "cosmosTx" in firstTx) {
|
|
87
|
+
const { chainId, msgs: firstTxMsgs } = firstTx.cosmosTx;
|
|
88
|
+
if (!transferIndexToRouteKey) {
|
|
89
|
+
transferIndexToRouteKey = {};
|
|
90
|
+
}
|
|
91
|
+
transferIndexToRouteKey[transferIndex] = routeKey;
|
|
92
|
+
transferIndex++;
|
|
93
|
+
if (!cosmosTxIndex0Map.has(chainId)) {
|
|
94
|
+
cosmosTxIndex0Map.set(chainId, {
|
|
95
|
+
routeKey,
|
|
96
|
+
firstCosmosTx: firstTx.cosmosTx
|
|
97
|
+
});
|
|
98
|
+
} else {
|
|
99
|
+
const existing = cosmosTxIndex0Map.get(chainId);
|
|
100
|
+
if (existing && firstTxMsgs) {
|
|
101
|
+
const modifyTarget = msgsRecord[existing.routeKey]?.txs?.[0];
|
|
102
|
+
if (modifyTarget && "cosmosTx" in modifyTarget) {
|
|
103
|
+
modifyTarget.cosmosTx.msgs?.push(...firstTxMsgs);
|
|
104
|
+
msgsRecord[routeKey]?.txs?.shift();
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
Object.entries(msgsRecord).forEach(([routeKey, msgs]) => {
|
|
111
|
+
if (msgs?.txs?.length === 0) {
|
|
112
|
+
delete msgsRecord[routeKey];
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
let mainRouteId = void 0;
|
|
116
|
+
let msgsRecordIndexToRouteId = {};
|
|
117
|
+
let index = 0;
|
|
118
|
+
const transactionDetailsList = {};
|
|
119
|
+
const executeTransactionList = {};
|
|
120
|
+
const mergedMainAndSecondaryRoutes = Object.entries(msgsRecord).length !== Object.entries(route).length;
|
|
121
|
+
for (const [routeKey, msgsResponse] of Object.entries(msgsRecord)) {
|
|
122
|
+
const { id: routeId } = chunkZHV4J6EM_cjs.updateRouteDetails({
|
|
123
|
+
status: "unconfirmed",
|
|
124
|
+
options: {
|
|
125
|
+
route: route[routeKey],
|
|
126
|
+
...restOptions
|
|
127
|
+
},
|
|
128
|
+
mainRouteId,
|
|
129
|
+
transferIndexToRouteKey
|
|
130
|
+
});
|
|
131
|
+
msgsRecordIndexToRouteId[index] = routeId;
|
|
132
|
+
if (routeKey === "mainRoute") {
|
|
133
|
+
mainRouteId = routeId;
|
|
134
|
+
}
|
|
135
|
+
const { transactionDetails, executeTransaction: _executeTransaction } = await chunk67WZP4PA_cjs.executeTransactions({
|
|
136
|
+
...restOptions,
|
|
137
|
+
routeId,
|
|
138
|
+
txs: msgsResponse?.txs,
|
|
139
|
+
route: route[routeKey],
|
|
140
|
+
userAddresses: userAddresses[routeKey],
|
|
141
|
+
isMultiRoutes: true
|
|
142
|
+
});
|
|
143
|
+
const executeTransaction = async (index2) => {
|
|
144
|
+
const txResult = await _executeTransaction(index2);
|
|
145
|
+
if (routeKey !== "mainRoute" || mergedMainAndSecondaryRoutes) {
|
|
146
|
+
const relatedRoutes = Object.entries(route).filter(([key]) => key !== "mainRoute").map(([key, route2]) => ({ route: route2, routeKey: key, status: "pending" }));
|
|
147
|
+
chunkZHV4J6EM_cjs.updateRouteDetails({
|
|
148
|
+
options: {
|
|
149
|
+
route: route[routeKey],
|
|
150
|
+
...restOptions
|
|
151
|
+
},
|
|
152
|
+
routeId: mainRouteId,
|
|
153
|
+
transferIndexToRouteKey,
|
|
154
|
+
relatedRoutes
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
return txResult;
|
|
158
|
+
};
|
|
159
|
+
if (transactionDetails[0]?.chainType === "evm" /* Evm */) {
|
|
160
|
+
for (const [index2, transactionDetail] of transactionDetails.entries()) {
|
|
161
|
+
const txResult = await executeTransaction(index2);
|
|
162
|
+
if (txResult.txHash) {
|
|
163
|
+
const trackResponse = await chunkAUTOIM57_cjs.trackTransaction({
|
|
164
|
+
chainId: transactionDetail.chainId,
|
|
165
|
+
txHash: txResult.txHash,
|
|
166
|
+
...options.trackTxPollingOptions
|
|
167
|
+
});
|
|
168
|
+
await options?.onTransactionTracked?.({
|
|
169
|
+
txHash: txResult.txHash,
|
|
170
|
+
chainId: transactionDetail.chainId,
|
|
171
|
+
explorerLink: trackResponse.explorerLink
|
|
172
|
+
});
|
|
173
|
+
transactionDetail.txHash = txResult.txHash;
|
|
174
|
+
transactionDetail.explorerLink = trackResponse.explorerLink;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
executeTransactionList[index] = executeTransaction;
|
|
179
|
+
}
|
|
180
|
+
transactionDetailsList[index] = transactionDetails;
|
|
181
|
+
index++;
|
|
182
|
+
}
|
|
183
|
+
await Promise.all(
|
|
184
|
+
Object.entries(msgsRecord).map(([routeKey, msgsResponse], index2) => {
|
|
185
|
+
return chunkZHV4J6EM_cjs.executeAndSubscribeToRouteStatus({
|
|
186
|
+
transactionDetails: transactionDetailsList[index2],
|
|
187
|
+
executeTransaction: executeTransactionList[index2],
|
|
188
|
+
routeId: msgsRecordIndexToRouteId[index2],
|
|
189
|
+
options: {
|
|
190
|
+
route: route[routeKey],
|
|
191
|
+
userAddresses: userAddresses[routeKey],
|
|
192
|
+
...restOptions,
|
|
193
|
+
onRouteStatusUpdated: (routeStatus) => {
|
|
194
|
+
const relatedRoutes = Object.entries(route).filter(([key]) => key !== "mainRoute").map(([key, route2]) => ({ route: route2, routeKey: key, status: routeStatus.status }));
|
|
195
|
+
if (routeKey !== "mainRoute") {
|
|
196
|
+
chunkZHV4J6EM_cjs.updateRouteDetails({
|
|
197
|
+
options: {
|
|
198
|
+
route: route[routeKey],
|
|
199
|
+
...restOptions
|
|
200
|
+
},
|
|
201
|
+
routeId: mainRouteId,
|
|
202
|
+
transferIndexToRouteKey,
|
|
203
|
+
relatedRoutes
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
options.onRouteStatusUpdated?.(routeStatus);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
})
|
|
211
|
+
);
|
|
212
|
+
};
|
|
213
|
+
|
|
214
|
+
exports.executeMultipleRoutes = executeMultipleRoutes;
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var chunkKZOSEIWH_cjs = require('./chunk-KZOSEIWH.cjs');
|
|
3
4
|
var chunkUMBMSRZZ_cjs = require('./chunk-UMBMSRZZ.cjs');
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
// src/constants/constants.ts
|
|
7
|
-
var DEFAULT_GAS_DENOM_OVERRIDES = {
|
|
8
|
-
"noble-1": "uusdc"
|
|
9
|
-
};
|
|
10
|
-
var GAS_STATION_CHAIN_IDS = ["bbn-test-5", "bbn-1"];
|
|
5
|
+
var chunkATW6UNT5_cjs = require('./chunk-ATW6UNT5.cjs');
|
|
11
6
|
|
|
12
7
|
// src/private-functions/getDefaultGasTokenForChain.ts
|
|
13
8
|
var getDefaultGasTokenForChain = async (chainId) => {
|
|
14
|
-
const gasDenom = DEFAULT_GAS_DENOM_OVERRIDES[chainId];
|
|
9
|
+
const gasDenom = chunkKZOSEIWH_cjs.DEFAULT_GAS_DENOM_OVERRIDES[chainId];
|
|
15
10
|
if (gasDenom) {
|
|
16
11
|
return gasDenom;
|
|
17
12
|
}
|
|
@@ -58,7 +53,7 @@ var getStakingTokensForChain = (chainId) => {
|
|
|
58
53
|
|
|
59
54
|
// src/public-functions/getFeeInfoForChain.ts
|
|
60
55
|
var getFeeInfoForChain = async ({ chainId, apiUrl, apiKey }) => {
|
|
61
|
-
const skipChains = await
|
|
56
|
+
const skipChains = await chunkATW6UNT5_cjs.ClientState.getSkipChains({ apiUrl, apiKey });
|
|
62
57
|
const skipChain = skipChains.find((chain2) => chain2.chainId === chainId);
|
|
63
58
|
if (!skipChain) {
|
|
64
59
|
return void 0;
|
|
@@ -97,5 +92,4 @@ var getFeeInfoForChain = async ({ chainId, apiUrl, apiKey }) => {
|
|
|
97
92
|
};
|
|
98
93
|
};
|
|
99
94
|
|
|
100
|
-
exports.GAS_STATION_CHAIN_IDS = GAS_STATION_CHAIN_IDS;
|
|
101
95
|
exports.getFeeInfoForChain = getFeeInfoForChain;
|