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/wallets/custodial.test.ts
var require_custodial_test = __commonJS({
  "src/resources/wallets/custodial.test.ts"(exports) {
    init_dist();
    init_client();
    var mockWallet = {
      id: "wa_000000000000",
      name: "Main Wallet",
      external_id: null,
      address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
      network: "polygon",
      created_at: "2025-01-01T00:00:00Z"
    };
    describe("Custodial Wallets", () => {
      afterEach(() => fetchMock.resetMocks());
      const blindpay = new BlindPay({ apiKey: "test-key", instanceId: "in_000000000000" });
      describe("Create custodial wallet", () => {
        it("should create a custodial wallet", () => __async(null, null, function* () {
          const mockedWallet = mockWallet;
          fetchMock.mockResponseOnce(JSON.stringify(mockedWallet), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.wallets.custodial.create({
            receiver_id: "re_000000000000",
            name: "Main Wallet",
            network: "polygon"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedWallet);
        }));
      });
      describe("List custodial wallets", () => {
        it("should list custodial wallets", () => __async(null, null, function* () {
          const mockedWallets = [mockWallet];
          fetchMock.mockResponseOnce(JSON.stringify(mockedWallets), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.wallets.custodial.list("re_000000000000");
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedWallets);
        }));
      });
      describe("Get custodial wallet", () => {
        it("should get a custodial wallet", () => __async(null, null, function* () {
          const mockedWallet = mockWallet;
          fetchMock.mockResponseOnce(JSON.stringify(mockedWallet), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.wallets.custodial.get({
            receiver_id: "re_000000000000",
            id: "wa_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedWallet);
        }));
      });
      describe("Get custodial wallet balance", () => {
        it("should get wallet balance", () => __async(null, null, function* () {
          const mockedBalance = {
            USDC: {
              address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
              id: "tok_000000000001",
              symbol: "USDC",
              amount: 1e4
            },
            USDT: {
              address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
              id: "tok_000000000002",
              symbol: "USDT",
              amount: 5e3
            },
            USDB: {
              address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
              id: "tok_000000000003",
              symbol: "USDB",
              amount: 0
            }
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedBalance), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.wallets.custodial.getBalance({
            receiver_id: "re_000000000000",
            id: "wa_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedBalance);
        }));
      });
      describe("Delete custodial wallet", () => {
        it("should delete a custodial wallet", () => __async(null, null, function* () {
          fetchMock.mockResponseOnce(JSON.stringify({ success: true }), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.wallets.custodial.delete({
            receiver_id: "re_000000000000",
            id: "wa_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ success: true });
        }));
      });
    });
  }
});
export default require_custodial_test();
