dataxfi / dapp

DataX Dapp Frontend
dapp-olive.vercel.app
0 stars 0 forks source link

[TODO] TradeX & StakeX : Allow users to search datatokens using datapool address #4

Open 0xMageX opened 3 years ago

0xMageX commented 3 years ago

Background

Currently we try to create and maintain list of datatokens and datapools (tokenlist) which is sourced from Ocean Aquarius. Since there is no direct api call to source this list of tokens and pools, we run scripted jobs to source this token details on weekly basis and publish new tokenlist on IPFS. As a result, there might be tokens and pools listed in between two consecutive jobs that might not be available for users to trade/stake on DataX. And this scenario will be more likely once DataX gets more traction.

Task

We want to allow users to input DataPool Address (contract address) in the input field, which will be used by datax.js to find datatoken details and datapools details. Thereby, allowing users to interact with datatokens even not listed on DataX yet.

Implementation

Suggested implementation is as follows -

1) Dapp (TradeX & StakeX)

In TokenList Dialog box, replace Search box text by - "Search by token name, address or datapool address" (see screenshot below)

image

2) Datax.js

Create a function -

getTokenDetails(address inputAddress) 

This function first 1) checks if given address is ERC20 token (by

returns below object

{
"type":"datatoken",
"address": <datatoken-address>,
"poolAddress: <datapool-address>

}
0xaki commented 2 years ago

dapp repo issues