BlockPo / BlockPo-to-Tradelayer

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

RPC for GetAllTxForBlock #110

Closed patrickdugan closed 4 years ago

patrickdugan commented 4 years ago

Omniexplorer shows summaries of all tx per block (e.g. https://omniexplorer.info/block/601832)

Our tx types are more varied, beyond SimpleSends.

We need a catch-all RPC that will return a list of TradeLayer addresses in a block.

JSON format:

{ blockHeight: 0, totalTradeLayerTX: 0, timestamp: 0, transactions: [ {type: "Simple Send", txHash: "", amount: 1234 propertyID: "4", alias: "dUSD" inputs: [{address:"",value:0}], outputs:[{address:"",value:0.00000540,vOut:0},{address:"",value:0.001234,vOut:2}], }, { type: "Trade Contract (Open Outcry)", txHash: "", amount: 4560 propertyID: "65", alias: "BLX, BTCUSD March 2020 Future" inputs: [{address:"",value:0}], outputs:[{address:"",value:0.00000540,vOut:0},{address:"",value:0.001234,vOut:2}], }, { type: "BTC For Tokens (Instant)", txHash: "", amount: 1000 propertyID: "3", alias: "BLX, BTCUSD March 2020 Future", inputs: [{address:"3m1234123asyasdq3",value:0.00014523},{address:1wyasdqUeoad1344},value:0.109234], outputs:[{address:"1myrefaddressgetthatBTC!",value:0.1089231,vOut:0}] }

Note that OP_Returns are a vOut:1 value output in a lot of Omni tx but basically we filter those out, present the data embedded, but include ideally this array data on the raw BTC outputs as it's salient to properly reading/signing instant-trade tx.

santos177 commented 4 years ago

Working on it, using getalltxforblock branch