Skip to content

BaerChain RPCInterfaceDocument

weidong edited this page Apr 8, 2020 · 11 revisions

BaerChain RPC接口文档

Vote Match BlockInfo
brc_getBallot brc_getPendingOrderPool brc_blockNumber
brc_getElector brc_getPendingOrderPoolForAddr brc_chainId
brc_getObtainVote brc_getSuccessPendingOrder brc_protocolVersion
brc_getVoted brc_getSuccessPendingOrderForAddr brc_gasPrice
AccountTx TxQueryAndAnalyse BlockInfo
brc_getQueryBlockReward brc_getAnalysisData brc_coinbase
brc_getQueryExchangeReward brc_inspectTransaction brc_getBlockByHash
brc_getBalance brc_getBlockDetialByHash brc_getBlockByNumber
brc_sendRawTransaction brc_getBlockDetialByNumber brc_getBlockTransactionCountByNumber
brc_getTransactionReceipt brc_getTransactionDetialByBlockHashAndIndex brc_getTransactionByBlockHashAndIndex
brc_getTransactionByHash brc_getTransactionDetialByBlockNumberAndIndex brc_getTransactionByBlockNumberAndIndex
brc_getTransactionCount brc_getTransactionDetialByHash brc_getUncleCountByBlockHash
brc_call
brc_estimateGasUsed

brc_getBallot : Query the number of votes that the address can cast Back Dir

  • request
{"jsonrpc":"2.0","method":"brc_getBallot","params":["cccc7a30bf688c060524dfd759fe2627ed3387bc", "latest"],"id":1}
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getBallot","params":["cccc7a30bf688c060524dfd759fe2627ed3387bc", "latest"],"id":1}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params : Parameter list, array structure
         > Array Table 0: Address to be queried
         > Array Table 1: Block height, default is "latest"
  • Return result
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": "0x2"
}
  • Parameter Description
result : The number of votes the current address can vote for other addresses

brc_getElector : Query the collection of candidates and their votes Back Dir

  • Request
{"jsonrpc":"2.0","id":9,"method":"brc_getElector","params":["latest"]}
  • Command example
curl -d '{"jsonrpc":"2.0","id":9,"method":"brc_getElector","params":["latest"]}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params : Parameter list, default "latest"
  • Return result
{
    "id": 9,
    "jsonrpc": "2.0",
    "result": {
	"electors": [{
	"address": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
 	"vote_num": "0x0"
    }, {
        "address": "0xdb1874c67cf3628690c795f0553e0e2904b02ffd",
        "vote_num": "0x0"
     }, {
         "address": "0xc3eb4d16a99e0a04de3242729a759a45809d2628",
	 "vote_num": "0x0"
     }, {
         "address": "0x02b3d7c2f9f53f5bbcb3794da5282566f5632b46",
  	 "vote_num": "0x0"
     }, {
	 "address": "0xd15c70cb560cea42995c9f52858778aa8b08c1c1",
	 "vote_num": "0x0"
     }, {
	 "address": "0x6e8c3d142894db1e06a026497f6b506c49069908",
	 "vote_num": "0x2"  == > (You can see that at this time you have got 2 votes to change your address)
     }]
   }
}
  • Parameter Description
address  : Candidate address
vote_num : Candidate votes

brc_getObtainVote : Query the number of votes for the designated candidate Back Dir

  • Request
{"jsonrpc":"2.0","id":9,"method":"brc_getObtainVote","params":["0x6e8c3d142894db1e06a026497f6b506c49069908","latest"]}
  • Command example
curl -d '{"jsonrpc":"2.0","id":9,"method":"brc_getObtainVote","params":["0x6e8c3d142894db1e06a026497f6b506c49069908","latest"]}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params : Parameter list, default is "latest"
  • Return result
{
    "id": 9,
    "jsonrpc": "2.0",
    "result": {
	"addrsss": "0x6e8c3d142894db1e06a026497f6b506c49069908",
	"obtain_vote": "0x2"
    }
}
  • Parameter Description
addrsss     : look for the address
obtain_vote : Total votes for this address

brc_getVoted : Check the voting status of the specified account Back Dir

  • request
{"jsonrpc":"2.0","id":22,"method":"brc_getVoted","params":["0xffe917db507e44e0a050227708f6af7ecf21790c","latest"]}
  • 指令示例
curl -d '{"jsonrpc":"2.0","id":22,"method":"brc_getVoted","params":["0xffe917db507e44e0a050227708f6af7ecf21790c","latest"]}' http://127.0.0.1:8111
  • Parameter Description
method : Method name, such as:brc_getVoted
params : Array structure, parameter list:
         > Array subscript 0: account address
         > Array subscript 1: default is the latest, indicating the latest block
  • Return result
{
  "id": 9,
  "jsonrpc": "2.0",
  "result": {
    "total_voted_num": "0x2",
    "vote": [{
      "address": "0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
      "voted_num": "0x2"
    }]
  }
}
  • Parameter Description
result          : json-object array  ==> Number of votes corresponding to the address
total_voted_num : Total votes cast
vote            : Voting array, showing which addresses to vote for
                  > address   : Voted address
                  > voted_num : Number of votes cast by other addresses

brc_getPendingOrderPool : Get orders existing in the trading pool Back Dir

  • Request
{"jsonrpc":"2.0","method":"brc_getPendingOrderPool","params":["sell", "FUEL", "10","latest"],"id":1}
  • Instruction example
curl -X POST --data '{"jsonrpc":"2.0","method":"brc_getPendingOrderPool","params":["sell", "FUEL", "10","latest"],"id":1}' http://127.0.0.1:8111
  • Parameter Description
method :[Required] Method name, such as:brc_getPendingOrderPool
params :[Required] Parameter list, array structure
         > Array subscript 0: buy and sell types, buy means buy, sell means sell (in this case, "sell")
         > Array subscript 1: Currency type, FUEL (Cookie)
         > Array subscript 2: the amount of data, the default is 10
         > Array subscript 3: block height, latest is passed by default, indicating the latest block
  • Return result
{
"id":1,
"jsonrpc":"2.0",
"result":[{
	"Address":"0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
	"Hash":"0xe8e0b418bc0c5c999accbf63849ac40b10f5aced8cee8bc3a86c8d5174327c1e",
	"create_time":"0x16afe84eb48",
	"order_token_type":"FUEL",
	"order_type":"sell",
	"price":"200000000",
	"source_amount":"100000000000",
	"token_amount":"100000000000"},
     {
	"Address":"0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
	"Hash":"0xe8e0b418bc0c5c999accbf63849ac40b10f5aced8cee8bc3a86c8d5174327c1e",
	"create_time":"0x16afe84eb48",
	"order_token_type":"FUEL",
	"order_type":"sell",
	"price":"200000000",
	"source_amount":"10000000000",
	"token_amount":"100000000000"
}]
}
  • Return parameter description
result           : json-object array transaction array
Address          : Pending order address
Hash             : Transaction hash waiting to be matched
create_time      : Timestamp of transaction initiation
order_token_type : Currency type,FUEL(Cookie)
order_type       : Type of sale, buy means buy, sell means sell
price            : Unit price (8 digit precision, such as: unit price is 2, then enter 200000000)
source_amount    : The total number of listings (8-digit precision, such as: selling 2 cookies, it is 200000000)
token_amount     : The number of unsold (8-digit precision, such as: the number of unsold is 1.8, it is 180000000)

brc_getPendingOrderPoolForAddr : Get the matching transaction at the specified address Back Dir

  • Request:
{"jsonrpc":"2.0","method":"brc_getPendingOrderPoolForAddr","params":["0xffe917db507e44e0a050227708f6af7ecf21790c", "10", "latest"],"id":1}
  • Command example
curl -X POST --data '{"jsonrpc":"2.0","method":"brc_getPendingOrderPoolForAddr","params":["0xe523e7c59a0725afd08bc9751c89eed6f8e16dec", "10", "latest"],"id":1}' http://127.0.0.1:8111
  • 参数说明
method : [Required], method name, such as :brc_getPendingOrderPoolForAddr
params : [Required], parameter list, array structure
         > Array subscript 0: the address of the initiating transaction, such as:0xe523e7c59a0725afd08bc9751c89eed6f8e16dec
         > Array subscript 1: data amount, default is 10
         > Array subscript 2: block height, (values that can be passed in are: latest, earliest, pending), default is latest, indicating the latest block
  • Return result
{
	"id":1,
	"jsonrpc":"2.0",
	"result":[{
		"Address":"0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
		"Hash":"0x6f4d0684e25cb76930ae5965b627e56b0c4a030231b83a7f6b1b8e21e48e5819",
		"create_time":"0x16afe6f1d40",
		"order_token_type":"FUEL",
		"order_type":"sell",
		"price":"100000000",
		"source_amount":"10000000000",
		"token_amount":"10000000000"},
           {
		"Address":"0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
		"Hash":"0x6f4d0684e25cb76930ae5965b627e56b0c4a030231b83a7f6b1b8e21e48e5819",
		"create_time":"0x16afe6f1d40",
		"order_token_type":"FUEL",
		"order_type":"sell",
		"price":"100000000",
		"source_amount":"10000000000",
		"token_amount":"10000000000"
}]
}
  • Parameter Description
result           : json-object array, Transaction array
Address          : Pending order address
Hash             : Transaction hash waiting to be matched
create_time      : Timestamp of transaction initiation
order_token_type : Currency type,FUEL(Cookie)
order_type       : Type of sale, buy means buy, sell means sell
price            : Unit price (8 digit precision, such as: unit price is 1, then enter 100000000)
source_amount    : The total number of listings (8-digit precision, such as: selling 1 cookie is 100000000)
token_amount     : The number of unsold (8-digit precision, such as: the number of unsold is 0.8, it is 80000000)

brc_getSuccessPendingOrder : Get the successful matchmaking transaction Back Dir

  • Remarks: This interface is not yet open, the following examples are for reference only
  • Request:
{"jsonrpc":"2.0","method":"brc_getSuccessPendingOrder","params":["100", "latest"],"id":1}
  • Command example
curl -X POST --data '{"jsonrpc":"2.0","method":"brc_getSuccessPendingOrder","params":["100", "latest"],"id":1}' http://127.0.0.1:8111
  • Parameter Description
method : Method name, such as:brc_getSuccessPendingOrder 
params : Array structure, parameter list
         > Array subscript 0: transaction volume, default is 100
         > Array subscript 1: Block height, (available values are: latest, earliest, pending), default is latest, indicating the latest block
  • Return result
{
	"id":1,
	"jsonrpc":"2.0",
	"result":[{
		"Acceptor":"0x00000000000000000000000000000000766f7465",
		"AcceptorHash":"0x0000000000000000000000000000000000000000000000000000000000000001",
		"Address":"0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
		"Hash":"0x97098f7b39cfda4c97b1d2feac29d6a338ab712760c9dca5e55fea889ab14156",
		"amount":"1000000000",
		"create_time":"0x16af74b89e0",
		"order_buy_type":"only_price",
		"order_token_type":"FUEL",
		"order_type":"buy",
		"price":"100000000"},
           {
		"Acceptor":"0x00000000000000000000000000000000766f7465",
		"AcceptorHash":"0x0000000000000000000000000000000000000000000000000000000000000001",
		"Address":"0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
		"Hash":"0x97098f7b39cfda4c97b1d2feac29d6a338ab712760c9dca5e55fea889ab14156",
		"amount":"1000000000",
		"create_time":"0x16af74b89e0",
		"order_buy_type":"only_price",
		"order_token_type":"FUEL",
		"order_type":"buy",
		"price":"100000000"
	}]
}
  • Parameter Description
result           : json-object array,Transaction array
Acceptor         : Address to accept matchmaking transaction
Address          : Initiating the matching address
AcceptorHash     : The hash of the transaction at the matched address
Hash             : Initiate a hash of matching transaction addresses
amount           : Number of tokens (8-digit precision)
create_time      : Timestamp of matchmaking initiation
order_buy_type   : The limit price is "only_price", the market price is "all_price"
order_token_type : Currency type,FUEL(Cookie)
order_type       : Buy and sell type "buy" means buy, "sell" means sell
price            : Unit price (8 digit precision)

brc_getSuccessPendingOrderForAddr : Obtain a successful transaction at the specified address Back Dir

  • This interface is not yet open, the following example is for reference only
  • Request
{"jsonrpc":"2.0","method":"brc_getSuccessPendingOrderForAddr","params":["0xffe917db507e44e0a050227708f6af7ecf21790c", "1562312503000", "1562312603000", "30", "latest"],"id":1}
  • Instruction example
curl -X POST --data '{"jsonrpc":"2.0","method":"brc_getSuccessPendingOrderForAddr","params":["0x41ff923c81d7a47f262f9fca7359014cdc19c7f7", "1562312503000", "1562312603000", "30", "latest"],"id":1}' http://127.0.0.1:8111
  • Parameter Description
method : [Required], method name,如:brc_getSuccessPendingOrderForAddr
params : [Required], parameter table, array structure
		 > Array subscript 0: the address to be queried
		 > Array subscript 1: time to start query (need to be decimal)
		 > Array subscript 2: the world where the query ends (must be greater than the time when the query starts, the time needs to be in decimal)
		 > Array subscript 3: the number of successfully matched transactions (maximum cannot exceed 50)
		 > Array subscript 4: block height, default is latest, indicating the latest block
  • Return result
{
	"id":1,
	"jsonrpc":"2.0",
	"result":[{
		"Acceptor":"0x41ff923c81d7a47f262f9fca7359014cdc19c7f7",
		"AcceptorHash":"0x6e7cf0151803927f2b9f0934b2f6a667cf87b7c23d7a86317ccd6fe165b9097c",
		"Address":"0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
		"Hash":"0x6ec92e0214b0d1b8517dc909c737da0c73bc8fbb19df3accd2b71d96a1696daf",
		"amount":"1000000000",
		"create_time":"0x16bc114eed8",
		"order_buy_type":"only_price",
		"order_token_type":"FUEL",
		"order_type":"sell",
		"price":"100000000"
	}]
}
  • Parameter Description
result           : json-object array, Transaction array
Acceptor	     : Address to accept matchmaking transaction
AcceptorHash	 : The hash of the transaction at the matched address
Address		     : Initiating the matching address
Hash		     : Initiate a hash of matching transaction addresses
amount		     : Number of tokens (8-digit precision)
order_buy_type   : Limit price only_price, market price all_price
order_token_type : Currency type, FUEL (Cookie)
order_type       : Buy and sell type buy means buy, sell means sell
price            : Unit price (8 digit precision)

brc_getQueryBlockReward : Check the voter's address and the block producer's block reward Back Dir

  • Remarks: There are two types of addresses that can get block rewards: one is the address of the block producer, and the other is the address where the ordinary user voted and the address he voted among the block producers

  • Request

{"jsonrpc":"2.0","method":"brc_getQueryBlockReward","params":["042610e447c94ff0824b7aa89fab123930edc805", "latest"],"id":1}
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getQueryBlockReward","params":["042610e447c94ff0824b7aa89fab123930edc805", "latest"],"id":1}' http://127.0.0.1:8111

  • Parameter Description
method : Method name
params : parameter list,
         > Array subscript 0: address of the person who made the block
         > Array subscript 1: Block height, latest is passed by default, indicating the latest block
  • Return result
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
	 "CookieFeeIncome": "0x267cac"
  }
}
  • Parameter Description
BRC     : The number of BRC rewards obtained by the block producer, 8-digit precision, hexadecimal
Cookies : Number of cookies rewarded by block producers, 8-digit precision, hexadecimal

brc_getQueryExchangeReward : Query the matching transaction rewards obtained by block producers Back Dir

  • Request
{"jsonrpc":"2.0","method":"brc_getQueryExchangeReward","params":["042610e447c94ff0824b7aa89fab123930edc805", "latest"],"id":1}
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getQueryExchangeReward","params":["042610e447c94ff0824b7aa89fab123930edc805", "latest"],"id":1}' http://127.0.0.1:8111

  • Parameter Description
method : Method name
params : parameter list,
         > Array subscript 0: address of the person who made the block
         > Array subscript 1: Block height, latest is passed by default, indicating the latest block
  • Return result
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": {
	 "queryExchangeReward": {
	 "BRC": "0x10df6",
	 "Cookies": "0x71960"
	 }
  }
}
  • Parameter Description
BRC     : The number of BRC rewards obtained by the block producer, 8-digit precision, hexadecimal
Cookies : Number of cookies rewarded by block producers, 8-digit precision, hexadecimal

brc_getBalance : Get account balance Back Dir

  • Request:
{"jsonrpc":"2.0","id":22,"method":"brc_getBalance","params:["0xffe917db507e44e0a050227708f6af7ecf21790c","latest"]}
  • Instruction example
curl -d '{"jsonrpc":"2.0","id":22,"method":"brc_getBalance","params":["0xffe917db507e44e0a050227708f6af7ecf21790c","latest"]}' http://127.0.0.1:8111
  • Parameter Description
method : Method name, such as:brc_getBalance
params : Array structure, parameter list
         > Array subscript 0: account address, such as: 0xffe917db507e44e0a050227708f6af7ecf21790c
         > 数组下标1 : 区块高度(可传入值为:latest,earliest,pending),默认传latest,表示最新区块
  • Return result 1
{
	"id": 9,
	"jsonrpc": "2.0",
	"result": {
		"Address": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
		"BRC": "0xa4d88ddd94000",
		"FBRC": "0x0",
		"FBalance": "0x0",
		"balance": "0xa4d88ddafb848",
		"ballot": "0x0",
		"cookieinsummury": "0x0",
		"nonce": "0x3",
		"poll": "0x0",
		"vote": null
	}
}
  • Return result 2
{
	"id": 22,
	"jsonrpc": "2.0",
	"result": {
		"Address": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
		"BRC": "0xa0ddd70e38900",
		"FBRC": "0x0",
		"FBalance": "0x0",
		"balance": "0xa4d88dd7129ac",
		"ballot": "0x1869e",
		"cookieinsummury": "0x681654",
		"nonce": "0x18",
		"poll": "0x1",
		"vote": [{
			"Address": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
			"vote_num": "0x1"
		}, {
			"Address": "0xdb1874c67cf3628690c795f0553e0e2904b02ffd",
			"vote_num": "0x2"
		}]
	}
}
  • Parameter Description
Address     		: Account address, such as: 0x042610e447c94ff0824b7aa89fab123930edc805
BRC         		: The number of chain coins owned by the account address
FBRC        		: Number of chain coins whose account address is frozen
FBalance    		: Number of fuel coins with frozen account addresses
balance     		: The number of fuel coins owned by the account address
ballot      		: The number of votes that the account address can vote
cookieinsummury		: Block revenue
poll        		: If the address is a campaign address, it is the number of votes that other accounts voted for the account
nonce       		: Record the number of transactions
vote        		: Voting situation
                      > If it is "null" it means that it has not been voted. If there is data, record which addresses were voted for
                      > Address	 : Record the address of the voted
                      > vote_num : Record the number of votes cast for the voted

brc_sendRawTransaction : Submit and send the transaction Back Dir

  • Request
{"jsonrpc":"2.0","id":12,"method":"brc_sendRawTransaction","params":["0xf864028504a817c80082520894ffff19f5ada6a28821ce0ed74c605c8c086ceb3501801ba0ccb5aed4e0a76528634f5599142e413e1b4351883daa9f4002c1e059ae93462aa037f3bf1e22de40b8840bb29154e9255370e99f5fc7dbc6948b54612ccfff6060"]}
  • Command example
curl -d '{"jsonrpc":"2.0","id":12,"method":"brc_sendRawTransaction","params":["0xf864028504a817c80082520894ffff19f5ada6a28821ce0ed74c605c8c086ceb3501801ba0ccb5aed4e0a76528634f5599142e413e1b4351883daa9f4002c1e059ae93462aa037f3bf1e22de40b8840bb29154e9255370e99f5fc7dbc6948b54612ccfff6060"]}' http://127.0.0.1:8111
  • Command parameter description
"method" : [Required] Method name, such as:brc_sendRawTransaction
"params" : [Required] Parameter list, such as:①

①:The "raw" value of the signed transaction, "string" type, as follows

"0xf864028504a817c80082520894ffff19f5ada6a28821ce0ed74c605c8c086ceb3501801ba0ccb5aed4e0a76528634f5599142e413e1b4351883daa9f4002c1e059ae93462aa037f3bf1e22de40b8840bb29154e9255370e99f5fc7dbc6948b54612ccfff6060"
  • Example of return value
{
    "id": 12,
	"jsonrpc": "2.0",
	"result": "0x4070ca3994af5191aa5805376c1da89c7989e351c890cb7779b327cca160cba3"
}
  • Return parameter description
"result" : "0x4070ca3994af5191aa5805376c1da89c7989e351c890cb7779b327cca160cba3" 交易hash

brc_getTransactionReceipt : Get transaction voucher Back Dir

  • Request:
{"jsonrpc":"2.0","method":"brc_getTransactionReceipt","params":["0x1b80fdfa871bdb16c4e3a2c28f066984ea073724bfc848cffa510749c5eea954"],"id":1}
  • Instruction example
curl -X POST --data '{"jsonrpc":"2.0","method":"brc_getTransactionReceipt","params":["0x1b80fdfa871bdb16c4e3a2c28f066984ea073724bfc848cffa510749c5eea954"],"id":1}' http://127.0.0.1:8111
  • Parameter Description
method : Method name, such as:brc_getTransactionReceipt
params : Array structure, parameter list, default is 1 element
         Array subscript 0: transaction hash
  • Return result
{
	"id": 1,
	"jsonrpc": "2.0",
	"result": {
		"blockHash": "0xf65ad7f07d991a93ffd3e7f6d45fab3c0f6022b55c7dd53b5c615477ccbc88eb",
		"blockNumber": 1159,
		"contractAddress": "0xbb211c682d917ebf0383e8a3c2e6b4de148a645f",
		"cumulativeGasUsed": "0x5208",
		"from": "0xffe917db507e44e0a050227708f6af7ecf21790c",
		"gasUsed": "0x5208",
		"logs": [],
		"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
		"stateRoot": "0xa34fc2b8e86f5ae37d66c3cc775fe9fe0891a8a557c4d92dc32f7f20f3e0e131",
                "status": "1",
		"to": "0xffff19f5ada6a28821ce0ed74c605c8c086ceb35",
		"transactionHash": "0x1b80fdfa871bdb16c4e3a2c28f066984ea073724bfc848cffa510749c5eea954",
		"transactionIndex": 0
	}
}
  • Parameter Description
blockHash         : Block hash
blockNumber       : Block height
contractAddress   : The contract address when deploying the contract; otherwise, a random value
cumulativeGasUsed : Block cumulative gas consumption
from              : Transaction sender address
gasUsed           : gas consumption
logs              : Array of log objects generated by this transaction
logsBloom         : bloom filter, light client used to quickly extract related logs
stateRoot         : Transaction root status
status            : Transaction status, "1" means success, "0" means failure
to                : The address of the transaction receiver, the value is "0" for the contract creation transaction
transactionHash   : Transaction hash
transactionIndex  : The index number of the transaction within the block

brc_blockNumber : Get block height Back Dir

  • request
{"jsonrpc":"2.0","method":"brc_blockNumber","params":[],"id":17}
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_blockNumber","params":[],"id":17}' http://127.0.0.1:8111
  • Parameter Description
method : Method name, such as:brc_blockNumber
params : Parameter list, default is empty
  • Return result
{
    "id": 17,
    "jsonrpc": "2.0",
    "result": "0x10e1"
}
  • Parameter Description
result : Current block height

brc_chainId : Get chain ID Back Dir

  • Request
{"jsonrpc":"2.0","id":20,"method":"brc_chainId","params":[]}
  • Instruction example
curl -d '{"jsonrpc":"2.0","id":20,"method":"brc_chainId","params":[]}' http://127.0.0.1:8111
  • Parameter Description
method : Method name, such as:brc_chainId
params : Array structure, default is empty
  • Example of return value
{
	"id": 20,
	"jsonrpc": "2.0",
	"result": "0x23"
}
  • Parameter Description
result : Represented chain ID, expressed in hexadecimal

brc_protocolVersion : Returns the version of the current chain protocol Back Dir

  • Request
{"jsonrpc":"2.0","method":"brc_protocolVersion","params":[],"id":17}
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_protocolVersion","params":[],"id":17}' http://127.0.0.1:8111
  • Parameter Description
method : Method name, such as:brc_blockNumber
params : Parameter list, default is empty
  • Return result
{
    "id": 17,
    "jsonrpc": "2.0",
    "result": "0x3f"
}
  • Parameter Description
result : The version of the current chain protocol

brc_gasPrice : Query current gas price Back Dir

  • Request
{"jsonrpc":"2.0","method":"brc_gasPrice","params":[],"id":17}
  • Instruction example
 curl -d '{"jsonrpc":"2.0","method":"brc_gasPrice","params":[],"id":17}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params : Parameter list, default is empty
  • Return result
{
    "id": 17,
    "jsonrpc": "2.0",
    "result": "0xc"
}
  • Parameter Description
result : Current gas price in the smallest unit

brc_coinbase : Query the coinbase address of the client Back Dir

  • Request
'{"jsonrpc":"2.0","method":"brc_coinbase","params":[],"id":17}
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_coinbase","params":[],"id":17}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params : Parameter list, default is empty
  • Return result
{
    "id": 17,
    "jsonrpc": "2.0",
    "result": "0x880bb80005873e49e7a6bb126d3c74315688fd36"
}
  • Parameter Description
result :  20 bytes - Current coinbase address

brc_getBlockByHash : Query block information by block hash Back Dir

  • Request
{"jsonrpc":"2.0","method":"brc_getBlockByHash","params":["0x1a7a749eb4d83db06d1797726ba8357afd5d07f962f9631d8623e11389b1052a",true],"id":17}
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getBlockByHash","params":["0x1a7a749eb4d83db06d1797726ba8357afd5d07f962f9631d8623e11389b1052a",true],"id":17}' http://127.0.0.1:8111
  • Parameter Description
method : Method name, such as:brc_getBlockByHash
params : Array structure, parameter list
         > Array subscript 0: block hash, such as:0x1a7a749eb4d83db06d1797726ba8357afd5d07f962f9631d8623e11389b1052a
         > Array subscript 1: Specify whether the return parameter contains transaction information, the default is: true
  • Return result
{
	"id": 17,
	"jsonrpc": "2.0",
	"result": {
		"author": "0x880bb80005873e49e7a6bb126d3c74315688fd36",
		"extraData": "0xd68094302e392e302b2b32313163524c696e7578474e55",
		"gasLimit": "0x100000000",
		"gasUsed": "0x5f98",
		"hash": "0xc13c96ac7f6456cfc51a893db809b968b842be0a7f5cb1a6f099ec1a05c3afb1",
		"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
		"miner": "0x880bb80005873e49e7a6bb126d3c74315688fd36",
		"number": "0xa",
		"parentHash": "0x02e17ab283e1533df680a748938b38a79f955f58682130ebdc02ed8f00a66c22",
		"receiptsRoot": "0x22c688cf462219b87d78ea5efeb8f7fe39a426b3ca35bfcfe489f3fa5f23f1d4",
		"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
		"sign": "0xe535b3abd8ae1574ef4870587ca3cb6c29701659cdef214f5c51b385d55861ae7d45c8534485e6d49d93a8f0f857cd259a4f725b1eceb51de23f16b71201f25f00",
		"size": "0x48",
		"stateRoot": "0x4f9dd28259090b3946f9c94a39e6e1f04e46433b3b80943b5f752304d598b7b4",
		"timestamp": "0x16c811ee3c8",
		"totalDifficulty": "0xdc",
		"transactions": [{
			"baseGas": "0x5f98",
			"blockHash": "0xc13c96ac7f6456cfc51a893db809b968b842be0a7f5cb1a6f099ec1a05c3afb1",
			"blockNumber": "0xa",
			"from": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
			"gas": "0x138080",
			"gasPrice": "0x5",
			"hash": "0xfad645eb5c77dc8bed9ef51b88f8130b80b25c3884ab4f8b0f3afbb4770943cd",
			"input": "0xf3b2f10294cccc7a30bf688c060524dfd759fe2627ed3387bc94d0e89b32875f5a1d68ecbfb3995263adc3439bea01843b9aca00",
			"nonce": "0x1",
			"r": "0xf11dcb619d626f5cc427a58a28835a88fb03505d33420e0c8e412fc30cba4890",
			"s": "0x503afee857237caf2cb7cd0da80c56a61725e5d6930ed91173f380c9062f8648",
			"to": "0x00000000000000000000000000000000766f7465",
			"transactionIndex": "0x0",
			"v": "0x1",
			"value": "0x0"
		}],
		"transactionsRoot": "0x3263f9005b856915f42427ded1ede61eca74eff8ffa7248c94553d91bce77c7b",
		"uncles": []
	}
}

  • Parameter Description
author           : Block address
extraData        : extra information
gasLimit         : Block defined fuel cap
gasUsed          : The amount of fuel actually used in the block
hash             : hash value
logsBloom        : Bloom filter
miner            : Miner address
number           : Block height
parentHash       : Parent block hash
receiptsRoot     : Receipt hash
sha3Uncles       : Uncle block hash
sign             : Block signature
size             : Block size
stateRoot        : State hash
timestamp        : Block timestamp
totalDifficulty  : Total difficulty of the block
transactions     : Block contains transactions
        > baseGas   : The actual fuel value consumed by this transaction
        > blockHash : The block hash of this exchange in the block
        > blockNum  : The block height of this exchange in the block
        > from      : Transaction initiator
        > gas       : This transaction expects a given fuel value
        > gasPrice  : Actual fuel unit price for this transaction
        > hash      : The hash value of this transaction
        > input     : Serialized data of transaction or contract data, please check the remarks
        > nonce     : The number of transactions of the transaction initiator, each time a transaction is initiated nonce + 1
        > v         : Transaction signature
        > r         : Transaction signature
        > s         : Transaction signature
        > to        : Fixed address
        > value     : Numerical value
transactionsRoot : Block transaction total hash
uncles           : Uncle Block
  • 备注: 以转账方式二进行的转账input为空,即: "input":"" , 由转账方式二 可知,data的数据为空,所以此时input的数据也为空

brc_getAnalysisData : Parsing serialized data Back Dir

  • Request
'{"jsonrpc":"2.0","method":"brc_getAnalysisData","params":["0xf864b1f00294cccc7a30bf688c060524dfd759fe2627ed3387bc94042610e447c94ff0824b7aa89fab123930edc8050183010000b1f00294cccc7a30bf688c060524dfd759fe2627ed3387bc94eee227766ba28fa6abc9ec8fea0c56188bbd54c50183010000"],"id":1}'
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getAnalysisData","params":["0xf864b1f00294cccc7a30bf688c060524dfd759fe2627ed3387bc94042610e447c94ff0824b7aa89fab123930edc8050183010000b1f00294cccc7a30bf688c060524dfd759fe2627ed3387bc94eee227766ba28fa6abc9ec8fea0c56188bbd54c50183010000"],"id":1}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params :The parameter, that is, the serialized data that needs to be parsed, must be the serialized data of several custom transactions that have been confirmed, such as: "1". Vote; "2".brcTranscation; 3. pendingOrder; 4. cancelPendingOrder以及receivingincome,The rest are considered invalid data

Return results, the following provides several examples, the specific return is subject to actual

  • Return result 1. If a single brcTranscation transfer transaction
{
	"id": 1,
	"jsonrpc": "2.0",
	"result": [{
		"from": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
		"to": "0xd0e89b32875f5a1d68ecbfb3995263adc3439bea",
		"transcation_numbers": "0x3b9aca00",
		"transcation_type": "0x2",
		"type": "0x2"
	}]
}
  • Return result 2. If two brcTranscation transfer transactions, more than one include more
{
	"id": 1,
	"jsonrpc": "2.0",
	"result": [{
		"from": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
		"to": "0x042610e447c94ff0824b7aa89fab123930edc805",
		"transcation_numbers": "0x10000",
		"transcation_type": "0x2",
		"type": "0x2"
	}, {
		"from": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
		"to": "0xeee227766ba28fa6abc9ec8fea0c56188bbd54c5",
		"transcation_numbers": "0x10000",
		"transcation_type": "0x2",
		"type": "0x2"
	}]
}
  • 如果是挂单"If it is a pending order "pendingOrder" transaction"交易
{
	"id": 1,
	"jsonrpc": "2.0",
	"result": [{
		"buy_type": "0x1",
		"from": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
		"num": "0x2710",
		"pendingorder_type": "0x1",
		"price": "0x2710",
		"token_type": "0x1",
		"type": "0x3"
	}]
}
  • If it is cancel order "cancelOrder" transaction
{
	"id": 1,
	"jsonrpc": "2.0",
	"result": [{
        "cancelType": "0x3",
        "hash": "0x25beb155269a8bcf26e8ef13652f0d5aba21d8bb0ae5584656c54173406a4f17",
        "type":"0x4"
	}]
}
  • If it is a "vote" transaction
{
	"id": 1,
	"jsonrpc": "2.0",
	"result": [{
		"from": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
		"to": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
		"type": "0x1",
		"vote_numbers": "0xa",
		"vote_type": "0x1"
	}]
}
  • If the incoming data is incorrect (including the deployment contract and the execution contract are not parsed), the following error will be returned
{
	"error": {
		"code": 0,
		"data": null,
		"message": "Invalid data format!"
	},
	"id": 1,
	"jsonrpc": "2.0"
}

brc_inspectTransaction : Parsing transaction data Back Dir

  • 请求
'{"jsonrpc":"2.0","method":"brc_inspectTransaction","params":["0xf8968005831388009400000000000000000000000000000000766f746580b6f5b4f30294cccc7a30bf688c060524dfd759fe2627ed3387bc94695193772208fb21b8cae0096ddea871d74e82cb018609184e72a00026a025558263644754242d8488873590512926b53039c8f10676a5454cf38558c783a0772d6e9d8bc0084bf40d022adca0cde6adf4e3b6ee0c2d3667c59659ea187cea"],"id":17}'
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_inspectTransaction","params":["0xf8968005831388009400000000000000000000000000000000766f746580b6f5b4f30294cccc7a30bf688c060524dfd759fe2627ed3387bc94695193772208fb21b8cae0096ddea871d74e82cb018609184e72a00026a025558263644754242d8488873590512926b53039c8f10676a5454cf38558c783a0772d6e9d8bc0084bf40d022adca0cde6adf4e3b6ee0c2d3667c59659ea187cea"],"id":17}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params : Parameters, that is, transaction data that needs to be parsed
  • Return result
{
	"id": 17,
	"jsonrpc": "2.0",
	"result": {
		"data": "0xf5b4f30294cccc7a30bf688c060524dfd759fe2627ed3387bc94695193772208fb21b8cae0096ddea871d74e82cb018609184e72a000",
		"from": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
		"gas": "0x138800",
		"gasPrice": "0x5",
		"hash": "0x38c6313ce4bcb60e6b94f88f49ca3eae06ba4d265e9c5c396d43c8fbbbc26389",
		"nonce": "0x0",
		"r": "0x25558263644754242d8488873590512926b53039c8f10676a5454cf38558c783",
		"s": "0x772d6e9d8bc0084bf40d022adca0cde6adf4e3b6ee0c2d3667c59659ea187cea",
		"sighash": "0x7fe50e82c5281726f424851a4645e7b8dcce076a81f68df34ee45509e4405d09",
		"to": "0x00000000000000000000000000000000766f7465",
		"v": "0x1",
		"value": "0x0"
	}
}
  • Parameter Description
data 		: Serialized data
from 		: Transaction originating address
gas  		: This transaction expects a given fuel value
gasPrice 	: Actual fuel unit price for this transaction
hash 		: Transaction hash
nonce 		: The number of transactions of the transaction initiator, each time a transaction is initiated nonce + 1
r           : Transaction signature
s           : Transaction signature
v           : Transaction signature
to          : Fixed address
sighash 	: Transaction hash
value 		: Numerical value

brc_getBlockDetialByHash : Query blocks by block hash and parse transaction data Back Dir

  • Request
{"jsonrpc":"2.0","method":"brc_getBlockDetialByHash","params":["0xe8fb3338a779656aec4dcc580210fc9d57a8e11a3ec7e50c94aab20d08ffe8e7", true],"id":1}
  • Instruction example
curl -X POST --data '{"jsonrpc":"2.0","method":"brc_getBlockDetialByHash","params":["0xe8fb3338a779656aec4dcc580210fc9d57a8e11a3ec7e50c94aab20d08ffe8e7", true],"id":1}' http://127.0.0.1:8111
  • Parameter Description
method : Method name, such as:brc_getBlockByHash
params : Array structure, parameter list:
         > Array subscript 0: block hash, such as:0x1a7a749eb4d83db06d1797726ba8357afd5d07f962f9631d8623e11389b1052a
         > Array subscript 1: Specify whether the return parameter contains transaction information, the default is: true
  • Return result
{
	"id": 1,
	"jsonrpc": "2.0",
	"result": {
		"author": "0xe79fead329b69540142fabd881099c04424cc49f",
		"extraData": "0xd68094302e392e322b2b39383963524c696e7578474e55",
		"gasLimit": "0x100000000",
		"gasUsed": "0x5f98",
		"hash": "0xe8fb3338a779656aec4dcc580210fc9d57a8e11a3ec7e50c94aab20d08ffe8e7",
		"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
		"miner": "0xe79fead329b69540142fabd881099c04424cc49f",
		"number": "0xc3",
		"parentHash": "0xb3b3a5ea47bbdf14f211becfabc1cb5ca20d4474cf0aafa1fedcf20ad7ccd35e",
		"receiptsRoot": "0x22c688cf462219b87d78ea5efeb8f7fe39a426b3ca35bfcfe489f3fa5f23f1d4",
		"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
		"sign": "0x2a818e493b06d0702ce265e359ff81c9370fb95841a19d7d8979d3e5f3ce3ff03bb3ceab789180bfdd174c970a8a2a966a1209c0b7fba5b7f2541c0e1ed45b9801",
		"size": "0x0",
		"stateRoot": "0x454c5967eb05a0b34811ad1e46fcef44008c04f6f4daf58ee915efba3a71d395",
		"timestamp": "0x16c91288aa8",
		"totalDifficulty": "0xf50",
		"transactions": [{
			"baseGas": "0x5f98",
			"blockHash": "0xe8fb3338a779656aec4dcc580210fc9d57a8e11a3ec7e50c94aab20d08ffe8e7",
			"blockNumber": "0xc3",
			"from": "0xe79fead329b69540142fabd881099c04424cc49f",
			"gas": "0x138000",
			"gasPrice": "0x5",
			"hash": "0xe95af798afdc7bd34fdf6ce41448fc4338f244dfe028f12907d37b2e512eb94d",
			"input": "0xf3b2f10294e79fead329b69540142fabd881099c04424cc49f94b119c4dacf4b09fa44ab4ed8df9271acb50e69c901843b9aca00",
			"nonce": "0x3",
			"r": "0x215345a614cf329ada3dcc07156aac7b79f581a63aba6838932d077d6c6f7492",
			"s": "0x59423ccf87d51c925d84a016ea0b2ddb874b5ca960031b147b3e1683897450e3",
			"to": "0x00000000000000000000000000000000766f7465",
			"transactionIndex": "0x0",
			"txdata": [{
				"from": "0xe79fead329b69540142fabd881099c04424cc49f",
				"to": "0xb119c4dacf4b09fa44ab4ed8df9271acb50e69c9",
				"transcation_numbers": "0x3b9aca00",
				"transcation_type": "0x1",
				"type": "0x2"
			}],
			"v": "0x1",
			"value": "0x0"
		}],
		"transactionsRoot": "0xd0245f8cec1526febcfc2e2407ce1d6a7639b880122966944970a15e24e4b8d9",
		"uncles": []
	}
}

  • Parameter Description
author           : Block address
extraData        : extra information
gasLimit         : Block defined fuel cap
gasUsed          : The amount of fuel actually used in the block
hash             : hash
logsBloom        : Bloom filter
miner            : Miner address
number           : Block height
parentHash       : Parent block hash
receiptsRoot     : Receipt hash
sha3Uncles       : Onkel Block Hash
sign             : signature
size             : Block size
stateRoot        : State hash
timestamp        : Block timestamp
totalDifficulty  : Total difficulty of the block
transactions     : Block contains transactions
        > baseGas   : The actual fuel value consumed by this transaction
        > blockHash : The block hash of this exchange in the block
        > blockNum  : The block height of this exchange in the block
        > from      : Transaction initiator
        > gas       : This transaction expects a given fuel value
        > gasPrice  : Actual fuel unit price for this transaction
        > hash      : The hash value of this transaction
        > input	    : Serialized data of transaction or contract data, please check the remarks
        > txdata    : The input data of the transaction is parsed, and the contract is not parsed.In this case, the analysis can be known as a transfer transaction. The specific parsed data is subject to the actual return.For details, please see Note 2
        > nonce     : The number of transactions of the transaction initiator, each time a transaction is initiated nonce + 1
        > v         : Transaction signature
        > r         : Transaction signature
        > s         : Transaction signature
        > to        : Fixed address
        > value     : Numerical value
transactionsRoot : Block transaction total hash
uncles           : Uncle Block
  • 备注1: 以转账方式二进行的转账input为空,即: "input":"" , 由转账方式二 可知,data的数据为空,所以此时input的数据也为空

  • Note 2: The data types parsed by txdata are Back Dir

     "txdata": [{
         "from": "0xe79fead329b69540142fabd881099c04424cc49f",   => The address from which the transfer was initiated
         "to": "0xb119c4dacf4b09fa44ab4ed8df9271acb50e69c9",     => Address to accept transfer
         "transcation_numbers": "0x3b9aca00",                    => Number of transfers
         "transcation_type": "0x1",                              => Default value, fixed at 0x1
         "type": "0x2"                                           => Transaction identification number, fixed at 0x2, indicating "brcTranscation" transfer transaction
     }]
    
     "txdata": [{
         "buy_type": "0x0",                                     => Price type, 0 means market price, 1 means limit price
         "from": "0xdb6124227e944f54f578b9544efbe5c98c928b02",  => Pending order (pendingOrder) originating address
         "num": "0x0",                                          => Quantity to buy and sell
         "pendingorder_type": "0x2",                            => Type of sale, 1 means sell, 2 means buy
         "price": "0xa2fb405800",                               => price
         "token_type": "0x1",                                   => Currency, 1 means cookie
         "type": "0x3"                                          => Transaction identification number, fixed at 3, indicating pending order (pendingOrder)
     }]
    
     "txdata": [{
         "cancelType": "0x3",				                                => Default value, fixed at 3
         "hash": "0x25beb155269a8bcf26e8ef13652f0d5aba21d8bb0ae5584656c54173406a4f17",	=>  The hash value of the cancelled order
         "type":"0x4"   									=> Transaction identification number, fixed at 4, indicating cancellation of transaction
    }]
    
    "txdata": [{
         "type":"0x1",                                              => Transaction identification number, the type is fixed at 1, indicating "vote" transaction
         "from":"c6f73c3b14456434c7db388bcb4fd47377c0d738",         => vote transaction originating address
         "to":"0x4eb60bfab454b5aaece4e8759e62ed36266fde39",         => Addresses that accept vote transactions
         "vote_type":"0x5",                                         => 1: buy tickets 2: sell tickets 5: vote 6: cancel the vote, in this case 5 means vote
         "vote_numbers":"0xa"                                       => Votes
     }]
    

brc_getBlockDetialByNumber : Obtain the information of the specified block and parse the transaction data of the block Back Dir

  • Request
{"jsonrpc":"2.0","method":"brc_getBlockDetialByNumber","params":["1", true],"id":1}
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getBlockDetialByNumber","params":["1", true],"id":1}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params : Array structure, parameter list
         > Array subscript 0: block height, such as: 1, decimal representation
         > Array subscript 1: Specify whether the return parameter contains transaction information, the default is: true
  • Return result
{
	"id": 1,
	"jsonrpc": "2.0",
	"result": {
		"author": "0xe79fead329b69540142fabd881099c04424cc49f",
		"extraData": "0xd68094302e392e322b2b62356162524c696e7578474e55",
		"gasLimit": "0x100000000",
		"gasUsed": "0x5f94",
		"hash": "0xa7ffe064c5b7e47d63e62d9e8aba67ba74fc2ea8d5e6ee3a88ae3d741953edf8",
		"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
		"miner": "0xe79fead329b69540142fabd881099c04424cc49f",
		"number": "0x1",
		"parentHash": "0x921882ecf97914b46674b32333e656766e9dbd313d09eaa208c9fd13e03029e9",
		"receiptsRoot": "0xdb5120eeb1b13c44d0ad6d20560f34c0e0768c97c72d8772b2d2eec542a64e98",
		"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
		"sign": "0x0639b87f3a7197786c3479b2a679dfc2d5bf49efbacb530725783cdf895166aa7f1dd263217d726d1dca22926d0ff5329347f49f73b18bf9eb9710f1706cf55f00",
		"size": "0x0",
		"stateRoot": "0x0d942ca88bad1f6b53583ecc796099a730fd28d63e01c15df76d1908e96ad0a5",
		"timestamp": "0x16c940475c0",
		"totalDifficulty": "0x28",
		"transactions": [{
			"baseGas": "0x5f94",
			"blockHash": "0xa7ffe064c5b7e47d63e62d9e8aba67ba74fc2ea8d5e6ee3a88ae3d741953edf8",
			"blockNumber": "0x1",
			"from": "0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
			"gas": "0x138000",
			"gasPrice": "0x5",
			"hash": "0xdcbc38562d012b70a30516924b479d1b374131422cacd8d350cbc99249b538a6",
			"input": "0xf2b1f00294e523e7c59a0725afd08bc9751c89eed6f8e16dec94b119c4dacf4b09fa44ab4ed8df9271acb50e69c901833b9aca",
			"nonce": "0x0",
			"r": "0xe063fb2410aa7ef14735ecba5070134f11ac78b5cd16ffa273dc3036468417ec",
			"s": "0x513561c56c5231de4c9b1bacc949032e8667da386c09caf894bff264831045fd",
			"to": "0x00000000000000000000000000000000766f7465",
			"transactionIndex": "0x0",
			"txdata": [{
				"from": "0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
				"to": "0xb119c4dacf4b09fa44ab4ed8df9271acb50e69c9",
				"transcation_numbers": "0x3b9aca",
				"transcation_type": "0x1",
				"type": "0x2"
			}],
			"v": "0x0",
			"value": "0x0"
		}],
		"transactionsRoot": "0x00fb46951758c9dcd9e83efeea6e89af2c9b1bb9f56164f5caeecfc634887e1c",
		"uncles": []
	}
}

  • Parameter Description
author           : Block address
extraData        : extra information
gasLimit         : Block defined fuel cap
gasUsed          : The amount of fuel actually used in the block
hash             : hash
logsBloom        : Bloom filter
miner            : Miner address
number           : Block height
parentHash       : Parent block hash
receiptsRoot     : Receipt hash
sha3Uncles       : Uncle block hash
sign             : signature
size             : Block size
stateRoot        : State hash
timestamp        : Block timestamp
totalDifficulty  : Total difficulty of the block
transactions     : Block contains transactions
        > baseGas	: The actual fuel value consumed by this transaction
        > blockHash : The block hash of this exchange in the block
        > blockNum  : The block height of this exchange in the block
        > from		: Transaction initiator
        > gas		: This transaction expects a given fuel value
        > gasPrice	: Actual fuel unit price for this transaction
        > hash		: Transaction hash
        > input     : Serialized data of transaction or contract data, please check the remarks
        > nonce		: The number of transactions of the transaction initiator, each time a transaction is initiated nonce + 1
        > v 		: Transaction signature
        > r 		: Transaction signature
        > s 		: Transaction signature
        > to 		: Fixed address
        > value 	: Number of transactions, the number is 0 during custom transactions
transactionsRoot : Block transaction root hash
        > txdata    : The input data of the transaction is parsed, and the contract is not parsed.In this case, the analysis can be known as a transfer transaction. The specific parsed data is subject to the actual return.For details, please see Note 2
uncles           : Uncle Block
  • Note 1: The transfer input in transfer method 2 is empty, that is: "input":"" , 由转账方式二 可知,data的数据为空,所以此时input的数据也为空

*Note 2: The data types parsed by txdata are Back Dir

 "txdata": [{
     "from": "0xe79fead329b69540142fabd881099c04424cc49f",   => The address from which the transfer was initiated
     "to": "0xb119c4dacf4b09fa44ab4ed8df9271acb50e69c9",     => Address to accept transfer
     "transcation_numbers": "0x3b9aca00",                    => Number of transfers
     "transcation_type": "0x1",                              => Default value, fixed at 0x1
     "type": "0x2"                                           => Transaction identification number, fixed at 0x2, indicating "brcTranscation" transfer transaction
 }]
 "txdata": [{
     "buy_type": "0x0",                                     => Price type, 0 means market price, 1 means limit price

     "from": "0xdb6124227e944f54f578b9544efbe5c98c928b02",  => Pending order (pendingOrder) originating address
     "num": "0x0",                                          => Quantity to buy and sell
     "pendingorder_type": "0x2",                            => Type of sale, 1 means sell, 2 means buy
     "price": "0xa2fb405800",                               => price
     "token_type": "0x1",                                   => Currency, 1 means cookie
     "type": "0x3"                                          => Transaction identification number, fixed at 3, indicating pending order (pendingOrder)
 }]
 "txdata": [{
     "cancelType": "0x3",				                                => Default value, fixed at 3
     "hash": "0x25beb155269a8bcf26e8ef13652f0d5aba21d8bb0ae5584656c54173406a4f17",	=> The hash value of the cancelled order
     "type":"0x4"   									=> Transaction identification number, fixed at 4, indicating cancellation of transaction
}]
"txdata": [{
     "type":"0x1",                                              => Transaction identification number, the type is fixed at 1, indicating vote transaction
     "from":"c6f73c3b14456434c7db388bcb4fd47377c0d738",         => vote transaction originating address
     "to":"0x4eb60bfab454b5aaece4e8759e62ed36266fde39",         => Addresses that accept vote transactions
     "vote_type":"0x5",                                         => 1: buy tickets 2: sell tickets 5: vote 6: cancel the vote, in this case 5 means vote
     "vote_numbers":"0xa"                                       => Votes
 }]

brc_getTransactionDetialByBlockHashAndIndex : Query and parse transaction information according to the specified block hash and index Back Dir

  • Request
{"jsonrpc":"2.0","method":"brc_getTransactionDetialByBlockHashAndIndex","params":["0x33577d2f967249f67f06cfa6b1efcddc95d30d3d35f33805a1d55516f1fe41d1", "0x0"],"id":1}

  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getTransactionDetialByBlockHashAndIndex","params":["0x33577d2f967249f67f06cfa6b1efcddc95d30d3d35f33805a1d55516f1fe41d1", "0x0"],"id":1}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params : Array structure, parameter list
         > Array subscript 0: block hash
         > Array subscript 1: Specify the transaction sequence number in the block
  • Return result
{
	"id": 1,
	"jsonrpc": "2.0",
	"result": {
		"baseGas": "0x5f98",
		"blockHash": "0x33577d2f967249f67f06cfa6b1efcddc95d30d3d35f33805a1d55516f1fe41d1",
		"blockNumber": "0x15b",
		"from": "0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
		"gas": "0x138000",
		"gasPrice": "0x5",
		"hash": "0x39ffd9856997ad057bcca0d52b1ca02166f386f6b7f7f82ed8e7c39711e0af4f",
		"input": "0xf3b2f10294e523e7c59a0725afd08bc9751c89eed6f8e16dec94b119c4dacf4b09fa44ab4ed8df9271acb50e69c901843b9aca00",
		"nonce": "0x0",
		"to": "0x00000000000000000000000000000000766f7465",
		"transactionIndex": "0x0",
		"txdata": [{
			"from": "0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
			"to": "0xb119c4dacf4b09fa44ab4ed8df9271acb50e69c9",
			"transcation_numbers": "0x3b9aca00",
			"transcation_type": "0x1",
			"type": "0x2"
		}],
		"value": "0x0"
	}
}
  • Parameter Description
baseGas          : The actual fuel value consumed by this transaction
blockHash        : Block hash
blockNumber      : Block height
from             : Transaction initiator
gas              : This transaction expects a given fuel value
gasPrice         : Actual fuel unit price for this transaction
hash             : Transaction hash
input            : Serialized data of transaction or contract data, please check the remarks
nonce            : Number of transaction records
to               : Fixed address
transactionIndex : Transaction number in the block
txdata           : The input data of the transaction is parsed, and the contract is not parsed.In this case, the analysis can be known as a transfer transaction. The specific parsed data is subject to the actual return.For details, please see Note 2
value            : Numerical value
  • 备注1: 以转账方式二进行的转账input为空,即: "input":"" , 由转账方式二 可知,data的数据为空,所以此时input的数据也为空

  • 备注2: txdata解析的数据类型有 返回目录

     "txdata": [{
         "from": "0xe79fead329b69540142fabd881099c04424cc49f",   => The address from which the transfer was initiated
         "to": "0xb119c4dacf4b09fa44ab4ed8df9271acb50e69c9",     => Address to accept transfer
         "transcation_numbers": "0x3b9aca00",                    => Number of transfers
         "transcation_type": "0x1",                              => Default value, fixed at 0x1
         "type": "0x2"                                           => Transaction identification number, fixed at 0x2, indicating "brcTranscation" transfer transaction
     }]
    
     "txdata": [{
         "buy_type": "0x0",                                     => Price type, 0 means market price, 1 means limit price
         "from": "0xdb6124227e944f54f578b9544efbe5c98c928b02",  => Pending order (pendingOrder) originating address
         "num": "0x0",                                          => Quantity to buy and sell
         "pendingorder_type": "0x2",                            => Type of sale, 1 means sell, 2 means buy
         "price": "0xa2fb405800",                               => price
         "token_type": "0x1",                                   => Currency, 1 means cookie
         "type": "0x3"                                          => Transaction identification number, fixed at 3, indicating pending order (pendingOrder)
     }]
    
     "txdata": [{
         "cancelType": "0x3",				                                => Default value, fixed at 3
         "hash": "0x25beb155269a8bcf26e8ef13652f0d5aba21d8bb0ae5584656c54173406a4f17",	=> The hash value of the cancelled order
         "type":"0x4"   									=> Transaction identification number, fixed at 4, indicating cancellation of transaction
    }]
    
    "txdata": [{
         "type":"0x1",                                              => Transaction identification number, the type is fixed at 1, indicating vote transaction
         "from":"c6f73c3b14456434c7db388bcb4fd47377c0d738",         => vote transaction originating address
         "to":"0x4eb60bfab454b5aaece4e8759e62ed36266fde39",         => vote transaction originating address
         "vote_type":"0x5",                                         => 1: buy tickets 2: sell tickets 5: vote 6: cancel the vote, in this case 5 means vote
         "vote_numbers":"0xa"                                       => Votes
     }]
    

brc_getTransactionDetialByBlockNumberAndIndex : Query transaction information according to the specified block height and index Back Dir

  • Request
{"jsonrpc":"2.0","method":"brc_getTransactionDetialByBlockNumberAndIndex","params":["3", "0x0"],"id":1}

  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getTransactionDetialByBlockNumberAndIndex","params":["3", "0x0"],"id":1}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params : Array structure, parameter list
         > Array subscript 0: block height, decimal
         > Array subscript 1: Specify the transaction sequence number in the block, hexadecimal
  • Return result
{
	"id": 1,
	"jsonrpc": "2.0",
	"result": {
		"baseGas": "0x5f94",
		"blockHash": "0x0d0c2afa9a46dff627a7c42839fdb8677ea757bc8172c6a2f26ca651d8819325",
		"blockNumber": "0x3",
		"from": "0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
		"gas": "0x138000",
		"gasPrice": "0x5",
		"hash": "0xdcbc38562d012b70a30516924b479d1b374131422cacd8d350cbc99249b538a6",
		"input": "0xf2b1f00294e523e7c59a0725afd08bc9751c89eed6f8e16dec94b119c4dacf4b09fa44ab4ed8df9271acb50e69c901833b9aca",
		"nonce": "0x0",
		"to": "0x00000000000000000000000000000000766f7465",
		"transactionIndex": "0x0",
		"txdata": [{
			"from": "0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
			"to": "0xb119c4dacf4b09fa44ab4ed8df9271acb50e69c9",
			"transcation_numbers": "0x3b9aca",
			"transcation_type": "0x1",
			"type": "0x2"
		}],
		"value": "0x0"
	}
}
  • Parameter Description
baseGas          : The actual fuel value consumed by this transaction
blockHash        : Block hash
blockNumber      : Block height
from             : Transaction initiator
gas              : This transaction expects a given fuel value
gasPrice         : Actual fuel unit price for this transaction
hash             : Transaction hash
input            : Serialized data of transaction or contract data, please check the remarks
nonce            : Number of transaction records
to               : Fixed address
transactionIndex : Transaction number in the block
txdata           : The input data of the transaction is parsed, and the contract is not parsed.In this case, the analysis can be known as a transfer transaction. The specific parsed data is subject to the actual return.For details, please see Note 2
value            : Numerical value
  • 备注1: 以转账方式二进行的转账input为空,即: "input":"" , 由转账方式二 可知,data的数据为空,所以此时input的数据也为空

  • 备注2: txdata解析的数据类型有 返回目录

     "txdata": [{
         "from": "0xe79fead329b69540142fabd881099c04424cc49f",   => The address from which the transfer was initiated
         "to": "0xb119c4dacf4b09fa44ab4ed8df9271acb50e69c9",     => Address to accept transfer
         "transcation_numbers": "0x3b9aca00",                    => Number of transfers
         "transcation_type": "0x1",                              => Default value, fixed at 0x1
         "type": "0x2"                                           => Transaction identification number, fixed at 0x2, indicating "brcTranscation" transfer transaction
     }]
    
     "txdata": [{
         "buy_type": "0x0",                                     => Price type, 0 means market price, 1 means limit price
         "from": "0xdb6124227e944f54f578b9544efbe5c98c928b02",  => Pending order (pendingOrder) originating address
         "num": "0x0",                                          => Quantity to buy and sell
         "pendingorder_type": "0x2",                            => Type of sale, 1 means sell, 2 means buy
         "price": "0xa2fb405800",                               => price
         "token_type": "0x1",                                   => Currency, 1 means cookie
         "type": "0x3"                                          => Transaction identification number, fixed at 3, indicating pending order (pendingOrder)
     }]
    
     "txdata": [{
         "cancelType": "0x3",				                                => Default value, fixed at 3
         "hash": "0x25beb155269a8bcf26e8ef13652f0d5aba21d8bb0ae5584656c54173406a4f17",	=> The hash value of the cancelled order
         "type":"0x4"   									=> Transaction identification number, fixed at 4, indicating cancellation of transaction
    }]
    
    "txdata": [{
         "type":"0x1",                                              => Transaction identification number, the type is fixed at 1, indicating vote transaction
         "from":"c6f73c3b14456434c7db388bcb4fd47377c0d738",         => vote transaction originating address
         "to":"0x4eb60bfab454b5aaece4e8759e62ed36266fde39",         => Addresses that accept vote transactions
         "vote_type":"0x5",                                         => 1: buy tickets 2: sell tickets 5: vote 6: cancel the vote, in this case 5 means vote
         "vote_numbers":"0xa"                                       => Votes
     }]
    

brc_getTransactionDetialByHash : Query transaction information through transaction hash Back Dir

  • Request
{"jsonrpc":"2.0","method":"brc_getTransactionDetialByHash","params":["0x4fd969d4e8347aadc6e7ae05ff105ad03c54712e77ac7dc4b55618e4a1ad9fd1"],"id":1}
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getTransactionDetialByHash","params":["0x4fd969d4e8347aadc6e7ae05ff105ad03c54712e77ac7dc4b55618e4a1ad9fd1"],"id":1}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params : Array structure, parameter list
         > Array subscript 0: transaction hash, there is only one parameter by default
  • Return result
{
	"id": 1,
	"jsonrpc": "2.0",
	"result": {
		"baseGas": "0x5f98",
		"blockHash": "0x9ad6276f53e38edb34e909795ef36dae90630cbd2790d0bb7e6650cd5d846543",
		"blockNumber": "0x2a1",
		"from": "0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
		"gas": "0x138000",
		"gasPrice": "0x5",
		"hash": "0x4fd969d4e8347aadc6e7ae05ff105ad03c54712e77ac7dc4b55618e4a1ad9fd1",
		"input": "0xf3b2f10294e523e7c59a0725afd08bc9751c89eed6f8e16dec94b119c4dacf4b09fa44ab4ed8df9271acb50e69c901843b9aca00",
		"nonce": "0x2",
		"to": "0x00000000000000000000000000000000766f7465",
		"transactionIndex": "0x0",
		"txdata": [{
			"from": "0xe523e7c59a0725afd08bc9751c89eed6f8e16dec",
			"to": "0xb119c4dacf4b09fa44ab4ed8df9271acb50e69c9",
			"transcation_numbers": "0x3b9aca00",
			"transcation_type": "0x1",
			"type": "0x2"
		}],
		"value": "0x0"
	}
}
  • Parameter Description
baseGas          : The actual fuel value consumed by this transaction
blockHash        : Block hash
blockNumber      : Block height
from             : Transaction initiator
gas              : This transaction expects a given fuel value
gasPrice         : Actual fuel unit price for this transaction
hash             : Transaction hash
input            : Serialized data of transaction or contract data, please check the remarks
nonce            : Number of transaction records
to               : Fixed address
transactionIndex : Transaction number in the block
txdata           : The input data of the transaction is parsed, and the contract is not parsed.In this case, the analysis can be known as a transfer transaction. The specific parsed data is subject to the actual return.For details, please see Note 2
value            : Numerical value
  • 备注1: 以转账方式二进行的转账input为空,即: "input":"" , 由转账方式二 可知,data的数据为空,所以此时input的数据也为空

  • 备注2: txdata解析的数据类型有 返回目录

     "txdata": [{
         "from": "0xe79fead329b69540142fabd881099c04424cc49f",   => The address from which the transfer was initiated
         "to": "0xb119c4dacf4b09fa44ab4ed8df9271acb50e69c9",     => Address to accept transfer
         "transcation_numbers": "0x3b9aca00",                    => Number of transfers
         "transcation_type": "0x1",                              => Default value, fixed at 0x1
         "type": "0x2"                                           => Transaction identification number, fixed at 0x2, indicating brcTranscation transfer transaction
     }]
    
     "txdata": [{
         "buy_type": "0x0",                                     => Price type, 0 means market price, 1 means limit price
         "from": "0xdb6124227e944f54f578b9544efbe5c98c928b02",  => Pending order (pendingOrder) originating address
         "num": "0x0",                                          => Quantity to buy and sell
         "pendingorder_type": "0x2",                            => Type of sale, 1 means sell, 2 means buy
         "price": "0xa2fb405800",                               => price
         "token_type": "0x1",                                   => Currency, 1 means cookie
         "type": "0x3"                                          => Transaction identification number, fixed at 3, indicating pending order (pendingOrder)
     }]
    
     "txdata": [{
         "cancelType": "0x3",				                                => Default value, fixed at 3
         "hash": "0x25beb155269a8bcf26e8ef13652f0d5aba21d8bb0ae5584656c54173406a4f17",	=> The hash value of the cancelled order
         "type":"0x4"   									=> Transaction identification number, fixed at 4, indicating cancellation of transaction
    }]
    
    "txdata": [{
         "type":"0x1",                                              => Transaction identification number, the type is fixed at 1, indicating vote transaction
         "from":"c6f73c3b14456434c7db388bcb4fd47377c0d738",         => vote transaction originating address
         "to":"0x4eb60bfab454b5aaece4e8759e62ed36266fde39",         => Addresses that accept vote transactions
         "vote_type":"0x5",                                         => 1: buy tickets 2: sell tickets 5: vote 6: cancel the vote, in this case 5 means vote
         "vote_numbers":"0xa"                                       => Votes
     }]
    

brc_getBlockByNumber : Get the information of the specified block Back Dir

  • Request
{"jsonrpc":"2.0","method":"brc_getBlockByNumber","params":["17", true],"id":1}
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getBlockByNumber","params":["17", true],"id":1}' http://127.0.0.1:8111
  • Parameter Description
method : ethod name, such as:brc_getBlockByNumber
params : Array structure, parameter list
         > Array subscript 0: block height, such as: 17, decimal representation
         > Array subscript 1: Specify whether the return parameter contains transaction information, the default is: true
  • Return result
{
	"id": 1,
	"jsonrpc": "2.0",
	"result": {
		"author": "0x880bb80005873e49e7a6bb126d3c74315688fd36",
		"extraData": "0xd68094302e392e302b2b32313163524c696e7578474e55",
		"gasLimit": "0x100000000",
		"gasUsed": "0x5f98",
		"hash": "0xcfa5fedfd8195abb2f1556f240f49a0769925016677cabf9ed1bde6457993503",
		"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
		"miner": "0x880bb80005873e49e7a6bb126d3c74315688fd36",
		"number": "0xbd",
		"parentHash": "0x30cc261ca32244bdaaa4b7ae4c918268c1b4fd72407fd92ce4948eb37a71f4fb",
		"receiptsRoot": "0x22c688cf462219b87d78ea5efeb8f7fe39a426b3ca35bfcfe489f3fa5f23f1d4",
		"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
		"sign": "0x9cfe4a0ccc8542bf704597d5299f60dd27d69f002b508d2300cd90560b806248711b766ceb2cda237061b333edc763069d3e5d82c9a1ee2641257c00d0578f6401",
		"size": "0x4a",
		"stateRoot": "0xfae894e0477a92bd26c7e1b8bb75545b51e52e791d34dee7d7530d9c6419a2e8",
		"timestamp": "0x16c812f4718",
		"totalDifficulty": "0xed8",
		"transactions": [{
			"baseGas": "0x5f98",
			"blockHash": "0xcfa5fedfd8195abb2f1556f240f49a0769925016677cabf9ed1bde6457993503",
			"blockNumber": "0xbd",
			"from": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
			"gas": "0x138080",
			"gasPrice": "0x5",
			"hash": "0xdd550ae2b530f9388a2d552c9f6cf7a2ccbdb07eb4a0acb802347d4492c22ee9",
			"input": "0xf3b2f10294cccc7a30bf688c060524dfd759fe2627ed3387bc94d0e89b32875f5a1d68ecbfb3995263adc3439bea01843b9aca00",
			"nonce": "0x2",
			"r": "0xa624b1abd0614cc73d7f8b223fa6dac5f2ff25b0df9c4cd901cc6d6c187b4137",
			"s": "0x445e4ec03aa41ad9a1693445b87fb29e99992bf082cede9de28baca5df6ef007",
			"to": "0x00000000000000000000000000000000766f7465",
			"transactionIndex": "0x0",
			"v": "0x1",
			"value": "0x0"
		}],
		"transactionsRoot": "0x0ec3678572758a83fa8437923e931e23dc3ef42f986dc265ecdbc56ee7681588",
		"uncles": []
	}
}

  • Parameter Description
author           : Block address
extraData        : extra information
gasLimit         : Block defined fuel cap
gasUsed          : The amount of fuel actually used in the block
hash             : hash
logsBloom        : Bloom filter
miner            : Miner address
number           : Block height
parentHash       : Parent block hash
receiptsRoot     : Receipt hash
sha3Uncles       : Uncle block hash
sign             : signature
size             : Block size
stateRoot        : State hash
timestamp        : Block timestamp
totalDifficulty  : Total difficulty of the block
transactions     : Block contains transactions
        > baseGas       : The actual fuel value consumed by this transaction

        > blockHash     : The block hash of this exchange in the block
        > blockNum      : The block height of this exchange in the block
        > from		: Transaction initiator
        > gas		: This transaction expects a given fuel value
        > gasPrice	: Actual fuel unit price for this transaction
        > hash		: The hash value of this transaction
        > input     : Serialized data of transaction or contract data, please check the remarks
        > nonce		: The number of transactions of the transaction initiator, each time a transaction is initiated nonce + 1
        > v 		: Transaction signature
        > r 		: Transaction signature
        > s 		: Transaction signature
        > to 		: Fixed address
        > value 	: Number of transactions, the number is 0 during custom transactions
transactionsRoot : Block transaction total hash
uncles           : Uncle Block
  • 备注: 以转账方式二进行的转账input为空,即: "input":"" , 由转账方式二 可知,data的数据为空,所以此时input的数据也为空

brc_getBlockTransactionCountByNumber : Query the number of transactions in the specified block Back Dir

  • Request
{"jsonrpc":"2.0","method":"brc_getBlockTransactionCountByNumber","params":["latest"],"id":1}
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getBlockTransactionCountByNumber","params":["latest"],"id":1}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params : Parameter list, real block height, default "latest", optional string "earliest", or "pending"
  • Return result
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": "0xf"
}
  • Parameter Description
result :  Number of transactions within the specified block

brc_getTransactionByBlockHashAndIndex : Query transaction information according to the specified block hash and index Back Dir

  • Request
'{"jsonrpc":"2.0","method":"brc_getTransactionByBlockHashAndIndex","params":["0x30fe211d23791fc810abcc9997a76f5657b77c3d75d490feb72b871443f553f7","0x0"],"id":17}'

  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getTransactionByBlockHashAndIndex","params":["0x30fe211d23791fc810abcc9997a76f5657b77c3d75d490feb72b871443f553f7","0x0"],"id":17}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params : Array structure, parameter list
         > Array subscript 0: block hash
         > Array subscript 1: Specify the transaction sequence number in the block
  • Return result
{
	"id": 17,
	"jsonrpc": "2.0",
	"result": {
		"baseGas": "0x5f98",
		"blockHash": "0x30fe211d23791fc810abcc9997a76f5657b77c3d75d490feb72b871443f553f7",
		"blockNumber": "0x11d",
		"from": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
		"gas": "0x138080",
		"gasPrice": "0x5",
		"hash": "0x43439f12c70fcd32e5a4e8d76429a105308ba8ced9b10b7acfea266361278539",
		"input": "0xf3b2f10294cccc7a30bf688c060524dfd759fe2627ed3387bc94d0e89b32875f5a1d68ecbfb3995263adc3439bea01843b9aca00",
		"nonce": "0x3",
		"to": "0x00000000000000000000000000000000766f7465",
		"transactionIndex": "0x0",
		"value": "0x0"
	}
}
  • Parameter Description
baseGas          : The actual fuel value consumed by this transaction
blockHash        : Block hash
blockNumber      : Block height
from             : Transaction initiator
gas              : This transaction expects a given fuel value
gasPrice         : Actual fuel unit price for this transaction
hash             : Transaction hash
input            : Serialized data of transaction or contract data, please check the remarks
nonce            : Number of transaction records
to               : Fixed address
transactionIndex : Transaction number in the block
value            : Numerical value
  • 备注: 以转账方式二进行的转账input为空,即: "input":"" , 由转账方式二 可知,data的数据为空,所以此时input的数据也为空

brc_getTransactionByBlockNumberAndIndex : Query transaction information according to the specified block height and index Back Dir

  • Request
{"jsonrpc":"2.0","method":"brc_getTransactionByBlockNumberAndIndex","params":["947","0x0"],"id":17}

  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getTransactionByBlockNumberAndIndex","params":["947","0x0"],"id":17}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params : Array structure, parameter list
         > Array subscript 0: block height, decimal
         > Array subscript 1: Specify the transaction sequence number in the block, hexadecimal
  • Return result
{
	"id": 17,
	"jsonrpc": "2.0",
	"result": {
		"baseGas": "0x5f98",
		"blockHash": "0x30fe211d23791fc810abcc9997a76f5657b77c3d75d490feb72b871443f553f7",
		"blockNumber": "0x11d",
		"from": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
		"gas": "0x138080",
		"gasPrice": "0x5",
		"hash": "0x43439f12c70fcd32e5a4e8d76429a105308ba8ced9b10b7acfea266361278539",
		"input": "0xf3b2f10294cccc7a30bf688c060524dfd759fe2627ed3387bc94d0e89b32875f5a1d68ecbfb3995263adc3439bea01843b9aca00",
		"nonce": "0x3",
		"to": "0x00000000000000000000000000000000766f7465",
		"transactionIndex": "0x0",
		"value": "0x0"
	}
}
  • Parameter Description
baseGas          : The actual fuel value consumed by this transaction
blockHash        : Block hash
blockNumber      : Block height
from             : Transaction initiator
gas              : This transaction expects a given fuel value
gasPrice         : Actual fuel unit price for this transaction
hash             : Transaction hash
input            : Serialized data of transaction or contract data, please check the remarks
nonce            : Number of transaction records
to               : Fixed address
transactionIndex : Transaction number in the block
value		     : Numerical value
  • 备注: 以转账方式二进行的转账input为空,即: "input":"" , 由转账方式二 可知,data的数据为空,所以此时input的数据也为空

brc_getTransactionByHash : Query transaction information through transaction hash Back to Contents

  • Request
{"jsonrpc":"2.0","method":"brc_getTransactionByHash","params":["0xab45b5f8b7fc89bcd01dc7b84e90f14286ceafe169245034e0cf456dffee3fe1"],"id":17}
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getTransactionByHash","params":["0xab45b5f8b7fc89bcd01dc7b84e90f14286ceafe169245034e0cf456dffee3fe1"],"id":17}' http://127.0.0.1:8111
  • Parameter Description
method : Method name, such as:brc_getTransactionByHash
params : Array structure, parameter list
         > Array subscript 0: transaction hash, there is only one parameter by default
  • Return result
{
	"id": 17,
	"jsonrpc": "2.0",
	"result": {
		"baseGas": "0x5f98",
		"blockHash": "0x542e115ef0336eeaf3c3d5ea2d1909ff8b51dd33c6703c91507cab00b13426da",
		"blockNumber": "0x339",
		"from": "0xcccc7a30bf688c060524dfd759fe2627ed3387bc",
		"gas": "0x138080",
		"gasPrice": "0x5",
		"hash": "0x3c6d96f5fc5cb978e04684532ab9fbdea6e1a8d49f688be31d66f192520e2443",
		"input": "0xf3b2f10294cccc7a30bf688c060524dfd759fe2627ed3387bc94d0e89b32875f5a1d68ecbfb3995263adc3439bea01843b9aca00",
		"nonce": "0xd",
		"to": "0x00000000000000000000000000000000766f7465",
		"transactionIndex": "0x0",
		"value": "0x0"
	}
}
  • Parameter Description
baseGas          : The actual fuel value consumed by this transaction
blockHash        : Block hash
blockNumber      : Block height
from             : Transaction initiator
gas              : This transaction expects a given fuel value
gasPrice         : Actual fuel unit price for this transaction
hash             : Transaction hash
input		     : For serialized data of transactions or contracts, please see the notes
nonce            : Number of transaction records
to               : Fixed address
transactionIndex : Transaction number in the block
value		     : Numerical value
  • 备注: 以转账方式二进行的转账input为空,即: "input":"" , 由转账方式二 可知,data的数据为空,所以此时input的数据也为空

brc_getTransactionCount : Returns the number of transactions at the specified address 返回目录

  • Request
{"jsonrpc":"2.0","method":"brc_getTransactionCount","params":["cccc7a30bf688c060524dfd759fe2627ed3387bc", "latest"],"id":1}
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getTransactionCount","params":["cccc7a30bf688c060524dfd759fe2627ed3387bc", "latest"],"id":1}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params : 参数列表,数组结构
         > Array Table 0: Address to be queried
         > Array Table 1: Real block height, default latest
  • Return result
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": "0x9"
}
  • Parameter Description
result : Number of transactions at the specified address

brc_getUncleCountByBlockHash : Use the hash to specify the block to query the number of uncles in the block Back Dir

  • Request
{"jsonrpc":"2.0","method":"brc_getUncleCountByBlockHash","params":["0xff532cc5b85e45505c8e85ea29ef58265725a2aebba786bf44424b47a93c24ba"],"id":1}
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_getUncleCountByBlockHash","params":["0xff532cc5b85e45505c8e85ea29ef58265725a2aebba786bf44424b47a93c24ba"],"id":1}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params : Parameter list, 32 bytes, block hash
  • Return result
{
  "id": 1,
  "jsonrpc": "2.0",
  "result": "0x0"
}
  • Parameter Description
result : Returns the number of uncles in the specified block

brc_call : Contract related data query Back Dir

  • request
{
    "jsonrpc": "2.0",
    "method": "brc_call",
    "params": [
        {
            "from": "e79fead329b69540142fabd881099c04424cc49f",
            "to": "0x6bb313a31fb23dd97d73d02217af51a515db2f41",
            "data": "0x18160ddd",
            "chainid":"0x1"
        },
        "latest"
    ],
    "id": 1
}
  • 指令示例
curl -d '{"jsonrpc":"2.0","method":"brc_call","params":[{"from":"0xe79fead329b69540142fabd881099c04424cc49f","to":"0x6bb313a31fb23dd97d73d02217af51a515db2f41","data":"0x18160ddd", "chainid":"0x1"}, "latest"],"id":1}' http://127.0.0.1:8111
  • Instruction example
method : Method name
params : Parameter list, 32 bytes, block hash
         > from    : Call contract address
         > to      : Contract address
         > data    : To query the signature of the corresponding function function of the contract
         > chainid : The chainId of the chain, for example: the test net value is: 0x1, the main net value is: 0xb
  • Return result
{
	"id": 1,
	"jsonrpc": "2.0",
	"result": "0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000974657374546f6b656e0000000000000000000000000000000000000000000000"
}
  • Parameter Description
result : Contract query returns

brc_estimateGasUsed : Estimate the amount of gas to be paid for the transaction Back Dir

  • Explanation: This interface estimates the amount of gas that the transaction needs to pay, and then you can multiply this amount by the gasPrice you give, and you can get the processing fee you need to pay.
  • Request
{"jsonrpc":"2.0","method":"brc_estimateGasUsed","params":[{"from":"","to":"","value":"","data":""}],"id":17}
  • Instruction example
curl -d '{"jsonrpc":"2.0","method":"brc_estimateGasUsed","params":[{"from":"0x695193772208fb21b8cae0096ddea871d74e82cb","to":"0x00000000000000000000000000000000766f7465","value":"0x0","data":"0xf1b0ef0294695193772208fb21b8cae0096ddea871d74e82cb94e79fead329b69540142fabd881099c04424cc49f018201df"}],"id":17}' http://127.0.0.1:8111
  • Parameter Description
method : Method name
params :Parameter list, the data in "[]" is in json format
         > from  : Transaction origination address, or the address where the contract is deployed or executed
         > to    : (1) The general transaction is the system address, fixed at: 0x00000000000000000000000000000000766f7465;
                   (2) If it is a deployment contract, to is empty or 0x0000000000000000000000000000000000000000;
                   (3) If the contract is executed, to is the address of the contract
         > value : (1) Generally the default is 0x0;
                   (2) If it is a transfer with empty data, there is a transfer to the contract when the contract is deployed, and there is a transfer to the contract when the contract is executed, and value is the number of BRCs transferred
         > data  : Serialized data of transaction data
  • Return result
{
    "id": 17,
    "jsonrpc": "2.0",
    "result": {
        "estimateGasUsed": "0x5f50"
    }
}
  • Parameter Description
estimateGasUsed : Estimated payment amount of gas
  • Supplementary explanation

If the transfer is empty, the following instruction

 curl -d '{"jsonrpc":"2.0","method":"brc_estimateGasUsed","params":[{"from":"0x695193772208fb21b8cae0096ddea871d74e82cb","to":"0xe79fead329b69540142fabd881099c04424cc49f","value":"0x5f5e100","data":""}],"id":17}' http://127.0.0.1:8111 
  • Return result
{
    "id": 17,
    "jsonrpc": "2.0",
    "result": {
        "estimateGasUsed": "0x5208"
    }
}

Clone this wiki locally