Hierarchy

  • SubsocialSubstrateApi

Constructors

Properties

_api: ApiPromise

Accessors

  • get api(): Promise<ApiPromise>
  • Returns Promise<ApiPromise>

Methods

  • Find and load data about the number of account followers of an account from Subsocial blockchain and IPFS by a given accountId.

    Returns

    Number of account followers of a given accountId aggregated from Subsocial blockchain in BN.

    Parameters

    • accountId: AnyAccountId

      An account id.

    Returns Promise<BN>

  • Find and load data about the number of account followed by an account from Subsocial blockchain and IPFS by a given accountId.

    Returns

    Number of account followers of a given accountId aggregated from Subsocial blockchain in BN.

    Parameters

    • accountId: AnyAccountId

      An account id.

    Returns Promise<BN>

  • Find and load domain by a given accountId and spaceId from Subsocial blockchain.

    Returns

    Data about domain name (in string) retrieved from Subsocial blockchain by a given accountId and spaceId. If no corresponding domain name to given accountId and spaceId, undefined is returned.

    Parameters

    • accountId: AnyAccountId

      Id of a desired account.

    • spaceId: AnySpaceId

      Id of desired space.

    Returns Promise<undefined | string>

  • Find and load an array of information about domains by a given accountId from Subsocial blockchain.

    Returns

    An array of information about domains retrieved from Subsocial blockchain by an owner accountId. If no corresponding domain to given owner accountId, an empty array is returned.

    Parameters

    • accountId: AnyAccountId

      Id of owner of domains.

    Returns Promise<string[]>

  • Find and load information about a post from Subsocial blockchain and IPFS by a given id, content and visibility filter.

    Returns

    Data about desired post from Subsocial blockchain and IPFS. If no corresponding post to given id, content and visibility filter, undefined is returned.

    Parameters

    • params: FindPostQuery

      An object containing a post id, visibility filter (hidden field), and content filter.

    Returns Promise<undefined | Post>

  • Find and load an array of information about posts from Subsocial blockchain and IPFS by a given array of ids, content and visibility filter.

    Returns

    An array of data about desired posts from Subsocial blockchain and IPFS. If no corresponding posts to given array of ids, content and visibility filter, an empty array is returned.

    Parameters

    • params: FindPostsQuery

      An object containing an array of space ids, visibility filter (hidden field), and content filter.

    Returns Promise<Post[]>

  • Find and load information about a reaction from Subsocial blockchain by a given reaction id.

    Returns

    Data about desired reaction from Subsocial blockchain. If no corresponding reaction to given reaction id, undefined is returned.

    Parameters

    • id: AnyReactionId

      Id of desired reaction.

    Returns Promise<undefined | Reaction>

  • Find and load an array of information about reactions from Subsocial blockchain by a given array of reaction ids.

    Returns

    An array of data about desired reactions from Subsocial blockchain. If no corresponding reactions to given array of ids, an empty array is returned.

    Parameters

    • ids: AnyReactionId[]

      An array of ids of desired reactions.

    Returns Promise<Reaction[]>

  • Find and load information about a space from Subsocial blockchain and IPFS by a given id, content and visibility filter.

    Returns

    Data about desired space from Subsocial blockchain and IPFS. If no corresponding space to given id, content and visibility filter, undefined is returned.

    Parameters

    • params: FindSpaceQuery

      An object containing a space id, visibility filter (hidden field), and content filter.

    Returns Promise<undefined | Space>

  • Find and load an array of information about spaces from Subsocial blockchain and IPFS by a given array of ids, visibility filter, and content filter.

    Returns

    An array of data about desired spaces from Subsocial blockchain and IPFS. If no corresponding spaces to given array of ids, content and visibility filter, an empty array is returned.

    Parameters

    • params: FindSpacesQuery

      An object containing an array of space ids, visibility filter (hidden field), and content filter.

    Returns Promise<Space[]>

  • Type Parameters

    • T extends SupportedSubstrateResult

    Parameters

    • storageItem: StorageItem
    • ids: SupportedSubstrateId[]

    Returns Promise<T[]>

  • Find and load an array of account ids with any role from Subsocial blockchain by a given spaceId.

    Returns

    An array of string representing accounts in any role retrieved from Subsocial blockchain by a given spaceId. If no corresponding account with any role to a given spaceId, an empty array is returned.

    Parameters

    • spaceId: AnySpaceId

      Id of desired space.

    Returns Promise<string[]>

  • Find and load an array of domain names by key pairs [Owner, SpaceId] from Subsocial blockchain.

    Returns

    An array of domain names retrieved from Subsocial blockchain by a given array of key pairs [Owner, SpaceId]. If no corresponding domain name to given key pairs, an empty array is returned.

    Parameters

    • keys: [AnyAccountId, AnySpaceId][]

      An array of keypairs [Owner, SpaceId].

    Returns Promise<string[]>

  • Parameters

    • pallet: PalletName

    Returns Promise<QueryableModuleStorage<"promise"> | {
        domainByInnerValue: AugmentedQuery<"promise", ((arg1: string | AccountId32 | Uint8Array, arg2: string | Uint8Array | PalletDomainsInnerValue | {
            Account: any;
        } | {
            Space: any;
        } | {
            Post: any;
        }) => Observable<Option<Bytes>>), [AccountId32, PalletDomainsInnerValue]>;
        domainsByOwner: AugmentedQuery<"promise", ((arg: string | AccountId32 | Uint8Array) => Observable<Vec<Bytes>>), [AccountId32]>;
        registeredDomains: AugmentedQuery<"promise", ((arg: string | Uint8Array | Bytes) => Observable<Option<PalletDomainsDomainMeta>>), [Bytes]>;
        reservedWords: AugmentedQuery<"promise", ((arg: string | Uint8Array | Bytes) => Observable<bool>), [Bytes]>;
        supportedTlds: AugmentedQuery<"promise", ((arg: string | Uint8Array | Bytes) => Observable<bool>), [Bytes]>;
    } | {
        nextPostId: AugmentedQuery<"promise", (() => Observable<u64>), []>;
        postById: AugmentedQuery<"promise", ((arg: u64 | AnyNumber) => Observable<Option<PalletPostsPost>>), [u64]>;
        postIdsBySpaceId: AugmentedQuery<"promise", ((arg: u64 | AnyNumber) => Observable<Vec<u64>>), [u64]>;
        replyIdsByPostId: AugmentedQuery<"promise", ((arg: u64 | AnyNumber) => Observable<Vec<u64>>), [u64]>;
        sharedPostIdsByOriginalPostId: AugmentedQuery<"promise", ((arg: u64 | AnyNumber) => Observable<Vec<u64>>), [u64]>;
    } | {
        accountFollowedByAccount: AugmentedQuery<"promise", ((arg: ITuple<[AccountId32, AccountId32]> | [string | AccountId32 | Uint8Array, string | AccountId32 | Uint8Array]) => Observable<bool>), [ITuple<[AccountId32, AccountId32]>]>;
        accountFollowers: AugmentedQuery<"promise", ((arg: string | AccountId32 | Uint8Array) => Observable<Vec<AccountId32>>), [AccountId32]>;
        accountsFollowedByAccount: AugmentedQuery<"promise", ((arg: string | AccountId32 | Uint8Array) => Observable<Vec<AccountId32>>), [AccountId32]>;
    } | {
        profileSpaceIdByAccount: AugmentedQuery<"promise", ((arg: string | AccountId32 | Uint8Array) => Observable<Option<u64>>), [AccountId32]>;
    } | {
        nextReactionId: AugmentedQuery<"promise", (() => Observable<u64>), []>;
        postReactionIdByAccount: AugmentedQuery<"promise", ((arg: ITuple<[AccountId32, u64]> | [string | AccountId32 | Uint8Array, u64 | AnyNumber]) => Observable<u64>), [ITuple<[AccountId32, u64]>]>;
        reactionById: AugmentedQuery<"promise", ((arg: u64 | AnyNumber) => Observable<Option<PalletReactionsReaction>>), [u64]>;
        reactionIdsByPostId: AugmentedQuery<"promise", ((arg: u64 | AnyNumber) => Observable<Vec<u64>>), [u64]>;
    } | {
        nextRoleId: AugmentedQuery<"promise", (() => Observable<u64>), []>;
        roleById: AugmentedQuery<"promise", ((arg: u64 | AnyNumber) => Observable<Option<PalletRolesRole>>), [u64]>;
        roleIdsBySpaceId: AugmentedQuery<"promise", ((arg: u64 | AnyNumber) => Observable<Vec<u64>>), [u64]>;
        roleIdsByUserInSpace: AugmentedQuery<"promise", ((arg1: string | Uint8Array | SubsocialSupportUser | {
            Account: any;
        } | {
            Space: any;
        }, arg2: u64 | AnyNumber) => Observable<Vec<u64>>), [SubsocialSupportUser, u64]>;
        usersByRoleId: AugmentedQuery<"promise", ((arg: u64 | AnyNumber) => Observable<Vec<SubsocialSupportUser>>), [u64]>;
    } | {
        spaceFollowedByAccount: AugmentedQuery<"promise", ((arg: ITuple<[AccountId32, u64]> | [string | AccountId32 | Uint8Array, u64 | AnyNumber]) => Observable<bool>), [ITuple<[AccountId32, u64]>]>;
        spaceFollowers: AugmentedQuery<"promise", ((arg: u64 | AnyNumber) => Observable<Vec<AccountId32>>), [u64]>;
        spacesFollowedByAccount: AugmentedQuery<"promise", ((arg: string | AccountId32 | Uint8Array) => Observable<Vec<u64>>), [AccountId32]>;
    } | {
        pendingSpaceOwner: AugmentedQuery<"promise", ((arg: u64 | AnyNumber) => Observable<Option<AccountId32>>), [u64]>;
    } | {
        nextSpaceId: AugmentedQuery<"promise", (() => Observable<u64>), []>;
        spaceById: AugmentedQuery<"promise", ((arg: u64 | AnyNumber) => Observable<Option<PalletSpacesSpace>>), [u64]>;
        spaceIdsByOwner: AugmentedQuery<"promise", ((arg: string | AccountId32 | Uint8Array) => Observable<Vec<u64>>), [AccountId32]>;
    }>

  • Find and load data about a reaction id from Subsocial blockchain and IPFS by a given accountId and and postId.

    Returns

    Data of reaction id aggregated from Subsocial blockchain. If no corresponding reaction id to given accountId and postId, undefined is returned.

    Parameters

    • accountId: AnyAccountId

      Id of desired account.

    • postId: AnyPostId

      Id of desired post.

    Returns Promise<undefined | string>

  • Find and load an array of information about reaction ids from Subsocial blockchain and IPFS by a given accountId and and an array of postIds.

    Returns

    An array of reaction id aggregated from Subsocial blockchain. If no corresponding reaction id to given accountId and and array of postIds, an empty array is returned.

    Parameters

    • accountId: AnyAccountId

      Id of desired account.

    • postIds: AnyPostId[]

      An array of ids of desired posts.

    Returns Promise<string[]>

  • Find and load data about reaction ids from Subsocial blockchain and IPFS by a given accountId and an array of structIds.

    Returns

    An array of reaction ids aggregated from Subsocial blockchain. If no corresponding reaction ids to given accountId and structIds, an empty array is returned.

    Parameters

    • accountId: AnyAccountId

      An account id of desired reaction ids.

    • postIds: AnyPostId[]

      An array of post ids of desired reaction ids.

    Returns Promise<string[]>

  • Find and load an array of reply ids from Subsocial blockchain by a given post id.

    Returns

    An array of reply id aggregated from Subsocial blockchain. If no corresponding reply id to given post id, an empty array is returned.

    Parameters

    • id: AnyPostId

      Id of desired post.

    Returns Promise<string[]>

  • Find and load an array of role ids owned by a given accountId from Subsocial blockchain within a given space.

    Returns

    An array of role ids retrieved from Subsocial blockchain by a given accountId within a space. If no corresponding role id to a given accountId, an empty array is returned.

    Parameters

    • accountId: AnyAccountId

      Id of desired account.

    Returns Promise<string[]>

  • Find and load an array of space permissions owned by a given accountId from Subsocial blockchain within a given spaceId.

    Returns

    An array of space permissions retrieved from Subsocial blockchain by a given accountId within a spaceId. If no corresponding space permissions to a given accountId within a spaceId, an empty array is returned.

    Parameters

    • accountId: AnyAccountId

      Id of desired account.

    • spaceId: AnySpaceId

      Id of desired space.

    Returns Promise<(keyof SpacePermissionMap)[]>

  • Parameters

    • params: StorageSizeProps
    • Optional value: any

    Returns Promise<BN>

  • Find and load boolean value from Subsocial blockchain by a given myAddress and followedAddress.

    Returns

    A boolean value whether myAddress is following followedAddress or not, retrieved from Subsocial blockchain.

    Parameters

    • myAddress: AnyAccountId

      Id of own account.

    • followedAddress: AnyAccountId

      Id of followedAccount.

    Returns Promise<boolean>

  • Parameters

    • params: StorageItem
    • accountId: AnyAccountId
    • subjectId: SubstrateId

    Returns Promise<boolean>

  • Find and load boolean value from Subsocial blockchain by a given myAddress and spaceId.

    Returns

    A boolean value whether myAddress is following a given spaceId or not, retrieved from Subsocial blockchain.

    Parameters

    • myAddress: AnyAccountId

      Id of own account.

    • spaceId: AnySpaceId

      Id of desired space.

    Returns Promise<boolean>

  • Find and load next post id from Subsocial blockchain.

    Returns

    A string of the next post id.

    Returns Promise<string>

  • Find and load next space id from Subsocial blockchain.

    Returns

    A string of the next space id.

    Returns Promise<string>

  • Find and load an array of post ids from Subsocial blockchain by a given space id.

    Returns

    An array of post id aggregated from Subsocial blockchain. If no corresponding post id to given space id, an empty array is returned.

    Parameters

    • id: AnySpaceId

      Id of desired space.

    Returns Promise<string[]>

  • Find and load data about the number of posts of a space from Subsocial blockchain and IPFS by a given space id spaceId.

    Returns

    Number of posts of a given space id spaceId aggregated from Subsocial blockchain in BN.

    Parameters

    • spaceId: AnySpaceId

      A space id.

    Returns Promise<BN>

  • Find and load profile space id from Subsocial blockchain by a given account id.

    Returns

    Data of profile space id from Subsocial blockchain.

    Parameters

    • accountId: AnyAccountId

      Id of desired account.

    Returns Promise<string>

  • Find and load an array of profile space ids from Subsocial blockchain by a given array of accountIds.

    Returns

    An array of profile space ids aggregated from Subsocial blockchain. If no corresponding space id to given array of accountIds, an empty array is returned.

    Parameters

    • accountIds: AnyAccountId[]

      An array of desired account ids.

    Returns Promise<string[]>

  • Parameters

    • params: StorageItem
    • Optional value: any

    Returns Promise<any>

  • Parameters

    • params: StorageItem
    • value: any

    Returns Promise<any[]>

  • Parameters

    • storage: string
    • Optional value: any

    Returns Promise<any>

  • Parameters

    • storage: string
    • Optional value: any

    Returns Promise<any>

  • Parameters

    • storage: string
    • Optional value: any

    Returns Promise<any>

  • Find and load information about domain structs of registered domain by a given domainName from Subsocial blockchain.

    Returns

    Data about domain structs of a registered domain retrieved from Subsocial blockchain by a given domainName.

    Parameters

    • domainName: string

      A string of desired domain name.

    Returns Promise<PalletDomainsDomainMeta[]>

  • Find and load an array of domain structs of registered domains by a given array of domainNames from Subsocial blockchain.

    Returns

    An array of information about domain structs of registered domains retrieved from Subsocial blockchain by a given array of domainNames. If no corresponding domain structs to given array of domainNames, an empty array is returned.

    Parameters

    • domainNames: string[]

      An array of desired domain names.

    Returns Promise<PalletDomainsDomainMeta[]>

  • Find and load data about the number of replies of a post from Subsocial blockchain and IPFS by a given postId.

    Returns

    Number of replies of a given postId aggregated from Subsocial blockchain in BN.

    Parameters

    • postId: AnyPostId

      A post id.

    Returns Promise<BN>

  • Find and load data about the number of shares of a post from Subsocial blockchain and IPFS by a given postId.

    Returns

    Number of shares of a given postId aggregated from Subsocial blockchain in BN.

    Parameters

    • postId: AnyPostId

      A post id.

    Returns Promise<BN>

  • Find and load an array of space ids from Subsocial blockchain of an owner by a given account id.

    Returns

    An array of space id aggregated from Subsocial blockchain. If no corresponding space id to given account id, an empty array is returned.

    Parameters

    • id: AnyAccountId

      Id of desired account as spaces owner.

    Returns Promise<string[]>

  • Find and load an array of space ids from Subsocial blockchain followed by a given account id.

    Returns

    An array of space id aggregated from Subsocial blockchain. If no corresponding space id followed by a given account id, an empty array is returned.

    Parameters

    • id: AnyAccountId

      Id of desired account as spaces follower.

    Returns Promise<string[]>