Peera.

Publication

Partagez vos connaissances.

Questions et Réponses avec des Experts

How do I get all incoming txs to an Eth address with a python script using Alchemy SDK?

I have an Alchemy API python script that checks the balance for an Ethereum address. According to the python alchemy-sdk docs, you can set up the Alchemy API object like this:

from alchemy import Alchemy, Network

# create Alchemy object using your Alchemy api key, default is "demo"
api_key = "your_api_key"

# choose preferred network from Network, default is ETH_MAINNET
network = Network.ETH_MAINNET

# choose the maximum number of retries to perform, default is 5
max_retries = 3

# create Alchemy object
alchemy = Alchemy(api_key, network, max_retries=max_retries)

From here you can get the ether balance of an address like this:

eth_address_balance = alchemy.core.get_balance("ADDRESS", "BLOCK_NUMBER")

Notice that you can get the address balance at any block height by adding "BLOCK_NUMBER" to the get_balance function.

How would I get all transactions that send ether to a certain address between 2 block heights?

I know your first instinct is to tell me to check Etherscan but I've noticed that some exchanges send ether to my address and no transaction appears on Etherscan... That's why I'm trying to build this script.

  • blockchain
  • wallet
0
0
Partager
Commentaires
.

Connaissez-vous la réponse ?

Veuillez vous connecter et la partager.

Web3 (also known as Web 3.0) is an idea for a new iteration of the World Wide Web which incorporates concepts such as decentralization, blockchain technologies, and token-based economics.

142Publications198Réponses
Sui.X.Peera.

Gagne ta part de 1000 Sui

Gagne des points de réputation et obtiens des récompenses pour avoir aidé la communauté Sui à se développer.

Campagne de RécompensesJuin
Nous utilisons des cookies pour vous assurer la meilleure expérience sur notre site Web.
Plus d'infos