本文整理汇总了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));
示例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;
}
示例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>
示例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);
}
示例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;
示例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>
示例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;
示例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;
示例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;
}