@propxchain/core-client 0.2.1-canary.20 → 0.2.1-canary.22

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.
Files changed (40) hide show
  1. package/dist/canisters/document_storage/document_storage.did.d.ts.map +1 -1
  2. package/dist/canisters/document_storage/document_storage.did.js +90 -21
  3. package/dist/canisters/document_storage/document_storage.did.js.map +1 -1
  4. package/dist/canisters/document_verification/document_verification.did.d.ts.map +1 -1
  5. package/dist/canisters/document_verification/document_verification.did.js +132 -0
  6. package/dist/canisters/document_verification/document_verification.did.js.map +1 -1
  7. package/dist/canisters/email_service/email_service.did.d.ts.map +1 -1
  8. package/dist/canisters/email_service/email_service.did.js +40 -0
  9. package/dist/canisters/email_service/email_service.did.js.map +1 -1
  10. package/dist/canisters/land_registry_integration/land_registry_integration.did.d.ts.map +1 -1
  11. package/dist/canisters/land_registry_integration/land_registry_integration.did.js +186 -12
  12. package/dist/canisters/land_registry_integration/land_registry_integration.did.js.map +1 -1
  13. package/dist/canisters/ledger_manager/ledger_manager.did.d.ts.map +1 -1
  14. package/dist/canisters/ledger_manager/ledger_manager.did.js +55 -2
  15. package/dist/canisters/ledger_manager/ledger_manager.did.js.map +1 -1
  16. package/dist/canisters/user_management/user_management.did.d.ts.map +1 -1
  17. package/dist/canisters/user_management/user_management.did.js +103 -20
  18. package/dist/canisters/user_management/user_management.did.js.map +1 -1
  19. package/package.json +1 -1
  20. package/src/canisters/document_storage/document_storage.did +82 -12
  21. package/src/canisters/document_storage/document_storage.did.d.ts +89 -12
  22. package/src/canisters/document_storage/document_storage.did.js +128 -19
  23. package/src/canisters/document_verification/document_verification.did +150 -0
  24. package/src/canisters/document_verification/document_verification.did.d.ts +128 -4
  25. package/src/canisters/document_verification/document_verification.did.js +160 -0
  26. package/src/canisters/email_service/email_service.did +49 -0
  27. package/src/canisters/email_service/email_service.did.d.ts +52 -5
  28. package/src/canisters/email_service/email_service.did.js +68 -0
  29. package/src/canisters/land_registry_integration/land_registry_integration.did +239 -13
  30. package/src/canisters/land_registry_integration/land_registry_integration.did.d.ts +188 -14
  31. package/src/canisters/land_registry_integration/land_registry_integration.did.js +213 -11
  32. package/src/canisters/ledger_manager/ledger_manager.did +77 -6
  33. package/src/canisters/ledger_manager/ledger_manager.did.d.ts +68 -5
  34. package/src/canisters/ledger_manager/ledger_manager.did.js +71 -2
  35. package/src/canisters/property_registry/property_registry.did.d.ts +3 -3
  36. package/src/canisters/transaction_manager/transaction_manager.did +27 -0
  37. package/src/canisters/transaction_manager/transaction_manager.did.d.ts +29 -0
  38. package/src/canisters/user_management/user_management.did +127 -25
  39. package/src/canisters/user_management/user_management.did.d.ts +100 -24
  40. package/src/canisters/user_management/user_management.did.js +135 -20
@@ -76,7 +76,84 @@ export const idlFactory = ({ IDL }) => {
76
76
  'apiKey' : IDL.Text,
77
77
  'environment' : Environment,
78
78
  });
79
- const Result_1 = IDL.Variant({ 'ok' : IDL.Text, 'err' : IDL.Text });
79
+ const Result_2 = IDL.Variant({ 'ok' : IDL.Text, 'err' : IDL.Text });
80
+ const ApplicationEnquiryResponse = IDL.Record({
81
+ 'completedDate' : IDL.Opt(IDL.Text),
82
+ 'status' : IDL.Text,
83
+ 'httpStatus' : IDL.Nat,
84
+ 'lastUpdated' : IDL.Text,
85
+ 'applicationReference' : IDL.Text,
86
+ 'notes' : IDL.Vec(IDL.Text),
87
+ 'applicationDate' : IDL.Text,
88
+ });
89
+ const Result_12 = IDL.Variant({
90
+ 'ok' : ApplicationEnquiryResponse,
91
+ 'err' : IDL.Text,
92
+ });
93
+ const ActorType = IDL.Variant({
94
+ 'agent' : IDL.Null,
95
+ 'systemActor' : IDL.Null,
96
+ 'user' : IDL.Null,
97
+ });
98
+ const AuditEntry = IDL.Record({
99
+ 'action' : IDL.Text,
100
+ 'actorType' : ActorType,
101
+ 'delegatedBy' : IDL.Opt(IDL.Principal),
102
+ 'timestamp' : IDL.Int,
103
+ 'details' : IDL.Text,
104
+ 'caller' : IDL.Principal,
105
+ 'success' : IDL.Bool,
106
+ });
107
+ const CredentialStatus = IDL.Record({
108
+ 'isExpired' : IDL.Bool,
109
+ 'isConfigured' : IDL.Bool,
110
+ 'lastRotated' : IDL.Opt(IDL.Int),
111
+ 'environment' : IDL.Opt(Environment),
112
+ 'daysSinceRotation' : IDL.Opt(IDL.Nat),
113
+ });
114
+ const ECDResponse = IDL.Record({
115
+ 'httpStatus' : IDL.Nat,
116
+ 'applicationReference' : IDL.Text,
117
+ 'estimatedCompletionDate' : IDL.Text,
118
+ 'confidence' : IDL.Opt(IDL.Text),
119
+ });
120
+ const Result_11 = IDL.Variant({ 'ok' : ECDResponse, 'err' : IDL.Text });
121
+ const RateLimitInfo = IDL.Record({
122
+ 'callsThisHour' : IDL.Nat,
123
+ 'endpoint' : IDL.Text,
124
+ 'dayResetAt' : IDL.Int,
125
+ 'lastCallAt' : IDL.Int,
126
+ 'callsToday' : IDL.Nat,
127
+ 'hourResetAt' : IDL.Int,
128
+ });
129
+ const ProprietorData = IDL.Record({
130
+ 'title' : IDL.Opt(IDL.Text),
131
+ 'decoration' : IDL.Opt(IDL.Text),
132
+ 'forenames' : IDL.Opt(IDL.Text),
133
+ 'surname' : IDL.Opt(IDL.Text),
134
+ 'companyLocation' : IDL.Opt(IDL.Text),
135
+ 'organisationType' : IDL.Opt(IDL.Text),
136
+ 'proprietorName' : IDL.Text,
137
+ 'sequence' : IDL.Nat,
138
+ 'proprietorType' : IDL.Text,
139
+ });
140
+ const ProprietorNamesResponse = IDL.Record({
141
+ 'httpStatus' : IDL.Nat,
142
+ 'titleStatusCode' : IDL.Text,
143
+ 'titleNumber' : IDL.Text,
144
+ 'proprietors' : IDL.Vec(ProprietorData),
145
+ 'titleStatus' : IDL.Text,
146
+ });
147
+ const Result_10 = IDL.Variant({
148
+ 'ok' : ProprietorNamesResponse,
149
+ 'err' : IDL.Text,
150
+ });
151
+ const CostSummary = IDL.Record({
152
+ 'entryCount' : IDL.Nat,
153
+ 'byEndpoint' : IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat)),
154
+ 'totalPence' : IDL.Nat,
155
+ 'byTransaction' : IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat)),
156
+ });
80
157
  const Period = IDL.Variant({
81
158
  'day' : IDL.Null,
82
159
  'month' : IDL.Null,
@@ -90,15 +167,87 @@ export const idlFactory = ({ IDL }) => {
90
167
  'successful' : IDL.Nat32,
91
168
  'failed' : IDL.Nat32,
92
169
  });
93
- const Result_4 = IDL.Variant({
170
+ const Result_9 = IDL.Variant({
94
171
  'ok' : LandRegistryAPIResponse,
95
172
  'err' : IDL.Text,
96
173
  });
97
- const Result_3 = IDL.Variant({ 'ok' : IDL.Nat32, 'err' : IDL.Text });
98
- const Result_2 = IDL.Variant({
174
+ const Result_8 = IDL.Variant({ 'ok' : IDL.Nat32, 'err' : IDL.Text });
175
+ const LRNotification = IDL.Record({
176
+ 'titleNumber' : IDL.Opt(IDL.Text),
177
+ 'metadata' : IDL.Vec(IDL.Tuple(IDL.Text, IDL.Text)),
178
+ 'notificationType' : IDL.Text,
179
+ 'applicationReference' : IDL.Opt(IDL.Text),
180
+ 'receivedAt' : IDL.Int,
181
+ 'message' : IDL.Text,
182
+ });
183
+ const Result_7 = IDL.Variant({
184
+ 'ok' : IDL.Vec(LRNotification),
185
+ 'err' : IDL.Text,
186
+ });
187
+ const Result_6 = IDL.Variant({
99
188
  'ok' : OwnershipTransferPayload,
100
189
  'err' : IDL.Text,
101
190
  });
191
+ const Result_5 = IDL.Variant({ 'ok' : IDL.Nat, 'err' : IDL.Text });
192
+ const OfficialSearchResponse = IDL.Record({
193
+ 'httpStatus' : IDL.Nat,
194
+ 'officialCopyTimestamp' : IDL.Opt(IDL.Text),
195
+ 'advisoryEntries' : IDL.Vec(IDL.Text),
196
+ 'documentStorageId' : IDL.Opt(IDL.Nat),
197
+ 'certificatePdfHash' : IDL.Opt(IDL.Text),
198
+ 'registeredProprietorNames' : IDL.Vec(IDL.Text),
199
+ 'certificateTimestamp' : IDL.Text,
200
+ 'resultContainsAdvisoryEntries' : IDL.Bool,
201
+ 'registerChangedSinceSearchFromDate' : IDL.Bool,
202
+ 'priorityExpiry' : IDL.Text,
203
+ 'searchRef' : IDL.Text,
204
+ });
205
+ const Result_4 = IDL.Variant({
206
+ 'ok' : OfficialSearchResponse,
207
+ 'err' : IDL.Text,
208
+ });
209
+ const Result_3 = IDL.Variant({ 'ok' : IDL.Null, 'err' : IDL.Text });
210
+ const AP1SubmissionRequest = IDL.Record({
211
+ 'transfereeNames' : IDL.Vec(IDL.Text),
212
+ 'transferAmount' : IDL.Nat,
213
+ 'transferDate' : IDL.Text,
214
+ 'titleNumber' : IDL.Text,
215
+ 'transfereeAddress' : IDL.Text,
216
+ 'propertyAddress' : IDL.Text,
217
+ 'transferorAddress' : IDL.Text,
218
+ 'blockchainProofHash' : IDL.Text,
219
+ 'propertyPostcode' : IDL.Text,
220
+ 'conveyancerReference' : IDL.Text,
221
+ 'conveyancerAddress' : IDL.Text,
222
+ 'conveyancerSRANumber' : IDL.Text,
223
+ 'officialSearchRef' : IDL.Text,
224
+ 'transfereeType' : IDL.Text,
225
+ 'conveyancerName' : IDL.Text,
226
+ 'transferorNames' : IDL.Vec(IDL.Text),
227
+ 'applicationType' : IDL.Text,
228
+ });
229
+ const AP1SubmissionResponse = IDL.Record({
230
+ 'httpStatus' : IDL.Nat,
231
+ 'applicationReference' : IDL.Text,
232
+ 'message' : IDL.Text,
233
+ 'confirmationNumber' : IDL.Text,
234
+ 'estimatedCompletionDate' : IDL.Opt(IDL.Text),
235
+ 'scaleFePence' : IDL.Nat,
236
+ });
237
+ const Result_1 = IDL.Variant({
238
+ 'ok' : AP1SubmissionResponse,
239
+ 'err' : IDL.Text,
240
+ });
241
+ const HttpHeader = IDL.Record({ 'value' : IDL.Text, 'name' : IDL.Text });
242
+ const HttpResponse = IDL.Record({
243
+ 'status' : IDL.Nat,
244
+ 'body' : IDL.Vec(IDL.Nat8),
245
+ 'headers' : IDL.Vec(HttpHeader),
246
+ });
247
+ const TransformArgs = IDL.Record({
248
+ 'context' : IDL.Vec(IDL.Nat8),
249
+ 'response' : HttpResponse,
250
+ });
102
251
  const Result = IDL.Variant({ 'ok' : IDL.Bool, 'err' : IDL.Text });
103
252
  return IDL.Service({
104
253
  'check_land_registry_status' : IDL.Func(
@@ -108,10 +257,33 @@ export const idlFactory = ({ IDL }) => {
108
257
  ),
109
258
  'configure_land_registry_api' : IDL.Func(
110
259
  [LandRegistryAPICredentials],
111
- [Result_1],
260
+ [Result_2],
112
261
  [],
113
262
  ),
263
+ 'getApplicationStatus' : IDL.Func([IDL.Text], [Result_12], []),
264
+ 'getAuditLog' : IDL.Func([], [IDL.Vec(AuditEntry)], ['query']),
265
+ 'getCredentialStatus' : IDL.Func([], [CredentialStatus], ['query']),
114
266
  'getCycles' : IDL.Func([], [IDL.Nat], ['query']),
267
+ 'getDailySpend' : IDL.Func([], [IDL.Nat], ['query']),
268
+ 'getEstimatedCompletionDate' : IDL.Func([IDL.Text], [Result_11], []),
269
+ 'getNotificationPollingStatus' : IDL.Func(
270
+ [],
271
+ [
272
+ IDL.Record({
273
+ 'enabled' : IDL.Bool,
274
+ 'intervalSeconds' : IDL.Nat,
275
+ 'lastPollAt' : IDL.Int,
276
+ }),
277
+ ],
278
+ ['query'],
279
+ ),
280
+ 'getRateLimitStatus' : IDL.Func(
281
+ [],
282
+ [IDL.Vec(IDL.Tuple(IDL.Text, RateLimitInfo))],
283
+ ['query'],
284
+ ),
285
+ 'getRegisteredProprietorNames' : IDL.Func([IDL.Text], [Result_10], []),
286
+ 'getTotalCosts' : IDL.Func([IDL.Int, IDL.Int], [CostSummary], ['query']),
115
287
  'get_all_pending_land_registry_submissions' : IDL.Func(
116
288
  [IDL.Text],
117
289
  [IDL.Vec(LandRegistryTransactionRecord)],
@@ -140,8 +312,9 @@ export const idlFactory = ({ IDL }) => {
140
312
  ],
141
313
  ['query'],
142
314
  ),
143
- 'get_lr_response' : IDL.Func([IDL.Text], [Result_4], ['query']),
144
- 'log_land_registry_error' : IDL.Func([IDL.Text, IDL.Text], [Result_3], []),
315
+ 'get_lr_response' : IDL.Func([IDL.Text], [Result_9], ['query']),
316
+ 'log_land_registry_error' : IDL.Func([IDL.Text, IDL.Text], [Result_8], []),
317
+ 'pollNotifications' : IDL.Func([], [Result_7], []),
145
318
  'prepare_ownership_transfer_payload' : IDL.Func(
146
319
  [
147
320
  IDL.Text,
@@ -160,21 +333,50 @@ export const idlFactory = ({ IDL }) => {
160
333
  IDL.Int,
161
334
  IDL.Int,
162
335
  ],
163
- [Result_2],
336
+ [Result_6],
164
337
  [],
165
338
  ),
166
339
  'receive_land_registry_callback' : IDL.Func(
167
340
  [LandRegistryAPIResponse],
168
- [Result_1],
341
+ [Result_2],
342
+ [],
343
+ ),
344
+ 'recordAuditEntry' : IDL.Func(
345
+ [ActorType, IDL.Opt(IDL.Principal), IDL.Text, IDL.Text, IDL.Bool],
346
+ [Result_5],
347
+ [],
348
+ ),
349
+ 'requestOfficialSearch' : IDL.Func(
350
+ [IDL.Text, IDL.Text, IDL.Vec(IDL.Text), IDL.Text],
351
+ [Result_4],
169
352
  [],
170
353
  ),
171
354
  'retry_failed_land_registry_transmission' : IDL.Func(
172
355
  [IDL.Text],
356
+ [Result_2],
357
+ [],
358
+ ),
359
+ 'rotateCredentials' : IDL.Func([IDL.Text], [Result_3], []),
360
+ 'send_to_land_registry' : IDL.Func([IDL.Text], [Result_2], []),
361
+ 'setCredentials' : IDL.Func(
362
+ [IDL.Text, IDL.Text, IDL.Text, Environment],
363
+ [Result_3],
364
+ [],
365
+ ),
366
+ 'setDailySpendLimit' : IDL.Func([IDL.Nat], [Result_3], []),
367
+ 'setNotificationPolling' : IDL.Func(
368
+ [IDL.Bool, IDL.Opt(IDL.Nat)],
369
+ [Result_3],
370
+ [],
371
+ ),
372
+ 'setUserManagementCanisterId' : IDL.Func([IDL.Text], [Result_3], []),
373
+ 'simulate_land_registry_processing' : IDL.Func([IDL.Text], [Result_2], []),
374
+ 'submitApplicationToChangeRegister' : IDL.Func(
375
+ [AP1SubmissionRequest, IDL.Text],
173
376
  [Result_1],
174
377
  [],
175
378
  ),
176
- 'send_to_land_registry' : IDL.Func([IDL.Text], [Result_1], []),
177
- 'simulate_land_registry_processing' : IDL.Func([IDL.Text], [Result_1], []),
379
+ 'transform' : IDL.Func([TransformArgs], [HttpResponse], ['query']),
178
380
  'validate_land_registry_connection' : IDL.Func([], [Result], []),
179
381
  'verify_land_registry_receipt' : IDL.Func([IDL.Text], [Result], []),
180
382
  });
@@ -58,15 +58,43 @@ type TeamMemberRole =
58
58
  manager;
59
59
  viewer;
60
60
  };
61
- type Result =
61
+ type Result_2 =
62
62
  variant {
63
63
  err: text;
64
- ok: text;
64
+ ok: nat;
65
65
  };
66
66
  type Result_1 =
67
67
  variant {
68
68
  err: text;
69
- ok: nat;
69
+ ok;
70
+ };
71
+ type Result =
72
+ variant {
73
+ err: text;
74
+ ok: text;
75
+ };
76
+ type LandRegistryCostEntry =
77
+ record {
78
+ apiEndpoint: text;
79
+ calledAt: int;
80
+ calledBy: principal;
81
+ costPence: nat;
82
+ description: text;
83
+ id: nat;
84
+ invoiceReference: opt text;
85
+ titleNumber: text;
86
+ transactionId: text;
87
+ };
88
+ type LRCostReport =
89
+ record {
90
+ avgCostPerTransaction: nat;
91
+ byEndpoint: vec record {
92
+ text;
93
+ nat;
94
+ };
95
+ entryCount: nat;
96
+ totalGBP: text;
97
+ totalPence: nat;
70
98
  };
71
99
  type DocumentVerification =
72
100
  record {
@@ -100,6 +128,17 @@ type CompanyLedger =
100
128
  teamMemberCount: nat;
101
129
  totalTransactions: nat;
102
130
  };
131
+ type BudgetStatus =
132
+ record {
133
+ dailyLimit: nat;
134
+ dailyRemaining: nat;
135
+ dailySpent: nat;
136
+ isOverDailyBudget: bool;
137
+ isOverMonthlyBudget: bool;
138
+ monthlyLimit: nat;
139
+ monthlyRemaining: nat;
140
+ monthlySpent: nat;
141
+ };
103
142
  type BlockchainEfficiencyMetrics =
104
143
  record {
105
144
  avgBlockchainCompletionDays: nat;
@@ -112,6 +151,16 @@ type BlockchainEfficiencyMetrics =
112
151
  totalTimeSavedDays: nat;
113
152
  transactionsCompleted: nat;
114
153
  };
154
+ type AuditEvent =
155
+ record {
156
+ caller: principal;
157
+ details: text;
158
+ eventId: nat;
159
+ eventType: text;
160
+ metadata: opt text;
161
+ timestamp: int;
162
+ transactionId: text;
163
+ };
115
164
  type Analytics =
116
165
  record {
117
166
  avgCompletionTime: nat;
@@ -130,25 +179,47 @@ service : {
130
179
  addTransactionToLedger: (accountID: text, transactionID: text,
131
180
  roleInTransaction: TransactionRole, propertyAddress: text, propertyValue:
132
181
  nat, counterparties: vec Counterparty) -> (bool);
182
+ canAffordAPICall: (costPence: nat) -> (bool) query;
183
+ clearFailedAuditEvents: () -> ();
133
184
  createCompanyTeamMember: (companyID: text, name: text, email: text, role:
134
185
  TeamMemberRole, permissions: TeamPermissions) -> (text);
135
186
  createUserAccount: (name: text, email: text, accountType: AccountType,
136
187
  companyName: opt text, taxID: opt text) -> (text);
188
+ getAllAuditEvents: () -> (vec AuditEvent) query;
137
189
  getBlockchainEfficiencyMetrics: (accountID: text) ->
138
190
  (BlockchainEfficiencyMetrics) query;
191
+ getBudgetStatus: () -> (BudgetStatus) query;
139
192
  getCompanyLedger: (companyAccountID: text) -> (CompanyLedger) query;
140
193
  getCompanyTeamMembers: (companyAccountID: text) ->
141
194
  (vec CompanyTeamMember) query;
142
195
  getCycles: () -> (nat) query;
196
+ getDailyLRSpend: () -> (nat) query;
197
+ getEventsByTransaction: (transactionId: text) -> (vec AuditEvent) query;
198
+ getFailedAuditEvents: () -> (vec AuditEvent) query;
143
199
  getGlobalBlockchainStats: () -> (BlockchainEfficiencyMetrics) query;
200
+ getLRCostReport: (fromDate: int, toDate: int) -> (LRCostReport) query;
201
+ getLRCostsForTransaction: (transactionId: text) ->
202
+ (vec LandRegistryCostEntry) query;
203
+ getLRSpendByEndpoint: (fromDate: int, toDate: int) ->
204
+ (vec record {
205
+ text;
206
+ nat;
207
+ }) query;
144
208
  getLedgerAnalytics: (accountID: text, period: text) -> (Analytics) query;
209
+ getMonthlyLRSpend: () -> (nat) query;
145
210
  getMyAccount: () -> (opt UserAccount) query;
146
211
  getMyLedger: () -> (vec UserLedgerEntry) query;
147
212
  getUserAccount: (accountID: text) -> (opt UserAccount) query;
148
213
  getUserLedger: (accountID: text) -> (vec UserLedgerEntry) query;
149
- logEvent: (transactionId: text, eventType: text, details: text,
150
- metadata: opt text) -> (Result_1);
214
+ logEvent: (transactionId: text, eventType: text, details: text, metadata:
215
+ opt text) -> (Result_2);
216
+ recordLandRegistryCost: (transactionId: text, apiEndpoint: text, costPence:
217
+ nat, titleNumber: text, description: text, invoiceReference: opt text) ->
218
+ (Result_2);
219
+ setDailyBudget: (limitPence: nat) -> (Result_1);
220
+ setDocumentStorageCanister: (canisterId: principal) -> ();
151
221
  setDocumentVerificationCanister: (canisterId: principal) -> ();
222
+ setMonthlyBudget: (limitPence: nat) -> (Result_1);
152
223
  setPropertyRegistryCanister: (canisterId: principal) -> ();
153
224
  setTransactionManagerCanister: (canisterId: principal) -> ();
154
225
  setUserManagementCanister: (canisterId: principal) -> ();
@@ -158,4 +229,4 @@ service : {
158
229
  TeamPermissions) -> (bool);
159
230
  updateTransactionStatus: (transactionID: text, accountID: text, newStatus:
160
231
  TransactionStatus) -> (bool);
161
- }
232
+ }
@@ -1,6 +1,6 @@
1
- import type { Principal } from '@icp-sdk/core/principal';
2
- import type { ActorMethod } from '@icp-sdk/core/agent';
3
- import type { IDL } from '@icp-sdk/core/candid';
1
+ import type { Principal } from '@dfinity/principal';
2
+ import type { ActorMethod } from '@dfinity/agent';
3
+ import type { IDL } from '@dfinity/candid';
4
4
 
5
5
  export type AccountType = { 'company' : null } |
6
6
  { 'individual' : null };
@@ -12,6 +12,15 @@ export interface Analytics {
12
12
  'completedTransactions' : bigint,
13
13
  'totalTransactions' : bigint,
14
14
  }
15
+ export interface AuditEvent {
16
+ 'eventId' : bigint,
17
+ 'metadata' : [] | [string],
18
+ 'timestamp' : bigint,
19
+ 'details' : string,
20
+ 'caller' : Principal,
21
+ 'transactionId' : string,
22
+ 'eventType' : string,
23
+ }
15
24
  export interface BlockchainEfficiencyMetrics {
16
25
  'avgBlockchainCompletionDays' : bigint,
17
26
  'totalCostSaved' : bigint,
@@ -23,6 +32,16 @@ export interface BlockchainEfficiencyMetrics {
23
32
  'costReductionPercent' : bigint,
24
33
  'totalTimeSavedDays' : bigint,
25
34
  }
35
+ export interface BudgetStatus {
36
+ 'dailyRemaining' : bigint,
37
+ 'isOverDailyBudget' : boolean,
38
+ 'monthlyLimit' : bigint,
39
+ 'monthlySpent' : bigint,
40
+ 'dailyLimit' : bigint,
41
+ 'dailySpent' : bigint,
42
+ 'isOverMonthlyBudget' : boolean,
43
+ 'monthlyRemaining' : bigint,
44
+ }
26
45
  export interface CompanyLedger {
27
46
  'companyAccountID' : string,
28
47
  'avgCompletionTime' : bigint,
@@ -48,9 +67,29 @@ export interface DocumentVerification {
48
67
  'landRegistryConfirm' : VerificationStatus,
49
68
  'surveyReport' : VerificationStatus,
50
69
  }
70
+ export interface LRCostReport {
71
+ 'entryCount' : bigint,
72
+ 'byEndpoint' : Array<[string, bigint]>,
73
+ 'avgCostPerTransaction' : bigint,
74
+ 'totalGBP' : string,
75
+ 'totalPence' : bigint,
76
+ }
77
+ export interface LandRegistryCostEntry {
78
+ 'id' : bigint,
79
+ 'titleNumber' : string,
80
+ 'invoiceReference' : [] | [string],
81
+ 'description' : string,
82
+ 'calledAt' : bigint,
83
+ 'calledBy' : Principal,
84
+ 'apiEndpoint' : string,
85
+ 'costPence' : bigint,
86
+ 'transactionId' : string,
87
+ }
51
88
  export type Result = { 'ok' : string } |
52
89
  { 'err' : string };
53
- export type Result_1 = { 'ok' : bigint } |
90
+ export type Result_1 = { 'ok' : null } |
91
+ { 'err' : string };
92
+ export type Result_2 = { 'ok' : bigint } |
54
93
  { 'err' : string };
55
94
  export type TeamMemberRole = { 'manager' : null } |
56
95
  { 'admin' : null } |
@@ -102,6 +141,8 @@ export interface _SERVICE {
102
141
  [string, string, TransactionRole, string, bigint, Array<Counterparty>],
103
142
  boolean
104
143
  >,
144
+ 'canAffordAPICall' : ActorMethod<[bigint], boolean>,
145
+ 'clearFailedAuditEvents' : ActorMethod<[], undefined>,
105
146
  'createCompanyTeamMember' : ActorMethod<
106
147
  [string, string, string, TeamMemberRole, TeamPermissions],
107
148
  string
@@ -110,21 +151,43 @@ export interface _SERVICE {
110
151
  [string, string, AccountType, [] | [string], [] | [string]],
111
152
  string
112
153
  >,
154
+ 'getAllAuditEvents' : ActorMethod<[], Array<AuditEvent>>,
113
155
  'getBlockchainEfficiencyMetrics' : ActorMethod<
114
156
  [string],
115
157
  BlockchainEfficiencyMetrics
116
158
  >,
159
+ 'getBudgetStatus' : ActorMethod<[], BudgetStatus>,
117
160
  'getCompanyLedger' : ActorMethod<[string], CompanyLedger>,
118
161
  'getCompanyTeamMembers' : ActorMethod<[string], Array<CompanyTeamMember>>,
119
162
  'getCycles' : ActorMethod<[], bigint>,
163
+ 'getDailyLRSpend' : ActorMethod<[], bigint>,
164
+ 'getEventsByTransaction' : ActorMethod<[string], Array<AuditEvent>>,
165
+ 'getFailedAuditEvents' : ActorMethod<[], Array<AuditEvent>>,
120
166
  'getGlobalBlockchainStats' : ActorMethod<[], BlockchainEfficiencyMetrics>,
167
+ 'getLRCostReport' : ActorMethod<[bigint, bigint], LRCostReport>,
168
+ 'getLRCostsForTransaction' : ActorMethod<
169
+ [string],
170
+ Array<LandRegistryCostEntry>
171
+ >,
172
+ 'getLRSpendByEndpoint' : ActorMethod<
173
+ [bigint, bigint],
174
+ Array<[string, bigint]>
175
+ >,
121
176
  'getLedgerAnalytics' : ActorMethod<[string, string], Analytics>,
177
+ 'getMonthlyLRSpend' : ActorMethod<[], bigint>,
122
178
  'getMyAccount' : ActorMethod<[], [] | [UserAccount]>,
123
179
  'getMyLedger' : ActorMethod<[], Array<UserLedgerEntry>>,
124
180
  'getUserAccount' : ActorMethod<[string], [] | [UserAccount]>,
125
181
  'getUserLedger' : ActorMethod<[string], Array<UserLedgerEntry>>,
126
- 'logEvent' : ActorMethod<[string, string, string, [] | [string]], Result_1>,
182
+ 'logEvent' : ActorMethod<[string, string, string, [] | [string]], Result_2>,
183
+ 'recordLandRegistryCost' : ActorMethod<
184
+ [string, string, bigint, string, string, [] | [string]],
185
+ Result_2
186
+ >,
187
+ 'setDailyBudget' : ActorMethod<[bigint], Result_1>,
188
+ 'setDocumentStorageCanister' : ActorMethod<[Principal], undefined>,
127
189
  'setDocumentVerificationCanister' : ActorMethod<[Principal], undefined>,
190
+ 'setMonthlyBudget' : ActorMethod<[bigint], Result_1>,
128
191
  'setPropertyRegistryCanister' : ActorMethod<[Principal], undefined>,
129
192
  'setTransactionManagerCanister' : ActorMethod<[Principal], undefined>,
130
193
  'setUserManagementCanister' : ActorMethod<[Principal], undefined>,
@@ -24,6 +24,15 @@ export const idlFactory = ({ IDL }) => {
24
24
  'company' : IDL.Null,
25
25
  'individual' : IDL.Null,
26
26
  });
27
+ const AuditEvent = IDL.Record({
28
+ 'eventId' : IDL.Nat,
29
+ 'metadata' : IDL.Opt(IDL.Text),
30
+ 'timestamp' : IDL.Int,
31
+ 'details' : IDL.Text,
32
+ 'caller' : IDL.Principal,
33
+ 'transactionId' : IDL.Text,
34
+ 'eventType' : IDL.Text,
35
+ });
27
36
  const BlockchainEfficiencyMetrics = IDL.Record({
28
37
  'avgBlockchainCompletionDays' : IDL.Nat,
29
38
  'totalCostSaved' : IDL.Nat,
@@ -35,6 +44,16 @@ export const idlFactory = ({ IDL }) => {
35
44
  'costReductionPercent' : IDL.Nat,
36
45
  'totalTimeSavedDays' : IDL.Nat,
37
46
  });
47
+ const BudgetStatus = IDL.Record({
48
+ 'dailyRemaining' : IDL.Nat,
49
+ 'isOverDailyBudget' : IDL.Bool,
50
+ 'monthlyLimit' : IDL.Nat,
51
+ 'monthlySpent' : IDL.Nat,
52
+ 'dailyLimit' : IDL.Nat,
53
+ 'dailySpent' : IDL.Nat,
54
+ 'isOverMonthlyBudget' : IDL.Bool,
55
+ 'monthlyRemaining' : IDL.Nat,
56
+ });
38
57
  const CompanyLedger = IDL.Record({
39
58
  'companyAccountID' : IDL.Text,
40
59
  'avgCompletionTime' : IDL.Nat,
@@ -54,6 +73,24 @@ export const idlFactory = ({ IDL }) => {
54
73
  'role' : TeamMemberRole,
55
74
  'email' : IDL.Text,
56
75
  });
76
+ const LRCostReport = IDL.Record({
77
+ 'entryCount' : IDL.Nat,
78
+ 'byEndpoint' : IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat)),
79
+ 'avgCostPerTransaction' : IDL.Nat,
80
+ 'totalGBP' : IDL.Text,
81
+ 'totalPence' : IDL.Nat,
82
+ });
83
+ const LandRegistryCostEntry = IDL.Record({
84
+ 'id' : IDL.Nat,
85
+ 'titleNumber' : IDL.Text,
86
+ 'invoiceReference' : IDL.Opt(IDL.Text),
87
+ 'description' : IDL.Text,
88
+ 'calledAt' : IDL.Int,
89
+ 'calledBy' : IDL.Principal,
90
+ 'apiEndpoint' : IDL.Text,
91
+ 'costPence' : IDL.Nat,
92
+ 'transactionId' : IDL.Text,
93
+ });
57
94
  const Analytics = IDL.Record({
58
95
  'transactionVolume' : IDL.Nat,
59
96
  'avgCompletionTime' : IDL.Nat,
@@ -103,8 +140,9 @@ export const idlFactory = ({ IDL }) => {
103
140
  'counterparties' : IDL.Vec(Counterparty),
104
141
  'transactionID' : IDL.Text,
105
142
  });
143
+ const Result_2 = IDL.Variant({ 'ok' : IDL.Nat, 'err' : IDL.Text });
144
+ const Result_1 = IDL.Variant({ 'ok' : IDL.Null, 'err' : IDL.Text });
106
145
  const Result = IDL.Variant({ 'ok' : IDL.Text, 'err' : IDL.Text });
107
- const Result_1 = IDL.Variant({ 'ok' : IDL.Nat, 'err' : IDL.Text });
108
146
  return IDL.Service({
109
147
  'addTransactionToLedger' : IDL.Func(
110
148
  [
@@ -118,6 +156,8 @@ export const idlFactory = ({ IDL }) => {
118
156
  [IDL.Bool],
119
157
  [],
120
158
  ),
159
+ 'canAffordAPICall' : IDL.Func([IDL.Nat], [IDL.Bool], ['query']),
160
+ 'clearFailedAuditEvents' : IDL.Func([], [], []),
121
161
  'createCompanyTeamMember' : IDL.Func(
122
162
  [IDL.Text, IDL.Text, IDL.Text, TeamMemberRole, TeamPermissions],
123
163
  [IDL.Text],
@@ -128,11 +168,13 @@ export const idlFactory = ({ IDL }) => {
128
168
  [IDL.Text],
129
169
  [],
130
170
  ),
171
+ 'getAllAuditEvents' : IDL.Func([], [IDL.Vec(AuditEvent)], ['query']),
131
172
  'getBlockchainEfficiencyMetrics' : IDL.Func(
132
173
  [IDL.Text],
133
174
  [BlockchainEfficiencyMetrics],
134
175
  ['query'],
135
176
  ),
177
+ 'getBudgetStatus' : IDL.Func([], [BudgetStatus], ['query']),
136
178
  'getCompanyLedger' : IDL.Func([IDL.Text], [CompanyLedger], ['query']),
137
179
  'getCompanyTeamMembers' : IDL.Func(
138
180
  [IDL.Text],
@@ -140,16 +182,35 @@ export const idlFactory = ({ IDL }) => {
140
182
  ['query'],
141
183
  ),
142
184
  'getCycles' : IDL.Func([], [IDL.Nat], ['query']),
185
+ 'getDailyLRSpend' : IDL.Func([], [IDL.Nat], ['query']),
186
+ 'getEventsByTransaction' : IDL.Func(
187
+ [IDL.Text],
188
+ [IDL.Vec(AuditEvent)],
189
+ ['query'],
190
+ ),
191
+ 'getFailedAuditEvents' : IDL.Func([], [IDL.Vec(AuditEvent)], ['query']),
143
192
  'getGlobalBlockchainStats' : IDL.Func(
144
193
  [],
145
194
  [BlockchainEfficiencyMetrics],
146
195
  ['query'],
147
196
  ),
197
+ 'getLRCostReport' : IDL.Func([IDL.Int, IDL.Int], [LRCostReport], ['query']),
198
+ 'getLRCostsForTransaction' : IDL.Func(
199
+ [IDL.Text],
200
+ [IDL.Vec(LandRegistryCostEntry)],
201
+ ['query'],
202
+ ),
203
+ 'getLRSpendByEndpoint' : IDL.Func(
204
+ [IDL.Int, IDL.Int],
205
+ [IDL.Vec(IDL.Tuple(IDL.Text, IDL.Nat))],
206
+ ['query'],
207
+ ),
148
208
  'getLedgerAnalytics' : IDL.Func(
149
209
  [IDL.Text, IDL.Text],
150
210
  [Analytics],
151
211
  ['query'],
152
212
  ),
213
+ 'getMonthlyLRSpend' : IDL.Func([], [IDL.Nat], ['query']),
153
214
  'getMyAccount' : IDL.Func([], [IDL.Opt(UserAccount)], ['query']),
154
215
  'getMyLedger' : IDL.Func([], [IDL.Vec(UserLedgerEntry)], ['query']),
155
216
  'getUserAccount' : IDL.Func([IDL.Text], [IDL.Opt(UserAccount)], ['query']),
@@ -160,10 +221,18 @@ export const idlFactory = ({ IDL }) => {
160
221
  ),
161
222
  'logEvent' : IDL.Func(
162
223
  [IDL.Text, IDL.Text, IDL.Text, IDL.Opt(IDL.Text)],
163
- [Result_1],
224
+ [Result_2],
225
+ [],
226
+ ),
227
+ 'recordLandRegistryCost' : IDL.Func(
228
+ [IDL.Text, IDL.Text, IDL.Nat, IDL.Text, IDL.Text, IDL.Opt(IDL.Text)],
229
+ [Result_2],
164
230
  [],
165
231
  ),
232
+ 'setDailyBudget' : IDL.Func([IDL.Nat], [Result_1], []),
233
+ 'setDocumentStorageCanister' : IDL.Func([IDL.Principal], [], []),
166
234
  'setDocumentVerificationCanister' : IDL.Func([IDL.Principal], [], []),
235
+ 'setMonthlyBudget' : IDL.Func([IDL.Nat], [Result_1], []),
167
236
  'setPropertyRegistryCanister' : IDL.Func([IDL.Principal], [], []),
168
237
  'setTransactionManagerCanister' : IDL.Func([IDL.Principal], [], []),
169
238
  'setUserManagementCanister' : IDL.Func([IDL.Principal], [], []),