@jsm-mit/tigi-sharded-package 0.3.0 → 0.5.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.
- package/README.md +16 -2
- package/declarations/coordinator/coordinator.did +39 -0
- package/declarations/coordinator/coordinator.did.d.ts +68 -0
- package/declarations/coordinator/coordinator.did.js +23 -0
- package/declarations/core/core.did +240 -53
- package/declarations/core/core.did.d.ts +208 -48
- package/declarations/core/core.did.js +165 -51
- package/declarations/tigi-driver/tigi-driver.did +15 -0
- package/declarations/tigi-driver/tigi-driver.did.d.ts +19 -0
- package/declarations/tigi-driver/tigi-driver.did.js +6 -0
- package/declarations/tigi-simulator/tigi-simulator.did +46 -4
- package/declarations/tigi-simulator/tigi-simulator.did.d.ts +70 -4
- package/declarations/tigi-simulator/tigi-simulator.did.js +39 -10
- package/declarations/worker/worker.did +23 -6
- package/declarations/worker/worker.did.d.ts +18 -6
- package/declarations/worker/worker.did.js +14 -7
- package/dist/actors/profiles-actor.d.ts +20 -1
- package/dist/actors/profiles-actor.d.ts.map +1 -1
- package/dist/actors/profiles-actor.js +46 -12
- package/dist/actors/rides-actor.d.ts +21 -1
- package/dist/actors/rides-actor.d.ts.map +1 -1
- package/dist/actors/rides-actor.js +46 -6
- package/dist/geo.d.ts +5 -0
- package/dist/geo.d.ts.map +1 -1
- package/dist/geo.js +41 -0
- package/dist/group/canister-actor.d.ts +7 -0
- package/dist/group/canister-actor.d.ts.map +1 -1
- package/dist/group/canister-actor.js +18 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/interfaces.d.ts +35 -1
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/mappers.d.ts +20 -2
- package/dist/mappers.d.ts.map +1 -1
- package/dist/mappers.js +62 -2
- package/package.json +7 -4
|
@@ -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
|
|
64
|
+
const Result_22 = 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
|
|
91
|
-
const
|
|
92
|
-
const
|
|
90
|
+
const Result_31 = IDL.Variant({ 'ok' : WasmInfo, 'err' : Error });
|
|
91
|
+
const Result_30 = IDL.Variant({ 'ok' : IDL.Principal, 'err' : Error });
|
|
92
|
+
const Result_29 = IDL.Variant({
|
|
93
93
|
'ok' : IDL.Vec(IDL.Principal),
|
|
94
94
|
'err' : Error,
|
|
95
95
|
});
|
|
@@ -105,13 +105,52 @@ export const idlFactory = ({ IDL }) => {
|
|
|
105
105
|
'pendingSinceNs' : IDL.Opt(IDL.Int),
|
|
106
106
|
'rooms' : IDL.Nat,
|
|
107
107
|
});
|
|
108
|
-
const
|
|
108
|
+
const Result_28 = 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
|
|
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_27 = IDL.Variant({ 'ok' : DriverFeeAccountView, 'err' : Error });
|
|
146
|
+
const Result_26 = IDL.Variant({ 'ok' : FeeBill, 'err' : Error });
|
|
147
|
+
const DriverRatingArgs = IDL.Record({
|
|
148
|
+
'driverKey' : IDL.Text,
|
|
149
|
+
'canister' : IDL.Principal,
|
|
150
|
+
});
|
|
151
|
+
const Rating = IDL.Record({ 'sum' : IDL.Nat, 'count' : IDL.Nat });
|
|
152
|
+
const Result_21 = IDL.Variant({ 'ok' : IDL.Opt(Rating), 'err' : Error });
|
|
153
|
+
const Result_25 = IDL.Variant({ 'ok' : IDL.Opt(RolloutView), 'err' : Error });
|
|
115
154
|
const FactoryStatus = IDL.Record({
|
|
116
155
|
'simulator' : IDL.Opt(IDL.Principal),
|
|
117
156
|
'mode' : Mode,
|
|
@@ -123,45 +162,63 @@ export const idlFactory = ({ IDL }) => {
|
|
|
123
162
|
'driverWasm' : IDL.Opt(WasmInfo),
|
|
124
163
|
'registered' : IDL.Nat,
|
|
125
164
|
});
|
|
126
|
-
const
|
|
165
|
+
const Result_24 = IDL.Variant({ 'ok' : FactoryStatus, 'err' : Error });
|
|
166
|
+
const FeeStatus = IDL.Record({
|
|
167
|
+
'multiplier' : IDL.Opt(
|
|
168
|
+
IDL.Record({ 'day' : IDL.Nat, 'permille' : IDL.Nat })
|
|
169
|
+
),
|
|
170
|
+
'today' : IDL.Nat,
|
|
171
|
+
'toForward' : IDL.Nat,
|
|
172
|
+
'forwardedTotal' : IDL.Nat,
|
|
173
|
+
'lastForwardError' : IDL.Opt(IDL.Text),
|
|
174
|
+
'accounts' : IDL.Nat,
|
|
175
|
+
'paidTotal' : IDL.Nat,
|
|
176
|
+
'rates' : FeeRates,
|
|
177
|
+
});
|
|
178
|
+
const Result_23 = IDL.Variant({ 'ok' : FeeStatus, 'err' : Error });
|
|
127
179
|
const Profile = IDL.Record({
|
|
128
180
|
'updatedAtNs' : IDL.Int,
|
|
129
181
|
'name' : IDL.Text,
|
|
130
182
|
'createdAtNs' : IDL.Int,
|
|
131
183
|
});
|
|
132
184
|
const Result_4 = IDL.Variant({ 'ok' : Profile, 'err' : Error });
|
|
133
|
-
const
|
|
134
|
-
const Result_16 = IDL.Variant({ 'ok' : IDL.Opt(Rating), 'err' : Error });
|
|
135
|
-
const RidesPageArgs = IDL.Record({
|
|
136
|
-
'beforeIndex' : IDL.Opt(IDL.Nat),
|
|
137
|
-
'limit' : IDL.Nat,
|
|
138
|
-
});
|
|
185
|
+
const RequestIdArgs = IDL.Record({ 'requestId' : IDL.Text });
|
|
139
186
|
const RideEnd = IDL.Variant({
|
|
140
187
|
'completed' : IDL.Null,
|
|
141
188
|
'cancelledByRider' : IDL.Null,
|
|
142
189
|
'cancelledByDriver' : IDL.Null,
|
|
143
190
|
});
|
|
191
|
+
const Geo = IDL.Record({ 'lat' : IDL.Float64, 'lng' : IDL.Float64 });
|
|
144
192
|
const Money = IDL.Record({ 'currency' : IDL.Text, 'amount' : IDL.Nat64 });
|
|
145
|
-
const
|
|
193
|
+
const RideView = IDL.Record({
|
|
146
194
|
'end' : RideEnd,
|
|
195
|
+
'destination' : IDL.Opt(Geo),
|
|
147
196
|
'requestId' : IDL.Text,
|
|
148
197
|
'endedAtNs' : IDL.Nat64,
|
|
198
|
+
'ratable' : IDL.Opt(IDL.Bool),
|
|
199
|
+
'pickup' : IDL.Opt(Geo),
|
|
149
200
|
'driverKey' : IDL.Text,
|
|
150
201
|
'driverCanister' : IDL.Principal,
|
|
151
202
|
'price' : IDL.Opt(Money),
|
|
152
203
|
'rider' : IDL.Principal,
|
|
204
|
+
'myRating' : IDL.Opt(IDL.Nat8),
|
|
205
|
+
});
|
|
206
|
+
const Result_20 = IDL.Variant({ 'ok' : RideView, 'err' : Error });
|
|
207
|
+
const RidesPageArgs = IDL.Record({
|
|
208
|
+
'beforeIndex' : IDL.Opt(IDL.Nat),
|
|
209
|
+
'limit' : IDL.Nat,
|
|
153
210
|
});
|
|
154
211
|
const RidesPage = IDL.Record({
|
|
155
212
|
'nextBeforeIndex' : IDL.Opt(IDL.Nat),
|
|
156
|
-
'rides' : IDL.Vec(
|
|
213
|
+
'rides' : IDL.Vec(RideView),
|
|
157
214
|
});
|
|
158
|
-
const
|
|
215
|
+
const Result_19 = IDL.Variant({ 'ok' : RidesPage, 'err' : Error });
|
|
159
216
|
const ProfilesArgs = IDL.Record({ 'principals' : IDL.Vec(IDL.Principal) });
|
|
160
217
|
const ProfileEntry = IDL.Record({
|
|
161
218
|
'principal' : IDL.Principal,
|
|
162
219
|
'name' : IDL.Text,
|
|
163
220
|
});
|
|
164
|
-
const
|
|
221
|
+
const Result_18 = IDL.Variant({
|
|
165
222
|
'ok' : IDL.Vec(ProfileEntry),
|
|
166
223
|
'err' : Error,
|
|
167
224
|
});
|
|
@@ -175,8 +232,8 @@ export const idlFactory = ({ IDL }) => {
|
|
|
175
232
|
'knownWorkers' : IDL.Vec(IDL.Principal),
|
|
176
233
|
'coordinator' : IDL.Opt(IDL.Principal),
|
|
177
234
|
});
|
|
178
|
-
const
|
|
179
|
-
const
|
|
235
|
+
const Result_17 = IDL.Variant({ 'ok' : Wiring, 'err' : Error });
|
|
236
|
+
const Result_16 = IDL.Variant({
|
|
180
237
|
'ok' : IDL.Record({
|
|
181
238
|
'subjects' : IDL.Nat,
|
|
182
239
|
'headSeq' : IDL.Nat64,
|
|
@@ -197,9 +254,31 @@ export const idlFactory = ({ IDL }) => {
|
|
|
197
254
|
'driverCanister' : IDL.Principal,
|
|
198
255
|
'rider' : IDL.Principal,
|
|
199
256
|
});
|
|
257
|
+
const DriverUsage = IDL.Record({
|
|
258
|
+
'quoteRequests' : IDL.Nat,
|
|
259
|
+
'canister' : IDL.Principal,
|
|
260
|
+
'registrations' : IDL.Nat,
|
|
261
|
+
'rides' : IDL.Nat,
|
|
262
|
+
});
|
|
263
|
+
const UsageBatch = IDL.Record({
|
|
264
|
+
'entries' : IDL.Vec(DriverUsage),
|
|
265
|
+
'batchId' : IDL.Nat64,
|
|
266
|
+
});
|
|
267
|
+
const RideEntryIn = IDL.Record({
|
|
268
|
+
'end' : RideEnd,
|
|
269
|
+
'destination' : IDL.Opt(Geo),
|
|
270
|
+
'requestId' : IDL.Text,
|
|
271
|
+
'endedAtNs' : IDL.Nat64,
|
|
272
|
+
'pickup' : IDL.Opt(Geo),
|
|
273
|
+
'driverKey' : IDL.Text,
|
|
274
|
+
'driverCanister' : IDL.Principal,
|
|
275
|
+
'price' : IDL.Opt(Money),
|
|
276
|
+
'rider' : IDL.Principal,
|
|
277
|
+
});
|
|
200
278
|
const RideBatch = IDL.Record({
|
|
201
279
|
'ratings' : IDL.Vec(RatingEntry),
|
|
202
|
-
'
|
|
280
|
+
'usage' : IDL.Opt(UsageBatch),
|
|
281
|
+
'rides' : IDL.Vec(RideEntryIn),
|
|
203
282
|
});
|
|
204
283
|
const RideBatchResult = IDL.Record({
|
|
205
284
|
'duplicates' : IDL.Nat,
|
|
@@ -207,7 +286,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
207
286
|
'rejected' : IDL.Nat,
|
|
208
287
|
'ratingsCounted' : IDL.Nat,
|
|
209
288
|
});
|
|
210
|
-
const
|
|
289
|
+
const Result_15 = IDL.Variant({ 'ok' : RideBatchResult, 'err' : Error });
|
|
211
290
|
const ClaimCode = IDL.Record({
|
|
212
291
|
'expiresAtNs' : IDL.Int,
|
|
213
292
|
'code' : IDL.Text,
|
|
@@ -228,7 +307,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
228
307
|
'busy' : IDL.Record({ 'untilNs' : IDL.Int }),
|
|
229
308
|
'leased' : LeasedCanister,
|
|
230
309
|
});
|
|
231
|
-
const
|
|
310
|
+
const Result_14 = IDL.Variant({ 'ok' : LeaseAnswer, 'err' : Error });
|
|
232
311
|
const PageArgs = IDL.Record({ 'offset' : IDL.Nat, 'limit' : IDL.Nat });
|
|
233
312
|
const BlockTarget = IDL.Variant({
|
|
234
313
|
'driverCanister' : IDL.Principal,
|
|
@@ -244,12 +323,16 @@ export const idlFactory = ({ IDL }) => {
|
|
|
244
323
|
'target' : BlockTarget,
|
|
245
324
|
'reason' : IDL.Text,
|
|
246
325
|
});
|
|
247
|
-
const
|
|
326
|
+
const Result_13 = IDL.Variant({ 'ok' : IDL.Vec(Block), 'err' : Error });
|
|
248
327
|
const DriverCanistersPage = IDL.Record({
|
|
249
328
|
'total' : IDL.Nat,
|
|
250
329
|
'canisters' : IDL.Vec(DriverCanister),
|
|
251
330
|
});
|
|
252
|
-
const
|
|
331
|
+
const Result_12 = IDL.Variant({ 'ok' : DriverCanistersPage, 'err' : Error });
|
|
332
|
+
const Result_11 = IDL.Variant({
|
|
333
|
+
'ok' : IDL.Vec(DriverFeeAccountView),
|
|
334
|
+
'err' : Error,
|
|
335
|
+
});
|
|
253
336
|
const DriverRoomView = IDL.Record({
|
|
254
337
|
'recipient' : IDL.Principal,
|
|
255
338
|
'driverKey' : IDL.Text,
|
|
@@ -258,15 +341,35 @@ export const idlFactory = ({ IDL }) => {
|
|
|
258
341
|
'roomId' : IDL.Text,
|
|
259
342
|
'synced' : IDL.Bool,
|
|
260
343
|
});
|
|
261
|
-
const
|
|
344
|
+
const Result_10 = IDL.Variant({
|
|
262
345
|
'ok' : IDL.Vec(DriverRoomView),
|
|
263
346
|
'err' : Error,
|
|
264
347
|
});
|
|
265
|
-
const
|
|
266
|
-
const
|
|
348
|
+
const Result_9 = IDL.Variant({ 'ok' : ClaimCode, 'err' : Error });
|
|
349
|
+
const FeePayArgs = IDL.Record({ 'day' : IDL.Nat });
|
|
350
|
+
const FeePaid = IDL.Record({
|
|
351
|
+
'day' : IDL.Nat,
|
|
352
|
+
'accepted' : IDL.Nat,
|
|
353
|
+
'amount' : IDL.Nat,
|
|
354
|
+
});
|
|
355
|
+
const Result_8 = IDL.Variant({ 'ok' : FeePaid, 'err' : Error });
|
|
356
|
+
const RateRideArgs = IDL.Record({
|
|
357
|
+
'requestId' : IDL.Text,
|
|
358
|
+
'stars' : IDL.Nat8,
|
|
359
|
+
});
|
|
360
|
+
const RateRideOutcome = IDL.Variant({
|
|
361
|
+
'notRatable' : IDL.Text,
|
|
362
|
+
'rated' : IDL.Null,
|
|
363
|
+
'alreadyRated' : IDL.Null,
|
|
364
|
+
});
|
|
365
|
+
const Result_7 = IDL.Variant({ 'ok' : RateRideOutcome, 'err' : Error });
|
|
366
|
+
const Result_6 = IDL.Variant({ 'ok' : ChatConfig, 'err' : Error });
|
|
267
367
|
const ClaimTtlArgs = IDL.Record({ 'seconds' : IDL.Nat });
|
|
268
368
|
const Result = IDL.Variant({ 'ok' : IDL.Nat, 'err' : Error });
|
|
369
|
+
const Result_5 = IDL.Variant({ 'ok' : FeeRates, 'err' : Error });
|
|
269
370
|
const SetProfileArgs = IDL.Record({ 'name' : IDL.Text });
|
|
371
|
+
const SimulatorRouterArgs = IDL.Record({ 'router' : IDL.Opt(IDL.Principal) });
|
|
372
|
+
const TestDayArgs = IDL.Record({ 'days' : IDL.Nat });
|
|
270
373
|
const UnblockDriverArgs = IDL.Record({
|
|
271
374
|
'driverKey' : IDL.Opt(IDL.Text),
|
|
272
375
|
'canister' : IDL.Principal,
|
|
@@ -281,51 +384,62 @@ export const idlFactory = ({ IDL }) => {
|
|
|
281
384
|
const TigiCore = IDL.Service({
|
|
282
385
|
'abortDriverRollout' : IDL.Func([], [Result_3], []),
|
|
283
386
|
'addAdmin' : IDL.Func([PrincipalArgs], [Result_2], []),
|
|
284
|
-
'addPoolCanister' : IDL.Func([CanisterArgs], [
|
|
387
|
+
'addPoolCanister' : IDL.Func([CanisterArgs], [Result_22], []),
|
|
285
388
|
'blockDriver' : IDL.Func([BlockDriverArgs], [Result_2], []),
|
|
286
389
|
'blockRider' : IDL.Func([BlockRiderArgs], [Result_2], []),
|
|
287
|
-
'claimDriverCanister' : IDL.Func([ClaimArgs], [
|
|
390
|
+
'claimDriverCanister' : IDL.Func([ClaimArgs], [Result_22], []),
|
|
288
391
|
'clearLogs' : IDL.Func([], [], []),
|
|
289
|
-
'commitDriverWasm' : IDL.Func([WasmCommitArgs], [
|
|
290
|
-
'createLocalPoolCanister' : IDL.Func([], [
|
|
291
|
-
'createMyDriverCanister' : IDL.Func([], [
|
|
292
|
-
'ensureSimulator' : IDL.Func([], [
|
|
293
|
-
'extendDemoLease' : IDL.Func([], [
|
|
294
|
-
'getAdmins' : IDL.Func([], [
|
|
392
|
+
'commitDriverWasm' : IDL.Func([WasmCommitArgs], [Result_31], []),
|
|
393
|
+
'createLocalPoolCanister' : IDL.Func([], [Result_22], []),
|
|
394
|
+
'createMyDriverCanister' : IDL.Func([], [Result_22], []),
|
|
395
|
+
'ensureSimulator' : IDL.Func([], [Result_30], []),
|
|
396
|
+
'extendDemoLease' : IDL.Func([], [Result_22], []),
|
|
397
|
+
'getAdmins' : IDL.Func([], [Result_29], ['query']),
|
|
295
398
|
'getChatConfig' : IDL.Func([], [IDL.Opt(ChatConfig)], ['query']),
|
|
296
|
-
'getChatRoomsStatus' : IDL.Func([], [
|
|
399
|
+
'getChatRoomsStatus' : IDL.Func([], [Result_28], ['query']),
|
|
297
400
|
'getDriverCanisterStatus' : IDL.Func(
|
|
298
401
|
[CanisterArgs],
|
|
299
402
|
[DriverCanisterStatus],
|
|
300
403
|
['query'],
|
|
301
404
|
),
|
|
302
|
-
'
|
|
303
|
-
'
|
|
405
|
+
'getDriverFeeAccount' : IDL.Func([CanisterArgs], [Result_27], ['query']),
|
|
406
|
+
'getDriverFeeBill' : IDL.Func([], [Result_26], []),
|
|
407
|
+
'getDriverRating' : IDL.Func([DriverRatingArgs], [Result_21], ['query']),
|
|
408
|
+
'getDriverRollout' : IDL.Func([], [Result_25], ['query']),
|
|
409
|
+
'getFactoryStatus' : IDL.Func([], [Result_24], ['query']),
|
|
410
|
+
'getFeeStatus' : IDL.Func([], [Result_23], ['query']),
|
|
304
411
|
'getLogs' : IDL.Func([], [IDL.Text], ['query']),
|
|
305
|
-
'getMyDriverCanister' : IDL.Func([], [
|
|
412
|
+
'getMyDriverCanister' : IDL.Func([], [Result_22], ['query']),
|
|
306
413
|
'getMyProfile' : IDL.Func([], [Result_4], ['query']),
|
|
307
|
-
'getMyRating' : IDL.Func([], [
|
|
308
|
-
'
|
|
309
|
-
'
|
|
414
|
+
'getMyRating' : IDL.Func([], [Result_21], ['query']),
|
|
415
|
+
'getMyRide' : IDL.Func([RequestIdArgs], [Result_20], ['query']),
|
|
416
|
+
'getMyRides' : IDL.Func([RidesPageArgs], [Result_19], ['query']),
|
|
417
|
+
'getProfiles' : IDL.Func([ProfilesArgs], [Result_18], ['query']),
|
|
310
418
|
'getReleasedDriverWasms' : IDL.Func([], [IDL.Vec(ReleasedWasm)], ['query']),
|
|
311
419
|
'getSimulator' : IDL.Func([], [IDL.Opt(IDL.Principal)], ['query']),
|
|
312
|
-
'getWiring' : IDL.Func([], [
|
|
313
|
-
'getWorkerOutbox' : IDL.Func([], [
|
|
420
|
+
'getWiring' : IDL.Func([], [Result_17], ['query']),
|
|
421
|
+
'getWorkerOutbox' : IDL.Func([], [Result_16], ['query']),
|
|
314
422
|
'helloFromWorker' : IDL.Func([], [Result_2], []),
|
|
315
|
-
'ingestRideBatch' : IDL.Func([RideBatch], [
|
|
423
|
+
'ingestRideBatch' : IDL.Func([RideBatch], [Result_15], []),
|
|
316
424
|
'isUser' : IDL.Func([IDL.Principal], [IDL.Bool], ['query']),
|
|
317
|
-
'leaseDemoDriverCanister' : IDL.Func([], [
|
|
318
|
-
'listBlocks' : IDL.Func([PageArgs], [
|
|
319
|
-
'listDriverCanisters' : IDL.Func([PageArgs], [
|
|
320
|
-
'
|
|
321
|
-
'
|
|
425
|
+
'leaseDemoDriverCanister' : IDL.Func([], [Result_14], []),
|
|
426
|
+
'listBlocks' : IDL.Func([PageArgs], [Result_13], ['query']),
|
|
427
|
+
'listDriverCanisters' : IDL.Func([PageArgs], [Result_12], ['query']),
|
|
428
|
+
'listDriverFeeAccounts' : IDL.Func([PageArgs], [Result_11], ['query']),
|
|
429
|
+
'listDriverRooms' : IDL.Func([PageArgs], [Result_10], ['query']),
|
|
430
|
+
'newClaimCode' : IDL.Func([], [Result_9], []),
|
|
431
|
+
'payDriverFee' : IDL.Func([FeePayArgs], [Result_8], []),
|
|
432
|
+
'rateMyRide' : IDL.Func([RateRideArgs], [Result_7], []),
|
|
322
433
|
'removeAdmin' : IDL.Func([PrincipalArgs], [Result_2], []),
|
|
323
434
|
'resumeDriverRollout' : IDL.Func([], [Result_3], []),
|
|
324
|
-
'setChatConfig' : IDL.Func([ChatConfig], [
|
|
435
|
+
'setChatConfig' : IDL.Func([ChatConfig], [Result_6], []),
|
|
325
436
|
'setClaimCodeTtl' : IDL.Func([ClaimTtlArgs], [Result], []),
|
|
437
|
+
'setFeeRates' : IDL.Func([FeeRates], [Result_5], []),
|
|
326
438
|
'setLoggingEnabled' : IDL.Func([IDL.Bool], [Result_2], []),
|
|
327
439
|
'setLowCyclesBelow' : IDL.Func([IDL.Nat], [Result_2], []),
|
|
328
440
|
'setMyProfile' : IDL.Func([SetProfileArgs], [Result_4], []),
|
|
441
|
+
'setSimulatorRouter' : IDL.Func([SimulatorRouterArgs], [Result_2], []),
|
|
442
|
+
'setTestDayOffset' : IDL.Func([TestDayArgs], [Result], []),
|
|
329
443
|
'startDriverRollout' : IDL.Func([], [Result_3], []),
|
|
330
444
|
'unblockDriver' : IDL.Func([UnblockDriverArgs], [Result_2], []),
|
|
331
445
|
'unblockRider' : IDL.Func([UnblockRiderArgs], [Result_2], []),
|
|
@@ -104,6 +104,16 @@ type RegisterDriver = record {
|
|
|
104
104
|
validUntilNs : opt nat64; // simulator only: no pulse needed until then (U-25)
|
|
105
105
|
};
|
|
106
106
|
|
|
107
|
+
// The route the driver's front got from its provider, in the same query that priced the
|
|
108
|
+
// quote (2026-10-24, route line): two legs, each a Google encoded polyline of precision 6
|
|
109
|
+
// (lat, lng; 1e-6 degrees). `toPickup` starts at the driver's exact position and ends at A,
|
|
110
|
+
// `ride` runs A → B. At most 4 096 bytes and 500 points for both legs together (P-17);
|
|
111
|
+
// a line over the cap or not valid is dropped, never the quote.
|
|
112
|
+
type RouteLine = record {
|
|
113
|
+
toPickup : text;
|
|
114
|
+
ride : text;
|
|
115
|
+
};
|
|
116
|
+
|
|
107
117
|
type Quote = record {
|
|
108
118
|
requestId : RequestId;
|
|
109
119
|
driverKey : DriverKey;
|
|
@@ -113,6 +123,8 @@ type Quote = record {
|
|
|
113
123
|
rideSec : nat32;
|
|
114
124
|
price : Money; // start fee + per km (U-28), computed by the driver canister
|
|
115
125
|
validUntilNs : nat64; // 60 s (U-39)
|
|
126
|
+
routeLine : opt RouteLine; // P-17: the line of the offer; none from an old canister
|
|
127
|
+
driverPosition : opt Geo; // P-18: exact, the start of the route — the pin of the offer
|
|
116
128
|
};
|
|
117
129
|
|
|
118
130
|
type QuoteDecline = record { requestId : RequestId; driverKey : DriverKey };
|
|
@@ -180,6 +192,9 @@ service : {
|
|
|
180
192
|
// rider waits on the worker's request state and `getRide` answers `notFound`)
|
|
181
193
|
getRide : (RideRef) -> (variant { ok : RideView; err : ProtocolError }) query;
|
|
182
194
|
getLicence : (RideRef) -> (variant { ok : Licence; err : ProtocolError }) query;
|
|
195
|
+
// P-19: the line of the accepted quote while the ride is active (`notFound` without a
|
|
196
|
+
// line or after the end); an old canister has no such method — the rider draws none.
|
|
197
|
+
getRideRoute : (RideRef) -> (variant { ok : RouteLine; err : ProtocolError }) query;
|
|
183
198
|
cancelRide : (RideRef) -> (variant { ok; err : ProtocolError });
|
|
184
199
|
}
|
|
185
200
|
|
|
@@ -48,9 +48,11 @@ export interface Quote {
|
|
|
48
48
|
'requestId' : RequestId,
|
|
49
49
|
'rideMeters' : number,
|
|
50
50
|
'rideSec' : number,
|
|
51
|
+
'routeLine' : [] | [RouteLine],
|
|
51
52
|
'driverKey' : DriverKey,
|
|
52
53
|
'price' : Money,
|
|
53
54
|
'etaToPickupSec' : number,
|
|
55
|
+
'driverPosition' : [] | [Geo],
|
|
54
56
|
'toPickupMeters' : number,
|
|
55
57
|
'validUntilNs' : bigint,
|
|
56
58
|
}
|
|
@@ -122,6 +124,14 @@ export interface RiderRating {
|
|
|
122
124
|
'stars' : number,
|
|
123
125
|
'driverKey' : DriverKey,
|
|
124
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* The route the driver's front got from its provider, in the same query that priced the
|
|
129
|
+
* quote (2026-10-24, route line): two legs, each a Google encoded polyline of precision 6
|
|
130
|
+
* (lat, lng; 1e-6 degrees). `toPickup` starts at the driver's exact position and ends at A,
|
|
131
|
+
* `ride` runs A → B. At most 4 096 bytes and 500 points for both legs together (P-17);
|
|
132
|
+
* a line over the cap or not valid is dropped, never the quote.
|
|
133
|
+
*/
|
|
134
|
+
export interface RouteLine { 'ride' : string, 'toPickup' : string }
|
|
125
135
|
/**
|
|
126
136
|
* Implemented by every driver canister.
|
|
127
137
|
*/
|
|
@@ -145,6 +155,15 @@ export interface _SERVICE {
|
|
|
145
155
|
{ 'ok' : RideView } |
|
|
146
156
|
{ 'err' : ProtocolError }
|
|
147
157
|
>,
|
|
158
|
+
/**
|
|
159
|
+
* P-19: the line of the accepted quote while the ride is active (`notFound` without a
|
|
160
|
+
* line or after the end); an old canister has no such method — the rider draws none.
|
|
161
|
+
*/
|
|
162
|
+
'getRideRoute' : ActorMethod<
|
|
163
|
+
[RideRef],
|
|
164
|
+
{ 'ok' : RouteLine } |
|
|
165
|
+
{ 'err' : ProtocolError }
|
|
166
|
+
>,
|
|
148
167
|
'protocolVersion' : ActorMethod<[], number>,
|
|
149
168
|
/**
|
|
150
169
|
* worker → driver: queue and answer at once
|
|
@@ -53,6 +53,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
53
53
|
'driver' : DriverCard,
|
|
54
54
|
'driverPosition' : IDL.Opt(Geo),
|
|
55
55
|
});
|
|
56
|
+
const RouteLine = IDL.Record({ 'ride' : IDL.Text, 'toPickup' : IDL.Text });
|
|
56
57
|
const QuoteRequest = IDL.Record({
|
|
57
58
|
'destination' : Geo,
|
|
58
59
|
'requestId' : RequestId,
|
|
@@ -100,6 +101,11 @@ export const idlFactory = ({ IDL }) => {
|
|
|
100
101
|
[IDL.Variant({ 'ok' : RideView, 'err' : ProtocolError })],
|
|
101
102
|
['query'],
|
|
102
103
|
),
|
|
104
|
+
'getRideRoute' : IDL.Func(
|
|
105
|
+
[RideRef],
|
|
106
|
+
[IDL.Variant({ 'ok' : RouteLine, 'err' : ProtocolError })],
|
|
107
|
+
['query'],
|
|
108
|
+
),
|
|
103
109
|
'protocolVersion' : IDL.Func([], [IDL.Nat32], ['query']),
|
|
104
110
|
'quoteRequest' : IDL.Func(
|
|
105
111
|
[QuoteRequest],
|
|
@@ -206,8 +206,9 @@ type RequestClosed = record {
|
|
|
206
206
|
driverKey : text;
|
|
207
207
|
reason : CloseReason;
|
|
208
208
|
};
|
|
209
|
-
type Result = variant { Ok; Err : SimulatorError };
|
|
210
|
-
type Result_1 = variant { Ok
|
|
209
|
+
type Result = variant { Ok : vec RouteTaskView; Err : SimulatorError };
|
|
210
|
+
type Result_1 = variant { Ok; Err : SimulatorError };
|
|
211
|
+
type Result_2 = variant { Ok : SpawnResult; Err : SimulatorError };
|
|
211
212
|
// `variant { ok : RideView; err : ProtocolError }`.
|
|
212
213
|
type RideAnswer = variant { ok : RideView; err : ProtocolError };
|
|
213
214
|
type RideOrder = record {
|
|
@@ -243,6 +244,35 @@ type RideView = record {
|
|
|
243
244
|
// Exact, for the rider of this ride only.
|
|
244
245
|
driverPosition : opt Geo;
|
|
245
246
|
};
|
|
247
|
+
// `variant { ok : RouteLine; err : ProtocolError }` (P-19).
|
|
248
|
+
type RouteAnswer = variant { ok : RouteLine; err : ProtocolError };
|
|
249
|
+
// P-17 (2026-10-24, route line): the route of a quote in two legs, each a Google encoded
|
|
250
|
+
// polyline of precision 6 — `toPickup` from the driver's exact position to A, `ride` A → B.
|
|
251
|
+
// Bounds and checks: `crate::polyline`.
|
|
252
|
+
type RouteLine = record { ride : text; toPickup : text };
|
|
253
|
+
// S-N13: a quote request waiting for the router: route me → A → B.
|
|
254
|
+
type RouteTaskView = record {
|
|
255
|
+
// The router has until then; after `ROUTER_WAIT_NS` the quote goes without it.
|
|
256
|
+
untilNs : nat64;
|
|
257
|
+
destination : Geo;
|
|
258
|
+
requestId : text;
|
|
259
|
+
from : Geo;
|
|
260
|
+
pickup : Geo;
|
|
261
|
+
driverKey : text;
|
|
262
|
+
};
|
|
263
|
+
// S-N13: the core sets the router (an admin's `setSimulatorRouter`); none removes it.
|
|
264
|
+
type SetRouterArgs = record { router : opt principal };
|
|
265
|
+
// S-N13: the router's answer — metres, seconds and the line, like the driver front's
|
|
266
|
+
// `RouteResult`, for one virtual driver.
|
|
267
|
+
type SimRouteResult = record {
|
|
268
|
+
requestId : text;
|
|
269
|
+
rideMeters : nat32;
|
|
270
|
+
rideSec : nat32;
|
|
271
|
+
routeLine : opt RouteLine;
|
|
272
|
+
driverKey : text;
|
|
273
|
+
toPickupSec : nat32;
|
|
274
|
+
toPickupMeters : nat32;
|
|
275
|
+
};
|
|
246
276
|
type SimulatorError = variant {
|
|
247
277
|
// The coordinator or a worker refused or did not answer.
|
|
248
278
|
RemoteCanisterError : text;
|
|
@@ -257,6 +287,8 @@ type SimulatorStatus = record {
|
|
|
257
287
|
liveDrivers : nat64;
|
|
258
288
|
events : vec Event;
|
|
259
289
|
drivers : nat64;
|
|
290
|
+
// S-N13 (a new reply field: opt).
|
|
291
|
+
router : opt principal;
|
|
260
292
|
rides : nat64;
|
|
261
293
|
};
|
|
262
294
|
type SpawnArgs = record {
|
|
@@ -282,6 +314,10 @@ service : (InitArgs) -> {
|
|
|
282
314
|
cancelRide : (RideRef) -> (ProtocolAnswer);
|
|
283
315
|
getLicence : (RideRef) -> (LicenceAnswer) query;
|
|
284
316
|
getRide : (RideRef) -> (RideAnswer) query;
|
|
317
|
+
// S-N14 (P-19): the line of the ride for its rider, while the ride is active.
|
|
318
|
+
getRideRoute : (RideRef) -> (RouteAnswer) query;
|
|
319
|
+
// S-N13: the quote requests that wait for a route (at most 5 s each), the oldest first.
|
|
320
|
+
getRouteTasks : () -> (Result) query;
|
|
285
321
|
getStatus : () -> (SimulatorStatus) query;
|
|
286
322
|
http_request : (HttpRequest) -> (HttpResponse) query;
|
|
287
323
|
protocolVersion : () -> (nat32) query;
|
|
@@ -292,9 +328,15 @@ service : (InitArgs) -> {
|
|
|
292
328
|
// S-10, U-42: accepted at once, like the driver canister (the acceptance goes out by the
|
|
293
329
|
// job timer right away).
|
|
294
330
|
rideOrder : (RideOrder) -> (ProtocolAnswer);
|
|
331
|
+
// S-N13: the core only (an admin's `setSimulatorRouter`): the one principal that routes the
|
|
332
|
+
// virtual drivers' quotes, like a driver's front; none = the straight line again.
|
|
333
|
+
setRouter : (SetRouterArgs) -> (Result_1);
|
|
295
334
|
// S-15: ×10 for one request (`requestId`), not the whole canister.
|
|
296
|
-
setSpeedUp : (SpeedUpArgs) -> (
|
|
335
|
+
setSpeedUp : (SpeedUpArgs) -> (Result_1);
|
|
297
336
|
// S-2, S-3: virtual drivers around a point, each registered in the worker of its cell
|
|
298
337
|
// with `validUntilNs` (30 min) instead of a pulse.
|
|
299
|
-
spawnDrivers : (SpawnArgs) -> (
|
|
338
|
+
spawnDrivers : (SpawnArgs) -> (Result_2);
|
|
339
|
+
// S-N13: the router's route for one virtual driver — metres, seconds, the line. The quote
|
|
340
|
+
// goes with it at its moment (S-8), or at once when that moment has passed.
|
|
341
|
+
submitRoute : (SimRouteResult) -> (Result_1);
|
|
300
342
|
}
|
|
@@ -288,9 +288,11 @@ export interface RequestClosed {
|
|
|
288
288
|
'driverKey' : string,
|
|
289
289
|
'reason' : CloseReason,
|
|
290
290
|
}
|
|
291
|
-
export type Result = { 'Ok' :
|
|
291
|
+
export type Result = { 'Ok' : Array<RouteTaskView> } |
|
|
292
292
|
{ 'Err' : SimulatorError };
|
|
293
|
-
export type Result_1 = { 'Ok' :
|
|
293
|
+
export type Result_1 = { 'Ok' : null } |
|
|
294
|
+
{ 'Err' : SimulatorError };
|
|
295
|
+
export type Result_2 = { 'Ok' : SpawnResult } |
|
|
294
296
|
{ 'Err' : SimulatorError };
|
|
295
297
|
/**
|
|
296
298
|
* `variant { ok : RideView; err : ProtocolError }`.
|
|
@@ -336,6 +338,48 @@ export interface RideView {
|
|
|
336
338
|
*/
|
|
337
339
|
'driverPosition' : [] | [Geo],
|
|
338
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* `variant { ok : RouteLine; err : ProtocolError }` (P-19).
|
|
343
|
+
*/
|
|
344
|
+
export type RouteAnswer = { 'ok' : RouteLine } |
|
|
345
|
+
{ 'err' : ProtocolError };
|
|
346
|
+
/**
|
|
347
|
+
* P-17 (2026-10-24, route line): the route of a quote in two legs, each a Google encoded
|
|
348
|
+
* polyline of precision 6 — `toPickup` from the driver's exact position to A, `ride` A → B.
|
|
349
|
+
* Bounds and checks: `crate::polyline`.
|
|
350
|
+
*/
|
|
351
|
+
export interface RouteLine { 'ride' : string, 'toPickup' : string }
|
|
352
|
+
/**
|
|
353
|
+
* S-N13: a quote request waiting for the router: route me → A → B.
|
|
354
|
+
*/
|
|
355
|
+
export interface RouteTaskView {
|
|
356
|
+
/**
|
|
357
|
+
* The router has until then; after `ROUTER_WAIT_NS` the quote goes without it.
|
|
358
|
+
*/
|
|
359
|
+
'untilNs' : bigint,
|
|
360
|
+
'destination' : Geo,
|
|
361
|
+
'requestId' : string,
|
|
362
|
+
'from' : Geo,
|
|
363
|
+
'pickup' : Geo,
|
|
364
|
+
'driverKey' : string,
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* S-N13: the core sets the router (an admin's `setSimulatorRouter`); none removes it.
|
|
368
|
+
*/
|
|
369
|
+
export interface SetRouterArgs { 'router' : [] | [Principal] }
|
|
370
|
+
/**
|
|
371
|
+
* S-N13: the router's answer — metres, seconds and the line, like the driver front's
|
|
372
|
+
* `RouteResult`, for one virtual driver.
|
|
373
|
+
*/
|
|
374
|
+
export interface SimRouteResult {
|
|
375
|
+
'requestId' : string,
|
|
376
|
+
'rideMeters' : number,
|
|
377
|
+
'rideSec' : number,
|
|
378
|
+
'routeLine' : [] | [RouteLine],
|
|
379
|
+
'driverKey' : string,
|
|
380
|
+
'toPickupSec' : number,
|
|
381
|
+
'toPickupMeters' : number,
|
|
382
|
+
}
|
|
339
383
|
export type SimulatorError = {
|
|
340
384
|
/**
|
|
341
385
|
* The coordinator or a worker refused or did not answer.
|
|
@@ -352,6 +396,10 @@ export interface SimulatorStatus {
|
|
|
352
396
|
'liveDrivers' : bigint,
|
|
353
397
|
'events' : Array<Event>,
|
|
354
398
|
'drivers' : bigint,
|
|
399
|
+
/**
|
|
400
|
+
* S-N13 (a new reply field: opt).
|
|
401
|
+
*/
|
|
402
|
+
'router' : [] | [Principal],
|
|
355
403
|
'rides' : bigint,
|
|
356
404
|
}
|
|
357
405
|
export interface SpawnArgs {
|
|
@@ -387,6 +435,14 @@ export interface _SERVICE {
|
|
|
387
435
|
'cancelRide' : ActorMethod<[RideRef], ProtocolAnswer>,
|
|
388
436
|
'getLicence' : ActorMethod<[RideRef], LicenceAnswer>,
|
|
389
437
|
'getRide' : ActorMethod<[RideRef], RideAnswer>,
|
|
438
|
+
/**
|
|
439
|
+
* S-N14 (P-19): the line of the ride for its rider, while the ride is active.
|
|
440
|
+
*/
|
|
441
|
+
'getRideRoute' : ActorMethod<[RideRef], RouteAnswer>,
|
|
442
|
+
/**
|
|
443
|
+
* S-N13: the quote requests that wait for a route (at most 5 s each), the oldest first.
|
|
444
|
+
*/
|
|
445
|
+
'getRouteTasks' : ActorMethod<[], Result>,
|
|
390
446
|
'getStatus' : ActorMethod<[], SimulatorStatus>,
|
|
391
447
|
'http_request' : ActorMethod<[HttpRequest], HttpResponse>,
|
|
392
448
|
'protocolVersion' : ActorMethod<[], number>,
|
|
@@ -403,15 +459,25 @@ export interface _SERVICE {
|
|
|
403
459
|
* job timer right away).
|
|
404
460
|
*/
|
|
405
461
|
'rideOrder' : ActorMethod<[RideOrder], ProtocolAnswer>,
|
|
462
|
+
/**
|
|
463
|
+
* S-N13: the core only (an admin's `setSimulatorRouter`): the one principal that routes the
|
|
464
|
+
* virtual drivers' quotes, like a driver's front; none = the straight line again.
|
|
465
|
+
*/
|
|
466
|
+
'setRouter' : ActorMethod<[SetRouterArgs], Result_1>,
|
|
406
467
|
/**
|
|
407
468
|
* S-15: ×10 for one request (`requestId`), not the whole canister.
|
|
408
469
|
*/
|
|
409
|
-
'setSpeedUp' : ActorMethod<[SpeedUpArgs],
|
|
470
|
+
'setSpeedUp' : ActorMethod<[SpeedUpArgs], Result_1>,
|
|
410
471
|
/**
|
|
411
472
|
* S-2, S-3: virtual drivers around a point, each registered in the worker of its cell
|
|
412
473
|
* with `validUntilNs` (30 min) instead of a pulse.
|
|
413
474
|
*/
|
|
414
|
-
'spawnDrivers' : ActorMethod<[SpawnArgs],
|
|
475
|
+
'spawnDrivers' : ActorMethod<[SpawnArgs], Result_2>,
|
|
476
|
+
/**
|
|
477
|
+
* S-N13: the router's route for one virtual driver — metres, seconds, the line. The quote
|
|
478
|
+
* goes with it at its moment (S-8), or at once when that moment has passed.
|
|
479
|
+
*/
|
|
480
|
+
'submitRoute' : ActorMethod<[SimRouteResult], Result_1>,
|
|
415
481
|
}
|
|
416
482
|
export declare const idlFactory: IDL.InterfaceFactory;
|
|
417
483
|
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|