Skip to content

Instantly share code, notes, and snippets.

@briandipalma
Last active August 12, 2019 11:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save briandipalma/d23c4b82f3f90807cf9ef88c7d53595d to your computer and use it in GitHub Desktop.
Save briandipalma/d23c4b82f3f90807cf9ef88c7d53595d to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const blockTradesMachine = Machine({
id: 'BlockTrades',
initial: 'Initial',
states: {
Initial: {
on: {
Submit: "Submitted"
}
},
Submitted: {
on: {
ClientClose: "ClientCloseSent",
SumbitAck: "Queued"
}
},
Queued: {
on: {
ClientClose: "ClientCloseSent",
Expire: "Expired",
PickUp: "PickedUp"
}
},
ClientCloseSent: {
on: {
ClientCloseAck: "ClientClosed"
}
},
PickedUp: {
on: {
Hold: "Queued",
PriceUpdate: "Executable",
ClientClose: "ClientCloseSent"
}
},
Executable: {
on: {
Withdraw: "PickedUp",
PriceUpdate: "Executable",
Expire: "Expired",
Execute: "ExecuteSent",
ClientClose: "ClientCloseSent"
}
},
ExecuteSent: {
on: {
PriceUpdate: "ExecuteSent",
ExecuteAck: "Executed",
Warning: "WarningSent"
}
},
WarningSent: {
on: {
RejectWarning: "Executable",
AcceptWarning: "AcceptWarningSent",
ClientClose: "ClientCloseSent"
}
},
AcceptWarningSent: {
on: {
AcceptWarningAck: "Executed"
}
},
Executed: {
on: {
Expire: "Expired",
TradeConfirmation: "TradeConfirmed"
}
},
ClientClosed: {type: "final"},
TradeConfirmed: {type: "final"},
Expired: {type: "final"}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment