List NFT for sale (Asset)
=====
- [RMV2-7](https://rsklabs.atlassian.net/browse/RMV2-7)
## User Story
### B2B
As a software developer I want to be able to choose between different sale methods via a unified, easy-to-use developer interface, so that I can customize the sale behaviour depending on the users needs.
### B2C
As a digital item seller I want to be able to select a sale method during the sale listing process, so that I can list an item via an NFT Marketplace application using the most convenient and profitable approach to me.
### Requirements
---
# Substories/subtasks
Fixed price product listing
---
- [RMV2-8](https://rsklabs.atlassian.net/browse/RMV2-8)
### User Story
#### B2B
As a software developer, I want to have a unified, easy-to-use simple fixed-price sale API, so that I can use this interface to programmatically set digital items for sale based on the price my users set.
#### B2C
As a digital item seller I want to list an item for sale using a simple fixed price mechanism via an NFT Marketplace application, so that I can sell my work based on the price I set.
#### Requirements
1. Be able to change price
2. Be able to cancel anytime
3. Be able to set and change an expiration date for the listing sale
English Auction product listing
---
- [RMV2-9](https://rsklabs.atlassian.net/browse/RMV2-9)
### User Story
#### B2B
As a software developer I want to have a unified, easy-to-use English Auction sale API, so that I can use this interface to programmatically sell digital items based on the open market price.
#### B2C
As a digital item seller, I want to list an item for sale using a highest-bidder auction (English Auction) via an NFT Marketplace application, so that I can sell my work based on the open market price.
#### Requirements
1. Be able to set a minimum price
2. Customize allowance to cancel
3. Be able to set expiration date
4. Allow transfer of the bidder's funds on the bid
5. Be able to edit any feature (min price, expiration date, …)
6. Req6: Be able to cancel the auction
Set accepted Currencies for the item for sale
---
- [RMV2-11](https://rsklabs.atlassian.net/browse/RMV2-11)
### User Story
#### B2B
As a software developer I want to have a unified, easy-to-use developer interface to set the Accepted Currencies for the item for sale, so that I can programmatically set and change this property.
#### B2C
As a digital item seller, I want to set up the Accepted Currencies for the item for sale taking into account the selected listing method (fixed price or auction), so that I can sell my work based on the price I set.
#### Requirements
1. allow RBTC
2. allow RIF
3. allow RDOC
---
# Diagrams
```sequence
title: Sequence analysis
participant RSK
participant EngineSC
participant EngineSDK
participant Owner
participant Producer
participant IExchange
# B2B
Owner->>EngineSDK: setWhitelistedCurrencies
EngineSDK->>RSK: new CustomTokenSC(): []
EngineSDK->EngineSDK: whitelistedCurrencies < tokenContracts
EngineSDK->>EngineSC: setWhitelistedCurrency(): whitelistedCurrencies
EngineSC-->>EngineSDK:
EngineSDK-->>Owner:
Owner->EngineSDK: getWhitelistedExchanges
EngineSDK-->Owner: IExchange[]
Owner->EngineSDK: use exchangeContracts[]
EngineSDK->>RSK: new CustomExchangeSC(): []
RSK->>IExchange: deploy
EngineSDK->EngineSDK: whitelistedExchanges < exchangeContracts
EngineSDK->EngineSC: setWhitelistedExchange(): whitelistedExchanges
EngineSDK-->Owner: address[]
Note over Owner: Deploy Marketplace:
Owner->>RSK: new EngineSC(options)
RSK->>EngineSC: deploy
RSK-->Owner:
# B2C
Producer->Owner: showAssets
Note left of Owner: if(!producerAccount.assets)
Owner->EngineSDK: getAssets(userAddress)
EngineSDK->EngineSC: getAssets(userAddress)
EngineSC-->EngineSDK: assets[]
EngineSDK-->Owner: assets[]
Owner-->Producer:
Producer->Owner: getAvailableExchanges
Owner->EngineSDK: getWhitelistedExchanges
EngineSDK->EngineSC: isWhitelistedExchange(): whitelistedExchanges
EngineSC-->EngineSDK:
EngineSDK-->Owner: whitelistedExchanges[]
Owner-->Producer:
Producer->Owner: List asset with sale method
Owner->EngineSDK: createOrder(whitelistedExchanges[], asset)
EngineSDK->EngineSDK: orders < new Order()
EngineSDK-->Owner: order
Owner->EngineSDK: getWhitelistedCurrencies(order)
EngineSDK->EngineSC: isWhitelistedCcy(ccy, order): whitelistedCurrencies
EngineSC->IExchange: isWhitelistedCcy(ccy)
EngineSC-->EngineSDK: address[]
EngineSDK-->Owner: Currency[]
Owner->Producer: choose currencies
Producer-->Owner: select currencies
Owner->EngineSDK: useCurrencies(): Currency[]
EngineSDK->EngineSC: createOrder(asset, exchange[], currency[])
EngineSC-->EngineSDK: order
EngineSDK->EngineSDK: update orders[order]
EngineSDK-->Owner: order
Owner-->>Producer: order
```
:::info
Note: $Owner ∋ Kahlo$
:::
---
# Q&A:
- **Q**: Is it possible for exchange method contracts to specify their own whitelisted tokens (currencies)? If not, then the currencies need to be retrieved and selected before the order creation is called. Otherwise each exchange contract has to be checked for whitelistedTokens as done above.
- ***A***: