ao-js-sdk - v0.4.0
    Preparing search index...

    Interface IDelegationHistorianClient

    interface IDelegationHistorianClient {
        dryrun(
            data: any,
            tags: Tags,
            anchor?: string,
            id?: string,
            owner?: string,
        ): Promise<DryRunResult>;
        getAOClient(): IAOClient;
        getCallingWalletAddress(): Promise<string>;
        getLastNRecords(count: number): Promise<DelegationRecord[]>;
        getLastRecord(): Promise<DelegationRecord>;
        getProcessId(): string;
        getProcessInfo(): Promise<Partial<FullArweaveTransaction>>;
        getTotalDelegatedAOByProject(): Promise<ProjectDelegationTotal[]>;
        getWallet(): any;
        getWalletAddressSync(): string;
        isReadOnly(): boolean;
        isRunningDryRunsAsMessages(): boolean;
        message(data?: string, tags?: Tags, anchor?: string): Promise<string>;
        result(messageId: string): Promise<MessageResult>;
        results(
            from?: string,
            to?: string,
            limit?: number,
            sort?: string,
        ): Promise<ResultsResponse>;
        setDryRunAsMessage(enabled: boolean): void;
        setWallet(wallet: any): void;
    }

    Hierarchy

    • IProcessClient
      • IDelegationHistorianClient

    Implemented by

    Index

    Methods

    • Performs a dry run, executing the logic of a message without actually persisting the result. When useDryRunAsMessage is false (default), this performs a simulation. When useDryRunAsMessage is true, this executes as a real message.

      Parameters

      • data: any

        Optional data to be passed to the message.

      • tags: Tags

        Optional tags to be passed to the message.

      • Optionalanchor: string

        Optional anchor to be passed to the message.

      • Optionalid: string

        Optional ID to be passed to the message.

      • Optionalowner: string

        Optional owner to be passed to the message.

      Returns Promise<DryRunResult>

      A DryRunResult object containing the output of the message, including the result of any computations, and any spawned messages. Or a MessageResult if useDryRunAsMessage is true.

      DryRunError if there is an error performing the dry run.

    • Gets the current AO client instance being used by this process client.

      Returns IAOClient

      The IAOClient instance currently in use

    • Gets the wallet address associated with the client.

      Returns Promise<string>

      Promise resolving to the wallet address string

      Error if client is in read-only mode

    • Returns string

      Boolean indicating whether or not the client is set to run dryruns as messages. (non default behavior)

    • Retrieves the transaction that created this process. This transaction contains the initial state and configuration of the process in its tags.

      Returns Promise<Partial<FullArweaveTransaction>>

      Promise resolving to the transaction data containing process creation details

      ArweaveGraphQLError if there is an error retrieving the transaction

    • Gets the wallet this client uses to sign messages

      Returns any

      the wallet used for message signing

    • Gets the wallet address associated with the client synchronously. Uses the hasher and JWK to derive the wallet address without async operations.

      Returns string

      The wallet address string

      Error if client is in read-only mode or if synchronous hashing is not supported

    • A Readonly Client can only perform dry run and result operations, however does not require a wallet to be used. If a wallet is specified on instantiation the client will additionally be able to use write operations (messages).

      Returns boolean

      Boolean indicating whether or not the client is for read operations only.

    • Returns boolean

      Boolean indicating whether or not the client is set to run dryruns as messages. (non default behavior)

    • Send a message to an ao Message Unit (mu) targeting an ao process.

      Parameters

      • Optionaldata: string

        Optional data to be passed to the message

      • Optionaltags: Tags

        Optional tags to be passed to the message

      • Optionalanchor: string

        Optional 32 byte anchor to be set on the DataItem

      Returns Promise<string>

      Promise resolving to the message ID

      MessageError if there is an error sending the message

    • Read the result of a message evaluation from an ao Compute Unit (cu).

      Parameters

      • messageId: string

        ID of the message to get result for

      Returns Promise<MessageResult>

      Promise resolving to MessageResult containing Messages, Spawns, Output, Error

      ResultError if there is an error fetching the result

    • Read a batch of results from a process. Can be used as a polling mechanism for new results.

      Parameters

      • Optionalfrom: string

        Optional cursor starting point

      • Optionalto: string

        Optional cursor ending point

      • Optionallimit: number

        Optional number of results to return (default: 25)

      • Optionalsort: string

        Optional sort order ('ASC' or 'DESC', default: 'ASC')

      Returns Promise<ResultsResponse>

      Promise resolving to ResultsResponse containing the batch of results

      ResultsError if there is an error fetching results

    • Controls whether dryrun executes as a message or simulation.

      Parameters

      • enabled: boolean

        When true, dryrun will execute as a real message. When false (default), executes as a simulation.

      Returns void

    • Sets the wallet being used for this client. If the client is readonly it will now have write abilities.

      Parameters

      • wallet: any

        the wallet to use with this client.

      Returns void