Skip to content
LogoLogo

Accounts

Tempo.ts provides Viem-compatible Local Accounts that support multiple signature schemes including secp256k1, P256, and WebAuthn (passkeys).

These accounts are fully backwards compatible with Viem APIs, meaning you can use them any Viem Action that accepts an account.

import { ,  } from 'viem'
import { ,  } from 'viem/tempo'
import {  } from 'viem/chains'
 
// Create a passkey account
const  = await .createCredential({ : 'Example' })
const  = .fromWebAuthnP256()
 
const  = ({
  : ,
  : (),
})
 
// Use with Viem APIs
const  = await .sendTransactionSync({
  ,
  : '0xcafebabe',
  : '0xdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef',
})

Account Types

TypeDescription
fromSecp256k1Create an account from a secp256k1 private key (standard Ethereum accounts)
fromWebAuthnP256Create an account from a WebAuthn credential (passkeys)
fromWebCryptoP256Create an account from a WebCrypto P256 key pair
fromP256Create an account from a P256 private key