> For the complete documentation index, see [llms.txt](https://docs.orai.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.orai.io/developer-guides/vrf/api-reference.md).

# API Reference

## Index

#### Constructors

|              | Description               |
| ------------ | ------------------------- |
| Constructors | Oracle vrf initialization |

#### Functions

|                   | Description                                                   |
| ----------------- | ------------------------------------------------------------- |
| randomnessRequest | Make a request to generate random numbers                     |
| fulfillRandomness | VRF Oracle will call back when receiving valid VRF proof data |

## Constructors

```
constructor (address _oraiToken, address _oracle) public {
    fee = 1000000000000000000;
    orai = _oraiToken;
    oracle = _oracle;
}
```

## �Funtions

#### randomnessRequest

```
function randomnessRequest(uint256 _seed, bytes memory _data) public returns (bytes32 reqId);
```

* \_seed : a random number provided by the caller
* \_data : the result of callbackAddress and callbackFunc after encoding

```
bytes memory data = abi.encode(address(this), this.fulfillRandomness.selector);
```

* callbackAddress: smart contract address receive random number
* callbackFunct : hen a function is called, the first 4 bytes of `calldata` specifies which function to call.

#### fulfillRandomness

```
function fulfillRandomness(bytes32 reqId, bytes calldata _data, uint8 v, bytes32 r, bytes32 s) external;
```

* reqId: request id generated when calling function randomnessRequest
* \_data: includes callbackAddress and callbackFunc after encode
* v,r,s: proof vrf


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.orai.io/developer-guides/vrf/api-reference.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
