1. Go to this page and download the library: Download cityofzion/neo-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/ */
cityofzion / neo-php example snippets
$newWallet = new NeoPHP\NeoWallet();
$wallet = new NeoPHP\NeoWallet("KzfUdP9MbsuL4Ejo1rTWve4JZfa7m1hc397JGXTHhNqJDAqMxZYu");
$wallet = new NeoPHP\NeoWallet();
$wallet->encryptWallet("passphrase");
$wallet = new NeoPHP\NeoWallet("6PYMFa9gMAcBrTaAs8JyDrtoGLqb45P8dnmUfVVNcfLd9xKUdffSNfKWKp","passphrase");
$wallet = new NeoPHP\NeoWallet("KzfUdP9MbsuL4Ejo1rTWve4JZfa7m1hc397JGXTHhNqJDAqMxZYu");
$wallet->encryptWallet("passphrase");
$wallet->isNEP2();
$wallet->getEncryptedKey();
$wallet->getWif();
$wallet->getAddress();
$wallet->getPrivateKey()
$rpcObject = new NeoRPC();
$rpcObject->setNode("https://seed1.redpulse.com:10331");
\NeoPHP\NEP5::getTokenBalance($rpcObject,NeoPHP\NeoAssets::ASSET_ZPT,"AKDVzYGLczmykdtRaejgvWeZrvdkVEvQ1X");
\NeoPHP\NEP5::getTokenBalance($rpcObject,NeoPHP\NeoAssets::ASSET_TKY,"AKDVzYGLczmykdtRaejgvWeZrvdkVEvQ1X")
$neo = new NeoRPC(); #use false as argument to go to testnet
//$neo->setNode($neo->getFastestNode());
$neo->setNode("http://seed5.neo.org:10332");
$transaction_id = ""; //A hexadecimal string that has been serialized, after the signed transaction in the program.
$broadcastTransaction = $neo->sendRawTransaction($transaction_id);
if ($broadcastTransaction)
echo "Sent";
else
echo "Hasn't been sent";
if ($neo->validateAddress("AXCLjFvfi47R1sKLrebbRJnqWgbcsncfro"))
echo "Address is valid";
else
echo "Address is not valid";
//setup coinmarketcap object
$cmcObject = new \NeoPHP\CoinMarketCap();
//set currency, if not set it defaults to USD
$cmcObject->setCurrency("EUR");
print_r($cmcObject->getTicker());
//get ticket for asset GAS
print_r($cmcObject->getTickerForAsset(\NeoPHP\Assets\NeoAssets::ASSET_GAS));
//get ticket for asset NEO
print_r($cmcObject->getTickerForAsset(\NeoPHP\Assets\NeoAssets::ASSET_NEO));
//get global data
print_r($cmcObject->getGlobalData());
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.