當前位置: 首頁>>代碼示例>>PHP>>正文


PHP jsonRPCClient::listunspent方法代碼示例

本文整理匯總了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) {
開發者ID:newmight2015,項目名稱:p2pool-donate,代碼行數:31,代碼來源:api.php

示例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);
開發者ID:newmight2015,項目名稱:dicestart,代碼行數:31,代碼來源:head.php

示例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']);
開發者ID:blockstrap,項目名稱:blockstrap.github.io,代碼行數:31,代碼來源:rpc.php


注:本文中的jsonRPCClient::listunspent方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。