@subsocial/api
Version:
JavaScript API for Subsocial blockchain.
30 lines (29 loc) • 1.5 kB
TypeScript
import { SubsocialApiProps, RawPostData, RawSpaceData } from '../types';
import { SubsocialIpfsApi } from '../ipfs';
import { SubsocialSubstrateApi } from '../substrate';
import { FindPostQuery, FindSpacesQuery, FindPostsQuery, FindSpaceQuery } from '../filters';
/** Using this class, you can get all the data of posts, spaces and profiles from blockchain storages and ipfs */
export declare class InnerSubsocialApi {
/** Gives access to subsocial substrate api*/
private _substrate;
/** Gives access to subsocial ipfs api*/
private _ipfs;
constructor(props: SubsocialApiProps);
/** Accessors for private field {@link _substrate}*/
get substrate(): SubsocialSubstrateApi;
/** Accessors for private field {@link _ipfs}*/
get ipfs(): SubsocialIpfsApi;
/** Get an array of data from blockchain storages and ipfs that is passed in the parameters of the method
* @param findStructs gets an array of structures by ids
* @param findContents gets contents by cids
*/
private findDataArray;
/** Find and load an array of spaces */
findSpaces(filter: FindSpacesQuery): Promise<RawSpaceData[]>;
/** Find and load an array of posts */
findPosts(filter: FindPostsQuery): Promise<RawPostData[]>;
/** Find and load single space */
findSpace({ id, visibility }: FindSpaceQuery): Promise<RawSpaceData | undefined>;
/** Find and load single post */
findPost({ id, visibility }: FindPostQuery): Promise<RawPostData | undefined>;
}