Skip to content

Commit 71551d7

Browse files
authored
refactor: base instance name (#131)
1 parent 6c05ac5 commit 71551d7

18 files changed

Lines changed: 115 additions & 79 deletions

src/ArkClient.php renamed to src/Client.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use ArkEcosystem\Client\API\Wallets;
2222
use GuzzleHttp\HandlerStack;
2323

24-
class ArkClient
24+
class Client
2525
{
2626
public Connection $connection;
2727

tests/API/ApiNodesTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
namespace ArkEcosystem\Tests\Client\API;
66

7-
use ArkEcosystem\Client\ArkClient;
7+
use ArkEcosystem\Client\Client;
88

99
it('calls the correct url for api nodes', function () {
10-
$this->assertResponse('GET', 'api-nodes', function (ArkClient $client) {
10+
$this->assertResponse('GET', 'api-nodes', function (Client $client) {
1111
return $client->apiNodes()->all();
1212
});
1313
});

tests/API/BlockchainTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
namespace ArkEcosystem\Tests\Client\API;
66

7-
use ArkEcosystem\Client\ArkClient;
7+
use ArkEcosystem\Client\Client;
88

99
it('calls the correct blockchain url', function () {
10-
$this->assertResponse('GET', 'blockchain', function (ArkClient $client) {
10+
$this->assertResponse('GET', 'blockchain', function (Client $client) {
1111
return $client->blockchain()->blockchain();
1212
});
1313
});

tests/API/BlocksTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,34 @@
44

55
namespace ArkEcosystem\Tests\Client\API;
66

7-
use ArkEcosystem\Client\ArkClient;
7+
use ArkEcosystem\Client\Client;
88

99
it('calls correct url for all', function () {
10-
$this->assertResponse('GET', 'blocks', function (ArkClient $client) {
10+
$this->assertResponse('GET', 'blocks', function (Client $client) {
1111
return $client->blocks()->all();
1212
});
1313
});
1414

1515
it('calls correct url for get', function () {
16-
$this->assertResponse('GET', 'blocks/dummy', function (ArkClient $client) {
16+
$this->assertResponse('GET', 'blocks/dummy', function (Client $client) {
1717
return $client->blocks()->get('dummy');
1818
});
1919
});
2020

2121
it('calls correct url for first', function () {
22-
$this->assertResponse('GET', 'blocks/first', function (ArkClient $client) {
22+
$this->assertResponse('GET', 'blocks/first', function (Client $client) {
2323
return $client->blocks()->first();
2424
});
2525
});
2626

2727
it('calls correct url for last', function () {
28-
$this->assertResponse('GET', 'blocks/last', function (ArkClient $client) {
28+
$this->assertResponse('GET', 'blocks/last', function (Client $client) {
2929
return $client->blocks()->last();
3030
});
3131
});
3232

3333
it('calls correct url for transactions', function () {
34-
$this->assertResponse('GET', 'blocks/dummy/transactions', function (ArkClient $client) {
34+
$this->assertResponse('GET', 'blocks/dummy/transactions', function (Client $client) {
3535
return $client->blocks()->transactions('dummy');
3636
});
3737
});

tests/API/CommitsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
namespace ArkEcosystem\Tests\Client\API;
66

7-
use ArkEcosystem\Client\ArkClient;
7+
use ArkEcosystem\Client\Client;
88

99
it('calls the correct URL for get', function () {
10-
$this->assertResponse('GET', 'commits/1', function (ArkClient $client) {
10+
$this->assertResponse('GET', 'commits/1', function (Client $client) {
1111
return $client->commits()->get(1);
1212
});
1313
});

tests/API/ContractsTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
namespace ArkEcosystem\Tests\Client\API;
66

7-
use ArkEcosystem\Client\ArkClient;
7+
use ArkEcosystem\Client\Client;
88

99
it('calls the correct url for all contracts', function () {
10-
$this->assertResponse('GET', 'contracts', function (ArkClient $client) {
10+
$this->assertResponse('GET', 'contracts', function (Client $client) {
1111
return $client->contracts()->all();
1212
});
1313
});
1414

1515
it('calls the correct url for abi', function () {
16-
$this->assertResponse('GET', 'contracts/consensus/some-wallet/abi', function (ArkClient $client) {
16+
$this->assertResponse('GET', 'contracts/consensus/some-wallet/abi', function (Client $client) {
1717
return $client->contracts()->abi('consensus', 'some-wallet');
1818
});
1919
});

tests/API/EVMTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44

55
namespace ArkEcosystem\Tests\Client\API;
66

7-
use ArkEcosystem\Client\ArkClient;
7+
use ArkEcosystem\Client\Client;
88

99
it('calls the correct URL for eth_call', function () {
1010
$this->assertResponse(
1111
method: 'POST',
1212
path: 'api/',
13-
callback: function (ArkClient $client) {
13+
callback: function (Client $client) {
1414
return $client->evm()->call([
1515
'method' => 'eth_call',
1616
'params' => [[

tests/API/NodeTest.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,40 @@
44

55
namespace ArkEcosystem\Tests\Client\API;
66

7-
use ArkEcosystem\Client\ArkClient;
7+
use ArkEcosystem\Client\Client;
88

99
it('calls the correct url for status', function () {
10-
$this->assertResponse('GET', 'node/status', function (ArkClient $client) {
10+
$this->assertResponse('GET', 'node/status', function (Client $client) {
1111
return $client->node()->status();
1212
});
1313
});
1414

1515
it('calls the correct url for syncing', function () {
16-
$this->assertResponse('GET', 'node/syncing', function (ArkClient $client) {
16+
$this->assertResponse('GET', 'node/syncing', function (Client $client) {
1717
return $client->node()->syncing();
1818
});
1919
});
2020

2121
it('calls the correct url for configuration', function () {
22-
$this->assertResponse('GET', 'node/configuration', function (ArkClient $client) {
22+
$this->assertResponse('GET', 'node/configuration', function (Client $client) {
2323
return $client->node()->configuration();
2424
});
2525
});
2626

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

3333
it('calls the correct url for fees', function () {
34-
$this->assertResponse('GET', 'node/fees', function (ArkClient $client) {
34+
$this->assertResponse('GET', 'node/fees', function (Client $client) {
3535
return $client->node()->fees();
3636
});
3737
});
38+
39+
it('calls the correct url for fees with query', function () {
40+
$this->assertResponse('GET', 'node/fees?days=7', function (Client $client) {
41+
return $client->node()->fees(7);
42+
});
43+
});

tests/API/PeersTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@
44

55
namespace ArkEcosystem\Tests\Client\API;
66

7-
use ArkEcosystem\Client\ArkClient;
7+
use ArkEcosystem\Client\Client;
88

99
it('calls correct url for all', function () {
10-
$this->assertResponse('GET', 'peers', function (ArkClient $client) {
10+
$this->assertResponse('GET', 'peers', function (Client $client) {
1111
return $client->peers()->all();
1212
});
1313
});
1414

1515
it('calls correct url for get', function () {
16-
$this->assertResponse('GET', 'peers/dummy', function (ArkClient $client) {
16+
$this->assertResponse('GET', 'peers/dummy', function (Client $client) {
1717
return $client->peers()->get('dummy');
1818
});
1919
});

tests/API/ReceiptsTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
namespace ArkEcosystem\Tests\Client\API;
66

7-
use ArkEcosystem\Client\ArkClient;
7+
use ArkEcosystem\Client\Client;
88
use Exception;
99

1010
it('calls the correct url for all', function () {
11-
$this->assertResponse('GET', 'receipts', function (ArkClient $client) {
11+
$this->assertResponse('GET', 'receipts', function (Client $client) {
1212
return $client->receipts()->all();
1313
});
1414
});
@@ -17,7 +17,7 @@
1717
$this->assertResponse(
1818
method: 'GET',
1919
path: 'receipts/dummyTxHash',
20-
callback: function (ArkClient $client) {
20+
callback: function (Client $client) {
2121
return $client->receipts()->get('dummyTxHash');
2222
},
2323
response: ['data' => [['id' => 'dummyTxHash']]],
@@ -31,7 +31,7 @@
3131
$this->assertResponse(
3232
method: 'GET',
3333
path: 'receipts/dummyTxHash',
34-
callback: function (ArkClient $client) {
34+
callback: function (Client $client) {
3535
return $client->receipts()->get('dummyTxHash');
3636
},
3737
response: ['data' => []],

0 commit comments

Comments
 (0)