UNPKG

@owlprotocol/contracts-account-abstraction

Version:

ERC4337 Account Abstraction support for deploying relevant smart contracts and interacting with UserOps.

55 lines (54 loc) 2.78 kB
var __defProp = Object.defineProperty; var __getOwnPropDesc = Object.getOwnPropertyDescriptor; var __getOwnPropNames = Object.getOwnPropertyNames; var __hasOwnProp = Object.prototype.hasOwnProperty; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; 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); var __publicField = (obj, key, value) => { __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); return value; }; var Errors_exports = {}; __export(Errors_exports, { ExecutionError: () => ExecutionError, ExecutionErrors: () => ExecutionErrors, ValidationErrors: () => ValidationErrors }); module.exports = __toCommonJS(Errors_exports); var ValidationErrors = /* @__PURE__ */ ((ValidationErrors2) => { ValidationErrors2[ValidationErrors2["InvalidRequest"] = -32601] = "InvalidRequest"; ValidationErrors2[ValidationErrors2["InvalidFields"] = -32602] = "InvalidFields"; ValidationErrors2[ValidationErrors2["SimulateValidation"] = -32500] = "SimulateValidation"; ValidationErrors2[ValidationErrors2["SimulatePaymasterValidation"] = -32501] = "SimulatePaymasterValidation"; ValidationErrors2[ValidationErrors2["OpcodeValidation"] = -32502] = "OpcodeValidation"; ValidationErrors2[ValidationErrors2["ExpiresShortly"] = -32503] = "ExpiresShortly"; ValidationErrors2[ValidationErrors2["Reputation"] = -32504] = "Reputation"; ValidationErrors2[ValidationErrors2["InsufficientStake"] = -32505] = "InsufficientStake"; ValidationErrors2[ValidationErrors2["UnsupportedSignatureAggregator"] = -32506] = "UnsupportedSignatureAggregator"; ValidationErrors2[ValidationErrors2["InvalidSignature"] = -32507] = "InvalidSignature"; return ValidationErrors2; })(ValidationErrors || {}); var ExecutionErrors = /* @__PURE__ */ ((ExecutionErrors2) => { ExecutionErrors2[ExecutionErrors2["UserOperationReverted"] = -32521] = "UserOperationReverted"; return ExecutionErrors2; })(ExecutionErrors || {}); class ExecutionError extends Error { // error codes from: https://eips.ethereum.org/EIPS/eip-1474 constructor(msg, code) { super(msg); __publicField(this, "code"); this.code = code; } }