Skip to content

Instantly share code, notes, and snippets.

@joshwolff1
Created December 18, 2021 22:31
Show Gist options
  • Save joshwolff1/298e8251e43ff9b4815028683b1ca17d to your computer and use it in GitHub Desktop.
Save joshwolff1/298e8251e43ff9b4815028683b1ca17d to your computer and use it in GitHub Desktop.
check_mint_from_candy_tx_success.py
import requests
if __name__ == '__main__':
api_key_id = None
api_secret_key = None
tx_signature_succeeded = "2vsU2QVdAvQL1o2UQ37zwNiRFmAbv1DVHKP5Fi9MhWkf2bYC5iBobA6DHFAJSa1fCoFYCXzRCWCJrj9nQcvmPLty"
tx_signature_failed = "4FVw9dBA8KLLWvKZwjxfgkhKeq6F8PGDRVoqt1YKync3u8CRVeVxbhtVGUAVtPKksK2USLRxqyCrrUUZsZtBxq6C"
response = requests.get(
f"https://api.theblockchainapi.com/v1/solana/transaction/devnet/{tx_signature_succeeded}",
headers={
"APIKeyId": api_key_id,
"APISecretKey": api_secret_key
}
)
if response.status_code == 401:
raise Exception("Fill in API Key Pair!")
tx_succeeded_info = response.json()
print(tx_succeeded_info)
did_succeed = tx_succeeded_info['result']['meta']['err'] is None
print("Did it succeed? ", did_succeed)
response = requests.get(
f"https://api.theblockchainapi.com/v1/solana/transaction/devnet/{tx_signature_failed}",
headers={
"APIKeyId": api_key_id,
"APISecretKey": api_secret_key
}
)
if response.status_code == 401:
raise Exception("Fill in API Key Pair!")
tx_failed_info = response.json()
print(tx_failed_info)
did_succeed = tx_failed_info['result']['meta']['err'] is None
print("Did it succeed? ", did_succeed)
@joshwolff1
Copy link
Author

joshwolff1 commented Dec 18, 2021

Expected output

`{'id': 1.0, 'jsonrpc': '2.0', 'result': {.......

Did it succeed? True

{'id': 1.0, 'jsonrpc': '2.0', 'result': {.......

Did it succeed? False`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment