Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

import requests # جلب بيانات البلوك من الرابط block_url = "https://api.blockcypher.com/v1/btc/main/blocks/00000000000000000000cfbeaeb0b5f18dffc118597310d3f87096a2a204b512" response = requests.get(block_url) block_data = response.json() # طباعة بعض التفاصيل print(f"Block Height: {block_data['height']}") print(f"Block Hash: {block_data['hash']}") print(f"Previous Block Hash: {block_data['previous_hash']}") print(f"Time: {block_data['time']}") print(f"Unconfirmed Transactions: {block_data['unconfirmed_count']}") print(f"High Fee per KB: {block_data['high_fee_per_kb']} satoshis") print(f"Medium Fee per KB: {block_data['medium_fee_per_kb']} satoshis") print(f"Low Fee per KB: {block_data['low_fee_per_kb']} satoshis") #149

Closed
asalomeri opened this issue Jan 3, 2025 · 3 comments

Comments

@asalomeri
Copy link

Originally posted by @asalomeri in blockcypher/explorer#572

@asalomeri
Copy link
Author

import requests

جلب بيانات البلوك من الرابط

block_url = "https://api.blockcypher.com/v1/btc/main/blocks/00000000000000000000cfbeaeb0b5f18dffc118597310d3f87096a2a204b512"
response = requests.get(block_url)
block_data = response.json()

طباعة بعض التفاصيل

print(f"Block Height: {block_data['height']}")
print(f"Block Hash: {block_data['hash']}")
print(f"Previous Block Hash: {block_data['prev_block']}")
print(f"Time: {block_data['time']}")
print(f"Number of Transactions: {block_data['n_tx']}")
print(f"Total Value: {block_data['total']} satoshis")
print(f"Fees: {block_data['fees']} satoshis")

@asalomeri
Copy link
Author

from bitcoinlib.wallets import Wallet

فتح المحفظة

wallet = Wallet('MyWallet') # تأكد من أن المحفظة "MyWallet" تم إنشاؤها مسبقًا وتحتوي على المفتاح الخاص للعنوان المصدر

عنوان الوجهة

destination_address = 'bc1qv4ccyjl85pnm89fl3kqlkeegc5resqwzjg4tzz'

المبلغ بالبيتكوين (BTC)

amount_btc = 1.0 # قم بتحديد المبلغ الذي تود تحويله

إنشاء وإرسال المعاملة

tx = wallet.send_to(destination_address, amount_btc)

طباعة تفاصيل المعاملة

print("Transaction ID:", tx.txid)
print("Transaction details:", tx.info())

@PastaPastaPasta PastaPastaPasta closed this as not planned Won't fix, can't repro, duplicate, stale Jan 4, 2025
@dashpay dashpay locked as off-topic and limited conversation to collaborators Jan 4, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@PastaPastaPasta @asalomeri and others