Sui NFT Trading SDK
The Sui NFT Trading SDK is a Typescript library which enables the ability to execute Sui NFT trading transactions across any marketplace with just a few lines of code. Embed buying, selling, bidding, and transfering functionality into your app with simple Typescript code.
Building the correct payloads in Sui can be complex, such as needing more than a dozen of transactions in a specific order just to buy a NFT. Instead of trying to figure out how to build the transaction data yourself and add custom handlers for every marketplace and collection type, just import the Sui NFT Trading SDK and call the methods you need.
Note: In order to use the Sui NFT Trading SDK, you need to pass in data from the GraphQL NFT Data API. For example to buy a listing, you just need to pass in the listing ID from a NFT Data API listings
record.
Getting Started
Get API Key
Install the SDK
npm i @tradeport/sui-trading-sdk
Initialize the SDK Client
You need to pass in your API Key and API User to create an instance of the suiTradingClient. The SDK uses these headers to fetch necessary data internally from our NFT Data API in order to create the correct payload for the transaction.
import { suiTradingClient } from "@tradeport/sui-trading-sdk"
const suiTradingClient = new suiTradingClient({
apiKey: YOUR_API_KEY,
apiUser: YOUR_API_USER
})