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

Does not work for me #60

Open
mikklaos opened this issue Dec 6, 2022 · 0 comments
Open

Does not work for me #60

mikklaos opened this issue Dec 6, 2022 · 0 comments

Comments

@mikklaos
Copy link

mikklaos commented Dec 6, 2022

When calling the function, it throws the exception and dies. What I am doing wrong?


@on_exception(expo, RateLimitException, max_tries=8)
@limits(calls=15, period=300)
def mint_nft_to_address(cust_address):
    global contract_address
    assert contract_address, "Unable to mint. Empty contract address given"
    assert cust_address, "Unable to mint. Empty customer address given"
    assert metadata_directory_ipfs_uri, "Unable to mint. Empty metadata directory url given"
    url = "https://api.nftport.xyz/v0/mints/customizable"

    payload = {
        "chain": "polygon",
        "contract_address": contract_address,
        "metadata_uri": metadata_directory_ipfs_uri + "/1",
        "mint_to_address": cust_address
    }
    headers = {
        "Content-Type": "application/json",
        "Authorization": API_KEY
    }

    response = requests.post(url, json=payload, headers=headers)

    if response.status_code != 200:
        raise Exception('API response: {}'.format(response.status_code))
    print(response.text)
    return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant