@skip-go/client 1.0.4 → 1.0.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.
Files changed (106) hide show
  1. package/dist/api/{getAssets.d.cts → getAssets.d.ts} +2 -2
  2. package/dist/api/getAssets.js +2 -0
  3. package/dist/api/{getAssetsBetweenChains.d.cts → getAssetsBetweenChains.d.ts} +2 -2
  4. package/dist/api/getAssetsBetweenChains.js +2 -0
  5. package/dist/api/{getBridges.d.cts → getBridges.d.ts} +2 -2
  6. package/dist/api/getBridges.js +2 -0
  7. package/dist/api/{getChains.d.cts → getChains.d.ts} +2 -2
  8. package/dist/api/getChains.js +2 -0
  9. package/dist/api/{getVenues.d.cts → getVenues.d.ts} +1 -1
  10. package/dist/api/getVenues.js +2 -0
  11. package/dist/api/{postAssetsFromSource.d.cts → postAssetsFromSource.d.ts} +2 -2
  12. package/dist/api/postAssetsFromSource.js +3 -0
  13. package/dist/api/{postBalances.d.cts → postBalances.d.ts} +3 -3
  14. package/dist/api/postBalances.js +2 -0
  15. package/dist/api/{postIbcOriginAssets.d.cts → postIbcOriginAssets.d.ts} +1 -1
  16. package/dist/api/postIbcOriginAssets.js +2 -0
  17. package/dist/api/{postMessages.d.cts → postMessages.d.ts} +3 -3
  18. package/dist/api/postMessages.js +2 -0
  19. package/dist/api/{postMessagesDirect.d.cts → postMessagesDirect.d.ts} +2 -2
  20. package/dist/api/postMessagesDirect.js +2 -0
  21. package/dist/api/{postRecommendAssets.d.cts → postRecommendAssets.d.ts} +2 -2
  22. package/dist/api/postRecommendAssets.js +2 -0
  23. package/dist/api/{postRoute.d.cts → postRoute.d.ts} +3 -3
  24. package/dist/api/postRoute.js +2 -0
  25. package/dist/api/{postSubmitTransaction.d.cts → postSubmitTransaction.d.ts} +1 -1
  26. package/dist/api/postSubmitTransaction.js +2 -0
  27. package/dist/api/{postTrackTransaction.d.cts → postTrackTransaction.d.ts} +1 -1
  28. package/dist/api/postTrackTransaction.js +2 -0
  29. package/dist/api/{postTransactionStatus.d.cts → postTransactionStatus.d.ts} +3 -3
  30. package/dist/api/postTransactionStatus.js +2 -0
  31. package/dist/chunk-33K6EESX.js +10 -0
  32. package/dist/{chunk-77ITCT75.cjs → chunk-4JJWOILI.js} +3 -5
  33. package/dist/chunk-BQTQJQ5E.js +10 -0
  34. package/dist/{chunk-ED2OY55G.cjs → chunk-BRMONS6A.js} +5 -11
  35. package/dist/{chunk-PNWIJSMA.cjs → chunk-C2EDPY6J.js} +3 -5
  36. package/dist/chunk-DW4U6YI6.js +10 -0
  37. package/dist/{chunk-GQYZQCOJ.cjs → chunk-F75DC5RW.js} +179 -185
  38. package/dist/{chunk-SFMBRLUS.cjs → chunk-GARVPN2H.js} +4 -6
  39. package/dist/{chunk-7SK3IFXJ.cjs → chunk-JTIHU43D.js} +1 -6
  40. package/dist/{chunk-VI7UMBQ7.cjs → chunk-KNV72XRZ.js} +3 -5
  41. package/dist/chunk-MGVXJ2U4.js +11 -0
  42. package/dist/chunk-MTMPHY3Y.js +9 -0
  43. package/dist/{chunk-UO54MR5Z.cjs → chunk-PHTQQIAH.js} +220 -226
  44. package/dist/{chunk-RDOSNDAQ.cjs → chunk-PRQ2NHRZ.js} +3 -5
  45. package/dist/chunk-RDRDFJQE.js +10 -0
  46. package/dist/chunk-RMP3HM5N.js +14 -0
  47. package/dist/{chunk-D2MDLQQZ.cjs → chunk-SONZJVQM.js} +47 -51
  48. package/dist/{chunk-KZOSEIWH.cjs → chunk-SWYON2RG.js} +1 -4
  49. package/dist/{chunk-WMXUOVHN.cjs → chunk-TD63P2AG.js} +111 -156
  50. package/dist/{chunk-ZNXE6PUV.cjs → chunk-TW77BXMT.js} +7 -9
  51. package/dist/chunk-UNF72WYO.js +22 -0
  52. package/dist/{chunk-J4LI33TK.cjs → chunk-VMPFHQ7U.js} +9 -11
  53. package/dist/{chunk-4R6OCWRR.cjs → chunk-VQ5SIQWU.js} +1 -3
  54. package/dist/{chunk-HAR3IXDE.cjs → chunk-W6TBGBV3.js} +1 -31
  55. package/dist/{client-types-qvyKvyFh.d.cts → client-types-CxjtffyG.d.ts} +1 -1
  56. package/dist/{executeRoute-BKRpODCc.d.cts → executeRoute-BKvMVd1I.d.ts} +3 -3
  57. package/dist/{generateApi-C0amiydg.d.cts → generateApi-DqCp36fX.d.ts} +1 -1
  58. package/dist/{index.d.cts → index.d.ts} +25 -25
  59. package/dist/index.js +24 -0
  60. package/dist/public-functions/{executeRoute.d.cts → executeRoute.d.ts} +4 -4
  61. package/dist/public-functions/executeRoute.js +12 -0
  62. package/dist/public-functions/{getFeeInfoForChain.d.cts → getFeeInfoForChain.d.ts} +2 -2
  63. package/dist/public-functions/getFeeInfoForChain.js +5 -0
  64. package/dist/public-functions/{getRecommendedGasPrice.d.cts → getRecommendedGasPrice.d.ts} +1 -1
  65. package/dist/public-functions/getRecommendedGasPrice.js +7 -0
  66. package/dist/public-functions/getSigningStargateClient.js +4 -0
  67. package/dist/public-functions/{setApiOptions.d.cts → setApiOptions.d.ts} +2 -2
  68. package/dist/public-functions/setApiOptions.js +2 -0
  69. package/dist/public-functions/setClientOptions.d.ts +9 -0
  70. package/dist/public-functions/setClientOptions.js +4 -0
  71. package/dist/{setClientOptions-CT6CHI9I.d.cts → setClientOptions-DbanEIwL.d.ts} +2 -2
  72. package/package.json +6 -6
  73. package/dist/api/getAssets.cjs +0 -15
  74. package/dist/api/getAssetsBetweenChains.cjs +0 -11
  75. package/dist/api/getBridges.cjs +0 -11
  76. package/dist/api/getChains.cjs +0 -11
  77. package/dist/api/getVenues.cjs +0 -11
  78. package/dist/api/postAssetsFromSource.cjs +0 -12
  79. package/dist/api/postBalances.cjs +0 -11
  80. package/dist/api/postIbcOriginAssets.cjs +0 -11
  81. package/dist/api/postMessages.cjs +0 -11
  82. package/dist/api/postMessagesDirect.cjs +0 -11
  83. package/dist/api/postRecommendAssets.cjs +0 -11
  84. package/dist/api/postRoute.cjs +0 -11
  85. package/dist/api/postSubmitTransaction.cjs +0 -11
  86. package/dist/api/postTrackTransaction.cjs +0 -11
  87. package/dist/api/postTransactionStatus.cjs +0 -11
  88. package/dist/chunk-32MRDO7V.cjs +0 -12
  89. package/dist/chunk-4RVEOKQU.cjs +0 -24
  90. package/dist/chunk-DAMZSSOH.cjs +0 -12
  91. package/dist/chunk-ISHM4QWP.cjs +0 -16
  92. package/dist/chunk-KDN7RCGP.cjs +0 -13
  93. package/dist/chunk-L5V5PASH.cjs +0 -12
  94. package/dist/chunk-LXYLWTNZ.cjs +0 -12
  95. package/dist/chunk-URLFWBSC.cjs +0 -11
  96. package/dist/index.cjs +0 -209
  97. package/dist/public-functions/executeRoute.cjs +0 -21
  98. package/dist/public-functions/getFeeInfoForChain.cjs +0 -14
  99. package/dist/public-functions/getRecommendedGasPrice.cjs +0 -16
  100. package/dist/public-functions/getSigningStargateClient.cjs +0 -13
  101. package/dist/public-functions/setApiOptions.cjs +0 -11
  102. package/dist/public-functions/setClientOptions.cjs +0 -13
  103. package/dist/public-functions/setClientOptions.d.cts +0 -9
  104. /package/dist/{apiState-CdzxTxYd.d.cts → apiState-CdzxTxYd.d.ts} +0 -0
  105. /package/dist/public-functions/{getSigningStargateClient.d.cts → getSigningStargateClient.d.ts} +0 -0
  106. /package/dist/{swaggerTypes-O9-gvCT1.d.cts → swaggerTypes-O9-gvCT1.d.ts} +0 -0
@@ -1,51 +1,45 @@
1
- 'use strict';
2
-
3
- var chunk4R6OCWRR_cjs = require('./chunk-4R6OCWRR.cjs');
4
- var chunkKZOSEIWH_cjs = require('./chunk-KZOSEIWH.cjs');
5
- var chunkD2MDLQQZ_cjs = require('./chunk-D2MDLQQZ.cjs');
6
- var chunk7SK3IFXJ_cjs = require('./chunk-7SK3IFXJ.cjs');
7
- var chunkWMXUOVHN_cjs = require('./chunk-WMXUOVHN.cjs');
8
- var chunk32MRDO7V_cjs = require('./chunk-32MRDO7V.cjs');
9
- var chunkL5V5PASH_cjs = require('./chunk-L5V5PASH.cjs');
10
- var chunkKDN7RCGP_cjs = require('./chunk-KDN7RCGP.cjs');
11
- var chunkDAMZSSOH_cjs = require('./chunk-DAMZSSOH.cjs');
12
- var chunkED2OY55G_cjs = require('./chunk-ED2OY55G.cjs');
13
- var chunkHAR3IXDE_cjs = require('./chunk-HAR3IXDE.cjs');
14
- var web3_js = require('@solana/web3.js');
15
- var bech32 = require('bech32');
16
- var stargate = require('@cosmjs/stargate');
17
- var tx_js = require('cosmjs-types/cosmos/tx/v1beta1/tx.js');
18
- var protoSigning = require('@cosmjs/proto-signing');
19
- var encoding = require('@cosmjs/encoding');
20
- var sdkTs = require('@injectivelabs/sdk-ts');
21
- var tx_js$3 = require('cosmjs-types/cosmos/bank/v1beta1/tx.js');
22
- var tx_js$2 = require('cosmjs-types/cosmwasm/wasm/v1/tx.js');
23
- var tx_js$1 = require('cosmjs-types/ibc/applications/transfer/v1/tx.js');
24
- var _m0 = require('protobufjs/minimal.js');
25
- var utils = require('@injectivelabs/utils');
26
- var amino = require('@cosmjs/amino');
27
- var keys_js = require('cosmjs-types/cosmos/crypto/secp256k1/keys.js');
28
- var any_js = require('cosmjs-types/google/protobuf/any.js');
29
- var math = require('@cosmjs/math');
30
- var signing_js = require('cosmjs-types/cosmos/tx/signing/v1beta1/signing.js');
31
- var viem = require('viem');
32
-
33
- function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
34
-
35
- var _m0__default = /*#__PURE__*/_interopDefault(_m0);
1
+ import { BigNumber } from './chunk-VQ5SIQWU.js';
2
+ import { GAS_STATION_CHAIN_IDS } from './chunk-SWYON2RG.js';
3
+ import { getSigningStargateClient, getRpcEndpointForChain, accountParser } from './chunk-SONZJVQM.js';
4
+ import { chains, findFirstWorkingEndpoint, getIsEthermint, getIsInitia } from './chunk-JTIHU43D.js';
5
+ import { MsgDepositForBurn, MsgDepositForBurnWithCaller, MsgExecute, MsgInitiateTokenDeposit, BaseVestingAccount, Timestamp, toTimestamp, Period, fromTimestamp, isSet, fromJsonTimestamp } from './chunk-TD63P2AG.js';
6
+ import { messages } from './chunk-DW4U6YI6.js';
7
+ import { submitTransaction } from './chunk-RDRDFJQE.js';
8
+ import { trackTransaction } from './chunk-MGVXJ2U4.js';
9
+ import { transactionStatus } from './chunk-33K6EESX.js';
10
+ import { ClientState, balances } from './chunk-BRMONS6A.js';
11
+ import { ApiState, wait, createRequestClient, toCamel } from './chunk-W6TBGBV3.js';
12
+ import { PublicKey, Transaction, Connection, LAMPORTS_PER_SOL } from '@solana/web3.js';
13
+ import { bech32m, bech32 } from 'bech32';
14
+ import { StargateClient, GasPrice, calculateFee } from '@cosmjs/stargate';
15
+ import { TxRaw } from 'cosmjs-types/cosmos/tx/v1beta1/tx.js';
16
+ import { isOfflineDirectSigner, makeAuthInfoBytes, makeSignDoc, encodePubkey } from '@cosmjs/proto-signing';
17
+ import { fromBase64, toUtf8, toBase64 } from '@cosmjs/encoding';
18
+ import { ChainRestTendermintApi, MsgTransfer as MsgTransfer$1, MsgExecuteContractCompat, createTransactionWithSigners } from '@injectivelabs/sdk-ts';
19
+ import { MsgSend } from 'cosmjs-types/cosmos/bank/v1beta1/tx.js';
20
+ import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx.js';
21
+ import { MsgTransfer } from 'cosmjs-types/ibc/applications/transfer/v1/tx.js';
22
+ import _m0 from 'protobufjs/minimal.js';
23
+ import { BigNumberInBase, DEFAULT_BLOCK_TIMEOUT_HEIGHT, DEFAULT_STD_FEE } from '@injectivelabs/utils';
24
+ import { pubkeyType as pubkeyType$1, makeSignDoc as makeSignDoc$1, encodeSecp256k1Pubkey } from '@cosmjs/amino';
25
+ import { PubKey } from 'cosmjs-types/cosmos/crypto/secp256k1/keys.js';
26
+ import { Any } from 'cosmjs-types/google/protobuf/any.js';
27
+ import { Int53, Decimal } from '@cosmjs/math';
28
+ import { SignMode } from 'cosmjs-types/cosmos/tx/signing/v1beta1/signing.js';
29
+ import { isAddress, publicActions, maxUint256, formatUnits } from 'viem';
36
30
 
37
31
  // src/private-functions/getRestEndpointForChain.ts
38
32
  var getRestEndpointForChain = async (chainId) => {
39
- if (chunkED2OY55G_cjs.ClientState.endpointOptions.getRestEndpointForChain) {
40
- return chunkED2OY55G_cjs.ClientState.endpointOptions.getRestEndpointForChain(chainId);
33
+ if (ClientState.endpointOptions.getRestEndpointForChain) {
34
+ return ClientState.endpointOptions.getRestEndpointForChain(chainId);
41
35
  }
42
- if (chunkED2OY55G_cjs.ClientState.endpointOptions.endpoints && chunkED2OY55G_cjs.ClientState.endpointOptions.endpoints[chainId]) {
43
- const endpointOptions = chunkED2OY55G_cjs.ClientState.endpointOptions.endpoints[chainId];
36
+ if (ClientState.endpointOptions.endpoints && ClientState.endpointOptions.endpoints[chainId]) {
37
+ const endpointOptions = ClientState.endpointOptions.endpoints[chainId];
44
38
  if (endpointOptions?.rest) {
45
39
  return endpointOptions.rest;
46
40
  }
47
41
  }
48
- const chain = chunk7SK3IFXJ_cjs.chains().find((chain2) => chain2.chain_id === chainId);
42
+ const chain = chains().find((chain2) => chain2.chain_id === chainId);
49
43
  if (!chain) {
50
44
  throw new Error(
51
45
  `getRestEndpointForChain error: failed to find chain id '${chainId}' in registry`
@@ -57,7 +51,7 @@ var getRestEndpointForChain = async (chainId) => {
57
51
  );
58
52
  }
59
53
  const endpoints = chain.apis?.rest?.map((api) => api.address);
60
- const endpoint = await chunk7SK3IFXJ_cjs.findFirstWorkingEndpoint(endpoints, "rest");
54
+ const endpoint = await findFirstWorkingEndpoint(endpoints, "rest");
61
55
  if (!endpoint) {
62
56
  throw new Error(
63
57
  `getRestEndpointForChain error: failed to find REST endpoint for chain '${chainId}'`
@@ -71,9 +65,9 @@ var getAccountNumberAndSequence = async (address, chainId) => {
71
65
  if (chainId.includes("dymension")) {
72
66
  return getAccountNumberAndSequenceFromDymension(address, chainId);
73
67
  }
74
- const endpoint = await chunkD2MDLQQZ_cjs.getRpcEndpointForChain(chainId);
75
- const client = chunkED2OY55G_cjs.ClientState.signingStargateClientByChainId[chainId] ?? await stargate.StargateClient.connect(endpoint, {
76
- accountParser: chunkD2MDLQQZ_cjs.accountParser
68
+ const endpoint = await getRpcEndpointForChain(chainId);
69
+ const client = ClientState.signingStargateClientByChainId[chainId] ?? await StargateClient.connect(endpoint, {
70
+ accountParser
77
71
  });
78
72
  const account = await client.getAccount(address);
79
73
  if (!account) {
@@ -87,10 +81,10 @@ var getAccountNumberAndSequence = async (address, chainId) => {
87
81
  };
88
82
  var getAccountNumberAndSequenceFromDymension = async (address, chainId) => {
89
83
  const endpoint = await getRestEndpointForChain(chainId);
90
- const jsonResponse = await chunkHAR3IXDE_cjs.createRequestClient({
84
+ const jsonResponse = await createRequestClient({
91
85
  baseUrl: `${endpoint}/cosmos/auth/v1beta1/accounts/${address}`
92
86
  }).get();
93
- const response = chunkHAR3IXDE_cjs.toCamel(jsonResponse);
87
+ const response = toCamel(jsonResponse);
94
88
  let sequence = 0;
95
89
  let accountNumber = 0;
96
90
  if (response.account.baseAccount) {
@@ -116,45 +110,45 @@ function createBaseClawbackVestingAccount() {
116
110
  }
117
111
  var ClawbackVestingAccount = {
118
112
  typeUrl: "/evmos.vesting.v2.ClawbackVestingAccount",
119
- encode(message, writer = _m0__default.default.Writer.create()) {
113
+ encode(message, writer = _m0.Writer.create()) {
120
114
  if (message.baseVestingAccount !== void 0) {
121
- chunkWMXUOVHN_cjs.BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim();
115
+ BaseVestingAccount.encode(message.baseVestingAccount, writer.uint32(10).fork()).ldelim();
122
116
  }
123
117
  if (message.funderAddress !== "") {
124
118
  writer.uint32(18).string(message.funderAddress);
125
119
  }
126
120
  if (message.startTime !== void 0) {
127
- chunkWMXUOVHN_cjs.Timestamp.encode(chunkWMXUOVHN_cjs.toTimestamp(message.startTime), writer.uint32(26).fork()).ldelim();
121
+ Timestamp.encode(toTimestamp(message.startTime), writer.uint32(26).fork()).ldelim();
128
122
  }
129
123
  for (const v of message.lockupPeriods) {
130
- chunkWMXUOVHN_cjs.Period.encode(v, writer.uint32(34).fork()).ldelim();
124
+ Period.encode(v, writer.uint32(34).fork()).ldelim();
131
125
  }
132
126
  for (const v of message.vestingPeriods) {
133
- chunkWMXUOVHN_cjs.Period.encode(v, writer.uint32(42).fork()).ldelim();
127
+ Period.encode(v, writer.uint32(42).fork()).ldelim();
134
128
  }
135
129
  return writer;
136
130
  },
137
131
  decode(input, length) {
138
- const reader = input instanceof _m0__default.default.Reader ? input : new _m0__default.default.Reader(input);
132
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
139
133
  let end = length === void 0 ? reader.len : reader.pos + length;
140
134
  const message = createBaseClawbackVestingAccount();
141
135
  while (reader.pos < end) {
142
136
  const tag = reader.uint32();
143
137
  switch (tag >>> 3) {
144
138
  case 1:
145
- message.baseVestingAccount = chunkWMXUOVHN_cjs.BaseVestingAccount.decode(reader, reader.uint32());
139
+ message.baseVestingAccount = BaseVestingAccount.decode(reader, reader.uint32());
146
140
  break;
147
141
  case 2:
148
142
  message.funderAddress = reader.string();
149
143
  break;
150
144
  case 3:
151
- message.startTime = chunkWMXUOVHN_cjs.fromTimestamp(chunkWMXUOVHN_cjs.Timestamp.decode(reader, reader.uint32()));
145
+ message.startTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
152
146
  break;
153
147
  case 4:
154
- message.lockupPeriods.push(chunkWMXUOVHN_cjs.Period.decode(reader, reader.uint32()));
148
+ message.lockupPeriods.push(Period.decode(reader, reader.uint32()));
155
149
  break;
156
150
  case 5:
157
- message.vestingPeriods.push(chunkWMXUOVHN_cjs.Period.decode(reader, reader.uint32()));
151
+ message.vestingPeriods.push(Period.decode(reader, reader.uint32()));
158
152
  break;
159
153
  default:
160
154
  reader.skipType(tag & 7);
@@ -165,25 +159,25 @@ var ClawbackVestingAccount = {
165
159
  },
166
160
  fromJSON(object) {
167
161
  return {
168
- baseVestingAccount: chunkWMXUOVHN_cjs.isSet(object.baseVestingAccount) ? chunkWMXUOVHN_cjs.BaseVestingAccount.fromJSON(object.baseVestingAccount) : void 0,
169
- funderAddress: chunkWMXUOVHN_cjs.isSet(object.funderAddress) ? String(object.funderAddress) : "",
170
- startTime: chunkWMXUOVHN_cjs.isSet(object.startTime) ? chunkWMXUOVHN_cjs.fromJsonTimestamp(object.startTime) : void 0,
171
- lockupPeriods: Array.isArray(object?.lockupPeriods) ? object.lockupPeriods.map((e) => chunkWMXUOVHN_cjs.Period.fromJSON(e)) : [],
172
- vestingPeriods: Array.isArray(object?.vestingPeriods) ? object.vestingPeriods.map((e) => chunkWMXUOVHN_cjs.Period.fromJSON(e)) : []
162
+ baseVestingAccount: isSet(object.baseVestingAccount) ? BaseVestingAccount.fromJSON(object.baseVestingAccount) : void 0,
163
+ funderAddress: isSet(object.funderAddress) ? String(object.funderAddress) : "",
164
+ startTime: isSet(object.startTime) ? fromJsonTimestamp(object.startTime) : void 0,
165
+ lockupPeriods: Array.isArray(object?.lockupPeriods) ? object.lockupPeriods.map((e) => Period.fromJSON(e)) : [],
166
+ vestingPeriods: Array.isArray(object?.vestingPeriods) ? object.vestingPeriods.map((e) => Period.fromJSON(e)) : []
173
167
  };
174
168
  },
175
169
  toJSON(message) {
176
170
  const obj = {};
177
- message.baseVestingAccount !== void 0 && (obj.baseVestingAccount = message.baseVestingAccount ? chunkWMXUOVHN_cjs.BaseVestingAccount.toJSON(message.baseVestingAccount) : void 0);
171
+ message.baseVestingAccount !== void 0 && (obj.baseVestingAccount = message.baseVestingAccount ? BaseVestingAccount.toJSON(message.baseVestingAccount) : void 0);
178
172
  message.funderAddress !== void 0 && (obj.funderAddress = message.funderAddress);
179
173
  message.startTime !== void 0 && (obj.startTime = message.startTime.toISOString());
180
174
  if (message.lockupPeriods) {
181
- obj.lockupPeriods = message.lockupPeriods.map((e) => e ? chunkWMXUOVHN_cjs.Period.toJSON(e) : void 0);
175
+ obj.lockupPeriods = message.lockupPeriods.map((e) => e ? Period.toJSON(e) : void 0);
182
176
  } else {
183
177
  obj.lockupPeriods = [];
184
178
  }
185
179
  if (message.vestingPeriods) {
186
- obj.vestingPeriods = message.vestingPeriods.map((e) => e ? chunkWMXUOVHN_cjs.Period.toJSON(e) : void 0);
180
+ obj.vestingPeriods = message.vestingPeriods.map((e) => e ? Period.toJSON(e) : void 0);
187
181
  } else {
188
182
  obj.vestingPeriods = [];
189
183
  }
@@ -191,40 +185,40 @@ var ClawbackVestingAccount = {
191
185
  },
192
186
  fromPartial(object) {
193
187
  const message = createBaseClawbackVestingAccount();
194
- message.baseVestingAccount = object.baseVestingAccount !== void 0 && object.baseVestingAccount !== null ? chunkWMXUOVHN_cjs.BaseVestingAccount.fromPartial(object.baseVestingAccount) : void 0;
188
+ message.baseVestingAccount = object.baseVestingAccount !== void 0 && object.baseVestingAccount !== null ? BaseVestingAccount.fromPartial(object.baseVestingAccount) : void 0;
195
189
  message.funderAddress = object.funderAddress ?? "";
196
190
  message.startTime = object.startTime ?? void 0;
197
- message.lockupPeriods = object.lockupPeriods?.map((e) => chunkWMXUOVHN_cjs.Period.fromPartial(e)) || [];
198
- message.vestingPeriods = object.vestingPeriods?.map((e) => chunkWMXUOVHN_cjs.Period.fromPartial(e)) || [];
191
+ message.lockupPeriods = object.lockupPeriods?.map((e) => Period.fromPartial(e)) || [];
192
+ message.vestingPeriods = object.vestingPeriods?.map((e) => Period.fromPartial(e)) || [];
199
193
  return message;
200
194
  },
201
195
  fromAmino(object) {
202
196
  const message = createBaseClawbackVestingAccount();
203
197
  if (object.base_vesting_account !== void 0 && object.base_vesting_account !== null) {
204
- message.baseVestingAccount = chunkWMXUOVHN_cjs.BaseVestingAccount.fromAmino(object.base_vesting_account);
198
+ message.baseVestingAccount = BaseVestingAccount.fromAmino(object.base_vesting_account);
205
199
  }
206
200
  if (object.funder_address !== void 0 && object.funder_address !== null) {
207
201
  message.funderAddress = object.funder_address;
208
202
  }
209
203
  if (object.start_time !== void 0 && object.start_time !== null) {
210
- message.startTime = chunkWMXUOVHN_cjs.fromTimestamp(chunkWMXUOVHN_cjs.Timestamp.fromAmino(object.start_time));
204
+ message.startTime = fromTimestamp(Timestamp.fromAmino(object.start_time));
211
205
  }
212
- message.lockupPeriods = object.lockup_periods?.map((e) => chunkWMXUOVHN_cjs.Period.fromAmino(e)) || [];
213
- message.vestingPeriods = object.vesting_periods?.map((e) => chunkWMXUOVHN_cjs.Period.fromAmino(e)) || [];
206
+ message.lockupPeriods = object.lockup_periods?.map((e) => Period.fromAmino(e)) || [];
207
+ message.vestingPeriods = object.vesting_periods?.map((e) => Period.fromAmino(e)) || [];
214
208
  return message;
215
209
  },
216
210
  toAmino(message) {
217
211
  const obj = {};
218
- obj.base_vesting_account = message.baseVestingAccount ? chunkWMXUOVHN_cjs.BaseVestingAccount.toAmino(message.baseVestingAccount) : void 0;
212
+ obj.base_vesting_account = message.baseVestingAccount ? BaseVestingAccount.toAmino(message.baseVestingAccount) : void 0;
219
213
  obj.funder_address = message.funderAddress === "" ? void 0 : message.funderAddress;
220
- obj.start_time = message.startTime ? chunkWMXUOVHN_cjs.Timestamp.toAmino(chunkWMXUOVHN_cjs.toTimestamp(message.startTime)) : void 0;
214
+ obj.start_time = message.startTime ? Timestamp.toAmino(toTimestamp(message.startTime)) : void 0;
221
215
  if (message.lockupPeriods) {
222
- obj.lockup_periods = message.lockupPeriods.map((e) => e ? chunkWMXUOVHN_cjs.Period.toAmino(e) : void 0);
216
+ obj.lockup_periods = message.lockupPeriods.map((e) => e ? Period.toAmino(e) : void 0);
223
217
  } else {
224
218
  obj.lockup_periods = message.lockupPeriods;
225
219
  }
226
220
  if (message.vestingPeriods) {
227
- obj.vesting_periods = message.vestingPeriods.map((e) => e ? chunkWMXUOVHN_cjs.Period.toAmino(e) : void 0);
221
+ obj.vesting_periods = message.vestingPeriods.map((e) => e ? Period.toAmino(e) : void 0);
228
222
  } else {
229
223
  obj.vesting_periods = message.vestingPeriods;
230
224
  }
@@ -259,7 +253,7 @@ function getEncodeObjectFromCosmosMessage(message) {
259
253
  if (message.msgTypeUrl === "/ibc.applications.transfer.v1.MsgTransfer") {
260
254
  return {
261
255
  typeUrl: "/ibc.applications.transfer.v1.MsgTransfer",
262
- value: tx_js$1.MsgTransfer.fromJSON({
256
+ value: MsgTransfer.fromJSON({
263
257
  sourcePort: msgJson.source_port,
264
258
  sourceChannel: msgJson.source_channel,
265
259
  token: msgJson.token,
@@ -274,10 +268,10 @@ function getEncodeObjectFromCosmosMessage(message) {
274
268
  if (message.msgTypeUrl === "/cosmwasm.wasm.v1.MsgExecuteContract") {
275
269
  return {
276
270
  typeUrl: message.msgTypeUrl,
277
- value: tx_js$2.MsgExecuteContract.fromPartial({
271
+ value: MsgExecuteContract.fromPartial({
278
272
  sender: msgJson.sender,
279
273
  contract: msgJson.contract,
280
- msg: encoding.toUtf8(JSON.stringify(msgJson.msg)),
274
+ msg: toUtf8(JSON.stringify(msgJson.msg)),
281
275
  funds: msgJson.funds
282
276
  })
283
277
  };
@@ -285,7 +279,7 @@ function getEncodeObjectFromCosmosMessage(message) {
285
279
  if (message.msgTypeUrl === "/cosmos.bank.v1beta1.MsgSend") {
286
280
  return {
287
281
  typeUrl: message.msgTypeUrl,
288
- value: tx_js$3.MsgSend.fromPartial({
282
+ value: MsgSend.fromPartial({
289
283
  fromAddress: msgJson.from_address,
290
284
  toAddress: msgJson.to_address,
291
285
  amount: msgJson.amount
@@ -295,19 +289,19 @@ function getEncodeObjectFromCosmosMessage(message) {
295
289
  if (message.msgTypeUrl === "/circle.cctp.v1.MsgDepositForBurn") {
296
290
  return {
297
291
  typeUrl: message.msgTypeUrl,
298
- value: chunkWMXUOVHN_cjs.MsgDepositForBurn.fromAmino(msgJson)
292
+ value: MsgDepositForBurn.fromAmino(msgJson)
299
293
  };
300
294
  }
301
295
  if (message.msgTypeUrl === "/circle.cctp.v1.MsgDepositForBurnWithCaller") {
302
296
  return {
303
297
  typeUrl: message.msgTypeUrl,
304
- value: chunkWMXUOVHN_cjs.MsgDepositForBurnWithCaller.fromAmino(msgJson)
298
+ value: MsgDepositForBurnWithCaller.fromAmino(msgJson)
305
299
  };
306
300
  }
307
301
  if (message.msgTypeUrl === "/initia.move.v1.MsgExecute") {
308
302
  return {
309
303
  typeUrl: message.msgTypeUrl,
310
- value: chunkWMXUOVHN_cjs.MsgExecute.fromPartial({
304
+ value: MsgExecute.fromPartial({
311
305
  sender: msgJson.sender,
312
306
  moduleAddress: msgJson.module_address,
313
307
  moduleName: msgJson.module_name,
@@ -319,7 +313,7 @@ function getEncodeObjectFromCosmosMessage(message) {
319
313
  if (message.msgTypeUrl === "/opinit.ophost.v1.MsgInitiateTokenDeposit") {
320
314
  return {
321
315
  typeUrl: message.msgTypeUrl,
322
- value: chunkWMXUOVHN_cjs.MsgInitiateTokenDeposit.fromPartial({
316
+ value: MsgInitiateTokenDeposit.fromPartial({
323
317
  sender: msgJson.sender,
324
318
  to: msgJson.to,
325
319
  amount: msgJson.amount,
@@ -347,7 +341,7 @@ function getEncodeObjectFromCosmosMessage(message) {
347
341
  function getEncodeObjectFromCosmosMessageInjective(message) {
348
342
  const msgJson = JSON.parse(message.msg ?? "");
349
343
  if (message.msgTypeUrl === "/ibc.applications.transfer.v1.MsgTransfer") {
350
- return sdkTs.MsgTransfer.fromJSON({
344
+ return MsgTransfer$1.fromJSON({
351
345
  port: msgJson.source_port,
352
346
  channelId: msgJson.source_channel,
353
347
  amount: msgJson.token,
@@ -358,7 +352,7 @@ function getEncodeObjectFromCosmosMessageInjective(message) {
358
352
  });
359
353
  }
360
354
  if (message.msgTypeUrl === "/cosmwasm.wasm.v1.MsgExecuteContract") {
361
- return sdkTs.MsgExecuteContractCompat.fromJSON({
355
+ return MsgExecuteContractCompat.fromJSON({
362
356
  sender: msgJson.sender,
363
357
  contractAddress: msgJson.contract,
364
358
  msg: msgJson.msg,
@@ -372,7 +366,7 @@ function createTransaction({
372
366
  message,
373
367
  timeoutHeight,
374
368
  memo = "",
375
- fee = utils.DEFAULT_STD_FEE,
369
+ fee = DEFAULT_STD_FEE,
376
370
  signMode = 1,
377
371
  pubKey,
378
372
  accountNumber,
@@ -383,7 +377,7 @@ function createTransaction({
383
377
  accountNumber,
384
378
  sequence
385
379
  };
386
- return sdkTs.createTransactionWithSigners({
380
+ return createTransactionWithSigners({
387
381
  fee,
388
382
  memo,
389
383
  message,
@@ -415,10 +409,10 @@ var signCosmosMessageDirectEvmos = async (signerAddress, signer, cosmosMsgs, fee
415
409
  fee
416
410
  });
417
411
  const directSignResponse = await signer.signDirect(signerAddress, signDoc);
418
- return tx_js.TxRaw.fromPartial({
412
+ return TxRaw.fromPartial({
419
413
  bodyBytes: directSignResponse.signed.bodyBytes,
420
414
  authInfoBytes: directSignResponse.signed.authInfoBytes,
421
- signatures: [encoding.fromBase64(directSignResponse.signature.signature)]
415
+ signatures: [fromBase64(directSignResponse.signature.signature)]
422
416
  });
423
417
  };
424
418
  var signCosmosMessageDirectInjective = async (signerAddress, signer, cosmosMsgs, fee, { accountNumber, sequence, chainId }) => {
@@ -428,10 +422,10 @@ var signCosmosMessageDirectInjective = async (signerAddress, signer, cosmosMsgs,
428
422
  throw new Error("signCosmosMessageDirectInjective: failed to retrieve account from signer");
429
423
  }
430
424
  const restEndpoint = await getRestEndpointForChain(chainId);
431
- const chainRestTendermintApi = new sdkTs.ChainRestTendermintApi(restEndpoint);
425
+ const chainRestTendermintApi = new ChainRestTendermintApi(restEndpoint);
432
426
  const latestBlock = await chainRestTendermintApi.fetchLatestBlock();
433
427
  const latestHeight = latestBlock.header.height;
434
- const timeoutHeight = new utils.BigNumberInBase(latestHeight).plus(utils.DEFAULT_BLOCK_TIMEOUT_HEIGHT);
428
+ const timeoutHeight = new BigNumberInBase(latestHeight).plus(DEFAULT_BLOCK_TIMEOUT_HEIGHT);
435
429
  const pk = Buffer.from(accountFromSigner.pubkey).toString("base64");
436
430
  const messages2 = cosmosMsgs.map(
437
431
  (cosmosMsg) => getEncodeObjectFromCosmosMessageInjective(cosmosMsg)
@@ -450,15 +444,15 @@ var signCosmosMessageDirectInjective = async (signerAddress, signer, cosmosMsgs,
450
444
  // @ts-expect-error TODO: Fix this
451
445
  signDoc
452
446
  );
453
- return tx_js.TxRaw.fromPartial({
447
+ return TxRaw.fromPartial({
454
448
  bodyBytes: directSignResponse.signed.bodyBytes,
455
449
  authInfoBytes: directSignResponse.signed.authInfoBytes,
456
- signatures: [encoding.fromBase64(directSignResponse.signature.signature)]
450
+ signatures: [fromBase64(directSignResponse.signature.signature)]
457
451
  });
458
452
  };
459
453
  var pubkeyType = {
460
454
  ethsecp256k1: "ethermint/PubKeyEthSecp256k1",
461
- ...amino.pubkeyType
455
+ ...pubkeyType$1
462
456
  };
463
457
 
464
458
  // src/amino/encoding.ts
@@ -470,21 +464,21 @@ function encodeEthSecp256k1Pubkey(pubkey) {
470
464
  }
471
465
  return {
472
466
  type: pubkeyType.ethsecp256k1,
473
- value: encoding.toBase64(pubkey)
467
+ value: toBase64(pubkey)
474
468
  };
475
469
  }
476
470
 
477
471
  // src/proto-signing/pubkey.ts
478
472
  function makePubkeyAnyFromAccount(account, chainId) {
479
- const isEthermint = chunk7SK3IFXJ_cjs.getIsEthermint(chainId);
480
- const pubkey = isEthermint ? encodeEthSecp256k1Pubkey(account.pubkey) : amino.encodeSecp256k1Pubkey(account.pubkey);
473
+ const isEthermint = getIsEthermint(chainId);
474
+ const pubkey = isEthermint ? encodeEthSecp256k1Pubkey(account.pubkey) : encodeSecp256k1Pubkey(account.pubkey);
481
475
  const pubkeyAny = encodePubkeyToAny(pubkey, chainId, isEthermint);
482
476
  return pubkeyAny;
483
477
  }
484
478
  function encodePubkeyToAny(pubkey, chainId, isEthermint) {
485
479
  if (isEthermint) {
486
- const pubkeyProto = keys_js.PubKey.fromPartial({
487
- key: encoding.fromBase64(pubkey.value)
480
+ const pubkeyProto = PubKey.fromPartial({
481
+ key: fromBase64(pubkey.value)
488
482
  });
489
483
  let typeUrl = "";
490
484
  if (chainId?.includes("injective")) {
@@ -492,22 +486,22 @@ function encodePubkeyToAny(pubkey, chainId, isEthermint) {
492
486
  } else {
493
487
  typeUrl = "/ethermint.crypto.v1.ethsecp256k1.PubKey";
494
488
  }
495
- return any_js.Any.fromPartial({
489
+ return Any.fromPartial({
496
490
  typeUrl,
497
- value: Uint8Array.from(keys_js.PubKey.encode(pubkeyProto).finish())
491
+ value: Uint8Array.from(PubKey.encode(pubkeyProto).finish())
498
492
  });
499
493
  } else {
500
- const isInitia = chunk7SK3IFXJ_cjs.getIsInitia(chainId);
501
- const pubkeyProto = keys_js.PubKey.fromPartial({
502
- key: encoding.fromBase64(pubkey.value)
494
+ const isInitia = getIsInitia(chainId);
495
+ const pubkeyProto = PubKey.fromPartial({
496
+ key: fromBase64(pubkey.value)
503
497
  });
504
498
  if (isInitia) {
505
- return any_js.Any.fromPartial({
499
+ return Any.fromPartial({
506
500
  typeUrl: "/initia.crypto.v1beta1.ethsecp256k1.PubKey",
507
- value: Uint8Array.from(keys_js.PubKey.encode(pubkeyProto).finish())
501
+ value: Uint8Array.from(PubKey.encode(pubkeyProto).finish())
508
502
  });
509
503
  }
510
- return protoSigning.encodePubkey(pubkey);
504
+ return encodePubkey(pubkey);
511
505
  }
512
506
  }
513
507
  var signCosmosMessageDirect = async (options) => {
@@ -545,22 +539,22 @@ var signCosmosMessageDirect = async (options) => {
545
539
  messages: messages2
546
540
  }
547
541
  };
548
- const txBodyBytes = chunkED2OY55G_cjs.ClientState.registry.encode(txBodyEncodeObject);
549
- const gasLimit = math.Int53.fromString(fee.gas).toNumber();
542
+ const txBodyBytes = ClientState.registry.encode(txBodyEncodeObject);
543
+ const gasLimit = Int53.fromString(fee.gas).toNumber();
550
544
  const pubkeyAny = makePubkeyAnyFromAccount(accountFromSigner, chainId);
551
- const authInfoBytes = protoSigning.makeAuthInfoBytes(
545
+ const authInfoBytes = makeAuthInfoBytes(
552
546
  [{ pubkey: pubkeyAny, sequence }],
553
547
  fee.amount,
554
548
  gasLimit,
555
549
  fee.granter,
556
550
  fee.payer
557
551
  );
558
- const signDoc = protoSigning.makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber);
552
+ const signDoc = makeSignDoc(txBodyBytes, authInfoBytes, chainId, accountNumber);
559
553
  const { signature, signed } = await signer.signDirect(signerAddress, signDoc);
560
- return tx_js.TxRaw.fromPartial({
554
+ return TxRaw.fromPartial({
561
555
  bodyBytes: signed.bodyBytes,
562
556
  authInfoBytes: signed.authInfoBytes,
563
- signatures: [encoding.fromBase64(signature.signature)]
557
+ signatures: [fromBase64(signature.signature)]
564
558
  });
565
559
  };
566
560
  var signCosmosMessageAmino = async (options) => {
@@ -578,13 +572,13 @@ var signCosmosMessageAmino = async (options) => {
578
572
  throw new Error("signCosmosMessageAmino: failed to retrieve account from signer");
579
573
  }
580
574
  const messages2 = cosmosMsgs.map((cosmosMsg) => getEncodeObjectFromCosmosMessage(cosmosMsg));
581
- const signMode = signing_js.SignMode.SIGN_MODE_LEGACY_AMINO_JSON;
582
- const msgs = messages2.map((msg) => chunkED2OY55G_cjs.ClientState.aminoTypes.toAmino(msg));
575
+ const signMode = SignMode.SIGN_MODE_LEGACY_AMINO_JSON;
576
+ const msgs = messages2.map((msg) => ClientState.aminoTypes.toAmino(msg));
583
577
  console.log("sign cosmos message amino", msgs, fee, signerChainId, "", accountNumber, sequence);
584
- const signDoc = amino.makeSignDoc(msgs, fee, signerChainId, "", accountNumber, sequence);
578
+ const signDoc = makeSignDoc$1(msgs, fee, signerChainId, "", accountNumber, sequence);
585
579
  const { signature, signed } = await signer.signAmino(signerAddress, signDoc);
586
580
  const signedTxBody = {
587
- messages: signed.msgs.map((msg) => chunkED2OY55G_cjs.ClientState.aminoTypes.fromAmino(msg)),
581
+ messages: signed.msgs.map((msg) => ClientState.aminoTypes.fromAmino(msg)),
588
582
  memo: signed.memo
589
583
  };
590
584
  signedTxBody.messages[0].value.memo = messages2[0].value.memo;
@@ -592,11 +586,11 @@ var signCosmosMessageAmino = async (options) => {
592
586
  typeUrl: "/cosmos.tx.v1beta1.TxBody",
593
587
  value: signedTxBody
594
588
  };
595
- const signedTxBodyBytes = chunkED2OY55G_cjs.ClientState.registry.encode(signedTxBodyEncodeObject);
596
- const signedGasLimit = math.Int53.fromString(signed.fee.gas).toNumber();
597
- const signedSequence = math.Int53.fromString(signed.sequence).toNumber();
589
+ const signedTxBodyBytes = ClientState.registry.encode(signedTxBodyEncodeObject);
590
+ const signedGasLimit = Int53.fromString(signed.fee.gas).toNumber();
591
+ const signedSequence = Int53.fromString(signed.sequence).toNumber();
598
592
  const pubkeyAny = makePubkeyAnyFromAccount(accountFromSigner, chainId);
599
- const signedAuthInfoBytes = protoSigning.makeAuthInfoBytes(
593
+ const signedAuthInfoBytes = makeAuthInfoBytes(
600
594
  [{ pubkey: pubkeyAny, sequence: signedSequence }],
601
595
  signed.fee.amount,
602
596
  signedGasLimit,
@@ -604,10 +598,10 @@ var signCosmosMessageAmino = async (options) => {
604
598
  signed.fee.payer,
605
599
  signMode
606
600
  );
607
- return tx_js.TxRaw.fromPartial({
601
+ return TxRaw.fromPartial({
608
602
  bodyBytes: signedTxBodyBytes,
609
603
  authInfoBytes: signedAuthInfoBytes,
610
- signatures: [encoding.fromBase64(signature.signature)]
604
+ signatures: [fromBase64(signature.signature)]
611
605
  });
612
606
  };
613
607
 
@@ -624,7 +618,7 @@ var executeCosmosTransaction = async ({
624
618
  const chainId = tx.cosmosTx?.chainId;
625
619
  const messages2 = tx.cosmosTx?.msgs;
626
620
  const currentUserAddress = userAddresses.find((x) => x.chainId === tx.cosmosTx?.chainId)?.address;
627
- const gasArray = chunkED2OY55G_cjs.ClientState.validateGasResults;
621
+ const gasArray = ClientState.validateGasResults;
628
622
  const gas = gasArray?.find((gas2) => gas2?.error !== null && gas2?.error !== void 0);
629
623
  if (typeof gas?.error === "string") {
630
624
  throw new Error(gas?.error);
@@ -639,7 +633,7 @@ var executeCosmosTransaction = async ({
639
633
  if (messages2 === void 0) {
640
634
  throw new Error("no messages found for tx");
641
635
  }
642
- const { stargateClient, signer } = await chunkD2MDLQQZ_cjs.getSigningStargateClient({
636
+ const { stargateClient, signer } = await getSigningStargateClient({
643
637
  chainId,
644
638
  getOfflineSigner: options?.getCosmosSigner
645
639
  });
@@ -673,7 +667,7 @@ var executeCosmosTransaction = async ({
673
667
  chainId
674
668
  }
675
669
  };
676
- if (protoSigning.isOfflineDirectSigner(signer)) {
670
+ if (isOfflineDirectSigner(signer)) {
677
671
  rawTx = await signCosmosMessageDirect({
678
672
  ...commonRawTxBody,
679
673
  signer
@@ -684,7 +678,7 @@ var executeCosmosTransaction = async ({
684
678
  options?.onTransactionSigned?.({
685
679
  chainId
686
680
  });
687
- const txBytes = tx_js.TxRaw.encode(rawTx).finish();
681
+ const txBytes = TxRaw.encode(rawTx).finish();
688
682
  const txResponse = await stargateClient.broadcastTx(txBytes);
689
683
  return {
690
684
  chainId: tx?.cosmosTx?.chainId ?? "",
@@ -894,13 +888,13 @@ var erc20ABI = /* @__PURE__ */ createAbi([
894
888
 
895
889
  // src/private-functions/evm/executeEvmTransaction.ts
896
890
  var executeEvmTransaction = async (message, options) => {
897
- const gasArray = chunkED2OY55G_cjs.ClientState.validateGasResults;
891
+ const gasArray = ClientState.validateGasResults;
898
892
  const gas = gasArray?.find((gas2) => gas2?.error !== null && gas2?.error !== void 0);
899
893
  if (typeof gas?.error === "string") {
900
894
  throw new Error(gas?.error);
901
895
  }
902
896
  const { evmTx } = message;
903
- const getEvmSigner = options.getEvmSigner || chunkED2OY55G_cjs.ClientState.getEvmSigner;
897
+ const getEvmSigner = options.getEvmSigner || ClientState.getEvmSigner;
904
898
  if (!getEvmSigner) {
905
899
  throw new Error("Unable to get EVM signer");
906
900
  }
@@ -918,7 +912,7 @@ var executeEvmTransaction = async (message, options) => {
918
912
  throw new Error("executeEVMTransaction error: no value found in evmTx");
919
913
  }
920
914
  const { onApproveAllowance, onTransactionSigned, bypassApprovalCheck, useUnlimitedApproval } = options;
921
- const extendedSigner = evmSigner.extend(viem.publicActions);
915
+ const extendedSigner = evmSigner.extend(publicActions);
922
916
  if (!bypassApprovalCheck && evmTx.requiredErc20Approvals) {
923
917
  for (const requiredApproval of evmTx.requiredErc20Approvals) {
924
918
  const allowance = await extendedSigner.readContract({
@@ -947,7 +941,7 @@ var executeEvmTransaction = async (message, options) => {
947
941
  functionName: "approve",
948
942
  args: [
949
943
  requiredApproval.spender,
950
- useUnlimitedApproval ? viem.maxUint256 : BigInt(requiredApproval.amount) + BigInt(1e3)
944
+ useUnlimitedApproval ? maxUint256 : BigInt(requiredApproval.amount) + BigInt(1e3)
951
945
  ],
952
946
  chain: evmSigner.chain
953
947
  });
@@ -980,7 +974,7 @@ var executeEvmTransaction = async (message, options) => {
980
974
  return receipt;
981
975
  };
982
976
  var executeSvmTransaction = async (tx, options) => {
983
- const gasArray = chunkED2OY55G_cjs.ClientState.validateGasResults;
977
+ const gasArray = ClientState.validateGasResults;
984
978
  if (tx === void 0) {
985
979
  throw new Error("executeSvmTransaction error: tx is undefined");
986
980
  }
@@ -989,7 +983,7 @@ var executeSvmTransaction = async (tx, options) => {
989
983
  throw new Error(gas?.error);
990
984
  }
991
985
  const svmTx = tx?.svmTx;
992
- const getSvmSigner = options?.getSvmSigner || chunkED2OY55G_cjs.ClientState.getSvmSigner;
986
+ const getSvmSigner = options?.getSvmSigner || ClientState.getSvmSigner;
993
987
  if (!getSvmSigner) {
994
988
  throw new Error(
995
989
  "executeRoute error: 'getSVMSigner' is not provided or configured in skip router"
@@ -1000,15 +994,15 @@ var executeSvmTransaction = async (tx, options) => {
1000
994
  throw new Error("executeSvmTransaction error: chainId not found in svmTx");
1001
995
  }
1002
996
  const txBuffer = Buffer.from(svmTx.tx ?? "", "base64");
1003
- const transaction = web3_js.Transaction.from(txBuffer);
1004
- const endpoint = await chunkD2MDLQQZ_cjs.getRpcEndpointForChain(svmTx.chainId);
1005
- const connection = new web3_js.Connection(endpoint);
997
+ const transaction = Transaction.from(txBuffer);
998
+ const endpoint = await getRpcEndpointForChain(svmTx.chainId);
999
+ const connection = new Connection(endpoint);
1006
1000
  let signature;
1007
1001
  if ("signTransaction" in signer) {
1008
1002
  const signedTx = await signer.signTransaction(transaction);
1009
1003
  options?.onTransactionSigned?.({ chainId: svmTx.chainId });
1010
1004
  const serializedTx = signedTx.serialize();
1011
- await chunkL5V5PASH_cjs.submitTransaction({
1005
+ await submitTransaction({
1012
1006
  chainId: svmTx.chainId,
1013
1007
  tx: serializedTx.toString("base64")
1014
1008
  }).then((res) => {
@@ -1037,13 +1031,13 @@ var executeSvmTransaction = async (tx, options) => {
1037
1031
  };
1038
1032
  }
1039
1033
  if (getStatusCount > 12) {
1040
- await chunkHAR3IXDE_cjs.wait(3e3);
1034
+ await wait(3e3);
1041
1035
  throw new Error(
1042
1036
  `executeSvmTransaction error: waiting finalized status timed out for ${signature}`
1043
1037
  );
1044
1038
  }
1045
1039
  getStatusCount++;
1046
- await chunkHAR3IXDE_cjs.wait(3e3);
1040
+ await wait(3e3);
1047
1041
  } catch (error) {
1048
1042
  errorCount++;
1049
1043
  if (errorCount > 12) {
@@ -1083,8 +1077,8 @@ var validateCosmosGasBalance = async ({
1083
1077
  txIndex,
1084
1078
  simulate
1085
1079
  }) => {
1086
- const skipAssets = (await chunkED2OY55G_cjs.ClientState.getSkipAssets({ chainId }))?.[chainId];
1087
- const skipChains = await chunkED2OY55G_cjs.ClientState.getSkipChains();
1080
+ const skipAssets = (await ClientState.getSkipAssets({ chainId }))?.[chainId];
1081
+ const skipChains = await ClientState.getSkipChains();
1088
1082
  const chain = skipChains?.find((c) => c.chainId === chainId);
1089
1083
  if (!chain) {
1090
1084
  throw new Error(`failed to find chain id for '${chainId}'`);
@@ -1099,7 +1093,7 @@ var validateCosmosGasBalance = async ({
1099
1093
  if (txIndex !== 0 && chainId === "noble-1") {
1100
1094
  return "0";
1101
1095
  }
1102
- const { stargateClient } = await chunkD2MDLQQZ_cjs.getSigningStargateClient({
1096
+ const { stargateClient } = await getSigningStargateClient({
1103
1097
  chainId,
1104
1098
  getOfflineSigner
1105
1099
  });
@@ -1136,8 +1130,8 @@ var validateCosmosGasBalance = async ({
1136
1130
  price = asset.gasPrice.low;
1137
1131
  }
1138
1132
  if (!price) return;
1139
- return new stargate.GasPrice(
1140
- math.Decimal.fromUserInput(chunk4R6OCWRR_cjs.BigNumber(price).toFixed(), 18),
1133
+ return new GasPrice(
1134
+ Decimal.fromUserInput(BigNumber(price).toFixed(), 18),
1141
1135
  asset?.denom ?? ""
1142
1136
  );
1143
1137
  })();
@@ -1145,12 +1139,12 @@ var validateCosmosGasBalance = async ({
1145
1139
  return null;
1146
1140
  }
1147
1141
  if (chainId === "noble-1") {
1148
- const fee = stargate.calculateFee(2e5, gasPrice);
1142
+ const fee = calculateFee(2e5, gasPrice);
1149
1143
  return fee;
1150
1144
  }
1151
- return stargate.calculateFee(Math.ceil(parseFloat(estimatedGasAmount)), gasPrice);
1145
+ return calculateFee(Math.ceil(parseFloat(estimatedGasAmount)), gasPrice);
1152
1146
  });
1153
- const feeBalance = await chunkED2OY55G_cjs.balances({
1147
+ const feeBalance = await balances({
1154
1148
  chains: {
1155
1149
  [chainId]: {
1156
1150
  address: signerAddress,
@@ -1199,8 +1193,8 @@ var validateCosmosGasBalance = async ({
1199
1193
  };
1200
1194
  }
1201
1195
  if (parseInt(balance?.amount ?? "") < parseInt(fee.amount[0]?.amount)) {
1202
- const userAmount = new chunk4R6OCWRR_cjs.BigNumber(parseFloat(balance?.amount ?? "")).shiftedBy(-decimal).toFixed(decimal);
1203
- const feeAmount = new chunk4R6OCWRR_cjs.BigNumber(parseFloat(fee.amount[0]?.amount)).shiftedBy(-decimal).toFixed(decimal);
1196
+ const userAmount = new BigNumber(parseFloat(balance?.amount ?? "")).shiftedBy(-decimal).toFixed(decimal);
1197
+ const feeAmount = new BigNumber(parseFloat(fee.amount[0]?.amount)).shiftedBy(-decimal).toFixed(decimal);
1204
1198
  return {
1205
1199
  error: `Insufficient balance for gas on ${chain?.prettyName}. Need ${feeAmount} ${symbol} but only have ${userAmount} ${symbol}.`,
1206
1200
  asset
@@ -1237,7 +1231,7 @@ var validateEvmTokenApproval = async ({
1237
1231
  throw new Error("validateEvmGasBalance: Signer address not found");
1238
1232
  }
1239
1233
  for (const requiredApproval of requiredErc20Approvals) {
1240
- const extendedSigner = signer.extend(viem.publicActions);
1234
+ const extendedSigner = signer.extend(publicActions);
1241
1235
  const allowance = await extendedSigner.readContract({
1242
1236
  address: requiredApproval.tokenContract,
1243
1237
  abi: erc20ABI,
@@ -1250,7 +1244,7 @@ var validateEvmTokenApproval = async ({
1250
1244
  const fee = await extendedSigner.estimateFeesPerGas();
1251
1245
  const allowanceGasFee = BigInt(fee.maxFeePerGas) * BigInt(1e5);
1252
1246
  if (!gasBalance) {
1253
- const chainAssets = (await chunkED2OY55G_cjs.ClientState.getSkipAssets({ chainId: tx.chainId }))[tx.chainId];
1247
+ const chainAssets = (await ClientState.getSkipAssets({ chainId: tx.chainId }))[tx.chainId];
1254
1248
  const nativeAsset = chainAssets?.find((x) => x.denom.includes("-native"));
1255
1249
  const zeroAddressAsset = chainAssets?.find(
1256
1250
  (x) => x.denom.toLowerCase() === "0x0000000000000000000000000000000000000000"
@@ -1261,13 +1255,13 @@ var validateEvmTokenApproval = async ({
1261
1255
  `Insufficient balance for gas on ${chain.prettyName}. Need ${allowanceGasFee} gwei.`
1262
1256
  );
1263
1257
  }
1264
- const formattedGasAmount = viem.formatUnits(allowanceGasFee, asset?.decimals);
1258
+ const formattedGasAmount = formatUnits(allowanceGasFee, asset?.decimals);
1265
1259
  throw new Error(
1266
1260
  `Insufficient balance for gas on ${chain.prettyName}. Need ${formattedGasAmount} ${asset.symbol}.`
1267
1261
  );
1268
1262
  }
1269
- if (chunk4R6OCWRR_cjs.BigNumber(gasBalance.amount).lt(Number(allowanceGasFee))) {
1270
- const chainAssets = (await chunkED2OY55G_cjs.ClientState.getSkipAssets({ chainId: tx.chainId }))[tx.chainId];
1263
+ if (BigNumber(gasBalance.amount).lt(Number(allowanceGasFee))) {
1264
+ const chainAssets = (await ClientState.getSkipAssets({ chainId: tx.chainId }))[tx.chainId];
1271
1265
  const asset = chainAssets?.find(
1272
1266
  (x) => x.denom.includes("-native") || x.denom.toLowerCase() === "0x0000000000000000000000000000000000000000"
1273
1267
  );
@@ -1278,7 +1272,7 @@ var validateEvmTokenApproval = async ({
1278
1272
  fee: null
1279
1273
  };
1280
1274
  }
1281
- const formattedGasAmount = viem.formatUnits(allowanceGasFee, asset?.decimals);
1275
+ const formattedGasAmount = formatUnits(allowanceGasFee, asset?.decimals);
1282
1276
  return {
1283
1277
  error: `Insufficient balance for gas on ${chain.prettyName}. Need ${formattedGasAmount} ${asset.symbol} but only have ${gasBalance.formattedAmount} ${asset.symbol}.`,
1284
1278
  asset: null,
@@ -1292,7 +1286,7 @@ var validateEvmTokenApproval = async ({
1292
1286
  functionName: "approve",
1293
1287
  args: [
1294
1288
  requiredApproval.spender,
1295
- useUnlimitedApproval ? viem.maxUint256 : BigInt(requiredApproval.amount) + BigInt(1e3)
1289
+ useUnlimitedApproval ? maxUint256 : BigInt(requiredApproval.amount) + BigInt(1e3)
1296
1290
  ],
1297
1291
  chain: signer.chain
1298
1292
  });
@@ -1309,7 +1303,7 @@ var validateEvmTokenApproval = async ({
1309
1303
  async function getEVMGasAmountForMessage(signer, tx, getFallbackGasAmount) {
1310
1304
  const { to, data, value } = tx;
1311
1305
  if (!signer.account) throw new Error("estimateGasForEvmTx: No account found");
1312
- const extendedSigner = signer.extend(viem.publicActions);
1306
+ const extendedSigner = signer.extend(publicActions);
1313
1307
  const fee = await extendedSigner.estimateFeesPerGas();
1314
1308
  try {
1315
1309
  const gasAmount = await extendedSigner.estimateGas({
@@ -1336,8 +1330,8 @@ var validateEvmGasBalance = async ({
1336
1330
  useUnlimitedApproval
1337
1331
  }) => {
1338
1332
  const chainId = tx?.chainId ?? "";
1339
- const skipAssets = (await chunkED2OY55G_cjs.ClientState.getSkipAssets({ chainId }))?.[chainId];
1340
- const skipChains = await chunkED2OY55G_cjs.ClientState.getSkipChains();
1333
+ const skipAssets = (await ClientState.getSkipAssets({ chainId }))?.[chainId];
1334
+ const skipChains = await ClientState.getSkipChains();
1341
1335
  const chain = skipChains?.find?.((chain2) => chain2.chainId === chainId);
1342
1336
  if (!chain) {
1343
1337
  throw new Error(`failed to find chain for chainId: '${chainId}'`);
@@ -1345,7 +1339,7 @@ var validateEvmGasBalance = async ({
1345
1339
  if (!signer.account?.address) {
1346
1340
  throw new Error("validateEvmGasBalance: Signer address not found");
1347
1341
  }
1348
- const skipBalances = (await chunkED2OY55G_cjs.balances({
1342
+ const skipBalances = (await balances({
1349
1343
  chains: {
1350
1344
  [tx?.chainId ?? ""]: {
1351
1345
  address: signer.account?.address
@@ -1391,14 +1385,14 @@ var validateEvmGasBalance = async ({
1391
1385
  fee: null
1392
1386
  };
1393
1387
  }
1394
- const formattedGasAmount = viem.formatUnits(gasAmount, asset?.decimals);
1388
+ const formattedGasAmount = formatUnits(gasAmount, asset?.decimals);
1395
1389
  return {
1396
1390
  error: `Insufficient balance for gas on ${chain.prettyName}. Need ${formattedGasAmount} ${asset.symbol}.`,
1397
1391
  asset: null,
1398
1392
  fee: null
1399
1393
  };
1400
1394
  }
1401
- if (chunk4R6OCWRR_cjs.BigNumber(gasBalance.amount ?? "").lt(Number(gasAmount))) {
1395
+ if (BigNumber(gasBalance.amount ?? "").lt(Number(gasAmount))) {
1402
1396
  const asset = skipAssets?.find(
1403
1397
  (x) => x.denom?.includes("-native") || x.denom?.toLowerCase() === "0x0000000000000000000000000000000000000000"
1404
1398
  );
@@ -1409,7 +1403,7 @@ var validateEvmGasBalance = async ({
1409
1403
  fee: null
1410
1404
  };
1411
1405
  }
1412
- const formattedGasAmount = viem.formatUnits(gasAmount, asset?.decimals);
1406
+ const formattedGasAmount = formatUnits(gasAmount, asset?.decimals);
1413
1407
  return {
1414
1408
  error: `Insufficient balance for gas on ${chain.prettyName}. Need ${formattedGasAmount} ${asset.symbol} but only have ${gasBalance.formattedAmount} ${asset.symbol}.`,
1415
1409
  asset: null,
@@ -1421,8 +1415,8 @@ var validateSvmGasBalance = async ({
1421
1415
  tx
1422
1416
  }) => {
1423
1417
  if (!tx) throw new Error("Transaction is required");
1424
- const endpoint = await chunkD2MDLQQZ_cjs.getRpcEndpointForChain(tx.chainId ?? "");
1425
- const connection = new web3_js.Connection(endpoint);
1418
+ const endpoint = await getRpcEndpointForChain(tx.chainId ?? "");
1419
+ const connection = new Connection(endpoint);
1426
1420
  if (!connection) throw new Error(`Failed to connect to ${tx.chainId}`);
1427
1421
  if (!tx.tx) {
1428
1422
  throw new Error("Transaction is required");
@@ -1430,7 +1424,7 @@ var validateSvmGasBalance = async ({
1430
1424
  const txBuffer = Buffer.from(tx.tx, "base64");
1431
1425
  let transaction;
1432
1426
  try {
1433
- transaction = web3_js.Transaction.from(txBuffer);
1427
+ transaction = Transaction.from(txBuffer);
1434
1428
  } catch (decodeError) {
1435
1429
  return {
1436
1430
  success: false,
@@ -1472,7 +1466,7 @@ function getSolShortfall(logs) {
1472
1466
  const have = parseInt(m[1] ?? "0", 10);
1473
1467
  const need = parseInt(m[2] ?? "0", 10);
1474
1468
  const shortfallLamports = need - have;
1475
- return shortfallLamports / web3_js.LAMPORTS_PER_SOL;
1469
+ return shortfallLamports / LAMPORTS_PER_SOL;
1476
1470
  }
1477
1471
 
1478
1472
  // src/private-functions/validateGasBalances.ts
@@ -1569,13 +1563,13 @@ var validateGasBalances = async ({
1569
1563
  onValidateGasBalance?.({
1570
1564
  status: "error"
1571
1565
  });
1572
- chunkED2OY55G_cjs.ClientState.validateGasResults = validateResult;
1566
+ ClientState.validateGasResults = validateResult;
1573
1567
  throw new Error(`${txError.error}`);
1574
1568
  }
1575
1569
  onValidateGasBalance?.({
1576
1570
  status: "completed"
1577
1571
  });
1578
- chunkED2OY55G_cjs.ClientState.validateGasResults = validateResult;
1572
+ ClientState.validateGasResults = validateResult;
1579
1573
  };
1580
1574
 
1581
1575
  // src/private-functions/waitForTransaction.ts
@@ -1584,13 +1578,13 @@ var waitForTransaction = async ({
1584
1578
  txHash,
1585
1579
  onTransactionTracked
1586
1580
  }) => {
1587
- const { explorerLink } = await chunkKDN7RCGP_cjs.trackTransaction({
1581
+ const { explorerLink } = await trackTransaction({
1588
1582
  chainId,
1589
1583
  txHash
1590
1584
  });
1591
1585
  await onTransactionTracked?.({ txHash, chainId, explorerLink });
1592
1586
  while (true) {
1593
- const txStatusResponse = await chunkDAMZSSOH_cjs.transactionStatus({
1587
+ const txStatusResponse = await transactionStatus({
1594
1588
  chainId,
1595
1589
  txHash
1596
1590
  });
@@ -1603,7 +1597,7 @@ var waitForTransaction = async ({
1603
1597
  if (txStatusResponse.state === "STATE_ABANDONED") {
1604
1598
  throw new Error("Tracking for the transaction has been abandoned");
1605
1599
  }
1606
- await chunkHAR3IXDE_cjs.wait(1e3);
1600
+ await wait(1e3);
1607
1601
  }
1608
1602
  };
1609
1603
 
@@ -1640,10 +1634,10 @@ var executeTransactions = async (options) => {
1640
1634
  }
1641
1635
  });
1642
1636
  const isGasStationSourceEVM = chainIds.find((item, i, array) => {
1643
- return chunkKZOSEIWH_cjs.GAS_STATION_CHAIN_IDS.includes(item?.chainId ?? "") && array[i - 1]?.chainType === "evm";
1637
+ return GAS_STATION_CHAIN_IDS.includes(item?.chainId ?? "") && array[i - 1]?.chainType === "evm";
1644
1638
  });
1645
- chunkED2OY55G_cjs.ClientState.validateGasResults = void 0;
1646
- const validateChainIds = !batchSimulate ? chainIds.map((x) => x?.chainId ?? "") : isGasStationSourceEVM ? chunkKZOSEIWH_cjs.GAS_STATION_CHAIN_IDS : [];
1639
+ ClientState.validateGasResults = void 0;
1640
+ const validateChainIds = !batchSimulate ? chainIds.map((x) => x?.chainId ?? "") : isGasStationSourceEVM ? GAS_STATION_CHAIN_IDS : [];
1647
1641
  await validateGasBalances({
1648
1642
  txs,
1649
1643
  getFallbackGasAmount: options.getFallbackGasAmount,
@@ -1722,7 +1716,7 @@ var executeRoute = async (options) => {
1722
1716
  if (!isUserAddressesValid) {
1723
1717
  throw new Error("executeRoute error: invalid user addresses");
1724
1718
  }
1725
- const response = await chunk32MRDO7V_cjs.messages({
1719
+ const response = await messages({
1726
1720
  timeoutSeconds,
1727
1721
  amountIn: route?.amountIn,
1728
1722
  amountOut: route.estimatedAmountOut || "0",
@@ -1733,7 +1727,7 @@ var executeRoute = async (options) => {
1733
1727
  operations: route?.operations,
1734
1728
  addressList,
1735
1729
  slippageTolerancePercent: options.slippageTolerancePercent || "1",
1736
- chainIdsToAffiliates: chunkHAR3IXDE_cjs.ApiState.chainIdsToAffiliates
1730
+ chainIdsToAffiliates: ApiState.chainIdsToAffiliates
1737
1731
  });
1738
1732
  if (beforeMsg && (response?.txs?.length ?? 0) > 0) {
1739
1733
  const firstTx = response?.txs?.[0];
@@ -1750,7 +1744,7 @@ var executeRoute = async (options) => {
1750
1744
  await executeTransactions({ ...options, txs: response?.txs });
1751
1745
  };
1752
1746
  var validateUserAddresses = async (userAddresses) => {
1753
- const chains2 = await chunkED2OY55G_cjs.ClientState.getSkipChains();
1747
+ const chains2 = await ClientState.getSkipChains();
1754
1748
  const validations = userAddresses.map((userAddress) => {
1755
1749
  const chain = chains2.find((chain2) => chain2.chainId === userAddress.chainId);
1756
1750
  switch (chain?.chainType) {
@@ -1758,27 +1752,27 @@ var validateUserAddresses = async (userAddresses) => {
1758
1752
  try {
1759
1753
  if (chain.chainId?.includes("penumbra")) {
1760
1754
  try {
1761
- return chain.bech32Prefix === bech32.bech32m.decode(userAddress.address, 143)?.prefix;
1755
+ return chain.bech32Prefix === bech32m.decode(userAddress.address, 143)?.prefix;
1762
1756
  } catch {
1763
1757
  return ["penumbracompat1", "tpenumbra"].includes(
1764
- bech32.bech32.decode(userAddress.address, 1023).prefix
1758
+ bech32.decode(userAddress.address, 1023).prefix
1765
1759
  );
1766
1760
  }
1767
1761
  }
1768
- return chain.bech32Prefix === bech32.bech32.decode(userAddress.address, 1023).prefix;
1762
+ return chain.bech32Prefix === bech32.decode(userAddress.address, 1023).prefix;
1769
1763
  } catch {
1770
1764
  return false;
1771
1765
  }
1772
1766
  case "evm" /* Evm */:
1773
1767
  try {
1774
- return viem.isAddress(userAddress.address);
1768
+ return isAddress(userAddress.address);
1775
1769
  } catch (_error) {
1776
1770
  return false;
1777
1771
  }
1778
1772
  case "svm" /* Svm */:
1779
1773
  try {
1780
- const publicKey = new web3_js.PublicKey(userAddress.address);
1781
- return web3_js.PublicKey.isOnCurve(publicKey);
1774
+ const publicKey = new PublicKey(userAddress.address);
1775
+ return PublicKey.isOnCurve(publicKey);
1782
1776
  } catch (_error) {
1783
1777
  return false;
1784
1778
  }
@@ -1789,4 +1783,4 @@ var validateUserAddresses = async (userAddresses) => {
1789
1783
  return validations.every((validation) => validation);
1790
1784
  };
1791
1785
 
1792
- exports.executeRoute = executeRoute;
1786
+ export { executeRoute };