@unicitylabs/sphere-sdk 0.1.7 → 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 +69 -7
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +39 -3
- package/dist/core/index.d.ts +39 -3
- package/dist/core/index.js +69 -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 +69 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +109 -11
- package/dist/index.d.ts +109 -11
- package/dist/index.js +69 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1682,15 +1682,17 @@ var NostrTransportProvider = class {
|
|
|
1682
1682
|
const bindingEvent = events[0];
|
|
1683
1683
|
try {
|
|
1684
1684
|
const content = JSON.parse(bindingEvent.content);
|
|
1685
|
+
const { ProxyAddress } = await import("@unicitylabs/state-transition-sdk/lib/address/ProxyAddress");
|
|
1686
|
+
const proxyAddr = await ProxyAddress.fromNameTag(nametag);
|
|
1687
|
+
const proxyAddress = proxyAddr.toString();
|
|
1685
1688
|
if (content.public_key && content.l1_address) {
|
|
1686
|
-
const l3Address = `PROXY:${hashedNametag}`;
|
|
1687
1689
|
return {
|
|
1688
1690
|
nametag,
|
|
1689
1691
|
transportPubkey: bindingEvent.pubkey,
|
|
1690
1692
|
chainPubkey: content.public_key,
|
|
1691
1693
|
l1Address: content.l1_address,
|
|
1692
1694
|
directAddress: content.direct_address || "",
|
|
1693
|
-
proxyAddress
|
|
1695
|
+
proxyAddress,
|
|
1694
1696
|
timestamp: bindingEvent.created_at * 1e3
|
|
1695
1697
|
};
|
|
1696
1698
|
}
|
|
@@ -1698,14 +1700,13 @@ var NostrTransportProvider = class {
|
|
|
1698
1700
|
const pubkeyTag = bindingEvent.tags.find((t) => t[0] === "pubkey");
|
|
1699
1701
|
const l1Tag = bindingEvent.tags.find((t) => t[0] === "l1");
|
|
1700
1702
|
if (pubkeyTag?.[1] && l1Tag?.[1]) {
|
|
1701
|
-
const l3Address = `PROXY:${hashedNametag}`;
|
|
1702
1703
|
return {
|
|
1703
1704
|
nametag,
|
|
1704
1705
|
transportPubkey: bindingEvent.pubkey,
|
|
1705
1706
|
chainPubkey: pubkeyTag[1],
|
|
1706
1707
|
l1Address: l1Tag[1],
|
|
1707
1708
|
directAddress: "",
|
|
1708
|
-
proxyAddress
|
|
1709
|
+
proxyAddress,
|
|
1709
1710
|
timestamp: bindingEvent.created_at * 1e3
|
|
1710
1711
|
};
|
|
1711
1712
|
}
|
|
@@ -1717,17 +1718,19 @@ var NostrTransportProvider = class {
|
|
|
1717
1718
|
l1Address: "",
|
|
1718
1719
|
// Cannot derive without 33-byte pubkey
|
|
1719
1720
|
directAddress: "",
|
|
1720
|
-
proxyAddress
|
|
1721
|
+
proxyAddress,
|
|
1721
1722
|
timestamp: bindingEvent.created_at * 1e3
|
|
1722
1723
|
};
|
|
1723
1724
|
} catch {
|
|
1725
|
+
const { ProxyAddress } = await import("@unicitylabs/state-transition-sdk/lib/address/ProxyAddress");
|
|
1726
|
+
const proxyAddr = await ProxyAddress.fromNameTag(nametag);
|
|
1724
1727
|
return {
|
|
1725
1728
|
nametag,
|
|
1726
1729
|
transportPubkey: bindingEvent.pubkey,
|
|
1727
1730
|
chainPubkey: "",
|
|
1728
1731
|
l1Address: "",
|
|
1729
1732
|
directAddress: "",
|
|
1730
|
-
proxyAddress:
|
|
1733
|
+
proxyAddress: proxyAddr.toString(),
|
|
1731
1734
|
timestamp: bindingEvent.created_at * 1e3
|
|
1732
1735
|
};
|
|
1733
1736
|
}
|