@unicitylabs/sphere-sdk 0.1.8 → 0.1.9
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 +41 -7
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +25 -3
- package/dist/core/index.d.ts +25 -3
- package/dist/core/index.js +41 -7
- package/dist/core/index.js.map +1 -1
- package/dist/impl/browser/index.cjs +9 -6
- package/dist/impl/browser/index.cjs.map +1 -1
- package/dist/impl/browser/index.js +9 -6
- package/dist/impl/browser/index.js.map +1 -1
- package/dist/impl/nodejs/index.cjs +23 -6
- package/dist/impl/nodejs/index.cjs.map +1 -1
- package/dist/impl/nodejs/index.d.cts +1 -0
- package/dist/impl/nodejs/index.d.ts +1 -0
- package/dist/impl/nodejs/index.js +23 -6
- package/dist/impl/nodejs/index.js.map +1 -1
- package/dist/index.cjs +41 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +66 -10
- package/dist/index.d.ts +66 -10
- package/dist/index.js +41 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1633,15 +1633,17 @@ var NostrTransportProvider = class {
|
|
|
1633
1633
|
const bindingEvent = events[0];
|
|
1634
1634
|
try {
|
|
1635
1635
|
const content = JSON.parse(bindingEvent.content);
|
|
1636
|
+
const { ProxyAddress } = await import("@unicitylabs/state-transition-sdk/lib/address/ProxyAddress");
|
|
1637
|
+
const proxyAddr = await ProxyAddress.fromNameTag(nametag);
|
|
1638
|
+
const proxyAddress = proxyAddr.toString();
|
|
1636
1639
|
if (content.public_key && content.l1_address) {
|
|
1637
|
-
const l3Address = `PROXY:${hashedNametag}`;
|
|
1638
1640
|
return {
|
|
1639
1641
|
nametag,
|
|
1640
1642
|
transportPubkey: bindingEvent.pubkey,
|
|
1641
1643
|
chainPubkey: content.public_key,
|
|
1642
1644
|
l1Address: content.l1_address,
|
|
1643
1645
|
directAddress: content.direct_address || "",
|
|
1644
|
-
proxyAddress
|
|
1646
|
+
proxyAddress,
|
|
1645
1647
|
timestamp: bindingEvent.created_at * 1e3
|
|
1646
1648
|
};
|
|
1647
1649
|
}
|
|
@@ -1649,14 +1651,13 @@ var NostrTransportProvider = class {
|
|
|
1649
1651
|
const pubkeyTag = bindingEvent.tags.find((t) => t[0] === "pubkey");
|
|
1650
1652
|
const l1Tag = bindingEvent.tags.find((t) => t[0] === "l1");
|
|
1651
1653
|
if (pubkeyTag?.[1] && l1Tag?.[1]) {
|
|
1652
|
-
const l3Address = `PROXY:${hashedNametag}`;
|
|
1653
1654
|
return {
|
|
1654
1655
|
nametag,
|
|
1655
1656
|
transportPubkey: bindingEvent.pubkey,
|
|
1656
1657
|
chainPubkey: pubkeyTag[1],
|
|
1657
1658
|
l1Address: l1Tag[1],
|
|
1658
1659
|
directAddress: "",
|
|
1659
|
-
proxyAddress
|
|
1660
|
+
proxyAddress,
|
|
1660
1661
|
timestamp: bindingEvent.created_at * 1e3
|
|
1661
1662
|
};
|
|
1662
1663
|
}
|
|
@@ -1668,17 +1669,19 @@ var NostrTransportProvider = class {
|
|
|
1668
1669
|
l1Address: "",
|
|
1669
1670
|
// Cannot derive without 33-byte pubkey
|
|
1670
1671
|
directAddress: "",
|
|
1671
|
-
proxyAddress
|
|
1672
|
+
proxyAddress,
|
|
1672
1673
|
timestamp: bindingEvent.created_at * 1e3
|
|
1673
1674
|
};
|
|
1674
1675
|
} catch {
|
|
1676
|
+
const { ProxyAddress } = await import("@unicitylabs/state-transition-sdk/lib/address/ProxyAddress");
|
|
1677
|
+
const proxyAddr = await ProxyAddress.fromNameTag(nametag);
|
|
1675
1678
|
return {
|
|
1676
1679
|
nametag,
|
|
1677
1680
|
transportPubkey: bindingEvent.pubkey,
|
|
1678
1681
|
chainPubkey: "",
|
|
1679
1682
|
l1Address: "",
|
|
1680
1683
|
directAddress: "",
|
|
1681
|
-
proxyAddress:
|
|
1684
|
+
proxyAddress: proxyAddr.toString(),
|
|
1682
1685
|
timestamp: bindingEvent.created_at * 1e3
|
|
1683
1686
|
};
|
|
1684
1687
|
}
|