@skip-go/client 1.0.0-alpha-2 → 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.
- package/dist/api/{getAssets.d.mts → getAssets.d.ts} +2 -2
- package/dist/api/getAssets.js +2 -0
- package/dist/api/{getAssetsBetweenChains.d.mts → getAssetsBetweenChains.d.ts} +2 -2
- package/dist/api/getAssetsBetweenChains.js +2 -0
- package/dist/api/{getBridges.d.mts → getBridges.d.ts} +2 -2
- package/dist/api/getBridges.js +2 -0
- package/dist/api/{getChains.d.mts → getChains.d.ts} +2 -2
- package/dist/api/getChains.js +2 -0
- package/dist/api/{getVenues.d.mts → getVenues.d.ts} +1 -1
- package/dist/api/getVenues.js +2 -0
- package/dist/api/{postAssetsFromSource.d.mts → postAssetsFromSource.d.ts} +2 -2
- package/dist/api/postAssetsFromSource.js +3 -0
- package/dist/api/{postBalances.d.mts → postBalances.d.ts} +3 -3
- package/dist/api/postBalances.js +2 -0
- package/dist/api/{postIbcOriginAssets.d.mts → postIbcOriginAssets.d.ts} +1 -1
- package/dist/api/postIbcOriginAssets.js +2 -0
- package/dist/api/{postMessages.d.mts → postMessages.d.ts} +186 -186
- package/dist/api/postMessages.js +2 -0
- package/dist/api/{postMessagesDirect.d.mts → postMessagesDirect.d.ts} +185 -185
- package/dist/api/postMessagesDirect.js +2 -0
- package/dist/api/{postRecommendAssets.d.mts → postRecommendAssets.d.ts} +2 -2
- package/dist/api/postRecommendAssets.js +2 -0
- package/dist/api/{postRoute.d.mts → postRoute.d.ts} +163 -163
- package/dist/api/postRoute.js +2 -0
- package/dist/api/{postSubmitTransaction.d.mts → postSubmitTransaction.d.ts} +1 -1
- package/dist/api/postSubmitTransaction.js +2 -0
- package/dist/api/{postTrackTransaction.d.mts → postTrackTransaction.d.ts} +1 -1
- package/dist/api/postTrackTransaction.js +2 -0
- package/dist/api/{postTransactionStatus.d.mts → postTransactionStatus.d.ts} +3 -3
- package/dist/api/postTransactionStatus.js +2 -0
- package/dist/{api/postRecommendAssets.mjs → chunk-2H4KT24S.js} +2 -2
- package/dist/chunk-3OZQ35X3.js +3597 -0
- package/dist/chunk-44YEAWRJ.js +22 -0
- package/dist/chunk-66DO7NZD.js +183 -0
- package/dist/chunk-6IZXDY7U.js +93 -0
- package/dist/chunk-6JMGI4N7.js +2229 -0
- package/dist/{api/postAssetsFromSource.mjs → chunk-6MCLH626.js} +3 -3
- package/dist/{api/postTrackTransaction.mjs → chunk-6SEZNZJY.js} +2 -2
- package/dist/{api/postSubmitTransaction.mjs → chunk-BQTWTYWD.js} +2 -2
- package/dist/chunk-DUCP65HQ.js +675 -0
- package/dist/{api/postMessages.mjs → chunk-EAVQIWH7.js} +2 -2
- package/dist/{api/postMessagesDirect.mjs → chunk-HFWTLB35.js} +2 -2
- package/dist/{api/getVenues.mjs → chunk-JBPMJE44.js} +2 -2
- package/dist/{api/postIbcOriginAssets.mjs → chunk-LJ4RFN4L.js} +2 -2
- package/dist/{api/postTransactionStatus.mjs → chunk-MKEROBAQ.js} +2 -2
- package/dist/{api/getBridges.mjs → chunk-QKCJUB43.js} +2 -2
- package/dist/{public-functions/setApiOptions.mjs → chunk-RSUFWUIE.js} +5 -7
- package/dist/chunk-SWYON2RG.js +7 -0
- package/dist/chunk-T3G7MVDN.js +16 -0
- package/dist/{public-functions/getRecommendedGasPrice.mjs → chunk-VQ5SIQWU.js} +1 -23
- package/dist/chunk-XEDYWBEU.js +1792 -0
- package/dist/chunk-XOC57DJF.js +269 -0
- package/dist/{api/getAssetsBetweenChains.mjs → chunk-XS6XFYYD.js} +2 -2
- package/dist/chunk-Y325PIRY.js +130 -0
- package/dist/{client-types-CVch1pZ-.d.mts → client-types-CxjtffyG.d.ts} +1 -1
- package/dist/{executeRoute-CRdeEz1o.d.mts → executeRoute-BKvMVd1I.d.ts} +3 -3
- package/dist/{generateApi-3mHZ6Zbr.d.mts → generateApi-DqCp36fX.d.ts} +1 -1
- package/dist/{index.d.mts → index.d.ts} +25 -25
- package/dist/index.js +24 -0
- package/dist/public-functions/{executeRoute.d.mts → executeRoute.d.ts} +4 -4
- package/dist/public-functions/executeRoute.js +12 -0
- package/dist/public-functions/{getFeeInfoForChain.d.mts → getFeeInfoForChain.d.ts} +2 -2
- package/dist/public-functions/getFeeInfoForChain.js +5 -0
- package/dist/public-functions/{getRecommendedGasPrice.d.mts → getRecommendedGasPrice.d.ts} +1 -1
- package/dist/public-functions/getRecommendedGasPrice.js +7 -0
- package/dist/public-functions/getSigningStargateClient.js +4 -0
- package/dist/public-functions/{setApiOptions.d.mts → setApiOptions.d.ts} +2 -2
- package/dist/public-functions/setApiOptions.js +2 -0
- package/dist/public-functions/setClientOptions.d.ts +9 -0
- package/dist/public-functions/setClientOptions.js +4 -0
- package/dist/{setClientOptions-CVB_OUIn.d.mts → setClientOptions-DbanEIwL.d.ts} +2 -2
- package/package.json +40 -6
- package/dist/api/getAssets.mjs +0 -25
- package/dist/api/getChains.mjs +0 -16
- package/dist/api/postBalances.mjs +0 -16
- package/dist/api/postRoute.mjs +0 -16
- package/dist/chunk-AXBFBHS2.mjs +0 -41
- package/dist/index.mjs +0 -24
- package/dist/public-functions/executeRoute.mjs +0 -100
- package/dist/public-functions/getFeeInfoForChain.mjs +0 -47
- package/dist/public-functions/getSigningStargateClient.mjs +0 -32
- package/dist/public-functions/setClientOptions.d.mts +0 -9
- package/dist/public-functions/setClientOptions.mjs +0 -34
- /package/dist/{apiState-CdzxTxYd.d.mts → apiState-CdzxTxYd.d.ts} +0 -0
- /package/dist/public-functions/{getSigningStargateClient.d.mts → getSigningStargateClient.d.ts} +0 -0
- /package/dist/{swaggerTypes-O9-gvCT1.d.mts → swaggerTypes-O9-gvCT1.d.ts} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { pollingApi } from '../utils/generateApi.mjs';
|
|
1
|
+
import { pollingApi } from './chunk-DUCP65HQ.js';
|
|
3
2
|
|
|
3
|
+
// src/api/postTransactionStatus.ts
|
|
4
4
|
var transactionStatus = pollingApi({
|
|
5
5
|
methodName: "getTransactionStatusV2",
|
|
6
6
|
path: "/v2/tx/status",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import { ApiState } from 'src/state/apiState.mjs';
|
|
3
|
-
import { createRequestClient } from '../utils/generateApi.mjs';
|
|
1
|
+
import { ApiState, createRequestClient } from './chunk-DUCP65HQ.js';
|
|
4
2
|
|
|
3
|
+
// src/public-functions/setApiOptions.ts
|
|
5
4
|
var setApiOptions = (options = {}) => {
|
|
6
5
|
ApiState.client = createRequestClient({
|
|
7
6
|
baseUrl: options.apiUrl || "https://api.skip.build",
|
|
@@ -15,9 +14,8 @@ var setApiOptions = (options = {}) => {
|
|
|
15
14
|
return ApiState.clientInitialized;
|
|
16
15
|
};
|
|
17
16
|
function validateChainIdsToAffiliates(chainIdsToAffiliates) {
|
|
18
|
-
var _a;
|
|
19
17
|
const affiliatesArray = Object.values(chainIdsToAffiliates).map((chain) => chain.affiliates).filter((a) => a !== void 0);
|
|
20
|
-
const firstAffiliateBasisPointsFee =
|
|
18
|
+
const firstAffiliateBasisPointsFee = affiliatesArray[0]?.reduce((acc, affiliate) => {
|
|
21
19
|
if (!affiliate.basisPointsFee) {
|
|
22
20
|
throw new Error("basisPointFee must exist in each affiliate");
|
|
23
21
|
}
|
|
@@ -31,7 +29,7 @@ function validateChainIdsToAffiliates(chainIdsToAffiliates) {
|
|
|
31
29
|
if (!affiliate2.address) {
|
|
32
30
|
throw new Error("address to receive fee must exist in each affiliate");
|
|
33
31
|
}
|
|
34
|
-
return acc + parseInt(affiliate2
|
|
32
|
+
return acc + parseInt(affiliate2?.basisPointsFee, 10);
|
|
35
33
|
}, 0);
|
|
36
34
|
return totalBasisPointsFee === firstAffiliateBasisPointsFee;
|
|
37
35
|
});
|
|
@@ -40,7 +38,7 @@ function validateChainIdsToAffiliates(chainIdsToAffiliates) {
|
|
|
40
38
|
"basisPointFee does not add up to the same number for each chain in chainIdsToAffiliates"
|
|
41
39
|
);
|
|
42
40
|
}
|
|
43
|
-
return firstAffiliateBasisPointsFee
|
|
41
|
+
return firstAffiliateBasisPointsFee?.toFixed(0);
|
|
44
42
|
}
|
|
45
43
|
|
|
46
44
|
export { setApiOptions };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ApiState, api } from './chunk-DUCP65HQ.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 };
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import { __async } from '../chunk-AXBFBHS2.mjs';
|
|
2
|
-
import { Decimal } from '@cosmjs/math/build/decimal';
|
|
3
|
-
import { GasPrice } from '@cosmjs/stargate';
|
|
4
|
-
import { getFeeInfoForChain } from 'src/public-functions/getFeeInfoForChain.mjs';
|
|
5
|
-
|
|
6
1
|
// ../../node_modules/bignumber.js/bignumber.mjs
|
|
7
2
|
var isNumeric = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;
|
|
8
3
|
var mathceil = Math.ceil;
|
|
@@ -1346,21 +1341,4 @@ function toFixedPoint(str, e, z) {
|
|
|
1346
1341
|
}
|
|
1347
1342
|
var BigNumber = clone();
|
|
1348
1343
|
|
|
1349
|
-
|
|
1350
|
-
var getRecommendedGasPrice = (props) => __async(void 0, null, function* () {
|
|
1351
|
-
const feeInfo = yield getFeeInfoForChain(props);
|
|
1352
|
-
if (!feeInfo || !feeInfo.gasPrice) {
|
|
1353
|
-
return void 0;
|
|
1354
|
-
}
|
|
1355
|
-
let price = feeInfo.gasPrice.average;
|
|
1356
|
-
if (price === "") {
|
|
1357
|
-
price = feeInfo.gasPrice.high;
|
|
1358
|
-
}
|
|
1359
|
-
if (price === "") {
|
|
1360
|
-
price = feeInfo.gasPrice.low;
|
|
1361
|
-
}
|
|
1362
|
-
if (!price) return;
|
|
1363
|
-
return new GasPrice(Decimal.fromUserInput(BigNumber(price).toFixed(), 18), feeInfo.denom);
|
|
1364
|
-
});
|
|
1365
|
-
|
|
1366
|
-
export { getRecommendedGasPrice };
|
|
1344
|
+
export { BigNumber };
|