@skip-go/client 1.5.17 → 1.5.18
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-LVK2SUFG.cjs → chunk-LVRHZ5ZL.cjs} +3 -3
- package/dist/cjs/{chunk-Q7TR6RHE.cjs → chunk-NPKUHEGG.cjs} +26 -6
- package/dist/cjs/{chunk-USQLPDZG.cjs → chunk-YLL6U5SG.cjs} +3 -3
- package/dist/cjs/index.cjs +5 -5
- package/dist/cjs/public-functions/executeMultipleRoutes.cjs +3 -3
- package/dist/cjs/public-functions/executeRoute.cjs +3 -3
- package/dist/cjs/public-functions/getRouteWithGasOnReceive.cjs +3 -3
- package/dist/esm/api/getBridges.d.ts +2 -2
- package/dist/esm/{chunk-XUCVKXX3.js → chunk-DFXZ6FIV.js} +1 -1
- package/dist/esm/{chunk-E6IRM5VQ.js → chunk-PQCZ64TO.js} +1 -1
- package/dist/esm/{chunk-5IGYTGG3.js → chunk-RCXA3W7Y.js} +27 -7
- package/dist/esm/index.js +3 -3
- package/dist/esm/public-functions/executeMultipleRoutes.js +2 -2
- package/dist/esm/public-functions/executeRoute.js +2 -2
- package/dist/esm/public-functions/getRouteWithGasOnReceive.js +3 -3
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkNPKUHEGG_cjs = require('./chunk-NPKUHEGG.cjs');
|
|
4
4
|
var chunkX2ASEG4P_cjs = require('./chunk-X2ASEG4P.cjs');
|
|
5
5
|
var chunkNCFH5MGF_cjs = require('./chunk-NCFH5MGF.cjs');
|
|
6
6
|
var chunkAUTOIM57_cjs = require('./chunk-AUTOIM57.cjs');
|
|
@@ -24,7 +24,7 @@ var executeMultipleRoutes = async (options) => {
|
|
|
24
24
|
`executeMultipleRoutes error: no user addresses found for route: ${routeKey}`
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
|
-
const routeAddressList = await
|
|
27
|
+
const routeAddressList = await chunkNPKUHEGG_cjs.createValidAddressList({
|
|
28
28
|
userAddresses: _userAddresses,
|
|
29
29
|
route: routeValue
|
|
30
30
|
});
|
|
@@ -132,7 +132,7 @@ var executeMultipleRoutes = async (options) => {
|
|
|
132
132
|
if (routeKey === "mainRoute") {
|
|
133
133
|
mainRouteId = routeId;
|
|
134
134
|
}
|
|
135
|
-
const { transactionDetails, executeTransaction: _executeTransaction } = await
|
|
135
|
+
const { transactionDetails, executeTransaction: _executeTransaction } = await chunkNPKUHEGG_cjs.executeTransactions({
|
|
136
136
|
...restOptions,
|
|
137
137
|
routeId,
|
|
138
138
|
txs: msgsResponse?.txs,
|
|
@@ -688,6 +688,24 @@ var executeEvmTransaction = async (message, options, index, routeId) => {
|
|
|
688
688
|
});
|
|
689
689
|
return receipt;
|
|
690
690
|
};
|
|
691
|
+
function deserializeSvmTransaction(txBuffer) {
|
|
692
|
+
const probe = web3_js.VersionedTransaction.deserialize(txBuffer);
|
|
693
|
+
if (probe.version === "legacy") {
|
|
694
|
+
return web3_js.Transaction.from(txBuffer);
|
|
695
|
+
}
|
|
696
|
+
return probe;
|
|
697
|
+
}
|
|
698
|
+
function isVersionedTransaction(tx) {
|
|
699
|
+
return "version" in tx;
|
|
700
|
+
}
|
|
701
|
+
function serializeSvmMessage(tx) {
|
|
702
|
+
return isVersionedTransaction(tx) ? tx.message.serialize() : tx.serializeMessage();
|
|
703
|
+
}
|
|
704
|
+
function simulateSvmTransaction(connection, tx) {
|
|
705
|
+
return isVersionedTransaction(tx) ? connection.simulateTransaction(tx) : connection.simulateTransaction(tx);
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
// src/private-functions/svm/signSvmTransaction.ts
|
|
691
709
|
var signSvmTransaction = async ({
|
|
692
710
|
tx,
|
|
693
711
|
options,
|
|
@@ -716,10 +734,12 @@ var signSvmTransaction = async ({
|
|
|
716
734
|
throw new Error("executeSvmTransaction error: chainId not found in svmTx");
|
|
717
735
|
}
|
|
718
736
|
const txBuffer = Buffer.from(svmTx.tx ?? "", "base64");
|
|
719
|
-
const transaction =
|
|
737
|
+
const transaction = deserializeSvmTransaction(txBuffer);
|
|
720
738
|
if (options.svmFeePayer) {
|
|
721
|
-
const message = transaction
|
|
722
|
-
const resSignTx = await options.svmFeePayer.signTransaction(
|
|
739
|
+
const message = serializeSvmMessage(transaction);
|
|
740
|
+
const resSignTx = await options.svmFeePayer.signTransaction(
|
|
741
|
+
Buffer.from(message)
|
|
742
|
+
);
|
|
723
743
|
transaction.addSignature(
|
|
724
744
|
new web3_js.PublicKey(options.svmFeePayer.address),
|
|
725
745
|
Buffer.from(resSignTx)
|
|
@@ -743,7 +763,7 @@ var signSvmTransaction = async ({
|
|
|
743
763
|
routeId,
|
|
744
764
|
options
|
|
745
765
|
});
|
|
746
|
-
const serializedTx = signedTx.serialize();
|
|
766
|
+
const serializedTx = Buffer.from(signedTx.serialize());
|
|
747
767
|
return serializedTx;
|
|
748
768
|
};
|
|
749
769
|
|
|
@@ -1019,7 +1039,7 @@ var validateSvmGasBalance = async ({
|
|
|
1019
1039
|
const txBuffer = Buffer.from(tx.tx, "base64");
|
|
1020
1040
|
let transaction;
|
|
1021
1041
|
try {
|
|
1022
|
-
transaction =
|
|
1042
|
+
transaction = deserializeSvmTransaction(txBuffer);
|
|
1023
1043
|
} catch (decodeError) {
|
|
1024
1044
|
return {
|
|
1025
1045
|
success: false,
|
|
@@ -1028,7 +1048,7 @@ var validateSvmGasBalance = async ({
|
|
|
1028
1048
|
fee: null
|
|
1029
1049
|
};
|
|
1030
1050
|
}
|
|
1031
|
-
const simulation = await connection
|
|
1051
|
+
const simulation = await simulateSvmTransaction(connection, transaction);
|
|
1032
1052
|
if (simulation.value.err) {
|
|
1033
1053
|
const logs = simulation.value.logs ?? [];
|
|
1034
1054
|
const shortfall = getSolShortfall(logs);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkNPKUHEGG_cjs = require('./chunk-NPKUHEGG.cjs');
|
|
4
4
|
var chunkX2ASEG4P_cjs = require('./chunk-X2ASEG4P.cjs');
|
|
5
5
|
var chunkNCFH5MGF_cjs = require('./chunk-NCFH5MGF.cjs');
|
|
6
6
|
var chunk2QPPD3BB_cjs = require('./chunk-2QPPD3BB.cjs');
|
|
@@ -12,7 +12,7 @@ var executeRoute = async (options) => {
|
|
|
12
12
|
status: "unconfirmed",
|
|
13
13
|
options
|
|
14
14
|
});
|
|
15
|
-
const addressList = await
|
|
15
|
+
const addressList = await chunkNPKUHEGG_cjs.createValidAddressList({
|
|
16
16
|
userAddresses,
|
|
17
17
|
route
|
|
18
18
|
});
|
|
@@ -43,7 +43,7 @@ var executeRoute = async (options) => {
|
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
const { transactionDetails, executeTransaction } = await
|
|
46
|
+
const { transactionDetails, executeTransaction } = await chunkNPKUHEGG_cjs.executeTransactions({ ...options, routeId, txs: response?.txs });
|
|
47
47
|
await chunkX2ASEG4P_cjs.executeAndSubscribeToRouteStatus({
|
|
48
48
|
transactionDetails,
|
|
49
49
|
executeTransaction,
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -4,9 +4,9 @@ var chunkSNDRAYA6_cjs = require('./chunk-SNDRAYA6.cjs');
|
|
|
4
4
|
var chunkAVWWCQ5P_cjs = require('./chunk-AVWWCQ5P.cjs');
|
|
5
5
|
var chunkCK6CQWQU_cjs = require('./chunk-CK6CQWQU.cjs');
|
|
6
6
|
var chunk4BWE7SOV_cjs = require('./chunk-4BWE7SOV.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
require('./chunk-
|
|
7
|
+
var chunkLVRHZ5ZL_cjs = require('./chunk-LVRHZ5ZL.cjs');
|
|
8
|
+
var chunkYLL6U5SG_cjs = require('./chunk-YLL6U5SG.cjs');
|
|
9
|
+
require('./chunk-NPKUHEGG.cjs');
|
|
10
10
|
var chunkX2ASEG4P_cjs = require('./chunk-X2ASEG4P.cjs');
|
|
11
11
|
var chunkYX56UXDX_cjs = require('./chunk-YX56UXDX.cjs');
|
|
12
12
|
var chunkTEH6UMUR_cjs = require('./chunk-TEH6UMUR.cjs');
|
|
@@ -141,11 +141,11 @@ Object.defineProperty(exports, "waitForTransactionWithCancel", {
|
|
|
141
141
|
});
|
|
142
142
|
Object.defineProperty(exports, "executeMultipleRoutes", {
|
|
143
143
|
enumerable: true,
|
|
144
|
-
get: function () { return
|
|
144
|
+
get: function () { return chunkLVRHZ5ZL_cjs.executeMultipleRoutes; }
|
|
145
145
|
});
|
|
146
146
|
Object.defineProperty(exports, "executeRoute", {
|
|
147
147
|
enumerable: true,
|
|
148
|
-
get: function () { return
|
|
148
|
+
get: function () { return chunkYLL6U5SG_cjs.executeRoute; }
|
|
149
149
|
});
|
|
150
150
|
Object.defineProperty(exports, "TransferType", {
|
|
151
151
|
enumerable: true,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkLVRHZ5ZL_cjs = require('../chunk-LVRHZ5ZL.cjs');
|
|
4
|
+
require('../chunk-NPKUHEGG.cjs');
|
|
5
5
|
require('../chunk-X2ASEG4P.cjs');
|
|
6
6
|
require('../chunk-YX56UXDX.cjs');
|
|
7
7
|
require('../chunk-TEH6UMUR.cjs');
|
|
@@ -23,5 +23,5 @@ require('../chunk-WOSAJSJB.cjs');
|
|
|
23
23
|
|
|
24
24
|
Object.defineProperty(exports, "executeMultipleRoutes", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkLVRHZ5ZL_cjs.executeMultipleRoutes; }
|
|
27
27
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkYLL6U5SG_cjs = require('../chunk-YLL6U5SG.cjs');
|
|
4
|
+
require('../chunk-NPKUHEGG.cjs');
|
|
5
5
|
require('../chunk-X2ASEG4P.cjs');
|
|
6
6
|
require('../chunk-YX56UXDX.cjs');
|
|
7
7
|
require('../chunk-TEH6UMUR.cjs');
|
|
@@ -23,5 +23,5 @@ require('../chunk-WOSAJSJB.cjs');
|
|
|
23
23
|
|
|
24
24
|
Object.defineProperty(exports, "executeRoute", {
|
|
25
25
|
enumerable: true,
|
|
26
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkYLL6U5SG_cjs.executeRoute; }
|
|
27
27
|
});
|
|
@@ -4,9 +4,9 @@ var chunkSNDRAYA6_cjs = require('../chunk-SNDRAYA6.cjs');
|
|
|
4
4
|
require('../chunk-AVWWCQ5P.cjs');
|
|
5
5
|
require('../chunk-CK6CQWQU.cjs');
|
|
6
6
|
require('../chunk-4BWE7SOV.cjs');
|
|
7
|
-
require('../chunk-
|
|
8
|
-
require('../chunk-
|
|
9
|
-
require('../chunk-
|
|
7
|
+
require('../chunk-LVRHZ5ZL.cjs');
|
|
8
|
+
require('../chunk-YLL6U5SG.cjs');
|
|
9
|
+
require('../chunk-NPKUHEGG.cjs');
|
|
10
10
|
require('../chunk-X2ASEG4P.cjs');
|
|
11
11
|
require('../chunk-YX56UXDX.cjs');
|
|
12
12
|
require('../chunk-TEH6UMUR.cjs');
|
|
@@ -4,9 +4,9 @@ import { bG as ContentType, B as BridgeType } from '../swaggerTypes-CJ2Xl5ed.js'
|
|
|
4
4
|
declare const bridges: (options?: ({
|
|
5
5
|
cache?: RequestCache | undefined;
|
|
6
6
|
credentials?: RequestCredentials | undefined;
|
|
7
|
-
headers?: {
|
|
7
|
+
headers?: string[][] | {
|
|
8
8
|
[x: string]: string;
|
|
9
|
-
} |
|
|
9
|
+
} | {
|
|
10
10
|
append: {};
|
|
11
11
|
delete: {};
|
|
12
12
|
get: {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createValidAddressList, executeTransactions } from './chunk-
|
|
1
|
+
import { createValidAddressList, executeTransactions } from './chunk-RCXA3W7Y.js';
|
|
2
2
|
import { updateRouteDetails, executeAndSubscribeToRouteStatus } from './chunk-QCGHODGV.js';
|
|
3
3
|
import { messages } from './chunk-P36PE4CR.js';
|
|
4
4
|
import { trackTransaction } from './chunk-SXBG57J3.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createValidAddressList, executeTransactions } from './chunk-
|
|
1
|
+
import { createValidAddressList, executeTransactions } from './chunk-RCXA3W7Y.js';
|
|
2
2
|
import { updateRouteDetails, executeAndSubscribeToRouteStatus } from './chunk-QCGHODGV.js';
|
|
3
3
|
import { messages } from './chunk-P36PE4CR.js';
|
|
4
4
|
import { ApiState } from './chunk-F66EKL3W.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);
|
package/dist/esm/index.js
CHANGED
|
@@ -2,9 +2,9 @@ export { AutopilotActionJson, AxelarTransferStateJson, AxelarTransferTypeJson, B
|
|
|
2
2
|
export { setClientOptions } from './chunk-GZJLX2CP.js';
|
|
3
3
|
export { setApiOptions } from './chunk-QYXGDTUU.js';
|
|
4
4
|
export { waitForTransaction, waitForTransactionWithCancel } from './chunk-E4NRDAVO.js';
|
|
5
|
-
export { executeMultipleRoutes } from './chunk-
|
|
6
|
-
export { executeRoute } from './chunk-
|
|
7
|
-
import './chunk-
|
|
5
|
+
export { executeMultipleRoutes } from './chunk-DFXZ6FIV.js';
|
|
6
|
+
export { executeRoute } from './chunk-PQCZ64TO.js';
|
|
7
|
+
import './chunk-RCXA3W7Y.js';
|
|
8
8
|
export { TransferType, getSimpleOverallStatus, getTransferEventsFromTxStatusResponse, subscribeToRouteStatus } from './chunk-QCGHODGV.js';
|
|
9
9
|
export { validateCosmosGasBalance } from './chunk-PZ2624FK.js';
|
|
10
10
|
export { getCosmosGasAmountForMessage } from './chunk-R2GHDOWX.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { executeMultipleRoutes } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { executeMultipleRoutes } from '../chunk-DFXZ6FIV.js';
|
|
2
|
+
import '../chunk-RCXA3W7Y.js';
|
|
3
3
|
import '../chunk-QCGHODGV.js';
|
|
4
4
|
import '../chunk-PZ2624FK.js';
|
|
5
5
|
import '../chunk-R2GHDOWX.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { executeRoute } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
export { executeRoute } from '../chunk-PQCZ64TO.js';
|
|
2
|
+
import '../chunk-RCXA3W7Y.js';
|
|
3
3
|
import '../chunk-QCGHODGV.js';
|
|
4
4
|
import '../chunk-PZ2624FK.js';
|
|
5
5
|
import '../chunk-R2GHDOWX.js';
|
|
@@ -2,9 +2,9 @@ export { getRouteWithGasOnReceive } from '../chunk-6URWUQ4I.js';
|
|
|
2
2
|
import '../chunk-GZJLX2CP.js';
|
|
3
3
|
import '../chunk-QYXGDTUU.js';
|
|
4
4
|
import '../chunk-E4NRDAVO.js';
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
7
|
-
import '../chunk-
|
|
5
|
+
import '../chunk-DFXZ6FIV.js';
|
|
6
|
+
import '../chunk-PQCZ64TO.js';
|
|
7
|
+
import '../chunk-RCXA3W7Y.js';
|
|
8
8
|
import '../chunk-QCGHODGV.js';
|
|
9
9
|
import '../chunk-PZ2624FK.js';
|
|
10
10
|
import '../chunk-R2GHDOWX.js';
|