eth_call RPC 메서드
매개변수
거래
객체
필수
로딩 중...
출처:
문자열
로딩 중...
~에
문자열
필수
로딩 중...
가스
정수
로딩 중...
가스 가격
정수
로딩 중...
값
정수
로딩 중...
데이터
문자열
로딩 중...
블록 번호/태그
문자열
필수
로딩 중...
Object
객체
로딩 중...
균형
문자열
로딩 중...
논스
문자열
로딩 중...
코드
문자열
로딩 중...
상태
객체
로딩 중...
stateDiff
정수
로딩 중...
반품
데이터
문자열
로딩 중...
요청
1curl https://docs-demo.moca-testnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--데이터 '{5"jsonrpc": "2.0",6"id": 1,7"method": "eth_call",8"params":[{"to":"0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"]9}'
1curl https://docs-demo.moca-testnet.quiknode.pro/ \2-X POST \3-H "Content-Type: application/json" \4--데이터 '{5"jsonrpc": "2.0",6"id": 1,7"method": "eth_call",8"params":[{"to":"0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"]9}'
1필수 'eth'23클라이언트 = Eth::클라이언트.생성 'testnet'4페이로드 = {5"jsonrpc": "2.0",6"method": "eth_call",7"params":[{"to":"0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"],8"id": "1"9}1011답변 = 클라이언트.전송(페이로드.to_json)12응답을 반환합니다
1필수 'eth'23클라이언트 = Eth::클라이언트.생성 'testnet'4페이로드 = {5"jsonrpc": "2.0",6"method": "eth_call",7"params":[{"to":"0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"],8"id": "1"9}1011답변 = 클라이언트.전송(페이로드.to_json)12응답을 반환합니다
1import { ethers } from "ethers";2(async () => {3const provider = new ethers.JsonRpcProvider("testnet");4const response = await provider.send("eth_call", [5{6"to": "0x0fd43c8fabe26d70dfa4c8b6fa680db39f147460",7"data": "0x919840ad"8},9"최신",10{11"0x0fd43c8fabe26d70dfa4c8b6fa680db39f147460": {12"code": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063919840ad14602d575b600080fd5b60336045565b60408051918252519081900360200190f35b60005a90509056fea265627a7a72315820df124583906aafd283490b866399b6762e2075e1d84214363893c5993a13276f64736f6c63430005110032"13}14}15]);16콘솔.log(응답);17})();
1import { ethers } from "ethers";2(async () => {3const provider = new ethers.JsonRpcProvider("testnet");4const response = await provider.send("eth_call", [5{6"to": "0x0fd43c8fabe26d70dfa4c8b6fa680db39f147460",7"data": "0x919840ad"8},9"최신",10{11"0x0fd43c8fabe26d70dfa4c8b6fa680db39f147460": {12"code": "0x6080604052348015600f57600080fd5b506004361060285760003560e01c8063919840ad14602d575b600080fd5b60336045565b60408051918252519081900360200190f35b60005a90509056fea265627a7a72315820df124583906aafd283490b866399b6762e2075e1d84214363893c5993a13276f64736f6c63430005110032"13}14}15]);16콘솔.log(응답);17})();
1var myHeaders = new Headers();2myHeaders.추가("Content-Type", "application/json");34var raw = JSON.stringify({5"방법": "eth_call",6"params":[{"to":"0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"],7"id": 1,8"jsonrpc": "2.0"9});1011var requestOptions = {12메서드: 'POST',13헤더: myHeaders,14본문: raw,15리디렉션: 'follow'16};1718가져오기("testnet", requestOptions)19.그런 다음(응답 => 응답.text())20.그런 다음(결과 => console.log(result))21.catchcatch (오류 => console.log('error', error));
1var myHeaders = new Headers();2myHeaders.추가("Content-Type", "application/json");34var raw = JSON.stringify({5"방법": "eth_call",6"params":[{"to":"0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"],7"id": 1,8"jsonrpc": "2.0"9});1011var requestOptions = {12메서드: 'POST',13헤더: myHeaders,14본문: raw,15리디렉션: 'follow'16};1718가져오기("testnet", requestOptions)19.그런 다음(응답 => 응답.text())20.그런 다음(결과 => console.log(result))21.catchcatch (오류 => console.log('error', error));
1import 요청2import json34url = "testnet"56페이로드 = json.dumps({7"방법": "eth_call",8"params":[{"to":"0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"],9"id": 1,10"jsonrpc": "2.0"11})12헤더 = {13'Content-Type': 'application/json'14}1516답변 = 요청.요청("POST", url, 헤더=헤더, 데이터=페이로드)1718인쇄(응답.text)19
1import 요청2import json34url = "testnet"56페이로드 = json.dumps({7"방법": "eth_call",8"params":[{"to":"0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"],9"id": 1,10"jsonrpc": "2.0"11})12헤더 = {13'Content-Type': 'application/json'14}1516답변 = 요청.요청("POST", url, 헤더=헤더, 데이터=페이로드)1718인쇄(응답.text)19
1require "uri"2require "json"3require "net/http"45url = URI("testnet")67https = Net::HTTP.new(url.호스트, url.포트)8https.use_ssl = true910요청 = 순::HTTP::POST.새(URL)11요청["Content-Type"] = "application/json"12요청.본문 = JSON.dump({13"방법": "eth_call",14"params":[{"to":"0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"],15"id": 1,16"jsonrpc": "2.0"17})1819답변 = https.요청(요청)20응답을 반환합니다.read_body21
1require "uri"2require "json"3require "net/http"45url = URI("testnet")67https = Net::HTTP.new(url.호스트, url.포트)8https.use_ssl = true910요청 = 순::HTTP::POST.새(URL)11요청["Content-Type"] = "application/json"12요청.본문 = JSON.dump({13"방법": "eth_call",14"params":[{"to":"0x83B72cEDc6D9A4277c3036cb4b7faa699b8ef039","data":"0x70a08231000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"}, "latest"],15"id": 1,16"jsonrpc": "2.0"17})1819답변 = https.요청(요청)20응답을 반환합니다.read_body21
1출처: web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.moca-testnet.quiknode.pro/'))3abi = '[{"constant":True,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":False,"stateMutability":"view","type":"function"}]'4myContract = w3.eth.contract(address="0x0f37613A717a793560DF394928bCc22ed0D8653f", abi=abi)5response = myContract.functions.balanceOf("0xcd2120D608C7FCa8ed6A69016cF7A7562ED730B1").call()6인쇄(응답)
1출처: web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.moca-testnet.quiknode.pro/'))3abi = '[{"constant":True,"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"payable":False,"stateMutability":"view","type":"function"}]'4myContract = w3.eth.contract(address="0x0f37613A717a793560DF394928bCc22ed0D8653f", abi=abi)5response = myContract.functions.balanceOf("0xcd2120D608C7FCa8ed6A69016cF7A7562ED730B1").call()6인쇄(응답)