@engramx/idl 0.16.0-rc.4 → 0.16.0-rc.6
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/dist/engram.did +143 -121
- package/dist/engram.idl.d.ts +137 -120
- package/dist/engram.idl.js +125 -120
- package/dist/market.did +86 -35
- package/dist/market.idl.d.ts +83 -35
- package/dist/market.idl.js +41 -35
- package/package.json +2 -2
package/dist/market.did
CHANGED
|
@@ -171,88 +171,93 @@ type RevenueSummary =
|
|
|
171
171
|
type Result_9 =
|
|
172
172
|
variant {
|
|
173
173
|
Err: Error;
|
|
174
|
-
Ok:
|
|
174
|
+
Ok: Page_5;
|
|
175
175
|
};
|
|
176
176
|
type Result_8 =
|
|
177
177
|
variant {
|
|
178
178
|
Err: Error;
|
|
179
|
-
Ok:
|
|
179
|
+
Ok: Page_4;
|
|
180
180
|
};
|
|
181
181
|
type Result_7 =
|
|
182
182
|
variant {
|
|
183
183
|
Err: Error;
|
|
184
|
-
Ok:
|
|
184
|
+
Ok: Page_2;
|
|
185
185
|
};
|
|
186
186
|
type Result_6 =
|
|
187
187
|
variant {
|
|
188
188
|
Err: Error;
|
|
189
|
-
Ok:
|
|
189
|
+
Ok: Page_1;
|
|
190
190
|
};
|
|
191
191
|
type Result_5 =
|
|
192
192
|
variant {
|
|
193
193
|
Err: Error;
|
|
194
|
-
Ok:
|
|
194
|
+
Ok: SessionState;
|
|
195
195
|
};
|
|
196
196
|
type Result_4 =
|
|
197
197
|
variant {
|
|
198
198
|
Err: Error;
|
|
199
|
-
Ok:
|
|
199
|
+
Ok: PaymentQuote;
|
|
200
200
|
};
|
|
201
201
|
type Result_3 =
|
|
202
202
|
variant {
|
|
203
203
|
Err: Error;
|
|
204
|
-
Ok:
|
|
204
|
+
Ok: EscrowRecovery;
|
|
205
205
|
};
|
|
206
206
|
type Result_2 =
|
|
207
207
|
variant {
|
|
208
208
|
Err: Error;
|
|
209
209
|
Ok: text;
|
|
210
210
|
};
|
|
211
|
-
type
|
|
211
|
+
type Result_19 =
|
|
212
212
|
variant {
|
|
213
213
|
Err: Error;
|
|
214
214
|
Ok: X402Endpoint;
|
|
215
215
|
};
|
|
216
|
-
type
|
|
216
|
+
type Result_18 =
|
|
217
217
|
variant {
|
|
218
218
|
Err: Error;
|
|
219
219
|
Ok: ServiceRequestResponse;
|
|
220
220
|
};
|
|
221
|
-
type
|
|
221
|
+
type Result_17 =
|
|
222
222
|
variant {
|
|
223
223
|
Err: Error;
|
|
224
224
|
Ok: ContentResponse;
|
|
225
225
|
};
|
|
226
|
-
type
|
|
226
|
+
type Result_16 =
|
|
227
227
|
variant {
|
|
228
228
|
Err: Error;
|
|
229
229
|
Ok: opt text;
|
|
230
230
|
};
|
|
231
|
-
type
|
|
231
|
+
type Result_15 =
|
|
232
232
|
variant {
|
|
233
233
|
Err: Error;
|
|
234
234
|
Ok: Job;
|
|
235
235
|
};
|
|
236
|
-
type
|
|
236
|
+
type Result_14 =
|
|
237
237
|
variant {
|
|
238
238
|
Err: Error;
|
|
239
239
|
Ok: blob;
|
|
240
240
|
};
|
|
241
|
-
type
|
|
241
|
+
type Result_13 =
|
|
242
242
|
variant {
|
|
243
243
|
Err: Error;
|
|
244
244
|
Ok: JobStatus;
|
|
245
245
|
};
|
|
246
|
-
type
|
|
246
|
+
type Result_12 =
|
|
247
247
|
variant {
|
|
248
248
|
Err: Error;
|
|
249
249
|
Ok: RevenueSummary;
|
|
250
250
|
};
|
|
251
|
-
type
|
|
251
|
+
type Result_11 =
|
|
252
252
|
variant {
|
|
253
253
|
Err: Error;
|
|
254
254
|
Ok: SellerStatus;
|
|
255
255
|
};
|
|
256
|
+
type Result_10 =
|
|
257
|
+
variant {
|
|
258
|
+
Err: Error;
|
|
259
|
+
Ok: Page_7;
|
|
260
|
+
};
|
|
256
261
|
type Result_1 =
|
|
257
262
|
variant {
|
|
258
263
|
Err: Error;
|
|
@@ -466,6 +471,11 @@ type GenesisNote =
|
|
|
466
471
|
predecessorSize: opt nat;
|
|
467
472
|
version: text;
|
|
468
473
|
};
|
|
474
|
+
type EscrowRecovery =
|
|
475
|
+
record {
|
|
476
|
+
amount: TokenAmount;
|
|
477
|
+
blockIndex: nat;
|
|
478
|
+
};
|
|
469
479
|
type Error =
|
|
470
480
|
variant {
|
|
471
481
|
Conflict: text;
|
|
@@ -616,6 +626,9 @@ service : {
|
|
|
616
626
|
/// is RATIFIED as the 0.16.0 contract (the owner's ruling of 2026-10-02, the pre-cut
|
|
617
627
|
/// recommendation); giving the library one arm per kind of refusal is post-cut dependency work,
|
|
618
628
|
/// not a change made mid-cut.
|
|
629
|
+
/// ⟨2026-10-07, beside the count above⟩ Twelve: the admin's `retrySellerPayment` (the owner's
|
|
630
|
+
/// decision of that day) passes the library's settle refusal through as `#Conflict` too — state
|
|
631
|
+
/// behind this canister's own gate, like the other six.
|
|
619
632
|
///
|
|
620
633
|
/// It also refuses while TRADE IS FROZEN, and that one is a true `#Conflict` — the refusal says
|
|
621
634
|
/// so explicitly ("Not a permission problem and not a missing job"), and `isTradeFrozen()` is the
|
|
@@ -649,7 +662,7 @@ service : {
|
|
|
649
662
|
/// Born disabled deliberately: a listing that went live at creation would be sellable before its
|
|
650
663
|
/// price was set, and `price` starts at 0 with `suggestedPrice` as the fallback.
|
|
651
664
|
createEndpoint: (name: text, description: text, contentId: text,
|
|
652
|
-
suggestedPriceE6: nat) -> (
|
|
665
|
+
suggestedPriceE6: nat) -> (Result_19);
|
|
653
666
|
/// Submit a paid service request. Returns a job id, or the price.
|
|
654
667
|
///
|
|
655
668
|
/// ⟨0.16.0⟩ TWO GATES FROM THE ENGRAM DO NOT TRAVEL, and both for the same reason: they were the
|
|
@@ -664,7 +677,7 @@ service : {
|
|
|
664
677
|
///
|
|
665
678
|
/// What DOES gate here is the market's freeze, and the service's own existence and pricing mode.
|
|
666
679
|
createJob: (serviceId: text, params: blob, paymentSig:
|
|
667
|
-
opt PaymentSignature) -> (
|
|
680
|
+
opt PaymentSignature) -> (Result_18);
|
|
668
681
|
/// Delete content.
|
|
669
682
|
///
|
|
670
683
|
/// ⚠ THE QUOTA IS NOT REFUNDED, and this is the honest part of the design rather than a
|
|
@@ -753,7 +766,7 @@ service : {
|
|
|
753
766
|
/// before the nonce lock or any ledger call, and the refusal reaches the buyer as #Refused with
|
|
754
767
|
/// ic402's text naming both principals. Pay as the principal that approved the allowance.
|
|
755
768
|
getContent: (contentId: text, paymentSig: opt PaymentSignature) ->
|
|
756
|
-
(
|
|
769
|
+
(Result_17);
|
|
757
770
|
/// ⟨0.16.0⟩ THE `getChunk` FIX, and it is the sharpest single case in the corpus.
|
|
758
771
|
///
|
|
759
772
|
/// The engram's version was:
|
|
@@ -778,13 +791,13 @@ service : {
|
|
|
778
791
|
/// list they scan holds authorization helpers only — so a refusal fabricated behind a payment
|
|
779
792
|
/// check was out of scope by construction rather than by ruling. L11 adds payment gates to that
|
|
780
793
|
/// list; this method is why.
|
|
781
|
-
getContentChunk: (grant: AccessGrant, index: nat) -> (
|
|
794
|
+
getContentChunk: (grant: AccessGrant, index: nat) -> (Result_14) query;
|
|
782
795
|
/// A seller's payout address — THEIRS, or the admin's to read.
|
|
783
796
|
///
|
|
784
797
|
/// The engram made this owner-only and TRAPPED at everyone else. Here the answer is a refusal a
|
|
785
798
|
/// caller can read, and `#Ok(null)` genuinely means "this seller has set no payout address" —
|
|
786
799
|
/// distinguishable from "you may not ask", which is the whole point of the envelope.
|
|
787
|
-
getEvmSellerPayout: (seller: principal) -> (
|
|
800
|
+
getEvmSellerPayout: (seller: principal) -> (Result_16) query;
|
|
788
801
|
/// PUBLIC: what this canister's chains continue, or that they continue nothing. A fresh chain
|
|
789
802
|
/// beside a published predecessor head is auditable; a fresh chain with no statement is
|
|
790
803
|
/// indistinguishable from a wipe.
|
|
@@ -797,7 +810,7 @@ service : {
|
|
|
797
810
|
/// collapsed "unknown jobId" and "not authorized", and the product rendered the wrong conclusion
|
|
798
811
|
/// from it — the marketplace UI printed "Job not found (or not yet visible)" at a caller who was
|
|
799
812
|
/// merely unauthorized. Job existence is not the secret: `getJobCounts()` is ungated.
|
|
800
|
-
getJob: (jobId: text) -> (
|
|
813
|
+
getJob: (jobId: text) -> (Result_15) query;
|
|
801
814
|
/// PUBLIC: aggregate counts that identify nobody — and already public on the engram, which is
|
|
802
815
|
/// what made `listJobs`' existence-leak justification false.
|
|
803
816
|
getJobCounts: () -> (JobCounts) query;
|
|
@@ -810,7 +823,7 @@ service : {
|
|
|
810
823
|
///
|
|
811
824
|
/// Three outcomes, three answers now. And `Payer` (above) removes the root cause rather than
|
|
812
825
|
/// only labelling it.
|
|
813
|
-
getJobResult: (jobId: text) -> (
|
|
826
|
+
getJobResult: (jobId: text) -> (Result_14) query;
|
|
814
827
|
/// Terminal money settlement — the seller gets paid. Honours the freeze exactly like every
|
|
815
828
|
/// other settle path; a settlement that ignored the freeze would make the freeze a suggestion.
|
|
816
829
|
/// PUBLIC: a job's state, and nothing else about it.
|
|
@@ -825,7 +838,7 @@ service : {
|
|
|
825
838
|
///
|
|
826
839
|
/// The engram returned `?EngramJobStatus`, conflating "no such job" with a null-ish answer. Here
|
|
827
840
|
/// a missing job is `#NotFound`, which is a fact rather than an absence a caller has to interpret.
|
|
828
|
-
getJobStatus: (jobId: text) -> (
|
|
841
|
+
getJobStatus: (jobId: text) -> (Result_13) query;
|
|
829
842
|
/// PUBLIC: the market's spend limits, with the caller rosters REDACTED.
|
|
830
843
|
///
|
|
831
844
|
/// The limits themselves are already public — they are advertised inside every 402 challenge, so
|
|
@@ -848,7 +861,7 @@ service : {
|
|
|
848
861
|
/// Anonymous is refused rather than answered with zeroes. A zero here is a real business fact —
|
|
849
862
|
/// "you have sold nothing" — and returning it to a caller who simply has no identity is the
|
|
850
863
|
/// fabricated-empty defect wearing a number instead of a list.
|
|
851
|
-
getRevenueSummary: () -> (
|
|
864
|
+
getRevenueSummary: () -> (Result_12) query;
|
|
852
865
|
/// PUBLIC: what a buyer can learn about a seller, and the whole of it.
|
|
853
866
|
///
|
|
854
867
|
/// The ENGRAM ID is the point of this read. This market runs no reputation system and issues no
|
|
@@ -859,7 +872,7 @@ service : {
|
|
|
859
872
|
///
|
|
860
873
|
/// `verified` is about ownership at a moment in time and nothing else. It is not an endorsement,
|
|
861
874
|
/// and the field name is the strongest claim it makes.
|
|
862
|
-
getSellerStatus: (seller: principal) -> (
|
|
875
|
+
getSellerStatus: (seller: principal) -> (Result_11) query;
|
|
863
876
|
/// PUBLIC: aggregate session counts. Identifies nobody, and the same reasoning as getJobCounts —
|
|
864
877
|
/// which is also what made `listJobs`' old "no existence leak" defence false.
|
|
865
878
|
getSessionCounts: () -> (SessionCounts) query;
|
|
@@ -938,17 +951,17 @@ service : {
|
|
|
938
951
|
isTradeFrozen: () -> (bool) query;
|
|
939
952
|
/// `total` is the head counter, not the row count: this is a bounded ring, so a page that
|
|
940
953
|
/// reported only what it returned would make a trimmed log look complete.
|
|
941
|
-
listAuditEntries: (start: nat, limit: nat) -> (
|
|
954
|
+
listAuditEntries: (start: nat, limit: nat) -> (Result_9) query;
|
|
942
955
|
/// Admin AND the enrolled viewers themselves — L8's roster rule. A viewer who cannot see the
|
|
943
956
|
/// roster cannot tell whether their own enrolment survived a rotation.
|
|
944
|
-
listAuditViewers: () -> (
|
|
957
|
+
listAuditViewers: () -> (Result_10) query;
|
|
945
958
|
/// PUBLIC: the catalogue is the storefront. A shop that refuses to say what it sells to
|
|
946
959
|
/// anyone who has not already bought is not a shop.
|
|
947
960
|
listContent: (start: nat, limit: nat) -> (Page_6) query;
|
|
948
961
|
/// L11 names this canister's reason for having a denial log at all: the commerce surface is where
|
|
949
962
|
/// the fabricated-empty class was born, and a refusal that leaves no trace cannot be counted,
|
|
950
963
|
/// alerted on, or disproved.
|
|
951
|
-
listDenialEntries: (start: nat, limit: nat) -> (
|
|
964
|
+
listDenialEntries: (start: nat, limit: nat) -> (Result_9) query;
|
|
952
965
|
/// Purchase history for one endpoint: its creator sees every row, a buyer sees their own.
|
|
953
966
|
///
|
|
954
967
|
/// ⟨0.16.0⟩ Two defects close here at once, and they are the same defect wearing two hats.
|
|
@@ -962,7 +975,7 @@ service : {
|
|
|
962
975
|
/// few sales. `withheld` now counts them, so "no purchases here" and "not yours to see" are
|
|
963
976
|
/// different answers — without naming whose they were.
|
|
964
977
|
listEndpointPurchases: (endpointId: text, start: nat, limit: nat) ->
|
|
965
|
-
(
|
|
978
|
+
(Result_8) query;
|
|
966
979
|
/// PUBLIC: the shelves, like the catalogue. `#Deleted` listings are excluded from an
|
|
967
980
|
/// unfiltered read and COUNTED in `withheld` — a shop with three deleted listings and a shop with
|
|
968
981
|
/// none look different, which is the honest answer, without publishing what was withdrawn.
|
|
@@ -990,7 +1003,7 @@ service : {
|
|
|
990
1003
|
/// Now: `#Refused` when the caller may not ask, `#NotFound` when the service does not exist —
|
|
991
1004
|
/// two facts that were one empty list.
|
|
992
1005
|
listJobs: (serviceId: text, statusFilter: opt JobStatus, start: nat, limit:
|
|
993
|
-
nat) -> (
|
|
1006
|
+
nat) -> (Result_7) query;
|
|
994
1007
|
/// The parked withdrawals belonging to this caller, so an unresolved payout is discoverable
|
|
995
1008
|
/// rather than something a seller has to already know the id of.
|
|
996
1009
|
///
|
|
@@ -1005,7 +1018,7 @@ service : {
|
|
|
1005
1018
|
/// not see, so nothing is ever hidden from them — unlike `listEndpointPurchases`, where a
|
|
1006
1019
|
/// non-owner's view withholds other buyers' rows. Stated because a reader comparing the two
|
|
1007
1020
|
/// should know the zero is a fact about this surface, not an unimplemented field.
|
|
1008
|
-
listMyPendingWithdrawals: (start: nat, limit: nat) -> (
|
|
1021
|
+
listMyPendingWithdrawals: (start: nat, limit: nat) -> (Result_6) query;
|
|
1009
1022
|
/// ⟨0.16.0⟩ `listAllServices` FOLDS in as `includeDisabled`.
|
|
1010
1023
|
///
|
|
1011
1024
|
/// The engram had two methods because the visibility rule differed: everyone saw enabled
|
|
@@ -1055,7 +1068,7 @@ service : {
|
|
|
1055
1068
|
/// ⟨2026-09-30, ic402 2.17.0⟩ That future spend path calls `gate.consumeVoucherFrom(msg.caller, …)`,
|
|
1056
1069
|
/// not the bare `consumeVoucher`: the signed fallback is off on this canister, so the bare call
|
|
1057
1070
|
/// refuses every voucher, and only the session key calling as itself may spend a session.
|
|
1058
|
-
openSession: (config: SessionConfig, sig: PaymentSignature) -> (
|
|
1071
|
+
openSession: (config: SessionConfig, sig: PaymentSignature) -> (Result_5);
|
|
1059
1072
|
/// RENAMED from `requestSession` (census tier-3 #21): it is a pure dry run — a quote for a session
|
|
1060
1073
|
/// the caller has not opened and is not committed to. `request` read as an action with an effect.
|
|
1061
1074
|
///
|
|
@@ -1117,7 +1130,7 @@ service : {
|
|
|
1117
1130
|
/// This matters most on the ckUSDC rail, which is where customer payments settle: ICP has no
|
|
1118
1131
|
/// on-chain nonce, so `settle` ALWAYS requires the server one. A conformant EVM x402 client
|
|
1119
1132
|
/// sends no server nonce at all and is unaffected.
|
|
1120
|
-
quotePayment: (amountE6: nat) -> (
|
|
1133
|
+
quotePayment: (amountE6: nat) -> (Result_4) query;
|
|
1121
1134
|
/// Admin recovery: re-drive a job stuck mid-settlement — a broadcast EVM transfer whose outcome
|
|
1122
1135
|
/// this canister never learned. Reads the chain and finishes what the settle started.
|
|
1123
1136
|
///
|
|
@@ -1196,7 +1209,15 @@ service : {
|
|
|
1196
1209
|
/// refused or rejected: that close already ends the session `closed`, with the remainder still in
|
|
1197
1210
|
/// its escrow, so it needs no force. Recover it within 24 hours of that close, asking at most the
|
|
1198
1211
|
/// escrow's ledger balance less one fee.
|
|
1199
|
-
|
|
1212
|
+
///
|
|
1213
|
+
/// ⟨2026-10-07, the owner's decision of that day⟩ WHAT IT ANSWERS: what came back. `amount` is what
|
|
1214
|
+
/// was transferred to the session's payer, in the token named (the amount asked, capped at the
|
|
1215
|
+
/// session's unconsumed deposit; the transfer's fee comes out of the escrow on top), and
|
|
1216
|
+
/// `blockIndex` is that ledger's block of the transfer. Until this date it answered a bare `nat`
|
|
1217
|
+
/// that was the block index alone, which read as the amount. If the session's record is removed
|
|
1218
|
+
/// before the amount can be read back — a session closed in the same moment as the recovery and
|
|
1219
|
+
/// cleaned up during its transfer — it answers `#Other` naming the block, never a guessed amount.
|
|
1220
|
+
recoverEscrow: (sessionId: text, amount: TokenAmount) -> (Result_3);
|
|
1200
1221
|
/// Register as a seller by naming the engram you own.
|
|
1201
1222
|
///
|
|
1202
1223
|
/// The registry is asked, not trusted from the caller's word: `verifyEngramActiveOwner` confirms
|
|
@@ -1284,6 +1305,36 @@ service : {
|
|
|
1284
1305
|
/// contract as ratified on 2026-10-02; giving the library one arm per kind of refusal is post-cut
|
|
1285
1306
|
/// dependency work.
|
|
1286
1307
|
resolveJob: (jobId: text, terminal: JobStatus) -> (Result_1);
|
|
1308
|
+
/// Admin recovery: retry the payment to the seller of a job left `#Verified` by a failed payment.
|
|
1309
|
+
/// NOTHING ELSE. It never refunds the buyer, and it refuses every job that does not read
|
|
1310
|
+
/// `#Verified`, with nothing moved.
|
|
1311
|
+
///
|
|
1312
|
+
/// ⟨2026-10-07, the owner's decision of that day⟩ A job whose work passed verification and whose
|
|
1313
|
+
/// payment to the seller then failed rests in `#Verified`, and only `resolveDispute` moves it — the
|
|
1314
|
+
/// service's SELLER's, by the ruling of 2026-08-17, which stands unchanged. A seller who never acts
|
|
1315
|
+
/// left it there, with no way for anyone else to move it. This is the admin's way: unstick, not
|
|
1316
|
+
/// decide. The job's outcome was decided by its verification; the payment goes where that sent it,
|
|
1317
|
+
/// and the admin names neither a recipient nor an amount. Refunding the buyer, and anything about a
|
|
1318
|
+
/// job not yet verified (`#Submitted`, `#Disputed`), stay the seller's.
|
|
1319
|
+
///
|
|
1320
|
+
/// It runs the library's own settle, the one a buyer's confirmation runs: the job reads `#Settling`
|
|
1321
|
+
/// while it pays (so two retries cannot both pay), ends `#Settled`, and a payment the ledger refuses
|
|
1322
|
+
/// leaves it `#Verified` to retry again. For a job priced "up to" an amount, that settle also returns
|
|
1323
|
+
/// to the buyer what the seller did not claim, as every settle does. Past the admin check, the
|
|
1324
|
+
/// freeze and the cycles floor (each of which refuses before anything is read), every outcome is a
|
|
1325
|
+
/// chained record entry naming the admin.
|
|
1326
|
+
///
|
|
1327
|
+
/// A NEW METHOD, NOT A WIDER `resolveJob`, ON PURPOSE. `resolveJob` is the one place the admin line
|
|
1328
|
+
/// bends — a STATE assertion, moving no money, for a job stuck in `#Settling`. Widening it to move
|
|
1329
|
+
/// money on a `#Verified` job would give one argument (`#Settled`) two meanings depending on a state
|
|
1330
|
+
/// the admin read a moment earlier: if the job moved to `#Settling` in between (a settle in flight),
|
|
1331
|
+
/// "pay the seller" would become "declare the seller paid". One method per meaning keeps the
|
|
1332
|
+
/// deciding one narrow and named.
|
|
1333
|
+
///
|
|
1334
|
+
/// `#Conflict` covers the state refusals: a job that does not read `#Verified`, and the library's
|
|
1335
|
+
/// own (a job that moved on before the retry ran, or a payment that failed). `#NotFound` is a job id
|
|
1336
|
+
/// this market does not have.
|
|
1337
|
+
retrySellerPayment: (jobId: text) -> (Result_1);
|
|
1287
1338
|
setAdmin: (newAdmin: principal) -> (Result_1);
|
|
1288
1339
|
/// Override the policy for ONE payer — the market's per-buyer risk control.
|
|
1289
1340
|
setCallerPolicy: (caller: principal, policy: SpendingPolicy) -> (Result_1);
|
package/dist/market.idl.d.ts
CHANGED
|
@@ -79,6 +79,10 @@ export type Error =
|
|
|
79
79
|
| { Other: string }
|
|
80
80
|
| { Unavailable: string }
|
|
81
81
|
| { Conflict: string };
|
|
82
|
+
export interface EscrowRecovery {
|
|
83
|
+
blockIndex: bigint;
|
|
84
|
+
amount: TokenAmount;
|
|
85
|
+
}
|
|
82
86
|
export interface GenesisNote {
|
|
83
87
|
predecessorSize: [] | [bigint];
|
|
84
88
|
predecessorHeadHash: [] | [Uint8Array | number[]];
|
|
@@ -242,23 +246,24 @@ export interface QuotedRequirement {
|
|
|
242
246
|
}
|
|
243
247
|
export type Result = { Ok: bigint } | { Err: Error };
|
|
244
248
|
export type Result_1 = { Ok: null } | { Err: Error };
|
|
245
|
-
export type Result_10 = { Ok:
|
|
246
|
-
export type Result_11 = { Ok:
|
|
247
|
-
export type Result_12 = { Ok:
|
|
248
|
-
export type Result_13 = { Ok:
|
|
249
|
-
export type Result_14 = { Ok:
|
|
250
|
-
export type Result_15 = { Ok:
|
|
251
|
-
export type Result_16 = { Ok:
|
|
252
|
-
export type Result_17 = { Ok:
|
|
253
|
-
export type Result_18 = { Ok:
|
|
249
|
+
export type Result_10 = { Ok: Page_7 } | { Err: Error };
|
|
250
|
+
export type Result_11 = { Ok: SellerStatus } | { Err: Error };
|
|
251
|
+
export type Result_12 = { Ok: RevenueSummary } | { Err: Error };
|
|
252
|
+
export type Result_13 = { Ok: JobStatus } | { Err: Error };
|
|
253
|
+
export type Result_14 = { Ok: Uint8Array | number[] } | { Err: Error };
|
|
254
|
+
export type Result_15 = { Ok: Job } | { Err: Error };
|
|
255
|
+
export type Result_16 = { Ok: [] | [string] } | { Err: Error };
|
|
256
|
+
export type Result_17 = { Ok: ContentResponse } | { Err: Error };
|
|
257
|
+
export type Result_18 = { Ok: ServiceRequestResponse } | { Err: Error };
|
|
258
|
+
export type Result_19 = { Ok: X402Endpoint } | { Err: Error };
|
|
254
259
|
export type Result_2 = { Ok: string } | { Err: Error };
|
|
255
|
-
export type Result_3 = { Ok:
|
|
256
|
-
export type Result_4 = { Ok:
|
|
257
|
-
export type Result_5 = { Ok:
|
|
258
|
-
export type Result_6 = { Ok:
|
|
259
|
-
export type Result_7 = { Ok:
|
|
260
|
-
export type Result_8 = { Ok:
|
|
261
|
-
export type Result_9 = { Ok:
|
|
260
|
+
export type Result_3 = { Ok: EscrowRecovery } | { Err: Error };
|
|
261
|
+
export type Result_4 = { Ok: PaymentQuote } | { Err: Error };
|
|
262
|
+
export type Result_5 = { Ok: SessionState } | { Err: Error };
|
|
263
|
+
export type Result_6 = { Ok: Page_1 } | { Err: Error };
|
|
264
|
+
export type Result_7 = { Ok: Page_2 } | { Err: Error };
|
|
265
|
+
export type Result_8 = { Ok: Page_4 } | { Err: Error };
|
|
266
|
+
export type Result_9 = { Ok: Page_5 } | { Err: Error };
|
|
262
267
|
export interface RevenueSummary {
|
|
263
268
|
serviceJobsSettled: bigint;
|
|
264
269
|
owedToYou: bigint;
|
|
@@ -438,6 +443,9 @@ export interface _SERVICE {
|
|
|
438
443
|
* / is RATIFIED as the 0.16.0 contract (the owner's ruling of 2026-10-02, the pre-cut
|
|
439
444
|
* / recommendation); giving the library one arm per kind of refusal is post-cut dependency work,
|
|
440
445
|
* / not a change made mid-cut.
|
|
446
|
+
* / ⟨2026-10-07, beside the count above⟩ Twelve: the admin's `retrySellerPayment` (the owner's
|
|
447
|
+
* / decision of that day) passes the library's settle refusal through as `#Conflict` too — state
|
|
448
|
+
* / behind this canister's own gate, like the other six.
|
|
441
449
|
* /
|
|
442
450
|
* / It also refuses while TRADE IS FROZEN, and that one is a true `#Conflict` — the refusal says
|
|
443
451
|
* / so explicitly ("Not a permission problem and not a missing job"), and `isTradeFrozen()` is the
|
|
@@ -475,7 +483,7 @@ export interface _SERVICE {
|
|
|
475
483
|
* / Born disabled deliberately: a listing that went live at creation would be sellable before its
|
|
476
484
|
* / price was set, and `price` starts at 0 with `suggestedPrice` as the fallback.
|
|
477
485
|
*/
|
|
478
|
-
createEndpoint: ActorMethod<[string, string, string, bigint],
|
|
486
|
+
createEndpoint: ActorMethod<[string, string, string, bigint], Result_19>;
|
|
479
487
|
/**
|
|
480
488
|
* / Submit a paid service request. Returns a job id, or the price.
|
|
481
489
|
* /
|
|
@@ -491,7 +499,7 @@ export interface _SERVICE {
|
|
|
491
499
|
* /
|
|
492
500
|
* / What DOES gate here is the market's freeze, and the service's own existence and pricing mode.
|
|
493
501
|
*/
|
|
494
|
-
createJob: ActorMethod<[string, Uint8Array | number[], [] | [PaymentSignature]],
|
|
502
|
+
createJob: ActorMethod<[string, Uint8Array | number[], [] | [PaymentSignature]], Result_18>;
|
|
495
503
|
/**
|
|
496
504
|
* / Delete content.
|
|
497
505
|
* /
|
|
@@ -600,7 +608,7 @@ export interface _SERVICE {
|
|
|
600
608
|
* / before the nonce lock or any ledger call, and the refusal reaches the buyer as #Refused with
|
|
601
609
|
* / ic402's text naming both principals. Pay as the principal that approved the allowance.
|
|
602
610
|
*/
|
|
603
|
-
getContent: ActorMethod<[string, [] | [PaymentSignature]],
|
|
611
|
+
getContent: ActorMethod<[string, [] | [PaymentSignature]], Result_17>;
|
|
604
612
|
/**
|
|
605
613
|
* / ⟨0.16.0⟩ THE `getChunk` FIX, and it is the sharpest single case in the corpus.
|
|
606
614
|
* /
|
|
@@ -627,7 +635,7 @@ export interface _SERVICE {
|
|
|
627
635
|
* / check was out of scope by construction rather than by ruling. L11 adds payment gates to that
|
|
628
636
|
* / list; this method is why.
|
|
629
637
|
*/
|
|
630
|
-
getContentChunk: ActorMethod<[AccessGrant, bigint],
|
|
638
|
+
getContentChunk: ActorMethod<[AccessGrant, bigint], Result_14>;
|
|
631
639
|
/**
|
|
632
640
|
* / A seller's payout address — THEIRS, or the admin's to read.
|
|
633
641
|
* /
|
|
@@ -635,7 +643,7 @@ export interface _SERVICE {
|
|
|
635
643
|
* / caller can read, and `#Ok(null)` genuinely means "this seller has set no payout address" —
|
|
636
644
|
* / distinguishable from "you may not ask", which is the whole point of the envelope.
|
|
637
645
|
*/
|
|
638
|
-
getEvmSellerPayout: ActorMethod<[Principal],
|
|
646
|
+
getEvmSellerPayout: ActorMethod<[Principal], Result_16>;
|
|
639
647
|
/**
|
|
640
648
|
* / PUBLIC: what this canister's chains continue, or that they continue nothing. A fresh chain
|
|
641
649
|
* / beside a published predecessor head is auditable; a fresh chain with no statement is
|
|
@@ -652,7 +660,7 @@ export interface _SERVICE {
|
|
|
652
660
|
* / from it — the marketplace UI printed "Job not found (or not yet visible)" at a caller who was
|
|
653
661
|
* / merely unauthorized. Job existence is not the secret: `getJobCounts()` is ungated.
|
|
654
662
|
*/
|
|
655
|
-
getJob: ActorMethod<[string],
|
|
663
|
+
getJob: ActorMethod<[string], Result_15>;
|
|
656
664
|
/**
|
|
657
665
|
* / PUBLIC: aggregate counts that identify nobody — and already public on the engram, which is
|
|
658
666
|
* / what made `listJobs`' existence-leak justification false.
|
|
@@ -669,7 +677,7 @@ export interface _SERVICE {
|
|
|
669
677
|
* / Three outcomes, three answers now. And `Payer` (above) removes the root cause rather than
|
|
670
678
|
* / only labelling it.
|
|
671
679
|
*/
|
|
672
|
-
getJobResult: ActorMethod<[string],
|
|
680
|
+
getJobResult: ActorMethod<[string], Result_14>;
|
|
673
681
|
/**
|
|
674
682
|
* / Terminal money settlement — the seller gets paid. Honours the freeze exactly like every
|
|
675
683
|
* / other settle path; a settlement that ignored the freeze would make the freeze a suggestion.
|
|
@@ -686,7 +694,7 @@ export interface _SERVICE {
|
|
|
686
694
|
* / The engram returned `?EngramJobStatus`, conflating "no such job" with a null-ish answer. Here
|
|
687
695
|
* / a missing job is `#NotFound`, which is a fact rather than an absence a caller has to interpret.
|
|
688
696
|
*/
|
|
689
|
-
getJobStatus: ActorMethod<[string],
|
|
697
|
+
getJobStatus: ActorMethod<[string], Result_13>;
|
|
690
698
|
/**
|
|
691
699
|
* / PUBLIC: the market's spend limits, with the caller rosters REDACTED.
|
|
692
700
|
* /
|
|
@@ -713,7 +721,7 @@ export interface _SERVICE {
|
|
|
713
721
|
* / "you have sold nothing" — and returning it to a caller who simply has no identity is the
|
|
714
722
|
* / fabricated-empty defect wearing a number instead of a list.
|
|
715
723
|
*/
|
|
716
|
-
getRevenueSummary: ActorMethod<[],
|
|
724
|
+
getRevenueSummary: ActorMethod<[], Result_12>;
|
|
717
725
|
/**
|
|
718
726
|
* / PUBLIC: what a buyer can learn about a seller, and the whole of it.
|
|
719
727
|
* /
|
|
@@ -726,7 +734,7 @@ export interface _SERVICE {
|
|
|
726
734
|
* / `verified` is about ownership at a moment in time and nothing else. It is not an endorsement,
|
|
727
735
|
* / and the field name is the strongest claim it makes.
|
|
728
736
|
*/
|
|
729
|
-
getSellerStatus: ActorMethod<[Principal],
|
|
737
|
+
getSellerStatus: ActorMethod<[Principal], Result_11>;
|
|
730
738
|
/**
|
|
731
739
|
* / PUBLIC: aggregate session counts. Identifies nobody, and the same reasoning as getJobCounts —
|
|
732
740
|
* / which is also what made `listJobs`' old "no existence leak" defence false.
|
|
@@ -814,12 +822,12 @@ export interface _SERVICE {
|
|
|
814
822
|
* / `total` is the head counter, not the row count: this is a bounded ring, so a page that
|
|
815
823
|
* / reported only what it returned would make a trimmed log look complete.
|
|
816
824
|
*/
|
|
817
|
-
listAuditEntries: ActorMethod<[bigint, bigint],
|
|
825
|
+
listAuditEntries: ActorMethod<[bigint, bigint], Result_9>;
|
|
818
826
|
/**
|
|
819
827
|
* / Admin AND the enrolled viewers themselves — L8's roster rule. A viewer who cannot see the
|
|
820
828
|
* / roster cannot tell whether their own enrolment survived a rotation.
|
|
821
829
|
*/
|
|
822
|
-
listAuditViewers: ActorMethod<[],
|
|
830
|
+
listAuditViewers: ActorMethod<[], Result_10>;
|
|
823
831
|
/**
|
|
824
832
|
* / PUBLIC: the catalogue is the storefront. A shop that refuses to say what it sells to
|
|
825
833
|
* / anyone who has not already bought is not a shop.
|
|
@@ -830,7 +838,7 @@ export interface _SERVICE {
|
|
|
830
838
|
* / the fabricated-empty class was born, and a refusal that leaves no trace cannot be counted,
|
|
831
839
|
* / alerted on, or disproved.
|
|
832
840
|
*/
|
|
833
|
-
listDenialEntries: ActorMethod<[bigint, bigint],
|
|
841
|
+
listDenialEntries: ActorMethod<[bigint, bigint], Result_9>;
|
|
834
842
|
/**
|
|
835
843
|
* / Purchase history for one endpoint: its creator sees every row, a buyer sees their own.
|
|
836
844
|
* /
|
|
@@ -845,7 +853,7 @@ export interface _SERVICE {
|
|
|
845
853
|
* / few sales. `withheld` now counts them, so "no purchases here" and "not yours to see" are
|
|
846
854
|
* / different answers — without naming whose they were.
|
|
847
855
|
*/
|
|
848
|
-
listEndpointPurchases: ActorMethod<[string, bigint, bigint],
|
|
856
|
+
listEndpointPurchases: ActorMethod<[string, bigint, bigint], Result_8>;
|
|
849
857
|
/**
|
|
850
858
|
* / PUBLIC: the shelves, like the catalogue. `#Deleted` listings are excluded from an
|
|
851
859
|
* / unfiltered read and COUNTED in `withheld` — a shop with three deleted listings and a shop with
|
|
@@ -875,7 +883,7 @@ export interface _SERVICE {
|
|
|
875
883
|
* / Now: `#Refused` when the caller may not ask, `#NotFound` when the service does not exist —
|
|
876
884
|
* / two facts that were one empty list.
|
|
877
885
|
*/
|
|
878
|
-
listJobs: ActorMethod<[string, [] | [JobStatus], bigint, bigint],
|
|
886
|
+
listJobs: ActorMethod<[string, [] | [JobStatus], bigint, bigint], Result_7>;
|
|
879
887
|
/**
|
|
880
888
|
* / The parked withdrawals belonging to this caller, so an unresolved payout is discoverable
|
|
881
889
|
* / rather than something a seller has to already know the id of.
|
|
@@ -892,7 +900,7 @@ export interface _SERVICE {
|
|
|
892
900
|
* / non-owner's view withholds other buyers' rows. Stated because a reader comparing the two
|
|
893
901
|
* / should know the zero is a fact about this surface, not an unimplemented field.
|
|
894
902
|
*/
|
|
895
|
-
listMyPendingWithdrawals: ActorMethod<[bigint, bigint],
|
|
903
|
+
listMyPendingWithdrawals: ActorMethod<[bigint, bigint], Result_6>;
|
|
896
904
|
/**
|
|
897
905
|
* / ⟨0.16.0⟩ `listAllServices` FOLDS in as `includeDisabled`.
|
|
898
906
|
* /
|
|
@@ -945,7 +953,7 @@ export interface _SERVICE {
|
|
|
945
953
|
* / not the bare `consumeVoucher`: the signed fallback is off on this canister, so the bare call
|
|
946
954
|
* / refuses every voucher, and only the session key calling as itself may spend a session.
|
|
947
955
|
*/
|
|
948
|
-
openSession: ActorMethod<[SessionConfig, PaymentSignature],
|
|
956
|
+
openSession: ActorMethod<[SessionConfig, PaymentSignature], Result_5>;
|
|
949
957
|
/**
|
|
950
958
|
* / RENAMED from `requestSession` (census tier-3 #21): it is a pure dry run — a quote for a session
|
|
951
959
|
* / the caller has not opened and is not committed to. `request` read as an action with an effect.
|
|
@@ -1011,7 +1019,7 @@ export interface _SERVICE {
|
|
|
1011
1019
|
* / on-chain nonce, so `settle` ALWAYS requires the server one. A conformant EVM x402 client
|
|
1012
1020
|
* / sends no server nonce at all and is unaffected.
|
|
1013
1021
|
*/
|
|
1014
|
-
quotePayment: ActorMethod<[bigint],
|
|
1022
|
+
quotePayment: ActorMethod<[bigint], Result_4>;
|
|
1015
1023
|
/**
|
|
1016
1024
|
* / Admin recovery: re-drive a job stuck mid-settlement — a broadcast EVM transfer whose outcome
|
|
1017
1025
|
* / this canister never learned. Reads the chain and finishes what the settle started.
|
|
@@ -1097,8 +1105,16 @@ export interface _SERVICE {
|
|
|
1097
1105
|
* / refused or rejected: that close already ends the session `closed`, with the remainder still in
|
|
1098
1106
|
* / its escrow, so it needs no force. Recover it within 24 hours of that close, asking at most the
|
|
1099
1107
|
* / escrow's ledger balance less one fee.
|
|
1108
|
+
* /
|
|
1109
|
+
* / ⟨2026-10-07, the owner's decision of that day⟩ WHAT IT ANSWERS: what came back. `amount` is what
|
|
1110
|
+
* / was transferred to the session's payer, in the token named (the amount asked, capped at the
|
|
1111
|
+
* / session's unconsumed deposit; the transfer's fee comes out of the escrow on top), and
|
|
1112
|
+
* / `blockIndex` is that ledger's block of the transfer. Until this date it answered a bare `nat`
|
|
1113
|
+
* / that was the block index alone, which read as the amount. If the session's record is removed
|
|
1114
|
+
* / before the amount can be read back — a session closed in the same moment as the recovery and
|
|
1115
|
+
* / cleaned up during its transfer — it answers `#Other` naming the block, never a guessed amount.
|
|
1100
1116
|
*/
|
|
1101
|
-
recoverEscrow: ActorMethod<[string, TokenAmount],
|
|
1117
|
+
recoverEscrow: ActorMethod<[string, TokenAmount], Result_3>;
|
|
1102
1118
|
/**
|
|
1103
1119
|
* / Register as a seller by naming the engram you own.
|
|
1104
1120
|
* /
|
|
@@ -1207,6 +1223,38 @@ export interface _SERVICE {
|
|
|
1207
1223
|
* / dependency work.
|
|
1208
1224
|
*/
|
|
1209
1225
|
resolveJob: ActorMethod<[string, JobStatus], Result_1>;
|
|
1226
|
+
/**
|
|
1227
|
+
* / Admin recovery: retry the payment to the seller of a job left `#Verified` by a failed payment.
|
|
1228
|
+
* / NOTHING ELSE. It never refunds the buyer, and it refuses every job that does not read
|
|
1229
|
+
* / `#Verified`, with nothing moved.
|
|
1230
|
+
* /
|
|
1231
|
+
* / ⟨2026-10-07, the owner's decision of that day⟩ A job whose work passed verification and whose
|
|
1232
|
+
* / payment to the seller then failed rests in `#Verified`, and only `resolveDispute` moves it — the
|
|
1233
|
+
* / service's SELLER's, by the ruling of 2026-08-17, which stands unchanged. A seller who never acts
|
|
1234
|
+
* / left it there, with no way for anyone else to move it. This is the admin's way: unstick, not
|
|
1235
|
+
* / decide. The job's outcome was decided by its verification; the payment goes where that sent it,
|
|
1236
|
+
* / and the admin names neither a recipient nor an amount. Refunding the buyer, and anything about a
|
|
1237
|
+
* / job not yet verified (`#Submitted`, `#Disputed`), stay the seller's.
|
|
1238
|
+
* /
|
|
1239
|
+
* / It runs the library's own settle, the one a buyer's confirmation runs: the job reads `#Settling`
|
|
1240
|
+
* / while it pays (so two retries cannot both pay), ends `#Settled`, and a payment the ledger refuses
|
|
1241
|
+
* / leaves it `#Verified` to retry again. For a job priced "up to" an amount, that settle also returns
|
|
1242
|
+
* / to the buyer what the seller did not claim, as every settle does. Past the admin check, the
|
|
1243
|
+
* / freeze and the cycles floor (each of which refuses before anything is read), every outcome is a
|
|
1244
|
+
* / chained record entry naming the admin.
|
|
1245
|
+
* /
|
|
1246
|
+
* / A NEW METHOD, NOT A WIDER `resolveJob`, ON PURPOSE. `resolveJob` is the one place the admin line
|
|
1247
|
+
* / bends — a STATE assertion, moving no money, for a job stuck in `#Settling`. Widening it to move
|
|
1248
|
+
* / money on a `#Verified` job would give one argument (`#Settled`) two meanings depending on a state
|
|
1249
|
+
* / the admin read a moment earlier: if the job moved to `#Settling` in between (a settle in flight),
|
|
1250
|
+
* / "pay the seller" would become "declare the seller paid". One method per meaning keeps the
|
|
1251
|
+
* / deciding one narrow and named.
|
|
1252
|
+
* /
|
|
1253
|
+
* / `#Conflict` covers the state refusals: a job that does not read `#Verified`, and the library's
|
|
1254
|
+
* / own (a job that moved on before the retry ran, or a payment that failed). `#NotFound` is a job id
|
|
1255
|
+
* / this market does not have.
|
|
1256
|
+
*/
|
|
1257
|
+
retrySellerPayment: ActorMethod<[string], Result_1>;
|
|
1210
1258
|
setAdmin: ActorMethod<[Principal], Result_1>;
|
|
1211
1259
|
/**
|
|
1212
1260
|
* / Override the policy for ONE payer — the market's per-buyer risk control.
|