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

omnite-sdk

v0.1.2

Published

Omnite oNFT SDK

Downloads

96

Readme

Omnite SDK

API docs

API documentation is available under docs/index.html.

Examples

Initialize (required for package to work)

await config.initialize({
    supportedChains: [
        // supported chains for project
        ChainId.BSCT,
        ChainId.RINKEBY,
    ],
    moralisApiKey: '',
    pinataJWTToken: '',
    providerRpcUrls: {
        // taken from https://chainlist.org/, private RPC URLs can be used too
        [ChainId.BSCT]: 'https://data-seed-prebsc-1-s1.binance.org:8545/',
        [ChainId.RINKEBY]:
            'https://rinkeby.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161',
    },
});

Omnichain deployment

const collectionCreator = new CollectionCreator(
    chainId,
    wallet,
    DeployType.native,
    {
        collectionName: 'My omnichain collection',
        collectionTicker: 'MOC',
        userAddress: '0x21453911eb364c7DF9291d2f427fd04Fa7234667',
    },
    [BridgeBroker.LayerZero, BridgeBroker.Axelar], // which broker should be supported, could be Axelar and LayerZero
    BridgeBroker.LayerZero, // which broker should be used to deploy new collection
    [
        { amount: 10, chainId: '0x4' }, // deploy collection on Rinkeby with 10 available slots (1-10)
        { amount: 20, chainId: '0x61' }, // deploy collection on BSCT with 20 available slots (11-30)
    ]
);

collectionCreator.baseTokenUri =
    'ipfs://QmNNvuUaB5cd8mP7oMhcEeax1AMSHcWfp2GzY3YfoZJLD3/'; // base token uri, will be concatenated with token id if tokenURI is requested. Eg. ipfs://QmNNvuUaB5cd8mP7oMhcEeax1AMSHcWfp2GzY3YfoZJLD3/11 for tokenId 11

const result = await collectionCreator.deploy(); // regular ethers tx result
await result.wait(); // wait for the tx to be confirmed once

Crosschain minting

// signer is ethers.providers.JsonRpcProvider
const collection = new Collection(
    signer,
    '0x29d9b96fb1e6df756669ff694c87a14c70e5810d'
); // 0x29d9b96fb1e6df756669ff694c87a14c70e5810d is the collection address on the source chain

const result = await collection.mintOnTargetChain(
    '0x61', // mint on BSCT chain
    BridgeBroker.LayerZero, // which broker should be used for minting
    {
        tokenId: BigNumber.from(11), // token ID to be minted
    },
    'QmNNvuUaB5cd8mP7oMhcEeax1AMSHcWfp2GzY3YfoZJLD3' // tokenURI, used if no baseTokenUri is defined for collection
);