@unicitylabs/sphere-sdk 0.7.2 → 0.8.0-dev.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/core/index.cjs +1127 -767
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +3383 -3147
- package/dist/core/index.d.ts +3383 -3147
- package/dist/core/index.js +1115 -755
- package/dist/core/index.js.map +1 -1
- package/dist/impl/browser/index.cjs +17 -19
- package/dist/impl/browser/index.cjs.map +1 -1
- package/dist/impl/browser/index.js +17 -19
- package/dist/impl/browser/index.js.map +1 -1
- package/dist/impl/nodejs/index.cjs +17 -19
- package/dist/impl/nodejs/index.cjs.map +1 -1
- package/dist/impl/nodejs/index.d.cts +10 -5
- package/dist/impl/nodejs/index.d.ts +10 -5
- package/dist/impl/nodejs/index.js +17 -19
- package/dist/impl/nodejs/index.js.map +1 -1
- package/dist/index.cjs +1181 -1041
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3906 -3728
- package/dist/index.d.ts +3906 -3728
- package/dist/index.js +1159 -1019
- package/dist/index.js.map +1 -1
- package/package.json +4 -3
|
@@ -25312,26 +25312,14 @@ var NostrTransportProvider = class _NostrTransportProvider {
|
|
|
25312
25312
|
}
|
|
25313
25313
|
/**
|
|
25314
25314
|
* Convert a BindingInfo (from nostr-js-sdk) to PeerInfo (sphere-sdk type).
|
|
25315
|
-
* Computes PROXY address from nametag if available.
|
|
25316
25315
|
*/
|
|
25317
25316
|
async bindingInfoToPeerInfo(binding, nametag) {
|
|
25318
|
-
const nametagValue = nametag || binding.nametag;
|
|
25319
|
-
let proxyAddress = binding.proxyAddress;
|
|
25320
|
-
if (nametagValue && !proxyAddress) {
|
|
25321
|
-
try {
|
|
25322
|
-
const { ProxyAddress } = await import("@unicitylabs/state-transition-sdk/lib/address/ProxyAddress");
|
|
25323
|
-
const proxyAddr = await ProxyAddress.fromNameTag(nametagValue);
|
|
25324
|
-
proxyAddress = proxyAddr.toString();
|
|
25325
|
-
} catch {
|
|
25326
|
-
}
|
|
25327
|
-
}
|
|
25328
25317
|
return {
|
|
25329
|
-
nametag:
|
|
25318
|
+
nametag: nametag || binding.nametag,
|
|
25330
25319
|
transportPubkey: binding.transportPubkey,
|
|
25331
25320
|
chainPubkey: binding.publicKey || "",
|
|
25332
25321
|
l1Address: binding.l1Address || "",
|
|
25333
25322
|
directAddress: binding.directAddress || "",
|
|
25334
|
-
proxyAddress,
|
|
25335
25323
|
timestamp: binding.timestamp
|
|
25336
25324
|
};
|
|
25337
25325
|
}
|
|
@@ -25357,7 +25345,6 @@ var NostrTransportProvider = class _NostrTransportProvider {
|
|
|
25357
25345
|
chainPubkey: content.public_key || "",
|
|
25358
25346
|
l1Address: content.l1_address || "",
|
|
25359
25347
|
directAddress: content.direct_address || "",
|
|
25360
|
-
proxyAddress: content.proxy_address || void 0,
|
|
25361
25348
|
timestamp: bindingEvent.created_at * 1e3
|
|
25362
25349
|
};
|
|
25363
25350
|
} catch {
|
|
@@ -25400,7 +25387,6 @@ var NostrTransportProvider = class _NostrTransportProvider {
|
|
|
25400
25387
|
chainPubkey: content.public_key || "",
|
|
25401
25388
|
l1Address: content.l1_address || "",
|
|
25402
25389
|
directAddress: content.direct_address || "",
|
|
25403
|
-
proxyAddress: content.proxy_address || void 0,
|
|
25404
25390
|
timestamp: event.created_at * 1e3
|
|
25405
25391
|
});
|
|
25406
25392
|
} catch {
|
|
@@ -25470,8 +25456,6 @@ var NostrTransportProvider = class _NostrTransportProvider {
|
|
|
25470
25456
|
}
|
|
25471
25457
|
const nostrPubkey = this.getNostrPubkey();
|
|
25472
25458
|
if (nametag) {
|
|
25473
|
-
const { ProxyAddress } = await import("@unicitylabs/state-transition-sdk/lib/address/ProxyAddress");
|
|
25474
|
-
const proxyAddr = await ProxyAddress.fromNameTag(nametag);
|
|
25475
25459
|
try {
|
|
25476
25460
|
const success2 = await this.nostrClient.publishNametagBinding(
|
|
25477
25461
|
nametag,
|
|
@@ -25479,8 +25463,7 @@ var NostrTransportProvider = class _NostrTransportProvider {
|
|
|
25479
25463
|
{
|
|
25480
25464
|
publicKey: chainPubkey,
|
|
25481
25465
|
l1Address,
|
|
25482
|
-
directAddress
|
|
25483
|
-
proxyAddress: proxyAddr.toString()
|
|
25466
|
+
directAddress
|
|
25484
25467
|
}
|
|
25485
25468
|
);
|
|
25486
25469
|
if (success2) {
|
|
@@ -26448,10 +26431,24 @@ var UnicityAggregatorProvider = class {
|
|
|
26448
26431
|
aggregatorClient = null;
|
|
26449
26432
|
stateTransitionClient = null;
|
|
26450
26433
|
trustBase = null;
|
|
26434
|
+
/** Raw trust-base JSON as loaded (kept so the v2 token engine can re-parse it). */
|
|
26435
|
+
trustBaseJson = null;
|
|
26451
26436
|
/** Get the current trust base */
|
|
26452
26437
|
getTrustBase() {
|
|
26453
26438
|
return this.trustBase;
|
|
26454
26439
|
}
|
|
26440
|
+
/** Raw trust-base JSON (for constructing the v2 token engine); null if loaded as an object. */
|
|
26441
|
+
getTrustBaseJson() {
|
|
26442
|
+
return this.trustBaseJson;
|
|
26443
|
+
}
|
|
26444
|
+
/** The aggregator URL this provider is configured against. */
|
|
26445
|
+
getAggregatorUrl() {
|
|
26446
|
+
return this.config.url;
|
|
26447
|
+
}
|
|
26448
|
+
/** The gateway API key (for the v2 token engine); undefined when none is configured. */
|
|
26449
|
+
getApiKey() {
|
|
26450
|
+
return this.config.apiKey || void 0;
|
|
26451
|
+
}
|
|
26455
26452
|
/** Get the state transition client */
|
|
26456
26453
|
getStateTransitionClient() {
|
|
26457
26454
|
return this.stateTransitionClient;
|
|
@@ -26508,6 +26505,7 @@ var UnicityAggregatorProvider = class {
|
|
|
26508
26505
|
try {
|
|
26509
26506
|
const trustBaseJson = await this.config.trustBaseLoader.load();
|
|
26510
26507
|
if (trustBaseJson) {
|
|
26508
|
+
this.trustBaseJson = trustBaseJson;
|
|
26511
26509
|
this.trustBase = import_RootTrustBase.RootTrustBase.fromJSON(trustBaseJson);
|
|
26512
26510
|
}
|
|
26513
26511
|
} catch (error) {
|