Download the PHP package mercator/dcorephp-sdk without Composer
On this page you can find all versions of the php package mercator/dcorephp-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package dcorephp-sdk
DCore SDK for PHP
Set of APIs for accessing the DCore Blockchain.
If you are looking for other platforms you can find info below.
Requirements
- composer
- php ~7.1
- php json
- php bcmath
- php gmp
- php openssl
- symfony PropertyAccess component
- websocket-php - websocket library
- stephen-hill/base58php - base58 conversion library
- kornrunner/php-secp256k1 - secp256k1 library
- BitcoinPHP/BitcoinECDSA.php - ecdsa library
Instalation
composer.json
Usage
You can find example project with SDK usage here.
You can find developer documentation for latest release here.
DCore API initialization
Look at ./src/DCoreApi.php and ./src/Sdk/*Interface.php to see all available methods and their return values.
Get account
Create account
There are two ways to create account in DCore network: $dcoreApi->getAccountApi()->registerAccount()
and $dcoreApi->getAccountApi()->createAccountWithBrainKey()
.
Recommended way to create account is using $dcoreApi->getAccountApi()->registerAccount()
method, because it has an option to specify keys. You can use $dcoreApi->getAccountApi()->createAccountWithBrainKey()
, but keys generated from $brainkey
for $publicOwnerKeyWif
, $publicActiveKeyWif
and $publicMemoKeyWif
will be the same, which is not recommended for security reasons.
Create transfer
Create content
Search content
NFT
NftModels require @Type("type")
annotation for correct functioning. GMP library is also necessary when working with integers.
NftModel
Create NFT
More examples can be found in ./tests/Sdk/NftApiTest.php.
Development requirements & recommendations
- docker
- docker-compose
- phpunit
- symfony VarDumper component
- php code sniffer
- php code sniffer fixer
- php mess detector
PHPStorm configuration
- https://www.jetbrains.com/help/phpstorm/using-php-code-sniffer.html
- https://www.jetbrains.com/help/phpstorm/using-php-cs-fixer.html
- https://www.jetbrains.com/help/phpstorm/using-php-mess-detector.html
Development & testing
Official DCore SDKs for other platforms
All versions of dcorephp-sdk with dependencies
ext-json Version *
ext-curl Version *
ext-bcmath Version *
ext-gmp Version *
ext-openssl Version *
symfony/property-access Version ^3.4
textalk/websocket Version 1.2.0
stephenhill/base58 Version 1.1.4
kornrunner/secp256k1 Version ^0.1.1
bitcoin-php/bitcoin-ecdsa Version 1.3.4
symfony/validator Version ^4.2
symfony/process Version ^4.2
codacy/coverage Version ^1.4
symfony/serializer Version ^4.3
symfony/property-info Version ^4.3
doctrine/annotations Version 1.6.1