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/offramp.test.ts
var require_offramp_test = __commonJS({
  "src/resources/wallets/offramp.test.ts"(exports) {
    init_dist();
    init_client();
    describe("Offramp wallets", () => {
      afterEach(() => fetchMock.resetMocks());
      const blindpay = new Blindpay("test-key");
      describe("List offramp wallets", () => {
        it("should list offramp wallets", () => __async(null, null, function* () {
          const mockedOfframpWallets = [
            {
              id: "ow_000000000000",
              external_id: "your_external_id",
              instance_id: "in_000000000000",
              receiver_id: "re_000000000000",
              bank_account_id: "ba_000000000000",
              network: "tron",
              address: "TALJN9zTTEL9TVBb4WuTt6wLvPqJZr3hvb",
              created_at: "2021-01-01T00:00:00Z",
              updated_at: "2021-01-01T00:00:00Z"
            }
          ];
          fetchMock.mockResponseOnce(JSON.stringify(mockedOfframpWallets), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.wallets.offramp.list({
            instanceId: "in_000000000000",
            receiverId: "re_000000000000",
            bankAccountId: "ba_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedOfframpWallets);
        }));
      });
      describe("Create offramp wallet", () => {
        it("should create an offramp wallet", () => __async(null, null, function* () {
          const mockedOfframpWallet = {
            id: "ow_000000000000",
            external_id: "your_external_id",
            network: "tron",
            address: "TALJN9zTTEL9TVBb4WuTt6wLvPqJZr3hvb"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedOfframpWallet), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.wallets.offramp.create({
            instanceId: "in_000000000000",
            external_id: "your_external_id",
            network: "tron",
            receiverId: "re_000000000000",
            bankAccountId: "ba_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedOfframpWallet);
        }));
      });
      describe("Get offramp wallet", () => {
        it("should get an offramp wallet", () => __async(null, null, function* () {
          const mockedOfframpWallet = {
            id: "ow_000000000000",
            external_id: "your_external_id",
            instance_id: "in_000000000000",
            receiver_id: "re_000000000000",
            bank_account_id: "ba_000000000000",
            network: "tron",
            address: "TALJN9zTTEL9TVBb4WuTt6wLvPqJZr3hvb",
            created_at: "2021-01-01T00:00:00Z",
            updated_at: "2021-01-01T00:00:00Z"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedOfframpWallet), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.wallets.offramp.get({
            instanceId: "in_000000000000",
            id: "ow_000000000000",
            bankAccountId: "ba_000000000000",
            receiverId: "re_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedOfframpWallet);
        }));
      });
    });
  }
});
export default require_offramp_test();
