Skip to main content

Connect dApp

Please start with this section when your application needs to interact with the UKey Wallet through the wallet provider instead of calling the hardware SDK directly. The Provider layer covers EVM requests to dApps and provides connection and signing capabilities for multiple non-EVM chains.

Pick a Path

OptionBest forStack
RainbowKitReact apps that want the fastest path to a mature wallet pickerReact
Web3ModalFront-end projects that need a wallet modal usable across stacksReact / Vue / JS
Web3-OnboardTeams that want deeper control over the wallet connection flowReact / Vue / JS
WagmiCustom wallet UIs built around React hooksReact
Provider APIDirect Provider access without a UI kit dependencyAny stack
💡
Quick tip

If you want to write less UI for React projects, you can choose RainbowKit first; Vue or native JS projects are usually more suitable for Web3Modal or Web3-Onboard.


Get Going

RainbowKit (React)

npm install @rainbow-me/rainbowkit wagmi viem @tanstack/react-query
import "@rainbow-me/rainbowkit/styles.css";
import {
getDefaultConfig,
RainbowKitProvider,
ConnectButton,
} from "@rainbow-me/rainbowkit";
import { WagmiProvider } from "wagmi";
import { mainnet } from "wagmi/chains";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";

const config = getDefaultConfig({
appName: "UKey Wallet Sample",
projectId: "YOUR_WALLETCONNECT_PROJECT_ID", // request this from cloud.walletconnect.com
chains: [mainnet],
});

export default function RainbowKitDemoApp() {
return (
<WagmiProvider config={config}>
<QueryClientProvider client={new QueryClient()}>
<RainbowKitProvider>
<ConnectButton />
</RainbowKitProvider>
</QueryClientProvider>
</WagmiProvider>
);
}

Complete Guide

Provider API (no dependencies)

// Ask installed wallets via EIP-6963 to announce their providers proactively.
const providers = [];
window.addEventListener("eip6963:announceProvider", (e) =>
providers.push(e.detail),
);
window.dispatchEvent(new Event("eip6963:requestProvider"));

// Pick the UKey Wallet provider, then request an account.
const ukey = providers.find((p) => p.info.rdns === "so.ukey.app.wallet");
const accounts = await ukey.provider.request({
method: "eth_requestAccounts",
});

Complete Guide


Find UKey Wallet

FieldSetting
EIP-6963 rdnsso.ukey.app.wallet
Providerwindow.$ukey.ethereum

Chain List

EVM: Ethereum, Polygon, BSC, Arbitrum, Optimism, Base, and other EVM compatible networks.

Non-EVM: Bitcoin, Solana, Cosmos, Aptos, Sui, TON, TRON, Polkadot, Cardano, NEAR etc.

View all Provider APIs