@skip-go/client 1.0.0-alpha-2 → 1.0.0-alpha-3
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.mjs +2 -25
- package/dist/api/getAssetsBetweenChains.mjs +2 -9
- package/dist/api/getBridges.mjs +2 -10
- package/dist/api/getChains.mjs +2 -16
- package/dist/api/getVenues.mjs +2 -10
- package/dist/api/postAssetsFromSource.mjs +3 -14
- package/dist/api/postBalances.mjs +2 -16
- package/dist/api/postIbcOriginAssets.mjs +2 -11
- package/dist/api/postMessages.d.mts +183 -183
- package/dist/api/postMessages.mjs +2 -10
- package/dist/api/postMessagesDirect.d.mts +183 -183
- package/dist/api/postMessagesDirect.mjs +2 -10
- package/dist/api/postRecommendAssets.mjs +2 -13
- package/dist/api/postRoute.d.mts +160 -160
- package/dist/api/postRoute.mjs +2 -16
- package/dist/api/postSubmitTransaction.mjs +2 -10
- package/dist/api/postTrackTransaction.mjs +2 -11
- package/dist/api/postTransactionStatus.mjs +2 -10
- package/dist/chunk-2ETF4N4H.mjs +45 -0
- package/dist/chunk-2F4MBSMT.mjs +99 -0
- package/dist/chunk-2FYLP573.mjs +15 -0
- package/dist/chunk-7TBBV2YY.mjs +13 -0
- package/dist/chunk-B72MYSG5.mjs +273 -0
- package/dist/chunk-C5CGY2X7.mjs +10 -0
- package/dist/chunk-CAAR7GDJ.mjs +11 -0
- package/dist/chunk-CZ27FEZ7.mjs +11 -0
- package/dist/chunk-DKIWPD5I.mjs +124 -0
- package/dist/chunk-IGD32L7C.mjs +9 -0
- package/dist/chunk-J7GGREYX.mjs +10 -0
- package/dist/chunk-KPK3Z6QZ.mjs +10 -0
- package/dist/chunk-KSMJWLEH.mjs +2315 -0
- package/dist/chunk-LJVI5DLG.mjs +10 -0
- package/dist/chunk-NNZFCKHP.mjs +10 -0
- package/dist/chunk-NU7MCJOK.mjs +187 -0
- package/dist/chunk-OTLFF5OB.mjs +3634 -0
- package/dist/chunk-PEZHVPSR.mjs +2237 -0
- package/dist/chunk-QZ3X6MP3.mjs +10 -0
- package/dist/chunk-RXWDHQLG.mjs +231 -0
- package/dist/chunk-TUBI6VE6.mjs +1344 -0
- package/dist/chunk-WDMGUHWR.mjs +23 -0
- package/dist/chunk-YWYU6P7W.mjs +14 -0
- package/dist/chunk-ZAF3Z56R.mjs +7 -0
- package/dist/index.mjs +24 -24
- package/dist/public-functions/executeRoute.mjs +12 -100
- package/dist/public-functions/getFeeInfoForChain.mjs +5 -47
- package/dist/public-functions/getRecommendedGasPrice.mjs +7 -1366
- package/dist/public-functions/getSigningStargateClient.mjs +4 -32
- package/dist/public-functions/setApiOptions.mjs +2 -46
- package/dist/public-functions/setClientOptions.mjs +4 -34
- package/package.json +1 -8
- package/dist/chunk-AXBFBHS2.mjs +0 -41
|
@@ -1,32 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { getRpcEndpointForChain } from '../private-functions/getRpcEndpointForChain.mjs';
|
|
6
|
-
|
|
7
|
-
var getSigningStargateClient = (_0) => __async(void 0, [_0], function* ({
|
|
8
|
-
chainId,
|
|
9
|
-
getOfflineSigner
|
|
10
|
-
}) {
|
|
11
|
-
var _a;
|
|
12
|
-
if (!getOfflineSigner) {
|
|
13
|
-
throw new Error("'getCosmosSigner' is not provided or configured in skip router");
|
|
14
|
-
}
|
|
15
|
-
if (!((_a = ClientState.signingStargateClientByChainId) == null ? void 0 : _a[chainId])) {
|
|
16
|
-
const [signer, endpoint] = yield Promise.all([
|
|
17
|
-
getOfflineSigner(chainId),
|
|
18
|
-
getRpcEndpointForChain(chainId)
|
|
19
|
-
]);
|
|
20
|
-
ClientState.signingStargateClientByChainId[chainId] = yield SigningStargateClient.connectWithSigner(endpoint, signer, {
|
|
21
|
-
aminoTypes: ClientState.aminoTypes,
|
|
22
|
-
registry: ClientState.registry,
|
|
23
|
-
accountParser
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return {
|
|
27
|
-
stargateClient: ClientState.signingStargateClientByChainId[chainId],
|
|
28
|
-
signer: yield getOfflineSigner(chainId)
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
export { getSigningStargateClient };
|
|
1
|
+
export { getSigningStargateClient } from '../chunk-B72MYSG5.mjs';
|
|
2
|
+
import '../chunk-NU7MCJOK.mjs';
|
|
3
|
+
import '../chunk-DKIWPD5I.mjs';
|
|
4
|
+
import '../chunk-RXWDHQLG.mjs';
|
|
@@ -1,46 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import { createRequestClient } from '../utils/generateApi.mjs';
|
|
4
|
-
|
|
5
|
-
var setApiOptions = (options = {}) => {
|
|
6
|
-
ApiState.client = createRequestClient({
|
|
7
|
-
baseUrl: options.apiUrl || "https://api.skip.build",
|
|
8
|
-
apiKey: options.apiKey
|
|
9
|
-
});
|
|
10
|
-
ApiState.setClientInitialized();
|
|
11
|
-
if (options.chainIdsToAffiliates) {
|
|
12
|
-
ApiState.cumulativeAffiliateFeeBPS = validateChainIdsToAffiliates(options.chainIdsToAffiliates);
|
|
13
|
-
ApiState.chainIdsToAffiliates = options.chainIdsToAffiliates;
|
|
14
|
-
}
|
|
15
|
-
return ApiState.clientInitialized;
|
|
16
|
-
};
|
|
17
|
-
function validateChainIdsToAffiliates(chainIdsToAffiliates) {
|
|
18
|
-
var _a;
|
|
19
|
-
const affiliatesArray = Object.values(chainIdsToAffiliates).map((chain) => chain.affiliates).filter((a) => a !== void 0);
|
|
20
|
-
const firstAffiliateBasisPointsFee = (_a = affiliatesArray[0]) == null ? void 0 : _a.reduce((acc, affiliate) => {
|
|
21
|
-
if (!affiliate.basisPointsFee) {
|
|
22
|
-
throw new Error("basisPointFee must exist in each affiliate");
|
|
23
|
-
}
|
|
24
|
-
return acc + parseInt(affiliate.basisPointsFee, 10);
|
|
25
|
-
}, 0);
|
|
26
|
-
const allBasisPointsAreEqual = affiliatesArray.every((affiliate) => {
|
|
27
|
-
const totalBasisPointsFee = affiliate.reduce((acc, affiliate2) => {
|
|
28
|
-
if (!affiliate2.basisPointsFee) {
|
|
29
|
-
throw new Error("basisPointFee must exist in each affiliate");
|
|
30
|
-
}
|
|
31
|
-
if (!affiliate2.address) {
|
|
32
|
-
throw new Error("address to receive fee must exist in each affiliate");
|
|
33
|
-
}
|
|
34
|
-
return acc + parseInt(affiliate2 == null ? void 0 : affiliate2.basisPointsFee, 10);
|
|
35
|
-
}, 0);
|
|
36
|
-
return totalBasisPointsFee === firstAffiliateBasisPointsFee;
|
|
37
|
-
});
|
|
38
|
-
if (!allBasisPointsAreEqual) {
|
|
39
|
-
throw new Error(
|
|
40
|
-
"basisPointFee does not add up to the same number for each chain in chainIdsToAffiliates"
|
|
41
|
-
);
|
|
42
|
-
}
|
|
43
|
-
return firstAffiliateBasisPointsFee == null ? void 0 : firstAffiliateBasisPointsFee.toFixed(0);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export { setApiOptions };
|
|
1
|
+
export { setApiOptions } from '../chunk-2ETF4N4H.mjs';
|
|
2
|
+
import '../chunk-RXWDHQLG.mjs';
|
|
@@ -1,34 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { evmosAminoConverters, evmosProtoRegistry } from 'src/codegen/evmos/client.mjs';
|
|
6
|
-
import { Registry } from '@cosmjs/proto-signing/build/registry';
|
|
7
|
-
import { MsgExecuteContract } from 'cosmjs-types/cosmwasm/wasm/v1/tx';
|
|
8
|
-
import { MsgExecute } from 'src/codegen/initia/move/v1/tx.mjs';
|
|
9
|
-
import { MsgInitiateTokenDeposit } from 'src/codegen/opinit/ophost/v1/tx.mjs';
|
|
10
|
-
import { ClientState } from '../state/clientState.mjs';
|
|
11
|
-
import { createRequestClient } from '../utils/generateApi.mjs';
|
|
12
|
-
import { ApiState } from 'src/state/apiState.mjs';
|
|
13
|
-
|
|
14
|
-
var setClientOptions = (options = {}) => {
|
|
15
|
-
var _a, _b, _c;
|
|
16
|
-
ApiState.client = createRequestClient({
|
|
17
|
-
baseUrl: options.apiUrl || "https://api.skip.build",
|
|
18
|
-
apiKey: options.apiKey
|
|
19
|
-
});
|
|
20
|
-
ClientState.endpointOptions = (_a = options.endpointOptions) != null ? _a : {};
|
|
21
|
-
ClientState.aminoTypes = new AminoTypes(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, createDefaultAminoConverters()), createWasmAminoConverters()), circleAminoConverters), evmosAminoConverters), (_b = options.aminoTypes) != null ? _b : {}));
|
|
22
|
-
ClientState.registry = new Registry([
|
|
23
|
-
...defaultRegistryTypes,
|
|
24
|
-
["/cosmwasm.wasm.v1.MsgExecuteContract", MsgExecuteContract],
|
|
25
|
-
["/initia.move.v1.MsgExecute", MsgExecute],
|
|
26
|
-
["/opinit.ophost.v1.MsgInitiateTokenDeposit", MsgInitiateTokenDeposit],
|
|
27
|
-
...circleProtoRegistry,
|
|
28
|
-
...evmosProtoRegistry,
|
|
29
|
-
...(_c = options.registryTypes) != null ? _c : []
|
|
30
|
-
]);
|
|
31
|
-
ApiState.setClientInitialized();
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export { setClientOptions };
|
|
1
|
+
export { setClientOptions } from '../chunk-PEZHVPSR.mjs';
|
|
2
|
+
import '../chunk-OTLFF5OB.mjs';
|
|
3
|
+
import '../chunk-DKIWPD5I.mjs';
|
|
4
|
+
import '../chunk-RXWDHQLG.mjs';
|
package/package.json
CHANGED
|
@@ -1,17 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skip-go/client",
|
|
3
3
|
"description": "JavaScript SDK for Skip Go API",
|
|
4
|
-
"version": "1.0.0-alpha-
|
|
4
|
+
"version": "1.0.0-alpha-3",
|
|
5
5
|
"repository": "https://github.com/skip-mev/skip-go",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
7
7
|
"types": "dist/index.d.mts",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"import": "./dist/index.mjs",
|
|
11
|
-
"types": "./dist/index.d.mts"
|
|
12
|
-
},
|
|
13
|
-
"./package.json": "./package.json"
|
|
14
|
-
},
|
|
15
8
|
"files": [
|
|
16
9
|
"dist/*",
|
|
17
10
|
"*.js",
|
package/dist/chunk-AXBFBHS2.mjs
DELETED
|
@@ -1,41 +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 __async = (__this, __arguments, generator) => {
|
|
21
|
-
return new Promise((resolve, reject) => {
|
|
22
|
-
var fulfilled = (value) => {
|
|
23
|
-
try {
|
|
24
|
-
step(generator.next(value));
|
|
25
|
-
} catch (e) {
|
|
26
|
-
reject(e);
|
|
27
|
-
}
|
|
28
|
-
};
|
|
29
|
-
var rejected = (value) => {
|
|
30
|
-
try {
|
|
31
|
-
step(generator.throw(value));
|
|
32
|
-
} catch (e) {
|
|
33
|
-
reject(e);
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
37
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export { __async, __spreadProps, __spreadValues };
|