当前位置: 首页>>代码示例>>PHP>>正文


PHP jsonRPCClient::getnewaddress方法代码示例

本文整理汇总了PHP中jsonRPCClient::getnewaddress方法的典型用法代码示例。如果您正苦于以下问题:PHP jsonRPCClient::getnewaddress方法的具体用法?PHP jsonRPCClient::getnewaddress怎么用?PHP jsonRPCClient::getnewaddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在jsonRPCClient的用法示例。


在下文中一共展示了jsonRPCClient::getnewaddress方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: json_encode

<?php

$included = true;
include '../../inc/db-conf.php';
include '../../inc/wallet_driver.php';
$wallet = new jsonRPCClient($driver_login);
include '../../inc/functions.php';
if (empty($_GET['_unique']) || mysql_num_rows(mysql_query("SELECT `id` FROM `players` WHERE `hash`='" . prot($_GET['_unique']) . "' LIMIT 1")) == 0) {
    exit;
}
$player = mysql_fetch_array(mysql_query("SELECT `id` FROM `players` WHERE `hash`='" . prot($_GET['_unique']) . "' LIMIT 1"));
$new_addr = $wallet->getnewaddress();
mysql_query("INSERT INTO `deposits` (`player_id`,`address`) VALUES ({$player['id']},'{$new_addr}')");
echo json_encode(array('confirmed' => $new_addr));
开发者ID:tellurion-project,项目名称:CoinWheel,代码行数:14,代码来源:generate_address.php

示例2: getWallet

 function getWallet($token = "Unset")
 {
     if ($token == "Unset") {
         return null;
     } else {
         $bitcoind = new jsonRPCClient('http://' . $this->__get("username") . ':' . $this->__get("password") . '@' . $this->__get("btcserver") . ':' . $this->__get("btcport") . '/');
         $newaddr = $bitcoind->getnewaddress(md5($token));
         return $newaddr;
     }
     return null;
 }
开发者ID:djbakerman,项目名称:botjack,代码行数:11,代码来源:DanCoin.php

示例3: elseif

        $booked = $data["booked"];
        if ($row_address_a["creation_date"] > "2011-10-11 00:00:00") {
            if ($received == 0) {
                $new = false;
                echo "<tr><td>{$row_address_a['address']}</td><td style=\"text-align: right\">" . nice_format($received, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format($booked, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format($pending, true, 0, 8) . "</td></tr>\r\n";
            } elseif ($pending > 0) {
                echo "<tr><td onclick=\"this.innerHTML='{$row_address_a['address']}'; this.onclick = 'function {}'\">" . substr($row_address_a["address"], 0, 5) . "..." . substr($row_address_a["address"], -3, 3) . "</td><td style=\"text-align: right\">" . nice_format($received, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format($booked, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format($pending, true, 0, 8) . "</td></tr>\r\n";
            } else {
                echo "<tr><td onclick=\"this.innerHTML='{$row_address_a['address']}'; this.onclick = 'function {}'\">" . substr($row_address_a["address"], 0, 5) . "..." . substr($row_address_a["address"], -3, 3) . "</td><td style=\"text-align: right\">" . nice_format($received, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format($booked, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format($pending, true, 0, 8) . "</td></tr>\r\n";
            }
        } else {
            echo "<tr><td onclick=\"this.innerHTML='{$row_address_a['address']}'\">" . substr($row_address_a["address"], 0, 5) . "..." . substr($row_address_a["address"], -3, 3) . "</td><td>? (old address)</td><td>? (old address)</td><td>? (old address)</td></tr>\r\n";
        }
    }
    if ($new) {
        $address = $bitcoin->getnewaddress();
        $ins_address_a = "INSERT INTO deposit_address (currency, address, user, booked, creation_date) VALUES ('BTC', '{$address}', '{$_SESSION['user_id']}', '0', NOW())";
        mysql_query($ins_address_a);
        echo "<tr><td>{$address}</td><td style=\"text-align: right\">" . nice_format(0, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format(0, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format(0, true, 0, 8) . "</td></tr>\r\n";
    }
} else {
    $address = $bitcoin->getnewaddress();
    echo "<tr><td>{$address}</td><td>0</td><td>0</td><td>0</td></tr>\r\n";
    $ins_address_a = "INSERT INTO deposit_address (currency, address, user, booked, creation_date) VALUES ('BTC', '{$address}', '{$_SESSION['user_id']}', '0', NOW())";
    mysql_query($ins_address_a);
}
?>
</table>
<br />
Transfer any amount to any of the addresses, preferably to one of the new ones for best anonymity.
</p>
开发者ID:rhartness,项目名称:slc24,代码行数:31,代码来源:deposit_btc_cont.php

示例4: LTC_transaction

 public static function LTC_transaction()
 {
     $usr = usr::getCurrentUser(1);
     if ($usr == null) {
         header('Location: /');
         exit;
     }
     $at_ltc = new AtLtc();
     $exist = $at_ltc->findBy(array('UID' => $usr->getId(), 'type' => 0, 'done' => 0));
     if ($exist == true) {
         $currentAddress = Core::validate($_POST['currentAddress']);
         if ($currentAddress == $at_ltc->getAddress()) {
             Core::printErrorJson(URL_ERROR . self::UNUSED_COIN_ADDRESS);
         } else {
             Core::printSuccessJson($at_ltc->getAddress());
         }
         return;
     }
     $wallets = self::LTC_MinAndMaxWallets();
     if ($wallets['min'] == null) {
         Core::printErrorJson(URL_SERVER_ERROR);
         exit;
     }
     $ourAccount = $wallets['min']['account'];
     $litecoin = new jsonRPCClient('http://' . LTC_RPC_USER . ':' . LTC_RPC_PASSWORD . '@' . LTC_RPC_HOST . ':' . LTC_RPC_PORT . '/');
     try {
         $address = $litecoin->getnewaddress($ourAccount);
     } catch (Exception $e) {
         Core::printErrorJson(URL_SERVER_ERROR);
         return;
     }
     $at_ltc->setUID($usr->getId());
     $at_ltc->setAddress($address);
     $at_ltc->setType(0);
     $at_ltc->setDone(0);
     $at_ltc->insert();
     Core::printSuccessJson($address);
 }
开发者ID:Christian1998,项目名称:php_btc_exchange,代码行数:38,代码来源:moneyController.php

示例5: die

     //die("nocoin");
     $isvalid = $vertcoin->validateaddress($_POST['address']);
     if (!$isvalid['isvalid']) {
         die("invalid");
     }
     $query_select = $db->prepare("SELECT * FROM `address` WHERE `vtc` = :address AND `type` = :type");
     $query_select->bindParam(':address', $_POST['address'], PDO::PARAM_STR);
     $query_select->bindParam(':type', $_POST['coin'], PDO::PARAM_STR);
     $query_select->execute();
     if ($query_select->rowCount() > 0) {
         $row = $query_select->fetch();
         $address = $row['address'];
     } else {
         switch ($_POST['coin']) {
             default:
                 $address = $darkcoin->getnewaddress();
                 $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;
开发者ID:newmight2015,项目名称:p2pool-donate,代码行数:31,代码来源:api.php

示例6: elseif

        $booked = $data["booked"];
        if ($row_address_a["creation_date"] > "2011-10-11 00:00:00") {
            if ($received == 0) {
                $new = false;
                echo "<tr><td>{$row_address_a['address']}</td><td style=\"text-align: right\">" . nice_format($received, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format($booked, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format($pending, true, 0, 8) . "</td></tr>\r\n";
            } elseif ($pending > 0) {
                echo "<tr><td onclick=\"this.innerHTML='{$row_address_a['address']}'; this.onclick = 'function {}'\">" . substr($row_address_a["address"], 0, 5) . "..." . substr($row_address_a["address"], -3, 3) . "</td><td style=\"text-align: right\">" . nice_format($received, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format($booked, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format($pending, true, 0, 8) . "</td></tr>\r\n";
            } else {
                echo "<tr><td onclick=\"this.innerHTML='{$row_address_a['address']}'; this.onclick = 'function {}'\">" . substr($row_address_a["address"], 0, 5) . "..." . substr($row_address_a["address"], -3, 3) . "</td><td style=\"text-align: right\">" . nice_format($received, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format($booked, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format($pending, true, 0, 8) . "</td></tr>\r\n";
            }
        } else {
            echo "<tr><td onclick=\"this.innerHTML='{$row_address_a['address']}'\">" . substr($row_address_a["address"], 0, 5) . "..." . substr($row_address_a["address"], -3, 3) . "</td><td>? (old address)</td><td>? (old address)</td><td>? (old address)</td></tr>\r\n";
        }
    }
    if ($new) {
        $address = $namecoin->getnewaddress();
        $ins_address_a = "INSERT INTO deposit_address (currency, address, user, booked, creation_date) VALUES ('NMC', '{$address}', '{$_SESSION['user_id']}', '0', NOW())";
        mysql_query($ins_address_a);
        echo "<tr><td>{$address}</td><td style=\"text-align: right\">" . nice_format(0, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format(0, true, 0, 8) . "</td><td style=\"text-align: right\">" . nice_format(0, true, 0, 8) . "</td></tr>\r\n";
    }
} else {
    $address = $namecoin->getnewaddress();
    echo "<tr><td>{$address}</td><td>0</td><td>0</td><td>0</td></tr>\r\n";
    $ins_address_a = "INSERT INTO deposit_address (currency, address, user, booked, creation_date) VALUES ('NMC', '{$address}', '{$_SESSION['user_id']}', '0', NOW())";
    mysql_query($ins_address_a);
}
?>
</table>
<br />
Transfer any amount to any of the addresses, preferably to one of the new ones for best anonymity.
</p>
开发者ID:rhartness,项目名称:slc24,代码行数:31,代码来源:deposit_nmc_cont.php

示例7: jsonRPCClient

    $orderName = "John Doe";
    $shippingAddress = "No Address Supplied";
    $showCoinAddress = "False";
    $email = "no@email.com";
}
?>
<!DOCTYPE html>
<html>
<head>
<?php 
$bitcoin = new jsonRPCClient("http://{$rpcuser}:{$rpcpass}@{$rpcserver}:{$rpcport}/");
if ($showCoinAddress == True) {
    if ($debug == True) {
        $newAddress = "DEBUGGED TURNED ON";
    } else {
        $newAddress = $bitcoin->getnewaddress("");
        //$newAddress = "Lfxu6TjMXJsfSyce1ufWj2uVcoAALrRhmS";
    }
} else {
    $newAddress = "Click Submit Above For Address";
}
//END DEBUG
?>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>View shopping cart</title>
<link href="style/style.css" rel="stylesheet" type="text/css">
<style>
      html, body, #map-canvas {
        height: 400px;
		width: 500px;
开发者ID:jpcsupplies,项目名称:LimeCart,代码行数:31,代码来源:view_cart.php

示例8: switch

     }
     $query_select = $db->prepare("SELECT * FROM `address` WHERE `vtc` = :address AND `type` = :type");
     $query_select->bindParam(':address', $_POST['address'], PDO::PARAM_STR);
     $query_select->bindParam(':type', $_POST['coin'], PDO::PARAM_STR);
     $query_select->execute();
     if ($query_select->rowCount() > 0) {
         $row = $query_select->fetch();
         $address = $row['address'];
     } else {
         switch ($_POST['coin']) {
             default:
                 $address = $darkcoin->getnewaddress();
                 $coin = 'DRK';
                 break;
             case "FTC":
                 $address = $feathercoin->getnewaddress();
                 $coin = 'FTC';
                 break;
         }
         $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':
     balance($darkcoin->listunspent(121, 1000), 'DRK');
     balance($feathercoin->listunspent(121, 1000), 'FTC');
     break;
开发者ID:newmight2015,项目名称:p2pool-donate,代码行数:31,代码来源:api.php

示例9: funct_Billing_JSONRPC_GetNewAddress

function funct_Billing_JSONRPC_GetNewAddress($strWalletAddressForward)
{
    //Important
    //give label and get back new receiving address in wallet
    $mybtc = new jsonRPCClient(JSONRPC_CONNECTIONSTRING);
    //- ** requires second password
    if (!$strWalletAddressForward) {
        $strWalletAddressForward = '*';
    }
    $strWalletAddress = $mybtc->getnewaddress($strWalletAddressForward);
    return $strWalletAddress;
}
开发者ID:bitcoinbrisbane,项目名称:EzBitcoin-Api-Wallet,代码行数:12,代码来源:funct_jsonrpc.php


注:本文中的jsonRPCClient::getnewaddress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。