From 9e0b5c02dcb74d7e7acef1d74123359491a1570f Mon Sep 17 00:00:00 2001 From: ape364 Date: Fri, 21 Jun 2024 00:35:32 +0500 Subject: [PATCH] feat: add snowscan explorer (#30) --- README.md | 1 + aioetherscan/url_builder.py | 1 + tests/test_url_builder.py | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 3b2ceb2..7b63cfb 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ Supports blockchain explorers: * [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) +* [SnowScan](https://docs.snowscan.xyz/getting-started/endpoint-urls) ## Installation diff --git a/aioetherscan/url_builder.py b/aioetherscan/url_builder.py index c0dc44a..514f220 100644 --- a/aioetherscan/url_builder.py +++ b/aioetherscan/url_builder.py @@ -13,6 +13,7 @@ class UrlBuilder: 'arbitrum': ('arbiscan.io', 'ETH'), 'fantom': ('ftmscan.com', 'FTM'), 'taiko': ('taikoscan.io', 'ETH'), + 'snowscan': ('snowscan.xyz', 'ETH'), } BASE_URL: str = None diff --git a/tests/test_url_builder.py b/tests/test_url_builder.py index 28f016f..5323016 100644 --- a/tests/test_url_builder.py +++ b/tests/test_url_builder.py @@ -55,6 +55,8 @@ def test_filter_params(ub): ('fantom', 'testnet', 'https://api-testnet.ftmscan.com/api'), ('taiko', 'main', 'https://api.taikoscan.io/api'), ('taiko', 'hekla', 'https://api-hekla.taikoscan.io/api'), + ('snowscan', 'main', 'https://api.snowscan.xyz/api'), + ('snowscan', 'testnet', 'https://api-testnet.snowscan.xyz/api'), ], ) def test_api_url(api_kind, network_name, expected): @@ -89,6 +91,8 @@ def test_api_url(api_kind, network_name, expected): ('fantom', 'testnet', 'https://testnet.ftmscan.com'), ('taiko', 'main', 'https://taikoscan.io'), ('taiko', 'hekla', 'https://hekla.taikoscan.io'), + ('snowscan', 'main', 'https://snowscan.xyz'), + ('snowscan', 'testnet', 'https://testnet.snowscan.xyz'), ], ) def test_base_url(api_kind, network_name, expected):