Download the PHP package cityofzion/neo-php without Composer
On this page you can find all versions of the php package cityofzion/neo-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download cityofzion/neo-php
More information about cityofzion/neo-php
Files in cityofzion/neo-php
Package neo-php
Short Description NEO blockchain implementation for PHP
License MIT
Informations about the package neo-php
neo-php
PHP SDK for the NEO blockchain.
Overview
What does it currently do
- Installation though Composer
- Open, create and encrypt unencrypted wallets
- Create and open encrypted wallet
- Minimal NEP-5 interation (token balance requesting and Smart Contract parameter factory)
- All RPC functions are integrated.
- Address validation
- It contains a cold wallet generator
- Coinmarketcap API integration
What will (should) it do
- Do wallet transactions for: NEO, GAS and NEP-5 Tokens
- Build, deploy, and run smart contracts
- A lot more
Documentation
Currently there isn't much documentation besides this Readme. We could use it! Do a PR if you'd like to help us :). Though there are a lot of examples
Get help or give help
- Open a new issue if you encounter a problem.
- Or ping @Deanpress or @Woodehh on the NEO Discord.
- Pull requests welcome. You can help with wallet functionality, writing tests or documentation, or on any other feature you deem awesome.
Getting started
To start using neo-php you need to have composer installed. When you're ready openup a terminal and type in:
From there on include the autoloader and you can use all of the juicy neo-php features.
Wallet functionality:
The wallet part of neo-php consists out of initializers that have multiple functions.
Create new unencrypted wallet
Open an unencrypted wallet
Create new encrypted wallet
Open an encrypted wallet
Encrypt an existing wallet
BOOL to test if wallet is an encrypted wallet
String get the encrypted address, when isNEP2()
String get wif for initialized wallet
String get address for initialized wallet
String get key for initialized wallet
Minimal NEP-5 integration
We're working on NEP5 integration. For now we're able to request the majority of the NEP5 tokens balance with a specified address.
Requesting NEP-5 Token balance for address
Right now we have the following "assets" which you can request the balance for:
Token | Asset constant |
---|---|
Ontology | NeoPHP\NeoAssets::ASSET_ONT |
THEKEY | NeoPHP\NeoAssets::ASSET_TKY |
Congierce token | NeoPHP\NeoAssets::ASSET_CGE |
Alphacat | NeoPHP\NeoAssets::ASSET_ACAT |
Narrative Token | NeoPHP\NeoAssets::ASSET_NRVE |
Red Pulse | NeoPHP\NeoAssets::ASSET_RPX |
DeepBrainChain | NeoPHP\NeoAssets::ASSET_DBC |
QLink | NeoPHP\NeoAssets::ASSET_QLC |
Trinity Network Credit | NeoPHP\NeoAssets::ASSET_TN |
Zeepin Token | NeoPHP\NeoAssets::ASSET_ZPT |
PikcioChain | NeoPHP\NeoAssets::ASSET_PKC |
The RPC
The RPC is the way to talk to the different blockchain nodes. For example: We use it to request the balance for the NEP-5 tokens.
Connecting to a RPC Node
Asking for balance using the CityOfZion API
Query the account asset information, according to the account address.
Query the asset information, based on the specified asset number.
Returns the hash of the tallest block in the main chain.
Returns the corresponding block information according to the specified index OR hash.
Gets the number of blocks in the main chain.
Calculate claim transaction amounts in order use sendrawtransaction to make a claim.
Returns the hash value of the corresponding block, based on the specified index.
Gets the current number of connections for the node.
Query contract information, according to the contract script hash.
Obtain the list of unconfirmed transactions in memory.
Returns the corresponding transaction information, based on the specified hash value.
Query contract information, according to the contract script hash.
Returns the corresponding transaction output information (returned change), based on the specified hash and index.
Broadcasts a transaction over the NEO network. There are many kinds of transactions, as specified in the network protocol documentation
Validate an address
NEO Cold wallet generator
You can also run the cli-create-wallet-interactive.php example to generate a new wallet. You can do so on a fresh virtual and disconnected Linux distro, you can do a clean run and keep your wallet safe.
CoinMarketCap integration
Neo-PHP Features a full CoinMarketCap API integration.
To initiate the object
To request the ticker
Arguments are start and limit. Similar to MySQL start and limit
To request the ticker for a specific currency
Check NEP-5 asset constants of this documentation for the right assets
To get global data
Check NEP-5 asset constants of this documentation for the right assets
Created by
-
Benjamin de Bos (LinkedIn) - Neodius (NEO Blockchain App) & ITSVision
- Dean van Dugteren (LinkedIn) - NEO dApp Starter Kit, Vidiato, Click.DJ
Check out Neodius
Licensed under MIT License
Enjoy!