@jaw.id/ui 0.4.5 → 0.4.6
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/components/SiweDialog/index.d.ts +1 -1
- package/dist/components/SiweDialog/index.d.ts.map +1 -1
- package/dist/index.js +6661 -6423
- package/dist/react/ReactUIHandler.d.ts.map +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/siwe.d.ts +43 -0
- package/dist/utils/siwe.d.ts.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReactUIHandler.d.ts","sourceRoot":"","sources":["../../src/react/ReactUIHandler.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,SAAS,EACT,eAAe,EACf,SAAS,EACT,UAAU,EA0BX,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"ReactUIHandler.d.ts","sourceRoot":"","sources":["../../src/react/ReactUIHandler.tsx"],"names":[],"mappings":"AAIA,OAAO,EACL,SAAS,EACT,eAAe,EACf,SAAS,EACT,UAAU,EA0BX,MAAM,cAAc,CAAC;AAsBtB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AA4D7C;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,kFAAkF;IAClF,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBAAa,cAAe,YAAW,SAAS;IAC9C,OAAO,CAAC,MAAM,CAA0C;IACxD,OAAO,CAAC,UAAU,CAAC,CAAW;gBAElB,OAAO,CAAC,EAAE,qBAAqB;IAI3C;;;OAGG;IACH,IAAI,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI;IAInC;;;OAGG;IACH,QAAQ,CAAC,KAAK,EAAE,QAAQ,GAAG,IAAI;IAI/B,8DAA8D;IAC9D,OAAO,KAAK,cAAc,GAIzB;IAEK,OAAO,CAAC,CAAC,GAAG,OAAO,EAAE,OAAO,EAAE,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IA6FtE,SAAS,CAAC,OAAO,EAAE,SAAS,GAAG,OAAO;IAahC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAU9B,OAAO,CAAC,YAAY;CAmMrB"}
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SIWE (Sign-In with Ethereum, EIP-4361) detection, parsing, and cross-domain
|
|
3
|
+
* origin checks. Single source of truth shared by the keys.jaw.id popup and the
|
|
4
|
+
* in-app ReactUIHandler.
|
|
5
|
+
* https://eips.ethereum.org/EIPS/eip-4361
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Converts a hex string (with or without 0x prefix) to UTF-8.
|
|
9
|
+
*/
|
|
10
|
+
export declare function hexToUtf8(hex: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Detects whether a message (hex or plaintext) is a valid EIP-4361 SIWE message.
|
|
13
|
+
*/
|
|
14
|
+
export declare function isSiweMessage(message: string): boolean;
|
|
15
|
+
export interface SiweMessageFields {
|
|
16
|
+
domain: string;
|
|
17
|
+
address: string;
|
|
18
|
+
statement?: string;
|
|
19
|
+
uri: string;
|
|
20
|
+
version: string;
|
|
21
|
+
chainId: number;
|
|
22
|
+
nonce: string;
|
|
23
|
+
issuedAt: string;
|
|
24
|
+
expirationTime?: string;
|
|
25
|
+
notBefore?: string;
|
|
26
|
+
requestId?: string;
|
|
27
|
+
resources?: string[];
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Parses a SIWE message into its fields, or null if it isn't a valid SIWE message.
|
|
31
|
+
*/
|
|
32
|
+
export declare function parseSiweMessage(message: string): SiweMessageFields | null;
|
|
33
|
+
/**
|
|
34
|
+
* Per EIP-4361 the SIWE `domain` must be the origin requesting the signature.
|
|
35
|
+
* Returns a warning when the asserted domain/uri host differs from the origin
|
|
36
|
+
* the user is actually on (cross-domain phishing), or undefined when they match
|
|
37
|
+
* or cannot be compared.
|
|
38
|
+
*/
|
|
39
|
+
export declare function getSiweOriginWarning(requestOrigin: string, siwe: {
|
|
40
|
+
domain?: string;
|
|
41
|
+
uri?: string;
|
|
42
|
+
}): string | undefined;
|
|
43
|
+
//# sourceMappingURL=siwe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"siwe.d.ts","sourceRoot":"","sources":["../../src/utils/siwe.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAS7C;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAuBtD;AAED,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CAwD1E;AAeD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,aAAa,EAAE,MAAM,EACrB,IAAI,EAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,GACtC,MAAM,GAAG,SAAS,CAKpB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jaw.id/ui",
|
|
3
3
|
"description": "Pre-built React dialogs for JAW.id",
|
|
4
|
-
"version": "0.4.
|
|
4
|
+
"version": "0.4.6",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": [
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"react-dom": ">=18.0.0"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@jaw.id/core": "0.4.
|
|
43
|
+
"@jaw.id/core": "0.4.3",
|
|
44
44
|
"@hookform/resolvers": "^5.2.2",
|
|
45
45
|
"@justaname.id/sdk": "^0.2.204",
|
|
46
46
|
"@radix-ui/react-accordion": "^1.2.12",
|