/** * @param Address $address * @param BlockCypherAddressBalance $blockCypherAddressBalance * @param string $apiUrl * @param string $explorerUrl * @return $this */ public static function from(Address $address, BlockCypherAddressBalance $blockCypherAddressBalance, $apiUrl, $explorerUrl) { $addressListItemDto = new self(); $addressListItemDto->setAddress($address->getAddress()); $addressListItemDto->setTag($address->getTag()); $addressListItemDto->setCreationTime($address->getCreationTime()); $addressListItemDto->setFinalBalance($blockCypherAddressBalance->getFinalBalance()); $addressListItemDto->setNTx($blockCypherAddressBalance->getNTx()); $addressListItemDto->setApiUrl($apiUrl); $addressListItemDto->setExplorerUrl($explorerUrl); return $addressListItemDto; }
/** * @param Wallet $wallet * @param Transaction[]|null $transactions * @param BlockCypherAddress $blockCypherAddress * @param ApiRouter $apiRouter * @param ExplorerRouter $explorerRouter * @return TransactionListDto */ public static function from(Wallet $wallet, $transactions, BlockCypherAddress $blockCypherAddress, ApiRouter $apiRouter, ExplorerRouter $explorerRouter) { $transactionListDto = new self(); // From BlockCypher Address $transactionListDto->setTotalSent($blockCypherAddress->getTotalSent()); $transactionListDto->setTotalReceived($blockCypherAddress->getTotalReceived()); $transactionListDto->setUnconfirmedBalance($blockCypherAddress->getUnconfirmedBalance()); $transactionListDto->setBalance($blockCypherAddress->getBalance()); $transactionListDto->setFinalBalance($blockCypherAddress->getFinalBalance()); $transactionListDto->setNTx($blockCypherAddress->getNTx()); $transactionListDto->setUnconfirmedNTx($blockCypherAddress->getUnconfirmedNTx()); $transactionListDto->setFinalNTx($blockCypherAddress->getFinalNTx()); $blockCypherTXRefs = $blockCypherAddress->getAllTxrefs(); // Confirmed and unconfirmed $transactionListItems = TransactionListItemArray::from($blockCypherTXRefs); $transactionListItemDtos = TransactionListItemDtoArray::from($wallet, $transactions, $transactionListItems, $apiRouter, $explorerRouter); $transactionListDto->setTransactionListItemDtos($transactionListItemDtos); return $transactionListDto; }