NFT Checkout Quickstart

πŸ‘

Try it Out!

Check out our demo to explore our Halliday Direct NFT Checkout service.

Halliday's SDK offers support for a Direct NFT Checkout customized towards your app. Our goal is to minimize the hassle for your users and developers with just a few lines of code. Integration with our Direct NFT Checkout is as simple as displaying a price and button.

First, install halliday-sdk:

npm install halliday-sdk

or

yarn add halliday-sdk

The following code example shows how to use Halliday's SDK to enable Direct NFT Checkout for your users.

import { HallidayCheckout, BlockchainType } from "halliday-sdk";

// Initialize the Halliday client.
const hallidayClient = new HallidayCheckout({
  hallidayPublicApiKey: "HALLIDAY_PUBLIC_API_KEY",
  blockchainType: BlockchainType.DFK
});

// Get a price breakdown from Halliday to display next to an NFT.
// This method will throw if the NFT is outside of the vali price 
// range or is not actually for sale.
const priceBreakdown = await hallidayClient.getPriceBreakdown({
  collectionId: "collectionId",
  tokenId: "tokenId",
});

// Call our SDK to process your customer's payment details.
// Customize the button to match your game's aesthetic.
<Button
  onClick={() => {
    hallidayClient.openCheckoutWindow({
      collectionId: "collectionId",
      tokenId: "tokenId",
      destinationAddress: "destinationAddress",
      assetImage: "optionalAssetImage",
      assetUrl: "optionalAssetUrl",
      assetName: "optionalAssetName",
      assetDescription: "optionalAssetDescription",
    });
  }}
>
  Checkout with Halliday
</Button>

Once the button is clicked, a pop-up window will prompt the user for their payment details. The NFT will be transferred to their Halliday Smart Account wallet; if the user does not have one, a new Halliday Smart Account wallet will be automatically created for them.

πŸ“˜

Please reach out to a Halliday representative here if you are interested in integrating Direct NFT Checkout to your app or marketplace.