import {
  afterEach,
  describe,
  globalExpect,
  init_dist,
  it
} from "../../chunk-D6N3USMR.mjs";
import {
  BlindPay,
  init_client
} from "../../chunk-VWWGGMMT.mjs";
import "../../chunk-FG25JHDX.mjs";
import "../../chunk-KMU6V4LW.mjs";
import "../../chunk-QGNLMN6Z.mjs";
import "../../chunk-ISHZTBAN.mjs";
import "../../chunk-UDRMLZWT.mjs";
import "../../chunk-LEPGLH7Q.mjs";
import "../../chunk-UC57SCKQ.mjs";
import "../../chunk-E7M4CJKR.mjs";
import "../../chunk-F5Z45GCA.mjs";
import "../../chunk-TBTA7A2P.mjs";
import "../../chunk-YIZJM2GU.mjs";
import "../../chunk-Z6EYX4D3.mjs";
import "../../chunk-ALHMJWQN.mjs";
import "../../chunk-B5T7AQLH.mjs";
import "../../chunk-RC5NN5UF.mjs";
import "../../chunk-VGU72ZNI.mjs";
import "../../chunk-LRHWT4JU.mjs";
import "../../chunk-WE73MTQL.mjs";
import "../../chunk-UOAM7SX3.mjs";
import {
  __async,
  __commonJS
} from "../../chunk-OBKEW4AQ.mjs";

// src/resources/payins/payins-quotes.test.ts
var require_payins_quotes_test = __commonJS({
  "src/resources/payins/payins-quotes.test.ts"(exports) {
    init_dist();
    init_client();
    describe("Payin quotes", () => {
      afterEach(() => fetchMock.resetMocks());
      const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
      describe("Create payin quote", () => {
        it("should create a payin quote", () => __async(null, null, function* () {
          const mockedPayinQuote = {
            id: "qu_000000000000",
            expires_at: 1712958191,
            commercial_quotation: 495,
            blindpay_quotation: 505,
            receiver_amount: 1010,
            sender_amount: 5240,
            partner_fee_amount: 150,
            flat_fee: 50
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedPayinQuote), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.payins.quotes.create({
            blockchain_wallet_id: "bw_000000000000",
            currency_type: "sender",
            cover_fees: true,
            request_amount: 1e3,
            payment_method: "pix",
            token: "USDC",
            partner_fee_id: "pf_000000000000",
            payer_rules: {
              pix_allowed_tax_ids: ["149.476.037-68"]
            }
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedPayinQuote);
        }));
      });
      describe("Get FX rate", () => {
        it("should get the FX rate", () => __async(null, null, function* () {
          const mockedFxRate = {
            commercial_quotation: 495,
            blindpay_quotation: 505,
            result_amount: 1,
            instance_flat_fee: 50,
            instance_percentage_fee: 0
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedFxRate), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.payins.quotes.getFxRate({
            currency_type: "sender",
            from: "USD",
            to: "BRL",
            request_amount: 1e3
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedFxRate);
        }));
      });
    });
  }
});
export default require_payins_quotes_test();
