@neus/sdk 1.0.2 → 1.0.4
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 +53 -75
- package/SECURITY.md +33 -29
- package/cjs/client.cjs +678 -337
- package/cjs/errors.cjs +1 -0
- package/cjs/gates.cjs +1 -0
- package/cjs/index.cjs +927 -362
- package/cjs/utils.cjs +408 -32
- package/cli/neus.mjs +58 -0
- package/client.js +1957 -1728
- package/errors.js +5 -5
- package/gates.js +18 -18
- package/index.js +18 -3
- package/neus-logo.svg +3 -0
- package/package.json +21 -11
- package/types.d.ts +303 -53
- package/utils.js +1291 -777
- package/widgets/README.md +12 -20
- package/widgets/index.js +9 -9
- package/widgets/verify-gate/dist/ProofBadge.js +57 -52
- package/widgets/verify-gate/dist/VerifyGate.js +357 -121
- package/widgets/verify-gate/index.js +13 -13
package/widgets/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# NEUS Widgets
|
|
1
|
+
# NEUS Widgets
|
|
2
2
|
|
|
3
|
-
React components
|
|
3
|
+
**Proof-aware React components** (VerifyGate, ProofBadge) so your UI can show verified state and gate content **using the same checks your server already trusts** - avoid re-implementing verifier rules only in the browser.
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ npm install @neus/sdk react react-dom
|
|
|
10
10
|
|
|
11
11
|
## VerifyGate
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Create mode defaults to **unlisted public** for gate-friendly reuse. Override `proofOptions` when you need listed public or private.
|
|
14
14
|
|
|
15
15
|
```jsx
|
|
16
16
|
import { VerifyGate } from '@neus/sdk/widgets';
|
|
@@ -18,9 +18,10 @@ import { VerifyGate } from '@neus/sdk/widgets';
|
|
|
18
18
|
export function Page() {
|
|
19
19
|
return (
|
|
20
20
|
<VerifyGate
|
|
21
|
+
appId="your-app-id"
|
|
21
22
|
requiredVerifiers={['nft-ownership']}
|
|
22
23
|
verifierData={{
|
|
23
|
-
'nft-ownership': { contractAddress: '0x...', tokenId: '1', chainId:
|
|
24
|
+
'nft-ownership': { contractAddress: '0x...', tokenId: '1', chainId: 8453 }
|
|
24
25
|
}}
|
|
25
26
|
>
|
|
26
27
|
<div>Unlocked</div>
|
|
@@ -29,25 +30,16 @@ export function Page() {
|
|
|
29
30
|
}
|
|
30
31
|
```
|
|
31
32
|
|
|
32
|
-
### Key props
|
|
33
|
-
|
|
34
|
-
- `requiredVerifiers`: `string[]` (default: `['ownership-basic']`)
|
|
35
|
-
- `verifierData`: object keyed by verifier id
|
|
36
|
-
- `strategy`: `'reuse-or-create' | 'reuse' | 'fresh'` (default: `'reuse-or-create'`)
|
|
37
|
-
- `proofOptions`: `{ privacyLevel, publicDisplay, storeOriginalContent, enableIpfs? }` (defaults: private)
|
|
38
|
-
- `mode`: `'create' | 'access'` (default: `'create'`)
|
|
39
|
-
- `qHash`: string (required for `mode="access"`)
|
|
40
|
-
|
|
41
|
-
Notes:
|
|
42
|
-
- Reuse without prompting can only see **public + discoverable** proofs.
|
|
43
|
-
- Reusing private proofs requires an **owner signature** (wallet grants read access).
|
|
44
|
-
|
|
45
33
|
## ProofBadge
|
|
46
34
|
|
|
47
|
-
Display verification status by Proof ID (`qHash`).
|
|
48
|
-
|
|
49
35
|
```jsx
|
|
50
36
|
import { ProofBadge } from '@neus/sdk/widgets';
|
|
51
37
|
|
|
52
|
-
<ProofBadge
|
|
38
|
+
<ProofBadge proofId="0x..." showChains />
|
|
53
39
|
```
|
|
40
|
+
|
|
41
|
+
## Docs
|
|
42
|
+
|
|
43
|
+
- [Widgets Overview](https://docs.neus.network/widgets/overview)
|
|
44
|
+
- [Verify Component](https://docs.neus.network/widgets/verifygate)
|
|
45
|
+
- [Quickstart](https://docs.neus.network/quickstart)
|
package/widgets/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NEUS Widgets
|
|
3
|
-
*
|
|
4
|
-
* Core Widgets:
|
|
5
|
-
* - VerifyGate: Universal verification gate component
|
|
6
|
-
* - ProofBadge: Display verification status
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
export * from './verify-gate/index.js';
|
|
1
|
+
/**
|
|
2
|
+
* NEUS Widgets
|
|
3
|
+
*
|
|
4
|
+
* Core Widgets:
|
|
5
|
+
* - VerifyGate: Universal verification gate component
|
|
6
|
+
* - ProofBadge: Display verification status
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from './verify-gate/index.js';
|