Management API Reference

Ecosystem wallet

Integrating with ecosystem wallet connectors

Integrating apps do not need to use Openfort themselves to integrate ecosystem wallets; instead, they can import a your ecosystem SDK directly to configure with their wallet connector library. Simply follow the instructions below to get set up!

ecosystem-rainbow-kit

1. Install dependencies#

Install the @ecosystem/wallet SDK and its peer dependencies:

CAREFUL: @ecosystem/wallet doesn't exist

To make these instructions concrete, this will continue with the sample ecosystem wallet called ... Ecosystem Wallet. For the sake of this guide, available in package form as @ecosystem/wallet.


_10
npm i @ecosystem/wallet @rainbow-me/rainbowkit @tanstack/react-query

2. Create the connector#

config.ts

_10
import {EcosystemWallet} from '@ecosystem/wallet';
_10
_10
const CLIENT_ID = 'pk_test_...';
_10
export const identityInstance = new EcosystemWallet({
_10
clientId: CLIENT_ID,
_10
redirectUri: '/redirect',
_10
logoutRedirectUri: '/logout',
_10
audience: 'platform_api',
_10
scope: 'openid offline_access email transact',
_10
});

3. Wrap app with providers#

At the highest level of your applications, wrap the component with the wagmi, QueryClient, and RainbowKit providers. Pass the configuration you created in step 2 to the wagmi provider.

All of ecosystem wallets can export a standard EIP-1193 provider object. This allows your app to request signatures and transactions from the wallet, using familiar JSON-RPC requests like personal_sign or eth_sendTransaction.

EIP-1193, also known as the Ethereum JavaScript API, is a standardized interface for how applications can request information, signatures, and transactions from a connected wallet.

To get a wallet's EIP-1193 provider, use the getEthereumProvider method:

_app.tsx
wagmiConfig.ts

_25
import {QueryClient, QueryClientProvider} from '@tanstack/react-query';
_25
import {WagmiProvider} from 'wagmi';
_25
import {useEffect} from 'react';
_25
import {config} from './wagmiConfig';
_25
import {identityInstance} from './config';
_25
_25
const queryClient = new QueryClient();
_25
_25
export default function App() {
_25
useEffect(() => {
_25
if (!identityInstance) return;
_25
identityInstance.getEthereumProvider({
_25
policyId: 'pol_...',
_25
rpcUrl: 'https://rpc.ankr.com/polygon_amoy',
_25
});
_25
}, []);
_25
_25
return (
_25
<WagmiProvider config={config}>
_25
<QueryClientProvider client={queryClient}>
_25
<Component {...pageProps} />
_25
</QueryClientProvider>
_25
</WagmiProvider>
_25
);
_25
}

4. Use the ConnectButton#

Import the ConnectButton and use to prompt users to connect to their provider ecosystem wallet.


_11
import {ConnectButton} from '@rainbow-me/rainbowkit';
_11
_11
function Page() {
_11
return (
_11
<div>
_11
<h1> My app </h1>
_11
...
_11
<ConnectButton />
_11
</div>
_11
);
_11
}

Thats it! You can now use any wagmi hook in your application to interact with the connected wallet. When users connect and transact with their wallet, Openfort will open a pop-up for users to authorize any actions.