Usage
Returns
Parameters
Filter response with the following optional parameters.limit
- Type:
number
pageToken
- Type:
string
cid
- Type:
string
name
- Type:
string
id
- Type:
string
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
Pinata SDK x402.paymentInstructions.list returns and filters every x402 payment instruction on your Pinata account for monetized private files.
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;
};
numberconst instructions = await pinata.x402.listPaymentInstructions({
limit: 10,
});
stringconst instructions = await pinata.x402.listPaymentInstructions({
pageToken: "MDE5MWIzZWYtM2U0Zi03YTY5LWE3OTQtOTRhZDE5NjQxMTk0",
});
stringconst instructions = await pinata.x402.listPaymentInstructions({
cid: "bafkreih5aznjvttude6c3wbvqeebb6rlx5wkbzyppv7garjiubll2ceym4",
});
stringconst instructions = await pinata.x402.listPaymentInstructions({
name: "Premium Content",
});
stringconst instructions = await pinata.x402.listPaymentInstructions({
id: "01234567-89ab-cdef-0123-456789abcdef",
});