From 3d5471a899619ce25e69a08b1a3291d773c42373 Mon Sep 17 00:00:00 2001 From: Alex Barnsley <8069294+alexbarnsley@users.noreply.github.com> Date: Wed, 26 Mar 2025 23:27:45 +0000 Subject: [PATCH 1/3] refactor: add transactions configuration endpoint --- src/API/Transactions.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/API/Transactions.php b/src/API/Transactions.php index 60ce910..adbb784 100644 --- a/src/API/Transactions.php +++ b/src/API/Transactions.php @@ -64,6 +64,16 @@ public function showUnconfirmed(string $id): ?array return $this->get("transactions/unconfirmed/{$id}"); } + /** + * Get the transaction pool configuration. + * + * @return array + */ + public function configuration(): ?array + { + return $this->withApi('transactions')->get('configuration'); + } + /** * Get a list of valid transaction types. * From f5ef528bb15a6b61b900cfc93042cb2ee6914e9c Mon Sep 17 00:00:00 2001 From: Alex Barnsley <8069294+alexbarnsley@users.noreply.github.com> Date: Wed, 26 Mar 2025 23:29:22 +0000 Subject: [PATCH 2/3] test --- tests/API/TransactionsTest.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/API/TransactionsTest.php b/tests/API/TransactionsTest.php index 5c3c263..59d44ba 100644 --- a/tests/API/TransactionsTest.php +++ b/tests/API/TransactionsTest.php @@ -56,6 +56,19 @@ public function show_unconfirmed_calls_correct_url() }); } + /** @test */ + public function configuration_calls_correct_url() + { + $this->assertResponse( + method: 'GET', + path: 'configuration', + callback: function ($client) { + return $client->transactions()->configuration(); + }, + expectedApi: 'transactions' + ); + } + /** @test */ public function types_calls_correct_url() { From 83fbc6165da2e84eeb4129afdf54d213a26692c9 Mon Sep 17 00:00:00 2001 From: Alex Barnsley <8069294+alexbarnsley@users.noreply.github.com> Date: Wed, 26 Mar 2025 23:30:37 +0000 Subject: [PATCH 3/3] remove redundant tx endpoint methods --- src/API/Transactions.php | 30 ------------------------------ tests/API/TransactionsTest.php | 24 ------------------------ 2 files changed, 54 deletions(-) diff --git a/src/API/Transactions.php b/src/API/Transactions.php index adbb784..e2a37f9 100644 --- a/src/API/Transactions.php +++ b/src/API/Transactions.php @@ -73,34 +73,4 @@ public function configuration(): ?array { return $this->withApi('transactions')->get('configuration'); } - - /** - * Get a list of valid transaction types. - * - * @return array - */ - public function types(): ?array - { - return $this->get('transactions/types'); - } - - /** - * Get the list of static transaction fees. - * - * @return array - */ - public function fees(): ?array - { - return $this->get('transactions/fees'); - } - - /** - * Get the list of transaction schemas. - * - * @return array - */ - public function schemas(): ?array - { - return $this->get('transactions/schemas'); - } } diff --git a/tests/API/TransactionsTest.php b/tests/API/TransactionsTest.php index 59d44ba..9eb8803 100644 --- a/tests/API/TransactionsTest.php +++ b/tests/API/TransactionsTest.php @@ -68,28 +68,4 @@ public function configuration_calls_correct_url() expectedApi: 'transactions' ); } - - /** @test */ - public function types_calls_correct_url() - { - $this->assertResponse('GET', 'transactions/types', function ($client) { - return $client->transactions()->types(); - }); - } - - /** @test */ - public function fees_calls_correct_url() - { - $this->assertResponse('GET', 'transactions/fees', function ($client) { - return $client->transactions()->fees(); - }); - } - - /** @test */ - public function schemas_calls_correct_url() - { - $this->assertResponse('GET', 'transactions/schemas', function ($client) { - return $client->transactions()->schemas(); - }); - } }