/**
  * @param Wallet $wallet
  * @param BigMoney|null $balance
  * @param $apiUrl
  * @return WalletListItemDto
  */
 public static function from(Wallet $wallet, BigMoney $balance, $apiUrl)
 {
     $walletListItemDto = new self();
     $walletListItemDto->setId($wallet->getId()->getValue());
     $walletListItemDto->setCoinSymbol($wallet->getCoinSymbol());
     $walletListItemDto->setCreationTime($wallet->getCreationTime());
     $walletListItemDto->setName($wallet->getName());
     if ($balance !== null) {
         $walletListItemDto->setBalance((double) (string) $balance->getAmount());
     } else {
         $walletListItemDto->setBalance(-1);
     }
     $walletListItemDto->setApiUrl($apiUrl);
     return $walletListItemDto;
 }
Пример #2
0
 /**
  * @param Crawler $crawler
  */
 private function assertWalletListIsShown($crawler)
 {
     $walletId = $this->wallet->getId()->getValue();
     $this->assertTrue($crawler->filter('html:contains("' . $walletId . '")')->count() > 0);
 }
 /**
  * @param Wallet $wallet
  * @return BlockCypherAddress
  */
 private function getBlockCypherAddress(Wallet $wallet)
 {
     $blockCypherAddress = null;
     $blockCypherAddress = $this->blockCypherAddressService->getAddress($wallet->getId()->getValue(), $wallet->getCoinSymbol(), $wallet->getToken());
     return $blockCypherAddress;
 }