Skip to main content

Wallet Adapter Plugin

Use the standard Aptos Wallet Adapter to connect Watchee from any dApp.

When to Use This

watchee-minikit@watchee/wallet-adapter-plugin
Use caseMini-apps that run exclusively inside WatcheeStandard dApps that work everywhere
Authminikit.walletAuth() — automaticuseWallet().connect("Watchee") — user-initiated
ScopeFull MiniKit API (payments, social, haptics)Wallet only (connect, sign, submit)
Works outside WatcheeNoYes (deep link fallback)

If your app only runs inside Watchee, use MiniKit. If you want your dApp to support Watchee alongside other Aptos wallets, use this plugin.

Installation

npm install @watchee/wallet-adapter-plugin

Peer dependency: @aptos-labs/ts-sdk (>= 1.33.0). If you already use the Aptos Wallet Adapter, you have this.

Setup

Add WatcheeWallet to the Wallet Adapter Provider:

import { AptosWalletAdapterProvider } from "@aptos-labs/wallet-adapter-react";
import { WatcheeWallet } from "@watchee/wallet-adapter-plugin";
import { Network } from "@aptos-labs/ts-sdk";

function App() {
const wallets = [
new WatcheeWallet({ network: Network.MAINNET }),
];

return (
<AptosWalletAdapterProvider
plugins={wallets}
autoConnect={true}
dappConfig={{ network: Network.MAINNET }}
>
{/* Your app */}
</AptosWalletAdapterProvider>
);
}

Connect & Disconnect

Use the standard useWallet hook from @aptos-labs/wallet-adapter-react:

import { useWallet } from "@aptos-labs/wallet-adapter-react";

function ConnectButton() {
const { connect, disconnect, account, connected } = useWallet();

if (connected) {
return (
<div>
<p>Connected: {account?.address}</p>
<button onClick={disconnect}>Disconnect</button>
</div>
);
}

return <button onClick={() => connect("Watchee")}>Connect Watchee</button>;
}

Sign Transactions

import { useWallet } from "@aptos-labs/wallet-adapter-react";

function TransferAPT() {
const { signAndSubmitTransaction } = useWallet();

const handleTransfer = async () => {
const result = await signAndSubmitTransaction({
data: {
function: "0x1::coin::transfer",
typeArguments: ["0x1::aptos_coin::AptosCoin"],
functionArguments: ["0xRecipientAddress", 100_000_000], // 1 APT
},
});
console.log("Transaction hash:", result.hash);
};

return <button onClick={handleTransfer}>Send 1 APT</button>;
}

Sign Messages

const { signMessage } = useWallet();

const handleVerify = async () => {
const result = await signMessage({
message: "Verify account ownership",
nonce: Date.now().toString(),
});
console.log("Signature:", result.signature);
// Send signature to your backend for verification
};

How It Works

Inside Watchee (Mini-Apps)

When your dApp runs inside the Watchee app, the plugin detects window.WatcheeSDK (injected by the native bridge) and uses it directly. The user is already authenticated, so connect() resolves immediately with the active account.

Outside Watchee (Standalone dApps)

When your dApp runs in a regular browser, clicking "Connect Watchee" opens the Watchee app via deep link (watcheetv://wallet/connect). If the Watchee app is not installed, the user is redirected to the Watchee download page.

Configuration

interface WatcheeWalletConfig {
/** Target Aptos network. Defaults to Network.MAINNET. */
network?: Network;
}

Pass to the constructor:

new WatcheeWallet({ network: Network.TESTNET })

AIP-62 Features

The plugin implements all required AIP-62 Wallet Standard features:

FeatureVersionDescription
aptos:connect1.0.0Connect wallet
aptos:disconnect1.0.0Disconnect wallet
aptos:account1.0.0Get connected account info
aptos:network1.0.0Get current network
aptos:signTransaction1.0.0Sign a raw transaction
aptos:signMessage1.0.0Sign an arbitrary message
aptos:onAccountChange1.0.0Listen for account changes
aptos:onNetworkChange1.0.0Listen for network changes

Best Practices

  • Enable autoConnect: Set autoConnect={true} on the provider so returning users reconnect automatically.
  • Handle errors: Wrap all wallet calls in try/catch — users can cancel prompts or lose network.
  • Match networks: Ensure the network you pass to WatcheeWallet matches your dappConfig.network.
  • Test both paths: Verify your dApp works both inside the Watchee app (native bridge) and in a regular browser (deep link fallback).