Skip to content

Does not work for me #60

Description

@mikklaos

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

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions