Files
getSwapHistory
See the history of Hot Swaps on a Gateway domain for a specified CID.
Usage
import { PinataSDK } from "pinata";
const pinata = new PinataSDK({
pinataJwt: process.env.PINATA_JWT!,
pinataGateway: "example-gateway.mypinata.cloud",
});
const history = await pinata.files.getSwapHistory({
cid: "bafkreibbvdqf5ekc2crouowv7vtjbcmbjoiysegslmmqc6jrxbaa43xske",
domain: "discordpinnie.mypinata.cloud"
})
Returns
SwapCidResponse[]
export type SwapCidResponse = {
mapped_cid: string;
created_at: 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.files.getSwapHistory({
cid: "bafkreibbvdqf5ekc2crouowv7vtjbcmbjoiysegslmmqc6jrxbaa43xske",
})
domain
- Type:
string
The Gateway domain that has the Hot Swaps plugin installed
const history = await pinata.files.getSwapHistory({
domain: "discordpinnie.mypinata.cloud"
})