PHP code example of muvon / bitclout-creator-coin

1. Go to this page and download the library: Download muvon/bitclout-creator-coin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

muvon / bitclout-creator-coin example snippets


    use Muvon\Bitclout\CreatorCoin;
    $Coin = CreatorCoin::create(0); // pass reward basis points
    

    use Muvon\Bitclout\CreatorCoin;
    $Coin = CreatorCoin::create(0); // pass reward basis points
    // Watermark is optional
    $Coin->init(1000, 1000, 0); // locked, supply and watermark in nanos
    

$Coin->buy(1 * 10 ** 9);

// Check rate, locked and supply
var_dump($Coin->getLocked());
var_dump($Coin->getSupply());
var_dump($Coin->getRate());

// Check info about minting of last buy
var_dump($Coin->getLastBuy());

$Coin->sell(1 * 10 ** 9);

// Latest strategy when founder get reward in $CLOUT
$Coin->setStrategy('reward');

// salamon bug fix strategy when founder always get reward in coins
$Coin->setStrategy('minting');

// Watermark is a initial strategy of BitClout blockchain, once supply reached no more reward minted for creator
$Coin->setStrategy('watermark');

// Or just set it with block height
$Coin->setStrategyByHeight(1000);