/** * @param Wallet[] $wallets * @param BigMoney[] $walletBalances * @param ApiRouter $apiRouter * @return array */ public static function from($wallets, $walletBalances, $apiRouter) { $walletListItemDtos = array(); foreach ($wallets as $wallet) { $apiUrl = $apiRouter->wallet($wallet->getId()->getValue(), $wallet->getCoinSymbol(), $wallet->getToken()); $walletListItemDto = WalletListItemDto::from($wallet, $walletBalances[$wallet->getId()->getValue()], $apiUrl); $walletListItemDtos[] = $walletListItemDto; } return $walletListItemDtos; }