@toon-protocol/core 1.4.2 → 1.5.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/dist/index.d.ts +15 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -432,6 +432,21 @@ interface IlpPeerInfo {
|
|
|
432
432
|
ilpAddresses?: string[];
|
|
433
433
|
/** BTP WebSocket endpoint URL for packet exchange (pay-per-event writes) */
|
|
434
434
|
btpEndpoint: string;
|
|
435
|
+
/**
|
|
436
|
+
* ILP-over-HTTP endpoint URL (RFC-0035) for stateless, one-shot writes:
|
|
437
|
+
* `POST` an ILP PREPARE here and receive a FULFILL/REJECT body. Suited to
|
|
438
|
+
* pure consumers, browsers, and NAT'd agents that don't need a duplex BTP
|
|
439
|
+
* session. Absent when the node only exposes BTP. The same host typically
|
|
440
|
+
* also accepts an HTTP `Upgrade` to BTP — see {@link supportsUpgrade}.
|
|
441
|
+
*/
|
|
442
|
+
httpEndpoint?: string;
|
|
443
|
+
/**
|
|
444
|
+
* Whether `httpEndpoint`'s host accepts an HTTP `Upgrade` to a BTP/WebSocket
|
|
445
|
+
* session (`Sec-WebSocket-Protocol: btp`). Lets a client start on
|
|
446
|
+
* ILP-over-HTTP and upgrade to duplex BTP when it becomes a peer or needs
|
|
447
|
+
* server-initiated packets, carrying its HTTP-proven identity across.
|
|
448
|
+
*/
|
|
449
|
+
supportsUpgrade?: boolean;
|
|
435
450
|
/**
|
|
436
451
|
* Public Nostr relay WebSocket URL for FREE reads (e.g. `wss://<addr>.anyone/`
|
|
437
452
|
* or `ws://host:7100`). Lets a client discover where to subscribe/read without
|
package/dist/index.js
CHANGED
|
@@ -414,6 +414,8 @@ function parseIlpPeerInfo(event) {
|
|
|
414
414
|
const {
|
|
415
415
|
ilpAddress,
|
|
416
416
|
btpEndpoint,
|
|
417
|
+
httpEndpoint,
|
|
418
|
+
supportsUpgrade,
|
|
417
419
|
blsHttpEndpoint,
|
|
418
420
|
settlementEngine,
|
|
419
421
|
assetCode,
|
|
@@ -428,6 +430,12 @@ function parseIlpPeerInfo(event) {
|
|
|
428
430
|
if (btpEndpoint !== void 0 && typeof btpEndpoint !== "string") {
|
|
429
431
|
throw new InvalidEventError("Invalid field: btpEndpoint must be a string");
|
|
430
432
|
}
|
|
433
|
+
if (httpEndpoint !== void 0 && typeof httpEndpoint !== "string") {
|
|
434
|
+
throw new InvalidEventError("Invalid field: httpEndpoint must be a string");
|
|
435
|
+
}
|
|
436
|
+
if (supportsUpgrade !== void 0 && typeof supportsUpgrade !== "boolean") {
|
|
437
|
+
throw new InvalidEventError("Invalid field: supportsUpgrade must be a boolean");
|
|
438
|
+
}
|
|
431
439
|
if (typeof assetCode !== "string" || assetCode.length === 0) {
|
|
432
440
|
throw new InvalidEventError("Missing or invalid required field: assetCode");
|
|
433
441
|
}
|
|
@@ -561,6 +569,8 @@ function parseIlpPeerInfo(event) {
|
|
|
561
569
|
return {
|
|
562
570
|
ilpAddress,
|
|
563
571
|
btpEndpoint: typeof btpEndpoint === "string" ? btpEndpoint : "",
|
|
572
|
+
...httpEndpoint !== void 0 && typeof httpEndpoint === "string" && { httpEndpoint },
|
|
573
|
+
...supportsUpgrade !== void 0 && typeof supportsUpgrade === "boolean" && { supportsUpgrade },
|
|
564
574
|
...blsHttpEndpoint !== void 0 && typeof blsHttpEndpoint === "string" && { blsHttpEndpoint },
|
|
565
575
|
assetCode,
|
|
566
576
|
assetScale,
|