module EvmClient::ExplorerUrlHelper
Constants
- CHAIN_PREFIX
Public Instance Methods
explorer_path(suffix, version = EvmClient::Singleton.instance.get_chain)
click to toggle source
# File lib/evm_client/explorer_url_helper.rb, line 20 def explorer_path(suffix, version = EvmClient::Singleton.instance.get_chain) prefix = CHAIN_PREFIX.fetch(version, "") "https://#{prefix}etherscan.io/#{suffix}" end
link_to_address(label, address, **opts)
click to toggle source
# File lib/evm_client/explorer_url_helper.rb, line 16 def link_to_address(label, address, **opts) link_to label, explorer_path("address/#{address}"), {target: "_blank"}.merge(opts) end
link_to_tx(label, txid, **opts)
click to toggle source
# File lib/evm_client/explorer_url_helper.rb, line 12 def link_to_tx(label, txid, **opts) link_to label, explorer_path("tx/#{txid}"), {target: "_blank"}.merge(opts) end