For a lesson I am following to learn Move/SUI I have this method I need to implement
/*
Withdraws the sales balance from the MinterCap object. This can only be called by the owner
of the MinterCap object.
@param minter_cap - the minter cap object
@param ctx - the transaction context
@return the withdrawn coin
*/
public fun withdraw(
minter_cap: &mut MinterCap,
ctx: &mut TxContext,
): Coin<SUI> {
// implement
}
Up until now, I have always used transfer::transfer(obj, address) to transfer an object to an address, but in this case, this method actually returns Coin<SUI>
, so I am not sure how to handle this. Should I use transfer::transfer(coin, address)
like I am used to before? or the fact that this method returns Coin<SUI>
has a special meaning?