From b3636a0b509957114781d1ca038cb046373347f7 Mon Sep 17 00:00:00 2001 From: Gino Date: Wed, 26 Jun 2024 10:22:30 +0100 Subject: [PATCH] feat(iota-wiki): implement review suggestions --- .../core-contracts/nft/get-L2-nfts.mdx | 40 ++++++++++++++----- .../core-contracts/nft/get-L2-nfts.mdx | 40 ++++++++++++++----- 2 files changed, 58 insertions(+), 22 deletions(-) diff --git a/docs/build/isc/v1.1/docs/how-tos/core-contracts/nft/get-L2-nfts.mdx b/docs/build/isc/v1.1/docs/how-tos/core-contracts/nft/get-L2-nfts.mdx index 29d471e27bb..1951ac3b7da 100644 --- a/docs/build/isc/v1.1/docs/how-tos/core-contracts/nft/get-L2-nfts.mdx +++ b/docs/build/isc/v1.1/docs/how-tos/core-contracts/nft/get-L2-nfts.mdx @@ -1,5 +1,5 @@ --- -description: How to Get the L2 NFTs owned by an account. +description: How to get the L2 NFTs owned by an account. image: /img/logo/WASP_logo_dark.png tags: - EVM @@ -11,7 +11,7 @@ import GetNftMetadata from '../../../_partials/how-tos/token/_get-nft-metadata.m # Get NFTs Owned by an Account -This guide will show you how to get the L2 NFTs owned by an account using the `getL2NFTs` function from the `ISCAccounts` magic contract. +This guide will show you how to get the L2 NFTs owned by an account using the [`ISCAccounts.getL2NFTs`](../../../reference/magic-contract/ISCAccounts.md#getl2nfts) function from the [`ISCAccounts.getL2NFTs`](../../../reference/magic-contract/ISCAccounts.md) [magic contract](../../../reference/magic-contract/introduction.md). @@ -19,32 +19,50 @@ This guide will show you how to get the L2 NFTs owned by an account using the `g The `getL2NFTs` function is a view function provided by the `ISCAccounts` interface. It takes an `ISCAgentID` as an argument and returns an array of `NFTID` objects. This function allows users to query and retrieve the list of L2 NFTs owned by a specified agent. The `ISCAgentID` represents the identifier of the agent (user or contract) whose NFTs you want to retrieve. The returned array contains the identifiers of the NFTs, which can then be used to fetch more details about each NFT if needed. -## Why Would a User Need to retrieve owned NFTs? +## Why Would a User Need to Retrieve Owned NFTs? Retrieving the NFTs owned by a user can serve several purposes: -1. **Portfolio Management:** Users can manage their digital assets effectively by viewing all their NFTs in one place. -2. **Marketplace Listing:** Users can list their NFTs on various marketplaces by verifying their ownership. -3. **Collection Display:** Users can showcase their NFT collections on social media, personal websites, or within specific applications. -4. **Trading and Transfers:** Knowing the NFTs owned helps users decide which assets to trade or transfer to other users. -5. **Application Integration:** Applications can provide customized experiences based on the NFTs a user owns, such as granting access to special content or features. +- ### Portfolio Management + + - Users can manage their digital assets effectively by viewing all their NFTs in one place. + +- ### Marketplace Listing + + - Users can list their NFTs on various marketplaces by verifying their ownership. + +- ### Collection Display + + - Users can showcase their NFT collections on social media, personal websites, or within specific applications. + +- ### Trading and Transfers + + - Knowing the NFTs owned helps users decide which assets to trade or transfer to other users. + +- ### Application Integration + + - Applications can provide customized experiences based on the NFTs a user owns, such as granting access to special content or features. ## Prerequisites -1. **Install the ISC Magic Library:** + +### Install the ISC Magic Library Ensure you have the ISC Magic library installed in your project: + ```bash npm install @iota/iscmagic ``` -2. **Import the ISC Library:** +### 2. Import the ISC Library In your Solidity file, import the ISC Library: + ```solidity pragma solidity >=0.8.5; import "@iota/iscmagic/ISC.sol"; ``` + ## Implement the `getL2NFTs` Function Here’s a sample implementation to retrieve L2 NFTs owned by an account: @@ -76,4 +94,4 @@ function getOwnedNFTs(ISCAgentID memory agentID) public view returns (NFTID[] me ``` ## Conclusion -Using the `getL2NFTs` function from the `ISCAccounts` interface provides an efficient way to retrieve and manage the Layer 2 NFTs owned by an account. By integrating this functionality into your smart contracts, you can enhance user experience by enabling features such as portfolio management, marketplace listings, collection displays, and more. With this guide, you now have the foundational knowledge to implement and utilize the `getL2NFTs` function in your own projects, allowing for seamless interaction with `ISC Magic` and its associated NFTs. \ No newline at end of file +Using the `getL2NFTs` function from the `ISCAccounts` interface provides an efficient way to retrieve and manage the Layer 2 NFTs owned by an account. By integrating this functionality into your smart contracts, you can enhance user experience by enabling features such as [portfolio management](#portfolio-management), [marketplace listings](#marketplace-listing), [collection displays](#collection-display), and more. With this guide, you have the foundational knowledge to implement and utilize the `getL2NFTs` function in your projects, allowing for seamless interaction with `ISC Magic` and its associated NFTs. \ No newline at end of file diff --git a/docs/build/isc/v1.3/docs/how-tos/core-contracts/nft/get-L2-nfts.mdx b/docs/build/isc/v1.3/docs/how-tos/core-contracts/nft/get-L2-nfts.mdx index 29d471e27bb..1951ac3b7da 100644 --- a/docs/build/isc/v1.3/docs/how-tos/core-contracts/nft/get-L2-nfts.mdx +++ b/docs/build/isc/v1.3/docs/how-tos/core-contracts/nft/get-L2-nfts.mdx @@ -1,5 +1,5 @@ --- -description: How to Get the L2 NFTs owned by an account. +description: How to get the L2 NFTs owned by an account. image: /img/logo/WASP_logo_dark.png tags: - EVM @@ -11,7 +11,7 @@ import GetNftMetadata from '../../../_partials/how-tos/token/_get-nft-metadata.m # Get NFTs Owned by an Account -This guide will show you how to get the L2 NFTs owned by an account using the `getL2NFTs` function from the `ISCAccounts` magic contract. +This guide will show you how to get the L2 NFTs owned by an account using the [`ISCAccounts.getL2NFTs`](../../../reference/magic-contract/ISCAccounts.md#getl2nfts) function from the [`ISCAccounts.getL2NFTs`](../../../reference/magic-contract/ISCAccounts.md) [magic contract](../../../reference/magic-contract/introduction.md). @@ -19,32 +19,50 @@ This guide will show you how to get the L2 NFTs owned by an account using the `g The `getL2NFTs` function is a view function provided by the `ISCAccounts` interface. It takes an `ISCAgentID` as an argument and returns an array of `NFTID` objects. This function allows users to query and retrieve the list of L2 NFTs owned by a specified agent. The `ISCAgentID` represents the identifier of the agent (user or contract) whose NFTs you want to retrieve. The returned array contains the identifiers of the NFTs, which can then be used to fetch more details about each NFT if needed. -## Why Would a User Need to retrieve owned NFTs? +## Why Would a User Need to Retrieve Owned NFTs? Retrieving the NFTs owned by a user can serve several purposes: -1. **Portfolio Management:** Users can manage their digital assets effectively by viewing all their NFTs in one place. -2. **Marketplace Listing:** Users can list their NFTs on various marketplaces by verifying their ownership. -3. **Collection Display:** Users can showcase their NFT collections on social media, personal websites, or within specific applications. -4. **Trading and Transfers:** Knowing the NFTs owned helps users decide which assets to trade or transfer to other users. -5. **Application Integration:** Applications can provide customized experiences based on the NFTs a user owns, such as granting access to special content or features. +- ### Portfolio Management + + - Users can manage their digital assets effectively by viewing all their NFTs in one place. + +- ### Marketplace Listing + + - Users can list their NFTs on various marketplaces by verifying their ownership. + +- ### Collection Display + + - Users can showcase their NFT collections on social media, personal websites, or within specific applications. + +- ### Trading and Transfers + + - Knowing the NFTs owned helps users decide which assets to trade or transfer to other users. + +- ### Application Integration + + - Applications can provide customized experiences based on the NFTs a user owns, such as granting access to special content or features. ## Prerequisites -1. **Install the ISC Magic Library:** + +### Install the ISC Magic Library Ensure you have the ISC Magic library installed in your project: + ```bash npm install @iota/iscmagic ``` -2. **Import the ISC Library:** +### 2. Import the ISC Library In your Solidity file, import the ISC Library: + ```solidity pragma solidity >=0.8.5; import "@iota/iscmagic/ISC.sol"; ``` + ## Implement the `getL2NFTs` Function Here’s a sample implementation to retrieve L2 NFTs owned by an account: @@ -76,4 +94,4 @@ function getOwnedNFTs(ISCAgentID memory agentID) public view returns (NFTID[] me ``` ## Conclusion -Using the `getL2NFTs` function from the `ISCAccounts` interface provides an efficient way to retrieve and manage the Layer 2 NFTs owned by an account. By integrating this functionality into your smart contracts, you can enhance user experience by enabling features such as portfolio management, marketplace listings, collection displays, and more. With this guide, you now have the foundational knowledge to implement and utilize the `getL2NFTs` function in your own projects, allowing for seamless interaction with `ISC Magic` and its associated NFTs. \ No newline at end of file +Using the `getL2NFTs` function from the `ISCAccounts` interface provides an efficient way to retrieve and manage the Layer 2 NFTs owned by an account. By integrating this functionality into your smart contracts, you can enhance user experience by enabling features such as [portfolio management](#portfolio-management), [marketplace listings](#marketplace-listing), [collection displays](#collection-display), and more. With this guide, you have the foundational knowledge to implement and utilize the `getL2NFTs` function in your projects, allowing for seamless interaction with `ISC Magic` and its associated NFTs. \ No newline at end of file