A class meant to be extended with the custom implementation of an Oracle Program. Takes care of executing the correct code depending on the phase of the Data Request.

Example

class MyOracleProgram extends OracleProgram {
execution(): void {
Process.success(Bytes.fromUtf8String("Hello from execution phase"));
}
tally(): void {
Process.success(Bytes.fromUtf8String("Hello from tally phase"));
}
}

new MyOracleProgram().run();

Constructors

Methods

Constructors

Methods

  • Meant to be overridden if the oracle program needs to execute logic in the execution phase.

    Returns void

  • Method used to execute the correct part of the oracle program depending on the context in which it is run. Not meant to be overridden unless you know what you're doing.

    Returns void

  • Meant to be overridden if the oracle program needs to execute logic in the tally phase.

    Returns void