Get reward details
What is a rewards contract ?
A rewards contract represents a unique smart contract on the blockchain that will be in charge of maintaining a balance, allocating and distributing rewards in the cryptocurrency of your choice to your users.
When you create a rewards contract, Original deploys a unique and secured smart contract on the blockchain (testnet or mainnet depending on the environment you are in) that will execute allocation (distribution) and claim (transfer) on your demand.
In order to start allocating rewards you first need to create a rewards contract via your developer console.
Important:
Request headers are required. See API basics introduction for more information.
Get reward details by uid
Endpoint
GET /reward/{uid}
- Gets the
reward
for a givenuid
associated with the given App (set by the X-API-KEY). - Returns the
reward
details associated.
Parameters
Path parameters
Path parameter | Description |
---|---|
uid | The unique identifier of the rewards contract for this app (ex. 113434045189). |
Response
You will receive the reward details including the following fields:
Response fields | Type | Description | Condition |
---|---|---|---|
uid | String | The UID for the rewards contract. | Mandatory |
name | String | The name of the rewards contract. | Mandatory |
status | String | The status of the rewards contract on the blockchain (deploying | deployed). | Mandatory |
token_type | String | The type of the token minted in that rewards contract. | Mandatory |
token_name | String | The token name associated to your rewards contract. | Mandatory |
created_at | String (Timestamp) | The timestamp at which the rewards contract has been created. | Mandatory |
contract_address | String | The rewards contract address. Can be null if it is not yet deployed. | Mandatory |
withdraw_receiver | String | The address that will receive the remaining funds when you decide to close the rewards contract | Optional |
description | String | The description to your rewards contract. Can be null if not specified on creation. | Mandatory |
chain | String | The chain of your rewards contract (Polygon | Amoy). | Mandatory |
chain_id | Number | The chain id of your rewards contract when EVM (Polygon | Amoy). | Optional |
network | String | The network of your rewards contract (Polygon). | Mandatory |
explorer_url | String (URL) | The explorer URL (PolygonScan) of the rewards contract. It can be used to see all blockchain related informations. Can be null if rewards contract is not yet deployed. | Mandatory |
Response example
{
"success": true,
"data": {
"uid": "113434045189",
"name": "newContract",
"status": "deployed",
"token_type": "ERC20",
"token_name": "TestnetORI",
"created_at": "2023-09-06T14:11:13.515036Z",
"contract_address": "0x124a6755ee787153bb6228463d5dc3a02890a7db",
"withdraw_receiver": "0x4881ab2f73c48a54b907a8b697b270f490768e6d",
"description": "This is the wonderful description of my rewards contract example for the documentation",
"chain": "Amoy",
"chain_id": 80002,
"network": "Polygon",
"explorer_url": "https://amoy.polygonscan.com/address/0x124a6755ee787153bb6228463d5dc3a02890a7db"
}
}
Example
The following example gets the rewards contract details for uid 999999999999.
# API_KEY is your api key
# TOKEN is the access token generated with your api key secret
curl -i \
-X GET \
-H "Content-Type: application/json" \
-H "X-Api-Key: API_KEY" \
-H "Authorization: Bearer TOKEN" \
"https://api.getoriginal.com/v1/reward/999999999999"
Updated 4 months ago