Add an EIP-712 signature to a CID

For more information about adding signatures to CIDs on IPFS please read the Signatures Guide.

Usage

import { PinataSDK } from "pinata-web3";

const pinata = new PinataSDK({
  pinataJwt: process.env.PINATA_JWT!,
  pinataGateway: "example-gateway.mypinata.cloud",
});

const signature = await pinata.signatures.add({
  cid: "QmXGeVy9dVwfuFJmvbzz8y4dYK1TdxXbDGzwbNuyZ5xXSU",
  signature: "0x1b...911b"
});

Returns

type SignatureResponse = {
  cid: string;
  signature: string;
};

Parameters

cid

  • Type: string

Target CID that you want to add a signature to.

const signature = await pinata.signatures.add({
  cid: "QmXGeVy9dVwfuFJmvbzz8y4dYK1TdxXbDGzwbNuyZ5xXSU",
});

signature

  • Type: 0x${string}

EIP-712 Signature to be assigned to target CID.

const signature = await pinata.signatures.add({
  signature: "0x1b...911b"
});