From 86fb740bd6f4af33e7177273efd7b17ae835ce26 Mon Sep 17 00:00:00 2001
From: decanus <7621705+decanus@users.noreply.github.com>
Date: Tue, 14 Sep 2021 16:35:54 +0200
Subject: [PATCH 1/2] adding fantom supoort
---
ethtx_ce/frontend/templates/index.html | 1 +
wsgi.py | 2 ++
2 files changed, 3 insertions(+)
diff --git a/ethtx_ce/frontend/templates/index.html b/ethtx_ce/frontend/templates/index.html
index efde376..f4b988f 100644
--- a/ethtx_ce/frontend/templates/index.html
+++ b/ethtx_ce/frontend/templates/index.html
@@ -216,6 +216,7 @@
+
diff --git a/wsgi.py b/wsgi.py
index 1a79854..49f10a2 100644
--- a/wsgi.py
+++ b/wsgi.py
@@ -28,12 +28,14 @@
"mainnet": dict(hook=os.getenv("MAINNET_NODE_URL", ""), poa=False),
"goerli": dict(hook=os.getenv("GOERLI_NODE_URL", ""), poa=True),
"rinkeby": dict(hook=os.getenv("RINKEBY_NODE_URL", ""), poa=True),
+ "fantom": dict(hook=os.getenv("FANTOM_NODE_URL", ""), poa=True),
},
default_chain="mainnet",
etherscan_urls={
"mainnet": "https://api.etherscan.io/api",
"goerli": "https://api-goerli.etherscan.io/api",
"rinkeby": "https://api-rinkeby.etherscan.io/api",
+ "fantom": "https://api.fmtscan.com/api",
},
)
From 6ce8e8ac791dfd9fc9da3cb7297603ffefa4192b Mon Sep 17 00:00:00 2001
From: decanus <7621705+decanus@users.noreply.github.com>
Date: Tue, 14 Sep 2021 17:25:14 +0200
Subject: [PATCH 2/2] added macro
---
ethtx_ce/frontend/templates/index.html | 1 +
ethtx_ce/frontend/templates/semantics.html | 2 ++
ethtx_ce/frontend/templates/transaction.html | 12 ++++++++++--
wsgi.py | 2 ++
4 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/ethtx_ce/frontend/templates/index.html b/ethtx_ce/frontend/templates/index.html
index f4b988f..10a70ba 100644
--- a/ethtx_ce/frontend/templates/index.html
+++ b/ethtx_ce/frontend/templates/index.html
@@ -217,6 +217,7 @@
+
diff --git a/ethtx_ce/frontend/templates/semantics.html b/ethtx_ce/frontend/templates/semantics.html
index 3f4be38..fd2a5c4 100644
--- a/ethtx_ce/frontend/templates/semantics.html
+++ b/ethtx_ce/frontend/templates/semantics.html
@@ -182,6 +182,8 @@
Semantics for: {{address}} / {{ metadata.chain }}
+
+
diff --git a/ethtx_ce/frontend/templates/transaction.html b/ethtx_ce/frontend/templates/transaction.html
index 935ad7b..0720ddd 100644
--- a/ethtx_ce/frontend/templates/transaction.html
+++ b/ethtx_ce/frontend/templates/transaction.html
@@ -12,9 +12,17 @@
~ limitations under the License.
-->
+{% macro block_explorer_link(chain_id) %}
+ {%- if chain_id.startswith("fantom") -%}
+ https://{%- if chain_id == 'fantom_testnet' -%}testnet.{% endif %}ftmscan.io/
+ {% else %}
+ https://{%- if chain_id != 'mainnet' -%}{{ chain_id }}.{% endif %}etherscan.io/
+ {% endif %}
+{% endmacro %}
+
{% macro address_link(address, label, badge="") %}
{%- if address and address != '0x0000000000000000000000000000000000000000' -%}
-
+
{%- if badge -%}
[{{ badge }}]
{%- endif -%}
@@ -27,7 +35,7 @@
{% macro nft_link(address, label) %}
{%- if address and address != '0x0000000000000000000000000000000000000000' -%}
-
+
{{- label -}}
{%- else -%}
diff --git a/wsgi.py b/wsgi.py
index 49f10a2..c5a70af 100644
--- a/wsgi.py
+++ b/wsgi.py
@@ -29,6 +29,7 @@
"goerli": dict(hook=os.getenv("GOERLI_NODE_URL", ""), poa=True),
"rinkeby": dict(hook=os.getenv("RINKEBY_NODE_URL", ""), poa=True),
"fantom": dict(hook=os.getenv("FANTOM_NODE_URL", ""), poa=True),
+ "fantom_testnet": dict(hook=os.getenv("FANTOM_TESTNET_NODE_URL", ""), poa=True),
},
default_chain="mainnet",
etherscan_urls={
@@ -36,6 +37,7 @@
"goerli": "https://api-goerli.etherscan.io/api",
"rinkeby": "https://api-rinkeby.etherscan.io/api",
"fantom": "https://api.fmtscan.com/api",
+ "fantom_testnet": "https://api-testnet.ftmscan.com/api",
},
)