Module of the UrlDomain
Used to associate a URL with Collection
or Nft
.add
Interoperability functions are delegated to the display_ext
module.
Structs
url::UrlDomain has store
url::UrlDomain has store
Fields:
Name | Type | Description |
---|---|---|
url
|
url::Url
|
Domain for storing an associated URL
Changes are replicated to ComposableUrl
domain as URL base for NFTs.
Methods
public fun set_url<C>(
witness: witness::Witness<C>,
nft: &mut nft::Nft<C>,
url: url::Url,
)
public fun set_url<C>(
witness: witness::Witness<C>,
nft: &mut nft::Nft<C>,
url: url::Url,
)
Sets URL of UrlDomain
Need to ensure that UrlDomain
is updated with attributes if they
exist therefore function cannot be public.
Panics
Panics if UrlDomain
does not exist on Nft
public fun set_collection_url<C>(
_witness: witness::Witness<C>,
collection: &mut collection::Collection<C>,
url: url::Url,
)
public fun set_collection_url<C>(
_witness: witness::Witness<C>,
collection: &mut collection::Collection<C>,
url: url::Url,
)
Sets URL of UrlDomain
Panics
Panics if UrlDomain
does not exist on Collection
public fun has_collection_url<C>(
collection: &collection::Collection<C>,
): bool
public fun has_collection_url<C>(
collection: &collection::Collection<C>,
): bool
Returns whether UrlDomain
is registered on Collection
public fun borrow_url<C>(nft: &nft::Nft<C>):
&url::Url
public fun borrow_url<C>(nft: &nft::Nft<C>):
&url::Url
Borrows UrlDomain
from Nft
Panics
Panics if UrlDomain
is not registered on the Nft
public fun borrow_collection_url<C>(
collection: &collection::Collection<C>,
): &url::Url
public fun borrow_collection_url<C>(
collection: &collection::Collection<C>,
): &url::Url
Borrows UrlDomain
from Collection
Panics
Panics if UrlDomain
is not registered on the Collection
public fun add_url_domain<C, W>(
witness: &W,
nft: &mut nft::Nft<C>,
url: url::Url,
)
public fun add_url_domain<C, W>(
witness: &W,
nft: &mut nft::Nft<C>,
url: url::Url,
)
Adds UrlDomain
to Nft
Need to ensure that UrlDomain
is updated with attributes if they
exist therefore function cannot be public.
Panics
Panics if UrlDomain
domain already exists
public fun add_url_domain_delegated<C>(
witness: witness::Witness<C>,
nft: &mut nft::Nft<C>,
url: url::Url,
)
public fun add_url_domain_delegated<C>(
witness: witness::Witness<C>,
nft: &mut nft::Nft<C>,
url: url::Url,
)
Adds UrlDomain
to Nft
Need to ensure that UrlDomain
is updated with attributes if they
exist therefore function cannot be public.
Panics
Panics if UrlDomain
domain already exists
public fun add_collection_url_domain<C, W>(
witness: &W,
collection: &mut collection::Collection<C>,
url: url::Url,
)
public fun add_collection_url_domain<C, W>(
witness: &W,
collection: &mut collection::Collection<C>,
url: url::Url,
)
Adds UrlDomain
to Collection
Panics
Panics if UrlDomain
domain already exists
public fun add_collection_url_domain_delegated<C>(
witness: witness::Witness<C>,
collection: &mut collection::Collection<C>,
url: url::Url,
)
public fun add_collection_url_domain_delegated<C>(
witness: witness::Witness<C>,
collection: &mut collection::Collection<C>,
url: url::Url,
)
Adds UrlDomain
to Collection
Panics
Panics if UrlDomain
domain already exists
public fun assert_url<C>(nft: &nft::Nft<C>)
public fun assert_url<C>(nft: &nft::Nft<C>)
Asserts that UrlDomain
is registered on Nft
Panics
Panics if UrlDomain
is not registered
public fun assert_collection_url<C>(
collection: &collection::Collection<C>,
)
public fun assert_collection_url<C>(
collection: &collection::Collection<C>,
)
Asserts that UrlDomain
is registered on Nft
Panics
Panics if UrlDomain
is not registered