Skip to content

Instantly share code, notes, and snippets.

@placecodex
Last active September 5, 2021 00:30
Show Gist options
  • Save placecodex/25e69d7ddad8fcb4ba13004c976765d9 to your computer and use it in GitHub Desktop.
Save placecodex/25e69d7ddad8fcb4ba13004c976765d9 to your computer and use it in GitHub Desktop.
get balance ethereum php , guzzle, curl
try {
$url ='https://api.anyblock.tools/ethereum/ethereum/ropsten/rpc/ac-a196sasasd581576f/';
$client = new Https();
$opts = [
//'timeout' => 4,
'json' => [
'jsonrpc' => '1.0',
'method' => 'eth_getBalance',
'params' => ['0xC18c19eDf','latest'],
'id' => time()
]
];
$request = $client->post($url,$opts);
$array = json_decode($request->getBody()->getContents());
print_r($array);
} catch (\Exception $e) {
// will return user to previous screen with twilio error|
print_r($e->getMessage());
}
@placecodex
Copy link
Author

start

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment