@skip-go/client 1.0.1-alpha-0 → 1.0.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 (129) hide show
  1. package/dist/api/getAssets.js +15 -2
  2. package/dist/api/getAssetsBetweenChains.js +11 -2
  3. package/dist/api/getBridges.js +11 -2
  4. package/dist/api/getChains.js +11 -2
  5. package/dist/api/getVenues.js +11 -2
  6. package/dist/api/postAssetsFromSource.js +12 -3
  7. package/dist/api/postBalances.js +11 -2
  8. package/dist/api/postIbcOriginAssets.js +11 -2
  9. package/dist/api/postMessages.js +11 -2
  10. package/dist/api/postMessagesDirect.js +11 -2
  11. package/dist/api/postRecommendAssets.js +11 -2
  12. package/dist/api/postRoute.js +11 -2
  13. package/dist/api/postSubmitTransaction.js +11 -2
  14. package/dist/api/postTrackTransaction.js +11 -2
  15. package/dist/api/postTransactionStatus.js +11 -2
  16. package/dist/{chunk-DAMZSSOH.cjs → chunk-2WHYWV4Y.js} +2 -2
  17. package/dist/{chunk-J4LI33TK.cjs → chunk-4XWIXR2P.js} +24 -18
  18. package/dist/chunk-5KVRQLI5.js +17 -0
  19. package/dist/{chunk-VI7UMBQ7.cjs → chunk-5ZJBR5AQ.js} +2 -2
  20. package/dist/{chunk-ISHM4QWP.cjs → chunk-6BTWKTNM.js} +4 -4
  21. package/dist/chunk-6GJEXV5J.js +130 -0
  22. package/dist/chunk-ASPVKNJ7.js +242 -0
  23. package/dist/{chunk-7SK3IFXJ.cjs → chunk-CG5CQQBW.js} +36 -32
  24. package/dist/chunk-EQLA2SEZ.js +2361 -0
  25. package/dist/{chunk-32MRDO7V.cjs → chunk-FVSSCQ6C.js} +2 -2
  26. package/dist/{chunk-5IAEEEOQ.cjs → chunk-GFRPLEJR.js} +227 -217
  27. package/dist/{chunk-L5V5PASH.cjs → chunk-KYFTM3PI.js} +2 -2
  28. package/dist/chunk-L2Q5RP6O.js +25 -0
  29. package/dist/{chunk-URLFWBSC.cjs → chunk-LRIPQQ4M.js} +2 -2
  30. package/dist/{chunk-ZNXE6PUV.cjs → chunk-PKPZTO4H.js} +10 -9
  31. package/dist/{chunk-RDOSNDAQ.cjs → chunk-RE2QZJWE.js} +2 -2
  32. package/dist/{chunk-7OIZPQJB.cjs → chunk-RT5TZAMU.js} +138 -101
  33. package/dist/chunk-SWYON2RG.js +4 -1
  34. package/dist/chunk-VQ5SIQWU.js +3 -1
  35. package/dist/{chunk-LXYLWTNZ.cjs → chunk-X2E2TKVR.js} +2 -2
  36. package/dist/{chunk-SW3SEQMJ.cjs → chunk-X2YPYBVN.js} +30 -25
  37. package/dist/{chunk-KDN7RCGP.cjs → chunk-YYNIFO2A.js} +2 -2
  38. package/dist/{chunk-77ITCT75.cjs → chunk-Z4ZKOUGH.js} +2 -2
  39. package/dist/{chunk-PNWIJSMA.cjs → chunk-ZG23Z3WY.js} +2 -2
  40. package/dist/index.d.ts +2 -0
  41. package/dist/index.js +209 -24
  42. package/dist/public-functions/executeRoute.js +21 -12
  43. package/dist/public-functions/getFeeInfoForChain.js +14 -5
  44. package/dist/public-functions/getRecommendedGasPrice.d.ts +1 -1
  45. package/dist/public-functions/getRecommendedGasPrice.js +16 -7
  46. package/dist/public-functions/getSigningStargateClient.d.ts +1 -1
  47. package/dist/public-functions/getSigningStargateClient.js +13 -4
  48. package/dist/public-functions/setApiOptions.js +11 -2
  49. package/dist/public-functions/setClientOptions.js +13 -4
  50. package/package.json +1 -10
  51. package/dist/api/getAssets.cjs +0 -15
  52. package/dist/api/getAssets.d.cts +0 -19
  53. package/dist/api/getAssetsBetweenChains.cjs +0 -11
  54. package/dist/api/getAssetsBetweenChains.d.cts +0 -56
  55. package/dist/api/getBridges.cjs +0 -11
  56. package/dist/api/getBridges.d.cts +0 -54
  57. package/dist/api/getChains.cjs +0 -11
  58. package/dist/api/getChains.d.cts +0 -41
  59. package/dist/api/getVenues.cjs +0 -11
  60. package/dist/api/getVenues.d.cts +0 -13
  61. package/dist/api/postAssetsFromSource.cjs +0 -12
  62. package/dist/api/postAssetsFromSource.d.cts +0 -13
  63. package/dist/api/postBalances.cjs +0 -11
  64. package/dist/api/postBalances.d.cts +0 -35
  65. package/dist/api/postIbcOriginAssets.cjs +0 -11
  66. package/dist/api/postIbcOriginAssets.d.cts +0 -32
  67. package/dist/api/postMessages.cjs +0 -11
  68. package/dist/api/postMessages.d.cts +0 -528
  69. package/dist/api/postMessagesDirect.cjs +0 -11
  70. package/dist/api/postMessagesDirect.d.cts +0 -568
  71. package/dist/api/postRecommendAssets.cjs +0 -11
  72. package/dist/api/postRecommendAssets.d.cts +0 -40
  73. package/dist/api/postRoute.cjs +0 -11
  74. package/dist/api/postRoute.d.cts +0 -460
  75. package/dist/api/postSubmitTransaction.cjs +0 -11
  76. package/dist/api/postSubmitTransaction.d.cts +0 -13
  77. package/dist/api/postTrackTransaction.cjs +0 -11
  78. package/dist/api/postTrackTransaction.d.cts +0 -13
  79. package/dist/api/postTransactionStatus.cjs +0 -11
  80. package/dist/api/postTransactionStatus.d.cts +0 -559
  81. package/dist/apiState-CdzxTxYd.d.cts +0 -6
  82. package/dist/chunk-33K6EESX.js +0 -10
  83. package/dist/chunk-3N7XVGLX.js +0 -269
  84. package/dist/chunk-3OZQ35X3.js +0 -3597
  85. package/dist/chunk-44PBLFB5.cjs +0 -24
  86. package/dist/chunk-4JJWOILI.js +0 -13
  87. package/dist/chunk-4R6OCWRR.cjs +0 -1346
  88. package/dist/chunk-BQTQJQ5E.js +0 -10
  89. package/dist/chunk-BRJDNGYH.js +0 -22
  90. package/dist/chunk-BRMONS6A.js +0 -130
  91. package/dist/chunk-C2EDPY6J.js +0 -10
  92. package/dist/chunk-DW4U6YI6.js +0 -10
  93. package/dist/chunk-ED2OY55G.cjs +0 -136
  94. package/dist/chunk-GARVPN2H.js +0 -16
  95. package/dist/chunk-HAR3IXDE.cjs +0 -705
  96. package/dist/chunk-JTIHU43D.js +0 -183
  97. package/dist/chunk-KNV72XRZ.js +0 -10
  98. package/dist/chunk-KZOSEIWH.cjs +0 -10
  99. package/dist/chunk-MGVXJ2U4.js +0 -11
  100. package/dist/chunk-MTMPHY3Y.js +0 -9
  101. package/dist/chunk-PRQ2NHRZ.js +0 -11
  102. package/dist/chunk-RDRDFJQE.js +0 -10
  103. package/dist/chunk-RMP3HM5N.js +0 -14
  104. package/dist/chunk-SFMBRLUS.cjs +0 -18
  105. package/dist/chunk-SQGWZAUC.js +0 -2229
  106. package/dist/chunk-TW77BXMT.js +0 -44
  107. package/dist/chunk-VMPFHQ7U.js +0 -93
  108. package/dist/chunk-W2U2UOFA.js +0 -1790
  109. package/dist/chunk-W6TBGBV3.js +0 -675
  110. package/dist/chunk-WWNTHZ6I.cjs +0 -1812
  111. package/dist/client-types-qvyKvyFh.d.cts +0 -60
  112. package/dist/executeRoute-BKRpODCc.d.cts +0 -69
  113. package/dist/generateApi-C0amiydg.d.cts +0 -22
  114. package/dist/index.cjs +0 -209
  115. package/dist/index.d.cts +0 -35
  116. package/dist/public-functions/executeRoute.cjs +0 -21
  117. package/dist/public-functions/executeRoute.d.cts +0 -9
  118. package/dist/public-functions/getFeeInfoForChain.cjs +0 -14
  119. package/dist/public-functions/getFeeInfoForChain.d.cts +0 -9
  120. package/dist/public-functions/getRecommendedGasPrice.cjs +0 -16
  121. package/dist/public-functions/getRecommendedGasPrice.d.cts +0 -9
  122. package/dist/public-functions/getSigningStargateClient.cjs +0 -13
  123. package/dist/public-functions/getSigningStargateClient.d.cts +0 -13
  124. package/dist/public-functions/setApiOptions.cjs +0 -11
  125. package/dist/public-functions/setApiOptions.d.cts +0 -9
  126. package/dist/public-functions/setClientOptions.cjs +0 -13
  127. package/dist/public-functions/setClientOptions.d.cts +0 -9
  128. package/dist/setClientOptions-CT6CHI9I.d.cts +0 -19
  129. package/dist/swaggerTypes-O9-gvCT1.d.cts +0 -1890
@@ -1,10 +0,0 @@
1
- import { api } from './chunk-W6TBGBV3.js';
2
-
3
- // src/api/postMessagesDirect.ts
4
- var messagesDirect = api({
5
- methodName: "getMsgsDirectV2",
6
- method: "post",
7
- path: "/v2/fungible/msgs_direct"
8
- });
9
-
10
- export { messagesDirect };
@@ -1,22 +0,0 @@
1
- import { BigNumber } from './chunk-VQ5SIQWU.js';
2
- import { getFeeInfoForChain } from './chunk-VMPFHQ7U.js';
3
- import { Decimal } from '@cosmjs/math/build/decimal';
4
- import { GasPrice } from '@cosmjs/stargate';
5
-
6
- var getRecommendedGasPrice = async (props) => {
7
- const feeInfo = await getFeeInfoForChain(props);
8
- if (!feeInfo || !feeInfo.gasPrice) {
9
- return void 0;
10
- }
11
- let price = feeInfo.gasPrice.average;
12
- if (price === "") {
13
- price = feeInfo.gasPrice.high;
14
- }
15
- if (price === "") {
16
- price = feeInfo.gasPrice.low;
17
- }
18
- if (!price) return;
19
- return new GasPrice(Decimal.fromUserInput(BigNumber(price).toFixed(), 18), feeInfo.denom);
20
- };
21
-
22
- export { getRecommendedGasPrice };
@@ -1,130 +0,0 @@
1
- import { api } from './chunk-W6TBGBV3.js';
2
-
3
- // src/private-functions/getMainnetAndTestnetChains.ts
4
- var getMainnetAndTestnetChains = async (apiOptions) => {
5
- const [mainnetRes, testnetRes] = await Promise.all([
6
- chains({
7
- includeEvm: true,
8
- includeSvm: true,
9
- ...apiOptions
10
- }),
11
- chains({
12
- includeEvm: true,
13
- includeSvm: true,
14
- onlyTestnets: true,
15
- ...apiOptions
16
- })
17
- ]);
18
- const combinedChains = [...mainnetRes ?? [], ...testnetRes ?? []];
19
- ClientState.skipChains = combinedChains;
20
- return combinedChains;
21
- };
22
-
23
- // src/api/getAssets.ts
24
- var assets = api({
25
- methodName: "getAssets",
26
- path: "/v2/fungible/assets",
27
- transformResponse: (response) => {
28
- return transformAssetsMap(response.chainToAssetsMap);
29
- },
30
- onSuccess: (response, options) => {
31
- if (options?.includeEvmAssets && options?.includeSvmAssets && options?.includeCw20Assets) {
32
- ClientState.skipAssets = response;
33
- }
34
- }
35
- });
36
- var transformAssetsMap = (input) => Object.entries(input ?? {}).reduce(
37
- (acc, [chainId, { assets: assets2 }]) => {
38
- acc[chainId] = (assets2 ?? []).map((asset) => asset);
39
- return acc;
40
- },
41
- {}
42
- );
43
-
44
- // src/private-functions/getMainnetAndTestnetAssets.ts
45
- var getMainnetAndTestnetAssets = async ({
46
- chainId,
47
- ...apiOptions
48
- }) => {
49
- const [assetsMainnet, assetsTestnet] = await Promise.all([
50
- assets({
51
- chainIds: chainId ? [chainId] : void 0,
52
- ...apiOptions
53
- }),
54
- assets({
55
- chainIds: chainId ? [chainId] : void 0,
56
- onlyTestnets: true,
57
- ...apiOptions
58
- })
59
- ]);
60
- const mainnet = assetsMainnet;
61
- const testnet = assetsTestnet;
62
- const merged = {
63
- ...mainnet,
64
- ...testnet
65
- };
66
- ClientState.skipAssets = merged;
67
- return merged;
68
- };
69
-
70
- // src/api/postBalances.ts
71
- var balances = api({
72
- methodName: "getBalances",
73
- method: "post",
74
- path: "/v2/info/balances",
75
- onSuccess: (response, options) => {
76
- if (!options) {
77
- ClientState.skipBalances = response;
78
- }
79
- }
80
- });
81
-
82
- // src/state/clientState.ts
83
- var ClientState = class {
84
- static aminoTypes;
85
- static registry;
86
- static endpointOptions;
87
- static skipChains;
88
- static skipAssets;
89
- static skipBalances;
90
- static async getSkipChains(apiOptions) {
91
- if (this.skipChains) {
92
- return this.skipChains;
93
- }
94
- const response = await getMainnetAndTestnetChains(apiOptions);
95
- this.skipChains = response;
96
- return response;
97
- }
98
- static async getSkipAssets(props) {
99
- if (this.skipAssets) {
100
- return this.skipAssets;
101
- }
102
- const response = await getMainnetAndTestnetAssets(props);
103
- this.skipAssets = response;
104
- return response;
105
- }
106
- static async getSkipBalances() {
107
- if (this.skipBalances) {
108
- return this.skipBalances;
109
- }
110
- const response = await balances();
111
- this.skipBalances = response;
112
- return response;
113
- }
114
- static signingStargateClientByChainId = {};
115
- static validateGasResults;
116
- };
117
-
118
- // src/api/getChains.ts
119
- var chains = api({
120
- methodName: "getChains",
121
- path: "/v2/info/chains",
122
- transformResponse: (response) => response.chains,
123
- onSuccess: (response, options) => {
124
- if (options?.includeEvm && options?.includeSvm) {
125
- ClientState.skipChains = response;
126
- }
127
- }
128
- });
129
-
130
- export { ClientState, assets, balances, chains, transformAssetsMap };
@@ -1,10 +0,0 @@
1
- import { api } from './chunk-W6TBGBV3.js';
2
-
3
- // src/api/getVenues.ts
4
- var venues = api({
5
- methodName: "getVenues",
6
- path: "/v2/fungible/venues",
7
- transformResponse: (response) => response.venues
8
- });
9
-
10
- export { venues };
@@ -1,10 +0,0 @@
1
- import { api } from './chunk-W6TBGBV3.js';
2
-
3
- // src/api/postMessages.ts
4
- var messages = api({
5
- methodName: "getMsgsV2",
6
- method: "post",
7
- path: "/v2/fungible/msgs"
8
- });
9
-
10
- export { messages };
@@ -1,136 +0,0 @@
1
- 'use strict';
2
-
3
- var chunkHAR3IXDE_cjs = require('./chunk-HAR3IXDE.cjs');
4
-
5
- // src/private-functions/getMainnetAndTestnetChains.ts
6
- var getMainnetAndTestnetChains = async (apiOptions) => {
7
- const [mainnetRes, testnetRes] = await Promise.all([
8
- chains({
9
- includeEvm: true,
10
- includeSvm: true,
11
- ...apiOptions
12
- }),
13
- chains({
14
- includeEvm: true,
15
- includeSvm: true,
16
- onlyTestnets: true,
17
- ...apiOptions
18
- })
19
- ]);
20
- const combinedChains = [...mainnetRes ?? [], ...testnetRes ?? []];
21
- ClientState.skipChains = combinedChains;
22
- return combinedChains;
23
- };
24
-
25
- // src/api/getAssets.ts
26
- var assets = chunkHAR3IXDE_cjs.api({
27
- methodName: "getAssets",
28
- path: "/v2/fungible/assets",
29
- transformResponse: (response) => {
30
- return transformAssetsMap(response.chainToAssetsMap);
31
- },
32
- onSuccess: (response, options) => {
33
- if (options?.includeEvmAssets && options?.includeSvmAssets && options?.includeCw20Assets) {
34
- ClientState.skipAssets = response;
35
- }
36
- }
37
- });
38
- var transformAssetsMap = (input) => Object.entries(input ?? {}).reduce(
39
- (acc, [chainId, { assets: assets2 }]) => {
40
- acc[chainId] = (assets2 ?? []).map((asset) => asset);
41
- return acc;
42
- },
43
- {}
44
- );
45
-
46
- // src/private-functions/getMainnetAndTestnetAssets.ts
47
- var getMainnetAndTestnetAssets = async ({
48
- chainId,
49
- ...apiOptions
50
- }) => {
51
- const [assetsMainnet, assetsTestnet] = await Promise.all([
52
- assets({
53
- chainIds: chainId ? [chainId] : void 0,
54
- ...apiOptions
55
- }),
56
- assets({
57
- chainIds: chainId ? [chainId] : void 0,
58
- onlyTestnets: true,
59
- ...apiOptions
60
- })
61
- ]);
62
- const mainnet = assetsMainnet;
63
- const testnet = assetsTestnet;
64
- const merged = {
65
- ...mainnet,
66
- ...testnet
67
- };
68
- ClientState.skipAssets = merged;
69
- return merged;
70
- };
71
-
72
- // src/api/postBalances.ts
73
- var balances = chunkHAR3IXDE_cjs.api({
74
- methodName: "getBalances",
75
- method: "post",
76
- path: "/v2/info/balances",
77
- onSuccess: (response, options) => {
78
- if (!options) {
79
- ClientState.skipBalances = response;
80
- }
81
- }
82
- });
83
-
84
- // src/state/clientState.ts
85
- var ClientState = class {
86
- static aminoTypes;
87
- static registry;
88
- static endpointOptions;
89
- static skipChains;
90
- static skipAssets;
91
- static skipBalances;
92
- static async getSkipChains(apiOptions) {
93
- if (this.skipChains) {
94
- return this.skipChains;
95
- }
96
- const response = await getMainnetAndTestnetChains(apiOptions);
97
- this.skipChains = response;
98
- return response;
99
- }
100
- static async getSkipAssets(props) {
101
- if (this.skipAssets) {
102
- return this.skipAssets;
103
- }
104
- const response = await getMainnetAndTestnetAssets(props);
105
- this.skipAssets = response;
106
- return response;
107
- }
108
- static async getSkipBalances() {
109
- if (this.skipBalances) {
110
- return this.skipBalances;
111
- }
112
- const response = await balances();
113
- this.skipBalances = response;
114
- return response;
115
- }
116
- static signingStargateClientByChainId = {};
117
- static validateGasResults;
118
- };
119
-
120
- // src/api/getChains.ts
121
- var chains = chunkHAR3IXDE_cjs.api({
122
- methodName: "getChains",
123
- path: "/v2/info/chains",
124
- transformResponse: (response) => response.chains,
125
- onSuccess: (response, options) => {
126
- if (options?.includeEvm && options?.includeSvm) {
127
- ClientState.skipChains = response;
128
- }
129
- }
130
- });
131
-
132
- exports.ClientState = ClientState;
133
- exports.assets = assets;
134
- exports.balances = balances;
135
- exports.chains = chains;
136
- exports.transformAssetsMap = transformAssetsMap;
@@ -1,16 +0,0 @@
1
- import { ApiState, api } from './chunk-W6TBGBV3.js';
2
-
3
- // src/api/postRoute.ts
4
- var route = async (request) => {
5
- const requestWithAffiliateFeeBps = {
6
- ...request,
7
- cumulativeAffiliateFeeBps: ApiState.cumulativeAffiliateFeeBPS
8
- };
9
- return api({
10
- methodName: "getRouteV2",
11
- method: "post",
12
- path: "/v2/fungible/route"
13
- })(requestWithAffiliateFeeBps);
14
- };
15
-
16
- export { route };