-
Notifications
You must be signed in to change notification settings - Fork 13
BaerChain cancelPendingOrder transaction
woodbaer edited this page Aug 23, 2019
·
4 revisions
- Request Json file (transfer1_data.json)
{
"from":"e523e7c59a0725afd08bc9751c89eed6f8e16dec",
"to":"0x00000000000000000000000000000000766f7465",
"value":"0x0",
"data":[
{
"type":2,
"m_from":"e523e7c59a0725afd08bc9751c89eed6f8e16dec",
"m_to":"042610e447c94ff0824b7aa89fab123930edc805",
"m_transcation_type":1,
"m_transcation_numbers":"0x5f5e100"
}
],
"chainId":"0x1",
"nonce":"0x0",
"gas":"0x13880",
"gasPrice":"0x5"
}
2. Transfer method 2 Return directory
- Request Json file(transfer2_data.json)
{
"from":"e523e7c59a0725afd08bc9751c89eed6f8e16dec",
"to":"042610e447c94ff0824b7aa89fab123930edc805",
"value":"0x5f5e100",
"data":[],
"chainId":"0x1",
"nonce":"0x1",
"gas":"0x13880",
"gasPrice":"0x5"
}
Transfer method 3 Return directory
- Request Json file (transfer3_data.json)
- Batch transfer, this time contains two transfer data, no more than 50 transfer data in "data"
{
"from":"e523e7c59a0725afd08bc9751c89eed6f8e16dec",
"to":"0x00000000000000000000000000000000766f7465",
"value":"0x0",
"data":[
{
"type":2,
"m_from":"cccc7a30bf688c060524dfd759fe2627ed3387bc",
"m_to":"042610e447c94ff0824b7aa89fab123930edc805",
"m_transcation_type":1,
"m_transcation_numbers":"0x5f5e100"
},
{
"type":2,
"m_from":"cccc7a30bf688c060524dfd759fe2627ed3387bc",
"m_to":"eee227766ba28fa6abc9ec8fea0c56188bbd54c5",
"m_transcation_type":1,
"m_transcation_numbers":"0x5f5e100"
}
],
"chainId":"0x1",
"nonce":"0x2",
"gas":"0x138080",
"gasPrice":"0x5"
}
Note : > When to fills in other addresses and data is not empty, the default to is the contract address to be invoked.
and it is generally forbidden to transfer from value (value if it has value) to to value.
> If value has a numerical value, "data" also has data in it. Transfer is based on the data contained in "data".
- Parameters description Return directory
from : Type is string, brcTransaction transaction initiation address
to : Type is string, fixed address, cannot be changed
value : Type is string, hexadecimal, when transfer 1 and 3 is "0x0", when transfer mode 2 is the number of BRC
data : Transfer transaction data, array structure, if transfer is 2, then pass empty
> type : Type is int, transaction identification number, fixed to 2, representing brcTransaction transfer transaction
> m_from : Type is string, the address at which the transfer is initiated is the same as that of the initiator of the transaction
> m_to : Type is tring, the address where the transfer is accepted
> m_transcation_type : Type is int, fixed to 1
> m_transcation_numbers : Type is string, hexadecimal, number of transfers, default to hexadecimal
chainId : Type is string, hexadecimal, chain ID, must be the same as "chainid" of chain genesis
nonce : Type is string, hexadecimal, nonce value, after each execution +1
gas : Type is string, hexadecimal, gas integer provided for transaction execution
gasPrice : Type is string, hexadecimal, gas integer provided for each gas payment
- Note : For the transfer operation, the accuracy is 8 bits. that is, if one BRC is needed, it will be 100000000 and 16-digit: 0x5f5e100. that is, the value of m_transaction_numbers needs to be filled in: 0x5f5e100
4. Transfer process Return directory
- 4.1 Pre-transfer query
curl -d '{"jsonrpc":"2.0","id":9,"method":"brc_getBalance","params":["e523e7c59a0725afd08bc9751c89eed6f8e16dec","-1"]}' 10.0.0.41:36100
curl -d '{"jsonrpc":"2.0","id":9,"method":"brc_getBalance","params":["042610e447c94ff0824b7aa89fab123930edc805","-1"]}' 10.0.0.41:36100
- results
{
"id":9,
"jsonrpc":"2.0",
"result":
{
"Address":"0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
"BRC":"0x1f711def073e900000",
"FBRC":"0x0",
"FBalance":"0x0",
"balance":"0xa4d88ddd94000",
"ballot":"0x0",
"cookieinsummury": "0x0",
"nonce":"0x0",
"poll":"0x0",
"vote":null
}
}
{
"id":9,
"jsonrpc":"2.0",
"result":
{
"Address":"0x042610e447c94ff0824b7aa89fab123930edc805",
"BRC":"0x1f711def073e900000",
"FBRC":"0x0",
"FBalance":"0x0",
"balance":"0xa4d88ddd94000",
"ballot":"0x0",
"cookieinsummury": "0x0",
"nonce":"0x0",
"poll":"0x0",
"vote":null
}
}
address:0xe523e7c59a0725afd08bc9751c89eed6f8e16dec's BRC number is "BRC":"0x1f711def073e900000"
address:0x042610e447c94ff0824b7aa89fab123930edc805's BRC number is "BRC":"0x1f711def073e900000"
-
4.2 Test transfer 1 minimum unit BRC Return BRC
- command(Three methods have the same command)
../cmdWallet -j ./1_transfer_data.json -s 10.0.0.41:36100- cmdWallet execution file acquisition
cd cpp-lsac/build : enter directory cmake .. : command make : command cd cpp-lsac/build/wallet/cmdWallet : In this directory, you can find the cmdWallet execution file that you just compiles -
return hash
{"id":1,"jsonrpc":"2.0","result":"0x3d55b1004e779b7533aaa6c06835538ff1ad9b0701f5531a322f9903acea1b08"}
- Query transfer results though hash
{
"id":9,
"jsonrpc":"2.0",
"result":
{
"Address":"0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
"BRC":"0x1f711def073e8fffff",
"FBRC":"0x0",
"FBalance":"0x0",
"balance":"0xa4d88d6ffb5c0",
"ballot":"0x0",
"cookieinsummury": "0x0",
"nonce":"0x1",
"poll":"0x0",
"vote":null
}
}
{
"id":9,
"jsonrpc":"2.0",
"result":
{
"Address":"0x042610e447c94ff0824b7aa89fab123930edc805",
"BRC":"0x1f711def073e900001",
"FBRC":"0x0",
"FBalance":"0x0",
"balance":"0xa4d88ddd94000",
"ballot":"0x0",
"cookieinsummury": "0x0",
"nonce":"0x0",
"poll":"0x0",
"vote":null
}
}
- From the results we can see that:
- address:0xe523e7c59a0725afd08bc9751c89eed6f8e16dec's BRC number is "BRC":"0x1f711def073e8fffff", reduce 1 minimum unit BRC
- address:0x042610e447c94ff0824b7aa89fab123930edc805's BRC number is "BRC":"0x1f711def073e900001", increase 1 minimum unit BRC
- indicate successful transfer