(blockchain: string, address: string)
| 1 | import Blockchain from "../blockchain_enum"; |
| 2 | |
| 3 | function getAddressLink(blockchain: string, address: string): string { |
| 4 | switch (blockchain) { |
| 5 | case Blockchain.BITCOIN: |
| 6 | return `https://www.blockchain.com/btc/address/${address}`; |
| 7 | case Blockchain.ETHEREUM: |
| 8 | return `https://etherscan.io/address/${address}`; |
| 9 | default: |
| 10 | console.error( |
| 11 | `No block explorer link has been set for blockchain ${blockchain}`, |
| 12 | ); |
| 13 | return ""; |
| 14 | } |
| 15 | } |
| 16 | |
| 17 | export default getAddressLink; |
no outgoing calls
no test coverage detected