git.delta.rocks / unique-network / refs/commits / 95d6df7b2c6b

difftreelog

doc: added more detailed description

PraetorP2022-07-18parent: #5b40b46.patch.diff
in: master

1 file changed

modifiedpallets/fungible/src/lib.rsdiffbeforeafterboth
472472
473 /// Set allowance for the spender to `transfer` or `burn` owner's tokens.473 /// Set allowance for the spender to `transfer` or `burn` owner's tokens.
474 ///474 ///
475 /// - `collection`: Collection that contains the token
476 /// - `owner`: Owner of tokens that sets the allowance.
477 /// - `spender`: Recipient of the allowance rights.
475 /// - `amount`: Amount of tokens the spender is allowed to `transfer` or `burn`.478 /// - `amount`: Amount of tokens the spender is allowed to `transfer` or `burn`.
476 pub fn set_allowance(479 pub fn set_allowance(
477 collection: &FungibleHandle<T>,480 collection: &FungibleHandle<T>,
497 Ok(())500 Ok(())
498 }501 }
499502
500 /// Returns allowance, which should be set after transaction503 /// Checks if a non-owner has (enough) allowance from the owner to perform operations on the tokens.
504 /// Returns the expected remaining allowance - it should be set manually if the transaction proceeds.
505 ///
506 /// - `collection`: Collection that contains the token.
507 /// - `spender`: CrossAccountId who has the allowance rights.
508 /// - `from`: The owner of the tokens who sets the allowance.
509 /// - `amount`: Amount of tokens by which the allowance sholud be reduced.
501 fn check_allowed(510 fn check_allowed(
502 collection: &FungibleHandle<T>,511 collection: &FungibleHandle<T>,
503 spender: &T::CrossAccountId,512 spender: &T::CrossAccountId,
538 }547 }
539548
540 /// Transfer fungible tokens from one account to another.549 /// Transfer fungible tokens from one account to another.
541 /// Same as the [`transfer`] but spender doesn't needs to be an owner of the token pieces.550 /// Same as the [`transfer`][`Pallet::transfer`] but spender doesn't needs to be an owner of the token pieces.
542 /// The owner should set allowance for the spender to transfer pieces.551 /// The owner should set allowance for the spender to transfer pieces.
543 /// See [`set_allowance`][`Pallet::set_allowance`] for more details.552 /// See [`set_allowance`][`Pallet::set_allowance`] for more details.
544 /// 553
545 /// [`transfer`]: struct.Pallet.html#method.transfer
546 pub fn transfer_from(554 pub fn transfer_from(
547 collection: &FungibleHandle<T>,555 collection: &FungibleHandle<T>,
548 spender: &T::CrossAccountId,556 spender: &T::CrossAccountId,