Skip to content
Official repository of the DCore SDK for PHP
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
src Add #619 Subscription API (#15) Apr 26, 2019
tests Add #619 Subscription API (#15) Apr 26, 2019
.gitignore Initial commit Mar 27, 2019
.travis.yml Initial commit Mar 27, 2019
Dockerfile Initial commit Mar 27, 2019
LICENSE Initial commit Mar 27, 2019 Readme align, cross references Apr 15, 2019
composer.json Testnet + BroadcastAPI (#18) Apr 26, 2019
composer.lock Testnet + BroadcastAPI (#18) Apr 26, 2019
docker-compose.yml Initial commit Mar 27, 2019

DCore SDK for PHP

Set of APIs for accessing the DCore Blockchain.
If you are looking for other platforms you can find info below.




    "repositories": [
            "type": "vcs",
            "url": ""
    "require": {
        "decentfoundation/dcorephp-sdk": "dev-master"
composer require decentfoundation/dcorephp-sdk


DCore API initialization

$dcoreApi = new \DCorePHP\DCoreApi(

Look at ./src/DCoreApi.php and ./src/Sdk/*Interface.php to see all available methods and their return values.

Get account

$account = $dcoreApi->getAccountApi()->get(new ChainObject('1.2.34'));
$account = $dcoreApi->getAccountApi()->getByName('Your test account name');

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.

    'Your test account name',
    new ChainObject('1.2.34'),

Create transfer

    new Credentials(new ChainObject('1.2.34'), '5Jd7zdvxXYNdUfnEXt5XokrE3zwJSs734yQ36a1YaqioRTGGLtn'),
    (new AssetAmount())->setAmount(1500000),
    'your secret message',

Create content

$content = new SubmitContent();
        'title' => 'Your content title',
        'description' => 'Your content description',
        'content_type_id' => '1.2.3'
    ->setPrice([(new RegionalPrice)->setPrice((new AssetAmount())->setAmount(1000))->setRegion(1)]);

$credentials = new Credentials(
    new ChainObject('1.2.34'),

    (new AssetAmount())->setAmount(1000)->setAssetId('1.3.0'),
    (new AssetAmount())->setAmount(1000)->setAssetId('1.3.0')

Search content

$contents = $dcoreApi->getContentApi()->findAll(
    'search term',

Development requirements & recommendations

PHPStorm configuration

Development & testing

git clone
cd dcorephp-sdk
docker-compose up -d
docker-compose exec php composer install --dev --prefer-dist --optimize-autoloader
docker-compose exec php ./vendor/bin/phpunit --bootstrap vendor/autoload.php tests

Official DCore SDKs for other platforms

You can’t perform that action at this time.