skills/skills.volces.com/ts-sdk-wallet-adapter

ts-sdk-wallet-adapter

Installation
SKILL.md

TypeScript SDK: Wallet Adapter (React)

Purpose

Guide wallet connection and frontend transaction submission in React using @aptos-labs/wallet-adapter-react. End users sign transactions via their browser wallet (Petra, Nightly, etc.) — never via raw private keys.

ALWAYS

  1. Use @aptos-labs/wallet-adapter-react for frontend wallet integration — this is the standard React adapter.
  2. Wrap your app root with AptosWalletAdapterProvider — all useWallet() calls require this context.
  3. Use useWallet() hook to access wallet functions in React components.
  4. Use the wallet adapter's signAndSubmitTransaction (from useWallet()) in frontend — NOT the SDK's direct aptos.signAndSubmitTransaction.
  5. Always call aptos.waitForTransaction({ transactionHash }) after submit — the wallet returns when the tx is accepted, not committed.

NEVER

Installs
2
First Seen
Apr 24, 2026