The SDK also provides some useful functions that you can use to implement search functionality and check if a token is owned by a given wallet address or not. Here is the complete list of the functions:
searchMarketplace
This function allows you to search for a token on the marketplace by providing a search query. Here is an example call of how you can search for a token on the marketplace:
import { Networks, searchMarketplace } from'@lyncworld/fuel-marketplace';constresponse=searchMarketplace(Networks.Testnet,'0x...'// contract address, token id, asset id, or seller address to search);
This function allows you to check if a token is owned by a given wallet address or not. Here is an example call of how you can check if a token is owned by a given wallet address:
import { checkNftOwnership, Networks } from'@lyncworld/fuel-marketplace';constresponse=checkNftOwnership( wallet,// wallet of the user to check the ownership'0x...'// contract address of the token to check the ownership"0x..."// token id (or sub id) of the token to check the ownership"SEMI_FT"// token standard of the token to check the ownership (choose from NFT or SEMI_FT));