BlockPo / BlockPo-to-Tradelayer

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

contractID passed as a variable from fronend slider #250

Closed Galuf1 closed 3 years ago

Galuf1 commented 4 years ago

Current contract has to populate the variable contractID to be sent to the api, so it checks positions and orderbooks instead of being hardcoded in frontend.

The current contract should come from clicking in the slider that lets you pick your contract to trade.

patrickdugan commented 4 years ago

I'm not sure if a slider is the best UI implement, maybe just a drop-down menu?

Galuf1 commented 4 years ago

https://github.com/patrickdugan/tradelayer_wallet_mono_repo_v1/blob/master/frontend-wallet/src/containers/SummaryContainer.vue#L8

Here you can see all contracts are hardcoded in this slider image

That should not be hardcoded, it should come from the result of consulting the api with the call properties//listNatives and properties/listOracleContracts. In the result of that calls, you'll get a JSON with different contracts, of which you have to extract the "name" image and pass that as a variable for the slider, if there is 10 contracts, there should be 10 options, if there is 100, 100 options.

And after that being populated with the result from the api call, it should populate the variable contractID that is required for everything else. like this:

https://github.com/patrickdugan/tradelayer_wallet_mono_repo_v1/blob/master/frontend-wallet/src/components/Positions.vue#L54

now about the dropdown or slider i don't really know, if @patrickdugan thinks it's the best we should go for it, unless you think otherwise @afroguy16

patrickdugan commented 3 years ago

Closing as this milestone is in another repo.