textiot
Version:
A framework for building web and native (IoT) Dapps on the IPFS network
40 lines (39 loc) • 1.23 kB
TypeScript
import { API } from '../core/api';
import { Peer, ApiOptions } from '../models';
/**
* Profile is an API module for accessing public profile information
*/
export default class Profile extends API {
private config;
private files;
constructor(opts?: ApiOptions);
/**
* Retrieve the local node's public profile peer information
* @returns The local node's peer information
*/
get(): Promise<Peer>;
/**
* Get the local node's public profile display name
* @returns Node's public profile display name
*/
name(): Promise<string>;
/**
* Set the local node's public profile display name
*
* @param name Username string
* @returns Whether the update was successful
*/
setName(name: string): Promise<boolean>;
/**
* Get the local node's public profile avatar image hash
* @returns Node's public profile avatar image hash
*/
avatar(): Promise<string>;
/**
* Set the local node's public profile avatar image
*
* @param image Image to use as new avatar. Can be any input type accepted by [[Files.add]].
* @returns Whether the update was successful
*/
setAvatar(image: any): Promise<boolean>;
}