JSPM

kyzr-marketplace-sdk

0.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q10169F
  • License AGPL-3.0-only

Kyzr Marketplace Standard Actions for the Metaplex Auction House program

Package Exports

  • kyzr-marketplace-sdk
  • kyzr-marketplace-sdk/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (kyzr-marketplace-sdk) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Holaplex Marketplace Standard JS SDK

Submit actions to the Metaplex Auction House program that adhere to the Holaplex Marketplace Standard. Its recommend to leverage the sdk with typescript to get access to the package type definitions and code completion.

Setup

Install the package from npm using your favorite package manager.

npm install -S @holaplex/marketplace-js-sdk
yarn add @holaplex/marketplace-js-sdk

Usage

Examples of using the sdk from different javascript based development environments.

React

import { initMarketplaceSDK, AuctionHouse, Nft } from '@holaplex/marketplace-js-sdk'
import { useConnection, useWallet } from '@solana/wallet-adapter-react'

interface PageProps {
  auctionHouse: AuctionHouse
  nft: Nft
}

const Page = ({ auctionHouse, nft }: PageProps) => {
  const wallet = useWallet()
  const connection = useConnection()

  const sdk = useMemo(() => initMarketplaceSDK(connection, wallet), [connection, wallet])

  const onListNft = ({ amount }: <{ amount: number }>) => {
    await sdk.transaction().add(sdk.listings(auctionHouse).post({ amount, nft })).send()
  }

  const onMakeOffer = ({ amount }: <{ amount: number }>) => {
    await sdk.transaction().add(sdk.offers(auctionHouse).make({ amount, nft })).send()
  }

  return (
    ...
  )
}

Deploy

yarn build

Publish

npm publish

Contribute

As with all Holaplex repositories contributions are welcome. Please fork and publish a pull request with any fixes or enhancements.