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

    Class RandomClient

    Hierarchy

    • BaseClient
      • RandomClient

    Implements

    Index

    Constructors

    Properties

    baseConfig: BaseClientConfig
    tokenClient: TokenClient

    Methods

    • Parameters

      • data: any = ''
      • tags: Tags = []
      • Optionalanchor: string
      • Optionalid: string
      • Optionalowner: string

      Returns Promise<DryRunResult>

    • Posts a timeunlocked commitement to a randomness request

      Parameters

      • params: { puzzle: { input: string; modulus: string }; requestId: string }
        • puzzle: { input: string; modulus: string }
          • input: string

            The timelock puzzle input base64 (no 0x)

          • modulus: string

            The timelock puzzle modulus base64 (no 0x)

        • requestId: string

          Id of the randomness request to commit to

      Returns Promise<void>

    • Creates a new randomness request using a list of provider IDs.

      Parameters

      • provider_ids: string[]
      • OptionalrequestedInputs: number

        The number of requested random inputs.

      • callbackId: string = ''

        A unique identifier for tracking the request callback.

      Returns Promise<boolean>

      • A promise that resolves with a boolean indicating success.
    • Protected

      Parameters

      • data: any = ''
      • tags: Tags = []
      • Optionalanchor: string
      • Optionalid: string
      • Optionalowner: string

      Returns Promise<DryRunResult>

    • 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

    • 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)

    • Protected

      Parameters

      • data: string = ''
      • tags: Tags = []
      • Optionalanchor: string

      Returns Promise<string>

    • Parameters

      • data: string = ''
      • tags: Tags = []
      • Optionalanchor: string

      Returns Promise<MessageResult>

    • Redeem random credits

      Parameters

      • OptionalprovidersIds: string[]
      • OptionalrequestedInputs: number
      • OptionalcallbackId: string

      Returns Promise<boolean>

    • Protected

      Parameters

      • messageId: string

      Returns Promise<MessageResult>

    • Protected

      Parameters

      • Optionalfrom: string
      • Optionalto: string
      • limit: number = 25
      • sort: SortOrder = SortOrder.ASCENDING

      Returns Promise<ResultsResponse>

    • Posts a timeunlocked commitement to a randomness request

      Parameters

      • params: { requestId: string; rsa_key: { p: string; q: string } }
        • requestId: string

          Id of the randomness request to reveal

        • rsa_key: { p: string; q: string }
          • p: string

            base64 (no 0x)

          • q: string

            base64 (no 0x)

      Returns Promise<void>

    • 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