Get Active Listings of a Wallet
Get all active listings of a wallet on Tensor marketplace using GraphQL
Tensor Cross Program Query
import { gql, GraphQLClient } from "graphql-request";
const endpoint = 'https://programs.shyft.to/v0/graphql/?api_key=YOUR-KEY';
const graphQLClient = new GraphQLClient(endpoint, {
method: `POST`,
jsonSerializer: {
parse: JSON.parse,
stringify: JSON.stringify,
},
});
async function getAllListingsOnTensor(walletAddr:string) {
//you can select the fields as per your requirement
const query = gql`
query MyQuery {
TENSOR_CNFT_listState(
where: {owner: {_eq: ${JSON.stringify(walletAddr)}}}
) {
_lamports
amount
assetId
currency
expiry
makerBroker
owner
privateTaker
rentPayer
version
}
Tensor_SingleListing(
where: {owner: {_eq: ${JSON.stringify(walletAddr)}}}
) {
bump
lamports
nftMint
owner
price
}
}
`;
const response = await graphQLClient.request(query);
console.dir(response,{depth: null});
}
//replace with the wallet address you want to query
getAllListingsOnTensor('5GAPWPNhsQWZ9V61cdSUY4Dy4qm1shN2tddB1gibz5zM')
Active Listings for Tensor Swap (normal NFTs)
Active Listings for Tensor cNFT
Last updated