@jsm-mit/tigi-sharded-package 0.2.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.
- package/README.md +51 -3
- 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 +210 -45
- package/declarations/core/core.did.d.ts +191 -43
- package/declarations/core/core.did.js +146 -42
- 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/driver-canisters-actor.d.ts +77 -0
- package/dist/actors/driver-canisters-actor.d.ts.map +1 -0
- package/dist/actors/driver-canisters-actor.js +147 -0
- 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 +44 -2
- 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 +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/interfaces.d.ts +43 -1
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/mappers.d.ts +7 -2
- package/dist/mappers.d.ts.map +1 -1
- package/dist/mappers.js +17 -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_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,
|
|
@@ -71,6 +71,10 @@ export const idlFactory = ({ IDL }) => {
|
|
|
71
71
|
'rider' : IDL.Principal,
|
|
72
72
|
'reason' : IDL.Text,
|
|
73
73
|
});
|
|
74
|
+
const ClaimArgs = IDL.Record({
|
|
75
|
+
'code' : IDL.Text,
|
|
76
|
+
'canister' : IDL.Principal,
|
|
77
|
+
});
|
|
74
78
|
const WasmKind = IDL.Variant({ 'simulator' : IDL.Null, 'driver' : IDL.Null });
|
|
75
79
|
const WasmCommitArgs = IDL.Record({
|
|
76
80
|
'sha256' : IDL.Vec(IDL.Nat8),
|
|
@@ -83,9 +87,9 @@ export const idlFactory = ({ IDL }) => {
|
|
|
83
87
|
'size' : IDL.Nat,
|
|
84
88
|
'committedAtNs' : IDL.Int,
|
|
85
89
|
});
|
|
86
|
-
const
|
|
87
|
-
const
|
|
88
|
-
const
|
|
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({
|
|
89
93
|
'ok' : IDL.Vec(IDL.Principal),
|
|
90
94
|
'err' : Error,
|
|
91
95
|
});
|
|
@@ -101,13 +105,46 @@ export const idlFactory = ({ IDL }) => {
|
|
|
101
105
|
'pendingSinceNs' : IDL.Opt(IDL.Int),
|
|
102
106
|
'rooms' : IDL.Nat,
|
|
103
107
|
});
|
|
104
|
-
const
|
|
108
|
+
const Result_26 = IDL.Variant({ 'ok' : ChatRoomsStatus, 'err' : Error });
|
|
105
109
|
const DriverCanisterStatus = IDL.Record({
|
|
106
110
|
'moduleHash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
107
111
|
'blocked' : IDL.Bool,
|
|
108
112
|
'registered' : IDL.Bool,
|
|
109
113
|
});
|
|
110
|
-
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_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 });
|
|
111
148
|
const FactoryStatus = IDL.Record({
|
|
112
149
|
'simulator' : IDL.Opt(IDL.Principal),
|
|
113
150
|
'mode' : Mode,
|
|
@@ -119,7 +156,20 @@ export const idlFactory = ({ IDL }) => {
|
|
|
119
156
|
'driverWasm' : IDL.Opt(WasmInfo),
|
|
120
157
|
'registered' : IDL.Nat,
|
|
121
158
|
});
|
|
122
|
-
const
|
|
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 });
|
|
123
173
|
const Profile = IDL.Record({
|
|
124
174
|
'updatedAtNs' : IDL.Int,
|
|
125
175
|
'name' : IDL.Text,
|
|
@@ -127,7 +177,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
127
177
|
});
|
|
128
178
|
const Result_4 = IDL.Variant({ 'ok' : Profile, 'err' : Error });
|
|
129
179
|
const Rating = IDL.Record({ 'sum' : IDL.Nat, 'count' : IDL.Nat });
|
|
130
|
-
const
|
|
180
|
+
const Result_19 = IDL.Variant({ 'ok' : IDL.Opt(Rating), 'err' : Error });
|
|
131
181
|
const RidesPageArgs = IDL.Record({
|
|
132
182
|
'beforeIndex' : IDL.Opt(IDL.Nat),
|
|
133
183
|
'limit' : IDL.Nat,
|
|
@@ -151,13 +201,13 @@ export const idlFactory = ({ IDL }) => {
|
|
|
151
201
|
'nextBeforeIndex' : IDL.Opt(IDL.Nat),
|
|
152
202
|
'rides' : IDL.Vec(RideEntry),
|
|
153
203
|
});
|
|
154
|
-
const
|
|
204
|
+
const Result_18 = IDL.Variant({ 'ok' : RidesPage, 'err' : Error });
|
|
155
205
|
const ProfilesArgs = IDL.Record({ 'principals' : IDL.Vec(IDL.Principal) });
|
|
156
206
|
const ProfileEntry = IDL.Record({
|
|
157
207
|
'principal' : IDL.Principal,
|
|
158
208
|
'name' : IDL.Text,
|
|
159
209
|
});
|
|
160
|
-
const
|
|
210
|
+
const Result_17 = IDL.Variant({
|
|
161
211
|
'ok' : IDL.Vec(ProfileEntry),
|
|
162
212
|
'err' : Error,
|
|
163
213
|
});
|
|
@@ -171,8 +221,8 @@ export const idlFactory = ({ IDL }) => {
|
|
|
171
221
|
'knownWorkers' : IDL.Vec(IDL.Principal),
|
|
172
222
|
'coordinator' : IDL.Opt(IDL.Principal),
|
|
173
223
|
});
|
|
174
|
-
const
|
|
175
|
-
const
|
|
224
|
+
const Result_16 = IDL.Variant({ 'ok' : Wiring, 'err' : Error });
|
|
225
|
+
const Result_15 = IDL.Variant({
|
|
176
226
|
'ok' : IDL.Record({
|
|
177
227
|
'subjects' : IDL.Nat,
|
|
178
228
|
'headSeq' : IDL.Nat64,
|
|
@@ -193,8 +243,19 @@ export const idlFactory = ({ IDL }) => {
|
|
|
193
243
|
'driverCanister' : IDL.Principal,
|
|
194
244
|
'rider' : IDL.Principal,
|
|
195
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
|
+
});
|
|
196
256
|
const RideBatch = IDL.Record({
|
|
197
257
|
'ratings' : IDL.Vec(RatingEntry),
|
|
258
|
+
'usage' : IDL.Opt(UsageBatch),
|
|
198
259
|
'rides' : IDL.Vec(RideEntry),
|
|
199
260
|
});
|
|
200
261
|
const RideBatchResult = IDL.Record({
|
|
@@ -203,12 +264,28 @@ export const idlFactory = ({ IDL }) => {
|
|
|
203
264
|
'rejected' : IDL.Nat,
|
|
204
265
|
'ratingsCounted' : IDL.Nat,
|
|
205
266
|
});
|
|
206
|
-
const
|
|
267
|
+
const Result_14 = IDL.Variant({ 'ok' : RideBatchResult, 'err' : Error });
|
|
268
|
+
const ClaimCode = IDL.Record({
|
|
269
|
+
'expiresAtNs' : IDL.Int,
|
|
270
|
+
'code' : IDL.Text,
|
|
271
|
+
'canister' : IDL.Principal,
|
|
272
|
+
});
|
|
273
|
+
const LeasedCanister = IDL.Record({
|
|
274
|
+
'moduleHash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
|
|
275
|
+
'owner' : IDL.Principal,
|
|
276
|
+
'blocked' : IDL.Bool,
|
|
277
|
+
'kind' : DriverCanisterKind,
|
|
278
|
+
'claim' : IDL.Opt(ClaimCode),
|
|
279
|
+
'createdAtNs' : IDL.Int,
|
|
280
|
+
'canister' : IDL.Principal,
|
|
281
|
+
'installedAtNs' : IDL.Opt(IDL.Int),
|
|
282
|
+
'leaseUntilNs' : IDL.Opt(IDL.Int),
|
|
283
|
+
});
|
|
207
284
|
const LeaseAnswer = IDL.Variant({
|
|
208
285
|
'busy' : IDL.Record({ 'untilNs' : IDL.Int }),
|
|
209
|
-
'leased' :
|
|
286
|
+
'leased' : LeasedCanister,
|
|
210
287
|
});
|
|
211
|
-
const
|
|
288
|
+
const Result_13 = IDL.Variant({ 'ok' : LeaseAnswer, 'err' : Error });
|
|
212
289
|
const PageArgs = IDL.Record({ 'offset' : IDL.Nat, 'limit' : IDL.Nat });
|
|
213
290
|
const BlockTarget = IDL.Variant({
|
|
214
291
|
'driverCanister' : IDL.Principal,
|
|
@@ -224,12 +301,16 @@ export const idlFactory = ({ IDL }) => {
|
|
|
224
301
|
'target' : BlockTarget,
|
|
225
302
|
'reason' : IDL.Text,
|
|
226
303
|
});
|
|
227
|
-
const
|
|
304
|
+
const Result_12 = IDL.Variant({ 'ok' : IDL.Vec(Block), 'err' : Error });
|
|
228
305
|
const DriverCanistersPage = IDL.Record({
|
|
229
306
|
'total' : IDL.Nat,
|
|
230
307
|
'canisters' : IDL.Vec(DriverCanister),
|
|
231
308
|
});
|
|
232
|
-
const
|
|
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
|
+
});
|
|
233
314
|
const DriverRoomView = IDL.Record({
|
|
234
315
|
'recipient' : IDL.Principal,
|
|
235
316
|
'driverKey' : IDL.Text,
|
|
@@ -238,12 +319,25 @@ export const idlFactory = ({ IDL }) => {
|
|
|
238
319
|
'roomId' : IDL.Text,
|
|
239
320
|
'synced' : IDL.Bool,
|
|
240
321
|
});
|
|
241
|
-
const
|
|
322
|
+
const Result_9 = IDL.Variant({
|
|
242
323
|
'ok' : IDL.Vec(DriverRoomView),
|
|
243
324
|
'err' : Error,
|
|
244
325
|
});
|
|
245
|
-
const
|
|
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 });
|
|
335
|
+
const ClaimTtlArgs = IDL.Record({ 'seconds' : IDL.Nat });
|
|
336
|
+
const Result = IDL.Variant({ 'ok' : IDL.Nat, 'err' : Error });
|
|
337
|
+
const Result_5 = IDL.Variant({ 'ok' : FeeRates, 'err' : Error });
|
|
246
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 });
|
|
247
341
|
const UnblockDriverArgs = IDL.Record({
|
|
248
342
|
'driverKey' : IDL.Opt(IDL.Text),
|
|
249
343
|
'canister' : IDL.Principal,
|
|
@@ -255,52 +349,62 @@ export const idlFactory = ({ IDL }) => {
|
|
|
255
349
|
'bytes' : IDL.Vec(IDL.Nat8),
|
|
256
350
|
'index' : IDL.Nat32,
|
|
257
351
|
});
|
|
258
|
-
const Result = IDL.Variant({ 'ok' : IDL.Nat, 'err' : Error });
|
|
259
352
|
const TigiCore = IDL.Service({
|
|
260
353
|
'abortDriverRollout' : IDL.Func([], [Result_3], []),
|
|
261
354
|
'addAdmin' : IDL.Func([PrincipalArgs], [Result_2], []),
|
|
262
|
-
'addPoolCanister' : IDL.Func([CanisterArgs], [
|
|
355
|
+
'addPoolCanister' : IDL.Func([CanisterArgs], [Result_20], []),
|
|
263
356
|
'blockDriver' : IDL.Func([BlockDriverArgs], [Result_2], []),
|
|
264
357
|
'blockRider' : IDL.Func([BlockRiderArgs], [Result_2], []),
|
|
358
|
+
'claimDriverCanister' : IDL.Func([ClaimArgs], [Result_20], []),
|
|
265
359
|
'clearLogs' : IDL.Func([], [], []),
|
|
266
|
-
'commitDriverWasm' : IDL.Func([WasmCommitArgs], [
|
|
267
|
-
'createLocalPoolCanister' : IDL.Func([], [
|
|
268
|
-
'createMyDriverCanister' : IDL.Func([], [
|
|
269
|
-
'ensureSimulator' : IDL.Func([], [
|
|
270
|
-
'extendDemoLease' : IDL.Func([], [
|
|
271
|
-
'getAdmins' : IDL.Func([], [
|
|
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']),
|
|
272
366
|
'getChatConfig' : IDL.Func([], [IDL.Opt(ChatConfig)], ['query']),
|
|
273
|
-
'getChatRoomsStatus' : IDL.Func([], [
|
|
367
|
+
'getChatRoomsStatus' : IDL.Func([], [Result_26], ['query']),
|
|
274
368
|
'getDriverCanisterStatus' : IDL.Func(
|
|
275
369
|
[CanisterArgs],
|
|
276
370
|
[DriverCanisterStatus],
|
|
277
371
|
['query'],
|
|
278
372
|
),
|
|
279
|
-
'
|
|
280
|
-
'
|
|
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']),
|
|
281
378
|
'getLogs' : IDL.Func([], [IDL.Text], ['query']),
|
|
282
|
-
'getMyDriverCanister' : IDL.Func([], [
|
|
379
|
+
'getMyDriverCanister' : IDL.Func([], [Result_20], ['query']),
|
|
283
380
|
'getMyProfile' : IDL.Func([], [Result_4], ['query']),
|
|
284
|
-
'getMyRating' : IDL.Func([], [
|
|
285
|
-
'getMyRides' : IDL.Func([RidesPageArgs], [
|
|
286
|
-
'getProfiles' : IDL.Func([ProfilesArgs], [
|
|
381
|
+
'getMyRating' : IDL.Func([], [Result_19], ['query']),
|
|
382
|
+
'getMyRides' : IDL.Func([RidesPageArgs], [Result_18], ['query']),
|
|
383
|
+
'getProfiles' : IDL.Func([ProfilesArgs], [Result_17], ['query']),
|
|
287
384
|
'getReleasedDriverWasms' : IDL.Func([], [IDL.Vec(ReleasedWasm)], ['query']),
|
|
288
385
|
'getSimulator' : IDL.Func([], [IDL.Opt(IDL.Principal)], ['query']),
|
|
289
|
-
'getWiring' : IDL.Func([], [
|
|
290
|
-
'getWorkerOutbox' : IDL.Func([], [
|
|
386
|
+
'getWiring' : IDL.Func([], [Result_16], ['query']),
|
|
387
|
+
'getWorkerOutbox' : IDL.Func([], [Result_15], ['query']),
|
|
291
388
|
'helloFromWorker' : IDL.Func([], [Result_2], []),
|
|
292
|
-
'ingestRideBatch' : IDL.Func([RideBatch], [
|
|
389
|
+
'ingestRideBatch' : IDL.Func([RideBatch], [Result_14], []),
|
|
293
390
|
'isUser' : IDL.Func([IDL.Principal], [IDL.Bool], ['query']),
|
|
294
|
-
'leaseDemoDriverCanister' : IDL.Func([], [
|
|
295
|
-
'listBlocks' : IDL.Func([PageArgs], [
|
|
296
|
-
'listDriverCanisters' : IDL.Func([PageArgs], [
|
|
297
|
-
'
|
|
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], []),
|
|
298
398
|
'removeAdmin' : IDL.Func([PrincipalArgs], [Result_2], []),
|
|
299
399
|
'resumeDriverRollout' : IDL.Func([], [Result_3], []),
|
|
300
|
-
'setChatConfig' : IDL.Func([ChatConfig], [
|
|
400
|
+
'setChatConfig' : IDL.Func([ChatConfig], [Result_6], []),
|
|
401
|
+
'setClaimCodeTtl' : IDL.Func([ClaimTtlArgs], [Result], []),
|
|
402
|
+
'setFeeRates' : IDL.Func([FeeRates], [Result_5], []),
|
|
301
403
|
'setLoggingEnabled' : IDL.Func([IDL.Bool], [Result_2], []),
|
|
302
404
|
'setLowCyclesBelow' : IDL.Func([IDL.Nat], [Result_2], []),
|
|
303
405
|
'setMyProfile' : IDL.Func([SetProfileArgs], [Result_4], []),
|
|
406
|
+
'setSimulatorRouter' : IDL.Func([SimulatorRouterArgs], [Result_2], []),
|
|
407
|
+
'setTestDayOffset' : IDL.Func([TestDayArgs], [Result], []),
|
|
304
408
|
'startDriverRollout' : IDL.Func([], [Result_3], []),
|
|
305
409
|
'unblockDriver' : IDL.Func([UnblockDriverArgs], [Result_2], []),
|
|
306
410
|
'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[];
|