@skip-go/client 1.5.8 → 1.5.9
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-5YIGBG5L.cjs +185 -0
- package/dist/cjs/{chunk-IKW6KEBR.cjs → chunk-KSSCA63F.cjs} +3 -3
- package/dist/cjs/{chunk-AJAKXRMU.cjs → chunk-LXO7LI67.cjs} +3 -3
- package/dist/cjs/{chunk-MAIPDPG2.cjs → chunk-MQDVHLSO.cjs} +3 -3
- package/dist/cjs/{chunk-P4WDCGXH.cjs → chunk-PK52AJPP.cjs} +4 -4
- package/dist/cjs/{chunk-QTEVKV42.cjs → chunk-Q67SRREF.cjs} +4 -4
- package/dist/cjs/{chunk-4KPBBDLF.cjs → chunk-SNDRAYA6.cjs} +11 -9
- package/dist/cjs/{chunk-GFISU6YP.cjs → chunk-TAO6SPEJ.cjs} +16 -16
- package/dist/cjs/{chunk-2ZWLTAT4.cjs → chunk-U6MTA2JG.cjs} +6 -6
- package/dist/cjs/index.cjs +37 -38
- package/dist/cjs/public-functions/executeMultipleRoutes.cjs +6 -7
- package/dist/cjs/public-functions/executeRoute.cjs +6 -7
- package/dist/cjs/public-functions/getFeeInfoForChain.cjs +3 -3
- package/dist/cjs/public-functions/getRecommendedGasPrice.cjs +4 -5
- package/dist/cjs/public-functions/getRouteWithGasOnReceive.cjs +10 -11
- package/dist/cjs/public-functions/getSigningStargateClient.cjs +3 -3
- package/dist/cjs/public-functions/validateCosmosGasBalance.cjs +4 -5
- package/dist/esm/{chunk-LY5N6CIL.js → chunk-472RXHE7.js} +2 -2
- package/dist/esm/{chunk-M7ODNKRS.js → chunk-5XVMDYUC.js} +4 -4
- package/dist/esm/{chunk-32JIBODG.js → chunk-6URWUQ4I.js} +7 -9
- package/dist/esm/{chunk-WIQPJ6JH.js → chunk-I65D76KL.js} +1 -1
- package/dist/esm/{chunk-3HAURBPX.js → chunk-KHWB37HP.js} +1 -1
- package/dist/esm/{chunk-7VC424OM.js → chunk-SCIQM6HX.js} +1 -1
- package/dist/esm/chunk-TGIUPSHR.js +180 -0
- package/dist/esm/{chunk-4HXJSGX4.js → chunk-UMJLJYCI.js} +1 -1
- package/dist/esm/{chunk-I6MYY4XP.js → chunk-YA3ZZYLE.js} +2 -2
- package/dist/esm/index.js +9 -10
- package/dist/esm/public-functions/executeMultipleRoutes.js +5 -6
- package/dist/esm/public-functions/executeRoute.js +5 -6
- package/dist/esm/public-functions/getFeeInfoForChain.js +2 -2
- package/dist/esm/public-functions/getRecommendedGasPrice.js +3 -4
- package/dist/esm/public-functions/getRouteWithGasOnReceive.js +9 -10
- package/dist/esm/public-functions/getSigningStargateClient.js +2 -2
- package/dist/esm/public-functions/validateCosmosGasBalance.js +3 -4
- package/package.json +2 -1
- package/dist/cjs/chunk-6W2OIU3O.cjs +0 -1348
- package/dist/cjs/chunk-E4JCU2RG.cjs +0 -185
- package/dist/esm/chunk-CGZNJAHL.js +0 -180
- package/dist/esm/chunk-KS764SOZ.js +0 -1345
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkTAO6SPEJ_cjs = require('./chunk-TAO6SPEJ.cjs');
|
|
4
4
|
var chunkA3UNNRKD_cjs = require('./chunk-A3UNNRKD.cjs');
|
|
5
5
|
var chunkNCFH5MGF_cjs = require('./chunk-NCFH5MGF.cjs');
|
|
6
6
|
var chunk2QPPD3BB_cjs = require('./chunk-2QPPD3BB.cjs');
|
|
@@ -12,7 +12,7 @@ var executeRoute = async (options) => {
|
|
|
12
12
|
status: "unconfirmed",
|
|
13
13
|
options
|
|
14
14
|
});
|
|
15
|
-
const addressList = await
|
|
15
|
+
const addressList = await chunkTAO6SPEJ_cjs.createValidAddressList({
|
|
16
16
|
userAddresses,
|
|
17
17
|
route
|
|
18
18
|
});
|
|
@@ -43,7 +43,7 @@ var executeRoute = async (options) => {
|
|
|
43
43
|
}
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
|
-
const { transactionDetails, executeTransaction } = await
|
|
46
|
+
const { transactionDetails, executeTransaction } = await chunkTAO6SPEJ_cjs.executeTransactions({ ...options, routeId, txs: response?.txs });
|
|
47
47
|
await chunkA3UNNRKD_cjs.executeAndSubscribeToRouteStatus({
|
|
48
48
|
transactionDetails,
|
|
49
49
|
executeTransaction,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkTAO6SPEJ_cjs = require('./chunk-TAO6SPEJ.cjs');
|
|
4
4
|
var chunkA3UNNRKD_cjs = require('./chunk-A3UNNRKD.cjs');
|
|
5
5
|
var chunkNCFH5MGF_cjs = require('./chunk-NCFH5MGF.cjs');
|
|
6
6
|
var chunkAUTOIM57_cjs = require('./chunk-AUTOIM57.cjs');
|
|
@@ -24,7 +24,7 @@ var executeMultipleRoutes = async (options) => {
|
|
|
24
24
|
`executeMultipleRoutes error: no user addresses found for route: ${routeKey}`
|
|
25
25
|
);
|
|
26
26
|
}
|
|
27
|
-
const routeAddressList = await
|
|
27
|
+
const routeAddressList = await chunkTAO6SPEJ_cjs.createValidAddressList({
|
|
28
28
|
userAddresses: _userAddresses,
|
|
29
29
|
route: routeValue
|
|
30
30
|
});
|
|
@@ -132,7 +132,7 @@ var executeMultipleRoutes = async (options) => {
|
|
|
132
132
|
if (routeKey === "mainRoute") {
|
|
133
133
|
mainRouteId = routeId;
|
|
134
134
|
}
|
|
135
|
-
const { transactionDetails, executeTransaction: _executeTransaction } = await
|
|
135
|
+
const { transactionDetails, executeTransaction: _executeTransaction } = await chunkTAO6SPEJ_cjs.executeTransactions({
|
|
136
136
|
...restOptions,
|
|
137
137
|
routeId,
|
|
138
138
|
txs: msgsResponse?.txs,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkMUJBB64F_cjs = require('./chunk-MUJBB64F.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunk5YIGBG5L_cjs = require('./chunk-5YIGBG5L.cjs');
|
|
5
5
|
var chunkATW6UNT5_cjs = require('./chunk-ATW6UNT5.cjs');
|
|
6
6
|
var stargate = require('@cosmjs/stargate');
|
|
7
7
|
var utils = require('@cosmjs/utils');
|
|
@@ -334,7 +334,7 @@ var getRpcEndpointForChain = async (chainId) => {
|
|
|
334
334
|
console.warn(
|
|
335
335
|
"Warning: You are using unreliable public endpoints. We strongly recommend overriding them via endpointOptions for use beyond development settings."
|
|
336
336
|
);
|
|
337
|
-
const chain =
|
|
337
|
+
const chain = chunk5YIGBG5L_cjs.chains().find((chain2) => chain2.chainId === chainId);
|
|
338
338
|
if (!chain) {
|
|
339
339
|
throw new Error(`getRpcEndpointForChain: failed to find chain id '${chainId}' in registry`);
|
|
340
340
|
}
|
|
@@ -344,7 +344,7 @@ var getRpcEndpointForChain = async (chainId) => {
|
|
|
344
344
|
);
|
|
345
345
|
}
|
|
346
346
|
const endpoints = chain.apis?.rpc?.map((api) => api.address);
|
|
347
|
-
const endpoint = await
|
|
347
|
+
const endpoint = await chunk5YIGBG5L_cjs.findFirstWorkingEndpoint(endpoints, "rpc");
|
|
348
348
|
if (!endpoint) {
|
|
349
349
|
throw new Error(
|
|
350
350
|
`getRpcEndpointForChain error: failed to find RPC endpoint for chain id '${chainId}'`
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var chunkQTEVKV42_cjs = require('./chunk-QTEVKV42.cjs');
|
|
3
|
+
var chunkQ67SRREF_cjs = require('./chunk-Q67SRREF.cjs');
|
|
5
4
|
var math = require('@cosmjs/math');
|
|
6
5
|
var stargate = require('@cosmjs/stargate');
|
|
6
|
+
var bignumber_js = require('bignumber.js');
|
|
7
7
|
|
|
8
8
|
var getRecommendedGasPrice = async (props) => {
|
|
9
|
-
const feeInfo = await
|
|
9
|
+
const feeInfo = await chunkQ67SRREF_cjs.getFeeInfoForChain(props);
|
|
10
10
|
if (!feeInfo || !feeInfo.gasPrice) {
|
|
11
11
|
return void 0;
|
|
12
12
|
}
|
|
@@ -18,7 +18,7 @@ var getRecommendedGasPrice = async (props) => {
|
|
|
18
18
|
price = feeInfo.gasPrice.low;
|
|
19
19
|
}
|
|
20
20
|
if (!price) return;
|
|
21
|
-
return new stargate.GasPrice(math.Decimal.fromUserInput(
|
|
21
|
+
return new stargate.GasPrice(math.Decimal.fromUserInput(bignumber_js.BigNumber(price).toFixed(), 18), feeInfo.denom);
|
|
22
22
|
};
|
|
23
23
|
|
|
24
24
|
exports.getRecommendedGasPrice = getRecommendedGasPrice;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk5YIGBG5L_cjs = require('./chunk-5YIGBG5L.cjs');
|
|
4
4
|
var chunkATW6UNT5_cjs = require('./chunk-ATW6UNT5.cjs');
|
|
5
5
|
|
|
6
6
|
// src/constants/constants.ts
|
|
@@ -14,7 +14,7 @@ var getDefaultGasTokenForChain = async (chainId) => {
|
|
|
14
14
|
if (gasDenom) {
|
|
15
15
|
return gasDenom;
|
|
16
16
|
}
|
|
17
|
-
const chain =
|
|
17
|
+
const chain = chunk5YIGBG5L_cjs.chains().find((chain2) => chain2.chainId === chainId);
|
|
18
18
|
if (!chain) {
|
|
19
19
|
return void 0;
|
|
20
20
|
}
|
|
@@ -43,7 +43,7 @@ var getDefaultGasTokenForChain = async (chainId) => {
|
|
|
43
43
|
return chain.fees.feeTokens[0]?.denom;
|
|
44
44
|
};
|
|
45
45
|
var getStakingTokensForChain = (chainId) => {
|
|
46
|
-
const chain =
|
|
46
|
+
const chain = chunk5YIGBG5L_cjs.chains().find((chain2) => chain2.chainId === chainId);
|
|
47
47
|
if (!chain) {
|
|
48
48
|
throw new Error(
|
|
49
49
|
`getStakingTokensForChain error: failed to find chain id '${chainId}' in registry`
|
|
@@ -73,7 +73,7 @@ var getFeeInfoForChain = async ({ chainId, apiUrl, apiKey }) => {
|
|
|
73
73
|
if (skipFeeInfo && skipFeeInfo.gasPrice !== null) {
|
|
74
74
|
return skipFeeInfo;
|
|
75
75
|
}
|
|
76
|
-
const chain =
|
|
76
|
+
const chain = chunk5YIGBG5L_cjs.chains().find((chain2) => chain2.chainId === chainId);
|
|
77
77
|
if (!chain) {
|
|
78
78
|
return void 0;
|
|
79
79
|
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var chunk6W2OIU3O_cjs = require('./chunk-6W2OIU3O.cjs');
|
|
4
3
|
var chunk2SA3OAIJ_cjs = require('./chunk-2SA3OAIJ.cjs');
|
|
5
4
|
var chunkATW6UNT5_cjs = require('./chunk-ATW6UNT5.cjs');
|
|
5
|
+
var BigNumber2 = require('bignumber.js');
|
|
6
6
|
var viem = require('viem');
|
|
7
7
|
var chains = require('viem/chains');
|
|
8
8
|
|
|
9
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var BigNumber2__default = /*#__PURE__*/_interopDefault(BigNumber2);
|
|
12
|
+
|
|
9
13
|
// src/types/swaggerTypesJson.ts
|
|
10
14
|
var FeeBehaviorJson = /* @__PURE__ */ ((FeeBehaviorJson2) => {
|
|
11
15
|
FeeBehaviorJson2["FEE_BEHAVIOR_DEDUCTED"] = "FEE_BEHAVIOR_DEDUCTED";
|
|
@@ -160,10 +164,8 @@ var getUsdPrice = async (coingeckoId) => {
|
|
|
160
164
|
return void 0;
|
|
161
165
|
}
|
|
162
166
|
};
|
|
163
|
-
|
|
164
|
-
// src/utils/numbers.ts
|
|
165
167
|
var convertHumanReadableAmountToCryptoAmount = (humanReadableAmount, decimals) => {
|
|
166
|
-
const cryptoAmount = new
|
|
168
|
+
const cryptoAmount = new BigNumber2__default.default(humanReadableAmount).shiftedBy(decimals);
|
|
167
169
|
return cryptoAmount.toFixed(0);
|
|
168
170
|
};
|
|
169
171
|
var formaTestnet = viem.defineChain({
|
|
@@ -315,7 +317,7 @@ var getRouteWithGasOnReceive = async (props) => {
|
|
|
315
317
|
"No gas route found for the destination chain with the provided assets"
|
|
316
318
|
);
|
|
317
319
|
}
|
|
318
|
-
const mainRouteAmountIn =
|
|
320
|
+
const mainRouteAmountIn = BigNumber2__default.default(originalRoute?.amountIn ?? 0).minus(BigNumber2__default.default(gasRoute.amountIn ?? 0)).toString();
|
|
319
321
|
const mainRoute = await chunk2SA3OAIJ_cjs.route({
|
|
320
322
|
...props.routeRequest,
|
|
321
323
|
amountIn: mainRouteAmountIn,
|
|
@@ -357,7 +359,7 @@ var getGasOnReceiveAmount = async ({
|
|
|
357
359
|
if (!gasPrice || Number(gasPrice) === 0) {
|
|
358
360
|
if (!usdPrice || !sourceAsset?.decimals) return;
|
|
359
361
|
const gasOnReceiveAmountUsd = GAS_ON_RECEIVE_AMOUNT_USD["cosmos"];
|
|
360
|
-
const amountIn =
|
|
362
|
+
const amountIn = BigNumber2__default.default(gasOnReceiveAmountUsd).multipliedBy(usdPrice).toString();
|
|
361
363
|
return {
|
|
362
364
|
amountIn: convertHumanReadableAmountToCryptoAmount(
|
|
363
365
|
amountIn,
|
|
@@ -370,7 +372,7 @@ var getGasOnReceiveAmount = async ({
|
|
|
370
372
|
return {
|
|
371
373
|
amountIn: void 0,
|
|
372
374
|
amountOut: gasPrice && destinationAsset?.decimals ? convertHumanReadableAmountToCryptoAmount(
|
|
373
|
-
|
|
375
|
+
BigNumber2__default.default(gasPrice).multipliedBy(3).toNumber(),
|
|
374
376
|
destinationAsset.decimals
|
|
375
377
|
) : void 0,
|
|
376
378
|
denom: asset.denom
|
|
@@ -398,12 +400,12 @@ var getGasOnReceiveAmount = async ({
|
|
|
398
400
|
return [
|
|
399
401
|
{
|
|
400
402
|
amountIn: void 0,
|
|
401
|
-
amountOut:
|
|
403
|
+
amountOut: BigNumber2__default.default(15e4).multipliedBy(fees.maxFeePerGas.toString()).multipliedBy(3).toString(),
|
|
402
404
|
denom: destinationAsset?.denom
|
|
403
405
|
}
|
|
404
406
|
];
|
|
405
407
|
}
|
|
406
|
-
const gasPrice =
|
|
408
|
+
const gasPrice = BigNumber2__default.default(GAS_ON_RECEIVE_AMOUNT_USD["evm_l2"]).dividedBy(
|
|
407
409
|
sourceAssetPrice
|
|
408
410
|
).toString();
|
|
409
411
|
return [
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkA3UNNRKD_cjs = require('./chunk-A3UNNRKD.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkU6MTA2JG_cjs = require('./chunk-U6MTA2JG.cjs');
|
|
5
5
|
var chunkTEH6UMUR_cjs = require('./chunk-TEH6UMUR.cjs');
|
|
6
6
|
var chunkF3EB2AQG_cjs = require('./chunk-F3EB2AQG.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var chunkE4JCU2RG_cjs = require('./chunk-E4JCU2RG.cjs');
|
|
7
|
+
var chunkMQDVHLSO_cjs = require('./chunk-MQDVHLSO.cjs');
|
|
8
|
+
var chunk5YIGBG5L_cjs = require('./chunk-5YIGBG5L.cjs');
|
|
10
9
|
var chunkJRXPJ45U_cjs = require('./chunk-JRXPJ45U.cjs');
|
|
11
10
|
var chunkFCTBCHOT_cjs = require('./chunk-FCTBCHOT.cjs');
|
|
12
11
|
var chunkATW6UNT5_cjs = require('./chunk-ATW6UNT5.cjs');
|
|
@@ -22,6 +21,7 @@ var math = require('@cosmjs/math');
|
|
|
22
21
|
var signing_js = require('cosmjs-types/cosmos/tx/signing/v1beta1/signing.js');
|
|
23
22
|
var viem = require('viem');
|
|
24
23
|
var web3_js = require('@solana/web3.js');
|
|
24
|
+
var bignumber_js = require('bignumber.js');
|
|
25
25
|
var bech32 = require('bech32');
|
|
26
26
|
|
|
27
27
|
// src/private-functions/getRestEndpointForChain.ts
|
|
@@ -35,7 +35,7 @@ var getRestEndpointForChain = async (chainId) => {
|
|
|
35
35
|
return endpointOptions.rest;
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
|
-
const chain =
|
|
38
|
+
const chain = chunk5YIGBG5L_cjs.chains().find((chain2) => chain2.chainId === chainId);
|
|
39
39
|
if (!chain) {
|
|
40
40
|
throw new Error(
|
|
41
41
|
`getRestEndpointForChain error: failed to find chain id '${chainId}' in registry`
|
|
@@ -47,7 +47,7 @@ var getRestEndpointForChain = async (chainId) => {
|
|
|
47
47
|
);
|
|
48
48
|
}
|
|
49
49
|
const endpoints = chain.apis?.rest?.map((api) => api.address);
|
|
50
|
-
const endpoint = await
|
|
50
|
+
const endpoint = await chunk5YIGBG5L_cjs.findFirstWorkingEndpoint(endpoints, "rest");
|
|
51
51
|
if (!endpoint) {
|
|
52
52
|
throw new Error(
|
|
53
53
|
`getRestEndpointForChain error: failed to find REST endpoint for chain id '${chainId}'`
|
|
@@ -61,9 +61,9 @@ var getAccountNumberAndSequence = async (address, chainId) => {
|
|
|
61
61
|
if (chainId.includes("dymension")) {
|
|
62
62
|
return getAccountNumberAndSequenceFromDymension(address, chainId);
|
|
63
63
|
}
|
|
64
|
-
const endpoint = await
|
|
64
|
+
const endpoint = await chunkMQDVHLSO_cjs.getRpcEndpointForChain(chainId);
|
|
65
65
|
const client = chunkATW6UNT5_cjs.ClientState.signingStargateClientByChainId[chainId] ?? await stargate.StargateClient.connect(endpoint, {
|
|
66
|
-
accountParser:
|
|
66
|
+
accountParser: chunkMQDVHLSO_cjs.accountParser
|
|
67
67
|
});
|
|
68
68
|
const account = await client.getAccount(address);
|
|
69
69
|
if (!account) {
|
|
@@ -124,7 +124,7 @@ function encodeEthSecp256k1Pubkey(pubkey) {
|
|
|
124
124
|
|
|
125
125
|
// src/proto-signing/pubkey.ts
|
|
126
126
|
function makePubkeyAnyFromAccount(account, chainId) {
|
|
127
|
-
const isEthermint =
|
|
127
|
+
const isEthermint = chunk5YIGBG5L_cjs.getIsEthermint(chainId);
|
|
128
128
|
const pubkey = isEthermint ? encodeEthSecp256k1Pubkey(account.pubkey) : amino.encodeSecp256k1Pubkey(account.pubkey);
|
|
129
129
|
const pubkeyAny = encodePubkeyToAny(pubkey, chainId, isEthermint);
|
|
130
130
|
return pubkeyAny;
|
|
@@ -145,7 +145,7 @@ function encodePubkeyToAny(pubkey, chainId, isEthermint) {
|
|
|
145
145
|
value: Uint8Array.from(keys_js.PubKey.encode(pubkeyProto).finish())
|
|
146
146
|
});
|
|
147
147
|
} else {
|
|
148
|
-
const isInitia =
|
|
148
|
+
const isInitia = chunk5YIGBG5L_cjs.getIsInitia(chainId);
|
|
149
149
|
const pubkeyProto = keys_js.PubKey.fromPartial({
|
|
150
150
|
key: encoding.fromBase64(pubkey.value)
|
|
151
151
|
});
|
|
@@ -288,7 +288,7 @@ var signCosmosTransaction = async ({
|
|
|
288
288
|
if (messages === void 0) {
|
|
289
289
|
throw new Error("no messages found for tx");
|
|
290
290
|
}
|
|
291
|
-
const { signer } = await
|
|
291
|
+
const { signer } = await chunkMQDVHLSO_cjs.getSigningStargateClient({
|
|
292
292
|
chainId,
|
|
293
293
|
getOfflineSigner: options?.getCosmosSigner
|
|
294
294
|
});
|
|
@@ -757,7 +757,7 @@ var executeSvmTransaction = async (tx, options, index, routeId) => {
|
|
|
757
757
|
if (!signedTx) {
|
|
758
758
|
throw new Error("executeSvmTransaction error: signedTx is undefined");
|
|
759
759
|
}
|
|
760
|
-
const endpoint = await
|
|
760
|
+
const endpoint = await chunkMQDVHLSO_cjs.getRpcEndpointForChain(svmTx.chainId);
|
|
761
761
|
const connection = new web3_js.Connection(endpoint);
|
|
762
762
|
let signature;
|
|
763
763
|
const submitTxResponse = await chunkJRXPJ45U_cjs.submitTransaction({
|
|
@@ -845,7 +845,7 @@ var validateEvmTokenApproval = async ({
|
|
|
845
845
|
`Insufficient balance for gas on ${chain.prettyName}. Need ${formattedGasAmount} ${asset.symbol}.`
|
|
846
846
|
);
|
|
847
847
|
}
|
|
848
|
-
if (
|
|
848
|
+
if (bignumber_js.BigNumber(gasBalance.amount).lt(Number(allowanceGasFee))) {
|
|
849
849
|
const chainAssets = (await chunkATW6UNT5_cjs.ClientState.getSkipAssets({ chainId: tx.chainId }))[tx.chainId];
|
|
850
850
|
const asset = chainAssets?.find(
|
|
851
851
|
(x) => x.denom.includes("-native") || x.denom.toLowerCase() === "0x0000000000000000000000000000000000000000"
|
|
@@ -977,7 +977,7 @@ var validateEvmGasBalance = async ({
|
|
|
977
977
|
fee: null
|
|
978
978
|
};
|
|
979
979
|
}
|
|
980
|
-
if (
|
|
980
|
+
if (bignumber_js.BigNumber(gasBalance.amount ?? "").lt(Number(gasAmount))) {
|
|
981
981
|
const asset = skipAssets?.find(
|
|
982
982
|
(x) => x.denom?.includes("-native") || x.denom?.toLowerCase() === "0x0000000000000000000000000000000000000000"
|
|
983
983
|
);
|
|
@@ -1010,7 +1010,7 @@ var validateSvmGasBalance = async ({
|
|
|
1010
1010
|
fee: null
|
|
1011
1011
|
};
|
|
1012
1012
|
}
|
|
1013
|
-
const endpoint = await
|
|
1013
|
+
const endpoint = await chunkMQDVHLSO_cjs.getRpcEndpointForChain(tx.chainId ?? "");
|
|
1014
1014
|
const connection = new web3_js.Connection(endpoint);
|
|
1015
1015
|
if (!connection) throw new Error(`Failed to connect to ${tx.chainId}`);
|
|
1016
1016
|
if (!tx.tx) {
|
|
@@ -1097,7 +1097,7 @@ var validateGasBalances = async ({
|
|
|
1097
1097
|
throw new Error(`invalid msgs ${tx?.cosmosTx?.msgs}`);
|
|
1098
1098
|
}
|
|
1099
1099
|
try {
|
|
1100
|
-
const res = await
|
|
1100
|
+
const res = await chunkU6MTA2JG_cjs.validateCosmosGasBalance({
|
|
1101
1101
|
chainId: tx.cosmosTx.chainId ?? "",
|
|
1102
1102
|
signerAddress: tx.cosmosTx.signerAddress ?? "",
|
|
1103
1103
|
messages: tx.cosmosTx.msgs,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkTEH6UMUR_cjs = require('./chunk-TEH6UMUR.cjs');
|
|
4
|
-
var
|
|
5
|
-
var chunkMAIPDPG2_cjs = require('./chunk-MAIPDPG2.cjs');
|
|
4
|
+
var chunkMQDVHLSO_cjs = require('./chunk-MQDVHLSO.cjs');
|
|
6
5
|
var chunkATW6UNT5_cjs = require('./chunk-ATW6UNT5.cjs');
|
|
6
|
+
var bignumber_js = require('bignumber.js');
|
|
7
7
|
var stargate = require('@cosmjs/stargate');
|
|
8
8
|
var math = require('@cosmjs/math');
|
|
9
9
|
|
|
@@ -35,7 +35,7 @@ var validateCosmosGasBalance = async ({
|
|
|
35
35
|
if (txIndex !== 0 && chainId === "noble-1") {
|
|
36
36
|
return "0";
|
|
37
37
|
}
|
|
38
|
-
const { stargateClient } = await
|
|
38
|
+
const { stargateClient } = await chunkMQDVHLSO_cjs.getSigningStargateClient({
|
|
39
39
|
chainId,
|
|
40
40
|
getOfflineSigner
|
|
41
41
|
});
|
|
@@ -76,7 +76,7 @@ var validateCosmosGasBalance = async ({
|
|
|
76
76
|
}
|
|
77
77
|
if (!price) return;
|
|
78
78
|
return new stargate.GasPrice(
|
|
79
|
-
math.Decimal.fromUserInput(
|
|
79
|
+
math.Decimal.fromUserInput(bignumber_js.BigNumber(price).toFixed(), 18),
|
|
80
80
|
asset?.denom ?? ""
|
|
81
81
|
);
|
|
82
82
|
})();
|
|
@@ -148,8 +148,8 @@ var validateCosmosGasBalance = async ({
|
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
if (parseInt(balance?.amount ?? "") < parseInt(fee.amount[0]?.amount)) {
|
|
151
|
-
const userAmount = new
|
|
152
|
-
const feeAmount = new
|
|
151
|
+
const userAmount = new bignumber_js.BigNumber(parseFloat(balance?.amount ?? "")).shiftedBy(-decimal).toFixed(decimal);
|
|
152
|
+
const feeAmount = new bignumber_js.BigNumber(parseFloat(fee.amount[0]?.amount)).shiftedBy(-decimal).toFixed(decimal);
|
|
153
153
|
return {
|
|
154
154
|
error: `Insufficient balance for gas on ${chain?.prettyName}. Need ${feeAmount} ${symbol} but only have ${userAmount} ${symbol}.`,
|
|
155
155
|
asset
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkSNDRAYA6_cjs = require('./chunk-SNDRAYA6.cjs');
|
|
4
4
|
var chunkAVWWCQ5P_cjs = require('./chunk-AVWWCQ5P.cjs');
|
|
5
5
|
var chunkCK6CQWQU_cjs = require('./chunk-CK6CQWQU.cjs');
|
|
6
6
|
var chunk4BWE7SOV_cjs = require('./chunk-4BWE7SOV.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
require('./chunk-
|
|
7
|
+
var chunkLXO7LI67_cjs = require('./chunk-LXO7LI67.cjs');
|
|
8
|
+
var chunkKSSCA63F_cjs = require('./chunk-KSSCA63F.cjs');
|
|
9
|
+
require('./chunk-TAO6SPEJ.cjs');
|
|
10
10
|
var chunkA3UNNRKD_cjs = require('./chunk-A3UNNRKD.cjs');
|
|
11
|
-
var
|
|
11
|
+
var chunkU6MTA2JG_cjs = require('./chunk-U6MTA2JG.cjs');
|
|
12
12
|
var chunkTEH6UMUR_cjs = require('./chunk-TEH6UMUR.cjs');
|
|
13
13
|
require('./chunk-NM4PISTQ.cjs');
|
|
14
14
|
var chunkF3EB2AQG_cjs = require('./chunk-F3EB2AQG.cjs');
|
|
15
|
-
var
|
|
16
|
-
require('./chunk-
|
|
17
|
-
var
|
|
18
|
-
var chunkMAIPDPG2_cjs = require('./chunk-MAIPDPG2.cjs');
|
|
15
|
+
var chunkPK52AJPP_cjs = require('./chunk-PK52AJPP.cjs');
|
|
16
|
+
var chunkQ67SRREF_cjs = require('./chunk-Q67SRREF.cjs');
|
|
17
|
+
var chunkMQDVHLSO_cjs = require('./chunk-MQDVHLSO.cjs');
|
|
19
18
|
require('./chunk-MUJBB64F.cjs');
|
|
20
|
-
require('./chunk-
|
|
19
|
+
require('./chunk-5YIGBG5L.cjs');
|
|
21
20
|
var chunkOJISEAMX_cjs = require('./chunk-OJISEAMX.cjs');
|
|
22
21
|
var chunkNCFH5MGF_cjs = require('./chunk-NCFH5MGF.cjs');
|
|
23
22
|
var chunkA5S6SIYN_cjs = require('./chunk-A5S6SIYN.cjs');
|
|
@@ -38,91 +37,91 @@ var chunkWOSAJSJB_cjs = require('./chunk-WOSAJSJB.cjs');
|
|
|
38
37
|
|
|
39
38
|
Object.defineProperty(exports, "AutopilotActionJson", {
|
|
40
39
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
40
|
+
get: function () { return chunkSNDRAYA6_cjs.AutopilotActionJson; }
|
|
42
41
|
});
|
|
43
42
|
Object.defineProperty(exports, "AxelarTransferStateJson", {
|
|
44
43
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
44
|
+
get: function () { return chunkSNDRAYA6_cjs.AxelarTransferStateJson; }
|
|
46
45
|
});
|
|
47
46
|
Object.defineProperty(exports, "AxelarTransferTypeJson", {
|
|
48
47
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
48
|
+
get: function () { return chunkSNDRAYA6_cjs.AxelarTransferTypeJson; }
|
|
50
49
|
});
|
|
51
50
|
Object.defineProperty(exports, "BridgeTypeJson", {
|
|
52
51
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
52
|
+
get: function () { return chunkSNDRAYA6_cjs.BridgeTypeJson; }
|
|
54
53
|
});
|
|
55
54
|
Object.defineProperty(exports, "CCTPTransferStateJson", {
|
|
56
55
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
56
|
+
get: function () { return chunkSNDRAYA6_cjs.CCTPTransferStateJson; }
|
|
58
57
|
});
|
|
59
58
|
Object.defineProperty(exports, "ChainTypeJson", {
|
|
60
59
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
60
|
+
get: function () { return chunkSNDRAYA6_cjs.ChainTypeJson; }
|
|
62
61
|
});
|
|
63
62
|
Object.defineProperty(exports, "ContractCallWithTokenErrorTypeJson", {
|
|
64
63
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
64
|
+
get: function () { return chunkSNDRAYA6_cjs.ContractCallWithTokenErrorTypeJson; }
|
|
66
65
|
});
|
|
67
66
|
Object.defineProperty(exports, "FeeBehaviorJson", {
|
|
68
67
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
68
|
+
get: function () { return chunkSNDRAYA6_cjs.FeeBehaviorJson; }
|
|
70
69
|
});
|
|
71
70
|
Object.defineProperty(exports, "FeeTypeJson", {
|
|
72
71
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
72
|
+
get: function () { return chunkSNDRAYA6_cjs.FeeTypeJson; }
|
|
74
73
|
});
|
|
75
74
|
Object.defineProperty(exports, "GoFastTransferStateJson", {
|
|
76
75
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
76
|
+
get: function () { return chunkSNDRAYA6_cjs.GoFastTransferStateJson; }
|
|
78
77
|
});
|
|
79
78
|
Object.defineProperty(exports, "HyperlaneTransferStateJson", {
|
|
80
79
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
80
|
+
get: function () { return chunkSNDRAYA6_cjs.HyperlaneTransferStateJson; }
|
|
82
81
|
});
|
|
83
82
|
Object.defineProperty(exports, "LayerZeroTransferStateJson", {
|
|
84
83
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
84
|
+
get: function () { return chunkSNDRAYA6_cjs.LayerZeroTransferStateJson; }
|
|
86
85
|
});
|
|
87
86
|
Object.defineProperty(exports, "OPInitTransferStateJson", {
|
|
88
87
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
88
|
+
get: function () { return chunkSNDRAYA6_cjs.OPInitTransferStateJson; }
|
|
90
89
|
});
|
|
91
90
|
Object.defineProperty(exports, "PacketErrorTypeJson", {
|
|
92
91
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
92
|
+
get: function () { return chunkSNDRAYA6_cjs.PacketErrorTypeJson; }
|
|
94
93
|
});
|
|
95
94
|
Object.defineProperty(exports, "ReasonJson", {
|
|
96
95
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
96
|
+
get: function () { return chunkSNDRAYA6_cjs.ReasonJson; }
|
|
98
97
|
});
|
|
99
98
|
Object.defineProperty(exports, "RoutePriceWarningTypeJson", {
|
|
100
99
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
100
|
+
get: function () { return chunkSNDRAYA6_cjs.RoutePriceWarningTypeJson; }
|
|
102
101
|
});
|
|
103
102
|
Object.defineProperty(exports, "SendTokenErrorTypeJson", {
|
|
104
103
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
104
|
+
get: function () { return chunkSNDRAYA6_cjs.SendTokenErrorTypeJson; }
|
|
106
105
|
});
|
|
107
106
|
Object.defineProperty(exports, "StargateTransferStateJson", {
|
|
108
107
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
108
|
+
get: function () { return chunkSNDRAYA6_cjs.StargateTransferStateJson; }
|
|
110
109
|
});
|
|
111
110
|
Object.defineProperty(exports, "StatusErrorTypeJson", {
|
|
112
111
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
112
|
+
get: function () { return chunkSNDRAYA6_cjs.StatusErrorTypeJson; }
|
|
114
113
|
});
|
|
115
114
|
Object.defineProperty(exports, "TransactionStateJson", {
|
|
116
115
|
enumerable: true,
|
|
117
|
-
get: function () { return
|
|
116
|
+
get: function () { return chunkSNDRAYA6_cjs.TransactionStateJson; }
|
|
118
117
|
});
|
|
119
118
|
Object.defineProperty(exports, "TransferStateJson", {
|
|
120
119
|
enumerable: true,
|
|
121
|
-
get: function () { return
|
|
120
|
+
get: function () { return chunkSNDRAYA6_cjs.TransferStateJson; }
|
|
122
121
|
});
|
|
123
122
|
Object.defineProperty(exports, "getRouteWithGasOnReceive", {
|
|
124
123
|
enumerable: true,
|
|
125
|
-
get: function () { return
|
|
124
|
+
get: function () { return chunkSNDRAYA6_cjs.getRouteWithGasOnReceive; }
|
|
126
125
|
});
|
|
127
126
|
Object.defineProperty(exports, "setClientOptions", {
|
|
128
127
|
enumerable: true,
|
|
@@ -142,11 +141,11 @@ Object.defineProperty(exports, "waitForTransactionWithCancel", {
|
|
|
142
141
|
});
|
|
143
142
|
Object.defineProperty(exports, "executeMultipleRoutes", {
|
|
144
143
|
enumerable: true,
|
|
145
|
-
get: function () { return
|
|
144
|
+
get: function () { return chunkLXO7LI67_cjs.executeMultipleRoutes; }
|
|
146
145
|
});
|
|
147
146
|
Object.defineProperty(exports, "executeRoute", {
|
|
148
147
|
enumerable: true,
|
|
149
|
-
get: function () { return
|
|
148
|
+
get: function () { return chunkKSSCA63F_cjs.executeRoute; }
|
|
150
149
|
});
|
|
151
150
|
Object.defineProperty(exports, "TransferType", {
|
|
152
151
|
enumerable: true,
|
|
@@ -166,7 +165,7 @@ Object.defineProperty(exports, "subscribeToRouteStatus", {
|
|
|
166
165
|
});
|
|
167
166
|
Object.defineProperty(exports, "validateCosmosGasBalance", {
|
|
168
167
|
enumerable: true,
|
|
169
|
-
get: function () { return
|
|
168
|
+
get: function () { return chunkU6MTA2JG_cjs.validateCosmosGasBalance; }
|
|
170
169
|
});
|
|
171
170
|
Object.defineProperty(exports, "getCosmosGasAmountForMessage", {
|
|
172
171
|
enumerable: true,
|
|
@@ -178,15 +177,15 @@ Object.defineProperty(exports, "getEVMGasAmountForMessage", {
|
|
|
178
177
|
});
|
|
179
178
|
Object.defineProperty(exports, "getRecommendedGasPrice", {
|
|
180
179
|
enumerable: true,
|
|
181
|
-
get: function () { return
|
|
180
|
+
get: function () { return chunkPK52AJPP_cjs.getRecommendedGasPrice; }
|
|
182
181
|
});
|
|
183
182
|
Object.defineProperty(exports, "getFeeInfoForChain", {
|
|
184
183
|
enumerable: true,
|
|
185
|
-
get: function () { return
|
|
184
|
+
get: function () { return chunkQ67SRREF_cjs.getFeeInfoForChain; }
|
|
186
185
|
});
|
|
187
186
|
Object.defineProperty(exports, "getSigningStargateClient", {
|
|
188
187
|
enumerable: true,
|
|
189
|
-
get: function () { return
|
|
188
|
+
get: function () { return chunkMQDVHLSO_cjs.getSigningStargateClient; }
|
|
190
189
|
});
|
|
191
190
|
Object.defineProperty(exports, "ibcOriginAssets", {
|
|
192
191
|
enumerable: true,
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkLXO7LI67_cjs = require('../chunk-LXO7LI67.cjs');
|
|
4
|
+
require('../chunk-TAO6SPEJ.cjs');
|
|
5
5
|
require('../chunk-A3UNNRKD.cjs');
|
|
6
|
-
require('../chunk-
|
|
6
|
+
require('../chunk-U6MTA2JG.cjs');
|
|
7
7
|
require('../chunk-TEH6UMUR.cjs');
|
|
8
8
|
require('../chunk-NM4PISTQ.cjs');
|
|
9
9
|
require('../chunk-F3EB2AQG.cjs');
|
|
10
|
-
require('../chunk-
|
|
11
|
-
require('../chunk-MAIPDPG2.cjs');
|
|
10
|
+
require('../chunk-MQDVHLSO.cjs');
|
|
12
11
|
require('../chunk-MUJBB64F.cjs');
|
|
13
|
-
require('../chunk-
|
|
12
|
+
require('../chunk-5YIGBG5L.cjs');
|
|
14
13
|
require('../chunk-NCFH5MGF.cjs');
|
|
15
14
|
require('../chunk-JRXPJ45U.cjs');
|
|
16
15
|
require('../chunk-AUTOIM57.cjs');
|
|
@@ -24,5 +23,5 @@ require('../chunk-WOSAJSJB.cjs');
|
|
|
24
23
|
|
|
25
24
|
Object.defineProperty(exports, "executeMultipleRoutes", {
|
|
26
25
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkLXO7LI67_cjs.executeMultipleRoutes; }
|
|
28
27
|
});
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkKSSCA63F_cjs = require('../chunk-KSSCA63F.cjs');
|
|
4
|
+
require('../chunk-TAO6SPEJ.cjs');
|
|
5
5
|
require('../chunk-A3UNNRKD.cjs');
|
|
6
|
-
require('../chunk-
|
|
6
|
+
require('../chunk-U6MTA2JG.cjs');
|
|
7
7
|
require('../chunk-TEH6UMUR.cjs');
|
|
8
8
|
require('../chunk-NM4PISTQ.cjs');
|
|
9
9
|
require('../chunk-F3EB2AQG.cjs');
|
|
10
|
-
require('../chunk-
|
|
11
|
-
require('../chunk-MAIPDPG2.cjs');
|
|
10
|
+
require('../chunk-MQDVHLSO.cjs');
|
|
12
11
|
require('../chunk-MUJBB64F.cjs');
|
|
13
|
-
require('../chunk-
|
|
12
|
+
require('../chunk-5YIGBG5L.cjs');
|
|
14
13
|
require('../chunk-NCFH5MGF.cjs');
|
|
15
14
|
require('../chunk-JRXPJ45U.cjs');
|
|
16
15
|
require('../chunk-AUTOIM57.cjs');
|
|
@@ -24,5 +23,5 @@ require('../chunk-WOSAJSJB.cjs');
|
|
|
24
23
|
|
|
25
24
|
Object.defineProperty(exports, "executeRoute", {
|
|
26
25
|
enumerable: true,
|
|
27
|
-
get: function () { return
|
|
26
|
+
get: function () { return chunkKSSCA63F_cjs.executeRoute; }
|
|
28
27
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkQ67SRREF_cjs = require('../chunk-Q67SRREF.cjs');
|
|
4
|
+
require('../chunk-5YIGBG5L.cjs');
|
|
5
5
|
require('../chunk-ATW6UNT5.cjs');
|
|
6
6
|
require('../chunk-2QPPD3BB.cjs');
|
|
7
7
|
require('../chunk-WOSAJSJB.cjs');
|
|
@@ -10,5 +10,5 @@ require('../chunk-WOSAJSJB.cjs');
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "getFeeInfoForChain", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkQ67SRREF_cjs.getFeeInfoForChain; }
|
|
14
14
|
});
|