Ejemplo n.º 1
0
 /**
  * @return array
  */
 public function toArray()
 {
     $entityAsArray = array();
     $entityAsArray['id'] = $this->id->toArray();
     $entityAsArray['userId'] = $this->userId->toArray();
     $entityAsArray['name'] = $this->name;
     $entityAsArray['coinSymbol'] = $this->coinSymbol;
     $entityAsArray['token'] = $this->token;
     $entityAsArray['creationTime'] = clone $this->creationTime;
     return $entityAsArray;
 }
 /**
  * @return array
  */
 public function toArray()
 {
     $entityAsArray = array();
     $entityAsArray['id'] = $this->id->toArray();
     $entityAsArray['walletId'] = $this->walletId->toArray();
     $entityAsArray['hash'] = $this->hash;
     $entityAsArray['payToAddress'] = $this->payToAddress;
     $entityAsArray['description'] = $this->description;
     $entityAsArray['amount'] = $this->amount;
     $entityAsArray['creationTime'] = clone $this->creationTime;
     return $entityAsArray;
 }
 /**
  * @param WalletId $walletId
  * @return Wallet
  */
 public function walletOfId(WalletId $walletId)
 {
     /** @var Result $result */
     $result = $this->repository->query()->where('id', '==', $walletId->getValue())->execute();
     if ($result === false) {
         return null;
     }
     if ($result->count() == 0) {
         return null;
     }
     $wallet = $this->documentToEncryptedWallet($result->first());
     return $wallet;
 }
 /**
  * @return WalletId
  * @throws \Exception
  */
 public function nextIdentity()
 {
     $id = strtoupper(str_replace('.', '', uniqid('', true)));
     if (strlen($id) > 25) {
         throw new \Exception("BlockCypher wallet names can not be longer than 25 characters");
     }
     return WalletId::create($id);
 }
Ejemplo n.º 5
0
 public function toArray()
 {
     $entityAsArray = array();
     $entityAsArray['id'] = $this->id->toArray();
     $entityAsArray['walletId'] = $this->walletId->toArray();
     $entityAsArray['address'] = $this->address;
     $entityAsArray['tag'] = $this->tag;
     $entityAsArray['private'] = $this->private;
     $entityAsArray['public'] = $this->public;
     $entityAsArray['wif'] = $this->wif;
     $entityAsArray['callbackUrl'] = $this->callbackUrl;
     $entityAsArray['creationTime'] = clone $this->creationTime;
     return $entityAsArray;
 }
 /**
  * @param WalletId $walletId
  * @return EncryptedTransaction
  */
 public function transactionsOfWalletId(WalletId $walletId)
 {
     /** @var EncryptedTransactionDocument[] $result */
     $result = $this->repository->query()->where('walletId', '==', $walletId->getValue())->execute();
     $encryptedTransactions = $this->documentArrayToObjectArray($result);
     return $encryptedTransactions;
 }
 /**
  * @param WalletId $walletId
  * @return EncryptedAddress[]
  */
 public function addressesOfWalletId(WalletId $walletId)
 {
     $result = $this->repository->query()->where('walletId', '==', $walletId->getValue())->execute();
     if ($result === false) {
         return array();
     }
     if ($result->count() == 0) {
         return array();
     }
     /** @var EncryptedAddressDocument[] $encryptedAddressDocuments */
     $encryptedAddressDocuments = $result;
     $encryptedAddresses = $this->documentArrayToObjectArray($encryptedAddressDocuments);
     return $encryptedAddresses;
 }