Getting More Interesting: Orders with the Tools
In this tutorial lets deal with something a little more involved, creating and monitoring trades through two users with the Network Tools
Last updated
In this tutorial lets deal with something a little more involved, creating and monitoring trades through two users with the Network Tools
Last updated
Let’s try something a bit more fun. Now with users on our exchange, let's see how we can facilitate trades using the network tools.
Since this script will have a little more complexity to it, I am going to be splitting it into a few sections and files so we can see what is going on at each stage.
At the end, a complete script will be provided for enabling and monitoring trade between two users (you can skip to there if you don't want the guided tour).
For the sake of reference, these are the rough steps we will take in this tutorial.
The main commands we are using are also listed, alongside their step.
Interact with three accounts (Admin and two users)
Account A and B have been created with a similar script to the previous tutorial and given wallets we need for trades
Transfer from the Admin account XHT to user A, and USDT to user B
transerAsset
From account A create a sell order for 10 XHT and a buy order for Account B for 10 XHT
createOrder
Observe this order
getOrder
getOrders
See the values in our users' wallets now the trade has occurred
getUser
See our generated fees from the trade
getGeneratedFees
Settle these fees to the admin account
settleFees