@skip-go/client 1.0.0 → 1.0.1-alpha-1

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 (101) hide show
  1. package/dist/api/getAssets.js +2 -0
  2. package/dist/api/getAssetsBetweenChains.js +2 -0
  3. package/dist/api/getBridges.js +2 -0
  4. package/dist/api/getChains.js +2 -0
  5. package/dist/api/getVenues.js +2 -0
  6. package/dist/api/postAssetsFromSource.js +3 -0
  7. package/dist/api/postBalances.js +2 -0
  8. package/dist/api/postIbcOriginAssets.js +2 -0
  9. package/dist/api/postMessages.js +2 -0
  10. package/dist/api/postMessagesDirect.js +2 -0
  11. package/dist/api/postRecommendAssets.js +2 -0
  12. package/dist/api/postRoute.js +2 -0
  13. package/dist/api/postSubmitTransaction.js +2 -0
  14. package/dist/api/postTrackTransaction.js +2 -0
  15. package/dist/api/postTransactionStatus.js +2 -0
  16. package/dist/{chunk-C5CGY2X7.mjs → chunk-33K6EESX.js} +1 -1
  17. package/dist/{chunk-ZMEQSFOL.mjs → chunk-3N7XVGLX.js} +18 -23
  18. package/dist/{chunk-OTLFF5OB.mjs → chunk-3OZQ35X3.js} +101 -138
  19. package/dist/{chunk-7TBBV2YY.mjs → chunk-4JJWOILI.js} +1 -1
  20. package/dist/{chunk-QZ3X6MP3.mjs → chunk-BQTQJQ5E.js} +1 -1
  21. package/dist/{chunk-IHIJJNTV.mjs → chunk-BRJDNGYH.js} +6 -7
  22. package/dist/chunk-BRMONS6A.js +130 -0
  23. package/dist/{chunk-NNZFCKHP.mjs → chunk-C2EDPY6J.js} +1 -1
  24. package/dist/{chunk-KPK3Z6QZ.mjs → chunk-DW4U6YI6.js} +1 -1
  25. package/dist/chunk-GARVPN2H.js +16 -0
  26. package/dist/{chunk-NU7MCJOK.mjs → chunk-JTIHU43D.js} +32 -36
  27. package/dist/{chunk-J7GGREYX.mjs → chunk-KNV72XRZ.js} +1 -1
  28. package/dist/{chunk-CAAR7GDJ.mjs → chunk-MGVXJ2U4.js} +1 -1
  29. package/dist/{chunk-IGD32L7C.mjs → chunk-MTMPHY3Y.js} +1 -1
  30. package/dist/{chunk-CZ27FEZ7.mjs → chunk-PRQ2NHRZ.js} +1 -1
  31. package/dist/{chunk-LJVI5DLG.mjs → chunk-RDRDFJQE.js} +1 -1
  32. package/dist/{chunk-YWYU6P7W.mjs → chunk-RMP3HM5N.js} +2 -2
  33. package/dist/{chunk-DZQJN6OX.mjs → chunk-SQGWZAUC.js} +76 -86
  34. package/dist/{chunk-2ETF4N4H.mjs → chunk-TW77BXMT.js} +4 -5
  35. package/dist/{chunk-2F4MBSMT.mjs → chunk-VMPFHQ7U.js} +14 -20
  36. package/dist/chunk-W6TBGBV3.js +675 -0
  37. package/dist/chunk-Y5EY3Q6D.js +1790 -0
  38. package/dist/index.js +24 -0
  39. package/dist/public-functions/executeRoute.js +12 -0
  40. package/dist/public-functions/getFeeInfoForChain.js +5 -0
  41. package/dist/public-functions/getRecommendedGasPrice.js +7 -0
  42. package/dist/public-functions/getSigningStargateClient.js +4 -0
  43. package/dist/public-functions/setApiOptions.js +2 -0
  44. package/dist/public-functions/setClientOptions.js +4 -0
  45. package/package.json +12 -3
  46. package/dist/api/getAssets.d.mts +0 -19
  47. package/dist/api/getAssets.mjs +0 -2
  48. package/dist/api/getAssetsBetweenChains.d.mts +0 -56
  49. package/dist/api/getAssetsBetweenChains.mjs +0 -2
  50. package/dist/api/getBridges.d.mts +0 -54
  51. package/dist/api/getBridges.mjs +0 -2
  52. package/dist/api/getChains.d.mts +0 -41
  53. package/dist/api/getChains.mjs +0 -2
  54. package/dist/api/getVenues.d.mts +0 -13
  55. package/dist/api/getVenues.mjs +0 -2
  56. package/dist/api/postAssetsFromSource.d.mts +0 -13
  57. package/dist/api/postAssetsFromSource.mjs +0 -3
  58. package/dist/api/postBalances.d.mts +0 -35
  59. package/dist/api/postBalances.mjs +0 -2
  60. package/dist/api/postIbcOriginAssets.d.mts +0 -32
  61. package/dist/api/postIbcOriginAssets.mjs +0 -2
  62. package/dist/api/postMessages.d.mts +0 -528
  63. package/dist/api/postMessages.mjs +0 -2
  64. package/dist/api/postMessagesDirect.d.mts +0 -568
  65. package/dist/api/postMessagesDirect.mjs +0 -2
  66. package/dist/api/postRecommendAssets.d.mts +0 -40
  67. package/dist/api/postRecommendAssets.mjs +0 -2
  68. package/dist/api/postRoute.d.mts +0 -460
  69. package/dist/api/postRoute.mjs +0 -2
  70. package/dist/api/postSubmitTransaction.d.mts +0 -13
  71. package/dist/api/postSubmitTransaction.mjs +0 -2
  72. package/dist/api/postTrackTransaction.d.mts +0 -13
  73. package/dist/api/postTrackTransaction.mjs +0 -2
  74. package/dist/api/postTransactionStatus.d.mts +0 -559
  75. package/dist/api/postTransactionStatus.mjs +0 -2
  76. package/dist/apiState-CdzxTxYd.d.mts +0 -6
  77. package/dist/chunk-2FYLP573.mjs +0 -15
  78. package/dist/chunk-DKIWPD5I.mjs +0 -124
  79. package/dist/chunk-I2MX24LT.mjs +0 -2316
  80. package/dist/chunk-RXWDHQLG.mjs +0 -231
  81. package/dist/client-types-CVch1pZ-.d.mts +0 -60
  82. package/dist/executeRoute-CRdeEz1o.d.mts +0 -69
  83. package/dist/generateApi-3mHZ6Zbr.d.mts +0 -22
  84. package/dist/index.d.mts +0 -37
  85. package/dist/index.mjs +0 -24
  86. package/dist/public-functions/executeRoute.d.mts +0 -9
  87. package/dist/public-functions/executeRoute.mjs +0 -12
  88. package/dist/public-functions/getFeeInfoForChain.d.mts +0 -9
  89. package/dist/public-functions/getFeeInfoForChain.mjs +0 -5
  90. package/dist/public-functions/getRecommendedGasPrice.d.mts +0 -9
  91. package/dist/public-functions/getRecommendedGasPrice.mjs +0 -7
  92. package/dist/public-functions/getSigningStargateClient.d.mts +0 -13
  93. package/dist/public-functions/getSigningStargateClient.mjs +0 -4
  94. package/dist/public-functions/setApiOptions.d.mts +0 -9
  95. package/dist/public-functions/setApiOptions.mjs +0 -2
  96. package/dist/public-functions/setClientOptions.d.mts +0 -9
  97. package/dist/public-functions/setClientOptions.mjs +0 -4
  98. package/dist/setClientOptions-CVB_OUIn.d.mts +0 -19
  99. package/dist/swaggerTypes-O9-gvCT1.d.mts +0 -1890
  100. /package/dist/{chunk-ZAF3Z56R.mjs → chunk-SWYON2RG.js} +0 -0
  101. /package/dist/{chunk-TUBI6VE6.mjs → chunk-VQ5SIQWU.js} +0 -0
@@ -0,0 +1,2 @@
1
+ export { assets, transformAssetsMap } from '../chunk-BRMONS6A.js';
2
+ import '../chunk-W6TBGBV3.js';
@@ -0,0 +1,2 @@
1
+ export { assetsBetweenChains } from '../chunk-MTMPHY3Y.js';
2
+ import '../chunk-W6TBGBV3.js';
@@ -0,0 +1,2 @@
1
+ export { bridges } from '../chunk-KNV72XRZ.js';
2
+ import '../chunk-W6TBGBV3.js';
@@ -0,0 +1,2 @@
1
+ export { chains } from '../chunk-BRMONS6A.js';
2
+ import '../chunk-W6TBGBV3.js';
@@ -0,0 +1,2 @@
1
+ export { venues } from '../chunk-C2EDPY6J.js';
2
+ import '../chunk-W6TBGBV3.js';
@@ -0,0 +1,3 @@
1
+ export { assetsFromSource } from '../chunk-RMP3HM5N.js';
2
+ import '../chunk-BRMONS6A.js';
3
+ import '../chunk-W6TBGBV3.js';
@@ -0,0 +1,2 @@
1
+ export { balances } from '../chunk-BRMONS6A.js';
2
+ import '../chunk-W6TBGBV3.js';
@@ -0,0 +1,2 @@
1
+ export { ibcOriginAssets } from '../chunk-PRQ2NHRZ.js';
2
+ import '../chunk-W6TBGBV3.js';
@@ -0,0 +1,2 @@
1
+ export { messages } from '../chunk-DW4U6YI6.js';
2
+ import '../chunk-W6TBGBV3.js';
@@ -0,0 +1,2 @@
1
+ export { messagesDirect } from '../chunk-BQTQJQ5E.js';
2
+ import '../chunk-W6TBGBV3.js';
@@ -0,0 +1,2 @@
1
+ export { recommendAssets } from '../chunk-4JJWOILI.js';
2
+ import '../chunk-W6TBGBV3.js';
@@ -0,0 +1,2 @@
1
+ export { route } from '../chunk-GARVPN2H.js';
2
+ import '../chunk-W6TBGBV3.js';
@@ -0,0 +1,2 @@
1
+ export { submitTransaction } from '../chunk-RDRDFJQE.js';
2
+ import '../chunk-W6TBGBV3.js';
@@ -0,0 +1,2 @@
1
+ export { trackTransaction } from '../chunk-MGVXJ2U4.js';
2
+ import '../chunk-W6TBGBV3.js';
@@ -0,0 +1,2 @@
1
+ export { transactionStatus } from '../chunk-33K6EESX.js';
2
+ import '../chunk-W6TBGBV3.js';
@@ -1,4 +1,4 @@
1
- import { pollingApi } from './chunk-RXWDHQLG.mjs';
1
+ import { pollingApi } from './chunk-W6TBGBV3.js';
2
2
 
3
3
  // src/api/postTransactionStatus.ts
4
4
  var transactionStatus = pollingApi({
@@ -1,8 +1,6 @@
1
- import { chains, findFirstWorkingEndpoint } from './chunk-NU7MCJOK.mjs';
2
- import { ClientState } from './chunk-DKIWPD5I.mjs';
3
- import { __async } from './chunk-RXWDHQLG.mjs';
4
- import { SigningStargateClient } from '@cosmjs/stargate/build/signingstargateclient';
5
- import { accountFromAny } from '@cosmjs/stargate';
1
+ import { chains, findFirstWorkingEndpoint } from './chunk-JTIHU43D.js';
2
+ import { ClientState } from './chunk-BRMONS6A.js';
3
+ import { accountFromAny, SigningStargateClient } from '@cosmjs/stargate';
6
4
  import { assertDefinedAndNotNull } from '@cosmjs/utils';
7
5
  import { BinaryWriter, BinaryReader } from 'cosmjs-types/binary';
8
6
  import { BaseAccount } from 'cosmjs-types/cosmos/auth/v1beta1/auth';
@@ -171,10 +169,9 @@ var StridePeriodicVestingAccount = {
171
169
  }
172
170
  };
173
171
  var accountParser = (acc) => {
174
- var _a;
175
172
  switch (acc.typeUrl) {
176
173
  case "/stride.vesting.StridePeriodicVestingAccount": {
177
- const baseAccount = (_a = StridePeriodicVestingAccount.decode(acc.value).baseVestingAccount) == null ? void 0 : _a.baseAccount;
174
+ const baseAccount = StridePeriodicVestingAccount.decode(acc.value).baseVestingAccount?.baseAccount;
178
175
  assertDefinedAndNotNull(baseAccount);
179
176
  return {
180
177
  address: baseAccount.address,
@@ -195,7 +192,7 @@ var accountParser = (acc) => {
195
192
  const { address, pubKey, accountNumber, sequence } = BaseAccount.decode(
196
193
  acc.value
197
194
  );
198
- if ((pubKey == null ? void 0 : pubKey.typeUrl) === "/initia.crypto.v1beta1.ethsecp256k1.PubKey") {
195
+ if (pubKey?.typeUrl === "/initia.crypto.v1beta1.ethsecp256k1.PubKey") {
199
196
  const { key } = PubKey.decode(pubKey.value);
200
197
  const pk = encodeSecp256k1Pubkey(key);
201
198
  return {
@@ -212,14 +209,13 @@ var accountParser = (acc) => {
212
209
  };
213
210
 
214
211
  // src/private-functions/getRpcEndpointForChain.ts
215
- var getRpcEndpointForChain = (chainId) => __async(void 0, null, function* () {
216
- var _a, _b, _c, _d, _e;
212
+ var getRpcEndpointForChain = async (chainId) => {
217
213
  if (ClientState.endpointOptions.getRpcEndpointForChain) {
218
214
  return ClientState.endpointOptions.getRpcEndpointForChain(chainId);
219
215
  }
220
216
  if (ClientState.endpointOptions.endpoints && ClientState.endpointOptions.endpoints[chainId]) {
221
217
  const endpointOptions = ClientState.endpointOptions.endpoints[chainId];
222
- if (endpointOptions == null ? void 0 : endpointOptions.rpc) {
218
+ if (endpointOptions?.rpc) {
223
219
  return endpointOptions.rpc;
224
220
  }
225
221
  }
@@ -230,36 +226,35 @@ var getRpcEndpointForChain = (chainId) => __async(void 0, null, function* () {
230
226
  if (!chain) {
231
227
  throw new Error(`getRpcEndpointForChain: failed to find chain id '${chainId}' in registry`);
232
228
  }
233
- if (((_b = (_a = chain.apis) == null ? void 0 : _a.rpc) == null ? void 0 : _b.length) === 0 || !((_c = chain.apis) == null ? void 0 : _c.rpc)) {
229
+ if (chain.apis?.rpc?.length === 0 || !chain.apis?.rpc) {
234
230
  throw new Error(
235
231
  `getRpcEndpointForChain error: failed to find RPC endpoint for chain '${chainId}'`
236
232
  );
237
233
  }
238
- const endpoints = (_e = (_d = chain.apis) == null ? void 0 : _d.rpc) == null ? void 0 : _e.map((api) => api.address);
239
- const endpoint = yield findFirstWorkingEndpoint(endpoints, "rpc");
234
+ const endpoints = chain.apis?.rpc?.map((api) => api.address);
235
+ const endpoint = await findFirstWorkingEndpoint(endpoints, "rpc");
240
236
  if (!endpoint) {
241
237
  throw new Error(
242
238
  `getRpcEndpointForChain error: failed to find RPC endpoint for chain '${chainId}'`
243
239
  );
244
240
  }
245
241
  return endpoint;
246
- });
242
+ };
247
243
 
248
244
  // src/public-functions/getSigningStargateClient.ts
249
- var getSigningStargateClient = (_0) => __async(void 0, [_0], function* ({
245
+ var getSigningStargateClient = async ({
250
246
  chainId,
251
247
  getOfflineSigner
252
- }) {
253
- var _a;
248
+ }) => {
254
249
  if (!getOfflineSigner) {
255
250
  throw new Error("'getCosmosSigner' is not provided or configured in skip router");
256
251
  }
257
- if (!((_a = ClientState.signingStargateClientByChainId) == null ? void 0 : _a[chainId])) {
258
- const [signer, endpoint] = yield Promise.all([
252
+ if (!ClientState.signingStargateClientByChainId?.[chainId]) {
253
+ const [signer, endpoint] = await Promise.all([
259
254
  getOfflineSigner(chainId),
260
255
  getRpcEndpointForChain(chainId)
261
256
  ]);
262
- ClientState.signingStargateClientByChainId[chainId] = yield SigningStargateClient.connectWithSigner(endpoint, signer, {
257
+ ClientState.signingStargateClientByChainId[chainId] = await SigningStargateClient.connectWithSigner(endpoint, signer, {
263
258
  aminoTypes: ClientState.aminoTypes,
264
259
  registry: ClientState.registry,
265
260
  accountParser
@@ -267,8 +262,8 @@ var getSigningStargateClient = (_0) => __async(void 0, [_0], function* ({
267
262
  }
268
263
  return {
269
264
  stargateClient: ClientState.signingStargateClientByChainId[chainId],
270
- signer: yield getOfflineSigner(chainId)
265
+ signer: await getOfflineSigner(chainId)
271
266
  };
272
- });
267
+ };
273
268
 
274
269
  export { accountParser, getRpcEndpointForChain, getSigningStargateClient };