epam / mintgate

1 stars 2 forks source link

[HIGH] F13: As an Owner, I want to give approval to all of my tokens to the Marketplace #62

Closed zahhar closed 3 years ago

zahhar commented 3 years ago

It would be preferable if the Owner is able to approve a batch sell orders to avoid approving individual items one at a time if they want to sell multiple.

For example, if the Owner wants to approve to sell 3 tokens of a specific GateId, or even series of different TokenIds they hold, that would be ideal. Perhaps for the GateId approach, just selecting the GateId and then an amount, and for the TokenId approach we could allow them to select from the TokenIds they currently own and each could be approved.

zahhar commented 3 years ago
pub fn nft_batch_approve(
    &mut self,
    token_ids: Vec<U64>,
    account_id: AccountId,
    msg: Option<String>,
  ) -> Option<Promise> {

with a mirrored method on our market

#[ext_contract(ext_on_approve)]
pub trait NonFungibleOnBatchApprove {
  /// The Mintiest-base special, `nft_batch_on_approve` allows for batch
  /// approval of a set of tokens.
  fn nft_on_batch_approve(
    &mut self,
    tokens: Vec<U64>,
    approvals: Vec<U64>,
    owner_id: AccountId,
    msg: String,
  );
}
zahhar commented 3 years ago

As an Owner, I want to approve batch of N out of M tokens within in my possession (even if they come from different Collectible).

acuarica commented 3 years ago

I see some issues in the implementation of batch approvals: