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)
2) Datax.js
Create a function -
getTokenDetails(address inputAddress)
This function first
1) checks if given address is ERC20 token (by
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)
2) Datax.js
Create a function -
This function first 1) checks if given address is ERC20 token (by
returns below object