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

pandora-express

v1.1.3

Published

Express Protocol SDK is used to build applications for minting, trading, auctioning NFTs on multiple blockchains.

Downloads

18

Readme

Express-Protocol-SDK

Express Protocol SDK is used to build applications for minting, trading, auctioning NFTs on multiple blockchains.

Currently, the following blockchains are supported:

Mainnet :-

  • Binance Smart Chain
  • Polygon Matic

Testnets :-

  • Rinkeby Testnet
  • Ropsten Testnet
  • BSC Testnet
  • Polygon Testnet

Installation

npm install pandora-express

Development

For running the SDK code in a local environment -

→Clone the repository.

→Install the dependencies.

npm install

→Install parcel-bundler globally(if not already installed).

npm install -g parcel-bundler

→To initiate a sample application, run

parcel erc721/example/index.html

Structure

The erc721 and erc1155 directory follows a similar directory structure for two different token standards ERC721 and ERC1155 respectively. Inside both the directories -

-> The abi directory contains the abi of the smart contracts through which the Tokens are issued and traded within a blockchain network.

  • pndc.js contains the abi of PNDC_ERC721 contract through which NFTs can be minted singly or in batch.
  • tokenfactory.js contains the abi of TokenFactory contract through which NFTs can be put on direct sale, auction sale and can be bought, bid as well.
  • tokenerc721.js contains the abi of TokenERC721 contract through which collections can be created.
  • Similarly, pndc1155.js, tokenfactory1155.js and tokenerc1155.js inside erc1155/abi contains the abis for the ERC1155 token standard.

-> The example directory contains code for a basic application that uses all the functionality of Protocol SDK.

-> The src directory contains the main source code of the SDK.

  • src/nft/mint.js contains code for minting NFTs.
  • src/order/sell.js contains code for putting NFTs on direct sale, auction sale, and for canceling the sale.
  • src/order/buy.js contains code for buying NFTs on direct sale.
  • src/order/Bid.js contains code for bidding on NFTs, accepting bids, and withdrawing bids.
  • src/collection/collection.js contains code for creating collections and minting, trading, auctioning NFTs inside the collection.
  • src/common/utils.js contains utility functions and variables that are used by other functions.

index.js contains the code for the initialization of the SDK

Usage

Import createPandoraExpressSDK function from pandora-express and initialize SDK.

import {createPandoraExpressSDK} from "pandora-express";
const ExpressSDK = createPandoraExpressSDK();

Mint: NFTs can be mint using the mint function.

ExpressSDK.erc721.nft.mint(web3, chainId, minterAddress, tokenURI, royalties);

Sell: NFTs can be put on sale using the sellNFT function.

ExpressSDK.erc721.order.sellNFT(
  web3,
  chainId,
  tokenId,
  tokenPrice,
  ownerAddress
);

Buy: NFTs can be bought using the buyNFT function.

ExpressSDK.erc721.order.buyNFT(web3, chainId, saleId, buyerAddress, price);

Cancel Sale: NFTs on sale can be removed from sale using the cancelSale function.

ExpressSDK.erc721.order.cancelSale(web3, chainId, sellerAddress, saleId);

Auction: NFTs can be put on auction sale using sellNFTByBid function.

ExpressSDK.erc721.order.sellNFTByBid(
  web3,
  chainId,
  tokenId,
  initialPrice,
  ownerAddress,
  auctionTime
);

Bid: NFTs on auction sale can be bid using bid function.

ExpressSDK.erc721.order.bid(web3, chainId, saleId, buyerAddress, bidPrice);

Bid Execution: Bids on NFTs can be executed using acceptBid function.

ExpressSDK.erc721.order.acceptBid(web3, chainId, saleId, bidId, sellerAddress);

Bid Withdraw: Other bids except executed bid can be withdrawn using withdrawBid function.

ExpressSDK.erc721.order.withdrawBid(web3, chainId, saleId, bidId, buyerAddress);

TokenURI: Fetch token URI of the NFT using fetchTokenURI function.

ExpressSDK.erc721.nft.fetchTokenURI(
  web3,
  chainId,
  tokenId,
);

Collection Functions.

Collection: New collection can be deployed using createCollection function.

ExpressSDK.erc721.collection.createCollection(
  web3,
  chainId,
  ownerAddress,
  collectionName,
  collectionSymbol,
  collectionDescription,
  collectionRoyalties
);

Mint in Collection: NFTs can be minted inside collection using mint function.

ExpressSDK.erc721.collection.mint(
  web3,
  collectionAddress,
  tokenURI,
  minterAddress,
  royalties
);

Sell in Collection: NFTs can be put on direct sale inside collection using sellNFT function.

ExpressSDK.erc721.collection.sellNFT(
  web3,
  chainId,
  sellCollectionAddress,
  sellTokenId,
  sellPrice,
  ownerAddress
);

Buy in Collection: NFTs on sale can be bought in a collection using buyNFT function.

ExpressSDK.erc721.collection.buyNFT(
  web3,
  chainId,
  buyTokenId,
  buyerAddress,
  buyPrice
);

Auction in Collection : NFTs can be put on auction sale in a collection using sellNFTByBid function.

ExpressSDK.erc721.collection.sellNFTByBid(
  web3,
  chainId,
  sellByBidCollectionAddress,
  sellByBidTokenId,
  sellByBidPrice,
  ownerAddress,
  sellByBidTime
);

Bid Collection NFTs: NFTs on auction sale can be bid by other users in a collection using bid function.

ExpressSDK.erc721.collection.bid(
  web3,
  chainId,
  bidCollectionSaleId,
  bidderAddress,
  bidCollectionPrice
);

Bid Execution on Collection NFTs: Bids on NFTs can be executed in a collection using acceptBid function.

ExpressSDK.erc721.collection.acceptBid(
  web3,
  chainId,
  acceptBidSaleId,
  acceptBidId,
  sellerAddress
);

Bid Withdraw in Collection: Other bids except executed bid can be withdrawn in a collection using withdrawBid function.

ExpressSDK.erc721.collection.withdrawBid(
  web3,
  chainId,
  saleId,
  bidId,
  buyerAddress
);

Cancel Sale in Collection NFTs: NFTs on sale in a collection can be removed from sale using the cancelSale function.

ExpressSDK.erc721.collection.cancelSale(web3, chainId, sellerAddress, saleId);

Token URI of NFT in Collection: Fetch TokenURI of the NFT in a collection using fetchTokenURI function.

ExpressSDK.erc721.collection.fetchTokenURI(
  web3,
  collectionAddress
  tokenId
);

Pinata Upload Functions.

Upload NFTs to Pinata Cloud service :

ExpressSDK.pinata.upload(
  nftImage,
  nftDescription,
  pinataApiKey,
  pinataSecretApiKey
);

Upload JSON data to Pinata Cloud:

ExpressSDK.pinata.pinJSON(
  pinataAPIKeyJSON,
  pinataSecretApiKeyJSON,
  pinataJSONData
);