From 39ccac179d3d59d83f130ec18bcd908443b5a1e0 Mon Sep 17 00:00:00 2001 From: Derrick Hammer Date: Tue, 13 Feb 2024 00:04:40 -0500 Subject: [PATCH] feat: add downloadProof method --- src/methods/download.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/methods/download.ts b/src/methods/download.ts index e3b0d69..c7cfe83 100644 --- a/src/methods/download.ts +++ b/src/methods/download.ts @@ -142,3 +142,18 @@ export async function downloadData( }) ).arrayBuffer(); } + +/** + * Downloads a proof for the given cid. + * @param this - S5Client + * @param cid - 46-character cid, or a valid cid URL. + * @param [customOptions] - Additional settings that can optionally be set. + * @returns - The data + */ +export async function downloadProof( + this: S5Client, + cid: string, + customOptions: CustomDownloadOptions = {}, +): Promise { + return this.downloadData(`${cid}.obao`, customOptions); +}