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/transfers/transfers.test.ts
var require_transfers_test = __commonJS({
  "src/resources/transfers/transfers.test.ts"(exports) {
    init_dist();
    init_client();
    var mockTrackingStep = {
      step: "processing",
      transaction_hash: null,
      gas_fee: null,
      completed_at: null,
      error_message: null
    };
    var mockTrackingMonitoring = {
      step: "processing",
      blockchain_screening: null,
      risk_score: null,
      completed_at: null
    };
    var mockTransfer = {
      id: "tr_000000000000",
      status: "processing",
      transfer_quote_id: "tq_000000000000",
      instance_id: "in_000000000000",
      tracking_transaction_monitoring: mockTrackingMonitoring,
      tracking_paymaster: mockTrackingStep,
      tracking_bridge_swap: mockTrackingStep,
      tracking_complete: mockTrackingStep,
      tracking_partner_fee: mockTrackingStep,
      created_at: "2025-01-01T00:00:00Z",
      updated_at: "2025-01-01T00:00:00Z",
      wallet_id: "wa_000000000000",
      sender_token: "USDC",
      sender_amount: 1e4,
      receiver_amount: 9950,
      receiver_network: "polygon",
      receiver_token: "USDC",
      receiver_wallet_address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
      partner_fee_amount: null
    };
    describe("Transfers", () => {
      afterEach(() => fetchMock.resetMocks());
      const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
      describe("Create transfer quote", () => {
        it("should create a transfer quote", () => __async(null, null, function* () {
          const mockedQuote = {
            id: "tq_000000000000",
            expires_at: 17e8,
            commercial_quotation: 100,
            blindpay_quotation: 100,
            receiver_amount: 9950,
            sender_amount: 1e4,
            partner_fee_amount: null,
            flat_fee: 50
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedQuote), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.transfers.quotes.create({
            wallet_id: "wa_000000000000",
            sender_token: "USDC",
            receiver_wallet_address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
            receiver_token: "USDC",
            receiver_network: "polygon",
            request_amount: 1e4,
            cover_fees: true,
            amount_reference: "sender"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedQuote);
        }));
      });
      describe("Create transfer", () => {
        it("should create a transfer", () => __async(null, null, function* () {
          const mockedTransfer = {
            id: "tr_000000000000",
            status: "processing",
            tracking_bridge_swap: mockTrackingStep,
            tracking_complete: mockTrackingStep,
            tracking_paymaster: mockTrackingStep,
            tracking_transaction_monitoring: mockTrackingMonitoring,
            tracking_partner_fee: mockTrackingStep
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedTransfer), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.transfers.create({
            transfer_quote_id: "tq_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedTransfer);
        }));
      });
      describe("List transfers", () => {
        it("should list transfers", () => __async(null, null, function* () {
          const mockedTransfers = {
            data: [mockTransfer],
            pagination: {
              has_more: false,
              next_page: "",
              prev_page: ""
            }
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedTransfers), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.transfers.list();
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedTransfers);
        }));
      });
      describe("Get transfer", () => {
        it("should get a transfer", () => __async(null, null, function* () {
          const mockedTransfer = mockTransfer;
          fetchMock.mockResponseOnce(JSON.stringify(mockedTransfer), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.transfers.get("tr_000000000000");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedTransfer);
        }));
      });
      describe("Get transfer track", () => {
        it("should get transfer tracking information", () => __async(null, null, function* () {
          const mockedTrack = mockTransfer;
          fetchMock.mockResponseOnce(JSON.stringify(mockedTrack), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.transfers.getTrack("tr_000000000000");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedTrack);
        }));
      });
    });
  }
});
export default require_transfers_test();
