@propxchain/core-client 0.2.1-canary.9 → 0.3.0-canary.23

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 (63) hide show
  1. package/README.md +2 -3
  2. package/dist/auth.d.ts +7 -7
  3. package/dist/auth.d.ts.map +1 -1
  4. package/dist/auth.js +5 -5
  5. package/dist/auth.js.map +1 -1
  6. package/dist/canisters/document_storage/document_storage.did.d.ts.map +1 -1
  7. package/dist/canisters/document_storage/document_storage.did.js +90 -21
  8. package/dist/canisters/document_storage/document_storage.did.js.map +1 -1
  9. package/dist/canisters/document_verification/document_verification.did.d.ts.map +1 -1
  10. package/dist/canisters/document_verification/document_verification.did.js +132 -0
  11. package/dist/canisters/document_verification/document_verification.did.js.map +1 -1
  12. package/dist/canisters/email_service/email_service.did.d.ts.map +1 -1
  13. package/dist/canisters/email_service/email_service.did.js +40 -0
  14. package/dist/canisters/email_service/email_service.did.js.map +1 -1
  15. package/dist/canisters/land_registry_integration/land_registry_integration.did.d.ts.map +1 -1
  16. package/dist/canisters/land_registry_integration/land_registry_integration.did.js +186 -12
  17. package/dist/canisters/land_registry_integration/land_registry_integration.did.js.map +1 -1
  18. package/dist/canisters/ledger_manager/ledger_manager.did.d.ts.map +1 -1
  19. package/dist/canisters/ledger_manager/ledger_manager.did.js +55 -0
  20. package/dist/canisters/ledger_manager/ledger_manager.did.js.map +1 -1
  21. package/dist/canisters/transaction_manager/transaction_manager.did.d.ts.map +1 -1
  22. package/dist/canisters/transaction_manager/transaction_manager.did.js +42 -4
  23. package/dist/canisters/transaction_manager/transaction_manager.did.js.map +1 -1
  24. package/dist/canisters/user_management/user_management.did.d.ts.map +1 -1
  25. package/dist/canisters/user_management/user_management.did.js +115 -18
  26. package/dist/canisters/user_management/user_management.did.js.map +1 -1
  27. package/dist/client.js +1 -1
  28. package/dist/client.js.map +1 -1
  29. package/dist/index.d.ts +1 -1
  30. package/dist/index.d.ts.map +1 -1
  31. package/dist/index.js +1 -1
  32. package/dist/index.js.map +1 -1
  33. package/dist/mock.js +1 -1
  34. package/dist/mock.js.map +1 -1
  35. package/dist/types.d.ts +1 -1
  36. package/dist/types.d.ts.map +1 -1
  37. package/package.json +3 -6
  38. package/src/auth.ts +8 -9
  39. package/src/canisters/document_storage/document_storage.did +82 -12
  40. package/src/canisters/document_storage/document_storage.did.d.ts +86 -9
  41. package/src/canisters/document_storage/document_storage.did.js +128 -19
  42. package/src/canisters/document_verification/document_verification.did +150 -0
  43. package/src/canisters/document_verification/document_verification.did.d.ts +125 -1
  44. package/src/canisters/document_verification/document_verification.did.js +160 -0
  45. package/src/canisters/email_service/email_service.did +49 -0
  46. package/src/canisters/email_service/email_service.did.d.ts +49 -2
  47. package/src/canisters/email_service/email_service.did.js +68 -0
  48. package/src/canisters/land_registry_integration/land_registry_integration.did +118 -19
  49. package/src/canisters/land_registry_integration/land_registry_integration.did.d.ts +89 -19
  50. package/src/canisters/land_registry_integration/land_registry_integration.did.js +213 -11
  51. package/src/canisters/ledger_manager/ledger_manager.did +78 -0
  52. package/src/canisters/ledger_manager/ledger_manager.did.d.ts +66 -0
  53. package/src/canisters/ledger_manager/ledger_manager.did.js +75 -0
  54. package/src/canisters/transaction_manager/transaction_manager.did +98 -5
  55. package/src/canisters/transaction_manager/transaction_manager.did.d.ts +102 -4
  56. package/src/canisters/transaction_manager/transaction_manager.did.js +50 -4
  57. package/src/canisters/user_management/user_management.did +133 -18
  58. package/src/canisters/user_management/user_management.did.d.ts +108 -16
  59. package/src/canisters/user_management/user_management.did.js +151 -22
  60. package/src/client.ts +1 -1
  61. package/src/index.ts +2 -2
  62. package/src/mock.ts +1 -1
  63. package/src/types.ts +1 -1
@@ -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,11 +58,44 @@ type TeamMemberRole =
58
58
  manager;
59
59
  viewer;
60
60
  };
61
+ type Result_2 =
62
+ variant {
63
+ err: text;
64
+ ok: nat;
65
+ };
66
+ type Result_1 =
67
+ variant {
68
+ err: text;
69
+ ok;
70
+ };
61
71
  type Result =
62
72
  variant {
63
73
  err: text;
64
74
  ok: text;
65
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;
98
+ };
66
99
  type DocumentVerification =
67
100
  record {
68
101
  landRegistryConfirm: VerificationStatus;
@@ -95,6 +128,17 @@ type CompanyLedger =
95
128
  teamMemberCount: nat;
96
129
  totalTransactions: nat;
97
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
+ };
98
142
  type BlockchainEfficiencyMetrics =
99
143
  record {
100
144
  avgBlockchainCompletionDays: nat;
@@ -107,6 +151,16 @@ type BlockchainEfficiencyMetrics =
107
151
  totalTimeSavedDays: nat;
108
152
  transactionsCompleted: nat;
109
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
+ };
110
164
  type Analytics =
111
165
  record {
112
166
  avgCompletionTime: nat;
@@ -125,23 +179,47 @@ service : {
125
179
  addTransactionToLedger: (accountID: text, transactionID: text,
126
180
  roleInTransaction: TransactionRole, propertyAddress: text, propertyValue:
127
181
  nat, counterparties: vec Counterparty) -> (bool);
182
+ canAffordAPICall: (costPence: nat) -> (bool) query;
183
+ clearFailedAuditEvents: () -> ();
128
184
  createCompanyTeamMember: (companyID: text, name: text, email: text, role:
129
185
  TeamMemberRole, permissions: TeamPermissions) -> (text);
130
186
  createUserAccount: (name: text, email: text, accountType: AccountType,
131
187
  companyName: opt text, taxID: opt text) -> (text);
188
+ getAllAuditEvents: () -> (vec AuditEvent) query;
132
189
  getBlockchainEfficiencyMetrics: (accountID: text) ->
133
190
  (BlockchainEfficiencyMetrics) query;
191
+ getBudgetStatus: () -> (BudgetStatus) query;
134
192
  getCompanyLedger: (companyAccountID: text) -> (CompanyLedger) query;
135
193
  getCompanyTeamMembers: (companyAccountID: text) ->
136
194
  (vec CompanyTeamMember) query;
137
195
  getCycles: () -> (nat) query;
196
+ getDailyLRSpend: () -> (nat) query;
197
+ getEventsByTransaction: (transactionId: text) -> (vec AuditEvent) query;
198
+ getFailedAuditEvents: () -> (vec AuditEvent) query;
138
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;
139
208
  getLedgerAnalytics: (accountID: text, period: text) -> (Analytics) query;
209
+ getMonthlyLRSpend: () -> (nat) query;
140
210
  getMyAccount: () -> (opt UserAccount) query;
141
211
  getMyLedger: () -> (vec UserLedgerEntry) query;
142
212
  getUserAccount: (accountID: text) -> (opt UserAccount) query;
143
213
  getUserLedger: (accountID: text) -> (vec UserLedgerEntry) query;
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) -> ();
144
221
  setDocumentVerificationCanister: (canisterId: principal) -> ();
222
+ setMonthlyBudget: (limitPence: nat) -> (Result_1);
145
223
  setPropertyRegistryCanister: (canisterId: principal) -> ();
146
224
  setTransactionManagerCanister: (canisterId: principal) -> ();
147
225
  setUserManagementCanister: (canisterId: principal) -> ();
@@ -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,8 +67,30 @@ 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 };
90
+ export type Result_1 = { 'ok' : null } |
91
+ { 'err' : string };
92
+ export type Result_2 = { 'ok' : bigint } |
93
+ { 'err' : string };
53
94
  export type TeamMemberRole = { 'manager' : null } |
54
95
  { 'admin' : null } |
55
96
  { 'viewer' : null };
@@ -100,6 +141,8 @@ export interface _SERVICE {
100
141
  [string, string, TransactionRole, string, bigint, Array<Counterparty>],
101
142
  boolean
102
143
  >,
144
+ 'canAffordAPICall' : ActorMethod<[bigint], boolean>,
145
+ 'clearFailedAuditEvents' : ActorMethod<[], undefined>,
103
146
  'createCompanyTeamMember' : ActorMethod<
104
147
  [string, string, string, TeamMemberRole, TeamPermissions],
105
148
  string
@@ -108,20 +151,43 @@ export interface _SERVICE {
108
151
  [string, string, AccountType, [] | [string], [] | [string]],
109
152
  string
110
153
  >,
154
+ 'getAllAuditEvents' : ActorMethod<[], Array<AuditEvent>>,
111
155
  'getBlockchainEfficiencyMetrics' : ActorMethod<
112
156
  [string],
113
157
  BlockchainEfficiencyMetrics
114
158
  >,
159
+ 'getBudgetStatus' : ActorMethod<[], BudgetStatus>,
115
160
  'getCompanyLedger' : ActorMethod<[string], CompanyLedger>,
116
161
  'getCompanyTeamMembers' : ActorMethod<[string], Array<CompanyTeamMember>>,
117
162
  'getCycles' : ActorMethod<[], bigint>,
163
+ 'getDailyLRSpend' : ActorMethod<[], bigint>,
164
+ 'getEventsByTransaction' : ActorMethod<[string], Array<AuditEvent>>,
165
+ 'getFailedAuditEvents' : ActorMethod<[], Array<AuditEvent>>,
118
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
+ >,
119
176
  'getLedgerAnalytics' : ActorMethod<[string, string], Analytics>,
177
+ 'getMonthlyLRSpend' : ActorMethod<[], bigint>,
120
178
  'getMyAccount' : ActorMethod<[], [] | [UserAccount]>,
121
179
  'getMyLedger' : ActorMethod<[], Array<UserLedgerEntry>>,
122
180
  'getUserAccount' : ActorMethod<[string], [] | [UserAccount]>,
123
181
  'getUserLedger' : ActorMethod<[string], Array<UserLedgerEntry>>,
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>,
124
189
  'setDocumentVerificationCanister' : ActorMethod<[Principal], undefined>,
190
+ 'setMonthlyBudget' : ActorMethod<[bigint], Result_1>,
125
191
  'setPropertyRegistryCanister' : ActorMethod<[Principal], undefined>,
126
192
  'setTransactionManagerCanister' : ActorMethod<[Principal], undefined>,
127
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,6 +140,8 @@ 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
146
  return IDL.Service({
108
147
  'addTransactionToLedger' : IDL.Func(
@@ -117,6 +156,8 @@ export const idlFactory = ({ IDL }) => {
117
156
  [IDL.Bool],
118
157
  [],
119
158
  ),
159
+ 'canAffordAPICall' : IDL.Func([IDL.Nat], [IDL.Bool], ['query']),
160
+ 'clearFailedAuditEvents' : IDL.Func([], [], []),
120
161
  'createCompanyTeamMember' : IDL.Func(
121
162
  [IDL.Text, IDL.Text, IDL.Text, TeamMemberRole, TeamPermissions],
122
163
  [IDL.Text],
@@ -127,11 +168,13 @@ export const idlFactory = ({ IDL }) => {
127
168
  [IDL.Text],
128
169
  [],
129
170
  ),
171
+ 'getAllAuditEvents' : IDL.Func([], [IDL.Vec(AuditEvent)], ['query']),
130
172
  'getBlockchainEfficiencyMetrics' : IDL.Func(
131
173
  [IDL.Text],
132
174
  [BlockchainEfficiencyMetrics],
133
175
  ['query'],
134
176
  ),
177
+ 'getBudgetStatus' : IDL.Func([], [BudgetStatus], ['query']),
135
178
  'getCompanyLedger' : IDL.Func([IDL.Text], [CompanyLedger], ['query']),
136
179
  'getCompanyTeamMembers' : IDL.Func(
137
180
  [IDL.Text],
@@ -139,16 +182,35 @@ export const idlFactory = ({ IDL }) => {
139
182
  ['query'],
140
183
  ),
141
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']),
142
192
  'getGlobalBlockchainStats' : IDL.Func(
143
193
  [],
144
194
  [BlockchainEfficiencyMetrics],
145
195
  ['query'],
146
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
+ ),
147
208
  'getLedgerAnalytics' : IDL.Func(
148
209
  [IDL.Text, IDL.Text],
149
210
  [Analytics],
150
211
  ['query'],
151
212
  ),
213
+ 'getMonthlyLRSpend' : IDL.Func([], [IDL.Nat], ['query']),
152
214
  'getMyAccount' : IDL.Func([], [IDL.Opt(UserAccount)], ['query']),
153
215
  'getMyLedger' : IDL.Func([], [IDL.Vec(UserLedgerEntry)], ['query']),
154
216
  'getUserAccount' : IDL.Func([IDL.Text], [IDL.Opt(UserAccount)], ['query']),
@@ -157,7 +219,20 @@ export const idlFactory = ({ IDL }) => {
157
219
  [IDL.Vec(UserLedgerEntry)],
158
220
  ['query'],
159
221
  ),
222
+ 'logEvent' : IDL.Func(
223
+ [IDL.Text, IDL.Text, IDL.Text, IDL.Opt(IDL.Text)],
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],
230
+ [],
231
+ ),
232
+ 'setDailyBudget' : IDL.Func([IDL.Nat], [Result_1], []),
233
+ 'setDocumentStorageCanister' : IDL.Func([IDL.Principal], [], []),
160
234
  'setDocumentVerificationCanister' : IDL.Func([IDL.Principal], [], []),
235
+ 'setMonthlyBudget' : IDL.Func([IDL.Nat], [Result_1], []),
161
236
  'setPropertyRegistryCanister' : IDL.Func([IDL.Principal], [], []),
162
237
  'setTransactionManagerCanister' : IDL.Func([IDL.Principal], [], []),
163
238
  'setUserManagementCanister' : IDL.Func([IDL.Principal], [], []),