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/payouts/payouts.test.ts
var require_payouts_test = __commonJS({
  "src/resources/payouts/payouts.test.ts"(exports) {
    init_dist();
    init_client();
    describe("Payouts", () => {
      afterEach(() => fetchMock.resetMocks());
      const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
      describe("List payouts", () => {
        it("should list payouts", () => __async(null, null, function* () {
          const mockedPayouts = {
            data: [
              {
                receiver_id: "re_000000000000",
                id: "pa_000000000000",
                status: "processing",
                sender_wallet_address: "0x123...890",
                signed_transaction: "AAA...Zey8y0A",
                quote_id: "qu_000000000000",
                instance_id: "in_000000000000",
                tracking_transaction: {
                  step: "processing",
                  status: "failed",
                  transaction_hash: "0x123...890",
                  completed_at: "2011-10-05T14:48:00.000Z"
                },
                tracking_payment: {
                  step: "on_hold",
                  provider_name: "blockchain",
                  provider_transaction_id: "0x123...890",
                  provider_status: "canceled",
                  recipient_name: "John Doe",
                  recipient_tax_id: "123.456.789-10",
                  recipient_bank_code: "00416968",
                  recipient_branch_code: "0001",
                  recipient_account_number: "1234567890",
                  recipient_account_type: "checking",
                  estimated_time_of_arrival: "5_min",
                  completed_at: "2011-10-05T14:48:00.000Z"
                },
                tracking_liquidity: {
                  step: "processing",
                  provider_transaction_id: "0x123...890",
                  provider_status: "deposited",
                  estimated_time_of_arrival: "1_business_day",
                  completed_at: "2011-10-05T14:48:00.000Z"
                },
                tracking_complete: {
                  step: "on_hold",
                  status: "tokens_refunded",
                  transaction_hash: "0x123...890",
                  completed_at: "2011-10-05T14:48:00.000Z"
                },
                tracking_partner_fee: {
                  step: "on_hold",
                  transaction_hash: "0x123...890",
                  completed_at: "2011-10-05T14:48:00.000Z"
                },
                created_at: "2021-01-01T00:00:00Z",
                updated_at: "2021-01-01T00:00:00Z",
                image_url: "https://example.com/image.png",
                first_name: "John",
                last_name: "Doe",
                legal_name: "Company Name Inc.",
                network: "sepolia",
                token: "USDC",
                description: "Memo code or description, only works with USD and BRL",
                sender_amount: 1010,
                receiver_amount: 5240,
                partner_fee_amount: 150,
                commercial_quotation: 495,
                blindpay_quotation: 485,
                total_fee_amount: 1.5,
                receiver_local_amount: 1e3,
                currency: "BRL",
                transaction_document_file: "https://example.com/image.png",
                transaction_document_type: "invoice",
                transaction_document_id: "1234567890",
                name: "Bank Account Name",
                type: "wire",
                pix_key: "14947677768",
                account_number: "1001001234",
                routing_number: "012345678",
                country: "US",
                account_class: "individual",
                address_line_1: "Address line 1",
                address_line_2: "Address line 2",
                city: "City",
                state_province_region: "State/Province/Region",
                postal_code: "Postal code",
                account_type: "checking",
                ach_cop_beneficiary_first_name: "Fernando",
                ach_cop_bank_account: "12345678",
                ach_cop_bank_code: "051",
                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",
                beneficiary_name: "Individual full name or business name",
                spei_clabe: "5482347403740546",
                spei_protocol: "clabe",
                spei_institution_code: "40002",
                swift_beneficiary_country: "MX",
                swift_code_bic: "123456789",
                swift_account_holder_name: "John Doe",
                swift_account_number_iban: "123456789",
                transfers_account: "BM123123123123",
                transfers_type: "CVU",
                has_virtual_account: true
              }
            ],
            pagination: {
              has_more: true,
              next_page: "3",
              prev_page: "1"
            }
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedPayouts), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.payouts.list();
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedPayouts);
        }));
      });
      describe("Get payout", () => {
        it("should get a payout", () => __async(null, null, function* () {
          const mockedPayout = {
            receiver_id: "re_000000000000",
            id: "pa_000000000000",
            status: "processing",
            sender_wallet_address: "0x123...890",
            signed_transaction: "AAA...Zey8y0A",
            quote_id: "qu_000000000000",
            instance_id: "in_000000000000",
            tracking_transaction: {
              step: "processing",
              status: "failed",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_payment: {
              step: "on_hold",
              provider_name: "blockchain",
              provider_transaction_id: "0x123...890",
              provider_status: "canceled",
              recipient_name: "John Doe",
              recipient_tax_id: "123.456.789-10",
              recipient_bank_code: "00416968",
              recipient_branch_code: "0001",
              recipient_account_number: "1234567890",
              recipient_account_type: "checking",
              estimated_time_of_arrival: "5_min",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_liquidity: {
              step: "processing",
              provider_transaction_id: "0x123...890",
              provider_status: "deposited",
              estimated_time_of_arrival: "1_business_day",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_complete: {
              step: "on_hold",
              status: "tokens_refunded",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_partner_fee: {
              step: "on_hold",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            created_at: "2021-01-01T00:00:00Z",
            updated_at: "2021-01-01T00:00:00Z",
            image_url: "https://example.com/image.png",
            first_name: "John",
            last_name: "Doe",
            legal_name: "Company Name Inc.",
            network: "sepolia",
            token: "USDC",
            description: "Memo code or description, only works with USD and BRL",
            sender_amount: 1010,
            receiver_amount: 5240,
            partner_fee_amount: 150,
            commercial_quotation: 495,
            blindpay_quotation: 485,
            total_fee_amount: 1.5,
            receiver_local_amount: 1e3,
            currency: "BRL",
            transaction_document_file: "https://example.com/image.png",
            transaction_document_type: "invoice",
            transaction_document_id: "1234567890",
            name: "Bank Account Name",
            type: "wire",
            pix_key: "14947677768",
            account_number: "1001001234",
            routing_number: "012345678",
            country: "US",
            account_class: "individual",
            address_line_1: "Address line 1",
            address_line_2: "Address line 2",
            city: "City",
            state_province_region: "State/Province/Region",
            postal_code: "Postal code",
            account_type: "checking",
            ach_cop_beneficiary_first_name: "Fernando",
            ach_cop_bank_account: "12345678",
            ach_cop_bank_code: "051",
            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",
            beneficiary_name: "Individual full name or business name",
            spei_clabe: "5482347403740546",
            spei_protocol: "clabe",
            spei_institution_code: "40002",
            swift_beneficiary_country: "MX",
            swift_code_bic: "123456789",
            swift_account_holder_name: "John Doe",
            swift_account_number_iban: "123456789",
            transfers_account: "BM123123123123",
            transfers_type: "CVU",
            has_virtual_account: true
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedPayout), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.payouts.get("pa_000000000000");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedPayout);
        }));
      });
      describe("Get payout track", () => {
        it("should get payout tracking information", () => __async(null, null, function* () {
          const mockedPayoutTrack = {
            receiver_id: "re_000000000000",
            id: "pa_000000000000",
            status: "processing",
            sender_wallet_address: "0x123...890",
            signed_transaction: "AAA...Zey8y0A",
            quote_id: "qu_000000000000",
            instance_id: "in_000000000000",
            tracking_transaction: {
              step: "processing",
              status: "failed",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_payment: {
              step: "on_hold",
              provider_name: "blockchain",
              provider_transaction_id: "0x123...890",
              provider_status: "canceled",
              recipient_name: "John Doe",
              recipient_tax_id: "123.456.789-10",
              recipient_bank_code: "00416968",
              recipient_branch_code: "0001",
              recipient_account_number: "1234567890",
              recipient_account_type: "checking",
              estimated_time_of_arrival: "5_min",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_liquidity: {
              step: "processing",
              provider_transaction_id: "0x123...890",
              provider_status: "deposited",
              estimated_time_of_arrival: "1_business_day",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_complete: {
              step: "on_hold",
              status: "tokens_refunded",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_partner_fee: {
              step: "on_hold",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            created_at: "2021-01-01T00:00:00Z",
            updated_at: "2021-01-01T00:00:00Z",
            image_url: "https://example.com/image.png",
            first_name: "John",
            last_name: "Doe",
            legal_name: "Company Name Inc.",
            network: "sepolia",
            token: "USDC",
            description: "Memo code or description, only works with USD and BRL",
            sender_amount: 1010,
            receiver_amount: 5240,
            partner_fee_amount: 150,
            commercial_quotation: 495,
            blindpay_quotation: 485,
            total_fee_amount: 1.5,
            receiver_local_amount: 1e3,
            currency: "BRL",
            transaction_document_file: "https://example.com/image.png",
            transaction_document_type: "invoice",
            transaction_document_id: "1234567890",
            name: "Bank Account Name",
            type: "wire",
            pix_key: "14947677768",
            account_number: "1001001234",
            routing_number: "012345678",
            country: "US",
            account_class: "individual",
            address_line_1: "Address line 1",
            address_line_2: "Address line 2",
            city: "City",
            state_province_region: "State/Province/Region",
            postal_code: "Postal code",
            account_type: "checking",
            ach_cop_beneficiary_first_name: "Fernando",
            ach_cop_bank_account: "12345678",
            ach_cop_bank_code: "051",
            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",
            beneficiary_name: "Individual full name or business name",
            spei_clabe: "5482347403740546",
            spei_protocol: "clabe",
            spei_institution_code: "40002",
            swift_beneficiary_country: "MX",
            swift_code_bic: "123456789",
            swift_account_holder_name: "John Doe",
            swift_account_number_iban: "123456789",
            transfers_account: "BM123123123123",
            transfers_type: "CVU",
            has_virtual_account: true
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedPayoutTrack), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.payouts.getTrack("pa_000000000000");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedPayoutTrack);
        }));
      });
      describe("Authorize stellar token", () => {
        it("should authorize stellar token", () => __async(null, null, function* () {
          const mockedAuthorizeToken = {
            transaction_hash: "string"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedAuthorizeToken), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.payouts.authorizeStellarToken({
            quote_id: "qu_000000000000",
            sender_wallet_address: "0x123...890"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedAuthorizeToken);
        }));
      });
      describe("Create stellar payout", () => {
        it("should create a stellar payout", () => __async(null, null, function* () {
          const mockedStellarPayout = {
            id: "pa_000000000000",
            status: "processing",
            sender_wallet_address: "0x123...890",
            tracking_complete: {
              step: "on_hold",
              status: "tokens_refunded",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_payment: {
              step: "on_hold",
              provider_name: "blockchain",
              provider_transaction_id: "0x123...890",
              provider_status: "canceled",
              recipient_name: "John Doe",
              recipient_tax_id: "123.456.789-10",
              recipient_bank_code: "00416968",
              recipient_branch_code: "0001",
              recipient_account_number: "1234567890",
              recipient_account_type: "checking",
              estimated_time_of_arrival: "5_min",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_transaction: {
              step: "processing",
              status: "failed",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_partner_fee: {
              step: "on_hold",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_liquidity: {
              step: "processing",
              provider_transaction_id: "0x123...890",
              provider_status: "deposited",
              estimated_time_of_arrival: "1_business_day",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            receiver_id: "re_000000000000"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedStellarPayout), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.payouts.createStellar({
            quote_id: "qu_000000000000",
            sender_wallet_address: "0x123...890"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedStellarPayout);
        }));
      });
      describe("Create EVM payout", () => {
        it("should create an EVM payout", () => __async(null, null, function* () {
          const mockedEvmPayout = {
            id: "pa_000000000000",
            status: "processing",
            sender_wallet_address: "0x123...890",
            tracking_complete: {
              step: "on_hold",
              status: "tokens_refunded",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_payment: {
              step: "on_hold",
              provider_name: "blockchain",
              provider_transaction_id: "0x123...890",
              provider_status: "canceled",
              recipient_name: "John Doe",
              recipient_tax_id: "123.456.789-10",
              recipient_bank_code: "00416968",
              recipient_branch_code: "0001",
              recipient_account_number: "1234567890",
              recipient_account_type: "checking",
              estimated_time_of_arrival: "5_min",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_transaction: {
              step: "processing",
              status: "failed",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_partner_fee: {
              step: "on_hold",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_liquidity: {
              step: "processing",
              provider_transaction_id: "0x123...890",
              provider_status: "deposited",
              estimated_time_of_arrival: "1_business_day",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            receiver_id: "re_000000000000"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedEvmPayout), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.payouts.createEvm({
            quote_id: "qu_000000000000",
            sender_wallet_address: "0x123...890"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedEvmPayout);
        }));
      });
      describe("Create solana payout", () => {
        it("should create a solana payout", () => __async(null, null, function* () {
          const mockedSolanaPayout = {
            id: "pa_000000000000",
            status: "processing",
            sender_wallet_address: "0x123...890",
            tracking_complete: {
              step: "on_hold",
              status: "tokens_refunded",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_payment: {
              step: "on_hold",
              provider_name: "blockchain",
              provider_transaction_id: "0x123...890",
              provider_status: "canceled",
              recipient_name: "John Doe",
              recipient_tax_id: "123.456.789-10",
              recipient_bank_code: "00416968",
              recipient_branch_code: "0001",
              recipient_account_number: "1234567890",
              recipient_account_type: "checking",
              estimated_time_of_arrival: "5_min",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_transaction: {
              step: "processing",
              status: "failed",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_partner_fee: {
              step: "on_hold",
              transaction_hash: "0x123...890",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            tracking_liquidity: {
              step: "processing",
              provider_transaction_id: "0x123...890",
              provider_status: "deposited",
              estimated_time_of_arrival: "1_business_day",
              completed_at: "2011-10-05T14:48:00.000Z"
            },
            receiver_id: "re_000000000000"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedSolanaPayout), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.payouts.createSolana({
            quote_id: "qu_000000000000",
            sender_wallet_address: "0x123...890",
            signed_transaction: "AAA...Zey8y0A"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedSolanaPayout);
        }));
      });
      describe("Submit payout documents", () => {
        it("should submit payout documents", () => __async(null, null, function* () {
          const mockedResponse = {
            id: "pd_000000000000"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedResponse), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.payouts.submitDocuments({
            payout_id: "pa_000000000000",
            transaction_document_type: "invoice",
            transaction_document_id: "INV-2025-001",
            transaction_document_file: "https://storage.blindpay.com/uploads/invoice.pdf",
            description: "Invoice for services"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedResponse);
        }));
      });
    });
  }
});
export default require_payouts_test();
