kubo-rpc-client
Version:
A client library for the Kubo RPC API
51 lines • 1.36 kB
TypeScript
import type { HTTPRPCOptions } from '../index.js';
import type { HTTPRPCClient } from '../lib/core.js';
import type { Multiaddr } from '@multiformats/multiaddr';
export interface BootstrapAPI {
/**
* Add a peer address to the bootstrap list
*
* @example
* ```js
* const validIp4 = '/ip4/104....9z'
*
* const res = await ipfs.bootstrap.add(validIp4)
* console.log(res.Peers)
* // Logs:
* // ['/ip4/104....9z']
* ```
*/
add(addr: Multiaddr, options?: HTTPRPCOptions): Promise<{
Peers: Multiaddr[];
}>;
/**
* List all peer addresses in the bootstrap list
*
* @example
* ```js
* const res = await ipfs.bootstrap.list()
* console.log(res.Peers)
* // Logs:
* // [address1, address2, ...]
* ```
*/
list(options?: HTTPRPCOptions): Promise<{
Peers: Multiaddr[];
}>;
/**
* Remove a peer address from the bootstrap list
*
* @example
* ```js
* const res = await ipfs.bootstrap.list()
* console.log(res.Peers)
* // Logs:
* // [address1, address2, ...]
* ```
*/
rm(addr: Multiaddr, options?: HTTPRPCOptions): Promise<{
Peers: Multiaddr[];
}>;
}
export declare function createBootstrap(client: HTTPRPCClient): BootstrapAPI;
//# sourceMappingURL=index.d.ts.map