UNPKG

gray-market-js

Version:

Utility library for the Gray Market rental marketplace

35 lines (31 loc) 1.55 kB
const { default: axios } = require("axios"); const AssetsClient = require("./assets/AssetsClient"); const AuthClient = require("./auth/AuthClient"); const RentalsClient = require("./rentals/RentalsClient"); const WalletsClient = require("./wallets/WalletsClient"); const CustodyProvidersClient = require("./custody/CustodyProvidersClient"); const RentalListingsClient = require("./rental_listings/RentalListingsClient"); const RentalListingCreator = require("./rental_listings/RentalListingCreator"); const RentalListingFulfiller = require("./rental_listings/RentalListingFulfiller"); const RentalListingWithdrawer = require("./rental_listings/RentalListingWithdrawer"); const SearchClient = require("./search/SearchClient"); class GrayMarketAPI { constructor(baseUrl, axiosInstance = null) { axiosInstance = axiosInstance ?? axios.create({ baseURL: baseUrl }); //API clients this.auth = new AuthClient(axiosInstance); this.assets = new AssetsClient(axiosInstance); this.custodyProviders = new CustodyProvidersClient(axiosInstance); this.rentalListings = new RentalListingsClient(axiosInstance); this.wallets = new WalletsClient(axiosInstance); this.search = new SearchClient(axiosInstance); this.rentals = new RentalsClient(axiosInstance); //Utils this.listingCreator = new RentalListingCreator(); this.listingFulfiller = new RentalListingFulfiller(); this.listingWithdrawer = new RentalListingWithdrawer(); } } module.exports = GrayMarketAPI;