Philipp Hoenisch
3 years ago
No known key found for this signature in database
GPG Key ID: E5F8E74C672BC666
3 changed files with
14 additions and
1 deletions
-
daemon/src/to_sse_event.rs
-
frontend/src/components/Types.tsx
-
frontend/src/components/cfdtables/CfdTable.tsx
|
|
@ -300,13 +300,16 @@ fn available_actions(state: CfdState, role: Role) -> Vec<CfdAction> { |
|
|
|
(CfdState::IncomingSettlementProposal { .. }, Role::Maker) => { |
|
|
|
vec![CfdAction::AcceptSettlement, CfdAction::RejectSettlement] |
|
|
|
} |
|
|
|
(CfdState::IncomingRollOverProposal { .. }, Role::Maker) => { |
|
|
|
vec![CfdAction::AcceptRollOver, CfdAction::RejectRollOver] |
|
|
|
} |
|
|
|
// If there is an outgoing settlement proposal already, user can't
|
|
|
|
// initiate new one
|
|
|
|
(CfdState::OutgoingSettlementProposal { .. }, Role::Maker) => { |
|
|
|
vec![CfdAction::Commit] |
|
|
|
} |
|
|
|
(CfdState::Open { .. }, Role::Taker) => { |
|
|
|
vec![CfdAction::Commit, CfdAction::Settle] |
|
|
|
vec![CfdAction::RollOver, CfdAction::Commit, CfdAction::Settle] |
|
|
|
} |
|
|
|
(CfdState::Open { .. }, Role::Maker) => vec![CfdAction::Commit], |
|
|
|
_ => vec![], |
|
|
|
|
|
@ -169,6 +169,7 @@ export enum Action { |
|
|
|
REJECT_ORDER = "rejectOrder", |
|
|
|
COMMIT = "commit", |
|
|
|
SETTLE = "settle", |
|
|
|
ROLL_OVER = "rollOver", |
|
|
|
ACCEPT_SETTLEMENT = "acceptSettlement", |
|
|
|
REJECT_SETTLEMENT = "rejectSettlement", |
|
|
|
ACCEPT_ROLL_OVER = "acceptRollOver", |
|
|
|
|
|
@ -4,6 +4,7 @@ import { |
|
|
|
ChevronRightIcon, |
|
|
|
ChevronUpIcon, |
|
|
|
CloseIcon, |
|
|
|
RepeatIcon, |
|
|
|
TriangleDownIcon, |
|
|
|
TriangleUpIcon, |
|
|
|
WarningIcon, |
|
|
@ -199,6 +200,12 @@ function iconForAction(action: Action): any { |
|
|
|
return <CheckIcon />; |
|
|
|
case Action.REJECT_SETTLEMENT: |
|
|
|
return <CloseIcon />; |
|
|
|
case Action.ROLL_OVER: |
|
|
|
return <RepeatIcon />; |
|
|
|
case Action.ACCEPT_ROLL_OVER: |
|
|
|
return <CheckIcon />; |
|
|
|
case Action.REJECT_ROLL_OVER: |
|
|
|
return <CloseIcon />; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -212,6 +219,8 @@ function colorSchemaForAction(action: Action): string { |
|
|
|
return "red"; |
|
|
|
case Action.SETTLE: |
|
|
|
return "green"; |
|
|
|
case Action.ROLL_OVER: |
|
|
|
return "green"; |
|
|
|
case Action.ACCEPT_SETTLEMENT: |
|
|
|
return "green"; |
|
|
|
case Action.REJECT_SETTLEMENT: |
|
|
|