2024-03-14 10:51:25 +01:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
|
# Copyright (C) 2024 Riften Labs AS,
|
|
|
|
|
# This software is licensed under the GNU Affero General Public License (AGPL), version 3.0 or later.,
|
|
|
|
|
# A copy of the license can be found in the LICENSE file or at https://www.gnu.org/licenses/agpl-3.0.html
|
|
|
|
|
|
2024-03-04 16:40:50 +01:00
|
|
|
from urllib.request import urlopen
|
|
|
|
|
import json
|
|
|
|
|
|
2025-07-18 14:11:42 +02:00
|
|
|
url = "http://localhost:8000/cauldron/tvl/1721303452";
|
|
|
|
|
#url = "https://indexer2.cauldron.quest/cauldron/tvl/9999999999"
|
2024-03-04 16:40:50 +01:00
|
|
|
|
|
|
|
|
with urlopen(url) as response:
|
|
|
|
|
data = json.load(response)
|
|
|
|
|
total_satoshis = sum(item["satoshis"] for item in data)
|
|
|
|
|
print(f"Total BCH: {total_satoshis / 100000000}")
|
|
|
|
|
|
|
|
|
|
|