ipfs-http-client
Version:
A client library for the IPFS HTTP API
25 lines (20 loc) • 630 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var configure = require('./lib/configure.js');
var toUrlSearchParams = require('./lib/to-url-search-params.js');
const createResolve = configure.configure(api => {
async function resolve(path, options = {}) {
const res = await api.post('resolve', {
signal: options.signal,
searchParams: toUrlSearchParams.toUrlSearchParams({
arg: path,
...options
}),
headers: options.headers
});
const {Path} = await res.json();
return Path;
}
return resolve;
});
exports.createResolve = createResolve;