https://github.com/hitthecodelabs/bitcointransactionverifier
Interacting with Bitcoin transactions and prices
https://github.com/hitthecodelabs/bitcointransactionverifier
bitcoin-transaction blockchain-address python script
Last synced: about 2 months ago
JSON representation
Interacting with Bitcoin transactions and prices
- Host: GitHub
- URL: https://github.com/hitthecodelabs/bitcointransactionverifier
- Owner: hitthecodelabs
- License: mit
- Created: 2023-11-16T01:55:30.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-16T09:04:58.000Z (over 1 year ago)
- Last Synced: 2025-02-04T11:44:04.805Z (3 months ago)
- Topics: bitcoin-transaction, blockchain-address, python, script
- Language: Jupyter Notebook
- Homepage:
- Size: 1.71 MB
- Stars: 0
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BitcoinTransactionVerifier
This repository contains Python functions for interacting with Bitcoin transactions and prices.
## Functions
### `verify_transactions`
This function queries and verifies Bitcoin transactions for a given address within a specified time period.
#### Parameters
- `address` (str): The Bitcoin address to check for transactions.
- `period_hours` (int, optional): The time period in hours to look back for transactions. Default is 24 hours.#### Returns
- `float`: The total amount of Bitcoin received by the address in the specified period.#### Example
```python
total_received = verify_transactions('your_bitcoin_address')
print(f"Total received in the last 24 hours: {total_received} BTC")
```### `get_bitcoin_price`
This function fetches the current price of Bitcoin in USD from the CoinGecko API.
#### Returns
- `float`: The current price of Bitcoin in USD.#### Example
```python
btc_price = get_bitcoin_price()
if btc_price:
print(f"Current Bitcoin price: ${btc_price} USD")
```## Installation
To use these functions, you need to have Python installed on your system along with the `requests` library.
```bash
pip install requests
```## Usage
After installing the required library, you can import and use these functions in your Python scripts.
## Contributions
Contributions are welcome. Please feel free to submit a pull request or open an issue.
## License
This project is licensed under the MIT License - see the LICENSE file for details.