Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/ArkClient.php → src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
use ArkEcosystem\Client\API\Wallets;
use GuzzleHttp\HandlerStack;

class ArkClient
class Client
{
public Connection $connection;

Expand Down
4 changes: 2 additions & 2 deletions tests/API/ApiNodesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Client\Client;

it('calls the correct url for api nodes', function () {
$this->assertResponse('GET', 'api-nodes', function (ArkClient $client) {
$this->assertResponse('GET', 'api-nodes', function (Client $client) {
return $client->apiNodes()->all();
});
});
4 changes: 2 additions & 2 deletions tests/API/BlockchainTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Client\Client;

it('calls the correct blockchain url', function () {
$this->assertResponse('GET', 'blockchain', function (ArkClient $client) {
$this->assertResponse('GET', 'blockchain', function (Client $client) {
return $client->blockchain()->blockchain();
});
});
12 changes: 6 additions & 6 deletions tests/API/BlocksTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,34 @@

namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Client\Client;

it('calls correct url for all', function () {
$this->assertResponse('GET', 'blocks', function (ArkClient $client) {
$this->assertResponse('GET', 'blocks', function (Client $client) {
return $client->blocks()->all();
});
});

it('calls correct url for get', function () {
$this->assertResponse('GET', 'blocks/dummy', function (ArkClient $client) {
$this->assertResponse('GET', 'blocks/dummy', function (Client $client) {
return $client->blocks()->get('dummy');
});
});

it('calls correct url for first', function () {
$this->assertResponse('GET', 'blocks/first', function (ArkClient $client) {
$this->assertResponse('GET', 'blocks/first', function (Client $client) {
return $client->blocks()->first();
});
});

it('calls correct url for last', function () {
$this->assertResponse('GET', 'blocks/last', function (ArkClient $client) {
$this->assertResponse('GET', 'blocks/last', function (Client $client) {
return $client->blocks()->last();
});
});

it('calls correct url for transactions', function () {
$this->assertResponse('GET', 'blocks/dummy/transactions', function (ArkClient $client) {
$this->assertResponse('GET', 'blocks/dummy/transactions', function (Client $client) {
return $client->blocks()->transactions('dummy');
});
});
4 changes: 2 additions & 2 deletions tests/API/CommitsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Client\Client;

it('calls the correct URL for get', function () {
$this->assertResponse('GET', 'commits/1', function (ArkClient $client) {
$this->assertResponse('GET', 'commits/1', function (Client $client) {
return $client->commits()->get(1);
});
});
6 changes: 3 additions & 3 deletions tests/API/ContractsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Client\Client;

it('calls the correct url for all contracts', function () {
$this->assertResponse('GET', 'contracts', function (ArkClient $client) {
$this->assertResponse('GET', 'contracts', function (Client $client) {
return $client->contracts()->all();
});
});

it('calls the correct url for abi', function () {
$this->assertResponse('GET', 'contracts/consensus/some-wallet/abi', function (ArkClient $client) {
$this->assertResponse('GET', 'contracts/consensus/some-wallet/abi', function (Client $client) {
return $client->contracts()->abi('consensus', 'some-wallet');
});
});
4 changes: 2 additions & 2 deletions tests/API/EVMTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Client\Client;

it('calls the correct URL for eth_call', function () {
$this->assertResponse(
method: 'POST',
path: 'api/',
callback: function (ArkClient $client) {
callback: function (Client $client) {
return $client->evm()->call([
'method' => 'eth_call',
'params' => [[
Expand Down
18 changes: 12 additions & 6 deletions tests/API/NodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,40 @@

namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Client\Client;

it('calls the correct url for status', function () {
$this->assertResponse('GET', 'node/status', function (ArkClient $client) {
$this->assertResponse('GET', 'node/status', function (Client $client) {
return $client->node()->status();
});
});

it('calls the correct url for syncing', function () {
$this->assertResponse('GET', 'node/syncing', function (ArkClient $client) {
$this->assertResponse('GET', 'node/syncing', function (Client $client) {
return $client->node()->syncing();
});
});

it('calls the correct url for configuration', function () {
$this->assertResponse('GET', 'node/configuration', function (ArkClient $client) {
$this->assertResponse('GET', 'node/configuration', function (Client $client) {
return $client->node()->configuration();
});
});

it('calls the correct url for crypto', function () {
$this->assertResponse('GET', 'node/configuration/crypto', function (ArkClient $client) {
$this->assertResponse('GET', 'node/configuration/crypto', function (Client $client) {
return $client->node()->crypto();
});
});

it('calls the correct url for fees', function () {
$this->assertResponse('GET', 'node/fees', function (ArkClient $client) {
$this->assertResponse('GET', 'node/fees', function (Client $client) {
return $client->node()->fees();
});
});

it('calls the correct url for fees with query', function () {
$this->assertResponse('GET', 'node/fees?days=7', function (Client $client) {
return $client->node()->fees(7);
});
});
6 changes: 3 additions & 3 deletions tests/API/PeersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@

namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Client\Client;

it('calls correct url for all', function () {
$this->assertResponse('GET', 'peers', function (ArkClient $client) {
$this->assertResponse('GET', 'peers', function (Client $client) {
return $client->peers()->all();
});
});

it('calls correct url for get', function () {
$this->assertResponse('GET', 'peers/dummy', function (ArkClient $client) {
$this->assertResponse('GET', 'peers/dummy', function (Client $client) {
return $client->peers()->get('dummy');
});
});
8 changes: 4 additions & 4 deletions tests/API/ReceiptsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Client\Client;
use Exception;

it('calls the correct url for all', function () {
$this->assertResponse('GET', 'receipts', function (ArkClient $client) {
$this->assertResponse('GET', 'receipts', function (Client $client) {
return $client->receipts()->all();
});
});
Expand All @@ -17,7 +17,7 @@
$this->assertResponse(
method: 'GET',
path: 'receipts/dummyTxHash',
callback: function (ArkClient $client) {
callback: function (Client $client) {
return $client->receipts()->get('dummyTxHash');
},
response: ['data' => [['id' => 'dummyTxHash']]],
Expand All @@ -31,7 +31,7 @@
$this->assertResponse(
method: 'GET',
path: 'receipts/dummyTxHash',
callback: function (ArkClient $client) {
callback: function (Client $client) {
return $client->receipts()->get('dummyTxHash');
},
response: ['data' => []],
Expand Down
8 changes: 4 additions & 4 deletions tests/API/RoundsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@

namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Client\Client;

it('calls correct url for all', function () {
$this->assertResponse('GET', 'rounds', function (ArkClient $client) {
$this->assertResponse('GET', 'rounds', function (Client $client) {
return $client->rounds()->all();
});
});

it('calls correct url for view', function () {
$this->assertResponse('GET', 'rounds/12345', function (ArkClient $client) {
$this->assertResponse('GET', 'rounds/12345', function (Client $client) {
return $client->rounds()->get(12345);
});
});

it('calls correct url for validators', function () {
$this->assertResponse('GET', 'rounds/12345/validators', function (ArkClient $client) {
$this->assertResponse('GET', 'rounds/12345/validators', function (Client $client) {
return $client->rounds()->validators(12345);
});
});
20 changes: 10 additions & 10 deletions tests/API/TokensTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Client\Client;

it('calls correct url for all', function () {
$this->assertResponse('GET', 'tokens', function (ArkClient $client) {
$this->assertResponse('GET', 'tokens', function (Client $client) {
return $client->tokens()->all();
});
});
Expand All @@ -16,7 +16,7 @@
$this->assertResponse(
'POST',
'tokens',
function (ArkClient $client) {
function (Client $client) {
return $client->tokens()->all([
'whitelist' => ['0x1234567890abcdef1234567890abcdef12345678'],
]);
Expand All @@ -31,7 +31,7 @@ function (ArkClient $client) {
$this->assertResponse(
'POST',
'tokens',
function (ArkClient $client) {
function (Client $client) {
return $client->tokens()->all([
'whitelist' => [
'0x1234567890abcdef1234567890abcdef12345678',
Expand All @@ -49,7 +49,7 @@ function (ArkClient $client) {
});

it('calls correct url for whitelist with query', function () {
$this->assertResponse('GET', 'tokens/whitelist?page=2&limit=10', function (ArkClient $client) {
$this->assertResponse('GET', 'tokens/whitelist?page=2&limit=10', function (Client $client) {
return $client->tokens()->whitelist([
'page' => 2,
'limit' => 10,
Expand All @@ -58,31 +58,31 @@ function (ArkClient $client) {
});

it('calls correct url for get', function () {
$this->assertResponse('GET', 'tokens/dummy', function (ArkClient $client) {
$this->assertResponse('GET', 'tokens/dummy', function (Client $client) {
return $client->tokens()->get('dummy');
});
});

it('calls correct url for holders', function () {
$this->assertResponse('GET', 'tokens/dummy/holders', function (ArkClient $client) {
$this->assertResponse('GET', 'tokens/dummy/holders', function (Client $client) {
return $client->tokens()->holders('dummy');
});
});

it('calls correct url for transfers by token', function () {
$this->assertResponse('GET', 'tokens/dummy/transfers', function (ArkClient $client) {
$this->assertResponse('GET', 'tokens/dummy/transfers', function (Client $client) {
return $client->tokens()->transfersByToken('dummy');
});
});

it('calls correct url for all transfers', function () {
$this->assertResponse('GET', 'tokens/transfers', function (ArkClient $client) {
$this->assertResponse('GET', 'tokens/transfers', function (Client $client) {
return $client->tokens()->transfers();
});
});

it('calls correct url for whitelist', function () {
$this->assertResponse('GET', 'tokens/whitelist', function (ArkClient $client) {
$this->assertResponse('GET', 'tokens/whitelist', function (Client $client) {
return $client->tokens()->whitelist();
});
});
14 changes: 7 additions & 7 deletions tests/API/TransactionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

namespace ArkEcosystem\Tests\Client\API;

use ArkEcosystem\Client\ArkClient;
use ArkEcosystem\Client\Client;

it('calls correct url for all', function () {
$this->assertResponse('GET', 'transactions', function (ArkClient $client) {
$this->assertResponse('GET', 'transactions', function (Client $client) {
return $client->transactions()->all();
});
});
Expand All @@ -16,15 +16,15 @@
$this->assertResponse(
method: 'POST',
path: 'transactions',
callback: function (ArkClient $client) {
callback: function (Client $client) {
return $client->transactions()->create(['transactions' => []]);
},
expectedApi: 'transactions'
);
});

it('calls correct url for get', function () {
$this->assertResponse('GET', 'transactions/dummy', function (ArkClient $client) {
$this->assertResponse('GET', 'transactions/dummy', function (Client $client) {
return $client->transactions()->get('dummy');
});
});
Expand All @@ -33,7 +33,7 @@
$this->assertResponse(
method: 'GET',
path: 'transactions/unconfirmed',
callback: function (ArkClient $client) {
callback: function (Client $client) {
return $client->transactions()->allUnconfirmed();
},
expectedApi: 'transactions'
Expand All @@ -44,7 +44,7 @@
$this->assertResponse(
method: 'GET',
path: 'transactions/unconfirmed/dummy',
callback: function (ArkClient $client) {
callback: function (Client $client) {
return $client->transactions()->getUnconfirmed('dummy');
},
expectedApi: 'transactions'
Expand All @@ -55,7 +55,7 @@
$this->assertResponse(
method: 'GET',
path: 'configuration',
callback: function (ArkClient $client) {
callback: function (Client $client) {
return $client->transactions()->configuration();
},
expectedApi: 'transactions'
Expand Down
Loading
Loading