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/quotes/quotes.test.ts
var require_quotes_test = __commonJS({
  "src/resources/quotes/quotes.test.ts"(exports) {
    init_dist();
    init_client();
    describe("Quotes", () => {
      afterEach(() => fetchMock.resetMocks());
      const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
      describe("Create quote", () => {
        it("should create a quote", () => __async(null, null, function* () {
          const mockedQuote = {
            id: "qu_000000000000",
            expires_at: 1712958191,
            commercial_quotation: 495,
            blindpay_quotation: 485,
            receiver_amount: 5240,
            sender_amount: 1010,
            partner_fee_amount: 150,
            flat_fee: 50,
            contract: {
              abi: [{}],
              address: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
              functionName: "approve",
              blindpayContractAddress: "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
              amount: "1000000000000000000",
              network: {
                name: "Ethereum",
                chainId: 1
              }
            },
            receiver_local_amount: 1e3,
            description: "Memo code or description, only works with USD and BRL"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedQuote), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.quotes.create({
            bank_account_id: "ba_000000000000",
            currency_type: "sender",
            network: "sepolia",
            request_amount: 1e3,
            token: "USDC",
            cover_fees: true,
            description: "Memo code or description, only works with USD and BRL",
            partner_fee_id: "pf_000000000000",
            transaction_document_file: null,
            transaction_document_id: null,
            transaction_document_type: "invoice"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedQuote);
        }));
      });
      describe("Get FX rate", () => {
        it("should get FX rate", () => __async(null, null, function* () {
          const mockedFxRate = {
            commercial_quotation: 495,
            blindpay_quotation: 485,
            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.quotes.getFxRate({
            currency_type: "sender",
            from: "USDC",
            to: "BRL",
            request_amount: 1e3
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedFxRate);
        }));
      });
    });
  }
});
export default require_quotes_test();
