@skip-go/client 1.3.7 → 1.5.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 +4 -4
- package/dist/cjs/api/getAssetsBetweenChains.cjs +3 -3
- package/dist/cjs/api/getBridges.cjs +3 -3
- package/dist/cjs/api/getChains.cjs +3 -3
- package/dist/cjs/api/getVenues.cjs +3 -3
- package/dist/cjs/api/postAssetsFromSource.cjs +4 -4
- package/dist/cjs/api/postBalances.cjs +3 -3
- package/dist/cjs/api/postIbcOriginAssets.cjs +3 -3
- package/dist/cjs/api/postMessages.cjs +3 -3
- package/dist/cjs/api/postMessagesDirect.cjs +3 -3
- package/dist/cjs/api/postRecommendAssets.cjs +3 -3
- package/dist/cjs/api/postRoute.cjs +3 -3
- package/dist/cjs/api/postSubmitTransaction.cjs +3 -3
- package/dist/cjs/api/postTrackTransaction.cjs +3 -3
- package/dist/cjs/api/postTransactionStatus.cjs +3 -3
- package/dist/cjs/{chunk-2EKCOIWV.cjs → chunk-23YF4LFI.cjs} +185 -154
- package/dist/cjs/chunk-3M7YYWGL.cjs +295 -0
- package/dist/cjs/chunk-4YTACAVP.cjs +185 -0
- package/dist/cjs/{chunk-MW3TE7DC.cjs → chunk-5AYPH3ZR.cjs} +2 -2
- package/dist/cjs/{chunk-2CCLIBCC.cjs → chunk-5HDKZVOL.cjs} +2 -2
- package/dist/cjs/{chunk-YYBGBKRE.cjs → chunk-A26H4FVN.cjs} +4 -4
- package/dist/cjs/{chunk-P7CDAHIX.cjs → chunk-AXYRULAI.cjs} +2 -2
- package/dist/cjs/{chunk-E2P5MVX3.cjs → chunk-CUDPMOR6.cjs} +16 -9
- package/dist/cjs/{chunk-WMXUOVHN.cjs → chunk-DWOE6N5S.cjs} +248 -532
- package/dist/cjs/{chunk-7I2KQNIU.cjs → chunk-EJMC4JXF.cjs} +2 -2
- package/dist/cjs/{chunk-HKQ5VION.cjs → chunk-ERGJBZUC.cjs} +5 -1
- package/dist/cjs/{chunk-J5RC6ZU5.cjs → chunk-FNB244QI.cjs} +6 -6
- package/dist/cjs/chunk-GCJO6DZD.cjs +55 -0
- package/dist/cjs/{chunk-OEYY7NXT.cjs → chunk-HHZGD62Y.cjs} +256 -168
- package/dist/cjs/{chunk-DBDB2XWX.cjs → chunk-JBKNEFXB.cjs} +3 -3
- package/dist/cjs/{chunk-AF7EI5BT.cjs → chunk-K4YAPDUE.cjs} +2 -2
- package/dist/cjs/{chunk-MN6HFZJA.cjs → chunk-KM2D7PJL.cjs} +33 -33
- package/dist/cjs/{chunk-XGBCEYWI.cjs → chunk-LHY62HPI.cjs} +2 -2
- package/dist/cjs/{chunk-EXK2GDR5.cjs → chunk-LUVMRHAJ.cjs} +2 -2
- package/dist/cjs/{chunk-QSISUSYP.cjs → chunk-N4UW74AG.cjs} +4 -4
- package/dist/cjs/{chunk-FY56EEFB.cjs → chunk-OZUCMWNE.cjs} +2 -2
- package/dist/cjs/{chunk-2VQ2TNFM.cjs → chunk-QPM7H2YL.cjs} +2 -2
- package/dist/cjs/{chunk-FO25SR66.cjs → chunk-RCGCQD6T.cjs} +6 -6
- package/dist/cjs/chunk-UIQML2XG.cjs +455 -0
- package/dist/cjs/chunk-VF65UG3E.cjs +214 -0
- package/dist/cjs/{chunk-VKVHMUDR.cjs → chunk-W3KF3V57.cjs} +6 -6
- package/dist/cjs/{chunk-YN66ABRQ.cjs → chunk-X22PL5T7.cjs} +126 -16
- package/dist/cjs/{chunk-DCFIIF7G.cjs → chunk-X5AJHZ2J.cjs} +2 -2
- package/dist/cjs/{chunk-MCZ3F457.cjs → chunk-ZBPDDVQ2.cjs} +2 -2
- package/dist/cjs/index.cjs +66 -54
- package/dist/cjs/public-functions/executeMultipleRoutes.cjs +29 -0
- package/dist/cjs/public-functions/executeRoute.cjs +17 -15
- package/dist/cjs/public-functions/getCosmosGasAmountForMessage.cjs +5 -4
- package/dist/cjs/public-functions/getFeeInfoForChain.cjs +5 -5
- package/dist/cjs/public-functions/getRecommendedGasPrice.cjs +6 -6
- package/dist/cjs/public-functions/getSigningStargateClient.cjs +6 -5
- package/dist/cjs/public-functions/setApiOptions.cjs +3 -3
- package/dist/cjs/public-functions/setClientOptions.cjs +6 -5
- package/dist/cjs/public-functions/subscribeToRouteStatus.cjs +26 -0
- package/dist/cjs/public-functions/validateCosmosGasBalance.cjs +9 -8
- package/dist/cjs/public-functions/waitForTransaction.cjs +5 -5
- package/dist/esm/api/getAssets.js +2 -2
- package/dist/esm/api/getAssetsBetweenChains.js +2 -2
- package/dist/esm/api/getBridges.js +2 -2
- package/dist/esm/api/getChains.js +2 -2
- package/dist/esm/api/getVenues.js +2 -2
- package/dist/esm/api/postAssetsFromSource.js +3 -3
- package/dist/esm/api/postBalances.js +2 -2
- package/dist/esm/api/postIbcOriginAssets.js +2 -2
- package/dist/esm/api/postMessages.js +2 -2
- package/dist/esm/api/postMessagesDirect.js +2 -2
- package/dist/esm/api/postRecommendAssets.js +2 -2
- package/dist/esm/api/postRoute.js +2 -2
- package/dist/esm/api/postSubmitTransaction.js +2 -2
- package/dist/esm/api/postTrackTransaction.d.ts +2 -1
- package/dist/esm/api/postTrackTransaction.js +2 -2
- package/dist/esm/api/postTransactionStatus.d.ts +1 -1
- package/dist/esm/api/postTransactionStatus.js +2 -2
- package/dist/esm/callbacks-CvqAtBJq.d.ts +130 -0
- package/dist/esm/{chunk-SJP6W2SK.js → chunk-3XOGEVJL.js} +1 -1
- package/dist/esm/{chunk-JSY7M43P.js → chunk-52PEBJRQ.js} +1 -1
- package/dist/esm/chunk-7RS3YIVC.js +53 -0
- package/dist/esm/{chunk-7ITTEUMR.js → chunk-7X4ERB3R.js} +1 -1
- package/dist/esm/{chunk-LZI7A4JI.js → chunk-A6KSECAH.js} +5 -1
- package/dist/esm/{chunk-7LSTJXAF.js → chunk-AND7HVIU.js} +1 -1
- package/dist/esm/{chunk-MXCJ2M3K.js → chunk-APRMN34M.js} +1 -1
- package/dist/esm/chunk-AZALP3WR.js +212 -0
- package/dist/esm/{chunk-5JZOTYDC.js → chunk-CX5N7ZLJ.js} +1 -1
- package/dist/esm/{chunk-JYUNVL4F.js → chunk-FH2YHZVV.js} +1 -1
- package/dist/esm/chunk-IUYOY23L.js +180 -0
- package/dist/esm/{chunk-IQQDEBLI.js → chunk-JKN4E5VN.js} +11 -4
- package/dist/esm/{chunk-OHV2LZEG.js → chunk-JQ4F4WBG.js} +1 -1
- package/dist/esm/{chunk-5FKIW2ZL.js → chunk-KLGGCB73.js} +2 -2
- package/dist/esm/{chunk-P76IRSIS.js → chunk-KNXMSLOB.js} +2 -2
- package/dist/esm/{chunk-IWXRHEX4.js → chunk-LHNGF5J2.js} +2 -2
- package/dist/esm/{chunk-KJVD5P3Q.js → chunk-MPSXXWKL.js} +109 -3
- package/dist/esm/{chunk-FFFVITWF.js → chunk-MTAS5XMN.js} +219 -132
- package/dist/esm/{chunk-JIADJKRD.js → chunk-OTS5KO43.js} +1 -1
- package/dist/esm/{chunk-CU6W3622.js → chunk-QIS6ILPS.js} +3 -3
- package/dist/esm/chunk-QO2CYYF5.js +278 -0
- package/dist/esm/{chunk-XXTECZG3.js → chunk-S4RO2LHD.js} +1 -1
- package/dist/esm/{chunk-7YN3UVVF.js → chunk-UI3SIFZN.js} +1 -1
- package/dist/esm/{chunk-TD63P2AG.js → chunk-UIDIKXMB.js} +65 -340
- package/dist/esm/chunk-VUXLWWLF.js +450 -0
- package/dist/esm/{chunk-OL7CWCPB.js → chunk-WBZVMPPV.js} +34 -3
- package/dist/esm/{chunk-HT6O3BQ7.js → chunk-Y2YCODZK.js} +1 -1
- package/dist/esm/{chunk-IPHFFTGO.js → chunk-ZI3SYUQH.js} +1 -1
- package/dist/esm/{chunk-2L7PKZDY.js → chunk-ZOUYAZU6.js} +1 -1
- package/dist/esm/client-types-Dk6ypWdO.d.ts +114 -0
- package/dist/esm/index.d.ts +5 -5
- package/dist/esm/index.js +29 -25
- package/dist/esm/public-functions/executeMultipleRoutes.d.ts +60 -0
- package/dist/esm/public-functions/executeMultipleRoutes.js +20 -0
- package/dist/esm/public-functions/executeRoute.d.ts +7 -76
- package/dist/esm/public-functions/executeRoute.js +16 -14
- package/dist/esm/public-functions/getCosmosGasAmountForMessage.js +3 -2
- package/dist/esm/public-functions/getEvmGasAmountForMessage.d.ts +4 -1
- package/dist/esm/public-functions/getFeeInfoForChain.js +4 -4
- package/dist/esm/public-functions/getRecommendedGasPrice.js +5 -5
- package/dist/esm/public-functions/getSigningStargateClient.js +5 -4
- package/dist/esm/public-functions/setApiOptions.js +2 -2
- package/dist/esm/public-functions/setClientOptions.d.ts +4 -2
- package/dist/esm/public-functions/setClientOptions.js +5 -4
- package/dist/esm/public-functions/subscribeToRouteStatus.d.ts +12 -0
- package/dist/esm/public-functions/subscribeToRouteStatus.js +5 -0
- package/dist/esm/public-functions/validateCosmosGasBalance.d.ts +7 -5
- package/dist/esm/public-functions/validateCosmosGasBalance.js +8 -7
- package/dist/esm/public-functions/waitForTransaction.d.ts +6 -2
- package/dist/esm/public-functions/waitForTransaction.js +4 -4
- package/dist/esm/{setClientOptions-BTRwCbmt.d.ts → setClientOptions-BD8e7m2x.d.ts} +1 -1
- package/package.json +3 -3
- package/dist/cjs/chunk-7H6XRQAX.cjs +0 -185
- package/dist/esm/callbacks-CuL50GnB.d.ts +0 -38
- package/dist/esm/chunk-U6AH2WOP.js +0 -180
- package/dist/esm/client-types-B7Fin0mq.d.ts +0 -61
|
@@ -0,0 +1,450 @@
|
|
|
1
|
+
import { trackTransaction } from './chunk-7X4ERB3R.js';
|
|
2
|
+
import { transactionStatus } from './chunk-APRMN34M.js';
|
|
3
|
+
import { wait } from './chunk-A6KSECAH.js';
|
|
4
|
+
import { v4 } from 'uuid';
|
|
5
|
+
|
|
6
|
+
// src/utils/clientType.ts
|
|
7
|
+
function getClientTransferEvent(transferEvent) {
|
|
8
|
+
const combinedTransferEvent = transferEvent;
|
|
9
|
+
const axelarTransfer = combinedTransferEvent?.axelarTransfer;
|
|
10
|
+
const ibcTransfer = combinedTransferEvent?.ibcTransfer;
|
|
11
|
+
const cctpTransfer = combinedTransferEvent?.cctpTransfer;
|
|
12
|
+
const hyperlaneTransfer = combinedTransferEvent?.hyperlaneTransfer;
|
|
13
|
+
const opInitTransfer = combinedTransferEvent?.opInitTransfer;
|
|
14
|
+
const goFastTransfer = combinedTransferEvent?.goFastTransfer;
|
|
15
|
+
const stargateTransfer = combinedTransferEvent?.stargateTransfer;
|
|
16
|
+
const eurekaTransfer = combinedTransferEvent?.eurekaTransfer;
|
|
17
|
+
const layerZeroTransfer = combinedTransferEvent?.layerZeroTransfer;
|
|
18
|
+
let transferType = "";
|
|
19
|
+
if (axelarTransfer) {
|
|
20
|
+
transferType = "axelarTransfer" /* axelarTransfer */;
|
|
21
|
+
} else if (ibcTransfer) {
|
|
22
|
+
transferType = "ibcTransfer" /* ibcTransfer */;
|
|
23
|
+
} else if (cctpTransfer) {
|
|
24
|
+
transferType = "cctpTransfer" /* cctpTransfer */;
|
|
25
|
+
} else if (hyperlaneTransfer) {
|
|
26
|
+
transferType = "hyperlaneTransfer" /* hyperlaneTransfer */;
|
|
27
|
+
} else if (opInitTransfer) {
|
|
28
|
+
transferType = "opInitTransfer" /* opInitTransfer */;
|
|
29
|
+
} else if (goFastTransfer) {
|
|
30
|
+
transferType = "goFastTransfer" /* goFastTransfer */;
|
|
31
|
+
} else if (stargateTransfer) {
|
|
32
|
+
transferType = "stargateTransfer" /* stargateTransfer */;
|
|
33
|
+
} else if (eurekaTransfer) {
|
|
34
|
+
transferType = "eurekaTransfer" /* eurekaTransfer */;
|
|
35
|
+
} else if (layerZeroTransfer) {
|
|
36
|
+
transferType = "layerZeroTransfer" /* layerZeroTransfer */;
|
|
37
|
+
}
|
|
38
|
+
const getExplorerLink = (type) => {
|
|
39
|
+
switch (transferType) {
|
|
40
|
+
case "ibcTransfer" /* ibcTransfer */:
|
|
41
|
+
if (type === "send") {
|
|
42
|
+
return ibcTransfer.packetTxs.sendTx?.explorerLink;
|
|
43
|
+
}
|
|
44
|
+
return ibcTransfer.packetTxs.receiveTx?.explorerLink;
|
|
45
|
+
case "eurekaTransfer" /* eurekaTransfer */:
|
|
46
|
+
if (type === "send") {
|
|
47
|
+
return eurekaTransfer.packetTxs.sendTx?.explorerLink;
|
|
48
|
+
}
|
|
49
|
+
return eurekaTransfer.packetTxs.receiveTx?.explorerLink;
|
|
50
|
+
case "goFastTransfer" /* goFastTransfer */:
|
|
51
|
+
if (type === "send") {
|
|
52
|
+
return goFastTransfer.txs.orderSubmittedTx?.explorerLink;
|
|
53
|
+
}
|
|
54
|
+
return goFastTransfer.txs.orderFilledTx?.explorerLink;
|
|
55
|
+
case "axelarTransfer" /* axelarTransfer */:
|
|
56
|
+
return axelarTransfer?.axelarScanLink;
|
|
57
|
+
default:
|
|
58
|
+
if (type === "send") {
|
|
59
|
+
return combinedTransferEvent[transferType]?.txs?.sendTx?.explorerLink;
|
|
60
|
+
}
|
|
61
|
+
return combinedTransferEvent[transferType]?.txs?.receiveTx?.explorerLink;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const _result = {
|
|
65
|
+
...ibcTransfer,
|
|
66
|
+
...axelarTransfer,
|
|
67
|
+
...cctpTransfer,
|
|
68
|
+
...hyperlaneTransfer,
|
|
69
|
+
...stargateTransfer,
|
|
70
|
+
...hyperlaneTransfer,
|
|
71
|
+
...opInitTransfer,
|
|
72
|
+
...goFastTransfer,
|
|
73
|
+
...stargateTransfer,
|
|
74
|
+
...eurekaTransfer,
|
|
75
|
+
...layerZeroTransfer,
|
|
76
|
+
fromExplorerLink: getExplorerLink("send"),
|
|
77
|
+
toExplorerLink: getExplorerLink("receive")
|
|
78
|
+
};
|
|
79
|
+
const status = getSimpleStatus(_result.state);
|
|
80
|
+
const result = {
|
|
81
|
+
..._result,
|
|
82
|
+
status
|
|
83
|
+
};
|
|
84
|
+
return result;
|
|
85
|
+
}
|
|
86
|
+
function getTransferEventsFromTxStatusResponse(txStatusResponse) {
|
|
87
|
+
if (!txStatusResponse) return [];
|
|
88
|
+
return txStatusResponse?.flatMap((txStatus) => {
|
|
89
|
+
return (txStatus.transferSequence ?? []).map((transferEvent) => {
|
|
90
|
+
return getClientTransferEvent(transferEvent);
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
function getSimpleStatus(state) {
|
|
95
|
+
switch (state) {
|
|
96
|
+
case "TRANSFER_PENDING":
|
|
97
|
+
case "TRANSFER_RECEIVED":
|
|
98
|
+
case "AXELAR_TRANSFER_PENDING_CONFIRMATION":
|
|
99
|
+
case "AXELAR_TRANSFER_PENDING_RECEIPT":
|
|
100
|
+
case "CCTP_TRANSFER_SENT":
|
|
101
|
+
case "CCTP_TRANSFER_PENDING_CONFIRMATION":
|
|
102
|
+
case "CCTP_TRANSFER_CONFIRMED":
|
|
103
|
+
case "HYPERLANE_TRANSFER_SENT":
|
|
104
|
+
case "OPINIT_TRANSFER_SENT":
|
|
105
|
+
case "GO_FAST_TRANSFER_SENT":
|
|
106
|
+
case "STARGATE_TRANSFER_SENT":
|
|
107
|
+
case "LAYER_ZERO_TRANSFER_SENT":
|
|
108
|
+
return "pending";
|
|
109
|
+
case "TRANSFER_SUCCESS":
|
|
110
|
+
case "AXELAR_TRANSFER_SUCCESS":
|
|
111
|
+
case "CCTP_TRANSFER_RECEIVED":
|
|
112
|
+
case "HYPERLANE_TRANSFER_RECEIVED":
|
|
113
|
+
case "OPINIT_TRANSFER_RECEIVED":
|
|
114
|
+
case "STARGATE_TRANSFER_RECEIVED":
|
|
115
|
+
case "GO_FAST_TRANSFER_FILLED":
|
|
116
|
+
case "LAYER_ZERO_TRANSFER_RECEIVED":
|
|
117
|
+
return "completed";
|
|
118
|
+
default:
|
|
119
|
+
return "failed";
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function getTransactionStatus(state) {
|
|
123
|
+
switch (state) {
|
|
124
|
+
case "STATE_SUBMITTED":
|
|
125
|
+
case "STATE_PENDING":
|
|
126
|
+
return "pending";
|
|
127
|
+
case "STATE_COMPLETED_SUCCESS":
|
|
128
|
+
return "success";
|
|
129
|
+
case "STATE_COMPLETED_ERROR":
|
|
130
|
+
case "STATE_PENDING_ERROR":
|
|
131
|
+
return "failed";
|
|
132
|
+
default:
|
|
133
|
+
return "pending";
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
var isFinalRouteStatus = (routeDetails) => {
|
|
137
|
+
if (routeDetails.status === "completed" || routeDetails.status === "failed" || routeDetails.status === "incomplete") {
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
return false;
|
|
141
|
+
};
|
|
142
|
+
var isFinalState = (transaction) => {
|
|
143
|
+
const transactionState = transaction?.statusResponse?.transfers?.[0]?.state;
|
|
144
|
+
const transactionStatus2 = transaction?.status;
|
|
145
|
+
return transactionState === "STATE_COMPLETED_SUCCESS" || transactionState === "STATE_COMPLETED_ERROR" || transactionState === "STATE_ABANDONED" || transactionStatus2 === "failed" || transactionStatus2 === "success";
|
|
146
|
+
};
|
|
147
|
+
var isSuccessState = (transaction) => {
|
|
148
|
+
const transactionState = transaction?.statusResponse?.transfers?.[0]?.state;
|
|
149
|
+
const transactionStatus2 = transaction?.status;
|
|
150
|
+
return transactionState === "STATE_COMPLETED_SUCCESS" || transactionStatus2 === "success";
|
|
151
|
+
};
|
|
152
|
+
var routeDetailsMap = /* @__PURE__ */ new Map();
|
|
153
|
+
var initializeNewRouteDetails = (options) => {
|
|
154
|
+
const newRouteId = v4();
|
|
155
|
+
const newRouteDetails = {
|
|
156
|
+
id: newRouteId,
|
|
157
|
+
timestamp: Date.now(),
|
|
158
|
+
route: getSimpleRoute(options?.route),
|
|
159
|
+
status: "unconfirmed",
|
|
160
|
+
txsRequired: options?.route?.txsRequired ?? 1,
|
|
161
|
+
txsSigned: 0,
|
|
162
|
+
transactionDetails: [],
|
|
163
|
+
transferEvents: [],
|
|
164
|
+
relatedRoutes: [],
|
|
165
|
+
userAddresses: options?.userAddresses ?? []
|
|
166
|
+
};
|
|
167
|
+
routeDetailsMap.set(newRouteId, newRouteDetails);
|
|
168
|
+
return newRouteDetails;
|
|
169
|
+
};
|
|
170
|
+
var subscribeToRouteStatus = (props) => {
|
|
171
|
+
const { routeDetails, onRouteStatusUpdated } = props;
|
|
172
|
+
const routeList = Array.isArray(routeDetails) ? routeDetails : [routeDetails];
|
|
173
|
+
const cancelFlags = /* @__PURE__ */ new Map();
|
|
174
|
+
const unsubscribers = [];
|
|
175
|
+
for (const route of routeList) {
|
|
176
|
+
const cancelFlag = { cancelled: false };
|
|
177
|
+
cancelFlags.set(route?.id ?? v4(), cancelFlag);
|
|
178
|
+
const unsubscribe = () => {
|
|
179
|
+
cancelFlag.cancelled = true;
|
|
180
|
+
};
|
|
181
|
+
unsubscribers.push(unsubscribe);
|
|
182
|
+
void executeAndSubscribeToRouteStatus({
|
|
183
|
+
routeDetails: route,
|
|
184
|
+
onRouteStatusUpdated,
|
|
185
|
+
isCancelled: () => cancelFlag.cancelled
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
const unsubscribeAll = () => {
|
|
189
|
+
for (const unsubscribe of unsubscribers) {
|
|
190
|
+
unsubscribe();
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
return unsubscribeAll;
|
|
194
|
+
};
|
|
195
|
+
var executeAndSubscribeToRouteStatus = async ({
|
|
196
|
+
transactionDetails,
|
|
197
|
+
executeTransaction,
|
|
198
|
+
trackTxPollingOptions,
|
|
199
|
+
onTransactionTracked,
|
|
200
|
+
onTransactionCompleted,
|
|
201
|
+
routeDetails,
|
|
202
|
+
onRouteStatusUpdated,
|
|
203
|
+
options,
|
|
204
|
+
routeId,
|
|
205
|
+
isCancelled
|
|
206
|
+
}) => {
|
|
207
|
+
removeRoutesWithFinalStatus();
|
|
208
|
+
routeId ??= routeDetails?.id;
|
|
209
|
+
const currentRouteDetails = routeDetailsMap.get(routeId ?? "");
|
|
210
|
+
transactionDetails ??= routeDetails?.transactionDetails ?? currentRouteDetails?.transactionDetails ?? [];
|
|
211
|
+
if (routeDetails && isFinalRouteStatus(routeDetails) && routeDetails?.relatedRoutes?.every(
|
|
212
|
+
(relatedRoute) => isFinalRouteStatus(relatedRoute)
|
|
213
|
+
)) {
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
for (const [transactionIndex, transaction] of transactionDetails.entries()) {
|
|
217
|
+
if (executeTransaction && !transaction.txHash) {
|
|
218
|
+
let { txHash, explorerLink } = await executeTransaction?.(transactionIndex);
|
|
219
|
+
transaction.txHash = txHash;
|
|
220
|
+
if (!explorerLink) {
|
|
221
|
+
const trackResponse = await trackTransaction({
|
|
222
|
+
chainId: transaction.chainId,
|
|
223
|
+
txHash: transaction.txHash,
|
|
224
|
+
...trackTxPollingOptions
|
|
225
|
+
});
|
|
226
|
+
explorerLink = trackResponse.explorerLink;
|
|
227
|
+
}
|
|
228
|
+
transaction.explorerLink = explorerLink;
|
|
229
|
+
await onTransactionTracked?.({
|
|
230
|
+
txHash: transaction.txHash,
|
|
231
|
+
chainId: transaction.chainId,
|
|
232
|
+
explorerLink
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
if (transaction.txHash === void 0) {
|
|
236
|
+
updateRouteDetails({
|
|
237
|
+
routeId,
|
|
238
|
+
routeDetails,
|
|
239
|
+
transactionDetails,
|
|
240
|
+
options: {
|
|
241
|
+
onRouteStatusUpdated,
|
|
242
|
+
...options
|
|
243
|
+
}
|
|
244
|
+
});
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
while (true) {
|
|
248
|
+
const updatedRouteDetails = routeDetailsMap.get(routeId ?? "");
|
|
249
|
+
const allRelatedRoutesFinal = updatedRouteDetails?.relatedRoutes?.every(
|
|
250
|
+
(relatedRoute) => relatedRoute && isFinalRouteStatus(relatedRoute)
|
|
251
|
+
);
|
|
252
|
+
if (isFinalState(transaction) && allRelatedRoutesFinal) {
|
|
253
|
+
break;
|
|
254
|
+
}
|
|
255
|
+
if (isCancelled?.()) {
|
|
256
|
+
console.info(`Polling cancelled for route ${routeId}`);
|
|
257
|
+
break;
|
|
258
|
+
}
|
|
259
|
+
try {
|
|
260
|
+
const statusResponse = await transactionStatus({
|
|
261
|
+
chainId: transaction.chainId,
|
|
262
|
+
txHash: transaction.txHash
|
|
263
|
+
});
|
|
264
|
+
transaction.statusResponse = statusResponse;
|
|
265
|
+
updateRouteDetails({
|
|
266
|
+
routeId,
|
|
267
|
+
routeDetails,
|
|
268
|
+
transactionDetails,
|
|
269
|
+
options: {
|
|
270
|
+
onRouteStatusUpdated,
|
|
271
|
+
...options
|
|
272
|
+
},
|
|
273
|
+
relatedRoutes: routeDetails?.relatedRoutes
|
|
274
|
+
});
|
|
275
|
+
if (isFinalState(transaction)) {
|
|
276
|
+
onTransactionCompleted?.({
|
|
277
|
+
chainId: transaction.chainId,
|
|
278
|
+
txHash: transaction.txHash,
|
|
279
|
+
status: statusResponse
|
|
280
|
+
});
|
|
281
|
+
if (routeDetails?.relatedRoutes?.every(
|
|
282
|
+
(relatedRoute) => isFinalRouteStatus(relatedRoute)
|
|
283
|
+
)) {
|
|
284
|
+
break;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
} catch (error) {
|
|
288
|
+
console.error(error);
|
|
289
|
+
} finally {
|
|
290
|
+
await wait(1e3);
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
var updateRouteDetails = ({
|
|
296
|
+
transactionDetails,
|
|
297
|
+
routeDetails,
|
|
298
|
+
options,
|
|
299
|
+
status,
|
|
300
|
+
routeId,
|
|
301
|
+
mainRouteId,
|
|
302
|
+
transferIndexToRouteKey,
|
|
303
|
+
relatedRoutes
|
|
304
|
+
}) => {
|
|
305
|
+
routeId ??= routeDetails?.id ?? "";
|
|
306
|
+
let currentRouteDetails = routeDetails ?? routeDetailsMap.get(routeId);
|
|
307
|
+
if (!routeId && currentRouteDetails == void 0) {
|
|
308
|
+
currentRouteDetails = initializeNewRouteDetails(options);
|
|
309
|
+
routeId = currentRouteDetails?.id;
|
|
310
|
+
}
|
|
311
|
+
transferIndexToRouteKey ??= currentRouteDetails?.transferIndexToRouteKey;
|
|
312
|
+
if (currentRouteDetails === void 0) {
|
|
313
|
+
throw new Error("No route details found");
|
|
314
|
+
}
|
|
315
|
+
transactionDetails ??= currentRouteDetails?.transactionDetails ?? [];
|
|
316
|
+
const txsRequired = currentRouteDetails?.txsRequired ?? options?.route?.txsRequired ?? 1;
|
|
317
|
+
if (currentRouteDetails?.status === "signing" && status === "pending") {
|
|
318
|
+
currentRouteDetails.txsSigned += 1;
|
|
319
|
+
}
|
|
320
|
+
const transferEvents = routeDetails?.transferEvents ?? getTransferEventsFromTxStatusResponse(
|
|
321
|
+
transactionDetails.map((tx) => tx.statusResponse).filter((status2) => status2 !== void 0)
|
|
322
|
+
);
|
|
323
|
+
const allExpectedTxsStarted = transactionDetails.every(
|
|
324
|
+
(tx) => tx.txHash || tx.status === void 0
|
|
325
|
+
);
|
|
326
|
+
const allKnownDetailsHaveFinalStatus = transactionDetails.every(
|
|
327
|
+
(transaction) => isFinalState(transaction)
|
|
328
|
+
);
|
|
329
|
+
const isAllSettled = allExpectedTxsStarted && allKnownDetailsHaveFinalStatus;
|
|
330
|
+
const someTxSucceeded = transactionDetails.some((tx) => isSuccessState(tx));
|
|
331
|
+
const someTxFailed = transactionDetails.some((tx) => !isSuccessState(tx));
|
|
332
|
+
const getRouteStatus = () => {
|
|
333
|
+
if (status) return status;
|
|
334
|
+
if (someTxSucceeded && !allExpectedTxsStarted) return "incomplete";
|
|
335
|
+
if (isAllSettled) {
|
|
336
|
+
if (!someTxFailed) {
|
|
337
|
+
return "completed";
|
|
338
|
+
} else if (someTxSucceeded && someTxFailed) {
|
|
339
|
+
return "incomplete";
|
|
340
|
+
} else if (someTxFailed) {
|
|
341
|
+
return "failed";
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
return currentRouteDetails?.status;
|
|
345
|
+
};
|
|
346
|
+
const transferAssetRelease = transactionDetails?.findLast(
|
|
347
|
+
(i) => i.statusResponse?.transferAssetRelease
|
|
348
|
+
)?.statusResponse?.transferAssetRelease;
|
|
349
|
+
const updatedRelatedRoutes = updateRelatedRoutes({
|
|
350
|
+
relatedRoutes: relatedRoutes ?? currentRouteDetails?.relatedRoutes ?? [],
|
|
351
|
+
transferIndexToRouteKey,
|
|
352
|
+
transactionDetails
|
|
353
|
+
});
|
|
354
|
+
const newRouteDetails = {
|
|
355
|
+
id: routeId,
|
|
356
|
+
timestamp: currentRouteDetails.timestamp,
|
|
357
|
+
status: getRouteStatus(),
|
|
358
|
+
route: getSimpleRoute(currentRouteDetails?.route ?? options?.route),
|
|
359
|
+
txsRequired,
|
|
360
|
+
transactionDetails,
|
|
361
|
+
transferEvents,
|
|
362
|
+
transferAssetRelease,
|
|
363
|
+
userAddresses: (currentRouteDetails?.userAddresses.length > 0 ? currentRouteDetails?.userAddresses : options?.userAddresses) ?? [],
|
|
364
|
+
txsSigned: currentRouteDetails?.txsSigned,
|
|
365
|
+
transferIndexToRouteKey,
|
|
366
|
+
mainRouteId: mainRouteId ?? currentRouteDetails?.mainRouteId,
|
|
367
|
+
relatedRoutes: updatedRelatedRoutes
|
|
368
|
+
};
|
|
369
|
+
const newRouteStatus = getRouteDetailsWithSimpleTransactionDetailsStatus(newRouteDetails);
|
|
370
|
+
const previousRouteStatus = getRouteDetailsWithSimpleTransactionDetailsStatus(currentRouteDetails);
|
|
371
|
+
if (options?.onRouteStatusUpdated && JSON.stringify(newRouteStatus) !== JSON.stringify(previousRouteStatus)) {
|
|
372
|
+
options?.onRouteStatusUpdated?.(newRouteStatus);
|
|
373
|
+
}
|
|
374
|
+
if (routeId) {
|
|
375
|
+
routeDetailsMap.set(routeId, newRouteDetails);
|
|
376
|
+
}
|
|
377
|
+
return newRouteDetails;
|
|
378
|
+
};
|
|
379
|
+
var getSimpleRoute = (route) => {
|
|
380
|
+
return {
|
|
381
|
+
usdAmountOut: route?.usdAmountOut,
|
|
382
|
+
usdAmountIn: route?.usdAmountIn,
|
|
383
|
+
amountIn: route?.amountIn,
|
|
384
|
+
amountOut: route?.amountOut,
|
|
385
|
+
sourceAssetDenom: route?.sourceAssetDenom,
|
|
386
|
+
sourceAssetChainId: route?.sourceAssetChainId,
|
|
387
|
+
destAssetDenom: route?.destAssetDenom,
|
|
388
|
+
destAssetChainId: route?.destAssetChainId,
|
|
389
|
+
estimatedRouteDurationSeconds: route?.estimatedRouteDurationSeconds
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
var getRouteDetailsWithSimpleTransactionDetailsStatus = (routeDetails) => {
|
|
393
|
+
return {
|
|
394
|
+
...routeDetails,
|
|
395
|
+
transactionDetails: routeDetails.transactionDetails.map((txDetails) => {
|
|
396
|
+
const { statusResponse, ...rest } = txDetails;
|
|
397
|
+
const newTxDetails = {
|
|
398
|
+
...rest,
|
|
399
|
+
status: txDetails?.status ?? getTransactionStatus(statusResponse?.transfers?.[0]?.state)
|
|
400
|
+
};
|
|
401
|
+
return newTxDetails;
|
|
402
|
+
})
|
|
403
|
+
};
|
|
404
|
+
};
|
|
405
|
+
var removeRoutesWithFinalStatus = () => {
|
|
406
|
+
routeDetailsMap.forEach((routeDetails, routeId) => {
|
|
407
|
+
if (routeDetails.status === "completed" || routeDetails.status === "failed" || routeDetails.status === "incomplete") {
|
|
408
|
+
routeDetailsMap.delete(routeId);
|
|
409
|
+
}
|
|
410
|
+
});
|
|
411
|
+
};
|
|
412
|
+
var convertTransactionStatusToRouteStatus = (transactionStatus2) => {
|
|
413
|
+
if (!transactionStatus2) return;
|
|
414
|
+
if (transactionStatus2 === "success") {
|
|
415
|
+
return "completed";
|
|
416
|
+
}
|
|
417
|
+
return transactionStatus2;
|
|
418
|
+
};
|
|
419
|
+
var updateRelatedRoutes = ({
|
|
420
|
+
relatedRoutes,
|
|
421
|
+
transferIndexToRouteKey,
|
|
422
|
+
transactionDetails
|
|
423
|
+
}) => {
|
|
424
|
+
let updatedRelatedRoutes = [
|
|
425
|
+
...relatedRoutes.map((relatedRoute) => ({ ...relatedRoute }))
|
|
426
|
+
];
|
|
427
|
+
if (!transferIndexToRouteKey) return updatedRelatedRoutes;
|
|
428
|
+
transactionDetails?.forEach((transaction) => {
|
|
429
|
+
Object.entries(transferIndexToRouteKey).forEach(([indexStr, routeKey]) => {
|
|
430
|
+
const index = Number(indexStr);
|
|
431
|
+
const state = transaction?.statusResponse?.transfers?.[index]?.state;
|
|
432
|
+
const status = convertTransactionStatusToRouteStatus(
|
|
433
|
+
getTransactionStatus(state)
|
|
434
|
+
);
|
|
435
|
+
const transferAssetRelease = transaction?.statusResponse?.transfers?.[index]?.transferAssetRelease;
|
|
436
|
+
const targetRoute = updatedRelatedRoutes.find(
|
|
437
|
+
(r) => r.routeKey === routeKey
|
|
438
|
+
);
|
|
439
|
+
if (targetRoute && state) {
|
|
440
|
+
targetRoute.status = status ?? "failed";
|
|
441
|
+
}
|
|
442
|
+
if (targetRoute && transferAssetRelease) {
|
|
443
|
+
targetRoute.transferAssetRelease = transferAssetRelease;
|
|
444
|
+
}
|
|
445
|
+
});
|
|
446
|
+
});
|
|
447
|
+
return updatedRelatedRoutes;
|
|
448
|
+
};
|
|
449
|
+
|
|
450
|
+
export { executeAndSubscribeToRouteStatus, getTransactionStatus, subscribeToRouteStatus, updateRouteDetails };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { MsgAcceptOwner, MsgAddRemoteTokenMessenger, MsgDepositForBurn, MsgDepositForBurnWithCaller, MsgDisableAttester, MsgEnableAttester, MsgLinkTokenPair, MsgPauseBurningAndMinting, MsgPauseSendingAndReceivingMessages, MsgReceiveMessage, MsgRemoveRemoteTokenMessenger, MsgReplaceDepositForBurn, MsgReplaceMessage, MsgSendMessage, MsgSendMessageWithCaller, MsgUnlinkTokenPair, MsgUnpauseBurningAndMinting, MsgUnpauseSendingAndReceivingMessages, MsgUpdateOwner, MsgUpdateAttesterManager, MsgUpdateTokenController, MsgUpdatePauser, MsgUpdateMaxMessageBodySize, MsgSetMaxBurnAmountPerMessage, MsgUpdateSignatureThreshold, MsgExecute, MsgInitiateTokenDeposit, Coin,
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { MsgAcceptOwner, MsgAddRemoteTokenMessenger, MsgDepositForBurn, MsgDepositForBurnWithCaller, MsgDisableAttester, MsgEnableAttester, MsgLinkTokenPair, MsgPauseBurningAndMinting, MsgPauseSendingAndReceivingMessages, MsgReceiveMessage, MsgRemoveRemoteTokenMessenger, MsgReplaceDepositForBurn, MsgReplaceMessage, MsgSendMessage, MsgSendMessageWithCaller, MsgUnlinkTokenPair, MsgUnpauseBurningAndMinting, MsgUnpauseSendingAndReceivingMessages, MsgUpdateOwner, MsgUpdateAttesterManager, MsgUpdateTokenController, MsgUpdatePauser, MsgUpdateMaxMessageBodySize, MsgSetMaxBurnAmountPerMessage, MsgUpdateSignatureThreshold, MsgExecute, MsgInitiateTokenDeposit, Coin, Timestamp, Period } from './chunk-UIDIKXMB.js';
|
|
2
|
+
import { isSet, Long, toTimestamp, fromTimestamp, fromJsonTimestamp, padDecimal } from './chunk-QO2CYYF5.js';
|
|
3
|
+
import { ClientState } from './chunk-ZOUYAZU6.js';
|
|
4
|
+
import { ApiState, createRequestClient } from './chunk-A6KSECAH.js';
|
|
4
5
|
import { AminoTypes, createDefaultAminoConverters, defaultRegistryTypes } from '@cosmjs/stargate';
|
|
5
6
|
import { createWasmAminoConverters } from '@cosmjs/cosmwasm-stargate';
|
|
6
7
|
import { Registry } from '@cosmjs/proto-signing';
|
|
@@ -2199,6 +2200,34 @@ var evmosAminoConverters = {
|
|
|
2199
2200
|
...AminoConverter5
|
|
2200
2201
|
};
|
|
2201
2202
|
var evmosProtoRegistry = [...registry2, ...registry3, ...registry4, ...registry5];
|
|
2203
|
+
|
|
2204
|
+
// src/codegen/initia/move/v1/tx.amino.ts
|
|
2205
|
+
var AminoConverter6 = {
|
|
2206
|
+
"/initia.move.v1.MsgExecute": {
|
|
2207
|
+
aminoType: "/initia.move.v1.MsgExecute",
|
|
2208
|
+
toAmino: MsgExecute.toAmino,
|
|
2209
|
+
fromAmino: MsgExecute.fromAmino
|
|
2210
|
+
}
|
|
2211
|
+
};
|
|
2212
|
+
|
|
2213
|
+
// src/codegen/initia/client.ts
|
|
2214
|
+
var initiaAminoConverters = {
|
|
2215
|
+
...AminoConverter6
|
|
2216
|
+
};
|
|
2217
|
+
|
|
2218
|
+
// src/codegen/opinit/ophost/v1/tx.amino.ts
|
|
2219
|
+
var AminoConverter7 = {
|
|
2220
|
+
"/opinit.ophost.v1.MsgInitiateTokenDeposit": {
|
|
2221
|
+
aminoType: "ophost/MsgInitiateTokenDeposit",
|
|
2222
|
+
toAmino: MsgInitiateTokenDeposit.toAmino,
|
|
2223
|
+
fromAmino: MsgInitiateTokenDeposit.fromAmino
|
|
2224
|
+
}
|
|
2225
|
+
};
|
|
2226
|
+
|
|
2227
|
+
// src/codegen/opinit/client.ts
|
|
2228
|
+
var opinitAminoConverters = {
|
|
2229
|
+
...AminoConverter7
|
|
2230
|
+
};
|
|
2202
2231
|
var setClientOptions = (options = {}) => {
|
|
2203
2232
|
ApiState.client = createRequestClient({
|
|
2204
2233
|
apiUrl: options.apiUrl || "https://api.skip.build",
|
|
@@ -2211,6 +2240,8 @@ var setClientOptions = (options = {}) => {
|
|
|
2211
2240
|
...createWasmAminoConverters(),
|
|
2212
2241
|
...circleAminoConverters,
|
|
2213
2242
|
...evmosAminoConverters,
|
|
2243
|
+
...initiaAminoConverters,
|
|
2244
|
+
...opinitAminoConverters,
|
|
2214
2245
|
...options.aminoTypes ?? {}
|
|
2215
2246
|
});
|
|
2216
2247
|
ClientState.registry = new Registry([
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { OfflineAminoSigner } from '@cosmjs/amino';
|
|
2
|
+
import { OfflineDirectSigner } from '@cosmjs/proto-signing';
|
|
3
|
+
import { StdFee, GasPrice, SignerData } from '@cosmjs/stargate';
|
|
4
|
+
import { WalletClient } from 'viem';
|
|
5
|
+
import { Adapter } from '@solana/wallet-adapter-base';
|
|
6
|
+
import { a3 as FeeAsset, L as ChainType, W as CosmosMsg } from './swaggerTypes-DDwqIjap.js';
|
|
7
|
+
import { TrackTxPollingProps } from './api/postTrackTransaction.js';
|
|
8
|
+
|
|
9
|
+
/** Common Types */
|
|
10
|
+
type UserAddress = {
|
|
11
|
+
chainId: string;
|
|
12
|
+
address: string;
|
|
13
|
+
};
|
|
14
|
+
type EndpointOptions = {
|
|
15
|
+
rpc?: string;
|
|
16
|
+
rest?: string;
|
|
17
|
+
};
|
|
18
|
+
type ValidateGasResult = {
|
|
19
|
+
error: null | string;
|
|
20
|
+
asset: FeeAsset | null;
|
|
21
|
+
fee: StdFee | null;
|
|
22
|
+
};
|
|
23
|
+
/** Signer Getters */
|
|
24
|
+
type SignerGetters = {
|
|
25
|
+
getEvmSigner?: (chainId: string) => Promise<WalletClient>;
|
|
26
|
+
getCosmosSigner?: (chainId: string) => Promise<(OfflineAminoSigner & OfflineDirectSigner) | OfflineAminoSigner | OfflineDirectSigner>;
|
|
27
|
+
getSvmSigner?: () => Promise<Adapter>;
|
|
28
|
+
};
|
|
29
|
+
/** Gas Options */
|
|
30
|
+
type GetFallbackGasAmount = (chainId: string, chainType: ChainType) => Promise<number | undefined>;
|
|
31
|
+
type GetGasPrice = (chainId: string, chainType: ChainType) => Promise<GasPrice | undefined>;
|
|
32
|
+
type GasOptions = {
|
|
33
|
+
/**
|
|
34
|
+
* If `getGasPrice` is undefined, or returns undefined, the router will attempt to set the recommended gas price
|
|
35
|
+
**/
|
|
36
|
+
getGasPrice?: GetGasPrice;
|
|
37
|
+
/**
|
|
38
|
+
* If `getFallbackGasAmount` is set, when router fails to simulate the gas amount, it will use the fallback gas amount
|
|
39
|
+
*/
|
|
40
|
+
getFallbackGasAmount?: GetFallbackGasAmount;
|
|
41
|
+
gasAmountMultiplier?: number;
|
|
42
|
+
};
|
|
43
|
+
type SignCosmosMessageOptionsBase = {
|
|
44
|
+
signerAddress: string;
|
|
45
|
+
chainId: string;
|
|
46
|
+
cosmosMsgs: CosmosMsg[];
|
|
47
|
+
fee: StdFee;
|
|
48
|
+
signerData: SignerData;
|
|
49
|
+
};
|
|
50
|
+
type SignCosmosMessageDirectOptions = SignCosmosMessageOptionsBase & {
|
|
51
|
+
signer: OfflineDirectSigner;
|
|
52
|
+
};
|
|
53
|
+
type SignCosmosMessageAminoOptions = SignCosmosMessageOptionsBase & {
|
|
54
|
+
signer: OfflineAminoSigner;
|
|
55
|
+
};
|
|
56
|
+
type TxResult = {
|
|
57
|
+
txHash: string;
|
|
58
|
+
chainId: string;
|
|
59
|
+
explorerLink?: string;
|
|
60
|
+
};
|
|
61
|
+
interface BaseSettings {
|
|
62
|
+
slippageTolerancePercent?: string;
|
|
63
|
+
simulate?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Set allowance amount to max if EVM transaction requires allowance approval.
|
|
66
|
+
*/
|
|
67
|
+
useUnlimitedApproval?: boolean;
|
|
68
|
+
/**
|
|
69
|
+
/**
|
|
70
|
+
* If `skipApproval` is set to `true`, the router will bypass checking whether
|
|
71
|
+
* the signer has granted approval for the specified token contract on an EVM chain.
|
|
72
|
+
* This can be useful if approval has already been handled externally or there are race conditions.
|
|
73
|
+
*/
|
|
74
|
+
bypassApprovalCheck?: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* defaults to true
|
|
77
|
+
* If `batchSimulate` is set to `true`, it will simulate all messages in a batch before the first tx run.
|
|
78
|
+
* If `batchSimulate` is set to `false`, it will simulate each message one by one.
|
|
79
|
+
*/
|
|
80
|
+
batchSimulate?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Optional configuration for transaction polling behavior.
|
|
83
|
+
* - `maxRetries`: Maximum number of polling attempts (default: 5)
|
|
84
|
+
* - `retryInterval`: Retry interval in milliseconds (default: 1000)
|
|
85
|
+
* - `backoffMultiplier`: Exponential backoff multiplier for increasing delay between retries (default: 2.5)
|
|
86
|
+
* Example backoff with retryInterval = 1000 and backoffMultiplier = 2:
|
|
87
|
+
* 1st retry: 1000ms → 2nd: 2000ms → 3rd: 4000ms → 4th: 8000ms ...
|
|
88
|
+
*/
|
|
89
|
+
trackTxPollingOptions?: TrackTxPollingProps;
|
|
90
|
+
/**
|
|
91
|
+
* If `batchSignTxs` is set to `true`, it will sign all transactions in a batch up front.
|
|
92
|
+
* If `batchSignTxs` is set to `false`, it will sign each transaction one by one.
|
|
93
|
+
*/
|
|
94
|
+
batchSignTxs?: boolean;
|
|
95
|
+
/**
|
|
96
|
+
* If `cosmosPriorityFeeDenom` is provided, it will be used to set the priority fee for Cosmos transactions.
|
|
97
|
+
* It should be a function that takes a chainId and returns the denom for the priority fee.
|
|
98
|
+
*/
|
|
99
|
+
getCosmosPriorityFeeDenom?: (chainId: string) => Promise<string | undefined>;
|
|
100
|
+
/**
|
|
101
|
+
* SVM Fee Payer
|
|
102
|
+
*
|
|
103
|
+
* This is used to pay for the transaction fees on SVM chains.
|
|
104
|
+
* It should be an object with the following properties:
|
|
105
|
+
* `address`: The address of the fee payer.
|
|
106
|
+
* `signTransaction`: A function that takes the data to sign and returns a Promise that resolves to the signed transaction.
|
|
107
|
+
*/
|
|
108
|
+
svmFeePayer?: {
|
|
109
|
+
address: string;
|
|
110
|
+
signTransaction: (dataToSign: Buffer) => Promise<Uint8Array>;
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export type { BaseSettings as B, EndpointOptions as E, GetFallbackGasAmount as G, SignerGetters as S, TxResult as T, UserAddress as U, ValidateGasResult as V, GetGasPrice as a, GasOptions as b, SignCosmosMessageOptionsBase as c, SignCosmosMessageDirectOptions as d, SignCosmosMessageAminoOptions as e };
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { A as AcknowledgementErrorDetails, a as Affiliate, bx as Api, bt as ApiConfig, b as ApiError, c as Asset, d as AssetBetweenChains, e as AssetRecommendation, bi as AssetRecommendationsResponse, be as AssetsFromSourceResponse, bc as AssetsRequest, bd as AssetsResponse, f as AutopilotAction, g as AutopilotMsg, h as AutopilotMsgWrapper, i as AxelarTransfer, j as AxelarTransferInfo, k as AxelarTransferState, l as AxelarTransferType, m as AxelarTransferWrapper, B as BalanceRequestChainEntry, E as BalanceResponseChainEntry, D as BalanceResponseDenomEntry, b8 as BalancesResponse, F as BankSend, H as BankSendWrapper, I as Bridge, J as BridgeType, b9 as BridgesResponse, C as CCTPTransfer, n as CCTPTransferInfo, p as CCTPTransferState, o as CCTPTransferTxs, q as CCTPTransferWrapper, K as Chain, M as ChainAffiliates, am as ChainTransaction, L as ChainType, b6 as ChainsRequest, b7 as ChainsResponse, bv as ContentType, N as ContractCallWithTokenError, O as ContractCallWithTokenErrorType, P as ContractCallWithTokenTxs, Q as CosmWasmContractMsg, R as CosmWasmContractMsgWrapper, b1 as CosmosModuleSupport, W as CosmosMsg, X as CosmosTx, Y as CosmosTxWrapper, T as Erc20Approval, V as Error, U as ErrorDetail, aW as EurekaTransfer, aX as EurekaTransferInfo, aY as EurekaTransferWrapper, Z as EvmSwap, _ as EvmSwapWrapper, $ as EvmTx, a0 as EvmTxWrapper, b5 as Fee, a3 as FeeAsset, b4 as FeeBehavior, b3 as FeeType, br as FullRequestParams, bo as FungibleAssetsBetweenChainsCreateResponse, a5 as GRPCStatusCode, a4 as GoFastFee, G as GoFastTransfer, y as GoFastTransferInfo, w as GoFastTransferState, x as GoFastTransferTxs, z as GoFastTransferWrapper, bw as HttpClient, bu as HttpResponse, a6 as HyperlaneTransfer, a7 as HyperlaneTransferInfo, a8 as HyperlaneTransferState, a9 as HyperlaneTransferTransactions, aa as HyperlaneTransferWrapper, ab as IBCTransferInfo, b2 as IbcCapabilities, bn as IbcOriginAssetsResponse, aZ as LayerZeroTransfer, a_ as LayerZeroTransferInfo, aP as LayerZeroTransferState, ai as LayerZeroTransferTransactions, a$ as LayerZeroTransferWrapper, ac as Msg, bh as MsgsDirectResponse, bg as MsgsResponse, ae as MultiChainMsg, af as MultiChainMsgWrapper, aK as OPInitTransfer, aM as OPInitTransferInfo, aO as OPInitTransferState, aN as OPInitTransferTxs, aL as OPInitTransferWrapper, ag as Operation, ah as OptionalAsset, aj as Packet, ak as PacketError, al as PacketErrorType, an as PostHandler, bp as QueryParamsType, ao as Reason, b0 as RecommendationRequest, bs as RequestParams, bq as ResponseFormat, aq as Route, ap as RoutePriceWarningType, bf as RouteResponse, ar as SendTokenError, as as SendTokenErrorType, at as SendTokenTxs, S as SmartRelayFeeQuote, aD as SmartSwapExactCoinIn, aF as SmartSwapInWrapper, aE as SmartSwapOptions, r as StargateTransfer, u as StargateTransferInfo, s as StargateTransferState, t as StargateTransferTxs, v as StargateTransferWrapper, au as StatusError, av as StatusErrorType, bl as StatusRequest, bm as StatusResponse, bj as SubmitResponse, a1 as SvmTx, a2 as SvmTxWrapper, aw as Swap, ax as SwapExactCoinIn, ay as SwapExactCoinOut, az as SwapInWrapper, aA as SwapOperation, aB as SwapOutWrapper, aC as SwapRoute, aG as SwapVenue, aH as SwapWrapper, bk as TrackResponse, aI as TransactionExecutionErrorDetails, aJ as TransactionState, aQ as Transfer, aT as TransferAssetRelease, aR as TransferEvent, aS as TransferState, aU as TransferStatus, aV as TransferWrapper, ad as Tx, ba as VenuesRequest, bb as VenuesResponse } from './swaggerTypes-DDwqIjap.js';
|
|
2
|
-
export {
|
|
3
|
-
export { E as EndpointOptions, b as GasOptions, G as GetFallbackGasAmount, a as GetGasPrice, e as SignCosmosMessageAminoOptions, d as SignCosmosMessageDirectOptions, c as SignCosmosMessageOptionsBase, S as SignerGetters, T as TxResult, U as UserAddress, V as ValidateGasResult } from './client-types-
|
|
2
|
+
export { E as ExecuteRouteOptions, R as RouteDetails, a as RouteStatus, d as TransactionCallbacks, T as TransactionDetails, b as TransactionStatus, c as TransferEventStatus, e as executeRoute, s as subscribeToRouteStatus } from './callbacks-CvqAtBJq.js';
|
|
3
|
+
export { B as BaseSettings, E as EndpointOptions, b as GasOptions, G as GetFallbackGasAmount, a as GetGasPrice, e as SignCosmosMessageAminoOptions, d as SignCosmosMessageDirectOptions, c as SignCosmosMessageOptionsBase, S as SignerGetters, T as TxResult, U as UserAddress, V as ValidateGasResult } from './client-types-Dk6ypWdO.js';
|
|
4
4
|
export { assets } from './api/getAssets.js';
|
|
5
5
|
export { assetsBetweenChains } from './api/getAssetsBetweenChains.js';
|
|
6
6
|
export { bridges } from './api/getBridges.js';
|
|
@@ -16,9 +16,9 @@ export { RouteRequest, route } from './api/postRoute.js';
|
|
|
16
16
|
export { SubmitTransactionRequest, SubmitTransactionResponse, submitTransaction } from './api/postSubmitTransaction.js';
|
|
17
17
|
export { trackTransaction } from './api/postTrackTransaction.js';
|
|
18
18
|
export { TxStatusResponse, transactionStatus } from './api/postTransactionStatus.js';
|
|
19
|
-
export {
|
|
19
|
+
export { ExecuteMultipleRoutesOptions, executeMultipleRoutes } from './public-functions/executeMultipleRoutes.js';
|
|
20
20
|
export { getSigningStargateClient, getSigningStargateClientProps } from './public-functions/getSigningStargateClient.js';
|
|
21
|
-
export { S as SkipClientOptions, s as setClientOptions } from './setClientOptions-
|
|
21
|
+
export { S as SkipClientOptions, s as setClientOptions } from './setClientOptions-BD8e7m2x.js';
|
|
22
22
|
export { getRecommendedGasPrice } from './public-functions/getRecommendedGasPrice.js';
|
|
23
23
|
export { getFeeInfoForChain } from './public-functions/getFeeInfoForChain.js';
|
|
24
24
|
export { SetApiOptionsProps, setApiOptions } from './public-functions/setApiOptions.js';
|
|
@@ -26,13 +26,13 @@ export { waitForTransaction } from './public-functions/waitForTransaction.js';
|
|
|
26
26
|
export { getCosmosGasAmountForMessage } from './public-functions/getCosmosGasAmountForMessage.js';
|
|
27
27
|
export { getEVMGasAmountForMessage } from './public-functions/getEvmGasAmountForMessage.js';
|
|
28
28
|
export { validateCosmosGasBalance } from './public-functions/validateCosmosGasBalance.js';
|
|
29
|
+
import './generateApi-C_xgtxrO.js';
|
|
29
30
|
import '@cosmjs/amino';
|
|
30
31
|
import '@cosmjs/proto-signing';
|
|
31
32
|
import '@cosmjs/stargate';
|
|
32
33
|
import 'viem';
|
|
33
34
|
import '@solana/wallet-adapter-base';
|
|
34
35
|
import './apiState-DwZhwVul.js';
|
|
35
|
-
import './generateApi-C_xgtxrO.js';
|
|
36
36
|
|
|
37
37
|
interface AcknowledgementErrorDetailsJson {
|
|
38
38
|
/** Error code */
|