@decent.xyz/sdk
TypeScript icon, indicating that this package has built-in type declarations

0.3.9 • Public • Published

Welcome to the Decent SDK

Core Resources

Protocol Documentation: includes module descriptions, available functions for each contract, and protocol deployment addresses.

Protocol Repository: you can find community discussions about new PR's and issues in the Discussions panel of this repository.

SDK Repository

Starter Repo: the fastest way to publish your first application using Decent is to fork this repository (NextJS, Tailwind, RainbowKit, DecentSDK).

Getting Started

npm i @decent.xyz/sdk

Example deployment of Decent's 721A contract
import { DecentSDK, edition, ipfs } from '@decent.xyz/sdk';
// wagmi is a core dependency to deploy contracts; DecentSDK get functions can be used without
 import { useSigner, useNetwork } from 'wagmi';

// Define your metadata schema before deploying contract
  const deployFunction = async () => {
        const ipfsHash = await ipfs.createMetadata(metadata).then((res: any) => {
          return res
        });

        Decent's defaults to storing metadata on-chain on L2's and on IPFS for Ethereum mainnet
        let onChainMetadata = null;
        let offChainMetadata = '';

        if ( chain.id === 1 || chain.id == 5 ) {
          offChainMetadata = `${ipfsHash.url}?`;
        } else {
          onChainMetadata = {
            metadata: ipfsHash?.data?.metadata || "",
          }
        }

        const sdk = new DecentSDK(chain.id, signer);

        let nft;
        try {
          nft = await edition.deploy(
            sdk,
            collectionName,
            symbol,
            editionSize,
            tokenPrice,
            maxTokenPurchase,
            creatorRoyalty,
            offChainMetadata,
            onChainMetadata,
          );
        } 
      }

For the artists of every industry 🤝

Dependencies (0)

    Dev Dependencies (9)

    Package Sidebar

    Install

    npm i @decent.xyz/sdk

    Weekly Downloads

    139

    Version

    0.3.9

    License

    GNU GPL V3.0

    Unpacked Size

    1.9 MB

    Total Files

    69

    Last publish

    Collaborators

    • edricy
    • arshankhanifar
    • wkantaros
    • zev2axa
    • cdsiren
    • decentxyz