当前位置: 首页>>代码示例>>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;未经允许,请勿转载。