Etherscan API Chinese documentation

Link to the original text of this article
Click here to get the Etherscan API Chinese document (full version).
The full content is better typesetting, and readers are recommended to read it.

Account

Account and address-related APIs, for interface parameter descriptions, please refer to the Etherscan API conventions , which are not described separately in the document.

Get a single account balance

 译者注:
    英文 `balance` 有人翻译为`金额`,译者习惯称为`余额`。
    账号和地址大部分也是指一个意思。

interface:

/api?module=account&action=balance&address=0x&tag=latest&apikey=YourApiKeyToken

return:

{
    
    
    status: "1",
    message: "OK",
    result: "40807178566070000000000"
}

illustrate:

The unit of the balance is the smallest unit wei, and more unit conversions can be read: Ether unit conversion

Request a sample URL , click to view the effect in the browser.

Get multiple account balances

interface:

/api?module=account&action=balancemulti&address=0xabc,0x63..,0x198..&tag=latest&apikey=YourApiKeyToken

Use ,to split addresses, and request up to 20 accounts at a time.

return:

{
    
    
status: "1",
message: "OK",
result: [
{
    
    
account: "0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a",
balance: "40807178566070000000000"
},
{
    
    
account: "0x63a9975ba31b0b9626b34300f7f627147df1f526",
balance: "332567136222827062478"
}
]
}

request sample URL

Get address (ordinary) transaction list

interface:

/api?module=account&action=txlist&address=&apikey=YourApiKeyToken

Optional parameters: startblock, endblock,sort

return:

{
    
    
	"status": "1",
	"message": "OK",
	"result": [{
    
    
		"blockNumber": "47884",
		"timeStamp": "1438947953",
		"hash": "0xad1c27dd8d0329dbc400021d7477b34ac41e84365bd54b45a4019a15deb10c0d",
		"nonce": "0",
		"blockHash": "0xf2988b9870e092f2898662ccdbc06e0e320a08139e9c6be98d0ce372f8611f22",
		"transactionIndex": "0",
		"from": "0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a",
		"to": "0x2910543af39aba0cd09dbb2d50200b3e800a63d2",
		"value": "5000000000000000000",
		"gas": "23000",
		"gasPrice": "400000000000",
		"isError": "0",
		"txreceipt_status": "",
		"input": "0x454e34354139455138",
		"contractAddress": "",
		"cumulativeGasUsed": "21612",
		"gasUsed": "21612",
		"confirmations": "7525550"
	}]
}

illustrate:

isError : 0=Yes, 1=Error
Return up to the latest 10,000 transactions

For the keywords appearing in the returned field, please refer to Ethereum Design and Implementation - Terminology .

request sample URL

Pagination can also be used. For parameter descriptions, please refer to the Etherscan API convention , paging request sample URL

Click to get Etherscan API Chinese documentation (full version)

Schematic diagram:
insert image description here

Related document recommendation:

Solidity Chinese Documentation (full version)
ethers.js Chinese Documentation (full version)
Web3.js Chinese Documentation (full version)
Truffle Chinese Documentation (full version)

Guess you like

Origin blog.csdn.net/xilibi2003/article/details/90577441