NFT
The non-fungible tokens.

Types

Media

export class Media {
id: string
owner_id: string
creator: string
prev_owner: string
metadata: TokenMetadata
royalty: Royalty
constructor(media: string) { }
}

Metadata

export class TokenMetadata {
constructor(
public title: string = '',
public issued_at: string = '',
public copies: u8 = 1,
public media: string = '',
public extra: Uint8Array = new Uint8Array(0),
public description: string = '',
public media_hash: string = '',
public expires_at: string = '',
public starts_at: string = '',
public updated_at: string = '',
public reference: string = '',
public reference_hash: string = ''
) {}
}
​
export class NFTContractMetadata {
constructor(
public spec: string = NFT_SPEC,
public name: string = NFT_NAME,
public symbol: string = NFT_SYMBOL,
public icon: string = '',
public base_uri: string = '',
public reference: string = '',
public reference_hash: string = ''
) {}
}

Royalty

export class Royalty {
split_between: Map<AccountId, u32> = new Map()
percentage: u32 = 0
constructor() {
/** 25% of future sales goes to FT */
this.split_between.set(FT_CONTRACT, ROYALTY_PERCENTAGE)
this.percentage = ROYALTY_PERCENTAGE
}
}
​

Methods

post
[nft-contract]
.claim_media(media)
Claim Media
delete
[nft-contract]
.burn_design(token_id)
Burn Design
get
[nft-contract]
.nft_token(token_id)
NFT Token
get
[nft-contract]
.nft_total_supply()
NFT Total Supply
get
[nft-contract].
nft_tokens(from_index, limit)
NFT Tokens
get
[nft-contract]
.nft_supply_for_owner(account_id)
NFT Supply For Owner
get
[nft-contract]
.nft_tokens_for_owner(account_id, from_index, limit)
NFT Tokens For Owner
patch
[nft-contract]
.nft_transfer(token_id, bidder)
NFT Transfer
get
[nft-contract]
.nft_metadata()
NFT Metadata
post
[nft-contract]
.init(contract_metadata, market_contract)
init