@nexex/api
Version:
support trade on nexex network
25 lines • 711 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var SCENES;
(function (SCENES) {
SCENES["TRANSFER"] = "Transfer";
SCENES["TRADE"] = "Trade";
})(SCENES = exports.SCENES || (exports.SCENES = {}));
var MAX_GAS_LIMIT = 8000000;
var SCENE_GAS_LIMIT = {
Transfer: 200000,
Trade: 300000
};
function getGasLimit(scene, times) {
if (times === void 0) { times = 1; }
return Math.min(SCENE_GAS_LIMIT[scene] * times, MAX_GAS_LIMIT);
}
exports.getGasLimit = getGasLimit;
function getGasOption(scene, gasPrice) {
return {
gasLimit: getGasLimit(scene),
gasPrice: gasPrice
};
}
exports.getGasOption = getGasOption;
//# sourceMappingURL=gasUtil.js.map