diff --git a/app/assets/locales/locale-en.json b/app/assets/locales/locale-en.json index f6263a91d..25bc3837e 100644 --- a/app/assets/locales/locale-en.json +++ b/app/assets/locales/locale-en.json @@ -1280,7 +1280,7 @@ "gateway": "Gateway", "disabled": "Gateway service disabled", "wallet_error": "Gateway wallet disabled", - "select_gateway": "Please select a gateway opperator", + "select_gateway": "Please select a gateway operator", "address_generation_error": "Unable to generate address", "bts_transfer_description": "It's easy to receive BTS from anywhere. As long as BTS is sent to your account name it will show up in your wallet. This QR code also contains your account name.", "close": "Close", diff --git a/app/components/DepositWithdraw/DepositWithdrawAssetSelector.js b/app/components/DepositWithdraw/DepositWithdrawAssetSelector.js index edf8b7b22..afb60a27e 100644 --- a/app/components/DepositWithdraw/DepositWithdrawAssetSelector.js +++ b/app/components/DepositWithdraw/DepositWithdrawAssetSelector.js @@ -1,9 +1,8 @@ import React from "react"; import { connect } from "alt-react"; -import Translate from "react-translate-component"; import BindToChainState from "../Utility/BindToChainState"; import { Apis } from "bitsharesjs-ws"; -import { settingsAPIs, rudexAPIs } from "api/apiConfig"; +import { rudexAPIs } from "api/apiConfig"; import GatewayStore from "stores/GatewayStore"; import GatewayActions from "actions/GatewayActions"; import TypeAhead from "../Utility/TypeAhead"; diff --git a/app/components/Modal/DepositModal.jsx b/app/components/Modal/DepositModal.jsx index cfe09abfd..d833680cd 100644 --- a/app/components/Modal/DepositModal.jsx +++ b/app/components/Modal/DepositModal.jsx @@ -3,8 +3,7 @@ import ZfApi from "react-foundation-apps/src/utils/foundation-api"; import BaseModal from "../Modal/BaseModal"; import Translate from "react-translate-component"; import utils from "common/utils"; -import BindToChainState from "../Utility/BindToChainState"; -import {requestDepositAddress, validateAddress} from "common/blockTradesMethods"; +import {requestDepositAddress} from "common/blockTradesMethods"; import BlockTradesDepositAddressCache from "common/BlockTradesDepositAddressCache"; import CopyButton from "../Utility/CopyButton"; import Icon from "../Icon/Icon"; @@ -12,14 +11,13 @@ import LoadingIndicator from "../LoadingIndicator"; import {DecimalChecker} from "../Exchange/ExchangeInput"; import QRCode from "qrcode.react"; import DepositWithdrawAssetSelector from "../DepositWithdraw/DepositWithdrawAssetSelector.js"; -import ChainTypes from "../Utility/ChainTypes"; class DepositModalContent extends DecimalChecker { - + constructor() { super(); - + this.state = { depositAddress: "", selectedAsset: "BTS", @@ -27,7 +25,7 @@ class DepositModalContent extends DecimalChecker { fetchingAddress: false, backingAsset: null, gatewayStatus: { - OPEN: { id: "OPEN", name: "OPENLEDGER", enabled: false, selected: false, support_url: "https://wallet.bitshares.org/#/help/gateways/openledger" }, + OPEN: { id: "OPEN", name: "OPENLEDGER", enabled: false, selected: false, support_url: "https://wallet.bitshares.org/#/help/gateways/openledger" }, RUDEX: { id: "RUDEX", name: "RUDEX", enabled: false, selected: false, support_url: "https://wallet.bitshares.org/#/help/gateways/rudex" } } }; @@ -55,7 +53,7 @@ class DepositModalContent extends DecimalChecker { shouldComponentUpdate(np, ns) { return(!utils.are_equal_shallow(ns, this.state)); } - + onGatewayChanged(e) { if(!e.target.value) return; this._getDepositAddress(this.state.selectedAsset, e.target.value); @@ -69,7 +67,7 @@ class DepositModalContent extends DecimalChecker { for(let g in gatewayStatus) { if(gatewayStatus[g].enabled) { nAvailable++; } } if(nAvailable == 1) { for(let g in gatewayStatus) { if(gatewayStatus[g].enabled) { selectedGateway = g; } } } - + // Fetch address if we have a selected gateway if(selectedGateway) { this._getDepositAddress(selectedAsset, selectedGateway); } else { @@ -99,7 +97,7 @@ class DepositModalContent extends DecimalChecker { _getDepositAddress(selectedAsset, selectedGateway) { let {account} = this.props; - this.setState({ + this.setState({ fetchingAddress: true, depositAddress: null, gatewayStatus: this._getAvailableGateways(selectedAsset) @@ -126,11 +124,11 @@ class DepositModalContent extends DecimalChecker { selectedGateway.toUpperCase(), account, selectedAsset.toLowerCase(), - selectedGateway.toLowerCase() + "." + selectedAsset.toLowerCase(), + selectedGateway.toLowerCase() + "." + selectedAsset.toLowerCase(), ); if(!depositAddress) { requestDepositAddress({ - inputCoinType: selectedAsset.toLowerCase(), + inputCoinType: selectedAsset.toLowerCase(), outputCoinType: "open." + selectedAsset.toLowerCase(), outputAddress: account, stateCallback: this.addDepositAddress @@ -143,7 +141,7 @@ class DepositModalContent extends DecimalChecker { } } else if(selectedGateway == "RUDEX") { this.setState({ - depositAddress: { + depositAddress: { address: backingAsset.gatewayWallet, memo: "dex:" + account, }, @@ -153,7 +151,7 @@ class DepositModalContent extends DecimalChecker { console.log("Withdraw Modal Error: Unknown Gateway " + selectedGateway + "(asset: " + selectedAsset + ")"); } - this.setState({ + this.setState({ selectedAsset, selectedGateway, backingAsset @@ -187,7 +185,7 @@ class DepositModalContent extends DecimalChecker { render() { let {selectedAsset, selectedGateway, depositAddress, fetchingAddress, gatewayStatus, backingAsset} = this.state; let {account} = this.props; - + let usingGateway = true; if(selectedGateway == null && selectedAsset == "BTS") { @@ -251,15 +249,15 @@ class DepositModalContent extends DecimalChecker { : null} - {!fetchingAddress ? + {!fetchingAddress ? (!usingGateway || (usingGateway && selectedGateway && gatewayStatus[selectedGateway].enabled)) && depositAddress && !depositAddress.memo ? -