Follow these requirements before you integrate with our marketplace
NFT requirements
There are two requirements:
Implement nft_transfer_payout and nft_payout
Implement logging for nft_transfer, nft_transfer_call, nft_transfer_payout. Please follow the event standard
Implement nft_transfer_payout
Paras marketplace will call nft_transfer_payout when user purchase the NFT. https://github.com/ParasHQ/paras-marketplace-contract/blob/master/paras-marketplace-contract/src/lib.rs#L213
#[derive(Serialize, Deserialize)]
#[serde(crate = "near_sdk::serde")]
pub struct Payout {
pub payout: HashMap<AccountId, U128>,
}
pub trait Payouts{
/// Given a `token_id` and NEAR-denominated balance, return the `Payout`.
/// struct for the given token. Panic if the length of the payout exceeds
/// `max_len_payout.`
fn nft_payout(&self, token_id: String, balance: U128, max_len_payout: u32) -> Payout;
/// Given a `token_id` and NEAR-denominated balance, transfer the token
/// and return the `Payout` struct for the given token. Panic if the
/// length of the payout exceeds `max_len_payout.`
#[payable]
fn nft_transfer_payout(
&mut self,
receiver_id: AccountId,
token_id: String,
approval_id: u64,
balance: U128,
max_len_payout: u32,
) -> Payout{
assert_one_yocto();
let payout = self.nft_payout(token_id, balance);
self.nft_transfer(receiver_id, token_id, approval_id);
payout
}
}
NOTE: If you are not using royalty, then implement nft_transfer_payout as a wrapper for nft_transfer and return HashMap of {"<owner_id>": balance}, e.g.
Any function calls with NFT event standard will automatically trigger a listing on our indexer.
By cold start
Our team will list all of your NFTs into Paras without having to place a sale in the first place.
By nft_approve
Every time there is an nft_approve into paras-marketplace contract then it will be automatically listed on Paras.
Before calling nft_approve, please deposit storage fee for your sale.
storage deposit function call:
near call paras-marketplace-v1.testnet storage_deposit '{"accountId":"orang.testnet"}' --accountId orang.testnet --depositYocto 8590000000000000000000
nft_approve function call:
near call nft_contract_id nft_approve '{"token_id":"<token_id>","account_id":"paras-marketplace-v1.testnet","msg":"{\"market_type\":\"sale\",\"price\":\"1000000000000000000000000\",\"ft_token_id\":\"near\"}"}'