@skip-go/client 1.0.3-alpha-0 → 1.0.4

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