简体   繁体   English

如何将钱包内容放入PHP?

[英]how to put wallet contents in PHP?

I am trying to integrate waves tokens in my website, it runs on joomla, and I know a bit about php. 我正在尝试将wave令牌集成到我的网站中,它在joomla上运行,并且我对php有所了解。 I successfully integrate my token's ticker using your api. 我已使用您的api成功集成了令牌的代码。

  • Now I would like to link my users to their wallet, so thet can see their balance directly on my site (balance in Bastion token). 现在,我想将我的用户链接到他们的钱包,以便可以直接在我的网站上看到他们的余额(Bastion令牌中的余额)。
  • I would use their wallet adress also to show a top 10 holder list, keeping their adress hidden if they want 我还会使用他们的钱包地址显示前十名的持有者列表,如果他们愿意的话,将他们的地址隐藏起来
  • Finally if I find a good documentation, I could try to integrate transfer from-to their wallet, and even automate coin distribution, but that's not for tomorrow. 最后,如果我找到了不错的文档,我可以尝试整合从其到钱包的转账,甚至自动进行硬币分配,但这不是明天。

My issue? 我的问题? I use php, I would like to know if someone could help me or if there exist and exhaustive documentation about it 我使用php,我想知道是否有人可以帮助我,或者是否存在有关它的详尽文档

Big thanks to all helpers. 非常感谢所有帮手。

Wanna see my current integration ? 想看我目前的整合吗? : https://www.itharagaian.net/main/index.php/bastion-token/getting-bastion-tokens https : //www.itharagaian.net/main/index.php/bastion-token/getting-bastion-tokens

I finally found how to do. 我终于找到了方法。

Balance = 余额=

$curl = curl_init();

$opts = [
    CURLOPT_URL => 'https://nodes.wavesplatform.com/assets/balance/3PC1NwcrvR9EwDCZ4na2q1RrUY21M5RMg7W/9dmvLmq8iK4aXTHk21Fdi3Tjf2XJUHUoBokvS7zsG7Sn',
    CURLOPT_RETURNTRANSFER => true,
];

curl_setopt_array($curl, $opts);

$response = curl_exec($curl);
curl_close($curl);
$balance= json_decode($response, true);

echo "This account has ";
echo $balance[balance]/100000000;
echo "Bastion Tokens";
?>

And list of wallets 和钱包清单

<?php

$curl = curl_init();

$opts = [
    CURLOPT_URL => 'https://nodes.wavesplatform.com/assets/9dmvLmq8iK4aXTHk21Fdi3Tjf2XJUHUoBokvS7zsG7Sn/distribution',
    CURLOPT_RETURNTRANSFER => true,
];

curl_setopt_array($curl, $opts);

$response = curl_exec($curl);
curl_close($curl);

$balance= json_decode($response, true);
echo "<br>";

echo "<table><tr><th>NBR</th>< th>WALLET</th><th>VALUE</th></tr>";
foreach ($balance as $address => $amount) {
    $i=$i+1;

   echo "<tr><td>";
    echo  $i;
    echo "</td><td>";
    echo $address;
    $wallet[$i] = $address;
    echo " </td><td>";
    echo round($amount/100000000);
    $value[$i]= round($amount/100000000);
    echo "  Bastion</td>";
    echo "</tr>";

}

echo "</table>";




?>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM