BlockPo / BlockPo-to-Tradelayer

Incubation Repo for the TradeLayer protocol, 0.2.0
http://www.tradelayer.org
Other
8 stars 8 forks source link

Missing RPCs for "tl_get_channelreserve","tl_getchannel_info" #316

Closed patrickdugan closed 4 years ago

patrickdugan commented 4 years ago

Couldn't find in RPC.cpp any functions to make these two calls work. Both should take the channel address as a parameter and return the relevant data.

patrickdugan commented 4 years ago

Let's make it just getchannel_info like this:

{ channelAddress: 3Q2i3ssGWstW... firstFundingAddress: 1W7xoOPpslLke... secondFundingAddress: 1uTqwe234as firstAddressReserves: [{propertyid: 4, amount:231}] secondAddressReserves: [{propertyid:5, amount:23.1}] }

patrickdugan commented 4 years ago

A note, we may need to add some logic related with the concept of a specific address A and B. If a tx comes first, it's address A, a contract trade can implied to be either a 'buy' to address A buying from address B, or a 'sell' from address A to address B, for tokens it's just the two property ids and the first one is implied to be the trade consideration for address A. Then therefore, to handle commits from new addresses, we don't know who really controls it, maybe it's best if commits from new addresses are invalid tx. Simpler that way.

patrickdugan commented 4 years ago

Closing this as these RPCs are already extand in the higher part of rpc.cpp