0x0::composable_url

Module of ComposableUrlDomain

ComposableUrlDomain does not itself compose NFTs but serves as a display standard provider for and NFT which composes UrlDomain with AttributesDomain.

Structs

composable_url::ComposableUrlDomain has store

Fields:

Name Type Description
url url::Url

Composed URL

Domain for providing composed URL data

composable_url::Witness has drop

Witness used to authenticate witness protected endpoints

Methods

public fun new(): composable_url::ComposableUrlDomain

Creates new ComposableUrlDomain with no predefined NFTs

public fun set_url<C>(
    witness: witness::Witness<C>,
    nft: &mut nft::Nft<C>,
    url: url::Url,
)

Sets URL of ComposableUrlDomain

Also sets static url field on Nft.

Panics

Panics if ComposableUrlDomain does not exist on Nft

public fun regenerate<C>(
    witness: witness::Witness<C>,
    nft: &mut nft::Nft<C>,
)

Regenerates composed URL data

Panics

Panics if ComposableUrlDomain or UrlDomain is not registered

public fun has_composable_url<C>(
    nft: &nft::Nft<C>,
): bool

Returns whether ComposableUrlDomain is registered on Nft

public fun borrow_composable_url<C>(
    nft: &nft::Nft<C>,
): &url::Url

Borrows composed URL data from Nft

Panics

Panics if ComposableUrlDomain is not registered on the Nft

public fun add_composable_url<C, W>(
    witness: &W,
    nft: &mut nft::Nft<C>,
)

Adds UrlDomain to Nft

ComposableUrlDomain will not be automatically updated so composable_url::register and composable_url::regenerate must be called.

Panics

Panics if UrlDomain domain already exists

public fun add_composable_url_delegated<C>(
    _witness: witness::Witness<C>,
    nft: &mut nft::Nft<C>,
)

Adds UrlDomain to Nft

ComposableUrlDomain will not be automatically updated so composable_url::register and composable_url::regenerate must be called.

Panics

Panics if UrlDomain domain already exists

public fun assert_composable_url<C>(
    nft: &nft::Nft<C>,
)

Asserts that ComposableUrlDomain is registered on Nft

Panics

Panics if ComposableUrlDomain is not registered