Calibur7702Account upgrades an EOA to a smart account via EIP-7702 delegation to the Calibur singleton. It provides batched transactions, passkey authentication, multi-key management with per-key hooks, and full ERC-4337 support through EntryPoint v0.8.
When to Use Calibur Account
- Multi-key support: Register passkeys, session keys, or secondary signers alongside the EOA root key.
- Per-key hooks: Attach custom validation logic to individual keys (e.g., spending limits, time locks).
- Key expiration and admin separation: Set expiration timestamps and distinguish admin keys from non-admin keys.
- WebAuthn/passkey authentication: Sign transactions with biometrics through the WebAuthn standard.
- Production-grade contracts: Built by Uniswap, audited by OpenZeppelin and Cantina.
Supported ERCs: ERC-4337 (Account Abstraction), EIP-7702 (EOA delegation).
Supported key types:
| Type | Description |
|---|
Secp256k1 | Standard Ethereum EOA key (keyType = 2). Used for EOA private keys and secondary signers. |
WebAuthnP256 | P-256 key signed through the browser's WebAuthn API (keyType = 1). Used for passkeys, Face ID, fingerprint, and security keys. The signature includes WebAuthn metadata (authenticatorData, clientDataJSON) that the contract parses before verifying the underlying P-256 signature. |
P256 | Raw P-256 / secp256r1 key (keyType = 0). Same elliptic curve as WebAuthnP256, but with a raw (r, s) signature format. Used when you have direct access to a P-256 key (e.g., from a secure enclave or HSM) without the WebAuthn wrapper. |
Smart Contracts and Audits
The contracts were developed by Uniswap and audited by OpenZeppelin and Cantina.
How to Use
Prerequisites
Before using Calibur7702Account, you must have:
- Node.js: Version 18.0 or higher.
- EIP-7702 Compatible Network: Ethereum mainnet, Sepolia, or other EIP-7702 enabled chains.
- Private Key Access: Required for signing authorizations and user operations.
Installation
npm install abstractionkit@0.2.39
Calibur support requires abstractionkit v0.2.39 or later. The contracts are audited by OpenZeppelin and Cantina.
Usage
import { Calibur7702Account } from "abstractionkit";
const eoaAddress = "0xBdbc5FBC9cA8C3F514D073eC3de840Ac84FC6D31";
const smartAccount = new Calibur7702Account(eoaAddress);
Constructor defaults:
entrypointAddress: 0x4337084D9E255Ff0702461CF8895CE9E3b5Ff108 (EntryPoint v0.8)
delegateeAddress: 0x000000009B1D0aF20D8C6d0A44e162d11F9b8f00 (Uniswap v1.0.0)
Both can be overridden by passing an overrides object as the second constructor argument.
const smartAccount = new Calibur7702Account(eoaAddress, {
entrypointAddress: "0x...",
delegateeAddress: "0x...",
});
Essential Methods
createUserOperation
Creates a UserOperation for EIP-7702 accounts that can be sent to bundlers for execution. Handles nonce fetching, gas estimation, and optional EIP-7702 delegation authorization.
- example.ts
- Param Types
- Return Type
example.ts
import { Calibur7702Account } from "abstractionkit";
const eoaAddress = "0xBdbc5FBC9cA8C3F514D073eC3de840Ac84FC6D31";
const smartAccount = new Calibur7702Account(eoaAddress);
const transactions = [
{
to: "0x9a7af758aE5d7B6aAE84fe4C5Ba67c041dFE5336",
value: 0n,
data: "0x...",
},
];
const userOperation = await smartAccount.createUserOperation(
transactions,
"https://ethereum-sepolia-rpc.publicnode.com",
"https://api.candide.dev/public/v3/sepolia",
{
eip7702Auth: {
chainId: 11155111n,
},
}
);
| key | type | description |
|---|
transactions | SimpleMetaTransaction[] | Array of transactions to include in the user operation |
providerRpc? | string | JSON-RPC provider URL for nonce and gas price queries |
bundlerRpc? | string | Bundler RPC URL for gas estimation |
overrides? | | key | type | description |
|---|
nonce? | bigint | Set the nonce instead of querying from the RPC node | callData? | string | Set the callData instead of encoding the provided MetaTransactions | callGasLimit? | bigint | Set the callGasLimit instead of estimating via the bundler | verificationGasLimit? | bigint | Set the verificationGasLimit instead of estimating via the bundler | preVerificationGas? | bigint | Set the preVerificationGas instead of estimating via the bundler | maxFeePerGas? | bigint | Set the maxFeePerGas instead of querying current gas price | maxPriorityFeePerGas? | bigint | Set the maxPriorityFeePerGas instead of querying current gas price | callGasLimitPercentageMultiplier? | number | Percentage multiplier applied to estimated callGasLimit | verificationGasLimitPercentageMultiplier? | number | Percentage multiplier applied to estimated verificationGasLimit | preVerificationGasPercentageMultiplier? | number | Percentage multiplier applied to estimated preVerificationGas | maxFeePerGasPercentageMultiplier? | number | Percentage multiplier applied to fetched maxFeePerGas | maxPriorityFeePerGasPercentageMultiplier? | number | Percentage multiplier applied to fetched maxPriorityFeePerGas | state_override_set? | StateOverrideSet | State overrides for gas estimation | dummySignature? | string | Override the dummy signature used during gas estimation | gasLevel? | GasOption | Gas price level preference | polygonGasStation? | PolygonChain | Polygon chain identifier for fetching gas prices from Polygon Gas Station | revertOnFailure? | boolean | Whether BatchedCall should revert on individual call failure (default: true) | paymasterFields? | ParallelPaymasterInitValues | Paymaster init values for gas estimation. Set these to include paymaster data during gas estimation so preVerificationGas is accurate. | eip7702Auth? | | key | type | description |
|---|
chainId | string | Chain ID in hexadecimal format where the authorization is valid | address | string | Address to authorize for the EOA delegation | nonce | string | Authorization nonce in hexadecimal format | yParity | string | Y parity of the authorization signature | r | string | R component of the authorization signature | s | string | S component of the authorization signature |
| EIP-7702 authorization fields. Required for the first UserOperation to delegate the EOA to the Calibur singleton. |
| Optional overrides for gas, nonce, and EIP-7702 auth fields |
SimpleMetaTransaction
| key | type | description |
|---|
SimpleMetaTransaction | | key | type | description |
|---|
to | string | Target contract address for the transaction | value | bigint | Value transferred in the transaction (usually 0n for contract interactions) | data | string | The call data for the transaction |
| SimpleMetaTransaction is the type of transaction used with Calibur7702Account. |
| key | type | description |
|---|
userOperation | | key | type | description |
|---|
sender | string | The account making the operation | nonce | bigint | Anti-replay parameter (see Semi-abstracted Nonce Support) | factory | string | null | Account factory address, only for new accounts (null if account already exists) | factoryData | string | null | Data for account factory (null if account already exists) | callData | string | The data to pass to the sender during the main execution call | callGasLimit | bigint | The amount of gas to allocate the main execution call | verificationGasLimit | bigint | The amount of gas to allocate for the verification step | preVerificationGas | bigint | The amount of gas to pay for to compensate the bundler for pre-verification execution and calldata | maxFeePerGas | bigint | Maximum fee per gas (similar to EIP-1559 max_fee_per_gas) | maxPriorityFeePerGas | bigint | Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) | paymaster | string | null | Address of paymaster contract (null if account pays for itself) | paymasterVerificationGasLimit | bigint | null | The amount of gas to allocate for the paymaster verification step (null if no paymaster) | paymasterPostOpGasLimit | bigint | null | The amount of gas to allocate for the paymaster post-operation code (null if no paymaster) | paymasterData | string | null | Data for paymaster (null if no paymaster) | eip7702Auth | Authorization7702Hex | null | EIP-7702 authorization data for EOA delegation (null if not using EIP-7702) | signature | string | Data passed into the account to verify authorization. Resolves to '0x' when the user did not provide their signature yet |
| The constructed unsigned UserOperation for EIP-7702 |
Source code
createUserOperation
signUserOperation
Signs a UserOperation with a private key. Computes the UserOperation hash and wraps the ECDSA signature in Calibur's format. By default signs with the root key. To sign with a registered secondary key, pass its key hash via overrides.keyHash.
- example.ts
- Param Types
- Return Type
example.ts
userOperation.signature = smartAccount.signUserOperation(
userOperation,
"0x...private-key",
11155111n
);
userOperation.signature = smartAccount.signUserOperation(
userOperation,
"0x...secondary-private-key",
11155111n,
{ keyHash: "0x...registered-key-hash" }
);
| key | type | description |
|---|
userOperation | | key | type | description |
|---|
sender | string | The account making the operation | nonce | bigint | Anti-replay parameter (see Semi-abstracted Nonce Support) | factory | string | null | Account factory address, only for new accounts (null if account already exists) | factoryData | string | null | Data for account factory (null if account already exists) | callData | string | The data to pass to the sender during the main execution call | callGasLimit | bigint | The amount of gas to allocate the main execution call | verificationGasLimit | bigint | The amount of gas to allocate for the verification step | preVerificationGas | bigint | The amount of gas to pay for to compensate the bundler for pre-verification execution and calldata | maxFeePerGas | bigint | Maximum fee per gas (similar to EIP-1559 max_fee_per_gas) | maxPriorityFeePerGas | bigint | Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) | paymaster | string | null | Address of paymaster contract (null if account pays for itself) | paymasterVerificationGasLimit | bigint | null | The amount of gas to allocate for the paymaster verification step (null if no paymaster) | paymasterPostOpGasLimit | bigint | null | The amount of gas to allocate for the paymaster post-operation code (null if no paymaster) | paymasterData | string | null | Data for paymaster (null if no paymaster) | eip7702Auth | Authorization7702Hex | null | EIP-7702 authorization data for EOA delegation (null if not using EIP-7702) | signature | string | Data passed into the account to verify authorization. Resolves to '0x' when the user did not provide their signature yet |
| The user operation to sign |
privateKey | string | Hex-encoded private key to sign the user operation with |
chainId | bigint | Chain ID for the target blockchain |
overrides? | | key | type | description |
|---|
hookData? | string | Hook data to append to the signature (default: "0x" = empty) | keyHash? | string | Key hash of a registered secondary key. If omitted, the root key hash is used. |
| Optional overrides (keyHash for secondary keys, hookData) |
| key | type | description |
|---|
signature | string | Hex-encoded wrapped signature in Calibur format |
Source code
signUserOperation
signUserOperationWithSigner
Signs a UserOperation with an external signer (viem, ethers Signer, hardware wallet, MPC signer, etc.). Computes the UserOperation hash and wraps the returned signature in Calibur's format. By default signs with the root key.
- example.ts
- Param Types
- Return Type
example.ts
import { privateKeyToAccount } from "viem/accounts";
const viemAccount = privateKeyToAccount("0x...private-key");
userOperation.signature = await smartAccount.signUserOperationWithSigner(
userOperation,
async (hash) => viemAccount.sign({ hash: hash as `0x${string}` }),
11155111n
);
userOperation.signature = await smartAccount.signUserOperationWithSigner(
userOperation,
async (hash) => viemAccount.sign({ hash: hash as `0x${string}` }),
11155111n,
{ keyHash: "0x...registered-key-hash" }
);
| key | type | description |
|---|
userOperation | | key | type | description |
|---|
sender | string | The account making the operation | nonce | bigint | Anti-replay parameter (see Semi-abstracted Nonce Support) | factory | string | null | Account factory address, only for new accounts (null if account already exists) | factoryData | string | null | Data for account factory (null if account already exists) | callData | string | The data to pass to the sender during the main execution call | callGasLimit | bigint | The amount of gas to allocate the main execution call | verificationGasLimit | bigint | The amount of gas to allocate for the verification step | preVerificationGas | bigint | The amount of gas to pay for to compensate the bundler for pre-verification execution and calldata | maxFeePerGas | bigint | Maximum fee per gas (similar to EIP-1559 max_fee_per_gas) | maxPriorityFeePerGas | bigint | Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) | paymaster | string | null | Address of paymaster contract (null if account pays for itself) | paymasterVerificationGasLimit | bigint | null | The amount of gas to allocate for the paymaster verification step (null if no paymaster) | paymasterPostOpGasLimit | bigint | null | The amount of gas to allocate for the paymaster post-operation code (null if no paymaster) | paymasterData | string | null | Data for paymaster (null if no paymaster) | eip7702Auth | Authorization7702Hex | null | EIP-7702 authorization data for EOA delegation (null if not using EIP-7702) | signature | string | Data passed into the account to verify authorization. Resolves to '0x' when the user did not provide their signature yet |
| The user operation to sign |
signer | SignerFunction | Async signing function: (hash: string) => Promise<string>. Use this to integrate viem, ethers Signers, hardware wallets, or MPC signers. |
chainId | bigint | Chain ID for the target blockchain |
overrides? | | key | type | description |
|---|
hookData? | string | Hook data to append to the signature (default: "0x" = empty) | keyHash? | string | Key hash of a registered secondary key. If omitted, the root key hash is used. |
| Optional overrides (keyHash for secondary keys, hookData) |
| key | type | description |
|---|
signature | string | Hex-encoded wrapped signature in Calibur format |
Source code
signUserOperationWithSigner
Formats a WebAuthn (passkey) assertion into Calibur's signature format. Use this after getting an assertion from the browser's navigator.credentials.get() API. The challenge for the assertion should be the UserOperation hash.
- example.ts
- Param Types
- Return Type
example.ts
import { Calibur7702Account, WebAuthnSignatureData } from "abstractionkit";
const webAuthnSignatureData: WebAuthnSignatureData = {
authenticatorData: "0x...",
clientDataJSON: '{"type":"webauthn.get","challenge":"...","origin":"https://example.com"}',
challengeIndex: 36n,
typeIndex: 8n,
r: 0x...n,
s: 0x...n,
};
const keyHash = Calibur7702Account.getKeyHash(webAuthnKey);
userOperation.signature = smartAccount.formatWebAuthnSignature(
keyHash,
webAuthnSignatureData,
);
| key | type | description |
|---|
keyHash | string | The key hash of the registered passkey (from getKeyHash) |
webAuthnAuth | | key | type | description |
|---|
WebAuthnSignatureData | | key | type | description |
|---|
authenticatorData | string | Authenticator data bytes (hex string) | clientDataJSON | string | Client data JSON string (UTF-8) | challengeIndex | bigint | Index of the challenge in clientDataJSON | typeIndex | bigint | Index of the type field in clientDataJSON | r | bigint | ECDSA signature r component | s | bigint | ECDSA signature s component |
| WebAuthn assertion data matching the on-chain WebAuthn.WebAuthnAuth struct. Used when signing UserOperations with a passkey. |
| WebAuthn assertion data from the browser |
overrides? | | key | type | description |
|---|
hookData? | string | Hook data to append to the signature (default: "0x" = empty) | keyHash? | string | Key hash of a registered secondary key. If omitted, the root key hash is used. |
| Optional signature overrides (e.g., hookData) |
WebAuthnSignatureData
| key | type | description |
|---|
WebAuthnSignatureData | | key | type | description |
|---|
authenticatorData | string | Authenticator data bytes (hex string) | clientDataJSON | string | Client data JSON string (UTF-8) | challengeIndex | bigint | Index of the challenge in clientDataJSON | typeIndex | bigint | Index of the type field in clientDataJSON | r | bigint | ECDSA signature r component | s | bigint | ECDSA signature s component |
| WebAuthn assertion data matching the on-chain WebAuthn.WebAuthnAuth struct. Used when signing UserOperations with a passkey. |
| key | type | description |
|---|
signature | string | Hex-encoded wrapped signature in Calibur format |
Source code
formatWebAuthnSignature
sendUserOperation
Sends a signed UserOperation to the bundler for execution on-chain.
- example.ts
- Param Types
- Return Type
example.ts
const response = await smartAccount.sendUserOperation(
userOperation,
"https://api.candide.dev/public/v3/sepolia"
);
console.log("UserOperation hash:", response.userOperationHash);
const receipt = await response.included();
console.log("Transaction receipt:", receipt);
| key | type | description |
|---|
userOperation | | key | type | description |
|---|
sender | string | The account making the operation | nonce | bigint | Anti-replay parameter (see Semi-abstracted Nonce Support) | factory | string | null | Account factory address, only for new accounts (null if account already exists) | factoryData | string | null | Data for account factory (null if account already exists) | callData | string | The data to pass to the sender during the main execution call | callGasLimit | bigint | The amount of gas to allocate the main execution call | verificationGasLimit | bigint | The amount of gas to allocate for the verification step | preVerificationGas | bigint | The amount of gas to pay for to compensate the bundler for pre-verification execution and calldata | maxFeePerGas | bigint | Maximum fee per gas (similar to EIP-1559 max_fee_per_gas) | maxPriorityFeePerGas | bigint | Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) | paymaster | string | null | Address of paymaster contract (null if account pays for itself) | paymasterVerificationGasLimit | bigint | null | The amount of gas to allocate for the paymaster verification step (null if no paymaster) | paymasterPostOpGasLimit | bigint | null | The amount of gas to allocate for the paymaster post-operation code (null if no paymaster) | paymasterData | string | null | Data for paymaster (null if no paymaster) | eip7702Auth | Authorization7702Hex | null | EIP-7702 authorization data for EOA delegation (null if not using EIP-7702) | signature | string | Data passed into the account to verify authorization. Resolves to '0x' when the user did not provide their signature yet |
| The signed user operation to submit |
bundlerRpc | string | Bundler RPC endpoint to send the user operation to |
| key | type | description |
|---|
response | | key | type | description |
|---|
userOperationHash | string | The hash over the userOp (except signature), entryPoint and chainId | bundler | Bundler | The Bundler class | entrypointAddress | string | The entrypoint address where the useroperation got executed | included() | Promise<UserOperationReceiptResult | BundlerJsonRpcError> | Waits for the user operation to be included onchain and returns the user operation receipt on success, or the bundler error on failture |
| Response containing user operation hash and bundler details |
SendUseroperationResponse
| key | type | description |
|---|
userOperationHash | string | The hash over the userOp (except signature), entryPoint and chainId |
bundler | Bundler | The Bundler class |
entrypointAddress | string | The entrypoint address where the useroperation got executed |
included() | Promise<UserOperationReceiptResult | BundlerJsonRpcError> | Waits for the user operation to be included onchain and returns the user operation receipt on success, or the bundler error on failture |
BundlerJsonRpcError
| key | type | description |
|---|
code | number | Bundler RPC error code |
message | string | Bundler RPC error message description |
UserOperationReceiptResult
| key | type | description |
|---|
userOpHash | string | The hash of the user operation. |
entryPoint | string | The address of the entry point contract that processed the operation. |
sender | string | The address of the sender of the user operation. |
nonce | bigint | The nonce of the user operation. |
paymaster | string | The address of the paymaster that paid for the gas of the user operation. |
actualGasCost | bigint | The actual gas cost incurred for executing the user operation. |
actualGasUsed | bigint | The actual amount of gas used for the user operation. |
success | boolean | Indicates whether the user operation was successful. |
logs | string | The logs produced during the execution of the user operation. |
receipt | | key | type | description |
|---|
blockHash | string | The hash of the block in which the transaction was included. | blockNumber | bigint | The number of the block in which the transaction was included. | from | string | The address that initiated the transaction. | cumulativeGasUsed | bigint | The total amount of gas used in the block up to and including this transaction. | gasUsed | bigint | The amount of gas used by this transaction. | logs | string | Logs generated by the transaction. | logsBloom | string | The bloom filter for the logs generated by the transaction. | transactionHash | string | The unique hash of the transaction. | transactionIndex | bigint | The index of the transaction within the block. | effectiveGasPrice | bigint | The effective gas price for the transaction. This field is optional and may not be present in all receipts. |
| The detailed receipt of the user operation. |
Source code
sendUserOperation
Key Management Methods
createSecp256k1Key
Static method. Creates a secp256k1 key descriptor from an Ethereum address.
- example.ts
- Param Types
- Return Type
example.ts
import { Calibur7702Account } from "abstractionkit";
const secondaryAddress = "0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18";
const key = Calibur7702Account.createSecp256k1Key(secondaryAddress);
console.log(key);
| key | type | description |
|---|
address | string | The Ethereum address (EOA public address) |
| key | type | description |
|---|
key | | key | type | description |
|---|
CaliburKey | | key | type | description |
|---|
keyType | CaliburKeyType | The type of cryptographic key (P256, WebAuthnP256, or Secp256k1) | publicKey | string | ABI-encoded public key bytes (hex string) |
| A key registered on a Calibur account. |
| A CaliburKey with type Secp256k1 |
CaliburKey
| key | type | description |
|---|
CaliburKey | | key | type | description |
|---|
keyType | CaliburKeyType | The type of cryptographic key (P256, WebAuthnP256, or Secp256k1) | publicKey | string | ABI-encoded public key bytes (hex string) |
| A key registered on a Calibur account. |
Source code
createSecp256k1Key
createWebAuthnP256Key
Static method. Creates a WebAuthn P-256 key descriptor from public key coordinates. Use this when registering a passkey on the account.
- example.ts
- Param Types
- Return Type
example.ts
import { Calibur7702Account } from "abstractionkit";
const x = 0x1234...n;
const y = 0x5678...n;
const webAuthnKey = Calibur7702Account.createWebAuthnP256Key(x, y);
const keyHash = Calibur7702Account.getKeyHash(webAuthnKey);
console.log("Key hash:", keyHash);
| key | type | description |
|---|
x | bigint | The x coordinate of the P-256 public key |
y | bigint | The y coordinate of the P-256 public key |
| key | type | description |
|---|
key | | key | type | description |
|---|
CaliburKey | | key | type | description |
|---|
keyType | CaliburKeyType | The type of cryptographic key (P256, WebAuthnP256, or Secp256k1) | publicKey | string | ABI-encoded public key bytes (hex string) |
| A key registered on a Calibur account. |
| A CaliburKey with type WebAuthnP256 |
CaliburKey
| key | type | description |
|---|
CaliburKey | | key | type | description |
|---|
keyType | CaliburKeyType | The type of cryptographic key (P256, WebAuthnP256, or Secp256k1) | publicKey | string | ABI-encoded public key bytes (hex string) |
| A key registered on a Calibur account. |
Source code
createWebAuthnP256Key
createP256Key
Static method. Creates a raw P-256 (secp256r1) key descriptor from public key coordinates. Use this for non-WebAuthn P-256 keys.
- example.ts
- Param Types
- Return Type
example.ts
import { Calibur7702Account } from "abstractionkit";
const x = 0x1234...n;
const y = 0x5678...n;
const p256Key = Calibur7702Account.createP256Key(x, y);
const keyHash = Calibur7702Account.getKeyHash(p256Key);
console.log("Key hash:", keyHash);
| key | type | description |
|---|
x | bigint | The x coordinate of the P-256 public key |
y | bigint | The y coordinate of the P-256 public key |
| key | type | description |
|---|
key | | key | type | description |
|---|
CaliburKey | | key | type | description |
|---|
keyType | CaliburKeyType | The type of cryptographic key (P256, WebAuthnP256, or Secp256k1) | publicKey | string | ABI-encoded public key bytes (hex string) |
| A key registered on a Calibur account. |
| A CaliburKey with type P256 |
CaliburKey
| key | type | description |
|---|
CaliburKey | | key | type | description |
|---|
keyType | CaliburKeyType | The type of cryptographic key (P256, WebAuthnP256, or Secp256k1) | publicKey | string | ABI-encoded public key bytes (hex string) |
| A key registered on a Calibur account. |
Source code
createP256Key
getKeyHash
Static method. Computes the key hash for a Calibur key. Uses double hashing: keccak256(abi.encode(uint8 keyType, bytes32 keccak256(publicKey))).
- example.ts
- Param Types
- Return Type
example.ts
import { Calibur7702Account } from "abstractionkit";
const key = Calibur7702Account.createSecp256k1Key("0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18");
const keyHash = Calibur7702Account.getKeyHash(key);
console.log("Key hash:", keyHash);
| key | type | description |
|---|
key | | key | type | description |
|---|
CaliburKey | | key | type | description |
|---|
keyType | CaliburKeyType | The type of cryptographic key (P256, WebAuthnP256, or Secp256k1) | publicKey | string | ABI-encoded public key bytes (hex string) |
| A key registered on a Calibur account. |
| The key to compute the hash for |
CaliburKey
| key | type | description |
|---|
CaliburKey | | key | type | description |
|---|
keyType | CaliburKeyType | The type of cryptographic key (P256, WebAuthnP256, or Secp256k1) | publicKey | string | ABI-encoded public key bytes (hex string) |
| A key registered on a Calibur account. |
| key | type | description |
|---|
keyHash | string | The key hash as a bytes32 hex string |
Source code
getKeyHash
Static method. Creates meta-transactions to register a new key on the Calibur account. Returns two transactions ([register, update]) that must both be included in the same UserOperation. For safety, isAdmin is always forced to false.
- example.ts
- Param Types
- Return Type
example.ts
import { Calibur7702Account } from "abstractionkit";
const newKey = Calibur7702Account.createSecp256k1Key("0x742d35Cc6634C0532925a3b844Bc9e7595f2bD18");
const registerTxs = Calibur7702Account.createRegisterKeyMetaTransactions(
newKey,
{
expiration: Math.floor(Date.now() / 1000) + 30 * 24 * 60 * 60,
}
);
const userOperation = await smartAccount.createUserOperation(
registerTxs,
nodeRpc,
bundlerRpc,
);
| key | type | description |
|---|
key | | key | type | description |
|---|
CaliburKey | | key | type | description |
|---|
keyType | CaliburKeyType | The type of cryptographic key (P256, WebAuthnP256, or Secp256k1) | publicKey | string | ABI-encoded public key bytes (hex string) |
| A key registered on a Calibur account. |
| The key to register |
settings? | | key | type | description |
|---|
CaliburKeySettings | | key | type | description |
|---|
hook? | string | Hook contract address called during validation (zero address = no hook) | expiration? | number | Unix timestamp after which the key expires (0 = never) | isAdmin? | boolean | Whether the key has admin privileges |
| Settings for a key registered on a Calibur account. All fields are optional. |
| Optional key settings. isAdmin is always forced to false for safety. |
CaliburKeySettings
| key | type | description |
|---|
CaliburKeySettings | | key | type | description |
|---|
hook? | string | Hook contract address called during validation (zero address = no hook) | expiration? | number | Unix timestamp after which the key expires (0 = never) | isAdmin? | boolean | Whether the key has admin privileges |
| Settings for a key registered on a Calibur account. All fields are optional. |
| key | type | description |
|---|
transactions | [SimpleMetaTransaction, SimpleMetaTransaction] | A tuple of exactly two SimpleMetaTransactions: [registerTx, updateTx]. Both must be included in the same UserOperation. |
Source code
createRegisterKeyMetaTransactions
Static method. Creates a meta-transaction to revoke a key from the Calibur account. Only admin keys can execute revoke operations.
- example.ts
- Param Types
- Return Type
example.ts
import { Calibur7702Account } from "abstractionkit";
const keyHash = "0x...key-hash-to-revoke";
const revokeTx = Calibur7702Account.createRevokeKeyMetaTransaction(keyHash);
const userOperation = await smartAccount.createUserOperation(
[revokeTx],
nodeRpc,
bundlerRpc,
);
| key | type | description |
|---|
keyHash | string | The key hash of the key to revoke |
| key | type | description |
|---|
transaction | | key | type | description |
|---|
SimpleMetaTransaction | | key | type | description |
|---|
to | string | Target contract address for the transaction | value | bigint | Value transferred in the transaction (usually 0n for contract interactions) | data | string | The call data for the transaction |
| SimpleMetaTransaction is the type of transaction used with Calibur7702Account. |
| A SimpleMetaTransaction that calls revoke(bytes32) |
Source code
createRevokeKeyMetaTransaction
Static method. Creates a meta-transaction to update settings for a registered key. Only admin keys can execute update operations. Throws if isAdmin is set to true in the settings.
- example.ts
- Param Types
- Return Type
example.ts
import { Calibur7702Account } from "abstractionkit";
const keyHash = "0x...registered-key-hash";
const updateTx = Calibur7702Account.createUpdateKeySettingsMetaTransaction(
keyHash,
{
expiration: Math.floor(Date.now() / 1000) + 365 * 24 * 60 * 60,
}
);
const userOperation = await smartAccount.createUserOperation(
[updateTx],
nodeRpc,
bundlerRpc,
);
| key | type | description |
|---|
keyHash | string | The key hash of the key to update |
settings | | key | type | description |
|---|
CaliburKeySettings | | key | type | description |
|---|
hook? | string | Hook contract address called during validation (zero address = no hook) | expiration? | number | Unix timestamp after which the key expires (0 = never) | isAdmin? | boolean | Whether the key has admin privileges |
| Settings for a key registered on a Calibur account. All fields are optional. |
| New settings for the key. isAdmin must not be true (throws if true). |
CaliburKeySettings
| key | type | description |
|---|
CaliburKeySettings | | key | type | description |
|---|
hook? | string | Hook contract address called during validation (zero address = no hook) | expiration? | number | Unix timestamp after which the key expires (0 = never) | isAdmin? | boolean | Whether the key has admin privileges |
| Settings for a key registered on a Calibur account. All fields are optional. |
| key | type | description |
|---|
transaction | | key | type | description |
|---|
SimpleMetaTransaction | | key | type | description |
|---|
to | string | Target contract address for the transaction | value | bigint | Value transferred in the transaction (usually 0n for contract interactions) | data | string | The call data for the transaction |
| SimpleMetaTransaction is the type of transaction used with Calibur7702Account. |
| A SimpleMetaTransaction that calls update(bytes32, uint256) |
Source code
createUpdateKeySettingsMetaTransaction
packKeySettings
Static method. Packs key settings into a single uint256 value. Layout: (isAdmin << 200) | (expiration << 160) | hook.
- example.ts
- Param Types
- Return Type
example.ts
import { Calibur7702Account } from "abstractionkit";
const packed = Calibur7702Account.packKeySettings({
hook: "0x0000000000000000000000000000000000000000",
expiration: Math.floor(Date.now() / 1000) + 86400,
isAdmin: false,
});
console.log("Packed settings:", packed);
| key | type | description |
|---|
settings | | key | type | description |
|---|
CaliburKeySettings | | key | type | description |
|---|
hook? | string | Hook contract address called during validation (zero address = no hook) | expiration? | number | Unix timestamp after which the key expires (0 = never) | isAdmin? | boolean | Whether the key has admin privileges |
| Settings for a key registered on a Calibur account. All fields are optional. |
| The key settings to pack |
CaliburKeySettings
| key | type | description |
|---|
CaliburKeySettings | | key | type | description |
|---|
hook? | string | Hook contract address called during validation (zero address = no hook) | expiration? | number | Unix timestamp after which the key expires (0 = never) | isAdmin? | boolean | Whether the key has admin privileges |
| Settings for a key registered on a Calibur account. All fields are optional. |
| key | type | description |
|---|
packed | bigint | The packed settings as a single uint256 value. Layout: (isAdmin << 200) | (expiration << 160) | hook |
Source code
packKeySettings
unpackKeySettings
Static method. Unpacks a uint256 settings value into a CaliburKeySettingsResult object with all fields populated.
- example.ts
- Param Types
- Return Type
example.ts
import { Calibur7702Account } from "abstractionkit";
const packed = 0x...n;
const settings = Calibur7702Account.unpackKeySettings(packed);
console.log("Admin:", settings.isAdmin);
console.log("Expiration:", settings.expiration);
console.log("Hook:", settings.hook);
| key | type | description |
|---|
packed | bigint | The packed settings uint256 value to unpack |
| key | type | description |
|---|
settings | | key | type | description |
|---|
CaliburKeySettingsResult | | key | type | description |
|---|
hook | string | Hook contract address called during validation (zero address = no hook) | expiration | number | Unix timestamp after which the key expires (0 = never) | isAdmin | boolean | Whether the key has admin privileges |
| Concrete key settings returned from on-chain reads. All fields are required since the contract always returns concrete values. |
| Parsed key settings with all fields populated |
CaliburKeySettingsResult
| key | type | description |
|---|
CaliburKeySettingsResult | | key | type | description |
|---|
hook | string | Hook contract address called during validation (zero address = no hook) | expiration | number | Unix timestamp after which the key expires (0 = never) | isAdmin | boolean | Whether the key has admin privileges |
| Concrete key settings returned from on-chain reads. All fields are required since the contract always returns concrete values. |
Source code
unpackKeySettings
Read Methods
isKeyRegistered
Checks if a key is registered on this account by querying the on-chain isRegistered(bytes32) function.
- example.ts
- Param Types
- Return Type
example.ts
const keyHash = Calibur7702Account.getKeyHash(key);
const isRegistered = await smartAccount.isKeyRegistered(
"https://ethereum-sepolia-rpc.publicnode.com",
keyHash,
);
console.log("Key registered:", isRegistered);
| key | type | description |
|---|
providerRpc | string | JSON-RPC endpoint for blockchain queries |
keyHash | string | The key hash to check |
| key | type | description |
|---|
isRegistered | boolean | True if the key is registered on this account |
Source code
isKeyRegistered
getKeySettings
Gets the settings for a registered key. Returns a CaliburKeySettingsResult with hook address, expiration timestamp, and admin flag.
- example.ts
- Param Types
- Return Type
example.ts
const keyHash = Calibur7702Account.getKeyHash(key);
const settings = await smartAccount.getKeySettings(
"https://ethereum-sepolia-rpc.publicnode.com",
keyHash,
);
console.log("Admin:", settings.isAdmin);
console.log("Expiration:", settings.expiration === 0 ? "never" : new Date(settings.expiration * 1000).toISOString());
console.log("Hook:", settings.hook);
| key | type | description |
|---|
providerRpc | string | JSON-RPC endpoint for blockchain queries |
keyHash | string | The key hash to query settings for |
| key | type | description |
|---|
settings | | key | type | description |
|---|
CaliburKeySettingsResult | | key | type | description |
|---|
hook | string | Hook contract address called during validation (zero address = no hook) | expiration | number | Unix timestamp after which the key expires (0 = never) | isAdmin | boolean | Whether the key has admin privileges |
| Concrete key settings returned from on-chain reads. All fields are required since the contract always returns concrete values. |
| Parsed key settings with all fields populated |
CaliburKeySettingsResult
| key | type | description |
|---|
CaliburKeySettingsResult | | key | type | description |
|---|
hook | string | Hook contract address called during validation (zero address = no hook) | expiration | number | Unix timestamp after which the key expires (0 = never) | isAdmin | boolean | Whether the key has admin privileges |
| Concrete key settings returned from on-chain reads. All fields are required since the contract always returns concrete values. |
Source code
getKeySettings
getKey
Gets the full key data for a registered key, including the key type and ABI-encoded public key bytes.
- example.ts
- Param Types
- Return Type
example.ts
const keyHash = "0x...registered-key-hash";
const key = await smartAccount.getKey(
"https://ethereum-sepolia-rpc.publicnode.com",
keyHash,
);
console.log("Key type:", key.keyType);
console.log("Public key:", key.publicKey);
| key | type | description |
|---|
providerRpc | string | JSON-RPC endpoint for blockchain queries |
keyHash | string | The key hash to query |
| key | type | description |
|---|
key | | key | type | description |
|---|
CaliburKey | | key | type | description |
|---|
keyType | CaliburKeyType | The type of cryptographic key (P256, WebAuthnP256, or Secp256k1) | publicKey | string | ABI-encoded public key bytes (hex string) |
| A key registered on a Calibur account. |
| The CaliburKey associated with the given key hash |
CaliburKey
| key | type | description |
|---|
CaliburKey | | key | type | description |
|---|
keyType | CaliburKeyType | The type of cryptographic key (P256, WebAuthnP256, or Secp256k1) | publicKey | string | ABI-encoded public key bytes (hex string) |
| A key registered on a Calibur account. |
Source code
getKey
listKeys
Lists all keys registered on this account. Iterates keyCount() and keyAt(i) to enumerate all keys.
- example.ts
- Param Types
- Return Type
example.ts
const keys = await smartAccount.listKeys(
"https://ethereum-sepolia-rpc.publicnode.com",
);
for (const key of keys) {
const keyHash = Calibur7702Account.getKeyHash(key);
const settings = await smartAccount.getKeySettings(nodeRpc, keyHash);
console.log("Key:", keyHash.slice(0, 18) + "...");
console.log(" Type:", key.keyType);
console.log(" Admin:", settings.isAdmin);
}
| key | type | description |
|---|
providerRpc | string | JSON-RPC endpoint for blockchain queries |
| key | type | description |
|---|
keys | CaliburKey[] | Array of all registered CaliburKeys on this account |
Source code
listKeys
isDelegated
Checks if the EOA is delegated to this account's Calibur singleton. Returns true only when delegated to the account's delegateeAddress, false if not delegated or delegated to a different singleton.
- example.ts
- Param Types
- Return Type
example.ts
const isDelegated = await smartAccount.isDelegated(
"https://ethereum-sepolia-rpc.publicnode.com"
);
if (isDelegated) {
console.log("EOA is delegated to the Calibur singleton");
} else {
console.log("EOA is not delegated. Include eip7702Auth in createUserOperation.");
}
| key | type | description |
|---|
providerRpc | string | JSON-RPC endpoint for blockchain queries |
| key | type | description |
|---|
isDelegated | boolean | True if the EOA is delegated to this account's Calibur singleton, false otherwise |
Source code
isDelegated
getNonce
Gets the account nonce from the EntryPoint. Supports parallel nonce channels via the optional sequenceKey parameter.
- example.ts
- Param Types
- Return Type
example.ts
const nonce = await smartAccount.getNonce(
"https://ethereum-sepolia-rpc.publicnode.com"
);
console.log("Nonce:", nonce);
const parallelNonce = await smartAccount.getNonce(
"https://ethereum-sepolia-rpc.publicnode.com",
1
);
| key | type | description |
|---|
providerRpc | string | JSON-RPC endpoint for blockchain queries |
sequenceKey? | number | Optional sequence key for parallel nonce channels (default: 0) |
| key | type | description |
|---|
nonce | bigint | The fully constructed nonce (sequenceKey << 64) | seq |
Source code
getNonce
Utility Methods
createAccountCallData
Static method. Encodes calldata for executeUserOp with BatchedCall format. All transactions (even single ones) go through the same BatchedCall path.
- example.ts
- Param Types
- Return Type
example.ts
import { Calibur7702Account } from "abstractionkit";
const transactions = [
{ to: "0x...", value: 0n, data: "0x..." },
{ to: "0x...", value: 1000000000000000000n, data: "0x" },
];
const callData = Calibur7702Account.createAccountCallData(transactions);
const callDataNoRevert = Calibur7702Account.createAccountCallData(transactions, false);
| key | type | description |
|---|
transactions | SimpleMetaTransaction[] | One or more transactions to encode into BatchedCall format |
revertOnFailure? | boolean | Whether to revert the entire batch if any call fails (default: true) |
| key | type | description |
|---|
callData | string | Encoded calldata for the executeUserOp function |
Source code
createAccountCallData
wrapSignature
Static method. Wraps a raw ECDSA signature in Calibur's signature format: abi.encode(bytes32 keyHash, bytes signature, bytes hookData). Use this when signing externally (e.g., with viem, hardware wallet, MPC) to avoid manually ABI-encoding the wrapped signature.
- example.ts
- Param Types
- Return Type
example.ts
import { Calibur7702Account } from "abstractionkit";
const ROOT_KEY_HASH = "0x0000000000000000000000000000000000000000000000000000000000000000";
const rawEcdsaSignature = "0x...";
const wrappedSignature = Calibur7702Account.wrapSignature(
ROOT_KEY_HASH,
rawEcdsaSignature,
);
const wrappedWithHook = Calibur7702Account.wrapSignature(
"0x...secondary-key-hash",
rawEcdsaSignature,
"0x...hook-data",
);
| key | type | description |
|---|
keyHash | string | The key hash (use 0x00...00 for the EOA root key) |
rawSignature | string | The raw ECDSA signature (65 bytes, hex-encoded) |
hookData? | string | Optional hook data (default: "0x") |
| key | type | description |
|---|
signature | string | Hex-encoded wrapped signature ready for userOp.signature |
Source code
wrapSignature
createDummyWebAuthnSignature
Static method. Creates a dummy WebAuthn signature for gas estimation when signing with a passkey. The key hash must correspond to an actually registered key on the account, otherwise the contract's validateUserOp will revert.
- example.ts
- Param Types
- Return Type
example.ts
import { Calibur7702Account } from "abstractionkit";
const keyHash = Calibur7702Account.getKeyHash(webAuthnKey);
const dummySignature = Calibur7702Account.createDummyWebAuthnSignature(keyHash);
const userOperation = await smartAccount.createUserOperation(
transactions,
nodeRpc,
bundlerRpc,
{ dummySignature },
);
| key | type | description |
|---|
keyHash | string | The key hash of a registered passkey (from getKeyHash). Must correspond to an actually registered key. |
| key | type | description |
|---|
signature | string | A dummy signature suitable for passing as dummySignature override during gas estimation |
Source code
createDummyWebAuthnSignature
getUserOperationHash
Computes the UserOperation hash for this account's EntryPoint. Convenience wrapper that automatically uses this account's EntryPoint address.
- example.ts
- Param Types
- Return Type
example.ts
const userOpHash = smartAccount.getUserOperationHash(
userOperation,
11155111n
);
console.log("UserOperation hash:", userOpHash);
| key | type | description |
|---|
userOperation | | key | type | description |
|---|
sender | string | The account making the operation | nonce | bigint | Anti-replay parameter (see Semi-abstracted Nonce Support) | factory | string | null | Account factory address, only for new accounts (null if account already exists) | factoryData | string | null | Data for account factory (null if account already exists) | callData | string | The data to pass to the sender during the main execution call | callGasLimit | bigint | The amount of gas to allocate the main execution call | verificationGasLimit | bigint | The amount of gas to allocate for the verification step | preVerificationGas | bigint | The amount of gas to pay for to compensate the bundler for pre-verification execution and calldata | maxFeePerGas | bigint | Maximum fee per gas (similar to EIP-1559 max_fee_per_gas) | maxPriorityFeePerGas | bigint | Maximum priority fee per gas (similar to EIP-1559 max_priority_fee_per_gas) | paymaster | string | null | Address of paymaster contract (null if account pays for itself) | paymasterVerificationGasLimit | bigint | null | The amount of gas to allocate for the paymaster verification step (null if no paymaster) | paymasterPostOpGasLimit | bigint | null | The amount of gas to allocate for the paymaster post-operation code (null if no paymaster) | paymasterData | string | null | Data for paymaster (null if no paymaster) | eip7702Auth | Authorization7702Hex | null | EIP-7702 authorization data for EOA delegation (null if not using EIP-7702) | signature | string | Data passed into the account to verify authorization. Resolves to '0x' when the user did not provide their signature yet |
| The UserOperation to hash |
chainId | bigint | Target chain ID |
| key | type | description |
|---|
hash | string | The UserOperation hash as a hex string |
Source code
getUserOperationHash
prependTokenPaymasterApproveToCallData
Prepends a token approve call to existing calldata for a token paymaster. Decodes the existing BatchedCall, prepends an ERC-20 approve transaction, and re-encodes.
- example.ts
- Param Types
- Return Type
example.ts
const callDataWithApproval = smartAccount.prependTokenPaymasterApproveToCallData(
userOperation.callData,
"0xa0b86a33e6b3e96bb24b8e4b28e80e0fb3a4f4b6",
"0x...",
1000000n
);
userOperation.callData = callDataWithApproval;
| key | type | description |
|---|
callData | string | Existing encoded calldata (executeUserOp format) |
tokenAddress | string | Address of the ERC-20 token contract to approve |
paymasterAddress | string | Address of the paymaster contract to approve as spender |
approveAmount | bigint | Amount of tokens to approve for the paymaster |
| key | type | description |
|---|
callData | string | Re-encoded calldata with the token approval prepended |
Source code
prependTokenPaymasterApproveToCallData
Static method. Creates a meta-transaction to invalidate nonces up to a given value. All nonces below the specified value become invalid, preventing replay of previously signed but unsubmitted UserOperations.
- example.ts
- Param Types
- Return Type
example.ts
import { Calibur7702Account } from "abstractionkit";
const invalidateTx = Calibur7702Account.createInvalidateNonceMetaTransaction(100n);
const userOperation = await smartAccount.createUserOperation(
[invalidateTx],
nodeRpc,
bundlerRpc,
);
| key | type | description |
|---|
newNonce | bigint | The new nonce value (all nonces below this are invalidated) |
| key | type | description |
|---|
transaction | | key | type | description |
|---|
SimpleMetaTransaction | | key | type | description |
|---|
to | string | Target contract address for the transaction | value | bigint | Value transferred in the transaction (usually 0n for contract interactions) | data | string | The call data for the transaction |
| SimpleMetaTransaction is the type of transaction used with Calibur7702Account. |
| A SimpleMetaTransaction that calls invalidateNonce(uint256) |
Source code
createInvalidateNonceMetaTransaction