TosiDrop / vm-frontend

Frontend for TosiDrop

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add a "Rewards History" button

wolf31o2 opened this issue · comments

I think we should have a "View recent claims" (or similar) button next to "Check my rewards" which will show the user a prettier version of the output from /getdeliveredrewards endpoint. This will show the user their most recent 100 token claims.

The endpoint is passing the raw VM response. It might make sense to properly type it.

Current response:

[
    {
        "id": "149",
        "staking_address": "stake_test1upx0fuqcjqs4h5vp687d8j2cng4y5wkmelc6wzm5szq04qsm5d0l6",
        "epoch": "37",
        "token": "148b7f9ce43bf557f74b8f23e90fff8ee479561093e8d7b375ba8468.4455434b53",
        "amount": "69",
        "withdrawal_request": "17",
        "expiry_return_pool_id": "project_tosidrop",
        "expiry": "57",
        "return_policy": "2",
        "delivered_on": "2022-09-15 16:43:54.558993"
    },
    {
        "id": "148",
        "staking_address": "stake_test1upx0fuqcjqs4h5vp687d8j2cng4y5wkmelc6wzm5szq04qsm5d0l6",
        "epoch": "0",
        "token": "lovelace",
        "amount": "1800000",
        "withdrawal_request": "17",
        "expiry_return_pool_id": null,
        "expiry": "0",
        "return_policy": "0",
        "delivered_on": "2022-09-15 16:43:54.558993"
    }
]

I think the only thing we really need is to show the token ticker (and logo?), amount, and delivery time. All times returned are GMT+2 (local to VM), so we should probably convert them to UTC (or browser timezone)