feat: add injective-x402-payment skill#14
Conversation
|
Warning Review limit reached
More reviews will be available in 34 minutes and 44 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR introduces documentation for the injective-x402-payment skill, defining how to use x402 (HTTP 402 Payment Required) on Injective with USDC payments. The SKILL.md file includes skill metadata, an overview of x402 mechanics, MCP-based workflow with the x402_fetch tool, example call scenarios, and required prerequisites. ChangesInjective x402 Payment Skill
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@skills/injective-x402-payment/SKILL.md`:
- Line 29: Update the SKILL.md entry for the password input to include explicit
secret-handling guidance: for the **password** keystore field (used by the
payment flow), state that it must never be logged, echoed, stored in
prompts/history, or persisted in any files or telemetry, and instruct
integrators to supply it only via secure secret input channels (e.g., secrets
manager or secret input widget) and to redact it from any debug output; also add
a short example note about using environment variables or secret stores rather
than inline literals.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 926883e1-9254-4944-95d3-b73067344d62
📒 Files selected for processing (1)
skills/injective-x402-payment/SKILL.md
| Example: | ||
| When calling an endpoint like `https://agents.injective.com/x402/perps`, the server will return a 402 quote. The MCP tool will handle signing a USDC transfer on Injective EVM to the facilitator and return the final data payload. | ||
|
|
||
| ## Prerequisites |
There was a problem hiding this comment.
needs to state that the Injective MCP server needs to be running.
perhaps reference the existing skill for how to set that up: https://github.com/InjectiveLabs/agent-skills/blob/master/skills/injective-mcp-servers/SKILL.md
| ## Prerequisites | ||
| - EVM wallet connected to Injective network | ||
| - A small amount of USDC for payments | ||
| - INJ tokens for gas fees |
There was a problem hiding this comment.
| - INJ tokens for gas fees | |
| - INJ to pay network transaction fees |
note that INJ is not a token, but rather a cryptocurrency.
| - **maxAmount**: (Optional) A safety limit on the maximum USDC amount you are willing to pay for this request. | ||
|
|
||
| Example: | ||
| When calling an endpoint like `https://agents.injective.com/x402/perps`, the server will return a 402 quote. The MCP tool will handle signing a USDC transfer on Injective EVM to the facilitator and return the final data payload. |
There was a problem hiding this comment.
| When calling an endpoint like `https://agents.injective.com/x402/perps`, the server will return a 402 quote. The MCP tool will handle signing a USDC transfer on Injective EVM to the facilitator and return the final data payload. | |
| When calling an endpoint like `https://agents.injective.com/x402/perps`, the server will return an x402 quote. The MCP tool will handle signing a USDC transfer on Injective EVM to the facilitator and return the final data payload. |
| - **address**: Your Injective wallet address. | ||
| - **password**: Your keystore password to authorize the payment. | ||
| - **url**: The URL of the x402-gated endpoint you wish to call. | ||
| - **maxAmount**: (Optional) A safety limit on the maximum USDC amount you are willing to pay for this request. |
There was a problem hiding this comment.
related to: InjectiveLabs/mcp-server#12 (comment)
needs to be implemented not here, but rather in the MCP server tool
There was a problem hiding this comment.
Pull request overview
This PR adds a new injective-x402-payment skill document intended to guide agents in paying for x402-gated HTTP endpoints on Injective EVM using USDC.
Changes:
- Added a new skill (
injective-x402-payment) with a short overview and workflow for x402-based payments. - Documented intended usage of an
x402_fetchMCP tool (including parameters and an example endpoint). - Listed basic prerequisites (wallet + USDC + INJ for gas).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| --- | ||
| name: injective-x402-payment | ||
| description: Use x402 on Injective to pay for AI services and gated API endpoints directly from the terminal or MCP using USDC. | ||
| license: Apache-2.0 | ||
| metadata: | ||
| author: zed | ||
| version: "1.0.0" | ||
| --- |
| The Injective MCP server provides a tool to fetch data from an x402-protected endpoint: | ||
|
|
||
| - `x402_fetch` - Automatically fetches an x402-gated URL, signs the payment using your Injective EVM wallet if a 402 Payment Required is returned, submits the payment receipt via the facilitator, and retries the request to deliver the gated data. |
Overview
gated API endpoints and services using the x402 protocol on Injective EVM.
Changes Made
without the need for API keys or prior registration.
Why
allows endpoints to quote a price, and agents to programmatically settle that cost per-request in ~650ms on
Injective EVM. This skill bridges that capability so agents know exactly how to trigger those payments via MCP.
Summary by CodeRabbit