@goplausible/openclaw-algorand-plugin 1.2.0 → 1.3.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.
package/lib/x402-fetch.ts
CHANGED
|
@@ -36,17 +36,10 @@ const PAYMENT_INSTRUCTIONS = `To pay for this resource, follow these steps using
|
|
|
36
36
|
"algorand:wGHE2Pwdvd7S12BL5FaOP20EGYesN73ktiC1qzkkit8=" → "mainnet"
|
|
37
37
|
|
|
38
38
|
2. Build fee payer transaction (facilitator sponsors fees for the group):
|
|
39
|
-
make_payment_txn {
|
|
40
|
-
|
|
41
|
-
to: "<feePayer>",
|
|
42
|
-
amount: 0,
|
|
43
|
-
fee: 2000,
|
|
44
|
-
flatFee: true,
|
|
45
|
-
network: "<network>"
|
|
46
|
-
}
|
|
47
|
-
— fee: 2000 covers both transactions in the group (1000 each). flatFee: true prevents SDK override.
|
|
39
|
+
make_payment_txn { from: "<feePayer from accepts[].extra.feePayer>", to: "<feePayer>", amount: 0, fee: N×1000 (N=group size, e.g. 2000 for 2 txns), flatFee: true, network: "<network>" }
|
|
40
|
+
— NEVER set fee=0 on the fee payer — this causes "txgroup had 0 in fees" errors.
|
|
48
41
|
|
|
49
|
-
3. Build payment transaction
|
|
42
|
+
3. Build payment transaction:
|
|
50
43
|
— For native ALGO (asset "0"):
|
|
51
44
|
make_payment_txn { from: "<your_address>", to: "<payTo>", amount: <maxAmountRequired>, fee: 0, flatFee: true, network: "<network>" }
|
|
52
45
|
— For ASA (asset is ASA ID):
|
package/openclaw.plugin.json
CHANGED
|
@@ -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.
|
|
5
|
+
"version": "1.3.0",
|
|
6
6
|
"skills": [
|
|
7
7
|
"skills/algorand-development",
|
|
8
8
|
"skills/algorand-typescript",
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@ description: Interact with Algorand blockchain via the Algorand MCP server — w
|
|
|
5
5
|
|
|
6
6
|
# Algorand MCP Interaction
|
|
7
7
|
|
|
8
|
-
Interact with Algorand blockchain through the Algorand MCP server (
|
|
8
|
+
Interact with Algorand blockchain through the Algorand MCP server (104+ tools across 13 categories).
|
|
9
9
|
|
|
10
10
|
## Key Characteristics
|
|
11
11
|
|
|
@@ -162,6 +162,8 @@ For atomic (all-or-nothing) multi-transaction groups:
|
|
|
162
162
|
|
|
163
163
|
**Haystack Router** (3): `api_haystack_get_swap_quote`, `api_haystack_execute_swap`, `api_haystack_needs_optin` — DEX-aggregated swaps across Tinyman V2, Pact, Folks with optimal routing. See the **haystack-router-interaction** skill for detailed workflows and reference docs.
|
|
164
164
|
|
|
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
|
+
|
|
165
167
|
**ARC-26 URI** (1): `generate_algorand_uri`
|
|
166
168
|
|
|
167
169
|
**Knowledge Base** (1): `get_knowledge_doc`
|
|
@@ -174,13 +176,15 @@ API responses are paginated. All API tools accept optional `itemsPerPage` (defau
|
|
|
174
176
|
|
|
175
177
|
When `x402_fetch` returns HTTP 402 with `PaymentRequirements`, use the atomic group transaction pattern to build the payment:
|
|
176
178
|
|
|
177
|
-
1. Build fee payer transaction
|
|
178
|
-
2. Build payment transaction
|
|
179
|
+
1. Build fee payer transaction: `make_payment_txn` with from=feePayer, to=feePayer, amount=0, **fee=N×1000** (N=group size, e.g. 2000 for 2 txns), **flatFee=true**
|
|
180
|
+
2. Build payment transaction: `make_payment_txn` or `make_asset_transfer_txn` to `payTo`, **fee=0**, **flatFee=true**
|
|
179
181
|
3. Group both transactions with `assign_group_id`
|
|
180
|
-
4. Sign only the payment transaction (index 1) with
|
|
182
|
+
4. Sign only the payment transaction (index 1) with `wallet_sign_transaction` — leave fee payer unsigned
|
|
181
183
|
5. Encode the unsigned fee payer transaction (index 0) with `encode_unsigned_transaction`
|
|
182
184
|
6. Construct PAYMENT-SIGNATURE JSON payload — **must include `accepted` field** (the exact `accepts[]` entry chosen) — and retry with `x402_fetch`
|
|
183
185
|
|
|
186
|
+
> **IMPORTANT: Fee Abstraction** — Pass `fee` and `flatFee` directly as input parameters to `make_*_txn` tools. Fee payer: `fee=N×1000`, `flatFee=true`. Payment: `fee=0`, `flatFee=true`. NEVER set fee=0 on the fee payer — this causes "txgroup had 0 in fees" errors.
|
|
187
|
+
|
|
184
188
|
**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.
|
|
185
189
|
|
|
186
190
|
**Critical — Base64 blob handling**: When constructing the `paymentHeader` JSON string for `x402_fetch`, NEVER manually re-type or partially copy base64 blob strings. Use the EXACT `bytes` value from `encode_unsigned_transaction` and the EXACT `blob` value from `wallet_sign_transaction` — copy each complete value verbatim into the `paymentGroup` array. Even a single character corruption (e.g., `5` → `4`) causes "signature does not match sender" errors and the payment will be rejected.
|
|
@@ -206,7 +210,7 @@ When using NFD (`.algo` names), always use the `depositAccount` field from the N
|
|
|
206
210
|
- **Mainnet = real value** — always confirm with user before mainnet transactions
|
|
207
211
|
- Never log, display, or store mnemonics or secret keys — use `wallet_*` tools for signing
|
|
208
212
|
- Verify recipient addresses with `validate_address` — transactions are irreversible
|
|
209
|
-
- Verify asset IDs on-chain — scam tokens use similar names
|
|
213
|
+
- Verify asset IDs on-chain and check verification tier with `api_pera_asset_verification_status` — scam tokens use similar names
|
|
210
214
|
- Respect wallet spending limits — if rejected, inform user rather than bypassing
|
|
211
215
|
|
|
212
216
|
## Links
|
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
8. [NFDomains API Tools](#nfdomains-api-tools)
|
|
16
16
|
9. [Tinyman DEX API Tools](#tinyman-dex-api-tools)
|
|
17
17
|
10. [Haystack Router Tools](#haystack-router-tools)
|
|
18
|
-
11. [
|
|
19
|
-
12. [
|
|
18
|
+
11. [Pera Asset Verification Tools](#pera-asset-verification-tools)
|
|
19
|
+
12. [ARC-26 URI Tools](#arc-26-uri-tools)
|
|
20
|
+
13. [Knowledge Base Tools](#knowledge-base-tools)
|
|
20
21
|
|
|
21
22
|
---
|
|
22
23
|
|
|
@@ -199,17 +200,16 @@ Build unsigned transaction objects. Must be signed before submission.
|
|
|
199
200
|
"from": "sender_address",
|
|
200
201
|
"to": "receiver_address",
|
|
201
202
|
"amount": 1000000,
|
|
202
|
-
"note": "optional note",
|
|
203
203
|
"fee": 1000,
|
|
204
204
|
"flatFee": false,
|
|
205
|
+
"note": "optional note",
|
|
205
206
|
"closeRemainderTo": "optional",
|
|
206
207
|
"rekeyTo": "optional",
|
|
207
208
|
"network": "testnet"
|
|
208
209
|
}
|
|
209
210
|
```
|
|
210
211
|
> Amount in microAlgos: 1 ALGO = 1,000,000
|
|
211
|
-
> `fee` (optional): transaction fee in microAlgos
|
|
212
|
-
> `flatFee` (optional): if `true`, use `fee` exactly as specified; if `false` (default), SDK may adjust fee based on transaction size.
|
|
212
|
+
> `fee` (optional): transaction fee in microAlgos (default: suggested fee). `flatFee` (optional): if true, use exact fee value instead of suggested fee.
|
|
213
213
|
|
|
214
214
|
### make_keyreg_txn
|
|
215
215
|
- **Purpose**: Create a key registration transaction for consensus participation
|
|
@@ -295,8 +295,7 @@ Build unsigned transaction objects. Must be signed before submission.
|
|
|
295
295
|
"network": "testnet"
|
|
296
296
|
}
|
|
297
297
|
```
|
|
298
|
-
> `fee` (optional): transaction fee in microAlgos
|
|
299
|
-
> `flatFee` (optional): if `true`, use `fee` exactly as specified; if `false` (default), SDK may adjust fee based on transaction size.
|
|
298
|
+
> `fee` (optional): transaction fee in microAlgos (default: suggested fee). `flatFee` (optional): if true, use exact fee value instead of suggested fee.
|
|
300
299
|
|
|
301
300
|
### make_app_create_txn
|
|
302
301
|
- **Purpose**: Deploy a smart contract
|
|
@@ -738,6 +737,34 @@ DEX-aggregated swaps across Tinyman V2, Pact, and Folks with smart order routing
|
|
|
738
737
|
|
|
739
738
|
---
|
|
740
739
|
|
|
740
|
+
## Pera Asset Verification Tools
|
|
741
|
+
|
|
742
|
+
Mainnet asset verification via Pera Wallet API. Use to check if assets are legitimate before transacting.
|
|
743
|
+
|
|
744
|
+
### api_pera_asset_verification_status
|
|
745
|
+
- **Purpose**: Get the verification tier of a mainnet asset (verified, trusted, suspicious, unverified)
|
|
746
|
+
- **Parameters**: `{ "assetId": 31566704 }`
|
|
747
|
+
- **Returns**: `{ asset_id, verification_tier, explorer_url }`
|
|
748
|
+
- **Note**: Mainnet only. Returns `"unverified"` for unknown assets.
|
|
749
|
+
|
|
750
|
+
### api_pera_verified_asset_details
|
|
751
|
+
- **Purpose**: Get detailed asset info including name, unit name, decimals, total supply, USD value, logo, verification tier, and collectible status
|
|
752
|
+
- **Parameters**: `{ "assetId": 31566704 }`
|
|
753
|
+
- **Returns**: Full asset object with `name`, `unit_name`, `fraction_decimals`, `total`, `usd_value`, `logo`, `verification_tier`, `is_collectible`, `creator_address`, etc.
|
|
754
|
+
|
|
755
|
+
### api_pera_verified_asset_search
|
|
756
|
+
- **Purpose**: Search mainnet assets by name, unit name, or keyword with optional verification filter
|
|
757
|
+
- **Parameters**:
|
|
758
|
+
```json
|
|
759
|
+
{
|
|
760
|
+
"query": "USDC",
|
|
761
|
+
"verifiedOnly": true
|
|
762
|
+
}
|
|
763
|
+
```
|
|
764
|
+
- **Returns**: Array of `{ asset_id, name, unit_name, decimals, verification_tier, usd_value, logo, creator_address, is_deleted }`
|
|
765
|
+
|
|
766
|
+
---
|
|
767
|
+
|
|
741
768
|
## ARC-26 URI Tools
|
|
742
769
|
|
|
743
770
|
### generate_algorand_uri
|
|
@@ -447,6 +447,31 @@ api_haystack_execute_swap {
|
|
|
447
447
|
|
|
448
448
|
---
|
|
449
449
|
|
|
450
|
+
## Verify an Asset (Pera)
|
|
451
|
+
|
|
452
|
+
Check if an asset is legitimate before transacting — mainnet only.
|
|
453
|
+
|
|
454
|
+
### Check verification status
|
|
455
|
+
```
|
|
456
|
+
api_pera_asset_verification_status { "assetId": 31566704 }
|
|
457
|
+
```
|
|
458
|
+
> Returns: `{ asset_id: 31566704, verification_tier: "verified", explorer_url: "..." }`
|
|
459
|
+
> Tiers: `verified` (highest), `trusted`, `suspicious`, `unverified`
|
|
460
|
+
|
|
461
|
+
### Get detailed asset info with USD value
|
|
462
|
+
```
|
|
463
|
+
api_pera_verified_asset_details { "assetId": 31566704 }
|
|
464
|
+
```
|
|
465
|
+
> Returns: name, unit name, decimals, total supply, USD value, logo, verification tier
|
|
466
|
+
|
|
467
|
+
### Search for verified assets
|
|
468
|
+
```
|
|
469
|
+
api_pera_verified_asset_search { "query": "USDC", "verifiedOnly": true }
|
|
470
|
+
```
|
|
471
|
+
> Returns array of matching assets filtered to verified/trusted only
|
|
472
|
+
|
|
473
|
+
---
|
|
474
|
+
|
|
450
475
|
## Using the Knowledge Base
|
|
451
476
|
|
|
452
477
|
### Get a specific document
|
|
@@ -602,7 +627,8 @@ wallet_get_info { "network": "<network>" }
|
|
|
602
627
|
|
|
603
628
|
### Step 2: Build fee payer transaction
|
|
604
629
|
|
|
605
|
-
The facilitator sponsors fees for the entire group.
|
|
630
|
+
The facilitator sponsors fees for the entire group. The fee payer's `fee` must equal **N × 1000 µAlgo** (N = total transactions in group). For a 2-txn group: fee = 2 × 1000 = **2000**. NEVER set fee=0 on the fee payer.
|
|
631
|
+
|
|
606
632
|
```
|
|
607
633
|
make_payment_txn {
|
|
608
634
|
"from": "<feePayer>",
|
|
@@ -616,7 +642,7 @@ make_payment_txn {
|
|
|
616
642
|
|
|
617
643
|
### Step 3: Build payment transaction
|
|
618
644
|
|
|
619
|
-
The payment transaction fee is 0 since the facilitator covers it.
|
|
645
|
+
The payment transaction fee is 0 since the facilitator covers it.
|
|
620
646
|
|
|
621
647
|
**For native ALGO (asset = "0"):**
|
|
622
648
|
```
|