0xa5::treasury_cap_reclaimer
use 0x2::object;
use 0x2::tx_context;
use 0xa5::token_id;
TreasuryCapReclaimer
Allow a user to reclaim a TreasuryCap
from ITS.
Phantom type T
is the type of the token that the TreasuryCap
is being reclaimed for.
struct TreasuryCapReclaimer<T> has store, key
id: object::UID
token_id: token_id::TokenId
token_id
for which the TreasuryCap
is being stored by ITS
create
public(friend) fun create<T>(token_id: token_id::TokenId, ctx: &mut tx_context::TxContext): treasury_cap_reclaimer::TreasuryCapReclaimer<T>
public(package) fun create<T>(token_id: TokenId, ctx: &mut TxContext): TreasuryCapReclaimer<T> {
TreasuryCapReclaimer<T> {
id: object::new(ctx),
token_id,
}
}
token_id
public(friend) fun token_id<T>(self: &treasury_cap_reclaimer::TreasuryCapReclaimer<T>): token_id::TokenId
public(package) fun token_id<T>(self: &TreasuryCapReclaimer<T>): TokenId {
self.token_id
}
destroy
public(friend) fun destroy<T>(self: treasury_cap_reclaimer::TreasuryCapReclaimer<T>)
public(package) fun destroy<T>(self: TreasuryCapReclaimer<T>) {
let TreasuryCapReclaimer { id, token_id: _ } = self;
id.delete();
}