@parifi/synthetix-sdk-ts
Version:
A Typescript SDK for interactions with the Synthetix protocol
54 lines (53 loc) • 1.82 kB
JavaScript
;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
// src/utils/parseError.ts
var parseError_exports = {};
__export(parseError_exports, {
parseError: () => parseError
});
module.exports = __toCommonJS(parseError_exports);
function parseError(error) {
try {
if (error.cause?.data) {
return error.cause?.data;
}
if (error.cause?.cause?.data) {
return error.cause?.cause?.data;
}
if (error.cause?.cause?.cause?.data) {
return error.cause?.cause?.cause?.data;
}
if (error.cause?.cause?.error?.data) {
return error.cause?.cause?.error?.data;
}
if (error.cause?.cause?.cause?.error?.data) {
return error.cause?.cause?.cause?.error?.data;
}
} catch (err) {
console.log("=== exception in erc7412 error parser:", err);
}
console.log("=== a", JSON.stringify(error, null, 2));
console.error("=== got unknown error in erc7412 parse", error);
return "0x";
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
parseError
});
//# sourceMappingURL=parseError.js.map