explain-algorand-x402-typescript

Explains @x402-avm TypeScript packages, signer interfaces, and Algorand payment integration patterns.

Updated Apr 6, 2026
One-click install
npx skills add https://github.com/Rudhrakoushik10/RootNode --skill explain-algorand-x402-typescript-rudhrakoushik10
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: explain-algorand-x402-typescript
Source: https://github.com/Rudhrakoushik10/RootNode/tree/main/projects/.opencode/skill/explain-algorand-x402-typescript
Command: npx skills add https://github.com/Rudhrakoushik10/RootNode --skill explain-algorand-x402-typescript-rudhrakoushik10

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? TypeScript developers integrating Algorand payments via the x402 protocol face a modular @x402-avm/* package ecosystem with role-specific signer interfaces, subpath-based scheme registration, and network constants that are easy to misuse. This Skill explains the package structure, signer implementations, and registration patterns so developers can wire up client, server, and facilitator components correctly. ## Core Features & Use Cases - Package Ecosystem Guidance: Maps each @x402-avm package (core, avm, express, hono, next, fetch, axios, paywall, extensions) to its role and key exports. - Signer Implementation Patterns: Shows how to implement ClientAvmSigner with @txnlab/use-wallet or algosdk private keys, and FacilitatorAvmSigner with simulation, submission, and confirmation methods. - Scheme Registration & Troubleshooting: Covers registerExactAvmScheme subpaths per role, CAIP-2 network constants, utility functions, and a table of common errors with fixes. - Use Case: A developer building an Express API that charges USDC on Algorand testnet can follow the workflow to install packages, register the AVM scheme on an x402ResourceServer, and gate routes with paymentMiddleware. ## Quick Start Ask the assistant to explain how to register the AVM scheme and implement a ClientAvmSigner for a TypeScript client using @x402-avm packages.

Frequently Asked Questions about explain-algorand-x402-typescript

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I use @x402-avm packages in a TypeScript application?

Install @x402-avm/core and @x402-avm/avm plus a role-specific package like @x402-avm/fetch or @x402-avm/express. Create the component (client, server, or facilitator), then call registerExactAvmScheme from the matching subpath before using it.

What is the difference between ClientAvmSigner and FacilitatorAvmSigner?

ClientAvmSigner signs payment transactions for a payer with an address and signTransactions method, compatible with @txnlab/use-wallet. FacilitatorAvmSigner manages fee payer addresses and adds getAlgodClient, simulateTransactions, sendTransactions, and waitForConfirmation for settlement.

How do I register the AVM scheme with registerExactAvmScheme?

Import registerExactAvmScheme from the subpath matching your role: @x402-avm/avm/exact/client, /exact/server, or /exact/facilitator. Clients and facilitators pass a signer; servers can register with no options to accept all Algorand networks.

Can I use @txnlab/use-wallet as an x402 signer in the browser?

Yes. ClientAvmSigner's signTransactions signature matches @txnlab/use-wallet directly, so you can wrap the wallet's activeAccount address and signTransactions function into a signer object without extra adaptation.

Why do I get 'No scheme registered for network' with x402-avm?

This error means registerExactAvmScheme was not called before using the client, server, or facilitator. Registration must be unconditional and happen immediately after component creation, never wrapped in environment variable checks.

How do I fix 'global is not defined' when using algosdk in a browser?

algosdk references the Node.js global object, which browsers lack. Add define: { global: 'globalThis' } to your vite.config.ts to polyfill it during bundling.