Tradeport API: GraphQL queries and Sui SDK integration
TradePort provides a GraphQL NFT Data API for reading Sui NFT and collection records. Its NFT Trading SDK uses API records to build transactions for buying, listing and other supported operations. The application passes the returned transaction to a wallet for signing and submission.
- Documented developer network
- Sui for both the NFT Data API and NFT Trading SDK.
- SDK package
-
@tradeport/sui-trading-sdk, a TypeScript library. - SDK credentials
-
An API key and API User, supplied as
apiKeyandapiUsertoSuiTradingClient.
Query records with the right identifiers
Send this query and its variables in an HTTP POST request body, with x-api-key and x-api-user headers for authentication. The API separates an NFT from its sale listings. A lookup for one Sui NFT can filter
nfts
by
collection_id
and
token_id
, using a collection UUID and a token ID string. The nested
listings
relation supplies sale records for that item.
query fetchNftListings($collectionId: uuid!, $tokenId: String!) {
sui {
nfts(
where: {
collection_id: { _eq: $collectionId }
token_id: { _eq: $tokenId }
}
) {
name
token_id
listings(
where: { listed: { _eq: true } }
order_by: { price: asc }
) {
id
listed
price
market_name
seller
block_time
}
}
}
}
The
listed: true
filter restricts the nested listings to active sale records. Ascending
price
order puts the lowest returned asking price first. An NFT record can exist without an active listing, so item visibility alone does not establish an offer to buy.
buyListings
takes the
id
values of listing records.
listNfts
and
transferNfts
instead use NFT record UUIDs. A display name or NFT
token_id
cannot substitute for the listing UUID a purchase method requires.
Collection analytics, ownership and event history
Collection lookups can match
slug
or
semantic_slug
through an
_or
filter. The documented
slug
derives from the collection contract ID;
semantic_slug
is a readable alternative present for some collections. The response can supply the collection
id
used in NFT queries and by
placeCollectionBid
.
Collection statistics distinguish totals from daily activity through fields such as
total_sales
and
day_sales
. Floor-history queries take a
period
and return
time
,
value
and
usd_value
. Trending queries have their own
period
and
trending_by
parameters, with current and previous trade counts and volumes. Keep the requested period with the metric an application displays.
NFT information includes media and properties alongside
owner
,
staked
and
staked_owner
. It also exposes
burned
and
chain_state
. These fields support portfolios and views of an item’s state beyond the sale listings needed for trading.
The NFT transaction-history query filters
actions
by collection ID, token ID and action type. It orders by
block_time
, then
tx_index
, both descending, and uses
offset
and
limit
for pagination. Returned fields include
tx_id
,
type
,
sender
,
receiver
and
market_name
. The transaction identifier lets an application associate an indexed event with a submitted transaction.
Connect GraphQL results to wallet execution
The SDK uses its configured credentials to fetch additional NFT Data API information internally when constructing transactions. For a purchase,
buyListings
accepts an array of listing UUIDs and
walletAddress
, the signer’s Sui wallet address. Buying one listing and sweeping several listings use this same method.
| Stage | Required data or result | Signing and execution state |
|---|---|---|
| Configure the SDK client |
Initialize
SuiTradingClient
with
apiKey
and
apiUser
.
|
API credentials configure data access; wallet signing remains separate. |
| Read the target records | Query Sui data and select the listing UUIDs the purchase will use. | Reading sale records does not execute a purchase. |
| Build the transaction |
Pass
listingIds
and the signer’s
walletAddress
to
buyListings
.
|
The SDK returns a Sui transaction for wallet signing. |
| Sign and submit | Pass the returned transaction to the application’s wallet signing and execution method. | Submission and successful execution are distinct states. |
| Reconcile the outcome |
Inspect the execution result and associate indexed activity with its
tx_id
.
|
A prepared transaction or signature alone does not establish a completed purchase. |
Other method inputs and conditions
unlistListings
targets listing UUIDs, while
claimNfts
requires UUIDs from NFT records with
nft.claimable === true
. Ownership alone does not satisfy that claim condition.
Bidding also depends on the collection standard. Shared bid pools work with non-Origin Byte kiosk collections. Collections using the deprecated Origin Byte standard fall back to legacy bidding even when a
multiBidId
is supplied, with funds locked separately for each bid.