@propxchain/core-client 0.1.0-canary.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +115 -0
- package/dist/canisters/document_storage/document_storage.did.d.ts +7 -0
- package/dist/canisters/document_storage/document_storage.did.d.ts.map +1 -0
- package/dist/canisters/document_storage/document_storage.did.js +82 -0
- package/dist/canisters/document_storage/document_storage.did.js.map +1 -0
- package/dist/canisters/document_storage/index.d.ts +4 -0
- package/dist/canisters/document_storage/index.d.ts.map +1 -0
- package/dist/canisters/document_storage/index.js +2 -0
- package/dist/canisters/document_storage/index.js.map +1 -0
- package/dist/canisters/ledger_manager/index.d.ts +4 -0
- package/dist/canisters/ledger_manager/index.d.ts.map +1 -0
- package/dist/canisters/ledger_manager/index.js +2 -0
- package/dist/canisters/ledger_manager/index.js.map +1 -0
- package/dist/canisters/ledger_manager/ledger_manager.did.d.ts +7 -0
- package/dist/canisters/ledger_manager/ledger_manager.did.d.ts.map +1 -0
- package/dist/canisters/ledger_manager/ledger_manager.did.js +138 -0
- package/dist/canisters/ledger_manager/ledger_manager.did.js.map +1 -0
- package/dist/canisters/transaction_manager/index.d.ts +4 -0
- package/dist/canisters/transaction_manager/index.d.ts.map +1 -0
- package/dist/canisters/transaction_manager/index.js +2 -0
- package/dist/canisters/transaction_manager/index.js.map +1 -0
- package/dist/canisters/transaction_manager/transaction_manager.did.d.ts +7 -0
- package/dist/canisters/transaction_manager/transaction_manager.did.d.ts.map +1 -0
- package/dist/canisters/transaction_manager/transaction_manager.did.js +515 -0
- package/dist/canisters/transaction_manager/transaction_manager.did.js.map +1 -0
- package/dist/canisters/user_management/index.d.ts +4 -0
- package/dist/canisters/user_management/index.d.ts.map +1 -0
- package/dist/canisters/user_management/index.js +2 -0
- package/dist/canisters/user_management/index.js.map +1 -0
- package/dist/canisters/user_management/user_management.did.d.ts +7 -0
- package/dist/canisters/user_management/user_management.did.d.ts.map +1 -0
- package/dist/canisters/user_management/user_management.did.js +137 -0
- package/dist/canisters/user_management/user_management.did.js.map +1 -0
- package/dist/client.d.ts +13 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +41 -0
- package/dist/client.js.map +1 -0
- package/dist/errors.d.ts +8 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +22 -0
- package/dist/errors.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/mock.d.ts +22 -0
- package/dist/mock.d.ts.map +1 -0
- package/dist/mock.js +94 -0
- package/dist/mock.js.map +1 -0
- package/dist/retry.d.ts +11 -0
- package/dist/retry.d.ts.map +1 -0
- package/dist/retry.js +22 -0
- package/dist/retry.js.map +1 -0
- package/dist/stubs.d.ts +34 -0
- package/dist/stubs.d.ts.map +1 -0
- package/dist/stubs.js +17 -0
- package/dist/stubs.js.map +1 -0
- package/dist/types.d.ts +30 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +7 -0
- package/dist/types.js.map +1 -0
- package/package.json +58 -0
- package/src/canisters/document_storage/document_storage.did +89 -0
- package/src/canisters/document_storage/document_storage.did.d.ts +82 -0
- package/src/canisters/document_storage/document_storage.did.js +121 -0
- package/src/canisters/document_storage/index.ts +5 -0
- package/src/canisters/ledger_manager/index.ts +5 -0
- package/src/canisters/ledger_manager/ledger_manager.did +154 -0
- package/src/canisters/ledger_manager/ledger_manager.did.d.ts +139 -0
- package/src/canisters/ledger_manager/ledger_manager.did.js +181 -0
- package/src/canisters/transaction_manager/index.ts +5 -0
- package/src/canisters/transaction_manager/transaction_manager.did +599 -0
- package/src/canisters/transaction_manager/transaction_manager.did.d.ts +517 -0
- package/src/canisters/transaction_manager/transaction_manager.did.js +638 -0
- package/src/canisters/user_management/index.ts +5 -0
- package/src/canisters/user_management/user_management.did +147 -0
- package/src/canisters/user_management/user_management.did.d.ts +148 -0
- package/src/canisters/user_management/user_management.did.js +192 -0
- package/src/client.ts +77 -0
- package/src/errors.ts +31 -0
- package/src/index.ts +30 -0
- package/src/mock.ts +120 -0
- package/src/retry.ts +44 -0
- package/src/stubs.ts +60 -0
- package/src/types.ts +44 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
type Time = int;
|
|
2
|
+
type Result_3 =
|
|
3
|
+
variant {
|
|
4
|
+
err: text;
|
|
5
|
+
ok:
|
|
6
|
+
record {
|
|
7
|
+
contentType: text;
|
|
8
|
+
docType: text;
|
|
9
|
+
fileHash: text;
|
|
10
|
+
fileName: text;
|
|
11
|
+
fileSize: nat;
|
|
12
|
+
id: nat;
|
|
13
|
+
totalChunks: nat;
|
|
14
|
+
transactionId: opt text;
|
|
15
|
+
uploadedAt: int;
|
|
16
|
+
uploadedBy: principal;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type Result_2 =
|
|
20
|
+
variant {
|
|
21
|
+
err: text;
|
|
22
|
+
ok: nat;
|
|
23
|
+
};
|
|
24
|
+
type Result_1 =
|
|
25
|
+
variant {
|
|
26
|
+
err: text;
|
|
27
|
+
ok: text;
|
|
28
|
+
};
|
|
29
|
+
type Result =
|
|
30
|
+
variant {
|
|
31
|
+
err: text;
|
|
32
|
+
ok: bool;
|
|
33
|
+
};
|
|
34
|
+
type DocumentProof =
|
|
35
|
+
record {
|
|
36
|
+
contentType: text;
|
|
37
|
+
docType: text;
|
|
38
|
+
fileHash: text;
|
|
39
|
+
fileName: text;
|
|
40
|
+
fileSize: nat;
|
|
41
|
+
id: nat;
|
|
42
|
+
storageLocation: text;
|
|
43
|
+
transactionId: opt text;
|
|
44
|
+
uploadedAt: Time;
|
|
45
|
+
uploadedBy: principal;
|
|
46
|
+
verified: bool;
|
|
47
|
+
};
|
|
48
|
+
type AuditLog =
|
|
49
|
+
record {
|
|
50
|
+
action: text;
|
|
51
|
+
actorPrincipal: principal;
|
|
52
|
+
documentId: nat;
|
|
53
|
+
id: nat;
|
|
54
|
+
metadata: text;
|
|
55
|
+
success: bool;
|
|
56
|
+
timestamp: Time;
|
|
57
|
+
};
|
|
58
|
+
service : {
|
|
59
|
+
deleteDocument: (documentId: nat, csrfToken: text) -> (Result_1);
|
|
60
|
+
generateCSRFToken: () -> (text);
|
|
61
|
+
getAuditLogs: (documentId: nat) -> (vec AuditLog) query;
|
|
62
|
+
getCSRFToken: () -> (opt text) query;
|
|
63
|
+
getCycles: () -> (nat) query;
|
|
64
|
+
getDocumentMetadata: (documentId: nat) -> (Result_3) query;
|
|
65
|
+
getDocumentProof: (documentId: nat) -> (opt DocumentProof) query;
|
|
66
|
+
getMyAuditLogs: ("principal": principal) -> (vec AuditLog) query;
|
|
67
|
+
getRecentAuditLogs: (limit: nat) -> (vec AuditLog) query;
|
|
68
|
+
getStorageStats: () ->
|
|
69
|
+
(record {
|
|
70
|
+
averageFileSizeBytes: nat;
|
|
71
|
+
totalDocuments: nat;
|
|
72
|
+
totalSizeBytes: nat;
|
|
73
|
+
verifiedDocuments: nat;
|
|
74
|
+
}) query;
|
|
75
|
+
getTransactionDocuments: (transactionId: text) -> (vec DocumentProof) query;
|
|
76
|
+
getTransactionManagerCanister: () -> (opt principal) query;
|
|
77
|
+
getUserManagementCanister: () -> (opt principal) query;
|
|
78
|
+
markDocumentDeleted: (documentId: nat, csrfToken: text) -> (Result_1);
|
|
79
|
+
registerDocumentProof: (fileName: text, fileHash: text, fileSize: nat,
|
|
80
|
+
contentType: text, storageLocation: text, transactionId: opt text,
|
|
81
|
+
docType: text, csrfToken: text) -> (Result_2);
|
|
82
|
+
setTransactionManagerCanister: (canisterId: principal, csrfToken: text) ->
|
|
83
|
+
(Result_1);
|
|
84
|
+
setUserManagementCanister: (canisterId: principal, csrfToken: text) ->
|
|
85
|
+
(Result_1);
|
|
86
|
+
validateCSRFToken: (token: text) -> (bool);
|
|
87
|
+
verifyDocumentHash: (documentId: nat, providedHash: text, csrfToken:
|
|
88
|
+
text) -> (Result);
|
|
89
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { Principal } from '@dfinity/principal';
|
|
2
|
+
import type { ActorMethod } from '@dfinity/agent';
|
|
3
|
+
import type { IDL } from '@dfinity/candid';
|
|
4
|
+
|
|
5
|
+
export interface AuditLog {
|
|
6
|
+
'id' : bigint,
|
|
7
|
+
'action' : string,
|
|
8
|
+
'metadata' : string,
|
|
9
|
+
'timestamp' : Time,
|
|
10
|
+
'success' : boolean,
|
|
11
|
+
'documentId' : bigint,
|
|
12
|
+
'actorPrincipal' : Principal,
|
|
13
|
+
}
|
|
14
|
+
export interface DocumentProof {
|
|
15
|
+
'id' : bigint,
|
|
16
|
+
'verified' : boolean,
|
|
17
|
+
'contentType' : string,
|
|
18
|
+
'fileHash' : string,
|
|
19
|
+
'fileName' : string,
|
|
20
|
+
'fileSize' : bigint,
|
|
21
|
+
'storageLocation' : string,
|
|
22
|
+
'docType' : string,
|
|
23
|
+
'uploadedAt' : Time,
|
|
24
|
+
'uploadedBy' : Principal,
|
|
25
|
+
'transactionId' : [] | [string],
|
|
26
|
+
}
|
|
27
|
+
export type Result = { 'ok' : boolean } |
|
|
28
|
+
{ 'err' : string };
|
|
29
|
+
export type Result_1 = { 'ok' : string } |
|
|
30
|
+
{ 'err' : string };
|
|
31
|
+
export type Result_2 = { 'ok' : bigint } |
|
|
32
|
+
{ 'err' : string };
|
|
33
|
+
export type Result_3 = {
|
|
34
|
+
'ok' : {
|
|
35
|
+
'id' : bigint,
|
|
36
|
+
'contentType' : string,
|
|
37
|
+
'fileHash' : string,
|
|
38
|
+
'fileName' : string,
|
|
39
|
+
'fileSize' : bigint,
|
|
40
|
+
'totalChunks' : bigint,
|
|
41
|
+
'docType' : string,
|
|
42
|
+
'uploadedAt' : bigint,
|
|
43
|
+
'uploadedBy' : Principal,
|
|
44
|
+
'transactionId' : [] | [string],
|
|
45
|
+
}
|
|
46
|
+
} |
|
|
47
|
+
{ 'err' : string };
|
|
48
|
+
export type Time = bigint;
|
|
49
|
+
export interface _SERVICE {
|
|
50
|
+
'deleteDocument' : ActorMethod<[bigint, string], Result_1>,
|
|
51
|
+
'generateCSRFToken' : ActorMethod<[], string>,
|
|
52
|
+
'getAuditLogs' : ActorMethod<[bigint], Array<AuditLog>>,
|
|
53
|
+
'getCSRFToken' : ActorMethod<[], [] | [string]>,
|
|
54
|
+
'getCycles' : ActorMethod<[], bigint>,
|
|
55
|
+
'getDocumentMetadata' : ActorMethod<[bigint], Result_3>,
|
|
56
|
+
'getDocumentProof' : ActorMethod<[bigint], [] | [DocumentProof]>,
|
|
57
|
+
'getMyAuditLogs' : ActorMethod<[Principal], Array<AuditLog>>,
|
|
58
|
+
'getRecentAuditLogs' : ActorMethod<[bigint], Array<AuditLog>>,
|
|
59
|
+
'getStorageStats' : ActorMethod<
|
|
60
|
+
[],
|
|
61
|
+
{
|
|
62
|
+
'averageFileSizeBytes' : bigint,
|
|
63
|
+
'totalSizeBytes' : bigint,
|
|
64
|
+
'verifiedDocuments' : bigint,
|
|
65
|
+
'totalDocuments' : bigint,
|
|
66
|
+
}
|
|
67
|
+
>,
|
|
68
|
+
'getTransactionDocuments' : ActorMethod<[string], Array<DocumentProof>>,
|
|
69
|
+
'getTransactionManagerCanister' : ActorMethod<[], [] | [Principal]>,
|
|
70
|
+
'getUserManagementCanister' : ActorMethod<[], [] | [Principal]>,
|
|
71
|
+
'markDocumentDeleted' : ActorMethod<[bigint, string], Result_1>,
|
|
72
|
+
'registerDocumentProof' : ActorMethod<
|
|
73
|
+
[string, string, bigint, string, string, [] | [string], string, string],
|
|
74
|
+
Result_2
|
|
75
|
+
>,
|
|
76
|
+
'setTransactionManagerCanister' : ActorMethod<[Principal, string], Result_1>,
|
|
77
|
+
'setUserManagementCanister' : ActorMethod<[Principal, string], Result_1>,
|
|
78
|
+
'validateCSRFToken' : ActorMethod<[string], boolean>,
|
|
79
|
+
'verifyDocumentHash' : ActorMethod<[bigint, string, string], Result>,
|
|
80
|
+
}
|
|
81
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
82
|
+
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
export const idlFactory = ({ IDL }) => {
|
|
2
|
+
const Result_1 = IDL.Variant({ 'ok' : IDL.Text, 'err' : IDL.Text });
|
|
3
|
+
const Time = IDL.Int;
|
|
4
|
+
const AuditLog = IDL.Record({
|
|
5
|
+
'id' : IDL.Nat,
|
|
6
|
+
'action' : IDL.Text,
|
|
7
|
+
'metadata' : IDL.Text,
|
|
8
|
+
'timestamp' : Time,
|
|
9
|
+
'success' : IDL.Bool,
|
|
10
|
+
'documentId' : IDL.Nat,
|
|
11
|
+
'actorPrincipal' : IDL.Principal,
|
|
12
|
+
});
|
|
13
|
+
const Result_3 = IDL.Variant({
|
|
14
|
+
'ok' : IDL.Record({
|
|
15
|
+
'id' : IDL.Nat,
|
|
16
|
+
'contentType' : IDL.Text,
|
|
17
|
+
'fileHash' : IDL.Text,
|
|
18
|
+
'fileName' : IDL.Text,
|
|
19
|
+
'fileSize' : IDL.Nat,
|
|
20
|
+
'totalChunks' : IDL.Nat,
|
|
21
|
+
'docType' : IDL.Text,
|
|
22
|
+
'uploadedAt' : IDL.Int,
|
|
23
|
+
'uploadedBy' : IDL.Principal,
|
|
24
|
+
'transactionId' : IDL.Opt(IDL.Text),
|
|
25
|
+
}),
|
|
26
|
+
'err' : IDL.Text,
|
|
27
|
+
});
|
|
28
|
+
const DocumentProof = IDL.Record({
|
|
29
|
+
'id' : IDL.Nat,
|
|
30
|
+
'verified' : IDL.Bool,
|
|
31
|
+
'contentType' : IDL.Text,
|
|
32
|
+
'fileHash' : IDL.Text,
|
|
33
|
+
'fileName' : IDL.Text,
|
|
34
|
+
'fileSize' : IDL.Nat,
|
|
35
|
+
'storageLocation' : IDL.Text,
|
|
36
|
+
'docType' : IDL.Text,
|
|
37
|
+
'uploadedAt' : Time,
|
|
38
|
+
'uploadedBy' : IDL.Principal,
|
|
39
|
+
'transactionId' : IDL.Opt(IDL.Text),
|
|
40
|
+
});
|
|
41
|
+
const Result_2 = IDL.Variant({ 'ok' : IDL.Nat, 'err' : IDL.Text });
|
|
42
|
+
const Result = IDL.Variant({ 'ok' : IDL.Bool, 'err' : IDL.Text });
|
|
43
|
+
return IDL.Service({
|
|
44
|
+
'deleteDocument' : IDL.Func([IDL.Nat, IDL.Text], [Result_1], []),
|
|
45
|
+
'generateCSRFToken' : IDL.Func([], [IDL.Text], []),
|
|
46
|
+
'getAuditLogs' : IDL.Func([IDL.Nat], [IDL.Vec(AuditLog)], ['query']),
|
|
47
|
+
'getCSRFToken' : IDL.Func([], [IDL.Opt(IDL.Text)], ['query']),
|
|
48
|
+
'getCycles' : IDL.Func([], [IDL.Nat], ['query']),
|
|
49
|
+
'getDocumentMetadata' : IDL.Func([IDL.Nat], [Result_3], ['query']),
|
|
50
|
+
'getDocumentProof' : IDL.Func(
|
|
51
|
+
[IDL.Nat],
|
|
52
|
+
[IDL.Opt(DocumentProof)],
|
|
53
|
+
['query'],
|
|
54
|
+
),
|
|
55
|
+
'getMyAuditLogs' : IDL.Func(
|
|
56
|
+
[IDL.Principal],
|
|
57
|
+
[IDL.Vec(AuditLog)],
|
|
58
|
+
['query'],
|
|
59
|
+
),
|
|
60
|
+
'getRecentAuditLogs' : IDL.Func([IDL.Nat], [IDL.Vec(AuditLog)], ['query']),
|
|
61
|
+
'getStorageStats' : IDL.Func(
|
|
62
|
+
[],
|
|
63
|
+
[
|
|
64
|
+
IDL.Record({
|
|
65
|
+
'averageFileSizeBytes' : IDL.Nat,
|
|
66
|
+
'totalSizeBytes' : IDL.Nat,
|
|
67
|
+
'verifiedDocuments' : IDL.Nat,
|
|
68
|
+
'totalDocuments' : IDL.Nat,
|
|
69
|
+
}),
|
|
70
|
+
],
|
|
71
|
+
['query'],
|
|
72
|
+
),
|
|
73
|
+
'getTransactionDocuments' : IDL.Func(
|
|
74
|
+
[IDL.Text],
|
|
75
|
+
[IDL.Vec(DocumentProof)],
|
|
76
|
+
['query'],
|
|
77
|
+
),
|
|
78
|
+
'getTransactionManagerCanister' : IDL.Func(
|
|
79
|
+
[],
|
|
80
|
+
[IDL.Opt(IDL.Principal)],
|
|
81
|
+
['query'],
|
|
82
|
+
),
|
|
83
|
+
'getUserManagementCanister' : IDL.Func(
|
|
84
|
+
[],
|
|
85
|
+
[IDL.Opt(IDL.Principal)],
|
|
86
|
+
['query'],
|
|
87
|
+
),
|
|
88
|
+
'markDocumentDeleted' : IDL.Func([IDL.Nat, IDL.Text], [Result_1], []),
|
|
89
|
+
'registerDocumentProof' : IDL.Func(
|
|
90
|
+
[
|
|
91
|
+
IDL.Text,
|
|
92
|
+
IDL.Text,
|
|
93
|
+
IDL.Nat,
|
|
94
|
+
IDL.Text,
|
|
95
|
+
IDL.Text,
|
|
96
|
+
IDL.Opt(IDL.Text),
|
|
97
|
+
IDL.Text,
|
|
98
|
+
IDL.Text,
|
|
99
|
+
],
|
|
100
|
+
[Result_2],
|
|
101
|
+
[],
|
|
102
|
+
),
|
|
103
|
+
'setTransactionManagerCanister' : IDL.Func(
|
|
104
|
+
[IDL.Principal, IDL.Text],
|
|
105
|
+
[Result_1],
|
|
106
|
+
[],
|
|
107
|
+
),
|
|
108
|
+
'setUserManagementCanister' : IDL.Func(
|
|
109
|
+
[IDL.Principal, IDL.Text],
|
|
110
|
+
[Result_1],
|
|
111
|
+
[],
|
|
112
|
+
),
|
|
113
|
+
'validateCSRFToken' : IDL.Func([IDL.Text], [IDL.Bool], []),
|
|
114
|
+
'verifyDocumentHash' : IDL.Func(
|
|
115
|
+
[IDL.Nat, IDL.Text, IDL.Text],
|
|
116
|
+
[Result],
|
|
117
|
+
[],
|
|
118
|
+
),
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
export const init = ({ IDL }) => { return []; };
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
type VerificationStatus =
|
|
2
|
+
variant {
|
|
3
|
+
failed;
|
|
4
|
+
pending;
|
|
5
|
+
verified;
|
|
6
|
+
};
|
|
7
|
+
type UserLedgerEntry =
|
|
8
|
+
record {
|
|
9
|
+
accountID: text;
|
|
10
|
+
completedDate: opt Time;
|
|
11
|
+
costsSaved: nat;
|
|
12
|
+
counterparties: vec Counterparty;
|
|
13
|
+
documentStatus: DocumentVerification;
|
|
14
|
+
entryID: text;
|
|
15
|
+
initiatedDate: Time;
|
|
16
|
+
propertyAddress: text;
|
|
17
|
+
propertyValue: nat;
|
|
18
|
+
roleInTransaction: TransactionRole;
|
|
19
|
+
status: TransactionStatus;
|
|
20
|
+
transactionID: text;
|
|
21
|
+
};
|
|
22
|
+
type UserAccount =
|
|
23
|
+
record {
|
|
24
|
+
accountID: text;
|
|
25
|
+
accountType: AccountType;
|
|
26
|
+
companyName: opt text;
|
|
27
|
+
email: text;
|
|
28
|
+
isActive: bool;
|
|
29
|
+
name: text;
|
|
30
|
+
registrationDate: Time;
|
|
31
|
+
taxID: opt text;
|
|
32
|
+
};
|
|
33
|
+
type TransactionStatus =
|
|
34
|
+
variant {
|
|
35
|
+
active;
|
|
36
|
+
completed;
|
|
37
|
+
failed;
|
|
38
|
+
pending;
|
|
39
|
+
};
|
|
40
|
+
type TransactionRole =
|
|
41
|
+
variant {
|
|
42
|
+
agent;
|
|
43
|
+
buyer;
|
|
44
|
+
seller;
|
|
45
|
+
solicitor;
|
|
46
|
+
};
|
|
47
|
+
type Time = int;
|
|
48
|
+
type TeamPermissions =
|
|
49
|
+
record {
|
|
50
|
+
canInitiate: bool;
|
|
51
|
+
canManageTeam: bool;
|
|
52
|
+
canSign: bool;
|
|
53
|
+
canViewAnalytics: bool;
|
|
54
|
+
};
|
|
55
|
+
type TeamMemberRole =
|
|
56
|
+
variant {
|
|
57
|
+
admin;
|
|
58
|
+
manager;
|
|
59
|
+
viewer;
|
|
60
|
+
};
|
|
61
|
+
type Result =
|
|
62
|
+
variant {
|
|
63
|
+
err: text;
|
|
64
|
+
ok: text;
|
|
65
|
+
};
|
|
66
|
+
type DocumentVerification =
|
|
67
|
+
record {
|
|
68
|
+
landRegistryConfirm: VerificationStatus;
|
|
69
|
+
mortgageApproval: VerificationStatus;
|
|
70
|
+
propertyDeed: VerificationStatus;
|
|
71
|
+
surveyReport: VerificationStatus;
|
|
72
|
+
};
|
|
73
|
+
type Counterparty =
|
|
74
|
+
record {
|
|
75
|
+
accountID: text;
|
|
76
|
+
name: text;
|
|
77
|
+
};
|
|
78
|
+
type CompanyTeamMember =
|
|
79
|
+
record {
|
|
80
|
+
accountID: text;
|
|
81
|
+
email: text;
|
|
82
|
+
joinDate: Time;
|
|
83
|
+
memberID: text;
|
|
84
|
+
name: text;
|
|
85
|
+
permissions: TeamPermissions;
|
|
86
|
+
role: TeamMemberRole;
|
|
87
|
+
};
|
|
88
|
+
type CompanyLedger =
|
|
89
|
+
record {
|
|
90
|
+
activeTransactions: nat;
|
|
91
|
+
avgCompletionTime: nat;
|
|
92
|
+
companyAccountID: text;
|
|
93
|
+
completedThisMonth: nat;
|
|
94
|
+
costSavings: nat;
|
|
95
|
+
teamMemberCount: nat;
|
|
96
|
+
totalTransactions: nat;
|
|
97
|
+
};
|
|
98
|
+
type BlockchainEfficiencyMetrics =
|
|
99
|
+
record {
|
|
100
|
+
avgBlockchainCompletionDays: nat;
|
|
101
|
+
avgBlockchainCost: nat;
|
|
102
|
+
avgTraditionalCompletionDays: nat;
|
|
103
|
+
avgTraditionalCost: nat;
|
|
104
|
+
costReductionPercent: nat;
|
|
105
|
+
timeReductionPercent: nat;
|
|
106
|
+
totalCostSaved: nat;
|
|
107
|
+
totalTimeSavedDays: nat;
|
|
108
|
+
transactionsCompleted: nat;
|
|
109
|
+
};
|
|
110
|
+
type Analytics =
|
|
111
|
+
record {
|
|
112
|
+
avgCompletionTime: nat;
|
|
113
|
+
completedTransactions: nat;
|
|
114
|
+
period: text;
|
|
115
|
+
totalCostSavings: nat;
|
|
116
|
+
totalTransactions: nat;
|
|
117
|
+
transactionVolume: nat;
|
|
118
|
+
};
|
|
119
|
+
type AccountType =
|
|
120
|
+
variant {
|
|
121
|
+
company;
|
|
122
|
+
individual;
|
|
123
|
+
};
|
|
124
|
+
service : {
|
|
125
|
+
addTransactionToLedger: (accountID: text, transactionID: text,
|
|
126
|
+
roleInTransaction: TransactionRole, propertyAddress: text, propertyValue:
|
|
127
|
+
nat, counterparties: vec Counterparty) -> (bool);
|
|
128
|
+
createCompanyTeamMember: (companyID: text, name: text, email: text, role:
|
|
129
|
+
TeamMemberRole, permissions: TeamPermissions) -> (text);
|
|
130
|
+
createUserAccount: (name: text, email: text, accountType: AccountType,
|
|
131
|
+
companyName: opt text, taxID: opt text) -> (text);
|
|
132
|
+
getBlockchainEfficiencyMetrics: (accountID: text) ->
|
|
133
|
+
(BlockchainEfficiencyMetrics) query;
|
|
134
|
+
getCompanyLedger: (companyAccountID: text) -> (CompanyLedger) query;
|
|
135
|
+
getCompanyTeamMembers: (companyAccountID: text) ->
|
|
136
|
+
(vec CompanyTeamMember) query;
|
|
137
|
+
getCycles: () -> (nat) query;
|
|
138
|
+
getGlobalBlockchainStats: () -> (BlockchainEfficiencyMetrics) query;
|
|
139
|
+
getLedgerAnalytics: (accountID: text, period: text) -> (Analytics) query;
|
|
140
|
+
getMyAccount: () -> (opt UserAccount) query;
|
|
141
|
+
getMyLedger: () -> (vec UserLedgerEntry) query;
|
|
142
|
+
getUserAccount: (accountID: text) -> (opt UserAccount) query;
|
|
143
|
+
getUserLedger: (accountID: text) -> (vec UserLedgerEntry) query;
|
|
144
|
+
setDocumentVerificationCanister: (canisterId: principal) -> ();
|
|
145
|
+
setPropertyRegistryCanister: (canisterId: principal) -> ();
|
|
146
|
+
setTransactionManagerCanister: (canisterId: principal) -> ();
|
|
147
|
+
setUserManagementCanister: (canisterId: principal) -> ();
|
|
148
|
+
syncTransactionToLedger: (transactionId: nat, userPrincipal: principal) ->
|
|
149
|
+
(Result);
|
|
150
|
+
updateTeamMemberPermissions: (companyID: text, memberID: text, permissions:
|
|
151
|
+
TeamPermissions) -> (bool);
|
|
152
|
+
updateTransactionStatus: (transactionID: text, accountID: text, newStatus:
|
|
153
|
+
TransactionStatus) -> (bool);
|
|
154
|
+
}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import type { Principal } from '@dfinity/principal';
|
|
2
|
+
import type { ActorMethod } from '@dfinity/agent';
|
|
3
|
+
import type { IDL } from '@dfinity/candid';
|
|
4
|
+
|
|
5
|
+
export type AccountType = { 'company' : null } |
|
|
6
|
+
{ 'individual' : null };
|
|
7
|
+
export interface Analytics {
|
|
8
|
+
'transactionVolume' : bigint,
|
|
9
|
+
'avgCompletionTime' : bigint,
|
|
10
|
+
'period' : string,
|
|
11
|
+
'totalCostSavings' : bigint,
|
|
12
|
+
'completedTransactions' : bigint,
|
|
13
|
+
'totalTransactions' : bigint,
|
|
14
|
+
}
|
|
15
|
+
export interface BlockchainEfficiencyMetrics {
|
|
16
|
+
'avgBlockchainCompletionDays' : bigint,
|
|
17
|
+
'totalCostSaved' : bigint,
|
|
18
|
+
'avgTraditionalCompletionDays' : bigint,
|
|
19
|
+
'timeReductionPercent' : bigint,
|
|
20
|
+
'avgTraditionalCost' : bigint,
|
|
21
|
+
'avgBlockchainCost' : bigint,
|
|
22
|
+
'transactionsCompleted' : bigint,
|
|
23
|
+
'costReductionPercent' : bigint,
|
|
24
|
+
'totalTimeSavedDays' : bigint,
|
|
25
|
+
}
|
|
26
|
+
export interface CompanyLedger {
|
|
27
|
+
'companyAccountID' : string,
|
|
28
|
+
'avgCompletionTime' : bigint,
|
|
29
|
+
'costSavings' : bigint,
|
|
30
|
+
'completedThisMonth' : bigint,
|
|
31
|
+
'activeTransactions' : bigint,
|
|
32
|
+
'teamMemberCount' : bigint,
|
|
33
|
+
'totalTransactions' : bigint,
|
|
34
|
+
}
|
|
35
|
+
export interface CompanyTeamMember {
|
|
36
|
+
'memberID' : string,
|
|
37
|
+
'permissions' : TeamPermissions,
|
|
38
|
+
'accountID' : string,
|
|
39
|
+
'joinDate' : Time,
|
|
40
|
+
'name' : string,
|
|
41
|
+
'role' : TeamMemberRole,
|
|
42
|
+
'email' : string,
|
|
43
|
+
}
|
|
44
|
+
export interface Counterparty { 'accountID' : string, 'name' : string }
|
|
45
|
+
export interface DocumentVerification {
|
|
46
|
+
'mortgageApproval' : VerificationStatus,
|
|
47
|
+
'propertyDeed' : VerificationStatus,
|
|
48
|
+
'landRegistryConfirm' : VerificationStatus,
|
|
49
|
+
'surveyReport' : VerificationStatus,
|
|
50
|
+
}
|
|
51
|
+
export type Result = { 'ok' : string } |
|
|
52
|
+
{ 'err' : string };
|
|
53
|
+
export type TeamMemberRole = { 'manager' : null } |
|
|
54
|
+
{ 'admin' : null } |
|
|
55
|
+
{ 'viewer' : null };
|
|
56
|
+
export interface TeamPermissions {
|
|
57
|
+
'canSign' : boolean,
|
|
58
|
+
'canInitiate' : boolean,
|
|
59
|
+
'canViewAnalytics' : boolean,
|
|
60
|
+
'canManageTeam' : boolean,
|
|
61
|
+
}
|
|
62
|
+
export type Time = bigint;
|
|
63
|
+
export type TransactionRole = { 'agent' : null } |
|
|
64
|
+
{ 'solicitor' : null } |
|
|
65
|
+
{ 'seller' : null } |
|
|
66
|
+
{ 'buyer' : null };
|
|
67
|
+
export type TransactionStatus = { 'active' : null } |
|
|
68
|
+
{ 'pending' : null } |
|
|
69
|
+
{ 'completed' : null } |
|
|
70
|
+
{ 'failed' : null };
|
|
71
|
+
export interface UserAccount {
|
|
72
|
+
'taxID' : [] | [string],
|
|
73
|
+
'accountID' : string,
|
|
74
|
+
'name' : string,
|
|
75
|
+
'isActive' : boolean,
|
|
76
|
+
'email' : string,
|
|
77
|
+
'accountType' : AccountType,
|
|
78
|
+
'companyName' : [] | [string],
|
|
79
|
+
'registrationDate' : Time,
|
|
80
|
+
}
|
|
81
|
+
export interface UserLedgerEntry {
|
|
82
|
+
'completedDate' : [] | [Time],
|
|
83
|
+
'initiatedDate' : Time,
|
|
84
|
+
'status' : TransactionStatus,
|
|
85
|
+
'accountID' : string,
|
|
86
|
+
'documentStatus' : DocumentVerification,
|
|
87
|
+
'costsSaved' : bigint,
|
|
88
|
+
'propertyAddress' : string,
|
|
89
|
+
'entryID' : string,
|
|
90
|
+
'propertyValue' : bigint,
|
|
91
|
+
'roleInTransaction' : TransactionRole,
|
|
92
|
+
'counterparties' : Array<Counterparty>,
|
|
93
|
+
'transactionID' : string,
|
|
94
|
+
}
|
|
95
|
+
export type VerificationStatus = { 'verified' : null } |
|
|
96
|
+
{ 'pending' : null } |
|
|
97
|
+
{ 'failed' : null };
|
|
98
|
+
export interface _SERVICE {
|
|
99
|
+
'addTransactionToLedger' : ActorMethod<
|
|
100
|
+
[string, string, TransactionRole, string, bigint, Array<Counterparty>],
|
|
101
|
+
boolean
|
|
102
|
+
>,
|
|
103
|
+
'createCompanyTeamMember' : ActorMethod<
|
|
104
|
+
[string, string, string, TeamMemberRole, TeamPermissions],
|
|
105
|
+
string
|
|
106
|
+
>,
|
|
107
|
+
'createUserAccount' : ActorMethod<
|
|
108
|
+
[string, string, AccountType, [] | [string], [] | [string]],
|
|
109
|
+
string
|
|
110
|
+
>,
|
|
111
|
+
'getBlockchainEfficiencyMetrics' : ActorMethod<
|
|
112
|
+
[string],
|
|
113
|
+
BlockchainEfficiencyMetrics
|
|
114
|
+
>,
|
|
115
|
+
'getCompanyLedger' : ActorMethod<[string], CompanyLedger>,
|
|
116
|
+
'getCompanyTeamMembers' : ActorMethod<[string], Array<CompanyTeamMember>>,
|
|
117
|
+
'getCycles' : ActorMethod<[], bigint>,
|
|
118
|
+
'getGlobalBlockchainStats' : ActorMethod<[], BlockchainEfficiencyMetrics>,
|
|
119
|
+
'getLedgerAnalytics' : ActorMethod<[string, string], Analytics>,
|
|
120
|
+
'getMyAccount' : ActorMethod<[], [] | [UserAccount]>,
|
|
121
|
+
'getMyLedger' : ActorMethod<[], Array<UserLedgerEntry>>,
|
|
122
|
+
'getUserAccount' : ActorMethod<[string], [] | [UserAccount]>,
|
|
123
|
+
'getUserLedger' : ActorMethod<[string], Array<UserLedgerEntry>>,
|
|
124
|
+
'setDocumentVerificationCanister' : ActorMethod<[Principal], undefined>,
|
|
125
|
+
'setPropertyRegistryCanister' : ActorMethod<[Principal], undefined>,
|
|
126
|
+
'setTransactionManagerCanister' : ActorMethod<[Principal], undefined>,
|
|
127
|
+
'setUserManagementCanister' : ActorMethod<[Principal], undefined>,
|
|
128
|
+
'syncTransactionToLedger' : ActorMethod<[bigint, Principal], Result>,
|
|
129
|
+
'updateTeamMemberPermissions' : ActorMethod<
|
|
130
|
+
[string, string, TeamPermissions],
|
|
131
|
+
boolean
|
|
132
|
+
>,
|
|
133
|
+
'updateTransactionStatus' : ActorMethod<
|
|
134
|
+
[string, string, TransactionStatus],
|
|
135
|
+
boolean
|
|
136
|
+
>,
|
|
137
|
+
}
|
|
138
|
+
export declare const idlFactory: IDL.InterfaceFactory;
|
|
139
|
+
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|