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.
參數
地址
字串
必填
載入中...
區塊編號
字串
必填
載入中...
退貨
結果
字串
載入中...
請求
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'))