eth_getCode RPC 方法
参数
地址
字符串
必填
正在加载...
blockNumber
字符串
必填
正在加载...
退货
结果
字符串
正在加载...
请求
1curl https://docs-demo.moca-testnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{"method":"eth_getCode","params":["0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039", "latest"],"id":1,"jsonrpc":"2.0"}'
1curl https://docs-demo.moca-testnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--data '{"method":"eth_getCode","params":["0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039", "latest"],"id":1,"jsonrpc":"2.0"}'
1require 'eth'23client = Eth::Client.create 'https://docs-demo.moca-testnet.quiknode.pro/'4有效载荷 = {5“jsonrpc”: "2.0",6"method": "eth_getCode",7"params":["0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039", "latest"],8"id": "1"9}1011回复 = 客户端.发送(有效载荷.to_json)12返回响应
1require 'eth'23client = Eth::Client.create 'https://docs-demo.moca-testnet.quiknode.pro/'4有效载荷 = {5“jsonrpc”: "2.0",6"method": "eth_getCode",7"params":["0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039", "latest"],8"id": "1"9}1011回复 = 客户端.发送(有效载荷.to_json)12返回响应
1import { ethers } from "ethers";2(async () => {3const provider = new ethers.JsonRpcProvider("https://docs-demo.moca-testnet.quiknode.pro/");4const code = await provider.getCode(5"0x0dBa4f40252492D3457D55aF77f26e84F3750926",6“最新”7);8console.log(code);9})();
1import { ethers } from "ethers";2(async () => {3const provider = new ethers.JsonRpcProvider("https://docs-demo.moca-testnet.quiknode.pro/");4const code = await provider.getCode(5"0x0dBa4f40252492D3457D55aF77f26e84F3750926",6“最新”7);8console.log(code);9})();
1var myHeaders = new Headers();2myHeaders.追加("Content-Type", "application/json");34var raw = JSON.stringify({5“方法”: "eth_getCode",6"params":["0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039", "latest"],7"id": 1,8“jsonrpc”: "2.0"9});1011var requestOptions = {12方法: 'POST',13标题: myHeaders,14正文: raw,15重定向: 'follow'16};1718fetch("https://docs-demo.moca-testnet.quiknode.pro/", requestOptions)19.然后(响应 => 响应.text())20.然后(结果 => 控制台.log(result))21.catch(error => 控制台.log('error', error));22
1var myHeaders = new Headers();2myHeaders.追加("Content-Type", "application/json");34var raw = JSON.stringify({5“方法”: "eth_getCode",6"params":["0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039", "latest"],7"id": 1,8“jsonrpc”: "2.0"9});1011var requestOptions = {12方法: 'POST',13标题: myHeaders,14正文: raw,15重定向: 'follow'16};1718fetch("https://docs-demo.moca-testnet.quiknode.pro/", requestOptions)19.然后(响应 => 响应.text())20.然后(结果 => 控制台.log(result))21.catch(error => 控制台.log('error', error));22
1导入 请求2import json34url = "https://docs-demo.moca-testnet.quiknode.pro/"56有效载荷 = json.dumps({7“方法”: "eth_getCode",8"params":["0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039", "latest"],9"id": 1,10“jsonrpc”: "2.0"11})12标题 = {13“Content-Type”: 'application/json'14}1516回复 = 请求.请求("POST", url, headers=headers, data=有效载荷)1718打印(响应.text)19
1导入 请求2import json34url = "https://docs-demo.moca-testnet.quiknode.pro/"56有效载荷 = json.dumps({7“方法”: "eth_getCode",8"params":["0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039", "latest"],9"id": 1,10“jsonrpc”: "2.0"11})12标题 = {13“Content-Type”: 'application/json'14}1516回复 = 请求.请求("POST", url, headers=headers, data=有效载荷)1718打印(响应.text)19
1var myHeaders = new Headers();2myHeaders.追加("Content-Type", "application/json");34var raw = JSON.stringify({5“方法”: "eth_getCode",6"params":["0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039", "latest"],7"id": 1,8“jsonrpc”: "2.0"9});1011var requestOptions = {12方法: 'POST',13标题: myHeaders,14正文: raw,15重定向: 'follow'16};1718fetch("https://docs-demo.moca-testnet.quiknode.pro/", requestOptions)19.then(response => response.text())20.then(result => console.log(result))21.catch(error => console.log('error', error));22
1var myHeaders = new Headers();2myHeaders.追加("Content-Type", "application/json");34var raw = JSON.stringify({5“方法”: "eth_getCode",6"params":["0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039", "latest"],7"id": 1,8“jsonrpc”: "2.0"9});1011var requestOptions = {12方法: 'POST',13标题: myHeaders,14正文: raw,15重定向: 'follow'16};1718fetch("https://docs-demo.moca-testnet.quiknode.pro/", requestOptions)19.then(response => response.text())20.then(result => console.log(result))21.catch(error => console.log('error', error));22
1来源 web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.moca-testnet.quiknode.pro/'))3print (w3.eth.get_code('0x0dBa4f40252492D3457D55aF77f26e84F3750926','latest'))
1来源 web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.moca-testnet.quiknode.pro/'))3print (w3.eth.get_code('0x0dBa4f40252492D3457D55aF77f26e84F3750926','latest'))