kopia lustrzana https://github.com/bugout-dev/moonstream
Few improvements to "nft ethereum"
rodzic
a564737dbc
commit
5a997ad772
|
@ -36,11 +36,16 @@ def ethereum_handler(args: argparse.Namespace) -> None:
|
|||
web3_client = web3_client_from_cli_or_env(args)
|
||||
result = ethereum_summary(web3_client, args.start, args.end, args.address)
|
||||
|
||||
start_time = result.get("date_range", {}).get("start_time", "UNKNOWN")
|
||||
start_block = result.get("blocks", {}).get("start", -1)
|
||||
end_time = result.get("date_range", {}).get("end_time", "UNKNOWN")
|
||||
end_block = result.get("blocks", {}).get("end", -1)
|
||||
|
||||
humbug_token = args.humbug
|
||||
if humbug_token is None:
|
||||
humbug_token = os.environ.get("MOONSTREAM_HUMBUG_TOKEN")
|
||||
if humbug_token:
|
||||
title = f"NFT activity on the Ethereum blockchain: Blocks {args.start} to {args.end}"
|
||||
title = f"NFT activity on the Ethereum blockchain: {start_time} (block {start_block}) to {end_time} (block {end_block})"
|
||||
publish_json(
|
||||
"nft_ethereum",
|
||||
humbug_token,
|
||||
|
|
|
@ -197,7 +197,7 @@ def summary(
|
|||
|
||||
# By default, let us summarize 100 blocks worth of NFT transfers
|
||||
if from_block is None:
|
||||
from_block = to_block - 100
|
||||
from_block = to_block - 99
|
||||
|
||||
start_block = w3.eth.get_block(from_block)
|
||||
start_time = datetime.utcfromtimestamp(start_block.timestamp).isoformat()
|
||||
|
|
Ładowanie…
Reference in New Issue