From c2df629af412722702a987044491e87f154ec6a6 Mon Sep 17 00:00:00 2001 From: ape364 Date: Thu, 20 Jun 2024 23:13:03 +0500 Subject: [PATCH] feat: add taiko explorer --- README.md | 2 ++ aioetherscan/url_builder.py | 1 + tests/test_url_builder.py | 5 +++++ 3 files changed, 8 insertions(+) diff --git a/README.md b/README.md index 97ebad9..3b2ceb2 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,8 @@ Supports blockchain explorers: * [Arbiscan](https://docs.arbiscan.io/getting-started/endpoint-urls) * [FtmScan](https://docs.ftmscan.com/getting-started/endpoint-urls) * [Basescan](https://docs.basescan.org/getting-started/endpoint-urls) +* [Taikoscan](https://docs.taikoscan.io/getting-started/endpoint-urls) + ## Installation ```sh diff --git a/aioetherscan/url_builder.py b/aioetherscan/url_builder.py index 6fc9499..c0dc44a 100644 --- a/aioetherscan/url_builder.py +++ b/aioetherscan/url_builder.py @@ -12,6 +12,7 @@ class UrlBuilder: 'base': ('basescan.org', 'ETH'), 'arbitrum': ('arbiscan.io', 'ETH'), 'fantom': ('ftmscan.com', 'FTM'), + 'taiko': ('taikoscan.io', 'ETH'), } BASE_URL: str = None diff --git a/tests/test_url_builder.py b/tests/test_url_builder.py index 868fc3f..28f016f 100644 --- a/tests/test_url_builder.py +++ b/tests/test_url_builder.py @@ -53,6 +53,8 @@ def test_filter_params(ub): ('arbitrum', 'goerli', 'https://api-goerli.arbiscan.io/api'), ('fantom', 'main', 'https://api.ftmscan.com/api'), ('fantom', 'testnet', 'https://api-testnet.ftmscan.com/api'), + ('taiko', 'main', 'https://api.taikoscan.io/api'), + ('taiko', 'hekla', 'https://api-hekla.taikoscan.io/api'), ], ) def test_api_url(api_kind, network_name, expected): @@ -85,6 +87,8 @@ def test_api_url(api_kind, network_name, expected): ('arbitrum', 'goerli', 'https://goerli.arbiscan.io'), ('fantom', 'main', 'https://ftmscan.com'), ('fantom', 'testnet', 'https://testnet.ftmscan.com'), + ('taiko', 'main', 'https://taikoscan.io'), + ('taiko', 'hekla', 'https://hekla.taikoscan.io'), ], ) def test_base_url(api_kind, network_name, expected): @@ -109,6 +113,7 @@ def test_invalid_api_kind(): ('base', 'ETH'), ('arbitrum', 'ETH'), ('fantom', 'FTM'), + ('taiko', 'ETH'), ], ) def test_currency(api_kind, expected):