Getting a cost estimate
The arrng API will return a live estimate of the native token (e.g. ETH) you need to send with requests to arrng.
Access the getCost end point using your preferred method:
https://api.arrng.io/getCost?chain=1&quantity=1&complexity=1
Chain. Set this to the chain you are using (e.g. 1 for ETH mainnet)
Quantity. Set this to the number of random numbers you are requesting.
Complexity. Your estimate of the complexity of work being done in the method that recieves the RNG. For example:
If you are just storing the RNG that would be low complexity and therefore a value of 1.
If you are storing the RNG, setting a boolean and doing some light maths that would be a value of 2.
If you are doing something more complex, like minting tokens and updating multiple balances, that would be 3.
The API will provide a json response with the amount of native token to be sent on the call, for example:
{"nativeToken":0.0048}
Last updated