@@ -355,6 +355,24 @@ pub enum AccountCommand {
355355 ChangeTokenMetadataUri ( TokenId , parity_scale_codec:: alloc:: vec:: Vec < u8 > ) ,
356356}
357357
358+ #[ derive( Encode , EnumDiscriminants ) ]
359+ #[ strum_discriminants( name( OrderCommandTag ) , derive( EnumIter , FromPrimitive ) ) ]
360+ pub enum OrderAccountCommand {
361+ // Satisfy an order completely or partially.
362+ // Second parameter is an amount provided to fill an order which corresponds to order's ask currency.
363+ #[ codec( index = 0 ) ]
364+ FillOrder ( OrderId , Amount , Destination ) ,
365+ // Freeze an order which effectively forbids any fill operations.
366+ // Frozen order can only be concluded.
367+ // Only the address specified as `conclude_key` can authorize this command.
368+ #[ codec( index = 1 ) ]
369+ FreezeOrder ( OrderId ) ,
370+ // Close an order and withdraw all remaining funds from both give and ask balances.
371+ // Only the address specified as `conclude_key` can authorize this command.
372+ #[ codec( index = 2 ) ]
373+ ConcludeOrder ( OrderId ) ,
374+ }
375+
358376#[ derive( Encode ) ]
359377pub enum TxInput {
360378 #[ codec( index = 0 ) ]
@@ -363,6 +381,8 @@ pub enum TxInput {
363381 Account ( AccountOutPoint ) ,
364382 #[ codec( index = 2 ) ]
365383 AccountCommand ( #[ codec( compact) ] u64 , AccountCommand ) ,
384+ #[ codec( index = 3 ) ]
385+ OrderAccountCommand ( OrderAccountCommand ) ,
366386}
367387
368388#[ cfg( test) ]
0 commit comments