@skip-go/client 1.3.4 → 1.3.5
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-KJ5NZG2D.cjs → chunk-3FYU3BJ7.cjs} +3 -3
- package/dist/cjs/{chunk-4AB775IT.cjs → chunk-5BVYKNVO.cjs} +25 -16
- package/dist/cjs/{chunk-TWXIFMTM.cjs → chunk-IE22IVFA.cjs} +2 -2
- package/dist/cjs/{chunk-B4OGYBRC.cjs → chunk-JTB3SPCH.cjs} +4 -4
- package/dist/cjs/chunk-MN763TPC.cjs +187 -0
- package/dist/cjs/{chunk-L4MLX6KI.cjs → chunk-SZ64FWGB.cjs} +2 -2
- package/dist/cjs/index.cjs +11 -11
- package/dist/cjs/public-functions/executeRoute.cjs +5 -5
- 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/validateCosmosGasBalance.cjs +4 -4
- package/dist/esm/{chunk-CFDTJGQK.js → chunk-5KIWNRW4.js} +1 -1
- package/dist/esm/{chunk-GD7EWX2G.js → chunk-ADUNNC4O.js} +1 -1
- package/dist/esm/chunk-VBWLUZXT.js +182 -0
- package/dist/esm/{chunk-JOBBQQDA.js → chunk-YL6PL36T.js} +17 -8
- package/dist/esm/{chunk-6F2T2KB3.js → chunk-YLVFZDR5.js} +2 -2
- package/dist/esm/{chunk-Y5H25R7Z.js → chunk-ZL6XF5A3.js} +1 -1
- package/dist/esm/index.js +6 -6
- package/dist/esm/public-functions/executeRoute.js +4 -4
- 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/validateCosmosGasBalance.js +3 -3
- package/package.json +1 -1
- package/dist/cjs/chunk-T5LPU5A2.cjs +0 -188
- package/dist/esm/chunk-43P4WRGN.js +0 -183
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkMN763TPC_cjs = require('./chunk-MN763TPC.cjs');
|
|
4
4
|
var chunkQSISUSYP_cjs = require('./chunk-QSISUSYP.cjs');
|
|
5
5
|
var stargate = require('@cosmjs/stargate');
|
|
6
6
|
var utils = require('@cosmjs/utils');
|
|
@@ -224,7 +224,7 @@ var getRpcEndpointForChain = async (chainId) => {
|
|
|
224
224
|
console.warn(
|
|
225
225
|
"Warning: You are using unreliable public endpoints. We strongly recommend overriding them via endpointOptions for use beyond development settings."
|
|
226
226
|
);
|
|
227
|
-
const chain =
|
|
227
|
+
const chain = chunkMN763TPC_cjs.chains().find((chain2) => chain2.chainId === chainId);
|
|
228
228
|
if (!chain) {
|
|
229
229
|
throw new Error(`getRpcEndpointForChain: failed to find chain id '${chainId}' in registry`);
|
|
230
230
|
}
|
|
@@ -234,7 +234,7 @@ var getRpcEndpointForChain = async (chainId) => {
|
|
|
234
234
|
);
|
|
235
235
|
}
|
|
236
236
|
const endpoints = chain.apis?.rpc?.map((api) => api.address);
|
|
237
|
-
const endpoint = await
|
|
237
|
+
const endpoint = await chunkMN763TPC_cjs.findFirstWorkingEndpoint(endpoints, "rpc");
|
|
238
238
|
if (!endpoint) {
|
|
239
239
|
throw new Error(
|
|
240
240
|
`getRpcEndpointForChain error: failed to find RPC endpoint for chain id '${chainId}'`
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkIE22IVFA_cjs = require('./chunk-IE22IVFA.cjs');
|
|
4
4
|
var chunkJ5RC6ZU5_cjs = require('./chunk-J5RC6ZU5.cjs');
|
|
5
5
|
var chunkN3LR7KTI_cjs = require('./chunk-N3LR7KTI.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 chunk3FYU3BJ7_cjs = require('./chunk-3FYU3BJ7.cjs');
|
|
10
|
+
var chunkMN763TPC_cjs = require('./chunk-MN763TPC.cjs');
|
|
11
11
|
var chunkFY56EEFB_cjs = require('./chunk-FY56EEFB.cjs');
|
|
12
12
|
var chunk2CCLIBCC_cjs = require('./chunk-2CCLIBCC.cjs');
|
|
13
13
|
var chunkMW3TE7DC_cjs = require('./chunk-MW3TE7DC.cjs');
|
|
@@ -39,7 +39,7 @@ var getRestEndpointForChain = async (chainId) => {
|
|
|
39
39
|
return endpointOptions.rest;
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
const chain =
|
|
42
|
+
const chain = chunkMN763TPC_cjs.chains().find((chain2) => chain2.chainId === chainId);
|
|
43
43
|
if (!chain) {
|
|
44
44
|
throw new Error(
|
|
45
45
|
`getRestEndpointForChain error: failed to find chain id '${chainId}' in registry`
|
|
@@ -51,7 +51,7 @@ var getRestEndpointForChain = async (chainId) => {
|
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
const endpoints = chain.apis?.rest?.map((api) => api.address);
|
|
54
|
-
const endpoint = await
|
|
54
|
+
const endpoint = await chunkMN763TPC_cjs.findFirstWorkingEndpoint(endpoints, "rest");
|
|
55
55
|
if (!endpoint) {
|
|
56
56
|
throw new Error(
|
|
57
57
|
`getRestEndpointForChain error: failed to find REST endpoint for chain id '${chainId}'`
|
|
@@ -65,9 +65,9 @@ var getAccountNumberAndSequence = async (address, chainId) => {
|
|
|
65
65
|
if (chainId.includes("dymension")) {
|
|
66
66
|
return getAccountNumberAndSequenceFromDymension(address, chainId);
|
|
67
67
|
}
|
|
68
|
-
const endpoint = await
|
|
68
|
+
const endpoint = await chunk3FYU3BJ7_cjs.getRpcEndpointForChain(chainId);
|
|
69
69
|
const client = chunkQSISUSYP_cjs.ClientState.signingStargateClientByChainId[chainId] ?? await stargate.StargateClient.connect(endpoint, {
|
|
70
|
-
accountParser:
|
|
70
|
+
accountParser: chunk3FYU3BJ7_cjs.accountParser
|
|
71
71
|
});
|
|
72
72
|
const account = await client.getAccount(address);
|
|
73
73
|
if (!account) {
|
|
@@ -81,9 +81,18 @@ var getAccountNumberAndSequence = async (address, chainId) => {
|
|
|
81
81
|
};
|
|
82
82
|
var getAccountNumberAndSequenceFromDymension = async (address, chainId) => {
|
|
83
83
|
const endpoint = await getRestEndpointForChain(chainId);
|
|
84
|
-
const
|
|
85
|
-
|
|
86
|
-
|
|
84
|
+
const res = await fetch(
|
|
85
|
+
`${endpoint}/cosmos/auth/v1beta1/accounts/${address}`,
|
|
86
|
+
{
|
|
87
|
+
headers: {
|
|
88
|
+
"Content-Type": "application/json"
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
if (!res.ok) {
|
|
93
|
+
throw new Error(`Failed to fetch account data: ${res.statusText}`);
|
|
94
|
+
}
|
|
95
|
+
const jsonResponse = await res.json();
|
|
87
96
|
const response = chunkHKQ5VION_cjs.toCamel(jsonResponse);
|
|
88
97
|
let sequence = 0;
|
|
89
98
|
let accountNumber = 0;
|
|
@@ -208,7 +217,7 @@ function encodeEthSecp256k1Pubkey(pubkey) {
|
|
|
208
217
|
|
|
209
218
|
// src/proto-signing/pubkey.ts
|
|
210
219
|
function makePubkeyAnyFromAccount(account, chainId) {
|
|
211
|
-
const isEthermint =
|
|
220
|
+
const isEthermint = chunkMN763TPC_cjs.getIsEthermint(chainId);
|
|
212
221
|
const pubkey = isEthermint ? encodeEthSecp256k1Pubkey(account.pubkey) : amino.encodeSecp256k1Pubkey(account.pubkey);
|
|
213
222
|
const pubkeyAny = encodePubkeyToAny(pubkey, chainId, isEthermint);
|
|
214
223
|
return pubkeyAny;
|
|
@@ -229,7 +238,7 @@ function encodePubkeyToAny(pubkey, chainId, isEthermint) {
|
|
|
229
238
|
value: Uint8Array.from(keys_js.PubKey.encode(pubkeyProto).finish())
|
|
230
239
|
});
|
|
231
240
|
} else {
|
|
232
|
-
const isInitia =
|
|
241
|
+
const isInitia = chunkMN763TPC_cjs.getIsInitia(chainId);
|
|
233
242
|
const pubkeyProto = keys_js.PubKey.fromPartial({
|
|
234
243
|
key: encoding.fromBase64(pubkey.value)
|
|
235
244
|
});
|
|
@@ -371,7 +380,7 @@ var signCosmosTransaction = async ({
|
|
|
371
380
|
if (messages2 === void 0) {
|
|
372
381
|
throw new Error("no messages found for tx");
|
|
373
382
|
}
|
|
374
|
-
const { signer } = await
|
|
383
|
+
const { signer } = await chunk3FYU3BJ7_cjs.getSigningStargateClient({
|
|
375
384
|
chainId,
|
|
376
385
|
getOfflineSigner: options?.getCosmosSigner
|
|
377
386
|
});
|
|
@@ -802,7 +811,7 @@ var executeSvmTransaction = async (tx, options, index) => {
|
|
|
802
811
|
if (!signedTx) {
|
|
803
812
|
throw new Error("executeSvmTransaction error: signedTx is undefined");
|
|
804
813
|
}
|
|
805
|
-
const endpoint = await
|
|
814
|
+
const endpoint = await chunk3FYU3BJ7_cjs.getRpcEndpointForChain(svmTx.chainId);
|
|
806
815
|
const connection = new web3_js.Connection(endpoint);
|
|
807
816
|
let signature;
|
|
808
817
|
const submitTxResponse = await chunk2CCLIBCC_cjs.submitTransaction({
|
|
@@ -1033,7 +1042,7 @@ var validateSvmGasBalance = async ({
|
|
|
1033
1042
|
fee: null
|
|
1034
1043
|
};
|
|
1035
1044
|
}
|
|
1036
|
-
const endpoint = await
|
|
1045
|
+
const endpoint = await chunk3FYU3BJ7_cjs.getRpcEndpointForChain(tx.chainId ?? "");
|
|
1037
1046
|
const connection = new web3_js.Connection(endpoint);
|
|
1038
1047
|
if (!connection) throw new Error(`Failed to connect to ${tx.chainId}`);
|
|
1039
1048
|
if (!tx.tx) {
|
|
@@ -1113,7 +1122,7 @@ var validateGasBalances = async ({
|
|
|
1113
1122
|
throw new Error(`invalid msgs ${tx?.cosmosTx?.msgs}`);
|
|
1114
1123
|
}
|
|
1115
1124
|
try {
|
|
1116
|
-
const res = await
|
|
1125
|
+
const res = await chunkIE22IVFA_cjs.validateCosmosGasBalance({
|
|
1117
1126
|
chainId: tx.cosmosTx.chainId ?? "",
|
|
1118
1127
|
signerAddress: tx.cosmosTx.signerAddress ?? "",
|
|
1119
1128
|
messages: tx.cosmosTx.msgs,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var chunkN3LR7KTI_cjs = require('./chunk-N3LR7KTI.cjs');
|
|
4
4
|
var chunk4R6OCWRR_cjs = require('./chunk-4R6OCWRR.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunk3FYU3BJ7_cjs = require('./chunk-3FYU3BJ7.cjs');
|
|
6
6
|
var chunkQSISUSYP_cjs = require('./chunk-QSISUSYP.cjs');
|
|
7
7
|
var stargate = require('@cosmjs/stargate');
|
|
8
8
|
var math = require('@cosmjs/math');
|
|
@@ -34,7 +34,7 @@ var validateCosmosGasBalance = async ({
|
|
|
34
34
|
if (txIndex !== 0 && chainId === "noble-1") {
|
|
35
35
|
return "0";
|
|
36
36
|
}
|
|
37
|
-
const { stargateClient } = await
|
|
37
|
+
const { stargateClient } = await chunk3FYU3BJ7_cjs.getSigningStargateClient({
|
|
38
38
|
chainId,
|
|
39
39
|
getOfflineSigner
|
|
40
40
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkKZOSEIWH_cjs = require('./chunk-KZOSEIWH.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkMN763TPC_cjs = require('./chunk-MN763TPC.cjs');
|
|
5
5
|
var chunkQSISUSYP_cjs = require('./chunk-QSISUSYP.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 = chunkMN763TPC_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 = chunkMN763TPC_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 = chunkMN763TPC_cjs.chains().find((chain2) => chain2.chainId === chainId);
|
|
73
73
|
if (!chain) {
|
|
74
74
|
return void 0;
|
|
75
75
|
}
|