@ethersphere/bee-js
Version:
Javascript client for Bee
15 lines • 488 B
JavaScript
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'
});
}