@reservoir0x/relay-kit-ui
Version:
Relay is the Fastest and Cheapest Way to Bridge and Transact Across Chains.
20 lines • 711 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.axiosPostFetcher = void 0;
const tslib_1 = require("tslib");
const axios_1 = tslib_1.__importDefault(require("axios"));
const fetcher = async (url, headers) => {
const response = await fetch(url, { headers });
if (!response.ok) {
const errorData = await response.json();
throw new Error(errorData.message || 'Network error');
}
return response.json();
};
exports.default = fetcher;
const axiosPostFetcher = async (url, params) => {
const { data } = await axios_1.default.post(url, params);
return data;
};
exports.axiosPostFetcher = axiosPostFetcher;
//# sourceMappingURL=fetcher.js.map