0

我正在尝试在我的网站中集成 wave 令牌,它在 joomla 上运行,并且我对 php 有所了解。我使用您的 api 成功集成了我的令牌的代码。

  • 现在我想将我的用户链接到他们的钱包,这样他们就可以直接在我的网站上看到他们的余额(Bastion 令牌中的余额)。
  • 我还会使用他们的钱包地址来显示前 10 名持有人名单,如果他们愿意,可以隐藏他们的地址
  • 最后,如果我找到一个好的文档,我可以尝试整合他们钱包的转账,甚至自动化硬币分配,但这不是明天。

我的问题?我使用 php,我想知道是否有人可以帮助我,或者是否存在关于它的详尽文档

非常感谢所有帮助者。

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

4

1 回答 1

1

我终于找到了方法。

余额 =

$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";
?>

和钱包清单

<?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>";




?>
于 2019-04-20T22:03:05.483 回答