Skip to main content

No project description provided

Project description

Twitter Pypi


Solana-Nfts-Python

Cryptomafia

🎨 A python client for querying the nfts in your wallet.

Table of Contents

I. Overview

Query your Metaplex Spl Tokens with easy to use apis.

II. Install

pip install solana_nfts

III. Usage

from solana_nfts import Client`

nft_client = Client()

address = "<YOUR_SOLANA_PUBLIC_KEY>"

nfts = nft_client.fetch_nfts_from_wallet_address(address)

The following returns an array nfts of json objects.

Each element of this array contains a json object with the following schema:

  • The `arweave_metadata` key gives us the arweave metadata for the nft.
  • The `token_metadata` key gives us the solana token metadata for the nft.
  • 
    {
        "arweave_metadata": {
            "attributes": [
                {
                    "trait_type": "Mint Number",
                    "value": 2353
                },
                {
                    "trait_type": "Generation",
                    "value": 1
                },
                {
                    "trait_type": "Name",
                    "value": "Jane"
                },
                {
                    "trait_type": "Species",
                    "value": "Doge"
                },
                {
                    "trait_type": "Rarity",
                    "value": "Legendary"
                },
                {
                    "trait_type": "Race",
                    "value": "Northern"
                },
                {
                    "trait_type": "Outline",
                    "value": "None"
                },
                {
                    "trait_type": "Head",
                    "value": "Gold Helmet"
                },
                {
                    "trait_type": "Face",
                    "value": "Beard"
                },
                {
                    "trait_type": "Mouth",
                    "value": "None"
                },
                {
                    "trait_type": "Ear",
                    "value": "None"
                },
                {
                    "trait_type": "Boots",
                    "value": "Iceskating Boots"
                },
                {
                    "trait_type": "Top",
                    "value": "None"
                },
                {
                    "trait_type": "Pants",
                    "value": "None"
                },
                {
                    "trait_type": "Tail",
                    "value": "Fire Tail"
                },
                {
                    "trait_type": "Necklace",
                    "value": "None"
                }
            ],
            "description": "Jane (#2353) is a unique, adorable, and algorithmically generated doge with Proof of Ownership on the Solana Blockchain.",
            "external_url": "",
            "image": "https://www.arweave.net/wY60DNoCoNzFQXYTVnDCH8I9axZY1dbHnyJW1FMRAEE?ext=png",
            "name": "Jane",
            "properties": {
                "category": "image",
                "files": [
                    {
                        "type": "image/png",
                        "uri": "REDACTED"
                    }
                ]
            },
            "seller_fee_basis_points": 500,
            "symbol": ""
        },
        "token_metadata": {
            "account": "REDACTED",
            "lamports": 1461600,
            "metadata": {
                "data": {
                    "creators": [
                        {
                            "address": "REDACTED",
                            "share": 0,
                            "verified": 1
                        },
                        {
                            "address": "REDACTED",
                            "share": 100,
                            "verified": 0
                        }
                    ],
                    "name": "Jane",
                    "sellerFeeBasisPoints": 500,
                    "symbol": "",
                    "uri": "REDACTED"
                },
                "isMutable": 1,
                "key": 4,
                "mint": "REDACTED",
                "primarySaleHappened": 1,
                "type": "metaplex",
                "updateAuthority": "REDACTED"
            },
            "ownerProgram": "REDACTED",
            "rentEpoch": 233,
            "tokenInfo": {
                "decimals": 0,
                "name": "Jane",
                "supply": "1",
                "symbol": "",
                "tokenAuthority": "REDACTED",
                "type": "nft"
            },
            "type": "token_account"
        }
    }
    
    

    Note; We shall note that the shape of "arweave_metadata" will vary depending on how the nft was defined.

    Designed with ❤️ by Sieve Labs

    ```

    Project details


    Download files

    Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

    Source Distribution

    solana_nfts-0.0.5.tar.gz (4.4 kB view details)

    Uploaded Source

    Built Distribution

    solana_nfts-0.0.5-py3-none-any.whl (4.8 kB view details)

    Uploaded Python 3

    File details

    Details for the file solana_nfts-0.0.5.tar.gz.

    File metadata

    • Download URL: solana_nfts-0.0.5.tar.gz
    • Upload date:
    • Size: 4.4 kB
    • Tags: Source
    • Uploaded using Trusted Publishing? No
    • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

    File hashes

    Hashes for solana_nfts-0.0.5.tar.gz
    Algorithm Hash digest
    SHA256 0626384986d4bdbb0a91293c223b5140c184fe070e21b7d7bb000bdb04d6243c
    MD5 c121f867d64e34e608701dcf7f1041e9
    BLAKE2b-256 70b5aca2fb31dcbb6a04b3e65d7ac939e9e5c482afc39c4beb1a8da1a5c3788b

    See more details on using hashes here.

    File details

    Details for the file solana_nfts-0.0.5-py3-none-any.whl.

    File metadata

    • Download URL: solana_nfts-0.0.5-py3-none-any.whl
    • Upload date:
    • Size: 4.8 kB
    • Tags: Python 3
    • Uploaded using Trusted Publishing? No
    • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

    File hashes

    Hashes for solana_nfts-0.0.5-py3-none-any.whl
    Algorithm Hash digest
    SHA256 0e6040de23f1bb58153a231f696536f524d1b430429cca94dc752bc42027d8db
    MD5 b5a0e85ffc0e7e9aa27c24b83e0e1cdf
    BLAKE2b-256 ccbccb1301b69056c3c8669dda764cf2b4df219118434fde8e85587342cd1f08

    See more details on using hashes here.

    Supported by

    AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page