UNPKG

@alchemy/aa-core

Version:

viem based SDK that enables interactions with ERC-4337 Smart Accounts. ABIs are based off the definitions generated in @account-abstraction/contracts

126 lines 4.25 kB
import { BaseError } from "./base.js"; export class AccountNotFoundError extends BaseError { constructor() { super("Could not find an Account to execute with this Action."); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AccountNotFoundError" }); } } export class DefaultFactoryNotDefinedError extends BaseError { constructor(accountType, chain, version) { super([ `No default factory for ${accountType} found on chain ${chain.name} for entrypoint version ${version}`, "Supply an override via the `factoryAddress` parameter when creating an account", ].join("\n")); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "DefaultFactoryNotDefinedError" }); } } export class GetCounterFactualAddressError extends BaseError { constructor() { super("getCounterFactualAddress failed"); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "GetCounterFactualAddressError" }); } } export class UpgradesNotSupportedError extends BaseError { constructor(accountType) { super(`Upgrades are not supported by ${accountType}`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "UpgradesNotSupported" }); } } export class SignTransactionNotSupportedError extends BaseError { constructor() { super(`SignTransaction is not supported by smart contracts`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "SignTransactionNotSupported" }); } } export class FailedToGetStorageSlotError extends BaseError { constructor(slot, slotDescriptor) { super(`Failed to get storage slot ${slot} (${slotDescriptor})`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "FailedToGetStorageSlotError" }); } } export class BatchExecutionNotSupportedError extends BaseError { constructor(accountType) { super(`Batch execution is not supported by ${accountType}`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "BatchExecutionNotSupportedError" }); } } export class AccountRequiresOwnerError extends BaseError { constructor(accountType) { super(`Account of type ${accountType} requires an owner to execute`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "AccountRequiresOwnerError" }); } } export class UpgradeToAndCallNotSupportedError extends BaseError { constructor(accountType) { super(`UpgradeToAndCall is not supported by ${accountType}`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "UpgradeToAndCallNotSupportedError" }); } } export class IncorrectAccountType extends BaseError { constructor(expected, actual) { super(`Expected account type ${expected}, got ${actual}`); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "IncorrectAccountTypeError" }); } } export class SmartAccountWithSignerRequiredError extends BaseError { constructor() { super("Smart account requires a signer"); Object.defineProperty(this, "name", { enumerable: true, configurable: true, writable: true, value: "SmartAccountWithSignerRequiredError" }); } } //# sourceMappingURL=account.js.map