class OracleContract

An Oracle contract implementing the IOracleContract interface.

Properties

events

Events emitted by this Oracle contract.

Signature
events: IOracleEvents;

tokenAddress

Stores the address of a token associated with the oracle contract. This token might be used for payment of oracle services or other interactions.

Signature
tokenAddress: State<PublicKey>;

Methods

fulfillOracleRequest(callbackAddress, data0, signature)

Fulfills an Oracle request, verifies a signature, and potentially sends a callback to the specified address.

Parameters
Name Type Description

callbackAddress

PublicKey

The public key of the contract to send the callback to (optional).

data0

Field

The first field of the data to be sent in the callback (optional).

signature

Signature

The signature to be verified (associated with the request or data).

Returns

Promise<void>

A boolean indicating success (always true in this implementation, potentially modify based on requirements).

Signature
fulfillOracleRequest(callbackAddress: PublicKey, data0: Field, signature: Signature): Promise<void>;

init()

Signature
init(): void;

oracleRequest(req0, req1, req2, req3)

Makes an Oracle request based on provided data.

Parameters
Name Type Description

req0

Field

The first field of the request data.

req1

Field

The second field of the request data.

req2

Field

The third field of the request data.

req3

Field

The fourth field of the request data.

Returns

Promise<void>

A boolean indicating success (always true in this implementation).

Signature
oracleRequest(req0: Field, req1: Field, req2: Field, req3: Field): Promise<void>;

setErc677Token(tokenAddress)

Updates the stored ERC-677 token address associated with this oracle contract.

Parameters
Name Type Description

tokenAddress

PublicKey

The new PublicKey of the ERC-677 token.

Returns

Promise<void>

True to indicate successful execution.

Signature
setErc677Token(tokenAddress: PublicKey): Promise<void>;
© OpenNautilus 2024-