@jsm-mit/tigi-sharded-package 0.3.0 → 0.4.0

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 (34) hide show
  1. package/README.md +7 -2
  2. package/declarations/coordinator/coordinator.did +39 -0
  3. package/declarations/coordinator/coordinator.did.d.ts +68 -0
  4. package/declarations/coordinator/coordinator.did.js +23 -0
  5. package/declarations/core/core.did +170 -45
  6. package/declarations/core/core.did.d.ts +155 -44
  7. package/declarations/core/core.did.js +122 -43
  8. package/declarations/tigi-driver/tigi-driver.did +15 -0
  9. package/declarations/tigi-driver/tigi-driver.did.d.ts +19 -0
  10. package/declarations/tigi-driver/tigi-driver.did.js +6 -0
  11. package/declarations/tigi-simulator/tigi-simulator.did +46 -4
  12. package/declarations/tigi-simulator/tigi-simulator.did.d.ts +70 -4
  13. package/declarations/tigi-simulator/tigi-simulator.did.js +39 -10
  14. package/declarations/worker/worker.did +23 -6
  15. package/declarations/worker/worker.did.d.ts +18 -6
  16. package/declarations/worker/worker.did.js +14 -7
  17. package/dist/actors/rides-actor.d.ts +21 -1
  18. package/dist/actors/rides-actor.d.ts.map +1 -1
  19. package/dist/actors/rides-actor.js +44 -2
  20. package/dist/geo.d.ts +5 -0
  21. package/dist/geo.d.ts.map +1 -1
  22. package/dist/geo.js +41 -0
  23. package/dist/group/canister-actor.d.ts +7 -0
  24. package/dist/group/canister-actor.d.ts.map +1 -1
  25. package/dist/group/canister-actor.js +18 -0
  26. package/dist/index.d.ts +2 -2
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +2 -2
  29. package/dist/interfaces.d.ts +15 -1
  30. package/dist/interfaces.d.ts.map +1 -1
  31. package/dist/mappers.d.ts +7 -2
  32. package/dist/mappers.d.ts.map +1 -1
  33. package/dist/mappers.js +17 -2
  34. package/package.json +5 -4
@@ -58,6 +58,14 @@ export interface DriverCanistersPage {
58
58
  'total' : bigint,
59
59
  'canisters' : Array<DriverCanister>,
60
60
  }
61
+ export interface DriverFeeAccountView {
62
+ 'pending' : FeeUsage,
63
+ 'bill' : [] | [FeeBill],
64
+ 'lastSettledDay' : [] | [bigint],
65
+ 'canister' : Principal,
66
+ 'paidTotal' : bigint,
67
+ 'lastFee' : [] | [FeeRecord],
68
+ }
61
69
  export interface DriverRoomView {
62
70
  'recipient' : Principal,
63
71
  'driverKey' : string,
@@ -66,6 +74,12 @@ export interface DriverRoomView {
66
74
  'roomId' : string,
67
75
  'synced' : boolean,
68
76
  }
77
+ export interface DriverUsage {
78
+ 'quoteRequests' : bigint,
79
+ 'canister' : Principal,
80
+ 'registrations' : bigint,
81
+ 'rides' : bigint,
82
+ }
69
83
  export interface Error { 'details' : ErrorDetails, 'logsJson' : string }
70
84
  export type ErrorDetails = { 'InterCanisterConnectionError' : null } |
71
85
  { 'RemoteCanisterError' : string } |
@@ -85,6 +99,45 @@ export interface FactoryStatus {
85
99
  'driverWasm' : [] | [WasmInfo],
86
100
  'registered' : bigint,
87
101
  }
102
+ export interface FeeBill {
103
+ 'day' : bigint,
104
+ 'settled' : boolean,
105
+ 'usage' : FeeUsage,
106
+ 'amount' : bigint,
107
+ 'multiplierPermille' : bigint,
108
+ 'rates' : FeeRates,
109
+ }
110
+ export interface FeePaid {
111
+ 'day' : bigint,
112
+ 'accepted' : bigint,
113
+ 'amount' : bigint,
114
+ }
115
+ export interface FeePayArgs { 'day' : bigint }
116
+ export interface FeeRates {
117
+ 'perRegistration' : bigint,
118
+ 'perQuoteRequest' : bigint,
119
+ 'perRide' : bigint,
120
+ }
121
+ export interface FeeRecord {
122
+ 'day' : bigint,
123
+ 'paidAtNs' : bigint,
124
+ 'amount' : bigint,
125
+ }
126
+ export interface FeeStatus {
127
+ 'multiplier' : [] | [{ 'day' : bigint, 'permille' : bigint }],
128
+ 'today' : bigint,
129
+ 'toForward' : bigint,
130
+ 'forwardedTotal' : bigint,
131
+ 'lastForwardError' : [] | [string],
132
+ 'accounts' : bigint,
133
+ 'paidTotal' : bigint,
134
+ 'rates' : FeeRates,
135
+ }
136
+ export interface FeeUsage {
137
+ 'quoteRequests' : bigint,
138
+ 'registrations' : bigint,
139
+ 'rides' : bigint,
140
+ }
88
141
  export interface InitArgs {
89
142
  'mode' : Mode,
90
143
  'admins' : Array<Principal>,
@@ -137,11 +190,17 @@ export type Result = { 'ok' : bigint } |
137
190
  { 'err' : Error };
138
191
  export type Result_1 = { 'ok' : Uint8Array | number[] } |
139
192
  { 'err' : Error };
140
- export type Result_10 = { 'ok' : LeaseAnswer } |
193
+ export type Result_10 = { 'ok' : Array<DriverFeeAccountView> } |
194
+ { 'err' : Error };
195
+ export type Result_11 = { 'ok' : DriverCanistersPage } |
196
+ { 'err' : Error };
197
+ export type Result_12 = { 'ok' : Array<Block> } |
141
198
  { 'err' : Error };
142
- export type Result_11 = { 'ok' : RideBatchResult } |
199
+ export type Result_13 = { 'ok' : LeaseAnswer } |
143
200
  { 'err' : Error };
144
- export type Result_12 = {
201
+ export type Result_14 = { 'ok' : RideBatchResult } |
202
+ { 'err' : Error };
203
+ export type Result_15 = {
145
204
  'ok' : {
146
205
  'subjects' : bigint,
147
206
  'headSeq' : bigint,
@@ -150,46 +209,53 @@ export type Result_12 = {
150
209
  }
151
210
  } |
152
211
  { 'err' : Error };
153
- export type Result_13 = { 'ok' : Wiring } |
212
+ export type Result_16 = { 'ok' : Wiring } |
154
213
  { 'err' : Error };
155
- export type Result_14 = { 'ok' : Array<ProfileEntry> } |
214
+ export type Result_17 = { 'ok' : Array<ProfileEntry> } |
156
215
  { 'err' : Error };
157
- export type Result_15 = { 'ok' : RidesPage } |
216
+ export type Result_18 = { 'ok' : RidesPage } |
158
217
  { 'err' : Error };
159
- export type Result_16 = { 'ok' : [] | [Rating] } |
218
+ export type Result_19 = { 'ok' : [] | [Rating] } |
160
219
  { 'err' : Error };
161
- export type Result_17 = { 'ok' : DriverCanister } |
220
+ export type Result_2 = { 'ok' : boolean } |
162
221
  { 'err' : Error };
163
- export type Result_18 = { 'ok' : FactoryStatus } |
222
+ export type Result_20 = { 'ok' : DriverCanister } |
164
223
  { 'err' : Error };
165
- export type Result_19 = { 'ok' : [] | [RolloutView] } |
224
+ export type Result_21 = { 'ok' : FeeStatus } |
166
225
  { 'err' : Error };
167
- export type Result_2 = { 'ok' : boolean } |
226
+ export type Result_22 = { 'ok' : FactoryStatus } |
227
+ { 'err' : Error };
228
+ export type Result_23 = { 'ok' : [] | [RolloutView] } |
229
+ { 'err' : Error };
230
+ export type Result_24 = { 'ok' : FeeBill } |
231
+ { 'err' : Error };
232
+ export type Result_25 = { 'ok' : DriverFeeAccountView } |
168
233
  { 'err' : Error };
169
- export type Result_20 = { 'ok' : ChatRoomsStatus } |
234
+ export type Result_26 = { 'ok' : ChatRoomsStatus } |
170
235
  { 'err' : Error };
171
- export type Result_21 = { 'ok' : Array<Principal> } |
236
+ export type Result_27 = { 'ok' : Array<Principal> } |
172
237
  { 'err' : Error };
173
- export type Result_22 = { 'ok' : Principal } |
238
+ export type Result_28 = { 'ok' : Principal } |
174
239
  { 'err' : Error };
175
- export type Result_23 = { 'ok' : WasmInfo } |
240
+ export type Result_29 = { 'ok' : WasmInfo } |
176
241
  { 'err' : Error };
177
242
  export type Result_3 = { 'ok' : RolloutView } |
178
243
  { 'err' : Error };
179
244
  export type Result_4 = { 'ok' : Profile } |
180
245
  { 'err' : Error };
181
- export type Result_5 = { 'ok' : ChatConfig } |
246
+ export type Result_5 = { 'ok' : FeeRates } |
182
247
  { 'err' : Error };
183
- export type Result_6 = { 'ok' : ClaimCode } |
248
+ export type Result_6 = { 'ok' : ChatConfig } |
184
249
  { 'err' : Error };
185
- export type Result_7 = { 'ok' : Array<DriverRoomView> } |
250
+ export type Result_7 = { 'ok' : FeePaid } |
186
251
  { 'err' : Error };
187
- export type Result_8 = { 'ok' : DriverCanistersPage } |
252
+ export type Result_8 = { 'ok' : ClaimCode } |
188
253
  { 'err' : Error };
189
- export type Result_9 = { 'ok' : Array<Block> } |
254
+ export type Result_9 = { 'ok' : Array<DriverRoomView> } |
190
255
  { 'err' : Error };
191
256
  export interface RideBatch {
192
257
  'ratings' : Array<RatingEntry>,
258
+ 'usage' : [] | [UsageBatch],
193
259
  'rides' : Array<RideEntry>,
194
260
  }
195
261
  export interface RideBatchResult {
@@ -240,6 +306,8 @@ export interface RolloutView {
240
306
  'finishedAtNs' : [] | [bigint],
241
307
  }
242
308
  export interface SetProfileArgs { 'name' : string }
309
+ export interface SimulatorRouterArgs { 'router' : [] | [Principal] }
310
+ export interface TestDayArgs { 'days' : bigint }
243
311
  export interface TigiCore {
244
312
  'abortDriverRollout' : ActorMethod<[], Result_3>,
245
313
  /**
@@ -249,7 +317,7 @@ export interface TigiCore {
249
317
  /**
250
318
  * / Admins: a canister the core controls joins the demo pool (U-35).
251
319
  */
252
- 'addPoolCanister' : ActorMethod<[CanisterArgs], Result_17>,
320
+ 'addPoolCanister' : ActorMethod<[CanisterArgs], Result_20>,
253
321
  /**
254
322
  * / Admins: a driver canister, or one driver in it (`driverKey`), is blocked; the workers
255
323
  * / drop it at once (WO-2).
@@ -264,30 +332,30 @@ export interface TigiCore {
264
332
  * / over the demo canister with the code of the link. Single use, 15 min; every refusal
265
333
  * / answers the same NotAuthorized. The room of the canister gets the caller (C-15).
266
334
  */
267
- 'claimDriverCanister' : ActorMethod<[ClaimArgs], Result_17>,
335
+ 'claimDriverCanister' : ActorMethod<[ClaimArgs], Result_20>,
268
336
  'clearLogs' : ActorMethod<[], undefined>,
269
337
  /**
270
338
  * / Admins: the chunks become THE module of their kind. A new driver wasm is released
271
339
  * / (F-11) and its hash goes to the workers.
272
340
  */
273
- 'commitDriverWasm' : ActorMethod<[WasmCommitArgs], Result_23>,
341
+ 'commitDriverWasm' : ActorMethod<[WasmCommitArgs], Result_29>,
274
342
  /**
275
343
  * / Admins, localTest: an empty canister from the core's cycles joins the demo pool.
276
344
  */
277
- 'createLocalPoolCanister' : ActorMethod<[], Result_17>,
345
+ 'createLocalPoolCanister' : ActorMethod<[], Result_20>,
278
346
  /**
279
347
  * / F-2 … F-4, F-10: the caller's own driver canister (localTest: from the core's cycles).
280
348
  */
281
- 'createMyDriverCanister' : ActorMethod<[], Result_17>,
349
+ 'createMyDriverCanister' : ActorMethod<[], Result_20>,
282
350
  /**
283
351
  * / Admins: the simulator, created once (F-18).
284
352
  */
285
- 'ensureSimulator' : ActorMethod<[], Result_22>,
353
+ 'ensureSimulator' : ActorMethod<[], Result_28>,
286
354
  /**
287
355
  * / F-8: 15 min more for the holder of a demo canister.
288
356
  */
289
- 'extendDemoLease' : ActorMethod<[], Result_17>,
290
- 'getAdmins' : ActorMethod<[], Result_21>,
357
+ 'extendDemoLease' : ActorMethod<[], Result_20>,
358
+ 'getAdmins' : ActorMethod<[], Result_27>,
291
359
  /**
292
360
  * / For the fronts (through the package): where the chat of this environment is. Null =
293
361
  * / no chat here yet. The room of a driver is `ChatRoomFunctions.driverRoomId`.
@@ -296,32 +364,46 @@ export interface TigiCore {
296
364
  /**
297
365
  * / Admins: how far the driver rooms are (C-15).
298
366
  */
299
- 'getChatRoomsStatus' : ActorMethod<[], Result_20>,
367
+ 'getChatRoomsStatus' : ActorMethod<[], Result_26>,
300
368
  /**
301
369
  * / WO-1, WO-2: what the core knows of a canister — for the workers and anybody.
302
370
  */
303
371
  'getDriverCanisterStatus' : ActorMethod<[CanisterArgs], DriverCanisterStatus>,
304
- 'getDriverRollout' : ActorMethod<[], Result_19>,
305
- 'getFactoryStatus' : ActorMethod<[], Result_18>,
372
+ /**
373
+ * / Admins: the account of one driver canister (C-17 … C-20).
374
+ */
375
+ 'getDriverFeeAccount' : ActorMethod<[CanisterArgs], Result_25>,
376
+ /**
377
+ * / C-19: a driver canister of the registry asks for its bill — the events since its
378
+ * / last settlement, priced on the fee's day. Called by the canister at its first
379
+ * / "Przyjmuję zlecenia" of a day. A pool canister owes nothing (C-18).
380
+ */
381
+ 'getDriverFeeBill' : ActorMethod<[], Result_24>,
382
+ 'getDriverRollout' : ActorMethod<[], Result_23>,
383
+ 'getFactoryStatus' : ActorMethod<[], Result_22>,
384
+ /**
385
+ * / C-22: the rates, the day, the multiplier cached, the totals.
386
+ */
387
+ 'getFeeStatus' : ActorMethod<[], Result_21>,
306
388
  'getLogs' : ActorMethod<[], string>,
307
389
  /**
308
390
  * / The caller's own canister, or the demo canister the caller holds now.
309
391
  */
310
- 'getMyDriverCanister' : ActorMethod<[], Result_17>,
392
+ 'getMyDriverCanister' : ActorMethod<[], Result_20>,
311
393
  'getMyProfile' : ActorMethod<[], Result_4>,
312
394
  /**
313
395
  * / C-16, PF-4: the caller's own rating as a rider (sum and count of stars; null = no
314
396
  * / rating yet). Ratings reach the core in the workers' batches, up to a minute late.
315
397
  */
316
- 'getMyRating' : ActorMethod<[], Result_16>,
398
+ 'getMyRating' : ActorMethod<[], Result_19>,
317
399
  /**
318
400
  * / C-8: the caller's rides, newest first.
319
401
  */
320
- 'getMyRides' : ActorMethod<[RidesPageArgs], Result_15>,
402
+ 'getMyRides' : ActorMethod<[RidesPageArgs], Result_18>,
321
403
  /**
322
404
  * / C-3: the names of up to MAX_PROFILES_PER_CALL principals; unknown ones are left out.
323
405
  */
324
- 'getProfiles' : ActorMethod<[ProfilesArgs], Result_14>,
406
+ 'getProfiles' : ActorMethod<[ProfilesArgs], Result_17>,
325
407
  /**
326
408
  * / F-11: the driver wasms released so far, oldest first.
327
409
  */
@@ -333,11 +415,11 @@ export interface TigiCore {
333
415
  /**
334
416
  * / Admins: the coordinator, the workers confirmed so far, the mode.
335
417
  */
336
- 'getWiring' : ActorMethod<[], Result_13>,
418
+ 'getWiring' : ActorMethod<[], Result_16>,
337
419
  /**
338
420
  * / Admins: how far the outbox to the workers is (C-6, C-7).
339
421
  */
340
- 'getWorkerOutbox' : ActorMethod<[], Result_12>,
422
+ 'getWorkerOutbox' : ActorMethod<[], Result_15>,
341
423
  /**
342
424
  * / Workers of the group: the core asks the coordinator once and remembers the worker,
343
425
  * / which then gets the network state through the outbox. A worker calls it once after
@@ -349,7 +431,7 @@ export interface TigiCore {
349
431
  * / Idempotent: a known requestId and a counted rating count once. Invalid entries are
350
432
  * / rejected and logged; the worker drops the whole batch after an ok.
351
433
  */
352
- 'ingestRideBatch' : ActorMethod<[RideBatch], Result_11>,
434
+ 'ingestRideBatch' : ActorMethod<[RideBatch], Result_14>,
353
435
  /**
354
436
  * / C-14: the accounts gate of the chat (U-43). The chat core asks this group's
355
437
  * / coordinator WHERE (`accountsCanisterFor` → this core) and asks here: true = an
@@ -360,18 +442,28 @@ export interface TigiCore {
360
442
  * / F-5 … F-7: a demo canister for 15 min (outside prod). A fresh lease comes with a
361
443
  * / one-time claim code (F-20, U-45).
362
444
  */
363
- 'leaseDemoDriverCanister' : ActorMethod<[], Result_10>,
364
- 'listBlocks' : ActorMethod<[PageArgs], Result_9>,
365
- 'listDriverCanisters' : ActorMethod<[PageArgs], Result_8>,
445
+ 'leaseDemoDriverCanister' : ActorMethod<[], Result_13>,
446
+ 'listBlocks' : ActorMethod<[PageArgs], Result_12>,
447
+ 'listDriverCanisters' : ActorMethod<[PageArgs], Result_11>,
448
+ /**
449
+ * / Admins: the accounts, 100 a page at most.
450
+ */
451
+ 'listDriverFeeAccounts' : ActorMethod<[PageArgs], Result_10>,
366
452
  /**
367
453
  * / Admins: the driver rooms as the core wants them, 100 a page at most.
368
454
  */
369
- 'listDriverRooms' : ActorMethod<[PageArgs], Result_7>,
455
+ 'listDriverRooms' : ActorMethod<[PageArgs], Result_9>,
370
456
  /**
371
457
  * / F-20: a fresh claim code for the caller's running demo lease; the old one stops
372
458
  * / working.
373
459
  */
374
- 'newClaimCode' : ActorMethod<[], Result_6>,
460
+ 'newClaimCode' : ActorMethod<[], Result_8>,
461
+ /**
462
+ * / C-20: the driver canister pays the bill of `day` with the cycles attached to this
463
+ * / call. The core takes exactly the bill (the rest goes back), or nothing when less is
464
+ * / attached (`FEE_SHORT`); a day paid already answers `accepted = 0`.
465
+ */
466
+ 'payDriverFee' : ActorMethod<[FeePayArgs], Result_7>,
375
467
  'removeAdmin' : ActorMethod<[PrincipalArgs], Result_2>,
376
468
  'resumeDriverRollout' : ActorMethod<[], Result_3>,
377
469
  /**
@@ -379,18 +471,33 @@ export interface TigiCore {
379
471
  * / (whose admin and accounts field are this group's coordinator). Every call sends every
380
472
  * / driver room again (a new project, a chat group set up again).
381
473
  */
382
- 'setChatConfig' : ActorMethod<[ChatConfig], Result_5>,
474
+ 'setChatConfig' : ActorMethod<[ChatConfig], Result_6>,
383
475
  /**
384
476
  * / Admins, localTest only: new claim codes live this long (the local check of an
385
477
  * / expired code). Heap only: an upgrade brings back 15 min.
386
478
  */
387
479
  'setClaimCodeTtl' : ActorMethod<[ClaimTtlArgs], Result>,
480
+ /**
481
+ * / Admins: the cycles per event (C-18).
482
+ */
483
+ 'setFeeRates' : ActorMethod<[FeeRates], Result_5>,
388
484
  'setLoggingEnabled' : ActorMethod<[boolean], Result_2>,
389
485
  /**
390
486
  * / The coordinator only: the balance below which the core asks for cycles.
391
487
  */
392
488
  'setLowCyclesBelow' : ActorMethod<[bigint], Result_2>,
393
489
  'setMyProfile' : ActorMethod<[SetProfileArgs], Result_4>,
490
+ /**
491
+ * / F-21 (2026-10-24, route line): admins — the one principal that routes the simulator's
492
+ * / quotes (S-N13, a Node process like a driver's front); null removes it. The simulator
493
+ * / takes it from the core only.
494
+ */
495
+ 'setSimulatorRouter' : ActorMethod<[SimulatorRouterArgs], Result_2>,
496
+ /**
497
+ * / Admins, localTest only: the fee's day moves this many days on (the local check of
498
+ * / "the next day"). Heap only: an upgrade brings back the real day.
499
+ */
500
+ 'setTestDayOffset' : ActorMethod<[TestDayArgs], Result>,
394
501
  /**
395
502
  * / Admins: a rollout of the current driver wasm (F-12): the canary, then the rest, one
396
503
  * / canister a step, never during a ride (F-13).
@@ -412,6 +519,10 @@ export interface UnblockDriverArgs {
412
519
  'canister' : Principal,
413
520
  }
414
521
  export interface UnblockRiderArgs { 'rider' : Principal }
522
+ export interface UsageBatch {
523
+ 'entries' : Array<DriverUsage>,
524
+ 'batchId' : bigint,
525
+ }
415
526
  export interface WasmChunkArgs {
416
527
  'kind' : WasmKind,
417
528
  'bytes' : Uint8Array | number[],
@@ -61,7 +61,7 @@ export const idlFactory = ({ IDL }) => {
61
61
  'installedAtNs' : IDL.Opt(IDL.Int),
62
62
  'leaseUntilNs' : IDL.Opt(IDL.Int),
63
63
  });
64
- const Result_17 = IDL.Variant({ 'ok' : DriverCanister, 'err' : Error });
64
+ const Result_20 = IDL.Variant({ 'ok' : DriverCanister, 'err' : Error });
65
65
  const BlockDriverArgs = IDL.Record({
66
66
  'driverKey' : IDL.Opt(IDL.Text),
67
67
  'canister' : IDL.Principal,
@@ -87,9 +87,9 @@ export const idlFactory = ({ IDL }) => {
87
87
  'size' : IDL.Nat,
88
88
  'committedAtNs' : IDL.Int,
89
89
  });
90
- const Result_23 = IDL.Variant({ 'ok' : WasmInfo, 'err' : Error });
91
- const Result_22 = IDL.Variant({ 'ok' : IDL.Principal, 'err' : Error });
92
- const Result_21 = IDL.Variant({
90
+ const Result_29 = IDL.Variant({ 'ok' : WasmInfo, 'err' : Error });
91
+ const Result_28 = IDL.Variant({ 'ok' : IDL.Principal, 'err' : Error });
92
+ const Result_27 = IDL.Variant({
93
93
  'ok' : IDL.Vec(IDL.Principal),
94
94
  'err' : Error,
95
95
  });
@@ -105,13 +105,46 @@ export const idlFactory = ({ IDL }) => {
105
105
  'pendingSinceNs' : IDL.Opt(IDL.Int),
106
106
  'rooms' : IDL.Nat,
107
107
  });
108
- const Result_20 = IDL.Variant({ 'ok' : ChatRoomsStatus, 'err' : Error });
108
+ const Result_26 = IDL.Variant({ 'ok' : ChatRoomsStatus, 'err' : Error });
109
109
  const DriverCanisterStatus = IDL.Record({
110
110
  'moduleHash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
111
111
  'blocked' : IDL.Bool,
112
112
  'registered' : IDL.Bool,
113
113
  });
114
- const Result_19 = IDL.Variant({ 'ok' : IDL.Opt(RolloutView), 'err' : Error });
114
+ const FeeUsage = IDL.Record({
115
+ 'quoteRequests' : IDL.Nat,
116
+ 'registrations' : IDL.Nat,
117
+ 'rides' : IDL.Nat,
118
+ });
119
+ const FeeRates = IDL.Record({
120
+ 'perRegistration' : IDL.Nat,
121
+ 'perQuoteRequest' : IDL.Nat,
122
+ 'perRide' : IDL.Nat,
123
+ });
124
+ const FeeBill = IDL.Record({
125
+ 'day' : IDL.Nat,
126
+ 'settled' : IDL.Bool,
127
+ 'usage' : FeeUsage,
128
+ 'amount' : IDL.Nat,
129
+ 'multiplierPermille' : IDL.Nat,
130
+ 'rates' : FeeRates,
131
+ });
132
+ const FeeRecord = IDL.Record({
133
+ 'day' : IDL.Nat,
134
+ 'paidAtNs' : IDL.Int,
135
+ 'amount' : IDL.Nat,
136
+ });
137
+ const DriverFeeAccountView = IDL.Record({
138
+ 'pending' : FeeUsage,
139
+ 'bill' : IDL.Opt(FeeBill),
140
+ 'lastSettledDay' : IDL.Opt(IDL.Nat),
141
+ 'canister' : IDL.Principal,
142
+ 'paidTotal' : IDL.Nat,
143
+ 'lastFee' : IDL.Opt(FeeRecord),
144
+ });
145
+ const Result_25 = IDL.Variant({ 'ok' : DriverFeeAccountView, 'err' : Error });
146
+ const Result_24 = IDL.Variant({ 'ok' : FeeBill, 'err' : Error });
147
+ const Result_23 = IDL.Variant({ 'ok' : IDL.Opt(RolloutView), 'err' : Error });
115
148
  const FactoryStatus = IDL.Record({
116
149
  'simulator' : IDL.Opt(IDL.Principal),
117
150
  'mode' : Mode,
@@ -123,7 +156,20 @@ export const idlFactory = ({ IDL }) => {
123
156
  'driverWasm' : IDL.Opt(WasmInfo),
124
157
  'registered' : IDL.Nat,
125
158
  });
126
- const Result_18 = IDL.Variant({ 'ok' : FactoryStatus, 'err' : Error });
159
+ const Result_22 = IDL.Variant({ 'ok' : FactoryStatus, 'err' : Error });
160
+ const FeeStatus = IDL.Record({
161
+ 'multiplier' : IDL.Opt(
162
+ IDL.Record({ 'day' : IDL.Nat, 'permille' : IDL.Nat })
163
+ ),
164
+ 'today' : IDL.Nat,
165
+ 'toForward' : IDL.Nat,
166
+ 'forwardedTotal' : IDL.Nat,
167
+ 'lastForwardError' : IDL.Opt(IDL.Text),
168
+ 'accounts' : IDL.Nat,
169
+ 'paidTotal' : IDL.Nat,
170
+ 'rates' : FeeRates,
171
+ });
172
+ const Result_21 = IDL.Variant({ 'ok' : FeeStatus, 'err' : Error });
127
173
  const Profile = IDL.Record({
128
174
  'updatedAtNs' : IDL.Int,
129
175
  'name' : IDL.Text,
@@ -131,7 +177,7 @@ export const idlFactory = ({ IDL }) => {
131
177
  });
132
178
  const Result_4 = IDL.Variant({ 'ok' : Profile, 'err' : Error });
133
179
  const Rating = IDL.Record({ 'sum' : IDL.Nat, 'count' : IDL.Nat });
134
- const Result_16 = IDL.Variant({ 'ok' : IDL.Opt(Rating), 'err' : Error });
180
+ const Result_19 = IDL.Variant({ 'ok' : IDL.Opt(Rating), 'err' : Error });
135
181
  const RidesPageArgs = IDL.Record({
136
182
  'beforeIndex' : IDL.Opt(IDL.Nat),
137
183
  'limit' : IDL.Nat,
@@ -155,13 +201,13 @@ export const idlFactory = ({ IDL }) => {
155
201
  'nextBeforeIndex' : IDL.Opt(IDL.Nat),
156
202
  'rides' : IDL.Vec(RideEntry),
157
203
  });
158
- const Result_15 = IDL.Variant({ 'ok' : RidesPage, 'err' : Error });
204
+ const Result_18 = IDL.Variant({ 'ok' : RidesPage, 'err' : Error });
159
205
  const ProfilesArgs = IDL.Record({ 'principals' : IDL.Vec(IDL.Principal) });
160
206
  const ProfileEntry = IDL.Record({
161
207
  'principal' : IDL.Principal,
162
208
  'name' : IDL.Text,
163
209
  });
164
- const Result_14 = IDL.Variant({
210
+ const Result_17 = IDL.Variant({
165
211
  'ok' : IDL.Vec(ProfileEntry),
166
212
  'err' : Error,
167
213
  });
@@ -175,8 +221,8 @@ export const idlFactory = ({ IDL }) => {
175
221
  'knownWorkers' : IDL.Vec(IDL.Principal),
176
222
  'coordinator' : IDL.Opt(IDL.Principal),
177
223
  });
178
- const Result_13 = IDL.Variant({ 'ok' : Wiring, 'err' : Error });
179
- const Result_12 = IDL.Variant({
224
+ const Result_16 = IDL.Variant({ 'ok' : Wiring, 'err' : Error });
225
+ const Result_15 = IDL.Variant({
180
226
  'ok' : IDL.Record({
181
227
  'subjects' : IDL.Nat,
182
228
  'headSeq' : IDL.Nat64,
@@ -197,8 +243,19 @@ export const idlFactory = ({ IDL }) => {
197
243
  'driverCanister' : IDL.Principal,
198
244
  'rider' : IDL.Principal,
199
245
  });
246
+ const DriverUsage = IDL.Record({
247
+ 'quoteRequests' : IDL.Nat,
248
+ 'canister' : IDL.Principal,
249
+ 'registrations' : IDL.Nat,
250
+ 'rides' : IDL.Nat,
251
+ });
252
+ const UsageBatch = IDL.Record({
253
+ 'entries' : IDL.Vec(DriverUsage),
254
+ 'batchId' : IDL.Nat64,
255
+ });
200
256
  const RideBatch = IDL.Record({
201
257
  'ratings' : IDL.Vec(RatingEntry),
258
+ 'usage' : IDL.Opt(UsageBatch),
202
259
  'rides' : IDL.Vec(RideEntry),
203
260
  });
204
261
  const RideBatchResult = IDL.Record({
@@ -207,7 +264,7 @@ export const idlFactory = ({ IDL }) => {
207
264
  'rejected' : IDL.Nat,
208
265
  'ratingsCounted' : IDL.Nat,
209
266
  });
210
- const Result_11 = IDL.Variant({ 'ok' : RideBatchResult, 'err' : Error });
267
+ const Result_14 = IDL.Variant({ 'ok' : RideBatchResult, 'err' : Error });
211
268
  const ClaimCode = IDL.Record({
212
269
  'expiresAtNs' : IDL.Int,
213
270
  'code' : IDL.Text,
@@ -228,7 +285,7 @@ export const idlFactory = ({ IDL }) => {
228
285
  'busy' : IDL.Record({ 'untilNs' : IDL.Int }),
229
286
  'leased' : LeasedCanister,
230
287
  });
231
- const Result_10 = IDL.Variant({ 'ok' : LeaseAnswer, 'err' : Error });
288
+ const Result_13 = IDL.Variant({ 'ok' : LeaseAnswer, 'err' : Error });
232
289
  const PageArgs = IDL.Record({ 'offset' : IDL.Nat, 'limit' : IDL.Nat });
233
290
  const BlockTarget = IDL.Variant({
234
291
  'driverCanister' : IDL.Principal,
@@ -244,12 +301,16 @@ export const idlFactory = ({ IDL }) => {
244
301
  'target' : BlockTarget,
245
302
  'reason' : IDL.Text,
246
303
  });
247
- const Result_9 = IDL.Variant({ 'ok' : IDL.Vec(Block), 'err' : Error });
304
+ const Result_12 = IDL.Variant({ 'ok' : IDL.Vec(Block), 'err' : Error });
248
305
  const DriverCanistersPage = IDL.Record({
249
306
  'total' : IDL.Nat,
250
307
  'canisters' : IDL.Vec(DriverCanister),
251
308
  });
252
- const Result_8 = IDL.Variant({ 'ok' : DriverCanistersPage, 'err' : Error });
309
+ const Result_11 = IDL.Variant({ 'ok' : DriverCanistersPage, 'err' : Error });
310
+ const Result_10 = IDL.Variant({
311
+ 'ok' : IDL.Vec(DriverFeeAccountView),
312
+ 'err' : Error,
313
+ });
253
314
  const DriverRoomView = IDL.Record({
254
315
  'recipient' : IDL.Principal,
255
316
  'driverKey' : IDL.Text,
@@ -258,15 +319,25 @@ export const idlFactory = ({ IDL }) => {
258
319
  'roomId' : IDL.Text,
259
320
  'synced' : IDL.Bool,
260
321
  });
261
- const Result_7 = IDL.Variant({
322
+ const Result_9 = IDL.Variant({
262
323
  'ok' : IDL.Vec(DriverRoomView),
263
324
  'err' : Error,
264
325
  });
265
- const Result_6 = IDL.Variant({ 'ok' : ClaimCode, 'err' : Error });
266
- const Result_5 = IDL.Variant({ 'ok' : ChatConfig, 'err' : Error });
326
+ const Result_8 = IDL.Variant({ 'ok' : ClaimCode, 'err' : Error });
327
+ const FeePayArgs = IDL.Record({ 'day' : IDL.Nat });
328
+ const FeePaid = IDL.Record({
329
+ 'day' : IDL.Nat,
330
+ 'accepted' : IDL.Nat,
331
+ 'amount' : IDL.Nat,
332
+ });
333
+ const Result_7 = IDL.Variant({ 'ok' : FeePaid, 'err' : Error });
334
+ const Result_6 = IDL.Variant({ 'ok' : ChatConfig, 'err' : Error });
267
335
  const ClaimTtlArgs = IDL.Record({ 'seconds' : IDL.Nat });
268
336
  const Result = IDL.Variant({ 'ok' : IDL.Nat, 'err' : Error });
337
+ const Result_5 = IDL.Variant({ 'ok' : FeeRates, 'err' : Error });
269
338
  const SetProfileArgs = IDL.Record({ 'name' : IDL.Text });
339
+ const SimulatorRouterArgs = IDL.Record({ 'router' : IDL.Opt(IDL.Principal) });
340
+ const TestDayArgs = IDL.Record({ 'days' : IDL.Nat });
270
341
  const UnblockDriverArgs = IDL.Record({
271
342
  'driverKey' : IDL.Opt(IDL.Text),
272
343
  'canister' : IDL.Principal,
@@ -281,51 +352,59 @@ export const idlFactory = ({ IDL }) => {
281
352
  const TigiCore = IDL.Service({
282
353
  'abortDriverRollout' : IDL.Func([], [Result_3], []),
283
354
  'addAdmin' : IDL.Func([PrincipalArgs], [Result_2], []),
284
- 'addPoolCanister' : IDL.Func([CanisterArgs], [Result_17], []),
355
+ 'addPoolCanister' : IDL.Func([CanisterArgs], [Result_20], []),
285
356
  'blockDriver' : IDL.Func([BlockDriverArgs], [Result_2], []),
286
357
  'blockRider' : IDL.Func([BlockRiderArgs], [Result_2], []),
287
- 'claimDriverCanister' : IDL.Func([ClaimArgs], [Result_17], []),
358
+ 'claimDriverCanister' : IDL.Func([ClaimArgs], [Result_20], []),
288
359
  'clearLogs' : IDL.Func([], [], []),
289
- 'commitDriverWasm' : IDL.Func([WasmCommitArgs], [Result_23], []),
290
- 'createLocalPoolCanister' : IDL.Func([], [Result_17], []),
291
- 'createMyDriverCanister' : IDL.Func([], [Result_17], []),
292
- 'ensureSimulator' : IDL.Func([], [Result_22], []),
293
- 'extendDemoLease' : IDL.Func([], [Result_17], []),
294
- 'getAdmins' : IDL.Func([], [Result_21], ['query']),
360
+ 'commitDriverWasm' : IDL.Func([WasmCommitArgs], [Result_29], []),
361
+ 'createLocalPoolCanister' : IDL.Func([], [Result_20], []),
362
+ 'createMyDriverCanister' : IDL.Func([], [Result_20], []),
363
+ 'ensureSimulator' : IDL.Func([], [Result_28], []),
364
+ 'extendDemoLease' : IDL.Func([], [Result_20], []),
365
+ 'getAdmins' : IDL.Func([], [Result_27], ['query']),
295
366
  'getChatConfig' : IDL.Func([], [IDL.Opt(ChatConfig)], ['query']),
296
- 'getChatRoomsStatus' : IDL.Func([], [Result_20], ['query']),
367
+ 'getChatRoomsStatus' : IDL.Func([], [Result_26], ['query']),
297
368
  'getDriverCanisterStatus' : IDL.Func(
298
369
  [CanisterArgs],
299
370
  [DriverCanisterStatus],
300
371
  ['query'],
301
372
  ),
302
- 'getDriverRollout' : IDL.Func([], [Result_19], ['query']),
303
- 'getFactoryStatus' : IDL.Func([], [Result_18], ['query']),
373
+ 'getDriverFeeAccount' : IDL.Func([CanisterArgs], [Result_25], ['query']),
374
+ 'getDriverFeeBill' : IDL.Func([], [Result_24], []),
375
+ 'getDriverRollout' : IDL.Func([], [Result_23], ['query']),
376
+ 'getFactoryStatus' : IDL.Func([], [Result_22], ['query']),
377
+ 'getFeeStatus' : IDL.Func([], [Result_21], ['query']),
304
378
  'getLogs' : IDL.Func([], [IDL.Text], ['query']),
305
- 'getMyDriverCanister' : IDL.Func([], [Result_17], ['query']),
379
+ 'getMyDriverCanister' : IDL.Func([], [Result_20], ['query']),
306
380
  'getMyProfile' : IDL.Func([], [Result_4], ['query']),
307
- 'getMyRating' : IDL.Func([], [Result_16], ['query']),
308
- 'getMyRides' : IDL.Func([RidesPageArgs], [Result_15], ['query']),
309
- 'getProfiles' : IDL.Func([ProfilesArgs], [Result_14], ['query']),
381
+ 'getMyRating' : IDL.Func([], [Result_19], ['query']),
382
+ 'getMyRides' : IDL.Func([RidesPageArgs], [Result_18], ['query']),
383
+ 'getProfiles' : IDL.Func([ProfilesArgs], [Result_17], ['query']),
310
384
  'getReleasedDriverWasms' : IDL.Func([], [IDL.Vec(ReleasedWasm)], ['query']),
311
385
  'getSimulator' : IDL.Func([], [IDL.Opt(IDL.Principal)], ['query']),
312
- 'getWiring' : IDL.Func([], [Result_13], ['query']),
313
- 'getWorkerOutbox' : IDL.Func([], [Result_12], ['query']),
386
+ 'getWiring' : IDL.Func([], [Result_16], ['query']),
387
+ 'getWorkerOutbox' : IDL.Func([], [Result_15], ['query']),
314
388
  'helloFromWorker' : IDL.Func([], [Result_2], []),
315
- 'ingestRideBatch' : IDL.Func([RideBatch], [Result_11], []),
389
+ 'ingestRideBatch' : IDL.Func([RideBatch], [Result_14], []),
316
390
  'isUser' : IDL.Func([IDL.Principal], [IDL.Bool], ['query']),
317
- 'leaseDemoDriverCanister' : IDL.Func([], [Result_10], []),
318
- 'listBlocks' : IDL.Func([PageArgs], [Result_9], ['query']),
319
- 'listDriverCanisters' : IDL.Func([PageArgs], [Result_8], ['query']),
320
- 'listDriverRooms' : IDL.Func([PageArgs], [Result_7], ['query']),
321
- 'newClaimCode' : IDL.Func([], [Result_6], []),
391
+ 'leaseDemoDriverCanister' : IDL.Func([], [Result_13], []),
392
+ 'listBlocks' : IDL.Func([PageArgs], [Result_12], ['query']),
393
+ 'listDriverCanisters' : IDL.Func([PageArgs], [Result_11], ['query']),
394
+ 'listDriverFeeAccounts' : IDL.Func([PageArgs], [Result_10], ['query']),
395
+ 'listDriverRooms' : IDL.Func([PageArgs], [Result_9], ['query']),
396
+ 'newClaimCode' : IDL.Func([], [Result_8], []),
397
+ 'payDriverFee' : IDL.Func([FeePayArgs], [Result_7], []),
322
398
  'removeAdmin' : IDL.Func([PrincipalArgs], [Result_2], []),
323
399
  'resumeDriverRollout' : IDL.Func([], [Result_3], []),
324
- 'setChatConfig' : IDL.Func([ChatConfig], [Result_5], []),
400
+ 'setChatConfig' : IDL.Func([ChatConfig], [Result_6], []),
325
401
  'setClaimCodeTtl' : IDL.Func([ClaimTtlArgs], [Result], []),
402
+ 'setFeeRates' : IDL.Func([FeeRates], [Result_5], []),
326
403
  'setLoggingEnabled' : IDL.Func([IDL.Bool], [Result_2], []),
327
404
  'setLowCyclesBelow' : IDL.Func([IDL.Nat], [Result_2], []),
328
405
  'setMyProfile' : IDL.Func([SetProfileArgs], [Result_4], []),
406
+ 'setSimulatorRouter' : IDL.Func([SimulatorRouterArgs], [Result_2], []),
407
+ 'setTestDayOffset' : IDL.Func([TestDayArgs], [Result], []),
329
408
  'startDriverRollout' : IDL.Func([], [Result_3], []),
330
409
  'unblockDriver' : IDL.Func([UnblockDriverArgs], [Result_2], []),
331
410
  'unblockRider' : IDL.Func([UnblockRiderArgs], [Result_2], []),