UNPKG

@ethersphere/bee-js

Version:
15 lines 488 B
import { Types } from 'cafe-utility'; import { http } from "../utils/http.js"; const RCHASH_ENDPOINT = 'rchash'; export async function rchash(requestOptions, depth, anchor1, anchor2) { const response = await http(requestOptions, { responseType: 'json', url: `${RCHASH_ENDPOINT}/${depth}/${anchor1}/${anchor2}` }); const body = Types.asObject(response.data, { name: 'response.data' }); return Types.asNumber(body.durationSeconds, { name: 'durationSeconds' }); }