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
- Use
@aptos-labs/wallet-adapter-reactfor frontend wallet integration — this is the standard React adapter. - Wrap your app root with
AptosWalletAdapterProvider— alluseWallet()calls require this context. - Use
useWallet()hook to access wallet functions in React components. - Use the wallet adapter's
signAndSubmitTransaction(fromuseWallet()) in frontend — NOT the SDK's directaptos.signAndSubmitTransaction. - Always call
aptos.waitForTransaction({ transactionHash })after submit — the wallet returns when the tx is accepted, not committed.