generated from PolymeshAssociation/typescript-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 11
/
types.ts
55 lines (48 loc) · 1.05 KB
/
types.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
44
45
46
47
48
49
50
51
52
53
54
55
import BigNumber from 'bignumber.js';
export enum MetadataType {
Local = 'Local',
Global = 'Global',
}
export enum MetadataLockStatus {
Unlocked = 'Unlocked',
Locked = 'Locked',
LockedUntil = 'LockedUntil',
}
export interface MetadataSpec {
url?: string;
description?: string;
typeDef?: string;
}
export interface MetadataDetails {
name: string;
specs: MetadataSpec;
}
export type MetadataValueDetails = {
/**
* Date at which the Metadata value expires, null if it never expires
*/
expiry: Date | null;
} & (
| {
/**
* Lock status of the Metadata value
*/
lockStatus: Exclude<MetadataLockStatus, MetadataLockStatus.LockedUntil>;
}
| {
/**
* Lock status of the Metadata value
*/
lockStatus: MetadataLockStatus.LockedUntil;
/**
* Date till which the Metadata value will be locked
*/
lockedUntil: Date;
}
);
export type MetadataValue = {
value: string;
} & MetadataValueDetails;
export type GlobalMetadataKey = MetadataDetails & {
id: BigNumber;
};