import { PinataSDK } from "pinata"; const pinata = new PinataSDK({ pinataJwt: process.env.PINATA_JWT!, pinataGateway: "example-gateway.mypinata.cloud", }); const instructions = await pinata.x402.listPaymentInstructions();
type PaymentInstructionListResponse = { data: { payment_instructions: PaymentInstruction[]; next_page_token?: string; }; }; type PaymentInstruction = { id: string; version: number; payment_requirements: PaymentRequirement[]; name: string; description?: string; created_at: string; }; type PaymentRequirement = { asset: string; pay_to: string; network: "base" | "base-sepolia" | "eip155:8453" | "eip155:84532"; amount: string; description?: string; };
number
const instructions = await pinata.x402.listPaymentInstructions({ limit: 10, });
string
const instructions = await pinata.x402.listPaymentInstructions({ pageToken: "MDE5MWIzZWYtM2U0Zi03YTY5LWE3OTQtOTRhZDE5NjQxMTk0", });
const instructions = await pinata.x402.listPaymentInstructions({ cid: "bafkreih5aznjvttude6c3wbvqeebb6rlx5wkbzyppv7garjiubll2ceym4", });
const instructions = await pinata.x402.listPaymentInstructions({ name: "Premium Content", });
const instructions = await pinata.x402.listPaymentInstructions({ id: "01234567-89ab-cdef-0123-456789abcdef", });