1# Building an NFT Application23## Architecture45Both centralized and serverless architectures are supported and application creator can decide which one to use depending on how much logic and data they intend to manage off-chain and off-line.67### Server-based architecture89In server-based architecture the application creator manually creates NFT collections and authorizes server to perform operations on each collection. See NFT palette methods that have admin permission level to understand better what server (or administrators) can do.10111213### Serverless architecture1415In serverless architecture the application creator does all initialization and token distribution manually. Alternatively, smart contracts may be used in order to implement some distribution mechanics such as token sales or claiming. The dApp has access to all properties of an NFT token, but it does not have any elevated permissions, since it resides on user site. All operations happen on user's behalf signed by user's private key.16171819## Custom Types for JS API2021See in root README2223## NFT Palette Methods2425### Collection Management2627#### CreateCollection2829##### Description30This method creates a Collection of NFTs. Each Token may have multiple properties encoded as an array of bytes of certain length. The initial owner and admin of the collection are set to the address that signed the transaction. Both addresses can be changed later.3132##### Permissions33Anyone3435##### Parameters36customDataSz: Size of NFT properties data.3738##### Events39CollectionCreated40CollectionID: Globally unique identifier of newly created collection.41Owner: Collection owner4243#### ChangeCollectionOwner4445##### Description46Change the owner of the collection4748##### Permissions49Collection Owner5051##### Parameters52CollectionId5354#### DestroyCollection5556##### Description57DANGEROUS: Destroys collection and all NFTs within this collection. Users irrecoverably lose their assets and may lose real money.5859##### Permissions60Collection Owner6162##### Parameters63CollectionId6465#### CreateItem6667##### Description68This method creates a concrete instance of NFT Collection created with CreateCollection method.6970##### Permissions71Collection Owner72Collection Admin7374##### Parameters75CollectionID: ID of the collection76Properties: Array of bytes that contains NFT properties. Since NFT Module is agnostic of properties’ meaning, it is treated purely as an array of bytes77Owner: Address, initial owner of the NFT7879##### Events80ItemCreated81ItemId: Identifier of newly created NFT, which is unique within the Collection, so the NFT is uniquely identified with a pair of values: CollectionId and ItemId.82Recipient: Address, owner of newly created item8384#### BurnItem8586##### Description87This method destroys a concrete instance of NFT.8889##### Permissions90Collection Owner91Collection Admin92Current NFT Owner9394##### Parameters95CollectionID: ID of the collection96ItemID: ID of NFT to burn9798##### Events99ItemDestroyed100CollectionID101ItemId: Identifier of burned NFT102103104#### AddCollectionAdmin105106##### Description107NFT Collection can be controlled by multiple admin addresses (some which can also be servers, for example). Admins can issue and burn NFTs, as well as add and remove other admins, but cannot change NFT or Collection ownership.108109This method adds an admin of the Collection.110111##### Permissions112Collection Owner113Collection Admin114115##### Parameters116CollectionID: ID of the Collection to add admin for117Admin: Address of new admin to add118119#### RemoveCollectionAdmin120121##### Description122Remove admin address of the Collection. An admin address can remove itself. List of admins may become empty, in which case only Collection Owner will be able to add an Admin.123124##### Permissions125Collection Owner126Collection Admin127128##### Parameters129CollectionID: ID of the Collection to remove admin for130Admin: Address of admin to remove131132### Item Ownership and Transfers133This group of methods allows managing NFT ownership.134135#### GetOwner136137##### Description138Return the address of the NFT owner. 139140##### Permissions141Anyone142143##### Parameters144CollectionId145ItemId: ID of the NFT146147##### Returns148Owner address149150#### BalanceOf151152##### Description153This method is included for compatibility with ERC-721. Return the total count of NFTs of a given Collection that belong to a given address. 154155##### Permissions156Anyone157158##### Parameters159CollectionId160Address to count NFTs for161162##### Returns163Total count of NFTs for Address164165166#### Transfer167168##### Description169Change ownership of the NFT.170171##### Permissions172Collection Owner173Collection Admin174Current NFT owner175176##### Parameters177Recipient: Address of token recipient178ClassId: ID of item class179ItemId: ID of the item180181#### TransferFrom182183##### Description184Change ownership of a NFT on behalf of the owner. See Approve method for additional information. After this method executes, the approval is removed so that the approved address will not be able to transfer this NFT again from this owner.185186##### Permissions187Collection Owner188Collection Admin189Current NFT owner190Address approved by current NFT owner191192##### Parameters193Recipient: Address of token recipient194ClassId: ID of item class195ItemId: ID of the item196197198#### Approve199200##### Description201Set, change, or remove approved address to transfer the ownership of the NFT.202203##### Permissions204Collection Owner205Collection Admin206Current NFT owner207208##### Parameters209Approved: Address that is approved to transfer this NFT or zero (if needed to remove approval)210ClassId: ID of item class211ItemId: ID of the item212213#### GetApproved214215##### Description216Get the approved address for a single NFT.217218##### Permissions219Anyone220221##### Parameters222ClassId: ID of item class223ItemId: ID of the item224225##### Returns226Approved address