diff options
author | Hsuan Lee <boczeratul@gmail.com> | 2019-04-25 10:59:08 +0800 |
---|---|---|
committer | Hsuan Lee <boczeratul@gmail.com> | 2019-04-25 10:59:08 +0800 |
commit | b33a2b70b16c03e6966a696eb33b18a5bd6c0ceb (patch) | |
tree | 59cbe923c41be87dd8effd4b3c2b21ae3d027b78 | |
parent | f8423f5a49fbc934109d53754ddd3ae22bd717d2 (diff) | |
download | dexon-wallet-b33a2b70b16c03e6966a696eb33b18a5bd6c0ceb.tar.gz dexon-wallet-b33a2b70b16c03e6966a696eb33b18a5bd6c0ceb.tar.zst dexon-wallet-b33a2b70b16c03e6966a696eb33b18a5bd6c0ceb.zip |
Show proper USD value
-rw-r--r-- | app/scripts/controllers/currency.js | 29 | ||||
-rw-r--r-- | notices/archive/notice_0.md | 28 | ||||
-rw-r--r-- | ui/app/components/currency-display/currency-display.container.js | 4 | ||||
-rw-r--r-- | ui/app/components/pages/settings/info-tab/info-tab.component.js | 4 |
4 files changed, 15 insertions, 50 deletions
diff --git a/app/scripts/controllers/currency.js b/app/scripts/controllers/currency.js index 6ce86476..0682f904 100644 --- a/app/scripts/controllers/currency.js +++ b/app/scripts/controllers/currency.js @@ -134,14 +134,9 @@ class CurrencyController { currentCurrency = this.getCurrentCurrency() nativeCurrency = this.getNativeCurrency() // select api - let apiUrl - if (nativeCurrency === 'DXN') { - // DEX - apiUrl = `https://api.infura.io/v1/ticker/eth${currentCurrency.toLowerCase()}` - } else { - // ETC - apiUrl = `https://min-api.cryptocompare.com/data/price?fsym=${nativeCurrency.toUpperCase()}&tsyms=${currentCurrency.toUpperCase()}` - } + // apiUrl = `https://api.infura.io/v1/ticker/eth${currentCurrency.toLowerCase()}` + const apiUrl = 'https://api.cobinhood.com/v1/market/exchange_rates/DXN' + // attempt request let response try { @@ -160,21 +155,9 @@ class CurrencyController { log.error(new Error(`CurrencyController - Failed to parse response "${rawResponse}"`)) return } - // set conversion rate - if (nativeCurrency === 'DXN') { - // DEX - this.setConversionRate(Number(parsedResponse.bid)) - this.setConversionDate(Number(parsedResponse.timestamp)) - } else { - // ETC - if (parsedResponse[currentCurrency.toUpperCase()]) { - this.setConversionRate(Number(parsedResponse[currentCurrency.toUpperCase()])) - this.setConversionDate(parseInt((new Date()).getTime() / 1000)) - } else { - this.setConversionRate(0) - this.setConversionDate('N/A') - } - } + + this.setConversionRate(Number(parsedResponse.result.price_usd)) + this.setConversionDate(Date.now()) } catch (err) { // reset current conversion rate log.warn(`DekuSan - Failed to query currency conversion:`, nativeCurrency, currentCurrency, err) diff --git a/notices/archive/notice_0.md b/notices/archive/notice_0.md index a4b96a1e..e69fbcf2 100644 --- a/notices/archive/notice_0.md +++ b/notices/archive/notice_0.md @@ -36,7 +36,7 @@ By utilizing the Service or interacting with the Content or platform in any way, ### 5.3 Risk of Regulatory Actions in One or More Jurisdictions ### -DEXON Wallet and ETH could be impacted by one or more regulatory inquiries or regulatory action, which could impede or limit the ability of DEXON Wallet to continue to develop, or which could impede or limit your ability to access or use the Service or DEXON blockchain. +DEXON Wallet and DXN could be impacted by one or more regulatory inquiries or regulatory action, which could impede or limit the ability of DEXON Wallet to continue to develop, or which could impede or limit your ability to access or use the Service or DEXON blockchain. ### 5.4 Risk of Weaknesses or Exploits in the Field of Cryptography ### @@ -56,13 +56,13 @@ You agree to release and to indemnify, defend and hold harmless DEXON Wallet and ## 7. Limitation on liability ## -YOU ACKNOWLEDGE AND AGREE THAT YOU ASSUME FULL RESPONSIBILITY FOR YOUR USE OF THE SITE AND SERVICE. YOU ACKNOWLEDGE AND AGREE THAT ANY INFORMATION YOU SEND OR RECEIVE DURING YOUR USE OF THE SITE AND SERVICE MAY NOT BE SECURE AND MAY BE INTERCEPTED OR LATER ACQUIRED BY UNAUTHORIZED PARTIES. YOU ACKNOWLEDGE AND AGREE THAT YOUR USE OF THE SITE AND SERVICE IS AT YOUR OWN RISK. RECOGNIZING SUCH, YOU UNDERSTAND AND AGREE THAT, TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, NEITHER METAMASK NOR ITS SUPPLIERS OR LICENSORS WILL BE LIABLE TO YOU FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY OR OTHER DAMAGES OF ANY KIND, INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF PROFITS, GOODWILL, USE, DATA OR OTHER TANGIBLE OR INTANGIBLE LOSSES OR ANY OTHER DAMAGES BASED ON CONTRACT, TORT, STRICT LIABILITY OR ANY OTHER THEORY (EVEN IF METAMASK HAD BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES), RESULTING FROM THE SITE OR SERVICE; THE USE OR THE INABILITY TO USE THE SITE OR SERVICE; UNAUTHORIZED ACCESS TO OR ALTERATION OF YOUR TRANSMISSIONS OR DATA; STATEMENTS OR CONDUCT OF ANY THIRD PARTY ON THE SITE OR SERVICE; ANY ACTIONS WE TAKE OR FAIL TO TAKE AS A RESULT OF COMMUNICATIONS YOU SEND TO US; HUMAN ERRORS; TECHNICAL MALFUNCTIONS; FAILURES, INCLUDING PUBLIC UTILITY OR TELEPHONE OUTAGES; OMISSIONS, INTERRUPTIONS, LATENCY, DELETIONS OR DEFECTS OF ANY DEVICE OR NETWORK, PROVIDERS, OR SOFTWARE (INCLUDING, BUT NOT LIMITED TO, THOSE THAT DO NOT PERMIT PARTICIPATION IN THE SERVICE); ANY INJURY OR DAMAGE TO COMPUTER EQUIPMENT; INABILITY TO FULLY ACCESS THE SITE OR SERVICE OR ANY OTHER WEBSITE; THEFT, TAMPERING, DESTRUCTION, OR UNAUTHORIZED ACCESS TO, IMAGES OR OTHER CONTENT OF ANY KIND; DATA THAT IS PROCESSED LATE OR INCORRECTLY OR IS INCOMPLETE OR LOST; TYPOGRAPHICAL, PRINTING OR OTHER ERRORS, OR ANY COMBINATION THEREOF; OR ANY OTHER MATTER RELATING TO THE SITE OR SERVICE. +YOU ACKNOWLEDGE AND AGREE THAT YOU ASSUME FULL RESPONSIBILITY FOR YOUR USE OF THE SITE AND SERVICE. YOU ACKNOWLEDGE AND AGREE THAT ANY INFORMATION YOU SEND OR RECEIVE DURING YOUR USE OF THE SITE AND SERVICE MAY NOT BE SECURE AND MAY BE INTERCEPTED OR LATER ACQUIRED BY UNAUTHORIZED PARTIES. YOU ACKNOWLEDGE AND AGREE THAT YOUR USE OF THE SITE AND SERVICE IS AT YOUR OWN RISK. RECOGNIZING SUCH, YOU UNDERSTAND AND AGREE THAT, TO THE FULLEST EXTENT PERMITTED BY APPLICABLE LAW, NEITHER DEXON NOR ITS SUPPLIERS OR LICENSORS WILL BE LIABLE TO YOU FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY OR OTHER DAMAGES OF ANY KIND, INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF PROFITS, GOODWILL, USE, DATA OR OTHER TANGIBLE OR INTANGIBLE LOSSES OR ANY OTHER DAMAGES BASED ON CONTRACT, TORT, STRICT LIABILITY OR ANY OTHER THEORY (EVEN IF DEXON HAD BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES), RESULTING FROM THE SITE OR SERVICE; THE USE OR THE INABILITY TO USE THE SITE OR SERVICE; UNAUTHORIZED ACCESS TO OR ALTERATION OF YOUR TRANSMISSIONS OR DATA; STATEMENTS OR CONDUCT OF ANY THIRD PARTY ON THE SITE OR SERVICE; ANY ACTIONS WE TAKE OR FAIL TO TAKE AS A RESULT OF COMMUNICATIONS YOU SEND TO US; HUMAN ERRORS; TECHNICAL MALFUNCTIONS; FAILURES, INCLUDING PUBLIC UTILITY OR TELEPHONE OUTAGES; OMISSIONS, INTERRUPTIONS, LATENCY, DELETIONS OR DEFECTS OF ANY DEVICE OR NETWORK, PROVIDERS, OR SOFTWARE (INCLUDING, BUT NOT LIMITED TO, THOSE THAT DO NOT PERMIT PARTICIPATION IN THE SERVICE); ANY INJURY OR DAMAGE TO COMPUTER EQUIPMENT; INABILITY TO FULLY ACCESS THE SITE OR SERVICE OR ANY OTHER WEBSITE; THEFT, TAMPERING, DESTRUCTION, OR UNAUTHORIZED ACCESS TO, IMAGES OR OTHER CONTENT OF ANY KIND; DATA THAT IS PROCESSED LATE OR INCORRECTLY OR IS INCOMPLETE OR LOST; TYPOGRAPHICAL, PRINTING OR OTHER ERRORS, OR ANY COMBINATION THEREOF; OR ANY OTHER MATTER RELATING TO THE SITE OR SERVICE. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OF CERTAIN WARRANTIES OR THE LIMITATION OR EXCLUSION OF LIABILITY FOR INCIDENTAL OR CONSEQUENTIAL DAMAGES. ACCORDINGLY, SOME OF THE ABOVE LIMITATIONS MAY NOT APPLY TO YOU. ## 8. Our Proprietary Rights ## -All title, ownership and intellectual property rights in and to the Service are owned by DEXON Wallet or its licensors. You acknowledge and agree that the Service contains proprietary and confidential information that is protected by applicable intellectual property and other laws. Except as expressly authorized by DEXON Wallet, you agree not to copy, modify, rent, lease, loan, sell, distribute, perform, display or create derivative works based on the Service, in whole or in part. DEXON Wallet issues a license for DEXON Wallet, found [here](https://github.com/DEXON Wallet/metamask-plugin/blob/master/LICENSE). For information on other licenses utilized in the development of DEXON Wallet, please see our attribution page at: [https://metamask.io/attributions.html](https://metamask.io/attributions.html) +All title, ownership and intellectual property rights in and to the Service are owned by DEXON Wallet or its licensors. You acknowledge and agree that the Service contains proprietary and confidential information that is protected by applicable intellectual property and other laws. Except as expressly authorized by DEXON Wallet, you agree not to copy, modify, rent, lease, loan, sell, distribute, perform, display or create derivative works based on the Service, in whole or in part. DEXON Wallet issues a license for DEXON Wallet, found [here](https://github.com/dexon-foundation/dekusan/blob/master/LICENSE). ## 9. Links ## @@ -96,17 +96,7 @@ If you believe that your copyright or the copyright of a person on whose behalf DEXON Wallet’s Copyright Agent can be reached at: -Email: copyright [at] metamask [dot] io - -Mail: - -Attention: - -DEXON Wallet Copyright ℅ ConsenSys - -49 Bogart Street - -Brooklyn, NY 11206 +Email: app [at] dexon [dot] org ## 13. Binding Arbitration and Class Action Waiver ## @@ -130,7 +120,7 @@ Binding arbitration shall take place in New York. You agree to submit to the per ### 13.4 Class Action Waiver ### -The parties further agree that any arbitration shall be conducted in their individual capacities only and not as a class action or other representative action, and the parties expressly waive their right to file a class action or seek relief on a class basis. YOU AND METAMASK AGREE THAT EACH MAY BRING CLAIMS AGAINST THE OTHER ONLY IN YOUR OR ITS INDIVIDUAL CAPACITY, AND NOT AS A PLAINTIFF OR CLASS MEMBER IN ANY PURPORTED CLASS OR REPRESENTATIVE PROCEEDING. If any court or arbitrator determines that the class action waiver set forth in this paragraph is void or unenforceable for any reason or that an arbitration can proceed on a class basis, then the arbitration provision set forth above shall be deemed null and void in its entirety and the parties shall be deemed to have not agreed to arbitrate disputes. +The parties further agree that any arbitration shall be conducted in their individual capacities only and not as a class action or other representative action, and the parties expressly waive their right to file a class action or seek relief on a class basis. YOU AND DEXON AGREE THAT EACH MAY BRING CLAIMS AGAINST THE OTHER ONLY IN YOUR OR ITS INDIVIDUAL CAPACITY, AND NOT AS A PLAINTIFF OR CLASS MEMBER IN ANY PURPORTED CLASS OR REPRESENTATIVE PROCEEDING. If any court or arbitrator determines that the class action waiver set forth in this paragraph is void or unenforceable for any reason or that an arbitration can proceed on a class basis, then the arbitration provision set forth above shall be deemed null and void in its entirety and the parties shall be deemed to have not agreed to arbitrate disputes. ### 13.5 Exception - Litigation of Intellectual Property and Small Claims Court Claims ### @@ -169,11 +159,3 @@ The section titles in the Terms are for convenience only and have no legal or co ### 14.5 Communications ### Users with questions, complaints or claims with respect to the Service may contact us using the relevant contact information set forth above and at support@dexon.org. - -## 15 Related Links ## - -**[Terms of Use](https://metamask.io/terms.html)** - -**[Privacy](https://metamask.io/privacy.html)** - -**[Attributions](https://metamask.io/attributions.html)** diff --git a/ui/app/components/currency-display/currency-display.container.js b/ui/app/components/currency-display/currency-display.container.js index a6d307e3..db4017eb 100644 --- a/ui/app/components/currency-display/currency-display.container.js +++ b/ui/app/components/currency-display/currency-display.container.js @@ -13,7 +13,7 @@ const mapStateToProps = state => { } const mergeProps = (stateProps, dispatchProps, ownProps) => { - const { nativeCurrency, currentCurrency, /* conversionRate, */ ...restStateProps } = stateProps + const { nativeCurrency, currentCurrency, conversionRate, ...restStateProps } = stateProps const { value, numberOfDecimals = 2, @@ -32,7 +32,7 @@ const mergeProps = (stateProps, dispatchProps, ownProps) => { value, fromCurrency: nativeCurrency, toCurrency, - conversionRate: 0, + conversionRate, numberOfDecimals, toDenomination: denomination, }), diff --git a/ui/app/components/pages/settings/info-tab/info-tab.component.js b/ui/app/components/pages/settings/info-tab/info-tab.component.js index e1c902bf..1f3157fb 100644 --- a/ui/app/components/pages/settings/info-tab/info-tab.component.js +++ b/ui/app/components/pages/settings/info-tab/info-tab.component.js @@ -32,7 +32,7 @@ export default class InfoTab extends PureComponent { </div> <div className="info-tab__link-item"> <a - href="https://github.com/dexon-foundation/dekusan/blob/develop/docs/privacy.md" + href="https://dexon.org/dexon-wallet-privacy" target="_blank" rel="noopener noreferrer" > @@ -43,7 +43,7 @@ export default class InfoTab extends PureComponent { </div> <div className="info-tab__link-item"> <a - href="https://github.com/dexon-foundation/dekusan/blob/develop/docs/terms-of-use.md" + href="https://dexon.org/dexon-wallet-tos" target="_blank" rel="noopener noreferrer" > |