Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Citadel gateway #1695

Merged
merged 20 commits into from
Sep 6, 2018
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions app/api/apiConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ export const widechainAPIs = {
DEPOSIT_HISTORY: "/latelyRecharge"
};

export const citadelAPIs = {
BASE: "https://citadel.li/trade",
COINS_LIST: "/coins",
ACTIVE_WALLETS: "/active-wallets",
TRADING_PAIRS: "/trading-pairs",
DEPOSIT_LIMIT: "/deposit-limits",
ESTIMATE_OUTPUT: "/estimate-output-amount",
ESTIMATE_INPUT: "/estimate-input-amount"
};

export const gdex2APIs = {
BASE: "https://api.gdex.io/adjust",
COINS_LIST: "/coins",
Expand Down Expand Up @@ -476,6 +486,14 @@ export const settingsAPIs = {
location: "Paris",
operator: "Witness: zapata42-witness",
contact: "telegram:Zapata_42"
},
{
url: "wss://citadel.li/node",
location: "Island"
snakebitekit marked this conversation as resolved.
Show resolved Hide resolved
},
{
url: "ws://citadel2miawoaqw.onion/node",
snakebitekit marked this conversation as resolved.
Show resolved Hide resolved
location: "Citadel Tor"
}
],
DEFAULT_FAUCET: getFaucet().url,
Expand Down
7 changes: 7 additions & 0 deletions app/assets/locales/locale-de.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,13 @@
"calc": "Calculating",
"choose_deposit": "Please select the coin you would like to deposit",
"choose_withdraw": "Please select the coin you would like to withdraw",
"citadel": {
"coming_soon": "Coming soon",
"min_amount": "Minimum amount: %(minAmount)s %(symbol)s",
"min_amount_error": "Please enter number >= minimum",
"support_block": "For support, please contact citadel.li at:",
"under_construction": "Under Construction"
},
"contact_TRADE": "Contact Blocktrades",
"convert": "Internal conversion",
"convert_coin": "Convert to %(coin)s (%(symbol)s)",
Expand Down
8 changes: 8 additions & 0 deletions app/assets/locales/locale-en.json
Original file line number Diff line number Diff line change
Expand Up @@ -799,6 +799,13 @@
"calc": "Calculating",
"choose_deposit": "Please select the coin you would like to deposit",
"choose_withdraw": "Please select the coin you would like to withdraw",
"citadel": {
"coming_soon": "Coming soon",
"min_amount": "Minimum amount: %(minAmount)s %(symbol)s",
"min_amount_error": "Please enter number >= minimum",
"support_block": "For support, please contact citadel.li at:",
"under_construction": "Under Construction"
},
"contact_TRADE": "Contact Blocktrades",
"convert": "Internal conversion",
"convert_coin": "Convert to %(coin)s (%(symbol)s)",
Expand Down Expand Up @@ -882,6 +889,7 @@
"unavailable_OPEN": "The OpenLedger Gateway is down or not responding",
"unavailable_RUDEX": "The RuDEX Gateway is down or not responding",
"unavailable_TRADE": "The Blocktrades Bridge is down or not responding",
"unavailable_CITADEL": "The Citadel Bridge is down or not responding",
"unavailable_bridge": "The bridge service for this asset is currently down, please try again later",
"use_copy_button": "PLEASE USE COPY BUTTON TO MAKE COPY OF ADDRESS OR MEMO ON THIS PAGE",
"user_unavailable": "User informaction is current unavailable, please try again later",
Expand Down
7 changes: 7 additions & 0 deletions app/assets/locales/locale-es.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,13 @@
"calc": "Calculando",
"choose_deposit": "Seleccione la moneda que desea depositar",
"choose_withdraw": "Seleccione la moneda que desea retirar",
"citadel": {
"coming_soon": "Coming soon",
"min_amount": "Minimum amount: %(minAmount)s %(symbol)s",
"min_amount_error": "Please enter number >= minimum",
"support_block": "For support, please contact citadel.li at:",
"under_construction": "Under Construction"
},
"contact_TRADE": "Contacta Blocktrades",
"convert": "Conversión interna",
"convert_coin": "Convertir a %(coin)s (%(symbol)s)",
Expand Down
7 changes: 7 additions & 0 deletions app/assets/locales/locale-fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,13 @@
"calc": "Calculating",
"choose_deposit": "Please select the coin you would like to deposit",
"choose_withdraw": "Please select the coin you would like to withdraw",
"citadel": {
"coming_soon": "Coming soon",
"min_amount": "Minimum amount: %(minAmount)s %(symbol)s",
"min_amount_error": "Please enter number >= minimum",
"support_block": "For support, please contact citadel.li at:",
"under_construction": "Under Construction"
},
"contact_TRADE": "Contact Blocktrades",
"convert": "Internal conversion",
"convert_coin": "Convert to %(coin)s (%(symbol)s)",
Expand Down
9 changes: 8 additions & 1 deletion app/assets/locales/locale-it.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,8 +798,15 @@
"calc": "Calcolo in corso",
"choose_deposit": "Per favore seleziona la valuta che vuoi depositare",
"choose_withdraw": "Per favore seleziona la valuta che vuoi prelevare",
"citadel": {
"coming_soon": "Prossimamente",
"min_amount": "Minimum amount: %(minAmount)s %(symbol)s",
"min_amount_error": "Per favore inserisci un numero >= minimo",
"support_block": "Per supporto, contatta citadel.li a:",
"under_construction": "Under Construction"
},
"contact_TRADE": "Contact Blocktrades",
"convert": "Conversione interna",
"convert": "Quantità minima: %(minAmount)s %(symbol)s",
"convert_coin": "Converti in %(coin)s (%(symbol)s)",
"convert_now": "Converti adesso",
"copy_address": "Copy address",
Expand Down
7 changes: 7 additions & 0 deletions app/assets/locales/locale-ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,13 @@
"calc": "計算中",
"choose_deposit": "入金したいコインを選択してください",
"choose_withdraw": "出金したいコインを選択してください",
"citadel": {
"coming_soon": "近日公開",
"min_amount": "最低数量: %(minAmount)s %(symbol)s",
"min_amount_error": "数字を入力してください >= minimum",
"support_block": "サポートについては、citadel.li までご連絡ください。:",
"under_construction": "工事中"
},
"contact_TRADE": "Blocktradesに連絡する",
"convert": "内部変換",
"convert_coin": "%(coin)s (%(symbol)s) に変換",
Expand Down
7 changes: 7 additions & 0 deletions app/assets/locales/locale-ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,13 @@
"calc": "Calculating",
"choose_deposit": "Please select the coin you would like to deposit",
"choose_withdraw": "Please select the coin you would like to withdraw",
"citadel": {
"coming_soon": "Coming soon",
"min_amount": "Minimum amount: %(minAmount)s %(symbol)s",
"min_amount_error": "Please enter number >= minimum",
"support_block": "For support, please contact citadel.li at:",
"under_construction": "Under Construction"
},
"contact_TRADE": "Contact Blocktrades",
"convert": "Internal conversion",
"convert_coin": "Convert to %(coin)s (%(symbol)s)",
Expand Down
8 changes: 8 additions & 0 deletions app/assets/locales/locale-ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,13 @@
"calc": "Расчет",
"choose_deposit": "Пожалуйста, выберите валюту, в которой хотели бы разместить депозит",
"choose_withdraw": "Пожалуйста, выберите валюту, которую хотели бы вывести",
"citadel": {
"coming_soon": "Скоро",
"min_amount": "Минимальная сумма: %(minAmount)s %(symbol)s",
"min_amount_error": "Пожалуйста введите число >= минимума",
"support_block": "Для получения поддержки, пожалуйста, свяжитесь с Citadel по адресу:",
"under_construction": "Технические работы"
},
"contact_TRADE": "Связаться с Blocktrades",
"convert": "Конвертировать внутри системы",
"convert_coin": "Конвертировать в %(coin)s (%(symbol)s)",
Expand Down Expand Up @@ -882,6 +889,7 @@
"unavailable_OPEN": "Шлюз OpenLedger не работает или не отвечает",
"unavailable_RUDEX": "Шлюз RuDEX не работает или не отвечает",
"unavailable_TRADE": "Шлюз Blocktrades не работает или не отвечает",
"unavailable_CITADEL": "Шлюз Citadel не работает или не отвечает",
"unavailable_bridge": "Мост для данного актива в настоящее время не работает, пожалуйста, повторите попытку позже",
"use_copy_button": "ПОЖАЛУЙСТА ИСПОЛЬЗУЙТЕ КНОПКУ ДЛЯ КОПИРОВАНИЯ АДРЕСА ИЛИ МЕМО",
"user_unavailable": "В настоящий момент информация о пользователе недоступна, повторите попытку позже",
Expand Down
7 changes: 7 additions & 0 deletions app/assets/locales/locale-tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,13 @@
"calc": "Hesaplanıyor...",
"choose_deposit": "Lütfen yatırmak istediğiniz dijital varlığı seçin",
"choose_withdraw": "Lütfen çekmek istediğiniz dijital varlığı seçin",
"citadel": {
"coming_soon": "Coming soon",
"min_amount": "Minimum amount: %(minAmount)s %(symbol)s",
"min_amount_error": "Please enter number >= minimum",
"support_block": "For support, please contact citadel.li at:",
"under_construction": "Under Construction"
},
"contact_TRADE": "Contact Blocktrades",
"convert": "Internal conversion",
"convert_coin": "Convert to %(coin)s (%(symbol)s)",
Expand Down
7 changes: 7 additions & 0 deletions app/assets/locales/locale-zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,13 @@
"calc": "计算中",
"choose_deposit": "请选择充值的币种",
"choose_withdraw": "请选择提现的币种",
"citadel": {
"coming_soon": "即将上线",
"min_amount": "最小金额:%(minAmount)s %(symbol)s",
"min_amount_error": "请输入大于最小金额的数量",
"support_block": "请联系 citadel.li 获取客户支持:",
"under_construction": "Under Construction"
},
"contact_TRADE": "联系 Blocktrades",
"convert": "内部兑换",
"convert_coin": "兑换成 %(coin)s (%(symbol)s)",
Expand Down
72 changes: 69 additions & 3 deletions app/components/Account/AccountDepositWithdraw.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import utils from "common/utils";
import Translate from "react-translate-component";
import ChainTypes from "../Utility/ChainTypes";
import BindToChainState from "../Utility/BindToChainState";
import CitadelGateway from "../DepositWithdraw/citadel/CitadelGateway";
import OpenledgerGateway from "../DepositWithdraw/OpenledgerGateway";
import OpenLedgerFiatDepositWithdrawal from "../DepositWithdraw/openledger/OpenLedgerFiatDepositWithdrawal";
import OpenLedgerFiatTransactionHistory from "../DepositWithdraw/openledger/OpenLedgerFiatTransactionHistory";
import BlockTradesBridgeDepositRequest from "../DepositWithdraw/blocktrades/BlockTradesBridgeDepositRequest";
import CitadelBridgeDepositRequest from "../DepositWithdraw/citadel/CitadelBridgeDepositRequest";
import HelpContent from "../Utility/HelpContent";
import AccountStore from "stores/AccountStore";
import SettingsStore from "stores/SettingsStore";
Expand Down Expand Up @@ -41,6 +43,7 @@ class AccountDepositWithdraw extends React.Component {
rudexService: props.viewSettings.get("rudexService", "gateway"),
xbtsxService: props.viewSettings.get("xbtsxService", "gateway"),
btService: props.viewSettings.get("btService", "bridge"),
citadelService: props.viewSettings.get("citadelService", "bridge"),
metaService: props.viewSettings.get("metaService", "bridge"),
activeService: props.viewSettings.get("activeService", 0)
};
Expand All @@ -58,10 +61,15 @@ class AccountDepositWithdraw extends React.Component {
nextProps.openLedgerBackedCoins,
this.props.openLedgerBackedCoins
) ||
!utils.are_equal_shallow(
nextProps.citadelBackedCoins,
this.props.citadelBackedCoins
) ||
nextState.olService !== this.state.olService ||
nextState.rudexService !== this.state.rudexService ||
nextState.xbtsxService !== this.state.xbtsxService ||
nextState.btService !== this.state.btService ||
nextState.citadelService !== this.state.citadelService ||
nextState.metaService !== this.state.metaService ||
nextState.activeService !== this.state.activeService
);
Expand Down Expand Up @@ -111,6 +119,15 @@ class AccountDepositWithdraw extends React.Component {
});
}

toggleCitadelService(service) {
this.setState({
citadelService: service
});
SettingsActions.changeViewSetting({
citadelService: service
});
}

toggleMetaService(service) {
this.setState({
metaService: service
Expand Down Expand Up @@ -140,8 +157,7 @@ class AccountDepositWithdraw extends React.Component {
//let services = ["Openledger (OPEN.X)", "BlockTrades (TRADE.X)", "Transwiser", "BitKapital"];
let serList = [];
let {account} = this.props;
let {olService, btService, rudexService, xbtsxService} = this.state;

let {olService, btService, rudexService, xbtsxService, citadelService} = this.state;
serList.push({
name: "Openledger (OPEN.X)",
template: (
Expand Down Expand Up @@ -376,6 +392,51 @@ class AccountDepositWithdraw extends React.Component {
)
});

serList.push({
name: "Citadel",
template: (
<div>
<div className="content-block">
{/* <div className="float-right"><a href="https://blocktrades.us" target="__blank" rel="noopener noreferrer"><Translate content="gateway.website" /></a></div> */}
<div
className="service-selector"
style={{marginBottom: "2rem"}}
>
<ul className="button-group segmented no-margin">
<li
onClick={this.toggleCitadelService.bind(
this,
"bridge"
)}
className={
citadelService === "bridge"
? "is-active"
: ""
}
>
<a>
<Translate content="gateway.bridge" />
</a>
</li>
</ul>
</div>
<CitadelBridgeDepositRequest
gateway="citadel"
issuer_account="citadel-wallet"
account={account}
initial_deposit_input_coin_type="xmr"
initial_deposit_output_coin_type="citadel.monero"
initial_deposit_estimated_input_amount="1.0"
initial_withdraw_input_coin_type="citadel.monero"
initial_withdraw_output_coin_type="xmr"
initial_withdraw_estimated_input_amount="1.0"
/>
</div>
<div className="content-block" />
</div>
)
});

serList.push({
name: "BitKapital",
template: (
Expand Down Expand Up @@ -462,7 +523,8 @@ class AccountDepositWithdraw extends React.Component {
"RUDEX",
"TRADE",
"BITKAPITAL",
"XBTSX"
"XBTSX",
"CITADEL"
];
const currentServiceName = serviceNames[activeService];
const currentServiceDown = servicesDown.get(currentServiceName);
Expand Down Expand Up @@ -597,6 +659,10 @@ export default connect(
"TRADE",
[]
),
citadelBackedCoins: GatewayStore.getState().backedCoins.get(
"CITADEL",
[]
),
winexBackedCoins: GatewayStore.getState().backedCoins.get(
"WIN",
[]
Expand Down
28 changes: 16 additions & 12 deletions app/components/Account/AccountSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -375,8 +375,9 @@ class AccountSelector extends React.Component {
)}
>
<span style={{paddingRight: "1.5rem"}}>
{account && account.statusText}&nbsp;{!!displayText &&
displayText}
{account && account.statusText}
&nbsp;
{!!displayText && displayText}
</span>
{linked_status}
</label>
Expand Down Expand Up @@ -517,16 +518,19 @@ class AccountSelector extends React.Component {

AccountSelector = BindToChainState(AccountSelector);

AccountSelector = connect(AccountSelector, {
listenTo() {
return [AccountStore];
},
getProps() {
return {
myActiveAccounts: AccountStore.getState().myActiveAccounts,
contacts: AccountStore.getState().accountContacts
};
AccountSelector = connect(
AccountSelector,
{
listenTo() {
return [AccountStore];
},
getProps() {
return {
myActiveAccounts: AccountStore.getState().myActiveAccounts,
contacts: AccountStore.getState().accountContacts
};
}
}
});
);

export default AccountSelector;
4 changes: 2 additions & 2 deletions app/components/Account/RecentTransactions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,8 @@ class RecentTransactions extends React.Component {
</td>
<td className="column-hide-tiny" />
<td style={{textAlign: "center"}}>
&nbsp;{(this.props.showMore &&
historyCount > this.props.limit) ||
&nbsp;
{(this.props.showMore && historyCount > this.props.limit) ||
(20 && limit < historyCount) ? (
<a onClick={this._onIncreaseLimit.bind(this)}>
<Icon
Expand Down
7 changes: 6 additions & 1 deletion app/components/Blockchain/Transaction.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,12 @@ class Transaction extends React.Component {
);

memo = text ? (
<td className="memo">{text}</td>
<td
className="memo"
style={{wordBreak: "break-all"}}
>
{text}
</td>
) : !text && isMine ? (
<td>
<Translate content="transfer.memo_unlock" />
Expand Down
Loading