@goplausible/openclaw-algorand-plugin 1.8.0 → 1.8.2

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.
package/README.md CHANGED
@@ -26,7 +26,7 @@
26
26
  openclaw plugins install @goplausible/openclaw-algorand-plugin
27
27
  ```
28
28
 
29
- Or install from local path:
29
+ Or install from local path if you are running from source code:
30
30
 
31
31
  ```bash
32
32
  openclaw plugins install ./path/to/openclaw-algorand-plugin
@@ -37,21 +37,17 @@ openclaw plugins install ./path/to/openclaw-algorand-plugin
37
37
  After installing, run these commands:
38
38
 
39
39
  ```bash
40
- # 1. Initialize plugin (write memory file + configure mcporter)
41
- openclaw algorand-plugin init
42
-
43
- # 2. Run interactive setup (keyring persistence + x402 toggle)
40
+ # 1. Setup plugin (memory file + mcporter + interactive config)
44
41
  openclaw algorand-plugin setup
45
42
 
46
- # 3. Restart the gateway
43
+ # 2. Restart the gateway
47
44
  openclaw gateway restart
48
45
  ```
49
46
 
50
47
  ## Commands
51
48
 
52
49
  ```bash
53
- openclaw algorand-plugin init # Write plugin memory + configure mcporter
54
- openclaw algorand-plugin setup # Run interactive setup wizard
50
+ openclaw algorand-plugin setup # Initialize + configure plugin (memory, mcporter, options)
55
51
  openclaw algorand-plugin status # Show plugin status (binary, mcporter, config)
56
52
  openclaw algorand-plugin mcp-config # Show MCP config snippet for external coding agents
57
53
  ```
package/index.ts CHANGED
@@ -92,6 +92,42 @@ function updatePluginConfig(newConfig: AlgorandPluginConfig): { success: boolean
92
92
  }
93
93
  }
94
94
 
95
+ function stopExistingMcpProcesses(): { stopped: number; message: string } {
96
+ try {
97
+ // Find all running algorand-mcp processes
98
+ const psOutput = execSync("ps aux 2>/dev/null || tasklist 2>/dev/null || echo ''", { encoding: "utf-8" });
99
+ const lines = psOutput.split("\n").filter((line: string) => line.includes("algorand-mcp") && !line.includes("grep"));
100
+
101
+ if (lines.length === 0) {
102
+ return { stopped: 0, message: "No existing algorand-mcp processes found" };
103
+ }
104
+
105
+ // Extract PIDs and kill them
106
+ let stopped = 0;
107
+ for (const line of lines) {
108
+ const parts = line.trim().split(/\s+/);
109
+ const pid = parts[1]; // PID is second column in ps aux
110
+ if (pid && /^\d+$/.test(pid)) {
111
+ try {
112
+ execSync(`kill ${pid} 2>/dev/null`, { encoding: "utf-8" });
113
+ stopped++;
114
+ } catch {
115
+ // Process may have already exited
116
+ }
117
+ }
118
+ }
119
+
120
+ // Brief wait for processes to terminate
121
+ if (stopped > 0) {
122
+ execSync("sleep 1");
123
+ }
124
+
125
+ return { stopped, message: `Stopped ${stopped} existing algorand-mcp process${stopped !== 1 ? "es" : ""}` };
126
+ } catch {
127
+ return { stopped: 0, message: "Could not check for existing processes" };
128
+ }
129
+ }
130
+
95
131
  function configureMcporter(): { success: boolean; message: string } {
96
132
  const mcpCommand = getMcpBinaryPath();
97
133
 
@@ -221,12 +257,12 @@ export default function register(api: PluginApi) {
221
257
  .command("algorand-plugin")
222
258
  .description("Algorand blockchain integration (GoPlausible)");
223
259
 
224
- // Init command - writes plugin memory file AND configures mcporter
260
+ // Setup command - initializes (memory + mcporter) then runs interactive config
225
261
  algorand
226
- .command("init")
227
- .description("Initialize Algorand plugin (memory file + mcporter config)")
262
+ .command("setup")
263
+ .description("Initialize and configure Algorand plugin")
228
264
  .action(async () => {
229
- console.log("\nšŸ”· Initializing Algorand plugin...\n");
265
+ console.log("\nšŸ”· Setting up Algorand plugin...\n");
230
266
 
231
267
  const workspacePath = getWorkspacePath(api);
232
268
 
@@ -238,7 +274,15 @@ export default function register(api: PluginApi) {
238
274
  console.error(` āŒ ${memResult.message}`);
239
275
  }
240
276
 
241
- // Step 2: Configure mcporter
277
+ // Step 2: Stop any existing algorand-mcp processes
278
+ const stopResult = stopExistingMcpProcesses();
279
+ if (stopResult.stopped > 0) {
280
+ console.log(` āœ… ${stopResult.message}`);
281
+ } else {
282
+ console.log(` ā„¹ļø ${stopResult.message}`);
283
+ }
284
+
285
+ // Step 3: Configure mcporter
242
286
  console.log("");
243
287
  const mcpResult = configureMcporter();
244
288
  if (mcpResult.success) {
@@ -247,15 +291,8 @@ export default function register(api: PluginApi) {
247
291
  console.log(` āš ļø ${mcpResult.message}`);
248
292
  }
249
293
 
250
- console.log("\n Run `openclaw algorand-plugin setup` to configure options.");
251
- console.log(" Run `mcporter list algorand-mcp --schema` to verify MCP tools.\n");
252
- });
253
-
254
- // Setup wizard
255
- algorand
256
- .command("setup")
257
- .description("Run interactive Algorand plugin setup")
258
- .action(async () => {
294
+ // Step 4: Interactive config
295
+ console.log("");
259
296
  const newConfig = await runSetup(pluginConfig);
260
297
  if (newConfig) {
261
298
  const result = updatePluginConfig(newConfig);
@@ -269,6 +306,8 @@ export default function register(api: PluginApi) {
269
306
  console.log(` "plugins": { "allow": ["${PLUGIN_ID}"], "entries": { "${PLUGIN_ID}": { "config": ${JSON.stringify(newConfig)} } } }\n`);
270
307
  }
271
308
  }
309
+
310
+ console.log(" Run `mcporter list algorand-mcp --schema` to verify MCP tools.\n");
272
311
  });
273
312
 
274
313
  // Status command
@@ -296,7 +335,7 @@ export default function register(api: PluginApi) {
296
335
  console.log("");
297
336
  console.log(" MCP Server:");
298
337
  console.log(` Binary: ${mcp.available ? `āœ… ${mcp.path}` : "āš ļø Not found"}`);
299
- console.log(` mcporter: ${mcporterConfigured ? "āœ… Configured" : "āš ļø Not configured (run init)"}`);
338
+ console.log(` mcporter: ${mcporterConfigured ? "āœ… Configured" : "āš ļø Not configured (run setup)"}`);
300
339
  console.log("");
301
340
  console.log(" Config:");
302
341
  console.log(` x402: ${pluginConfig.enableX402 !== false ? "Enabled" : "Disabled"}`);
@@ -353,7 +392,7 @@ export default function register(api: PluginApi) {
353
392
  console.log(` }`);
354
393
  console.log(` }\n`);
355
394
  console.log(" Cursor (.cursor/mcp.json) — same format\n");
356
- console.log(" Note: OpenClaw uses mcporter. Run `openclaw algorand-plugin init` to configure.\n");
395
+ console.log(" Note: OpenClaw uses mcporter. Run `openclaw algorand-plugin setup` to configure.\n");
357
396
  });
358
397
  },
359
398
  { commands: ["algorand-plugin"] }
@@ -380,9 +419,8 @@ export default function register(api: PluginApi) {
380
419
  } catch { /* ignore on install */ }
381
420
 
382
421
  console.log(" Next steps:");
383
- console.log(" 1. Run `openclaw algorand-plugin init` — configure mcporter + add plugin memory");
384
- console.log(" 2. Run `openclaw algorand-plugin setup` — configure options & add to allow list");
385
- console.log(" 3. Restart OpenClaw gateway\n");
422
+ console.log(" 1. Run `openclaw algorand-plugin setup` — initialize + configure plugin");
423
+ console.log(" 2. Restart OpenClaw gateway\n");
386
424
  console.log(` Docs: ${GOPLAUSIBLE_SERVICES.website}\n`);
387
425
  },
388
426
  { name: "algorand.post-install", description: "Show setup instructions on install" }
@@ -1,10 +1,12 @@
1
1
  # Algorand Plugin Guide
2
2
 
3
- This plugin enables three core capabilities:
3
+ This plugin enables four core capabilities:
4
4
 
5
5
  1. **Algorand Development** — Smart contracts, typed clients, React frontends via AlgoKit CLI and skills
6
- 2. **Blockchain Interaction** — Algorand MCP server (107 tools) via mcporter
6
+ 2. **Blockchain Interaction** — Algorand MCP server (107 tools) via mcporter (includes Pera asset verification)
7
7
  3. **x402 Payment Protocol** — HTTP-native payments with Algorand as first-class chain
8
+ 4. **Haystack Router** — DEX aggregator/smart order routing on Algorand (Tinyman V2, Pact, Folks)
9
+ 5. **Alpha Arcade** — On-chain prediction markets on Algorand (USDC-denominated, binary/multi-choice)
8
10
 
9
11
  ## Skill Routing
10
12
 
@@ -16,6 +18,10 @@ This plugin enables three core capabilities:
16
18
  | Interaction | Blockchain interaction via MCP | `algorand-interaction` |
17
19
  | x402 | TypeScript x402 development | `algorand-x402-typescript` |
18
20
  | x402 | Python x402 development | `algorand-x402-python` |
21
+ | x402 | Runtime x402 payment (Claude as client) | `algorand-x402-payment` |
22
+ | Haystack | Build swap apps with SDK | `haystack-router-development` |
23
+ | Haystack | Execute swaps via MCP tools | `haystack-router-interaction` |
24
+ | Alpha Arcade | Prediction markets via MCP tools | `alpha-arcade-interaction` |
19
25
 
20
26
  ## Using Algorand MCP Tools
21
27
 
@@ -31,7 +37,7 @@ mcporter call algorand-mcp.get_account_info address=XXXXX network=testnet
31
37
  mcporter call algorand-mcp.search_assets name=USDC network=mainnet
32
38
  ```
33
39
 
34
- ## MCP Tool Categories (101 tools)
40
+ ## MCP Tool Categories (107 tools)
35
41
 
36
42
  - **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`
37
43
  - **Account Management** (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`
@@ -42,9 +48,37 @@ mcporter call algorand-mcp.search_assets name=USDC network=mainnet
42
48
  - **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`
43
49
  - **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`
44
50
  - **Tinyman AMM** (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`
45
- - **ARC-26 URI** (1) — `generate_algorand_uri`
51
+ - **Haystack Router** (3) — `api_haystack_get_swap_quote`, `api_haystack_execute_swap`, `api_haystack_needs_optin`
52
+ - **Pera Asset Verification** (3) — `api_pera_asset_verification_status`, `api_pera_verified_asset_details`, `api_pera_verified_asset_search`
53
+ - **Alpha Arcade** (15) — Read: `alpha_get_live_markets`, `alpha_get_reward_markets`, `alpha_get_market`, `alpha_get_orderbook`, `alpha_get_open_orders`, `alpha_get_positions`. Trade: `alpha_create_limit_order`, `alpha_create_market_order`, `alpha_cancel_order`, `alpha_amend_order`, `alpha_propose_match`, `alpha_split_shares`, `alpha_merge_shares`, `alpha_claim`
54
+ - **ARC-26 URI** (1) — `generate_algorand_qrcode`
46
55
  - **Knowledge** (1) — `get_knowledge_doc` (categories: `arcs`, `sdks`, `algokit`, `algokit-utils`, `tealscript`, `puya`, `liquid-auth`, `python`, `developers`, `clis`, `nodes`, `details`)
47
56
 
57
+ ## QR Code Display (ARC-26 URI)
58
+
59
+ When generating QR codes with `generate_algorand_qrcode`, the tool returns:
60
+ - UTF-8 text QR code (terminal-friendly)
61
+ - PNG image as base64 (web-friendly)
62
+ - URI string
63
+
64
+ **Important:** MCP tool output may not render properly through mcporter → exec pipeline.
65
+ After calling the tool, **extract and paste the QR code directly in your response**:
66
+
67
+ 1. Call the tool and capture output
68
+ 2. Extract the UTF-8 QR block (Unicode block characters)
69
+ 3. Extract the base64 PNG data
70
+ 4. Include both in your reply:
71
+
72
+ ```
73
+ [paste UTF-8 QR here]
74
+ ```
75
+
76
+ ![QR Code](data:image/png;base64,[paste base64 here])
77
+
78
+ URI: `algorand://ADDRESS?amount=X&asset=Y`
79
+
80
+ This ensures the QR renders correctly in both terminal and web interfaces.
81
+
48
82
  ## Key things to remember
49
83
 
50
84
  - Always check wallet with `wallet_get_info` before blockchain operations
@@ -70,6 +104,7 @@ mcporter call algorand-mcp.search_assets name=USDC network=mainnet
70
104
  - **NEVER use PyTEAL or Beaker** — these are legacy. Use Algorand TypeScript or Algorand Python.
71
105
  - **NEVER use AlgoExplorer** — obsolete. Use Allo.info for block/account/transaction data.
72
106
  - **NFD (.algo names)**: Always use `depositAccount` field for transactions.
107
+ - **Alpha Arcade prices are microunits**: `yesProb`/`noProb` range 0–1,000,000 (NOT percentages). $0.50 = 500,000. Orders require both ALGO (MBR) and USDC (collateral).
73
108
 
74
109
  ## External resources
75
110
 
@@ -81,9 +116,12 @@ mcporter call algorand-mcp.search_assets name=USDC network=mainnet
81
116
  - Testnet Faucet: https://lora.algokit.io/testnet/fund
82
117
  - Testnet USDC Faucet: https://faucet.circle.com/
83
118
  - Algorand Developer Docs: https://dev.algorand.co/
84
- - Algorand Developer Docs Github : https://github.com/algorandfoundation/devportal
85
- - Algorand Developer Examples Github : https://github.com/algorandfoundation/devportal-code-examples
86
- - GoPlausible x402-avm Documentation and Example code : https://github.com/GoPlausible/.github/blob/main/profile/algorand-x402-documentation/README.md
87
- - GoPlausible x402-avm Examples template Projects : https://github.com/GoPlausible/x402-avm/tree/branch-v2-algorand-publish/examples/
88
- - CAIP-2 Specification : https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-2.md
89
- - Coinbase x402 Protocol : https://github.com/coinbase/x402
119
+ - Algorand Developer Docs Github: https://github.com/algorandfoundation/devportal
120
+ - Algorand Developer Examples Github: https://github.com/algorandfoundation/devportal-code-examples
121
+ - GoPlausible x402-avm Documentation and Example code: https://github.com/GoPlausible/.github/blob/main/profile/algorand-x402-documentation/README.md
122
+ - GoPlausible x402-avm Examples template Projects: https://github.com/GoPlausible/x402-avm/tree/branch-v2-algorand-publish/examples/
123
+ - CAIP-2 Specification: https://github.com/ChainAgnostic/CAIPs/blob/main/CAIPs/caip-2.md
124
+ - Coinbase x402 Protocol: https://github.com/coinbase/x402
125
+ - Haystack Router: https://github.com/TxnLab/haystack-router
126
+ - Alpha Arcade: https://alphaarcade.com
127
+ - Alpha Arcade API: https://platform.alphaarcade.com
@@ -2,7 +2,7 @@
2
2
  "id": "openclaw-algorand-plugin",
3
3
  "name": "Algorand Integration",
4
4
  "description": "Algorand blockchain integration with MCP and skills — by GoPlausible",
5
- "version": "1.8.0",
5
+ "version": "1.8.2",
6
6
  "skills": [
7
7
  "skills/algorand-development",
8
8
  "skills/algorand-typescript",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goplausible/openclaw-algorand-plugin",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -43,8 +43,8 @@ Key points:
43
43
 
44
44
  1. **Check wallet**: `wallet_get_info` with target `network` — verify an account exists and is active
45
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/
46
+ 3. **If needs funding**: Generate ARC-26 QR with `generate_algorand_qrcode` or direct to testnet faucet: https://lora.algokit.io/testnet/fund
47
+ 4. **If needs USDC funding**: Generate ARC-26 QR with `generate_algorand_qrcode` or direct to testnet faucet: https://faucet.circle.com/
48
48
  5. **Confirm network**: Always confirm which network (`mainnet`, `testnet`, `localnet`) before transactions
49
49
 
50
50
  ## Network Selection
@@ -164,7 +164,7 @@ For atomic (all-or-nothing) multi-transaction groups:
164
164
 
165
165
  **Pera Asset Verification** (3): `api_pera_asset_verification_status`, `api_pera_verified_asset_details`, `api_pera_verified_asset_search` — mainnet asset verification (verified/trusted/suspicious/unverified), detailed asset info with USD value, and search by name/keyword
166
166
 
167
- **ARC-26 URI** (1): `generate_algorand_uri`
167
+ **ARC-26 URI** (1): `generate_algorand_qrcode`
168
168
 
169
169
  **Knowledge Base** (1): `get_knowledge_doc`
170
170
 
@@ -209,6 +209,31 @@ All prices and quantities use **microunits** (1,000,000 = $1.00 or 1 share). Ord
209
209
 
210
210
  > For detailed Alpha Arcade workflows (orderbook mechanics, multi-choice markets, split/merge shares, claiming, collateral model), load the `alpha-arcade-interaction` skill.
211
211
 
212
+ ## QR Code Display (ARC-26 URI)
213
+
214
+ When generating QR codes with `generate_algorand_qrcode`, the tool returns:
215
+ - UTF-8 text QR code (terminal-friendly)
216
+ - PNG image as base64 (web-friendly)
217
+ - URI string
218
+
219
+ **Important:** MCP tool output may not render properly through mcporter → exec pipeline.
220
+ After calling the tool, **extract and paste the QR code directly in your response**:
221
+
222
+ 1. Call the tool and capture output
223
+ 2. Extract the UTF-8 QR block (Unicode block characters)
224
+ 3. Extract the base64 PNG data
225
+ 4. Include both in your reply:
226
+
227
+ ```
228
+ [paste UTF-8 QR here]
229
+ ```
230
+
231
+ ![QR Code](data:image/png;base64,[paste base64 here])
232
+
233
+ URI: `algorand://ADDRESS?amount=X&asset=Y`
234
+
235
+ This ensures the QR renders correctly in both terminal and web interfaces.
236
+
212
237
  ## References
213
238
 
214
239
  For detailed tool documentation:
@@ -782,20 +782,40 @@ Mainnet asset verification via Pera Wallet API. Use to check if assets are legit
782
782
 
783
783
  ## ARC-26 URI Tools
784
784
 
785
- ### generate_algorand_uri
786
- - **Purpose**: Generate an Algorand payment URI and QR code per ARC-26 specification
785
+ ### generate_algorand_qrcode
786
+ - **Purpose**: Generate an Algorand top up payment or asset transferURI and QR code per ARC-26 specification
787
787
  - **Parameters**:
788
788
  ```json
789
789
  {
790
790
  "address": "receiver_address",
791
791
  "label": "Payment label",
792
792
  "amount": 1000000,
793
- "asset": 31566704,
793
+ "asset": 31566704,// optional, if asset transfer; omit or set to 0 for ALGO
794
794
  "note": "Payment note",
795
- "xnote": "Exclusive note"
795
+ "xnote": "Exclusive immutable note"
796
796
  }
797
797
  ```
798
- - **Returns**: URI string + SVG QR code
798
+ - **Returns**: UTF-8 text QR code (terminal-friendly), PNG image as base64 (web-friendly), URI string
799
+
800
+ ### QR Code Display
801
+
802
+ **Important:** MCP tool output may not render properly through mcporter → exec pipeline.
803
+ After calling the tool, **extract and paste the QR code directly in your response**:
804
+
805
+ 1. Call the tool and capture output
806
+ 2. Extract the UTF-8 QR block (Unicode block characters)
807
+ 3. Extract the base64 PNG data
808
+ 4. Include both in your reply:
809
+
810
+ ```
811
+ [paste UTF-8 QR here]
812
+ ```
813
+
814
+ ![QR Code](data:image/png;base64,[paste base64 here])
815
+
816
+ URI: `algorand://ADDRESS?amount=X&asset=Y`
817
+
818
+ This ensures the QR renders correctly in both terminal and web interfaces.
799
819
 
800
820
  ---
801
821
 
@@ -23,7 +23,7 @@ wallet_add_account {
23
23
 
24
24
  ### Step 3: If account needs funding
25
25
  ```
26
- generate_algorand_uri {
26
+ generate_algorand_qrcode {
27
27
  "address": "[wallet_address]",
28
28
  "amount": 5000000,
29
29
  "note": "Fund testnet account"
@@ -33,7 +33,7 @@ Or direct user to: https://lora.algokit.io/testnet/fund
33
33
 
34
34
  ### Step 4: If account needs USDC funding
35
35
  ```
36
- generate_algorand_uri {
36
+ generate_algorand_qrcode {
37
37
  "address": "[wallet_address]",
38
38
  "asset": 10458941, // USDC on testnet
39
39
  "amount": 1000000, // 1 USDC with 6 decimals
@@ -599,7 +599,7 @@ send_raw_transaction {
599
599
  When balance is insufficient, generate an ARC-26 QR code for easy funding:
600
600
 
601
601
  ```
602
- generate_algorand_uri {
602
+ generate_algorand_qrcode {
603
603
  "address": "[wallet_address]",
604
604
  "amount": 5000000,
605
605
  "note": "Fund account for transaction"