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

hardhat-phosphor

v1.0.1

Published

harhat plugin to deploy phosphor contracts easily

Downloads

9

Readme

Hardhat Phosphor

This Hardhat plugin enables developers to seamlessly connect Hardhat with the Phosphor platform, facilitating the deployment and management of NFT collections directly within your Hardhat workflow. Phosphor simplifies the lifecycle management of NFT drops, offering a robust API for creating collections, managing NFTs, distributing and listing assets, and handling royalties and payments without the direct handling of smart contracts.

Features

  • Custom Contract Deployment: Support for deploying custom contracts to Phosphor by incorporating ABI, bytecode, and constructor arguments into your Hardhat deployment scripts.
  • Streamlined Workflow: Enhance your NFT project's workflow by leveraging Phosphor's API capabilities directly within Hardhat.

Prerequisites

  • Node.js and npm installed.
  • An existing Hardhat project setup.

Installation

npm install --save-dev hardhat-phosphor

Configuration

Import the plugin like this in your hardhat.config file and add your phosphor endpoint as well as the phosphor api key like this inside the config. So that it those can be picked up by the plugin.

import  "hardhat-phosphor"

const  config:  HardhatUserConfig  = {
  phosphor: {
  	phosphorEndpoint:  {your-phosphor-endpoint},
  	phosphorApiKey:  {your-phosphor-api-key,
  },
}

Usage

You can integrate the plugin into your Hardhat deployment scripts. Instead of using hre.deploy(), you should use hre.phosphor.deploy() and provide the appropriate arguments. The arguments include abi and bytecode from the specified contract, which are then passed to the Phosphor API to create a collection. You can setup a webhook or checkout the phosphor dashboard to view the progress of the contract deployment

  

const  deploy:  DeployFunction  =  async  function (hre:  HardhatRuntimeEnvironment) {

    // You will get the phosphor api response here
    const  response  =  await  hre.phosphor.deploy("Ticket", {
        name:  "Ticket",
        description:  "A NFT deployed using phosphor",
        networkId:  5,
        
        // pass constructor arguments if any in order
        constructorArgs: ["ticket name", 10000, 1],

    });

    if (response.error) {
        console.error("Error deploying contract", response.error);
        return;

    }

    console.log("Your contract is being deployed. View the progress in the phosphor dashboard; CollectionId",
        response.id );

    // You can also check the deployment status with this. This will probably return status as "PENDING" now

    // alternatively you can a setup a webhook to get the status

    const  statusResponse  =  await  hre.phosphor.getDeploymentStatus(response.id);

        if (response.error) {
            console.error("Error deploying contract", response.error);
            return; 
        }

        console.log(`Deployment status: ${statusResponse.status} and tranasaction id id ${statusResponse.transaction_id}`);

};

export  default  deploy;

Learn More

To learn more about the Phosphor platform and its capabilities, visit Phosphor's official documentation.

Support

For issues, feature requests, or contributions, please open an issue on GitHub.