@coti-io/coti-wallet-plugin
v0.2.9
Published
COTI Wallet Plugin — high-level abstraction for Private Token (pToken) operations across EIP-1193 wallets
Maintainers
Readme
@coti-io/coti-wallet-plugin
React library for adding COTI private token (pToken) support to wagmi v2 + RainbowKit dApps.
Important: This is a plugin for existing dApps and wallets, not a standalone wallet application. It provides React hooks, multi-wallet support, and token detection for any EIP-1193 wallet.
Documentation
Full documentation lives in the COTI documentation repository:
| Topic | Link | | --- | --- | | Overview and quickstart | COTI Wallet Plugin | | Integration guide | Integration Guide | | Configuration | Configuration | | API reference | API Reference | | AES key onboarding | AES Key Onboarding | | Onboard modal theming | Onboard Modal Theming | | Example app | Example App |
Installation
npm install @coti-io/coti-wallet-pluginPeer dependencies
npm install react react-dom ethers viem @coti-io/coti-sdk-typescript @metamask/providers @rainbow-me/rainbowkit wagmi @tanstack/react-queryThis release is validated with @rainbow-me/[email protected] and [email protected].
Quickstart
import {
PrivacyBridgeProvider,
WagmiRainbowKitProvider,
usePrivateUnlock,
} from '@coti-io/coti-wallet-plugin';
export function Root() {
return (
<WagmiRainbowKitProvider walletConnectProjectId={walletConnectProjectId}>
<PrivacyBridgeProvider>
<App />
</PrivacyBridgeProvider>
</WagmiRainbowKitProvider>
);
}See the integration guide for provider setup, unlock flow, and private operations.
Development
npm run build # dist/index.js (CJS) + dist/index.mjs (ESM) + dist/index.d.ts
npm run typecheck # TypeScript check
npm run test # Vitest suite
npm run lint # ESLintExample app
cd examples && npm run devSee Example App for setup details.
License
Apache 2.0
