A simple OpenClaw plugin that fetches and displays X402 discovery resources.
- Fetches resources from the X402 discovery API
- Formats and displays the resources in a readable format
- Provides a CLI command
x402 discoverto access resources - Registers an AI tool for discovery operations
openclaw plugins install @openclaw/x402Restart the Gateway afterwards.
On your VPS:
mkdir -p ~/.openclaw/extensions
mkdir -p ~/plugins/On your Local Machine:
scp -r "D:\DigitalBenjamins\openclaw-plugin\x402\" trader@46.225.134.170:~/plugins/On your VPS:
cp -R ~/plugins/x402 ~/.openclaw/extensions/
cd ~/.openclaw/extensions/x402 && npm installAdd the following configuration to your OpenClaw config file (typically ~/.openclaw/config.json or similar):
{
"plugins": {
"allow": ["x402"],
"entries": {
"x402": {
"config": {
"enabled": true,
"apiEndpoint": "https://api.cdp.coinbase.com/platform/v2/x402/discovery/resources"
}
}
}
}
}Alternatively, you can configure the plugin through the OpenClaw UI if available.
Run the discover command to fetch and display X402 resources:
openclaw x402 discoverCall the plugin's gateway method:
// Example client code
const response = await gateway.request("x402.discover", {});
console.log(response);openclaw gateway call x402.discover
The plugin registers a tool that can be used by the AI:
Tool name: x402_discover
Parameters:
- command: String (optional) - Command to execute
MIT