Skip to main content
POST
https://0xcord.com
/
api
/
vrfv2
/
presets
nDice Preset
curl --request POST \
  --url https://0xcord.com/api/vrfv2/presets \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "network": "<string>",
  "preset": "<string>",
  "numFaces": "<string>",
  "numDice": "<string>"
}
'
{
  "data": {
    "success": true,
    "vrfv2Hash": "<string>",
    "vrfv2EventHash": "<string>",
    "requestId": "<string>",
    "result": "<string>",
    "parsedResult": "<string>",
    "err": "<string>",
    "url": "<string>"
  }
}

Params

network
string
default:"polygon_mumbai"
required
The blockchain network to retrieve random numbers from. Available options are polygon_mumbai,fuji and sepolia.
preset
string
default:"nDice"
required
The preset to be used.
numFaces
string
default:"20"
required
The amount of faces the dice has.
numDice
string
default:"10"
required
The amount of dice you want to roll.

Response

data
object
success
boolean
Indicates whether the request was successful
vrfv2Hash
string
The hash of the VRF proof generated by Chainlink
vrfv2EventHash
string
The URL to the VRF proof event on the blockchain explorer
requestId
string
The unique request ID assigned by Chainlink
result
string
The random number generated by Chainlink
parsedResult
string
The parsed random number generated by Chainlink
err
string
The error message, if any
url
string
The URL to the transaction details on the blockchain explorer

0xCord's preset Tutorial

Learn how to integrate this preset with 0xCord