*headers not needed

This commit is contained in:
Derrick Hammer 2022-08-05 09:50:59 -04:00
parent bd27bf47f1
commit 80f6103180
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
1 changed files with 6 additions and 8 deletions

View File

@ -33,39 +33,37 @@ export async function refreshGatewayList() {
export async function fetchIpfs( export async function fetchIpfs(
hash: string, hash: string,
path = "", path = "",
headers = {},
receiveUpdate: DataFn receiveUpdate: DataFn
) { ) {
if (!ipfsPath(`/ipfs/{${hash}`)) { if (!ipfsPath(`/ipfs/{${hash}`)) {
throw new Error("Invalid hash"); throw new Error("Invalid hash");
} }
return doFetch("fetchIpfs", { hash, path, headers }, receiveUpdate); return doFetch("fetchIpfs", { hash, path }, receiveUpdate);
} }
export async function statIpfs(hash: string, path = "", headers = {}) { export async function statIpfs(hash: string, path = "") {
if (!ipfsPath(`/ipfs/{${hash}`)) { if (!ipfsPath(`/ipfs/{${hash}`)) {
throw new Error("Invalid hash"); throw new Error("Invalid hash");
} }
return doFetch("statIpfs", { hash, path, headers }); return doFetch("statIpfs", { hash, path });
} }
export async function fetchIpns( export async function fetchIpns(
hash: string, hash: string,
path = "", path = "",
headers = {},
receiveUpdate: DataFn receiveUpdate: DataFn
) { ) {
if (!ipnsPath(`/ipns/{${hash}`)) { if (!ipnsPath(`/ipns/{${hash}`)) {
throw new Error("Invalid hash"); throw new Error("Invalid hash");
} }
return doFetch("fetchIpns", { hash, path, headers }, receiveUpdate); return doFetch("fetchIpns", { hash, path }, receiveUpdate);
} }
export async function statIpns(hash: string, path = "", headers = {}) { export async function statIpns(hash: string, path = "") {
if (!ipnsPath(`/ipns/{${hash}`)) { if (!ipnsPath(`/ipns/{${hash}`)) {
throw new Error("Invalid hash"); throw new Error("Invalid hash");
} }
return doFetch("statIpns", { hash, path, headers }); return doFetch("statIpns", { hash, path });
} }
async function doFetch(method: string, data: any, receiveUpdate?: DataFn) { async function doFetch(method: string, data: any, receiveUpdate?: DataFn) {