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/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("Create solana offramp wallet", () => {
        it("should create a solana offramp wallet", () => __async(null, null, function* () {
          const mockedOfframpWallet = {
            id: "ow_000000000001",
            network: "solana",
            address: "7xKXtg2CW87d97TXJSDpbD5jBkheTqA83TZRuJosgAsU",
            circle_wallet_id: "01234567-abcd-efgh-ijkl-012345678901"
          };
          fetchMock.mockResponseOnce(JSON.stringify(mockedOfframpWallet), {
            headers: { "Content-Type": "application/json" }
          });
          const { data, error } = yield blindpay.wallets.offramp.create({
            network: "solana",
            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();
