"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomGasTokenQueries = void 0;
var tslib_1 = require("tslib");
var baseQuery_1 = require("./baseQuery");
var CustomGasTokenQueries = (function (_super) {
    tslib_1.__extends(CustomGasTokenQueries, _super);
    function CustomGasTokenQueries(args) {
        var _this = _super.apply(this, args.queryBaseArgs) || this;
        _this.customGasTokenSymbol = args.customGasTokenSymbol;
        return _this;
    }
    CustomGasTokenQueries.prototype.getTokenPrice = function (tokenSymbol) {
        return tslib_1.__awaiter(this, void 0, void 0, function () {
            var _a, customGasTokenPrice, tokenPrice;
            return tslib_1.__generator(this, function (_b) {
                switch (_b.label) {
                    case 0: return [4, Promise.all([
                            _super.prototype.getTokenPrice.call(this, this.customGasTokenSymbol),
                            _super.prototype.getTokenPrice.call(this, tokenSymbol),
                        ])];
                    case 1:
                        _a = _b.sent(), customGasTokenPrice = _a[0], tokenPrice = _a[1];
                        return [2, Number((tokenPrice / customGasTokenPrice).toFixed(this.symbolMapping[this.customGasTokenSymbol].decimals))];
                }
            });
        });
    };
    return CustomGasTokenQueries;
}(baseQuery_1.QueryBase));
exports.CustomGasTokenQueries = CustomGasTokenQueries;
//# sourceMappingURL=customGasToken.js.map