Management API Reference

Passkey (Webauthn) signer

Self-custodial wallet secured by Passkeys (Webauthn)

If you want to check out a live sample app using Passkey signers, check out the live demo with RapidSafe.

Install the required dependencies#

In this sample, we'll be using the Safe smart account, with Safe7579 adapter to add support for Passkeys and session keys.

Terminal

_10
npm install @openfort/ecosystem-js permissionless wagmi viem@2.x @tanstack/react-query

  • TypeScript is optional, but highly recommended.

Implementation#

Please refer to the complete code for the Wallet UI if you want to see the full implementation of the Passkey signer.

index.tsx
App.tsx
Loading.tsx
lib/Wagmi.ts
lib/Query.ts

_50
import React from 'react';
_50
import ReactDOM from 'react-dom/client';
_50
import './index.css';
_50
import App from './App';
_50
import { BrowserRouter, useNavigate } from 'react-router-dom';
_50
import { WagmiProvider } from 'wagmi';
_50
import { QueryClientProvider } from '@tanstack/react-query';
_50
_50
import * as Wagmi from './lib/Wagmi';
_50
import * as Query from './lib/Query'
_50
import { EcosystemProvider } from '@openfort/ecosystem-js/react';
_50
_50
const ProtectedRoute = ({ component, ...args }: any) => {
_50
const Component = withAuthenticationRequired(component, {
_50
onRedirecting: () => <Loading />,
_50
});
_50
return <Component {...args} />;
_50
};
_50
_50
export default function Providers({children}: {children: React.ReactNode}) {
_50
const nav = useNavigate()
_50
return (
_50
<EcosystemProvider
_50
appName='RapidSafe'
_50
navigateTo={(appState) => {
_50
nav({
_50
pathname: appState?.to,
_50
search: appState?.search
_50
})
_50
}}
_50
theme='midnight'
_50
logoUrl='https://purple-magnificent-bat-958.mypinata.cloud/ipfs/QmfQrh2BiCzugFauYF9Weu9SFddsVh9qV82uw43cxH8UDV'
_50
>
_50
<WagmiProvider config={Wagmi.config}>
_50
<QueryClientProvider
_50
client={Query.client}
_50
>
_50
<RapidsafeProvider
_50
debugMode={true}
_50
onRedirectCallback={(appState) => {
_50
return nav(appState?.returnTo || window.location.pathname);
_50
}}
_50
>
_50
{children}
_50
</RapidsafeProvider>
_50
</QueryClientProvider>
_50
</WagmiProvider>
_50
</EcosystemProvider>
_50
);
_50
}

Components:

Configure Supported Chains#

As you can see above, its required that you configure Wagmi and the chains you plan on enabling for your wallet.

Note that, to enable transaction simulation through asset changes, the Ecosystem SDK internally requires the eth_simulateV1 JSON-RPC method, so you will need to provide an RPC endpoint that supports this method (or disable simulation through the EcosystemProvider using disableTransactionSimulation).

Sample#