Closed LefterisJP closed 4 years ago
https://github.com/gitcoinco/web/issues/6493#issuecomment-631218558
This problem is not resolved yet. The API is not opened for CORS so it won't be accessible on other web-based services.
(note: the API was just deployed)
recommend creating a seperate issue for the CORS thing. it was not part of the original scope
@owocki Would you mind paying out for this bounty? This has been completed: #6633 #6830
Issue Status: 1. Open 2. Started 3. Submitted 4. Done
The funding of 0.5 ETH (111.83 USD @ $223.65/ETH) attached to this issue has been approved & issued to @sebastiantf.
User Story
We at Rotki plan to create a premium component that would allow grantees to manage their grant earnings as income and take it into account in their income and Profit/loss report. The issue in our repo is here: https://github.com/rotki/rotki/issues/692
We planned to take all data from the chain but after discussion with @owocki if Gitcoin already has the data and can expose it via an endpoint our task will be easier. And this is probably something other Gitcoin users or applications who want to integrate with Gitcoin may appreciate.
We may still add on-chain verification for people who have their own node connected, but that's not relevant to this issue.
Note: We could probably do the same for grant donors, and count donations as expenses which depending on jurisdiction may also be tax-deductible.
Required data
As a Grantee
Given any ethereum address, return the following if it's a grant receiver:
asset sent
:ETH
,DAI
,SAI
.. whatevertimestamp
: The UTC timestamp the transaction took place inamount
: The final amount received. Minus gitcoin fees. This should be the actual amount the gitcoin grantee receives at the end. Would be best denoted in the WEI (18-decimals or whatever decimal the token has) equivalent.clr_round
: Gitcoin CLR matching round.usd_value
: The equivalent usd value of theamount
ofasset
. At Rotki we can find that out via integrations with historic price oracles but if you guys already have it then you are saving us API queries.The above should also contain the CLR matching payouts.
With all the above Rotki should have a complete picture of what the user's grant got and when. If possible the endpoint should be filtered by timestamp. Two arguments
from_timestamp
andto_timestamp
. Default from would be0
and default to would be current time. Time should be UTC.As a Grant donor
We can do the same for grant donors.
Given an address ask for all my gitcoin contributions. This would returns a list with each entry containing:
grant_name
: The name of the grant the contribution went toasset_sent
:ETH
,DAI
,SAI
.. whatevertimestamp
: The UTC timestamp of the transactiongrant_amount
: The amount of asset that the user contributed to the grant. Would be best denoted in the WEI (18-decimals or whatever decimal the token has) equivalent.gitcoin_maintenance_amount
: The amount of asset (if any) that the user contributed to the gitcoin maintenance fund as gitcoin fees.Would be best denoted in the WEI (18-decimals or whatever decimal the token has) equivalent.grant_usd_value
: The equivalent usd value of thegrant_amount
ofasset
gitcoin_usd_value
: The equivalent usd value of thegitcoin_maintenance_amount
ofasset