import {
  afterEach,
  describe,
  globalExpect,
  init_dist,
  it
} from "../../chunk-GCCHFONX.mjs";
import {
  BlindPay,
  init_client
} from "../../chunk-ZPGWM4VJ.mjs";
import "../../chunk-IZYPRCCV.mjs";
import "../../chunk-QGNLMN6Z.mjs";
import "../../chunk-UC57SCKQ.mjs";
import "../../chunk-TBTA7A2P.mjs";
import "../../chunk-BONN6PYB.mjs";
import "../../chunk-5XJJKYXE.mjs";
import "../../chunk-RC5NN5UF.mjs";
import "../../chunk-W7NJUABI.mjs";
import "../../chunk-E7M4CJKR.mjs";
import "../../chunk-3QQCDR3E.mjs";
import "../../chunk-LRHWT4JU.mjs";
import "../../chunk-QHMIK7U3.mjs";
import "../../chunk-64EFLUS3.mjs";
import "../../chunk-B5T7AQLH.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({ apiKey: "test-key", instanceId: "in_000000000000" });
      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({
            receiver_id: "re_000000000000",
            bank_account_id: "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({
            external_id: "your_external_id",
            network: "tron",
            receiver_id: "re_000000000000",
            bank_account_id: "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({
            id: "ow_000000000000",
            bank_account_id: "ba_000000000000",
            receiver_id: "re_000000000000"
          });
          globalExpect(error).toBeNull();
          globalExpect(data).toEqual(mockedOfframpWallet);
        }));
      });
    });
  }
});
export default require_offramp_test();
