/** * @param $coinSymbol * @param $token * @return \BlockCypher\Rest\ApiContext * @throws \BlockCypher\Exception\BlockCypherConfigurationException */ public function getApiContext($coinSymbol, $token) { $coin = BlockCypherCoinSymbolConstants::getBlockCypherCode($coinSymbol); $chain = BlockCypherCoinSymbolConstants::getBlockCypherNetwork($coinSymbol); $apiContext = $this->getApiContextUsingConfigArray($token, $chain, $coin); return $apiContext; }
/** * @param string $walletName * @param string $coinSymbol * @param string $token * @return string * @throws \BlockCypher\Exception\BlockCypherConfigurationException */ public function wallet($walletName, $coinSymbol, $token) { // http://api.blockcypher.com/v1/btc/test3/addrs/559AC33394F28292099183?token=c0afcccdde5081d6429de37d16166ead $coin = BlockCypherCoinSymbolConstants::getBlockCypherCode($coinSymbol); $chain = BlockCypherCoinSymbolConstants::getBlockCypherNetwork($coinSymbol); $apiUrl = "https://api.blockcypher.com/v1/{$coin}/{$chain}/addrs/{$walletName}?token={$token}"; return $apiUrl; }
/** * @test * @dataProvider invalidGetBlockCypherCodeProvider * @expectedException \BlockCypher\Exception\BlockCypherConfigurationException * @param mixed $coinSymbol * @throws \BlockCypher\Exception\BlockCypherConfigurationException */ public function testGetBlockCypherCodeInvalidInput($coinSymbol) { BlockCypherCoinSymbolConstants::getBlockCypherCode($coinSymbol); }
/** * @param string $coinSymbol * @return string */ public function coinSymbolToWssFilter($coinSymbol) { $blockcypherCode = BlockCypherCoinSymbolConstants::getBlockCypherCode($coinSymbol); $blockcypherNetwork = BlockCypherCoinSymbolConstants::getBlockCypherNetwork($coinSymbol); return BlockCypherConstants::WEB_SOCKET_LIVE_ENDPOINT . "v1/{$blockcypherCode}/{$blockcypherNetwork}"; }