ipfs-http-client
Version:
A client library for the IPFS HTTP API
28 lines (23 loc) • 748 B
JavaScript
;
Object.defineProperty(exports, '__esModule', { value: true });
var objectToCamel = require('../lib/object-to-camel.js');
var configure = require('../lib/configure.js');
var toUrlSearchParams = require('../lib/to-url-search-params.js');
const createRename = configure.configure(api => {
async function rename(oldName, newName, options = {}) {
const res = await api.post('key/rename', {
signal: options.signal,
searchParams: toUrlSearchParams.toUrlSearchParams({
arg: [
oldName,
newName
],
...options
}),
headers: options.headers
});
return objectToCamel.objectToCamel(await res.json());
}
return rename;
});
exports.createRename = createRename;