@skip-go/client 1.6.0-alpha.4 → 1.6.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/{chunk-6T4SBY5H.cjs → chunk-3NPG3IJC.cjs} +8 -8
- package/dist/cjs/{chunk-OVKHTOBP.cjs → chunk-4BCG2K6O.cjs} +4 -4
- package/dist/cjs/{chunk-TELXDMYL.cjs → chunk-77NJD7SH.cjs} +6 -6
- package/dist/cjs/{chunk-EAZQ2ECA.cjs → chunk-7VBQWNW6.cjs} +10 -73
- package/dist/cjs/{chunk-IUMMXFGP.cjs → chunk-ERKGQBNL.cjs} +2 -2
- package/dist/cjs/{chunk-3KO2DHFX.cjs → chunk-KGK6P2R2.cjs} +53 -33
- package/dist/cjs/{chunk-4ZIVDKQN.cjs → chunk-PPDPKCRT.cjs} +3 -3
- package/dist/cjs/{chunk-A3UNNRKD.cjs → chunk-X2ASEG4P.cjs} +5 -0
- package/dist/cjs/{chunk-CIZTNJ3K.cjs → chunk-ZOZQTMOC.cjs} +2 -2
- package/dist/cjs/index.cjs +19 -19
- package/dist/cjs/public-functions/executeMultipleRoutes.cjs +7 -7
- package/dist/cjs/public-functions/executeRoute.cjs +7 -7
- package/dist/cjs/public-functions/getFeeInfoForChain.cjs +3 -3
- package/dist/cjs/public-functions/getRecommendedGasPrice.cjs +4 -4
- package/dist/cjs/public-functions/getRouteWithGasOnReceive.cjs +9 -9
- package/dist/cjs/public-functions/getSigningStargateClient.cjs +3 -3
- package/dist/cjs/public-functions/subscribeToRouteStatus.cjs +5 -5
- package/dist/cjs/public-functions/validateCosmosGasBalance.cjs +4 -4
- package/dist/esm/api/getAssets.d.ts +1 -1
- package/dist/esm/api/getAssetsBetweenChains.d.ts +1 -1
- package/dist/esm/api/getBridges.d.ts +1 -1
- package/dist/esm/api/getChains.d.ts +1 -1
- package/dist/esm/api/postAssetsFromSource.d.ts +1 -1
- package/dist/esm/api/postBalances.d.ts +2 -2
- package/dist/esm/api/postMessages.d.ts +2 -2
- package/dist/esm/api/postMessagesDirect.d.ts +1 -1
- package/dist/esm/api/postRecommendAssets.d.ts +1 -1
- package/dist/esm/api/postRoute.d.ts +2 -2
- package/dist/esm/api/postSubmitTransaction.d.ts +2 -2
- package/dist/esm/api/postTrackTransaction.d.ts +2 -2
- package/dist/esm/api/postTransactionStatus.d.ts +40 -2
- package/dist/esm/{callbacks-DdC6QMlE.d.ts → callbacks-Dpy_Kgln.d.ts} +4 -3
- package/dist/esm/{chunk-BU5RCZQH.js → chunk-CRKF5WSW.js} +1 -1
- package/dist/esm/{chunk-CGJRRAFS.js → chunk-FILH5L5T.js} +1 -1
- package/dist/esm/{chunk-5WYMRZIO.js → chunk-J2UCWYYM.js} +1 -1
- package/dist/esm/{chunk-3DIX6KRJ.js → chunk-QCGHODGV.js} +5 -0
- package/dist/esm/{chunk-DMJMN4J3.js → chunk-QMW5AP42.js} +1 -1
- package/dist/esm/{chunk-IZUHXTBP.js → chunk-R2AIIQDV.js} +2 -2
- package/dist/esm/{chunk-XIVAEU6S.js → chunk-W4ZLRWOX.js} +31 -11
- package/dist/esm/{chunk-G665WTT3.js → chunk-YLO3LH4B.js} +2 -2
- package/dist/esm/{chunk-NUHMTWHP.js → chunk-YPMWO6P2.js} +10 -73
- package/dist/esm/{client-types-D03Tellv.d.ts → client-types-B5U1JCIL.d.ts} +1 -1
- package/dist/esm/{generateApi-Bv02Xt5y.d.ts → generateApi-BcCeQt_X.d.ts} +1 -1
- package/dist/esm/index.d.ts +5 -5
- package/dist/esm/index.js +9 -9
- package/dist/esm/public-functions/executeMultipleRoutes.d.ts +4 -4
- package/dist/esm/public-functions/executeMultipleRoutes.js +6 -6
- package/dist/esm/public-functions/executeRoute.d.ts +4 -4
- package/dist/esm/public-functions/executeRoute.js +6 -6
- package/dist/esm/public-functions/getCosmosGasAmountForMessage.d.ts +1 -1
- package/dist/esm/public-functions/getEvmGasAmountForMessage.d.ts +3 -3
- package/dist/esm/public-functions/getFeeInfoForChain.d.ts +1 -1
- package/dist/esm/public-functions/getFeeInfoForChain.js +2 -2
- package/dist/esm/public-functions/getRecommendedGasPrice.js +3 -3
- package/dist/esm/public-functions/getRouteWithGasOnReceive.d.ts +1 -1
- package/dist/esm/public-functions/getRouteWithGasOnReceive.js +9 -9
- package/dist/esm/public-functions/getSigningStargateClient.js +2 -2
- package/dist/esm/public-functions/setApiOptions.d.ts +1 -1
- package/dist/esm/public-functions/setClientOptions.d.ts +4 -4
- package/dist/esm/public-functions/subscribeToRouteStatus.d.ts +4 -4
- package/dist/esm/public-functions/subscribeToRouteStatus.js +1 -1
- package/dist/esm/public-functions/validateCosmosGasBalance.d.ts +4 -4
- package/dist/esm/public-functions/validateCosmosGasBalance.js +3 -3
- package/dist/esm/public-functions/waitForTransaction.d.ts +80 -4
- package/dist/esm/{setClientOptions-CTwe8YVX.d.ts → setClientOptions-D1FsRXBJ.d.ts} +3 -3
- package/dist/esm/{swaggerTypes-CzGbnX_b.d.ts → swaggerTypes-BCOa1382.d.ts} +2 -0
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as SkipApiOptions } from '../apiState-1VvikVK-.js';
|
|
2
|
-
import { bI as ContentType, B as BridgeType } from '../swaggerTypes-
|
|
2
|
+
import { bI as ContentType, B as BridgeType } from '../swaggerTypes-BCOa1382.js';
|
|
3
3
|
|
|
4
4
|
declare const bridges: (options?: ({
|
|
5
5
|
cache?: RequestCache | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as SkipApiOptions } from '../apiState-1VvikVK-.js';
|
|
2
|
-
import { d as Reason, m as Asset } from '../swaggerTypes-
|
|
2
|
+
import { d as Reason, m as Asset } from '../swaggerTypes-BCOa1382.js';
|
|
3
3
|
|
|
4
4
|
declare const assetsFromSource: (options?: ({
|
|
5
5
|
sourceAssetDenom: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { S as SkipApiOptions } from '../apiState-1VvikVK-.js';
|
|
2
|
-
import { A as ApiRequest, a as ApiResponse } from '../generateApi-
|
|
3
|
-
import '../swaggerTypes-
|
|
2
|
+
import { A as ApiRequest, a as ApiResponse } from '../generateApi-BcCeQt_X.js';
|
|
3
|
+
import '../swaggerTypes-BCOa1382.js';
|
|
4
4
|
|
|
5
5
|
declare const balances: (options?: ({
|
|
6
6
|
chains?: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { a as FeeType, B as BridgeType, F as FeeBehavior } from '../swaggerTypes-
|
|
1
|
+
import { a as FeeType, B as BridgeType, F as FeeBehavior } from '../swaggerTypes-BCOa1382.js';
|
|
2
2
|
import { S as SkipApiOptions } from '../apiState-1VvikVK-.js';
|
|
3
|
-
import { A as ApiRequest, a as ApiResponse } from '../generateApi-
|
|
3
|
+
import { A as ApiRequest, a as ApiResponse } from '../generateApi-BcCeQt_X.js';
|
|
4
4
|
|
|
5
5
|
declare const messages: (request: MessagesRequest) => Promise<{
|
|
6
6
|
msgs?: ({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { S as SkipApiOptions } from '../apiState-1VvikVK-.js';
|
|
2
|
-
import { i as AutopilotAction, B as BridgeType, R as RoutePriceWarningType, a as FeeType, F as FeeBehavior } from '../swaggerTypes-
|
|
2
|
+
import { i as AutopilotAction, B as BridgeType, R as RoutePriceWarningType, a as FeeType, F as FeeBehavior } from '../swaggerTypes-BCOa1382.js';
|
|
3
3
|
|
|
4
4
|
declare const messagesDirect: (options?: ({
|
|
5
5
|
sourceAssetDenom?: string | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { B as BridgeType, R as RoutePriceWarningType, a as FeeType, F as FeeBehavior } from '../swaggerTypes-
|
|
1
|
+
import { B as BridgeType, R as RoutePriceWarningType, a as FeeType, F as FeeBehavior } from '../swaggerTypes-BCOa1382.js';
|
|
2
2
|
import { S as SkipApiOptions } from '../apiState-1VvikVK-.js';
|
|
3
|
-
import { A as ApiRequest } from '../generateApi-
|
|
3
|
+
import { A as ApiRequest } from '../generateApi-BcCeQt_X.js';
|
|
4
4
|
|
|
5
5
|
declare const route: (request: RouteRequest) => Promise<{
|
|
6
6
|
amountIn: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { S as SkipApiOptions } from '../apiState-1VvikVK-.js';
|
|
2
|
-
import { A as ApiRequest, a as ApiResponse } from '../generateApi-
|
|
3
|
-
import '../swaggerTypes-
|
|
2
|
+
import { A as ApiRequest, a as ApiResponse } from '../generateApi-BcCeQt_X.js';
|
|
3
|
+
import '../swaggerTypes-BCOa1382.js';
|
|
4
4
|
|
|
5
5
|
declare const submitTransaction: (options?: ({
|
|
6
6
|
tx?: string | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { S as SkipApiOptions } from '../apiState-1VvikVK-.js';
|
|
2
|
-
import { A as ApiRequest, P as PollingProps } from '../generateApi-
|
|
3
|
-
import '../swaggerTypes-
|
|
2
|
+
import { A as ApiRequest, P as PollingProps } from '../generateApi-BcCeQt_X.js';
|
|
3
|
+
import '../swaggerTypes-BCOa1382.js';
|
|
4
4
|
|
|
5
5
|
type TrackTxRequest = ApiRequest<"status"> & TrackTxPollingProps & SkipApiOptions;
|
|
6
6
|
type TrackTxPollingProps = Omit<PollingProps<"status">, "isSuccess" | "onError" | "onSuccess">;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { b as TransactionState, P as PacketErrorType, T as TransferState, h as AxelarTransferState, C as ContractCallWithTokenErrorType, c as SendTokenErrorType, A as AxelarTransferType, g as CCTPTransferState, H as HyperlaneTransferState, O as OPInitTransferState, f as StargateTransferState, G as GoFastTransferState, L as LayerZeroTransferState, S as StatusErrorType } from '../swaggerTypes-
|
|
2
|
-
import { a as ApiResponse } from '../generateApi-
|
|
1
|
+
import { b as TransactionState, P as PacketErrorType, T as TransferState, h as AxelarTransferState, C as ContractCallWithTokenErrorType, c as SendTokenErrorType, A as AxelarTransferType, g as CCTPTransferState, H as HyperlaneTransferState, O as OPInitTransferState, f as StargateTransferState, G as GoFastTransferState, L as LayerZeroTransferState, S as StatusErrorType } from '../swaggerTypes-BCOa1382.js';
|
|
2
|
+
import { a as ApiResponse } from '../generateApi-BcCeQt_X.js';
|
|
3
3
|
import { S as SkipApiOptions } from '../apiState-1VvikVK-.js';
|
|
4
4
|
|
|
5
5
|
declare const transactionStatus: (params?: ({
|
|
@@ -137,6 +137,25 @@ declare const transactionStatus: (params?: ({
|
|
|
137
137
|
} | undefined;
|
|
138
138
|
} | undefined;
|
|
139
139
|
} | undefined;
|
|
140
|
+
cctpTransferV2?: {
|
|
141
|
+
toChainId?: string | undefined;
|
|
142
|
+
fromChainId?: string | undefined;
|
|
143
|
+
state?: CCTPTransferState | undefined;
|
|
144
|
+
txs?: {
|
|
145
|
+
sendTx?: {
|
|
146
|
+
chainId?: string | undefined;
|
|
147
|
+
explorerLink: string;
|
|
148
|
+
txHash?: string | undefined;
|
|
149
|
+
onChainAt?: string | undefined;
|
|
150
|
+
} | undefined;
|
|
151
|
+
receiveTx?: {
|
|
152
|
+
chainId?: string | undefined;
|
|
153
|
+
explorerLink: string;
|
|
154
|
+
txHash?: string | undefined;
|
|
155
|
+
onChainAt?: string | undefined;
|
|
156
|
+
} | undefined;
|
|
157
|
+
} | undefined;
|
|
158
|
+
} | undefined;
|
|
140
159
|
hyperlaneTransfer?: {
|
|
141
160
|
fromChainId: string;
|
|
142
161
|
toChainId: string;
|
|
@@ -466,6 +485,25 @@ declare const transactionStatus: (params?: ({
|
|
|
466
485
|
} | undefined;
|
|
467
486
|
} | undefined;
|
|
468
487
|
} | undefined;
|
|
488
|
+
cctpTransferV2?: {
|
|
489
|
+
toChainId?: string | undefined;
|
|
490
|
+
fromChainId?: string | undefined;
|
|
491
|
+
state?: CCTPTransferState | undefined;
|
|
492
|
+
txs?: {
|
|
493
|
+
sendTx?: {
|
|
494
|
+
chainId?: string | undefined;
|
|
495
|
+
explorerLink: string;
|
|
496
|
+
txHash?: string | undefined;
|
|
497
|
+
onChainAt?: string | undefined;
|
|
498
|
+
} | undefined;
|
|
499
|
+
receiveTx?: {
|
|
500
|
+
chainId?: string | undefined;
|
|
501
|
+
explorerLink: string;
|
|
502
|
+
txHash?: string | undefined;
|
|
503
|
+
onChainAt?: string | undefined;
|
|
504
|
+
} | undefined;
|
|
505
|
+
} | undefined;
|
|
506
|
+
} | undefined;
|
|
469
507
|
hyperlaneTransfer?: {
|
|
470
508
|
fromChainId: string;
|
|
471
509
|
toChainId: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TxStatusResponse } from './api/postTransactionStatus.js';
|
|
2
|
-
import { T as TransferState, h as AxelarTransferState, g as CCTPTransferState, H as HyperlaneTransferState, O as OPInitTransferState, G as GoFastTransferState, f as StargateTransferState, L as LayerZeroTransferState, b as TransactionState, bs as RouteResponse, a8 as CosmosMsg, az as PostHandler, aA as Route, aX as TransferAssetRelease, aY as TransferStatus, a5 as Erc20Approval } from './swaggerTypes-
|
|
3
|
-
import { A as ApiRequest } from './generateApi-
|
|
4
|
-
import { S as SignerGetters, b as GasOptions, B as BaseSettings, U as UserAddress, T as TxResult } from './client-types-
|
|
2
|
+
import { T as TransferState, h as AxelarTransferState, g as CCTPTransferState, H as HyperlaneTransferState, O as OPInitTransferState, G as GoFastTransferState, f as StargateTransferState, L as LayerZeroTransferState, b as TransactionState, bs as RouteResponse, a8 as CosmosMsg, az as PostHandler, aA as Route, aX as TransferAssetRelease, aY as TransferStatus, a5 as Erc20Approval } from './swaggerTypes-BCOa1382.js';
|
|
3
|
+
import { A as ApiRequest } from './generateApi-BcCeQt_X.js';
|
|
4
|
+
import { S as SignerGetters, b as GasOptions, B as BaseSettings, U as UserAddress, T as TxResult } from './client-types-B5U1JCIL.js';
|
|
5
5
|
|
|
6
6
|
type OverallStatus = "pending" | "success" | "failed";
|
|
7
7
|
declare function getTransferEventsFromTxStatusResponse(txStatusResponse?: TxStatusResponse[]): {
|
|
@@ -22,6 +22,7 @@ declare enum TransferType {
|
|
|
22
22
|
ibcTransfer = "ibcTransfer",
|
|
23
23
|
axelarTransfer = "axelarTransfer",
|
|
24
24
|
cctpTransfer = "cctpTransfer",
|
|
25
|
+
cctpTransferV2 = "cctpTransferV2",
|
|
25
26
|
hyperlaneTransfer = "hyperlaneTransfer",
|
|
26
27
|
opInitTransfer = "opInitTransfer",
|
|
27
28
|
goFastTransfer = "goFastTransfer",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { getCosmosGasAmountForMessage } from './chunk-GPEO2I4P.js';
|
|
2
|
-
import { getSigningStargateClient } from './chunk-
|
|
2
|
+
import { getSigningStargateClient } from './chunk-QMW5AP42.js';
|
|
3
3
|
import { ClientState, balances } from './chunk-J24LYWJE.js';
|
|
4
4
|
import { BigNumber } from 'bignumber.js';
|
|
5
5
|
import { GasPrice, calculateFee } from '@cosmjs/stargate';
|
|
@@ -9,6 +9,7 @@ function getClientTransferEvent(transferEvent) {
|
|
|
9
9
|
const axelarTransfer = combinedTransferEvent?.axelarTransfer;
|
|
10
10
|
const ibcTransfer = combinedTransferEvent?.ibcTransfer;
|
|
11
11
|
const cctpTransfer = combinedTransferEvent?.cctpTransfer;
|
|
12
|
+
const cctpTransferV2 = combinedTransferEvent?.cctpTransferV2;
|
|
12
13
|
const hyperlaneTransfer = combinedTransferEvent?.hyperlaneTransfer;
|
|
13
14
|
const opInitTransfer = combinedTransferEvent?.opInitTransfer;
|
|
14
15
|
const goFastTransfer = combinedTransferEvent?.goFastTransfer;
|
|
@@ -22,6 +23,8 @@ function getClientTransferEvent(transferEvent) {
|
|
|
22
23
|
transferType = "ibcTransfer" /* ibcTransfer */;
|
|
23
24
|
} else if (cctpTransfer) {
|
|
24
25
|
transferType = "cctpTransfer" /* cctpTransfer */;
|
|
26
|
+
} else if (cctpTransferV2) {
|
|
27
|
+
transferType = "cctpTransferV2" /* cctpTransferV2 */;
|
|
25
28
|
} else if (hyperlaneTransfer) {
|
|
26
29
|
transferType = "hyperlaneTransfer" /* hyperlaneTransfer */;
|
|
27
30
|
} else if (opInitTransfer) {
|
|
@@ -137,6 +140,7 @@ function getClientTransferEvent(transferEvent) {
|
|
|
137
140
|
...ibcTransfer,
|
|
138
141
|
...axelarTransfer,
|
|
139
142
|
...cctpTransfer,
|
|
143
|
+
...cctpTransferV2,
|
|
140
144
|
...hyperlaneTransfer,
|
|
141
145
|
...stargateTransfer,
|
|
142
146
|
...hyperlaneTransfer,
|
|
@@ -213,6 +217,7 @@ var TransferType = /* @__PURE__ */ ((TransferType2) => {
|
|
|
213
217
|
TransferType2["ibcTransfer"] = "ibcTransfer";
|
|
214
218
|
TransferType2["axelarTransfer"] = "axelarTransfer";
|
|
215
219
|
TransferType2["cctpTransfer"] = "cctpTransfer";
|
|
220
|
+
TransferType2["cctpTransferV2"] = "cctpTransferV2";
|
|
216
221
|
TransferType2["hyperlaneTransfer"] = "hyperlaneTransfer";
|
|
217
222
|
TransferType2["opInitTransfer"] = "opInitTransfer";
|
|
218
223
|
TransferType2["goFastTransfer"] = "goFastTransfer";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BaseAccount as BaseAccount$1, base64FromBytes, bytesFromBase64, isSet } from './chunk-RTDD7HZ3.js';
|
|
2
|
-
import { chains, findFirstWorkingEndpoint } from './chunk-
|
|
2
|
+
import { chains, findFirstWorkingEndpoint } from './chunk-YPMWO6P2.js';
|
|
3
3
|
import { ClientState } from './chunk-J24LYWJE.js';
|
|
4
4
|
import { accountFromAny, SigningStargateClient } from '@cosmjs/stargate';
|
|
5
5
|
import { assertDefinedAndNotNull } from '@cosmjs/utils';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createValidAddressList, executeTransactions } from './chunk-
|
|
2
|
-
import { updateRouteDetails, executeAndSubscribeToRouteStatus } from './chunk-
|
|
1
|
+
import { createValidAddressList, executeTransactions } from './chunk-W4ZLRWOX.js';
|
|
2
|
+
import { updateRouteDetails, executeAndSubscribeToRouteStatus } from './chunk-QCGHODGV.js';
|
|
3
3
|
import { messages } from './chunk-P36PE4CR.js';
|
|
4
4
|
import { ApiState } from './chunk-F66EKL3W.js';
|
|
5
5
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { updateRouteDetails } from './chunk-
|
|
2
|
-
import { validateCosmosGasBalance } from './chunk-
|
|
1
|
+
import { updateRouteDetails } from './chunk-QCGHODGV.js';
|
|
2
|
+
import { validateCosmosGasBalance } from './chunk-CRKF5WSW.js';
|
|
3
3
|
import { getEncodeObjectFromCosmosMessage } from './chunk-GPEO2I4P.js';
|
|
4
4
|
import { getEVMGasAmountForMessage } from './chunk-GV2QOWB4.js';
|
|
5
|
-
import { getRpcEndpointForChain, accountParser, getSigningStargateClient } from './chunk-
|
|
6
|
-
import { chains, findFirstWorkingEndpoint, getIsEthermint, getIsInitia } from './chunk-
|
|
5
|
+
import { getRpcEndpointForChain, accountParser, getSigningStargateClient } from './chunk-QMW5AP42.js';
|
|
6
|
+
import { chains, findFirstWorkingEndpoint, getIsEthermint, getIsInitia } from './chunk-YPMWO6P2.js';
|
|
7
7
|
import { submitTransaction } from './chunk-ETBJVFQP.js';
|
|
8
8
|
import { venues } from './chunk-A5NZMSTI.js';
|
|
9
9
|
import { ClientState, balances } from './chunk-J24LYWJE.js';
|
|
@@ -18,7 +18,7 @@ import { Any } from 'cosmjs-types/google/protobuf/any.js';
|
|
|
18
18
|
import { Int53 } from '@cosmjs/math';
|
|
19
19
|
import { SignMode } from 'cosmjs-types/cosmos/tx/signing/v1beta1/signing.js';
|
|
20
20
|
import { isAddress, publicActions, maxUint256, formatUnits } from 'viem';
|
|
21
|
-
import {
|
|
21
|
+
import { PublicKey, Connection, VersionedTransaction, Transaction, LAMPORTS_PER_SOL } from '@solana/web3.js';
|
|
22
22
|
import { BigNumber } from 'bignumber.js';
|
|
23
23
|
import { bech32m, bech32 } from 'bech32';
|
|
24
24
|
|
|
@@ -686,6 +686,24 @@ var executeEvmTransaction = async (message, options, index, routeId) => {
|
|
|
686
686
|
});
|
|
687
687
|
return receipt;
|
|
688
688
|
};
|
|
689
|
+
function deserializeSvmTransaction(txBuffer) {
|
|
690
|
+
const probe = VersionedTransaction.deserialize(txBuffer);
|
|
691
|
+
if (probe.version === "legacy") {
|
|
692
|
+
return Transaction.from(txBuffer);
|
|
693
|
+
}
|
|
694
|
+
return probe;
|
|
695
|
+
}
|
|
696
|
+
function isVersionedTransaction(tx) {
|
|
697
|
+
return "version" in tx;
|
|
698
|
+
}
|
|
699
|
+
function serializeSvmMessage(tx) {
|
|
700
|
+
return isVersionedTransaction(tx) ? tx.message.serialize() : tx.serializeMessage();
|
|
701
|
+
}
|
|
702
|
+
function simulateSvmTransaction(connection, tx) {
|
|
703
|
+
return isVersionedTransaction(tx) ? connection.simulateTransaction(tx) : connection.simulateTransaction(tx);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// src/private-functions/svm/signSvmTransaction.ts
|
|
689
707
|
var signSvmTransaction = async ({
|
|
690
708
|
tx,
|
|
691
709
|
options,
|
|
@@ -714,10 +732,12 @@ var signSvmTransaction = async ({
|
|
|
714
732
|
throw new Error("executeSvmTransaction error: chainId not found in svmTx");
|
|
715
733
|
}
|
|
716
734
|
const txBuffer = Buffer.from(svmTx.tx ?? "", "base64");
|
|
717
|
-
const transaction =
|
|
735
|
+
const transaction = deserializeSvmTransaction(txBuffer);
|
|
718
736
|
if (options.svmFeePayer) {
|
|
719
|
-
const message = transaction
|
|
720
|
-
const resSignTx = await options.svmFeePayer.signTransaction(
|
|
737
|
+
const message = serializeSvmMessage(transaction);
|
|
738
|
+
const resSignTx = await options.svmFeePayer.signTransaction(
|
|
739
|
+
Buffer.from(message)
|
|
740
|
+
);
|
|
721
741
|
transaction.addSignature(
|
|
722
742
|
new PublicKey(options.svmFeePayer.address),
|
|
723
743
|
Buffer.from(resSignTx)
|
|
@@ -741,7 +761,7 @@ var signSvmTransaction = async ({
|
|
|
741
761
|
routeId,
|
|
742
762
|
options
|
|
743
763
|
});
|
|
744
|
-
const serializedTx = signedTx.serialize();
|
|
764
|
+
const serializedTx = Buffer.from(signedTx.serialize());
|
|
745
765
|
return serializedTx;
|
|
746
766
|
};
|
|
747
767
|
|
|
@@ -1017,7 +1037,7 @@ var validateSvmGasBalance = async ({
|
|
|
1017
1037
|
const txBuffer = Buffer.from(tx.tx, "base64");
|
|
1018
1038
|
let transaction;
|
|
1019
1039
|
try {
|
|
1020
|
-
transaction =
|
|
1040
|
+
transaction = deserializeSvmTransaction(txBuffer);
|
|
1021
1041
|
} catch (decodeError) {
|
|
1022
1042
|
return {
|
|
1023
1043
|
success: false,
|
|
@@ -1026,7 +1046,7 @@ var validateSvmGasBalance = async ({
|
|
|
1026
1046
|
fee: null
|
|
1027
1047
|
};
|
|
1028
1048
|
}
|
|
1029
|
-
const simulation = await connection
|
|
1049
|
+
const simulation = await simulateSvmTransaction(connection, transaction);
|
|
1030
1050
|
if (simulation.value.err) {
|
|
1031
1051
|
const logs = simulation.value.logs ?? [];
|
|
1032
1052
|
const shortfall = getSolShortfall(logs);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { createValidAddressList, executeTransactions } from './chunk-
|
|
2
|
-
import { updateRouteDetails, executeAndSubscribeToRouteStatus } from './chunk-
|
|
1
|
+
import { createValidAddressList, executeTransactions } from './chunk-W4ZLRWOX.js';
|
|
2
|
+
import { updateRouteDetails, executeAndSubscribeToRouteStatus } from './chunk-QCGHODGV.js';
|
|
3
3
|
import { messages } from './chunk-P36PE4CR.js';
|
|
4
4
|
import { trackTransaction } from './chunk-SXBG57J3.js';
|
|
5
5
|
import { ApiState } from './chunk-F66EKL3W.js';
|