-
Notifications
You must be signed in to change notification settings - Fork 7
/
assets.types.ts
106 lines (85 loc) · 2.07 KB
/
assets.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
import { IDIDDocument } from '@ew-did-registry/did-resolver-interface';
import { Order } from '../cache-client';
export interface Asset {
id: string;
owner: string;
offeredTo?: string;
document: IDIDDocument;
updatedAt: string;
createdAt: string;
}
export interface AssetHistory {
id: number;
emittedBy: string;
relatedTo?: string;
at: number;
timestamp: string;
assetId?: string;
type: AssetHistoryEventType;
}
export enum AssetHistoryEventType {
ASSET_CREATED = 'ASSET_CREATED',
ASSET_OFFERED = 'ASSET_OFFERED',
ASSET_OFFER_CANCELED = 'ASSET_OFFER_CANCELED',
ASSET_TRANSFERRED = 'ASSET_TRANSFERRED',
ASSET_OFFER_REJECTED = 'ASSET_OFFER_REJECTED',
}
export interface OfferAssetOptions {
/** DID of offered asset */
assetDID: string;
/** Address of offer recipient */
offerTo: string;
}
export interface AcceptAssetOfferOptions {
/** DID of offered asset */
assetDID: string;
}
export interface RejectAssetOfferOptions {
/** DID of offered asset */
assetDID: string;
}
export interface CancelAssetOfferOptions {
/** DID of offered asset */
assetDID: string;
}
export interface GetOwnedAssetsOptions {
/** DID of the user */
did: string;
}
export interface GetOfferedAssetsOptions {
/** DID of the user */
did?: string;
}
export interface GetAssetByIdOptions {
/** DID of the asset */
id: string;
}
export interface GetPreviouslyOwnedAssetsOptions {
/** DID of the user */
owner: string;
}
export interface GetAssetHistoryOptions {
/** DID of the asset */
id: string;
/** Order "ASC" (Ascending) || "DESC" (Descending) */
order?: Order;
/** Number of items to take */
take?: number;
/** Number of items to skip */
skip?: number;
/** Asset history event Type */
type?: AssetHistoryEventType;
}
export interface OfferAssetTxOptions {
offerTo: string;
assetContractAddress: string;
}
export interface AcceptOfferTxOptions {
assetContractAddress: string;
}
export interface RejectOfferTxOptions {
assetContractAddress: string;
}
export interface CancelOfferTxOptions {
assetContractAddress: string;
}