本文整理汇总了PHP中jsonRPCClient::validateaddress方法的典型用法代码示例。如果您正苦于以下问题:PHP jsonRPCClient::validateaddress方法的具体用法?PHP jsonRPCClient::validateaddress怎么用?PHP jsonRPCClient::validateaddress使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类jsonRPCClient
的用法示例。
在下文中一共展示了jsonRPCClient::validateaddress方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: funct_Billing_JSONRPC_ValidateAddress
function funct_Billing_JSONRPC_ValidateAddress($strWalletAddress)
{
//works
//validate address, returns json obj
$mybtc = new jsonRPCClient(JSONRPC_CONNECTIONSTRING);
//- ** requires second password
$objJSON = $mybtc->validateaddress($strWalletAddress);
foreach ($objJSON as $key => $value) {
$strReturn = $strReturn . $key . "=" . $value . "|";
}
return $strReturn;
}
示例2: validateaddress
public function validateaddress($coin_address)
{
try {
$aStatus = parent::validateaddress($coin_address);
if (!$aStatus['isvalid']) {
return false;
}
} catch (Exception $e) {
return false;
}
return true;
}
示例3: jsonRPCClient
* © CryptoDice
*
*
*
*/
header('X-Frame-Options: DENY');
$included = true;
include '../../inc/db-conf.php';
include '../../inc/wallet_driver.php';
$wallet = new jsonRPCClient($driver_login);
include '../../inc/functions.php';
if (empty($_GET['amount']) || empty($_GET['valid_addr']) || 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`,`balance` FROM `players` WHERE `hash`='" . prot($_GET['_unique']) . "' LIMIT 1"));
$validate = $wallet->validateaddress($_GET['valid_addr']);
if ($validate['isvalid'] == false) {
$error = 'yes';
$con = 0;
} else {
$player = mysql_fetch_array(mysql_query("SELECT `id`,`balance` FROM `players` WHERE `hash`='" . prot($_GET['_unique']) . "' LIMIT 1"));
if (!is_numeric($_GET['amount']) || (double) $_GET['amount'] > $player['balance'] || (double) $_GET['amount'] < $settings['min_withdrawal']) {
$error = 'yes';
$con = 1;
} else {
$amount = (double) $_GET['amount'];
$txid = $wallet->sendtoaddress($_GET['valid_addr'], $amount);
if ((string) $txid != '') {
mysql_query("UPDATE `players` SET `balance`=TRUNCATE(ROUND((`balance`-{$amount}),9),8) WHERE `id`={$player['id']} LIMIT 1");
}
mysql_query("INSERT INTO `transactions` (`player_id`,`amount`,`txid`) VALUES ({$player['id']},(0-{$amount}),'{$txid}')");
示例4: jsonRPCClient
$alt = new jsonRPCClient('http://username:password@localhost:port/');
//set to altcoind user/pass/port
$min = 1;
//set to minimum payout
$max = 5;
//set to max payout
$ayah = new AYAH();
if (array_key_exists('submit', $_POST)) {
$score = $ayah->scoreResult();
if ($score) {
$username = $_POST['address'];
if (!empty($_POST['address'])) {
if ($alt->getbalance() < 1) {
echo '<div class="alert alert-dismissable alert-danger"><button type="button" class="close" data-dismiss="alert">×</button><strong>Error:</strong> <a href="#" class="alert-link"></a>Not enough balance.</div>';
} else {
$check = $alt->validateaddress($username);
if ($check["isvalid"] == 1) {
$amount = rand($min, $max);
$alt->sendtoaddress($username, $amount);
echo '<div class="alert alert-dismissable alert-success"><button type="button" class="close" data-dismiss="alert">×</button><strong></strong> <a href="#" class="alert-link"></a>You got ';
echo $amount;
echo " ALT!</div>";
}
}
}
} else {
echo '<div class="alert alert-dismissable alert-danger"><button type="button" class="close" data-dismiss="alert">×</button><strong>Error:</strong> <a href="#" class="alert-link"></a>Human Verification Failed.</div>';
}
}
?>
示例5: LTC_transaction_o
public static function LTC_transaction_o()
{
$usr = usr::getCurrentUser(1);
if ($usr == null) {
header('Location: /');
return;
}
$address = Core::validate($_POST['address']);
$amount = Core::validate($_POST['amount']);
if ($amount == 0 || !Core::isDouble($amount, 8)) {
print json_encode(array('location' => URL_WRONG_MONEY_VALUE));
return;
}
if ($address == null) {
print json_encode(array('location' => URL_WRONG_DATA_INPUT));
return;
}
$litecoin = new jsonRPCClient('http://' . LTC_RPC_USER . ':' . LTC_RPC_PASSWORD . '@' . LTC_RPC_HOST . ':' . LTC_RPC_PORT . '/');
try {
$response = $litecoin->validateaddress($address);
} catch (Exception $e) {
print json_encode(array('location' => URL_SERVER_ERROR));
return;
}
if ($response['isvalid'] === false) {
print json_encode(array('location' => URL_WRONG_DATA_INPUT));
return;
}
$currency = new Currency();
$currency->findBy(array('Name' => 'LTC'));
$purses = Purse::findBy(array('UID' => $usr->getId(), 'CurId' => $currency->getId()));
if (empty($purses)) {
return;
}
$limits = self::transactionLimits($currency->getId(), 'LTC', 1);
$feeVolume = $amount * $limits['fee'];
$feeVolume = Core::round_up($feeVolume, 8);
$purse = new Purse();
$purse->findById($purses[0]['id']);
if ($purse->getValue() < $amount + $feeVolume) {
Core::printErrorJson(URL_WRONG_DATA_INPUT);
return;
}
if ($amount < $limits['min']) {
print json_encode(array('location' => URL_ERROR . self::LIMITS));
return;
}
if ($limits['max'] != null) {
$transaction_history = new AtLtc();
$transactions = $transaction_history->findAllByForLastPeriod(array('UID' => $usr->getid(), 'type' => 1, 'done' => 1));
$totalAmount = 0.0;
if (isset($transactions)) {
foreach ($transactions as $transaction) {
$totalAmount += $transaction['value'];
}
}
if ($totalAmount + $amount > $limits['max']) {
print json_encode(array('location' => URL_ERROR . self::LIMITS));
return;
}
}
$at = new AtLtc();
$at->setUID($usr->getId());
$at->setAddress($address);
$at->setType(1);
$at->setDone(0);
$at->setValue($amount);
$at->insert();
$success = self::send_output_link('LTC', $at->getId(), $usr);
if (!$success) {
print json_encode(array('location' => URL_SERVER_ERROR));
return;
}
print json_encode(array('location' => URL_NOTIFICATION_SEND));
}
示例6: jsonRPCClient
$vertcoin = new jsonRPCClient('http://xxxx:xxxx@127.0.0.1:5888/');
$darkcoin = new jsonRPCClient('http://xxxx:xxxx@127.0.0.1:9998/');
$cryptsy_drk = 'XsRzSLTYopmD3bhodgU4oJdGLk43ejZ697';
switch ($_GET['do']) {
default:
die('xDD');
break;
case 'gen':
if (preg_match('/[^0-9a-zA-Z]/', $_POST['address'])) {
die("invalid");
}
if ($_POST['coin'] != 'DRK') {
$_POST['coin'] = 'DRK';
}
//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';
示例7: jsonRPCClient
<?php
if (isset($_POST['address'])) {
require_once '../bitcoinURL.php';
require_once '../jsonRPCClient.php';
$bitcoin = new jsonRPCClient(kBitcoinURL);
$data = $bitcoin->validateaddress($_POST['address']);
$isValid = $data['isvalid'];
if ($isValid) {
header("Location: /bitcoin/atm/mtgox/mtgox_bill.php?address=" . $_POST['address']);
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=8">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Untitled Page</title>
<?php
include "../MouseCursor.inc";
?>
<style type="text/css">
html, body
{
height: 100%;
}
div#space
{
width: 1px;
height: 50%;
示例8: jsonRPCClient
if ($blockchain != 'multi') {
$bitcoind = new jsonRPCClient("http://" . $rpc_options[$blockchain]['username'] . ":" . $rpc_options[$blockchain]['password'] . "@" . $rpc_options[$blockchain]['host'] . ":" . $rpc_options[$blockchain]['port'] . "/");
$raw = false;
if ($debug && $bitcoind && $loaded) {
$raw = $bitcoind->getinfo();
}
}
if ($call == 'address') {
$obj = ["address" => false, "blockchain" => $blockchain, "hash" => "N/A", "tx_count" => 0, "received" => 0, "balance" => 0, "raw" => []];
if (isset($_GET['id']) && $_GET['id']) {
$address = $_GET['id'];
$obj['address'] = $address;
$account_name = 'XXX_' . $address;
$balance = $bitcoind->getbalance($account_name, 1, true);
$received = $bitcoind->getreceivedbyaccount($account_name, 1);
$address = $bitcoind->validateaddress($obj['address']);
$txs = $bitcoind->listtransactions($account_name, 100, 0, true);
foreach ($txs as $tx_key => $tx) {
$raw_tx = $bitcoind->getrawtransaction($tx['txid'], 1);
foreach ($raw_tx['vout'] as $output) {
if ($output['scriptPubKey']['addresses'][0] == $_GET['id']) {
$asm = explode(' ', $output['scriptPubKey']['asm']);
foreach ($asm as $op) {
if (substr($op, 0, 2) != 'OP') {
$obj['hash'] = $op;
}
}
}
}
}
if ($balance) {