本文整理汇总了PHP中jsonRPCClient::listunspent方法的典型用法代码示例。如果您正苦于以下问题:PHP jsonRPCClient::listunspent方法的具体用法?PHP jsonRPCClient::listunspent怎么用?PHP jsonRPCClient::listunspent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jsonRPCClient
的用法示例。
在下文中一共展示了jsonRPCClient::listunspent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: VALUES
$coin = 'DRK';
}
$insert_query = $db->prepare("INSERT INTO `address` (`vtc`, `type`, `address`) VALUES (:vtc, :type, :address)");
$insert_query->bindParam(':vtc', $_POST['address'], PDO::PARAM_STR);
$insert_query->bindParam(':type', $coin, PDO::PARAM_STR);
$insert_query->bindParam(':address', $address, PDO::PARAM_STR);
$insert_query->execute();
}
echo $address;
break;
case 'balance':
if ($_SERVER['REMOTE_ADDR'] != $allow) {
die;
}
$i = 0;
$a = $darkcoin->listunspent(121, 1000);
while (count($a) > $i) {
// Есть ли в базе эта транзакция?
$select_query = $db->prepare("SELECT * FROM `income` WHERE `txid` =:id AND `type` = 'DRK' AND `address` =:address");
$select_query->bindParam(':id', $a["{$i}"]["txid"], PDO::PARAM_STR);
$select_query->bindParam(':address', $a["{$i}"]["address"], PDO::PARAM_STR);
$select_query->execute();
if ($select_query->rowCount() > 0) {
$i++;
continue;
}
// Кто оплачивает?
$select_query = $db->prepare("SELECT * FROM `address` WHERE `address` =:address");
$select_query->bindParam(':address', $a["{$i}"]["address"], PDO::PARAM_STR);
$select_query->execute();
if ($select_query->rowCount() != 1) {
示例2: array
$rnd = (int) $rnd;
if ($rnd % 100 <= 49) {
//loose
$intx = array(array("txid" => $stx, "vout" => $kvin));
$ttt = $bet - LOOSER_BACK - TRANSACTION_FEE;
$inadd = array($playeraddress => LOOSER_BACK, DELIVER_FUNDS => $ttt);
$play_log["outcome"] = 0;
$play_log["sumout"] = LOOSER_BACK;
} else {
//win
$betvalue = $bet;
$oddvalue = $odd;
$win = $betvalue * $oddvalue;
$intx = array(array("txid" => $stx, "vout" => $kvin));
//prepare to pay the winner
$money = $ftc->listunspent();
$sumpay = 0;
foreach ($money as $cash) {
$sumpay += $cash["amount"];
$intx[] = array("txid" => $cash["txid"], "vout" => $cash["vout"]);
if ($sumpay > $win + TRANSACTION_FEE) {
break;
}
}
$inadd = array($playeraddress => $win, DELIVER_FUNDS => $sumpay - $win);
$play_log["outcome"] = 1;
$play_log["sumout"] = $win;
}
//end else win
//create output tx
$tl = $ftc->createrawtransaction($intx, $inadd);
示例3: intval
$obj['hash'] = $op;
}
}
}
}
}
if ($balance) {
$obj['balance'] = intval($balance * 100000000);
}
if ($received) {
$obj['received'] = intval($received * 100000000);
}
if ($txs) {
$obj['tx_count'] = count($txs);
}
$unspents = $bitcoind->listunspent(1, 9999999, [$obj['address']]);
if ($unspents) {
if (is_array($unspents) && count($unspents) > 0) {
$balance = 0;
foreach (array_reverse($unspents) as $tx) {
$balance = $balance + intval($tx['amount'] * 100000000);
}
$obj['balance'] = $balance;
}
}
}
} else {
if ($call == 'block') {
$obj = ["blockchain" => $blockchain, "height" => "N/A", "hash" => "N/A", "prev" => "N/A", "next" => "N/A", "tx_count" => 0, "time" => "N/A"];
if (isset($_GET['id']) && $_GET['id']) {
$height = intval($_GET['id']);