carbon-js-sdk 0.4.3-dev.2 → 0.4.4
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/lib/CarbonSDK.js +1 -1
- package/lib/clients/ETHClient.d.ts +4 -11
- package/lib/clients/ETHClient.js +6 -20
- package/lib/clients/HydrogenClient.d.ts +7 -16
- package/lib/clients/HydrogenClient.js +9 -55
- package/lib/clients/NEOClient.d.ts +1 -1
- package/lib/clients/NEOClient.js +4 -9
- package/lib/clients/TokenClient.d.ts +5 -29
- package/lib/clients/TokenClient.js +52 -257
- package/lib/clients/ZILClient.d.ts +1 -1
- package/lib/clients/ZILClient.js +4 -9
- package/lib/constant/ibc.d.ts +0 -7
- package/lib/constant/ibc.js +1 -4
- package/lib/constant/network.d.ts +0 -2
- package/lib/constant/network.js +1 -5
- package/lib/hydrogen/transfer.d.ts +5 -5
- package/lib/modules/ibc.d.ts +17 -5
- package/lib/modules/ibc.js +20 -75
- package/lib/provider/keplr/KeplrStore.d.ts +1 -1
- package/lib/provider/keplr/KeplrStore.js +5 -2
- package/lib/provider/metamask/MetaMask.d.ts +5 -5
- package/lib/provider/metamask/MetaMask.js +37 -37
- package/lib/util/blockchain.d.ts +0 -26
- package/lib/util/blockchain.js +1 -160
- package/lib/util/ibc.d.ts +3 -5
- package/lib/util/ibc.js +1 -26
- package/package.json +1 -1
package/lib/util/ibc.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isCw20Token = exports.
|
|
3
|
+
exports.isCw20Token = exports.calculateMaxFee = exports.parseChainId = exports.BlockchainMap = exports.getIbcChainFromBlockchain = exports.ChainIdBlockchainMap = exports.totalAssetObj = exports.EmbedChainInfos = exports.makeIBCMinimalDenom = void 0;
|
|
4
4
|
const constant_1 = require("../constant");
|
|
5
5
|
const provider_1 = require("../provider");
|
|
6
6
|
const crypto_1 = require("@keplr-wallet/crypto");
|
|
@@ -46,25 +46,6 @@ exports.totalAssetObj = Object.values(exports.EmbedChainInfos).reduce((prev, cha
|
|
|
46
46
|
newAssetObj[chainInfo.chainId] = assetsObj;
|
|
47
47
|
return newAssetObj;
|
|
48
48
|
}, {});
|
|
49
|
-
exports.ChainIdBlockchainMapV2 = {
|
|
50
|
-
[constant_1.ChainIds.Osmosis]: "Osmosis",
|
|
51
|
-
[constant_1.ChainIds.Terra]: "Terra",
|
|
52
|
-
[constant_1.ChainIds.CosmosHub]: "Cosmos Hub",
|
|
53
|
-
[constant_1.ChainIds.Juno]: "Juno",
|
|
54
|
-
[constant_1.ChainIds.Evmos]: "Evmos",
|
|
55
|
-
[constant_1.ChainIds.Axelar]: "Axelar",
|
|
56
|
-
[constant_1.ChainIds.Stride]: "Stride",
|
|
57
|
-
[constant_1.ChainIds.Kujira]: "Kujira",
|
|
58
|
-
[constant_1.ChainIds.Terra2]: "Terra (CW20)",
|
|
59
|
-
[constant_1.ChainIds.Quicksilver]: "Quicksilver",
|
|
60
|
-
[constant_1.ChainIds.Comdex]: "Comdex",
|
|
61
|
-
[constant_1.ChainIds.StafiHub]: "Stafihub",
|
|
62
|
-
[constant_1.ChainIds.Persistence]: "Persistence Core",
|
|
63
|
-
[constant_1.ChainIds.Stargaze]: "Stargaze",
|
|
64
|
-
[constant_1.ChainIds.Canto]: "Canto",
|
|
65
|
-
[constant_1.ChainIds.OmniFlixHub]: "Omniflix Hub",
|
|
66
|
-
[constant_1.ChainIds.Agoric]: "Agoric",
|
|
67
|
-
};
|
|
68
49
|
exports.ChainIdBlockchainMap = {
|
|
69
50
|
[constant_1.ChainIds.Osmosis]: blockchain_1.Blockchain.Osmosis,
|
|
70
51
|
[constant_1.ChainIds.Terra]: blockchain_1.Blockchain.Terra,
|
|
@@ -134,12 +115,6 @@ const calculateMaxFee = (gasStep = constant_1.DefaultGasPriceStep, gas = 0) => {
|
|
|
134
115
|
return gasStep.high * gas;
|
|
135
116
|
};
|
|
136
117
|
exports.calculateMaxFee = calculateMaxFee;
|
|
137
|
-
const estimateFeeStep = (gasStep = constant_1.DefaultGasPriceStep, gas = 0, stepId = 'average') => {
|
|
138
|
-
var _a;
|
|
139
|
-
const currentGasStep = (_a = gasStep[stepId]) !== null && _a !== void 0 ? _a : 0;
|
|
140
|
-
return currentGasStep * gas;
|
|
141
|
-
};
|
|
142
|
-
exports.estimateFeeStep = estimateFeeStep;
|
|
143
118
|
const isCw20Token = (currency) => {
|
|
144
119
|
if (!currency.hasOwnProperty("type"))
|
|
145
120
|
return false;
|