1"use strict";(self.webpackChunkankr_docs_v2=self.webpackChunkankr_docs_v2||[]).push([["19327"],{52255(e,n,s){s.r(n),s.d(n,{metadata:()=>r,default:()=>h,frontMatter:()=>t,contentTitle:()=>c,toc:()=>d,assets:()=>a});var r=JSON.parse('{"id":"rpc-service/chains/chains-api/harmony/web3","title":"Harmony \u2014 web3, net, eth (1/3)","description":"API reference for Harmony. All methods ->","source":"@site/docs/rpc-service/chains/chains-api/harmony/web3.mdx","sourceDirName":"rpc-service/chains/chains-api/harmony","slug":"/rpc-service/chains/chains-api/harmony/web3","permalink":"/docs/rpc-service/chains/chains-api/harmony/web3","draft":false,"unlisted":false,"editUrl":"https://github.com/w3tech/ankr-docs/tree/main/docs/rpc-service/chains/chains-api/harmony/web3.mdx","tags":[],"version":"current","lastUpdatedAt":1790023853000,"sidebarPosition":1,"frontMatter":{"title":"Harmony \u2014 web3, net, eth (1/3)","displayed_sidebar":"apisidebar","schema_type":"chain-methods","chain":"harmony","sidebar_position":1},"sidebar":"apisidebar","previous":{"title":"Harmony","permalink":"/docs/rpc-service/chains/chains-api/harmony/"},"next":{"title":"Harmony \u2014 web3, net, eth (2/3)","permalink":"/docs/rpc-service/chains/chains-api/harmony/web3-p2"}}'),l=s(74848),i=s(28453);let t={title:"Harmony \u2014 web3, net, eth (1/3)",displayed_sidebar:"apisidebar",schema_type:"chain-methods",chain:"harmony",sidebar_position:1},c="Harmony \u2014 web3, net, eth (1/3)",a={},d=[{value:"<code>web3_clientVersion</code>",id:"web3_clientversion",level:2},{value:"Parameters",id:"parameters",level:3},{value:"Returns",id:"returns",level:3},{value:"Request example",id:"request-example",level:3},{value:"Response example",id:"response-example",level:3},{value:"<code>net_version</code>",id:"net_version",level:2},{value:"Parameters",id:"parameters-1",level:3},{value:"Returns",id:"returns-1",level:3},{value:"Request example",id:"request-example-1",level:3},{value:"Response example",id:"response-example-1",level:3},{value:"<code>eth_protocolVersion</code>",id:"eth_protocolversion",level:2},{value:"Parameters",id:"parameters-2",level:3},{value:"Returns",id:"returns-2",level:3},{value:"Request example",id:"request-example-2",level:3},{value:"Response example",id:"response-example-2",level:3},{value:"<code>eth_syncing</code>",id:"eth_syncing",level:2},{value:"Parameters",id:"parameters-3",level:3},{value:"Returns",id:"returns-3",level:3},{value:"Request example",id:"request-example-3",level:3},{value:"Response example (syncing)",id:"response-example-syncing",level:3},{value:"Response example (not syncing)",id:"response-example-not-syncing",level:3},{value:"<code>eth_gasPrice</code>
1",id:"eth_gasprice",level:2},{value:"Parameters",id:"parameters-4",level:3},{value:"Returns",id:"returns-4",level:3},{value:"Request example",id:"request-example-4",level:3},{value:"Response example",id:"response-example-3",level:3},{value:"<code>eth_accounts</code>",id:"eth_accounts",level:2},{value:"Parameters",id:"parameters-5",level:3},{value:"Returns",id:"returns-5",level:3},{value:"Request example",id:"request-example-5",level:3},{value:"Response example",id:"response-example-4",level:3},{value:"<code>eth_blockNumber</code>",id:"eth_blocknumber",level:2},{value:"Parameters",id:"parameters-6",level:3},{value:"Returns",id:"returns-6",level:3},{value:"Request example",id:"request-example-6",level:3},{value:"Response example",id:"response-example-5",level:3},{value:"<code>eth_getBalance</code>",id:"eth_getbalance",level:2},{value:"Parameters",id:"parameters-7",level:3},{value:"Returns",id:"returns-7",level:3},{value:"Request example",id:"request-example-7",level:3},{value:"Response example",id:"response-example-6",level:3},{value:"<code>eth_getStorageAt</code>",id:"eth_getstorageat",level:2},{value:"Parameters",id:"parameters-8",level:3},{value:"Returns",id:"returns-8",level:3},{value:"Request example",id:"request-example-8",level:3},{value:"Response example",id:"response-example-7",level:3},{value:"<code>eth_getTransactionCount</code>",id:"eth_gettransactioncount",level:2},{value:"Parameters",id:"parameters-9",level:3},{value:"Returns",id:"returns-9",level:3},{value:"Request example",id:"request-example-9",level:3},{value:"Response example",id:"response-example-8",level:3},{value:"<code>eth_getBlockTransactionCountByHash</code>",id:"eth_getblocktransactioncountbyhash",level:2},{value:"Parameters",id:"parameters-10",level:3},{value:"Returns",id:"returns-10",level:3},{value:"Request example:",id:"request-example-10",level:3},{value:"Response example",id:"response-example-9",level:3},{value:"<code>eth_getBlockTransactionCountByNumber</code>
1",id:"eth_getblocktransactioncountbynumber",level:2},{value:"Parameters",id:"parameters-11",level:3},{value:"Returns",id:"returns-11",level:3},{value:"Request example",id:"request-example-11",level:3},{value:"Response example",id:"response-example-10",level:3},{value:"<code>eth_getCode</code>",id:"eth_getcode",level:2},{value:"Parameters",id:"parameters-12",level:3},{value:"Returns",id:"returns-12",level:3},{value:"Request example",id:"request-example-12",level:3},{value:"Response example",id:"response-example-11",level:3},{value:"<code>eth_sendRawTransaction</code>",id:"eth_sendrawtransaction",level:2},{value:"Parameters",id:"parameters-13",level:3},{value:"Returns",id:"returns-13",level:3},{value:"Request example",id:"request-example-13",level:3},{value:"Response example",id:"response-example-12",level:3},{value:"<code>eth_call</code>",id:"eth_call",level:2},{value:"Parameters",id:"parameters-14",level:3},{value:"Returns",id:"returns-14",level:3},{value:"Request example",id:"request-example-14",level:3},{value:"Response example",id:"response-example-13",level:3},{value:"<code>eth_estimateGas</code>",id:"eth_estimategas",level:2},{value:"Parameters",id:"parameters-15",level:3},{value:"Returns",id:"returns-15",level:3},{value:"Request example",id:"request-example-15",level:3},{value:"Response example",id:"response-example-14",level:3}];function o(e){let n={a:"a",blockquote:"blockquote",code:"code",em:"em",h1:"h1",h2:"h2",h3:"h3",header:"header",hr:"hr",li:"li",ol:"ol",p:"p",pre:"pre",ul:"ul",...(0,i.R)(),...e.components},{TryRpc:s}=n;return s||function(e,n){throw Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("TryRpc",!0),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.header,{children:(0,l.jsx)(n.h1,{id:"harmony--web3-net-eth-13",children:"Harmony \u2014 web3, net, eth (1/3)"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsxs)(n.p,{children:["API reference for ",(0,l.jsx)(n.a,{href:"/rpc-service/chains/chains-api/harmony/",children:"Harmony"}),". ",(0,l.jsx)(n.a,{href:"/rpc-service/chains/chains-api/harmony/#methods",children:"All methods ->"})]}),"\n",(0,l.jsxs)(n.p,{children:["Part 1 of 3: 1 \xb7 ",(0,l.jsx)(n.a,{href:"/rpc-service/chains/chains-api/harmony/web3-p2/",children:"2"})," \xb7 ",(0,l.jsx)(n.a,{href:"/rpc-service/chains/chains-api/harmony/web3-p3/",children:"3"})]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"web3_clientversion",children:(0,l.jsx)(n.code,{children:"web3_clientVersion"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Returns the current client version."}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"parameters",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"params"})," (array; required): None."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"}),": the current client version."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"request-example",children:"Request example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "web3_clientVersion",\n "params": [],\n "id": 1\n }\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"web3_clientVersion"}),"\n",(0,l.jsx)(n.h3,{id:"response-example",children:"Response example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "jsonrpc": "2.0",\n "id": 1,\n "result": "Harmony (C) 2023. harmony, version v7647-v4.3.14.rc3-0-g09dba416 (root@ 2023-01-23T16:33:47+0000)"\n}\n'})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h2,{id:"net_version",children:(0,l.jsx)(n.code,{children:"net_version"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Returns the current network ID."}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"parameters-1",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"params"})," (array; required): None."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns-1",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"}),": the current network ID."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"request-example-1",children:"Request example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "net_version",\n "params": [],\n "id": 1\n }\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"net_version"}),"\n",(0,l.jsx)(n.h3,{id:"response-example-1",children:"Response example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "jsonrpc": "2.0",\n "id": 1,\n "result": "1666600000"\n}\n'})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h2,{id:"eth_protocolversion",children:(0,l.jsx)(n.code,{children:"eth_protocolVersion"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Returns the current Ethereum protocol version."}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"parameters-2",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"params"})," (array; required): None."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns-2",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"}),": the current Ethereum protocol version."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"request-example-2",children:"Request example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "eth_protocolVersion",\n "params": [],\n "id": 1\n }\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"eth_protocolVersion"}),"\n",(0,l.jsx)(n.h3,{id:"response-example-2",children:"Response example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "jsonrpc": "2.0",\n "result": "0x1",\n "id": 1\n}\n'})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h2,{id:"eth_syncing",children:(0,l.jsx)(n.code,{children:"eth_syncing"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Returns an object with data about the sync status or false."}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"parameters-3",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"params"})," (array; required): None."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns-3",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<object>"}),"|",(0,l.jsx)(n.code,{children:"<boolean>"}),": an object with sync status data or ",(0,l.jsx)(n.code,{children:"false"}),", when not syncing:","\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"startingBlock"})," (quantity): the block at which the import started (will only be reset, after the sync reached its head)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"currentBlock"})," (quantity): the current block, same as ",(0,l.jsx)(n.code,{children:"eth_blockNumber"}),"."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"highestBlock"})," (quantity): the estimated highest block."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"request-example-3",children:"Request example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "eth_syncing",\n "params": [],\n "id": 1\n }\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"eth_syncing"}),"\n",(0,l.jsx)(n.h3,{id:"response-example-syncing",children:"Response example (syncing)"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "id": 1,\n "jsonrpc": "2.0",\n "result": {\n "startingBlock": "0x384",\n "currentBlock": "0x386",\n "highestBlock": "0x454"\n }\n}\n'})}),"\n",(0,l.jsx)(n.h3,{id:"response-example-not-syncing",children:"Response example (not syncing)"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "jsonrpc": "2.0",\n "id": 1,\n "result": false\n}\n'})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h2,{id:"eth_gasprice",children:(0,l.jsx)(n.code,{children:"eth_gasPrice"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Returns the current price per gas in wei."}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"parameters-4",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"params"})," (array; required): None."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns-4",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (quantity): the current gas price in wei."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"request-example-4",children:"Request example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "eth_gasPrice",\n "params": [],\n "id": 1\n }\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"eth_gasPrice"}),"\n",(0,l.jsx)(n.h3,{id:"response-example-3",children:"Response example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "jsonrpc": "2.0",\n "id": 1,\n "result": "0x22ecb25c00"\n}\n'})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h2,{id:"eth_accounts",children:(0,l.jsx)(n.code,{children:"eth_accounts"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Returns a list of addresses owned by client."}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"parameters-5",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"params"})," (array): None."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns-5",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<array>"})," (string; data, 20 bytes): addresses owned by the client."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"request-example-5",children:"Request example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "eth_accounts",\n "params": [],\n "id": 1\n }\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"eth_accounts"}),"\n",(0,l.jsx)(n.h3,{id:"response-example-4",children:"Response example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "id": 1,\n "jsonrpc": "2.0",\n "result": [\n "0x407d73d8a49eeb85d32cf465507dd71d507100c1"\n ]\n}\n'})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h2,{id:"eth_blocknumber",children:(0,l.jsx)(n.code,{children:"eth_blockNumber"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Returns the number of most recent block."}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"parameters-6",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"params"})," (array; required): None."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns-6",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (quantity): the current block number the client is on."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"request-example-6",children:"Request example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "eth_blockNumber",\n "params": [],\n "id": 1\n }\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"eth_blockNumber"}),"\n",(0,l.jsx)(n.h3,{id:"response-example-5",children:"Response example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "jsonrpc": "2.0",\n "id": 1,\n "result": "0x23ea004"\n}\n'})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h2,{id:"eth_getbalance",children:(0,l.jsx)(n.code,{children:"eth_getBalance"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Returns the balance of the account specified by address."}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"parameters-7",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.c
1ode,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"params"})," (array; required):"]}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (data, 20 bytes): an address to check for balance."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (quantity|tag): either the hex value of a ",(0,l.jsx)(n.em,{children:"block number"})," or one of the following ",(0,l.jsx)(n.em,{children:"block tags"}),":","\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"earliest"}),": the lowest numbered block available on the client."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"finalized"}),": the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"safe"}),": the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"latest"}),": the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"pending"}),": a sample next block built by the client on top of the ",(0,l.jsx)(n.code,{children:"latest"})," and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns-7",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (quantity): the current balance in wei."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"request-example-7",children:"Request example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "eth_getBalance",\n "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"],\n "id": 1\n }\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"eth_getBalance",params:["0x8D97689C9818892B700e27F316cc3E41e17fBeb9","latest"]}),"\n",(0,l.jsx)(n.h3,{id:"response-example-6",children:"Response example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "jsonrpc": "2.0",\n "id": 1,\n "result": "0x2c85c3ecfcb5fb"\n}\n'})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h2,{id:"eth_getstorageat",children:(0,l.jsx)(n.code,{children:"eth_getStorageAt"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Returns the value from a storage position at an address specified."}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"parameters-8",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"params"})," (array; required):"]}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (data, 20 bytes): an address of the storage (hex encoded)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (quantity): a slot position in the storage (hex encoded unsigned integer)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (quantity|tag): either the hex value of a ",(0,l.jsx)(n.em,{children:"block number"})," or one of the following ",(0,l.jsx)(n.em,{children:"block tags"}),":"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"earliest"}),": the lowest numbered block available on the client."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"finalized"}),": the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"safe"}),": the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"latest"}),": the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"pending"}),": a sample next block built by the client on top of the ",(0,l.jsx)(n.code,{children:"latest"})," and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns-8",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (data): the value at this storage position."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"request-example-8",children:"Request example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "eth_getStorageAt",\n "params": ["0x295a70b2de5e3953354a6a8344e616ed314d7251", "0x0", "latest"],\n "id": 1\n }\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"eth_getStorageAt",params:["0x295a70b2de5e3953354a6a8344e616ed314d7251","0x0","latest"]}),"\n",(0,l.jsx)(n.h3,{id:"response-example-7",children:"Response example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "jsonrpc": "2.0",\n "id": 1,\n "result": "0x0000000000000000000000000000000000000000000000000000000000000000"\n}\n'})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h2,{id:"eth_gettransactioncount",children:(0,l.jsx)(n.code,{children:"eth_getTransactionCount"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Returns the number of transactions sent from an address."}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"parameters-9",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"params"})," (array; required):"]}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (data, 20 bytes): an address."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (quantity|tag): either the hex value of a ",(0,l.jsx)(n.em,{children:"block number"})," or one of the following ",(0,l.jsx)(n.em,{children:"block tags"}),":"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"earliest"}),": the lowest numbered block available on the client."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"finalized"}),": the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"safe"}),": the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"latest"}),": the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"pending"}),": a sample next block built by the client on top of the ",(0,l.jsx)(n.code,{children:"latest"})," and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns-9",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (quantity): the number of transactions send from this address."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"request-example-9",children:"Request example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "eth_getTransactionCount",\n "params": ["0x8D97689C9818892B700e27F316cc3E41e17fBeb9", "latest"],\n "id": 1\n }\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"eth_getTransactionCount",params:["0x8D97689C9818892B700e27F316cc3E41e17fBeb9","latest"]}),"\n",(0,l.jsx)(n.h3,{id:"response-example-8",children:"Response example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "jsonrpc": "2.0",\n "id": 1,\n "result": "0x9"\n}\n'})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h2,{id:"eth_getblocktransactioncountbyhash",children:(0,l.jsx)(n.code,{children:"eth_getBlockTransactionCountByHash"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Returns the number of transactions in a block specified by block hash."}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"parameters-10",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"params"})," (array; required):"]}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (data, 32 bytes): a block hash."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns-10",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (quantity): the number of transactions in this block."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"request-example-10",children:"Request example:"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "eth_getBlockTransactionCountByHash",\n "params": ["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"],\n "id": 1\n }\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"eth_getBlockTransactionCountByHash",params:["0x829df9bb801fc0494abf2f443423a49ffa32964554db71b098d332d87b70a48b"]}),"\n",(0,l.jsx)(n.h3,{id:"response-example-9",children:"Response example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "jsonrpc": "2.0",\n "id": 1,\n "result": "0x7b"\n}\n'})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h2,{id:"eth_getblocktransactioncountbynumber",children:(0,l.jsx)(n.code,{children:"eth_getBlockTransactionCountByNumber"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Returns the number of transactions in the block specified by number."}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"parameters-11",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"params"})," (array; required):"]}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (quantity|tag): either the hex value of a ",(0,l.jsx)(n.em,{children:"block number"})," or one of the following ",(0,l.jsx)(n.em,{children:"block tags"}),":","\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"earliest"}),": the lowest numbered block available on the client."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"finalized"}),": the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"safe"}),": the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"latest"}),": the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"pending"}),": a sample next block built by the client on top of the ",(0,l.jsx)(n.code,{children:"latest"})," and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns-11",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (quantity): the number of transactions in this block."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"request-example-11",children:"Request example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "eth_getBlockTransactionCountByNumber",\n "params": ["0x36c1d18"],\n "id": 1\n }\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"eth_getBlockTransactionCountByNumber",params:["0x36c1d18"]}),"\n",(0,l.jsx)(n.h3,{id:"response-example-
110",children:"Response example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "jsonrpc": "2.0",\n "id": 1,\n "result": "0xb6"\n}\n'})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h2,{id:"eth_getcode",children:(0,l.jsx)(n.code,{children:"eth_getCode"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Returns code at a given address."}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"parameters-12",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"params"})," (array; required):"]}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (data, 20 bytes): an address to get the code from."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (quantity|tag): either the hex value of a ",(0,l.jsx)(n.em,{children:"block number"})," or one of the following ",(0,l.jsx)(n.em,{children:"block tags"}),":","\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"earliest"}),": the lowest numbered block available on the client."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"finalized"}),": the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"safe"}),": the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"latest"}),": the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"pending"}),": a sample next block built by the client on top of the ",(0,l.jsx)(n.code,{children:"latest"})," and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns-12",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (data): the code from the given address."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"request-example-12",children:"Request example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "eth_getCode",\n "params": ["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x2"],\n "id": 1\n }\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"eth_getCode",params:["0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b","0x2"]}),"\n",(0,l.jsx)(n.h3,{id:"response-example-11",children:"Response example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "jsonrpc": "2.0",\n "id": 1,\n "result": "0x"\n}\n'})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h2,{id:"eth_sendrawtransaction",children:(0,l.jsx)(n.code,{children:"eth_sendRawTransaction"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Creates new message call transaction or a contract creation for signed transactions."}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"parameters-13",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"params"})," (array; required):"]}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (data): the signed transaction data."]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns-13",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (data, 32 bytes): the transaction hash, or the zero hash if the transaction is not yet available."]}),"\n"]}),"\n",(0,l.jsxs)(n.p,{children:["Use ",(0,l.jsx)(n.a,{href:"/rpc-service/chains/chains-api/harmony/web3-p2/#eth_gettransactionreceipt",children:"eth_getTransactionReceipt"})," to get the contract address, after the transaction was mined, when you created a contract."]}),"\n",(0,l.jsx)(n.h3,{id:"request-example-13",children:"Request example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "eth_sendRawTransaction",\n "params": ["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"],\n "id": 1\n }\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"eth_sendRawTransaction",params:["0xd46e8dd67c5d32be8d46e8dd67c5d32be8058bb8eb970870f072445675058bb8eb970870f072445675"]}),"\n",(0,l.jsx)(n.h3,{id:"response-example-12",children:"Response example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "id": 1,\n "jsonrpc": "2.0",\n "result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"\n}\n'})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h2,{id:"eth_call",children:(0,l.jsx)(n.code,{children:"eth_call"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Executes a new message call immediately without creating a transaction on the blockchain."}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"parameters-14",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"params"})," (array; required):"]}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"<object>"})," (hex encoded): the transaction object:"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"from"})," (string; data, 20 bytes; optional): the address the transaction is sent from."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"to"})," (string; data, 20 bytes): the address the transaction is directed to."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"gas"})," (string; quantity; optional): the gas provided for the transaction execution. ",(0,l.jsx)(n.code,{children:"eth_call"})," consumes zero gas, but this parameter may be needed by some executions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"gasPrice"})," (string; quantity; optional): the gas price willing to be paid by the sender in wei."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"value"})," (string; quantity;
1 optional): the value sent with this transaction, in wei."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"data"})," (string; data; optional): the hash of the method signature and encoded parameters."]}),"\n"]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (quantity|tag): either the hex value of a ",(0,l.jsx)(n.em,{children:"block number"})," or one of the following ",(0,l.jsx)(n.em,{children:"block tags"}),":"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"earliest"}),": the lowest numbered block available on the client."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"finalized"}),": the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"safe"}),": the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"latest"}),": the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"pending"}),": a sample next block built by the client on top of the ",(0,l.jsx)(n.code,{children:"latest"})," and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns-14",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (hex encoded bytes): the return value of executed contract."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"request-example-14",children:"Request example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "eth_call",\n "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"],\n "id": 1\n}\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"eth_call",params:[{from:null,to:"0x6b175474e89094c44da98b954eedeac495271d0f",data:"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"},"latest"]}),"\n",(0,l.jsx)(n.h3,{id:"response-example-13",children:"Response example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "jsonrpc": "2.0",\n "id": 1,\n "result": "0x0000000000000000000000000000000000000000000000000858898f93629000"\n}\n'})}),"\n",(0,l.jsx)(n.hr,{}),"\n",(0,l.jsx)(n.h2,{id:"eth_estimategas",children:(0,l.jsx)(n.code,{children:"eth_estimateGas"})}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsx)(n.p,{children:"Generates and returns an estimate of how much gas is necessary to allow the transaction to complete."}),"\n"]}),"\n",(0,l.jsx)(n.p,{children:"The transaction will not be added to the blockchain. Note that the estimate may be significantly more than the amount of gas actually used by the transaction, for a variety of reasons including EVM mechanics and node performance."}),"\n",(0,l.jsx)(n.h3,{id:"parameters-15",children:"Parameters"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"id"})," (integer; required): a request ID (example: 1)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"jsonrpc"})," (string; required): a JSON RPC spec used (example: 2.0)."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"method"})," (string; required): a method used for the request."]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"params"})," (array; required):"]}),"\n",(0,l.jsxs)(n.ol,{children:["\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"<object>"})," (hex encoded): the transaction object:"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"from"})," (string; data, 20 bytes; optional): the address the transaction is sent from."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"to"})," (string; data, 20 bytes; optional): the address the transaction is directed to."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"gas"})," (string; quantity; optional): the gas provided for the transaction execution. ",(0,l.jsx)(n.code,{children:"eth_call"})," consumes zero gas, but this parameter may be needed by some executions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"gasPrice"})," (string; quantity; optional): the gas price willing to be paid by the sender in wei."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"value"})," (string; quantity;
1 optional): the value sent with this transaction, in wei."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"data"})," (string; data; optional): the hash of the method signature and encoded parameters."]}),"\n"]}),"\n"]}),"\n",(0,l.jsxs)(n.li,{children:["\n",(0,l.jsxs)(n.p,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (quantity|tag; optional): either a HEX value of a ",(0,l.jsx)(n.em,{children:"block number"})," or one of the following ",(0,l.jsx)(n.em,{children:"block tags"}),":"]}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"earliest"}),": the lowest numbered block available on the client."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"finalized"}),": the most recent crypto-economically secure block; cannot be re-orged outside of manual intervention driven by community coordination."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"safe"}),": the most recent block that is safe from re-orgs under honest majority and certain synchronicity assumptions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"latest"}),": the most recent block in the canonical chain observed by the client; this block can be re-orged out of the canonical chain even under healthy/normal conditions."]}),"\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"pending"}),": a sample next block built by the client on top of the ",(0,l.jsx)(n.code,{children:"latest"})," and containing the set of transactions usually taken from local mempool. In other words, it is the block that has not been mined yet."]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"returns-15",children:"Returns"}),"\n",(0,l.jsx)("br",{}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:[(0,l.jsx)(n.code,{children:"<string>"})," (quantity): the amount of gas used."]}),"\n"]}),"\n",(0,l.jsx)(n.h3,{id:"request-example-15",children:"Request example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-shell",children:'curl -X POST https://rpc.ankr.com/harmony/YOUR_ANKR_API_KEY \\\n-H \'Content-Type: application/json\' \\\n-d \'{\n "jsonrpc": "2.0",\n "method": "eth_estimateGas",\n "params": [{"from":null,"to":"0x6b175474e89094c44da98b954eedeac495271d0f","data":"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"}, "latest"],\n "id": 1\n}\'\n'})}),"\n",(0,l.jsx)(s,{chain:"harmony",method:"eth_estimateGas",params:[{from:null,to:"0x6b175474e89094c44da98b954eedeac495271d0f",data:"0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"},"latest"]}),"\n",(0,l.jsx)(n.h3,{id:"response-example-14",children:"Response example"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-json",children:'{\n "jsonrpc": "2.0",\n "id": 1,\n "result": "0x53b8"\n}\n'})}),"\n",(0,l.jsx)(n.hr,{})]})}function h(e={}){let{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(o,{...e})}):o(e)}},28453(e,n,s){s.d(n,{R:()=>t,x:()=>c});var r=s(96540);let l={},i=r.createContext(l);function t(e){let n=r.useContext(i);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:t(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.