1.0.3 • Published 2 months ago

evelonsdk v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
2 months ago

Warning Version 1.0.0 is under active development.

NPM Package Docs

A SDK for getting and updating the NFTs created at Evelon.

  • Get all the NFTs that you created at Evelon.
  • Modify any part of the NFTs like name, image, description etc.

Overview

Installation

npm

$ npm install evelonsdk

yarn

$ yarn add evelonsdk

Usage

Once installed, you can use SDK by importing it:

CommonJS / NodeJs Module

const { EvelonSDK } = require("evelonSDK");

ECMAScript 6 Module

import EvelonSDK from "evelonSDK";

Once you imported the SDK you need to create an object for the SDK.

const config = {
    apiKey: "test_ev_cd153f49193e693ec0434dcb52a9c5a1560d7e13",
    chainId: 1284,
  };

const sdk = new EvelonSDK(config);

After that you can use the object according to your usses. To get all the NFTs:

const data = await sdk.getAllNFTs(
    "0x02F4Db4adeA0E1E84e3Ff4901c4Af3DB4Cca2f80" // Enter your address here.
  );

Output:

[
  {
    allNFTs: [
        {
        tokenId: 0n, // TokenId
        name: 'Luffy #1', // Name of NFT
        description: 'A Pirate', // Description
        image: 'https://evelon.s3.eu-central-1.amazonaws.com/22', // URL of image
        attributes: [ [Object] ] // Array of objects for the attributes
      },
      {
        tokenId: 1n, // tokenId
        name: 'Luffy #2', // Name of NFT
        description: 'A Pirate', // Description
        image: 'https://evelon.s3.eu-central-1.amazonaws.com/23', // URL of image
        attributes: [ [Object], [Object], [Object], [Object], [Object] ] // Array of objects for the attributes
      }
    ],
    contractAddress: '0x52C28a6138bA4AFA744d301f4d7a15F1284c9468',
    contractName: 'EvelonBetaCollection'
  },
  {
    ...
  },
]

To update the metadata of NFTs:

const data =  await sdk.modifyNFT({
    tokenId: 0, // require
    contractAddress: 0x52C28a6138bA4AFA744d301f4d7a15F1284c9468 // require
    name: Luffy #3, // Optional
    description: "Future pirate King" // Optional
    image: "Image URL or the path of image"  // Optional
    attributes: [{  // Optional
      trait_type1: "Power",
      value: 7000
    }],
  });

This will update the NFT's metadata according to data inserted. You can update the specific part of metadata, for example if you just want to update the name and description of the NFT you need to fill only those value:

const data =  await sdk.modifyNFT({
    tokenId: 0, // require
    name: Luffy #3,
    description: "Future pirate King"
  });
1.0.2

2 months ago

1.0.1

2 months ago

1.0.0

2 months ago

1.0.3

2 months ago

0.1.5

10 months ago

0.1.4

10 months ago

0.1.3

10 months ago

0.1.2

10 months ago

0.1.1

10 months ago

0.1.0

10 months ago