import {
  afterEach,
  describe,
  globalExpect,
  init_dist,
  it
} from "../../chunk-GCCHFONX.mjs";
import {
  Blindpay,
  init_client
} from "../../chunk-ES7RXEM7.mjs";
import "../../chunk-GEDDLCJY.mjs";
import "../../chunk-LK3JPQ6I.mjs";
import "../../chunk-CNNEROQ7.mjs";
import "../../chunk-GNDAATIJ.mjs";
import "../../chunk-VKN2AMCW.mjs";
import "../../chunk-LUDGZPXY.mjs";
import "../../chunk-3CZJEDS5.mjs";
import "../../chunk-UCAW3RTZ.mjs";
import "../../chunk-M6IYYMRW.mjs";
import "../../chunk-HKFAJXJG.mjs";
import "../../chunk-QVOSGLUO.mjs";
import "../../chunk-2DAKB5XK.mjs";
import "../../chunk-QHMIK7U3.mjs";
import "../../chunk-LLWEHHKB.mjs";
import {
  __async,
  __commonJS
} from "../../chunk-OBKEW4AQ.mjs";

// src/resources/wallets/blockchain.test.ts
var require_blockchain_test = __commonJS({
  "src/resources/wallets/blockchain.test.ts"(exports) {
    init_dist();
    init_client();
    describe("Blockchain wallets", () => {
      afterEach(() => fetchMock.resetMocks());
      const blindpay = new Blindpay("test-key");
      describe("Get blockchain wallet message", () => {
        it("should get blockchain wallet message", () => __async(null, null, function* () {
          const mockedMessage = { message: "random" };
          fetchMock.mockResponseOnce(JSON.stringify(mockedMessage), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.wallets.blockchain.getWalletMessage({
            instanceId: "in_000000000000",
            receiverId: "re_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedMessage);
        }));
      });
      describe("List blockchain wallets", () => {
        it("should list blockchain wallets", () => __async(null, null, function* () {
          const mockedWallets = [
            {
              id: "bw_000000000000",
              name: "Wallet Display Name",
              network: "polygon",
              address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
              signature_tx_hash: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
              is_account_abstraction: false,
              receiver_id: "re_000000000000"
            }
          ];
          fetchMock.mockResponseOnce(JSON.stringify(mockedWallets), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.wallets.blockchain.list({
            instanceId: "in_000000000000",
            receiverId: "re_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedWallets);
        }));
      });
      describe("Create blockchain wallet", () => {
        it("should create a blockchain wallet", () => __async(null, null, function* () {
          const mockedWallet = {
            id: "bw_000000000000",
            name: "Wallet Display Name",
            network: "polygon",
            address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
            signature_tx_hash: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
            is_account_abstraction: false,
            receiver_id: "re_000000000000"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedWallet), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.wallets.blockchain.create({
            instanceId: "in_000000000000",
            receiverId: "re_000000000000",
            name: "Wallet Display Name",
            network: "polygon",
            address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedWallet);
        }));
      });
      describe("Get blockchain wallet", () => {
        it("should get a blockchain wallet", () => __async(null, null, function* () {
          const mockedWallet = {
            id: "bw_000000000000",
            name: "Wallet Display Name",
            network: "polygon",
            address: "0xDD6a3aD0949396e57C7738ba8FC1A46A5a1C372C",
            signature_tx_hash: "0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",
            is_account_abstraction: false,
            receiver_id: "re_000000000000"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedWallet), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.wallets.blockchain.get({
            instanceId: "in_000000000000",
            receiverId: "re_000000000000",
            id: "bw_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedWallet);
        }));
      });
      describe("Delete blockchain wallet", () => {
        it("should delete a blockchain wallet", () => __async(null, null, function* () {
          fetchMock.mockResponseOnce(JSON.stringify({ data: null }), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.wallets.blockchain.delete({
            instanceId: "in_000000000000",
            receiverId: "re_000000000000",
            id: "bw_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual({ data: null });
        }));
      });
    });
  }
});
export default require_blockchain_test();
