mirror of
https://github.com/RoboSats/robosats.git
synced 2025-09-13 00:56:22 +00:00
Improve frontend notifications. Add resolved messages. Add unlocked/settled bonds. Fix bug with statements submission.
This commit is contained in:
@ -343,13 +343,18 @@ class Logics:
|
|||||||
if not order.status == Order.Status.DIS:
|
if not order.status == Order.Status.DIS:
|
||||||
return False, {
|
return False, {
|
||||||
"bad_request":
|
"bad_request":
|
||||||
"Only orders in dispute accept a dispute statements"
|
"Only orders in dispute accept dispute statements"
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(statement) > 5000:
|
if len(statement) > 5000:
|
||||||
return False, {
|
return False, {
|
||||||
"bad_statement": "The statement is longer than 5000 characters"
|
"bad_statement": "The statement is longer than 5000 characters"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if len(statement) < 100:
|
||||||
|
return False, {
|
||||||
|
"bad_statement": "The statement is too short. Make sure to be thorough."
|
||||||
|
}
|
||||||
|
|
||||||
if order.maker == user:
|
if order.maker == user:
|
||||||
order.maker_statement = statement
|
order.maker_statement = statement
|
||||||
@ -357,7 +362,7 @@ class Logics:
|
|||||||
order.taker_statement = statement
|
order.taker_statement = statement
|
||||||
|
|
||||||
# If both statements are in, move status to wait for dispute resolution
|
# If both statements are in, move status to wait for dispute resolution
|
||||||
if order.maker_statement != None and order.taker_statement != None:
|
if order.maker_statement not in [None,""] or order.taker_statement not in [None,""]:
|
||||||
order.status = Order.Status.WFR
|
order.status = Order.Status.WFR
|
||||||
order.expires_at = timezone.now() + timedelta(
|
order.expires_at = timezone.now() + timedelta(
|
||||||
seconds=Order.t_to_expire[Order.Status.WFR])
|
seconds=Order.t_to_expire[Order.Status.WFR])
|
||||||
|
|||||||
@ -311,7 +311,7 @@ class OrderView(viewsets.ViewSet):
|
|||||||
and order.maker_statement != "")
|
and order.maker_statement != "")
|
||||||
elif data["is_taker"]:
|
elif data["is_taker"]:
|
||||||
data["statement_submitted"] = (order.taker_statement != None
|
data["statement_submitted"] = (order.taker_statement != None
|
||||||
and order.maker_statement != "")
|
and order.taker_statement != "")
|
||||||
|
|
||||||
# 9) If status is 'Failed routing', reply with retry amounts, time of next retry and ask for invoice at third.
|
# 9) If status is 'Failed routing', reply with retry amounts, time of next retry and ask for invoice at third.
|
||||||
elif (order.status == Order.Status.FAI
|
elif (order.status == Order.Status.FAI
|
||||||
|
|||||||
@ -63,8 +63,8 @@ export default class OrderPage extends Component {
|
|||||||
"3": 2000, //'Waiting for taker bond'
|
"3": 2000, //'Waiting for taker bond'
|
||||||
"4": 999999, //'Cancelled'
|
"4": 999999, //'Cancelled'
|
||||||
"5": 999999, //'Expired'
|
"5": 999999, //'Expired'
|
||||||
"6": 3000, //'Waiting for trade collateral and buyer invoice'
|
"6": 6000, //'Waiting for trade collateral and buyer invoice'
|
||||||
"7": 3000, //'Waiting only for seller trade collateral'
|
"7": 8000, //'Waiting only for seller trade collateral'
|
||||||
"8": 8000, //'Waiting only for buyer invoice'
|
"8": 8000, //'Waiting only for buyer invoice'
|
||||||
"9": 10000, //'Sending fiat - In chatroom'
|
"9": 10000, //'Sending fiat - In chatroom'
|
||||||
"10": 10000, //'Fiat sent - In chatroom'
|
"10": 10000, //'Fiat sent - In chatroom'
|
||||||
|
|||||||
@ -195,6 +195,26 @@ export default class TradeBox extends Component {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
showBondIsSettled=()=>{
|
||||||
|
return (
|
||||||
|
<Grid item xs={12} align="center">
|
||||||
|
<Typography color="error" component="subtitle1" variant="subtitle1" align="center">
|
||||||
|
⚖️ Your {this.props.data.is_maker ? 'maker' : 'taker'} bond was settled
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
showBondIsReturned=()=>{
|
||||||
|
return (
|
||||||
|
<Grid item xs={12} align="center">
|
||||||
|
<Typography color="green" component="subtitle1" variant="subtitle1" align="center">
|
||||||
|
🔓 Your {this.props.data.is_maker ? 'maker' : 'taker'} bond was unlocked
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
showEscrowQRInvoice=()=>{
|
showEscrowQRInvoice=()=>{
|
||||||
return (
|
return (
|
||||||
<Grid container spacing={1}>
|
<Grid container spacing={1}>
|
||||||
@ -476,10 +496,16 @@ export default class TradeBox extends Component {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} align="left">
|
<Grid item xs={12} align="left">
|
||||||
<Typography component="body2" variant="body2">
|
<Typography component="body2" variant="body2">
|
||||||
We are waiting for your trade counterparty statement.
|
<p>We are waiting for your trade counterparty statement. If you are hesitant about
|
||||||
|
the state of the dispute or want to add more information, contact robosats@protonmail.com.</p>
|
||||||
|
|
||||||
|
<p>Please, save the information needed to identificate 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).</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
{this.showBondIsLocked()}
|
{this.showBondIsSettled()}
|
||||||
</Grid>
|
</Grid>
|
||||||
)
|
)
|
||||||
}else{
|
}else{
|
||||||
@ -496,7 +522,7 @@ export default class TradeBox extends Component {
|
|||||||
<Grid item xs={12} align="left">
|
<Grid item xs={12} align="left">
|
||||||
<Typography component="body2" variant="body2">
|
<Typography component="body2" variant="body2">
|
||||||
Please, submit your statement. Be clear and specific about what happened and provide the necessary
|
Please, submit your statement. Be clear and specific about what happened and provide the necessary
|
||||||
evidence. It is best to provide a burner email, XMPP or telegram username to follow up with the staff.
|
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 <i>(aka humans)</i>, so be as helpful
|
Disputes are solved at the discretion of real robots <i>(aka humans)</i>, so be as helpful
|
||||||
as possible to ensure a fair outcome. Max 5000 chars.
|
as possible to ensure a fair outcome. Max 5000 chars.
|
||||||
</Typography>
|
</Typography>
|
||||||
@ -519,9 +545,8 @@ export default class TradeBox extends Component {
|
|||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<Button onClick={this.handleClickSubmitStatementButton} variant='contained' color='primary'>Submit</Button>
|
<Button onClick={this.handleClickSubmitStatementButton} variant='contained' color='primary'>Submit</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
{this.showBondIsSettled()}
|
||||||
{this.showBondIsLocked()}
|
</Grid>
|
||||||
</Grid>
|
|
||||||
)}
|
)}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -535,11 +560,60 @@ export default class TradeBox extends Component {
|
|||||||
</Grid>
|
</Grid>
|
||||||
<Grid item xs={12} align="left">
|
<Grid item xs={12} align="left">
|
||||||
<Typography component="body2" variant="body2">
|
<Typography component="body2" variant="body2">
|
||||||
Wait for the staff to resolve the dispute. The dispute winner
|
<p>Both statements have been received, wait for the staff to resolve the dispute.
|
||||||
will be asked to submit a LN invoice.
|
The dispute winner will be asked to submit a LN invoice via the contact methods provided.
|
||||||
|
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, write us inmediately. </p>
|
||||||
|
|
||||||
|
<p>Please, save the information needed to identificate 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).</p>
|
||||||
</Typography>
|
</Typography>
|
||||||
</Grid>
|
</Grid>
|
||||||
{this.showBondIsLocked()}
|
{this.showBondIsSettled()}
|
||||||
|
</Grid>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
showDisputeWinner=()=>{
|
||||||
|
return (
|
||||||
|
<Grid container spacing={1}>
|
||||||
|
<Grid item xs={12} align="center">
|
||||||
|
<Typography color="primary" component="subtitle1" variant="subtitle1">
|
||||||
|
<b> You have won the dispute </b>
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12} align="left">
|
||||||
|
<Typography component="body2" variant="body2">
|
||||||
|
You will be sent the satoshis of the escrow and your fidelity bond.
|
||||||
|
This is not an automatic process, instead it will be sent manually by the staff.
|
||||||
|
Please coordinate with the staff by writing to robosats@protonmail.com (or via your provided
|
||||||
|
burner contact method). You will be asked to submit a new invoice together with identificative
|
||||||
|
information about this order (bond payment hash, robot nicknames, exact amount in satoshis and order ID).
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
|
{this.showBondIsSettled()}
|
||||||
|
</Grid>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
showDisputeLoser=()=>{
|
||||||
|
return (
|
||||||
|
<Grid container spacing={1}>
|
||||||
|
<Grid item xs={12} align="center">
|
||||||
|
<Typography color="error" component="subtitle1" variant="subtitle1">
|
||||||
|
<b> You have lost the dispute </b>
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
|
<Grid item xs={12} align="left">
|
||||||
|
<Typography component="body2" variant="body2">
|
||||||
|
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.
|
||||||
|
</Typography>
|
||||||
|
</Grid>
|
||||||
|
{this.showBondIsSettled()}
|
||||||
</Grid>
|
</Grid>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@ -776,7 +850,8 @@ handleRatingRobosatsChange=(e)=>{
|
|||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<Button color='primary' onClick={() => {this.props.push('/')}}>Start Again</Button>
|
<Button color='primary' onClick={() => {this.props.push('/')}}>Start Again</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
{this.showBondIsReturned()}
|
||||||
|
</Grid>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -851,7 +926,8 @@ handleRatingRobosatsChange=(e)=>{
|
|||||||
<Grid item xs={12} align="center">
|
<Grid item xs={12} align="center">
|
||||||
<Button onClick={this.handleClickSubmitInvoiceButton} variant='contained' color='primary'>Submit</Button>
|
<Button onClick={this.handleClickSubmitInvoiceButton} variant='contained' color='primary'>Submit</Button>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
{this.showBondIsReturned()}
|
||||||
|
</Grid>
|
||||||
)
|
)
|
||||||
}else{
|
}else{
|
||||||
return(
|
return(
|
||||||
@ -874,7 +950,8 @@ handleRatingRobosatsChange=(e)=>{
|
|||||||
</ListItemText>
|
</ListItemText>
|
||||||
</List>
|
</List>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Grid>
|
{this.showBondIsReturned()}
|
||||||
|
</Grid>
|
||||||
)}
|
)}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -920,7 +997,9 @@ handleRatingRobosatsChange=(e)=>{
|
|||||||
{/* Trade Finished - TODO Needs more planning */}
|
{/* Trade Finished - TODO Needs more planning */}
|
||||||
{this.props.data.status == 11 ? this.showInDisputeStatement() : ""}
|
{this.props.data.status == 11 ? this.showInDisputeStatement() : ""}
|
||||||
{this.props.data.status == 16 ? this.showWaitForDisputeResolution() : ""}
|
{this.props.data.status == 16 ? this.showWaitForDisputeResolution() : ""}
|
||||||
|
{(this.props.data.status == 17 & this.props.data.is_taker) || (this.props.data.status == 18 & this.props.data.is_maker) ? this.showDisputeWinner() : ""}
|
||||||
|
{(this.props.data.status == 18 & this.props.data.is_taker) || (this.props.data.status == 17 & this.props.data.is_maker) ? this.showDisputeLoser() : ""}
|
||||||
|
|
||||||
{/* Order has expired */}
|
{/* Order has expired */}
|
||||||
{this.props.data.status == 5 ? this.showOrderExpired() : ""}
|
{this.props.data.status == 5 ? this.showOrderExpired() : ""}
|
||||||
{/* TODO */}
|
{/* TODO */}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user