See the history of Hot Swaps on a Gateway domain for a specified CID. This can be called by any Pinata user for any Gateway domain and CID.

Usage

import { PinataSDK } from "pinata";

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

const history = await pinata.gateways.swapHistory({
  cid: "bafkreibbvdqf5ekc2crouowv7vtjbcmbjoiysegslmmqc6jrxbaa43xske",
  domain: "discordpinnie.mypinata.cloud"
})

Returns

SwapCidResponse[]

export type SwapCidResponse = {
	mappedCid: string;
	createdAt: string;
};

Parameters

Pass in the required parameters to get a swap history

cid

  • Type: string

The target CID for swap history

const history = await pinata.gateways.swapHistory({
  cid: "bafkreibbvdqf5ekc2crouowv7vtjbcmbjoiysegslmmqc6jrxbaa43xske",
})

domain

  • Type: string

The Gateway domain that has the Hot Swaps plugin installed

const history = await pinata.gateways.swapHistory({
  domain: "discordpinnie.mypinata.cloud"
})