@skip-go/client 1.3.2 → 1.3.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 +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-EINQFLWN.cjs → chunk-2CCLIBCC.cjs} +2 -2
- package/dist/cjs/{chunk-SLZCWA4K.cjs → chunk-2EKCOIWV.cjs} +7 -7
- package/dist/cjs/{chunk-SIY2K7TT.cjs → chunk-2VQ2TNFM.cjs} +2 -2
- package/dist/cjs/{chunk-DUJSZRFD.cjs → chunk-4AB775IT.cjs} +81 -58
- package/dist/cjs/{chunk-EQBTNGJJ.cjs → chunk-7I2KQNIU.cjs} +2 -2
- package/dist/cjs/{chunk-WE7KICKO.cjs → chunk-B4OGYBRC.cjs} +2 -2
- package/dist/cjs/{chunk-OA5PE7TW.cjs → chunk-DBDB2XWX.cjs} +3 -3
- package/dist/cjs/{chunk-PFCGKAXF.cjs → chunk-DCFIIF7G.cjs} +2 -2
- package/dist/cjs/{chunk-W2DPDT3Y.cjs → chunk-EXK2GDR5.cjs} +2 -2
- package/dist/cjs/{chunk-G3G6PBIF.cjs → chunk-FO25SR66.cjs} +6 -6
- package/dist/cjs/{chunk-AHRSARNR.cjs → chunk-FY56EEFB.cjs} +3 -2
- package/dist/cjs/{chunk-5FR25GF5.cjs → chunk-HKQ5VION.cjs} +1 -1
- package/dist/cjs/{chunk-TCQMGBFL.cjs → chunk-J5RC6ZU5.cjs} +19 -11
- package/dist/cjs/{chunk-MGYSCMET.cjs → chunk-KJ5NZG2D.cjs} +10 -10
- package/dist/cjs/{chunk-KMDNP6DN.cjs → chunk-L4MLX6KI.cjs} +2 -2
- package/dist/cjs/{chunk-NQR3EPN2.cjs → chunk-MCZ3F457.cjs} +2 -2
- package/dist/cjs/{chunk-PG7RVHOU.cjs → chunk-MW3TE7DC.cjs} +2 -2
- package/dist/cjs/{chunk-TFL5E5A6.cjs → chunk-P7CDAHIX.cjs} +2 -2
- package/dist/cjs/{chunk-D2W4UBJB.cjs → chunk-QSISUSYP.cjs} +4 -4
- package/dist/cjs/{chunk-HDKNPB2J.cjs → chunk-TWXIFMTM.cjs} +7 -7
- package/dist/cjs/{chunk-CWUD7UGL.cjs → chunk-XGBCEYWI.cjs} +2 -2
- package/dist/cjs/{chunk-TWPLCFOH.cjs → chunk-YYBGBKRE.cjs} +4 -4
- package/dist/cjs/index.cjs +52 -57
- package/dist/cjs/public-functions/executeRoute.cjs +13 -14
- package/dist/cjs/public-functions/getFeeInfoForChain.cjs +4 -4
- package/dist/cjs/public-functions/getRecommendedGasPrice.cjs +5 -5
- package/dist/cjs/public-functions/getSigningStargateClient.cjs +4 -4
- package/dist/cjs/public-functions/setApiOptions.cjs +3 -3
- package/dist/cjs/public-functions/setClientOptions.cjs +4 -4
- package/dist/cjs/public-functions/validateCosmosGasBalance.cjs +6 -6
- package/dist/cjs/public-functions/waitForTransaction.cjs +5 -5
- package/dist/esm/api/getAssets.d.ts +1 -1
- package/dist/esm/api/getAssets.js +2 -2
- package/dist/esm/api/getAssetsBetweenChains.d.ts +1 -1
- package/dist/esm/api/getAssetsBetweenChains.js +2 -2
- package/dist/esm/api/getBridges.d.ts +1 -1
- package/dist/esm/api/getBridges.js +2 -2
- package/dist/esm/api/getChains.d.ts +1 -1
- package/dist/esm/api/getChains.js +2 -2
- package/dist/esm/api/getVenues.js +2 -2
- package/dist/esm/api/postAssetsFromSource.d.ts +1 -1
- package/dist/esm/api/postAssetsFromSource.js +3 -3
- package/dist/esm/api/postBalances.d.ts +2 -2
- package/dist/esm/api/postBalances.js +2 -2
- package/dist/esm/api/postIbcOriginAssets.js +2 -2
- package/dist/esm/api/postMessages.d.ts +2 -2
- package/dist/esm/api/postMessages.js +2 -2
- package/dist/esm/api/postMessagesDirect.d.ts +1 -1
- package/dist/esm/api/postMessagesDirect.js +2 -2
- package/dist/esm/api/postRecommendAssets.d.ts +1 -1
- package/dist/esm/api/postRecommendAssets.js +2 -2
- package/dist/esm/api/postRoute.d.ts +2 -2
- package/dist/esm/api/postRoute.js +2 -2
- package/dist/esm/api/postSubmitTransaction.d.ts +5 -1
- package/dist/esm/api/postSubmitTransaction.js +2 -2
- package/dist/esm/api/postTrackTransaction.d.ts +2 -2
- package/dist/esm/api/postTrackTransaction.js +2 -2
- package/dist/esm/api/postTransactionStatus.d.ts +2 -2
- package/dist/esm/api/postTransactionStatus.js +2 -2
- package/dist/esm/{callbacks-DGLv2hr0.d.ts → callbacks-CuL50GnB.d.ts} +1 -1
- package/dist/esm/{chunk-6ULKULTX.js → chunk-2L7PKZDY.js} +1 -1
- package/dist/esm/{chunk-F65QOYUA.js → chunk-6F2T2KB3.js} +1 -1
- package/dist/esm/{chunk-MAOMQHG5.js → chunk-7ITTEUMR.js} +1 -1
- package/dist/esm/{chunk-NZVZH6OA.js → chunk-7LSTJXAF.js} +2 -1
- package/dist/esm/{chunk-4DI7G6TH.js → chunk-7YN3UVVF.js} +1 -1
- package/dist/esm/{chunk-CGZ5DA2T.js → chunk-CFDTJGQK.js} +1 -1
- package/dist/esm/{chunk-ERPZHRBM.js → chunk-CU6W3622.js} +17 -9
- package/dist/esm/{chunk-7ZG7HNNC.js → chunk-GD7EWX2G.js} +3 -3
- package/dist/esm/{chunk-VUOOTNLG.js → chunk-HT6O3BQ7.js} +1 -1
- package/dist/esm/{chunk-ZTDLGX7X.js → chunk-IPHFFTGO.js} +1 -1
- package/dist/esm/{chunk-YLMQS52U.js → chunk-IWXRHEX4.js} +2 -2
- package/dist/esm/{chunk-UZKIIX6A.js → chunk-JIADJKRD.js} +1 -1
- package/dist/esm/{chunk-HAGMHUOI.js → chunk-JOBBQQDA.js} +46 -23
- package/dist/esm/{chunk-YYXOIRHZ.js → chunk-JSY7M43P.js} +1 -1
- package/dist/esm/{chunk-HS2D6FKN.js → chunk-JYUNVL4F.js} +1 -1
- package/dist/esm/{chunk-SS5LQKBL.js → chunk-LZI7A4JI.js} +1 -1
- package/dist/esm/{chunk-I4AMZAHH.js → chunk-MXCJ2M3K.js} +1 -1
- package/dist/esm/{chunk-PIQZD2VE.js → chunk-OHV2LZEG.js} +1 -1
- package/dist/esm/{chunk-C6NHVJ3R.js → chunk-OL7CWCPB.js} +2 -2
- package/dist/esm/{chunk-2R5COFPS.js → chunk-SJP6W2SK.js} +1 -1
- package/dist/esm/{chunk-QPJEHGY7.js → chunk-XXTECZG3.js} +1 -1
- package/dist/esm/{chunk-GOD6ESBZ.js → chunk-Y5H25R7Z.js} +1 -1
- package/dist/esm/{client-types-CSzTHcG9.d.ts → client-types-B7Fin0mq.d.ts} +2 -1
- package/dist/esm/{generateApi-Bfli9ipj.d.ts → generateApi-C_xgtxrO.d.ts} +1 -1
- package/dist/esm/index.d.ts +6 -7
- package/dist/esm/index.js +23 -24
- package/dist/esm/public-functions/executeRoute.d.ts +16 -4
- package/dist/esm/public-functions/executeRoute.js +12 -13
- package/dist/esm/public-functions/getCosmosGasAmountForMessage.d.ts +1 -1
- package/dist/esm/public-functions/getEvmGasAmountForMessage.d.ts +2 -2
- package/dist/esm/public-functions/getFeeInfoForChain.d.ts +1 -1
- package/dist/esm/public-functions/getFeeInfoForChain.js +3 -3
- package/dist/esm/public-functions/getRecommendedGasPrice.js +4 -4
- package/dist/esm/public-functions/getSigningStargateClient.js +3 -3
- package/dist/esm/public-functions/setApiOptions.d.ts +1 -1
- package/dist/esm/public-functions/setApiOptions.js +2 -2
- package/dist/esm/public-functions/setClientOptions.d.ts +3 -3
- package/dist/esm/public-functions/setClientOptions.js +3 -3
- package/dist/esm/public-functions/validateCosmosGasBalance.d.ts +4 -4
- package/dist/esm/public-functions/validateCosmosGasBalance.js +5 -5
- package/dist/esm/public-functions/waitForTransaction.d.ts +10 -6
- package/dist/esm/public-functions/waitForTransaction.js +4 -4
- package/dist/esm/{setClientOptions-RMgGQ1KD.d.ts → setClientOptions-BTRwCbmt.d.ts} +1 -1
- package/dist/esm/{swaggerTypes-BIYUp1AO.d.ts → swaggerTypes-DDwqIjap.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/cjs/api/postSubmit.cjs +0 -12
- package/dist/cjs/chunk-RFBDXALX.cjs +0 -12
- package/dist/esm/api/postSubmit.d.ts +0 -17
- package/dist/esm/api/postSubmit.js +0 -3
- package/dist/esm/chunk-6UMMVC2P.js +0 -10
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { ibcOriginAssets } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { ibcOriginAssets } from '../chunk-XXTECZG3.js';
|
|
2
|
+
import '../chunk-LZI7A4JI.js';
|
|
3
3
|
import '../chunk-OQDBWVET.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b3 as FeeType, J as BridgeType, b4 as FeeBehavior } from '../swaggerTypes-
|
|
1
|
+
import { b3 as FeeType, J as BridgeType, b4 as FeeBehavior } from '../swaggerTypes-DDwqIjap.js';
|
|
2
2
|
import { S as SkipApiOptions } from '../apiState-DwZhwVul.js';
|
|
3
|
-
import { A as ApiRequest, a as ApiResponse } from '../generateApi-
|
|
3
|
+
import { A as ApiRequest, a as ApiResponse } from '../generateApi-C_xgtxrO.js';
|
|
4
4
|
|
|
5
5
|
declare const messages: (request: MessagesRequest) => Promise<{
|
|
6
6
|
msgs?: ({
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { messages } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { messages } from '../chunk-7LSTJXAF.js';
|
|
2
|
+
import '../chunk-LZI7A4JI.js';
|
|
3
3
|
import '../chunk-OQDBWVET.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as SkipApiOptions } from '../apiState-DwZhwVul.js';
|
|
2
|
-
import { f as AutopilotAction, J as BridgeType, ap as RoutePriceWarningType, b3 as FeeType, b4 as FeeBehavior } from '../swaggerTypes-
|
|
2
|
+
import { f as AutopilotAction, J as BridgeType, ap as RoutePriceWarningType, b3 as FeeType, b4 as FeeBehavior } from '../swaggerTypes-DDwqIjap.js';
|
|
3
3
|
|
|
4
4
|
declare const messagesDirect: (options?: ({
|
|
5
5
|
sourceAssetDenom?: string | undefined;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { messagesDirect } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { messagesDirect } from '../chunk-SJP6W2SK.js';
|
|
2
|
+
import '../chunk-LZI7A4JI.js';
|
|
3
3
|
import '../chunk-OQDBWVET.js';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { recommendAssets } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { recommendAssets } from '../chunk-IPHFFTGO.js';
|
|
2
|
+
import '../chunk-LZI7A4JI.js';
|
|
3
3
|
import '../chunk-OQDBWVET.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { J as BridgeType, ap as RoutePriceWarningType, b3 as FeeType, b4 as FeeBehavior } from '../swaggerTypes-
|
|
1
|
+
import { J as BridgeType, ap as RoutePriceWarningType, b3 as FeeType, b4 as FeeBehavior } from '../swaggerTypes-DDwqIjap.js';
|
|
2
2
|
import { S as SkipApiOptions } from '../apiState-DwZhwVul.js';
|
|
3
|
-
import { A as ApiRequest } from '../generateApi-
|
|
3
|
+
import { A as ApiRequest } from '../generateApi-C_xgtxrO.js';
|
|
4
4
|
|
|
5
5
|
declare const route: (request: RouteRequest) => Promise<{
|
|
6
6
|
amountIn: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { route } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { route } from '../chunk-JIADJKRD.js';
|
|
2
|
+
import '../chunk-LZI7A4JI.js';
|
|
3
3
|
import '../chunk-OQDBWVET.js';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { S as SkipApiOptions } from '../apiState-DwZhwVul.js';
|
|
2
|
+
import { A as ApiRequest, a as ApiResponse } from '../generateApi-C_xgtxrO.js';
|
|
3
|
+
import '../swaggerTypes-DDwqIjap.js';
|
|
2
4
|
|
|
3
5
|
declare const submitTransaction: (options?: ({
|
|
4
6
|
tx?: string | undefined;
|
|
@@ -9,5 +11,7 @@ declare const submitTransaction: (options?: ({
|
|
|
9
11
|
txHash?: string | undefined;
|
|
10
12
|
explorerLink?: string | undefined;
|
|
11
13
|
} | undefined>;
|
|
14
|
+
type SubmitTransactionRequest = ApiRequest<"submit">;
|
|
15
|
+
type SubmitTransactionResponse = ApiResponse<"submit">;
|
|
12
16
|
|
|
13
|
-
export { submitTransaction };
|
|
17
|
+
export { type SubmitTransactionRequest, type SubmitTransactionResponse, submitTransaction };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { submitTransaction } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { submitTransaction } from '../chunk-OHV2LZEG.js';
|
|
2
|
+
import '../chunk-LZI7A4JI.js';
|
|
3
3
|
import '../chunk-OQDBWVET.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { A as ApiRequest, P as PollingProps } from '../generateApi-
|
|
2
|
-
import '../swaggerTypes-
|
|
1
|
+
import { A as ApiRequest, P as PollingProps } from '../generateApi-C_xgtxrO.js';
|
|
2
|
+
import '../swaggerTypes-DDwqIjap.js';
|
|
3
3
|
|
|
4
4
|
type TrackTxRequest = ApiRequest<"status"> & TrackTxPollingProps;
|
|
5
5
|
type TrackTxPollingProps = Omit<PollingProps<"status">, "isSuccess" | "onError" | "onSuccess">;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { trackTransaction } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { trackTransaction } from '../chunk-7ITTEUMR.js';
|
|
2
|
+
import '../chunk-LZI7A4JI.js';
|
|
3
3
|
import '../chunk-OQDBWVET.js';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { av as StatusErrorType, aJ as TransactionState, al as PacketErrorType, aS as TransferState, k as AxelarTransferState, O as ContractCallWithTokenErrorType, as as SendTokenErrorType, l as AxelarTransferType, p as CCTPTransferState, a8 as HyperlaneTransferState, aO as OPInitTransferState, s as StargateTransferState, w as GoFastTransferState, aP as LayerZeroTransferState } from '../swaggerTypes-
|
|
1
|
+
import { av as StatusErrorType, aJ as TransactionState, al as PacketErrorType, aS as TransferState, k as AxelarTransferState, O as ContractCallWithTokenErrorType, as as SendTokenErrorType, l as AxelarTransferType, p as CCTPTransferState, a8 as HyperlaneTransferState, aO as OPInitTransferState, s as StargateTransferState, w as GoFastTransferState, aP as LayerZeroTransferState } from '../swaggerTypes-DDwqIjap.js';
|
|
2
2
|
import { S as SkipApiOptions } from '../apiState-DwZhwVul.js';
|
|
3
|
-
import { a as ApiResponse } from '../generateApi-
|
|
3
|
+
import { a as ApiResponse } from '../generateApi-C_xgtxrO.js';
|
|
4
4
|
|
|
5
5
|
declare const transactionStatus: (params?: ({
|
|
6
6
|
txHash: string;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { transactionStatus } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { transactionStatus } from '../chunk-MXCJ2M3K.js';
|
|
2
|
+
import '../chunk-LZI7A4JI.js';
|
|
3
3
|
import '../chunk-OQDBWVET.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { chains, findFirstWorkingEndpoint } from './chunk-43P4WRGN.js';
|
|
2
|
-
import { ClientState } from './chunk-
|
|
2
|
+
import { ClientState } from './chunk-2L7PKZDY.js';
|
|
3
3
|
import { accountFromAny, SigningStargateClient } from '@cosmjs/stargate';
|
|
4
4
|
import { assertDefinedAndNotNull } from '@cosmjs/utils';
|
|
5
5
|
import { BinaryWriter, BinaryReader } from 'cosmjs-types/binary.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { api } from './chunk-
|
|
1
|
+
import { api } from './chunk-LZI7A4JI.js';
|
|
2
2
|
|
|
3
3
|
// src/utils/filterMessagesRequest.ts
|
|
4
4
|
var filterMessagesRequest = (request) => {
|
|
@@ -13,6 +13,7 @@ var filterMessagesRequest = (request) => {
|
|
|
13
13
|
operations: request.operations,
|
|
14
14
|
estimatedAmountOut: request.estimatedAmountOut,
|
|
15
15
|
slippageTolerancePercent: request.slippageTolerancePercent,
|
|
16
|
+
feePayerAddress: request.feePayerAddress,
|
|
16
17
|
timeoutSeconds: request.timeoutSeconds,
|
|
17
18
|
postRouteHandler: request.postRouteHandler,
|
|
18
19
|
chainIdsToAffiliates: request.chainIdsToAffiliates,
|
|
@@ -1,20 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { wait } from './chunk-
|
|
1
|
+
import { trackTransaction } from './chunk-7ITTEUMR.js';
|
|
2
|
+
import { transactionStatus } from './chunk-MXCJ2M3K.js';
|
|
3
|
+
import { wait } from './chunk-LZI7A4JI.js';
|
|
4
4
|
|
|
5
5
|
// src/public-functions/waitForTransaction.ts
|
|
6
6
|
var waitForTransaction = async ({
|
|
7
7
|
chainId,
|
|
8
8
|
txHash,
|
|
9
|
+
explorerLink,
|
|
9
10
|
onTransactionTracked,
|
|
10
11
|
...trackTxPollingOptions
|
|
11
12
|
}) => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
try {
|
|
14
|
+
if (!explorerLink) {
|
|
15
|
+
const response = await trackTransaction({
|
|
16
|
+
chainId,
|
|
17
|
+
txHash,
|
|
18
|
+
...trackTxPollingOptions
|
|
19
|
+
});
|
|
20
|
+
explorerLink = response.explorerLink;
|
|
21
|
+
}
|
|
22
|
+
await onTransactionTracked?.({ txHash, chainId, explorerLink });
|
|
23
|
+
} catch (error) {
|
|
24
|
+
console.warn(`track failed for txHash:${txHash}, chainId: ${chainId}`);
|
|
25
|
+
}
|
|
18
26
|
while (true) {
|
|
19
27
|
const txStatusResponse = await transactionStatus({
|
|
20
28
|
chainId,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getCosmosGasAmountForMessage } from './chunk-TV2XPAIF.js';
|
|
2
2
|
import { BigNumber } from './chunk-VQ5SIQWU.js';
|
|
3
|
-
import { getSigningStargateClient } from './chunk-
|
|
4
|
-
import { ClientState, balances } from './chunk-
|
|
3
|
+
import { getSigningStargateClient } from './chunk-6F2T2KB3.js';
|
|
4
|
+
import { ClientState, balances } from './chunk-2L7PKZDY.js';
|
|
5
5
|
import { GasPrice, calculateFee } from '@cosmjs/stargate';
|
|
6
6
|
import { Decimal } from '@cosmjs/math';
|
|
7
7
|
|
|
@@ -28,7 +28,7 @@ var validateCosmosGasBalance = async ({
|
|
|
28
28
|
}
|
|
29
29
|
const estimatedGasAmount = await (async () => {
|
|
30
30
|
try {
|
|
31
|
-
if (
|
|
31
|
+
if (simulate === false) throw new Error("simulate");
|
|
32
32
|
if (txIndex !== 0 && chainId === "noble-1") {
|
|
33
33
|
return "0";
|
|
34
34
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { transformAssetsMap } from './chunk-
|
|
2
|
-
import { api } from './chunk-
|
|
1
|
+
import { transformAssetsMap } from './chunk-2L7PKZDY.js';
|
|
2
|
+
import { api } from './chunk-LZI7A4JI.js';
|
|
3
3
|
|
|
4
4
|
// src/api/postAssetsFromSource.ts
|
|
5
5
|
var assetsFromSource = api({
|
|
@@ -1,17 +1,16 @@
|
|
|
1
|
-
import { validateCosmosGasBalance } from './chunk-
|
|
2
|
-
import { waitForTransaction } from './chunk-
|
|
1
|
+
import { validateCosmosGasBalance } from './chunk-GD7EWX2G.js';
|
|
2
|
+
import { waitForTransaction } from './chunk-CU6W3622.js';
|
|
3
3
|
import { getEncodeObjectFromCosmosMessage, getEncodeObjectFromCosmosMessageInjective } from './chunk-TV2XPAIF.js';
|
|
4
4
|
import { getEVMGasAmountForMessage } from './chunk-GV2QOWB4.js';
|
|
5
5
|
import { BigNumber } from './chunk-VQ5SIQWU.js';
|
|
6
6
|
import { GAS_STATION_CHAIN_IDS } from './chunk-SWYON2RG.js';
|
|
7
|
-
import { getSigningStargateClient, getRpcEndpointForChain, accountParser } from './chunk-
|
|
7
|
+
import { getSigningStargateClient, getRpcEndpointForChain, accountParser } from './chunk-6F2T2KB3.js';
|
|
8
8
|
import { chains, findFirstWorkingEndpoint, getIsEthermint, getIsInitia } from './chunk-43P4WRGN.js';
|
|
9
|
-
import { messages } from './chunk-
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import { ApiState, wait, createRequestClient, toCamel } from './chunk-SS5LQKBL.js';
|
|
9
|
+
import { messages } from './chunk-7LSTJXAF.js';
|
|
10
|
+
import { submitTransaction } from './chunk-OHV2LZEG.js';
|
|
11
|
+
import { venues } from './chunk-JSY7M43P.js';
|
|
12
|
+
import { ClientState, balances } from './chunk-2L7PKZDY.js';
|
|
13
|
+
import { ApiState, wait, createRequestClient, toCamel } from './chunk-LZI7A4JI.js';
|
|
15
14
|
import { PublicKey, Transaction, Connection, LAMPORTS_PER_SOL } from '@solana/web3.js';
|
|
16
15
|
import { bech32m, bech32 } from 'bech32';
|
|
17
16
|
import { StargateClient } from '@cosmjs/stargate';
|
|
@@ -341,6 +340,8 @@ var signCosmosMessageAmino = async (options) => {
|
|
|
341
340
|
signatures: [fromBase64(signature.signature)]
|
|
342
341
|
});
|
|
343
342
|
};
|
|
343
|
+
|
|
344
|
+
// src/private-functions/cosmos/signCosmosTransaction.ts
|
|
344
345
|
var signCosmosTransaction = async ({
|
|
345
346
|
tx,
|
|
346
347
|
options,
|
|
@@ -438,13 +439,14 @@ var executeCosmosTransaction = async ({
|
|
|
438
439
|
index
|
|
439
440
|
});
|
|
440
441
|
const chainId = tx.cosmosTx?.chainId;
|
|
441
|
-
const txResponse = await
|
|
442
|
+
const txResponse = await submitTransaction({
|
|
442
443
|
chainId,
|
|
443
444
|
tx: rawTxBase64
|
|
444
445
|
});
|
|
445
446
|
return {
|
|
446
447
|
chainId: tx?.cosmosTx?.chainId ?? "",
|
|
447
|
-
txHash: txResponse?.txHash ?? ""
|
|
448
|
+
txHash: txResponse?.txHash ?? "",
|
|
449
|
+
explorerLink: txResponse?.explorerLink ?? ""
|
|
448
450
|
};
|
|
449
451
|
};
|
|
450
452
|
function createAbi(abi) {
|
|
@@ -768,6 +770,14 @@ var signSvmTransaction = async ({
|
|
|
768
770
|
}
|
|
769
771
|
const txBuffer = Buffer.from(svmTx.tx ?? "", "base64");
|
|
770
772
|
const transaction = Transaction.from(txBuffer);
|
|
773
|
+
if (options.svmFeePayer) {
|
|
774
|
+
const message = transaction.serializeMessage();
|
|
775
|
+
const resSignTx = await options.svmFeePayer.signTransaction(message);
|
|
776
|
+
transaction.addSignature(
|
|
777
|
+
new PublicKey(options.svmFeePayer.address),
|
|
778
|
+
Buffer.from(resSignTx)
|
|
779
|
+
);
|
|
780
|
+
}
|
|
771
781
|
if (!("signTransaction" in signer)) return;
|
|
772
782
|
options?.onTransactionSignRequested?.({
|
|
773
783
|
chainId: svmTx.chainId,
|
|
@@ -781,24 +791,23 @@ var signSvmTransaction = async ({
|
|
|
781
791
|
};
|
|
782
792
|
|
|
783
793
|
// src/private-functions/svm/executeSvmTransaction.ts
|
|
784
|
-
var executeSvmTransaction = async (tx, options) => {
|
|
794
|
+
var executeSvmTransaction = async (tx, options, index) => {
|
|
785
795
|
const svmTx = tx?.svmTx;
|
|
786
796
|
if (!svmTx?.chainId) {
|
|
787
797
|
throw new Error("executeSvmTransaction error: chainId not found in svmTx");
|
|
788
798
|
}
|
|
789
|
-
const signedTx = await signSvmTransaction({ tx, options });
|
|
799
|
+
const signedTx = await signSvmTransaction({ tx, options, index });
|
|
790
800
|
if (!signedTx) {
|
|
791
801
|
throw new Error("executeSvmTransaction error: signedTx is undefined");
|
|
792
802
|
}
|
|
793
803
|
const endpoint = await getRpcEndpointForChain(svmTx.chainId);
|
|
794
804
|
const connection = new Connection(endpoint);
|
|
795
805
|
let signature;
|
|
796
|
-
await submitTransaction({
|
|
806
|
+
const submitTxResponse = await submitTransaction({
|
|
797
807
|
chainId: svmTx.chainId,
|
|
798
808
|
tx: signedTx.toString("base64")
|
|
799
|
-
}).then((res) => {
|
|
800
|
-
signature = res?.txHash;
|
|
801
809
|
});
|
|
810
|
+
signature = submitTxResponse?.txHash;
|
|
802
811
|
const rpcSig = await connection.sendRawTransaction(signedTx, {
|
|
803
812
|
preflightCommitment: "confirmed",
|
|
804
813
|
maxRetries: 5
|
|
@@ -817,7 +826,8 @@ var executeSvmTransaction = async (tx, options) => {
|
|
|
817
826
|
if (status?.value?.confirmationStatus === "confirmed") {
|
|
818
827
|
return {
|
|
819
828
|
chainId: svmTx.chainId,
|
|
820
|
-
txHash: signature
|
|
829
|
+
txHash: signature,
|
|
830
|
+
explorerLink: submitTxResponse?.explorerLink ?? ""
|
|
821
831
|
};
|
|
822
832
|
}
|
|
823
833
|
if (getStatusCount > 12) {
|
|
@@ -1008,9 +1018,19 @@ var validateEvmGasBalance = async ({
|
|
|
1008
1018
|
}
|
|
1009
1019
|
};
|
|
1010
1020
|
var validateSvmGasBalance = async ({
|
|
1011
|
-
tx
|
|
1021
|
+
tx,
|
|
1022
|
+
simulate
|
|
1012
1023
|
}) => {
|
|
1013
1024
|
if (!tx) throw new Error("Transaction is required");
|
|
1025
|
+
if (simulate === false) {
|
|
1026
|
+
return {
|
|
1027
|
+
success: true,
|
|
1028
|
+
logs: [],
|
|
1029
|
+
error: null,
|
|
1030
|
+
asset: null,
|
|
1031
|
+
fee: null
|
|
1032
|
+
};
|
|
1033
|
+
}
|
|
1014
1034
|
const endpoint = await getRpcEndpointForChain(tx.chainId ?? "");
|
|
1015
1035
|
const connection = new Connection(endpoint);
|
|
1016
1036
|
if (!connection) throw new Error(`Failed to connect to ${tx.chainId}`);
|
|
@@ -1144,7 +1164,8 @@ var validateGasBalances = async ({
|
|
|
1144
1164
|
});
|
|
1145
1165
|
try {
|
|
1146
1166
|
const res = await validateSvmGasBalance({
|
|
1147
|
-
tx: tx.svmTx
|
|
1167
|
+
tx: tx.svmTx,
|
|
1168
|
+
simulate
|
|
1148
1169
|
});
|
|
1149
1170
|
return res;
|
|
1150
1171
|
} catch (e) {
|
|
@@ -1286,13 +1307,14 @@ var executeTransactions = async (options) => {
|
|
|
1286
1307
|
let txResult;
|
|
1287
1308
|
const txSigned = signedTxs.find((item) => item.index === i);
|
|
1288
1309
|
if (txSigned) {
|
|
1289
|
-
const txResponse = await
|
|
1310
|
+
const txResponse = await submitTransaction({
|
|
1290
1311
|
chainId: txSigned.chainId,
|
|
1291
1312
|
tx: txSigned.tx
|
|
1292
1313
|
});
|
|
1293
1314
|
txResult = {
|
|
1294
1315
|
chainId: txSigned.chainId,
|
|
1295
|
-
txHash: txResponse?.txHash ?? ""
|
|
1316
|
+
txHash: txResponse?.txHash ?? "",
|
|
1317
|
+
explorerLink: txResponse?.explorerLink ?? ""
|
|
1296
1318
|
};
|
|
1297
1319
|
} else {
|
|
1298
1320
|
if ("cosmosTx" in tx) {
|
|
@@ -1311,7 +1333,7 @@ var executeTransactions = async (options) => {
|
|
|
1311
1333
|
};
|
|
1312
1334
|
} else if ("svmTx" in tx) {
|
|
1313
1335
|
await validateEnabledChainIds(tx.svmTx?.chainId ?? "");
|
|
1314
|
-
txResult = await executeSvmTransaction(tx, options);
|
|
1336
|
+
txResult = await executeSvmTransaction(tx, options, i);
|
|
1315
1337
|
} else {
|
|
1316
1338
|
throw new Error("executeRoute error: invalid message type");
|
|
1317
1339
|
}
|
|
@@ -1384,7 +1406,8 @@ var executeRoute = async (options) => {
|
|
|
1384
1406
|
addressList,
|
|
1385
1407
|
slippageTolerancePercent: options.slippageTolerancePercent || "1",
|
|
1386
1408
|
chainIdsToAffiliates: ApiState.chainIdsToAffiliates,
|
|
1387
|
-
postRouteHandler: options.postRouteHandler
|
|
1409
|
+
postRouteHandler: options.postRouteHandler,
|
|
1410
|
+
feePayerAddress: options.svmFeePayer?.address
|
|
1388
1411
|
});
|
|
1389
1412
|
if (beforeMsg && (response?.txs?.length ?? 0) > 0) {
|
|
1390
1413
|
const firstTx = response?.txs?.[0];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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, isSet, Long, Timestamp, toTimestamp, Period, fromTimestamp, fromJsonTimestamp, padDecimal } from './chunk-TD63P2AG.js';
|
|
2
|
-
import { ClientState } from './chunk-
|
|
3
|
-
import { ApiState, createRequestClient } from './chunk-
|
|
2
|
+
import { ClientState } from './chunk-2L7PKZDY.js';
|
|
3
|
+
import { ApiState, createRequestClient } from './chunk-LZI7A4JI.js';
|
|
4
4
|
import { AminoTypes, createDefaultAminoConverters, defaultRegistryTypes } from '@cosmjs/stargate';
|
|
5
5
|
import { createWasmAminoConverters } from '@cosmjs/cosmwasm-stargate';
|
|
6
6
|
import { Registry } from '@cosmjs/proto-signing';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DEFAULT_GAS_DENOM_OVERRIDES } from './chunk-SWYON2RG.js';
|
|
2
2
|
import { chains } from './chunk-43P4WRGN.js';
|
|
3
|
-
import { ClientState } from './chunk-
|
|
3
|
+
import { ClientState } from './chunk-2L7PKZDY.js';
|
|
4
4
|
|
|
5
5
|
// src/private-functions/getDefaultGasTokenForChain.ts
|
|
6
6
|
var getDefaultGasTokenForChain = async (chainId) => {
|
|
@@ -3,7 +3,7 @@ import { OfflineDirectSigner } from '@cosmjs/proto-signing';
|
|
|
3
3
|
import { StdFee, GasPrice, SignerData } from '@cosmjs/stargate';
|
|
4
4
|
import { WalletClient } from 'viem';
|
|
5
5
|
import { Adapter } from '@solana/wallet-adapter-base';
|
|
6
|
-
import { a3 as FeeAsset, L as ChainType, W as CosmosMsg } from './swaggerTypes-
|
|
6
|
+
import { a3 as FeeAsset, L as ChainType, W as CosmosMsg } from './swaggerTypes-DDwqIjap.js';
|
|
7
7
|
|
|
8
8
|
/** Common Types */
|
|
9
9
|
type UserAddress = {
|
|
@@ -55,6 +55,7 @@ type SignCosmosMessageAminoOptions = SignCosmosMessageOptionsBase & {
|
|
|
55
55
|
type TxResult = {
|
|
56
56
|
txHash: string;
|
|
57
57
|
chainId: string;
|
|
58
|
+
explorerLink?: string;
|
|
58
59
|
};
|
|
59
60
|
|
|
60
61
|
export type { 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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { bx as Api } from './swaggerTypes-DDwqIjap.js';
|
|
2
2
|
|
|
3
3
|
type CamelKey<S extends string> = S extends `${infer T}_${infer U}` ? `${T}${Capitalize<CamelKey<U>>}` : S;
|
|
4
4
|
type Camel<T> = T extends (infer U)[] ? Camel<U>[] : T extends object ? {
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { A as AcknowledgementErrorDetails, a as Affiliate,
|
|
2
|
-
export { T as TransactionCallbacks } from './callbacks-
|
|
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-
|
|
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 { T as TransactionCallbacks } from './callbacks-CuL50GnB.js';
|
|
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-B7Fin0mq.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';
|
|
@@ -13,12 +13,12 @@ export { recommendAssets } from './api/postRecommendAssets.js';
|
|
|
13
13
|
export { assetsFromSource } from './api/postAssetsFromSource.js';
|
|
14
14
|
export { BalanceRequest, BalanceResponse, balances } from './api/postBalances.js';
|
|
15
15
|
export { RouteRequest, route } from './api/postRoute.js';
|
|
16
|
-
export { submitTransaction } from './api/postSubmitTransaction.js';
|
|
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
19
|
export { ExecuteRouteOptions, executeRoute } from './public-functions/executeRoute.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-BTRwCbmt.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,14 +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
|
-
export { SubmitRequest, SubmitResponse, submit } from './api/postSubmit.js';
|
|
30
29
|
import '@cosmjs/amino';
|
|
31
30
|
import '@cosmjs/proto-signing';
|
|
32
31
|
import '@cosmjs/stargate';
|
|
33
32
|
import 'viem';
|
|
34
33
|
import '@solana/wallet-adapter-base';
|
|
35
34
|
import './apiState-DwZhwVul.js';
|
|
36
|
-
import './generateApi-
|
|
35
|
+
import './generateApi-C_xgtxrO.js';
|
|
37
36
|
|
|
38
37
|
interface AcknowledgementErrorDetailsJson {
|
|
39
38
|
/** Error code */
|