Skip to content
Discussion options

You must be logged in to vote

How to get token royalties

There's an existing view function for this on the token module. You can call this on a token directly.

https://github.com/aptos-labs/aptos-core/blob/84433ec8ffc448f1a99478720a697c645ee08411/aptos-move/framework/aptos-token-objects/sources/token.move#L464-L477

Source:

    #[view]
    public fun royalty<T: key>(token: Object<T>): Option<Royalty> acquires Token {
        borrow(&token);
        let royalty = royalty::get(token);
        if (option::is_some(&royalty)) {
            royalty
        } else {
            let creator = creator(token);
            let collection_name = collection_name(token);
            let collection_address = collection::create_collec…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Pelumi527
Comment options

Answer selected by gregnazario
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
nft Questions related to NFTs and digital asset / token standards
3 participants