0.1.1 • Published 9 months ago

@ample-launchpad/client v0.1.1

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
9 months ago

Ample Launchpad | Client Package

Main component for direct manipulation of a launchpad deployment.

Quickstart

This guide assumes you have already deployed a server and the NEAR contracts

Install dependencies

npm install @ample-launchpad/core @ample-launchpad/client

Setup

import { setupLaunchpad } from '@ample-launchpad/client'
// from @near-wallet-selector
import { setupWalletSelector } from "@near-wallet-selector/core";
import { setupMyNearWallet } from "@near-wallet-selector/my-near-wallet";


const init = async () => {
    // get near-wallet-selector Wallet instance
    const selector = await setupWalletSelector({
        network: "testnet",
        modules: [setupMyNearWallet()],
    });
    if(!selector.isSignedIn()) throw new Error('User must be signed in in order to setup the launchpad')
    const wallet = await selector.wallet();

    // get the actual launchpad instance
    const launchpad = await setupLaunchpad({
        network: 'testnet',
        wallet,
        serverUrl: process.env.SERVER_URL,
        treasuryAddress: process.env.TREASURY_ADDRESS,
        seriesAddress: process.env.SERIES_ADDRESS
    })
}

Usage

const res = await launchpad.createContent(/* body */)
const content = await launchpad.getContent(/* contentId */) 
const contents = await launchpad.getContents() 

// royalties
const royalties = await launchpad.contracts.treasury.calculateRoyalties(/* contentId */)
await launchpad.contracts.treasury.claimRoyalties(/* contentId */)

// nfts 
const serieDetails = await launchpad.contracts.series.getSeriesDetails(/* serieId */)
const ownedNftSeries = await launchpad.contracts.series.nftSeriesForOwner()
await launchpad.contracts.series.mint(/* serieId */)
0.1.0

9 months ago

0.1.1

9 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago