PHP code example of mitoop / crypto-php
1. Go to this page and download the library: Download mitoop/crypto-php 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/ */
mitoop / crypto-php example snippets
use Mitoop\Crypto\TokenBuilder;
// 获取代币实例
$token = TokenBuilder::fromArray([
'chain' => 'eth',
'chain_id' => 11155111,
'contract_address' => '0x779877A7B0D9E8603169DdbD7836e478b4624789',
'decimals' => 18,
'rpc_url' => 'https://sepolia.infura.io/v3/your_api_key',
'rpc_api_key' => '',
'explorer_url' => 'https://sepolia.etherscan.io'
])->build();
$token->generateWallet();
$token->getBalance();
// ...
// 通过代币实例获取原生币实例
$coin = $token->getNativeCoin();
$coin->getBalance();
// ...
bash
composer