nostr-wot-sdk 0.9.0 → 1.0.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/README.md +23 -10
- package/dist/{solid → auth}/index.cjs +3 -3
- package/dist/auth/index.d.cts +1 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.js +3 -0
- package/dist/blossom/index.cjs +14 -0
- package/dist/blossom/index.cjs.map +1 -0
- package/dist/blossom/index.d.cts +1 -0
- package/dist/blossom/index.d.ts +1 -0
- package/dist/blossom/index.js +3 -0
- package/dist/blossom/index.js.map +1 -0
- package/dist/dm/index.cjs +14 -0
- package/dist/dm/index.cjs.map +1 -0
- package/dist/dm/index.d.cts +1 -0
- package/dist/dm/index.d.ts +1 -0
- package/dist/dm/index.js +3 -0
- package/dist/dm/index.js.map +1 -0
- package/dist/dm/react/index.cjs +14 -0
- package/dist/dm/react/index.cjs.map +1 -0
- package/dist/dm/react/index.d.cts +1 -0
- package/dist/dm/react/index.d.ts +1 -0
- package/dist/dm/react/index.js +3 -0
- package/dist/dm/react/index.js.map +1 -0
- package/dist/graph/index.cjs +14 -0
- package/dist/graph/index.cjs.map +1 -0
- package/dist/graph/index.d.cts +1 -0
- package/dist/graph/index.d.ts +1 -0
- package/dist/graph/index.js +3 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/react/index.cjs +14 -0
- package/dist/graph/react/index.cjs.map +1 -0
- package/dist/graph/react/index.d.cts +1 -0
- package/dist/graph/react/index.d.ts +1 -0
- package/dist/graph/react/index.js +3 -0
- package/dist/graph/react/index.js.map +1 -0
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.d.cts +1 -2
- package/dist/react/index.d.ts +1 -2
- package/dist/react/index.js.map +1 -1
- package/dist/signers/index.cjs +14 -0
- package/dist/signers/index.cjs.map +1 -0
- package/dist/signers/index.d.cts +1 -0
- package/dist/signers/index.d.ts +1 -0
- package/dist/signers/index.js +3 -0
- package/dist/signers/index.js.map +1 -0
- package/dist/ui/index.cjs +14 -0
- package/dist/ui/index.cjs.map +1 -0
- package/dist/ui/index.d.cts +1 -0
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.js +3 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/wallet/index.cjs +14 -0
- package/dist/wallet/index.cjs.map +1 -0
- package/dist/wallet/index.d.cts +1 -0
- package/dist/wallet/index.d.ts +1 -0
- package/dist/wallet/index.js +3 -0
- package/dist/wallet/index.js.map +1 -0
- package/dist/wallet/react/index.cjs +14 -0
- package/dist/wallet/react/index.cjs.map +1 -0
- package/dist/wallet/react/index.d.cts +1 -0
- package/dist/wallet/react/index.d.ts +1 -0
- package/dist/wallet/react/index.js +3 -0
- package/dist/wallet/react/index.js.map +1 -0
- package/package.json +112 -19
- package/dist/solid/index.d.cts +0 -1
- package/dist/solid/index.d.ts +0 -1
- package/dist/solid/index.js +0 -3
- /package/dist/{solid → auth}/index.cjs.map +0 -0
- /package/dist/{solid → auth}/index.js.map +0 -0
package/README.md
CHANGED
|
@@ -40,7 +40,7 @@ import { NostrSdkProvider } from "nostr-wot-sdk/react";
|
|
|
40
40
|
- `<NostrDataProvider>` from `@nostr-wot/data/react` — configures default relays, profile aggregators, and SWR cache persistence
|
|
41
41
|
- `<WoTProvider>` from `@nostr-wot/wot/react` (only when `wot.enabled: true`) — provides WoT scoring context
|
|
42
42
|
|
|
43
|
-
WoT hooks (`useWoT`, `
|
|
43
|
+
WoT hooks (`useWoT`, `useIsInWoT`, `useBatchWoT`) require `wot.enabled: true`. Data hooks (`useProfile`, `useNote`, `useThread`, …) work either way.
|
|
44
44
|
|
|
45
45
|
## Re-export map
|
|
46
46
|
|
|
@@ -48,22 +48,35 @@ WoT hooks (`useWoT`, `useTrustScore`, `useIsInWoT`, `useBatchWoT`) require `wot.
|
|
|
48
48
|
|---|---|
|
|
49
49
|
| `nostr-wot-sdk` | `@nostr-wot/wot` |
|
|
50
50
|
| `nostr-wot-sdk/react` | `@nostr-wot/wot/react` + `@nostr-wot/data/react` + `<NostrSdkProvider>` |
|
|
51
|
-
| `nostr-wot-sdk/solid` | `@nostr-wot/wot/solid` |
|
|
52
51
|
| `nostr-wot-sdk/relay` | `@nostr-wot/relay` |
|
|
53
52
|
| `nostr-wot-sdk/relay/react` | `@nostr-wot/relay/react` |
|
|
54
53
|
| `nostr-wot-sdk/data` | `@nostr-wot/data` |
|
|
55
54
|
| `nostr-wot-sdk/data/cache` | `@nostr-wot/data/cache` |
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
| `nostr-wot-sdk/signers` | `@nostr-wot/signers` |
|
|
56
|
+
| `nostr-wot-sdk/ui` | `@nostr-wot/ui` |
|
|
57
|
+
| `nostr-wot-sdk/dm` | `@nostr-wot/dm` |
|
|
58
|
+
| `nostr-wot-sdk/dm/react` | `@nostr-wot/dm/react` |
|
|
59
|
+
| `nostr-wot-sdk/wallet` | `@nostr-wot/wallet` |
|
|
60
|
+
| `nostr-wot-sdk/wallet/react` | `@nostr-wot/wallet/react` |
|
|
61
|
+
| `nostr-wot-sdk/auth` | `@nostr-wot/auth` |
|
|
62
|
+
| `nostr-wot-sdk/blossom` | `@nostr-wot/blossom` |
|
|
63
|
+
|
|
64
|
+
The whole family is surfaced through this meta, so you can either import via a
|
|
65
|
+
subpath or depend on the scoped package directly:
|
|
58
66
|
|
|
59
67
|
```ts
|
|
60
|
-
import { Nip07Signer } from "
|
|
61
|
-
import { sealAndGiftWrap } from "
|
|
62
|
-
import { useDMSession } from "
|
|
63
|
-
import { uploadToBlossom } from "
|
|
64
|
-
import { NwcClient, requestZapInvoice } from "
|
|
68
|
+
import { Nip07Signer } from "nostr-wot-sdk/signers";
|
|
69
|
+
import { sealAndGiftWrap } from "nostr-wot-sdk/dm";
|
|
70
|
+
import { useDMSession } from "nostr-wot-sdk/dm/react";
|
|
71
|
+
import { uploadToBlossom } from "nostr-wot-sdk/blossom";
|
|
72
|
+
import { NwcClient, requestZapInvoice } from "nostr-wot-sdk/wallet";
|
|
65
73
|
```
|
|
66
74
|
|
|
75
|
+
> Note: `@nostr-wot/ui`'s stylesheet is not re-exported — import it from the
|
|
76
|
+
> scoped package directly: `import "@nostr-wot/ui/styles.css"`. The
|
|
77
|
+
> framework-specific `@nostr-wot/auth/next` and `@nostr-wot/auth/client`
|
|
78
|
+
> entries are likewise only available on the scoped package.
|
|
79
|
+
|
|
67
80
|
## Architecture
|
|
68
81
|
|
|
69
82
|
```
|
|
@@ -91,7 +104,7 @@ Every `@nostr-wot/*` package shares the same connection pool via `getPool()` / `
|
|
|
91
104
|
|
|
92
105
|
- [@nostr-wot/data](https://www.npmjs.com/package/@nostr-wot/data) — fetchers, cache, hooks
|
|
93
106
|
- [@nostr-wot/relay](https://www.npmjs.com/package/@nostr-wot/relay) — pool, batcher, stats
|
|
94
|
-
- [@nostr-wot/signers](https://www.npmjs.com/package/@nostr-wot/signers) — NIP-07/46
|
|
107
|
+
- [@nostr-wot/signers](https://www.npmjs.com/package/@nostr-wot/signers) — NIP-07/46 + private key
|
|
95
108
|
- [@nostr-wot/dm](https://www.npmjs.com/package/@nostr-wot/dm) — NIP-04, NIP-17, cache, hooks
|
|
96
109
|
- [@nostr-wot/blossom](https://www.npmjs.com/package/@nostr-wot/blossom) — uploads
|
|
97
110
|
- [@nostr-wot/wallet](https://www.npmjs.com/package/@nostr-wot/wallet) — NWC + zaps
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var auth = require('@nostr-wot/auth');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
Object.keys(
|
|
7
|
+
Object.keys(auth).forEach(function (k) {
|
|
8
8
|
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
9
|
enumerable: true,
|
|
10
|
-
get: function () { return
|
|
10
|
+
get: function () { return auth[k]; }
|
|
11
11
|
});
|
|
12
12
|
});
|
|
13
13
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/auth';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/auth';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var blossom = require('@nostr-wot/blossom');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(blossom).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return blossom[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=index.cjs.map
|
|
14
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/blossom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/blossom';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var dm = require('@nostr-wot/dm');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(dm).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return dm[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=index.cjs.map
|
|
14
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/dm';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/dm';
|
package/dist/dm/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('@nostr-wot/dm/react');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(react).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return react[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=index.cjs.map
|
|
14
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/dm/react';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/dm/react';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var graph = require('@nostr-wot/graph');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(graph).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return graph[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=index.cjs.map
|
|
14
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/graph';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/graph';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('@nostr-wot/graph/react');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(react).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return react[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=index.cjs.map
|
|
14
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/graph/react';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/graph/react';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
package/dist/react/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/nostr-sdk-provider.tsx"],"names":["jsx","NostrDataProvider","WoTProvider","NostrSessionProvider"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../src/react/nostr-sdk-provider.tsx"],"names":["jsx","NostrDataProvider","WoTProvider","NostrSessionProvider"],"mappings":";;;;;;;AAoDO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,QAAA;AAAA,EACA,MAAA;AAAA,EACA,kBAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAA,EAA0B;AACxB,EAAA,MAAM,SAAA,GAAY;AAAA,IAChB,GAAI,MAAA,KAAW,MAAA,GAAY,EAAE,MAAA,KAAW,EAAC;AAAA,IACzC,GAAI,kBAAA,KAAuB,MAAA,GAAY,EAAE,kBAAA,KAAuB,EAAC;AAAA,IACjE,GAAI,KAAA,KAAU,MAAA,GAAY,EAAE,KAAA,KAAU;AAAC,GACzC;AACA,EAAA,IAAI,IAAA,mBACFA,cAAA,CAACC,uBAAA,EAAA,EAAmB,GAAG,WAAY,QAAA,EAAS,CAAA;AAE9C,EAAA,IAAI,2BAAK,OAAA,EAAS;AAChB,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,GAAG,UAAS,GAAI,GAAA;AAC3C,IAAA,IAAA,mBAAOD,cAAA,CAACE,mBAAA,EAAA,EAAa,GAAG,QAAA,EAAW,QAAA,EAAA,IAAA,EAAK,CAAA;AAAA,EAC1C;AAGA,EAAA,IAAI,OAAA,IAAW,OAAA,CAAQ,OAAA,KAAY,KAAA,EAAO,OAAO,IAAA;AACjD,EAAA,MAAM,EAAE,OAAA,EAAS,GAAA,EAAK,GAAG,YAAA,EAAa,GAAK,4BAAW,EAAC;AAGvD,EAAA,uBACEF,cAAA,CAACG,0BAAA,EAAA,EAAsB,GAAG,YAAA,EAAe,QAAA,EAAA,IAAA,EAAK,CAAA;AAElD","file":"index.cjs","sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport {\n NostrDataProvider,\n NostrSessionProvider,\n type NostrSessionProviderProps,\n} from '@nostr-wot/data/react';\nimport { WoTProvider, type WoTProviderProps } from '@nostr-wot/wot/react';\n\nexport interface NostrSdkProviderProps {\n children: ReactNode;\n /** Override the default relay set used by all data fetchers. */\n relays?: string[];\n /** Specialised aggregators for kind-0 lookups (e.g. purplepag.es). */\n profileAggregators?: string[];\n /** Cache configuration. The SWR layer persists profiles, follows,\n * and relay-lists to localStorage by default. */\n cache?: {\n namespace?: string;\n ttlMs?: number;\n };\n /** Session context — holds the active signer + pubkey. By default the\n * provider mounts an empty session so any child can call `useSigner()`\n * safely. Pass `initialSigner` / `onChange` / `onLogout` to wire your\n * app's auth, or `{ enabled: false }` to opt out (useful when an\n * outer `<NostrSessionProvider>` already wraps the tree). */\n session?:\n | ({ enabled?: true } & Omit<NostrSessionProviderProps, 'children'>)\n | { enabled: false };\n /** Web-of-Trust configuration. WoT is opt-in:\n * - Omit `wot` (or set `wot: { enabled: false }`) → no WoT context;\n * `useWoTContext()` returns null safely.\n * - Set `wot: { enabled: true, ... }` → wraps children with the\n * WoT context so `useWoT`, `useIsInWoT`, `useBatchWoT` work. */\n wot?: { enabled: boolean } & Omit<WoTProviderProps, 'children'>;\n}\n\n/**\n * Top-level provider for an app using the full Nostr WoT SDK. Composes:\n * - `<NostrSessionProvider>` — single mount point for the active signer\n * + pubkey; consumed by DM hooks, blossom, login UI, etc.\n * - `<NostrDataProvider>` — sets default relays, profile aggregators,\n * cache namespace.\n * - `<WoTProvider>` (optional, when `wot.enabled === true`).\n *\n * For data-only apps with no WoT scoring, depend on `@nostr-wot/data`\n * and use `<NostrDataProvider>` directly — no need to install\n * `@nostr-wot/wot`. For full login UI, install `@nostr-wot/ui` and use\n * its `<NostrSessionProvider>` (a thin shell on top of this one that\n * also handles silent re-attach + theming attributes).\n */\nexport function NostrSdkProvider({\n children,\n relays,\n profileAggregators,\n cache,\n session,\n wot,\n}: NostrSdkProviderProps) {\n const dataProps = {\n ...(relays !== undefined ? { relays } : {}),\n ...(profileAggregators !== undefined ? { profileAggregators } : {}),\n ...(cache !== undefined ? { cache } : {}),\n };\n let tree: ReactNode = (\n <NostrDataProvider {...dataProps}>{children}</NostrDataProvider>\n );\n if (wot?.enabled) {\n const { enabled: _enabled, ...wotProps } = wot;\n tree = <WoTProvider {...wotProps}>{tree}</WoTProvider>;\n }\n // Default: mount session provider with empty signer state. Opt out\n // via `session: { enabled: false }`.\n if (session && session.enabled === false) return tree;\n const { enabled: _se, ...sessionProps } = (session ?? {}) as {\n enabled?: true;\n } & Omit<NostrSessionProviderProps, 'children'>;\n return (\n <NostrSessionProvider {...sessionProps}>{tree}</NostrSessionProvider>\n );\n}\n"]}
|
package/dist/react/index.d.cts
CHANGED
|
@@ -31,8 +31,7 @@ interface NostrSdkProviderProps {
|
|
|
31
31
|
* - Omit `wot` (or set `wot: { enabled: false }`) → no WoT context;
|
|
32
32
|
* `useWoTContext()` returns null safely.
|
|
33
33
|
* - Set `wot: { enabled: true, ... }` → wraps children with the
|
|
34
|
-
* WoT context so `useWoT`, `
|
|
35
|
-
* `useBatchWoT` work. */
|
|
34
|
+
* WoT context so `useWoT`, `useIsInWoT`, `useBatchWoT` work. */
|
|
36
35
|
wot?: {
|
|
37
36
|
enabled: boolean;
|
|
38
37
|
} & Omit<WoTProviderProps, 'children'>;
|
package/dist/react/index.d.ts
CHANGED
|
@@ -31,8 +31,7 @@ interface NostrSdkProviderProps {
|
|
|
31
31
|
* - Omit `wot` (or set `wot: { enabled: false }`) → no WoT context;
|
|
32
32
|
* `useWoTContext()` returns null safely.
|
|
33
33
|
* - Set `wot: { enabled: true, ... }` → wraps children with the
|
|
34
|
-
* WoT context so `useWoT`, `
|
|
35
|
-
* `useBatchWoT` work. */
|
|
34
|
+
* WoT context so `useWoT`, `useIsInWoT`, `useBatchWoT` work. */
|
|
36
35
|
wot?: {
|
|
37
36
|
enabled: boolean;
|
|
38
37
|
} & Omit<WoTProviderProps, 'children'>;
|
package/dist/react/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/react/nostr-sdk-provider.tsx"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../src/react/nostr-sdk-provider.tsx"],"names":[],"mappings":";;;;;;;AAoDO,SAAS,gBAAA,CAAiB;AAAA,EAC/B,QAAA;AAAA,EACA,MAAA;AAAA,EACA,kBAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAA,EAA0B;AACxB,EAAA,MAAM,SAAA,GAAY;AAAA,IAChB,GAAI,MAAA,KAAW,MAAA,GAAY,EAAE,MAAA,KAAW,EAAC;AAAA,IACzC,GAAI,kBAAA,KAAuB,MAAA,GAAY,EAAE,kBAAA,KAAuB,EAAC;AAAA,IACjE,GAAI,KAAA,KAAU,MAAA,GAAY,EAAE,KAAA,KAAU;AAAC,GACzC;AACA,EAAA,IAAI,IAAA,mBACF,GAAA,CAAC,iBAAA,EAAA,EAAmB,GAAG,WAAY,QAAA,EAAS,CAAA;AAE9C,EAAA,IAAI,2BAAK,OAAA,EAAS;AAChB,IAAA,MAAM,EAAE,OAAA,EAAS,QAAA,EAAU,GAAG,UAAS,GAAI,GAAA;AAC3C,IAAA,IAAA,mBAAO,GAAA,CAAC,WAAA,EAAA,EAAa,GAAG,QAAA,EAAW,QAAA,EAAA,IAAA,EAAK,CAAA;AAAA,EAC1C;AAGA,EAAA,IAAI,OAAA,IAAW,OAAA,CAAQ,OAAA,KAAY,KAAA,EAAO,OAAO,IAAA;AACjD,EAAA,MAAM,EAAE,OAAA,EAAS,GAAA,EAAK,GAAG,YAAA,EAAa,GAAK,4BAAW,EAAC;AAGvD,EAAA,uBACE,GAAA,CAAC,oBAAA,EAAA,EAAsB,GAAG,YAAA,EAAe,QAAA,EAAA,IAAA,EAAK,CAAA;AAElD","file":"index.js","sourcesContent":["'use client';\n\nimport type { ReactNode } from 'react';\nimport {\n NostrDataProvider,\n NostrSessionProvider,\n type NostrSessionProviderProps,\n} from '@nostr-wot/data/react';\nimport { WoTProvider, type WoTProviderProps } from '@nostr-wot/wot/react';\n\nexport interface NostrSdkProviderProps {\n children: ReactNode;\n /** Override the default relay set used by all data fetchers. */\n relays?: string[];\n /** Specialised aggregators for kind-0 lookups (e.g. purplepag.es). */\n profileAggregators?: string[];\n /** Cache configuration. The SWR layer persists profiles, follows,\n * and relay-lists to localStorage by default. */\n cache?: {\n namespace?: string;\n ttlMs?: number;\n };\n /** Session context — holds the active signer + pubkey. By default the\n * provider mounts an empty session so any child can call `useSigner()`\n * safely. Pass `initialSigner` / `onChange` / `onLogout` to wire your\n * app's auth, or `{ enabled: false }` to opt out (useful when an\n * outer `<NostrSessionProvider>` already wraps the tree). */\n session?:\n | ({ enabled?: true } & Omit<NostrSessionProviderProps, 'children'>)\n | { enabled: false };\n /** Web-of-Trust configuration. WoT is opt-in:\n * - Omit `wot` (or set `wot: { enabled: false }`) → no WoT context;\n * `useWoTContext()` returns null safely.\n * - Set `wot: { enabled: true, ... }` → wraps children with the\n * WoT context so `useWoT`, `useIsInWoT`, `useBatchWoT` work. */\n wot?: { enabled: boolean } & Omit<WoTProviderProps, 'children'>;\n}\n\n/**\n * Top-level provider for an app using the full Nostr WoT SDK. Composes:\n * - `<NostrSessionProvider>` — single mount point for the active signer\n * + pubkey; consumed by DM hooks, blossom, login UI, etc.\n * - `<NostrDataProvider>` — sets default relays, profile aggregators,\n * cache namespace.\n * - `<WoTProvider>` (optional, when `wot.enabled === true`).\n *\n * For data-only apps with no WoT scoring, depend on `@nostr-wot/data`\n * and use `<NostrDataProvider>` directly — no need to install\n * `@nostr-wot/wot`. For full login UI, install `@nostr-wot/ui` and use\n * its `<NostrSessionProvider>` (a thin shell on top of this one that\n * also handles silent re-attach + theming attributes).\n */\nexport function NostrSdkProvider({\n children,\n relays,\n profileAggregators,\n cache,\n session,\n wot,\n}: NostrSdkProviderProps) {\n const dataProps = {\n ...(relays !== undefined ? { relays } : {}),\n ...(profileAggregators !== undefined ? { profileAggregators } : {}),\n ...(cache !== undefined ? { cache } : {}),\n };\n let tree: ReactNode = (\n <NostrDataProvider {...dataProps}>{children}</NostrDataProvider>\n );\n if (wot?.enabled) {\n const { enabled: _enabled, ...wotProps } = wot;\n tree = <WoTProvider {...wotProps}>{tree}</WoTProvider>;\n }\n // Default: mount session provider with empty signer state. Opt out\n // via `session: { enabled: false }`.\n if (session && session.enabled === false) return tree;\n const { enabled: _se, ...sessionProps } = (session ?? {}) as {\n enabled?: true;\n } & Omit<NostrSessionProviderProps, 'children'>;\n return (\n <NostrSessionProvider {...sessionProps}>{tree}</NostrSessionProvider>\n );\n}\n"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var signers = require('@nostr-wot/signers');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(signers).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return signers[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=index.cjs.map
|
|
14
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/signers';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/signers';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ui = require('@nostr-wot/ui');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(ui).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return ui[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=index.cjs.map
|
|
14
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/ui';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/ui';
|
package/dist/ui/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var wallet = require('@nostr-wot/wallet');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(wallet).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return wallet[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=index.cjs.map
|
|
14
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/wallet';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/wallet';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var react = require('@nostr-wot/wallet/react');
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
Object.keys(react).forEach(function (k) {
|
|
8
|
+
if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function () { return react[k]; }
|
|
11
|
+
});
|
|
12
|
+
});
|
|
13
|
+
//# sourceMappingURL=index.cjs.map
|
|
14
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs","sourcesContent":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/wallet/react';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@nostr-wot/wallet/react';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js","sourcesContent":[]}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nostr-wot-sdk",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "Meta-package re-exporting @nostr-wot
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Meta-package re-exporting the @nostr-wot/* family (wot, relay, data, signers, ui, dm, wallet, auth, blossom) under subpaths. Existing imports keep working; new code should depend on the scoped packages directly.",
|
|
5
5
|
"author": "Leon Acosta <leon@nostr-wot.com>",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"keywords": [
|
|
@@ -52,16 +52,6 @@
|
|
|
52
52
|
"default": "./dist/react/index.cjs"
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
"./solid": {
|
|
56
|
-
"import": {
|
|
57
|
-
"types": "./dist/solid/index.d.ts",
|
|
58
|
-
"default": "./dist/solid/index.js"
|
|
59
|
-
},
|
|
60
|
-
"require": {
|
|
61
|
-
"types": "./dist/solid/index.d.cts",
|
|
62
|
-
"default": "./dist/solid/index.cjs"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
55
|
"./relay": {
|
|
66
56
|
"import": {
|
|
67
57
|
"types": "./dist/relay/index.d.ts",
|
|
@@ -101,6 +91,106 @@
|
|
|
101
91
|
"types": "./dist/data/cache/index.d.cts",
|
|
102
92
|
"default": "./dist/data/cache/index.cjs"
|
|
103
93
|
}
|
|
94
|
+
},
|
|
95
|
+
"./signers": {
|
|
96
|
+
"import": {
|
|
97
|
+
"types": "./dist/signers/index.d.ts",
|
|
98
|
+
"default": "./dist/signers/index.js"
|
|
99
|
+
},
|
|
100
|
+
"require": {
|
|
101
|
+
"types": "./dist/signers/index.d.cts",
|
|
102
|
+
"default": "./dist/signers/index.cjs"
|
|
103
|
+
}
|
|
104
|
+
},
|
|
105
|
+
"./ui": {
|
|
106
|
+
"import": {
|
|
107
|
+
"types": "./dist/ui/index.d.ts",
|
|
108
|
+
"default": "./dist/ui/index.js"
|
|
109
|
+
},
|
|
110
|
+
"require": {
|
|
111
|
+
"types": "./dist/ui/index.d.cts",
|
|
112
|
+
"default": "./dist/ui/index.cjs"
|
|
113
|
+
}
|
|
114
|
+
},
|
|
115
|
+
"./dm": {
|
|
116
|
+
"import": {
|
|
117
|
+
"types": "./dist/dm/index.d.ts",
|
|
118
|
+
"default": "./dist/dm/index.js"
|
|
119
|
+
},
|
|
120
|
+
"require": {
|
|
121
|
+
"types": "./dist/dm/index.d.cts",
|
|
122
|
+
"default": "./dist/dm/index.cjs"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"./dm/react": {
|
|
126
|
+
"import": {
|
|
127
|
+
"types": "./dist/dm/react/index.d.ts",
|
|
128
|
+
"default": "./dist/dm/react/index.js"
|
|
129
|
+
},
|
|
130
|
+
"require": {
|
|
131
|
+
"types": "./dist/dm/react/index.d.cts",
|
|
132
|
+
"default": "./dist/dm/react/index.cjs"
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"./wallet": {
|
|
136
|
+
"import": {
|
|
137
|
+
"types": "./dist/wallet/index.d.ts",
|
|
138
|
+
"default": "./dist/wallet/index.js"
|
|
139
|
+
},
|
|
140
|
+
"require": {
|
|
141
|
+
"types": "./dist/wallet/index.d.cts",
|
|
142
|
+
"default": "./dist/wallet/index.cjs"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
"./wallet/react": {
|
|
146
|
+
"import": {
|
|
147
|
+
"types": "./dist/wallet/react/index.d.ts",
|
|
148
|
+
"default": "./dist/wallet/react/index.js"
|
|
149
|
+
},
|
|
150
|
+
"require": {
|
|
151
|
+
"types": "./dist/wallet/react/index.d.cts",
|
|
152
|
+
"default": "./dist/wallet/react/index.cjs"
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
"./auth": {
|
|
156
|
+
"import": {
|
|
157
|
+
"types": "./dist/auth/index.d.ts",
|
|
158
|
+
"default": "./dist/auth/index.js"
|
|
159
|
+
},
|
|
160
|
+
"require": {
|
|
161
|
+
"types": "./dist/auth/index.d.cts",
|
|
162
|
+
"default": "./dist/auth/index.cjs"
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
"./blossom": {
|
|
166
|
+
"import": {
|
|
167
|
+
"types": "./dist/blossom/index.d.ts",
|
|
168
|
+
"default": "./dist/blossom/index.js"
|
|
169
|
+
},
|
|
170
|
+
"require": {
|
|
171
|
+
"types": "./dist/blossom/index.d.cts",
|
|
172
|
+
"default": "./dist/blossom/index.cjs"
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
"./graph": {
|
|
176
|
+
"import": {
|
|
177
|
+
"types": "./dist/graph/index.d.ts",
|
|
178
|
+
"default": "./dist/graph/index.js"
|
|
179
|
+
},
|
|
180
|
+
"require": {
|
|
181
|
+
"types": "./dist/graph/index.d.cts",
|
|
182
|
+
"default": "./dist/graph/index.cjs"
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
"./graph/react": {
|
|
186
|
+
"import": {
|
|
187
|
+
"types": "./dist/graph/react/index.d.ts",
|
|
188
|
+
"default": "./dist/graph/react/index.js"
|
|
189
|
+
},
|
|
190
|
+
"require": {
|
|
191
|
+
"types": "./dist/graph/react/index.d.cts",
|
|
192
|
+
"default": "./dist/graph/react/index.cjs"
|
|
193
|
+
}
|
|
104
194
|
}
|
|
105
195
|
},
|
|
106
196
|
"files": [
|
|
@@ -114,20 +204,23 @@
|
|
|
114
204
|
"prepublishOnly": "npm run build"
|
|
115
205
|
},
|
|
116
206
|
"dependencies": {
|
|
117
|
-
"@nostr-wot/
|
|
207
|
+
"@nostr-wot/auth": "^3.0.0",
|
|
208
|
+
"@nostr-wot/blossom": "^0.1.5",
|
|
209
|
+
"@nostr-wot/data": "^0.5.0",
|
|
210
|
+
"@nostr-wot/graph": "^0.2.0",
|
|
211
|
+
"@nostr-wot/dm": "^0.5.1",
|
|
118
212
|
"@nostr-wot/relay": "^0.1.1",
|
|
119
|
-
"@nostr-wot/
|
|
213
|
+
"@nostr-wot/signers": "^1.0.0",
|
|
214
|
+
"@nostr-wot/ui": "^0.7.1",
|
|
215
|
+
"@nostr-wot/wallet": "^0.3.2",
|
|
216
|
+
"@nostr-wot/wot": "^1.0.0"
|
|
120
217
|
},
|
|
121
218
|
"peerDependencies": {
|
|
122
|
-
"react": ">=16.8.0"
|
|
123
|
-
"solid-js": ">=1.0.0"
|
|
219
|
+
"react": ">=16.8.0"
|
|
124
220
|
},
|
|
125
221
|
"peerDependenciesMeta": {
|
|
126
222
|
"react": {
|
|
127
223
|
"optional": true
|
|
128
|
-
},
|
|
129
|
-
"solid-js": {
|
|
130
|
-
"optional": true
|
|
131
224
|
}
|
|
132
225
|
},
|
|
133
226
|
"sideEffects": false
|
package/dist/solid/index.d.cts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@nostr-wot/wot/solid';
|
package/dist/solid/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@nostr-wot/wot/solid';
|
package/dist/solid/index.js
DELETED
|
File without changes
|
|
File without changes
|