@parifi/synthetix-sdk-ts
Version:
A Typescript SDK for interactions with the Synthetix protocol
29 lines • 800 B
JavaScript
// src/utils/parseError.ts
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";
}
export {
parseError
};
//# sourceMappingURL=parseError.mjs.map