Skip to content

Commit

Permalink
- add PRIZM and it markets
Browse files Browse the repository at this point in the history
- add custom logic for public key PZM
- add Tab for listed projects
- change endpoint gateApi
- add IDENA to candidate for listing
  • Loading branch information
serdrdoor committed Apr 16, 2020
1 parent aa41f8a commit 7aa71f6
Show file tree
Hide file tree
Showing 17 changed files with 261 additions and 78 deletions.
2 changes: 1 addition & 1 deletion app/api/apiConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
};
Expand Down
Binary file added app/assets/asset-symbols/rudex.pzm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/asset-symbols/symbols.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
1 change: 1 addition & 0 deletions app/assets/coins-logo/coins.js
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Binary file added app/assets/coins-logo/dna.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions app/assets/locales/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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...",
Expand Down
2 changes: 2 additions & 0 deletions app/assets/locales/locale-ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,7 @@
"no_assets": "Нет доступных активов для вывода",
"no_estimate": "Для этого объекта нет доступных оценок",
"no_gateways": "Извините, для обработки этой операции вывода нет доступных шлюзов",
"public_key": "Public key",
"quantity": "Количество",
"submit": "Вывести",
"withdraw": "Вывод"
Expand Down Expand Up @@ -2967,6 +2968,7 @@
"submit_request": "Подать заявку",
"add_coin": "Добавить монету",
"donate_progress": "Прогресс краудфандинга",
"listed": "Размещенные активы",
"get_donate_tokens": "Получить ",
"token": " токен",
"loading": "Подождите, идёт загрузка",
Expand Down
21 changes: 19 additions & 2 deletions app/branding.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ export function getMyMarketsQuotes() {
"RUDEX.GOLOS",
"RUDEX.STEEM",
"RUDEX.WLS",
"RUDEX.SMOKE"
"RUDEX.SMOKE",
"RUDEX.PZM"

//"RUDEX.GRC",
//"RUDEX.GBG",
Expand Down Expand Up @@ -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"],
Expand All @@ -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"],
Expand All @@ -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"],
Expand All @@ -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;
Expand Down Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions app/components/DepositWithdraw/rudex/RuDexGateway.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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}
Expand Down
76 changes: 69 additions & 7 deletions app/components/DepositWithdraw/rudex/RuDexWithdrawModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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
});
}
});
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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")
: ""),
Expand Down Expand Up @@ -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")
: ""),
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
);
Expand Down Expand Up @@ -842,6 +875,34 @@ class RuDexWithdrawModal extends React.Component {
{invalid_address_message}
</div>

{/* for PublicKey input (ex.PRIZM) */}
{this.props.output_supportsPublicKey ? (
<div className="content-block">
<label className="left-label">
<Translate
component="span"
content="modal.withdraw.public_key"
/>
</label>
<div className="rudex-select-dropdown">
<div className="inline-label">
<input
type="text"
value={withdraw_publicKey}
tabIndex="5"
onChange={this.onWithdrawPublicKeyChanged.bind(
this
)}
onInput={this.onWithdrawPublicKeyChanged.bind(
this
)}
autoComplete="off"
/>
</div>
</div>
</div>
) : null}

{/* Memo input */}
{withdraw_memo}

Expand All @@ -851,7 +912,8 @@ class RuDexWithdrawModal extends React.Component {
disabled={
this.state.error ||
this.state.balanceError ||
this.state.minAmountError
this.state.minAmountError ||
!this.state.withdraw_publicKey_not_empty
}
type="primary"
onClick={this.onSubmit.bind(this)}
Expand Down
Loading

0 comments on commit 7aa71f6

Please sign in to comment.