Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
test
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
谢昇
test
Commits
6488e152
Commit
6488e152
authored
Aug 06, 2019
by
谢昇
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update cli独立模块命令-2(token).md
parent
a5658b4b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
192 deletions
+1
-192
cli独立模块命令-2(token).md
cli独立模块命令-2(token).md
+1
-192
No files found.
cli独立模块命令-2(token).md
View file @
6488e152
**版本:
V6.2.0**
**版本:
V6.2.0**
...
...
@@ -620,197 +620,6 @@ cli send unfreeze terminate --id mavl-unfreeze-f9cf7a1f2482ad1137bdc5af49bd1c2b
## trade trade合约
```
Available Commands:
buy Create a buying token transaction
buy_order Show one's buying orders
revoke Create a revoke token transaction
sell Create a selling token transaction
sell_order Show one's token selling orders
status_buy_order Show one's buying orders of tokens
status_order Show one's orders with status
status_sell_order Show selling orders of the status
status_token_buy_order Show token buying orders of a status
status_token_sell_order Show token selling orders of a status
```
要执行在trade中的交易,首先需要由token合约向trade合约转币:
获取trade合约地址:
cli exec addr -e trade
```
1BXvgjmBw1aBgmGn1hjfGyRkmN3krWpFP4
```
向合约地址转币:
cli send token transfer -t 1BXvgjmBw1aBgmGn1hjfGyRkmN3krWpFP4 -a 数量 -k 签名地址 -s MOU
查询trade合约指定token余额
cli token token_balance -a 地址 -s MOU -e trade
```
[
{
"Token": "MOU",
"balance": "100.0000",
"frozen": "0.0000",
"addr": "165HDiXVdTaP1XgM54QbFJaciwAqDSBuip"
}
]
```
### sell 挂卖
cli send trade sell -f 手续费 -m 最小手数 -p 价格 -s MOU -t 最大数量 -k "152xusBV1onddSYcyTmGcGr1Yva7GAc37w"
默认每手为0.01个token
### sell_order 根据地址查询挂卖单
cli trade sell_order -s 152xusBV1onddSYcyTmGcGr1Yva7GAc37w -t MOU
```
{
"sellOrders": [
{
"tokenSymbol": "MOU",
"owner": "152xusBV1onddSYcyTmGcGr1Yva7GAc37w",
"amountPerBoardlot": "0.0100",
"minBoardlot": 1,
"pricePerBoardlot": "1.0000",
"totalBoardlot": 2000,
"tradedBoardlot": 0,
"buyID": "",
"status": 1,
"sellID": "mavl-trade-sell-64cb10c29bedbd5ad1b3e9317999c637aac695cfbcab64ff292922ef9e5881ab",
"txHash": "0x64cb10c29bedbd5ad1b3e9317999c637aac695cfbcab64ff292922ef9e5881ab",
"height": 895679,
"key": "mavl-trade-sell-64cb10c29bedbd5ad1b3e9317999c637aac695cfbcab64ff292922ef9e5881ab",
"blockTime": 1536740067,
"isSellOrder": true
}
]
}
```
默认为0.01个每手,共20个token,故为2000手
购买trade中的挂卖时,需要先向trade合约转入bty
cli send bty transfer -t 1BXvgjmBw1aBgmGn1hjfGyRkmN3krWpFP4 -a 数量 -k 签名地址
```
返回交易哈希
```
### buy 购买token
cli send trade buy -c 购买手数 -s sellID -k 签名地址
购买后查询卖单
```
{
"sellOrders": [
{
"tokenSymbol": "MOU",
"owner": "152xusBV1onddSYcyTmGcGr1Yva7GAc37w",
"amountPerBoardlot": "0.0100",
"minBoardlot": 1,
"pricePerBoardlot": "1.0000",
"totalBoardlot": 2000,
"tradedBoardlot": 10,
"buyID": "",
"status": 1,
"sellID": "mavl-trade-sell-64cb10c29bedbd5ad1b3e9317999c637aac695cfbcab64ff292922ef9e5881ab",
"txHash": "0x64cb10c29bedbd5ad1b3e9317999c637aac695cfbcab64ff292922ef9e5881ab",
"height": 895679,
"key": "mavl-trade-sell-64cb10c29bedbd5ad1b3e9317999c637aac695cfbcab64ff292922ef9e5881ab",
"blockTime": 1536740067,
"isSellOrder": true
}
]
}
```
### buy_order 查询买单
cli trade buy_order -b "165HDiXVdTaP1XgM54QbFJaciwAqDSBuip" -t MOU
```
{
"buyOrders": [
{
"tokenSymbol": "MOU",
"owner": "165HDiXVdTaP1XgM54QbFJaciwAqDSBuip",
"amountPerBoardlot": "0.0100",
"minBoardlot": 1,
"pricePerBoardlot": "1.0000",
"totalBoardlot": 10,
"tradedBoardlot": 10,
"buyID": "",
"status": 6,
"sellID": "mavl-trade-sell-64cb10c29bedbd5ad1b3e9317999c637aac695cfbcab64ff292922ef9e5881ab",
"txHash": "0xd8e5f2dd4c5159f1e100b3f7f6d3de89c09f664bc8e00326d8eb66b6dc7bd67f",
"height": 895679,
"key": "0xd8e5f2dd4c5159f1e100b3f7f6d3de89c09f664bc8e00326d8eb66b6dc7bd67f",
"blockTime": 1536741001,
"isSellOrder": false
}
]
}
```
### status_buy_order 查询指定地址的指定状态的买单
cli trade status_buy_order -b 查询地址 -s 买单状态
```
{
"buyOrders": [
{
"tokenSymbol": "MOU",
"owner": "165HDiXVdTaP1XgM54QbFJaciwAqDSBuip",
"amountPerBoardlot": "0.0100",
"minBoardlot": 1,
"pricePerBoardlot": "1.0000",
"totalBoardlot": 10,
"tradedBoardlot": 10,
"buyID": "",
"status": 6,
"sellID": "mavl-trade-sell-64cb10c29bedbd5ad1b3e9317999c637aac695cfbcab64ff292922ef9e5881ab",
"txHash": "0xd8e5f2dd4c5159f1e100b3f7f6d3de89c09f664bc8e00326d8eb66b6dc7bd67f",
"height": 895679,
"key": "0xd8e5f2dd4c5159f1e100b3f7f6d3de89c09f664bc8e00326d8eb66b6dc7bd67f",
"blockTime": 1536741001,
"isSellOrder": false
}
]
}
```
※ -s支持onbuy, boughtout or buyrevoked
### status_order 查询指定地址的指定状态的所有买卖单,可指定配置查询
cli trade status_order -a "152xusBV1onddSYcyTmGcGr1Yva7GAc37w" -s 1
```
{
"orders": [
{
"tokenSymbol": "MOU",
"owner": "152xusBV1onddSYcyTmGcGr1Yva7GAc37w",
"amountPerBoardlot": "0.0100",
"minBoardlot": 1,
"pricePerBoardlot": "1.0000",
"totalBoardlot": 2000,
"tradedBoardlot": 10,
"buyID": "",
"status": 1,
"sellID": "mavl-trade-sell-64cb10c29bedbd5ad1b3e9317999c637aac695cfbcab64ff292922ef9e5881ab",
"txHash": "0x64cb10c29bedbd5ad1b3e9317999c637aac695cfbcab64ff292922ef9e5881ab",
"height": 895679,
"key": "mavl-trade-sell-64cb10c29bedbd5ad1b3e9317999c637aac695cfbcab64ff292922ef9e5881ab",
"blockTime": 1536740067,
"isSellOrder": true
}
]
}
```
※ -s后1: on, 2: done, 3: revoke
※ -c可选择输入,为显示的买卖单上限,默认为10;-d可选择输入,显示查询的方向,默认为1,即正向,0代表反向。
### revoke 撤销挂单
cli send trade revoke -s "mavl-trade-sell-64cb10c29bedbd5ad1b3e9317999c637aac695cfbcab64ff292922ef9e5881ab" -k "152xusBV1onddSYcyTmGcGr1Yva7GAc37w"
## privacy 隐私交易合约
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment