@engramx/idl 0.16.0-rc.21 → 0.16.0-rc.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engram.did +669 -194
- package/dist/engram.idl.d.ts +673 -194
- package/dist/engram.idl.js +289 -194
- package/dist/market.did +119 -107
- package/dist/market.idl.d.ts +123 -110
- package/dist/market.idl.js +52 -49
- package/dist/registry.did +317 -96
- package/dist/registry.idl.d.ts +308 -98
- package/dist/registry.idl.js +107 -48
- package/package.json +1 -1
package/dist/market.did
CHANGED
|
@@ -125,7 +125,11 @@ type SellerStatus =
|
|
|
125
125
|
byteQuota: nat;
|
|
126
126
|
bytesStored: nat;
|
|
127
127
|
engramId: principal;
|
|
128
|
+
evmPayout: opt text;
|
|
129
|
+
evmPayoutError: opt text;
|
|
128
130
|
expiresAtNs: int;
|
|
131
|
+
parkedPayouts: nat;
|
|
132
|
+
parkedSaleNotices: nat;
|
|
129
133
|
verifiedAtNs: int;
|
|
130
134
|
};
|
|
131
135
|
type SealedEntry =
|
|
@@ -170,10 +174,9 @@ type RevenueSummary =
|
|
|
170
174
|
purchases: nat;
|
|
171
175
|
revenue: nat;
|
|
172
176
|
};
|
|
173
|
-
|
|
177
|
+
parkedPayouts: nat;
|
|
174
178
|
serviceJobsSettled: nat;
|
|
175
179
|
serviceRevenue: nat;
|
|
176
|
-
unresolvedWithdrawals: nat;
|
|
177
180
|
};
|
|
178
181
|
type Result_9 =
|
|
179
182
|
variant {
|
|
@@ -210,11 +213,6 @@ type Result_3 =
|
|
|
210
213
|
Err: Error;
|
|
211
214
|
Ok: EscrowRecovery;
|
|
212
215
|
};
|
|
213
|
-
type Result_20 =
|
|
214
|
-
variant {
|
|
215
|
-
Err: Error;
|
|
216
|
-
Ok: X402Endpoint;
|
|
217
|
-
};
|
|
218
216
|
type Result_2 =
|
|
219
217
|
variant {
|
|
220
218
|
Err: Error;
|
|
@@ -223,17 +221,17 @@ type Result_2 =
|
|
|
223
221
|
type Result_19 =
|
|
224
222
|
variant {
|
|
225
223
|
Err: Error;
|
|
226
|
-
Ok:
|
|
224
|
+
Ok: X402Endpoint;
|
|
227
225
|
};
|
|
228
226
|
type Result_18 =
|
|
229
227
|
variant {
|
|
230
228
|
Err: Error;
|
|
231
|
-
Ok:
|
|
229
|
+
Ok: ServiceRequestResponse;
|
|
232
230
|
};
|
|
233
231
|
type Result_17 =
|
|
234
232
|
variant {
|
|
235
233
|
Err: Error;
|
|
236
|
-
Ok:
|
|
234
|
+
Ok: ContentResponse;
|
|
237
235
|
};
|
|
238
236
|
type Result_16 =
|
|
239
237
|
variant {
|
|
@@ -273,12 +271,12 @@ type Result_10 =
|
|
|
273
271
|
type Result_1 =
|
|
274
272
|
variant {
|
|
275
273
|
Err: Error;
|
|
276
|
-
Ok;
|
|
274
|
+
Ok: nat;
|
|
277
275
|
};
|
|
278
276
|
type Result =
|
|
279
277
|
variant {
|
|
280
278
|
Err: Error;
|
|
281
|
-
Ok
|
|
279
|
+
Ok;
|
|
282
280
|
};
|
|
283
281
|
type RecordPage =
|
|
284
282
|
record {
|
|
@@ -316,14 +314,17 @@ type PricingScheme =
|
|
|
316
314
|
Session;
|
|
317
315
|
Upto: nat;
|
|
318
316
|
};
|
|
319
|
-
type
|
|
317
|
+
type PendingPayout =
|
|
320
318
|
record {
|
|
321
|
-
|
|
319
|
+
amountE6: nat;
|
|
322
320
|
createdAtTimeNs: nat64;
|
|
321
|
+
engramId: principal;
|
|
322
|
+
feeE6: nat;
|
|
323
323
|
id: nat;
|
|
324
|
+
lastError: text;
|
|
325
|
+
memo: blob;
|
|
324
326
|
parkedAtNs: int;
|
|
325
|
-
|
|
326
|
-
seller: principal;
|
|
327
|
+
receiptId: text;
|
|
327
328
|
};
|
|
328
329
|
type PaymentSignature =
|
|
329
330
|
record {
|
|
@@ -410,7 +411,7 @@ type Page_2 =
|
|
|
410
411
|
};
|
|
411
412
|
type Page_1 =
|
|
412
413
|
record {
|
|
413
|
-
items: vec
|
|
414
|
+
items: vec PendingPayout;
|
|
414
415
|
total: nat;
|
|
415
416
|
withheld: nat;
|
|
416
417
|
};
|
|
@@ -601,7 +602,7 @@ type AccessGrant =
|
|
|
601
602
|
receiptId: text;
|
|
602
603
|
};
|
|
603
604
|
service : {
|
|
604
|
-
addAuditViewer: (viewer: principal) -> (
|
|
605
|
+
addAuditViewer: (viewer: principal) -> (Result);
|
|
605
606
|
/// Push this canister's chain head into the registry's anchor ring — the same thing every engram
|
|
606
607
|
/// does with its memory head, and the cashier with its treasury head.
|
|
607
608
|
///
|
|
@@ -616,7 +617,7 @@ service : {
|
|
|
616
617
|
/// ⟨RENAMED 2026-10-02 from `sysAnchorNow`, with `setRegistryId` and for the same reason: its
|
|
617
618
|
/// caller is the market's admin, a person, so it does not belong to the canister-to-canister
|
|
618
619
|
/// tier the `sys` prefix names.⟩
|
|
619
|
-
anchorNow: () -> (
|
|
620
|
+
anchorNow: () -> (Result);
|
|
620
621
|
/// A seller takes on a pending job. The CALLER must be the seller of the service the job was
|
|
621
622
|
/// created against — claiming is not open, and there is no assignment step: whoever registered
|
|
622
623
|
/// the service claims its work.
|
|
@@ -653,7 +654,7 @@ service : {
|
|
|
653
654
|
/// It also refuses while TRADE IS FROZEN, and that one is a true `#Conflict` — the refusal says
|
|
654
655
|
/// so explicitly ("Not a permission problem and not a missing job"), and `isTradeFrozen()` is the
|
|
655
656
|
/// ungated read that confirms it.
|
|
656
|
-
claimJob: (jobId: text) -> (
|
|
657
|
+
claimJob: (jobId: text) -> (Result);
|
|
657
658
|
/// ⟨0.16.0, L2.6⟩ `confirmJob` ABSORBS `confirmJobEvm`. One buyer action, two ways to prove you
|
|
658
659
|
/// are the buyer.
|
|
659
660
|
///
|
|
@@ -676,13 +677,13 @@ service : {
|
|
|
676
677
|
/// method read the MESSAGE rather than the arm — it is terminal money settlement, so a caller
|
|
677
678
|
/// who reads `#Conflict` as "retry later" will retry a release that can never happen for them.
|
|
678
679
|
/// Same seam as `claimJob`; three costed fixes in the project's backlog ⟨2026-08-21⟩.
|
|
679
|
-
confirmJob: (jobId: text, evmProof: opt vec nat8) -> (
|
|
680
|
+
confirmJob: (jobId: text, evmProof: opt vec nat8) -> (Result);
|
|
680
681
|
/// Create a content endpoint — a shelf in the storefront. Born DISABLED.
|
|
681
682
|
///
|
|
682
683
|
/// Born disabled deliberately: a listing that went live at creation would be sellable before its
|
|
683
684
|
/// price was set, and `price` starts at 0 with `suggestedPrice` as the fallback.
|
|
684
685
|
createEndpoint: (name: text, description: text, contentId: text,
|
|
685
|
-
suggestedPriceE6: nat) -> (
|
|
686
|
+
suggestedPriceE6: nat) -> (Result_19);
|
|
686
687
|
/// Submit a paid service request. Returns a job id, or the price.
|
|
687
688
|
///
|
|
688
689
|
/// ⟨0.16.0⟩ TWO GATES FROM THE ENGRAM DO NOT TRAVEL, and both for the same reason: they were the
|
|
@@ -697,7 +698,7 @@ service : {
|
|
|
697
698
|
///
|
|
698
699
|
/// What DOES gate here is the market's freeze, and the service's own existence and pricing mode.
|
|
699
700
|
createJob: (serviceId: text, params: blob, paymentSig:
|
|
700
|
-
opt PaymentSignature) -> (
|
|
701
|
+
opt PaymentSignature) -> (Result_18);
|
|
701
702
|
/// Delete content.
|
|
702
703
|
///
|
|
703
704
|
/// ⚠ THE QUOTA IS NOT REFUNDED, and this is the honest part of the design rather than a
|
|
@@ -705,10 +706,10 @@ service : {
|
|
|
705
706
|
/// persistence never shrinks — so crediting the bytes back would let one seller cycle uploads
|
|
706
707
|
/// forever against a ceiling that only ever rose in reality. The quota tracks bytes CLAIMED, not
|
|
707
708
|
/// bytes currently held, because claimed is the number that costs money.
|
|
708
|
-
deleteContent: (id: text) -> (
|
|
709
|
+
deleteContent: (id: text) -> (Result);
|
|
709
710
|
/// Delete an endpoint. Terminal — the record stays as #Deleted so purchase history keeps
|
|
710
711
|
/// resolving, and the id is never reused.
|
|
711
|
-
deleteEndpoint: (endpointId: text) -> (
|
|
712
|
+
deleteEndpoint: (endpointId: text) -> (Result);
|
|
712
713
|
/// ⟨0.16.0, L2.6⟩ `disputeJob` ABSORBS `disputeJobEvm`, exactly as confirmJob does, and for the
|
|
713
714
|
/// same reason: one act, two proofs of buyership.
|
|
714
715
|
///
|
|
@@ -725,18 +726,17 @@ service : {
|
|
|
725
726
|
/// ⚠ AND NOTE WHERE THE DISPUTE GOES: `resolveDispute` is answered by the SERVICE'S OWN SELLER
|
|
726
727
|
/// — the party being disputed. This market has no admin arbitration and no appeal, deliberately
|
|
727
728
|
/// and on the record. Filing a dispute is not an escalation to a neutral party.
|
|
728
|
-
disputeJob: (jobId: text, reason: text, evmProof: opt vec nat8) ->
|
|
729
|
-
(Result_1);
|
|
729
|
+
disputeJob: (jobId: text, reason: text, evmProof: opt vec nat8) -> (Result);
|
|
730
730
|
/// Closing refunds the unconsumed deposit to the payer, so it is NOT freeze-gated — the same
|
|
731
731
|
/// reasoning as disputeJob and forceCloseSession. A halt stops money moving toward sellers; it
|
|
732
732
|
/// must not strand a buyer's own escrow.
|
|
733
|
-
endSession: (sessionId: text) -> (
|
|
733
|
+
endSession: (sessionId: text) -> (Result);
|
|
734
734
|
/// Admin recovery: force a stuck session closed and return the unconsumed deposit to its payer.
|
|
735
735
|
///
|
|
736
736
|
/// Documented in RECOVERY-RUNBOOK as an owner procedure; on a shared canister the equivalent
|
|
737
737
|
/// authority is the market admin, because the session's own parties are precisely who cannot
|
|
738
738
|
/// unstick it. No discretion: the refund destination is the payer recorded on the session.
|
|
739
|
-
forceCloseSession: (sessionId: text) -> (
|
|
739
|
+
forceCloseSession: (sessionId: text) -> (Result);
|
|
740
740
|
/// Admin recovery: mark a stuck session resolved. STATE ONLY — no funds move.
|
|
741
741
|
///
|
|
742
742
|
/// Kept distinct from forceCloseSession, which refunds, because the two are different admissions.
|
|
@@ -753,7 +753,12 @@ service : {
|
|
|
753
753
|
/// arrives as `#Conflict` rather than `#NotFound`. Read the MESSAGE for which. This is the 0.16.0
|
|
754
754
|
/// contract as ratified on 2026-10-02; giving the library one arm per kind of refusal is post-cut
|
|
755
755
|
/// dependency work.
|
|
756
|
-
|
|
756
|
+
///
|
|
757
|
+
/// ⟨2026-11-05, ic402 2.20.0⟩ NOT FOR AN ICP SESSION LEFT `#closing` BY AN UNKNOWN SETTLE (a close that
|
|
758
|
+
/// answered "outcome unknown"): `reconcileSession` resolves that one from the escrow balance. Forcing it
|
|
759
|
+
/// would mark it closed whether or not the settle landed, stranding the recipient's share if it did
|
|
760
|
+
/// not. This method stays for a close that trapped after an await.
|
|
761
|
+
forceResolveSession: (sessionId: text) -> (Result);
|
|
757
762
|
/// PUBLIC: accountability requires knowing who holds power. This is the shape every canister
|
|
758
763
|
/// in the system serves, so one reader covers all of them.
|
|
759
764
|
getAdminRoles: () -> (AdminRoles) query;
|
|
@@ -786,7 +791,7 @@ service : {
|
|
|
786
791
|
/// before the nonce lock or any ledger call, and the refusal reaches the buyer as #Refused with
|
|
787
792
|
/// ic402's text naming both principals. Pay as the principal that approved the allowance.
|
|
788
793
|
getContent: (contentId: text, paymentSig: opt PaymentSignature) ->
|
|
789
|
-
(
|
|
794
|
+
(Result_17);
|
|
790
795
|
/// ⟨0.16.0⟩ THE `getChunk` FIX, and it is the sharpest single case in the corpus.
|
|
791
796
|
///
|
|
792
797
|
/// The engram's version was:
|
|
@@ -812,12 +817,6 @@ service : {
|
|
|
812
817
|
/// check was out of scope by construction rather than by ruling. L11 adds payment gates to that
|
|
813
818
|
/// list; this method is why.
|
|
814
819
|
getContentChunk: (grant: AccessGrant, index: nat) -> (Result_15) query;
|
|
815
|
-
/// A seller's payout address — THEIRS, or the admin's to read.
|
|
816
|
-
///
|
|
817
|
-
/// The engram made this owner-only and TRAPPED at everyone else. Here the answer is a refusal a
|
|
818
|
-
/// caller can read, and `#Ok(null)` genuinely means "this seller has set no payout address" —
|
|
819
|
-
/// distinguishable from "you may not ask", which is the whole point of the envelope.
|
|
820
|
-
getEvmSellerPayout: (seller: principal) -> (Result_17) query;
|
|
821
820
|
/// PUBLIC: what this canister's chains continue, or that they continue nothing. A fresh chain
|
|
822
821
|
/// beside a published predecessor head is auditable; a fresh chain with no statement is
|
|
823
822
|
/// indistinguishable from a wipe.
|
|
@@ -871,6 +870,11 @@ service : {
|
|
|
871
870
|
/// the canister acting as its own payer — which silently returns a self-override if one exists,
|
|
872
871
|
/// so the published limits could differ from the ones actually applied to buyers.
|
|
873
872
|
getPaymentPolicy: () -> (SpendingPolicy) query;
|
|
873
|
+
/// A seller's own revenue on this market.
|
|
874
|
+
///
|
|
875
|
+
/// ⟨0.16.0⟩ SELLER-SCOPED. The engram's version was owner-only and TRAPPED at everyone else,
|
|
876
|
+
/// which was coherent when the owner was the only seller. Here every caller has a different
|
|
877
|
+
/// answer, and no caller is entitled to another's: the numbers cover the caller's own listings
|
|
874
878
|
/// and nothing is aggregated across sellers.
|
|
875
879
|
///
|
|
876
880
|
/// THE FIGURES ARE COMPUTED, NOT READ FROM THE CANISTER-WIDE COUNTERS. `payments`' scalars are
|
|
@@ -892,6 +896,10 @@ service : {
|
|
|
892
896
|
///
|
|
893
897
|
/// `verified` is about ownership at a moment in time and nothing else. It is not an endorsement,
|
|
894
898
|
/// and the field name is the strongest claim it makes.
|
|
899
|
+
///
|
|
900
|
+
/// ⟨2026-11-04, the owner's ruling "1 A"⟩ It also says where this seller's sales land
|
|
901
|
+
/// (`evmPayout`, `evmPayoutError`) and how many are still in flight (`parkedPayouts`,
|
|
902
|
+
/// `parkedSaleNotices`) — counts, never amounts (`Types.SellerStatus`).
|
|
895
903
|
getSellerStatus: (seller: principal) -> (Result_12) query;
|
|
896
904
|
/// PUBLIC: aggregate session counts. Identifies nobody, and the same reasoning as getJobCounts —
|
|
897
905
|
/// which is also what made `listJobs`' old "no existence leak" defence false.
|
|
@@ -1030,21 +1038,17 @@ service : {
|
|
|
1030
1038
|
/// two facts that were one empty list.
|
|
1031
1039
|
listJobs: (serviceId: text, statusFilter: opt JobStatus, start: nat, limit:
|
|
1032
1040
|
nat) -> (Result_7) query;
|
|
1033
|
-
/// The parked
|
|
1034
|
-
///
|
|
1035
|
-
///
|
|
1036
|
-
///
|
|
1037
|
-
///
|
|
1038
|
-
///
|
|
1039
|
-
///
|
|
1040
|
-
///
|
|
1041
|
-
///
|
|
1042
|
-
///
|
|
1043
|
-
|
|
1044
|
-
/// not see, so nothing is ever hidden from them — unlike `listEndpointPurchases`, where a
|
|
1045
|
-
/// non-owner's view withholds other buyers' rows. Stated because a reader comparing the two
|
|
1046
|
-
/// should know the zero is a fact about this surface, not an unimplemented field.
|
|
1047
|
-
listMyPendingWithdrawals: (start: nat, limit: nat) -> (Result_6) query;
|
|
1041
|
+
/// ⟨2026-11-04, the owner's ruling "1 A"⟩ The parked payouts to the caller's engram — a content sale
|
|
1042
|
+
/// whose push the ledger has not confirmed, each settled by `retrySalePayout` — so an unresolved
|
|
1043
|
+
/// payout is discoverable rather than something a seller must already know the id of.
|
|
1044
|
+
///
|
|
1045
|
+
/// Behind the seller's CURRENT registration (`requireSellerRead`, the query twin of `requireSeller`),
|
|
1046
|
+
/// and scoped to that registration's engram by `Payments.parkedFor` — not an inline filter, for the
|
|
1047
|
+
/// reason that helper gives. `withheld` is 0 truthfully: the rows it drops belong to OTHER engrams
|
|
1048
|
+
/// and were never this caller's to see; a global count would tell a seller how many other sellers
|
|
1049
|
+
/// have a parked payout. PAGED, not a bounded exemption: a run of ledger outages across a run of
|
|
1050
|
+
/// sales accumulates rows with nothing to stop it.
|
|
1051
|
+
listMyParkedPayouts: (start: nat, limit: nat) -> (Result_6) query;
|
|
1048
1052
|
/// ⟨0.16.0⟩ `listAllServices` FOLDS in as `includeDisabled`.
|
|
1049
1053
|
///
|
|
1050
1054
|
/// The engram had two methods because the visibility rule differed: everyone saw enabled
|
|
@@ -1185,22 +1189,17 @@ service : {
|
|
|
1185
1189
|
/// arrives as `#Conflict` rather than `#NotFound`. Read the MESSAGE for which. This is the 0.16.0
|
|
1186
1190
|
/// contract as ratified on 2026-10-02; giving the library one arm per kind of refusal is post-cut
|
|
1187
1191
|
/// dependency work.
|
|
1188
|
-
reconcileSession: (sessionId: text) -> (Result_2);
|
|
1189
|
-
/// Settle a parked withdrawal by asking the ledger what happened, rather than assuming.
|
|
1190
1192
|
///
|
|
1191
|
-
///
|
|
1192
|
-
///
|
|
1193
|
-
///
|
|
1194
|
-
///
|
|
1195
|
-
///
|
|
1196
|
-
///
|
|
1197
|
-
///
|
|
1198
|
-
///
|
|
1199
|
-
///
|
|
1200
|
-
|
|
1201
|
-
///
|
|
1202
|
-
/// The precedent is the cashier's `recoverPendingClaim`: same saga, same rail, same reason.
|
|
1203
|
-
recoverContentWithdrawal: (withdrawalId: nat) -> (Result);
|
|
1193
|
+
/// ⟨2026-11-05, ic402 2.20.0 — beside the list of refusals above⟩ It now also resolves an ICP session
|
|
1194
|
+
/// left `#closing` by a close whose settle the ledger rejected after it may have run (that close
|
|
1195
|
+
/// answers "outcome unknown"). It moves no money itself: it reads the session's escrow balance, and
|
|
1196
|
+
/// the full deposit still there means the settle did not land, so the session reopens for a close to
|
|
1197
|
+
/// settle it once; less than the deposit means it did, so the session ends `#closed` with the
|
|
1198
|
+
/// remainder recoverable by its payer (`recoverEscrow`). Refused while a close of that session is
|
|
1199
|
+
/// still running ("call again once it returns"), and a failed balance or fee query leaves the session
|
|
1200
|
+
/// `#closing` to be reconciled again. THIS, NOT `forceResolveSession`, IS THE WAY OUT for such a
|
|
1201
|
+
/// session: forcing one whose settle never landed strands the recipient's share.
|
|
1202
|
+
reconcileSession: (sessionId: text) -> (Result_2);
|
|
1204
1203
|
/// Admin recovery: return unconsumed escrow from a stuck or terminal session's own subaccount.
|
|
1205
1204
|
/// THE ONE RECOVERY METHOD THAT MOVES REAL MONEY.
|
|
1206
1205
|
///
|
|
@@ -1254,7 +1253,19 @@ service : {
|
|
|
1254
1253
|
/// Re-registering is how a seller refreshes an expiring binding, and it is idempotent apart from
|
|
1255
1254
|
/// the timestamp. The byte count SURVIVES re-registration — otherwise the quota would reset every
|
|
1256
1255
|
/// thirty days, which is a quota in name only.
|
|
1257
|
-
|
|
1256
|
+
///
|
|
1257
|
+
/// ⟨2026-11-04, the owner's ruling "1 A": a sale is paid into the selling engram's own wallet⟩
|
|
1258
|
+
/// ON THIS MARKET'S BOOKS THE SELLER IS THE ENGRAM; the caller is the hand that lists for it. Every
|
|
1259
|
+
/// identity this market hands the payment library — a service's operator, the claimant, the
|
|
1260
|
+
/// submitter, the EVM payout key — is `engramId`, so the library pays the engram's own account on
|
|
1261
|
+
/// the ckUSDC rail with no money code of ours, and content sales are pushed there by `payEngram`.
|
|
1262
|
+
/// Three steps more than before, in order: the one-engram check (`oneEngramConflict`) before the
|
|
1263
|
+
/// first await; after the registry, the engram is asked for its own EVM address
|
|
1264
|
+
/// (`askEngramPayAddress`) and that address is registered with the library under the engram; the
|
|
1265
|
+
/// one-engram check again, and the binding written from the LIVE map (the byte count may have moved
|
|
1266
|
+
/// across the awaits). Last, this engram's parked sale notices are delivered (at most 16): a
|
|
1267
|
+
/// seller's own message, and the engram just answered.
|
|
1268
|
+
registerSeller: (engramId: principal) -> (Result);
|
|
1258
1269
|
/// Register a paid service. Born DISABLED, like an endpoint and for the same reason: a listing
|
|
1259
1270
|
/// that went live at creation would be sellable before its seller had checked it.
|
|
1260
1271
|
///
|
|
@@ -1274,13 +1285,13 @@ service : {
|
|
|
1274
1285
|
pricing: PricingScheme, verificationMethod: text, verifierCanisterId:
|
|
1275
1286
|
opt text, verificationKey: opt blob, delivery: ServiceDeliveryMethod,
|
|
1276
1287
|
timeout: nat, bindResult: opt bool) -> (Result_2);
|
|
1277
|
-
removeAuditViewer: (viewer: principal) -> (
|
|
1288
|
+
removeAuditViewer: (viewer: principal) -> (Result);
|
|
1278
1289
|
/// Remove a per-payer override so that payer reverts to — and keeps TRACKING — the global policy.
|
|
1279
1290
|
///
|
|
1280
1291
|
/// Its pair's only other "undo" was overwriting the override with a frozen copy of the global
|
|
1281
1292
|
/// policy, which then stops following later global changes. That is why the two never travel
|
|
1282
1293
|
/// apart: without this one, every override is permanent in effect.
|
|
1283
|
-
removeCallerPolicy: (caller: principal) -> (
|
|
1294
|
+
removeCallerPolicy: (caller: principal) -> (Result);
|
|
1284
1295
|
/// ⟨0.16.0⟩ RULED 2026-08-17: THE SELLER RESOLVES. Not the market admin.
|
|
1285
1296
|
///
|
|
1286
1297
|
/// The engram's `requireOwner` was coherent there because the engram's owner IS the seller — a
|
|
@@ -1309,7 +1320,7 @@ service : {
|
|
|
1309
1320
|
/// arrives as `#Conflict` rather than `#NotFound`. Read the MESSAGE for which. This is the 0.16.0
|
|
1310
1321
|
/// contract as ratified on 2026-10-02; giving the library one arm per kind of refusal is post-cut
|
|
1311
1322
|
/// dependency work.
|
|
1312
|
-
resolveDispute: (jobId: text, refundBuyer: bool) -> (
|
|
1323
|
+
resolveDispute: (jobId: text, refundBuyer: bool) -> (Result);
|
|
1313
1324
|
/// Admin LAST RESORT: force a job to a terminal status when reconcileJob cannot determine one —
|
|
1314
1325
|
/// a reverted or dead transaction that the chain will never resolve either way.
|
|
1315
1326
|
///
|
|
@@ -1330,7 +1341,30 @@ service : {
|
|
|
1330
1341
|
/// arrives as `#Conflict` rather than `#NotFound`. Read the MESSAGE for which. This is the 0.16.0
|
|
1331
1342
|
/// contract as ratified on 2026-10-02; giving the library one arm per kind of refusal is post-cut
|
|
1332
1343
|
/// dependency work.
|
|
1333
|
-
resolveJob: (jobId: text, terminal: JobStatus) -> (
|
|
1344
|
+
resolveJob: (jobId: text, terminal: JobStatus) -> (Result);
|
|
1345
|
+
/// ⟨2026-11-04, the owner's ruling "1 A"⟩ Deliver one engram's parked sale notices to its record —
|
|
1346
|
+
/// at most 16 a call, oldest first — and answer how many landed. CALLABLE BY ANYONE, anonymous
|
|
1347
|
+
/// included: the engram dedups on the receipt id and accepts only this market, so nothing can be
|
|
1348
|
+
/// misdirected or written twice; the same accepted residual as `retrySalePayout`. `#NotFound` when
|
|
1349
|
+
/// nothing is parked for that engram (every sale it made here reached its record, or none was made).
|
|
1350
|
+
retrySaleNotices: (engramId: principal) -> (Result_1);
|
|
1351
|
+
/// ⟨2026-11-04, the owner's ruling "1 A"⟩ Settle a parked sale payout by asking the ledger what
|
|
1352
|
+
/// happened, rather than assuming — the retired withdrawal recovery's saga, kept whole for the payout
|
|
1353
|
+
/// that replaced the withdrawal.
|
|
1354
|
+
///
|
|
1355
|
+
/// Re-sends the IDENTICAL transfer: same engram, amount, fee, memo and `created_at_time`. Within
|
|
1356
|
+
/// ICRC-1's 24-hour window there are exactly two conclusive outcomes: `#Duplicate` — the first push
|
|
1357
|
+
/// DID land, the engram has been paid, clear the row; `#Ok` — it had not, and this call has now
|
|
1358
|
+
/// paid it. `#TooOld` leaves it parked (outside the window only a human reading the ledger can say);
|
|
1359
|
+
/// `#BadFee` leaves it parked (the fee is part of the tuple — see `Types.PendingPayout.feeE6`); any
|
|
1360
|
+
/// other answer leaves it parked and retryable. Never guessed at.
|
|
1361
|
+
///
|
|
1362
|
+
/// CALLABLE BY ANYONE, anonymous included: the destination, amount, fee, memo and time are all
|
|
1363
|
+
/// recorded, so nothing about the call can be misdirected, and the chained row names whoever asked.
|
|
1364
|
+
/// The residual — a stranger can make the market spend one ledger call per press on its own debt —
|
|
1365
|
+
/// is accepted (a caller gate would buy nothing but a name). The sale's record line does not wait
|
|
1366
|
+
/// on this: the engram was told when the sale settled, whether the push paid or parked.
|
|
1367
|
+
retrySalePayout: (payoutId: nat) -> (Result_1);
|
|
1334
1368
|
/// Admin recovery: retry the payment to the seller of a job left `#Verified` by a failed payment.
|
|
1335
1369
|
/// NOTHING ELSE. It never refunds the buyer, and it refuses every job that does not read
|
|
1336
1370
|
/// `#Verified`, with nothing moved.
|
|
@@ -1360,10 +1394,10 @@ service : {
|
|
|
1360
1394
|
/// `#Conflict` covers the state refusals: a job that does not read `#Verified`, and the library's
|
|
1361
1395
|
/// own (a job that moved on before the retry ran, or a payment that failed). `#NotFound` is a job id
|
|
1362
1396
|
/// this market does not have.
|
|
1363
|
-
retrySellerPayment: (jobId: text) -> (
|
|
1364
|
-
setAdmin: (newAdmin: principal) -> (
|
|
1397
|
+
retrySellerPayment: (jobId: text) -> (Result);
|
|
1398
|
+
setAdmin: (newAdmin: principal) -> (Result);
|
|
1365
1399
|
/// Override the policy for ONE payer — the market's per-buyer risk control.
|
|
1366
|
-
setCallerPolicy: (caller: principal, policy: SpendingPolicy) -> (
|
|
1400
|
+
setCallerPolicy: (caller: principal, policy: SpendingPolicy) -> (Result);
|
|
1367
1401
|
/// ⟨0.16.0, L2.6⟩ `enableEndpoint` and `disableEndpoint` FOLD into one setter.
|
|
1368
1402
|
///
|
|
1369
1403
|
/// They were byte-identical apart from the status they wrote and the word in their name, which is
|
|
@@ -1375,29 +1409,19 @@ service : {
|
|
|
1375
1409
|
/// `#Deleted` stays a refusal in both directions and stays `#Conflict`, not `#Invalid`: the
|
|
1376
1410
|
/// request is well-formed and permitted, the endpoint is simply in a terminal state — and calling
|
|
1377
1411
|
/// that `#Invalid` would tell a caller to fix their request when nothing about it is wrong.
|
|
1378
|
-
setEndpointEnabled: (endpointId: text, enabled: bool) -> (
|
|
1412
|
+
setEndpointEnabled: (endpointId: text, enabled: bool) -> (Result);
|
|
1379
1413
|
/// Set an endpoint's price. THE SELLER'S, not the admin's.
|
|
1380
1414
|
///
|
|
1381
1415
|
/// requireEndpointOwner admits the market admin for the enable/disable pair, because a listing an
|
|
1382
1416
|
/// admin cannot take down is a moderation problem. PRICE IS DIFFERENT: changing what a seller
|
|
1383
1417
|
/// charges is trading on their behalf, and no recovery story needs it.
|
|
1384
|
-
setEndpointPrice: (endpointId: text, priceE6: nat) -> (
|
|
1385
|
-
/// A seller registers the EVM address their EVM-paid settlements are sent to.
|
|
1386
|
-
///
|
|
1387
|
-
/// SELF-SCOPED: the address is keyed by `msg.caller`, so the only account a caller can change is
|
|
1388
|
-
/// their own — there is no gate to get wrong, because there is nothing to gate. The engram's
|
|
1389
|
-
/// `requireAgentOrOwner` here was protecting a canister-level roster that a shared market does
|
|
1390
|
-
/// not have. Anonymous is refused: an anonymous payout address is an address nobody can be paid at.
|
|
1391
|
-
///
|
|
1392
|
-
/// Without one, an EVM-paid job's settlement FAILS CLOSED and rolls back — the market does not
|
|
1393
|
-
/// cross rails and pay an EVM seller out of the ICP pool.
|
|
1394
|
-
setEvmSellerPayout: (address: text) -> (Result_1);
|
|
1418
|
+
setEndpointPrice: (endpointId: text, priceE6: nat) -> (Result);
|
|
1395
1419
|
/// Set the market's global spending policy.
|
|
1396
1420
|
///
|
|
1397
1421
|
/// The audit row records the LIMITS, not just the fact of a change, so a WIDENING is
|
|
1398
1422
|
/// distinguishable from a tightening after the fact. A policy raise is the quiet half of most
|
|
1399
1423
|
/// money incidents, and "policy changed" alone cannot tell an investigator which way.
|
|
1400
|
-
setPaymentPolicy: (policy: SpendingPolicy) -> (
|
|
1424
|
+
setPaymentPolicy: (policy: SpendingPolicy) -> (Result);
|
|
1401
1425
|
/// Whom this canister anchors to. Set by the admin at deploy; `sys` because it is protocol
|
|
1402
1426
|
/// configuration, not a product surface.
|
|
1403
1427
|
///
|
|
@@ -1408,7 +1432,7 @@ service : {
|
|
|
1408
1432
|
/// and this method's only caller is a PERSON — the market's admin, at deploy. Keeping it there
|
|
1409
1433
|
/// made "a `sys` method has no human caller" false, and so uncheckable. A plain admin setter
|
|
1410
1434
|
/// (`setAdmin`'s sibling) is what it always was.
|
|
1411
|
-
setRegistryId: (id: principal) -> (
|
|
1435
|
+
setRegistryId: (id: principal) -> (Result);
|
|
1412
1436
|
/// ⟨0.16.0, L2.6⟩ enableService + disableService FOLD, same as the endpoint pair.
|
|
1413
1437
|
///
|
|
1414
1438
|
/// Deliberately NOT admin-overridable, unlike endpoints. Disabling a seller's service is a
|
|
@@ -1430,7 +1454,7 @@ service : {
|
|
|
1430
1454
|
/// not found" texts cannot reach the `#Conflict` arm below except across a race with a deletion.
|
|
1431
1455
|
/// The seam is closed on this method by the gate, not by the library; the others keep their
|
|
1432
1456
|
/// caveats.
|
|
1433
|
-
setServiceEnabled: (id: text, enabled: bool) -> (
|
|
1457
|
+
setServiceEnabled: (id: text, enabled: bool) -> (Result);
|
|
1434
1458
|
/// A seller submits a finished job's result.
|
|
1435
1459
|
///
|
|
1436
1460
|
/// AUTHORITY IS THE JOB'S SELLER, checked by ic402 against the claim — not "a seller of this
|
|
@@ -1451,33 +1475,21 @@ service : {
|
|
|
1451
1475
|
/// theirs. Read the MESSAGE, not the arm. This is the 0.16.0 contract as ratified on 2026-10-02;
|
|
1452
1476
|
/// giving the library one arm per kind of refusal is post-cut dependency work.
|
|
1453
1477
|
submitJobResult: (jobId: text, result: blob, proof: opt blob, actualCost:
|
|
1454
|
-
opt nat) -> (
|
|
1478
|
+
opt nat) -> (Result);
|
|
1455
1479
|
/// Upload a whole file in one call.
|
|
1456
|
-
uploadContent: (id: text, mimeType: text, data: blob) -> (
|
|
1480
|
+
uploadContent: (id: text, mimeType: text, data: blob) -> (Result);
|
|
1457
1481
|
/// Push one chunk of a started upload. NOT charged — uploadContentInit already reserved the
|
|
1458
1482
|
/// declared total, so charging again here would bill the same bytes twice.
|
|
1459
|
-
uploadContentChunk: (id: text, index: nat, data: blob) -> (
|
|
1483
|
+
uploadContentChunk: (id: text, index: nat, data: blob) -> (Result);
|
|
1460
1484
|
/// Begin a chunked upload. The WHOLE declared size is charged here, up front.
|
|
1461
1485
|
///
|
|
1462
1486
|
/// Charging at init rather than per chunk is the point: a per-chunk charge would let a seller
|
|
1463
1487
|
/// begin an upload that cannot finish, and discover it only after claiming most of the memory.
|
|
1464
1488
|
/// Reserving the declared total means an over-quota upload is refused before its first byte lands.
|
|
1465
1489
|
uploadContentInit: (id: text, mimeType: text, totalSize: nat, chunkCount:
|
|
1466
|
-
nat) -> (
|
|
1490
|
+
nat) -> (Result);
|
|
1467
1491
|
/// The buyer-facing half of the same check, kept because it answers a different question: "is my
|
|
1468
1492
|
/// grant still good", asked BEFORE spending a round trip on a chunk. Documented in ACCESS-CONTROL
|
|
1469
1493
|
/// as the buyer's pre-flight.
|
|
1470
|
-
verifyGrant: (grant: AccessGrant) -> (
|
|
1471
|
-
/// Withdraw everything this caller has earned from content sales, to their own principal.
|
|
1472
|
-
///
|
|
1473
|
-
/// NO DESTINATION ARGUMENT, and that is the security property rather than a missing feature: the
|
|
1474
|
-
/// funds go to `msg.caller` and nowhere else, so a stolen or mis-signed call cannot redirect a
|
|
1475
|
-
/// seller's balance to an attacker's account. A seller who wants the money elsewhere moves it
|
|
1476
|
-
/// from their own account, where they are the only signer.
|
|
1477
|
-
///
|
|
1478
|
-
/// NOT GATED ON `requireSeller`. A seller binding expires and can be revoked; earnings do not.
|
|
1479
|
-
/// Gating withdrawal on current seller status would strand the balance of anyone whose engram
|
|
1480
|
-
/// lapsed after they sold — money owed, permanently unreachable, for a reason unrelated to the
|
|
1481
|
-
/// debt. The gate is the debt itself: you may withdraw exactly what you are owed.
|
|
1482
|
-
withdrawContentRevenue: () -> (Result);
|
|
1494
|
+
verifyGrant: (grant: AccessGrant) -> (Result) query;
|
|
1483
1495
|
}
|