@receiz/sdk 93.0.0 → 93.2.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 +54 -0
- package/dist/index.d.ts +544 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +439 -1
- package/docs/proof-memory-and-projections.md +119 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,6 +28,60 @@ Default integration order:
|
|
|
28
28
|
3. Append public proof, wallet, sports, or Connect additions after the known truth.
|
|
29
29
|
4. Never treat an SDK response as stronger than the sealed artifact, verified append, ownership append, or settlement primitive it projects.
|
|
30
30
|
|
|
31
|
+
## Five-Minute Proof Object App
|
|
32
|
+
|
|
33
|
+
This is the highest-leverage SDK path for most apps:
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import {
|
|
37
|
+
createReceizClient,
|
|
38
|
+
createReceizProofRegister,
|
|
39
|
+
projectReceizAssetManifest,
|
|
40
|
+
} from "@receiz/sdk";
|
|
41
|
+
|
|
42
|
+
const receiz = createReceizClient({ accessToken: process.env.RECEIZ_ACCESS_TOKEN });
|
|
43
|
+
const register = createReceizProofRegister({ ownerId: "local-user-or-workspace-id" });
|
|
44
|
+
|
|
45
|
+
const verified = await receiz.verification.verifyArtifact(file);
|
|
46
|
+
if (!verified.ok) throw new Error(verified.errors.join(", "));
|
|
47
|
+
|
|
48
|
+
const manifest = verified.bundle?.assetManifest;
|
|
49
|
+
const projection = projectReceizAssetManifest(manifest);
|
|
50
|
+
register.admitAssetManifest(manifest);
|
|
51
|
+
|
|
52
|
+
renderReceizObject({
|
|
53
|
+
title: projection.title,
|
|
54
|
+
mediaUrl: projection.mediaUrl,
|
|
55
|
+
verifyUrl: projection.verifyUrl,
|
|
56
|
+
rows: projection.rows,
|
|
57
|
+
});
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The register is not a cache. It is the app's admitted verified prefix. Use it immediately on next open, then ask Receiz only for verified additions after the known head.
|
|
61
|
+
|
|
62
|
+
Full quickstart: `docs/proof-memory-and-projections.md`.
|
|
63
|
+
|
|
64
|
+
## Schemas, Projections, And Proof Memory
|
|
65
|
+
|
|
66
|
+
```ts
|
|
67
|
+
import {
|
|
68
|
+
RECEIZ_SCHEMAS,
|
|
69
|
+
createReceizProofRegister,
|
|
70
|
+
projectReceizSportsCardManifest,
|
|
71
|
+
} from "@receiz/sdk";
|
|
72
|
+
|
|
73
|
+
const schema = RECEIZ_SCHEMAS.sportsCardManifest;
|
|
74
|
+
const projection = projectReceizSportsCardManifest(cardManifest);
|
|
75
|
+
|
|
76
|
+
const memory = createReceizProofRegister();
|
|
77
|
+
memory.admitSportsCardManifest(cardManifest);
|
|
78
|
+
memory.admitWebhookEvent(webhookEvent);
|
|
79
|
+
|
|
80
|
+
const snapshot = memory.snapshot();
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Use schemas for developer validation, projections for display-ready proof rows, and proof memory for first-admission-then-append-forever UX.
|
|
84
|
+
|
|
31
85
|
## Artifact Verification
|
|
32
86
|
|
|
33
87
|
```ts
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const RECEIZ_SDK_VERSION = "93.
|
|
1
|
+
export declare const RECEIZ_SDK_VERSION = "93.2.0";
|
|
2
2
|
export declare const RECEIZ_DEFAULT_BASE_URL = "https://receiz.com";
|
|
3
3
|
export declare const RECEIZ_WEBHOOK_SIGNATURE_HEADER = "x-receiz-signature";
|
|
4
4
|
export declare const RECEIZ_WEBHOOK_TIMESTAMP_HEADER = "x-receiz-timestamp";
|
|
@@ -212,6 +212,372 @@ export type ReceizWebhookVerifyInput = ReceizWebhookSignatureInput & {
|
|
|
212
212
|
toleranceSeconds?: number;
|
|
213
213
|
nowMs?: number;
|
|
214
214
|
};
|
|
215
|
+
export type ReceizProofProjectionRow = {
|
|
216
|
+
label: string;
|
|
217
|
+
value: string;
|
|
218
|
+
href?: string | null;
|
|
219
|
+
};
|
|
220
|
+
export type ReceizAssetManifestProjection = {
|
|
221
|
+
schema: "receiz.sdk.asset_manifest_projection.v1";
|
|
222
|
+
assetId: string;
|
|
223
|
+
assetType: ReceizAssetManifest["assetType"];
|
|
224
|
+
title: string;
|
|
225
|
+
subtitle: string;
|
|
226
|
+
proofKind: string;
|
|
227
|
+
verifyUrl: string | null;
|
|
228
|
+
primaryUrl: string | null;
|
|
229
|
+
mediaUrl: string | null;
|
|
230
|
+
ownerLabel: string | null;
|
|
231
|
+
appendCount: number;
|
|
232
|
+
settlementState: string | null;
|
|
233
|
+
rows: ReceizProofProjectionRow[];
|
|
234
|
+
manifest: ReceizAssetManifest;
|
|
235
|
+
};
|
|
236
|
+
export type ReceizSportsCardManifestProjection = {
|
|
237
|
+
schema: "receiz.sdk.sports_card_manifest_projection.v1";
|
|
238
|
+
sport: string;
|
|
239
|
+
collectibleId: string;
|
|
240
|
+
claimHash: string;
|
|
241
|
+
title: string;
|
|
242
|
+
subtitle: string;
|
|
243
|
+
verifyUrl: string | null;
|
|
244
|
+
eventProofUrl: string | null;
|
|
245
|
+
mediaUrl: string | null;
|
|
246
|
+
ownerLabel: string | null;
|
|
247
|
+
scoreLabel: string | null;
|
|
248
|
+
valueLabel: string | null;
|
|
249
|
+
appendCount: number;
|
|
250
|
+
eventProofCount: number;
|
|
251
|
+
rows: ReceizProofProjectionRow[];
|
|
252
|
+
manifest: ReceizSportsCardManifest;
|
|
253
|
+
};
|
|
254
|
+
export type ReceizProofRegisterEntry = {
|
|
255
|
+
id: string;
|
|
256
|
+
kind: string;
|
|
257
|
+
createdAt?: string | null;
|
|
258
|
+
kaiUpulse?: string | number | null;
|
|
259
|
+
proof?: JsonObject | null;
|
|
260
|
+
payload: JsonObject;
|
|
261
|
+
projection?: JsonObject | null;
|
|
262
|
+
};
|
|
263
|
+
export type ReceizProofRegisterSnapshot = {
|
|
264
|
+
schema: "receiz.sdk.proof_register.v1";
|
|
265
|
+
ownerId?: string | null;
|
|
266
|
+
createdAt: string;
|
|
267
|
+
updatedAt: string;
|
|
268
|
+
head: {
|
|
269
|
+
entryId: string | null;
|
|
270
|
+
kaiUpulse: string | number | null;
|
|
271
|
+
createdAt: string | null;
|
|
272
|
+
count: number;
|
|
273
|
+
};
|
|
274
|
+
entries: ReceizProofRegisterEntry[];
|
|
275
|
+
};
|
|
276
|
+
export type ReceizProofRegisterInput = ReceizProofRegisterSnapshot | {
|
|
277
|
+
ownerId?: string | null;
|
|
278
|
+
createdAt?: string;
|
|
279
|
+
entries?: ReceizProofRegisterEntry[];
|
|
280
|
+
};
|
|
281
|
+
export declare const RECEIZ_ASSET_MANIFEST_SCHEMA: {
|
|
282
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
283
|
+
readonly $id: "https://receiz.com/standards/receiz.asset-manifest.schema.v1.json";
|
|
284
|
+
readonly title: "Receiz Asset Manifest";
|
|
285
|
+
readonly type: "object";
|
|
286
|
+
readonly additionalProperties: true;
|
|
287
|
+
readonly required: readonly ["schema", "assetId", "assetType", "proof", "links"];
|
|
288
|
+
readonly properties: {
|
|
289
|
+
readonly schema: {
|
|
290
|
+
readonly const: "receiz.asset_manifest.v1";
|
|
291
|
+
};
|
|
292
|
+
readonly assetId: {
|
|
293
|
+
readonly type: "string";
|
|
294
|
+
readonly minLength: 1;
|
|
295
|
+
};
|
|
296
|
+
readonly assetType: {
|
|
297
|
+
readonly enum: readonly ["proof_object", "sports_card", "signal_card", "wallet_note", "market_certificate", "profile_original", "document"];
|
|
298
|
+
};
|
|
299
|
+
readonly proof: {
|
|
300
|
+
readonly type: "object";
|
|
301
|
+
readonly required: readonly ["kind"];
|
|
302
|
+
readonly additionalProperties: true;
|
|
303
|
+
readonly properties: {
|
|
304
|
+
readonly kind: {
|
|
305
|
+
readonly type: "string";
|
|
306
|
+
readonly minLength: 1;
|
|
307
|
+
};
|
|
308
|
+
readonly verifyUrl: {
|
|
309
|
+
readonly type: "string";
|
|
310
|
+
};
|
|
311
|
+
readonly kaiPulseEternal: {
|
|
312
|
+
readonly type: readonly ["number", "string"];
|
|
313
|
+
};
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
readonly owner: {
|
|
317
|
+
readonly type: readonly ["object", "null"];
|
|
318
|
+
readonly additionalProperties: true;
|
|
319
|
+
};
|
|
320
|
+
readonly media: {
|
|
321
|
+
readonly type: readonly ["object", "null"];
|
|
322
|
+
readonly additionalProperties: true;
|
|
323
|
+
};
|
|
324
|
+
readonly appends: {
|
|
325
|
+
readonly type: "array";
|
|
326
|
+
readonly items: {
|
|
327
|
+
readonly type: "object";
|
|
328
|
+
readonly additionalProperties: true;
|
|
329
|
+
};
|
|
330
|
+
};
|
|
331
|
+
readonly settlement: {
|
|
332
|
+
readonly type: readonly ["object", "null"];
|
|
333
|
+
readonly additionalProperties: true;
|
|
334
|
+
};
|
|
335
|
+
readonly links: {
|
|
336
|
+
readonly type: "object";
|
|
337
|
+
readonly additionalProperties: {
|
|
338
|
+
readonly type: "string";
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
export declare const RECEIZ_SPORTS_CARD_MANIFEST_SCHEMA: {
|
|
344
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
345
|
+
readonly $id: "https://receiz.com/standards/receiz.sports-card-manifest.schema.v1.json";
|
|
346
|
+
readonly title: "Receiz Sports Arena Card Manifest";
|
|
347
|
+
readonly type: "object";
|
|
348
|
+
readonly additionalProperties: true;
|
|
349
|
+
readonly required: readonly ["schema", "sport", "collectibleId", "claimHash", "card", "ownership", "valueBasis", "links"];
|
|
350
|
+
readonly properties: {
|
|
351
|
+
readonly schema: {
|
|
352
|
+
readonly const: "receiz.sports_arena.card_manifest.v1";
|
|
353
|
+
};
|
|
354
|
+
readonly sport: {
|
|
355
|
+
readonly type: "string";
|
|
356
|
+
readonly minLength: 1;
|
|
357
|
+
};
|
|
358
|
+
readonly collectibleId: {
|
|
359
|
+
readonly type: "string";
|
|
360
|
+
readonly minLength: 1;
|
|
361
|
+
};
|
|
362
|
+
readonly claimHash: {
|
|
363
|
+
readonly type: "string";
|
|
364
|
+
readonly minLength: 1;
|
|
365
|
+
};
|
|
366
|
+
readonly card: {
|
|
367
|
+
readonly type: "object";
|
|
368
|
+
readonly additionalProperties: true;
|
|
369
|
+
};
|
|
370
|
+
readonly ownership: {
|
|
371
|
+
readonly type: "object";
|
|
372
|
+
readonly additionalProperties: true;
|
|
373
|
+
};
|
|
374
|
+
readonly valueBasis: {
|
|
375
|
+
readonly type: "object";
|
|
376
|
+
readonly additionalProperties: true;
|
|
377
|
+
};
|
|
378
|
+
readonly appendSummary: {
|
|
379
|
+
readonly type: readonly ["object", "null"];
|
|
380
|
+
readonly additionalProperties: true;
|
|
381
|
+
};
|
|
382
|
+
readonly eventProofSummary: {
|
|
383
|
+
readonly type: readonly ["object", "null"];
|
|
384
|
+
readonly additionalProperties: true;
|
|
385
|
+
};
|
|
386
|
+
readonly links: {
|
|
387
|
+
readonly type: "object";
|
|
388
|
+
readonly additionalProperties: {
|
|
389
|
+
readonly type: "string";
|
|
390
|
+
};
|
|
391
|
+
};
|
|
392
|
+
};
|
|
393
|
+
};
|
|
394
|
+
export declare const RECEIZ_WEBHOOK_EVENT_SCHEMA: {
|
|
395
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
396
|
+
readonly $id: "https://receiz.com/standards/receiz.webhook-event.schema.v1.json";
|
|
397
|
+
readonly title: "Receiz Webhook Event";
|
|
398
|
+
readonly type: "object";
|
|
399
|
+
readonly additionalProperties: true;
|
|
400
|
+
readonly required: readonly ["schema", "id", "type", "createdAt", "data"];
|
|
401
|
+
readonly properties: {
|
|
402
|
+
readonly schema: {
|
|
403
|
+
readonly const: "receiz.webhook_event.v1";
|
|
404
|
+
};
|
|
405
|
+
readonly id: {
|
|
406
|
+
readonly type: "string";
|
|
407
|
+
readonly minLength: 1;
|
|
408
|
+
};
|
|
409
|
+
readonly type: {
|
|
410
|
+
readonly enum: readonly ["asset.created", "asset.transferred", "proof.appended", "sports_card.scored", "event_proof.created", "wallet.ledger_entry", "note.claimed", "market.trade", "profile.asset.visible_changed"];
|
|
411
|
+
};
|
|
412
|
+
readonly createdAt: {
|
|
413
|
+
readonly type: "string";
|
|
414
|
+
readonly minLength: 1;
|
|
415
|
+
};
|
|
416
|
+
readonly data: {
|
|
417
|
+
readonly type: "object";
|
|
418
|
+
readonly additionalProperties: true;
|
|
419
|
+
};
|
|
420
|
+
readonly actor: {
|
|
421
|
+
readonly type: readonly ["object", "null"];
|
|
422
|
+
readonly additionalProperties: true;
|
|
423
|
+
};
|
|
424
|
+
readonly signature: {
|
|
425
|
+
readonly type: readonly ["object", "null"];
|
|
426
|
+
readonly additionalProperties: true;
|
|
427
|
+
};
|
|
428
|
+
};
|
|
429
|
+
};
|
|
430
|
+
export declare const RECEIZ_SCHEMAS: {
|
|
431
|
+
readonly assetManifest: {
|
|
432
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
433
|
+
readonly $id: "https://receiz.com/standards/receiz.asset-manifest.schema.v1.json";
|
|
434
|
+
readonly title: "Receiz Asset Manifest";
|
|
435
|
+
readonly type: "object";
|
|
436
|
+
readonly additionalProperties: true;
|
|
437
|
+
readonly required: readonly ["schema", "assetId", "assetType", "proof", "links"];
|
|
438
|
+
readonly properties: {
|
|
439
|
+
readonly schema: {
|
|
440
|
+
readonly const: "receiz.asset_manifest.v1";
|
|
441
|
+
};
|
|
442
|
+
readonly assetId: {
|
|
443
|
+
readonly type: "string";
|
|
444
|
+
readonly minLength: 1;
|
|
445
|
+
};
|
|
446
|
+
readonly assetType: {
|
|
447
|
+
readonly enum: readonly ["proof_object", "sports_card", "signal_card", "wallet_note", "market_certificate", "profile_original", "document"];
|
|
448
|
+
};
|
|
449
|
+
readonly proof: {
|
|
450
|
+
readonly type: "object";
|
|
451
|
+
readonly required: readonly ["kind"];
|
|
452
|
+
readonly additionalProperties: true;
|
|
453
|
+
readonly properties: {
|
|
454
|
+
readonly kind: {
|
|
455
|
+
readonly type: "string";
|
|
456
|
+
readonly minLength: 1;
|
|
457
|
+
};
|
|
458
|
+
readonly verifyUrl: {
|
|
459
|
+
readonly type: "string";
|
|
460
|
+
};
|
|
461
|
+
readonly kaiPulseEternal: {
|
|
462
|
+
readonly type: readonly ["number", "string"];
|
|
463
|
+
};
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
readonly owner: {
|
|
467
|
+
readonly type: readonly ["object", "null"];
|
|
468
|
+
readonly additionalProperties: true;
|
|
469
|
+
};
|
|
470
|
+
readonly media: {
|
|
471
|
+
readonly type: readonly ["object", "null"];
|
|
472
|
+
readonly additionalProperties: true;
|
|
473
|
+
};
|
|
474
|
+
readonly appends: {
|
|
475
|
+
readonly type: "array";
|
|
476
|
+
readonly items: {
|
|
477
|
+
readonly type: "object";
|
|
478
|
+
readonly additionalProperties: true;
|
|
479
|
+
};
|
|
480
|
+
};
|
|
481
|
+
readonly settlement: {
|
|
482
|
+
readonly type: readonly ["object", "null"];
|
|
483
|
+
readonly additionalProperties: true;
|
|
484
|
+
};
|
|
485
|
+
readonly links: {
|
|
486
|
+
readonly type: "object";
|
|
487
|
+
readonly additionalProperties: {
|
|
488
|
+
readonly type: "string";
|
|
489
|
+
};
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
};
|
|
493
|
+
readonly sportsCardManifest: {
|
|
494
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
495
|
+
readonly $id: "https://receiz.com/standards/receiz.sports-card-manifest.schema.v1.json";
|
|
496
|
+
readonly title: "Receiz Sports Arena Card Manifest";
|
|
497
|
+
readonly type: "object";
|
|
498
|
+
readonly additionalProperties: true;
|
|
499
|
+
readonly required: readonly ["schema", "sport", "collectibleId", "claimHash", "card", "ownership", "valueBasis", "links"];
|
|
500
|
+
readonly properties: {
|
|
501
|
+
readonly schema: {
|
|
502
|
+
readonly const: "receiz.sports_arena.card_manifest.v1";
|
|
503
|
+
};
|
|
504
|
+
readonly sport: {
|
|
505
|
+
readonly type: "string";
|
|
506
|
+
readonly minLength: 1;
|
|
507
|
+
};
|
|
508
|
+
readonly collectibleId: {
|
|
509
|
+
readonly type: "string";
|
|
510
|
+
readonly minLength: 1;
|
|
511
|
+
};
|
|
512
|
+
readonly claimHash: {
|
|
513
|
+
readonly type: "string";
|
|
514
|
+
readonly minLength: 1;
|
|
515
|
+
};
|
|
516
|
+
readonly card: {
|
|
517
|
+
readonly type: "object";
|
|
518
|
+
readonly additionalProperties: true;
|
|
519
|
+
};
|
|
520
|
+
readonly ownership: {
|
|
521
|
+
readonly type: "object";
|
|
522
|
+
readonly additionalProperties: true;
|
|
523
|
+
};
|
|
524
|
+
readonly valueBasis: {
|
|
525
|
+
readonly type: "object";
|
|
526
|
+
readonly additionalProperties: true;
|
|
527
|
+
};
|
|
528
|
+
readonly appendSummary: {
|
|
529
|
+
readonly type: readonly ["object", "null"];
|
|
530
|
+
readonly additionalProperties: true;
|
|
531
|
+
};
|
|
532
|
+
readonly eventProofSummary: {
|
|
533
|
+
readonly type: readonly ["object", "null"];
|
|
534
|
+
readonly additionalProperties: true;
|
|
535
|
+
};
|
|
536
|
+
readonly links: {
|
|
537
|
+
readonly type: "object";
|
|
538
|
+
readonly additionalProperties: {
|
|
539
|
+
readonly type: "string";
|
|
540
|
+
};
|
|
541
|
+
};
|
|
542
|
+
};
|
|
543
|
+
};
|
|
544
|
+
readonly webhookEvent: {
|
|
545
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
546
|
+
readonly $id: "https://receiz.com/standards/receiz.webhook-event.schema.v1.json";
|
|
547
|
+
readonly title: "Receiz Webhook Event";
|
|
548
|
+
readonly type: "object";
|
|
549
|
+
readonly additionalProperties: true;
|
|
550
|
+
readonly required: readonly ["schema", "id", "type", "createdAt", "data"];
|
|
551
|
+
readonly properties: {
|
|
552
|
+
readonly schema: {
|
|
553
|
+
readonly const: "receiz.webhook_event.v1";
|
|
554
|
+
};
|
|
555
|
+
readonly id: {
|
|
556
|
+
readonly type: "string";
|
|
557
|
+
readonly minLength: 1;
|
|
558
|
+
};
|
|
559
|
+
readonly type: {
|
|
560
|
+
readonly enum: readonly ["asset.created", "asset.transferred", "proof.appended", "sports_card.scored", "event_proof.created", "wallet.ledger_entry", "note.claimed", "market.trade", "profile.asset.visible_changed"];
|
|
561
|
+
};
|
|
562
|
+
readonly createdAt: {
|
|
563
|
+
readonly type: "string";
|
|
564
|
+
readonly minLength: 1;
|
|
565
|
+
};
|
|
566
|
+
readonly data: {
|
|
567
|
+
readonly type: "object";
|
|
568
|
+
readonly additionalProperties: true;
|
|
569
|
+
};
|
|
570
|
+
readonly actor: {
|
|
571
|
+
readonly type: readonly ["object", "null"];
|
|
572
|
+
readonly additionalProperties: true;
|
|
573
|
+
};
|
|
574
|
+
readonly signature: {
|
|
575
|
+
readonly type: readonly ["object", "null"];
|
|
576
|
+
readonly additionalProperties: true;
|
|
577
|
+
};
|
|
578
|
+
};
|
|
579
|
+
};
|
|
580
|
+
};
|
|
215
581
|
type RequestOptions = {
|
|
216
582
|
method?: string;
|
|
217
583
|
body?: BodyInit | JsonObject | URLSearchParams;
|
|
@@ -326,6 +692,166 @@ export declare class ReceizClient {
|
|
|
326
692
|
isAsset: typeof isReceizAssetManifest;
|
|
327
693
|
isSportsCard: typeof isReceizSportsCardManifest;
|
|
328
694
|
isWebhookEvent: typeof isReceizWebhookEvent;
|
|
695
|
+
projectAsset: typeof projectReceizAssetManifest;
|
|
696
|
+
projectSportsCard: typeof projectReceizSportsCardManifest;
|
|
697
|
+
};
|
|
698
|
+
readonly schemas: {
|
|
699
|
+
readonly assetManifest: {
|
|
700
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
701
|
+
readonly $id: "https://receiz.com/standards/receiz.asset-manifest.schema.v1.json";
|
|
702
|
+
readonly title: "Receiz Asset Manifest";
|
|
703
|
+
readonly type: "object";
|
|
704
|
+
readonly additionalProperties: true;
|
|
705
|
+
readonly required: readonly ["schema", "assetId", "assetType", "proof", "links"];
|
|
706
|
+
readonly properties: {
|
|
707
|
+
readonly schema: {
|
|
708
|
+
readonly const: "receiz.asset_manifest.v1";
|
|
709
|
+
};
|
|
710
|
+
readonly assetId: {
|
|
711
|
+
readonly type: "string";
|
|
712
|
+
readonly minLength: 1;
|
|
713
|
+
};
|
|
714
|
+
readonly assetType: {
|
|
715
|
+
readonly enum: readonly ["proof_object", "sports_card", "signal_card", "wallet_note", "market_certificate", "profile_original", "document"];
|
|
716
|
+
};
|
|
717
|
+
readonly proof: {
|
|
718
|
+
readonly type: "object";
|
|
719
|
+
readonly required: readonly ["kind"];
|
|
720
|
+
readonly additionalProperties: true;
|
|
721
|
+
readonly properties: {
|
|
722
|
+
readonly kind: {
|
|
723
|
+
readonly type: "string";
|
|
724
|
+
readonly minLength: 1;
|
|
725
|
+
};
|
|
726
|
+
readonly verifyUrl: {
|
|
727
|
+
readonly type: "string";
|
|
728
|
+
};
|
|
729
|
+
readonly kaiPulseEternal: {
|
|
730
|
+
readonly type: readonly ["number", "string"];
|
|
731
|
+
};
|
|
732
|
+
};
|
|
733
|
+
};
|
|
734
|
+
readonly owner: {
|
|
735
|
+
readonly type: readonly ["object", "null"];
|
|
736
|
+
readonly additionalProperties: true;
|
|
737
|
+
};
|
|
738
|
+
readonly media: {
|
|
739
|
+
readonly type: readonly ["object", "null"];
|
|
740
|
+
readonly additionalProperties: true;
|
|
741
|
+
};
|
|
742
|
+
readonly appends: {
|
|
743
|
+
readonly type: "array";
|
|
744
|
+
readonly items: {
|
|
745
|
+
readonly type: "object";
|
|
746
|
+
readonly additionalProperties: true;
|
|
747
|
+
};
|
|
748
|
+
};
|
|
749
|
+
readonly settlement: {
|
|
750
|
+
readonly type: readonly ["object", "null"];
|
|
751
|
+
readonly additionalProperties: true;
|
|
752
|
+
};
|
|
753
|
+
readonly links: {
|
|
754
|
+
readonly type: "object";
|
|
755
|
+
readonly additionalProperties: {
|
|
756
|
+
readonly type: "string";
|
|
757
|
+
};
|
|
758
|
+
};
|
|
759
|
+
};
|
|
760
|
+
};
|
|
761
|
+
readonly sportsCardManifest: {
|
|
762
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
763
|
+
readonly $id: "https://receiz.com/standards/receiz.sports-card-manifest.schema.v1.json";
|
|
764
|
+
readonly title: "Receiz Sports Arena Card Manifest";
|
|
765
|
+
readonly type: "object";
|
|
766
|
+
readonly additionalProperties: true;
|
|
767
|
+
readonly required: readonly ["schema", "sport", "collectibleId", "claimHash", "card", "ownership", "valueBasis", "links"];
|
|
768
|
+
readonly properties: {
|
|
769
|
+
readonly schema: {
|
|
770
|
+
readonly const: "receiz.sports_arena.card_manifest.v1";
|
|
771
|
+
};
|
|
772
|
+
readonly sport: {
|
|
773
|
+
readonly type: "string";
|
|
774
|
+
readonly minLength: 1;
|
|
775
|
+
};
|
|
776
|
+
readonly collectibleId: {
|
|
777
|
+
readonly type: "string";
|
|
778
|
+
readonly minLength: 1;
|
|
779
|
+
};
|
|
780
|
+
readonly claimHash: {
|
|
781
|
+
readonly type: "string";
|
|
782
|
+
readonly minLength: 1;
|
|
783
|
+
};
|
|
784
|
+
readonly card: {
|
|
785
|
+
readonly type: "object";
|
|
786
|
+
readonly additionalProperties: true;
|
|
787
|
+
};
|
|
788
|
+
readonly ownership: {
|
|
789
|
+
readonly type: "object";
|
|
790
|
+
readonly additionalProperties: true;
|
|
791
|
+
};
|
|
792
|
+
readonly valueBasis: {
|
|
793
|
+
readonly type: "object";
|
|
794
|
+
readonly additionalProperties: true;
|
|
795
|
+
};
|
|
796
|
+
readonly appendSummary: {
|
|
797
|
+
readonly type: readonly ["object", "null"];
|
|
798
|
+
readonly additionalProperties: true;
|
|
799
|
+
};
|
|
800
|
+
readonly eventProofSummary: {
|
|
801
|
+
readonly type: readonly ["object", "null"];
|
|
802
|
+
readonly additionalProperties: true;
|
|
803
|
+
};
|
|
804
|
+
readonly links: {
|
|
805
|
+
readonly type: "object";
|
|
806
|
+
readonly additionalProperties: {
|
|
807
|
+
readonly type: "string";
|
|
808
|
+
};
|
|
809
|
+
};
|
|
810
|
+
};
|
|
811
|
+
};
|
|
812
|
+
readonly webhookEvent: {
|
|
813
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
814
|
+
readonly $id: "https://receiz.com/standards/receiz.webhook-event.schema.v1.json";
|
|
815
|
+
readonly title: "Receiz Webhook Event";
|
|
816
|
+
readonly type: "object";
|
|
817
|
+
readonly additionalProperties: true;
|
|
818
|
+
readonly required: readonly ["schema", "id", "type", "createdAt", "data"];
|
|
819
|
+
readonly properties: {
|
|
820
|
+
readonly schema: {
|
|
821
|
+
readonly const: "receiz.webhook_event.v1";
|
|
822
|
+
};
|
|
823
|
+
readonly id: {
|
|
824
|
+
readonly type: "string";
|
|
825
|
+
readonly minLength: 1;
|
|
826
|
+
};
|
|
827
|
+
readonly type: {
|
|
828
|
+
readonly enum: readonly ["asset.created", "asset.transferred", "proof.appended", "sports_card.scored", "event_proof.created", "wallet.ledger_entry", "note.claimed", "market.trade", "profile.asset.visible_changed"];
|
|
829
|
+
};
|
|
830
|
+
readonly createdAt: {
|
|
831
|
+
readonly type: "string";
|
|
832
|
+
readonly minLength: 1;
|
|
833
|
+
};
|
|
834
|
+
readonly data: {
|
|
835
|
+
readonly type: "object";
|
|
836
|
+
readonly additionalProperties: true;
|
|
837
|
+
};
|
|
838
|
+
readonly actor: {
|
|
839
|
+
readonly type: readonly ["object", "null"];
|
|
840
|
+
readonly additionalProperties: true;
|
|
841
|
+
};
|
|
842
|
+
readonly signature: {
|
|
843
|
+
readonly type: readonly ["object", "null"];
|
|
844
|
+
readonly additionalProperties: true;
|
|
845
|
+
};
|
|
846
|
+
};
|
|
847
|
+
};
|
|
848
|
+
};
|
|
849
|
+
readonly projections: {
|
|
850
|
+
assetManifest: typeof projectReceizAssetManifest;
|
|
851
|
+
sportsCardManifest: typeof projectReceizSportsCardManifest;
|
|
852
|
+
};
|
|
853
|
+
readonly proofMemory: {
|
|
854
|
+
createRegister: typeof createReceizProofRegister;
|
|
329
855
|
};
|
|
330
856
|
constructor(options?: ReceizClientOptions);
|
|
331
857
|
request<T>(path: string, options?: RequestOptions): Promise<T>;
|
|
@@ -356,6 +882,23 @@ export declare function assertReceizSportsCardManifest(value: unknown): ReceizSp
|
|
|
356
882
|
export declare function isReceizSportsCardManifest(value: unknown): value is ReceizSportsCardManifest;
|
|
357
883
|
export declare function assertReceizWebhookEvent(value: unknown): ReceizWebhookEvent;
|
|
358
884
|
export declare function isReceizWebhookEvent(value: unknown): value is ReceizWebhookEvent;
|
|
885
|
+
export declare function projectReceizAssetManifest(value: unknown): ReceizAssetManifestProjection;
|
|
886
|
+
export declare function projectReceizSportsCardManifest(value: unknown): ReceizSportsCardManifestProjection;
|
|
887
|
+
export declare class ReceizProofRegister {
|
|
888
|
+
readonly ownerId: string | null;
|
|
889
|
+
readonly createdAt: string;
|
|
890
|
+
private readonly entriesById;
|
|
891
|
+
constructor(input?: ReceizProofRegisterInput);
|
|
892
|
+
append(entry: ReceizProofRegisterEntry): this;
|
|
893
|
+
admitAssetManifest(value: unknown): this;
|
|
894
|
+
admitSportsCardManifest(value: unknown): this;
|
|
895
|
+
admitWebhookEvent(value: unknown): this;
|
|
896
|
+
has(entryId: string): boolean;
|
|
897
|
+
entries(): ReceizProofRegisterEntry[];
|
|
898
|
+
snapshot(): ReceizProofRegisterSnapshot;
|
|
899
|
+
toJSON(): ReceizProofRegisterSnapshot;
|
|
900
|
+
}
|
|
901
|
+
export declare function createReceizProofRegister(input?: ReceizProofRegisterInput): ReceizProofRegister;
|
|
359
902
|
export declare function buildReceizWebhookSignaturePayload(input: {
|
|
360
903
|
timestamp: string;
|
|
361
904
|
body: string | ArrayBuffer | Uint8Array | JsonObject;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names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Q,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAA+C;gBAE/D,KAAK,GAAE,wBAA6B;IAMhD,MAAM,CAAC,KAAK,EAAE,wBAAwB,GAAG,IAAI;IAO7C,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAIxC,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAI7C,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI;IAIvC,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO;IAI7B,OAAO,IAAI,wBAAwB,EAAE;IAIrC,QAAQ,IAAI,2BAA2B;IAkBvC,MAAM,IAAI,2BAA2B;CAGtC;AAED,wBAAgB,yBAAyB,CAAC,KAAK,GAAE,wBAA6B,GAAG,mBAAmB,CAEnG;AASD,wBAAgB,kCAAkC,CAAC,KAAK,EAAE;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,CAAA;CAAE,GAAG,MAAM,CAE7I;AAuCD,wBAAsB,4BAA4B,CAAC,KAAK,EAAE,2BAA2B,GAAG,OAAO,CAAC,MAAM,CAAC,CAGtG;AAED,wBAAsB,4BAA4B,CAAC,KAAK,EAAE,wBAAwB,GAAG,OAAO,CAAC,OAAO,CAAC,CASpG"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,91 @@
|
|
|
1
|
-
export const RECEIZ_SDK_VERSION = "93.
|
|
1
|
+
export const RECEIZ_SDK_VERSION = "93.2.0";
|
|
2
2
|
export const RECEIZ_DEFAULT_BASE_URL = "https://receiz.com";
|
|
3
3
|
export const RECEIZ_WEBHOOK_SIGNATURE_HEADER = "x-receiz-signature";
|
|
4
4
|
export const RECEIZ_WEBHOOK_TIMESTAMP_HEADER = "x-receiz-timestamp";
|
|
5
|
+
export const RECEIZ_ASSET_MANIFEST_SCHEMA = {
|
|
6
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
7
|
+
$id: "https://receiz.com/standards/receiz.asset-manifest.schema.v1.json",
|
|
8
|
+
title: "Receiz Asset Manifest",
|
|
9
|
+
type: "object",
|
|
10
|
+
additionalProperties: true,
|
|
11
|
+
required: ["schema", "assetId", "assetType", "proof", "links"],
|
|
12
|
+
properties: {
|
|
13
|
+
schema: { const: "receiz.asset_manifest.v1" },
|
|
14
|
+
assetId: { type: "string", minLength: 1 },
|
|
15
|
+
assetType: {
|
|
16
|
+
enum: ["proof_object", "sports_card", "signal_card", "wallet_note", "market_certificate", "profile_original", "document"],
|
|
17
|
+
},
|
|
18
|
+
proof: {
|
|
19
|
+
type: "object",
|
|
20
|
+
required: ["kind"],
|
|
21
|
+
additionalProperties: true,
|
|
22
|
+
properties: {
|
|
23
|
+
kind: { type: "string", minLength: 1 },
|
|
24
|
+
verifyUrl: { type: "string" },
|
|
25
|
+
kaiPulseEternal: { type: ["number", "string"] },
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
owner: { type: ["object", "null"], additionalProperties: true },
|
|
29
|
+
media: { type: ["object", "null"], additionalProperties: true },
|
|
30
|
+
appends: { type: "array", items: { type: "object", additionalProperties: true } },
|
|
31
|
+
settlement: { type: ["object", "null"], additionalProperties: true },
|
|
32
|
+
links: { type: "object", additionalProperties: { type: "string" } },
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
export const RECEIZ_SPORTS_CARD_MANIFEST_SCHEMA = {
|
|
36
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
37
|
+
$id: "https://receiz.com/standards/receiz.sports-card-manifest.schema.v1.json",
|
|
38
|
+
title: "Receiz Sports Arena Card Manifest",
|
|
39
|
+
type: "object",
|
|
40
|
+
additionalProperties: true,
|
|
41
|
+
required: ["schema", "sport", "collectibleId", "claimHash", "card", "ownership", "valueBasis", "links"],
|
|
42
|
+
properties: {
|
|
43
|
+
schema: { const: "receiz.sports_arena.card_manifest.v1" },
|
|
44
|
+
sport: { type: "string", minLength: 1 },
|
|
45
|
+
collectibleId: { type: "string", minLength: 1 },
|
|
46
|
+
claimHash: { type: "string", minLength: 1 },
|
|
47
|
+
card: { type: "object", additionalProperties: true },
|
|
48
|
+
ownership: { type: "object", additionalProperties: true },
|
|
49
|
+
valueBasis: { type: "object", additionalProperties: true },
|
|
50
|
+
appendSummary: { type: ["object", "null"], additionalProperties: true },
|
|
51
|
+
eventProofSummary: { type: ["object", "null"], additionalProperties: true },
|
|
52
|
+
links: { type: "object", additionalProperties: { type: "string" } },
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
export const RECEIZ_WEBHOOK_EVENT_SCHEMA = {
|
|
56
|
+
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
57
|
+
$id: "https://receiz.com/standards/receiz.webhook-event.schema.v1.json",
|
|
58
|
+
title: "Receiz Webhook Event",
|
|
59
|
+
type: "object",
|
|
60
|
+
additionalProperties: true,
|
|
61
|
+
required: ["schema", "id", "type", "createdAt", "data"],
|
|
62
|
+
properties: {
|
|
63
|
+
schema: { const: "receiz.webhook_event.v1" },
|
|
64
|
+
id: { type: "string", minLength: 1 },
|
|
65
|
+
type: {
|
|
66
|
+
enum: [
|
|
67
|
+
"asset.created",
|
|
68
|
+
"asset.transferred",
|
|
69
|
+
"proof.appended",
|
|
70
|
+
"sports_card.scored",
|
|
71
|
+
"event_proof.created",
|
|
72
|
+
"wallet.ledger_entry",
|
|
73
|
+
"note.claimed",
|
|
74
|
+
"market.trade",
|
|
75
|
+
"profile.asset.visible_changed",
|
|
76
|
+
],
|
|
77
|
+
},
|
|
78
|
+
createdAt: { type: "string", minLength: 1 },
|
|
79
|
+
data: { type: "object", additionalProperties: true },
|
|
80
|
+
actor: { type: ["object", "null"], additionalProperties: true },
|
|
81
|
+
signature: { type: ["object", "null"], additionalProperties: true },
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
export const RECEIZ_SCHEMAS = {
|
|
85
|
+
assetManifest: RECEIZ_ASSET_MANIFEST_SCHEMA,
|
|
86
|
+
sportsCardManifest: RECEIZ_SPORTS_CARD_MANIFEST_SCHEMA,
|
|
87
|
+
webhookEvent: RECEIZ_WEBHOOK_EVENT_SCHEMA,
|
|
88
|
+
};
|
|
5
89
|
export class ReceizHttpError extends Error {
|
|
6
90
|
status;
|
|
7
91
|
payload;
|
|
@@ -227,6 +311,16 @@ export class ReceizClient {
|
|
|
227
311
|
isAsset: isReceizAssetManifest,
|
|
228
312
|
isSportsCard: isReceizSportsCardManifest,
|
|
229
313
|
isWebhookEvent: isReceizWebhookEvent,
|
|
314
|
+
projectAsset: projectReceizAssetManifest,
|
|
315
|
+
projectSportsCard: projectReceizSportsCardManifest,
|
|
316
|
+
};
|
|
317
|
+
schemas = RECEIZ_SCHEMAS;
|
|
318
|
+
projections = {
|
|
319
|
+
assetManifest: projectReceizAssetManifest,
|
|
320
|
+
sportsCardManifest: projectReceizSportsCardManifest,
|
|
321
|
+
};
|
|
322
|
+
proofMemory = {
|
|
323
|
+
createRegister: createReceizProofRegister,
|
|
230
324
|
};
|
|
231
325
|
constructor(options = {}) {
|
|
232
326
|
this.baseUrl = trimTrailingSlash(options.baseUrl ?? RECEIZ_DEFAULT_BASE_URL);
|
|
@@ -417,6 +511,350 @@ export function isReceizWebhookEvent(value) {
|
|
|
417
511
|
return false;
|
|
418
512
|
}
|
|
419
513
|
}
|
|
514
|
+
function stringField(record, key) {
|
|
515
|
+
if (!record)
|
|
516
|
+
return null;
|
|
517
|
+
const value = record[key];
|
|
518
|
+
return typeof value === "string" && value.trim() ? value.trim() : null;
|
|
519
|
+
}
|
|
520
|
+
function numberField(record, key) {
|
|
521
|
+
if (!record)
|
|
522
|
+
return null;
|
|
523
|
+
const value = record[key];
|
|
524
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
525
|
+
return value;
|
|
526
|
+
if (typeof value === "string" && value.trim() && Number.isFinite(Number(value)))
|
|
527
|
+
return Number(value);
|
|
528
|
+
return null;
|
|
529
|
+
}
|
|
530
|
+
function firstString(...values) {
|
|
531
|
+
for (const value of values) {
|
|
532
|
+
if (typeof value === "string" && value.trim())
|
|
533
|
+
return value.trim();
|
|
534
|
+
}
|
|
535
|
+
return null;
|
|
536
|
+
}
|
|
537
|
+
function objectField(record, key) {
|
|
538
|
+
if (!record)
|
|
539
|
+
return null;
|
|
540
|
+
const value = record[key];
|
|
541
|
+
return isRecord(value) ? value : null;
|
|
542
|
+
}
|
|
543
|
+
function optionalCount(value) {
|
|
544
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
545
|
+
return value;
|
|
546
|
+
if (typeof value === "string" && Number.isFinite(Number(value)))
|
|
547
|
+
return Number(value);
|
|
548
|
+
return 0;
|
|
549
|
+
}
|
|
550
|
+
function formatUsdCents(value) {
|
|
551
|
+
if (typeof value !== "string" && typeof value !== "number")
|
|
552
|
+
return null;
|
|
553
|
+
const numeric = Number(value);
|
|
554
|
+
if (!Number.isFinite(numeric))
|
|
555
|
+
return null;
|
|
556
|
+
return `$${(numeric / 100).toFixed(2)}`;
|
|
557
|
+
}
|
|
558
|
+
function proofCreatedAt(proof) {
|
|
559
|
+
return firstString(stringField(proof, "ts"), stringField(proof, "createdAt"));
|
|
560
|
+
}
|
|
561
|
+
function proofKaiUpulse(proof) {
|
|
562
|
+
return firstString(stringField(proof, "kaiUpulse"), stringField(proof, "kaiPulse"), stringField(proof, "kaiPulseEternal")) ?? numberField(proof, "kaiPulseEternal");
|
|
563
|
+
}
|
|
564
|
+
function addProjectionRow(rows, label, value, href) {
|
|
565
|
+
if (value === null || value === undefined || value === "")
|
|
566
|
+
return;
|
|
567
|
+
rows.push({ label, value: String(value), href: href ?? null });
|
|
568
|
+
}
|
|
569
|
+
export function projectReceizAssetManifest(value) {
|
|
570
|
+
const manifest = assertReceizAssetManifest(value);
|
|
571
|
+
const owner = manifest.owner ?? null;
|
|
572
|
+
const media = manifest.media ?? null;
|
|
573
|
+
const settlement = manifest.settlement ?? null;
|
|
574
|
+
const verifyUrl = firstString(manifest.links.verify, manifest.proof.verifyUrl, manifest.proof.verifyPath);
|
|
575
|
+
const primaryUrl = firstString(manifest.links.open, manifest.links.public, manifest.links.verify, verifyUrl);
|
|
576
|
+
const mediaUrl = firstString(stringField(media, "url"), stringField(media, "src"), stringField(media, "imageUrl"));
|
|
577
|
+
const ownerLabel = firstString(stringField(owner, "displayName"), stringField(owner, "ownerLabel"), stringField(owner, "username"), stringField(owner, "receizSubject"));
|
|
578
|
+
const title = firstString(stringField(media, "title"), stringField(media, "name"), manifest.assetId) ?? manifest.assetId;
|
|
579
|
+
const proofKind = manifest.proof.kind;
|
|
580
|
+
const settlementState = firstString(stringField(settlement, "state"), stringField(settlement, "status"));
|
|
581
|
+
const rows = [];
|
|
582
|
+
addProjectionRow(rows, "Asset ID", manifest.assetId);
|
|
583
|
+
addProjectionRow(rows, "Asset Type", manifest.assetType);
|
|
584
|
+
addProjectionRow(rows, "Proof Kind", proofKind);
|
|
585
|
+
addProjectionRow(rows, "Verify", verifyUrl, verifyUrl);
|
|
586
|
+
addProjectionRow(rows, "Kai Pulse", proofKaiUpulse(manifest.proof));
|
|
587
|
+
addProjectionRow(rows, "Appends", manifest.appends?.length ?? 0);
|
|
588
|
+
addProjectionRow(rows, "Settlement", settlementState);
|
|
589
|
+
addProjectionRow(rows, "Owner", ownerLabel);
|
|
590
|
+
return {
|
|
591
|
+
schema: "receiz.sdk.asset_manifest_projection.v1",
|
|
592
|
+
assetId: manifest.assetId,
|
|
593
|
+
assetType: manifest.assetType,
|
|
594
|
+
title,
|
|
595
|
+
subtitle: ownerLabel ? `${manifest.assetType} / ${ownerLabel}` : manifest.assetType,
|
|
596
|
+
proofKind,
|
|
597
|
+
verifyUrl,
|
|
598
|
+
primaryUrl,
|
|
599
|
+
mediaUrl,
|
|
600
|
+
ownerLabel,
|
|
601
|
+
appendCount: manifest.appends?.length ?? 0,
|
|
602
|
+
settlementState,
|
|
603
|
+
rows,
|
|
604
|
+
manifest,
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
export function projectReceizSportsCardManifest(value) {
|
|
608
|
+
const manifest = assertReceizSportsCardManifest(value);
|
|
609
|
+
const card = manifest.card;
|
|
610
|
+
const ownership = manifest.ownership;
|
|
611
|
+
const valueBasis = manifest.valueBasis;
|
|
612
|
+
const appendSummary = manifest.appendSummary ?? null;
|
|
613
|
+
const eventProofSummary = manifest.eventProofSummary ?? null;
|
|
614
|
+
const title = firstString(stringField(card, "playerName"), stringField(card, "athleteName"), stringField(card, "name"), manifest.collectibleId) ?? manifest.collectibleId;
|
|
615
|
+
const rarity = firstString(stringField(card, "rarity"), stringField(card, "tier"), stringField(card, "edition"));
|
|
616
|
+
const team = firstString(stringField(card, "team"), stringField(card, "club"));
|
|
617
|
+
const verifyUrl = firstString(manifest.links.verify, manifest.links.proof, manifest.links.asset);
|
|
618
|
+
const eventProofUrl = firstString(manifest.links.eventProof, stringField(eventProofSummary, "latestEventProofUrl"), stringField(eventProofSummary, "latestProofUrl"));
|
|
619
|
+
const mediaUrl = firstString(stringField(card, "deterministicImageUrl"), stringField(card, "imageUrl"), stringField(card, "mediaUrl"));
|
|
620
|
+
const ownerLabel = firstString(stringField(ownership, "ownerLabel"), stringField(ownership, "displayName"), stringField(ownership, "ownerSubject"));
|
|
621
|
+
const scoreLabel = firstString(stringField(valueBasis, "score"), stringField(valueBasis, "valueScore"));
|
|
622
|
+
const valueLabel = firstString(stringField(valueBasis, "valueLabel"), stringField(valueBasis, "reserveLabel"), formatUsdCents(valueBasis.reserveUsdCents));
|
|
623
|
+
const appendCount = optionalCount(appendSummary?.count);
|
|
624
|
+
const eventProofCount = optionalCount(eventProofSummary?.count);
|
|
625
|
+
const rows = [];
|
|
626
|
+
addProjectionRow(rows, "Collectible ID", manifest.collectibleId);
|
|
627
|
+
addProjectionRow(rows, "Claim Hash", manifest.claimHash);
|
|
628
|
+
addProjectionRow(rows, "Sport", manifest.sport);
|
|
629
|
+
addProjectionRow(rows, "Owner", ownerLabel);
|
|
630
|
+
addProjectionRow(rows, "Score", scoreLabel);
|
|
631
|
+
addProjectionRow(rows, "Reserve", valueLabel);
|
|
632
|
+
addProjectionRow(rows, "Kai Upulse", firstString(stringField(valueBasis, "kaiUpulse"), stringField(valueBasis, "kaiPulse")));
|
|
633
|
+
addProjectionRow(rows, "Appends", appendCount);
|
|
634
|
+
addProjectionRow(rows, "Event Proofs", eventProofCount);
|
|
635
|
+
addProjectionRow(rows, "Latest Event", stringField(eventProofSummary, "latestEventType"));
|
|
636
|
+
addProjectionRow(rows, "Proof", verifyUrl, verifyUrl);
|
|
637
|
+
return {
|
|
638
|
+
schema: "receiz.sdk.sports_card_manifest_projection.v1",
|
|
639
|
+
sport: manifest.sport,
|
|
640
|
+
collectibleId: manifest.collectibleId,
|
|
641
|
+
claimHash: manifest.claimHash,
|
|
642
|
+
title,
|
|
643
|
+
subtitle: [manifest.sport, team, rarity].filter(Boolean).join(" / "),
|
|
644
|
+
verifyUrl,
|
|
645
|
+
eventProofUrl,
|
|
646
|
+
mediaUrl,
|
|
647
|
+
ownerLabel,
|
|
648
|
+
scoreLabel,
|
|
649
|
+
valueLabel,
|
|
650
|
+
appendCount,
|
|
651
|
+
eventProofCount,
|
|
652
|
+
rows,
|
|
653
|
+
manifest,
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
function normalizeKaiForCompare(value) {
|
|
657
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
658
|
+
return String(value);
|
|
659
|
+
if (typeof value !== "string")
|
|
660
|
+
return null;
|
|
661
|
+
const trimmed = value.trim();
|
|
662
|
+
if (!trimmed)
|
|
663
|
+
return null;
|
|
664
|
+
return trimmed.replace(/^\+/, "");
|
|
665
|
+
}
|
|
666
|
+
function compareNumericTextDesc(leftValue, rightValue) {
|
|
667
|
+
const left = normalizeKaiForCompare(leftValue);
|
|
668
|
+
const right = normalizeKaiForCompare(rightValue);
|
|
669
|
+
if (!left && !right)
|
|
670
|
+
return 0;
|
|
671
|
+
if (!left)
|
|
672
|
+
return 1;
|
|
673
|
+
if (!right)
|
|
674
|
+
return -1;
|
|
675
|
+
const [leftWholeRaw = "", leftFractionRaw = ""] = left.split(".");
|
|
676
|
+
const [rightWholeRaw = "", rightFractionRaw = ""] = right.split(".");
|
|
677
|
+
const leftWhole = leftWholeRaw.replace(/^0+/, "") || "0";
|
|
678
|
+
const rightWhole = rightWholeRaw.replace(/^0+/, "") || "0";
|
|
679
|
+
if (leftWhole.length !== rightWhole.length)
|
|
680
|
+
return rightWhole.length - leftWhole.length;
|
|
681
|
+
if (leftWhole !== rightWhole)
|
|
682
|
+
return rightWhole.localeCompare(leftWhole);
|
|
683
|
+
const maxFractionLength = Math.max(leftFractionRaw.length, rightFractionRaw.length);
|
|
684
|
+
const leftFraction = leftFractionRaw.padEnd(maxFractionLength, "0");
|
|
685
|
+
const rightFraction = rightFractionRaw.padEnd(maxFractionLength, "0");
|
|
686
|
+
return rightFraction.localeCompare(leftFraction);
|
|
687
|
+
}
|
|
688
|
+
function compareRegisterEntries(left, right) {
|
|
689
|
+
const kai = compareNumericTextDesc(left.kaiUpulse, right.kaiUpulse);
|
|
690
|
+
if (kai !== 0)
|
|
691
|
+
return kai;
|
|
692
|
+
const leftTime = left.createdAt ? Date.parse(left.createdAt) : Number.NaN;
|
|
693
|
+
const rightTime = right.createdAt ? Date.parse(right.createdAt) : Number.NaN;
|
|
694
|
+
if (Number.isFinite(leftTime) && Number.isFinite(rightTime) && leftTime !== rightTime)
|
|
695
|
+
return rightTime - leftTime;
|
|
696
|
+
if (Number.isFinite(leftTime) && !Number.isFinite(rightTime))
|
|
697
|
+
return -1;
|
|
698
|
+
if (!Number.isFinite(leftTime) && Number.isFinite(rightTime))
|
|
699
|
+
return 1;
|
|
700
|
+
return left.id.localeCompare(right.id);
|
|
701
|
+
}
|
|
702
|
+
function mergeJsonPreservingExisting(existing, incoming) {
|
|
703
|
+
const merged = { ...existing };
|
|
704
|
+
for (const [key, value] of Object.entries(incoming)) {
|
|
705
|
+
if (merged[key] === undefined)
|
|
706
|
+
merged[key] = value;
|
|
707
|
+
}
|
|
708
|
+
return merged;
|
|
709
|
+
}
|
|
710
|
+
function mergeOptionalJsonPreservingExisting(existing, incoming) {
|
|
711
|
+
if (existing && incoming)
|
|
712
|
+
return mergeJsonPreservingExisting(existing, incoming);
|
|
713
|
+
return existing ?? incoming ?? null;
|
|
714
|
+
}
|
|
715
|
+
function normalizeRegisterEntry(value) {
|
|
716
|
+
const record = ensureRecord(value, "ReceizProofRegisterEntry");
|
|
717
|
+
const issues = [];
|
|
718
|
+
const id = ensureString(record, "id", issues);
|
|
719
|
+
const kind = ensureString(record, "kind", issues);
|
|
720
|
+
if (!isRecord(record.payload))
|
|
721
|
+
issues.push("payload must be an object");
|
|
722
|
+
const createdAt = record.createdAt === null || record.createdAt === undefined ? null : ensureString(record, "createdAt", issues);
|
|
723
|
+
const kaiUpulse = record.kaiUpulse;
|
|
724
|
+
if (kaiUpulse !== null && kaiUpulse !== undefined && typeof kaiUpulse !== "string" && typeof kaiUpulse !== "number") {
|
|
725
|
+
issues.push("kaiUpulse must be a string, number, or null");
|
|
726
|
+
}
|
|
727
|
+
const proof = record.proof;
|
|
728
|
+
if (proof !== null && proof !== undefined && !isRecord(proof))
|
|
729
|
+
issues.push("proof must be an object or null");
|
|
730
|
+
const projection = record.projection;
|
|
731
|
+
if (projection !== null && projection !== undefined && !isRecord(projection))
|
|
732
|
+
issues.push("projection must be an object or null");
|
|
733
|
+
failIfIssues("ReceizProofRegisterEntry", issues);
|
|
734
|
+
return {
|
|
735
|
+
id: id ?? "",
|
|
736
|
+
kind: kind ?? "",
|
|
737
|
+
createdAt,
|
|
738
|
+
kaiUpulse: kaiUpulse === undefined ? null : kaiUpulse,
|
|
739
|
+
proof: isRecord(proof) ? proof : null,
|
|
740
|
+
payload: record.payload,
|
|
741
|
+
projection: isRecord(projection) ? projection : null,
|
|
742
|
+
};
|
|
743
|
+
}
|
|
744
|
+
function mergeRegisterEntry(existing, incoming) {
|
|
745
|
+
return {
|
|
746
|
+
id: existing.id,
|
|
747
|
+
kind: existing.kind,
|
|
748
|
+
createdAt: existing.createdAt ?? incoming.createdAt ?? null,
|
|
749
|
+
kaiUpulse: existing.kaiUpulse ?? incoming.kaiUpulse ?? null,
|
|
750
|
+
proof: mergeOptionalJsonPreservingExisting(existing.proof, incoming.proof),
|
|
751
|
+
payload: mergeJsonPreservingExisting(existing.payload, incoming.payload),
|
|
752
|
+
projection: mergeOptionalJsonPreservingExisting(existing.projection, incoming.projection),
|
|
753
|
+
};
|
|
754
|
+
}
|
|
755
|
+
function registerEntryFromAssetManifest(manifest) {
|
|
756
|
+
const projection = projectReceizAssetManifest(manifest);
|
|
757
|
+
return {
|
|
758
|
+
id: `asset:${manifest.assetId}`,
|
|
759
|
+
kind: "asset_manifest",
|
|
760
|
+
createdAt: proofCreatedAt(manifest.proof),
|
|
761
|
+
kaiUpulse: proofKaiUpulse(manifest.proof),
|
|
762
|
+
proof: manifest.proof,
|
|
763
|
+
payload: manifest,
|
|
764
|
+
projection: projection,
|
|
765
|
+
};
|
|
766
|
+
}
|
|
767
|
+
function registerEntryFromSportsCardManifest(manifest) {
|
|
768
|
+
const projection = projectReceizSportsCardManifest(manifest);
|
|
769
|
+
return {
|
|
770
|
+
id: `sports-card:${manifest.collectibleId}:${manifest.claimHash}`,
|
|
771
|
+
kind: "sports_card_manifest",
|
|
772
|
+
createdAt: firstString(stringField(manifest.appendSummary ?? null, "latestObservedAt"), stringField(manifest.ownership, "updatedAt")),
|
|
773
|
+
kaiUpulse: firstString(stringField(manifest.valueBasis, "kaiUpulse"), stringField(manifest.valueBasis, "kaiPulse")),
|
|
774
|
+
proof: {
|
|
775
|
+
claimHash: manifest.claimHash,
|
|
776
|
+
latestAppendHash: stringField(manifest.appendSummary ?? null, "latestAppendHash"),
|
|
777
|
+
latestProofHash: stringField(manifest.eventProofSummary ?? null, "latestProofHash"),
|
|
778
|
+
},
|
|
779
|
+
payload: manifest,
|
|
780
|
+
projection: projection,
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
function registerEntryFromWebhookEvent(event) {
|
|
784
|
+
const proofBundle = objectField(event.data, "proofBundle");
|
|
785
|
+
const assetId = stringField(event.data, "assetId");
|
|
786
|
+
const appendId = stringField(event.data, "appendId");
|
|
787
|
+
return {
|
|
788
|
+
id: `webhook:${event.id}`,
|
|
789
|
+
kind: event.type,
|
|
790
|
+
createdAt: event.createdAt,
|
|
791
|
+
kaiUpulse: proofKaiUpulse(proofBundle),
|
|
792
|
+
proof: proofBundle,
|
|
793
|
+
payload: event,
|
|
794
|
+
projection: {
|
|
795
|
+
eventId: event.id,
|
|
796
|
+
type: event.type,
|
|
797
|
+
assetId,
|
|
798
|
+
appendId,
|
|
799
|
+
verifyUrl: stringField(proofBundle, "verifyUrl"),
|
|
800
|
+
},
|
|
801
|
+
};
|
|
802
|
+
}
|
|
803
|
+
export class ReceizProofRegister {
|
|
804
|
+
ownerId;
|
|
805
|
+
createdAt;
|
|
806
|
+
entriesById = new Map();
|
|
807
|
+
constructor(input = {}) {
|
|
808
|
+
this.ownerId = input.ownerId ?? null;
|
|
809
|
+
this.createdAt = input.createdAt ?? new Date().toISOString();
|
|
810
|
+
for (const entry of input.entries ?? [])
|
|
811
|
+
this.append(entry);
|
|
812
|
+
}
|
|
813
|
+
append(entry) {
|
|
814
|
+
const normalized = normalizeRegisterEntry(entry);
|
|
815
|
+
const existing = this.entriesById.get(normalized.id);
|
|
816
|
+
this.entriesById.set(normalized.id, existing ? mergeRegisterEntry(existing, normalized) : normalized);
|
|
817
|
+
return this;
|
|
818
|
+
}
|
|
819
|
+
admitAssetManifest(value) {
|
|
820
|
+
return this.append(registerEntryFromAssetManifest(assertReceizAssetManifest(value)));
|
|
821
|
+
}
|
|
822
|
+
admitSportsCardManifest(value) {
|
|
823
|
+
return this.append(registerEntryFromSportsCardManifest(assertReceizSportsCardManifest(value)));
|
|
824
|
+
}
|
|
825
|
+
admitWebhookEvent(value) {
|
|
826
|
+
return this.append(registerEntryFromWebhookEvent(assertReceizWebhookEvent(value)));
|
|
827
|
+
}
|
|
828
|
+
has(entryId) {
|
|
829
|
+
return this.entriesById.has(entryId);
|
|
830
|
+
}
|
|
831
|
+
entries() {
|
|
832
|
+
return [...this.entriesById.values()].sort(compareRegisterEntries);
|
|
833
|
+
}
|
|
834
|
+
snapshot() {
|
|
835
|
+
const entries = this.entries();
|
|
836
|
+
const head = entries[0] ?? null;
|
|
837
|
+
return {
|
|
838
|
+
schema: "receiz.sdk.proof_register.v1",
|
|
839
|
+
ownerId: this.ownerId,
|
|
840
|
+
createdAt: this.createdAt,
|
|
841
|
+
updatedAt: new Date().toISOString(),
|
|
842
|
+
head: {
|
|
843
|
+
entryId: head?.id ?? null,
|
|
844
|
+
kaiUpulse: head?.kaiUpulse ?? null,
|
|
845
|
+
createdAt: head?.createdAt ?? null,
|
|
846
|
+
count: entries.length,
|
|
847
|
+
},
|
|
848
|
+
entries,
|
|
849
|
+
};
|
|
850
|
+
}
|
|
851
|
+
toJSON() {
|
|
852
|
+
return this.snapshot();
|
|
853
|
+
}
|
|
854
|
+
}
|
|
855
|
+
export function createReceizProofRegister(input = {}) {
|
|
856
|
+
return new ReceizProofRegister(input);
|
|
857
|
+
}
|
|
420
858
|
function bodyToString(body) {
|
|
421
859
|
if (typeof body === "string")
|
|
422
860
|
return body;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Proof Memory And Projections
|
|
2
|
+
|
|
3
|
+
The Receiz SDK gives developer apps the same default shape Receiz uses internally:
|
|
4
|
+
|
|
5
|
+
```txt
|
|
6
|
+
verify proof object -> project immediately -> admit into durable proof memory -> append verified additions
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The SDK is convenience. It is not authority. The authority remains the sealed artifact, proof bundle, verified append, ownership append, and settlement ledger record.
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm install @receiz/sdk
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Project A Proof Object
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
import { projectReceizAssetManifest } from "@receiz/sdk";
|
|
21
|
+
|
|
22
|
+
const projection = projectReceizAssetManifest(manifest);
|
|
23
|
+
|
|
24
|
+
render({
|
|
25
|
+
title: projection.title,
|
|
26
|
+
subtitle: projection.subtitle,
|
|
27
|
+
mediaUrl: projection.mediaUrl,
|
|
28
|
+
verifyUrl: projection.verifyUrl,
|
|
29
|
+
rows: projection.rows,
|
|
30
|
+
});
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Projection is deterministic display preparation. It does not verify the artifact by itself. Verify first when the manifest comes from an untrusted transport.
|
|
34
|
+
|
|
35
|
+
## Project A Sports Card
|
|
36
|
+
|
|
37
|
+
```ts
|
|
38
|
+
import { projectReceizSportsCardManifest } from "@receiz/sdk";
|
|
39
|
+
|
|
40
|
+
const projection = projectReceizSportsCardManifest(cardManifest);
|
|
41
|
+
|
|
42
|
+
renderSportsCard({
|
|
43
|
+
player: projection.title,
|
|
44
|
+
value: projection.valueLabel,
|
|
45
|
+
score: projection.scoreLabel,
|
|
46
|
+
proofRows: projection.rows,
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
The projection keeps card identity, claim hash, ownership, value basis, append summary, and event proof summary together. Do not split those into unrelated app models.
|
|
51
|
+
|
|
52
|
+
## Admit Once, Append Forever
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
import { createReceizProofRegister } from "@receiz/sdk";
|
|
56
|
+
|
|
57
|
+
const memory = createReceizProofRegister({ ownerId: currentUserId });
|
|
58
|
+
|
|
59
|
+
memory.admitAssetManifest(assetManifest);
|
|
60
|
+
memory.admitSportsCardManifest(cardManifest);
|
|
61
|
+
memory.admitWebhookEvent(webhookEvent);
|
|
62
|
+
|
|
63
|
+
const snapshot = memory.snapshot();
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Persist `snapshot` in your app storage. On next open, reconstruct memory from `snapshot.entries` and render it immediately:
|
|
67
|
+
|
|
68
|
+
```ts
|
|
69
|
+
const memory = createReceizProofRegister(savedSnapshot);
|
|
70
|
+
const knownTruth = memory.entries();
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Then ask Receiz for verified additions after your known head. Do not ask whether known proof is still true.
|
|
74
|
+
|
|
75
|
+
## Duplicate Transport Is Safe
|
|
76
|
+
|
|
77
|
+
If the same proof object arrives again through another transport, the register keeps the first admitted payload and only fills missing fields. This prevents a weaker partial response from dropping known truth.
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
memory.admitAssetManifest(fullManifest);
|
|
81
|
+
memory.admitAssetManifest(partialManifest);
|
|
82
|
+
|
|
83
|
+
const retained = memory.snapshot().entries[0];
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
This is intentional. Receiz proof memory is not `newest response wins`.
|
|
87
|
+
|
|
88
|
+
## Runtime Schema Exports
|
|
89
|
+
|
|
90
|
+
```ts
|
|
91
|
+
import { RECEIZ_SCHEMAS } from "@receiz/sdk";
|
|
92
|
+
|
|
93
|
+
const assetManifestSchema = RECEIZ_SCHEMAS.assetManifest;
|
|
94
|
+
const sportsCardSchema = RECEIZ_SCHEMAS.sportsCardManifest;
|
|
95
|
+
const webhookEventSchema = RECEIZ_SCHEMAS.webhookEvent;
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
The schemas are packaged for docs, validation UIs, generated forms, test fixtures, and developer tooling. Runtime validators remain available as:
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
import {
|
|
102
|
+
assertReceizAssetManifest,
|
|
103
|
+
assertReceizSportsCardManifest,
|
|
104
|
+
assertReceizWebhookEvent,
|
|
105
|
+
} from "@receiz/sdk";
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Production Rule
|
|
109
|
+
|
|
110
|
+
Use this order in every integration:
|
|
111
|
+
|
|
112
|
+
1. Verify stronger proof truth when bytes come from an untrusted transport.
|
|
113
|
+
2. Validate the manifest or event shape.
|
|
114
|
+
3. Project display-ready rows from the verified object.
|
|
115
|
+
4. Admit the object into proof memory.
|
|
116
|
+
5. Persist the proof memory snapshot.
|
|
117
|
+
6. Append later verified additions without rediscovering known truth.
|
|
118
|
+
|
|
119
|
+
This gives users truthful first paint and gives developers a simple integration that stays aligned with Receiz primitives.
|
package/package.json
CHANGED