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

block-commerce-contract

v1.1.2

Published

<div id="top"></div> </br> <div align="center"> <img src="https://i.ibb.co/xHDbBM5/Block-Commerce-Logo-Rendered.png" alt="BlockCommerce Logo_Rendered" width="100" height = "100"> <h3>BlockCommerce</h3> <p>A good tool for setting up Ethereum-base

Downloads

5

Readme

About The Project

Provide you with a package secured by Blockchain and Smart Contract to build, manage and revise all aspects between bulding and developing software for Ethereum-based marketplace projects.

Built with

Setting Up

This section is all about relevant softwares, extensions and how to install this package.

Prerequisites

For using BlockCommerce, you need first to have metamask available in your browser.

  • Download metamask here (Choose the firefox to download it to your browser).
  • See how to use metamask here.

Installation

Use the package manager npm to install.

  • npm
  npm install npm@latest -g
  • block-commerce-contract
  npm install block-commerce-contract

Features

Below are what BlockCommerce will provide for you:

  • Contract: A smart library contract consists of a contract that creates, stores the NFT and a contract that serves its role as a marketplace for selling and exchanging NFTs. These contracts can be reused, secured and stored on blockchain, and are written by Solidity. Besides, all the functions are authorized according to the account's role.
  • Upgradable contract: A set of contract and tool is used for creating and managing contracts, it allows for the separation of upgradeable contracts on Ethereum.
  • Lazy minting: Advanced feature, this helps the seller not to pay any fee from the time a product is created to the time it is sold. The fee in the end will be paid by the end user.
  • Authorization: Advanced feature, this helps both the seller and buyer can controll the contract by themselves and execute it as they wished, instead of the inherent automatic execution of the contract.

Example

These are some code snippets to help you have a better understand what block-commerce-contract can do.

  • Generate a NFT with the recipient's address _to be obtained from the _hash of the artwork
createNewNFT(_to, string _hash)
  • Reset the owner rights for a _to address with the _tokenId token you want to transfer, this function is only called by the owner of _tokenId.
setOwnerToTokenId(_to, _tokenId)
  • Create a new product for selling with with hashed information (_hashInfo), hashed image (_hashImg), and the desired price (_price) for this product
createNewProduct(_hashInfo, _hashImg,  _price)
  • Buy the product with ETH cryptocurrency
buyWithETH(_tokenId)
  • Buy the product with dollar currency
buyWithCurrency(_tokenId, transactionId)
  • Create an offer for a product has id (_tokenId), with quantity of _amount, token ERC20 (_token20) as you wish, and the desired price (_price) for this product
offer(_tokenId, _amount, _token20, _timeout)
  • Approve an offer
approveOffer(_tokenId, _index)
  • Transfer owner after the offer was approved
Transfer(_tokenId, _oldOwner, _newOwner)

Usage

For better understanding on how to use block-commerce-contract for an Ethereum-based marketplace web application, you can go to this website. Some functions are currently availble:

  • Create a new product.
  • Create an offer.
  • Approve an offer.
  • Buy a product with ETH or other currency (currently Dollar).

Creators

We wish to give a big thanks to our contributors for building this project together and bringing it to life.

License

Distributed under MIT license. See LICENSE.md for more infomation.