diff --git a/daemon/src/to_sse_event.rs b/daemon/src/to_sse_event.rs index 621f66f..b4e6fd4 100644 --- a/daemon/src/to_sse_event.rs +++ b/daemon/src/to_sse_event.rs @@ -300,13 +300,16 @@ fn available_actions(state: CfdState, role: Role) -> Vec { (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![], diff --git a/frontend/src/components/Types.tsx b/frontend/src/components/Types.tsx index acc3462..1782a08 100644 --- a/frontend/src/components/Types.tsx +++ b/frontend/src/components/Types.tsx @@ -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", diff --git a/frontend/src/components/cfdtables/CfdTable.tsx b/frontend/src/components/cfdtables/CfdTable.tsx index 57818a1..60308c9 100644 --- a/frontend/src/components/cfdtables/CfdTable.tsx +++ b/frontend/src/components/cfdtables/CfdTable.tsx @@ -4,6 +4,7 @@ import { ChevronRightIcon, ChevronUpIcon, CloseIcon, + RepeatIcon, TriangleDownIcon, TriangleUpIcon, WarningIcon, @@ -199,6 +200,12 @@ function iconForAction(action: Action): any { return ; case Action.REJECT_SETTLEMENT: return ; + case Action.ROLL_OVER: + return ; + case Action.ACCEPT_ROLL_OVER: + return ; + case Action.REJECT_ROLL_OVER: + return ; } } @@ -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: