Hướng dẫn biopython get chain id - biopython lấy id chuỗi

Web3.eth¶

Gói Web3-eth cho phép bạn tương tác với các hợp đồng thông minh Ethereum và Ethereum.web3-eth package allows you to interact with an Ethereum blockchain and Ethereum smart contracts.

Show

Nội phân Chính showShow

  • Lưu ý trên địa chỉ tổng kiểm tra Jo
  • đặt mua¶
  • setprovider¶
  • Thông số¶
  • nhà cung cấp
  • Cấu hình¶
  • đã cho
  • nhà cung cấp hiện tại¶
  • Batchrequest¶
  • Thông số¶
  • Thông số¶
  • nhà cung cấp
  • Cấu hình¶
  • đã cho
  • nhà cung cấp hiện tại¶
  • Batchrequest¶
  • tài khoản mặc định¶
  • DefaultBlock¶
  • defaulthardfork¶
  • DefaultChain¶
  • DefaultCommon¶
  • Giao dịchBlockTimeout¶
  • Giao dịchConf xác nhậnBlocks¶
  • Giao dịchPollingTimeout¶
  • HandleRevert¶
  • Maxlistenerswarningthreshold
  • getProtocolversion¶
  • Issyncingcing¶
  • getcoinbase¶
  • Thông số¶
  • nhà cung cấp
  • Thông số¶
  • Thông số¶
  • Thông số¶
  • nhà cung cấp
  • Thông số¶
  • nhà cung cấp
  • Thông số¶
  • Thông số¶
  • nhà cung cấp
  • Thông số¶
  • nhà cung cấp
  • Thông số¶
  • nhà cung cấp
  • Thông số¶
  • nhà cung cấp
  • Thông số¶
  • nhà cung cấp
  • Thông số¶
  • nhà cung cấp
  • Thông số¶
  • nhà cung cấp
  • Thông số¶
  • Thông số¶
  • nhà cung cấp
  • Thông số¶
  • Thông số¶
  • nhà cung cấp
  • Thông số¶
  • nhà cung cấp
  • Thông số¶
  • Thông số¶
  • Cấu hình¶
  • Thông số¶
  • đã cho
  • Thông số¶
  • nhà cung cấp hiện tại¶
  • Batchrequest¶
  • Thông số¶
  • tài khoản mặc định¶

DefaultBlock¶ Eth = require('web3-eth'); // "Eth.providers.givenProvider" will be set if in an Ethereum supported browser. var eth = new Eth(Eth.givenProvider || 'ws://some.local-or-remote.node:8546'); // or using the web3 umbrella package var Web3 = require('web3'); var web3 = new Web3(Web3.givenProvider || 'ws://some.local-or-remote.node:8546'); // -> web3.eth

Lưu ý trên địa chỉ tổng kiểm tra Jo

defaulthardfork¶

DefaultChain¶

web3.eth.getAccounts(console.log);>["0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe","0x85F43D8a49eeB85d32Cf465507DD71d507100C1d"].eth.getAccounts(console.log); > ["0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe" ,"0x85F43D8a49eeB85d32Cf465507DD71d507100C1d"]


đặt mua¶

DefaultCommon¶web3.eth.subscribe see the Subscribe reference documentation.


Giao dịchBlockTimeout¶

Giao dịchConf xác nhậnBlocks¶web3.eth.Contract see the Contract reference documentation.


Giao dịchPollingTimeout¶

HandleRevert¶web3.eth.Iban see the Iban reference documentation.


Maxlistenerswarningthreshold

getProtocolversion¶web3.eth.personal see the personal reference documentation.


Issyncingcing¶

getcoinbase¶web3.eth.accounts see the accounts reference documentation.


gethashrate¶

Getgasprice¶web3.eth.ens see the ENS reference documentation.


GetAccounts¶

getblocknumber¶web3.eth.abi see the ABI reference documentation.


Getbalance¶

getstorageat¶web3.eth.net see the net reference documentation.


setprovider¶

web3.setProvider(myProvider)web3.eth.setProvider(myProvider)web3.shh.setProvider(myProvider)web3.bzz.setProvider(myProvider)....setProvider(myProvider) web3.eth.setProvider(myProvider) web3.shh.setProvider(myProvider) web3.bzz.setProvider(myProvider) ...

getBlockTransactionCount¶

getblockunclecount¶

gettransaction¶web3 it will also set the provider for all sub modules web3.eth, web3.shh, etc. EXCEPT web3.bzz which needs a separate provider at all times.

Thông số¶

  1. getPendingTransactions¶ - myProvider: a valid provider.

DefaultChain¶

DefaultCommon¶ Web3 = require('web3'); var web3 = new Web3('http://localhost:8545'); // or var web3 = new Web3(new Web3.providers.HttpProvider('http://localhost:8545')); // change provider web3.setProvider('ws://localhost:8546'); // or web3.setProvider(new Web3.providers.WebsocketProvider('ws://localhost:8546')); // Using the IPC provider in node.js var net = require('net'); var web3 = new Web3('/Users/myuser/Library/Ethereum/geth.ipc', net); // mac os path // or var web3 = new Web3(new Web3.providers.IpcProvider('/Users/myuser/Library/Ethereum/geth.ipc', net)); // mac os path // on windows the path is: "\\\\.\\pipe\\geth.ipc" // on linux the path is: "/users/myuser/.ethereum/geth.ipc"


nhà cung cấp

web3.providersweb3.eth.providersweb3.shh.providersweb3.bzz.providers....providers web3.eth.providers web3.shh.providers web3.bzz.providers ...

Giao dịchBlockTimeout¶providers.

Giao dịchConf xác nhậnBlocks¶

Giao dịchPollingTimeout¶ with the following providers:

  • HandleRevert¶ - HttpProvider: The HTTP provider is deprecated, as it wont work for subscriptions.
  • Maxlistenerswarningthreshold - WebsocketProvider: The Websocket provider is the standard for usage in legacy browsers.
  • getProtocolversion¶ - IpcProvider: The IPC provider is used node.js dapps when running a local node. Gives the most secure connection.

DefaultChain¶

DefaultCommon¶ Web3 = require('web3'); // use the given Provider, e.g in Mist, or instantiate a new websocket provider var web3 = new Web3(Web3.givenProvider || 'ws://remotenode.com:8546'); // or var web3 = new Web3(Web3.givenProvider || new Web3.providers.WebsocketProvider('ws://remotenode.com:8546')); // Using the IPC provider in node.js var net = require('net'); var web3 = new Web3('/Users/myuser/Library/Ethereum/geth.ipc', net); // mac os path // or var web3 = new Web3(new Web3.providers.IpcProvider('/Users/myuser/Library/Ethereum/geth.ipc', net)); // mac os path // on windows the path is: "\\\\.\\pipe\\geth.ipc" // on linux the path is: "/users/myuser/.ethereum/geth.ipc"

Cấu hình¶

// ==== // http // ==== varweb3httpprovider = Yêu cầu ('Web3-Providers-http'); : 'Truy cập kiểm soát-cho phép 'http: // localhost: 8545', tùy chọn); // ========== // WebSockets // ========= '); varoptions = {timeout: 30000, // ms // hữu ích cho các url được xác nhận // Hữu ích nếu các yêu cầu là LargemaxReceIdFramesize: 100000000, // BYTE - Mặc định: 1MibMaxReceIdingMessagesize: 100000000, // BYTE - Mặc định: 8Mib // hữu ích để giữ cho kết nối còn sống: True ReconnectionReConnect: {auto: true, trễ: 5000, // msmaxattems: 5, ontimeout: false}}; varws = newWeb3wsProvider ('ws: // localhost: 8546', tùy chọn); // Http // ==== var Web3HttpProvider = require('web3-providers-http'); var options = { keepAlive: true, withCredentials: false, timeout: 20000, // ms headers: [ { name: 'Access-Control-Allow-Origin', value: '*' }, { ... } ], agent: { http: http.Agent(...), baseUrl: '' } }; var provider = new Web3HttpProvider('http://localhost:8545', options); // ========== // Websockets // ========== var Web3WsProvider = require('web3-providers-ws'); var options = { timeout: 30000, // ms // Useful for credentialed urls, e.g: ws://username:[email protected]:8546 headers: { authorization: 'Basic username:password' }, clientConfig: { // Useful if requests are large maxReceivedFrameSize: 100000000, // bytes - default: 1MiB maxReceivedMessageSize: 100000000, // bytes - default: 8MiB // Useful to keep a connection alive keepalive: true, keepaliveInterval: 60000 // ms }, // Enable auto reconnection reconnect: { auto: true, delay: 5000, // ms maxAttempts: 5, onTimeout: false } }; var ws = new Web3WsProvider('ws://localhost:8546', options);

Thông tin thêm cho các mô -đun nhà cung cấp HTTP và WebSocket có thể được tìm thấy ở đây:

  • Httpprovider
  • WebSocketProvider


đã cho

web3.givenProviderweb3.eth.givenProviderweb3.shh.givenProviderweb3.bzz.givenProvider....givenProvider web3.eth.givenProvider web3.shh.givenProvider web3.bzz.givenProvider ...

Khi sử dụng Web3.js trong trình duyệt tương thích Ethereum, nó sẽ được đặt với nhà cung cấp gốc hiện tại theo trình duyệt đó. Sẽ trả lại nhà cung cấp đã cho bởi môi trường (trình duyệt), nếu không thì không.null.

Trở lại

Đối tượng: Bộ cung cấp đã cho hoặc null;: The given provider set or null;

Thí dụ¶


nhà cung cấp hiện tại¶

web3.currentProviderweb3.eth.currentProviderweb3.shh.currentProviderweb3.bzz.currentProvider....currentProvider web3.eth.currentProvider web3.shh.currentProvider web3.bzz.currentProvider ...

Sẽ trả lại nhà cung cấp hiện tại, nếu không thì null.null.

Trở lại

Đối tượng: Bộ cung cấp đã cho hoặc null;: The current provider set or null.

Thí dụ¶


nhà cung cấp hiện tại¶

newweb3.BatchRequest()newweb3.eth.BatchRequest()newweb3.shh.BatchRequest()newweb3.bzz.BatchRequest() web3.BatchRequest() new web3.eth.BatchRequest() new web3.shh.BatchRequest() new web3.bzz.BatchRequest()

Sẽ trả lại nhà cung cấp hiện tại, nếu không thì null.

Trở lại

Đối tượng: Bộ cung cấp đã cho hoặc null;: With the following methods:

  • Thí dụ¶: To add a request object to the batch call.
  • nhà cung cấp hiện tại¶: Will execute the batch request.

Thí dụ¶

varcontract=newweb3.eth.Contract(abi,address);varbatch=newweb3.BatchRequest();batch.add(web3.eth.getBalance.request('0x0000000000000000000000000000000000000000','latest',callback));batch.add(contract.methods.balance(address).call.request({from:'0x0000000000000000000000000000000000000000'},callback2));batch.execute(); contract = new web3.eth.Contract(abi, address); var batch = new web3.BatchRequest(); batch.add(web3.eth.getBalance.request('0x0000000000000000000000000000000000000000', 'latest', callback)); batch.add(contract.methods.balance(address).call.request({from: '0x0000000000000000000000000000000000000000'}, callback2)); batch.execute();


nhà cung cấp hiện tại¶

web3.extend(methods)web3.eth.extend(methods)web3.shh.extend(methods)web3.bzz.extend(methods)....extend(methods) web3.eth.extend(methods) web3.shh.extend(methods) web3.bzz.extend(methods) ...

Sẽ trả lại nhà cung cấp hiện tại, nếu không thì null.

Đối tượng: Bộ cung cấp hiện tại hoặc null.

Batchrequest¶*.extend.formatters as additional formatter functions to be used for input and output formatting. Please see the source file for function details.

Lớp để tạo và thực hiện các yêu cầu hàng loạt.

  1. Đối tượng: với các phương pháp sau: - Object: Extension object with array of methods description objects as follows:
    • Thêm (Yêu cầu): Để thêm một đối tượng yêu cầu vào cuộc gọi hàng loạt. - String: (optional) The name of the property to add to the module. If no property is set it will be added to the module directly.
    • EXECUTE (): Sẽ thực hiện yêu cầu hàng loạt. - Array: The array of method descriptions:
      • gia hạn¶ - String: Name of the method to add.
      • Cho phép mở rộng các mô -đun Web3. - String: The RPC method name.
      • Ghi chú - Number: (optional) The number of parameters for that function. Default 0.
      • Bạn cũng có *.extend.formatters như các hàm định dạng bổ sung sẽ được sử dụng cho định dạng đầu vào và đầu ra. Vui lòng xem tệp nguồn để biết chi tiết chức năng. - Array: (optional) Array of inputformatter functions. Each array item responds to a function parameter, so if you want some parameters not to be formatted, add a null instead.
      • Thông số¶ - ``Function: (optional) Can be used to format the output of the method.

Trở lại

Đối tượng: Bộ cung cấp đã cho hoặc null;: The extended module.

Thí dụ¶

web3.extend({property:'myModule',methods:[{name:'getBalance',call:'eth_getBalance',params:2,inputFormatter:[web3.extend.formatters.inputAddressFormatter,web3.extend.formatters.inputDefaultBlockNumberFormatter],outputFormatter:web3.utils.hexToNumberString},{name:'getGasPriceSuperFunction',call:'eth_gasPriceSuper',params:2,inputFormatter:[null,web3.utils.numberToHex]}]});web3.extend({methods:[{name:'directCall',call:'eth_callForFun',}]});console.log(web3);>Web3{myModule:{getBalance:function(){},getGasPriceSuperFunction:function(){}},directCall:function(){},eth:Eth{...},bzz:Bzz{...},...}.extend({ property: 'myModule', methods: [{ name: 'getBalance', call: 'eth_getBalance', params: 2, inputFormatter: [web3.extend.formatters.inputAddressFormatter, web3.extend.formatters.inputDefaultBlockNumberFormatter], outputFormatter: web3.utils.hexToNumberString },{ name: 'getGasPriceSuperFunction', call: 'eth_gasPriceSuper', params: 2, inputFormatter: [null, web3.utils.numberToHex] }] }); web3.extend({ methods: [{ name: 'directCall', call: 'eth_callForFun', }] }); console.log(web3); > Web3 { myModule: { getBalance: function(){}, getGasPriceSuperFunction: function(){} }, directCall: function(){}, eth: Eth {...}, bzz: Bzz {...}, ... }



nhà cung cấp hiện tại¶

Sẽ trả lại nhà cung cấp hiện tại, nếu không thì null."from" property, if no "from" property is specified in for the following methods:

  • web3.eth.sendTransaction()
  • web3.eth.call()
  • Đối tượng: Bộ cung cấp hiện tại hoặc null.
  • Batchrequest¶

Lớp để tạo và thực hiện các yêu cầu hàng loạt.

Đối tượng: với các phương pháp sau: - 20 Bytes: Any ethereum address. You should have the private key for that address in your node or keystore. (Default is undefined)

Thí dụ¶

nhà cung cấp hiện tại¶.eth.defaultAccount; > undefined // set the default account web3.eth.defaultAccount = '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe';


DefaultBlock¶

Khối mặc định được sử dụng cho một số phương thức nhất định. Bạn có thể ghi đè nó bằng cách chuyển trong DefaultBlock dưới dạng tham số cuối cùng. Giá trị mặc định là "mới nhất"."latest".

  • web3.eth.getBalance()
  • web3.eth.getCode()
  • web3.eth.getTransactionCount()
  • web3.eth.getStorageAt()
  • web3.eth.call()
  • Web3.eth.Contract () mới

Tài sản¶

Các tham số khối mặc định có thể là một trong những điều sau đây:

  • Số | BN | Bignumber: Số khối: A block number
  • "sớm nhất" - chuỗi: khối Genesis - String: The genesis block
  • "Mới nhất" - Chuỗi: Khối mới nhất (đầu hiện tại của blockchain) - String: The latest block (current head of the blockchain)
  • "Đang chờ" - Chuỗi: Khối hiện đang được khai thác (bao gồm cả giao dịch đang chờ xử lý) - String: The currently mined block (including pending transactions)

Mặc định là "mới nhất""latest"

Thí dụ¶

Web3.eth.DefaultBlock;> "mới nhất" // Đặt blockweb3.eth.defaultblock = 231;.eth.defaultBlock; > "latest" // set the default block web3.eth.defaultBlock = 231;

defaulthardfork¶

Thuộc tính HardFork mặc định được sử dụng để ký giao dịch tại địa phương.

Tài sản¶

Các tham số khối mặc định có thể là một trong những điều sau đây:

  • Số | BN | Bignumber: Số khối - String
  • "sớm nhất" - chuỗi: khối Genesis - String
  • "Mới nhất" - Chuỗi: Khối mới nhất (đầu hiện tại của blockchain) - String
  • "Đang chờ" - Chuỗi: Khối hiện đang được khai thác (bao gồm cả giao dịch đang chờ xử lý) - String
  • Mặc định là "mới nhất" - String
  • Thí dụ¶ - String
  • Web3.eth.DefaultBlock;> "mới nhất" // Đặt blockweb3.eth.defaultblock = 231; - String
  • defaulthardfork¶ - String
  • Thuộc tính HardFork mặc định được sử dụng để ký giao dịch tại địa phương. - String

Thuộc tính HardFork mặc định có thể là một trong những điều sau đây:"petersburg"

Thí dụ¶

Web3.eth.DefaultBlock;> "mới nhất" // Đặt blockweb3.eth.defaultblock = 231;.eth.defaultHardfork; > "petersburg" // set the default block web3.eth.defaultHardfork = 'istanbul';

defaulthardfork¶

Thuộc tính HardFork mặc định được sử dụng để ký giao dịch tại địa phương.

Tài sản¶

Các tham số khối mặc định có thể là một trong những điều sau đây:

  • Số | BN | Bignumber: Số khối - String
  • "sớm nhất" - chuỗi: khối Genesis - String
  • "Mới nhất" - Chuỗi: Khối mới nhất (đầu hiện tại của blockchain) - String
  • "Đang chờ" - Chuỗi: Khối hiện đang được khai thác (bao gồm cả giao dịch đang chờ xử lý) - String
  • Mặc định là "mới nhất" - String

Thí dụ¶"mainnet"

Thí dụ¶

Web3.eth.DefaultBlock;> "mới nhất" // Đặt blockweb3.eth.defaultblock = 231;.eth.defaultChain; > "mainnet" // set the default chain web3.eth.defaultChain = 'goerli';

defaulthardfork¶

Thuộc tính HardFork mặc định được sử dụng để ký giao dịch tại địa phương.

Tài sản¶

Thuộc tính HardFork mặc định có thể là một trong những điều sau đây:Common object:

  • "Chainstart" - Chuỗi - Object: The custom chain properties
    • "Homestead" - Chuỗi - string: (optional) The name of the chain
    • "DAO" - Chuỗi - number: Network ID of the custom chain
    • "TangerineWhistle" - Chuỗi - number: Chain ID of the custom chain
  • "PUTOUSDRAGON" - Chuỗi - string: (optional) mainnet, goerli, kovan, rinkeby, or ropsten
  • "Byzantium" - Chuỗi - string: (optional) chainstart, homestead, dao, tangerineWhistle, spuriousDragon, byzantium, constantinople, petersburg, or istanbul

"Constantinople" - Chuỗiundefined.

Thí dụ¶

Web3.eth.DefaultBlock;> "mới nhất" // Đặt blockweb3.eth.defaultblock = 231;.eth.defaultCommon; > {customChain: {name: 'custom-network', chainId: 1, networkId: 1}, baseChain: 'mainnet', hardfork: 'petersburg'} // set the default common web3.eth.defaultCommon = {customChain: {name: 'custom-network', chainId: 1, networkId: 1}, baseChain: 'mainnet', hardfork: 'petersburg'};


defaulthardfork¶

web3.eth.transactionBlockTimeout.eth.transactionBlockTimeout

Thuộc tính HardFork mặc định được sử dụng để ký giao dịch tại địa phương.transactionBlockTimeout is used over socket-based connections. This option defines the amount of new blocks it should wait until the first confirmation happens, otherwise the PromiEvent rejects with a timeout error.

Thuộc tính HardFork mặc định có thể là một trong những điều sau đây:

"Chainstart" - Chuỗi: The current value of transactionBlockTimeout (default: 50)

Thí dụ¶

Web3.eth.DefaultBlock;> "mới nhất" // Đặt blockweb3.eth.defaultblock = 231;.eth.transactionBlockTimeout; > 50 // set the transaction block timeout web3.eth.transactionBlockTimeout = 100;


defaulthardfork¶

web3.eth.transactionConfirmationBlocks.eth.transactionConfirmationBlocks

Thuộc tính HardFork mặc định được sử dụng để ký giao dịch tại địa phương.

Thuộc tính HardFork mặc định có thể là một trong những điều sau đây:

"Chainstart" - Chuỗi: The current value of transactionConfirmationBlocks (default: 24)

Thí dụ¶

Web3.eth.DefaultBlock;> "mới nhất" // Đặt blockweb3.eth.defaultblock = 231;.eth.transactionConfirmationBlocks; > 24 // set the transaction confirmations blocks web3.eth.transactionConfirmationBlocks = 50;


defaulthardfork¶

web3.eth.transactionPollingTimeout.eth.transactionPollingTimeout

Thuộc tính HardFork mặc định được sử dụng để ký giao dịch tại địa phương.transactionPollingTimeout is used over HTTP connections. This option defines the number of seconds Web3 will wait for a receipt which confirms that a transaction was mined by the network. Note: If this method times out, the transaction may still be pending.

Thuộc tính HardFork mặc định có thể là một trong những điều sau đây:

"Chainstart" - Chuỗi: The current value of transactionPollingTimeout (default: 750)

Thí dụ¶

Web3.eth.DefaultBlock;> "mới nhất" // Đặt blockweb3.eth.defaultblock = 231;.eth.transactionPollingTimeout; > 750 // set the transaction polling timeout web3.eth.transactionPollingTimeout = 1000;


defaulthardfork¶

Thuộc tính HardFork mặc định được sử dụng để ký giao dịch tại địa phương.handleRevert options property defaults to false and returns the revert reason string if enabled for the following methods:

  • web3.eth.call()
  • web3.eth.sendTransaction()
  • contract.methods.myMethod().send()
  • contract.methods.myMethod().call()

Thuộc tính HardFork mặc định có thể là một trong những điều sau đây:

"Chainstart" - Chuỗi

Thuộc tính HardFork mặc định có thể là một trong những điều sau đây:

"Chainstart" - Chuỗi: The current value of handleRevert (default: false)

Thí dụ¶

Web3.eth.DefaultBlock;> "mới nhất" // Đặt blockweb3.eth.defaultblock = 231;.eth.handlRevert; > false // turn revert handling on web3.eth.handleRevert = true;


defaulthardfork¶

web3.eth.maxListenersWarningThreshold.eth.maxListenersWarningThreshold

Thuộc tính HardFork mặc định được sử dụng để ký giao dịch tại địa phương.setProvider on large numbers of Web3 contract objects.

Trở lại

Số: Giá trị hiện tại của MaxListenerSwarningThold (mặc định: 100): The current value of maxListenersWarningThreshold (default: 100)

Thí dụ¶

Web3.eth.MaxListenerSwarningThreshold;> 100 // Đặt ngưỡng người nghe tối đa Ngưỡng cảnh báo WELL.eth.maxListenersWarningThreshold; > 100 // set the max listeners warning threshold web3.eth.maxListenersWarningThreshold = 200;


getProtocolversion¶

web3.eth.getProtocolVersion([callback]).eth.getProtocolVersion([callback])

Trả về phiên bản giao thức Ethereum của nút.

Trở lại

Lời hứa trả về chuỗi: Phiên bản giao thức. returns String: the protocol version.

Thí dụ¶

web3.eth.getProtocolVersion().then(console.log);>"63".eth.getProtocolVersion() .then(console.log); > "63"


Web3.eth.MaxListenerSwarningThreshold;> 100 // Đặt ngưỡng người nghe tối đa Ngưỡng cảnh báo WELL

web3.eth.isSyncing([callback]).eth.isSyncing([callback])

getProtocolversion¶false.

Trở lại

Trả về phiên bản giao thức Ethereum của nút. returns Object|Boolean - A sync object when the node is currently syncing or false:

  • Lời hứa trả về chuỗi: Phiên bản giao thức. - Number: The block number where the sync started.
  • Issyncingcing¶ - Number: The block number where the node is currently synced to.
  • Kiểm tra xem nút hiện đang đồng bộ hóa và trả về đối tượng đồng bộ hóa hay sai. - Number: The estimated block number to sync to.
  • Promise trả về đối tượng | Boolean - một đối tượng đồng bộ khi nút hiện đang đồng bộ hóa hoặc sai: - Number: The number of estimated states to download.
  • Bắt đầu - Số: Số khối nơi đồng bộ hóa bắt đầu. - Number: The number of already downloaded states.

Thí dụ¶

web3.eth.isSyncing().then(console.log);>{startingBlock:100,currentBlock:312,highestBlock:512,knownStates:234566,pulledStates:123455}.eth.isSyncing() .then(console.log); > { startingBlock: 100, currentBlock: 312, highestBlock: 512, knownStates: 234566, pulledStates: 123455 }


Web3.eth.MaxListenerSwarningThreshold;> 100 // Đặt ngưỡng người nghe tối đa Ngưỡng cảnh báo WELL

getProtocolversion¶

Trở lại

Trả về phiên bản giao thức Ethereum của nút. returns String - bytes 20: The coinbase address set in the node for mining rewards.

Thí dụ¶

web3.eth.getCoinbase().then(console.log);>"0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe".eth.getCoinbase() .then(console.log); > "0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe"


Web3.eth.MaxListenerSwarningThreshold;> 100 // Đặt ngưỡng người nghe tối đa Ngưỡng cảnh báo WELL

web3.eth.isMining([callback]).eth.isMining([callback])

getProtocolversion¶

Trở lại

Trả về phiên bản giao thức Ethereum của nút. returns Boolean: true if the node is mining, otherwise false.

Thí dụ¶

web3.eth.isMining().then(console.log);>true.eth.isMining() .then(console.log); > true


Web3.eth.MaxListenerSwarningThreshold;> 100 // Đặt ngưỡng người nghe tối đa Ngưỡng cảnh báo WELL

web3.eth.getHashrate([callback]).eth.getHashrate([callback])

getProtocolversion¶

Trở lại

Trả về phiên bản giao thức Ethereum của nút. returns Number: Number of hashes per second.

Thí dụ¶

web3.eth.getHashrate().then(console.log);>493736.eth.getHashrate() .then(console.log); > 493736


Web3.eth.MaxListenerSwarningThreshold;> 100 // Đặt ngưỡng người nghe tối đa Ngưỡng cảnh báo WELL

web3.eth.getGasPrice([callback]).eth.getGasPrice([callback])

getProtocolversion¶

Trở lại

Trả về phiên bản giao thức Ethereum của nút. returns String - Number string of the current gas price in wei.

Lời hứa trả về chuỗi: Phiên bản giao thức.A note on dealing with big numbers in JavaScript.

Thí dụ¶

web3.eth.getGasPrice().then(console.log);>"20000000000".eth.getGasPrice() .then(console.log); > "20000000000"


Web3.eth.MaxListenerSwarningThreshold;> 100 // Đặt ngưỡng người nghe tối đa Ngưỡng cảnh báo WELL

web3.eth.getAccounts([callback]).eth.getAccounts([callback])

getProtocolversion¶

Trở lại

Trả về phiên bản giao thức Ethereum của nút. returns Array - An array of addresses controlled by node.

Thí dụ¶

web3.eth.getAccounts().then(console.log);>["0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe","0xDCc6960376d6C6dEa93647383FfB245CfCed97Cf"].eth.getAccounts() .then(console.log); > ["0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe", "0xDCc6960376d6C6dEa93647383FfB245CfCed97Cf"]


Web3.eth.MaxListenerSwarningThreshold;> 100 // Đặt ngưỡng người nghe tối đa Ngưỡng cảnh báo WELL

web3.eth.getBlockNumber([callback]).eth.getBlockNumber([callback])

getProtocolversion¶

Trở lại

Trả về phiên bản giao thức Ethereum của nút. returns Number - The number of the most recent block.

Thí dụ¶

web3.eth.getBlockNumber().then(console.log);>2744.eth.getBlockNumber() .then(console.log); > 2744


Web3.eth.MaxListenerSwarningThreshold;> 100 // Đặt ngưỡng người nghe tối đa Ngưỡng cảnh báo WELL

web3.eth.getBalance(address[,defaultBlock][,callback]).eth.getBalance(address [, defaultBlock] [, callback])

getProtocolversion¶

Trả về phiên bản giao thức Ethereum của nút.

  1. Lời hứa trả về chuỗi: Phiên bản giao thức. - The address to get the balance of.
  2. Issyncingcing¶ - (optional) If you pass this parameter it will not use the default block set with web3.eth.defaultBlock. Pre-defined block numbers as "earliest", "latest" and "pending" can also be used.
  3. Kiểm tra xem nút hiện đang đồng bộ hóa và trả về đối tượng đồng bộ hóa hay sai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Promise trả về đối tượng | Boolean - một đối tượng đồng bộ khi nút hiện đang đồng bộ hóa hoặc sai: returns String - The current balance for the given address in wei.

Lời hứa trả về chuỗi: Phiên bản giao thức.A note on dealing with big numbers in JavaScript.

Thí dụ¶

web3.eth.getBalance("0x407d73d8a49eeb85d32cf465507dd71d507100c1").then(console.log);>"1000000000000".eth.getBalance("0x407d73d8a49eeb85d32cf465507dd71d507100c1") .then(console.log); > "1000000000000"


Web3.eth.MaxListenerSwarningThreshold;> 100 // Đặt ngưỡng người nghe tối đa Ngưỡng cảnh báo WELL

web3.eth.getStorageAt(address,position[,defaultBlock][,callback]).eth.getStorageAt(address, position [, defaultBlock] [, callback])

getProtocolversion¶

Trả về phiên bản giao thức Ethereum của nút.

  1. Lời hứa trả về chuỗi: Phiên bản giao thức. - The address to get the storage from.
  2. Issyncingcing¶ - The index position of the storage.
  3. Issyncingcing¶ - (optional) If you pass this parameter it will not use the default block set with web3.eth.defaultBlock. Pre-defined block numbers as "earliest", "latest" and "pending" can also be used.
  4. Kiểm tra xem nút hiện đang đồng bộ hóa và trả về đối tượng đồng bộ hóa hay sai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Promise trả về đối tượng | Boolean - một đối tượng đồng bộ khi nút hiện đang đồng bộ hóa hoặc sai: returns String - The value in storage at the given position.

Thí dụ¶

web3.eth.getStorageAt("0x407d73d8a49eeb85d32cf465507dd71d507100c1",0).then(console.log);>"0x033456732123ffff2342342dd12342434324234234fd234fd23fd4f23d4234".eth.getStorageAt("0x407d73d8a49eeb85d32cf465507dd71d507100c1", 0) .then(console.log); > "0x033456732123ffff2342342dd12342434324234234fd234fd23fd4f23d4234"


Web3.eth.MaxListenerSwarningThreshold;> 100 // Đặt ngưỡng người nghe tối đa Ngưỡng cảnh báo WELL

web3.eth.getCode(address[,defaultBlock][,callback]).eth.getCode(address [, defaultBlock] [, callback])

getProtocolversion¶

Trả về phiên bản giao thức Ethereum của nút.

  1. Lời hứa trả về chuỗi: Phiên bản giao thức. - The address to get the code from.
  2. Issyncingcing¶ - (optional) If you pass this parameter it will not use the default block set with web3.eth.defaultBlock. Pre-defined block numbers as "earliest", "latest" and "pending" can also be used.
  3. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Promise Trả về chuỗi - Dữ liệu tại địa chỉ địa chỉ đã cho. returns String - The data at given address address.

Thí dụ¶

web3.eth.getCode("0xd5677cf67b5aa051bb40496e68ad359eb97cfbf8").then(console.log);>"0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056".eth.getCode("0xd5677cf67b5aa051bb40496e68ad359eb97cfbf8") .then(console.log); > "0x600160008035811a818181146012578301005b601b6001356025565b8060005260206000f25b600060078202905091905056"


getblock¶

web3.eth.getBlock(blockHashOrBlockNumber[,returnTransactionObjects][,callback]).eth.getBlock(blockHashOrBlockNumber [, returnTransactionObjects] [, callback])

Trả về một khối khớp với số khối hoặc băm khối.

Thông số¶

  1. Chuỗi | Số | Bn | Bignumber - Số khối hoặc khối băm. Hoặc chuỗi "sớm nhất", "mới nhất" hoặc "đang chờ xử lý" như trong tham số khối mặc định. - The block number or block hash. Or the string "earliest", "latest" or "pending" as in the default block parameter.
  2. Boolean - (Tùy chọn, mặc định sai) Nếu được chỉ định là True, khối được trả về sẽ chứa tất cả các giao dịch dưới dạng đối tượng. Nếu sai, nó sẽ chỉ chứa các băm giao dịch. - (optional, default false) If specified true, the returned block will contain all transactions as objects. If false it will only contains the transaction hashes.
  3. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Promise Trả về chuỗi - Dữ liệu tại địa chỉ địa chỉ đã cho. returns Object - The block object:

  • Thí dụ¶ - Number: The block number. null if a pending block.
  • getblock¶ 32 Bytes - String: Hash of the block. null if a pending block.
  • Trả về một khối khớp với số khối hoặc băm khối. 32 Bytes - String: Hash of the parent block.
  • Thông số¶ 8 Bytes - String: Hash of the generated proof-of-work. null if a pending block.
  • Chuỗi | Số | Bn | Bignumber - Số khối hoặc khối băm. Hoặc chuỗi "sớm nhất", "mới nhất" hoặc "đang chờ xử lý" như trong tham số khối mặc định. 32 Bytes - String: SHA3 of the uncles data in the block.
  • Boolean - (Tùy chọn, mặc định sai) Nếu được chỉ định là True, khối được trả về sẽ chứa tất cả các giao dịch dưới dạng đối tượng. Nếu sai, nó sẽ chỉ chứa các băm giao dịch. 256 Bytes - String: The bloom filter for the logs of the block. null if a pending block.
  • Promise trả về đối tượng - đối tượng khối: 32 Bytes - String: The root of the transaction trie of the block.
  • Số - Số: Số khối. null nếu một khối đang chờ xử lý. 32 Bytes - String: The root of the final state trie of the block.
  • Hash 32 byte - Chuỗi: Hash của khối. null nếu một khối đang chờ xử lý. - String: The address of the beneficiary to whom the mining rewards were given.
  • Parenthash 32 byte - Chuỗi: Hash của khối cha. - String: Integer of the difficulty for this block.
  • Nonce 8 byte-Chuỗi: băm của bằng chứng được tạo ra. null nếu một khối đang chờ xử lý. - String: Integer of the total difficulty of the chain until this block.
  • SHA3UNCLES 32 BYTE - Chuỗi: SHA3 của dữ liệu chú trong khối. - String: The extra data field of this block.
  • LogSbloom 256 Byte - Chuỗi: Bộ lọc Bloom cho các bản ghi của khối. null nếu một khối đang chờ xử lý. - Number: Integer the size of this block in bytes.
  • Giao dịch 32 byte - Chuỗi: Root của Trie giao dịch của khối. - Number: The maximum gas allowed in this block.
  • Stateroot 32 byte - Chuỗi: gốc của Trie trạng thái cuối cùng của khối. - Number: The total used gas by all transactions in this block.
  • Miner - Chuỗi: Địa chỉ của người thụ hưởng mà phần thưởng khai thác được trao. - Number: The unix timestamp for when the block was collated.
  • Khó khăn - Chuỗi: Số nguyên của độ khó cho khối này. - Array: Array of transaction objects, or 32 Bytes transaction hashes depending on the returnTransactionObjects parameter.
  • TotalDiffic Khoa - Chuỗi: Số nguyên của tổng độ khó của chuỗi cho đến khi khối này. - Array: Array of uncle hashes.

Thí dụ¶

web3.eth.getBlock(3150).then(console.log);>{"number":3,"hash":"0xef95f2f1ed3ca60b048b4bf67cde2195961e0bba6f70bcbea9a2c4e133e34b46","parentHash":"0x2302e1c0b972d00932deb5dab9eb2982f570597d9d42504c05d9c2147eaf9c88","nonce":"0xfb6e1a62d119228b","sha3Uncles":"0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347","logsBloom":"0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000","transactionsRoot":"0x3a1b03875115b79539e5bd33fb00d8f7b7cd61929d5a3c574f507b8acf415bee","stateRoot":"0xf1133199d44695dfa8fd1bcfe424d82854b5cebef75bddd7e40ea94cda515bcb","miner":"0x8888f1f195afa192cfee860698584c030f4c9db1","difficulty":'21345678965432',"totalDifficulty":'324567845321',"size":616,"extraData":"0x","gasLimit":3141592,"gasUsed":21662,"timestamp":1429287689,"transactions":["0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b"],"uncles":[]}.eth.getBlock(3150) .then(console.log); > { "number": 3, "hash": "0xef95f2f1ed3ca60b048b4bf67cde2195961e0bba6f70bcbea9a2c4e133e34b46", "parentHash": "0x2302e1c0b972d00932deb5dab9eb2982f570597d9d42504c05d9c2147eaf9c88", "nonce": "0xfb6e1a62d119228b", "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "transactionsRoot": "0x3a1b03875115b79539e5bd33fb00d8f7b7cd61929d5a3c574f507b8acf415bee", "stateRoot": "0xf1133199d44695dfa8fd1bcfe424d82854b5cebef75bddd7e40ea94cda515bcb", "miner": "0x8888f1f195afa192cfee860698584c030f4c9db1", "difficulty": '21345678965432', "totalDifficulty": '324567845321', "size": 616, "extraData": "0x", "gasLimit": 3141592, "gasUsed": 21662, "timestamp": 1429287689, "transactions": [ "0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b" ], "uncles": [] }


getblock¶

web3.eth.getBlockTransactionCount(blockHashOrBlockNumber[,callback]).eth.getBlockTransactionCount(blockHashOrBlockNumber [, callback])

Trả về một khối khớp với số khối hoặc băm khối.

Thông số¶

  1. Chuỗi | Số | Bn | Bignumber - Số khối hoặc khối băm. Hoặc chuỗi "sớm nhất", "mới nhất" hoặc "đang chờ xử lý" như trong tham số khối mặc định. - The block number or hash. Or the string "earliest", "latest" or "pending" as in the default block parameter.
  2. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Boolean - (Tùy chọn, mặc định sai) Nếu được chỉ định là True, khối được trả về sẽ chứa tất cả các giao dịch dưới dạng đối tượng. Nếu sai, nó sẽ chỉ chứa các băm giao dịch. returns Number - The number of transactions in the given block.

Thí dụ¶

web3.eth.getBlockTransactionCount("0x407d73d8a49eeb85d32cf465507dd71d507100c1").then(console.log);>1.eth.getBlockTransactionCount("0x407d73d8a49eeb85d32cf465507dd71d507100c1") .then(console.log); > 1


getblock¶

web3.eth.getBlockUncleCount(blockHashOrBlockNumber[,callback]).eth.getBlockUncleCount(blockHashOrBlockNumber [, callback])

Trả về một khối khớp với số khối hoặc băm khối.

Thông số¶

  1. Chuỗi | Số | Bn | Bignumber - Số khối hoặc khối băm. Hoặc chuỗi "sớm nhất", "mới nhất" hoặc "đang chờ xử lý" như trong tham số khối mặc định. - The block number or hash. Or the string "earliest", "latest" or "pending" as in the default block parameter.
  2. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Lời hứa trả về số - số lượng giao dịch trong khối đã cho. returns Number - The number of transactions in the given block.

Thí dụ¶

web3.eth.getBlockUncleCount("0x407d73d8a49eeb85d32cf465507dd71d507100c1").then(console.log);>1.eth.getBlockUncleCount("0x407d73d8a49eeb85d32cf465507dd71d507100c1") .then(console.log); > 1


getuncle¶

web3.eth.getUncle(blockHashOrBlockNumber,uncleIndex[,returnTransactionObjects][,callback]).eth.getUncle(blockHashOrBlockNumber, uncleIndex [, returnTransactionObjects] [, callback])

Trả về một khối chú bởi một vị trí chỉ số của chú.

Thông số¶

  1. Chuỗi | Số | Bn | Bignumber - Số khối hoặc Hash. Hoặc chuỗi "sớm nhất", "mới nhất" hoặc "đang chờ xử lý" như trong tham số khối mặc định. - The block number or hash. Or the string "earliest", "latest" or "pending" as in the default block parameter.
  2. Số - Vị trí chỉ mục của chú. - The index position of the uncle.
  3. Boolean - (Tùy chọn, mặc định sai) Nếu được chỉ định là True, khối được trả về sẽ chứa tất cả các giao dịch dưới dạng đối tượng. Theo mặc định là sai, vì vậy, không cần phải chỉ định sai. Và, nếu sai, nó sẽ chỉ chứa các băm giao dịch. - (optional, default false) If specified true, the returned block will contain all transactions as objects. By default it is false so, there is no need to explictly specify false. And, if false it will only contains the transaction hashes.
  4. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Lời hứa trả về số - số lượng giao dịch trong khối đã cho. returns Object - the returned uncle. For a return value see web3.eth.getBlock().

Thí dụ¶

getuncle¶

Thí dụ¶

getuncle¶.eth.getUncle(500, 0) .then(console.log); > // see web3.eth.getBlock


Trả về một khối chú bởi một vị trí chỉ số của chú.

web3.eth.getTransaction(transactionHash[,callback]).eth.getTransaction(transactionHash [, callback])

Thông số¶

Thông số¶

  1. Chuỗi | Số | Bn | Bignumber - Số khối hoặc Hash. Hoặc chuỗi "sớm nhất", "mới nhất" hoặc "đang chờ xử lý" như trong tham số khối mặc định. - The transaction hash.
  2. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Lời hứa trả về số - số lượng giao dịch trong khối đã cho. returns Object - A transaction object its hash transactionHash:

  • Thí dụ¶ 32 Bytes - String: Hash of the transaction.
  • getuncle¶ - Number: The number of transactions made by the sender prior to this one.
  • Trả về một khối chú bởi một vị trí chỉ số của chú. 32 Bytes - String: Hash of the block where this transaction was in. null if pending.
  • Thông số¶ - Number: Block number where this transaction was in. null if pending.
  • Chuỗi | Số | Bn | Bignumber - Số khối hoặc Hash. Hoặc chuỗi "sớm nhất", "mới nhất" hoặc "đang chờ xử lý" như trong tham số khối mặc định. - Number: Integer of the transactions index position in the block. null if pending.
  • Số - Vị trí chỉ mục của chú. - String: Address of the sender.
  • Boolean - (Tùy chọn, mặc định sai) Nếu được chỉ định là True, khối được trả về sẽ chứa tất cả các giao dịch dưới dạng đối tượng. Theo mặc định là sai, vì vậy, không cần phải chỉ định sai. Và, nếu sai, nó sẽ chỉ chứa các băm giao dịch. - String: Address of the receiver. null if its a contract creation transaction.
  • Promise trả về đối tượng - người chú được trả lại. Để biết giá trị trả về, xem Web3.eth.getBlock (). - String: Value transferred in wei.
  • Ghi chú - String: Gas price provided by the sender in wei.
  • Một người chú không chứa các giao dịch riêng lẻ. - Number: Gas provided by the sender.
  • Web3.eth.getuncle (500,0) .then (Console.log);> // Xem Web3.Eth.GetBlock - String: The data sent along with the transaction.

Thí dụ¶

getuncle¶.eth.getTransaction('0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b§234') .then(console.log); > { "hash": "0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b", "nonce": 2, "blockHash": "0xef95f2f1ed3ca60b048b4bf67cde2195961e0bba6f70bcbea9a2c4e133e34b46", "blockNumber": 3, "transactionIndex": 0, "from": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "to": "0x6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value": '123450000000000000', "gas": 314159, "gasPrice": '2000000000000', "input": "0x57cb2fc4" }


Trả về một khối chú bởi một vị trí chỉ số của chú.

web3.eth.getPendingTransactions([,callback]).eth.getPendingTransactions([, callback])

Thông số¶

Thông số¶

  1. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Lời hứa trả về số - số lượng giao dịch trong khối đã cho. - Array of pending transactions:

  • Thí dụ¶ 32 Bytes - String: Hash of the transaction.
  • getuncle¶ - Number: The number of transactions made by the sender prior to this one.
  • Trả về một khối chú bởi một vị trí chỉ số của chú. 32 Bytes - String: Hash of the block where this transaction was in. null if pending.
  • Thông số¶ - Number: Block number where this transaction was in. null if pending.
  • Chuỗi | Số | Bn | Bignumber - Số khối hoặc Hash. Hoặc chuỗi "sớm nhất", "mới nhất" hoặc "đang chờ xử lý" như trong tham số khối mặc định. - Number: Integer of the transactions index position in the block. null if pending.
  • Số - Vị trí chỉ mục của chú. - String: Address of the sender.
  • Boolean - (Tùy chọn, mặc định sai) Nếu được chỉ định là True, khối được trả về sẽ chứa tất cả các giao dịch dưới dạng đối tượng. Theo mặc định là sai, vì vậy, không cần phải chỉ định sai. Và, nếu sai, nó sẽ chỉ chứa các băm giao dịch. - String: Address of the receiver. null when its a contract creation transaction.
  • Promise trả về đối tượng - người chú được trả lại. Để biết giá trị trả về, xem Web3.eth.getBlock (). - String: Value transferred in wei.
  • Ghi chú - String: The wei per unit of gas provided by the sender in wei.
  • Một người chú không chứa các giao dịch riêng lẻ. - Number: Gas provided by the sender.
  • Web3.eth.getuncle (500,0) .then (Console.log);> // Xem Web3.Eth.GetBlock - String: The data sent along with the transaction.

Thí dụ¶

web3.eth.getPendingTransactions().then(console.log);>[{hash:'0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b',nonce:2,blockHash:'0xef95f2f1ed3ca60b048b4bf67cde2195961e0bba6f70bcbea9a2c4e133e34b46',blockNumber:3,transactionIndex:0,from:'0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b',to:'0x6295ee1b4f6dd65047762f924ecd367c17eabf8f',value:'123450000000000000',gas:314159,gasPrice:'2000000000000',input:'0x57cb2fc4'v:'0x3d',r:'0xaabc9ddafffb2ae0bac4107697547d22d9383667d9e97f5409dd6881ce08f13f',s:'0x69e43116be8f842dcd4a0b2f760043737a59534430b762317db21d9ac8c5034'},....,{hash:'0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b',nonce:3,blockHash:'0xef95f2f1ed3ca60b048b4bf67cde2195961e0bba6f70bcbea9a2c4e133e34b46',blockNumber:4,transactionIndex:0,from:'0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b',to:'0x6295ee1b4f6dd65047762f924ecd367c17eabf8f',value:'123450000000000000',gas:314159,gasPrice:'2000000000000',input:'0x57cb2fc4'v:'0x3d',r:'0xaabc9ddafffb2ae0bac4107697547d22d9383667d9e97f5409dd6881ce08f13f',s:'0x69e43116be8f842dcd4a0b2f760043737a59534430b762317db21d9ac8c5034'}].eth.getPendingTransactions().then(console.log); > [ { hash: '0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b', nonce: 2, blockHash: '0xef95f2f1ed3ca60b048b4bf67cde2195961e0bba6f70bcbea9a2c4e133e34b46', blockNumber: 3, transactionIndex: 0, from: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b', to: '0x6295ee1b4f6dd65047762f924ecd367c17eabf8f', value: '123450000000000000', gas: 314159, gasPrice: '2000000000000', input: '0x57cb2fc4' v: '0x3d', r: '0xaabc9ddafffb2ae0bac4107697547d22d9383667d9e97f5409dd6881ce08f13f', s: '0x69e43116be8f842dcd4a0b2f760043737a59534430b762317db21d9ac8c5034' },....,{ hash: '0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b', nonce: 3, blockHash: '0xef95f2f1ed3ca60b048b4bf67cde2195961e0bba6f70bcbea9a2c4e133e34b46', blockNumber: 4, transactionIndex: 0, from: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b', to: '0x6295ee1b4f6dd65047762f924ecd367c17eabf8f', value: '123450000000000000', gas: 314159, gasPrice: '2000000000000', input: '0x57cb2fc4' v: '0x3d', r: '0xaabc9ddafffb2ae0bac4107697547d22d9383667d9e97f5409dd6881ce08f13f', s: '0x69e43116be8f842dcd4a0b2f760043737a59534430b762317db21d9ac8c5034' } ]


getTransactionFromblock¶

getTransactionFromBlock(hashStringOrNumber,indexNumber[,callback])(hashStringOrNumber, indexNumber [, callback])

Trả về một giao dịch dựa trên một khối băm hoặc số và vị trí chỉ mục giao dịch.

Thông số¶

  1. Chuỗi | Số | Bn | Bignumber - Số khối hoặc băm. Hoặc chuỗi "sớm nhất", "mới nhất" hoặc "đang chờ xử lý" như trong tham số khối mặc định. - A block number or hash. Or the string "earliest", "latest" or "pending" as in the default block parameter.
  2. Số - Vị trí chỉ số giao dịch. - The transactions index position.
  3. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Promise trả về đối tượng - một đối tượng giao dịch, xem Web3.eth.gettransaction: returns Object - A transaction object, see web3.eth.getTransaction:

Thí dụ¶

vartransaction = web3.eth.gettransactionfromblock ('0x4534534534', 2) .then (console.log);> // xem web3.eth.gettransaction transaction = web3.eth.getTransactionFromBlock('0x4534534534', 2) .then(console.log); > // see web3.eth.getTransaction


GetTransactionReceipt¶

web3.eth.getTransactionReceipt(hash[,callback]).eth.getTransactionReceipt(hash [, callback])

Trả về việc nhận giao dịch theo băm giao dịch.

Ghi chú

Biên lai không có sẵn cho các giao dịch đang chờ xử lý và trả lại null.null.

Thông số¶

  1. Chuỗi | Số | Bn | Bignumber - Số khối hoặc băm. Hoặc chuỗi "sớm nhất", "mới nhất" hoặc "đang chờ xử lý" như trong tham số khối mặc định. - The transaction hash.
  2. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Promise trả về đối tượng - một đối tượng giao dịch, xem Web3.eth.gettransaction: returns Object - A transaction receipt object, or null if no receipt was found:

  • Thí dụ¶ - Boolean: TRUE if the transaction was successful, FALSE if the EVM reverted the transaction.
  • vartransaction = web3.eth.gettransactionfromblock ('0x4534534534', 2) .then (console.log);> // xem web3.eth.gettransaction 32 Bytes - String: Hash of the block where this transaction was in.
  • GetTransactionReceipt¶ - Number: Block number where this transaction was in.
  • Trả về việc nhận giao dịch theo băm giao dịch. 32 Bytes - String: Hash of the transaction.
  • Ghi chú- Number: Integer of the transactions index position in the block.
  • Biên lai không có sẵn cho các giao dịch đang chờ xử lý và trả lại null. - String: Address of the sender.
  • Chuỗi - Giao dịch băm. - String: Address of the receiver. null when its a contract creation transaction.
  • Promise trả về đối tượng - Đối tượng Biên lai giao dịch hoặc NULL nếu không tìm thấy biên lai: - String: The contract address created, if the transaction was a contract creation, otherwise null.
  • Trạng thái - Boolean: Đúng nếu giao dịch thành công, sai nếu EVM hoàn nguyên giao dịch. - Number: The total amount of gas used when this transaction was executed in the block.
  • Blockhash 32 byte - Chuỗi: Hash của khối nơi giao dịch này.- Number: The amount of gas used by this specific transaction alone.
  • BlockNumber - Số: Số khối nơi giao dịch này. - Array: Array of log objects, which this transaction generated.

Thí dụ¶

vartransaction = web3.eth.gettransactionfromblock ('0x4534534534', 2) .then (console.log);> // xem web3.eth.gettransaction receipt = web3.eth.getTransactionReceipt('0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b') .then(console.log); > { "status": true, "transactionHash": "0x9fc76417374aa880d4449a1f7f31ec597f00b1f6f3dd2d66f4c9c6c445836d8b", "transactionIndex": 0, "blockHash": "0xef95f2f1ed3ca60b048b4bf67cde2195961e0bba6f70bcbea9a2c4e133e34b46", "blockNumber": 3, "contractAddress": "0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe", "cumulativeGasUsed": 314159, "gasUsed": 30234, "logs": [{ // logs as returned by getPastLogs, etc. }, ...] }


GetTransactionReceipt¶

web3.eth.getTransactionCount(address[,defaultBlock][,callback]).eth.getTransactionCount(address [, defaultBlock] [, callback])

Trả về việc nhận giao dịch theo băm giao dịch.

Thông số¶

  1. Ghi chú - The address to get the numbers of transactions from.
  2. Biên lai không có sẵn cho các giao dịch đang chờ xử lý và trả lại null. - (optional) If you pass this parameter it will not use the default block set with web3.eth.defaultBlock. Pre-defined block numbers as "earliest", "latest" and "pending" can also be used.
  3. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Promise trả về đối tượng - một đối tượng giao dịch, xem Web3.eth.gettransaction: returns Number - The number of transactions sent from the given address.

Thí dụ¶

web3.eth.getTransactionCount("0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe").then(console.log);>1.eth.getTransactionCount("0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe") .then(console.log); > 1


vartransaction = web3.eth.gettransactionfromblock ('0x4534534534', 2) .then (console.log);> // xem web3.eth.gettransaction

web3.eth.sendTransaction(transactionObject[,callback]).eth.sendTransaction(transactionObject [, callback])

GetTransactionReceipt¶

Trả về việc nhận giao dịch theo băm giao dịch.

  1. Ghi chú - The transaction object to send:
    • Biên lai không có sẵn cho các giao dịch đang chờ xử lý và trả lại null. - String|Number: The address for the sending account. Uses the web3.eth.defaultAccount property, if not specified. Or an address or index of a local wallet in web3.eth.accounts.wallet.
    • Chuỗi - Giao dịch băm. - String: (optional) The destination address of the message, left undefined for a contract-creation transaction.
    • Promise trả về đối tượng - Đối tượng Biên lai giao dịch hoặc NULL nếu không tìm thấy biên lai: - Number|String|BN|BigNumber: (optional) The value transferred for the transaction in wei, also the endowment if its a contract-creation transaction.
    • Trạng thái - Boolean: Đúng nếu giao dịch thành công, sai nếu EVM hoàn nguyên giao dịch. - Number: (optional, default: To-Be-Determined) The amount of gas to use for the transaction (unused gas is refunded).
    • Blockhash 32 byte - Chuỗi: Hash của khối nơi giao dịch này. - Number|String|BN|BigNumber: (optional) The price of gas for this transaction in wei, defaults to web3.eth.gasPrice.
    • BlockNumber - Số: Số khối nơi giao dịch này. - String: (optional) Either a ABI byte string containing the data of the function call on a contract, or in the case of a contract-creation transaction the initialisation code.
    • Giao dịchHash 32 byte - Chuỗi: băm của giao dịch. - Number: (optional) Integer of the nonce. This allows to overwrite your own pending transactions that use the same nonce.
    • Giao dịch Index- Số: Số nguyên của vị trí chỉ mục giao dịch trong khối. - String: (optional) Defaults to mainnet.
    • Từ - Chuỗi: Địa chỉ của người gửi. - String: (optional) Defaults to petersburg.
    • chung - đối tượng: (tùy chọn) đối tượng chung - Object: (optional) The common object
      • CustomChain - Đối tượng: Thuộc tính chuỗi tùy chỉnh - Object: The custom chain properties
        • Tên - Chuỗi: (Tùy chọn) Tên của chuỗi - string: (optional) The name of the chain
        • NetworkId - Số: ID mạng của chuỗi tùy chỉnh - number: Network ID of the custom chain
        • ChainID - Số: ID chuỗi của chuỗi tùy chỉnh - number: Chain ID of the custom chain
      • Basechain - Chuỗi: (Tùy chọn) Mainnet, Goerli, Kovan, Rinkeby hoặc Ropsten - string: (optional) mainnet, goerli, kovan, rinkeby, or ropsten
      • Hardfork - Chuỗi: (Tùy chọn) Chainstart, Homestead, Dao, TangerineWhistle, Spuriousdragon, Byzantium, Constantinople, Petersburg hoặc Istanbul - string: (optional) chainstart, homestead, dao, tangerineWhistle, spuriousDragon, byzantium, constantinople, petersburg, or istanbul
  2. Callback - Hàm: (Tùy chọn) Cuộc gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - Function: (optional) Optional callback, returns an error object as first parameter and the result as second.

Ghi chú

Thuộc tính từ cũng có thể là một địa chỉ hoặc chỉ mục từ web3.eth.accounts.wallet. Sau đó, nó sẽ ký cục bộ bằng khóa riêng của tài khoản đó và gửi giao dịch qua Web3.eth.SendsignTransaction (). Nếu chuỗi thuộc tính và HardFork hoặc Common không được đặt, Web3 sẽ cố gắng đặt các giá trị phù hợp bằng cách truy vấn mạng cho chuỗi và mạng của nó.from property can also be an address or index from the web3.eth.accounts.wallet. It will then sign locally using the private key of that account, and send the transaction via web3.eth.sendSignedTransaction(). If the properties chain and hardfork or common are not set, Web3 will try to set appropriate values by querying the network for its chainId and networkId.

Trở lại

Cuộc gọi lại sẽ trả về băm 32 byte.callback will return the 32 bytes transaction hash.

Promievent: Một người phát hành sự kiện kết hợp. Giải quyết khi nhận được biên lai giao dịch. Các sự kiện sau cũng có sẵn:: A promise combined event emitter. Resolves when the transaction receipt is available. The following events are also available:

  • Gửi trả về tải trọng: Đối tượng: Bị sa thải ngay trước khi truyền yêu cầu giao dịch. returns payload: Object: Fired immediately before transmitting the transaction request.
  • Đã gửi trả về tải trọng: Đối tượng: Đã bắn ngay sau khi cơ quan yêu cầu được ghi cho khách hàng, nhưng trước khi nhận được băm giao dịch. returns payload: Object: Fired immediately after the request body has been written to the client, but before the transaction hash is received.
  • "Giao dịchHash" trả về Giao dịchHash: Chuỗi: bị sa thải khi có hàm băm giao dịch. returns transactionHash: String: Fired when the transaction hash is available.
  • "Biên lai" Trả về Biên lai: Đối tượng: Bắn khi có sẵn biên lai giao dịch. returns receipt: Object: Fired when the transaction receipt is available.
  • "Xác nhận" Trả về Xác nhận Nhận số xác nhận là số đầu tiên và biên lai là đối số thứ hai. Bắn từ xác nhận 0 trên, là khối mà nó được khai thác. returns confirmationNumber: Number, receipt: Object, latestBlockHash: String: Fired for every confirmation up to the 12th confirmation. Receives the confirmation number as the first and the receipt as the second argument. Fired from confirmation 0 on, which is the block where its mined.

"Lỗi" Trả về Lỗi: Lỗi: Bắn nếu xảy ra lỗi trong quá trình gửi. Nếu giao dịch bị mạng từ chối với biên lai, biên lai sẽ có sẵn dưới dạng thuộc tính trên đối tượng lỗi. returns error: Error: Fired if an error occurs during sending. If the transaction was rejected by the network with a receipt, the receipt will be available as a property on the error object.

Thí dụ¶

// compiled solidity source code using https://remix.ethereum.orgvarcode="603d80600c6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463c6888fa18114602d57005b6007600435028060005260206000f3";// using the callbackweb3.eth.sendTransaction({from:'0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe',data:code// deploying a contracrt},function( Lỗi, băm) {...}); ..}); // sử dụng ESTERWEB33 . ; // Nếu lỗi ngoài khí, tham số thứ hai là biên lai. var code = "603d80600c6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463c6888fa18114602d57005b6007600435028060005260206000f3"; // using the callback web3.eth.sendTransaction({ from: '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe', data: code // deploying a contracrt }, function(error, hash){ ... }); // using the promise web3.eth.sendTransaction({ from: '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe', to: '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe', value: '1000000000000000' }) .then(function(receipt){ ... }); // using the event emitter web3.eth.sendTransaction({ from: '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe', to: '0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe', value: '1000000000000000' }) .on('transactionHash', function(hash){ ... }) .on('receipt', function(receipt){ ... }) .on('confirmation', function(confirmationNumber, receipt){ ... }) .on('error', console.error); // If a out of gas error, the second parameter is the receipt.


SendSignedTransaction¶

web3.eth.sendSignedTransaction(signedTransactionData[,callback]).eth.sendSignedTransaction(signedTransactionData [, callback])

Gửi một giao dịch đã ký, được tạo ví dụ bằng Web3.eth.accounts.SignTransaction.web3.eth.accounts.signTransaction.

Thông số¶

  1. Chuỗi - Dữ liệu giao dịch đã ký ở định dạng Hex - Signed transaction data in HEX format
  2. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Cuộc gọi lại sẽ trả về băm 32 byte.: A promise combined event emitter. Resolves when the transaction receipt is available.

Promievent: Một người phát hành sự kiện kết hợp. Giải quyết khi nhận được biên lai giao dịch. Các sự kiện sau cũng có sẵn:web3.eth.sendTransaction for details.

Thí dụ¶

// compiled solidity source code using https://remix.ethereum.orgvarcode="603d80600c6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463c6888fa18114602d57005b6007600435028060005260206000f3";// using the callbackweb3.eth.sendTransaction({from:'0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe',data:code// deploying a contracrt},function( Lỗi, băm) {...}); ..}); // sử dụng ESTERWEB33 . ; // Nếu lỗi ngoài khí, tham số thứ hai là biên lai. Tx = require('ethereumjs-tx').Transaction; var privateKey = Buffer.from('e331b6d69882b4cb4ea581d88e0b604039a3de5967688d3dcffdd2270c0fd109', 'hex'); var rawTx = { nonce: '0x00', gasPrice: '0x09184e72a000', gasLimit: '0x2710', to: '0x0000000000000000000000000000000000000000', value: '0x00', data: '0x7f7465737432000000000000000000000000000000000000000000000000000000600057' } var tx = new Tx(rawTx, {'chain':'ropsten'}); tx.sign(privateKey); var serializedTx = tx.serialize(); // console.log(serializedTx.toString('hex')); // 0xf889808609184e72a00082271094000000000000000000000000000000000000000080a47f74657374320000000000000000000000000000000000000000000000000000006000571ca08a8bbf888cfa37bbf0bb965423625641fc956967b81d12e23709cead01446075a01ce999b56a8a88504be365442ea61239198e23d1fce7d00fcfc5cd3b44b7215f web3.eth.sendSignedTransaction('0x' + serializedTx.toString('hex')) .on('receipt', console.log); > // see eth.getTransactionReceipt() for details

Ghi chú

Thuộc tính từ cũng có thể là một địa chỉ hoặc chỉ mục từ web3.eth.accounts.wallet. Sau đó, nó sẽ ký cục bộ bằng khóa riêng của tài khoản đó và gửi giao dịch qua Web3.eth.SendsignTransaction (). Nếu chuỗi thuộc tính và HardFork hoặc Common không được đặt, Web3 sẽ cố gắng đặt các giá trị phù hợp bằng cách truy vấn mạng cho chuỗi và mạng của nó.


dấu hiệu¶

web3.eth.sign(dataToSign,address[,callback]).eth.sign(dataToSign, address [, callback])

Dấu hiệu dữ liệu bằng một tài khoản cụ thể. Tài khoản này cần được mở khóa.

Thông số¶

  1. Chuỗi - Dữ liệu để ký. Nếu đó là một chuỗi, nó sẽ được chuyển đổi bằng Web3.utils.utf8tohex. - Data to sign. If it is a string it will be converted using web3.utils.utf8ToHex.
  2. Chuỗi | Số - Địa chỉ để ký dữ liệu với. Có thể là một địa chỉ hoặc chỉ số của một ví cục bộ trong Web3.eth.accounts.wallet. - Address to sign data with. Can be an address or the index of a local wallet in web3.eth.accounts.wallet.
  3. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Hứa trả về chuỗi - chữ ký. returns String - The signature.

Thí dụ¶

web3.eth.sign("Hello world","0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe").then(console.log);>"0x30755ed65396facf86c53e6217c52b4daebe72aa4941d89635409de4c9c7f9466d4e9aaec7977f05e923889b33c0d0dd27d7226b6e6f56ce737465c5cfd04be400"// the below is the sameweb3.eth.sign(web3.utils.utf8ToHex("Hello world") ,"0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe").then(console.log);>"0x30755ed65396facf86c53e6217c52b4daebe72aa4941d89635409de4c9c7f9466d4e9aaec7977f05e923889b33c0d0dd27d7226b6e6f56ce737465c5cfd04be400".eth.sign("Hello world", "0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe") .then(console.log); > "0x30755ed65396facf86c53e6217c52b4daebe72aa4941d89635409de4c9c7f9466d4e9aaec7977f05e923889b33c0d0dd27d7226b6e6f56ce737465c5cfd04be400" // the below is the same web3.eth.sign(web3.utils.utf8ToHex("Hello world"), "0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe") .then(console.log); > "0x30755ed65396facf86c53e6217c52b4daebe72aa4941d89635409de4c9c7f9466d4e9aaec7977f05e923889b33c0d0dd27d7226b6e6f56ce737465c5cfd04be400"


SignTransaction¶

web3.eth.signTransaction(transactionObject,address[,callback]).eth.signTransaction(transactionObject, address [, callback])

Ký một giao dịch. Tài khoản này cần được mở khóa.

Thông số¶

  1. Chuỗi - Dữ liệu để ký. Nếu đó là một chuỗi, nó sẽ được chuyển đổi bằng Web3.utils.utf8tohex. - The transaction data to sign. See web3.eth.sendTransaction() for more.
  2. Chuỗi | Số - Địa chỉ để ký dữ liệu với. Có thể là một địa chỉ hoặc chỉ số của một ví cục bộ trong Web3.eth.accounts.wallet. - Address to sign transaction with.
  3. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Hứa trả về chuỗi - chữ ký. returns Object - The RLP encoded transaction. The raw property can be used to send the transaction using web3.eth.sendSignedTransaction.

Thí dụ¶

web3.eth.signTransaction({from:"0xEB014f8c8B418Db6b45774c326A0E64C78914dC0",gasPrice:"20000000000",gas:"21000",to:'0x3535353535353535353535353535353535353535',value:"1000000000000000000",data:""}).then(console.log);>{raw:'0xf86c808504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a04f4c17305743700648bc4f6cd3038ec6f6af0df73e31757007b7f59df7bee88da07e1941b264348e80c78c4027afc65a87b0a5e43e86742b8ca0823584c6788fd0',tx:{nonce:'0x0',gasPrice:'0x4a817c800',gas:'0x5208',to:'0x3535353535353535353535353535353535353535',value:'0xde0b6b3a7640000',input:'0x',v:'0x25',r:'0x4f4c17305743700648bc4f6cd3038ec6f6af0df73e31757007b7f59df7bee88d',s:'0x7e1941b264348e80c78c4027afc65a87b0a5e43e86742b8ca0823584c6788fd0',hash:'0xda3be87732110de6c1354c83770aae630ede9ac308d9f7b399ecfba23d923384'}}.eth.signTransaction({ from: "0xEB014f8c8B418Db6b45774c326A0E64C78914dC0", gasPrice: "20000000000", gas: "21000", to: '0x3535353535353535353535353535353535353535', value: "1000000000000000000", data: "" }).then(console.log); > { raw: '0xf86c808504a817c800825208943535353535353535353535353535353535353535880de0b6b3a76400008025a04f4c17305743700648bc4f6cd3038ec6f6af0df73e31757007b7f59df7bee88da07e1941b264348e80c78c4027afc65a87b0a5e43e86742b8ca0823584c6788fd0', tx: { nonce: '0x0', gasPrice: '0x4a817c800', gas: '0x5208', to: '0x3535353535353535353535353535353535353535', value: '0xde0b6b3a7640000', input: '0x', v: '0x25', r: '0x4f4c17305743700648bc4f6cd3038ec6f6af0df73e31757007b7f59df7bee88d', s: '0x7e1941b264348e80c78c4027afc65a87b0a5e43e86742b8ca0823584c6788fd0', hash: '0xda3be87732110de6c1354c83770aae630ede9ac308d9f7b399ecfba23d923384' } }


web3.eth.sign("Hello world","0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe").then(console.log);>"0x30755ed65396facf86c53e6217c52b4daebe72aa4941d89635409de4c9c7f9466d4e9aaec7977f05e923889b33c0d0dd27d7226b6e6f56ce737465c5cfd04be400"// the below is the sameweb3.eth.sign(web3.utils.utf8ToHex("Hello world") ,"0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe").then(console.log);>"0x30755ed65396facf86c53e6217c52b4daebe72aa4941d89635409de4c9c7f9466d4e9aaec7977f05e923889b33c0d0dd27d7226b6e6f56ce737465c5cfd04be400"

web3.eth.call(callObject[,defaultBlock][,callback]).eth.call(callObject [, defaultBlock] [, callback])

SignTransaction¶

Thông số¶

  1. Chuỗi - Dữ liệu để ký. Nếu đó là một chuỗi, nó sẽ được chuyển đổi bằng Web3.utils.utf8tohex. - A transaction object, see web3.eth.sendTransaction. For calls the from property is optional however it is highly recommended to explicitly set it or it may default to address(0) depending on your node or provider.
  2. Chuỗi | Số - Địa chỉ để ký dữ liệu với. Có thể là một địa chỉ hoặc chỉ số của một ví cục bộ trong Web3.eth.accounts.wallet. - (optional) If you pass this parameter it will not use the default block set with web3.eth.defaultBlock. Pre-defined block numbers as "earliest", "latest" and "pending" can also be used.
  3. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Hứa trả về chuỗi - chữ ký. returns String: The returned data of the call, e.g. a smart contract functions return value.

Thí dụ¶

web3.eth.sign("Hello world","0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe").then(console.log);>"0x30755ed65396facf86c53e6217c52b4daebe72aa4941d89635409de4c9c7f9466d4e9aaec7977f05e923889b33c0d0dd27d7226b6e6f56ce737465c5cfd04be400"// the below is the sameweb3.eth.sign(web3.utils.utf8ToHex("Hello world") ,"0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe").then(console.log);>"0x30755ed65396facf86c53e6217c52b4daebe72aa4941d89635409de4c9c7f9466d4e9aaec7977f05e923889b33c0d0dd27d7226b6e6f56ce737465c5cfd04be400".eth.call({ to: "0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe", // contract address data: "0xc6888fa10000000000000000000000000000000000000000000000000000000000000003" }) .then(console.log); > "0x000000000000000000000000000000000000000000000000000000000000000a"


SignTransaction¶

web3.eth.estimateGas(callObject[,callback]).eth.estimateGas(callObject [, callback])

Ký một giao dịch. Tài khoản này cần được mở khóa.

Thông số¶

  1. Đối tượng - Dữ liệu giao dịch để ký. Xem Web3.eth.SendTransaction () để biết thêm. - A transaction object, see web3.eth.sendTransaction with the difference that for calls the from property is optional as well.
  2. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Hứa trả về chuỗi - chữ ký. returns Number - the used gas for the simulated call/transaction.

Thí dụ¶

web3.eth.estimateGas({to:"0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe",data:"0xc6888fa10000000000000000000000000000000000000000000000000000000000000003"}).then(console.log);>"0x0000000000000000000000000000000000000000000000000000000000000015".eth.estimateGas({ to: "0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe", data: "0xc6888fa10000000000000000000000000000000000000000000000000000000000000003" }) .then(console.log); > "0x0000000000000000000000000000000000000000000000000000000000000015"


web3.eth.sign("Hello world","0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe").then(console.log);>"0x30755ed65396facf86c53e6217c52b4daebe72aa4941d89635409de4c9c7f9466d4e9aaec7977f05e923889b33c0d0dd27d7226b6e6f56ce737465c5cfd04be400"// the below is the sameweb3.eth.sign(web3.utils.utf8ToHex("Hello world") ,"0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe").then(console.log);>"0x30755ed65396facf86c53e6217c52b4daebe72aa4941d89635409de4c9c7f9466d4e9aaec7977f05e923889b33c0d0dd27d7226b6e6f56ce737465c5cfd04be400"

web3.eth.getPastLogs(options[,callback]).eth.getPastLogs(options [, callback])

SignTransaction¶

Thông số¶

  1. Ký một giao dịch. Tài khoản này cần được mở khóa. - The filter options as follows:

  • Đối tượng - Dữ liệu giao dịch để ký. Xem Web3.eth.SendTransaction () để biết thêm. - Number|String: The number of the earliest block ("latest" may be given to mean the most recent and "pending" currently mining, block). By default "latest".
  • Chuỗi - Địa chỉ để ký giao dịch với. - Number|String: The number of the latest block ("latest" may be given to mean the most recent and "pending" currently mining, block). By default "latest".
  • Địa chỉ - Chuỗi | Mảng: Một địa chỉ hoặc danh sách các địa chỉ để chỉ nhận nhật ký từ (các) tài khoản cụ thể. - String|Array: An address or a list of addresses to only get logs from particular account(s).
  • Chủ đề - Mảng: Một mảng các giá trị phải xuất hiện trong các mục nhật ký. Thứ tự rất quan trọng, nếu bạn muốn để lại các chủ đề, hãy sử dụng null, ví dụ: [null, '0x12 ...']. Bạn cũng có thể vượt qua một mảng cho từng chủ đề với các tùy chọn cho chủ đề đó, ví dụ: [null, ['tùy chọn1', 'tùy chọn2']]]] - Array: An array of values which must each appear in the log entries. The order is important, if you want to leave topics out use null, e.g. [null, '0x12...']. You can also pass an array for each topic with options for that topic e.g. [null, ['option1', 'option2']]

Trở lại

Promise trả về mảng - mảng của các đối tượng nhật ký. returns Array - Array of log objects.

Cấu trúc của đối tượng sự kiện được trả về trong mảng trông như sau:Object in the Array looks as follows:

  • Địa chỉ - Chuỗi: Từ đó sự kiện này bắt nguồn từ. - String: From which this event originated from.
  • Dữ liệu - Chuỗi: Dữ liệu chứa tham số nhật ký không được chỉ số. - String: The data containing non-indexed log parameter.
  • Chủ đề - Mảng: Một mảng có chủ đề tối đa 4 32 byte, chủ đề 1-3 chứa các tham số được lập chỉ mục của nhật ký. - Array: An array with max 4 32 Byte topics, topic 1-3 contains indexed parameters of the log.
  • Logindex - Số: Số nguyên của vị trí chỉ mục sự kiện trong khối. - Number: Integer of the event index position in the block.
  • Giao dịch Index - Số: Số nguyên của vị trí chỉ mục giao dịch, sự kiện được tạo trong. - Number: Integer of the transactions index position, the event was created in.
  • Giao dịchHash 32 byte - Chuỗi: Hash của giao dịch Sự kiện này được tạo trong. 32 Bytes - String: Hash of the transaction this event was created in.
  • Blockhash 32 byte - Chuỗi: Hash of the Block nơi sự kiện này được tạo trong. NULL nếu vẫn đang chờ xử lý. 32 Bytes - String: Hash of the block where this event was created in. null if still pending.
  • BlockNumber - Số: Số khối nơi nhật ký này được tạo. NULL nếu vẫn đang chờ xử lý. - Number: The block number where this log was created in. null if still pending.

Thí dụ¶

web3.eth.getPastLogs({address:"0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe",topics:["0x033456732123ffff2342342dd12342434324234234fd234fd23fd4f23d4234"]}).then(console.log);>[{data:'0x7f9fade1c0d57a7af66ab4ead79fade1c0d57a7af66ab4ead7c2c2eb7b11a91385',topics:['0xfd43ade1c09fade1c0d57a7af66ab4ead7c2c2eb7b11a91ffdd57a7af66ab4ead7','0x7f9fade1c0d57a7af66ab4ead79fade1c0d57a7af66ab4ead7c2c2eb7b11a91385']logIndex:0,transactionIndex:0,transactionHash:'0x7f9fade1c0d57a7af66ab4ead79fade1c0d57a7af66ab4ead7c2c2eb7b11a91385',blockHash:'0xfd43ade1c09fade1c0d57a7af66ab4ead7c2c2eb7b11a91ffdd57a7af66ab4ead7',blockNumber:1234,address:'0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe'},{...}].eth.getPastLogs({ address: "0x11f4d0A3c12e86B4b5F39B213F7E19D048276DAe", topics: ["0x033456732123ffff2342342dd12342434324234234fd234fd23fd4f23d4234"] }) .then(console.log); > [{ data: '0x7f9fade1c0d57a7af66ab4ead79fade1c0d57a7af66ab4ead7c2c2eb7b11a91385', topics: ['0xfd43ade1c09fade1c0d57a7af66ab4ead7c2c2eb7b11a91ffdd57a7af66ab4ead7', '0x7f9fade1c0d57a7af66ab4ead79fade1c0d57a7af66ab4ead7c2c2eb7b11a91385'] logIndex: 0, transactionIndex: 0, transactionHash: '0x7f9fade1c0d57a7af66ab4ead79fade1c0d57a7af66ab4ead7c2c2eb7b11a91385', blockHash: '0xfd43ade1c09fade1c0d57a7af66ab4ead7c2c2eb7b11a91ffdd57a7af66ab4ead7', blockNumber: 1234, address: '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe' },{...}]


getwork¶

web3.eth.getWork([callback]).eth.getWork([callback])

Nhận công việc cho người khai thác để khai thác. Trả về hàm băm của khối hiện tại, hạt giống và điều kiện biên sẽ được đáp ứng (mục tiêu).

Thông số¶

  1. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Promise trả về mảng - mảng của các đối tượng nhật ký. returns Array - the mining work with the following structure:

  • Cấu trúc của đối tượng sự kiện được trả về trong mảng trông như sau: 32 Bytes - at index 0: current block header pow-hash
  • Địa chỉ - Chuỗi: Từ đó sự kiện này bắt nguồn từ. 32 Bytes - at index 1: the seed hash used for the DAG.
  • Dữ liệu - Chuỗi: Dữ liệu chứa tham số nhật ký không được chỉ số. 32 Bytes - at index 2: the boundary condition (target), 2^256 / difficulty.

Thí dụ¶

web3.eth.getWork().then(console.log);>["0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef","0x5EED00000000000000000000000000005EED0000000000000000000000000000","0xd1ff1c01710000000000000000000000d1ff1c01710000000000000000000000"].eth.getWork() .then(console.log); > [ "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "0x5EED00000000000000000000000000005EED0000000000000000000000000000", "0xd1ff1c01710000000000000000000000d1ff1c01710000000000000000000000" ]


getwork¶

web3.eth.submitWork(nonce,powHash,digest,[callback]).eth.submitWork(nonce, powHash, digest, [callback])

Nhận công việc cho người khai thác để khai thác. Trả về hàm băm của khối hiện tại, hạt giống và điều kiện biên sẽ được đáp ứng (mục tiêu).

Thông số¶

  1. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. 8 Bytes: The nonce found (64 bits)
  2. Lời hứa trả về mảng - Công việc khai thác với cấu trúc sau: 32 Bytes: The headers pow-hash (256 bits)
  3. Chuỗi 32 byte - AT INDEX 0: Tiêu đề khối hiện tại Pow -Hash 32 Bytes: The mix digest (256 bits)
  4. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Lời hứa trả về mảng - Công việc khai thác với cấu trúc sau: returns Boolean - Returns TRUE if the provided solution is valid, otherwise FALSE.

Thí dụ¶

web3.eth.submitWork(["0x0000000000000001","0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef","0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000"]).then(console.log);>true.eth.submitWork([ "0x0000000000000001", "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef", "0xD1FE5700000000000000000000000000D1FE5700000000000000000000000000" ]) .then(console.log); > true


getwork¶

web3.eth.requestAccounts([callback]).eth.requestAccounts([callback])

Nhận công việc cho người khai thác để khai thác. Trả về hàm băm của khối hiện tại, hạt giống và điều kiện biên sẽ được đáp ứng (mục tiêu).

Thông số¶

Thông số¶

  1. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Lời hứa trả về mảng - Công việc khai thác với cấu trúc sau: - Returns an array of enabled accounts.

Thí dụ¶

web3.eth.requestAccounts().then(console.log);>['0aae0B295369a9FD31d5F28D9Ec85E40f4cb692BAf','0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe'].eth.requestAccounts().then(console.log); > ['0aae0B295369a9FD31d5F28D9Ec85E40f4cb692BAf', '0xde0B295669a9FD93d5F28D9Ec85E40f4cb697BAe']


getwork¶

web3.eth.getChainId([callback]).eth.getChainId([callback])

Nhận công việc cho người khai thác để khai thác. Trả về hàm băm của khối hiện tại, hạt giống và điều kiện biên sẽ được đáp ứng (mục tiêu).

Trở lại

Thông số¶ - Returns chain ID.

Thí dụ¶

web3.eth.getChainId().then(console.log);>61.eth.getChainId().then(console.log); > 61


getwork¶

web3.eth.getNodeInfo([callback]).eth.getNodeInfo([callback])

Trở lại

Nhận công việc cho người khai thác để khai thác. Trả về hàm băm của khối hiện tại, hạt giống và điều kiện biên sẽ được đáp ứng (mục tiêu). - The current client version.

Thí dụ¶

web3.eth.getNodeInfo().then(console.log);>"Mist/v0.9.3/darwin/go1.4.1".eth.getNodeInfo().then(console.log); > "Mist/v0.9.3/darwin/go1.4.1"


GetProof;

web3.eth.getProof(address,storageKey,blockNumber,[callback]).eth.getProof(address, storageKey, blockNumber, [callback])

Trả về tài khoản và giá trị lưu trữ của tài khoản được chỉ định bao gồm chứng minh Merkle như được mô tả trong EIP-1186.

Thông số¶

  1. Chuỗi 20 byte: Địa chỉ của tài khoản hoặc hợp đồng. 20 Bytes: The Address of the account or contract.
  2. Số [] | Bignumber [] | Bn [] | Chuỗi [] 32 byte: mảng phím lưu trữ cần được chứng minh và bao gồm. Xem Web3.eth.getStorageat. | BigNumber[] | BN[] | String[] 32 Bytes: Array of storage-keys which should be proofed and included. See web3.eth.getStorageAt.
  3. Số | Chuỗi | Bn | Bignumber: Số khối số nguyên. Các số khối được xác định trước là "sớm nhất", "mới nhất" và "đang chờ xử lý" cũng có thể được sử dụng. | String | BN | BigNumber: Integer block number. Pre-defined block numbers as "earliest", "latest" and "pending" can also be used.
  4. Hàm - (tùy chọn) gọi lại tùy chọn, trả về một đối tượng lỗi làm tham số đầu tiên và kết quả là thứ hai. - (optional) Optional callback, returns an error object as first parameter and the result as second.

Trở lại

Lời hứa - một đối tượng tài khoản. - A account object.

  • Địa chỉ - Chuỗi: Địa chỉ của tài khoản. - String: The address of the account.
  • Số dư - Chuỗi: Số dư của tài khoản. Xem Web3.eth.getbalance. - String: The balance of the account. See web3.eth.getBalance.
  • CodeHash - Chuỗi: Hash của mã của tài khoản. Đối với một tài khoản đơn giản không có mã, nó sẽ trả về "0xC5D2460186F7233C927E7DB2DCC703C0E500B653CA82273B7BFAD8045D85A470". - String: hash of the code of the account. For a simple account without code it will return "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470".
  • Nonce - String: Nonce của tài khoản. - String: Nonce of the account.
  • StorageHash - Chuỗi: SHA3 của Storageroot. Tất cả các lưu trữ sẽ cung cấp một Merkleproof bắt đầu với Roothash này. - String: SHA3 of the StorageRoot. All storage will deliver a MerkleProof starting with this rootHash.
  • Tài khoản-Chuỗi []: Mảng của Merkletree-Nodes-serialized, bắt đầu bằng nút stateroot, theo đường dẫn của sha3 (địa chỉ) làm khóa. - String[]:Array of rlp-serialized MerkleTree-Nodes, starting with the stateRoot-Node, following the path of the SHA3 (address) as key.
  • StorageProof - Object [] mảng các mục nhập lưu trữ theo yêu cầu. - Object[] Array of storage-entries as requested.
    • Khóa - Chuỗi khóa lưu trữ được yêu cầu. - String The requested storage key.
    • Giá trị - Chuỗi giá trị lưu trữ. - String The storage value.

Thí dụ¶

web3.eth.getProof("0x1234567890123456789012345678901234567890",["0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001"],"latest").then(console.log);>{"address":"0x1234567890123456789012345678901234567890","accountProof":["0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021a0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315b61d9f6bd68bfe587ad0eeceb721a07117ef9fc932f1a88e908eaead8565c19b5645dc9e5b1b6e841c5edbdfd71681a069eb2de283f32c11f859d7bcf93da23990d3e662935ed4d6b39ce3673ec84472a0203d26456312bbc4da5cd293b75b840fc5045e493d6f904d180823ec22bfed8ea09287b5c21f2254af4e64fca76acc5cd87399c7f1ede818db4326c98ce2dc2208a06fc2d754e304c48ce6a517753c62b1a9c1d5925b89707486d7fc08919e0a94eca07b1c54f15e299bd58bdfef9741538c7828b5d7d11a489f9c20d052b3471df475a051f9dd3739a927c89e357580a4c97b40234aa01ed3d5e0390dc982a7975880a0a089d613f26159af43616fd9455bb461f4869bfede26f2130835ed067a8b967bfb80","0xf90211a0395d87a95873cd98c21cf1df9421af03f7247880a2554e20738eec2c7507a494a0bcf6546339a1e7e14eb8fb572a968d217d2a0d1f3bc4257b22ef5333e9e4433ca012ae12498af8b2752c99efce07f3feef8ec910493be749acd63822c3558e6671a0dbf51303afdc36fc0c2d68a9bb05dab4f4917e7531e4a37ab0a153472d1b86e2a0ae90b50f067d9a2244e3d975233c0a0558c39ee152969f6678790abf773a9621a01d65cd682cc1be7c5e38d8da5c942e0a73eeaef10f387340a40a106699d494c3a06163b53d956c55544390c13634ea9aa75309f4fd866f312586942daf0f60fb37a058a52c1e858b1382a8893eb9c1f111f266eb9e21e6137aff0dddea243a567000a037b4b100761e02de63ea5f1fcfcf43e81a372dafb4419d126342136d329b7a7ba032472415864b08f808ba4374092003c8d7c40a9f7f9fe9cc8291f62538e1cc14a074e238ff5ec96b810364515551344100138916594d6af966170ff326a092fab0a0d31ac4eef14a79845200a496662e92186ca8b55e29ed0f9f59dbc6b521b116fea090607784fe738458b63c1942bba7c0321ae77e18df4961b2bc66727ea996464ea078f757653c1b63f72aff3dcc3f2a2e4c8cb4a9d36d1117c742833c84e20de994a0f78407de07f4b4cb4f899dfb95eedeb4049aeb5fc1635d65cf2f2f4dfd25d1d7a0862037513ba9d45354dd3e36264aceb2b862ac79d2050f14c95657e43a51b85c80","0xf90171a04ad705ea7bf04339fa36b124fa221379bd5a38ffe9a6112cb2d94be3a437b879a08e45b5f72e8149c01efcb71429841d6a8879d4bbe27335604a5bff8dfdf85dcea00313d9b2f7c03733d6549ea3b810e5262ed844ea12f70993d87d3e0f04e3979ea0b59e3cdd6750fa8b15164612a5cb6567cdfb386d4e0137fccee5f35ab55d0efda0fe6db56e42f2057a071c980a778d9a0b61038f269dd74a0e90155b3f40f14364a08538587f2378a0849f9608942cf481da4120c360f8391bbcc225d811823c6432a026eac94e755534e16f9552e73025d6d9c30d1d7682a4cb5bd7741ddabfd48c50a041557da9a74ca68da793e743e81e2029b2835e1cc16e9e25bd0c1e89d4ccad6980a041dda0a40a21ade3a20fcd1a4abb2a42b74e9a32b02424ff8db4ea708a5e0fb9a09aaf8326a51f613607a8685f57458329b41e938bb761131a5747e066b81a0a16808080a022e6cef138e16d2272ef58434ddf49260dc1de1f8ad6dfca3da5d2a92aaaadc58080","0xf851808080a009833150c367df138f1538689984b8a84fc55692d3d41fe4d1e5720ff5483a6980808080808080808080a0a319c1c415b271afc0adcb664e67738d103ac168e0bc0b7bd2da7966165cb9518080"],"balance":0,"codeHash":"0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470","nonce":0,"storageHash":"0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421","storageProof":[{"key":"0x0000000000000000000000000000000000000000000000000000000000000000","value":'0',"proof":[]},{"key":"0x0000000000000000000000000000000000000000000000000000000000000001","value":'0',"proof":[]}]}.eth.getProof( "0x1234567890123456789012345678901234567890", ["0x0000000000000000000000000000000000000000000000000000000000000000","0x0000000000000000000000000000000000000000000000000000000000000001"], "latest" ).then(console.log); > { "address": "0x1234567890123456789012345678901234567890", "accountProof": [ "0xf90211a090dcaf88c40c7bbc95a912cbdde67c175767b31173df9ee4b0d733bfdd511c43a0babe369f6b12092f49181ae04ca173fb68d1a5456f18d20fa32cba73954052bda0473ecf8a7e36a829e75039a3b055e51b8332cbf03324ab4af2066bbd6fbf0021a0bbda34753d7aa6c38e603f360244e8f59611921d9e1f128372fec0d586d4f9e0a04e44caecff45c9891f74f6a2156735886eedf6f1a733628ebc802ec79d844648a0a5f3f2f7542148c973977c8a1e154c4300fec92f755f7846f1b734d3ab1d90e7a0e823850f50bf72baae9d1733a36a444ab65d0a6faaba404f0583ce0ca4dad92da0f7a00cbe7d4b30b11faea3ae61b7f1f2b315b61d9f6bd68bfe587ad0eeceb721a07117ef9fc932f1a88e908eaead8565c19b5645dc9e5b1b6e841c5edbdfd71681a069eb2de283f32c11f859d7bcf93da23990d3e662935ed4d6b39ce3673ec84472a0203d26456312bbc4da5cd293b75b840fc5045e493d6f904d180823ec22bfed8ea09287b5c21f2254af4e64fca76acc5cd87399c7f1ede818db4326c98ce2dc2208a06fc2d754e304c48ce6a517753c62b1a9c1d5925b89707486d7fc08919e0a94eca07b1c54f15e299bd58bdfef9741538c7828b5d7d11a489f9c20d052b3471df475a051f9dd3739a927c89e357580a4c97b40234aa01ed3d5e0390dc982a7975880a0a089d613f26159af43616fd9455bb461f4869bfede26f2130835ed067a8b967bfb80", "0xf90211a0395d87a95873cd98c21cf1df9421af03f7247880a2554e20738eec2c7507a494a0bcf6546339a1e7e14eb8fb572a968d217d2a0d1f3bc4257b22ef5333e9e4433ca012ae12498af8b2752c99efce07f3feef8ec910493be749acd63822c3558e6671a0dbf51303afdc36fc0c2d68a9bb05dab4f4917e7531e4a37ab0a153472d1b86e2a0ae90b50f067d9a2244e3d975233c0a0558c39ee152969f6678790abf773a9621a01d65cd682cc1be7c5e38d8da5c942e0a73eeaef10f387340a40a106699d494c3a06163b53d956c55544390c13634ea9aa75309f4fd866f312586942daf0f60fb37a058a52c1e858b1382a8893eb9c1f111f266eb9e21e6137aff0dddea243a567000a037b4b100761e02de63ea5f1fcfcf43e81a372dafb4419d126342136d329b7a7ba032472415864b08f808ba4374092003c8d7c40a9f7f9fe9cc8291f62538e1cc14a074e238ff5ec96b810364515551344100138916594d6af966170ff326a092fab0a0d31ac4eef14a79845200a496662e92186ca8b55e29ed0f9f59dbc6b521b116fea090607784fe738458b63c1942bba7c0321ae77e18df4961b2bc66727ea996464ea078f757653c1b63f72aff3dcc3f2a2e4c8cb4a9d36d1117c742833c84e20de994a0f78407de07f4b4cb4f899dfb95eedeb4049aeb5fc1635d65cf2f2f4dfd25d1d7a0862037513ba9d45354dd3e36264aceb2b862ac79d2050f14c95657e43a51b85c80", "0xf90171a04ad705ea7bf04339fa36b124fa221379bd5a38ffe9a6112cb2d94be3a437b879a08e45b5f72e8149c01efcb71429841d6a8879d4bbe27335604a5bff8dfdf85dcea00313d9b2f7c03733d6549ea3b810e5262ed844ea12f70993d87d3e0f04e3979ea0b59e3cdd6750fa8b15164612a5cb6567cdfb386d4e0137fccee5f35ab55d0efda0fe6db56e42f2057a071c980a778d9a0b61038f269dd74a0e90155b3f40f14364a08538587f2378a0849f9608942cf481da4120c360f8391bbcc225d811823c6432a026eac94e755534e16f9552e73025d6d9c30d1d7682a4cb5bd7741ddabfd48c50a041557da9a74ca68da793e743e81e2029b2835e1cc16e9e25bd0c1e89d4ccad6980a041dda0a40a21ade3a20fcd1a4abb2a42b74e9a32b02424ff8db4ea708a5e0fb9a09aaf8326a51f613607a8685f57458329b41e938bb761131a5747e066b81a0a16808080a022e6cef138e16d2272ef58434ddf49260dc1de1f8ad6dfca3da5d2a92aaaadc58080", "0xf851808080a009833150c367df138f1538689984b8a84fc55692d3d41fe4d1e5720ff5483a6980808080808080808080a0a319c1c415b271afc0adcb664e67738d103ac168e0bc0b7bd2da7966165cb9518080" ], "balance": 0, "codeHash": "0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470", "nonce": 0, "storageHash": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "storageProof": [ { "key": "0x0000000000000000000000000000000000000000000000000000000000000000", "value": '0', "proof": [] }, { "key": "0x0000000000000000000000000000000000000000000000000000000000000001", "value": '0', "proof": [] } ] }