0.2.0 • Published 2 years ago

nft-parser v0.2.0

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

XP Network NFT-Parser

Work In Progress / Alpha Stage Library

To parse NFTs metadata, follow the steps below:

Make sure nodejs is installed on your machine.

1. Install the libraries required for the project:

yarn add nft-parser

OR

npm i --save nft-parser

To import the latest version of nft-parser library:

yarn add "git+https://github.com/xp-network/nft-parser#bleeding-edge"

2. Import the dependencies

import { nftGeneralParser } from "nft-parser/dist/src/index";

3. Get parsed nft object with metadata

3.1 Example of getting parsed nft object with metadata for nft received from xp.network nft-indexer

NFT

{
    "uri": "https://nft.xp.network/w/30536082382037290147901655651",
    "native": {
        "chainId": "12",
        "tokenId": "30536082382037290147901655651",
        "owner": "0xb6C8748115d23Eb1c6d59Cb83eAe051b56ef75c7",
        "contract": "0x0D41c70E20587c2ec1cea9c4A3d394eC63C4bfbe",
        "symbol": "RMBB",
        "name": "Rocket Monsters Bear Battalion",
        "uri": "https://nft.xp.network/w/30536082382037290147901655651",
        "contractType": "ERC721"
    },
    "collectionIdent": "0x0D41c70E20587c2ec1cea9c4A3d394eC63C4bfbe"
}

Address - wallet address your dApp connected to

const parsedObject = await nftGeneralParser(NFT, Address);

Returned parsed object

interface NFT {
    chainId: string;
    tokenId: string;
    owner: string;
    uri: string;
    contract: string;
    collectionIdent: string;
    native: any;
    metaData: {
        whitelisted: boolean;
        image: string;
        imageFormat: string;
        animation_url?: string;
        animation_url_format?: string;
        name?: string;
        symbol?: string;
        attributes?: any;
        description?: string;
        contractType?: string;
    };
}
0.2.0

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.4

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago