carbon-js-sdk 0.4.3-dev.1 → 0.4.3-dev.2
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/util/ibc.d.ts +1 -0
- package/lib/util/ibc.js +7 -1
- package/package.json +1 -1
package/lib/util/ibc.d.ts
CHANGED
|
@@ -15,4 +15,5 @@ export interface ChainIdOutput {
|
|
|
15
15
|
}
|
|
16
16
|
export declare const parseChainId: (chainId: string) => ChainIdOutput;
|
|
17
17
|
export declare const calculateMaxFee: (gasStep?: GasPriceStep, gas?: number) => number;
|
|
18
|
+
export declare const estimateFeeStep: (gasStep?: GasPriceStep, gas?: number, stepId?: keyof GasPriceStep) => number;
|
|
18
19
|
export declare const isCw20Token: (currency: AppCurrency) => boolean;
|
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.calculateMaxFee = exports.parseChainId = exports.BlockchainMap = exports.getIbcChainFromBlockchain = exports.ChainIdBlockchainMap = exports.ChainIdBlockchainMapV2 = exports.totalAssetObj = exports.EmbedChainInfos = exports.makeIBCMinimalDenom = void 0;
|
|
3
|
+
exports.isCw20Token = exports.estimateFeeStep = exports.calculateMaxFee = exports.parseChainId = exports.BlockchainMap = exports.getIbcChainFromBlockchain = exports.ChainIdBlockchainMap = exports.ChainIdBlockchainMapV2 = 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");
|
|
@@ -134,6 +134,12 @@ const calculateMaxFee = (gasStep = constant_1.DefaultGasPriceStep, gas = 0) => {
|
|
|
134
134
|
return gasStep.high * gas;
|
|
135
135
|
};
|
|
136
136
|
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;
|
|
137
143
|
const isCw20Token = (currency) => {
|
|
138
144
|
if (!currency.hasOwnProperty("type"))
|
|
139
145
|
return false;
|