@sphereon/ssi-sdk-web3.headless-provider
Version:
24 lines • 1.4 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.UnrecognizedChainID = exports.ChainDisconnected = exports.Disconnected = exports.UnsupportedMethod = exports.Unauthorized = exports.Deny = exports.ErrorWithCode = void 0;
class ErrorWithCode extends Error {
constructor(message, code) {
super(message);
this.code = code;
return this;
}
}
exports.ErrorWithCode = ErrorWithCode;
const Deny = () => new ErrorWithCode('The user rejected the request.', 4001);
exports.Deny = Deny;
const Unauthorized = () => new ErrorWithCode('The requested method and/or account has not been authorized by the user.', 4100);
exports.Unauthorized = Unauthorized;
const UnsupportedMethod = () => new ErrorWithCode('The Provider does not support the requested method.', 4200);
exports.UnsupportedMethod = UnsupportedMethod;
const Disconnected = () => new ErrorWithCode('The Provider is disconnected from all chains.', 4900);
exports.Disconnected = Disconnected;
const ChainDisconnected = () => new ErrorWithCode('The Provider is not connected to the requested chain.', 4901);
exports.ChainDisconnected = ChainDisconnected;
const UnrecognizedChainID = () => new ErrorWithCode('Unrecognized chain ID. Try adding the chain using `wallet_addEthereumChain` first.', 4902);
exports.UnrecognizedChainID = UnrecognizedChainID;
//# sourceMappingURL=errors.js.map