@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.
- package/dist/api/getAssets.js +2 -0
- package/dist/api/getAssetsBetweenChains.js +2 -0
- package/dist/api/getBridges.js +2 -0
- package/dist/api/getChains.js +2 -0
- package/dist/api/getVenues.js +2 -0
- package/dist/api/postAssetsFromSource.js +3 -0
- package/dist/api/postBalances.js +2 -0
- package/dist/api/postIbcOriginAssets.js +2 -0
- package/dist/api/postMessages.js +2 -0
- package/dist/api/postMessagesDirect.js +2 -0
- package/dist/api/postRecommendAssets.js +2 -0
- package/dist/api/postRoute.js +2 -0
- package/dist/api/postSubmitTransaction.js +2 -0
- package/dist/api/postTrackTransaction.js +2 -0
- package/dist/api/postTransactionStatus.js +2 -0
- package/dist/{chunk-C5CGY2X7.mjs → chunk-33K6EESX.js} +1 -1
- package/dist/{chunk-ZMEQSFOL.mjs → chunk-3N7XVGLX.js} +18 -23
- package/dist/{chunk-OTLFF5OB.mjs → chunk-3OZQ35X3.js} +101 -138
- package/dist/{chunk-7TBBV2YY.mjs → chunk-4JJWOILI.js} +1 -1
- package/dist/{chunk-QZ3X6MP3.mjs → chunk-BQTQJQ5E.js} +1 -1
- package/dist/{chunk-IHIJJNTV.mjs → chunk-BRJDNGYH.js} +6 -7
- package/dist/chunk-BRMONS6A.js +130 -0
- package/dist/{chunk-NNZFCKHP.mjs → chunk-C2EDPY6J.js} +1 -1
- package/dist/{chunk-KPK3Z6QZ.mjs → chunk-DW4U6YI6.js} +1 -1
- package/dist/chunk-GARVPN2H.js +16 -0
- package/dist/{chunk-NU7MCJOK.mjs → chunk-JTIHU43D.js} +32 -36
- package/dist/{chunk-J7GGREYX.mjs → chunk-KNV72XRZ.js} +1 -1
- package/dist/{chunk-CAAR7GDJ.mjs → chunk-MGVXJ2U4.js} +1 -1
- package/dist/{chunk-IGD32L7C.mjs → chunk-MTMPHY3Y.js} +1 -1
- package/dist/{chunk-CZ27FEZ7.mjs → chunk-PRQ2NHRZ.js} +1 -1
- package/dist/{chunk-LJVI5DLG.mjs → chunk-RDRDFJQE.js} +1 -1
- package/dist/{chunk-YWYU6P7W.mjs → chunk-RMP3HM5N.js} +2 -2
- package/dist/{chunk-DZQJN6OX.mjs → chunk-SQGWZAUC.js} +76 -86
- package/dist/{chunk-2ETF4N4H.mjs → chunk-TW77BXMT.js} +4 -5
- package/dist/{chunk-2F4MBSMT.mjs → chunk-VMPFHQ7U.js} +14 -20
- package/dist/chunk-W6TBGBV3.js +675 -0
- package/dist/chunk-Y5EY3Q6D.js +1790 -0
- package/dist/index.js +24 -0
- package/dist/public-functions/executeRoute.js +12 -0
- package/dist/public-functions/getFeeInfoForChain.js +5 -0
- package/dist/public-functions/getRecommendedGasPrice.js +7 -0
- package/dist/public-functions/getSigningStargateClient.js +4 -0
- package/dist/public-functions/setApiOptions.js +2 -0
- package/dist/public-functions/setClientOptions.js +4 -0
- package/package.json +12 -3
- package/dist/api/getAssets.d.mts +0 -19
- package/dist/api/getAssets.mjs +0 -2
- package/dist/api/getAssetsBetweenChains.d.mts +0 -56
- package/dist/api/getAssetsBetweenChains.mjs +0 -2
- package/dist/api/getBridges.d.mts +0 -54
- package/dist/api/getBridges.mjs +0 -2
- package/dist/api/getChains.d.mts +0 -41
- package/dist/api/getChains.mjs +0 -2
- package/dist/api/getVenues.d.mts +0 -13
- package/dist/api/getVenues.mjs +0 -2
- package/dist/api/postAssetsFromSource.d.mts +0 -13
- package/dist/api/postAssetsFromSource.mjs +0 -3
- package/dist/api/postBalances.d.mts +0 -35
- package/dist/api/postBalances.mjs +0 -2
- package/dist/api/postIbcOriginAssets.d.mts +0 -32
- package/dist/api/postIbcOriginAssets.mjs +0 -2
- package/dist/api/postMessages.d.mts +0 -528
- package/dist/api/postMessages.mjs +0 -2
- package/dist/api/postMessagesDirect.d.mts +0 -568
- package/dist/api/postMessagesDirect.mjs +0 -2
- package/dist/api/postRecommendAssets.d.mts +0 -40
- package/dist/api/postRecommendAssets.mjs +0 -2
- package/dist/api/postRoute.d.mts +0 -460
- package/dist/api/postRoute.mjs +0 -2
- package/dist/api/postSubmitTransaction.d.mts +0 -13
- package/dist/api/postSubmitTransaction.mjs +0 -2
- package/dist/api/postTrackTransaction.d.mts +0 -13
- package/dist/api/postTrackTransaction.mjs +0 -2
- package/dist/api/postTransactionStatus.d.mts +0 -559
- package/dist/api/postTransactionStatus.mjs +0 -2
- package/dist/apiState-CdzxTxYd.d.mts +0 -6
- package/dist/chunk-2FYLP573.mjs +0 -15
- package/dist/chunk-DKIWPD5I.mjs +0 -124
- package/dist/chunk-I2MX24LT.mjs +0 -2316
- package/dist/chunk-RXWDHQLG.mjs +0 -231
- package/dist/client-types-CVch1pZ-.d.mts +0 -60
- package/dist/executeRoute-CRdeEz1o.d.mts +0 -69
- package/dist/generateApi-3mHZ6Zbr.d.mts +0 -22
- package/dist/index.d.mts +0 -37
- package/dist/index.mjs +0 -24
- package/dist/public-functions/executeRoute.d.mts +0 -9
- package/dist/public-functions/executeRoute.mjs +0 -12
- package/dist/public-functions/getFeeInfoForChain.d.mts +0 -9
- package/dist/public-functions/getFeeInfoForChain.mjs +0 -5
- package/dist/public-functions/getRecommendedGasPrice.d.mts +0 -9
- package/dist/public-functions/getRecommendedGasPrice.mjs +0 -7
- package/dist/public-functions/getSigningStargateClient.d.mts +0 -13
- package/dist/public-functions/getSigningStargateClient.mjs +0 -4
- package/dist/public-functions/setApiOptions.d.mts +0 -9
- package/dist/public-functions/setApiOptions.mjs +0 -2
- package/dist/public-functions/setClientOptions.d.mts +0 -9
- package/dist/public-functions/setClientOptions.mjs +0 -4
- package/dist/setClientOptions-CVB_OUIn.d.mts +0 -19
- package/dist/swaggerTypes-O9-gvCT1.d.mts +0 -1890
- /package/dist/{chunk-ZAF3Z56R.mjs → chunk-SWYON2RG.js} +0 -0
- /package/dist/{chunk-TUBI6VE6.mjs → chunk-VQ5SIQWU.js} +0 -0
package/dist/chunk-RXWDHQLG.mjs
DELETED
|
@@ -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 };
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { OfflineAminoSigner } from '@cosmjs/amino';
|
|
2
|
-
import { OfflineDirectSigner } from '@cosmjs/proto-signing';
|
|
3
|
-
import { StdFee, GasPrice, SignerData } from '@cosmjs/stargate';
|
|
4
|
-
import { WalletClient } from 'viem';
|
|
5
|
-
import { Adapter } from '@solana/wallet-adapter-base';
|
|
6
|
-
import { a2 as FeeAsset, K as ChainType, V as CosmosMsg } from './swaggerTypes-O9-gvCT1.mjs';
|
|
7
|
-
|
|
8
|
-
/** Common Types */
|
|
9
|
-
type UserAddress = {
|
|
10
|
-
chainId: string;
|
|
11
|
-
address: string;
|
|
12
|
-
};
|
|
13
|
-
type EndpointOptions = {
|
|
14
|
-
rpc?: string;
|
|
15
|
-
rest?: string;
|
|
16
|
-
};
|
|
17
|
-
type ValidateGasResult = {
|
|
18
|
-
error: null | string;
|
|
19
|
-
asset: FeeAsset | null;
|
|
20
|
-
fee: StdFee | null;
|
|
21
|
-
};
|
|
22
|
-
/** Signer Getters */
|
|
23
|
-
type SignerGetters = {
|
|
24
|
-
getEvmSigner?: (chainId: string) => Promise<WalletClient>;
|
|
25
|
-
getCosmosSigner?: (chainId: string) => Promise<(OfflineAminoSigner & OfflineDirectSigner) | OfflineAminoSigner | OfflineDirectSigner>;
|
|
26
|
-
getSvmSigner?: () => Promise<Adapter>;
|
|
27
|
-
};
|
|
28
|
-
/** Gas Options */
|
|
29
|
-
type GetFallbackGasAmount = (chainId: string, chainType: ChainType) => Promise<number | undefined>;
|
|
30
|
-
type GetGasPrice = (chainId: string, chainType: ChainType) => Promise<GasPrice | undefined>;
|
|
31
|
-
type GasOptions = {
|
|
32
|
-
/**
|
|
33
|
-
* If `getGasPrice` is undefined, or returns undefined, the router will attempt to set the recommended gas price
|
|
34
|
-
**/
|
|
35
|
-
getGasPrice?: GetGasPrice;
|
|
36
|
-
/**
|
|
37
|
-
* If `getFallbackGasAmount` is set, when router fails to simulate the gas amount, it will use the fallback gas amount
|
|
38
|
-
*/
|
|
39
|
-
getFallbackGasAmount?: GetFallbackGasAmount;
|
|
40
|
-
gasAmountMultiplier?: number;
|
|
41
|
-
};
|
|
42
|
-
type SignCosmosMessageOptionsBase = {
|
|
43
|
-
signerAddress: string;
|
|
44
|
-
chainId: string;
|
|
45
|
-
cosmosMsgs: CosmosMsg[];
|
|
46
|
-
fee: StdFee;
|
|
47
|
-
signerData: SignerData;
|
|
48
|
-
};
|
|
49
|
-
type SignCosmosMessageDirectOptions = SignCosmosMessageOptionsBase & {
|
|
50
|
-
signer: OfflineDirectSigner;
|
|
51
|
-
};
|
|
52
|
-
type SignCosmosMessageAminoOptions = SignCosmosMessageOptionsBase & {
|
|
53
|
-
signer: OfflineAminoSigner;
|
|
54
|
-
};
|
|
55
|
-
type TxResult = {
|
|
56
|
-
txHash: string;
|
|
57
|
-
chainId: string;
|
|
58
|
-
};
|
|
59
|
-
|
|
60
|
-
export type { EndpointOptions as E, GetFallbackGasAmount as G, SignerGetters as S, TxResult as T, UserAddress as U, ValidateGasResult as V, GetGasPrice as a, GasOptions as b, SignCosmosMessageOptionsBase as c, SignCosmosMessageDirectOptions as d, SignCosmosMessageAminoOptions as e };
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { aT as TransferStatus, R as Erc20Approval, ap as RouteResponse, V as CosmosMsg } from './swaggerTypes-O9-gvCT1.mjs';
|
|
2
|
-
import { A as ApiRequest } from './generateApi-3mHZ6Zbr.mjs';
|
|
3
|
-
import { S as SignerGetters, b as GasOptions, U as UserAddress } from './client-types-CVch1pZ-.mjs';
|
|
4
|
-
|
|
5
|
-
type CallbackStatus = "success" | "error" | "pending" | "completed";
|
|
6
|
-
type TransactionCallbacks = {
|
|
7
|
-
onTransactionSigned?: (txInfo: {
|
|
8
|
-
chainId: string;
|
|
9
|
-
}) => Promise<void>;
|
|
10
|
-
onTransactionBroadcast?: (txInfo: {
|
|
11
|
-
txHash: string;
|
|
12
|
-
chainId: string;
|
|
13
|
-
}) => Promise<void>;
|
|
14
|
-
onTransactionTracked?: (txInfo: {
|
|
15
|
-
txHash: string;
|
|
16
|
-
chainId: string;
|
|
17
|
-
explorerLink: string;
|
|
18
|
-
}) => Promise<void>;
|
|
19
|
-
onTransactionCompleted?: (txInfo: {
|
|
20
|
-
chainId: string;
|
|
21
|
-
txHash: string;
|
|
22
|
-
status?: TransferStatus;
|
|
23
|
-
}) => Promise<void>;
|
|
24
|
-
onValidateGasBalance?: (value: {
|
|
25
|
-
chainId?: string;
|
|
26
|
-
txIndex?: number;
|
|
27
|
-
status: CallbackStatus;
|
|
28
|
-
}) => Promise<void>;
|
|
29
|
-
onApproveAllowance?: (value: {
|
|
30
|
-
allowance?: Erc20Approval;
|
|
31
|
-
status: CallbackStatus;
|
|
32
|
-
}) => Promise<void>;
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/** Execute Route Options */
|
|
36
|
-
type ExecuteRouteOptions = SignerGetters & GasOptions & TransactionCallbacks & Pick<ApiRequest<"getMsgsV2">, "timeoutSeconds"> & {
|
|
37
|
-
route: RouteResponse;
|
|
38
|
-
/**
|
|
39
|
-
* Addresses should be in the same order with the `chainIDs` in the `route`
|
|
40
|
-
*/
|
|
41
|
-
userAddresses: UserAddress[];
|
|
42
|
-
simulate?: boolean;
|
|
43
|
-
slippageTolerancePercent?: string;
|
|
44
|
-
/**
|
|
45
|
-
* Arbitrary Tx to be executed before or after route msgs
|
|
46
|
-
*/
|
|
47
|
-
beforeMsg?: CosmosMsg;
|
|
48
|
-
afterMsg?: CosmosMsg;
|
|
49
|
-
/**
|
|
50
|
-
* Set allowance amount to max if EVM transaction requires allowance approval.
|
|
51
|
-
*/
|
|
52
|
-
useUnlimitedApproval?: boolean;
|
|
53
|
-
/**
|
|
54
|
-
/**
|
|
55
|
-
* If `skipApproval` is set to `true`, the router will bypass checking whether
|
|
56
|
-
* the signer has granted approval for the specified token contract on an EVM chain.
|
|
57
|
-
* This can be useful if approval has already been handled externally or there are race conditions.
|
|
58
|
-
*/
|
|
59
|
-
bypassApprovalCheck?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* defaults to true
|
|
62
|
-
* If `batchSimulate` is set to `true`, it will simulate all messages in a batch before the first tx run.
|
|
63
|
-
* If `batchSimulate` is set to `false`, it will simulate each message one by one.
|
|
64
|
-
*/
|
|
65
|
-
batchSimulate?: boolean;
|
|
66
|
-
};
|
|
67
|
-
declare const executeRoute: (options: ExecuteRouteOptions) => Promise<void>;
|
|
68
|
-
|
|
69
|
-
export { type ExecuteRouteOptions as E, type TransactionCallbacks as T, executeRoute as e };
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { bc as Api } from './swaggerTypes-O9-gvCT1.mjs';
|
|
2
|
-
|
|
3
|
-
type CamelKey<S extends string> = S extends `${infer T}_${infer U}` ? `${T}${Capitalize<CamelKey<U>>}` : S;
|
|
4
|
-
type Camel<T> = T extends (infer U)[] ? Camel<U>[] : T extends object ? {
|
|
5
|
-
[K in keyof T as K extends string ? CamelKey<K> : never]: Camel<T[K]>;
|
|
6
|
-
} : T;
|
|
7
|
-
|
|
8
|
-
type ApiInstance = InstanceType<typeof Api>;
|
|
9
|
-
type FunctionKeys<T> = {
|
|
10
|
-
[K in keyof T]: T[K] extends (...args: any[]) => any ? K : never;
|
|
11
|
-
}[keyof T];
|
|
12
|
-
type ValidApiMethodKeys = {
|
|
13
|
-
[K in FunctionKeys<ApiInstance>]: Awaited<ReturnType<ApiInstance[K]>> extends {
|
|
14
|
-
data: unknown;
|
|
15
|
-
} ? K : never;
|
|
16
|
-
}[FunctionKeys<ApiInstance>];
|
|
17
|
-
type ApiRequest<K extends ValidApiMethodKeys> = NonNullable<Camel<Parameters<ApiInstance[K]>[0]>>;
|
|
18
|
-
type ApiResponse<K extends ValidApiMethodKeys> = Camel<Awaited<ReturnType<ApiInstance[K]>> extends {
|
|
19
|
-
data: infer D;
|
|
20
|
-
} ? D extends object ? D : never : never>;
|
|
21
|
-
|
|
22
|
-
export type { ApiRequest as A, ApiResponse as a };
|
package/dist/index.d.mts
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export { A as AcknowledgementErrorDetails, a as Affiliate, bc as Api, b8 as ApiConfig, b as ApiError, c as Asset, d as AssetBetweenChains, e as AssetRecommendation, f as AutopilotAction, g as AutopilotMsg, h as AutopilotMsgWrapper, i as AxelarTransfer, j as AxelarTransferInfo, k as AxelarTransferState, l as AxelarTransferType, m as AxelarTransferWrapper, B as BalanceRequestChainEntry, D as BalanceResponseChainEntry, z as BalanceResponseDenomEntry, E as BankSend, F as BankSendWrapper, H as Bridge, I as BridgeType, C as CCTPTransfer, n as CCTPTransferInfo, p as CCTPTransferState, o as CCTPTransferTxs, q as CCTPTransferWrapper, J as Chain, L as ChainAffiliates, al as ChainTransaction, K as ChainType, ba as ContentType, M as ContractCallWithTokenError, N as ContractCallWithTokenErrorType, O as ContractCallWithTokenTxs, P as CosmWasmContractMsg, Q as CosmWasmContractMsgWrapper, b0 as CosmosModuleSupport, V as CosmosMsg, W as CosmosTx, X as CosmosTxWrapper, R as Erc20Approval, U as Error, T as ErrorDetail, aV as EurekaTransfer, aW as EurekaTransferInfo, aX as EurekaTransferWrapper, Y as EvmSwap, Z as EvmSwapWrapper, _ as EvmTx, $ as EvmTxWrapper, b3 as Fee, a2 as FeeAsset, b2 as FeeType, b6 as FullRequestParams, a4 as GRPCStatusCode, a3 as GoFastFee, G as GoFastTransfer, y as GoFastTransferInfo, w as GoFastTransferState, x as GoFastTransferTxs, bb as HttpClient, b9 as HttpResponse, a5 as HyperlaneTransfer, a6 as HyperlaneTransferInfo, a7 as HyperlaneTransferState, a8 as HyperlaneTransferTransactions, a9 as HyperlaneTransferWrapper, aa as IBCTransferInfo, b1 as IbcCapabilities, aY as LayerZeroTransfer, aZ as LayerZeroTransferInfo, aO as LayerZeroTransferState, ah as LayerZeroTransferTransactions, a_ as LayerZeroTransferWrapper, ab as Msg, ad as MultiChainMsg, ae as MultiChainMsgWrapper, aJ as OPInitTransfer, aL as OPInitTransferInfo, aN as OPInitTransferState, aM as OPInitTransferTxs, aK as OPInitTransferWrapper, af as Operation, ag as OptionalAsset, ai as Packet, aj as PacketError, ak as PacketErrorType, am as PostHandler, b4 as QueryParamsType, an as Reason, a$ as RecommendationRequest, b7 as RequestParams, b5 as ResponseFormat, ao as RoutePriceWarningType, ap as RouteResponse, aq as SendTokenError, ar as SendTokenErrorType, as as SendTokenTxs, S as SmartRelayFeeQuote, aC as SmartSwapExactCoinIn, aE as SmartSwapInWrapper, aD as SmartSwapOptions, r as StargateTransfer, u as StargateTransferInfo, s as StargateTransferState, t as StargateTransferTxs, v as StargateTransferWrapper, at as StatusError, au as StatusErrorType, a0 as SvmTx, a1 as SvmTxWrapper, av as Swap, aw as SwapExactCoinIn, ax as SwapExactCoinOut, ay as SwapInWrapper, az as SwapOperation, aA as SwapOutWrapper, aB as SwapRoute, aF as SwapVenue, aG as SwapWrapper, aH as TransactionExecutionErrorDetails, aI as TransactionState, aP as Transfer, aS as TransferAssetRelease, aQ as TransferEvent, aR as TransferState, aT as TransferStatus, aU as TransferWrapper, ac as Tx } from './swaggerTypes-O9-gvCT1.mjs';
|
|
2
|
-
export { E as ExecuteRouteOptions, T as TransactionCallbacks, e as executeRoute } from './executeRoute-CRdeEz1o.mjs';
|
|
3
|
-
export { E as EndpointOptions, b as GasOptions, G as GetFallbackGasAmount, a as GetGasPrice, e as SignCosmosMessageAminoOptions, d as SignCosmosMessageDirectOptions, c as SignCosmosMessageOptionsBase, S as SignerGetters, T as TxResult, U as UserAddress, V as ValidateGasResult } from './client-types-CVch1pZ-.mjs';
|
|
4
|
-
export { assets } from './api/getAssets.mjs';
|
|
5
|
-
export { assetsBetweenChains } from './api/getAssetsBetweenChains.mjs';
|
|
6
|
-
export { bridges } from './api/getBridges.mjs';
|
|
7
|
-
export { chains } from './api/getChains.mjs';
|
|
8
|
-
export { venues } from './api/getVenues.mjs';
|
|
9
|
-
export { ibcOriginAssets } from './api/postIbcOriginAssets.mjs';
|
|
10
|
-
export { MessagesRequest, MessagesResponse, messages } from './api/postMessages.mjs';
|
|
11
|
-
export { messagesDirect } from './api/postMessagesDirect.mjs';
|
|
12
|
-
export { recommendAssets } from './api/postRecommendAssets.mjs';
|
|
13
|
-
export { assetsFromSource } from './api/postAssetsFromSource.mjs';
|
|
14
|
-
export { BalanceRequest, BalanceResponse, balances } from './api/postBalances.mjs';
|
|
15
|
-
export { RouteRequest, route } from './api/postRoute.mjs';
|
|
16
|
-
export { submitTransaction } from './api/postSubmitTransaction.mjs';
|
|
17
|
-
export { trackTransaction } from './api/postTrackTransaction.mjs';
|
|
18
|
-
export { TxStatusResponse, transactionStatus } from './api/postTransactionStatus.mjs';
|
|
19
|
-
export { getSigningStargateClient, getSigningStargateClientProps } from './public-functions/getSigningStargateClient.mjs';
|
|
20
|
-
export { S as SkipClientOptions, s as setClientOptions } from './setClientOptions-CVB_OUIn.mjs';
|
|
21
|
-
export { getRecommendedGasPrice } from './public-functions/getRecommendedGasPrice.mjs';
|
|
22
|
-
export { getFeeInfoForChain } from './public-functions/getFeeInfoForChain.mjs';
|
|
23
|
-
export { SetApiOptionsProps, setApiOptions } from './public-functions/setApiOptions.mjs';
|
|
24
|
-
import './generateApi-3mHZ6Zbr.mjs';
|
|
25
|
-
import '@cosmjs/amino';
|
|
26
|
-
import '@cosmjs/proto-signing';
|
|
27
|
-
import '@cosmjs/stargate';
|
|
28
|
-
import 'viem';
|
|
29
|
-
import '@solana/wallet-adapter-base';
|
|
30
|
-
import './apiState-CdzxTxYd.mjs';
|
|
31
|
-
import '@cosmjs/proto-signing/build/signer';
|
|
32
|
-
import '@cosmjs/stargate/build/signingstargateclient';
|
|
33
|
-
import '@cosmjs/stargate/build/fee';
|
|
34
|
-
|
|
35
|
-
declare const GAS_STATION_CHAIN_IDS: string[];
|
|
36
|
-
|
|
37
|
-
export { GAS_STATION_CHAIN_IDS };
|
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-I2MX24LT.mjs';
|
|
2
|
-
export { getRecommendedGasPrice } from './chunk-IHIJJNTV.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-ZMEQSFOL.mjs';
|
|
7
|
-
import './chunk-NU7MCJOK.mjs';
|
|
8
|
-
export { setApiOptions } from './chunk-2ETF4N4H.mjs';
|
|
9
|
-
export { setClientOptions } from './chunk-DZQJN6OX.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,9 +0,0 @@
|
|
|
1
|
-
export { E as ExecuteRouteOptions, e as executeRoute } from '../executeRoute-CRdeEz1o.mjs';
|
|
2
|
-
import '../swaggerTypes-O9-gvCT1.mjs';
|
|
3
|
-
import '../generateApi-3mHZ6Zbr.mjs';
|
|
4
|
-
import '../client-types-CVch1pZ-.mjs';
|
|
5
|
-
import '@cosmjs/amino';
|
|
6
|
-
import '@cosmjs/proto-signing';
|
|
7
|
-
import '@cosmjs/stargate';
|
|
8
|
-
import 'viem';
|
|
9
|
-
import '@solana/wallet-adapter-base';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export { executeRoute } from '../chunk-I2MX24LT.mjs';
|
|
2
|
-
import '../chunk-TUBI6VE6.mjs';
|
|
3
|
-
import '../chunk-ZAF3Z56R.mjs';
|
|
4
|
-
import '../chunk-ZMEQSFOL.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,9 +0,0 @@
|
|
|
1
|
-
import { a2 as FeeAsset } from '../swaggerTypes-O9-gvCT1.mjs';
|
|
2
|
-
import { S as SkipApiOptions } from '../apiState-CdzxTxYd.mjs';
|
|
3
|
-
|
|
4
|
-
type GetFeeInfoForChainProps = {
|
|
5
|
-
chainId: string;
|
|
6
|
-
} & SkipApiOptions;
|
|
7
|
-
declare const getFeeInfoForChain: ({ chainId, apiUrl, apiKey }: GetFeeInfoForChainProps) => Promise<FeeAsset | undefined>;
|
|
8
|
-
|
|
9
|
-
export { type GetFeeInfoForChainProps, getFeeInfoForChain };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { GasPrice } from '@cosmjs/stargate/build/fee';
|
|
2
|
-
import { S as SkipApiOptions } from '../apiState-CdzxTxYd.mjs';
|
|
3
|
-
|
|
4
|
-
type getRecommendedGasPriceProps = {
|
|
5
|
-
chainId: string;
|
|
6
|
-
} & SkipApiOptions;
|
|
7
|
-
declare const getRecommendedGasPrice: (props: getRecommendedGasPriceProps) => Promise<GasPrice | undefined>;
|
|
8
|
-
|
|
9
|
-
export { getRecommendedGasPrice, type getRecommendedGasPriceProps };
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { OfflineSigner } from '@cosmjs/proto-signing/build/signer';
|
|
2
|
-
import { SigningStargateClient } from '@cosmjs/stargate/build/signingstargateclient';
|
|
3
|
-
|
|
4
|
-
type getSigningStargateClientProps = {
|
|
5
|
-
chainId: string;
|
|
6
|
-
getOfflineSigner?: (chainId: string) => Promise<OfflineSigner>;
|
|
7
|
-
};
|
|
8
|
-
declare const getSigningStargateClient: ({ chainId, getOfflineSigner, }: getSigningStargateClientProps) => Promise<{
|
|
9
|
-
stargateClient: SigningStargateClient;
|
|
10
|
-
signer: OfflineSigner;
|
|
11
|
-
}>;
|
|
12
|
-
|
|
13
|
-
export { getSigningStargateClient, type getSigningStargateClientProps };
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { S as SkipApiOptions } from '../apiState-CdzxTxYd.mjs';
|
|
2
|
-
import { L as ChainAffiliates } from '../swaggerTypes-O9-gvCT1.mjs';
|
|
3
|
-
|
|
4
|
-
type SetApiOptionsProps = {
|
|
5
|
-
chainIdsToAffiliates?: Record<string, ChainAffiliates>;
|
|
6
|
-
} & SkipApiOptions;
|
|
7
|
-
declare const setApiOptions: (options?: SetApiOptionsProps) => Promise<void>;
|
|
8
|
-
|
|
9
|
-
export { type SetApiOptionsProps, setApiOptions };
|
|
@@ -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,19 +0,0 @@
|
|
|
1
|
-
import { GeneratedType } from '@cosmjs/proto-signing';
|
|
2
|
-
import { AminoConverters } from '@cosmjs/stargate';
|
|
3
|
-
import { S as SkipApiOptions } from './apiState-CdzxTxYd.mjs';
|
|
4
|
-
import { E as EndpointOptions } from './client-types-CVch1pZ-.mjs';
|
|
5
|
-
|
|
6
|
-
type SkipClientOptions = SkipApiOptions & {
|
|
7
|
-
endpointOptions?: {
|
|
8
|
-
endpoints?: Record<string, EndpointOptions>;
|
|
9
|
-
getRpcEndpointForChain?: (chainId: string) => Promise<string>;
|
|
10
|
-
getRestEndpointForChain?: (chainId: string) => Promise<string>;
|
|
11
|
-
};
|
|
12
|
-
aminoTypes?: AminoConverters;
|
|
13
|
-
registryTypes?: Iterable<[string, GeneratedType]>;
|
|
14
|
-
cacheDurationMs?: number;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
declare const setClientOptions: (options?: SkipClientOptions) => void;
|
|
18
|
-
|
|
19
|
-
export { type SkipClientOptions as S, setClientOptions as s };
|