# addRewards

## Description

The `addRewards` function allows a user to add rewards to a staked position on the volary blockchain network.

## Parameters

| Name         | Type   | Description                       |
| ------------ | ------ | --------------------------------- |
| `rewards`    | string | The amount of rewards to be added |
| `stakeId`    | number | The ID of the staked position     |
| `signature`  | string | The signature of the user         |
| `privateKey` | string | The private key of the user       |

## Response

| Property  | Type   | Description                                   |
| --------- | ------ | --------------------------------------------- |
| `receipt` | object | The transaction receipt for the rewards added |

## Example Request and Response

### Prerequisites

Before making requests with Volary SDK, you must have it installed.

You can install Volary SDK using either **`npm`** or **`yarn`**. Use the following commands to install Volary SDK:

```jsx
npm install @nest25/tokenomics-lib
OR
yarn add @nest25/tokenomics-lib
```

### Request

Here is an example of how to make a `addRewards` request using the Volary SDK:

```
// import Nest SDK library
const { rewards } = require('@nest25/tokenomics-lib');

// create a new instance of the rewards class
const Rewards = new rewards();

async function main() {
  // add rewards to a user
  const result = await Rewards.addRewards(
    '1',
    49,
    '0x67bf60c0aeb9198cd464b57dd9049526bbf7c7dd2cb84f9051ee542aececf21876f81e402eff398a179ab7be23f443c588a5524473bcd16d65e6ec725d8c8c341c',
    TEST_PRIVATE_KEY,
  );
  // log the result
  console.log(result);
}
main();
```

### Response

```
 {
        type: 2,
        chainId: 8888,
        nonce: 3,
        maxPriorityFeePerGas: BigNumber { _hex: '0x59682f00', _isBigNumber: true },
        maxFeePerGas: BigNumber { _hex: '0xd09dc300', _isBigNumber: true },
        gasPrice: null,
        gasLimit: BigNumber { _hex: '0x0271c6', _isBigNumber: true },
        to: '0x5A98631C9Bb0a2139D70986D96F51E5872CEF5b9',
        value: BigNumber { _hex: '0x00', _isBigNumber: true },
        data: '0x1d4151520000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000000000000000000000000000000000000000000310000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000004167bf60c0aeb9198cd464b57dd9049526bbf7c7dd2cb84f9051ee542aececf21876f81e402eff398a179ab7be23f443c588a5524473bcd16d65e6ec725d8c8c341c00000000000000000000000000000000000000000000000000000000000000',
        accessList: [],
        hash: '0x99ee1728a91b8953e44852c72e8af4eb18763fad8608c00a3fe0cb4e363c98e4',
        v: 0,
        r: '0x1548a48052e82ff2a1ca71d5ab8992e0afeab86a81c6c8db4f9a75b51758507a',
        s: '0x5a4bec8ae710f939d40cb8aebd254ae3d36a665a29a7e8b763baeb8eb8dbab1e',
        from: '0x87658a6c698D1392d45B0AB756F969361AcB912d',
        confirmations: 0,
        wait: [Function (anonymous)]
      }
```

## Use Cases

* **Staking Platforms:** The function can be used by staking platforms to add rewards to the stakeholders' accounts.
* **Governance Systems:** The function can be used by governance systems to distribute rewards to the participants for their contributions to the network.
* **Token Distribution:** The function can be used by token distribution systems to distribute rewards to early adopters or token holders.


---

# Agent Instructions: 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:

```
GET https://docs.volary.io/sdks-guide/blockchain-sdks/tokenomics-sdk/addrewards.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
