Symfony

Installation

Require this package, with Composer , in the root directory of your project.

1composer require arkecosystem/bundle php-http/guzzle6-adapter

Go to config/packages/ark.yml and fill out your configuration similar to this.

1return [
2 Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
3 // ...
4 ArkEcosystem\ArkBundle\ArkBundle::class => ['all' => true],
5];

Configuration

Go to config/packages/ark.yml and fill out your configuration similar to this.

1ark:
2 protocol: "http"
3 ip: "your-node-ip"
4 port: 4001
5 nethash: "6e84d08bd299ed97c212c886c98a57e36545c8f5d645ca7eeae63a8bd62d8988"
6 version: "1.0.1"
7 networkAddress: 0x17 // or 0x1E for devnet

Usage

1namespace App\Controller;
2 
3use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
4use Symfony\Bundle\FrameworkBundle\Controller\Controller;
5use Symfony\Component\HttpFoundation\Response;
6 
7class CoolStuffController extends Controller
8{
9 /**
10 * @Route("/cool/stuff", name="cool_stuff")
11 */
12 public function index()
13 {
14 $wallets = $this->container->get('ark.client')->api('Wallets')->all();
15 
16 return new Response($wallets);
17 }
18}

API Documentation

There are other classes in this package that are not documented here. This is because the package is a Laravel wrapper of the ARK PHP-client package.

Last updated 11 months ago
Edit Page
Share: