Skip to content

Commit 8833159

Browse files
authored
Merge pull request #87 from 0xPolygon/fix/polygon-discovery-prerequisites
feat(skill): add prerequisites check to polygon-discovery skill
2 parents 0e7c291 + d16d6fa commit 8833159

3 files changed

Lines changed: 66 additions & 0 deletions

File tree

  • packages
    • connector-ui/public/skills/polygon-discovery
    • polygon-agent-cli/skills/polygon-discovery
  • skills/polygon-discovery

packages/connector-ui/public/skills/polygon-discovery/SKILL.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,28 @@ Pay-per-call APIs accessible via `x402-pay`. No API keys or subscriptions — ea
1111

1212
---
1313

14+
## Prerequisites — Check Before Any x402 Call
15+
16+
Before running any `x402-pay` command, verify the wallet session exists and is funded:
17+
18+
```bash
19+
# Check if a wallet is configured
20+
polygon-agent wallet list
21+
```
22+
23+
**If no wallet is listed**, the smart session has not been created. Run through the complete setup flow before proceeding:
24+
25+
1. `polygon-agent setup --name "MyAgent"` — creates EOA and Sequence project
26+
2. `polygon-agent wallet create --usdc-limit 100` — opens browser for session approval; enter the 6-digit code when prompted
27+
3. `polygon-agent wallet address` — get address, then fund via https://agentconnect.polygon.technology
28+
4. `polygon-agent balances` — confirm USDC is available before calling any x402 endpoint
29+
30+
**If a wallet exists but `balances` shows 0 USDC**, direct the user to fund it via the UI — `x402-pay` will fail with an EOA funding error otherwise.
31+
32+
Once a funded wallet is confirmed, proceed with the x402 calls below.
33+
34+
---
35+
1436
## Read Twitter/X Profile
1537

1638
$0.005 USDC per call.

packages/polygon-agent-cli/skills/polygon-discovery/SKILL.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,28 @@ Pay-per-call APIs accessible via `x402-pay`. No API keys or subscriptions — ea
1111

1212
---
1313

14+
## Prerequisites — Check Before Any x402 Call
15+
16+
Before running any `x402-pay` command, verify the wallet session exists and is funded:
17+
18+
```bash
19+
# Check if a wallet is configured
20+
polygon-agent wallet list
21+
```
22+
23+
**If no wallet is listed**, the smart session has not been created. Run through the complete setup flow before proceeding:
24+
25+
1. `polygon-agent setup --name "MyAgent"` — creates EOA and Sequence project
26+
2. `polygon-agent wallet create --usdc-limit 100` — opens browser for session approval; enter the 6-digit code when prompted
27+
3. `polygon-agent wallet address` — get address, then fund via https://agentconnect.polygon.technology
28+
4. `polygon-agent balances` — confirm USDC is available before calling any x402 endpoint
29+
30+
**If a wallet exists but `balances` shows 0 USDC**, direct the user to fund it via the UI — `x402-pay` will fail with an EOA funding error otherwise.
31+
32+
Once a funded wallet is confirmed, proceed with the x402 calls below.
33+
34+
---
35+
1436
## Read Twitter/X Profile
1537

1638
$0.005 USDC per call.

skills/polygon-discovery/SKILL.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,28 @@ Pay-per-call APIs accessible via `x402-pay`. No API keys or subscriptions — ea
1111

1212
---
1313

14+
## Prerequisites — Check Before Any x402 Call
15+
16+
Before running any `x402-pay` command, verify the wallet session exists and is funded:
17+
18+
```bash
19+
# Check if a wallet is configured
20+
polygon-agent wallet list
21+
```
22+
23+
**If no wallet is listed**, the smart session has not been created. Run through the complete setup flow before proceeding:
24+
25+
1. `polygon-agent setup --name "MyAgent"` — creates EOA and Sequence project
26+
2. `polygon-agent wallet create --usdc-limit 100` — opens browser for session approval; enter the 6-digit code when prompted
27+
3. `polygon-agent wallet address` — get address, then fund via https://agentconnect.polygon.technology
28+
4. `polygon-agent balances` — confirm USDC is available before calling any x402 endpoint
29+
30+
**If a wallet exists but `balances` shows 0 USDC**, direct the user to fund it via the UI — `x402-pay` will fail with an EOA funding error otherwise.
31+
32+
Once a funded wallet is confirmed, proceed with the x402 calls below.
33+
34+
---
35+
1436
## Read Twitter/X Profile
1537

1638
$0.005 USDC per call.

0 commit comments

Comments
 (0)