Skip to content

feat: add spraay crypto payments agent example#20

Open
plagtech wants to merge 3 commits into
NVIDIA:mainfrom
plagtech:add-spraay-crypto-payments
Open

feat: add spraay crypto payments agent example#20
plagtech wants to merge 3 commits into
NVIDIA:mainfrom
plagtech:add-spraay-crypto-payments

Conversation

@plagtech

@plagtech plagtech commented Mar 22, 2026

Copy link
Copy Markdown

Add Spraay crypto payments agent example

Summary

This PR adds a Spraay Crypto Payments Agent example that demonstrates how to build an AI agent capable of executing cryptocurrency payments across 13 blockchains using the x402 protocol.

What It Does

The example provides 8 custom tools that connect to the Spraay x402 gateway (gateway.spraay.app), enabling any NeMo Agent Toolkit agent to:

  • Query tools (free): check gateway health, list routes/pricing, list supported chains, check wallet balances, get token prices
  • Action tools (paid via x402 USDC micropayment): batch-send tokens to multiple recipients, create milestone-based escrow contracts, discover robots/IoT devices via the Robot Task Protocol (RTP)

Why This Matters for Agent Toolkit Users

Agents that take action in the real world need to pay for things. The x402 protocol makes payments native to HTTP — agents pay per API request with USDC, no wallet UX required. This example shows how to integrate a payment layer into any NeMo Agent Toolkit workflow.

What's Included

examples/spraay_crypto_payments/
├── README.md                                    # Full documentation
├── pyproject.toml                               # Dependencies
├── configs/
│   └── config.yml                               # Workflow config (ReAct + 8 tools)
└── src/spraay_crypto_payments/
    ├── __init__.py                              # Tool registration
    └── spraay_tools.py                          # 8 async tools (httpx-based)

Quick Start

export NVIDIA_API_KEY=<your-key>
nat run --config_file configs/config.yml --input "What chains does Spraay support?"

Supported Chains

Base · Ethereum · Arbitrum · Polygon · BNB · Avalanche · Solana · Bitcoin · Stacks · Unichain · Plasma · BOB · Bittensor

Related

@copy-pr-bot

copy-pr-bot Bot commented Mar 22, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@willkill07 willkill07 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This example doesn't run. The code is invalid.

All examples should show sample runs with expected output.

@plagtech plagtech requested a review from a team as a code owner April 3, 2026 15:43
@plagtech

plagtech commented Apr 3, 2026

Copy link
Copy Markdown
Author

This example doesn't run. The code is invalid.

All examples should show sample runs with expected output.

Thanks for the review — I've rewritten the example to use the proper @register_function / FunctionBaseConfig / FunctionInfo pattern and added expected output to the README.

@willkill07

Copy link
Copy Markdown
Member

@plagtech DCO check has failed. Please ensure all commits are signed-off

Signed-off-by: plagtech <mngoswp@gmail.com>
Signed-off-by: plagtech <mngoswp@gmail.com>
@plagtech plagtech force-pushed the add-spraay-crypto-payments branch from 39dabb7 to 0fdfc7b Compare April 20, 2026 19:37
@plagtech

Copy link
Copy Markdown
Author

Thanks for the review. I've rewritten the example using the proper @register_function / FunctionBaseConfig / FunctionInfo pattern and added expected output to the README. DCO sign-off is now fixed as well.

@willkill07

Copy link
Copy Markdown
Member

/ok to test 0fdfc7b

Signed-off-by: plagtech <mngoswp@gmail.com>
@plagtech

plagtech commented May 7, 2026

Copy link
Copy Markdown
Author

Hi @willkill07 — just checking in on this. I believe the requested changes from the initial review have been addressed in the rewrite (proper @register_function / FunctionBaseConfig pattern, DCO sign-off, copyright headers). Is there anything else needed on my end?
Also worth noting — Spraay's x402 payment integration was recently merged into Google ADK, so this example connects to the same gateway already available in Google's agent framework.

@plagtech

plagtech commented Jun 4, 2026

Copy link
Copy Markdown
Author

Hi @willkill07 — friendly bump on this. CI was triggered on the rewrite back in April, wondering if there's any remaining feedback. Happy to make adjustments if needed

@willkill07

Copy link
Copy Markdown
Member

/ok to test 0a3e359

@willkill07 willkill07 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked through this again and believe that logic consolidation should occur. Prefer a function group over individual functions so they all share the same HTTP client.

Also, please address CI failures. If we can avoid hyper-specific language, we should.

Comment thread examples/spraay_crypto_payments/configs/config.yml
Comment thread examples/spraay_crypto_payments/configs/config.yml
@plagtech

plagtech commented Jun 5, 2026

Copy link
Copy Markdown
Author

Done — converted to a single @register_function_group with shared HTTP client. Config now references spraay as a group. Also renamed module to nat_spraay_crypto_payments per contributor guidelines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external This issue was filed by someone outside of the NeMo Agent toolkit team feature request New feature or request non-breaking Non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants