def balance(account): return api.send_request('eth_getBalance', [account, "latest"]).text
def peers(): return api.send_request('net_peerCount').text
def transaction_nonce(account): return api.send_request('eth_getTransactionCount', [account, "latest"]).text
def pending_transactions(): return api.send_request('eth_pendingTransactions').text
def block(number): return api.send_request('eth_getBlockByNumber', [number, True]).text
def block_number(): return api.send_request('eth_blockNumber').text
def transaction(transaction_hash): return api.send_request('eth_getTransactionByHash', [transaction_hash]).text
def transaction_receipt(transaction_hash): return api.send_request('eth_getTransactionReceipt', [transaction_hash]).text
def execute(): data = json.loads(request.data) return api.send_request(data['method'], data['params']).text
def sendTransaction(): transaction = json.loads(request.data)['transaction'] return api.send_request('eth_sendRawTransaction', [transaction]).text
def index(): return api.send_request('admin_peers').text