Ownership
NFT ownership is tracked through individual NFT item contracts. Unlike jettons, which have a balance, one either owns a specific NFT item or does not. To obtain a list of NFTs owned by a user, query their TON wallet by either thegetNfts() method of wallet adapters or by calling kit.nfts.getAddressNfts() and passing it the TON wallet address.
Similar to other asset queries, discrete one-off checks have limited value on their own and continuous monitoring should be used for UI display.
On-demand ownership check
Use thegetNfts() method to check which NFTs are owned by a wallet managed by WalletKit. The method returns an array of NFT items with their addresses, collection info, and metadata.
TypeScript
TypeScript
Continuous ownership monitoring
Poll the NFT ownership at regular intervals to keep the displayed information up to date. Use an appropriate interval based on UX requirements — shorter intervals provide fresher data but increase API usage. This example should be modified according to the wallet service’s logic:TypeScript
Transfers from dApps
When a connected dApp requests an NFT transfer, the wallet service follows the same flow as Toncoin transfers: the dApp sends a transaction request through the bridge, WalletKit emulates it and presents a preview, the user approves or declines, and the result is returned to the dApp.TypeScript
Transfers in the wallet service
NFT transactions can be created directly from the wallet service (not from dApps) and fed into the regular approval flow via thehandleNewTransaction() method of the WalletKit. It creates a new transaction request event, enabling the same UI confirmation-to-transaction flow for both dApp-initiated and wallet-initiated transactions.
This example should be modified according to the wallet service’s logic:
TypeScript