Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Nexus

Hierarchy

  • Nexus

Index

Constructors

constructor

  • Parameters

    Returns Nexus

Properties

Readonly client

client: Client

Methods

accountNotifications

  • accountNotifications(account: string, min_score?: number, last_id?: number | null, limit?: number): Promise<NexusAccountNotifications[]>
  • Return array of account notification objects for the account passed.

    Returned values for type:

    • new_community - a new community was created
    • set_role - mod/admin adds a role to an account
    • set_props - properties set for a community
    • set_label - a title/badge/label has been set for an account
    • mute_post - a post has been muted, with a reason
    • unmute_post - a post has been unmuted, with a reason
    • pin_post - a post has been pinned
    • unpin_post - a post has been unpinned
    • flag_post - a post has been flagged by a member, with a reason
    • error - provides feedback to developers for ops that cannot be interpreted
    • subscribe - an account has subscribed to a community
    • reply - a post has been replied to
    • reblog - a post has been reblogged/reblogged
    • follow - an account has followed another account
    • mention - author mentions an account
    • vote - voter votes for an author

    The score value is based on the originating account’s rank.

    Parameters

    • account: string

      The account to fetch.

    • Default value min_score: number = 25

      Minimum score of notification, default: 25 [optional].

    • Default value last_id: number | null = null

      Last notification ID, paging mechanism [optional].

    • Default value limit: number = 100

      Number of results, default: 100 [optional].

    Returns Promise<NexusAccountNotifications[]>

call

  • call(method: string, params?: any[] | {}): Promise<any>
  • Convenience for calling bridge.

    Parameters

    • method: string
    • Optional params: any[] | {}

    Returns Promise<any>

getAccountPosts

  • getAccountPosts(sort: "blog" | "feed" | "posts" | "comments" | "replies" | "payout", account: string, start_author: string | null, start_permlink: string | null, limit: number, observer?: string | null): Promise<NexusPost[]>
  • Return a list of posts related to a given account.

    Parameters

    • sort: "blog" | "feed" | "posts" | "comments" | "replies" | "payout"

      Values accepted:

      • blog: top posts authored by given account (excluding posts to communities - unless explicitely reblogged) plus reblogs ranked by creation/reblog time.
      • feed: top posts from blogs of accounts that given account is following ranked by creation/reblog time, not older than last month.
      • posts: top posts authored by given account, newer first comments - replies authored by given account, newer first.
      • comments:
      • replies: replies to posts of given account, newer first.
      • payout: all posts authored by given account that were not yet cashed out.
    • account: string

      The account to fetch.

    • start_author: string | null

      Name of author to start from, used for paging. Should be used in conjunction with start_permlink.

    • start_permlink: string | null

      Permalink of post to start from, used for paging. Should be used in conjunction with start_author.

    • limit: number

      Number of results, max 1000.

    • Default value observer: string | null = null

      A valid account [optional].

    Returns Promise<NexusPost[]>

getCommunity

  • Gets the full community object. Includes metadata, leadership team. If observer is provided, get subcription status, user title, user role.

    Parameters

    • name: string

      The community account to fetch.

    • Default value observer: string | null = null

      A valid account [optional].

    Returns Promise<NexusCommunityExtended>

getCommunityContext

  • For a community/account: returns role, title, subscribed state.

    Parameters

    • name: string

      The community account concerned.

    • account: string

      The account to fetch.

    Returns Promise<NexusCommunityContext>

getDiscussion

  • getDiscussion(author: string, permlink: string): Promise<{}>
  • Gives a flattened discussion tree starting at given post. Modified get_state thread implementation. Returns an Object whose key is "author/permlink".

    Parameters

    • author: string
    • permlink: string

    Returns Promise<{}>

getPayoutStats

  • Get payout stats for building treemap.

    Parameters

    • Default value limit: number = 250

      Number of result, default: 250 [optional].

    Returns Promise<NexusPayoutStats>

getPost

  • getPost(author: string, permlink: string, observer?: string | null): Promise<NexusPost>
  • Fetch a single post.

    Parameters

    • author: string
    • permlink: string
    • Default value observer: string | null = null

    Returns Promise<NexusPost>

getProfile

  • getProfile(account: string, observer?: string | null): Promise<NexusProfile>
  • Returns a resume of a profile with metadata parsed.

    Parameters

    • account: string
    • Default value observer: string | null = null

    Returns Promise<NexusProfile>

getRankedPosts

  • getRankedPosts(sort: NexusSortGetRankedPost, start_author?: string | null, start_permlink?: string | null, limit?: number, tag?: string | null, observer?: string | null): Promise<NexusPost[]>
  • Query posts, sorted by given method.

    Parameters

    • sort: NexusSortGetRankedPost

      Sorting of results, valid options are: 'trending', 'hot', 'created', 'promoted', 'payout', 'payout_comments', 'muted'.

    • Default value start_author: string | null = null

      Name of author to start from, used for paging. Should be used in conjunction with start_permlink [optional].

    • Default value start_permlink: string | null = null

      Permalink of post to start from, used for paging. Should be used in conjunction with start_author [optional].

    • Default value limit: number = 20

      Number of results, default: 20 [optional].

    • Default value tag: string | null = null

      Specify a Tag [optional].

    • Default value observer: string | null = null

      A valid account [optional].

    Returns Promise<NexusPost[]>

listAllSubscriptions

  • listAllSubscriptions(account: string): Promise<[string, string, string, string | null][]>
  • Returns a lists of all communities account subscribes to, plus role and title in each. The content of a community account subscribes to is [community name, community title, role_id, title].

    Parameters

    • account: string

      The account to fetch.

    Returns Promise<[string, string, string, string | null][]>

listCommunities

  • listCommunities(last?: string | null, limit?: number, query?: string | null, sort?: "rank" | "new" | "subs", observer?: string | null): Promise<NexusCommunity[]>
  • Returns a list of communities.

    Parameters

    • Default value last: string | null = null

      Name of community, paging mechanism [optional].

    • Default value limit: number = 100

      Number of listed communities, default: 100 [optional].

    • Default value query: string | null = null

      Filters against title and about community fields [optional].

    • Default value sort: "rank" | "new" | "subs" = "rank"

      Sorting of results, default: rank [optional].

      • rank: sort by community rank.
      • new: sort by newest community.
      • subs: sort by subscriptions.
    • Default value observer: string | null = null

      A valid account [optional].

    Returns Promise<NexusCommunity[]>

listCommunityRoles

  • listCommunityRoles(community: string, last?: string | null, limit?: number): Promise<[string, string, string | null][]>
  • Returns a list of community account-roles (anyone with non-guest status). The content of a community account-roles array is [community name, role_id, title].

    Parameters

    • community: string

      Community category name (account).

    • Default value last: string | null = null

      Name of subscriber, paging mechanism [optional].

    • Default value limit: number = 100

      limit Number of listed communities, default: 100 [optional].

    Returns Promise<[string, string, string | null][]>

listPopComunities

  • listPopComunities(limit?: number): Promise<[string, string][]>
  • Returns a list communities by new subscriber count. The content of a community array is [community name, community title].

    Parameters

    • Default value limit: number = 25

      Number of listed communities, default: 25 [optional].

    Returns Promise<[string, string][]>

listSubscribers

  • listSubscribers(community: string, last: string | null, limit?: number): Promise<[string, string, string | null, string][]>
  • Returns a list of subscribers for a given community. The content of a subscriber array is [account, role_id, title, created_at].

    Parameters

    • community: string

      Community category name (account).

    • last: string | null

      Last account, paging mechanism [optional].

    • Default value limit: number = 100

      Number of results, default: 100 [optional].

    Returns Promise<[string, string, string | null, string][]>

postNotifications

  • postNotifications(author: string, permlink: string, min_score?: number, last_id?: number | null, limit?: number): Promise<NexusAccountNotifications[]>
  • Load notifications for a specific post.

    Parameters

    • author: string

      Name of author.

    • permlink: string

      Permlink of post.

    • Default value min_score: number = 25

      Minimum score of notification, default: 25 [optional].

    • Default value last_id: number | null = null

      Last notification ID, paging mechanism [optional].

    • Default value limit: number = 100

      Number of results, default: 100 [optional].

    Returns Promise<NexusAccountNotifications[]>

unreadNotifications

  • unreadNotifications(account: string, min_score?: number): Promise<{ lastread: string; unread: number }>
  • Load notifications for a specific post.

    Parameters

    • account: string

      The account to fetch.

    • Default value min_score: number = 25

      Minimum score of notification, default: 25 [optional].

    Returns Promise<{ lastread: string; unread: number }>

Generated using TypeDoc