@skip-go/client 1.3.5 → 1.3.6

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.
@@ -1283,6 +1283,24 @@ var executeTransactions = async (options) => {
1283
1283
  }
1284
1284
  if ("cosmosTx" in tx) {
1285
1285
  await validateEnabledChainIds(tx.cosmosTx?.chainId ?? "");
1286
+ const isAllowedToBatchSignTxsUpfront = await (async () => {
1287
+ try {
1288
+ const currentUserAddress = options.userAddresses.find((x) => x.chainId === tx.cosmosTx?.chainId)?.address;
1289
+ if (!currentUserAddress) {
1290
+ return false;
1291
+ }
1292
+ const { accountNumber } = await getAccountNumberAndSequence(currentUserAddress, tx.cosmosTx?.chainId);
1293
+ if (accountNumber) {
1294
+ return true;
1295
+ }
1296
+ return false;
1297
+ } catch (_error) {
1298
+ return false;
1299
+ }
1300
+ })();
1301
+ if (!isAllowedToBatchSignTxsUpfront) {
1302
+ continue;
1303
+ }
1286
1304
  const signedTx = await signCosmosTransaction({
1287
1305
  tx,
1288
1306
  options,
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk5BVYKNVO_cjs = require('./chunk-5BVYKNVO.cjs');
3
+ var chunkVGS46RWR_cjs = require('./chunk-VGS46RWR.cjs');
4
4
  var chunkIE22IVFA_cjs = require('./chunk-IE22IVFA.cjs');
5
5
  var chunkJ5RC6ZU5_cjs = require('./chunk-J5RC6ZU5.cjs');
6
6
  var chunkN3LR7KTI_cjs = require('./chunk-N3LR7KTI.cjs');
@@ -176,7 +176,7 @@ var FeeBehaviorJson = /* @__PURE__ */ ((FeeBehaviorJson2) => {
176
176
 
177
177
  Object.defineProperty(exports, "executeRoute", {
178
178
  enumerable: true,
179
- get: function () { return chunk5BVYKNVO_cjs.executeRoute; }
179
+ get: function () { return chunkVGS46RWR_cjs.executeRoute; }
180
180
  });
181
181
  Object.defineProperty(exports, "validateCosmosGasBalance", {
182
182
  enumerable: true,
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunk5BVYKNVO_cjs = require('../chunk-5BVYKNVO.cjs');
3
+ var chunkVGS46RWR_cjs = require('../chunk-VGS46RWR.cjs');
4
4
  require('../chunk-IE22IVFA.cjs');
5
5
  require('../chunk-J5RC6ZU5.cjs');
6
6
  require('../chunk-N3LR7KTI.cjs');
@@ -23,5 +23,5 @@ require('../chunk-IDDRJJO5.cjs');
23
23
 
24
24
  Object.defineProperty(exports, "executeRoute", {
25
25
  enumerable: true,
26
- get: function () { return chunk5BVYKNVO_cjs.executeRoute; }
26
+ get: function () { return chunkVGS46RWR_cjs.executeRoute; }
27
27
  });
@@ -4,13 +4,13 @@ import { getEncodeObjectFromCosmosMessage, getEncodeObjectFromCosmosMessageInjec
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-YLVFZDR5.js';
7
+ import { getRpcEndpointForChain, accountParser, getSigningStargateClient } from './chunk-YLVFZDR5.js';
8
8
  import { chains, findFirstWorkingEndpoint, getIsEthermint, getIsInitia } from './chunk-VBWLUZXT.js';
9
9
  import { messages } from './chunk-7LSTJXAF.js';
10
10
  import { submitTransaction } from './chunk-OHV2LZEG.js';
11
11
  import { venues } from './chunk-JSY7M43P.js';
12
12
  import { ClientState, balances } from './chunk-2L7PKZDY.js';
13
- import { ApiState, wait, toCamel } from './chunk-LZI7A4JI.js';
13
+ import { ApiState, toCamel, wait } from './chunk-LZI7A4JI.js';
14
14
  import { PublicKey, Transaction, Connection, LAMPORTS_PER_SOL } from '@solana/web3.js';
15
15
  import { bech32m, bech32 } from 'bech32';
16
16
  import { StargateClient } from '@cosmjs/stargate';
@@ -1281,6 +1281,24 @@ var executeTransactions = async (options) => {
1281
1281
  }
1282
1282
  if ("cosmosTx" in tx) {
1283
1283
  await validateEnabledChainIds(tx.cosmosTx?.chainId ?? "");
1284
+ const isAllowedToBatchSignTxsUpfront = await (async () => {
1285
+ try {
1286
+ const currentUserAddress = options.userAddresses.find((x) => x.chainId === tx.cosmosTx?.chainId)?.address;
1287
+ if (!currentUserAddress) {
1288
+ return false;
1289
+ }
1290
+ const { accountNumber } = await getAccountNumberAndSequence(currentUserAddress, tx.cosmosTx?.chainId);
1291
+ if (accountNumber) {
1292
+ return true;
1293
+ }
1294
+ return false;
1295
+ } catch (_error) {
1296
+ return false;
1297
+ }
1298
+ })();
1299
+ if (!isAllowedToBatchSignTxsUpfront) {
1300
+ continue;
1301
+ }
1284
1302
  const signedTx = await signCosmosTransaction({
1285
1303
  tx,
1286
1304
  options,
package/dist/esm/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { executeRoute } from './chunk-YL6PL36T.js';
1
+ export { executeRoute } from './chunk-6ZLEWCU2.js';
2
2
  export { validateCosmosGasBalance } from './chunk-ADUNNC4O.js';
3
3
  export { waitForTransaction } from './chunk-CU6W3622.js';
4
4
  export { getCosmosGasAmountForMessage } from './chunk-TV2XPAIF.js';
@@ -1,4 +1,4 @@
1
- export { executeRoute } from '../chunk-YL6PL36T.js';
1
+ export { executeRoute } from '../chunk-6ZLEWCU2.js';
2
2
  import '../chunk-ADUNNC4O.js';
3
3
  import '../chunk-CU6W3622.js';
4
4
  import '../chunk-TV2XPAIF.js';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@skip-go/client",
3
3
  "description": "JavaScript SDK for Skip Go API",
4
- "version": "1.3.5",
4
+ "version": "1.3.6",
5
5
  "repository": "https://github.com/skip-mev/skip-go",
6
6
  "type": "module",
7
7
  "main": "./dist/cjs/index.cjs",