Socket
Socket
Sign inDemoInstall

@ainft-team/ainft-js

Package Overview
Dependencies
196
Maintainers
6
Versions
82
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @ainft-team/ainft-js

[![Docs](https://img.shields.io/badge/Docs-blue)](https://ainft-team.github.io/ainft-js/) [![Tutorial](https://img.shields.io/badge/Tutorial-gre)](https://docs.ainetwork.ai/ainfts/developer-reference/ainft-tutorial) [![GitHub](https://img.shields.io/githu


Version published
Weekly downloads
257
increased by62.66%
Maintainers
6
Install size
164 MB
Created
Weekly downloads
 

Readme

Source

ainft-js

Docs Tutorial GitHub Npm

The ainft-js is typescript SDK to interact with AIN blockchain and create and manage AINFT.

AINFT Factory

The AINFT Factory is a component consisting of AINFT Factory server and ainft-js. AINFT Factory supports the following two features:

  • AINFT: Supports creating and managing AINFT, the NFT of the Ain blockchain.
  • Tokenomics: Supports functions for activating tokenomics in NFT communities.

You can see reference about AINFT Factory: https://docs.ainetwork.ai/ainfts/ainft.

Getting start

npm install @ainft-team/ainft-js

After installing the app, you can then import and use the SDK

const AinftJs = require('@ainft-team/ainft-js').default;

// Enter the private key for the account you want to use to create and manage AINFT.
// If you don't have an account, you can create it through ain wallet,
// or you can leverage tools/create_account.js.
const ainftJs = new AinftJs(<YOUR_PRIVATE_KEY>);

If you want to connect to the testnet of the Ain blockchain, you can set the Ain blockchain endpoint.

const config = {
  ainftServerEndpoint: 'https://ainft-api-dev.ainetwork.ai',
  ainBlockchainEndpoint: 'https://testnet-api.ainetwork.ai'
}
const ainftJs = new AinftJs(<YOUR_PRIVATE_KEY>, config);

Features

AINFT

You can create AINFT object and mint AINFT though AINFT object. Below modules support it.

  • nft: Creates AINFT object and Searches AINFTs and AINFT objects.
  • ainft721Object: It is AINFT object class. Mints AINFTs and Transfers it to other accounts.
  • ainftToken: It is AINFT class. Updates metadata.

You can learn how to make AINFT in tutorials.

Tokenomics

Features for activating tokenomics in NFT communities.

  • credit: Create and manage community-specific credits.
  • event: Create and manage events where user can take action and receive rewards. This is a function for credit mining.
  • store: You can create items, register them in the store, and sell them. This is a function for consuming credit.

NFT API

Introducing the main API functions that can be used in the nft module.

  • create(name, symbol): Creates AINFT object.
  • register(ainftObjectId): Register AINFT object created to AINFT Factory server.
  • get(ainftObjectId): Gets AINFT object instance by id.
  • getAinftsByAinftObject(ainftObjectId, limit, cursor): Gets information of AINFTs by AINFT object.
  • getAinftsByAccount(address, limit, cursor): Gets information of AINFTs by user address.
  • searchAinftObjects(searchParams): Search for AINFT object. You can use ainft object id, name, symbol for searching.
  • searchAinfts(searchParams): Search for AINFT. You can use ainft object id, name, symbol, token id, user address for searching.

AINFT721 Object API

Introducing the main API functions that can be used in the ainftObject module.

  • getToken(tokenId): Gets AINFT that was minted by AINFT object.
  • transfer(from, to, tokenId): Transfers AINFT to other account.
  • mint(to, tokenId): Mints AINFT.

AINFT Token API

Introducing the main API functions that can be used in the ainftToken module.

  • setMetadata(metadata): Sets metadata of AINFT.

AINFT tutorial

You can view the tutorial document at the following link. and You can also look at scripts created for tutorials in the tutorial directory.

Tutorial scripts

API Documentation

API documentation is available at https://ainft-team.github.io/ainft-js.

License

MIT License

Keywords

FAQs

Last updated on 20 Mar 2024

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc