Skip to main content

Types

This page documents the types used in Smart Accounts Kit APIs.

Enums

ExecutionMode

Enum specifying how delegated executions are processed when redeeming delegations.

ValueDescription
ExecutionMode.SingleDefaultExecutes a single call and reverts on failure.
ExecutionMode.SingleTryExecutes a single call and silently continues on failure.
ExecutionMode.BatchDefaultExecutes a batch of calls and reverts if any call fails.
ExecutionMode.BatchTryExecutes a batch of calls and silently continues past failures.

Implementation

Enum representing the MetaMask smart account implementation type.

ValueDescription
Implementation.HybridSupports both ECDSA and WebAuthn (passkey) signers.
Implementation.MultiSigSupports multiple ECDSA signers with threshold-based signing.
Implementation.Stateless7702Uses EIP-7702 to upgrade an EOA to a smart account without deployment.

ScopeType

Enum representing delegation scope types.

ValueString
ScopeType.Erc20TransferAmount"erc20TransferAmount"
ScopeType.Erc20Streaming"erc20Streaming"
ScopeType.Erc20PeriodTransfer"erc20PeriodTransfer"
ScopeType.NativeTokenTransferAmount"nativeTokenTransferAmount"
ScopeType.NativeTokenStreaming"nativeTokenStreaming"
ScopeType.NativeTokenPeriodTransfer"nativeTokenPeriodTransfer"
ScopeType.Erc721Transfer"erc721Transfer"
ScopeType.OwnershipTransfer"ownershipTransfer"
ScopeType.FunctionCall"functionCall"

TransferWindow

Enum representing predefined time intervals in seconds for transfer period durations.

ValueSeconds
TransferWindow.Hourly3600
TransferWindow.Daily86400
TransferWindow.Weekly604800
TransferWindow.BiWeekly1209600
TransferWindow.Monthly2592000
TransferWindow.Quarterly7776000
TransferWindow.Yearly31536000

Type

AllowedCalldataBuilderConfig

Defines an expected calldata segment for a single function signature.

NameTypeRequiredDescription
startIndexnumberYesThe byte offset in the calldata (including the 4-byte selector) where the expected value starts.
valueHexYesThe expected hex-encoded calldata at that offset.

Caveat

Represents a restriction or condition applied to a delegation.

NameTypeRequiredDescription
enforcerHexYesThe contract address of the enforcer.
termsHexYesThe terms of the caveat encoded as hex data.
argsHexYesAdditional arguments required by the caveat enforcer, encoded as hex data.

CaveatBuilderConfig

Optional configuration for createCaveatBuilder.

NameTypeRequiredDescription
allowInsecureUnrestrictedDelegationbooleanNoWhether to allow unrestricted delegations with no caveats. The default is false.

Delegation

Represents a delegation that grants permissions from a delegator to a delegate.

NameTypeRequiredDescription
delegateHexYesThe address to which the delegation is being granted.
delegatorHexYesThe address that is granting the delegation.
authorityHexYesThe parent delegation hash, or ROOT_AUTHORITY for creating root delegations.
caveatsCaveat[]YesAn array of caveats that constrain the delegation.
saltHexYesThe salt for generating the delegation hash. This helps prevent hash collisions when creating identical delegations.
signatureHexYesThe signature to validate the delegation.

ExactCalldataBuilderConfig

Defines the exact calldata the delegate is allowed to call.

NameTypeRequiredDescription
calldataHexYesThe exact calldata the delegate is allowed to call.

ExecutionStruct

Represents a single execution to perform on behalf of a delegator.

NameTypeRequiredDescription
targetAddressYesAddress of the contract or recipient that the call is directed to.
valuebigintYesValue of native tokens to send along with the call in wei format.
callDataHexYesEncoded function data to be executed on the target address.

PartialSignature

Represents a single signer's contribution to a multisig aggregated signature.

NameTypeRequiredDescription
signerAddressYesThe address of the signer.
signatureHexYesThe signer's signature over the user operation.
typeSignatureTypeYesThe signature type to represent signature algorithm. Only supported value is ECDSA.

SmartAccountsEnvironment

An object containing the contract addresses required to interact with the Delegation Framework on a specific chain.

NameTypeRequiredDescription
DelegationManagerHexYesThe address of the Delegation Manager contract.
EntryPointHexYesThe address of the ERC-4337 EntryPoint contract.
SimpleFactoryHexYesThe address of the factory contract for deploying MetaMask smart accounts.
implementationsRecord<string, Hex>YesA map of MetaMask smart account implementation types to their deployed addresses.
caveatEnforcersRecord<string, Hex>YesA map of caveat enforcer types to their deployed addresses.

ValueLteBuilderConfig

NameTypeRequiredDescription
maxValuebigintYesThe maximum native token amount the delegate can transfer per call.