import { __awaiter, __extends, __generator } from "tslib";
import { BaseHTTPAdapter } from "./baseAdapter";
/**
 * Fallback price adapter to unconditionally return 0 on all input addresses.
 * This adapter can be used as a last-resort to default to a token price of 0
 * in case all other adapters fail to resolve a token price.
 *
 * Note: This adapter could be augmented to permit returning a custom price on a per-token bsis.
 * This would allow the caller to peg token prices, which has been a use cases in the Across API.
 * That's left as an open possibility for now.
 */
var PriceFeed = /** @class */ (function (_super) {
    __extends(PriceFeed, _super);
    function PriceFeed() {
        return _super.call(this, "Default Adapter", "127.0.0.1", {}) || this;
    }
    PriceFeed.prototype.getPriceByAddress = function (address, currency) {
        return __awaiter(this, void 0, void 0, function () {
            var price;
            return __generator(this, function (_a) {
                switch (_a.label) {
                    case 0: return [4 /*yield*/, this.getPricesByAddress([address], currency)];
                    case 1:
                        price = _a.sent();
                        return [2 /*return*/, price[0]];
                }
            });
        });
    };
    PriceFeed.prototype.getPricesByAddress = function (addresses, _currency) {
        return Promise.resolve(addresses.map(function (address) { return ({ address: address, price: 0, timestamp: 0 }); }));
    };
    return PriceFeed;
}(BaseHTTPAdapter));
export { PriceFeed };
//# sourceMappingURL=default.js.map