General specifiation of the Piswap use case
This issue will detail the general use-case and all related useful information we can aggregate around the Piswap service integration in Startinblox.
First, we got some details about the available API and contracts available from the Piswap team but hte integration possibility still needs to be evaluated.
Here is the brief of our discussion:
Do you confirm that could be doable using the existing contracts ? I am not sure what is the actual method to call on the contracts to influence the value of a given NFT, like it is supposed to when you choose to click on the "undervalued" or "overvalued" CTAs ? I was looking here: https://github.com/PiSwapProtocol/PiSwap-core/tree/main/contracts but that may not be the proper entrypoint.
You would be using the nftValue or nftValueAccumulated function to get the value of an NFT for a given market. I’ve also added you to the interface repo now. The registry contract is currently deployed on the Rinkeby test network and is located at this contract address: 0x15db2Ec270863a12d20bAad32a87B14d7E512E6B Markets can only be created for NFTs on the Rinkeby network right now. We do not plan to add other networks at this point in time.
We still need to figure the proper way to interact directly with this smart contract using a facade API ? It also need Startinblox users to have an Ethereum wallet address, so the account needs to be extended to bear this wallet information, and ideally a list of NFTs address associated with their profiles. And all those interactions will be applied to the Ethereum Rinkeby Test Network so that we can both demonstrate usage of Perun and PiSwap APIs. The availability of the Perun API with Rinkeby address still needs to be validated though.
So the different steps we foresee:
-
Add an Ontochain specific NFT list relation to our user model (1 user to N NFT, ideally with the associated network specified) -
Implement a JavaScript Piswap Api Client interface/class to communicate with the smart contract -
Confirm with the Piswap team the easiest approach regarding this client API implementation ? -
Implement different templates in this component repository: -
One to provide a way for a given user to declare he owns a NFT (pure declaration), ?? and its associated price ?? -
One to list the NFTs associated with a given user account -
One to display the detail of a NFT (the image/asset or whatever information it bears) with the value evaluation retrieved from Piswap smart contract -
Ideally, the same button as Piswap welcome page to declare under/over-valuation of the NFT
-
-
Publish a draft of this component to NPM -
Once the component is published, add it to the component registry with proper default parameters based on test networks, including its dependencies on the directory -
Work on an isolated demonstration of the component, just displaying a user profile (having an account too) and its NFTs list/NFT declaration form and price evaluation feature.