Viem Support

Passport Protocol uses an EIP 1193 compatible interface for signing messages, transaction and typed data. With this we've created a wallet client, which acts as a JSON-RPC account which allows you to leverage all of Viem's features.

1. Install the packages

npm install viem @0xpass/passport-viem

2. Choose your auth method

Passkeys

npm install @0xpass/webauthn-signer

import { WebauthnSigner } from "@0xpass/webauthn-signer";

const signer = new WebauthnSigner({
      rpId: window.location.hostname,
      rpName: "rpName",
});

DOA

npm install @0xpass/key-signer

In order to generate private key for DOA signer, follow Generating DOA Keys

3. Create WalletClient

To create a wallet client, you'll need to have a registered and authenticated account, to setup a WalletClient with each signer you can follow the examples below.

Passkey Signer

Developer Owned Auth Signer

4. Use Viem as usual

Here's an example of the viem wallet client created by Passport sending a transaction.

Last updated