Options
All
  • Public
  • Public/Protected
  • All
Menu

A set of API wrappers for Subsocial Network.

Index

Type aliases

FindStructsFns

FindStructsFns: { findPosts: (ids: AnyPostId[]) => Promise<PostData[]>; findProfiles: (ids: AnyAccountId[]) => Promise<ProfileData[]>; findSpaces: (ids: AnySpaceId[]) => Promise<SpaceData[]> }

Type declaration

SubsocialApiProps

SubsocialApiProps: SubsocialContext & { ipfsNodeUrl: string; offchainUrl: string; substrateApi: SubstrateApi }

SubsocialIpfsProps

SubsocialIpfsProps: SubsocialContext & { ipfsNodeUrl: IpfsUrl; offchainUrl: string }

SupportedSubstrateId

SupportedSubstrateId: SubstrateId | AnyAccountId | ReactionId

SupportedSubstrateResult

SupportedSubstrateResult: CommonStruct | SocialAccount | Reaction

Variables

Const Api

Api: typeof SubstrateConnect = ...

Functions

asAccountId

  • asAccountId(id: AnyAccountId): GenericAccountId | undefined

Const asIpfsCid

contentFilter

  • contentFilter<T>(__namedParameters: Props<T>): T[]

Const createResolveSubsocialApi

  • createResolveSubsocialApi(context: NewSubsocialApiProps): () => Promise<Api>

Const getApi

  • getApi(url: string): Promise<ApiPromise>

getCidsOfStructs

  • getCidsOfStructs(structs: HasIpfsCidSomewhere[]): string[]

getIpfsCidOfSocialAccount

getIpfsCidOfStruct

  • getIpfsCidOfStruct<S>(struct: S): string | undefined
  • Try to resolve a corresponding IPFS CID of a given struct.

    Type parameters

    • S: HasIpfsCidSomewhere

    Parameters

    • struct: S

    Returns string | undefined

Const getPostIdFromExtension

  • getPostIdFromExtension(postData?: HasPostStruct): PostId

Const getSharedPostId

  • getSharedPostId(postData: any): PostId

Const getUniqueIds

  • getUniqueIds<ID>(ids: ID[]): ID[]

Const isEmptyContent

  • isEmptyContent(struct?: StructWithHidden): boolean

Const isEmptyIpfsContent

  • isEmptyIpfsContent(struct?: HasContent): boolean

Const isHidden

  • isHidden(struct?: StructWithHidden): boolean

Const isIpfs

Const isPublic

  • isPublic(struct?: StructWithHidden): struct is StructWithHidden

Const isUnlisted

  • isUnlisted(struct?: StructWithHidden): boolean

Const isValidIpfsCid

  • isValidIpfsCid(cid: IpfsCid): boolean

Const isVisible

  • isVisible(struct?: StructWithHidden): struct is StructWithHidden

loadAndSetPostRelatedStructs

Const newSubsocialApi

  • newSubsocialApi(__namedParameters: NewSubsocialApiProps): Promise<Api>

Const notEmptyIpfsContent

  • notEmptyIpfsContent(struct?: HasContent): boolean

Const resolveCidOfContent

  • resolveCidOfContent(content?: Content): string

visibilityFilter

  • visibilityFilter<T>(structs: T[], filter?: Visibility): T[]