@skip-go/client 1.0.1 → 1.0.2

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 (62) hide show
  1. package/dist/api/getAssets.js +2 -15
  2. package/dist/api/getAssetsBetweenChains.js +2 -11
  3. package/dist/api/getBridges.js +2 -11
  4. package/dist/api/getChains.js +2 -11
  5. package/dist/api/getVenues.js +2 -11
  6. package/dist/api/postAssetsFromSource.js +3 -12
  7. package/dist/api/postBalances.js +2 -11
  8. package/dist/api/postIbcOriginAssets.js +2 -11
  9. package/dist/api/postMessages.js +2 -11
  10. package/dist/api/postMessagesDirect.js +2 -11
  11. package/dist/api/postRecommendAssets.js +2 -11
  12. package/dist/api/postRoute.js +2 -11
  13. package/dist/api/postSubmitTransaction.js +2 -11
  14. package/dist/api/postTrackTransaction.js +2 -11
  15. package/dist/api/postTransactionStatus.js +2 -11
  16. package/dist/chunk-33K6EESX.js +10 -0
  17. package/dist/{chunk-X2YPYBVN.js → chunk-3N7XVGLX.js} +59 -68
  18. package/dist/{chunk-RT5TZAMU.js → chunk-3OZQ35X3.js} +212 -312
  19. package/dist/{chunk-Z4ZKOUGH.js → chunk-4JJWOILI.js} +3 -5
  20. package/dist/chunk-735L35R6.js +1790 -0
  21. package/dist/chunk-BQTQJQ5E.js +10 -0
  22. package/dist/chunk-BRJDNGYH.js +22 -0
  23. package/dist/chunk-BRMONS6A.js +130 -0
  24. package/dist/{chunk-ZG23Z3WY.js → chunk-C2EDPY6J.js} +3 -5
  25. package/dist/chunk-DW4U6YI6.js +10 -0
  26. package/dist/chunk-GARVPN2H.js +16 -0
  27. package/dist/{chunk-CG5CQQBW.js → chunk-JTIHU43D.js} +33 -42
  28. package/dist/{chunk-5ZJBR5AQ.js → chunk-KNV72XRZ.js} +3 -5
  29. package/dist/chunk-MGVXJ2U4.js +11 -0
  30. package/dist/chunk-MTMPHY3Y.js +9 -0
  31. package/dist/{chunk-RE2QZJWE.js → chunk-PRQ2NHRZ.js} +3 -5
  32. package/dist/chunk-RDRDFJQE.js +10 -0
  33. package/dist/chunk-RMP3HM5N.js +14 -0
  34. package/dist/{chunk-GFRPLEJR.js → chunk-SQGWZAUC.js} +279 -311
  35. package/dist/chunk-SWYON2RG.js +1 -4
  36. package/dist/{chunk-PKPZTO4H.js → chunk-TW77BXMT.js} +10 -13
  37. package/dist/{chunk-4XWIXR2P.js → chunk-VMPFHQ7U.js} +19 -27
  38. package/dist/chunk-VQ5SIQWU.js +1 -3
  39. package/dist/chunk-W6TBGBV3.js +675 -0
  40. package/dist/index.d.ts +0 -2
  41. package/dist/index.js +24 -209
  42. package/dist/public-functions/executeRoute.js +12 -21
  43. package/dist/public-functions/getFeeInfoForChain.js +5 -14
  44. package/dist/public-functions/getRecommendedGasPrice.d.ts +1 -1
  45. package/dist/public-functions/getRecommendedGasPrice.js +7 -16
  46. package/dist/public-functions/getSigningStargateClient.d.ts +1 -1
  47. package/dist/public-functions/getSigningStargateClient.js +4 -13
  48. package/dist/public-functions/setApiOptions.js +2 -11
  49. package/dist/public-functions/setClientOptions.js +4 -13
  50. package/package.json +12 -3
  51. package/dist/chunk-2WHYWV4Y.js +0 -12
  52. package/dist/chunk-5KVRQLI5.js +0 -17
  53. package/dist/chunk-6BTWKTNM.js +0 -16
  54. package/dist/chunk-6GJEXV5J.js +0 -130
  55. package/dist/chunk-ASPVKNJ7.js +0 -242
  56. package/dist/chunk-EQLA2SEZ.js +0 -2361
  57. package/dist/chunk-FVSSCQ6C.js +0 -12
  58. package/dist/chunk-KYFTM3PI.js +0 -12
  59. package/dist/chunk-L2Q5RP6O.js +0 -25
  60. package/dist/chunk-LRIPQQ4M.js +0 -11
  61. package/dist/chunk-X2E2TKVR.js +0 -12
  62. package/dist/chunk-YYNIFO2A.js +0 -13
@@ -1,10 +1,7 @@
1
- 'use strict';
2
-
3
1
  // src/constants/constants.ts
4
2
  var DEFAULT_GAS_DENOM_OVERRIDES = {
5
3
  "noble-1": "uusdc"
6
4
  };
7
5
  var GAS_STATION_CHAIN_IDS = ["bbn-test-5", "bbn-1"];
8
6
 
9
- exports.DEFAULT_GAS_DENOM_OVERRIDES = DEFAULT_GAS_DENOM_OVERRIDES;
10
- exports.GAS_STATION_CHAIN_IDS = GAS_STATION_CHAIN_IDS;
7
+ export { DEFAULT_GAS_DENOM_OVERRIDES, GAS_STATION_CHAIN_IDS };
@@ -1,24 +1,21 @@
1
- 'use strict';
2
-
3
- var chunkASPVKNJ7_js = require('./chunk-ASPVKNJ7.js');
1
+ import { ApiState, createRequestClient } from './chunk-W6TBGBV3.js';
4
2
 
5
3
  // src/public-functions/setApiOptions.ts
6
4
  var setApiOptions = (options = {}) => {
7
- chunkASPVKNJ7_js.ApiState.client = chunkASPVKNJ7_js.createRequestClient({
5
+ ApiState.client = createRequestClient({
8
6
  baseUrl: options.apiUrl || "https://api.skip.build",
9
7
  apiKey: options.apiKey
10
8
  });
11
- chunkASPVKNJ7_js.ApiState.setClientInitialized();
9
+ ApiState.setClientInitialized();
12
10
  if (options.chainIdsToAffiliates) {
13
- chunkASPVKNJ7_js.ApiState.cumulativeAffiliateFeeBPS = validateChainIdsToAffiliates(options.chainIdsToAffiliates);
14
- chunkASPVKNJ7_js.ApiState.chainIdsToAffiliates = options.chainIdsToAffiliates;
11
+ ApiState.cumulativeAffiliateFeeBPS = validateChainIdsToAffiliates(options.chainIdsToAffiliates);
12
+ ApiState.chainIdsToAffiliates = options.chainIdsToAffiliates;
15
13
  }
16
- return chunkASPVKNJ7_js.ApiState.clientInitialized;
14
+ return ApiState.clientInitialized;
17
15
  };
18
16
  function validateChainIdsToAffiliates(chainIdsToAffiliates) {
19
- var _a;
20
17
  const affiliatesArray = Object.values(chainIdsToAffiliates).map((chain) => chain.affiliates).filter((a) => a !== void 0);
21
- const firstAffiliateBasisPointsFee = (_a = affiliatesArray[0]) == null ? void 0 : _a.reduce((acc, affiliate) => {
18
+ const firstAffiliateBasisPointsFee = affiliatesArray[0]?.reduce((acc, affiliate) => {
22
19
  if (!affiliate.basisPointsFee) {
23
20
  throw new Error("basisPointFee must exist in each affiliate");
24
21
  }
@@ -32,7 +29,7 @@ function validateChainIdsToAffiliates(chainIdsToAffiliates) {
32
29
  if (!affiliate2.address) {
33
30
  throw new Error("address to receive fee must exist in each affiliate");
34
31
  }
35
- return acc + parseInt(affiliate2 == null ? void 0 : affiliate2.basisPointsFee, 10);
32
+ return acc + parseInt(affiliate2?.basisPointsFee, 10);
36
33
  }, 0);
37
34
  return totalBasisPointsFee === firstAffiliateBasisPointsFee;
38
35
  });
@@ -41,7 +38,7 @@ function validateChainIdsToAffiliates(chainIdsToAffiliates) {
41
38
  "basisPointFee does not add up to the same number for each chain in chainIdsToAffiliates"
42
39
  );
43
40
  }
44
- return firstAffiliateBasisPointsFee == null ? void 0 : firstAffiliateBasisPointsFee.toFixed(0);
41
+ return firstAffiliateBasisPointsFee?.toFixed(0);
45
42
  }
46
43
 
47
- exports.setApiOptions = setApiOptions;
44
+ export { setApiOptions };
@@ -1,18 +1,14 @@
1
- 'use strict';
2
-
3
- var chunkSWYON2RG_js = require('./chunk-SWYON2RG.js');
4
- var chunkCG5CQQBW_js = require('./chunk-CG5CQQBW.js');
5
- var chunk6GJEXV5J_js = require('./chunk-6GJEXV5J.js');
6
- var chunkASPVKNJ7_js = require('./chunk-ASPVKNJ7.js');
1
+ import { DEFAULT_GAS_DENOM_OVERRIDES } from './chunk-SWYON2RG.js';
2
+ import { chains } from './chunk-JTIHU43D.js';
3
+ import { ClientState } from './chunk-BRMONS6A.js';
7
4
 
8
5
  // src/private-functions/getDefaultGasTokenForChain.ts
9
- var getDefaultGasTokenForChain = (chainId) => chunkASPVKNJ7_js.__async(void 0, null, function* () {
10
- var _a;
11
- const gasDenom = chunkSWYON2RG_js.DEFAULT_GAS_DENOM_OVERRIDES[chainId];
6
+ var getDefaultGasTokenForChain = async (chainId) => {
7
+ const gasDenom = DEFAULT_GAS_DENOM_OVERRIDES[chainId];
12
8
  if (gasDenom) {
13
9
  return gasDenom;
14
10
  }
15
- const chain = chunkCG5CQQBW_js.chains().find((chain2) => chain2.chain_id === chainId);
11
+ const chain = chains().find((chain2) => chain2.chain_id === chainId);
16
12
  if (!chain) {
17
13
  return void 0;
18
14
  }
@@ -22,10 +18,7 @@ var getDefaultGasTokenForChain = (chainId) => chunkASPVKNJ7_js.__async(void 0, n
22
18
  const stakingTokens = getStakingTokensForChain(chainId);
23
19
  if (stakingTokens && stakingTokens.length > 0) {
24
20
  const feeAsset = chain.fees.fee_tokens.find(
25
- (feeToken) => {
26
- var _a2;
27
- return feeToken.denom === ((_a2 = stakingTokens[0]) == null ? void 0 : _a2.denom);
28
- }
21
+ (feeToken) => feeToken.denom === stakingTokens[0]?.denom
29
22
  );
30
23
  if (feeAsset) {
31
24
  return feeAsset.denom;
@@ -41,10 +34,10 @@ var getDefaultGasTokenForChain = (chainId) => chunkASPVKNJ7_js.__async(void 0, n
41
34
  if (nonL2Asset) {
42
35
  return nonL2Asset.denom;
43
36
  }
44
- return (_a = chain.fees.fee_tokens[0]) == null ? void 0 : _a.denom;
45
- });
37
+ return chain.fees.fee_tokens[0]?.denom;
38
+ };
46
39
  var getStakingTokensForChain = (chainId) => {
47
- const chain = chunkCG5CQQBW_js.chains().find((chain2) => chain2.chain_id === chainId);
40
+ const chain = chains().find((chain2) => chain2.chain_id === chainId);
48
41
  if (!chain) {
49
42
  throw new Error(
50
43
  `getStakingTokensForChain error: failed to find chain id '${chainId}' in registry`
@@ -57,25 +50,24 @@ var getStakingTokensForChain = (chainId) => {
57
50
  };
58
51
 
59
52
  // src/public-functions/getFeeInfoForChain.ts
60
- var getFeeInfoForChain = (_0) => chunkASPVKNJ7_js.__async(void 0, [_0], function* ({ chainId, apiUrl, apiKey }) {
61
- var _a, _b, _c, _d, _e;
62
- const skipChains = yield chunk6GJEXV5J_js.ClientState.getSkipChains({ apiUrl, apiKey });
53
+ var getFeeInfoForChain = async ({ chainId, apiUrl, apiKey }) => {
54
+ const skipChains = await ClientState.getSkipChains({ apiUrl, apiKey });
63
55
  const skipChain = skipChains.find((chain2) => chain2.chainId === chainId);
64
56
  if (!skipChain) {
65
57
  return void 0;
66
58
  }
67
- const defaultGasToken = yield getDefaultGasTokenForChain(chainId);
59
+ const defaultGasToken = await getDefaultGasTokenForChain(chainId);
68
60
  if (!defaultGasToken && !skipChain.feeAssets) {
69
61
  return void 0;
70
62
  }
71
- const skipFeeInfo = defaultGasToken ? (_a = skipChain.feeAssets) == null ? void 0 : _a.find((skipFee) => skipFee.denom === defaultGasToken) : (_b = skipChain.feeAssets) == null ? void 0 : _b[0];
72
- if (!skipFeeInfo && ((_d = (_c = skipChain.feeAssets) == null ? void 0 : _c[0]) == null ? void 0 : _d.gasPrice) !== null) {
73
- return (_e = skipChain.feeAssets) == null ? void 0 : _e[0];
63
+ const skipFeeInfo = defaultGasToken ? skipChain.feeAssets?.find((skipFee) => skipFee.denom === defaultGasToken) : skipChain.feeAssets?.[0];
64
+ if (!skipFeeInfo && skipChain.feeAssets?.[0]?.gasPrice !== null) {
65
+ return skipChain.feeAssets?.[0];
74
66
  }
75
67
  if (skipFeeInfo && skipFeeInfo.gasPrice !== null) {
76
68
  return skipFeeInfo;
77
69
  }
78
- const chain = chunkCG5CQQBW_js.chains().find((chain2) => chain2.chain_id === chainId);
70
+ const chain = chains().find((chain2) => chain2.chain_id === chainId);
79
71
  if (!chain) {
80
72
  return void 0;
81
73
  }
@@ -96,6 +88,6 @@ var getFeeInfoForChain = (_0) => chunkASPVKNJ7_js.__async(void 0, [_0], function
96
88
  high: registryFeeInfo.high_gas_price ? `${registryFeeInfo.high_gas_price}` : ""
97
89
  }
98
90
  };
99
- });
91
+ };
100
92
 
101
- exports.getFeeInfoForChain = getFeeInfoForChain;
93
+ export { getFeeInfoForChain };
@@ -1,5 +1,3 @@
1
- 'use strict';
2
-
3
1
  // ../../node_modules/bignumber.js/bignumber.mjs
4
2
  var isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;
5
3
  var mathceil = Math.ceil;
@@ -1343,4 +1341,4 @@ function toFixedPoint(str, e, z) {
1343
1341
  }
1344
1342
  var BigNumber = clone();
1345
1343
 
1346
- exports.BigNumber = BigNumber;
1344
+ export { BigNumber };