npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nft-gallery-sdk-api

v1.0.3

Published

We have created SDK function getContractLogs and the API function printMetaMaskBalance, and then wrapped them into an npm package "nft-gallery-sdk-api".

Downloads

6

Readme

A Simple Example of SDK and API for web3. Perspectives

We have created SDK function getContractLogs and the API function printMetaMaskBalance, and then wrapped them into an npm package "nft-gallery-sdk-api".


Of course, there are similar functions in other libraries, for example, in the well-known web3,
but in our case we have created a lightweight and very simple SDK with functions that are necessary for training and creating the simplest DApp applications.

At the same time, it is planned to further expand the library and update the published npm package.
These extensions will include functions for tracking trends in NFT collections by subject
based on classification and clustering algorithms, as well as algorithms for decision support and generating recommendations for managing
your NFT collections and so-called utilitarian business NFT applications.

Note the prospects and plans of the team:

  1. The team plans to formalize these ideas in the form of an explanatory note of a research project for participation in a funded competition,
    followed by the design of the results of scientific and (or) scientific and technical activities (in Russian РННТД)
    as "A framework for creating and maintaining DApp business applications based on utilitarian NFT and data mining algorithms."

As a result, the prospects of commercialization of the described provisions will be considered.

  1. The topic has been formulated, the tasks have been concretized and some groundwork has been obtained for a PhD thesis
    (the team invites those who wish to enter the PhD doctoral program this year for the educational program 8D06306 - Information Security Systems).

  2. The results, taking into account the planned expansion of the developed SDK and API example,
    will be designed and published in one of the scientific and technical journals.


Here is how you can use the npm-package from the web3 application.

To use the npm package in a web3 application, you can follow these steps:

In your web3 application directory, install the npm package as a dependency:

npm install nft-gallery-sdk-api

Import the SDK and API modules from the npm package in your app.js file:

const { sdk, api } = require('wrapped in an npm package');

Use the imported SDK and API functions in your web3 application as needed. Here's an example of how you can use the SDK function getContractLogs and the API function printMetaMaskBalance:
sdk.getContractLogs('YourContractAddress', NFTCreate1ABI)
  .then(logs => {
    console.log('Contract Logs:', logs);
    // Process the logs or update your application UI with the retrieved data
  })
  .catch(error => {
    console.error('Error:', error);
    // Handle the error appropriately
  });

api.printMetaMaskBalance()
  .then(balance => {
    console.log('MetaMask balance:', balance);
    // Display the MetaMask balance in your application UI or perform any other action
  })
  .catch(error => {
    console.error('Error:', error);
    // Handle the error appropriately
  });

Make sure to replace NFTCreate1ABI with the actual ABI. Note, that I did and tested all this for my NFTCreate1.sol contract.

Include the app.js file in your index.html file by adding the following line before the closing </body> tag:

<script src="app.js"></script>

Start your web3 application and test the functionality.

By using the npm package in your web3 application, you can leverage the SDK and API functions provided by the package for interacting with your contract (in my case it was the NFTCreate1.sol) and performing other actions.