class IOracleClient

Abstract class representing an Oracle client.

Properties

data0

Signature
data0: State<import("o1js/dist/node/lib/provable/field.js").Field>;

oracleAddress

Signature
oracleAddress: State<PublicKey>;

tokenAddress

Signature
tokenAddress: State<PublicKey>;

Methods

onFulfillRequest(data0)

Handles the fulfillment of an Oracle request.

Parameters
Name Type Description

data0

Field

The data0 data from the Oracle.

Returns

Promise<void>

A boolean indicating success.

Signature
abstract onFulfillRequest(data0: Field): Promise<void>;

sendErc677RequestTo(req0, req1, req2, req3)

Sends an Erc677 TransferAndCall request.

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.

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

sendOracleRequest(req0, req1, req2, req3)

Sends an Oracle request.

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.

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

sendOracleRequestWithAddr(oracleAddress, req0, req1, req2, req3)

Sends an Oracle request with Address.

Parameters
Name Type Description

oracleAddress

PublicKey

The public key of the Oracle contract.

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.

Signature
abstract sendOracleRequestWithAddr(oracleAddress: PublicKey, 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
abstract setErc677Token(tokenAddress: PublicKey): Promise<void>;

setOracleContract(oracleAddress)

Sets the Oracle contract address.

Parameters
Name Type Description

oracleAddress

PublicKey

The public key of the Oracle contract.

Returns

Promise<void>

A boolean indicating success.

Signature
abstract setOracleContract(oracleAddress: PublicKey): Promise<void>;
© OpenNautilus 2024-