lending-apy-fetcher-ts
Version:
TypeScript library for fetching APYs from DeFi lending protocols
35 lines • 1.2 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AuthenticationError = exports.ValidationError = exports.NetworkError = exports.ApyFetcherError = void 0;
// Custom error types for different failure modes
class ApyFetcherError extends Error {
constructor(message, protocol, cause) {
super(message);
this.protocol = protocol;
this.cause = cause;
this.name = 'ApyFetcherError';
}
}
exports.ApyFetcherError = ApyFetcherError;
class NetworkError extends ApyFetcherError {
constructor(message, protocol, cause) {
super(message, protocol, cause);
this.name = 'NetworkError';
}
}
exports.NetworkError = NetworkError;
class ValidationError extends ApyFetcherError {
constructor(message, protocol, cause) {
super(message, protocol, cause);
this.name = 'ValidationError';
}
}
exports.ValidationError = ValidationError;
class AuthenticationError extends ApyFetcherError {
constructor(message, protocol, cause) {
super(message, protocol, cause);
this.name = 'AuthenticationError';
}
}
exports.AuthenticationError = AuthenticationError;
//# sourceMappingURL=index.js.map