ergoplatform / explorer-backend

Ergo Blockchain Explorer
22 stars 31 forks source link

Make getApiV1BoxesP1 optionally return unconfirmed boxes #216

Open MrStahlfelge opened 2 years ago

MrStahlfelge commented 2 years ago

getApiV1BoxesP1 returns box information, but there doesn't seem to be a way to make it return information for unconfirmed boxes. Only way to retrieve box information for unconfirmed boxes is to request the whole mempool, which is over the top when the box id is already known. I suggest we add a includeMempool parameter to getApiV1BoxesP1 which, when set to true, also returns unconfirmed boxes when available for the given id.

monyedavid commented 2 years ago

the pr #214 does this also

MrStahlfelge commented 2 years ago

Great :)

MrStahlfelge commented 2 years ago

@monyedavid @oskin1 #214 is merged now, how can I access the unconfirmed boxes by id?

oskin1 commented 2 years ago

@MrStahlfelge /api/v1/boxes/unspent/unconfirmed/byAddress/{add}

MrStahlfelge commented 2 years ago

This was is what was asked for. We needed an endpoint for unconfirmed boxes by id.

Additionally, I tested the endpoint and the behaviour is weird:

Last but not last, endpoint is not in API doc.