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/bank-accounts/bank-accounts.test.ts
var require_bank_accounts_test = __commonJS({
  "src/resources/bank-accounts/bank-accounts.test.ts"(exports) {
    init_dist();
    init_client();
    describe("Bank accounts", () => {
      afterEach(() => fetchMock.resetMocks());
      const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
      describe("Create pix bank account", () => {
        it("should create a pix bank account", () => __async(null, null, function* () {
          const mockedPixAccount = {
            id: "ba_000000000000",
            type: "pix",
            name: "PIX Account",
            pix_key: "14947677768",
            created_at: "2021-01-01T00:00:00Z"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedPixAccount), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.bankAccounts.createPix({
            receiver_id: "re_000000000000",
            name: "PIX Account",
            pix_key: "14947677768"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedPixAccount);
        }));
      });
      describe("Create argentina transfers bank account", () => {
        it("should create an argentina transfers bank account", () => __async(null, null, function* () {
          const mockedArgentinaTransfersAccount = {
            id: "ba_000000000000",
            type: "transfers_bitso",
            name: "Argentina Transfers Account",
            beneficiary_name: "Individual full name or business name",
            transfers_type: "CVU",
            transfers_account: "BM123123123123",
            created_at: "2021-01-01T00:00:00Z"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedArgentinaTransfersAccount), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.bankAccounts.createArgentinaTransfers({
            receiver_id: "re_000000000000",
            name: "Argentina Transfers Account",
            beneficiary_name: "Individual full name or business name",
            transfers_type: "CVU",
            transfers_account: "BM123123123123"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedArgentinaTransfersAccount);
        }));
      });
      describe("Create spei bank account", () => {
        it("should create a spei bank account", () => __async(null, null, function* () {
          const mockedSpeiAccount = {
            id: "ba_000000000000",
            type: "spei_bitso",
            name: "SPEI Account",
            beneficiary_name: "Individual full name or business name",
            spei_protocol: "clabe",
            spei_institution_code: "40002",
            spei_clabe: "5482347403740546",
            created_at: "2021-01-01T00:00:00Z"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedSpeiAccount), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.bankAccounts.createSpei({
            receiver_id: "re_000000000000",
            name: "SPEI Account",
            beneficiary_name: "Individual full name or business name",
            spei_protocol: "clabe",
            spei_institution_code: "40002",
            spei_clabe: "5482347403740546"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedSpeiAccount);
        }));
      });
      describe("Create colombia ach bank account", () => {
        it("should create a colombia ach bank account", () => __async(null, null, function* () {
          const mockedColombiaAchAccount = {
            id: "ba_000000000000",
            type: "ach_cop_bitso",
            name: "Colombia ACH Account",
            account_type: "checking",
            ach_cop_beneficiary_first_name: "Fernando",
            ach_cop_beneficiary_last_name: "Guzman Alarc\xF3n",
            ach_cop_document_id: "1661105408",
            ach_cop_document_type: "CC",
            ach_cop_email: "fernando.guzman@gmail.com",
            ach_cop_bank_code: "051",
            ach_cop_bank_account: "12345678",
            created_at: "2021-01-01T00:00:00Z"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedColombiaAchAccount), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.bankAccounts.createColombiaAch({
            receiver_id: "re_000000000000",
            name: "Colombia ACH Account",
            account_type: "checking",
            ach_cop_beneficiary_first_name: "Fernando",
            ach_cop_beneficiary_last_name: "Guzman Alarc\xF3n",
            ach_cop_document_id: "1661105408",
            ach_cop_document_type: "CC",
            ach_cop_email: "fernando.guzman@gmail.com",
            ach_cop_bank_code: "051",
            ach_cop_bank_account: "12345678"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedColombiaAchAccount);
        }));
      });
      describe("Create ach bank account", () => {
        it("should create an ach bank account", () => __async(null, null, function* () {
          const mockedAchAccount = {
            id: "ba_000000000000",
            type: "ach",
            name: "ACH Account",
            beneficiary_name: "Individual full name or business name",
            routing_number: "012345678",
            account_number: "1001001234",
            account_type: "checking",
            account_class: "individual",
            recipient_relationship: "first_party",
            address_line_1: null,
            address_line_2: null,
            city: null,
            state_province_region: null,
            country: null,
            postal_code: null,
            ach_cop_beneficiary_first_name: null,
            ach_cop_beneficiary_last_name: null,
            ach_cop_document_id: null,
            ach_cop_document_type: null,
            ach_cop_email: null,
            ach_cop_bank_code: null,
            ach_cop_bank_account: null,
            created_at: "2021-01-01T00:00:00Z"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedAchAccount), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.bankAccounts.createAch({
            receiver_id: "re_000000000000",
            name: "ACH Account",
            account_class: "individual",
            account_number: "1001001234",
            account_type: "checking",
            beneficiary_name: "Individual full name or business name",
            routing_number: "012345678",
            recipient_relationship: "first_party",
            address_line_1: "123 Main St",
            city: "New York",
            state_province_region: "NY",
            country: "US",
            postal_code: "10001"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedAchAccount);
        }));
      });
      describe("Create wire bank account", () => {
        it("should create a wire bank account", () => __async(null, null, function* () {
          const mockedWireAccount = {
            id: "ba_000000000000",
            type: "wire",
            name: "Wire Account",
            beneficiary_name: "Individual full name or business name",
            routing_number: "012345678",
            account_number: "1001001234",
            account_class: "individual",
            recipient_relationship: "first_party",
            address_line_1: "Address line 1",
            address_line_2: "Address line 2",
            city: "City",
            state_province_region: "State/Province/Region",
            country: "US",
            postal_code: "Postal code",
            created_at: "2021-01-01T00:00:00Z"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedWireAccount), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.bankAccounts.createWire({
            receiver_id: "re_000000000000",
            name: "Wire Account",
            account_class: "individual",
            account_number: "1001001234",
            beneficiary_name: "Individual full name or business name",
            routing_number: "012345678",
            recipient_relationship: "first_party",
            address_line_1: "Address line 1",
            address_line_2: "Address line 2",
            city: "City",
            state_province_region: "State/Province/Region",
            country: "US",
            postal_code: "Postal code"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedWireAccount);
        }));
      });
      describe("Create international swift bank account", () => {
        it("should create an international swift bank account", () => __async(null, null, function* () {
          const mockedInternationalSwiftAccount = {
            id: "ba_000000000000",
            type: "international_swift",
            name: "International Swift Account",
            beneficiary_name: null,
            account_class: "individual",
            recipient_relationship: "first_party",
            address_line_1: null,
            address_line_2: null,
            city: null,
            state_province_region: null,
            country: null,
            postal_code: null,
            swift_code_bic: "123456789",
            swift_account_holder_name: "John Doe",
            swift_account_number_iban: "123456789",
            swift_beneficiary_address_line_1: "123 Main Street, Suite 100, Downtown District, City Center CP 12345",
            swift_beneficiary_address_line_2: null,
            swift_beneficiary_country: "MX",
            swift_beneficiary_city: "City",
            swift_beneficiary_state_province_region: "District",
            swift_beneficiary_postal_code: "11530",
            swift_bank_name: "Banco Regional SA",
            swift_bank_address_line_1: "123 Main Street, Suite 100, Downtown District, City Center CP 12345",
            swift_bank_address_line_2: null,
            swift_bank_country: "MX",
            swift_bank_city: "City",
            swift_bank_state_province_region: "District",
            swift_bank_postal_code: "11530",
            swift_intermediary_bank_swift_code_bic: null,
            swift_intermediary_bank_account_number_iban: null,
            swift_intermediary_bank_name: null,
            swift_intermediary_bank_country: null,
            swift_payment_code: null,
            created_at: "2021-01-01T00:00:00Z"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedInternationalSwiftAccount), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.bankAccounts.createInternationalSwift({
            receiver_id: "re_000000000000",
            name: "International Swift Account",
            account_class: "individual",
            recipient_relationship: "first_party",
            swift_account_holder_name: "John Doe",
            swift_account_number_iban: "123456789",
            swift_bank_address_line_1: "123 Main Street, Suite 100, Downtown District, City Center CP 12345",
            swift_bank_city: "City",
            swift_bank_country: "MX",
            swift_bank_name: "Banco Regional SA",
            swift_bank_postal_code: "11530",
            swift_bank_state_province_region: "District",
            swift_beneficiary_address_line_1: "123 Main Street, Suite 100, Downtown District, City Center CP 12345",
            swift_beneficiary_city: "City",
            swift_beneficiary_country: "MX",
            swift_beneficiary_postal_code: "11530",
            swift_beneficiary_state_province_region: "District",
            swift_code_bic: "123456789",
            swift_intermediary_bank_account_number_iban: null,
            swift_intermediary_bank_country: null,
            swift_intermediary_bank_name: null,
            swift_intermediary_bank_swift_code_bic: null
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedInternationalSwiftAccount);
        }));
      });
      describe("Create RTP bank account", () => {
        it("should create an RTP bank account", () => __async(null, null, function* () {
          const mockedRtpAccount = {
            id: "ba_JW5ZtlKMlgS1",
            type: "rtp",
            name: "John Doe RTP",
            beneficiary_name: "John Doe",
            routing_number: "121000358",
            account_number: "325203027578",
            account_class: "individual",
            recipient_relationship: "first_party",
            address_line_1: "Street of the fools",
            address_line_2: null,
            city: "Fools City",
            state_province_region: "FL",
            country: "US",
            postal_code: "22599",
            created_at: "2025-09-30T04:23:30.823Z"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedRtpAccount), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.bankAccounts.createRtp({
            receiver_id: "re_000000000000",
            name: "John Doe RTP",
            account_class: "individual",
            beneficiary_name: "John Doe",
            routing_number: "121000358",
            account_number: "325203027578",
            recipient_relationship: "first_party",
            address_line_1: "Street of the fools",
            city: "Fools City",
            state_province_region: "FL",
            country: "US",
            postal_code: "22599"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedRtpAccount);
        }));
      });
      describe("Get bank account", () => {
        it("should get a bank account", () => __async(null, null, function* () {
          const mockedBankAccount = {
            id: "ba_000000000000",
            receiver_id: "rcv_123",
            account_holder_name: "Individual full name or business name",
            account_number: "1001001234",
            routing_number: "012345678",
            account_type: "checking",
            bank_name: "Bank Name",
            swift_code: "123456789",
            iban: null,
            is_primary: false,
            created_at: "2021-01-01T00:00:00Z",
            updated_at: "2021-01-01T00:00:00Z"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedBankAccount), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.bankAccounts.get({
            receiver_id: "re_000000000000",
            id: "ba_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedBankAccount);
        }));
      });
      describe("List bank accounts", () => {
        it("should list bank accounts", () => __async(null, null, function* () {
          const mockedBankAccounts = {
            data: [
              {
                id: "ba_000000000000",
                type: "wire",
                name: "Bank Account Name",
                pix_key: "14947677768",
                beneficiary_name: "Individual full name or business name",
                routing_number: "012345678",
                account_number: "1001001234",
                account_type: "checking",
                account_class: "individual",
                address_line_1: "Address line 1",
                address_line_2: "Address line 2",
                city: "City",
                state_province_region: "State/Province/Region",
                country: "US",
                postal_code: "Postal code",
                spei_protocol: "clabe",
                spei_institution_code: "40002",
                spei_clabe: "5482347403740546",
                transfers_type: "CVU",
                transfers_account: "BM123123123123",
                ach_cop_beneficiary_first_name: "Fernando",
                ach_cop_beneficiary_last_name: "Guzman Alarc\xF3n",
                ach_cop_document_id: "1661105408",
                ach_cop_document_type: "CC",
                ach_cop_email: "fernando.guzman@gmail.com",
                ach_cop_bank_code: "051",
                ach_cop_bank_account: "12345678",
                swift_code_bic: "123456789",
                swift_account_holder_name: "John Doe",
                swift_account_number_iban: "123456789",
                swift_beneficiary_address_line_1: "123 Main Street, Suite 100, Downtown District, City Center CP 12345",
                swift_beneficiary_address_line_2: "456 Oak Avenue, Building 7, Financial District, Business Center CP 54321",
                swift_beneficiary_country: "MX",
                swift_beneficiary_city: "City",
                swift_beneficiary_state_province_region: "District",
                swift_beneficiary_postal_code: "11530",
                swift_bank_name: "Banco Regional SA",
                swift_bank_address_line_1: "123 Main Street, Suite 100, Downtown District, City Center CP 12345",
                swift_bank_address_line_2: "456 Oak Avenue, Building 7, Financial District, Business Center CP 54321",
                swift_bank_country: "MX",
                swift_bank_city: "City",
                swift_bank_state_province_region: "District",
                swift_bank_postal_code: "11530",
                swift_intermediary_bank_swift_code_bic: "AEIBARB1",
                swift_intermediary_bank_account_number_iban: "123456789",
                swift_intermediary_bank_name: "Banco Regional SA",
                swift_intermediary_bank_country: "US",
                tron_wallet_hash: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
                offramp_wallets: [
                  {
                    address: "TALJN9zTTEL9TVBb4WuTt6wLvPqJZr3hvb",
                    id: "ow_000000000000",
                    network: "tron",
                    external_id: "your_external_id"
                  }
                ],
                created_at: "2021-01-01T00:00:00Z"
              }
            ]
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedBankAccounts), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.bankAccounts.list({
            receiver_id: "re_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedBankAccounts);
        }));
      });
      describe("Create pix safe bank account", () => {
        it("should create a pix safe bank account", () => __async(null, null, function* () {
          const mockedPixSafeAccount = {
            id: "ba_000000000000",
            type: "pix_safe",
            name: "PIX Safe Account",
            beneficiary_name: "Maria Silva",
            account_number: "123456789",
            account_type: "checking",
            pix_safe_bank_code: "001",
            pix_safe_branch_code: "0001",
            pix_safe_cpf_cnpj: "12345678901",
            created_at: "2021-01-01T00:00:00Z"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedPixSafeAccount), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.bankAccounts.createPixSafe({
            receiver_id: "re_000000000000",
            name: "PIX Safe Account",
            beneficiary_name: "Maria Silva",
            account_number: "123456789",
            account_type: "checking",
            pix_safe_bank_code: "001",
            pix_safe_branch_code: "0001",
            pix_safe_cpf_cnpj: "12345678901"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedPixSafeAccount);
        }));
      });
      describe("Delete bank account", () => {
        it("should delete a bank account", () => __async(null, null, function* () {
          fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.receivers.bankAccounts.delete({
            receiver_id: "re_000000000000",
            id: "ba_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ data: null });
        }));
      });
    });
  }
});
export default require_bank_accounts_test();
