在 Manus 中运行任何 Skill
一键导入
一键导入
一键在 Manus 中运行任何 Skill
开始使用$pwd:
x402-client
// Client for interacting with the x402 payment service when receiving HTTP 402 responses.
$ git log --oneline --stat
stars:0
forks:0
updated:2026年1月29日 02:03
SKILL.md
// Client for interacting with the x402 payment service when receiving HTTP 402 responses.
| name | x402-client |
| description | Client for interacting with the x402 payment service when receiving HTTP 402 responses. |
The X402 Client Skill enables seamless interaction with the X402 payment service. When a user's HTTP request returns a 402 status code, this skill will be triggered to handle the authentication process and facilitate secure payment transactions.
npm install https://github.com/second-state/x402-client.git
After obtaining the TARGET_URL and PRIVATE_KEY, execute the following script:
import { createX402Client } from "x402-client";
const PRIVATE_KEY = "0x<PRIVATE_KEY>";
const TARGET_URL = "<TARGET_URL>";
const NETWORK = "<NETWORK>";
if (!PRIVATE_KEY) throw new Error("Missing PRIVATE_KEY");
const client = await createX402Client({
chain: NETWORK,
privateKey: PRIVATE_KEY,
});
const response = await client.fetchWithPayment(TARGET_URL, { method: "GET" });
console.log("Response headers:", Object.fromEntries(response.headers));
console.log("Response body:", await response.text());
const paymentHeader = response.headers.get("x-payment-response");
if (paymentHeader) {
console.log("Decoded payment response:", client.decodePaymentResponse(paymentHeader));
}
Return the result of the Execute Script to the user.