@skip-go/client 1.5.0 → 1.5.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/cjs/{chunk-W3KF3V57.cjs → chunk-5CB6SPCX.cjs} +4 -4
- package/dist/cjs/{chunk-HHZGD62Y.cjs → chunk-EZGHN6ZL.cjs} +25 -25
- package/dist/cjs/{chunk-UIQML2XG.cjs → chunk-KHJQE3DI.cjs} +24 -11
- package/dist/cjs/chunk-KSJ5QYMR.cjs +185 -0
- package/dist/cjs/{chunk-GCJO6DZD.cjs → chunk-N5V3YW5K.cjs} +6 -6
- package/dist/cjs/{chunk-VF65UG3E.cjs → chunk-NDSHB4I6.cjs} +8 -8
- package/dist/cjs/{chunk-K4YAPDUE.cjs → chunk-QZ2BGX6O.cjs} +2 -2
- package/dist/cjs/{chunk-X22PL5T7.cjs → chunk-RVXCF6AL.cjs} +3 -3
- package/dist/cjs/{chunk-CUDPMOR6.cjs → chunk-V3FWWJG2.cjs} +2 -2
- package/dist/cjs/index.cjs +16 -16
- package/dist/cjs/public-functions/executeMultipleRoutes.cjs +7 -7
- package/dist/cjs/public-functions/executeRoute.cjs +7 -7
- package/dist/cjs/public-functions/getFeeInfoForChain.cjs +3 -3
- package/dist/cjs/public-functions/getRecommendedGasPrice.cjs +4 -4
- package/dist/cjs/public-functions/getSigningStargateClient.cjs +3 -3
- package/dist/cjs/public-functions/subscribeToRouteStatus.cjs +5 -5
- package/dist/cjs/public-functions/validateCosmosGasBalance.cjs +4 -4
- package/dist/esm/api/getAssets.d.ts +1 -1
- package/dist/esm/api/getAssetsBetweenChains.d.ts +1 -1
- package/dist/esm/api/getBridges.d.ts +3 -3
- package/dist/esm/api/getChains.d.ts +1 -1
- package/dist/esm/api/postAssetsFromSource.d.ts +10 -1
- package/dist/esm/api/postBalances.d.ts +2 -2
- package/dist/esm/api/postMessages.d.ts +2 -2
- package/dist/esm/api/postMessagesDirect.d.ts +3 -1
- package/dist/esm/api/postRecommendAssets.d.ts +1 -1
- package/dist/esm/api/postRoute.d.ts +4 -2
- package/dist/esm/api/postSubmitTransaction.d.ts +2 -2
- package/dist/esm/api/postTrackTransaction.d.ts +2 -2
- package/dist/esm/api/postTransactionStatus.d.ts +2 -2
- package/dist/esm/{callbacks-CvqAtBJq.d.ts → callbacks-DCqqd0D9.d.ts} +4 -6
- package/dist/esm/{chunk-CX5N7ZLJ.js → chunk-2DD5F6PK.js} +1 -1
- package/dist/esm/{chunk-KLGGCB73.js → chunk-3J5IMMMB.js} +1 -1
- package/dist/esm/{chunk-7RS3YIVC.js → chunk-562J5DCB.js} +2 -2
- package/dist/esm/{chunk-MPSXXWKL.js → chunk-BZDVQMHK.js} +1 -1
- package/dist/esm/{chunk-AZALP3WR.js → chunk-FVQFGEL2.js} +2 -2
- package/dist/esm/chunk-RHGDUD76.js +180 -0
- package/dist/esm/{chunk-JKN4E5VN.js → chunk-VZGOU6MB.js} +1 -1
- package/dist/esm/{chunk-MTAS5XMN.js → chunk-W5EGS2G4.js} +4 -4
- package/dist/esm/{chunk-VUXLWWLF.js → chunk-XYYXRVFN.js} +24 -11
- package/dist/esm/{client-types-Dk6ypWdO.d.ts → client-types-BSZasIDd.d.ts} +1 -1
- package/dist/esm/{generateApi-C_xgtxrO.d.ts → generateApi-CwM4Ca30.d.ts} +1 -1
- package/dist/esm/index.d.ts +215 -6
- package/dist/esm/index.js +9 -9
- package/dist/esm/public-functions/executeMultipleRoutes.d.ts +4 -4
- package/dist/esm/public-functions/executeMultipleRoutes.js +6 -6
- package/dist/esm/public-functions/executeRoute.d.ts +4 -4
- package/dist/esm/public-functions/executeRoute.js +6 -6
- package/dist/esm/public-functions/getCosmosGasAmountForMessage.d.ts +1 -1
- package/dist/esm/public-functions/getEvmGasAmountForMessage.d.ts +3 -3
- package/dist/esm/public-functions/getFeeInfoForChain.d.ts +1 -1
- package/dist/esm/public-functions/getFeeInfoForChain.js +2 -2
- package/dist/esm/public-functions/getRecommendedGasPrice.js +3 -3
- package/dist/esm/public-functions/getSigningStargateClient.js +2 -2
- package/dist/esm/public-functions/setApiOptions.d.ts +1 -1
- package/dist/esm/public-functions/setClientOptions.d.ts +4 -4
- package/dist/esm/public-functions/subscribeToRouteStatus.d.ts +4 -4
- package/dist/esm/public-functions/subscribeToRouteStatus.js +1 -1
- package/dist/esm/public-functions/validateCosmosGasBalance.d.ts +4 -4
- package/dist/esm/public-functions/validateCosmosGasBalance.js +3 -3
- package/dist/esm/public-functions/waitForTransaction.d.ts +4 -4
- package/dist/esm/{setClientOptions-BD8e7m2x.d.ts → setClientOptions-0DYCj_A5.d.ts} +1 -1
- package/dist/esm/{swaggerTypes-DDwqIjap.d.ts → swaggerTypes-Bh6hu5Q-.d.ts} +220 -196
- package/package.json +1 -1
- package/dist/cjs/chunk-4YTACAVP.cjs +0 -185
- package/dist/esm/chunk-IUYOY23L.js +0 -180
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkKZOSEIWH_cjs = require('./chunk-KZOSEIWH.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkKSJ5QYMR_cjs = require('./chunk-KSJ5QYMR.cjs');
|
|
5
5
|
var chunkN4UW74AG_cjs = require('./chunk-N4UW74AG.cjs');
|
|
6
6
|
|
|
7
7
|
// src/private-functions/getDefaultGasTokenForChain.ts
|
|
@@ -10,7 +10,7 @@ var getDefaultGasTokenForChain = async (chainId) => {
|
|
|
10
10
|
if (gasDenom) {
|
|
11
11
|
return gasDenom;
|
|
12
12
|
}
|
|
13
|
-
const chain =
|
|
13
|
+
const chain = chunkKSJ5QYMR_cjs.chains().find((chain2) => chain2.chainId === chainId);
|
|
14
14
|
if (!chain) {
|
|
15
15
|
return void 0;
|
|
16
16
|
}
|
|
@@ -39,7 +39,7 @@ var getDefaultGasTokenForChain = async (chainId) => {
|
|
|
39
39
|
return chain.fees.feeTokens[0]?.denom;
|
|
40
40
|
};
|
|
41
41
|
var getStakingTokensForChain = (chainId) => {
|
|
42
|
-
const chain =
|
|
42
|
+
const chain = chunkKSJ5QYMR_cjs.chains().find((chain2) => chain2.chainId === chainId);
|
|
43
43
|
if (!chain) {
|
|
44
44
|
throw new Error(
|
|
45
45
|
`getStakingTokensForChain error: failed to find chain id '${chainId}' in registry`
|
|
@@ -69,7 +69,7 @@ var getFeeInfoForChain = async ({ chainId, apiUrl, apiKey }) => {
|
|
|
69
69
|
if (skipFeeInfo && skipFeeInfo.gasPrice !== null) {
|
|
70
70
|
return skipFeeInfo;
|
|
71
71
|
}
|
|
72
|
-
const chain =
|
|
72
|
+
const chain = chunkKSJ5QYMR_cjs.chains().find((chain2) => chain2.chainId === chainId);
|
|
73
73
|
if (!chain) {
|
|
74
74
|
return void 0;
|
|
75
75
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkKHJQE3DI_cjs = require('./chunk-KHJQE3DI.cjs');
|
|
4
|
+
var chunkV3FWWJG2_cjs = require('./chunk-V3FWWJG2.cjs');
|
|
5
5
|
var chunkKM2D7PJL_cjs = require('./chunk-KM2D7PJL.cjs');
|
|
6
6
|
var chunkF3EB2AQG_cjs = require('./chunk-F3EB2AQG.cjs');
|
|
7
7
|
var chunk4R6OCWRR_cjs = require('./chunk-4R6OCWRR.cjs');
|
|
8
8
|
var chunkKZOSEIWH_cjs = require('./chunk-KZOSEIWH.cjs');
|
|
9
|
-
var
|
|
10
|
-
var
|
|
9
|
+
var chunkRVXCF6AL_cjs = require('./chunk-RVXCF6AL.cjs');
|
|
10
|
+
var chunkKSJ5QYMR_cjs = require('./chunk-KSJ5QYMR.cjs');
|
|
11
11
|
var chunk5HDKZVOL_cjs = require('./chunk-5HDKZVOL.cjs');
|
|
12
12
|
var chunk5AYPH3ZR_cjs = require('./chunk-5AYPH3ZR.cjs');
|
|
13
13
|
var chunkN4UW74AG_cjs = require('./chunk-N4UW74AG.cjs');
|
|
@@ -36,7 +36,7 @@ var getRestEndpointForChain = async (chainId) => {
|
|
|
36
36
|
return endpointOptions.rest;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
const chain =
|
|
39
|
+
const chain = chunkKSJ5QYMR_cjs.chains().find((chain2) => chain2.chainId === chainId);
|
|
40
40
|
if (!chain) {
|
|
41
41
|
throw new Error(
|
|
42
42
|
`getRestEndpointForChain error: failed to find chain id '${chainId}' in registry`
|
|
@@ -48,7 +48,7 @@ var getRestEndpointForChain = async (chainId) => {
|
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
const endpoints = chain.apis?.rest?.map((api) => api.address);
|
|
51
|
-
const endpoint = await
|
|
51
|
+
const endpoint = await chunkKSJ5QYMR_cjs.findFirstWorkingEndpoint(endpoints, "rest");
|
|
52
52
|
if (!endpoint) {
|
|
53
53
|
throw new Error(
|
|
54
54
|
`getRestEndpointForChain error: failed to find REST endpoint for chain id '${chainId}'`
|
|
@@ -62,9 +62,9 @@ var getAccountNumberAndSequence = async (address, chainId) => {
|
|
|
62
62
|
if (chainId.includes("dymension")) {
|
|
63
63
|
return getAccountNumberAndSequenceFromDymension(address, chainId);
|
|
64
64
|
}
|
|
65
|
-
const endpoint = await
|
|
65
|
+
const endpoint = await chunkRVXCF6AL_cjs.getRpcEndpointForChain(chainId);
|
|
66
66
|
const client = chunkN4UW74AG_cjs.ClientState.signingStargateClientByChainId[chainId] ?? await stargate.StargateClient.connect(endpoint, {
|
|
67
|
-
accountParser:
|
|
67
|
+
accountParser: chunkRVXCF6AL_cjs.accountParser
|
|
68
68
|
});
|
|
69
69
|
const account = await client.getAccount(address);
|
|
70
70
|
if (!account) {
|
|
@@ -125,7 +125,7 @@ function encodeEthSecp256k1Pubkey(pubkey) {
|
|
|
125
125
|
|
|
126
126
|
// src/proto-signing/pubkey.ts
|
|
127
127
|
function makePubkeyAnyFromAccount(account, chainId) {
|
|
128
|
-
const isEthermint =
|
|
128
|
+
const isEthermint = chunkKSJ5QYMR_cjs.getIsEthermint(chainId);
|
|
129
129
|
const pubkey = isEthermint ? encodeEthSecp256k1Pubkey(account.pubkey) : amino.encodeSecp256k1Pubkey(account.pubkey);
|
|
130
130
|
const pubkeyAny = encodePubkeyToAny(pubkey, chainId, isEthermint);
|
|
131
131
|
return pubkeyAny;
|
|
@@ -146,7 +146,7 @@ function encodePubkeyToAny(pubkey, chainId, isEthermint) {
|
|
|
146
146
|
value: Uint8Array.from(keys_js.PubKey.encode(pubkeyProto).finish())
|
|
147
147
|
});
|
|
148
148
|
} else {
|
|
149
|
-
const isInitia =
|
|
149
|
+
const isInitia = chunkKSJ5QYMR_cjs.getIsInitia(chainId);
|
|
150
150
|
const pubkeyProto = keys_js.PubKey.fromPartial({
|
|
151
151
|
key: encoding.fromBase64(pubkey.value)
|
|
152
152
|
});
|
|
@@ -289,7 +289,7 @@ var signCosmosTransaction = async ({
|
|
|
289
289
|
if (messages === void 0) {
|
|
290
290
|
throw new Error("no messages found for tx");
|
|
291
291
|
}
|
|
292
|
-
const { signer } = await
|
|
292
|
+
const { signer } = await chunkRVXCF6AL_cjs.getSigningStargateClient({
|
|
293
293
|
chainId,
|
|
294
294
|
getOfflineSigner: options?.getCosmosSigner
|
|
295
295
|
});
|
|
@@ -328,7 +328,7 @@ var signCosmosTransaction = async ({
|
|
|
328
328
|
txIndex: index,
|
|
329
329
|
signerAddress: currentUserAddress
|
|
330
330
|
});
|
|
331
|
-
|
|
331
|
+
chunkKHJQE3DI_cjs.updateRouteDetails({
|
|
332
332
|
status: "signing",
|
|
333
333
|
routeId,
|
|
334
334
|
options
|
|
@@ -344,7 +344,7 @@ var signCosmosTransaction = async ({
|
|
|
344
344
|
options?.onTransactionSigned?.({
|
|
345
345
|
chainId
|
|
346
346
|
});
|
|
347
|
-
|
|
347
|
+
chunkKHJQE3DI_cjs.updateRouteDetails({
|
|
348
348
|
status: "pending",
|
|
349
349
|
routeId,
|
|
350
350
|
options
|
|
@@ -630,7 +630,7 @@ var executeEvmTransaction = async (message, options, index, routeId) => {
|
|
|
630
630
|
status: "pending",
|
|
631
631
|
allowance: requiredApproval
|
|
632
632
|
});
|
|
633
|
-
|
|
633
|
+
chunkKHJQE3DI_cjs.updateRouteDetails({
|
|
634
634
|
status: "allowance",
|
|
635
635
|
routeId,
|
|
636
636
|
options
|
|
@@ -664,7 +664,7 @@ var executeEvmTransaction = async (message, options, index, routeId) => {
|
|
|
664
664
|
signerAddress: evmSigner.account.address,
|
|
665
665
|
txIndex: index
|
|
666
666
|
});
|
|
667
|
-
|
|
667
|
+
chunkKHJQE3DI_cjs.updateRouteDetails({
|
|
668
668
|
status: "signing",
|
|
669
669
|
routeId,
|
|
670
670
|
options
|
|
@@ -676,7 +676,7 @@ var executeEvmTransaction = async (message, options, index, routeId) => {
|
|
|
676
676
|
chain: evmSigner.chain,
|
|
677
677
|
value: evmTx.value === "" ? void 0 : BigInt(evmTx.value)
|
|
678
678
|
});
|
|
679
|
-
|
|
679
|
+
chunkKHJQE3DI_cjs.updateRouteDetails({
|
|
680
680
|
status: "pending",
|
|
681
681
|
routeId,
|
|
682
682
|
options
|
|
@@ -732,14 +732,14 @@ var signSvmTransaction = async ({
|
|
|
732
732
|
signerAddress: signer.publicKey?.toBase58(),
|
|
733
733
|
txIndex: index
|
|
734
734
|
});
|
|
735
|
-
|
|
735
|
+
chunkKHJQE3DI_cjs.updateRouteDetails({
|
|
736
736
|
status: "signing",
|
|
737
737
|
routeId,
|
|
738
738
|
options
|
|
739
739
|
});
|
|
740
740
|
const signedTx = await signer.signTransaction(transaction);
|
|
741
741
|
options?.onTransactionSigned?.({ chainId: svmTx.chainId });
|
|
742
|
-
|
|
742
|
+
chunkKHJQE3DI_cjs.updateRouteDetails({
|
|
743
743
|
status: "pending",
|
|
744
744
|
routeId,
|
|
745
745
|
options
|
|
@@ -758,7 +758,7 @@ var executeSvmTransaction = async (tx, options, index, routeId) => {
|
|
|
758
758
|
if (!signedTx) {
|
|
759
759
|
throw new Error("executeSvmTransaction error: signedTx is undefined");
|
|
760
760
|
}
|
|
761
|
-
const endpoint = await
|
|
761
|
+
const endpoint = await chunkRVXCF6AL_cjs.getRpcEndpointForChain(svmTx.chainId);
|
|
762
762
|
const connection = new web3_js.Connection(endpoint);
|
|
763
763
|
let signature;
|
|
764
764
|
const submitTxResponse = await chunk5HDKZVOL_cjs.submitTransaction({
|
|
@@ -990,7 +990,7 @@ var validateSvmGasBalance = async ({
|
|
|
990
990
|
fee: null
|
|
991
991
|
};
|
|
992
992
|
}
|
|
993
|
-
const endpoint = await
|
|
993
|
+
const endpoint = await chunkRVXCF6AL_cjs.getRpcEndpointForChain(tx.chainId ?? "");
|
|
994
994
|
const connection = new web3_js.Connection(endpoint);
|
|
995
995
|
if (!connection) throw new Error(`Failed to connect to ${tx.chainId}`);
|
|
996
996
|
if (!tx.tx) {
|
|
@@ -1068,7 +1068,7 @@ var validateGasBalances = async ({
|
|
|
1068
1068
|
onValidateGasBalance?.({
|
|
1069
1069
|
status: "pending"
|
|
1070
1070
|
});
|
|
1071
|
-
|
|
1071
|
+
chunkKHJQE3DI_cjs.updateRouteDetails({
|
|
1072
1072
|
status: "validating",
|
|
1073
1073
|
routeId,
|
|
1074
1074
|
options
|
|
@@ -1077,7 +1077,7 @@ var validateGasBalances = async ({
|
|
|
1077
1077
|
throw new Error(`invalid msgs ${tx?.cosmosTx?.msgs}`);
|
|
1078
1078
|
}
|
|
1079
1079
|
try {
|
|
1080
|
-
const res = await
|
|
1080
|
+
const res = await chunkV3FWWJG2_cjs.validateCosmosGasBalance({
|
|
1081
1081
|
chainId: tx.cosmosTx.chainId ?? "",
|
|
1082
1082
|
signerAddress: tx.cosmosTx.signerAddress ?? "",
|
|
1083
1083
|
messages: tx.cosmosTx.msgs,
|
|
@@ -1102,7 +1102,7 @@ var validateGasBalances = async ({
|
|
|
1102
1102
|
onValidateGasBalance?.({
|
|
1103
1103
|
status: "pending"
|
|
1104
1104
|
});
|
|
1105
|
-
|
|
1105
|
+
chunkKHJQE3DI_cjs.updateRouteDetails({
|
|
1106
1106
|
status: "validating",
|
|
1107
1107
|
routeId,
|
|
1108
1108
|
options
|
|
@@ -1135,7 +1135,7 @@ var validateGasBalances = async ({
|
|
|
1135
1135
|
onValidateGasBalance?.({
|
|
1136
1136
|
status: "pending"
|
|
1137
1137
|
});
|
|
1138
|
-
|
|
1138
|
+
chunkKHJQE3DI_cjs.updateRouteDetails({
|
|
1139
1139
|
status: "validating",
|
|
1140
1140
|
routeId,
|
|
1141
1141
|
options
|
|
@@ -1231,7 +1231,7 @@ var executeTransactions = async (options) => {
|
|
|
1231
1231
|
throw new Error("executeRoute error: invalid message type");
|
|
1232
1232
|
}
|
|
1233
1233
|
});
|
|
1234
|
-
|
|
1234
|
+
chunkKHJQE3DI_cjs.updateRouteDetails({
|
|
1235
1235
|
transactionDetails,
|
|
1236
1236
|
routeId,
|
|
1237
1237
|
options
|
|
@@ -198,8 +198,6 @@ var executeAndSubscribeToRouteStatus = async ({
|
|
|
198
198
|
transactionDetails,
|
|
199
199
|
executeTransaction,
|
|
200
200
|
trackTxPollingOptions,
|
|
201
|
-
onTransactionTracked,
|
|
202
|
-
onTransactionCompleted,
|
|
203
201
|
routeDetails,
|
|
204
202
|
onRouteStatusUpdated,
|
|
205
203
|
options,
|
|
@@ -228,7 +226,7 @@ var executeAndSubscribeToRouteStatus = async ({
|
|
|
228
226
|
explorerLink = trackResponse.explorerLink;
|
|
229
227
|
}
|
|
230
228
|
transaction.explorerLink = explorerLink;
|
|
231
|
-
await onTransactionTracked?.({
|
|
229
|
+
await options?.onTransactionTracked?.({
|
|
232
230
|
txHash: transaction.txHash,
|
|
233
231
|
chainId: transaction.chainId,
|
|
234
232
|
explorerLink
|
|
@@ -252,6 +250,11 @@ var executeAndSubscribeToRouteStatus = async ({
|
|
|
252
250
|
(relatedRoute) => relatedRoute && isFinalRouteStatus(relatedRoute)
|
|
253
251
|
);
|
|
254
252
|
if (isFinalState(transaction) && allRelatedRoutesFinal) {
|
|
253
|
+
options?.onTransactionCompleted?.({
|
|
254
|
+
chainId: transaction.chainId,
|
|
255
|
+
txHash: transaction.txHash,
|
|
256
|
+
status: transaction.statusResponse
|
|
257
|
+
});
|
|
255
258
|
break;
|
|
256
259
|
}
|
|
257
260
|
if (isCancelled?.()) {
|
|
@@ -275,14 +278,24 @@ var executeAndSubscribeToRouteStatus = async ({
|
|
|
275
278
|
relatedRoutes: routeDetails?.relatedRoutes
|
|
276
279
|
});
|
|
277
280
|
if (isFinalState(transaction)) {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
281
|
+
const relatedRoutes = updatedRouteDetails?.relatedRoutes && updatedRouteDetails?.relatedRoutes.length > 0 ? updatedRouteDetails.relatedRoutes : routeDetails?.relatedRoutes;
|
|
282
|
+
if (relatedRoutes && relatedRoutes.length > 0) {
|
|
283
|
+
if (relatedRoutes.every(
|
|
284
|
+
(relatedRoute) => isFinalRouteStatus(relatedRoute)
|
|
285
|
+
)) {
|
|
286
|
+
options?.onTransactionCompleted?.({
|
|
287
|
+
chainId: transaction.chainId,
|
|
288
|
+
txHash: transaction.txHash,
|
|
289
|
+
status: statusResponse
|
|
290
|
+
});
|
|
291
|
+
break;
|
|
292
|
+
}
|
|
293
|
+
} else {
|
|
294
|
+
options?.onTransactionCompleted?.({
|
|
295
|
+
chainId: transaction.chainId,
|
|
296
|
+
txHash: transaction.txHash,
|
|
297
|
+
status: statusResponse
|
|
298
|
+
});
|
|
286
299
|
break;
|
|
287
300
|
}
|
|
288
301
|
}
|