Skip to content

Repository files navigation

@furlpay/account-kit

TypeScript Ethereum

npm license

Programmatic access to Furlpay's on-chain account layer: deploy Safe smart accounts from passkey (WebAuthn) signers, configure gas-sponsoring Paymasters, and manage time-locked pre-authorization escrow holds — the primitive that makes hotel and fuel pre-auths work on self-custodial cards.

  • ERC-4337 account abstraction with passkey owners (no seed phrases).
  • Paymaster configuration: sponsor gas outright or bill it in USDC.
  • Time-locked escrow holds that lock the exact pre-auth amount instead of freezing the whole account, and auto-release if unclaimed.
  • Zero runtime dependencies. Node 18+. TypeScript types included.

Installation

npm install @furlpay/account-kit

Quickstart

import { AccountKit } from "@furlpay/account-kit";

const kit = new AccountKit({ chain: "base" });

// 1. Deploy a Safe owned by a passkey
const safe = await kit.deploySafe(
  [{ credentialId: "...", publicKey: "..." }], // WebAuthn signer(s)
  1                                             // threshold
);

// 2. Sponsor its gas in USDC
await kit.configurePaymaster(safe.address, { mode: "erc20", feeToken: "USDC" });

// 3. Place a pre-authorization hold (for example a hotel deposit)
const hold = await kit.escrow.create(safe.address, "0xMerchant", 150);

API reference

new AccountKit(options)

Option Type Default Description
chain "ethereum" | "polygon" | "base" | "arbitrum" | "gnosis" "base" Target network.
mock boolean auto Run without RPC credentials (deterministic responses) — the default until keys are configured.

deploySafe(signers, threshold?)

Deploys an ERC-4337 Safe smart account owned by the given passkey signers. Returns a SafeAccount with the deployed address, owners, threshold, and enabled modules.

configurePaymaster(safeAddress, config)

Attaches a Paymaster policy to the account. config.mode is "sponsor" (platform pays gas) or "erc20" (gas billed in config.feeToken, for example USDC), so users never need the native token.

escrow

Time-locked pre-authorization holds:

Method Description
escrow.create(safe, merchant, amount) Lock amount for merchant; returns an EscrowHold (status held, expiry timestamp).
escrow.capture(hold, finalAmount) Merchant captures up to the held amount; the remainder returns to the Safe.
escrow.release(hold) Release the full hold back to the Safe. Unclaimed holds auto-release at expiry.

Types

PasskeySigner, SafeAccount, PaymasterConfig, EscrowHold, AccountKitOptions, and Chain are exported for downstream typing.

Mock mode

Without RPC credentials the kit runs in deterministic mock mode — the full API surface works offline with realistic shapes, which is what the Furlpay sandbox uses. Live deployments inject their RPC/bundler configuration; the interface is identical.

Related

Contributing and security

See CONTRIBUTING.md. Report vulnerabilities privately per SECURITY.md.

License

MIT

About

Safe/ERC-4337 smart accounts from passkeys, paymaster config, and time-locked pre-authorization escrow.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages