Skip to content

BaerChain BRC Transcation

woodbaer edited this page Aug 22, 2019 · 4 revisions

On Transfer Transactions(brcTranscation)

1. Transfer method 1

  • 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".
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

Clone this wiki locally