public Optional<AccountAdapter> getTo(final DataFetchingEnvironment environment) {
    final BlockchainQueries query = getBlockchainQueries(environment);
    final Long blockNumber =
        Optional.<Long>ofNullable(environment.getArgument("block"))
            .or(transactionWithMetadata::getBlockNumber)
            .orElseGet(query::headBlockNumber);

    return transactionWithMetadata
        .getTransaction()
        .getTo()
        .flatMap(
            address ->
                query
                    .getAndMapWorldState(
                        blockNumber,
                        ws -> Optional.of(new AccountAdapter(address, ws.get(address))))
                    .or(() -> Optional.of(new EmptyAccountAdapter(address))));
  }
Retrieves the recipient of the transaction.

<p>This method uses the BlockchainQueries to get the block number and then retrieves the
recipient of the transaction. It then uses the getAndMapWorldState method to get the state of
the recipient's account at the given block number.

@param environment the data fetching environment.
@return an Optional containing an AccountAdapter object representing the recipient's account
    state at the given block number, or an empty Optional if the transaction does not have a
    recipient (i.e., it is a contract creation transaction).
ethereum/api/src/main/java/org/hyperledger/besu/ethereum/api/graphql/internal/pojoadapter/TransactionAdapter.java