@smartledger/bsv 9.1.0 → 9.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/CHANGELOG.md +86 -0
- package/README.md +19 -19
- package/bsv-gdaf.min.js +44 -44
- package/bsv-ltp.min.js +28 -28
- package/bsv-smartcontract.min.js +1 -1
- package/bsv.bundle.js +44 -44
- package/bsv.d.ts +53 -3
- package/bsv.min.js +44 -44
- package/docs/MODULE_REFERENCE_COMPLETE.md +27 -27
- package/docs/advanced/UTXO_MANAGER_GUIDE.md +1 -1
- package/docs/getting-started/INSTALLATION.md +23 -23
- package/docs/getting-started/QUICK_START.md +7 -7
- package/docs/migration/FROM_BSV_1_5_6.md +5 -5
- package/index.js +5 -4
- package/index.mjs +1 -0
- package/jcs-entry.d.ts +12 -0
- package/jcs-entry.js +1 -0
- package/lib/block/merkleblock.js +34 -4
- package/lib/ltp/claim.js +105 -14
- package/lib/util/jcs.js +44 -14
- package/package.json +6 -1
- package/version.js +1 -1
package/bsv.d.ts
CHANGED
|
@@ -1421,12 +1421,62 @@ declare module '@smartledger/bsv' {
|
|
|
1421
1421
|
export function getClaimSchemaNames(): string[];
|
|
1422
1422
|
export function getClaimSchema(schemaName: string): object;
|
|
1423
1423
|
export function createClaimTemplate(schemaName: string): object;
|
|
1424
|
-
/**
|
|
1425
|
-
|
|
1426
|
-
|
|
1424
|
+
/**
|
|
1425
|
+
* Returns the canonical JSON STRING, not an object.
|
|
1426
|
+
*
|
|
1427
|
+
* Omitting `canonicalization` selects the legacy sorted-key form and emits a
|
|
1428
|
+
* deprecation notice; the default becomes `'jcs'` in 10.0.0. Pass one explicitly
|
|
1429
|
+
* to pin the behaviour across that change.
|
|
1430
|
+
*
|
|
1431
|
+
* For anything that is not an existing LTP claim, use `@smartledger/bsv/jcs`
|
|
1432
|
+
* directly — it is RFC 8785 and has no legacy mode.
|
|
1433
|
+
*/
|
|
1434
|
+
export function canonicalizeClaim(claim: object, canonicalization?: JcsCanonicalization): string;
|
|
1435
|
+
export function hashClaim(claim: object, canonicalization?: JcsCanonicalization): string;
|
|
1427
1436
|
export function addCustomClaimSchema(name: string, schema: object): void;
|
|
1428
1437
|
|
|
1438
|
+
/** Canonicalization forms understood by the LTP claim hashers. */
|
|
1439
|
+
export type JcsCanonicalization = 'jcs' | 'legacy';
|
|
1440
|
+
|
|
1441
|
+
/**
|
|
1442
|
+
* RFC 8785 JSON Canonicalization Scheme. Also available as the subpath export
|
|
1443
|
+
* `@smartledger/bsv/jcs`, which is the form to prefer in new code.
|
|
1444
|
+
*/
|
|
1445
|
+
export namespace JCS {
|
|
1446
|
+
/**
|
|
1447
|
+
* Serialize a value as RFC 8785 canonical JSON.
|
|
1448
|
+
*
|
|
1449
|
+
* Throws on non-finite numbers, bigint, circular structures, and values with
|
|
1450
|
+
* no JSON representation, rather than coercing them — a canonicalizer that
|
|
1451
|
+
* silently serializes a different document than the one supplied defeats its
|
|
1452
|
+
* own purpose.
|
|
1453
|
+
*/
|
|
1454
|
+
function stringify(value: any): string;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1429
1457
|
// Shamir convenience wrappers (also available on bsv.Shamir directly)
|
|
1430
1458
|
// Shamir secret sharing is exposed as `bsv.Shamir.split` / `.combine` / `.verifyShare`
|
|
1431
1459
|
// (see `crypto.Shamir` above) — there are no top-level splitSecret/reconstructSecret helpers.
|
|
1460
|
+
}
|
|
1461
|
+
|
|
1462
|
+
/**
|
|
1463
|
+
* RFC 8785 (JSON Canonicalization Scheme).
|
|
1464
|
+
*
|
|
1465
|
+
* Two independent implementations produce identical bytes for the same value, which
|
|
1466
|
+
* is the property that makes a hash or a signature meaningful to a party who did not
|
|
1467
|
+
* produce it. Prefer this over `bsv.canonicalizeClaim` in new code: that one carries
|
|
1468
|
+
* a legacy mode this does not.
|
|
1469
|
+
*/
|
|
1470
|
+
declare module '@smartledger/bsv/jcs' {
|
|
1471
|
+
/**
|
|
1472
|
+
* Serialize a value as RFC 8785 canonical JSON.
|
|
1473
|
+
*
|
|
1474
|
+
* Object keys sort by UTF-16 code unit, applied during serialization rather than
|
|
1475
|
+
* by rebuilding an object — rebuilding lets V8 reorder integer-like keys ahead of
|
|
1476
|
+
* the sort, producing `{"2":…,"10":…}` where the RFC requires `{"10":…,"2":…}`.
|
|
1477
|
+
*
|
|
1478
|
+
* Throws on non-finite numbers, bigint, circular structures, and values with no
|
|
1479
|
+
* JSON representation.
|
|
1480
|
+
*/
|
|
1481
|
+
export function stringify(value: any): string;
|
|
1432
1482
|
}
|