RPC-Methode „eth_call“
To use the eth_call method on the Avalanche C-Chain, ensure that the end of your URL includes ext/bc/C/rpc.
Parameter
Transaktion
Objekt
Wird geladen...
aus
Zeichenkette
Wird geladen...
zu
Zeichenkette
ERFORDERLICH
Wird geladen...
Gas
Ganzzahl
Wird geladen...
Benzinpreis
Ganzzahl
Wird geladen...
Wert
Ganzzahl
Wird geladen...
Daten
Zeichenkette
Wird geladen...
Blocknummer/Tag
Zeichenkette
ERFORDERLICH
Wird geladen...
Rücksendungen
Daten
Zeichenkette
Wird geladen...
Anfrage
1curl https://docs-demo.avalanche-mainnet.quiknode.pro \2-X POST \3-H "Content-Type: application/json" \4--data '{5"method": "eth_call",6"params": [7{8"from": null,9"to": "0x6b175474e89094c44da98b954eedeac495271d0f",10"data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"11},12„aktuell“13],14"id": 1,15"jsonrpc": "2.0"16}'
1curl https://docs-demo.avalanche-mainnet.quiknode.pro \2-X POST \3-H "Content-Type: application/json" \4--data '{5"method": "eth_call",6"params": [7{8"from": null,9"to": "0x6b175474e89094c44da98b954eedeac495271d0f",10"data": "0x70a082310000000000000000000000006E0d01A76C3Cf4288372a29124A26D4353EE51BE"11},12„aktuell“13],14"id": 1,15"jsonrpc": "2.0"16}'
1import { Core } aus sdk23const Kern = new Core({4endpointUrl: "https://docs-demo.avalanche-mainnet.quiknode.pro",5})67Kern.Client8.call({9account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',10data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',11to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',12})13.then(res => console.log(res))14
1import { Core } aus sdk23const Kern = new Core({4endpointUrl: "https://docs-demo.avalanche-mainnet.quiknode.pro",5})67Kern.Client8.call({9account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',10data: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',11to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',12})13.then(res => console.log(res))14
1import { ethers } from "ethers";2(async () => {3const abi = [4{5constant: true,6inputs: [{ internalType: "address", name: "", type: "address" }],7name: "balanceOf",8outputs: [{ internalType: "uint256", name: "", type: "uint256" }],9payable: false,10stateMutability: "view",11type: "function",12},13];14const provider = new ethers.JsonRpcProvider(15"https://docs-demo.avalanche-mainnet.quiknode.pro"16);17const contract = new ethers.Contract(18'0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7',19abi,20provider21)22const response = await contract.balanceOf(23"0x6E0d01A76C3Cf4288372a29124A26D4353EE51BE"24);25console.log(response);26})();27
1import { ethers } from "ethers";2(async () => {3const abi = [4{5constant: true,6inputs: [{ internalType: "address", name: "", type: "address" }],7name: "balanceOf",8outputs: [{ internalType: "uint256", name: "", type: "uint256" }],9payable: false,10stateMutability: "view",11type: "function",12},13];14const provider = new ethers.JsonRpcProvider(15"https://docs-demo.avalanche-mainnet.quiknode.pro"16);17const contract = new ethers.Contract(18'0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7',19abi,20provider21)22const response = await contract.balanceOf(23"0x6E0d01A76C3Cf4288372a29124A26D4353EE51BE"24);25console.log(response);26})();27
1aus web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.avalanche-mainnet.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="0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", abi=abi)5response = myContract.functions.balanceOf("0x6E0d01A76C3Cf4288372a29124A26D4353EE51BE").call()6Drucken(Antwort)
1aus web3 import Web3, HTTPProvider2w3 = Web3(HTTPProvider('https://docs-demo.avalanche-mainnet.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="0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7", abi=abi)5response = myContract.functions.balanceOf("0x6E0d01A76C3Cf4288372a29124A26D4353EE51BE").call()6Drucken(Antwort)
Hast du noch kein Konto?
Erstellen Sie Ihrenendpoint Sekundenschnelle und legen Sie los
Kostenlos loslegen