eth_getCode RPC 方法
To use the eth_getCode method on the Avalanche C-Chain, ensure that the end of your URL includes ext/bc/C/rpc.
参数
地址
字符串
必填
正在加载...
blockNumber
字符串
必填
正在加载...
退货
结果
字符串
正在加载...
请求
1curl https://docs-demo.avalanche-mainnet.quiknode.pro \2-X POST \3-H "Content-Type: application/json" \4--data '{5"method": "eth_getCode",6"params": [7"0x5B56438000bAc5ed2c6E0c1EcFF4354aBfFaf889",8“最新”9],10"id": 1,11"jsonrpc": "2.0"12}'
1curl https://docs-demo.avalanche-mainnet.quiknode.pro \2-X POST \3-H "Content-Type: application/json" \4--data '{5"method": "eth_getCode",6"params": [7"0x5B56438000bAc5ed2c6E0c1EcFF4354aBfFaf889",8“最新”9],10"id": 1,11"jsonrpc": "2.0"12}'
1import { ethers } from "ethers";2(async () => {3const provider = new ethers.JsonRpcProvider(4"https://docs-demo.avalanche-mainnet.quiknode.pro"5);6const code = await provider.getCode(7"0x5B56438000bAc5ed2c6E0c1EcFF4354aBfFaf889",8“最新”9);10console.log(code);11})();12
1import { ethers } from "ethers";2(async () => {3const provider = new ethers.JsonRpcProvider(4"https://docs-demo.avalanche-mainnet.quiknode.pro"5);6const code = await provider.getCode(7"0x5B56438000bAc5ed2c6E0c1EcFF4354aBfFaf889",8“最新”9);10console.log(code);11})();12
1来源 web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.avalanche-mainnet.quiknode.pro'))3print (w3.eth.get_code('0x5B56438000bAc5ed2c6E0c1EcFF4354aBfFaf889'))
1来源 web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.avalanche-mainnet.quiknode.pro'))3print (w3.eth.get_code('0x5B56438000bAc5ed2c6E0c1EcFF4354aBfFaf889'))