Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/filecoin-station/spark-rewards
https://github.com/filecoin-station/spark-rewards
Last synced: 1 day ago
JSON representation
- Host: GitHub
- URL: https://github.com/filecoin-station/spark-rewards
- Owner: filecoin-station
- License: other
- Created: 2024-08-27T07:39:42.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-10-21T10:47:35.000Z (3 months ago)
- Last Synced: 2024-10-21T15:41:01.821Z (3 months ago)
- Language: JavaScript
- Homepage: https://spark-rewards.fly.dev/
- Size: 137 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# spark-rewards
This implements revision D of [Meridian: Off-chain scheduled rewards](https://spacemeridian.notion.site/Meridian-Off-chain-scheduled-rewards-f9480ef009464ecfaf02a4f752cc4d70).
## Routes
### `GET /scheduled-rewards`
Response:
```js
{
"address": "scheduledRewardsInAttoFIL",
// ...
}
```### `GET /scheduled-rewards/:address`
Response:
```js
"scheduledRewardsInAttoFIL"
```### `POST /scores`
Request:
```js
{
"participants": ["address" /* ... */],
"scores": ["score" /* ... */],
"signature": {
"r": "...",
"s": "...",
"v": "..."
}
}
```Sign over a packed keccak256 with this schema:
```js
['address[]', 'uint256[]']
```The response includes the resulting scheduled rewards of all affected
participants (excluding the burner address):```js
{
"address": "scheduledRewardsInAttoFIL",
// ...
}
```### `POST /paid`
Request:
```js
{
"participants": ["address" /* ... */],
"rewards": ["amountInAttoFIL", /* ... */],
"signature": {
"r": "...",
"s": "...",
"v": "..."
}
}
```Sign over a packed keccak256 with this schema:
```js
['address[]', 'uint256[]']
```The response includes the resulting scheduled rewards of all affected
participants:```js
{
"adddress": "scheduledRewardsInAttoFIL",
// ...
}
```### `GET /log`
The log endpoint returns an audit trail of all scheduled rewards changes over
time:```js
[
{
timestamp: "2024-08-28T14:15:08.113Z",
address: "address",
scheduledRewardsDelta: "amountInAttoFIL",
score: "score"
}, {
timestamp: "2024-08-28T14:15:25.441Z",
address: "address",
scheduledRewardsDelta: "negativeAmountInAttoFIL"
// In case of a payout, no `score` is logged
}
// ...
]
```## Development
```bash
redis-server &
npm start
```