aminin/blockchain-bundle

Blockchain API integration for Symfony 2/3/4

Installs: 19

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 2

Forks: 2

Open Issues: 0

Type:symfony-bundle

v0.3.0 2018-03-27 15:05 UTC

This package is not auto-updated.

Last update: 2024-05-12 02:40:47 UTC


README

License

Blockchain.info integration for Symfony 2/3/4. This bundle plugs the Blockchain API client into Symfony project.

Prerequisites

This version of the bundle requires Symfony 2.8+

Installation

Step 1: Download AmiBlockchainBundle using composer

Add AmiBlockchainBundle in your composer.json:

$ composer require aminin/blockchain-bundle

Step 2: Enable the bundle

Enable the bundle in the kernel:

Skip if using SF4 and Flex, the bundle will be automatically added for you.

<?php
// app/AppKernel.php

public function registerBundles()
{
    $bundles = array(
        // ...
        new Ami\BlockchainBundle\AmiBlockchainBundle(),
    );
}

Step 3: Configure the AmiBlockchainBundle

Add the following configuration to your config.yml file

# app/config/config.yml
ami_blockchain:
    api_key: YOUR-API-KEY
    service_url: SERVICE-URL-FOR-API-V-2

If using SF4 create the config file for this bundle inside config/packages:

# config/packages/ami_blockchain.yaml
ami_blockchain:
    api_key: YOUR-API-KEY
    service_url: SERVICE-URL-FOR-API-V-2

# If you like to define this values in `.env` file or your server environment variables use:
    api_key: '%env(BLOCKCHAIN_API_KEY)%'
    service_url: '%env(BLOCKCHAIN_SERVICE_URL)%'

Usage

You may access the Blockchain as ami_blockchain.blockchain service

    /** @var ContainerInterface $container */
    $container->get('ami_blockchain.blockchain')->…;

License

This bundle is under the MIT license. See the complete license in the Resources/meta/LICENSE

References

Blockchain API client: https://github.com/blockchain/api-v1-client-php