Add order management commands to wallet CLI; add commands/methods for obtaining existing orders to wallet CLI and RPC #2000
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
order-create,order-fill,order-freezeandorder-conclude, similar to the previously existing RPC methods (also, the RPC methods themselves were renamed -create_orderis noworder_createetc)order_list_own(RPC) andorder-list-own(CLI);order_list_all_active(RPC) andorder-list-all-active(CLI).Some minor changes:
account-balancenow also prints token tickers.String's that represent addresses toRpcAddress<TheCorrespondingId>. This only affects how those parameters are shown in the RPC docs (was: "string", now: "bech32 string").HasValueHintforDestination, so that it returns "hexified destination" instead of "bech32 string" (because it's how it's actually serialized).impl<T> HasValueHint for Id<T>, because most ids (pools/delegations/tokens/orders) are serialized as "hexified" (e.g. "HexifiedTokenId{0xcf...e0}")and only the rest (block and tx ids) are actually serializes as pure hex. Now each
IdimplementsHasValueHintindividually.I added
basic_serialization_testtocommon/src/lib.rs, which checks how various ids andDestination/VRFPublicKeyare serialized and how their rpc value hints look like.chainstate_pool_decommission_destinationto actually returnRpcAddress<Destination>.common/src/chain/currency.rs), let me know if you agree.(The TODO has nothing to do with the Currency type, I just didn't know where to put it).
conclude_and_recreate_in_same_tx_with_same_balancesandconclude_and_recreate_in_same_tx_with_different_balances(unrelated to this task, I just thought it was an interesting scenario to check)
P.S. the CLI commands for order listing just spit all the data out into the console; later we can add pagination, if needed.
Example of the
order-list-own's output:(orders are sorted by creation date, unconfirmed ones come at the end)
And this is what
order-list-all-activecurrently shows on testnet:Here orders are sorted first by give currency, then by ask currency, then by give/ask ratio.
order-list-all-activealso allows to filter the orders by a certain ask currency or give currency or both.E.g.
order-list-all-active --give-currency tmltk1aa3vvztufv5m054klp960p6f6pf59ugxp394x7n42v0clgwhrw3q3mpcq3will show: