farcaster-project/farcaster-node

Add blockchain in `FundingAddressesResponse` gRPC type

h4sh3d opened this issue · 5 comments

Followup to #764

We could send back the blockchain type in the funding addresses response (or in AddressSwapIdPair). Even if we query by blockchain and thus have the data upstream adding the blockchain in the response allow later to query all funding addresses, this is useful if a frontend wants to query the full list to attach funding to all running swaps.

@h4sh3d if this is about adding the funding addresses to a running swap, wouldn't it be much easier to add the funding address to the SwapInfo instead?

Yes, that would be a better option than what I suggest here.

The funding address list is good as it is now, it's a need to have a list of all addresses, and instead of bloating that list with more data to improve the swap info I agree that we should directly add it to swap info message.

The information can be retrieved through the Deal in the SwapInfo.

With the refactors in place now, there are selectors for the blockchain and network in both the FundingAddressesRequest and the NeedsFundingRequest. I usually don't like mirroring args from the request into the response, but it would be very easy now to get this done. Would you still benefit from it?

Would you still benefit from it?

I don't think it is necessary to mirror those arguments from req to resp, so no.