import { __awaiter, __generator } from "tslib";
import { bnOne } from "../../utils";
import * as ethereum from "./ethereum";
/**
 * @notice Return Arbitrum orbit gas fees
 * @dev Arbitrum Nitro implements EIP-1559 pricing, but the priority fee is always refunded to the caller.
 * Reference: https://docs.arbitrum.io/how-arbitrum-works/gas-fees so we hardcode the priority fee
 * to 1 wei.
 * @param provider Ethers Provider
 * @param opts See notes below on specific parameters.
 * @param baseFeeMultiplier Amount to multiply base fee.
 * @param priorityFeeMultiplier Unused in this function because arbitrum priority fee is hardcoded to 1 wei by this
 * function.
 * @returns GasPriceEstimate
 */
export function eip1559(provider, opts) {
    return __awaiter(this, void 0, void 0, function () {
        var _a, _maxFeePerGas, maxPriorityFeePerGas, maxFeePerGas;
        return __generator(this, function (_b) {
            switch (_b.label) {
                case 0: return [4 /*yield*/, ethereum.eip1559(provider, opts)];
                case 1:
                    _a = _b.sent(), _maxFeePerGas = _a.maxFeePerGas, maxPriorityFeePerGas = _a.maxPriorityFeePerGas;
                    maxFeePerGas = _maxFeePerGas.sub(maxPriorityFeePerGas).add(bnOne);
                    return [2 /*return*/, { maxPriorityFeePerGas: bnOne, maxFeePerGas: maxFeePerGas }];
            }
        });
    });
}
//# sourceMappingURL=arbitrum.js.map