@skip-go/client 1.0.0-alpha-3 → 1.0.0-alpha-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 (102) hide show
  1. package/dist/api/{getAssets.d.mts → getAssets.d.ts} +2 -2
  2. package/dist/api/getAssets.js +2 -0
  3. package/dist/api/{getAssetsBetweenChains.d.mts → getAssetsBetweenChains.d.ts} +2 -2
  4. package/dist/api/getAssetsBetweenChains.js +2 -0
  5. package/dist/api/{getBridges.d.mts → getBridges.d.ts} +2 -2
  6. package/dist/api/getBridges.js +2 -0
  7. package/dist/api/{getChains.d.mts → getChains.d.ts} +2 -2
  8. package/dist/api/getChains.js +2 -0
  9. package/dist/api/{getVenues.d.mts → getVenues.d.ts} +1 -1
  10. package/dist/api/getVenues.js +2 -0
  11. package/dist/api/{postAssetsFromSource.d.mts → postAssetsFromSource.d.ts} +2 -2
  12. package/dist/api/postAssetsFromSource.js +3 -0
  13. package/dist/api/{postBalances.d.mts → postBalances.d.ts} +3 -3
  14. package/dist/api/postBalances.js +2 -0
  15. package/dist/api/{postIbcOriginAssets.d.mts → postIbcOriginAssets.d.ts} +1 -1
  16. package/dist/api/postIbcOriginAssets.js +2 -0
  17. package/dist/api/{postMessages.d.mts → postMessages.d.ts} +3 -3
  18. package/dist/api/postMessages.js +2 -0
  19. package/dist/api/{postMessagesDirect.d.mts → postMessagesDirect.d.ts} +2 -2
  20. package/dist/api/postMessagesDirect.js +2 -0
  21. package/dist/api/{postRecommendAssets.d.mts → postRecommendAssets.d.ts} +2 -2
  22. package/dist/api/postRecommendAssets.js +2 -0
  23. package/dist/api/{postRoute.d.mts → postRoute.d.ts} +3 -3
  24. package/dist/api/postRoute.js +2 -0
  25. package/dist/api/{postSubmitTransaction.d.mts → postSubmitTransaction.d.ts} +1 -1
  26. package/dist/api/postSubmitTransaction.js +2 -0
  27. package/dist/api/{postTrackTransaction.d.mts → postTrackTransaction.d.ts} +1 -1
  28. package/dist/api/postTrackTransaction.js +2 -0
  29. package/dist/api/{postTransactionStatus.d.mts → postTransactionStatus.d.ts} +3 -3
  30. package/dist/api/postTransactionStatus.js +2 -0
  31. package/dist/{chunk-7TBBV2YY.mjs → chunk-2H4KT24S.js} +1 -1
  32. package/dist/{chunk-OTLFF5OB.mjs → chunk-3OZQ35X3.js} +101 -138
  33. package/dist/{chunk-WDMGUHWR.mjs → chunk-44YEAWRJ.js} +5 -6
  34. package/dist/{chunk-NU7MCJOK.mjs → chunk-66DO7NZD.js} +32 -36
  35. package/dist/{chunk-2F4MBSMT.mjs → chunk-6IZXDY7U.js} +14 -20
  36. package/dist/{chunk-PEZHVPSR.mjs → chunk-6JMGI4N7.js} +75 -83
  37. package/dist/{chunk-YWYU6P7W.mjs → chunk-6MCLH626.js} +2 -2
  38. package/dist/{chunk-CAAR7GDJ.mjs → chunk-6SEZNZJY.js} +1 -1
  39. package/dist/{chunk-LJVI5DLG.mjs → chunk-BQTWTYWD.js} +1 -1
  40. package/dist/chunk-DUCP65HQ.js +675 -0
  41. package/dist/{chunk-KPK3Z6QZ.mjs → chunk-EAVQIWH7.js} +1 -1
  42. package/dist/{chunk-QZ3X6MP3.mjs → chunk-HFWTLB35.js} +1 -1
  43. package/dist/{chunk-NNZFCKHP.mjs → chunk-JBPMJE44.js} +1 -1
  44. package/dist/{chunk-CZ27FEZ7.mjs → chunk-LJ4RFN4L.js} +1 -1
  45. package/dist/{chunk-C5CGY2X7.mjs → chunk-MKEROBAQ.js} +1 -1
  46. package/dist/{chunk-J7GGREYX.mjs → chunk-QKCJUB43.js} +1 -1
  47. package/dist/{chunk-2ETF4N4H.mjs → chunk-RSUFWUIE.js} +4 -5
  48. package/dist/chunk-T3G7MVDN.js +16 -0
  49. package/dist/chunk-XEDYWBEU.js +1792 -0
  50. package/dist/{chunk-B72MYSG5.mjs → chunk-XOC57DJF.js} +17 -21
  51. package/dist/{chunk-IGD32L7C.mjs → chunk-XS6XFYYD.js} +1 -1
  52. package/dist/chunk-Y325PIRY.js +130 -0
  53. package/dist/{client-types-CVch1pZ-.d.mts → client-types-CxjtffyG.d.ts} +1 -1
  54. package/dist/{executeRoute-CRdeEz1o.d.mts → executeRoute-BKvMVd1I.d.ts} +3 -3
  55. package/dist/{generateApi-3mHZ6Zbr.d.mts → generateApi-DqCp36fX.d.ts} +1 -1
  56. package/dist/{index.d.mts → index.d.ts} +25 -25
  57. package/dist/index.js +24 -0
  58. package/dist/public-functions/{executeRoute.d.mts → executeRoute.d.ts} +4 -4
  59. package/dist/public-functions/executeRoute.js +12 -0
  60. package/dist/public-functions/{getFeeInfoForChain.d.mts → getFeeInfoForChain.d.ts} +2 -2
  61. package/dist/public-functions/getFeeInfoForChain.js +5 -0
  62. package/dist/public-functions/{getRecommendedGasPrice.d.mts → getRecommendedGasPrice.d.ts} +1 -1
  63. package/dist/public-functions/getRecommendedGasPrice.js +7 -0
  64. package/dist/public-functions/getSigningStargateClient.js +4 -0
  65. package/dist/public-functions/{setApiOptions.d.mts → setApiOptions.d.ts} +2 -2
  66. package/dist/public-functions/setApiOptions.js +2 -0
  67. package/dist/public-functions/setClientOptions.d.ts +9 -0
  68. package/dist/public-functions/setClientOptions.js +4 -0
  69. package/dist/{setClientOptions-CVB_OUIn.d.mts → setClientOptions-DbanEIwL.d.ts} +2 -2
  70. package/package.json +45 -4
  71. package/dist/api/getAssets.mjs +0 -2
  72. package/dist/api/getAssetsBetweenChains.mjs +0 -2
  73. package/dist/api/getBridges.mjs +0 -2
  74. package/dist/api/getChains.mjs +0 -2
  75. package/dist/api/getVenues.mjs +0 -2
  76. package/dist/api/postAssetsFromSource.mjs +0 -3
  77. package/dist/api/postBalances.mjs +0 -2
  78. package/dist/api/postIbcOriginAssets.mjs +0 -2
  79. package/dist/api/postMessages.mjs +0 -2
  80. package/dist/api/postMessagesDirect.mjs +0 -2
  81. package/dist/api/postRecommendAssets.mjs +0 -2
  82. package/dist/api/postRoute.mjs +0 -2
  83. package/dist/api/postSubmitTransaction.mjs +0 -2
  84. package/dist/api/postTrackTransaction.mjs +0 -2
  85. package/dist/api/postTransactionStatus.mjs +0 -2
  86. package/dist/chunk-2FYLP573.mjs +0 -15
  87. package/dist/chunk-DKIWPD5I.mjs +0 -124
  88. package/dist/chunk-KSMJWLEH.mjs +0 -2315
  89. package/dist/chunk-RXWDHQLG.mjs +0 -231
  90. package/dist/index.mjs +0 -24
  91. package/dist/public-functions/executeRoute.mjs +0 -12
  92. package/dist/public-functions/getFeeInfoForChain.mjs +0 -5
  93. package/dist/public-functions/getRecommendedGasPrice.mjs +0 -7
  94. package/dist/public-functions/getSigningStargateClient.mjs +0 -4
  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/{apiState-CdzxTxYd.d.mts → apiState-CdzxTxYd.d.ts} +0 -0
  99. /package/dist/{chunk-ZAF3Z56R.mjs → chunk-SWYON2RG.js} +0 -0
  100. /package/dist/{chunk-TUBI6VE6.mjs → chunk-VQ5SIQWU.js} +0 -0
  101. /package/dist/public-functions/{getSigningStargateClient.d.mts → getSigningStargateClient.d.ts} +0 -0
  102. /package/dist/{swaggerTypes-O9-gvCT1.d.mts → swaggerTypes-O9-gvCT1.d.ts} +0 -0
@@ -1,231 +0,0 @@
1
- var __defProp = Object.defineProperty;
2
- var __defProps = Object.defineProperties;
3
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
4
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
7
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
8
- var __spreadValues = (a, b) => {
9
- for (var prop in b || (b = {}))
10
- if (__hasOwnProp.call(b, prop))
11
- __defNormalProp(a, prop, b[prop]);
12
- if (__getOwnPropSymbols)
13
- for (var prop of __getOwnPropSymbols(b)) {
14
- if (__propIsEnum.call(b, prop))
15
- __defNormalProp(a, prop, b[prop]);
16
- }
17
- return a;
18
- };
19
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
20
- var __objRest = (source, exclude) => {
21
- var target = {};
22
- for (var prop in source)
23
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
24
- target[prop] = source[prop];
25
- if (source != null && __getOwnPropSymbols)
26
- for (var prop of __getOwnPropSymbols(source)) {
27
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
28
- target[prop] = source[prop];
29
- }
30
- return target;
31
- };
32
- var __async = (__this, __arguments, generator) => {
33
- return new Promise((resolve, reject) => {
34
- var fulfilled = (value) => {
35
- try {
36
- step(generator.next(value));
37
- } catch (e) {
38
- reject(e);
39
- }
40
- };
41
- var rejected = (value) => {
42
- try {
43
- step(generator.throw(value));
44
- } catch (e) {
45
- reject(e);
46
- }
47
- };
48
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
49
- step((generator = generator.apply(__this, __arguments)).next());
50
- });
51
- };
52
-
53
- // src/state/apiState.ts
54
- var _ApiState = class _ApiState {
55
- static setClientInitialized() {
56
- _ApiState.resolveInitialization();
57
- }
58
- };
59
- _ApiState.cumulativeAffiliateFeeBPS = "0";
60
- _ApiState.isInitialized = false;
61
- _ApiState.clientInitialized = new Promise((resolve) => {
62
- _ApiState.resolveInitialization = () => {
63
- if (!_ApiState.isInitialized) {
64
- _ApiState.isInitialized = true;
65
- resolve();
66
- }
67
- };
68
- });
69
- var ApiState = _ApiState;
70
-
71
- // src/utils/convert.ts
72
- function toSnake(obj) {
73
- return convertKeys(obj, (key) => key.replace(/([A-Z])/g, "_$1").toLowerCase());
74
- }
75
- function toCamel(obj) {
76
- return convertKeys(obj, (key) => key.replace(/_([a-z])/g, (_, letter) => letter.toUpperCase()));
77
- }
78
- function convertKeys(obj, convertKey) {
79
- if (Array.isArray(obj)) {
80
- return obj.map((item) => convertKeys(item, convertKey));
81
- } else if (obj !== null && typeof obj === "object") {
82
- return Object.keys(obj).reduce((acc, key) => {
83
- acc[convertKey(key)] = convertKeys(obj[key], convertKey);
84
- return acc;
85
- }, {});
86
- } else {
87
- return obj;
88
- }
89
- }
90
-
91
- // src/utils/timer.ts
92
- var wait = (ms) => {
93
- return new Promise((resolve) => setTimeout(resolve, ms));
94
- };
95
-
96
- // src/utils/generateApi.ts
97
- var createRequestClient = ({ baseUrl, apiKey }) => {
98
- const defaultHeaders = __spreadValues({
99
- "content-type": "application/json"
100
- }, apiKey ? { authorization: apiKey } : {});
101
- const handleResponse = (response) => __async(void 0, null, function* () {
102
- const contentType = response.headers.get("content-type");
103
- const isJson = contentType == null ? void 0 : contentType.includes("application/json");
104
- const body = isJson ? yield response.json() : yield response.text();
105
- if (!response.ok) {
106
- const message = typeof body === "object" && (body == null ? void 0 : body.message) ? body.message : response.statusText;
107
- throw new Error(message);
108
- }
109
- return body;
110
- });
111
- const get = (path, params, signal) => __async(void 0, null, function* () {
112
- const url = new URL(baseUrl + (path != null ? path : ""));
113
- if (params && typeof params === "object") {
114
- Object.entries(params).forEach(([key, value]) => {
115
- if (value !== void 0 && value !== null) {
116
- url.searchParams.append(key, String(value));
117
- }
118
- });
119
- }
120
- const response = yield fetch(url.toString(), {
121
- method: "GET",
122
- headers: defaultHeaders,
123
- signal
124
- });
125
- return handleResponse(response);
126
- });
127
- const post = (_0, ..._1) => __async(void 0, [_0, ..._1], function* (path, data = {}, signal) {
128
- const response = yield fetch(new URL(baseUrl + path).toString(), {
129
- method: "POST",
130
- headers: defaultHeaders,
131
- body: JSON.stringify(data),
132
- signal
133
- });
134
- return handleResponse(response);
135
- });
136
- return { get, post };
137
- };
138
- function createRequest({
139
- path,
140
- method = "get",
141
- onSuccess,
142
- transformResponse
143
- }) {
144
- let controller = null;
145
- const request = (options) => __async(this, null, function* () {
146
- var _b;
147
- const _a = options != null ? options : {}, { apiKey, apiUrl, abortDuplicateRequests } = _a, requestParams = __objRest(_a, ["apiKey", "apiUrl", "abortDuplicateRequests"]);
148
- let fetchClient = ApiState.client;
149
- if (apiUrl || apiKey) {
150
- fetchClient = createRequestClient({
151
- baseUrl: apiUrl || "https://api.skip.build",
152
- apiKey
153
- });
154
- } else {
155
- yield ApiState.clientInitialized;
156
- }
157
- if (abortDuplicateRequests && controller && !((_b = controller == null ? void 0 : controller.signal) == null ? void 0 : _b.aborted)) {
158
- controller == null ? void 0 : controller.abort();
159
- }
160
- controller = new AbortController();
161
- try {
162
- const response = yield fetchClient[method](
163
- path,
164
- requestParams ? toSnake(requestParams) : void 0,
165
- controller.signal
166
- );
167
- const camelCased = toCamel(response != null ? response : {});
168
- const finalResponse = transformResponse ? transformResponse(camelCased) : camelCased;
169
- onSuccess == null ? void 0 : onSuccess(finalResponse, requestParams);
170
- return finalResponse;
171
- } catch (error) {
172
- if (error.name === "AbortError") {
173
- console.log("Request was cancelled");
174
- } else {
175
- console.error("Error:", error);
176
- throw error;
177
- }
178
- }
179
- });
180
- return request;
181
- }
182
- function api({
183
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
184
- methodName,
185
- path,
186
- onSuccess,
187
- method = "get",
188
- transformResponse
189
- }) {
190
- return createRequest({
191
- path,
192
- method,
193
- onSuccess,
194
- transformResponse
195
- });
196
- }
197
- function pollingApi({
198
- methodName,
199
- path,
200
- method = "get",
201
- onSuccess,
202
- onError,
203
- isSuccess = () => true,
204
- maxRetries = 5,
205
- retryInterval = 1e3,
206
- backoffMultiplier = 2
207
- }) {
208
- const request = (requestParams) => __async(this, null, function* () {
209
- let attempt = 0;
210
- let lastError;
211
- while (attempt < maxRetries) {
212
- try {
213
- const result = yield api({ methodName, path, method })(requestParams);
214
- if (result && isSuccess(result)) {
215
- onSuccess == null ? void 0 : onSuccess(result, attempt);
216
- return result;
217
- }
218
- } catch (err) {
219
- lastError = err;
220
- onError == null ? void 0 : onError(err, attempt);
221
- }
222
- const delay = retryInterval * Math.pow(backoffMultiplier, attempt);
223
- yield wait(delay);
224
- attempt++;
225
- }
226
- throw lastError != null ? lastError : new Error("pollingApi: max retries exceeded");
227
- });
228
- return (params) => request(params);
229
- }
230
-
231
- export { ApiState, __async, __objRest, __spreadProps, __spreadValues, api, createRequestClient, pollingApi, toCamel, wait };
package/dist/index.mjs DELETED
@@ -1,24 +0,0 @@
1
- export { Api, AutopilotAction, AxelarTransferState, AxelarTransferType, BridgeType, CCTPTransferState, ChainType, ContentType, ContractCallWithTokenErrorType, FeeType, GoFastTransferState, HttpClient, HyperlaneTransferState, LayerZeroTransferState, OPInitTransferState, PacketErrorType, Reason, RoutePriceWarningType, SendTokenErrorType, StargateTransferState, StatusErrorType, TransactionState, TransferState, executeRoute } from './chunk-KSMJWLEH.mjs';
2
- export { getRecommendedGasPrice } from './chunk-WDMGUHWR.mjs';
3
- import './chunk-TUBI6VE6.mjs';
4
- export { getFeeInfoForChain } from './chunk-2F4MBSMT.mjs';
5
- export { GAS_STATION_CHAIN_IDS } from './chunk-ZAF3Z56R.mjs';
6
- export { getSigningStargateClient } from './chunk-B72MYSG5.mjs';
7
- import './chunk-NU7MCJOK.mjs';
8
- export { setApiOptions } from './chunk-2ETF4N4H.mjs';
9
- export { setClientOptions } from './chunk-PEZHVPSR.mjs';
10
- import './chunk-OTLFF5OB.mjs';
11
- export { ibcOriginAssets } from './chunk-CZ27FEZ7.mjs';
12
- export { messages } from './chunk-KPK3Z6QZ.mjs';
13
- export { messagesDirect } from './chunk-QZ3X6MP3.mjs';
14
- export { recommendAssets } from './chunk-7TBBV2YY.mjs';
15
- export { route } from './chunk-2FYLP573.mjs';
16
- export { submitTransaction } from './chunk-LJVI5DLG.mjs';
17
- export { trackTransaction } from './chunk-CAAR7GDJ.mjs';
18
- export { transactionStatus } from './chunk-C5CGY2X7.mjs';
19
- export { assetsBetweenChains } from './chunk-IGD32L7C.mjs';
20
- export { bridges } from './chunk-J7GGREYX.mjs';
21
- export { venues } from './chunk-NNZFCKHP.mjs';
22
- export { assetsFromSource } from './chunk-YWYU6P7W.mjs';
23
- export { assets, balances, chains } from './chunk-DKIWPD5I.mjs';
24
- import './chunk-RXWDHQLG.mjs';
@@ -1,12 +0,0 @@
1
- export { executeRoute } from '../chunk-KSMJWLEH.mjs';
2
- import '../chunk-TUBI6VE6.mjs';
3
- import '../chunk-ZAF3Z56R.mjs';
4
- import '../chunk-B72MYSG5.mjs';
5
- import '../chunk-NU7MCJOK.mjs';
6
- import '../chunk-OTLFF5OB.mjs';
7
- import '../chunk-KPK3Z6QZ.mjs';
8
- import '../chunk-LJVI5DLG.mjs';
9
- import '../chunk-CAAR7GDJ.mjs';
10
- import '../chunk-C5CGY2X7.mjs';
11
- import '../chunk-DKIWPD5I.mjs';
12
- import '../chunk-RXWDHQLG.mjs';
@@ -1,5 +0,0 @@
1
- export { getFeeInfoForChain } from '../chunk-2F4MBSMT.mjs';
2
- import '../chunk-ZAF3Z56R.mjs';
3
- import '../chunk-NU7MCJOK.mjs';
4
- import '../chunk-DKIWPD5I.mjs';
5
- import '../chunk-RXWDHQLG.mjs';
@@ -1,7 +0,0 @@
1
- export { getRecommendedGasPrice } from '../chunk-WDMGUHWR.mjs';
2
- import '../chunk-TUBI6VE6.mjs';
3
- import '../chunk-2F4MBSMT.mjs';
4
- import '../chunk-ZAF3Z56R.mjs';
5
- import '../chunk-NU7MCJOK.mjs';
6
- import '../chunk-DKIWPD5I.mjs';
7
- import '../chunk-RXWDHQLG.mjs';
@@ -1,4 +0,0 @@
1
- export { getSigningStargateClient } from '../chunk-B72MYSG5.mjs';
2
- import '../chunk-NU7MCJOK.mjs';
3
- import '../chunk-DKIWPD5I.mjs';
4
- import '../chunk-RXWDHQLG.mjs';
@@ -1,2 +0,0 @@
1
- export { setApiOptions } from '../chunk-2ETF4N4H.mjs';
2
- import '../chunk-RXWDHQLG.mjs';
@@ -1,9 +0,0 @@
1
- export { s as setClientOptions } from '../setClientOptions-CVB_OUIn.mjs';
2
- import '@cosmjs/proto-signing';
3
- import '@cosmjs/stargate';
4
- import '../apiState-CdzxTxYd.mjs';
5
- import '../client-types-CVch1pZ-.mjs';
6
- import '@cosmjs/amino';
7
- import 'viem';
8
- import '@solana/wallet-adapter-base';
9
- import '../swaggerTypes-O9-gvCT1.mjs';
@@ -1,4 +0,0 @@
1
- export { setClientOptions } from '../chunk-PEZHVPSR.mjs';
2
- import '../chunk-OTLFF5OB.mjs';
3
- import '../chunk-DKIWPD5I.mjs';
4
- import '../chunk-RXWDHQLG.mjs';
File without changes
File without changes