# GNSTriggerRewards

*Facet #6: Trigger rewards*

## constructor

```solidity
constructor() public
```

## initializeTriggerRewards

```solidity
function initializeTriggerRewards(uint16 _timeoutBlocks) external
```

*Initializes parameters for trigger rewards facet*

### Parameters

| Name            | Type   | Description                            |
| --------------- | ------ | -------------------------------------- |
| \_timeoutBlocks | uint16 | blocks after which a trigger times out |

## updateTriggerTimeoutBlocks

```solidity
function updateTriggerTimeoutBlocks(uint16 _timeoutBlocks) external
```

*Updates the blocks after which a trigger times out*

### Parameters

| Name            | Type   | Description                            |
| --------------- | ------ | -------------------------------------- |
| \_timeoutBlocks | uint16 | blocks after which a trigger times out |

## distributeTriggerReward

```solidity
function distributeTriggerReward(uint256 _rewardGns) external virtual
```

*Distributes GNS rewards to oracles for a specific trigger*

### Parameters

| Name        | Type    | Description                                      |
| ----------- | ------- | ------------------------------------------------ |
| \_rewardGns | uint256 | total GNS reward to be distributed among oracles |

## claimPendingTriggerRewards

```solidity
function claimPendingTriggerRewards(address _oracle) external
```

*Claims pending GNS trigger rewards for the caller*

### Parameters

| Name     | Type    | Description           |
| -------- | ------- | --------------------- |
| \_oracle | address | address of the oracle |

## getTriggerTimeoutBlocks

```solidity
function getTriggerTimeoutBlocks() external view returns (uint16)
```

*Returns current triggerTimeoutBlocks value*

## hasActiveOrder

```solidity
function hasActiveOrder(uint256 _orderBlock) external view returns (bool)
```

*Checks if an order is active (exists and has not timed out)*

### Parameters

| Name         | Type    | Description               |
| ------------ | ------- | ------------------------- |
| \_orderBlock | uint256 | block number of the order |

## getTriggerPendingRewardsGns

```solidity
function getTriggerPendingRewardsGns(address _oracle) external view returns (uint256)
```

*Returns the pending GNS trigger rewards for an oracle*

### Parameters

| Name     | Type    | Description           |
| -------- | ------- | --------------------- |
| \_oracle | address | address of the oracle |


---

# 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.gains.trade/developer/technical-reference/contracts/core/facets/gnstriggerrewards.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.
