diff --git a/app/api/apiConfig.js b/app/api/apiConfig.js index 123569e842..06a073bf57 100644 --- a/app/api/apiConfig.js +++ b/app/api/apiConfig.js @@ -22,7 +22,7 @@ export const openledgerAPIs = { }; export const rudexAPIs = { - BASE: "https://gateway.rudex.org/api/v3_0", + BASE: "https://gateway.rudex.org/api/rudex", COINS_LIST: "/coins", NEW_DEPOSIT_ADDRESS: "/simple-api/initiate-trade" }; diff --git a/app/assets/asset-symbols/rudex.pzm.png b/app/assets/asset-symbols/rudex.pzm.png new file mode 100644 index 0000000000..1275b9ccb7 Binary files /dev/null and b/app/assets/asset-symbols/rudex.pzm.png differ diff --git a/app/assets/asset-symbols/symbols.js b/app/assets/asset-symbols/symbols.js index 95604f82ab..c16c153a55 100644 --- a/app/assets/asset-symbols/symbols.js +++ b/app/assets/asset-symbols/symbols.js @@ -19,6 +19,7 @@ require("file-loader?name=asset-symbols/[name].png!./rudex.eth.png"); require("file-loader?name=asset-symbols/[name].png!./rudex.golos.png"); require("file-loader?name=asset-symbols/[name].png!./rudex.steem.png"); require("file-loader?name=asset-symbols/[name].png!./rudex.smoke.png"); +require("file-loader?name=asset-symbols/[name].png!./rudex.pzm.png"); require("file-loader?name=asset-symbols/[name].png!./rudex.dgb.png"); require("file-loader?name=asset-symbols/[name].png!./rudex.gbg.png"); diff --git a/app/assets/coins-logo/coins.js b/app/assets/coins-logo/coins.js index bd7d2cca8d..2ab68679e4 100644 --- a/app/assets/coins-logo/coins.js +++ b/app/assets/coins-logo/coins.js @@ -9,5 +9,6 @@ require("file-loader?name=coins-logo/[name].png!./neo.png"); require("file-loader?name=coins-logo/[name].png!./ltc.png"); require("file-loader?name=coins-logo/[name].png!./doge.png"); require("file-loader?name=coins-logo/[name].png!./dash.png"); +require("file-loader?name=coins-logo/[name].png!./dna.png"); require("file-loader?name=coins-logo/[name].png!./pzm.png"); diff --git a/app/assets/coins-logo/dna.png b/app/assets/coins-logo/dna.png new file mode 100644 index 0000000000..59f72cd1a2 Binary files /dev/null and b/app/assets/coins-logo/dna.png differ diff --git a/app/assets/locales/locale-en.json b/app/assets/locales/locale-en.json index 47d6c68aaf..ab770b7f8a 100644 --- a/app/assets/locales/locale-en.json +++ b/app/assets/locales/locale-en.json @@ -1707,6 +1707,7 @@ "no_assets": "No withdrawable assets available", "no_estimate": "No estimate available for this object", "no_gateways": "Sorry, but there are no gateways available to handle this withdrawal", + "public_key": "Public key", "quantity": "Quantity", "submit": "Withdraw", "withdraw": "Withdraw" @@ -2988,6 +2989,7 @@ "submit_request": "Submit request", "add_coin": "Add Coin", "donate_progress": "Crowdfunding progress", + "listed": "Listed", "get_donate_tokens": "Get ", "token": " token", "loading": "Please wait, loading...", diff --git a/app/assets/locales/locale-ru.json b/app/assets/locales/locale-ru.json index 10decd4e85..e3675d3cce 100644 --- a/app/assets/locales/locale-ru.json +++ b/app/assets/locales/locale-ru.json @@ -1686,6 +1686,7 @@ "no_assets": "Нет доступных активов для вывода", "no_estimate": "Для этого объекта нет доступных оценок", "no_gateways": "Извините, для обработки этой операции вывода нет доступных шлюзов", + "public_key": "Public key", "quantity": "Количество", "submit": "Вывести", "withdraw": "Вывод" @@ -2967,6 +2968,7 @@ "submit_request": "Подать заявку", "add_coin": "Добавить монету", "donate_progress": "Прогресс краудфандинга", + "listed": "Размещенные активы", "get_donate_tokens": "Получить ", "token": " токен", "loading": "Подождите, идёт загрузка", diff --git a/app/branding.js b/app/branding.js index c732306fa4..4177d71438 100644 --- a/app/branding.js +++ b/app/branding.js @@ -148,7 +148,8 @@ export function getMyMarketsQuotes() { "RUDEX.GOLOS", "RUDEX.STEEM", "RUDEX.WLS", - "RUDEX.SMOKE" + "RUDEX.SMOKE", + "RUDEX.PZM" //"RUDEX.GRC", //"RUDEX.GBG", @@ -181,6 +182,7 @@ export function getFeaturedMarkets(quotes = []) { ["RUBLE", "RUDEX.ETH"], ["RUBLE", "RUDEX.EOS"], ["RUBLE", "RUDEX.USDT"], + ["RUBLE", "RUDEX.PZM"], ["RUDEX.USDT", "RUDEX.BTC"], ["RUDEX.USDT", "RUDEX.ETH"], @@ -191,6 +193,7 @@ export function getFeaturedMarkets(quotes = []) { ["RUDEX.USDT", "RUDEX.SMOKE"], ["RUDEX.USDT", "RUDEX.WLS"], ["RUDEX.USDT", "RUBLE"], + ["RUDEX.USDT", "RUDEX.PZM"], ["RUDEX.BTC", "RUDEX.ETH"], ["RUDEX.BTC", "RUDEX.EOS"], @@ -201,6 +204,7 @@ export function getFeaturedMarkets(quotes = []) { ["RUDEX.BTC", "PPY"], ["RUDEX.BTC", "DONATE"], ["RUDEX.BTC", "USDT"], + ["RUDEX.BTC", "RUDEX.PZM"], ["BTS", "RUDEX.GOLOS"], ["BTS", "RUDEX.STEEM"], @@ -209,7 +213,8 @@ export function getFeaturedMarkets(quotes = []) { ["BTS", "RUDEX.ETH"], ["BTS", "RUDEX.USDT"], ["BTS", "RUDEX.WLS"], - ["BTS", "RUDEX.SMOKE"] + ["BTS", "RUDEX.SMOKE"], + ["BTS", "RUDEX.PZM"] //["BTS", "DONATE"] ].filter(a => { if (!quotes.length) return true; @@ -362,6 +367,18 @@ export function getListingCoins() { goal: 10000, votes: 0 }, + { + name: "Idena", + ticker: "DNA", + account: "rudex-idena", + goal: 10000, + votes: 0 + } + ]; +} + +export function getListedCoins() { + return [ { name: "PRIZM", ticker: "PZM", diff --git a/app/components/DepositWithdraw/rudex/RuDexGateway.jsx b/app/components/DepositWithdraw/rudex/RuDexGateway.jsx index 2f1a9ba125..34acd45355 100644 --- a/app/components/DepositWithdraw/rudex/RuDexGateway.jsx +++ b/app/components/DepositWithdraw/rudex/RuDexGateway.jsx @@ -241,6 +241,9 @@ class RuDexGateway extends React.Component { receive_asset={coin.symbol} receive_coin_type={coin.symbol.toLowerCase()} supports_output_memos={coin.supportsMemos} + supportsPublicKey={ + coin.supportsPublicKey || false + } memoType={coin.memoType} min_amount={coin.minAmount} gateFee={coin.gateFee} diff --git a/app/components/DepositWithdraw/rudex/RuDexGatewayDepositRequest.jsx b/app/components/DepositWithdraw/rudex/RuDexGatewayDepositRequest.jsx index 7855b53a2f..36e6213c33 100644 --- a/app/components/DepositWithdraw/rudex/RuDexGatewayDepositRequest.jsx +++ b/app/components/DepositWithdraw/rudex/RuDexGatewayDepositRequest.jsx @@ -33,6 +33,7 @@ class RuDexGatewayDepositRequest extends React.Component { deprecated_message: PropTypes.string, action: PropTypes.string, supports_output_memos: PropTypes.bool.isRequired, + supportsPublicKey: PropTypes.bool.isRequired, memoType: PropTypes.string, min_amount: PropTypes.number, gateFee: PropTypes.number, @@ -572,6 +573,9 @@ class RuDexGatewayDepositRequest extends React.Component { output_supports_memos={ this.props.supports_output_memos } + output_supportsPublicKey={ + this.props.supportsPublicKey + } memo_prefix={withdraw_memo_prefix} modal_id={withdraw_modal_id} min_amount={this.props.min_amount} diff --git a/app/components/DepositWithdraw/rudex/RuDexWithdrawModal.jsx b/app/components/DepositWithdraw/rudex/RuDexWithdrawModal.jsx index 5e116a052b..f0245c690f 100644 --- a/app/components/DepositWithdraw/rudex/RuDexWithdrawModal.jsx +++ b/app/components/DepositWithdraw/rudex/RuDexWithdrawModal.jsx @@ -28,6 +28,7 @@ class RuDexWithdrawModal extends React.Component { url: PropTypes.string, output_wallet_type: PropTypes.string, output_supports_memos: PropTypes.bool.isRequired, + output_supportsPublicKey: PropTypes.bool.isRequired, amount_to_withdraw: PropTypes.string, balance: ChainTypes.ChainObject, min_amount: PropTypes.number, @@ -50,6 +51,10 @@ class RuDexWithdrawModal extends React.Component { withdraw_address_selected: WithdrawAddresses.getLast( props.output_wallet_type ), + withdraw_publicKey: "", + withdraw_publicKey_not_empty: this.props.output_supportsPublicKey + ? false + : true, memo: "", withdraw_address_first: true, empty_withdraw_value: false, @@ -245,16 +250,37 @@ class RuDexWithdrawModal extends React.Component { this._validateAddress(new_withdraw_address); } + onWithdrawPublicKeyChanged(e) { + let new_withdraw_publicKey = e.target.value.trim(); + this.setState({ + withdraw_publicKey: new_withdraw_publicKey, + withdraw_publicKey_not_empty: + new_withdraw_publicKey != "" ? true : false + }); + } + _validateAddress(new_withdraw_address, props = this.props) { validateAddress({ url: props.url, walletType: props.output_wallet_type, newAddress: new_withdraw_address - }).then(isValid => { + }).then(json => { + if (typeof json === "undefined") { + json = {isValid: false}; + } if (this.state.withdraw_address === new_withdraw_address) { this.setState({ withdraw_address_check_in_progress: false, - withdraw_address_is_valid: isValid + withdraw_address_is_valid: json.isValid, + withdraw_publicKey: json.hasOwnProperty("publicKey") + ? json.publicKey + : "", + withdraw_publicKey_not_empty: this.props + .output_supportsPublicKey + ? json.hasOwnProperty("publicKey") + ? true + : false + : true }); } }); @@ -283,12 +309,12 @@ class RuDexWithdrawModal extends React.Component { withdraw_amount < this.props.min_amount / utils.get_asset_precision(this.props.asset_precision); - console.log( + /* console.log( "X", withdraw_amount, this.props.min_amount / - utils.get_asset_precision(this.props.asset_precision) - ); + utils.get_asset_precision(this.props.asset_precision) + );*/ this.setState({minAmountError: lessThanMinimum}); return lessThanMinimum; } @@ -353,6 +379,9 @@ class RuDexWithdrawModal extends React.Component { this.props.output_coin_type + ":" + this.state.withdraw_address + + (this.props.output_supportsPublicKey + ? ":" + this.state.withdraw_publicKey + : "") + (this.state.memo ? ":" + new Buffer(this.state.memo, "utf-8") : ""), @@ -415,6 +444,9 @@ class RuDexWithdrawModal extends React.Component { this.props.output_coin_type + ":" + this.state.withdraw_address + + (this.props.output_supportsPublicKey + ? ":" + this.state.withdraw_publicKey + : "") + (this.state.memo ? ":" + new Buffer(this.state.memo, "utf-8") : ""), @@ -483,6 +515,7 @@ class RuDexWithdrawModal extends React.Component { _getAvailableAssets(state = this.state) { const {from_account, feeStatus} = state; + function hasFeePoolBalance(id) { if (feeStatus[id] === undefined) return true; return feeStatus[id] && feeStatus[id].hasPoolBalance; @@ -552,7 +585,7 @@ class RuDexWithdrawModal extends React.Component { } render() { - let {withdraw_address_selected, memo} = this.state; + let {withdraw_address_selected, withdraw_publicKey, memo} = this.state; let storedAddress = WithdrawAddresses.get( this.props.output_wallet_type ); @@ -842,6 +875,34 @@ class RuDexWithdrawModal extends React.Component { {invalid_address_message} + {/* for PublicKey input (ex.PRIZM) */} + {this.props.output_supportsPublicKey ? ( +