Integration with xcRegions
⚠️ Deprecated ⚠️
Before attempting to integrate xcRegions into another smart contract or frontend code it is important to have a good understanding of our approach for solving NFT metadata transfers that is described here: Solving NFT cross-chain transfers.
The xcRegions contract is designed to function as a facilitator, offering a convenient means for various applications to engage with Coretime regions from the Bulk market. It adheres to the PSP34 interface, enabling it to be utilized as a standard NFT token. However, the contract goes beyond the PSP34 interface by implementing the MetadataWrapper
interface, as detailed in the Solving NFT Cross-Chain Transfers article.
Accessing region metadata
The xcRegions contract exposes the get_metadata
ink! message, which can be used to retrieve all associated metadata of the region.
However, it is important to note that not all metadata returned by this function is guaranteed to be accurate. The region's metadata is divided into two parts:
RegionId
The RegionId
is a unique identifier for regions. In itself, it contains parts of the metadata:
Given that this type is used to identify regions for executing reserve transfers (in the form of u128
), when a user sets the metadata of a region, the xcRegions contract can verify whether its properties align with those that are part of the RegionId
. This way we can be assured this part of the metadata is correct.
RegionRecord
This part of the metadata is not stored within the region identifier. For this reason, the xcRegions contract cannot verify its correctness and it is the responsibility of the client to ensure its validity as described in the Solving NFT Cross-Chain Transfers article.
Last updated