@aleph-sdk/monorepo
    Preparing search index...

    Class AlephHttpClient

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    aggregateClient: AggregateMessageClient
    forgetClient: ForgetMessageClient
    instanceClient: InstanceMessageClient
    messageClient: BaseMessageClient
    postClient: PostMessageClient
    programClient: ProgramMessageClient
    storeClient: StoreMessageClient

    Methods

    • Downloads a file from the Aleph network.

      Parameters

      • file_hash: string

        The hash of the STORE message of the file to retrieve.

      Returns Promise<ArrayBuffer>

    • Fetches an aggregate value from the Aleph network. Aggregates are a key-value store on the Aleph network. Aggregates are bound by address and each address can have multiple keys. By default, only the address that signs the aggregate can modify it.

      Type Parameters

      • T

      Parameters

      • address: string

        The address of the aggregate's owner

      • key: string

        The key of the aggregate to fetch

      Returns Promise<T>

    • Fetches multiple aggregates from the Aleph network. Aggregates are a key-value store on the Aleph network. Aggregates are bound by address and each address can have multiple keys. By default, only the address that signs the aggregate can modify it.

      Parameters

      • address: string

        The address of the aggregate's owner

      • Optionalkeys: string[]

        The keys of the aggregates to fetch

      Returns Promise<Record<string, any>>

    • Tries to fetch a specific message from the Aleph network. Throws an error if the message is not found or forgotten.

      Type Parameters

      • T extends MessageType | "any" = "any"
      • Content = any

      Parameters

      • itemHash: string

        The hash of the message to fetch.

      Returns Promise<PublishedMessage<MessageTypeMap<Content>[T]>>

    • Fetches the reason why a message has been rejected from the network. If the message has no error, returns null.

      Parameters

      • itemHash: string

        The hash of the message to fetch the error from.

      Returns Promise<null | MessageError>

    • Retrieves raw messages from the Aleph network. Similar to getPosts, but with more options.

      Parameters

      • config: GetMessagesConfiguration

        The configuration used to fetch messages.

      Returns Promise<MessagesQueryResponse>

    • Fetches a POST message on the Aleph network. POST messages are used to store arbitrary JSON data on the Aleph network. They can be queried by type, channel, reference, address, tag, or hash. POSTs can be modified by amend messages. This endpoint returns the latest version of the POST.

      Type Parameters

      • T = any

      Parameters

      • config: PostGetConfiguration

        The configuration used to fetch a post message.

      Returns Promise<PostResponse<T>>

    • Fetches multiple POST messages on the Aleph network. POST messages are used to store arbitrary JSON data on the Aleph network.

      Type Parameters

      • T = any

      Parameters

      • config: PostGetConfiguration

        The configuration used to fetch a post message.

      Returns Promise<PostQueryResponse<T>>

    • Watches for new messages on the Aleph network. This method returns a socket that can be used to listen for new messages.

      Parameters

      • config: Omit<GetMessagesConfiguration, "page" | "pagination">

        The filters used to watch for new messages, similar to getMessages.

      Returns Promise<AlephSocket>