NFT
The non-fungible tokens.

Types

Media

1
export class Media {
2
id: string
3
owner_id: string
4
creator: string
5
prev_owner: string
6
metadata: TokenMetadata
7
royalty: Royalty
8
constructor(media: string) { }
9
}
Copied!

Metadata

1
export class TokenMetadata {
2
constructor(
3
public title: string = '',
4
public issued_at: string = '',
5
public copies: u8 = 1,
6
public media: string = '',
7
public extra: Uint8Array = new Uint8Array(0),
8
public description: string = '',
9
public media_hash: string = '',
10
public expires_at: string = '',
11
public starts_at: string = '',
12
public updated_at: string = '',
13
public reference: string = '',
14
public reference_hash: string = ''
15
) {}
16
}
17
​
18
export class NFTContractMetadata {
19
constructor(
20
public spec: string = NFT_SPEC,
21
public name: string = NFT_NAME,
22
public symbol: string = NFT_SYMBOL,
23
public icon: string = '',
24
public base_uri: string = '',
25
public reference: string = '',
26
public reference_hash: string = ''
27
) {}
28
}
Copied!

Royalty

1
export class Royalty {
2
split_between: Map<AccountId, u32> = new Map()
3
percentage: u32 = 0
4
constructor() {
5
/** 25% of future sales goes to FT */
6
this.split_between.set(FT_CONTRACT, ROYALTY_PERCENTAGE)
7
this.percentage = ROYALTY_PERCENTAGE
8
}
9
}
10
​
Copied!

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
Last modified 4mo ago