lthn.io/app/Mod/Chain/Contracts/ChainDaemon.php
Claude 41a13e6ef4
refactor: extract ChainDaemon and ChainWallet interface contracts
DaemonRpc implements ChainDaemon, WalletRpc implements ChainWallet.
Interfaces bound in FrameworkBooted — enables mocking for tests and
swapping to Go wrapper when go-process is ready. Concrete bindings
kept for backwards compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-04 11:26:25 +01:00

32 lines
686 B
PHP

<?php
declare(strict_types=1);
namespace Mod\Chain\Contracts;
/**
* Chain daemon RPC interface.
*
* $daemon = app(ChainDaemon::class);
* $info = $daemon->getInfo();
*/
interface ChainDaemon
{
public function getInfo(): array;
public function getBlockByHeight(int $height): array;
public function getBlockByHash(string $hash): array;
public function getLastBlockHeader(): array;
public function getAllAliases(): array;
public function getAliasByName(string $name): ?array;
public function getBlockCount(): int;
public function getTransaction(string $hash): array;
public function call(string $method, array $params = []): array;
}