Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

Latest commit

 

History

History
70 lines (51 loc) · 1.46 KB

symfony.md

File metadata and controls

70 lines (51 loc) · 1.46 KB
id title
symfony
Symfony

Symfony

Installation

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

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

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

<?php

return [
    Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
    // ...
    ARKEcosystem\ARKBundle\ARKBundle::class => ['all' => true],
];

Configuration

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

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

Usage

<?php

namespace App\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Symfony\Component\HttpFoundation\Response;

class CoolStuffController extends Controller
{
    /**
     * @Route("/cool/stuff", name="cool_stuff")
     */
    public function index()
    {
        $wallets = $this->container->get('ark.client')->api('Wallets')->all();

        return new Response($wallets);
    }
}

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.