Skip to content
This repository has been archived by the owner on Jun 5, 2023. It is now read-only.

Return all hotspots which belonged to account at some point #395

Open
davetapley opened this issue Jan 1, 2022 · 2 comments
Open

Return all hotspots which belonged to account at some point #395

davetapley opened this issue Jan 1, 2022 · 2 comments

Comments

@davetapley
Copy link

The v1/accounts/:address/hotspots endpoint only returns hotspots which currently belong to an account.

As noted on davetapley/helium-tax#49, this creates a problem for tax reporting.


If I'm correct that there's currently no way to get such a list of hotspots from the API,
then could we get a new endpoint (or filter on v1/accounts/:address/hotspots)?

@davetapley
Copy link
Author

Relevant links:

get_hotspot_list([
{owner, Owner},
{city, undefined},
{filter_modes, FilterModes0},
{cursor, undefined}
]) ->
FilterModes =
case FilterModes0 of
undefined -> ?HOTSPOT_MODES;
_ -> FilterModes0
end,
Result = ?PREPARED_QUERY(?S_OWNER_HOTSPOT_LIST, [
Owner,
FilterModes
]),

And:

-- :owner_hotspot_list_source
from (select * from gateway_inventory where owner = $1) as g

@davetapley
Copy link
Author

davetapley commented Jan 1, 2022

Alas looking at gateway_inventory on https://etl.dewi.org/ it only includes current owners 😞

transactions_transfer_hotspot has it,
but we first need a transactions_transfer_hotspot.sql in /priv/ with something like:

select buyer, seller, gateway from transactions_transfer_hotspot
where seller = $1

I might have a go at a PR, but I haven't Erlang'd for a long time, so it might not be pretty 😆

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant