diff --git a/packages/serializer/src/operations.js b/packages/serializer/src/operations.js index 2386da2..7c5236a 100644 --- a/packages/serializer/src/operations.js +++ b/packages/serializer/src/operations.js @@ -531,6 +531,25 @@ export const credit_deal_expired_operation_fee_parameters = new Serializer( {} ); +export const liquidity_pool_update_operation_fee_parameters = new Serializer( + "liquidity_pool_update_operation_fee_parameters", + { + fee: uint64, + } +); + +export const credit_deal_update_operation_fee_parameters = new Serializer( + "credit_deal_update_operation_fee_parameters", + { + fee: uint64, + } +); + +export const limit_order_update_operation_fee_parameters = new Serializer( + "limit_order_update_operation_fee_parameters", + { fee: uint64 } +); + var fee_parameters = static_variant([ transfer_operation_fee_parameters, limit_order_create_operation_fee_parameters, @@ -607,6 +626,9 @@ var fee_parameters = static_variant([ credit_offer_accept_operation_fee_parameters, credit_deal_repay_operation_fee_parameters, credit_deal_expired_operation_fee_parameters, + liquidity_pool_update_operation_fee_parameters, + credit_deal_update_operation_fee_parameters, + limit_order_update_operation_fee_parameters, ]); export const fee_schedule = new Serializer("fee_schedule", { @@ -676,6 +698,20 @@ export const transfer = new Serializer("transfer", { extensions: set(future_extensions), }); +export const create_take_profit_order_action = new Serializer( + "create_take_profit_order_action", + { + fee_asset_id: protocol_id_type("asset"), + spread_percent: uint16, + size_percent: uint16, + expiration_seconds: uint32, + repeat: bool, + extensions: set(future_extensions), + } +); + +var limit_order_auto_action = static_variant([create_take_profit_order_action]); + export const limit_order_create = new Serializer("limit_order_create", { fee: asset, seller: protocol_id_type("account"), @@ -683,7 +719,12 @@ export const limit_order_create = new Serializer("limit_order_create", { min_to_receive: asset, expiration: time_point_sec, fill_or_kill: bool, - extensions: set(future_extensions), + extensions: extension([ + { + name: "on_fill", + type: array(limit_order_auto_action), + }, + ]), }); export const limit_order_cancel = new Serializer("limit_order_cancel", { @@ -1401,8 +1442,8 @@ export const restriction = new Serializer("restriction", { set(protocol_id_type("vesting_balance")), set(protocol_id_type("worker")), set(protocol_id_type("balance")), - // array(restriction), - // array(array(restriction)), + array(restriction), + array(array(restriction)), // fixme: pair> ]), extensions: set(future_extensions), @@ -1626,6 +1667,37 @@ export const credit_deal_expired = new Serializer("credit_deal_expired", { fee_rate: uint32, }); +// Op 75: liquidity_pool_update_operation +export const liquidity_pool_update = new Serializer("liquidity_pool_update", { + fee: asset, + account: protocol_id_type("account"), + pool: protocol_id_type("liquidity_pool"), + taker_fee_percent: optional(uint16), + withdrawal_fee_percent: optional(uint16), + extensions: set(future_extensions), +}); + +// Op 76: credit_deal_update_operation +export const credit_deal_update = new Serializer("credit_deal_update", { + fee: asset, + account: protocol_id_type("account"), + deal_id: protocol_id_type("credit_deal"), + auto_repay: uint8, + extensions: set(future_extensions), +}); + +// Op 77: limit_order_update_operation +export const limit_order_update = new Serializer("limit_order_update", { + fee: asset, + seller: protocol_id_type("account"), + order: protocol_id_type("limit_order"), + new_price: optional(price), + delta_amount_to_sell: optional(asset), + new_expiration: optional(time_point_sec), + on_fill: optional(array(limit_order_auto_action)), + extensions: set(future_extensions), +}); + operation.st_operations = [ transfer, limit_order_create, @@ -1702,6 +1774,9 @@ operation.st_operations = [ credit_offer_accept, credit_deal_repay, credit_deal_expired, + liquidity_pool_update, + credit_deal_update, + limit_order_update, ]; export const transaction = new Serializer("transaction", {