@goplausible/openclaw-algorand-plugin 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +112 -0
  3. package/index.ts +361 -0
  4. package/lib/mcp-servers.ts +14 -0
  5. package/lib/x402-fetch.ts +213 -0
  6. package/memory/algorand-plugin.md +82 -0
  7. package/openclaw.plugin.json +30 -0
  8. package/package.json +41 -0
  9. package/setup.ts +80 -0
  10. package/skills/algorand-development/SKILL.md +90 -0
  11. package/skills/algorand-development/references/build-smart-contracts-reference.md +79 -0
  12. package/skills/algorand-development/references/build-smart-contracts.md +52 -0
  13. package/skills/algorand-development/references/create-project-reference.md +86 -0
  14. package/skills/algorand-development/references/create-project.md +89 -0
  15. package/skills/algorand-development/references/implement-arc-standards-arc32-arc56.md +396 -0
  16. package/skills/algorand-development/references/implement-arc-standards-arc4.md +265 -0
  17. package/skills/algorand-development/references/implement-arc-standards.md +92 -0
  18. package/skills/algorand-development/references/search-algorand-examples-reference.md +119 -0
  19. package/skills/algorand-development/references/search-algorand-examples.md +89 -0
  20. package/skills/algorand-development/references/troubleshoot-errors-contract.md +373 -0
  21. package/skills/algorand-development/references/troubleshoot-errors-transaction.md +599 -0
  22. package/skills/algorand-development/references/troubleshoot-errors.md +105 -0
  23. package/skills/algorand-development/references/use-algokit-cli-reference.md +228 -0
  24. package/skills/algorand-development/references/use-algokit-cli.md +64 -0
  25. package/skills/algorand-interaction/SKILL.md +223 -0
  26. package/skills/algorand-interaction/references/algorand-mcp.md +743 -0
  27. package/skills/algorand-interaction/references/examples-algorand-mcp.md +647 -0
  28. package/skills/algorand-python/SKILL.md +95 -0
  29. package/skills/algorand-python/references/build-smart-contracts-decorators.md +413 -0
  30. package/skills/algorand-python/references/build-smart-contracts-reference.md +55 -0
  31. package/skills/algorand-python/references/build-smart-contracts-storage.md +452 -0
  32. package/skills/algorand-python/references/build-smart-contracts-transactions.md +445 -0
  33. package/skills/algorand-python/references/build-smart-contracts-types.md +438 -0
  34. package/skills/algorand-python/references/build-smart-contracts.md +82 -0
  35. package/skills/algorand-python/references/create-project-reference.md +55 -0
  36. package/skills/algorand-python/references/create-project.md +75 -0
  37. package/skills/algorand-python/references/implement-arc-standards-arc32-arc56.md +101 -0
  38. package/skills/algorand-python/references/implement-arc-standards-arc4.md +154 -0
  39. package/skills/algorand-python/references/implement-arc-standards.md +39 -0
  40. package/skills/algorand-python/references/troubleshoot-errors-contract.md +355 -0
  41. package/skills/algorand-python/references/troubleshoot-errors-transaction.md +430 -0
  42. package/skills/algorand-python/references/troubleshoot-errors.md +46 -0
  43. package/skills/algorand-python/references/use-algokit-utils-reference.md +350 -0
  44. package/skills/algorand-python/references/use-algokit-utils.md +76 -0
  45. package/skills/algorand-typescript/SKILL.md +131 -0
  46. package/skills/algorand-typescript/references/algorand-ts-migration-from-beta.md +448 -0
  47. package/skills/algorand-typescript/references/algorand-ts-migration-from-tealscript.md +487 -0
  48. package/skills/algorand-typescript/references/algorand-ts-migration.md +102 -0
  49. package/skills/algorand-typescript/references/algorand-typescript-syntax-methods-and-abi.md +134 -0
  50. package/skills/algorand-typescript/references/algorand-typescript-syntax-reference.md +58 -0
  51. package/skills/algorand-typescript/references/algorand-typescript-syntax-storage.md +154 -0
  52. package/skills/algorand-typescript/references/algorand-typescript-syntax-transactions.md +187 -0
  53. package/skills/algorand-typescript/references/algorand-typescript-syntax-types-and-values.md +150 -0
  54. package/skills/algorand-typescript/references/algorand-typescript-syntax.md +84 -0
  55. package/skills/algorand-typescript/references/build-smart-contracts-reference.md +52 -0
  56. package/skills/algorand-typescript/references/build-smart-contracts.md +74 -0
  57. package/skills/algorand-typescript/references/call-smart-contracts-reference.md +237 -0
  58. package/skills/algorand-typescript/references/call-smart-contracts.md +183 -0
  59. package/skills/algorand-typescript/references/create-project-reference.md +53 -0
  60. package/skills/algorand-typescript/references/create-project.md +86 -0
  61. package/skills/algorand-typescript/references/deploy-react-frontend-examples.md +527 -0
  62. package/skills/algorand-typescript/references/deploy-react-frontend-reference.md +412 -0
  63. package/skills/algorand-typescript/references/deploy-react-frontend.md +239 -0
  64. package/skills/algorand-typescript/references/implement-arc-standards-arc32-arc56.md +73 -0
  65. package/skills/algorand-typescript/references/implement-arc-standards-arc4.md +126 -0
  66. package/skills/algorand-typescript/references/implement-arc-standards.md +44 -0
  67. package/skills/algorand-typescript/references/test-smart-contracts-examples.md +245 -0
  68. package/skills/algorand-typescript/references/test-smart-contracts-unit-tests.md +147 -0
  69. package/skills/algorand-typescript/references/test-smart-contracts.md +127 -0
  70. package/skills/algorand-typescript/references/troubleshoot-errors-contract.md +296 -0
  71. package/skills/algorand-typescript/references/troubleshoot-errors-transaction.md +438 -0
  72. package/skills/algorand-typescript/references/troubleshoot-errors.md +56 -0
  73. package/skills/algorand-typescript/references/use-algokit-utils-reference.md +342 -0
  74. package/skills/algorand-typescript/references/use-algokit-utils.md +74 -0
  75. package/skills/algorand-x402-python/SKILL.md +113 -0
  76. package/skills/algorand-x402-python/references/create-python-x402-client-examples.md +469 -0
  77. package/skills/algorand-x402-python/references/create-python-x402-client-reference.md +313 -0
  78. package/skills/algorand-x402-python/references/create-python-x402-client.md +207 -0
  79. package/skills/algorand-x402-python/references/create-python-x402-facilitator-examples.md +924 -0
  80. package/skills/algorand-x402-python/references/create-python-x402-facilitator-reference.md +629 -0
  81. package/skills/algorand-x402-python/references/create-python-x402-facilitator.md +408 -0
  82. package/skills/algorand-x402-python/references/create-python-x402-server-examples.md +703 -0
  83. package/skills/algorand-x402-python/references/create-python-x402-server-reference.md +303 -0
  84. package/skills/algorand-x402-python/references/create-python-x402-server.md +221 -0
  85. package/skills/algorand-x402-python/references/explain-algorand-x402-python-examples.md +605 -0
  86. package/skills/algorand-x402-python/references/explain-algorand-x402-python-reference.md +315 -0
  87. package/skills/algorand-x402-python/references/explain-algorand-x402-python.md +167 -0
  88. package/skills/algorand-x402-python/references/use-python-x402-core-avm-examples.md +554 -0
  89. package/skills/algorand-x402-python/references/use-python-x402-core-avm-reference.md +278 -0
  90. package/skills/algorand-x402-python/references/use-python-x402-core-avm.md +166 -0
  91. package/skills/algorand-x402-typescript/SKILL.md +129 -0
  92. package/skills/algorand-x402-typescript/references/create-typescript-x402-client-examples.md +879 -0
  93. package/skills/algorand-x402-typescript/references/create-typescript-x402-client-reference.md +371 -0
  94. package/skills/algorand-x402-typescript/references/create-typescript-x402-client.md +236 -0
  95. package/skills/algorand-x402-typescript/references/create-typescript-x402-facilitator-examples.md +875 -0
  96. package/skills/algorand-x402-typescript/references/create-typescript-x402-facilitator-reference.md +461 -0
  97. package/skills/algorand-x402-typescript/references/create-typescript-x402-facilitator.md +270 -0
  98. package/skills/algorand-x402-typescript/references/create-typescript-x402-nextjs-examples.md +1181 -0
  99. package/skills/algorand-x402-typescript/references/create-typescript-x402-nextjs-reference.md +360 -0
  100. package/skills/algorand-x402-typescript/references/create-typescript-x402-nextjs.md +251 -0
  101. package/skills/algorand-x402-typescript/references/create-typescript-x402-paywall-examples.md +870 -0
  102. package/skills/algorand-x402-typescript/references/create-typescript-x402-paywall-reference.md +323 -0
  103. package/skills/algorand-x402-typescript/references/create-typescript-x402-paywall.md +281 -0
  104. package/skills/algorand-x402-typescript/references/create-typescript-x402-server-examples.md +1135 -0
  105. package/skills/algorand-x402-typescript/references/create-typescript-x402-server-reference.md +382 -0
  106. package/skills/algorand-x402-typescript/references/create-typescript-x402-server.md +216 -0
  107. package/skills/algorand-x402-typescript/references/explain-algorand-x402-typescript-examples.md +616 -0
  108. package/skills/algorand-x402-typescript/references/explain-algorand-x402-typescript-reference.md +323 -0
  109. package/skills/algorand-x402-typescript/references/explain-algorand-x402-typescript.md +232 -0
  110. package/skills/algorand-x402-typescript/references/use-typescript-x402-core-avm-examples.md +1417 -0
  111. package/skills/algorand-x402-typescript/references/use-typescript-x402-core-avm-reference.md +504 -0
  112. package/skills/algorand-x402-typescript/references/use-typescript-x402-core-avm.md +158 -0
@@ -0,0 +1,228 @@
1
+ # AlgoKit CLI Reference
2
+
3
+ Complete reference for AlgoKit CLI commands.
4
+
5
+ ## Project Commands
6
+
7
+ ### algokit project run build
8
+
9
+ Compile contracts and generate artifacts.
10
+
11
+ ```bash
12
+ algokit project run build
13
+ ```
14
+
15
+ **What it does:**
16
+ - Compiles contracts via Puya compiler
17
+ - Generates ARC-56 app specs (`*.arc56.json`)
18
+ - Creates typed client files
19
+ - Outputs to `artifacts/` directory
20
+
21
+ ### algokit project run test
22
+
23
+ Run the test suite.
24
+
25
+ ```bash
26
+ algokit project run test
27
+ ```
28
+
29
+ **What it does:**
30
+ - Executes tests using Vitest
31
+ - Uses generated clients to interact with contracts
32
+ - Runs against localnet
33
+
34
+ ### algokit project deploy
35
+
36
+ Deploy contracts to a network.
37
+
38
+ ```bash
39
+ # Deploy to localnet
40
+ algokit project deploy localnet
41
+ ```
42
+
43
+ **Prerequisites:**
44
+ - Localnet must be running
45
+ - Contracts must be built
46
+
47
+ ## LocalNet Commands
48
+
49
+ ### algokit localnet start
50
+
51
+ Start the local Algorand network.
52
+
53
+ ```bash
54
+ algokit localnet start
55
+ ```
56
+
57
+ **What it does:**
58
+ - Starts Docker containers for Algorand node
59
+ - Provides local development environment
60
+ - Includes KMD for test accounts
61
+
62
+ ### algokit localnet stop
63
+
64
+ Stop the local network.
65
+
66
+ ```bash
67
+ algokit localnet stop
68
+ ```
69
+
70
+ ### algokit localnet reset
71
+
72
+ Reset the network state.
73
+
74
+ ```bash
75
+ algokit localnet reset
76
+ ```
77
+
78
+ **Use when:**
79
+ - Need a clean slate
80
+ - State is corrupted
81
+ - Want to restart from genesis
82
+
83
+ ### algokit localnet status
84
+
85
+ Check network status.
86
+
87
+ ```bash
88
+ algokit localnet status
89
+ ```
90
+
91
+ ## Init Commands
92
+
93
+ ### algokit init
94
+
95
+ Initialize a new project.
96
+
97
+ ```bash
98
+ # TypeScript with Production preset
99
+ algokit init -n my-project -t typescript --answer preset_name production --defaults
100
+
101
+ # Python with Production preset
102
+ algokit init -n my-project -t python --answer preset_name production --defaults
103
+ ```
104
+
105
+ **Options:**
106
+
107
+ | Flag | Description |
108
+ |------|-------------|
109
+ | `-n, --name` | Project name |
110
+ | `-t, --template` | Template: `typescript` or `python` |
111
+ | `--answer` | Answer template prompts |
112
+ | `--defaults` | Accept all defaults |
113
+ | `--no-git` | Skip git initialization |
114
+ | `--no-bootstrap` | Skip dependency installation |
115
+
116
+ ## Project Configuration
117
+
118
+ ### .algokit.toml
119
+
120
+ The `.algokit.toml` file configures project behavior:
121
+
122
+ ```toml
123
+ [project]
124
+ type = "contract"
125
+ name = "my-project"
126
+ artifacts = "smart_contracts/artifacts"
127
+
128
+ [project.run]
129
+ build = "npm run build"
130
+ test = "npm run test"
131
+
132
+ [project.deploy]
133
+ command = "npm run deploy:ci"
134
+ environment_secrets = ["DEPLOYER_MNEMONIC"]
135
+
136
+ [project.deploy.localnet]
137
+ environment_secrets = []
138
+
139
+ [project.deploy.testnet]
140
+ environment_secrets = ["DEPLOYER_MNEMONIC"]
141
+ ```
142
+
143
+ ### Environment Files
144
+
145
+ Environment variables can be set in `.env` files:
146
+
147
+ - `.env` — Default values for all environments
148
+ - `.env.localnet` — LocalNet-specific overrides
149
+ - `.env.testnet` — TestNet-specific values
150
+ - `.env.mainnet` — MainNet-specific values
151
+
152
+ ```bash
153
+ # .env.testnet
154
+ ALGOD_SERVER=https://testnet-api.algonode.cloud
155
+ ALGOD_PORT=443
156
+ ALGOD_TOKEN=
157
+ DEPLOYER_MNEMONIC="word1 word2 ..."
158
+ ```
159
+
160
+ The `algokit project deploy` command automatically loads the appropriate `.env.{network}` file.
161
+
162
+ ### Deploy Command Flags
163
+
164
+ ```bash
165
+ # Deploy with specific deployer account
166
+ algokit project deploy testnet --deployer "DEPLOYER_NAME"
167
+
168
+ # Deploy with custom dispenser (for funding)
169
+ algokit project deploy testnet --dispenser "DISPENSER_NAME"
170
+ ```
171
+
172
+ ## Build Artifacts
173
+
174
+ After `algokit project run build`:
175
+
176
+ ```
177
+ smart_contracts/
178
+ └── artifacts/
179
+ └── <ContractName>/
180
+ ├── <ContractName>.arc56.json # ARC-56 app spec
181
+ ├── <ContractName>.approval.teal # Approval program
182
+ ├── <ContractName>.clear.teal # Clear program
183
+ └── <ContractName>Client.ts # Typed client
184
+ ```
185
+
186
+ ## Common Workflows
187
+
188
+ ### Development Cycle
189
+
190
+ ```bash
191
+ # 1. Write/edit contract code
192
+ # 2. Build
193
+ algokit project run build
194
+
195
+ # 3. Write/edit tests
196
+ # 4. Run tests
197
+ algokit project run test
198
+
199
+ # 5. Repeat until passing
200
+ ```
201
+
202
+ ### Deployment Workflow
203
+
204
+ ```bash
205
+ # 1. Start localnet
206
+ algokit localnet start
207
+
208
+ # 2. Build contracts
209
+ algokit project run build
210
+
211
+ # 3. Deploy
212
+ algokit project deploy localnet
213
+ ```
214
+
215
+ ### Clean Start
216
+
217
+ ```bash
218
+ # Reset everything
219
+ algokit localnet reset
220
+ algokit project run build
221
+ algokit project run test
222
+ ```
223
+
224
+ ## External Documentation
225
+
226
+ - [AlgoKit CLI Documentation](https://dev.algorand.co/algokit/cli/)
227
+ - [AlgoKit Project Commands](https://dev.algorand.co/reference/algokit-cli/#project)
228
+ - [AlgoKit LocalNet](https://dev.algorand.co/reference/algokit-cli/#localnet)
@@ -0,0 +1,64 @@
1
+
2
+ # AlgoKit Commands
3
+
4
+ Standard commands for Algorand development with AlgoKit CLI.
5
+
6
+ ## Overview / Core Workflow
7
+
8
+ 1. Write contract code
9
+ 2. Build: `algokit project run build`
10
+ 3. Write tests using generated clients
11
+ 4. Test: `algokit project run test`
12
+ 5. Deploy: `algokit project deploy localnet`
13
+
14
+ ## How to proceed
15
+
16
+ 1. **Build contracts:**
17
+ ```bash
18
+ algokit project run build
19
+ ```
20
+ This compiles contracts via Puya, generates ARC56 specs, and creates typed clients.
21
+
22
+ 2. **Run tests:**
23
+ ```bash
24
+ algokit project run test
25
+ ```
26
+ Executes the test suite using Vitest.
27
+
28
+ 3. **Start localnet (if needed):**
29
+ ```bash
30
+ algokit localnet start
31
+ ```
32
+
33
+ 4. **Deploy to localnet:**
34
+ ```bash
35
+ algokit project deploy localnet
36
+ ```
37
+
38
+ 5. **Check build artifacts:**
39
+ - `artifacts/` — Compiled contracts, ARC56 specs
40
+ - Generated client files for TypeScript/Python
41
+
42
+ ## Important Rules / Guidelines
43
+
44
+ - **Always build before testing** — Tests use generated clients
45
+ - **Only deploy when explicitly requested** — Don't auto-deploy
46
+ - **Check localnet status** before deployment operations
47
+ - **Reset localnet** if you need a clean state
48
+
49
+ ## Common Variations / Edge Cases
50
+
51
+ | Scenario | Command |
52
+ |----------|---------|
53
+ | Start local network | `algokit localnet start` |
54
+ | Stop local network | `algokit localnet stop` |
55
+ | Reset network state | `algokit localnet reset` |
56
+ | Check network status | `algokit localnet status` |
57
+ | Build fails | Check Puya compiler errors, fix contract code |
58
+ | Tests fail | Check test assertions, fix contract or test code |
59
+
60
+ ## References / Further Reading
61
+
62
+ - [Full CLI Reference](./use-algokit-cli-reference.md)
63
+ - [AlgoKit CLI Documentation](https://dev.algorand.co/algokit/cli/)
64
+ - [AlgoKit Project Commands](https://dev.algorand.co/reference/algokit-cli/#project)
@@ -0,0 +1,223 @@
1
+ ---
2
+ name: algorand-interaction
3
+ description: Interact with Algorand blockchain via the Algorand MCP server — wallet operations, ALGO/ASA transactions, smart contracts, account info, NFD lookups, atomic groups, Tinyman swaps, TEAL compilation, knowledge base. Use when user asks about Algorand wallet, balances, sending ALGO or tokens, asset opt-in, transactions, NFD names, DEX swaps, smart contracts, or account details.
4
+ ---
5
+
6
+ # Algorand MCP Interaction
7
+
8
+ Interact with Algorand blockchain through the Algorand MCP server (99 tools across 11 categories).
9
+
10
+ ## Key Characteristics
11
+
12
+ - **Secure signing** — use `wallet_*` tools to sign; private keys are never available to you
13
+ - **Multi-network** — supports `mainnet`, `testnet`, and `localnet`
14
+ - **Spending limits** — per-transaction (`allowance`) and daily (`dailyAllowance`) limits enforced by wallet
15
+
16
+ ## mcporter Syntax (Critical)
17
+
18
+ When calling Algorand MCP tools via mcporter, use the correct syntax:
19
+
20
+ **Correct:**
21
+ ```bash
22
+ mcporter call algorand-mcp.tool_name --args '{"param": "value", "network": "testnet"}'
23
+ ```
24
+
25
+ **Also correct (flag-style):**
26
+ ```bash
27
+ mcporter call algorand-mcp.tool_name param=value network=testnet
28
+ ```
29
+
30
+ **Wrong — args not sent properly:**
31
+ ```bash
32
+ mcporter call algorand-mcp tool_name '{"param": "value"}' # Space instead of dot, missing --args
33
+ ```
34
+
35
+ Key points:
36
+ - Use `server.tool` (dot notation), NOT `server tool` (space)
37
+ - Use `--args '{"json"}'` for JSON payloads
38
+ - Or use `param=value` / `param:value` flag syntax
39
+
40
+ ## Session Start Checklist
41
+
42
+ **At EVERY session start:**
43
+
44
+ 1. **Check wallet**: `wallet_get_info` with target `network` — verify an account exists and is active
45
+ 2. **If no accounts**: Guide user to create one with `wallet_add_account` (sets nickname and spending limits)
46
+ 3. **If needs funding**: Generate ARC-26 QR with `generate_algorand_uri` or direct to testnet faucet: https://lora.algokit.io/testnet/fund
47
+ 4. **If needs USDC funding**: Generate ARC-26 QR with `generate_algorand_uri` or direct to testnet faucet: https://faucet.circle.com/
48
+ 5. **Confirm network**: Always confirm which network (`mainnet`, `testnet`, `localnet`) before transactions
49
+
50
+ ## Network Selection
51
+
52
+ Every tool that touches the blockchain accepts a `network` parameter:
53
+
54
+ | Value | Description |
55
+ |-------|-------------|
56
+ | `mainnet` | Algorand mainnet (default) — **real value, exercise caution** |
57
+ | `testnet` | Algorand testnet — safe for development |
58
+ | `localnet` | Local dev network (requires `ALGORAND_LOCALNET_URL` env var) |
59
+
60
+ Default to `testnet` during development.
61
+
62
+ ## Pre-Transaction Validation
63
+
64
+ Before ANY transaction:
65
+
66
+ 1. **MBR Check**: Account needs 0.1 ALGO base + 0.1 per asset/app opt-in
67
+ 2. **Asset Opt-In**: Verify with `api_algod_get_account_asset_info` before ASA transfers
68
+ 3. **Fees**: Every txn costs 0.001 ALGO (1,000 microAlgos) minimum
69
+ 4. **Balance Check**: Fetch current balance with `wallet_get_info` or `api_algod_get_account_info`
70
+ 5. **Spending Limits**: Wallet enforces per-transaction and daily limits
71
+ 6. **Order**: Fund account with ALGO first, then asset transactions
72
+
73
+ ## Common Mainnet Assets
74
+
75
+ | Asset | ASA ID | Decimals |
76
+ |-------|--------|----------|
77
+ | ALGO | native | 6 |
78
+ | USDC | 31566704 | 6 |
79
+ | USDT | 312769 | 6 |
80
+ | goETH | 386192725 | 8 |
81
+ | goBTC | 386195940 | 8 |
82
+
83
+ > Always verify asset IDs on-chain — scam tokens use similar names.
84
+
85
+ ## Amounts and Decimals
86
+
87
+ | Asset | Unit | 1 Whole Token = |
88
+ |-------|------|-----------------|
89
+ | ALGO | microAlgos | 1,000,000 |
90
+ | USDC (ASA 31566704) | micro-units | 1,000,000 (6 decimals) |
91
+ | Custom ASAs | base units | Depends on `decimals` field |
92
+
93
+ Always check asset's `decimals` field with `api_algod_get_asset_by_id` before computing amounts.
94
+
95
+ ## Transaction Types
96
+
97
+ - **pay**: ALGO transfers → `make_payment_txn`
98
+ - **axfer**: Asset transfers, opt-in, clawback → `make_asset_transfer_txn`
99
+ - **acfg**: Asset create/configure/destroy → `make_asset_create_txn`, `make_asset_config_txn`, `make_asset_destroy_txn`
100
+ - **afrz**: Asset freeze/unfreeze → `make_asset_freeze_txn`
101
+ - **appl**: Smart contract calls → `make_app_create_txn`, `make_app_call_txn`, `make_app_update_txn`, `make_app_delete_txn`, `make_app_optin_txn`, `make_app_closeout_txn`, `make_app_clear_txn`
102
+ - **keyreg**: Consensus key registration → `make_keyreg_txn`
103
+
104
+ ## Wallet Transaction Workflow (Recommended)
105
+
106
+ | Step | Tool | Purpose |
107
+ |------|------|---------|
108
+ | 1 | `wallet_get_info` | Verify active account, check balance |
109
+ | 2 | Query tools | Get blockchain data (account info, asset info, etc.) |
110
+ | 3 | `make_*_txn` | Build the transaction |
111
+ | 4 | `wallet_sign_transaction` | Sign with active wallet account (enforces limits) |
112
+ | 5 | `send_raw_transaction` | Submit signed transaction to network |
113
+ | 6 | Query tools | Verify result on-chain |
114
+
115
+ ### One-Step Asset Opt-In
116
+
117
+ For asset opt-ins, use the shortcut:
118
+ ```
119
+ wallet_optin_asset { assetId: 31566704, network: "testnet" }
120
+ ```
121
+
122
+ ## External Key Transaction Workflow
123
+
124
+ When the user provides their own secret key (not using the wallet):
125
+
126
+ | Step | Tool | Purpose |
127
+ |------|------|---------|
128
+ | 1 | `make_*_txn` | Build the transaction |
129
+ | 2 | `sign_transaction` | Sign with provided secret key hex |
130
+ | 3 | `send_raw_transaction` | Submit signed transaction |
131
+
132
+ ## Atomic Group Transaction Workflow
133
+
134
+ For atomic (all-or-nothing) multi-transaction groups:
135
+
136
+ | Step | Tool | Purpose |
137
+ |------|------|---------|
138
+ | 1 | `make_*_txn` (multiple) | Build each transaction |
139
+ | 2 | `assign_group_id` | Assign group ID to all transactions |
140
+ | 3 | `wallet_sign_transaction_group` | Sign all transactions in group with wallet |
141
+ | 4 | `send_raw_transaction` | Submit all signed transactions |
142
+
143
+ ## Tool Categories
144
+
145
+ **Wallet** (10): `wallet_add_account`, `wallet_remove_account`, `wallet_list_accounts`, `wallet_switch_account`, `wallet_get_info`, `wallet_get_assets`, `wallet_sign_transaction`, `wallet_sign_transaction_group`, `wallet_sign_data`, `wallet_optin_asset`
146
+
147
+ **Account** (8): `create_account`, `rekey_account`, `mnemonic_to_mdk`, `mdk_to_mnemonic`, `secret_key_to_mnemonic`, `mnemonic_to_secret_key`, `seed_from_mnemonic`, `mnemonic_from_seed`
148
+
149
+ **Utility** (13): `ping`, `validate_address`, `encode_address`, `decode_address`, `get_application_address`, `bytes_to_bigint`, `bigint_to_bytes`, `encode_uint64`, `decode_uint64`, `verify_bytes`, `sign_bytes`, `encode_obj`, `decode_obj`
150
+
151
+ **Transaction Building** (16): `make_payment_txn`, `make_keyreg_txn`, `make_asset_create_txn`, `make_asset_config_txn`, `make_asset_destroy_txn`, `make_asset_freeze_txn`, `make_asset_transfer_txn`, `make_app_create_txn`, `make_app_update_txn`, `make_app_delete_txn`, `make_app_optin_txn`, `make_app_closeout_txn`, `make_app_clear_txn`, `make_app_call_txn`, `assign_group_id`, `sign_transaction`
152
+
153
+ **Algod** (5): `compile_teal`, `disassemble_teal`, `send_raw_transaction`, `simulate_raw_transactions`, `simulate_transactions`
154
+
155
+ **Algod API** (13): `api_algod_get_account_info`, `api_algod_get_account_application_info`, `api_algod_get_account_asset_info`, `api_algod_get_application_by_id`, `api_algod_get_application_box`, `api_algod_get_application_boxes`, `api_algod_get_asset_by_id`, `api_algod_get_pending_transaction`, `api_algod_get_pending_transactions_by_address`, `api_algod_get_pending_transactions`, `api_algod_get_transaction_params`, `api_algod_get_node_status`, `api_algod_get_node_status_after_block`
156
+
157
+ **Indexer API** (17): `api_indexer_lookup_account_by_id`, `api_indexer_lookup_account_assets`, `api_indexer_lookup_account_app_local_states`, `api_indexer_lookup_account_created_applications`, `api_indexer_search_for_accounts`, `api_indexer_lookup_applications`, `api_indexer_lookup_application_logs`, `api_indexer_search_for_applications`, `api_indexer_lookup_application_box`, `api_indexer_lookup_application_boxes`, `api_indexer_lookup_asset_by_id`, `api_indexer_lookup_asset_balances`, `api_indexer_lookup_asset_transactions`, `api_indexer_search_for_assets`, `api_indexer_lookup_transaction_by_id`, `api_indexer_lookup_account_transactions`, `api_indexer_search_for_transactions`
158
+
159
+ **NFDomains** (6): `api_nfd_get_nfd`, `api_nfd_get_nfds_for_addresses`, `api_nfd_get_nfd_activity`, `api_nfd_get_nfd_analytics`, `api_nfd_browse_nfds`, `api_nfd_search_nfds`
160
+
161
+ **Tinyman DEX** (9): `api_tinyman_get_pool`, `api_tinyman_get_pool_analytics`, `api_tinyman_get_pool_creation_quote`, `api_tinyman_get_liquidity_quote`, `api_tinyman_get_remove_liquidity_quote`, `api_tinyman_get_swap_quote`, `api_tinyman_get_asset_optin_quote`, `api_tinyman_get_validator_optin_quote`, `api_tinyman_get_validator_optout_quote`
162
+
163
+ **ARC-26 URI** (1): `generate_algorand_uri`
164
+
165
+ **Knowledge Base** (1): `get_knowledge_doc`
166
+
167
+ ## Pagination
168
+
169
+ API responses are paginated. All API tools accept optional `itemsPerPage` (default 10) and `pageToken` parameters. Pass `pageToken` from a previous response to fetch the next page.
170
+
171
+ ## x402 Payment Workflow for OpenClaw agents
172
+
173
+ When `x402_fetch` returns HTTP 402 with `PaymentRequirements`, use the atomic group transaction pattern to build the payment:
174
+
175
+ 1. Build fee payer transaction (0-amount from facilitator's `feePayer` address, `fee: 2000`, `flatFee: true` — covers fees for both txns)
176
+ 2. Build payment transaction (ALGO or ASA transfer to `payTo`, `fee: 0`, `flatFee: true` — facilitator covers fee)
177
+ 3. Group both transactions with `assign_group_id`
178
+ 4. Sign only the payment transaction (index 1) with wallet and tool wallet_sign_transaction — leave fee payer unsigned
179
+ 5. Encode the unsigned fee payer transaction (index 0) with `encode_unsigned_transaction`
180
+ 6. Construct PAYMENT-SIGNATURE JSON payload — **must include `accepted` field** (the exact `accepts[]` entry chosen) — and retry with `x402_fetch`
181
+
182
+ **Critical**: The `accepted` field is REQUIRED. It must be an exact copy of the `accepts[]` entry you chose to pay with (including all fields: scheme, network, price, payTo, asset, maxAmountRequired, extra, etc.). Without it, the server cannot match your payment and will reject with 402.
183
+
184
+ Map CAIP-2 network identifiers from `accepts[].network` to `testnet` or `mainnet`.
185
+
186
+ See [references/examples-algorand-mcp.md](references/examples-algorand-mcp.md) for the full step-by-step workflow.
187
+
188
+ ## References
189
+
190
+ For detailed tool documentation:
191
+ - **Tool Reference**: See [references/algorand-mcp.md](references/algorand-mcp.md)
192
+
193
+ For workflow examples (including x402 payment):
194
+ - **Examples**: See [references/examples-algorand-mcp.md](references/examples-algorand-mcp.md)
195
+
196
+ ## NFD Important Note
197
+
198
+ When using NFD (`.algo` names), always use the `depositAccount` field from the NFD response for transactions, NOT other address fields.
199
+
200
+ ## Security
201
+
202
+ - **Mainnet = real value** — always confirm with user before mainnet transactions
203
+ - Never log, display, or store mnemonics or secret keys — use `wallet_*` tools for signing
204
+ - Verify recipient addresses with `validate_address` — transactions are irreversible
205
+ - Verify asset IDs on-chain — scam tokens use similar names
206
+ - Respect wallet spending limits — if rejected, inform user rather than bypassing
207
+
208
+ ## Links
209
+
210
+ - GoPlausible: https://goplausible.com
211
+ - Algorand: https://algorand.co
212
+ - Algorand x402: https://x402.goplausible.xyz
213
+ - Algorand x402 test endpoints: https://example.x402.goplausible.xyz/
214
+ - Algorand x402 Facilitator: https://facilitator.goplausible.xyz
215
+ - Testnet Faucet: https://lora.algokit.io/testnet/fund
216
+ - Testnet USDC Faucet: https://faucet.circle.com/
217
+ - Algorand Developer Docs: https://dev.algorand.co/
218
+ - Algorand Developer Docs Github : https://github.com/algorandfoundation/devportal
219
+ - Algorand Developer Examples Github : https://github.com/algorandfoundation/devportal-code-examples
220
+ - [GoPlausible x402-avm Documentation and Example code](https://github.com/GoPlausible/.github/blob/main/profile/algorand-x402-documentation/README.md)
221
+ - [GoPlausible x402-avm Examples template Projects](https://github.com/GoPlausible/x402-avm/tree/branch-v2-algorand-publish/examples/)
222
+ - [CAIP-2 Specification](https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-2.md)
223
+ - [Coinbase x402 Protocol](https://github.com/coinbase/x402)