From b1bf674f39f3912da07454b008204fd632277d91 Mon Sep 17 00:00:00 2001 From: Nick Koutrelakos Date: Wed, 1 Apr 2026 09:50:51 -0700 Subject: [PATCH 1/3] [new-plugin] uniswap-pay-with-any-token v2.0.0 --- .../uniswap-pay-with-any-token/LICENSE | 21 ++++++ .../uniswap-pay-with-any-token/README.md | 24 +++++++ .../uniswap-pay-with-any-token/plugin.yaml | 24 +++++++ .../uniswap-pay-with-any-token/SKILL.md | 70 +++++++++++++++++++ 4 files changed, 139 insertions(+) create mode 100644 submissions/uniswap-pay-with-any-token/LICENSE create mode 100644 submissions/uniswap-pay-with-any-token/README.md create mode 100644 submissions/uniswap-pay-with-any-token/plugin.yaml create mode 100644 submissions/uniswap-pay-with-any-token/skills/uniswap-pay-with-any-token/SKILL.md diff --git a/submissions/uniswap-pay-with-any-token/LICENSE b/submissions/uniswap-pay-with-any-token/LICENSE new file mode 100644 index 0000000..fb60be1 --- /dev/null +++ b/submissions/uniswap-pay-with-any-token/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2026 Uniswap Labs + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/submissions/uniswap-pay-with-any-token/README.md b/submissions/uniswap-pay-with-any-token/README.md new file mode 100644 index 0000000..56aaf94 --- /dev/null +++ b/submissions/uniswap-pay-with-any-token/README.md @@ -0,0 +1,24 @@ +# uniswap-pay-with-any-token + +Pay HTTP 402 payment challenges using any token via Tempo CLI and Uniswap Trading API, supporting MPP and x402 protocols + +## Source + +This skill is maintained by Uniswap Labs in the [uniswap-ai](https://github.com/uniswap/uniswap-ai) monorepo. + +The canonical source is at [`packages/plugins/uniswap-trading/skills/pay-with-any-token/`](https://github.com/uniswap/uniswap-ai/tree/main/packages/plugins/uniswap-trading/skills/pay-with-any-token). + +### What It Does + +- Handles HTTP 402 Payment Required responses using the Machine Payment Protocol (MPP) and x402 +- Swaps any held token to the required payment token via Uniswap Trading API +- Supports cross-chain bridging to Tempo for payment fulfillment + +### Related Skills + +- **uniswap-swap-integration**: Full swap integration guide for applications +- **uniswap-viem-integration**: Foundational EVM blockchain integration + +## License + +MIT diff --git a/submissions/uniswap-pay-with-any-token/plugin.yaml b/submissions/uniswap-pay-with-any-token/plugin.yaml new file mode 100644 index 0000000..5f9543e --- /dev/null +++ b/submissions/uniswap-pay-with-any-token/plugin.yaml @@ -0,0 +1,24 @@ +schema_version: 1 +name: uniswap-pay-with-any-token +version: "2.0.0" +description: "Pay HTTP 402 payment challenges using any token via Tempo CLI and Uniswap Trading API, supporting MPP and x402 protocols" +author: + name: "Uniswap Labs" + github: "wkoutre" +license: MIT +category: defi-protocol +tags: + - uniswap + - payments + - x402 + - mpp + - tempo + - defi + - ethereum + +components: + skill: + dir: skills/uniswap-pay-with-any-token + +api_calls: + - "trade-api.gateway.uniswap.org" diff --git a/submissions/uniswap-pay-with-any-token/skills/uniswap-pay-with-any-token/SKILL.md b/submissions/uniswap-pay-with-any-token/skills/uniswap-pay-with-any-token/SKILL.md new file mode 100644 index 0000000..ecf7844 --- /dev/null +++ b/submissions/uniswap-pay-with-any-token/skills/uniswap-pay-with-any-token/SKILL.md @@ -0,0 +1,70 @@ +--- +name: uniswap-pay-with-any-token +description: "Pay HTTP 402 payment challenges using any token via Tempo CLI and Uniswap Trading API" +version: "2.0.0" +author: "Uniswap Labs" +tags: + - uniswap + - payments + - x402 + - mpp +--- + +# Pay With Any Token + +Pay HTTP 402 Payment Required challenges using any token via the Tempo CLI and Uniswap Trading API. + +## Overview + +This skill handles HTTP 402 Payment Required responses by detecting the payment challenge (MPP or x402), swapping held tokens to the required payment token via Uniswap, constructing the payment credential, and retrying the original request. + +## Pre-flight Checks + +1. The `tempo` CLI is installed and a wallet is configured (`tempo wallet status`) +2. The wallet holds tokens on a supported chain +3. For cross-chain payments: bridging may be required + +## Commands + +### Detect Payment Challenge + +When an HTTP request returns 402, parse the `WWW-Authenticate` header or JSON body to extract: +- Required token address and amount +- Payment recipient address +- Network/chain ID + +### Swap to Required Token + +Use the Uniswap Trading API to swap held tokens to the required payment token: + +```bash +# Check what tokens the wallet holds +tempo wallet balance + +# The skill automatically handles the swap via Trading API +``` + +### Construct and Send Payment + +After obtaining the required token, construct the payment credential (EIP-3009 for MPP, or x402 format) and retry the original request with the payment attached. + +## Full Skill + +For the complete implementation with credential construction, nonce generation, EIP-3009 signing, cross-chain bridging, and retry logic: + +``` +npx skills add Uniswap/uniswap-ai +``` + +## Error Handling + +| Error | Cause | Resolution | +|-------|-------|------------| +| "Insufficient balance" | Not enough tokens to cover swap + payment | Check balance and top up wallet | +| "Unsupported chain" | Payment required on chain wallet is not on | Bridge tokens first | +| "Payment rejected" | Credential construction error | Verify nonce and signature params | + +## Skill Routing + +- For general swap integration -> use `uniswap-swap-integration` +- For viem/wagmi blockchain setup -> use `uniswap-viem-integration` From d55ffaa6bc32af30b0024a632714804a6021f23c Mon Sep 17 00:00:00 2001 From: Nick Koutrelakos Date: Wed, 1 Apr 2026 09:55:36 -0700 Subject: [PATCH 2/3] simplify SKILL.md to minimal stub pointing to canonical source --- .../uniswap-pay-with-any-token/SKILL.md | 59 ++----------------- 1 file changed, 4 insertions(+), 55 deletions(-) diff --git a/submissions/uniswap-pay-with-any-token/skills/uniswap-pay-with-any-token/SKILL.md b/submissions/uniswap-pay-with-any-token/skills/uniswap-pay-with-any-token/SKILL.md index ecf7844..a2dd0b7 100644 --- a/submissions/uniswap-pay-with-any-token/skills/uniswap-pay-with-any-token/SKILL.md +++ b/submissions/uniswap-pay-with-any-token/skills/uniswap-pay-with-any-token/SKILL.md @@ -5,66 +5,15 @@ version: "2.0.0" author: "Uniswap Labs" tags: - uniswap - - payments - - x402 - - mpp + - defi --- -# Pay With Any Token +# uniswap-pay-with-any-token -Pay HTTP 402 Payment Required challenges using any token via the Tempo CLI and Uniswap Trading API. - -## Overview - -This skill handles HTTP 402 Payment Required responses by detecting the payment challenge (MPP or x402), swapping held tokens to the required payment token via Uniswap, constructing the payment credential, and retrying the original request. - -## Pre-flight Checks - -1. The `tempo` CLI is installed and a wallet is configured (`tempo wallet status`) -2. The wallet holds tokens on a supported chain -3. For cross-chain payments: bridging may be required - -## Commands - -### Detect Payment Challenge - -When an HTTP request returns 402, parse the `WWW-Authenticate` header or JSON body to extract: -- Required token address and amount -- Payment recipient address -- Network/chain ID - -### Swap to Required Token - -Use the Uniswap Trading API to swap held tokens to the required payment token: - -```bash -# Check what tokens the wallet holds -tempo wallet balance - -# The skill automatically handles the swap via Trading API -``` - -### Construct and Send Payment - -After obtaining the required token, construct the payment credential (EIP-3009 for MPP, or x402 format) and retry the original request with the payment attached. - -## Full Skill - -For the complete implementation with credential construction, nonce generation, EIP-3009 signing, cross-chain bridging, and retry logic: +This skill is maintained by Uniswap Labs. Install the full version: ``` npx skills add Uniswap/uniswap-ai ``` -## Error Handling - -| Error | Cause | Resolution | -|-------|-------|------------| -| "Insufficient balance" | Not enough tokens to cover swap + payment | Check balance and top up wallet | -| "Unsupported chain" | Payment required on chain wallet is not on | Bridge tokens first | -| "Payment rejected" | Credential construction error | Verify nonce and signature params | - -## Skill Routing - -- For general swap integration -> use `uniswap-swap-integration` -- For viem/wagmi blockchain setup -> use `uniswap-viem-integration` +Source: [uniswap-ai/packages/plugins/uniswap-trading/skills/pay-with-any-token](https://github.com/uniswap/uniswap-ai/tree/main/packages/plugins/uniswap-trading/skills/pay-with-any-token) From d73b02f47329ed762e0cc904452fcf6c6512b8d0 Mon Sep 17 00:00:00 2001 From: Nick Koutrelakos Date: Wed, 1 Apr 2026 10:01:47 -0700 Subject: [PATCH 3/3] add per-plugin install command to stub --- .../skills/uniswap-pay-with-any-token/SKILL.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/submissions/uniswap-pay-with-any-token/skills/uniswap-pay-with-any-token/SKILL.md b/submissions/uniswap-pay-with-any-token/skills/uniswap-pay-with-any-token/SKILL.md index a2dd0b7..fcc01e6 100644 --- a/submissions/uniswap-pay-with-any-token/skills/uniswap-pay-with-any-token/SKILL.md +++ b/submissions/uniswap-pay-with-any-token/skills/uniswap-pay-with-any-token/SKILL.md @@ -16,4 +16,10 @@ This skill is maintained by Uniswap Labs. Install the full version: npx skills add Uniswap/uniswap-ai ``` +Or install just this plugin: + +``` +claude plugin add @uniswap/uniswap-trading +``` + Source: [uniswap-ai/packages/plugins/uniswap-trading/skills/pay-with-any-token](https://github.com/uniswap/uniswap-ai/tree/main/packages/plugins/uniswap-trading/skills/pay-with-any-token)