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


PHP jsonRPCClient::sc_getbalance方法代碼示例

本文整理匯總了PHP中jsonRPCClient::sc_getbalance方法的典型用法代碼示例。如果您正苦於以下問題:PHP jsonRPCClient::sc_getbalance方法的具體用法?PHP jsonRPCClient::sc_getbalance怎麽用?PHP jsonRPCClient::sc_getbalance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在jsonRPCClient的用法示例。


在下文中一共展示了jsonRPCClient::sc_getbalance方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: die

 if (!get_lock("global")) {
     die("Too many queries. Please try again later.");
 }
 $balance = get_balance($_SESSION["user_id"], "SLC");
 if (count($errors) == 0) {
     $result = withdraw_slc($address);
     if ($result["type"] == "extern") {
         $amountwithfee = floor(($amount + $staticfee) * 10000) / 10000;
     } else {
         $amountwithfee = floor($amount * 10000) / 10000;
     }
     if ($amountwithfee > floor($balance * 10000) / 10000) {
         $errors[] = "You don't have that much.";
     }
 }
 $server_balance = $solidcoin->sc_getbalance("main") / 10000;
 if (count($errors) == 0 && $server_balance < $amountwithfee * 1.05 + 1) {
     $errors[] = "There's currently not enough Solidcoins on the Solidcoin24 servers to fulfill your withdrawal request. Don't worry, a Solidcoin24 admin has been informed and will resolve this for you. You will get an email as soon as the Solidcoins are available. Sorry for the inconvenience, but remember that a big part of the amounts are stored in a seperate wallets for your own security.";
     send_mail("Emergency! Solidcoin balance exhausted ({$server_balance} left)!", "A user with the email address " . $_SESSION["user_email"] . " legitimately tried to withdraw {$amount} Solidcoins. There are still {$server_balance} Solidcoins on the server. The request was denied. Please resolve this and make sure to inform the user.", "admin@solidcoin24.com");
 }
 if (count($errors) == 0) {
     echo "{$amount} Solidcoins are being transferred to {$address}.<br />";
     $result = withdraw_slc($address);
     if ($result["type"] == "extern") {
         $itxid = add_transaction($_SESSION["user_id"], "out", "extern", $amountwithfee, "SLC", "withdrawal", 0, $staticfee);
         $tx = withdraw_slc($address, $amount, "", $itxid);
         $udt_transaction_a = "UPDATE transaction SET info_id = '{$tx['txid']}' WHERE id = '{$itxid}'";
         mysql_query($udt_transaction_a);
         echo "<small>Transaction (extern): " . crypte_transaction($tx["txid"]) . "</small>";
     } else {
         $itxid = add_transaction($_SESSION["user_id"], "out", "intern", $amountwithfee, "SLC", "withdrawal", 0);
開發者ID:rhartness,項目名稱:slc24,代碼行數:31,代碼來源:withdraw_slc_cont.php


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