Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function eth_accountAmount(){
- $request = wp_remote_get('https://api.etherscan.io/api?module=account&action=balance&address=0xddbd2b932c763ba5b1b7ae3b362eac3e8d40121a&tag=latest&apikey=VYTX1PQH4C1AF5DV7J57CRFQ9ARUDNJ3MX/');
- if (is_wp_error($request))
- {
- return false; // Bail early
- }
- $body = wp_remote_retrieve_body($request);
- $data = json_decode($body);
- foreach($data->result as $result);
- $result = $result / 1000000000000000000;
- echo $result;
- }
- add_shortcode('eth_account_Amount', 'eth_accountAmount');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement