ArkEcosystem/php-client

Usage with Api V2?

Closed this issue · 2 comments

kLOsk commented

I'm trying to use this along with api v2, but unfortunate can't get any meaningful information from the objects. For example this here:

<?php
use ArkEcosystem\Client\Connection;

$connection = new Connection([
'host' => 'http://0.0.0.0:4003', // NO TRAILING SLASH!
'version' => 2
]);

$wallets = $connection->wallets();

echo '

';
print_r($wallets);
echo '
';
?>

The only thing I get from the walets object are guzzle objects. When trying to access the all() method I get an error. Can you provide some help here? Thanks!

Hey @kLOsk ,

can you try the following configuration:

$connection = new Connection([
    'host' => 'https://explorer.ark.io:8443/api/',
    'version' => 2, // you can remove this one because it isn't used by the client
]);

That should definitely work. There is also a minimalistic demo documentation: https://docs.ark.io/sdk/examples/sdk-demos.html#php

repat commented

@kLOsk Might your error might've been related to #93, should be fixed in the next release. You do need a trailing slash, otherwise you get a PHP return type error. A slash will automatically be added in the new release as well.

@reConNico not everyday you meet a neighbor on the interwebs, hallo aus quickborn ;)