use-wallet
3
总安装量
3
周安装量
#55525
全站排名
安装命令
npx skills add https://github.com/txnlab/skills --skill use-wallet
Agent 安装分布
amp
3
gemini-cli
3
claude-code
3
github-copilot
3
codex
3
kimi-cli
3
Skill 文档
@txnlab/use-wallet
A framework-agnostic Algorand wallet integration library (v4.x) with reactive adapters for React, Vue, SolidJS, and Svelte. Requires algosdk v3.
Packages
| Package | Purpose |
|---|---|
@txnlab/use-wallet |
Core library (framework-agnostic) |
@txnlab/use-wallet-react |
React adapter (hooks + WalletProvider) |
@txnlab/use-wallet-vue |
Vue adapter (composables + plugin) |
@txnlab/use-wallet-solid |
SolidJS adapter (primitives + WalletProvider) |
@txnlab/use-wallet-svelte |
Svelte adapter (primitives + context) |
@txnlab/use-wallet-ui-react |
React UI components (WalletButton, menus) |
Routing Guide
Read the reference file that matches the developer’s task:
Setup & Configuration
- Getting started (any framework): references/getting-started.md â Installation, WalletManager config, supported wallets table, webpack fallbacks
Framework-Specific Integration
- Vanilla JS/TS (no framework): references/vanilla.md â WalletManager direct usage, BaseWallet subscribe, no provider wrapper
- React: references/react.md â WalletProvider, useWallet, useNetwork hooks
- Vue: references/vue.md â WalletManagerPlugin, useWallet/useNetwork composables
- SolidJS: references/solid.md â WalletProvider, useWallet/useNetwork primitives (signals)
- Svelte: references/svelte.md â useWalletContext, useWallet/useNetwork primitives (.current)
Features & Guides
- Signing transactions: references/signing-transactions.md â signTransactions, transactionSigner with ATC, AlgoKit Utils
- Signing data (ARC-60/SIWA): references/signing-data.md â Sign In With Algorand, Lute wallet, verification
- Network switching & custom networks: references/network-configuration.md â NetworkConfigBuilder, custom AVM networks (Voi), runtime node config, useNetwork
- Pre-built UI components: references/wallet-ui.md â @txnlab/use-wallet-ui-react: WalletButton, menus, theming, Tailwind setup
- Testing: references/testing.md â Mnemonic wallet provider for dev/testing/E2E
- Custom wallet provider: references/custom-provider.md â Implementing CustomProvider interface
Reference
- Full API reference: references/api-reference.md â WalletManager, useWallet, useNetwork, enums, types
- Migration from v3: references/migration-v3.md â algosdk v3, network config changes, useNetwork extraction
Quick Reference: Supported Wallets
| Wallet | WalletId | Required Package |
|---|---|---|
| Pera | PERA |
@perawallet/connect |
| Defly | DEFLY |
@blockshake/defly-connect |
| Defly Web (beta) | DEFLY_WEB |
@agoralabs-sh/avm-web-provider |
| Exodus | EXODUS |
â |
| Kibisis | KIBISIS |
@agoralabs-sh/avm-web-provider |
| Lute | LUTE |
lute-connect |
| WalletConnect | WALLETCONNECT |
@walletconnect/sign-client, @walletconnect/modal |
| Magic | MAGIC |
magic-sdk, @magic-ext/algorand |
| Web3Auth | WEB3AUTH |
@web3auth/modal, @web3auth/base, @web3auth/base-provider |
| W3 Wallet | W3_WALLET |
â |
| KMD | KMD |
â (dev only) |
| Mnemonic | MNEMONIC |
â (test only, never MainNet) |
| Custom | CUSTOM |
â (implement CustomProvider) |
Wallets that require no extra package use built-in browser APIs or AVM web provider.
Key Patterns
Minimal Setup (React)
import {
WalletProvider,
WalletManager,
NetworkId,
WalletId,
} from '@txnlab/use-wallet-react'
const manager = new WalletManager({
wallets: [WalletId.PERA, WalletId.DEFLY, WalletId.LUTE],
defaultNetwork: NetworkId.TESTNET,
})
function App() {
return (
<WalletProvider manager={manager}>
<YourApp />
</WalletProvider>
)
}
Accessing Wallet State
const {
wallets,
activeAddress,
isReady,
signTransactions,
transactionSigner,
algodClient,
} = useWallet()
const {
activeNetwork,
setActiveNetwork,
updateAlgodConfig,
resetNetworkConfig,
} = useNetwork()
Important Notes
- v4.x requires algosdk v3 â see migration guide if upgrading from v3.x
- In v4.0.0, network features moved from
useWalletto a separateuseNetworkhook/composable/primitive - Default networks (MainNet, TestNet, BetaNet, LocalNet) use Nodely’s free API
- Some wallet providers require signature requests from direct user interaction (button clicks)
- Only Lute supports ARC-60 data signing (
signData)