2019-09-06 23:53:10 +08:00

32 lines
839 B
PHP
Executable File

<?php
namespace wstmart\app\model;
/**
* ============================================================================
* 基础模型器
*/
class Chain3 extends Chain3base {
protected $tokenabi;
protected $bytecode;
public function __construct(){
parent::__construct();
}
protected function get_Balance(){
$this->wei=8;
$address = trim(input('post.address'));
$this->web3->eth->getBalance($address , function ($err, $balance) {
if ($err !== null) {
exit(jsonReturn($err->getMessage()));
// echo 'Error: ' . $err->getMessage();
//return;
}else{
$my_balance = $balance->toString();
$my_balance = $my_balance/pow(10,$this->wei);
$data['balance'] = $my_balance;
exit(jsonReturn('',1,$data));
}
});
}
}