-
Notifications
You must be signed in to change notification settings - Fork 55
/
TokenMetadata.ts
43 lines (41 loc) · 1.69 KB
/
TokenMetadata.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import { Cardano } from '../..';
export interface TokenMetadataSizedIcon {
/** Most likely one of 16, 32, 64, 96, 128 icons are assumed to be square */
size: number;
/** MUST be either https, ipfs, or data. icon MUST be a browser supported image format. */
icon: string;
}
/** Either on-chain or off-chain asset metadata CIP-0035 https://github.com/cardano-foundation/CIPs/pull/137 */
export interface TokenMetadata {
/** Associated asset id (concatenated hex values of policyId + assetName) */
assetId: Cardano.AssetId;
/** Asset name */
name?: string;
/** when present, field and overrides default ticker which is the asset name */
ticker?: string;
/**
* MUST be either https, ipfs, or data. icon MUST be a browser supported image format.
* When implementing the parser, it is recommended to also check 'image' and 'logo'
* properties for backwards compatibility.
*/
icon?: string;
/** allows teams to provide icon in different sizes */
sizedIcons?: TokenMetadataSizedIcon[];
/**
* https only url that refers to metadata stored offchain.
* The URL SHOULD use the project domain and
* MUST return authenticity metadata in either html or json format (see below)
*/
url?: string;
/** additional description that defines the usage of the token */
desc?: string;
/** how many decimal places should the token support? For ADA, this would be 6 e.g. 1 ADA is 10^6 Lovelace */
decimals?: number;
/**
* https only url that holds the metadata in the onchain format.
* The URL SHOULD use the project domain and MUST return the token metadata as described above
*/
ref?: string;
/** when not specified, version will default to `1.0` */
version?: '1.0';
}