Hierarchy (view full)

Constructors

Properties

account: AccountBase

Account to use as oracle

address: `ok_${string}`

Oracle public key

options: OracleRegisterOptions & OracleExtendTtlOptions & {
    includeResponded?: boolean;
    interval?: number;
} & Partial<{
    _expectedMineRate?: number;
    _microBlockCycle?: number;
    onNode: Node;
}> & OracleRespondToQueryOptions & {
    onNode: Node;
}

Options object

Methods

  • Respond to queries to oracle based on callback value

    Parameters

    • getResponse: ((q: OracleQuery) => string | Promise<string>)

      Callback to respond on query

        • (q): string | Promise<string>
        • Parameters

          Returns string | Promise<string>

    • options: {
          includeResponded?: boolean;
          interval?: number;
      } & Partial<{
          _expectedMineRate?: number;
          _microBlockCycle?: number;
          onNode: Node;
      }> & OracleRespondToQueryOptions = {}

      Options object

    Returns (() => void)

    Callback to stop polling function

      • (): void
      • Returns void

  • Poll for oracle queries

    Parameters

    • onQuery: ((query: OracleQuery) => void)

      OnQuery callback

    • options: {
          includeResponded?: boolean;
          interval?: number;
      } & Partial<{
          _expectedMineRate?: number;
          _microBlockCycle?: number;
          onNode: Node;
      }> = {}

      Options object

    Returns (() => void)

    Callback to stop polling function

      • (): void
      • Returns void