@qntx/siwx 0.7.0 → 0.7.1
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 +10 -33
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,39 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
<!-- markdownlint-disable MD033 MD041 -->
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
Mirrors the Rust `siwx` crate one-to-one through shared vectors.
|
|
3
|
+
# `@qntx/siwx`
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
import { createMessage, authenticate, generateNonce } from "@qntx/siwx";
|
|
8
|
-
import { evm } from "@qntx/siwx/evm";
|
|
9
|
-
import { svm } from "@qntx/siwx/svm";
|
|
5
|
+
[Sign-In with X](https://chainagnostic.org/CAIPs/caip-122) (CAIP-122) for TypeScript: message construction, parsing, binding checks and signature verification for EVM (`@qntx/siwx/evm`, EIP-4361) and Solana (`@qntx/siwx/svm`, SIWS). Platform-neutral and Hermes-safe; behaviorally identical to the [siwx](https://crates.io/crates/siwx) crate.
|
|
10
6
|
|
|
11
|
-
|
|
12
|
-
const message = createMessage({
|
|
13
|
-
domain: "service.org",
|
|
14
|
-
address: "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
|
|
15
|
-
uri: "https://service.org/login",
|
|
16
|
-
version: "1",
|
|
17
|
-
chainId: "1",
|
|
18
|
-
nonce: generateNonce(),
|
|
19
|
-
issuedAt: "2026-01-01T00:00:00.000Z",
|
|
20
|
-
});
|
|
21
|
-
const text = ns.format(message); // wallet signs these bytes
|
|
7
|
+
See the [documentation](https://github.com/qntx/siwx/tree/main/docs).
|
|
22
8
|
|
|
23
|
-
|
|
24
|
-
message: text,
|
|
25
|
-
signature, // Uint8Array
|
|
26
|
-
expect: { domain: "service.org", nonce: message.nonce, skewSeconds: 60 },
|
|
27
|
-
});
|
|
28
|
-
```
|
|
9
|
+
## License
|
|
29
10
|
|
|
30
|
-
|
|
31
|
-
`{ rpc: { "1": provider } }` (`Eip1193Provider`) to enable the ERC-6492
|
|
32
|
-
universal-validator path for smart accounts.
|
|
33
|
-
- `svm()` — SIWS layout + strict Ed25519 (canonical prime-order-subgroup
|
|
34
|
-
keys, `S < L`); `offchainMessage(text, signer)` builds the v1 envelope.
|
|
35
|
-
- Errors: `SiwxError` with `info.code` (`Syntax`, `InvalidField`, `Mismatch`,
|
|
36
|
-
`VerificationFailed`, `Unsupported`, `Backend`, …) — see `errors.mdx` in
|
|
37
|
-
the repo docs.
|
|
11
|
+
Licensed under either of:
|
|
38
12
|
|
|
39
|
-
License
|
|
13
|
+
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <https://www.apache.org/licenses/LICENSE-2.0>)
|
|
14
|
+
- MIT License ([LICENSE-MIT](LICENSE-MIT) or <https://opensource.org/licenses/MIT>)
|
|
15
|
+
|
|
16
|
+
at your option.
|