Skip to content

feat: add AlgoVoi wallet provider#434

Open
chopmob-cloud wants to merge 3 commits intoTxnLab:mainfrom
chopmob-cloud:feat/add-algovoi-wallet
Open

feat: add AlgoVoi wallet provider#434
chopmob-cloud wants to merge 3 commits intoTxnLab:mainfrom
chopmob-cloud:feat/add-algovoi-wallet

Conversation

@chopmob-cloud
Copy link
Copy Markdown

@chopmob-cloud chopmob-cloud commented Mar 24, 2026

Summary

  • Adds AlgoVoi as a named wallet provider (WalletId.ALGOVOI)
  • AlgoVoi is an Algorand + Voi browser extension wallet with native x402 HTTP payment support
  • The implementation calls the ARC-0027 compliant window.algorand provider directly — no external SDK dependency required
  • Extension: AlgoVoi on GitHub

Changes

  • types.ts — Add ALGOVOI = 'algovoi' to WalletId enum, WalletMap, and WalletOptionsMap
  • algovoi.ts — New AlgoVoiWallet class extending BaseWallet
    • Detects the extension via window.algorand?.isAlgoVoi === true
    • Falls back to listening for algorand#initialized event if not yet injected
    • Implements connect(), disconnect(), resumeSession(), signTransactions()
    • Handles both algosdk.Transaction[] and Uint8Array[] input formats
    • 3-minute timeout for provider detection
  • index.ts — Export AlgoVoiWallet
  • utils.ts — Register in createWalletMap()
  • algovoi.test.ts — Unit tests for connect, disconnect, resumeSession, metadata

dApp usage

import { WalletId, WalletManager } from '@txnlab/use-wallet'

const walletManager = new WalletManager({
  wallets: [WalletId.ALGOVOI, WalletId.PERA, WalletId.DEFLY]
})

Test plan

  • All 475 existing tests pass (no regressions)
  • New AlgoVoi tests pass (connect, disconnect, resumeSession, metadata)
  • pnpm build succeeds for @txnlab/use-wallet package
  • Manual: Install AlgoVoi extension + test with a dApp using use-wallet

chopmob-cloud added a commit to chopmob-cloud/dorkfi-app that referenced this pull request Mar 25, 2026
- Register 'algovoi' in WalletManager (NetworkContext) alongside existing AVM wallets
- Add AlgoVoi to the wallet selection modal (WalletModal) for all AVM networks
- Mark AlgoVoi as a universal wallet (supports both Algorand and Voi Mainnet)
- Connection handler uses window.algorand directly as fallback until
  TxnLab/use-wallet#434 lands; upgrades automatically to use-wallet path once available
- Availability check detects the extension via window.algorand.isAlgoVoi so the
  button appears even before the npm package ships WalletId.ALGOVOI

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@chopmob-cloud
Copy link
Copy Markdown
Author

Hey @drichar — just wanted to check in on this one. AlgoVoi is a browser extension wallet for Algorand and Voi with native ARC-27 support, and getting it into use-wallet would really help with dApp compatibility across the ecosystem (a few Voi dApps are already waiting on this to land before they can add AlgoVoi support).

No pressure at all — just appreciate any review when you get a chance. Happy to address any feedback or changes needed. 🙏

@chopmob-cloud
Copy link
Copy Markdown
Author

Bumping this for visibility — wanted to share some context on where this fits in a wider rollout.

What's shipped since this PR was opened

Since submitting this PR, AlgoVoi has launched full implementations across three payment protocols:

Protocol Status Links
x402 (HTTP Payment Protocol, spec v1) ✅ live x402.org ecosystem listing #2022
MPP (IETF draft-ryan-httpauth-payment) ✅ live tempoxyz/mpp #556
AP2 (Agentic Commerce, AP2 v0.1) ✅ live google-agentic-commerce/AP2 #218

All three are smoke-tested with real on-chain USDC payments across Algorand, VOI, Hedera, and Stellar.

eCommerce platform adapters

AlgoVoi also has payment gateway adapters for 17+ eCommerce platforms (WooCommerce, Shopify, PrestaShop, Magento, OpenCart, and more), all open-source:
👉 chopmob-cloud/AlgoVoi-Platform-Adapters

Why use-wallet matters here

The AlgoVoi browser extension is the user-facing wallet that completes the loop — dApps built with use-wallet can sign the on-chain payment transactions that x402/MPP/AP2 require. Without WalletId.ALGOVOI in use-wallet, dApp developers building payment-gated flows on Algorand have to roll their own integration.

Happy to answer any questions or make changes if the implementation needs adjusting for the v4 API.

Add AlgoVoi as a named wallet provider so dApps using use-wallet
can display it in their connect modals alongside Pera, Defly, etc.

AlgoVoi is an Algorand + Voi browser extension wallet that exposes
an ARC-0027 compliant provider at window.algorand. The implementation
calls the injected provider directly (no external SDK dependency).

Changes:
- Add ALGOVOI to WalletId enum
- Create AlgoVoiWallet extending BaseWallet
- Register in createWalletMap and exports
- Add unit tests (connect, disconnect, resumeSession, metadata)
Remove unused `logger` and `Mock` imports flagged by eslint.
@chopmob-cloud chopmob-cloud force-pushed the feat/add-algovoi-wallet branch from 3ff0feb to 791dc4d Compare April 14, 2026 18:02
@chopmob-cloud
Copy link
Copy Markdown
Author

Quick check-in — coming up on three weeks since the last bump.

Since then AlgoVoi has expanded to seven supported chains (Solana and Tempo joining Algorand, VOI, Hedera, Stellar, Base) and the browser-extension wallet was just listed under Wallet Providers in awesome-algorand (#181, awaiting maintainer review).

A native wallet provider in use-wallet would help dApps using the library pick up AlgoVoi flows cleanly across that 7-chain surface.

Happy to make any changes the team would like to see — no rush, just wanted to flag it's still relevant on our side. Cheers.

@drichar
Copy link
Copy Markdown
Collaborator

drichar commented May 7, 2026

Sorry for the delay @chopmob-cloud! When the PR was opened I was preparing for the stable v5 release. My thinking was that we would wait and migrate the AlgoVoi provider to its new wallet adapter pattern, where it would be a standalone package instead of living inside the core library.

Shifting priorities have delayed the v5 release and my focus was elsewhere. I should have contacted you sooner.

We can get this merged and cut a new v4 release but I think it would make more sense to have you migrate AlgoVoi to its own adapter package now so it's ready for the v5 stable this month.

What do you think?

@drichar
Copy link
Copy Markdown
Collaborator

drichar commented May 7, 2026

@chopmob-cloud
Copy link
Copy Markdown
Author

Many thanks for the feedback, happy to wait, if it makes the transition easier, we are rolling out additional chains etc over the coming week or two, but if we need to make any code changes, they can be integrated very quickly.

Thank you

@drichar
Copy link
Copy Markdown
Collaborator

drichar commented May 7, 2026

Part of the reasoning behind this transition is to give wallet maintainers ownership of their wallet adapter packages. While in the initial v5 release most of these will still be @txnlab/ packages under our NPM org, the goal is to have wallets that are actively maintained take control of their respective packages.

(This also drastically reduces the bundle size of the core library)

If you want to take this approach and publish your own package for AlgoVoi, I'd be happy to help with the migration from what you have here. I'll add it to the v5 docs for discoverability when it's ready.

@chopmob-cloud
Copy link
Copy Markdown
Author

Thanks again for the detailed response — really helpful context on the v5 direction.

Happy to take ownership of the package. We've gone ahead and built and published the standalone adapter:

npm: https://www.npmjs.com/package/@algovoi/use-wallet-algovoi

Usage:

import { algovoi } from '@algovoi/use-wallet-algovoi'

const walletManager = new WalletManager({
  wallets: [algovoi(), pera(), defly()]
})

Test coverage:

  • 10 smoke tests — API surface, factory shape, metadata, icon
  • 15 unit tests — connect, disconnect, resumeSession, signTransactions against a mocked window.algorand
  • 20 e2e simulation tests — full WalletManager → AlgoVoiAdapter → window.algorand chain including late provider injection, timeout, and signing edge cases
  • 45/45 passing, clean build

Follows the Lute package structure exactly — peer deps on @txnlab/use-wallet ^5.0.0 and algosdk ^3.0.0, ESM-only output via tsdown, no external client dependency (talks directly to the ARC-27 window.algorand provider).

Happy to make any adjustments you need before adding it to the v5 docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants