feat: add downloadProof method

This commit is contained in:
Derrick Hammer 2024-02-13 00:04:40 -05:00
parent 8e172ebef9
commit 39ccac179d
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 15 additions and 0 deletions

View File

@ -142,3 +142,18 @@ export async function downloadData(
}) })
).arrayBuffer(); ).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<ArrayBuffer> {
return this.downloadData(`${cid}.obao`, customOptions);
}