This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
if __name__ == '__main__': | |
api_key_id = None | |
api_secret_key = None | |
tx_signature_succeeded = "2vsU2QVdAvQL1o2UQ37zwNiRFmAbv1DVHKP5Fi9MhWkf2bYC5iBobA6DHFAJSa1fCoFYCXzRCWCJrj9nQcvmPLty" | |
tx_signature_failed = "4FVw9dBA8KLLWvKZwjxfgkhKeq6F8PGDRVoqt1YKync3u8CRVeVxbhtVGUAVtPKksK2USLRxqyCrrUUZsZtBxq6C" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
SEARCH_CANDY_MACHINES_ENDPOINT = "https://api.theblockchainapi.com/v1/solana/nft/candy_machine/search" | |
def get_headers(api_key_id, secret_key): | |
headers = dict() | |
if secret_key: | |
headers["APISecretKey"] = secret_key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from cryptography.hazmat.primitives import serialization as crypto_serialization | |
from cryptography.hazmat.primitives.asymmetric import rsa | |
from cryptography.hazmat.backends import default_backend as crypto_default_backend | |
from cryptography.hazmat.primitives import hashes | |
from cryptography.hazmat.primitives.asymmetric import padding | |
from cryptography.hazmat.primitives import serialization | |
from cryptography.exceptions import InvalidSignature | |
import time | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from decimal import * | |
def recursive_get_dict(my_dict, use_decimal=True): | |
""" | |
:param my_dict: The dict to be converted, which is assumed to come from the record from the DynamoDB stream | |
:param use_decimal: Whether or not to use Decimal or int for the type for the number | |
:return: A dictionary converted from this format {"username" : {"S" : "beto"}} to this format {"username": "beto"} | |
""" | |
if type(my_dict) is not dict: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from gremlin_python.structure.graph import Graph | |
from gremlin_python.process.graph_traversal import __ | |
# I use a property instead of directly setting the ID because I could not get it to work, and this works | |
# just as well for now. I'd imagine setting the id directly is better for runtime. | |
# If you figure out how to set the id directly with gremlin-python, feel free to make a pull request and I'll merge it. | |
IDENTIFICATION_PROPERTY = 'identification' | |
WEIGHT_PROPERTY = 'weight' | |
""" |