+
+
+
+
+ {this.showBondIsLocked()}
+
+ );
+ }
+
+ // Asks the user for a dispute statement.
+ showInDisputeStatement = () => {
+ const { t } = this.props;
+ if (this.props.data.statement_submitted) {
+ return (
+
+
+
+ {t('We have received your statement')}
+
+
+
+
+
+
+
+ {t(
+ 'We are waiting for your trade counterpart statement. If you are hesitant about the state of the dispute or want to add more information, contact robosats@protonmail.com.',
+ )}
+
+
+
+
+ {t(
+ 'Please, save the information needed to identify your order and your payments: order ID; payment hashes of the bonds or escrow (check on your lightning wallet); exact amount of satoshis; and robot nickname. You will have to identify yourself as the user involved in this trade via email (or other contact methods).',
+ )}
+
+
+
+
+
+ {this.showBondIsSettled()}
+
+ );
+ } else {
+ return (
+ // TODO Option to upload files
+
+
+
+
+ {t('A dispute has been opened')}
+
+
+
+
+
+
+ {t(
+ 'Please, submit your statement. Be clear and specific about what happened and provide the necessary evidence. You MUST provide a contact method: burner email, XMPP or telegram username to follow up with the staff. Disputes are solved at the discretion of real robots (aka humans), so be as helpful as possible to ensure a fair outcome. Max 5000 chars.',
+ )}
+
+
+
+
+
+
+
+
+
+
+ {this.showBondIsSettled()}
+
+ );
+ }
+ };
+
+ showWaitForDisputeResolution = () => {
+ const { t } = this.props;
+ return (
+
+
+
+ {t('We have the statements')}
+
+
+
+
+
+
+
+ {t(
+ 'Both statements have been received, wait for the staff to resolve the dispute. If you are hesitant about the state of the dispute or want to add more information, contact robosats@protonmail.com. If you did not provide a contact method, or are unsure whether you wrote it right, write us immediately.',
+ )}
+
+
+
+
+ {t(
+ 'Please, save the information needed to identify your order and your payments: order ID; payment hashes of the bonds or escrow (check on your lightning wallet); exact amount of satoshis; and robot nickname. You will have to identify yourself as the user involved in this trade via email (or other contact methods).',
+ )}
+
+
+
+
+
+ {this.showBondIsSettled()}
+
+ );
+ };
+
+ showDisputeWinner = () => {
+ const { t } = this.props;
+ return (
+
+
+
+ {t('You have won the dispute')}
+
+
+
+
+ {t(
+ 'You can claim the dispute resolution amount (escrow and fidelity bond) from your profile rewards. If there is anything the staff can help with, do not hesitate to contact to robosats@protonmail.com (or via your provided burner contact method).',
+ )}
+
+
+ {this.showBondIsSettled()}
+
+ );
+ };
+
+ showDisputeLoser = () => {
+ const { t } = this.props;
+ return (
+
+
+
+ {t('You have lost the dispute')}
+
+
+
+
+ {t(
+ 'Unfortunately you have lost the dispute. If you think this is a mistake you can ask to re-open the case via email to robosats@protonmail.com. However, chances of it being investigated again are low.',
+ )}
+
+
+ {this.showBondIsSettled()}
+
+ );
+ };
+
+ showWaitingForEscrow() {
+ const { t } = this.props;
+ return (
+
+
+
+ {t('Your info looks good!')} {' ' + this.stepXofY()}
+
+
+
+
+
+
+
+ {t('We are waiting for the seller to lock the trade amount.')}
+
+
+
+
+ {t(
+ 'Just hang on for a moment. If the seller does not deposit, you will get your bond back automatically. In addition, you will receive a compensation (check the rewards in your profile).',
+ )}
+
+
+
+
+
+ {this.showBondIsLocked()}
+
+ );
+ }
+
+ showWaitingForBuyerInvoice() {
+ const { t } = this.props;
+ return (
+
+ {/* Make confirmation sound for HTLC received. */}
+ {this.Sound('locked-invoice')}
+
+
+ {t('The trade collateral is locked!')} {' ' + this.stepXofY()}
+
+
+
+
+
+
+
+ {t(
+ 'We are waiting for the buyer to post a lightning invoice. Once he does, you will be able to directly communicate the fiat payment details.',
+ )}
+
+
+
+
+
+ {t(
+ 'Just hang on for a moment. If the buyer does not cooperate, you will get back the trade collateral and your bond automatically. In addition, you will receive a compensation (check the rewards in your profile).',
+ )}
+
+
+
+
+
+ {this.showBondIsLocked()}
+
+ );
+ }
+
+ handleClickConfirmButton = () => {
+ apiClient
+ .post('/api/order/?order_id=' + this.props.data.id, {
+ action: 'confirm',
+ })
+ .then((data) => {
+ this.props.completeSetState(data),
+ this.setState({ loadingButtonFiatSent: false, loadingButtonFiatReceived: false });
+ });
+ };
+
+ handleRatingUserChange = (e) => {
+ apiClient
+ .post('/api/order/?order_id=' + this.props.data.id, {
+ action: 'rate_user',
+ rating: e.target.value,
+ })
+ .then((data) => this.props.completeSetState(data));
+ };
+
+ handleRatingRobosatsChange = (e) => {
+ if (this.state.rating_platform != null) {
+ return null;
+ }
+ this.setState({ rating_platform: e.target.value });
+
+ apiClient
+ .post('/api/order/?order_id=' + this.props.data.id, {
+ action: 'rate_platform',
+ rating: e.target.value,
+ })
+ .then((data) => this.props.completeSetState(data));
+ };
+
+ showFiatSentButton() {
+ const { t } = this.props;
+ return (
+
+
+
+
+
+ );
+ }
+
+ showFiatReceivedButton() {
+ const { t } = this.props;
+ return (
+
+
+ {t('Confirm {{amount}} {{currencyCode}} received', {
+ currencyCode: this.props.data.currencyCode,
+ amount: pn(
+ parseFloat(
+ parseFloat(this.props.data.amount).toFixed(
+ this.props.data.currency == 1000 ? 8 : 4,
+ ),
+ ),
+ ),
+ })}
+
+
+ );
+ }
+
+ disputeCountdownRenderer = ({ hours, minutes }) => {
+ return (
+
+ {hours}h {zeroPad(minutes)}m{' '}
+
+ );
+ };
+
+ showOpenDisputeButton() {
+ const { t } = this.props;
+ const now = Date.now();
+ const expires_at = new Date(this.props.data.expires_at);
+ // open dispute button enables 12h before expiry
+ expires_at.setHours(expires_at.getHours() - 12);
+ return (
+ expires_at}
+ disableTouchListener={now > expires_at}
+ enterTouchDelay={0}
+ title={
+
+ To open a dispute you need to wait
+
+
+ }
+ >
+
+
+
+
+ );
+ }
+
+ handleRenewOrderButtonPressed = () => {
+ this.setState({ renewLoading: true });
+ const body = {
+ type: this.props.data.type,
+ currency: this.props.data.currency,
+ amount: this.props.data.has_range ? null : this.props.data.amount,
+ has_range: this.props.data.has_range,
+ min_amount: this.props.data.min_amount,
+ max_amount: this.props.data.max_amount,
+ payment_method: this.props.data.payment_method,
+ is_explicit: this.props.data.is_explicit,
+ premium: this.props.data.is_explicit ? null : this.props.data.premium,
+ satoshis: this.props.data.is_explicit ? this.props.data.satoshis : null,
+ public_duration: this.props.data.public_duration,
+ escrow_duration: this.props.data.escrow_duration,
+ bond_size: this.props.data.bond_size,
+ bondless_taker: this.props.data.bondless_taker,
+ };
+ apiClient
+ .post('/api/make/', body)
+ .then(
+ (data) =>
+ this.setState({ badRequest: data.bad_request }) &
+ (data.id
+ ? this.props.push('/order/' + data.id) & this.props.getOrderDetails(data.id)
+ : ''),
+ );
+ };
+
+ showOrderExpired = () => {
+ const { t } = this.props;
+ const show_renew = this.props.data.is_maker;
+
+ return (
+
+
+
+ {t('The order has expired')}
+
+
+
+
+ {t(this.props.data.expiry_message)}
+
+ {show_renew ? (
+
+ {this.state.renewLoading ? (
+
+ ) : (
+
+ )}
+
+ ) : null}
+
+ );
+ };
+
+ showChat = () => {
+ const { t } = this.props;
+ // In Chatroom - No fiat sent - showChat(showSendButton, showReveiceButton, showDisputeButton)
+ if (this.props.data.is_buyer & (this.props.data.status == 9)) {
+ var showSendButton = true;
+ var showReveiceButton = false;
+ var showDisputeButton = true;
+ }
+ if (this.props.data.is_seller & (this.props.data.status == 9)) {
+ var showSendButton = false;
+ var showReveiceButton = false;
+ var showDisputeButton = true;
+ }
+
+ // In Chatroom - Fiat sent - showChat(showSendButton, showReveiceButton, showDisputeButton)
+ if (this.props.data.is_buyer & (this.props.data.status == 10)) {
+ var showSendButton = false;
+ var showReveiceButton = false;
+ var showDisputeButton = true;
+ }
+ if (this.props.data.is_seller & (this.props.data.status == 10)) {
+ var showSendButton = false;
+ var showReveiceButton = true;
+ var showDisputeButton = true;
+ }
+
+ return (
+
+ {/* Make confirmation sound for Chat Open. */}
+ {this.Sound('locked-invoice')}
+
+
+
+ {' '}
+ {this.props.data.is_seller ? t('Chat with the buyer') : t('Chat with the seller')}
+ {' '}
+ {' ' + this.stepXofY()}
+
+
+
+ {this.props.data.is_seller ? (
+
+ {this.props.data.status == 9
+ ? t(
+ 'Say hi! Be helpful and concise. Let them know how to send you {{amount}} {{currencyCode}}.',
+ {
+ currencyCode: this.props.data.currencyCode,
+ amount: pn(
+ parseFloat(
+ parseFloat(this.props.data.amount).toFixed(
+ this.props.data.currency == 1000 ? 8 : 4,
+ ),
+ ),
+ ),
+ },
+ )
+ : t("The buyer has sent the fiat. Click 'Confirm Received' once you receive it.")}
+
+ ) : (
+
+ {this.props.data.status == 9
+ ? t(
+ "Say hi! Ask for payment details and click 'Confirm Sent' as soon as the payment is sent.",
+ )
+ : t('Wait for the seller to confirm he has received the payment.')}
+
+ )}
+
+
+
+
+ {showDisputeButton ? this.showOpenDisputeButton() : ''}
+ {showSendButton ? this.showFiatSentButton() : ''}
+ {showReveiceButton ? this.showFiatReceivedButton() : ''}
+
+ {this.showBondIsLocked()}
+
+ );
+ };
+
+ showRateSelect() {
+ const { t } = this.props;
+ const show_renew = this.props.data.is_maker;
+
+ return (
+
+ {/* Make confirmation sound for Chat Open. */}
+ {this.Sound('successful')}
+
+
+
+
+ {t('Trade finished!')}
+
+
+
+
+
+
+
+ What do you think of RoboSats?
+
+
+
+
+
+
+ {this.state.rating_platform == 5 ? (
+
+