@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
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { chains, findFirstWorkingEndpoint } from './chunk-
|
|
2
|
-
import { ClientState } from './chunk-
|
|
3
|
-
import {
|
|
4
|
-
import { SigningStargateClient } from '@cosmjs/stargate/build/signingstargateclient';
|
|
5
|
-
import { accountFromAny } from '@cosmjs/stargate';
|
|
1
|
+
import { chains, findFirstWorkingEndpoint } from './chunk-JTIHU43D.js';
|
|
2
|
+
import { ClientState } from './chunk-BRMONS6A.js';
|
|
3
|
+
import { accountFromAny, SigningStargateClient } from '@cosmjs/stargate';
|
|
6
4
|
import { assertDefinedAndNotNull } from '@cosmjs/utils';
|
|
7
5
|
import { BinaryWriter, BinaryReader } from 'cosmjs-types/binary';
|
|
8
6
|
import { BaseAccount } from 'cosmjs-types/cosmos/auth/v1beta1/auth';
|
|
@@ -171,10 +169,9 @@ var StridePeriodicVestingAccount = {
|
|
|
171
169
|
}
|
|
172
170
|
};
|
|
173
171
|
var accountParser = (acc) => {
|
|
174
|
-
var _a;
|
|
175
172
|
switch (acc.typeUrl) {
|
|
176
173
|
case "/stride.vesting.StridePeriodicVestingAccount": {
|
|
177
|
-
const baseAccount =
|
|
174
|
+
const baseAccount = StridePeriodicVestingAccount.decode(acc.value).baseVestingAccount?.baseAccount;
|
|
178
175
|
assertDefinedAndNotNull(baseAccount);
|
|
179
176
|
return {
|
|
180
177
|
address: baseAccount.address,
|
|
@@ -195,7 +192,7 @@ var accountParser = (acc) => {
|
|
|
195
192
|
const { address, pubKey, accountNumber, sequence } = BaseAccount.decode(
|
|
196
193
|
acc.value
|
|
197
194
|
);
|
|
198
|
-
if (
|
|
195
|
+
if (pubKey?.typeUrl === "/initia.crypto.v1beta1.ethsecp256k1.PubKey") {
|
|
199
196
|
const { key } = PubKey.decode(pubKey.value);
|
|
200
197
|
const pk = encodeSecp256k1Pubkey(key);
|
|
201
198
|
return {
|
|
@@ -212,14 +209,13 @@ var accountParser = (acc) => {
|
|
|
212
209
|
};
|
|
213
210
|
|
|
214
211
|
// src/private-functions/getRpcEndpointForChain.ts
|
|
215
|
-
var getRpcEndpointForChain = (chainId) =>
|
|
216
|
-
var _a, _b, _c, _d, _e;
|
|
212
|
+
var getRpcEndpointForChain = async (chainId) => {
|
|
217
213
|
if (ClientState.endpointOptions.getRpcEndpointForChain) {
|
|
218
214
|
return ClientState.endpointOptions.getRpcEndpointForChain(chainId);
|
|
219
215
|
}
|
|
220
216
|
if (ClientState.endpointOptions.endpoints && ClientState.endpointOptions.endpoints[chainId]) {
|
|
221
217
|
const endpointOptions = ClientState.endpointOptions.endpoints[chainId];
|
|
222
|
-
if (endpointOptions
|
|
218
|
+
if (endpointOptions?.rpc) {
|
|
223
219
|
return endpointOptions.rpc;
|
|
224
220
|
}
|
|
225
221
|
}
|
|
@@ -230,36 +226,35 @@ var getRpcEndpointForChain = (chainId) => __async(void 0, null, function* () {
|
|
|
230
226
|
if (!chain) {
|
|
231
227
|
throw new Error(`getRpcEndpointForChain: failed to find chain id '${chainId}' in registry`);
|
|
232
228
|
}
|
|
233
|
-
if (
|
|
229
|
+
if (chain.apis?.rpc?.length === 0 || !chain.apis?.rpc) {
|
|
234
230
|
throw new Error(
|
|
235
231
|
`getRpcEndpointForChain error: failed to find RPC endpoint for chain '${chainId}'`
|
|
236
232
|
);
|
|
237
233
|
}
|
|
238
|
-
const endpoints =
|
|
239
|
-
const endpoint =
|
|
234
|
+
const endpoints = chain.apis?.rpc?.map((api) => api.address);
|
|
235
|
+
const endpoint = await findFirstWorkingEndpoint(endpoints, "rpc");
|
|
240
236
|
if (!endpoint) {
|
|
241
237
|
throw new Error(
|
|
242
238
|
`getRpcEndpointForChain error: failed to find RPC endpoint for chain '${chainId}'`
|
|
243
239
|
);
|
|
244
240
|
}
|
|
245
241
|
return endpoint;
|
|
246
|
-
}
|
|
242
|
+
};
|
|
247
243
|
|
|
248
244
|
// src/public-functions/getSigningStargateClient.ts
|
|
249
|
-
var getSigningStargateClient =
|
|
245
|
+
var getSigningStargateClient = async ({
|
|
250
246
|
chainId,
|
|
251
247
|
getOfflineSigner
|
|
252
|
-
}) {
|
|
253
|
-
var _a;
|
|
248
|
+
}) => {
|
|
254
249
|
if (!getOfflineSigner) {
|
|
255
250
|
throw new Error("'getCosmosSigner' is not provided or configured in skip router");
|
|
256
251
|
}
|
|
257
|
-
if (!
|
|
258
|
-
const [signer, endpoint] =
|
|
252
|
+
if (!ClientState.signingStargateClientByChainId?.[chainId]) {
|
|
253
|
+
const [signer, endpoint] = await Promise.all([
|
|
259
254
|
getOfflineSigner(chainId),
|
|
260
255
|
getRpcEndpointForChain(chainId)
|
|
261
256
|
]);
|
|
262
|
-
ClientState.signingStargateClientByChainId[chainId] =
|
|
257
|
+
ClientState.signingStargateClientByChainId[chainId] = await SigningStargateClient.connectWithSigner(endpoint, signer, {
|
|
263
258
|
aminoTypes: ClientState.aminoTypes,
|
|
264
259
|
registry: ClientState.registry,
|
|
265
260
|
accountParser
|
|
@@ -267,8 +262,8 @@ var getSigningStargateClient = (_0) => __async(void 0, [_0], function* ({
|
|
|
267
262
|
}
|
|
268
263
|
return {
|
|
269
264
|
stargateClient: ClientState.signingStargateClientByChainId[chainId],
|
|
270
|
-
signer:
|
|
265
|
+
signer: await getOfflineSigner(chainId)
|
|
271
266
|
};
|
|
272
|
-
}
|
|
267
|
+
};
|
|
273
268
|
|
|
274
269
|
export { accountParser, getRpcEndpointForChain, getSigningStargateClient };
|