@renown/sdk 6.0.0-staging.3 → 6.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 +47 -437
- package/dist/index.d.ts +77 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +173 -0
- package/dist/index.js.map +1 -0
- package/dist/node.d.ts +136 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +305 -0
- package/dist/node.js.map +1 -0
- package/dist/renown-builder-BLM2JCDq.js +815 -0
- package/dist/renown-builder-BLM2JCDq.js.map +1 -0
- package/dist/utils-BGF8Qb5f.d.ts +689 -0
- package/dist/utils-BGF8Qb5f.d.ts.map +1 -0
- package/package.json +18 -40
- package/dist/e2e/fixtures/main.d.ts +0 -2
- package/dist/e2e/fixtures/main.d.ts.map +0 -1
- package/dist/e2e/fixtures/main.js +0 -97
- package/dist/e2e/fixtures/main.js.map +0 -1
- package/dist/e2e/fixtures/vite.config.d.ts +0 -3
- package/dist/e2e/fixtures/vite.config.d.ts.map +0 -1
- package/dist/e2e/fixtures/vite.config.js +0 -10
- package/dist/e2e/fixtures/vite.config.js.map +0 -1
- package/dist/e2e/renown-components.spec.d.ts +0 -2
- package/dist/e2e/renown-components.spec.d.ts.map +0 -1
- package/dist/e2e/renown-components.spec.js +0 -155
- package/dist/e2e/renown-components.spec.js.map +0 -1
- package/dist/playwright.config.d.ts +0 -3
- package/dist/playwright.config.d.ts.map +0 -1
- package/dist/playwright.config.js +0 -25
- package/dist/playwright.config.js.map +0 -1
- package/dist/src/assets/assets.d.ts +0 -19
- package/dist/src/assets/renown-hover.svg +0 -17
- package/dist/src/assets/renown-light.svg +0 -15
- package/dist/src/assets/renown-short-hover.png +0 -0
- package/dist/src/assets/renown-short.png +0 -0
- package/dist/src/assets/renown.svg +0 -16
- package/dist/src/common.d.ts +0 -21
- package/dist/src/common.d.ts.map +0 -1
- package/dist/src/common.js +0 -113
- package/dist/src/common.js.map +0 -1
- package/dist/src/components/RenownAuthButton.d.ts +0 -62
- package/dist/src/components/RenownAuthButton.d.ts.map +0 -1
- package/dist/src/components/RenownAuthButton.js +0 -82
- package/dist/src/components/RenownAuthButton.js.map +0 -1
- package/dist/src/components/RenownLoginButton.d.ts +0 -48
- package/dist/src/components/RenownLoginButton.d.ts.map +0 -1
- package/dist/src/components/RenownLoginButton.js +0 -175
- package/dist/src/components/RenownLoginButton.js.map +0 -1
- package/dist/src/components/RenownUserButton.d.ts +0 -66
- package/dist/src/components/RenownUserButton.d.ts.map +0 -1
- package/dist/src/components/RenownUserButton.js +0 -216
- package/dist/src/components/RenownUserButton.js.map +0 -1
- package/dist/src/components/icons.d.ts +0 -25
- package/dist/src/components/icons.d.ts.map +0 -1
- package/dist/src/components/icons.js +0 -24
- package/dist/src/components/icons.js.map +0 -1
- package/dist/src/components/image-data.d.ts +0 -3
- package/dist/src/components/image-data.d.ts.map +0 -1
- package/dist/src/components/image-data.js +0 -4
- package/dist/src/components/image-data.js.map +0 -1
- package/dist/src/components/index.d.ts +0 -8
- package/dist/src/components/index.d.ts.map +0 -1
- package/dist/src/components/index.js +0 -5
- package/dist/src/components/index.js.map +0 -1
- package/dist/src/constants.d.ts +0 -130
- package/dist/src/constants.d.ts.map +0 -1
- package/dist/src/constants.js +0 -40
- package/dist/src/constants.js.map +0 -1
- package/dist/src/crypto/browser-key-storage.d.ts +0 -10
- package/dist/src/crypto/browser-key-storage.d.ts.map +0 -1
- package/dist/src/crypto/browser-key-storage.js +0 -76
- package/dist/src/crypto/browser-key-storage.js.map +0 -1
- package/dist/src/crypto/index.d.ts +0 -7
- package/dist/src/crypto/index.d.ts.map +0 -1
- package/dist/src/crypto/index.js +0 -9
- package/dist/src/crypto/index.js.map +0 -1
- package/dist/src/crypto/memory-key-storage.d.ts +0 -9
- package/dist/src/crypto/memory-key-storage.d.ts.map +0 -1
- package/dist/src/crypto/memory-key-storage.js +0 -18
- package/dist/src/crypto/memory-key-storage.js.map +0 -1
- package/dist/src/crypto/node-key-storage.d.ts +0 -21
- package/dist/src/crypto/node-key-storage.d.ts.map +0 -1
- package/dist/src/crypto/node-key-storage.js +0 -107
- package/dist/src/crypto/node-key-storage.js.map +0 -1
- package/dist/src/crypto/node.d.ts +0 -2
- package/dist/src/crypto/node.d.ts.map +0 -1
- package/dist/src/crypto/node.js +0 -3
- package/dist/src/crypto/node.js.map +0 -1
- package/dist/src/crypto/renown-crypto-builder.d.ts +0 -11
- package/dist/src/crypto/renown-crypto-builder.d.ts.map +0 -1
- package/dist/src/crypto/renown-crypto-builder.js +0 -34
- package/dist/src/crypto/renown-crypto-builder.js.map +0 -1
- package/dist/src/crypto/renown-crypto.d.ts +0 -26
- package/dist/src/crypto/renown-crypto.d.ts.map +0 -1
- package/dist/src/crypto/renown-crypto.js +0 -56
- package/dist/src/crypto/renown-crypto.js.map +0 -1
- package/dist/src/crypto/signer.d.ts +0 -74
- package/dist/src/crypto/signer.d.ts.map +0 -1
- package/dist/src/crypto/signer.js +0 -306
- package/dist/src/crypto/signer.js.map +0 -1
- package/dist/src/crypto/types.d.ts +0 -27
- package/dist/src/crypto/types.d.ts.map +0 -1
- package/dist/src/crypto/types.js +0 -2
- package/dist/src/crypto/types.js.map +0 -1
- package/dist/src/crypto/utils.d.ts +0 -13
- package/dist/src/crypto/utils.d.ts.map +0 -1
- package/dist/src/crypto/utils.js +0 -39
- package/dist/src/crypto/utils.js.map +0 -1
- package/dist/src/event/event.browser.d.ts +0 -10
- package/dist/src/event/event.browser.d.ts.map +0 -1
- package/dist/src/event/event.browser.js +0 -24
- package/dist/src/event/event.browser.js.map +0 -1
- package/dist/src/event/event.node.d.ts +0 -8
- package/dist/src/event/event.node.d.ts.map +0 -1
- package/dist/src/event/event.node.js +0 -17
- package/dist/src/event/event.node.js.map +0 -1
- package/dist/src/event/memory.d.ts +0 -8
- package/dist/src/event/memory.d.ts.map +0 -1
- package/dist/src/event/memory.js +0 -16
- package/dist/src/event/memory.js.map +0 -1
- package/dist/src/event/types.d.ts +0 -16
- package/dist/src/event/types.d.ts.map +0 -1
- package/dist/src/event/types.js +0 -2
- package/dist/src/event/types.js.map +0 -1
- package/dist/src/hooks/index.d.ts +0 -2
- package/dist/src/hooks/index.d.ts.map +0 -1
- package/dist/src/hooks/index.js +0 -2
- package/dist/src/hooks/index.js.map +0 -1
- package/dist/src/hooks/use-user.d.ts +0 -21
- package/dist/src/hooks/use-user.d.ts.map +0 -1
- package/dist/src/hooks/use-user.js +0 -30
- package/dist/src/hooks/use-user.js.map +0 -1
- package/dist/src/index.browser.d.ts +0 -4
- package/dist/src/index.browser.d.ts.map +0 -1
- package/dist/src/index.browser.js +0 -4
- package/dist/src/index.browser.js.map +0 -1
- package/dist/src/index.d.ts +0 -15
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -15
- package/dist/src/index.js.map +0 -1
- package/dist/src/index.node.d.ts +0 -4
- package/dist/src/index.node.d.ts.map +0 -1
- package/dist/src/index.node.js +0 -4
- package/dist/src/index.node.js.map +0 -1
- package/dist/src/init.browser.d.ts +0 -52
- package/dist/src/init.browser.d.ts.map +0 -1
- package/dist/src/init.browser.js +0 -66
- package/dist/src/init.browser.js.map +0 -1
- package/dist/src/init.node.d.ts +0 -29
- package/dist/src/init.node.d.ts.map +0 -1
- package/dist/src/init.node.js +0 -30
- package/dist/src/init.node.js.map +0 -1
- package/dist/src/lib/renown/constants.d.ts +0 -130
- package/dist/src/lib/renown/constants.d.ts.map +0 -1
- package/dist/src/lib/renown/constants.js +0 -40
- package/dist/src/lib/renown/constants.js.map +0 -1
- package/dist/src/lib/renown/credential.d.ts +0 -2
- package/dist/src/lib/renown/credential.d.ts.map +0 -1
- package/dist/src/lib/renown/credential.js +0 -68
- package/dist/src/lib/renown/credential.js.map +0 -1
- package/dist/src/lib/renown/did-parser.d.ts +0 -28
- package/dist/src/lib/renown/did-parser.d.ts.map +0 -1
- package/dist/src/lib/renown/did-parser.js +0 -57
- package/dist/src/lib/renown/did-parser.js.map +0 -1
- package/dist/src/lib/renown/index.d.ts +0 -4
- package/dist/src/lib/renown/index.d.ts.map +0 -1
- package/dist/src/lib/renown/index.js +0 -4
- package/dist/src/lib/renown/index.js.map +0 -1
- package/dist/src/lib/renown/utils.d.ts +0 -33
- package/dist/src/lib/renown/utils.d.ts.map +0 -1
- package/dist/src/lib/renown/utils.js +0 -188
- package/dist/src/lib/renown/utils.js.map +0 -1
- package/dist/src/lib/session-storage.d.ts +0 -40
- package/dist/src/lib/session-storage.d.ts.map +0 -1
- package/dist/src/lib/session-storage.js +0 -107
- package/dist/src/lib/session-storage.js.map +0 -1
- package/dist/src/node.d.ts +0 -10
- package/dist/src/node.d.ts.map +0 -1
- package/dist/src/node.js +0 -10
- package/dist/src/node.js.map +0 -1
- package/dist/src/providers/index.d.ts +0 -3
- package/dist/src/providers/index.d.ts.map +0 -1
- package/dist/src/providers/index.js +0 -2
- package/dist/src/providers/index.js.map +0 -1
- package/dist/src/providers/renown-user-provider.d.ts +0 -76
- package/dist/src/providers/renown-user-provider.d.ts.map +0 -1
- package/dist/src/providers/renown-user-provider.js +0 -166
- package/dist/src/providers/renown-user-provider.js.map +0 -1
- package/dist/src/renown-builder.d.ts +0 -60
- package/dist/src/renown-builder.d.ts.map +0 -1
- package/dist/src/renown-builder.js +0 -115
- package/dist/src/renown-builder.js.map +0 -1
- package/dist/src/storage/common.d.ts +0 -17
- package/dist/src/storage/common.d.ts.map +0 -1
- package/dist/src/storage/common.js +0 -20
- package/dist/src/storage/common.js.map +0 -1
- package/dist/src/storage/storage.browser.d.ts +0 -10
- package/dist/src/storage/storage.browser.d.ts.map +0 -1
- package/dist/src/storage/storage.browser.js +0 -27
- package/dist/src/storage/storage.browser.js.map +0 -1
- package/dist/src/storage/storage.node.d.ts +0 -11
- package/dist/src/storage/storage.node.d.ts.map +0 -1
- package/dist/src/storage/storage.node.js +0 -42
- package/dist/src/storage/storage.node.js.map +0 -1
- package/dist/src/types.d.ts +0 -104
- package/dist/src/types.d.ts.map +0 -1
- package/dist/src/types.js +0 -2
- package/dist/src/types.js.map +0 -1
- package/dist/src/utils.d.ts +0 -18
- package/dist/src/utils.d.ts.map +0 -1
- package/dist/src/utils.js +0 -88
- package/dist/src/utils.js.map +0 -1
- package/dist/test/auth.test.d.ts +0 -2
- package/dist/test/auth.test.d.ts.map +0 -1
- package/dist/test/auth.test.js +0 -13
- package/dist/test/auth.test.js.map +0 -1
- package/dist/test/crypto/signer.test.d.ts +0 -2
- package/dist/test/crypto/signer.test.d.ts.map +0 -1
- package/dist/test/crypto/signer.test.js +0 -184
- package/dist/test/crypto/signer.test.js.map +0 -1
- package/dist/test/script.test.d.ts +0 -2
- package/dist/test/script.test.d.ts.map +0 -1
- package/dist/test/script.test.js +0 -144
- package/dist/test/script.test.js.map +0 -1
- package/dist/test/storage.node.test.d.ts +0 -2
- package/dist/test/storage.node.test.d.ts.map +0 -1
- package/dist/test/storage.node.test.js +0 -66
- package/dist/test/storage.node.test.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
- package/dist/vitest.config.d.ts +0 -3
- package/dist/vitest.config.d.ts.map +0 -1
- package/dist/vitest.config.js +0 -7
- package/dist/vitest.config.js.map +0 -1
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { useContext } from "react";
|
|
3
|
-
import { RenownUserContext } from "../providers/renown-user-provider.js";
|
|
4
|
-
/**
|
|
5
|
-
* useUser Hook - Access user context
|
|
6
|
-
*
|
|
7
|
-
* Provides access to the current user and authentication methods.
|
|
8
|
-
* Must be used within a RenownUserProvider.
|
|
9
|
-
*
|
|
10
|
-
* @throws Error if used outside of RenownUserProvider
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```tsx
|
|
14
|
-
* function MyComponent() {
|
|
15
|
-
* const { user, loginStatus, isLoading, login, logout, openRenown, renownCrypto, renown } = useUser()
|
|
16
|
-
*
|
|
17
|
-
* if (isLoading) return <div>Loading...</div>
|
|
18
|
-
* if (!user) return <button onClick={openRenown}>Login</button>
|
|
19
|
-
* return <div>Welcome {user.name || user.did}</div>
|
|
20
|
-
* }
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export function useUser() {
|
|
24
|
-
const context = useContext(RenownUserContext);
|
|
25
|
-
if (!context) {
|
|
26
|
-
throw new Error("useUser must be used within a RenownUserProvider");
|
|
27
|
-
}
|
|
28
|
-
return context;
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=use-user.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"use-user.js","sourceRoot":"","sources":["../../../src/hooks/use-user.ts"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,OAAO;IACrB,MAAM,OAAO,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC;IAE9C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACtE,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../src/index.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../../src/index.browser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
package/dist/src/index.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from "./common.js";
|
|
2
|
-
export * from "./components/index.js";
|
|
3
|
-
export * from "./crypto/index.js";
|
|
4
|
-
export * from "./hooks/index.js";
|
|
5
|
-
export * from "./init.browser.js";
|
|
6
|
-
export * from "./providers/index.js";
|
|
7
|
-
export * from "./renown-builder.js";
|
|
8
|
-
export * from "./types.js";
|
|
9
|
-
export * from "./utils.js";
|
|
10
|
-
export { RENOWN_CHAIN_ID, RENOWN_NETWORK_ID, RENOWN_URL, } from "./lib/renown/constants.js";
|
|
11
|
-
export { extractEthAddressFromDid } from "./lib/renown/did-parser.js";
|
|
12
|
-
export { fetchProfileDataForUser, handleRenownReturn, login, logout, openRenown, reauthenticateFromSession, } from "./lib/renown/utils.js";
|
|
13
|
-
export type { LoginStatus, User as SimpleUser } from "./lib/renown/utils.js";
|
|
14
|
-
export { SessionStorageManager } from "./lib/session-storage.js";
|
|
15
|
-
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAE3B,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,UAAU,GACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,UAAU,EACV,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,WAAW,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/src/index.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export * from "./common.js";
|
|
2
|
-
export * from "./components/index.js";
|
|
3
|
-
export * from "./crypto/index.js";
|
|
4
|
-
export * from "./hooks/index.js";
|
|
5
|
-
export * from "./init.browser.js";
|
|
6
|
-
export * from "./providers/index.js";
|
|
7
|
-
export * from "./renown-builder.js";
|
|
8
|
-
export * from "./types.js";
|
|
9
|
-
export * from "./utils.js";
|
|
10
|
-
// Export specific items from lib/renown to avoid conflicts
|
|
11
|
-
export { RENOWN_CHAIN_ID, RENOWN_NETWORK_ID, RENOWN_URL, } from "./lib/renown/constants.js";
|
|
12
|
-
export { extractEthAddressFromDid } from "./lib/renown/did-parser.js";
|
|
13
|
-
export { fetchProfileDataForUser, handleRenownReturn, login, logout, openRenown, reauthenticateFromSession, } from "./lib/renown/utils.js";
|
|
14
|
-
export { SessionStorageManager } from "./lib/session-storage.js";
|
|
15
|
-
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,2DAA2D;AAC3D,OAAO,EACL,eAAe,EACf,iBAAiB,EACjB,UAAU,GACX,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EACL,uBAAuB,EACvB,kBAAkB,EAClB,KAAK,EACL,MAAM,EACN,UAAU,EACV,yBAAyB,GAC1B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAC"}
|
package/dist/src/index.node.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.node.d.ts","sourceRoot":"","sources":["../../src/index.node.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
package/dist/src/index.node.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.node.js","sourceRoot":"","sources":["../../src/index.node.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC"}
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import type { Renown } from "./common.js";
|
|
2
|
-
import { BrowserEventEmitter } from "./event/event.browser.js";
|
|
3
|
-
import { BaseRenownBuilder } from "./renown-builder.js";
|
|
4
|
-
import { BrowserStorage } from "./storage/storage.browser.js";
|
|
5
|
-
import type { RenownEvents, RenownStorageMap } from "./types.js";
|
|
6
|
-
export declare class BrowserRenownStorage extends BrowserStorage<RenownStorageMap> {
|
|
7
|
-
}
|
|
8
|
-
export declare class BrowserRenownEventEmitter extends BrowserEventEmitter<RenownEvents> {
|
|
9
|
-
}
|
|
10
|
-
export interface BrowserRenownBuilderOptions {
|
|
11
|
-
/** Base path for storage keys (e.g., "/app" for multi-tenant apps) */
|
|
12
|
-
basename?: string;
|
|
13
|
-
/** Renown server URL. Defaults to https://www.renown.id */
|
|
14
|
-
baseUrl?: string;
|
|
15
|
-
/** IndexedDB database name for key storage. Defaults to "renownKeyDB" */
|
|
16
|
-
keyDbName?: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Browser-specific Renown builder with pre-configured defaults.
|
|
20
|
-
* Uses localStorage for user data and IndexedDB for key storage.
|
|
21
|
-
*/
|
|
22
|
-
export declare class RenownBuilder extends BaseRenownBuilder {
|
|
23
|
-
#private;
|
|
24
|
-
/**
|
|
25
|
-
* @param appName - Application name used for signing context
|
|
26
|
-
* @param options - Browser-specific configuration options
|
|
27
|
-
*/
|
|
28
|
-
constructor(appName: string, options?: BrowserRenownBuilderOptions);
|
|
29
|
-
/**
|
|
30
|
-
* Set base path for storage keys (e.g., "/app" for multi-tenant apps).
|
|
31
|
-
*/
|
|
32
|
-
withBasename(basename: string): this;
|
|
33
|
-
/**
|
|
34
|
-
* Set IndexedDB database name for key storage.
|
|
35
|
-
* Defaults to "renownKeyDB".
|
|
36
|
-
*/
|
|
37
|
-
withKeyDbName(keyDbName: string): this;
|
|
38
|
-
/**
|
|
39
|
-
* Build and initialize the Renown instance.
|
|
40
|
-
* Initializes IndexedDB for key storage before building.
|
|
41
|
-
*/
|
|
42
|
-
build(): Promise<Renown>;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* @deprecated Use RenownBuilder directly instead.
|
|
46
|
-
* Initialize a browser-specific Renown instance.
|
|
47
|
-
* @param appName - Application name used for signing context
|
|
48
|
-
* @param options - Browser-specific configuration options
|
|
49
|
-
* @returns Initialized Renown instance
|
|
50
|
-
*/
|
|
51
|
-
export declare function initRenown(appName: string, options?: BrowserRenownBuilderOptions): Promise<Renown>;
|
|
52
|
-
//# sourceMappingURL=init.browser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.browser.d.ts","sourceRoot":"","sources":["../../src/init.browser.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEjE,qBAAa,oBAAqB,SAAQ,cAAc,CAAC,gBAAgB,CAAC;CAAG;AAC7E,qBAAa,yBAA0B,SAAQ,mBAAmB,CAAC,YAAY,CAAC;CAAG;AAEnF,MAAM,WAAW,2BAA2B;IAC1C,sEAAsE;IACtE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;GAGG;AACH,qBAAa,aAAc,SAAQ,iBAAiB;;IAIlD;;;OAGG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,2BAAgC;IAWtE;;OAEG;IACH,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI;IAMpC;;;OAGG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI;IAKtC;;;OAGG;IACG,KAAK,IAAI,OAAO,CAAC,MAAM,CAAC;CAK/B;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CACxB,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,2BAAgC,mBAG1C"}
|
package/dist/src/init.browser.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { BrowserKeyStorage } from "./crypto/browser-key-storage.js";
|
|
2
|
-
import { BrowserEventEmitter } from "./event/event.browser.js";
|
|
3
|
-
import { BaseRenownBuilder } from "./renown-builder.js";
|
|
4
|
-
import { BrowserStorage } from "./storage/storage.browser.js";
|
|
5
|
-
export class BrowserRenownStorage extends BrowserStorage {
|
|
6
|
-
}
|
|
7
|
-
export class BrowserRenownEventEmitter extends BrowserEventEmitter {
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Browser-specific Renown builder with pre-configured defaults.
|
|
11
|
-
* Uses localStorage for user data and IndexedDB for key storage.
|
|
12
|
-
*/
|
|
13
|
-
export class RenownBuilder extends BaseRenownBuilder {
|
|
14
|
-
#basename;
|
|
15
|
-
#keyDbName;
|
|
16
|
-
/**
|
|
17
|
-
* @param appName - Application name used for signing context
|
|
18
|
-
* @param options - Browser-specific configuration options
|
|
19
|
-
*/
|
|
20
|
-
constructor(appName, options = {}) {
|
|
21
|
-
super(appName);
|
|
22
|
-
this.#basename = options.basename;
|
|
23
|
-
this.#keyDbName = options.keyDbName;
|
|
24
|
-
this.withStorage(new BrowserRenownStorage("renown", this.#basename));
|
|
25
|
-
this.withEventEmitter(new BrowserRenownEventEmitter());
|
|
26
|
-
if (options.baseUrl) {
|
|
27
|
-
this.withBaseUrl(options.baseUrl);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Set base path for storage keys (e.g., "/app" for multi-tenant apps).
|
|
32
|
-
*/
|
|
33
|
-
withBasename(basename) {
|
|
34
|
-
this.#basename = basename;
|
|
35
|
-
this.withStorage(new BrowserRenownStorage("renown", this.#basename));
|
|
36
|
-
return this;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Set IndexedDB database name for key storage.
|
|
40
|
-
* Defaults to "renownKeyDB".
|
|
41
|
-
*/
|
|
42
|
-
withKeyDbName(keyDbName) {
|
|
43
|
-
this.#keyDbName = keyDbName;
|
|
44
|
-
return this;
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Build and initialize the Renown instance.
|
|
48
|
-
* Initializes IndexedDB for key storage before building.
|
|
49
|
-
*/
|
|
50
|
-
async build() {
|
|
51
|
-
const keyStorage = await BrowserKeyStorage.create(this.#keyDbName);
|
|
52
|
-
this.withKeyPairStorage(keyStorage);
|
|
53
|
-
return super.build();
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* @deprecated Use RenownBuilder directly instead.
|
|
58
|
-
* Initialize a browser-specific Renown instance.
|
|
59
|
-
* @param appName - Application name used for signing context
|
|
60
|
-
* @param options - Browser-specific configuration options
|
|
61
|
-
* @returns Initialized Renown instance
|
|
62
|
-
*/
|
|
63
|
-
export function initRenown(appName, options = {}) {
|
|
64
|
-
return new RenownBuilder(appName, options).build();
|
|
65
|
-
}
|
|
66
|
-
//# sourceMappingURL=init.browser.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.browser.js","sourceRoot":"","sources":["../../src/init.browser.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAG9D,MAAM,OAAO,oBAAqB,SAAQ,cAAgC;CAAG;AAC7E,MAAM,OAAO,yBAA0B,SAAQ,mBAAiC;CAAG;AAWnF;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAClD,SAAS,CAAU;IACnB,UAAU,CAAU;IAEpB;;;OAGG;IACH,YAAY,OAAe,EAAE,UAAuC,EAAE;QACpE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,QAAQ,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;QACpC,IAAI,CAAC,WAAW,CAAC,IAAI,oBAAoB,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QACrE,IAAI,CAAC,gBAAgB,CAAC,IAAI,yBAAyB,EAAE,CAAC,CAAC;QACvD,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACpB,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,QAAgB;QAC3B,IAAI,CAAC,SAAS,GAAG,QAAQ,CAAC;QAC1B,IAAI,CAAC,WAAW,CAAC,IAAI,oBAAoB,CAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC;QACrE,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACH,aAAa,CAAC,SAAiB;QAC7B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,KAAK;QACT,MAAM,UAAU,GAAG,MAAM,iBAAiB,CAAC,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACnE,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QACpC,OAAO,KAAK,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;CACF;AAED;;;;;;GAMG;AACH,MAAM,UAAU,UAAU,CACxB,OAAe,EACf,UAAuC,EAAE;IAEzC,OAAO,IAAI,aAAa,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,EAAE,CAAC;AACrD,CAAC"}
|
package/dist/src/init.node.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { NodeEventEmitter } from "./event/event.node.js";
|
|
2
|
-
import { BaseRenownBuilder } from "./renown-builder.js";
|
|
3
|
-
import { NodeStorage } from "./storage/storage.node.js";
|
|
4
|
-
import type { RenownEvents, RenownStorageMap } from "./types.js";
|
|
5
|
-
export declare class NodeRenownEventEmitter extends NodeEventEmitter<RenownEvents> {
|
|
6
|
-
}
|
|
7
|
-
export declare class NodeRenownStorage extends NodeStorage<RenownStorageMap> {
|
|
8
|
-
}
|
|
9
|
-
export declare const DEFAULT_RENOWN_STORAGE_PATH = "./.ph/.renown.json";
|
|
10
|
-
export interface NodeRenownBuilderOptions {
|
|
11
|
-
/** File path for user storage. Defaults to ".ph/.renown.json" in cwd */
|
|
12
|
-
storagePath?: string;
|
|
13
|
-
/** File path for keypair storage. Defaults to ".ph/.keypair.json" in cwd */
|
|
14
|
-
keyPath?: string;
|
|
15
|
-
/** Renown server URL. Defaults to https://www.renown.id */
|
|
16
|
-
baseUrl?: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Node.js-specific Renown builder with pre-configured defaults.
|
|
20
|
-
* Uses file-based storage for both user data and key storage.
|
|
21
|
-
*/
|
|
22
|
-
export declare class RenownBuilder extends BaseRenownBuilder {
|
|
23
|
-
/**
|
|
24
|
-
* @param appName - Application name used for signing context
|
|
25
|
-
* @param options - Node.js-specific configuration options
|
|
26
|
-
*/
|
|
27
|
-
constructor(appName: string, options?: NodeRenownBuilderOptions);
|
|
28
|
-
}
|
|
29
|
-
//# sourceMappingURL=init.node.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.node.d.ts","sourceRoot":"","sources":["../../src/init.node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEjE,qBAAa,sBAAuB,SAAQ,gBAAgB,CAAC,YAAY,CAAC;CAAG;AAC7E,qBAAa,iBAAkB,SAAQ,WAAW,CAAC,gBAAgB,CAAC;CAAG;AAEvE,eAAO,MAAM,2BAA2B,uBAAuB,CAAC;AAEhE,MAAM,WAAW,wBAAwB;IACvC,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,4EAA4E;IAC5E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2DAA2D;IAC3D,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,qBAAa,aAAc,SAAQ,iBAAiB;IAClD;;;OAGG;gBACS,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,wBAA6B;CAgBpE"}
|
package/dist/src/init.node.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { NodeKeyStorage } from "./crypto/node-key-storage.js";
|
|
2
|
-
import { NodeEventEmitter } from "./event/event.node.js";
|
|
3
|
-
import { BaseRenownBuilder } from "./renown-builder.js";
|
|
4
|
-
import { NodeStorage } from "./storage/storage.node.js";
|
|
5
|
-
export class NodeRenownEventEmitter extends NodeEventEmitter {
|
|
6
|
-
}
|
|
7
|
-
export class NodeRenownStorage extends NodeStorage {
|
|
8
|
-
}
|
|
9
|
-
export const DEFAULT_RENOWN_STORAGE_PATH = "./.ph/.renown.json";
|
|
10
|
-
/**
|
|
11
|
-
* Node.js-specific Renown builder with pre-configured defaults.
|
|
12
|
-
* Uses file-based storage for both user data and key storage.
|
|
13
|
-
*/
|
|
14
|
-
export class RenownBuilder extends BaseRenownBuilder {
|
|
15
|
-
/**
|
|
16
|
-
* @param appName - Application name used for signing context
|
|
17
|
-
* @param options - Node.js-specific configuration options
|
|
18
|
-
*/
|
|
19
|
-
constructor(appName, options = {}) {
|
|
20
|
-
super(appName);
|
|
21
|
-
const { storagePath = DEFAULT_RENOWN_STORAGE_PATH, keyPath, baseUrl, } = options;
|
|
22
|
-
this.withKeyPairStorage(new NodeKeyStorage(keyPath));
|
|
23
|
-
this.withStorage(new NodeRenownStorage(storagePath));
|
|
24
|
-
this.withEventEmitter(new NodeRenownEventEmitter());
|
|
25
|
-
if (baseUrl) {
|
|
26
|
-
this.withBaseUrl(baseUrl);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=init.node.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.node.js","sourceRoot":"","sources":["../../src/init.node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,MAAM,OAAO,sBAAuB,SAAQ,gBAA8B;CAAG;AAC7E,MAAM,OAAO,iBAAkB,SAAQ,WAA6B;CAAG;AAEvE,MAAM,CAAC,MAAM,2BAA2B,GAAG,oBAAoB,CAAC;AAWhE;;;GAGG;AACH,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAClD;;;OAGG;IACH,YAAY,OAAe,EAAE,UAAoC,EAAE;QACjE,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,MAAM,EACJ,WAAW,GAAG,2BAA2B,EACzC,OAAO,EACP,OAAO,GACR,GAAG,OAAO,CAAC;QAEZ,IAAI,CAAC,kBAAkB,CAAC,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,WAAW,CAAC,IAAI,iBAAiB,CAAC,WAAW,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,gBAAgB,CAAC,IAAI,sBAAsB,EAAE,CAAC,CAAC;QACpD,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;CACF"}
|
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
export declare const RENOWN_URL = "https://www.renown.id";
|
|
2
|
-
export declare const RENOWN_NETWORK_ID = "eip155";
|
|
3
|
-
export declare const RENOWN_CHAIN_ID = "1";
|
|
4
|
-
export declare const DOMAIN_TYPE: readonly [{
|
|
5
|
-
readonly name: "name";
|
|
6
|
-
readonly type: "string";
|
|
7
|
-
}, {
|
|
8
|
-
readonly name: "version";
|
|
9
|
-
readonly type: "string";
|
|
10
|
-
}, {
|
|
11
|
-
readonly name: "chainId";
|
|
12
|
-
readonly type: "uint256";
|
|
13
|
-
}, {
|
|
14
|
-
readonly name: "verifyingContract";
|
|
15
|
-
readonly type: "address";
|
|
16
|
-
}];
|
|
17
|
-
export declare const VERIFIABLE_CREDENTIAL_EIP712_TYPE: readonly [{
|
|
18
|
-
readonly name: "@context";
|
|
19
|
-
readonly type: "string[]";
|
|
20
|
-
}, {
|
|
21
|
-
readonly name: "type";
|
|
22
|
-
readonly type: "string[]";
|
|
23
|
-
}, {
|
|
24
|
-
readonly name: "id";
|
|
25
|
-
readonly type: "string";
|
|
26
|
-
}, {
|
|
27
|
-
readonly name: "issuer";
|
|
28
|
-
readonly type: "Issuer";
|
|
29
|
-
}, {
|
|
30
|
-
readonly name: "credentialSubject";
|
|
31
|
-
readonly type: "CredentialSubject";
|
|
32
|
-
}, {
|
|
33
|
-
readonly name: "credentialSchema";
|
|
34
|
-
readonly type: "CredentialSchema";
|
|
35
|
-
}, {
|
|
36
|
-
readonly name: "issuanceDate";
|
|
37
|
-
readonly type: "string";
|
|
38
|
-
}, {
|
|
39
|
-
readonly name: "expirationDate";
|
|
40
|
-
readonly type: "string";
|
|
41
|
-
}];
|
|
42
|
-
export declare const CREDENTIAL_SCHEMA_EIP712_TYPE: readonly [{
|
|
43
|
-
readonly name: "id";
|
|
44
|
-
readonly type: "string";
|
|
45
|
-
}, {
|
|
46
|
-
readonly name: "type";
|
|
47
|
-
readonly type: "string";
|
|
48
|
-
}];
|
|
49
|
-
export declare const CREDENTIAL_SUBJECT_TYPE: readonly [{
|
|
50
|
-
readonly name: "app";
|
|
51
|
-
readonly type: "string";
|
|
52
|
-
}, {
|
|
53
|
-
readonly name: "id";
|
|
54
|
-
readonly type: "string";
|
|
55
|
-
}, {
|
|
56
|
-
readonly name: "name";
|
|
57
|
-
readonly type: "string";
|
|
58
|
-
}];
|
|
59
|
-
export declare const ISSUER_TYPE: readonly [{
|
|
60
|
-
readonly name: "id";
|
|
61
|
-
readonly type: "string";
|
|
62
|
-
}, {
|
|
63
|
-
readonly name: "ethereumAddress";
|
|
64
|
-
readonly type: "string";
|
|
65
|
-
}];
|
|
66
|
-
export declare const CREDENTIAL_TYPES: {
|
|
67
|
-
readonly EIP712Domain: readonly [{
|
|
68
|
-
readonly name: "name";
|
|
69
|
-
readonly type: "string";
|
|
70
|
-
}, {
|
|
71
|
-
readonly name: "version";
|
|
72
|
-
readonly type: "string";
|
|
73
|
-
}, {
|
|
74
|
-
readonly name: "chainId";
|
|
75
|
-
readonly type: "uint256";
|
|
76
|
-
}, {
|
|
77
|
-
readonly name: "verifyingContract";
|
|
78
|
-
readonly type: "address";
|
|
79
|
-
}];
|
|
80
|
-
readonly VerifiableCredential: readonly [{
|
|
81
|
-
readonly name: "@context";
|
|
82
|
-
readonly type: "string[]";
|
|
83
|
-
}, {
|
|
84
|
-
readonly name: "type";
|
|
85
|
-
readonly type: "string[]";
|
|
86
|
-
}, {
|
|
87
|
-
readonly name: "id";
|
|
88
|
-
readonly type: "string";
|
|
89
|
-
}, {
|
|
90
|
-
readonly name: "issuer";
|
|
91
|
-
readonly type: "Issuer";
|
|
92
|
-
}, {
|
|
93
|
-
readonly name: "credentialSubject";
|
|
94
|
-
readonly type: "CredentialSubject";
|
|
95
|
-
}, {
|
|
96
|
-
readonly name: "credentialSchema";
|
|
97
|
-
readonly type: "CredentialSchema";
|
|
98
|
-
}, {
|
|
99
|
-
readonly name: "issuanceDate";
|
|
100
|
-
readonly type: "string";
|
|
101
|
-
}, {
|
|
102
|
-
readonly name: "expirationDate";
|
|
103
|
-
readonly type: "string";
|
|
104
|
-
}];
|
|
105
|
-
readonly CredentialSchema: readonly [{
|
|
106
|
-
readonly name: "id";
|
|
107
|
-
readonly type: "string";
|
|
108
|
-
}, {
|
|
109
|
-
readonly name: "type";
|
|
110
|
-
readonly type: "string";
|
|
111
|
-
}];
|
|
112
|
-
readonly CredentialSubject: readonly [{
|
|
113
|
-
readonly name: "app";
|
|
114
|
-
readonly type: "string";
|
|
115
|
-
}, {
|
|
116
|
-
readonly name: "id";
|
|
117
|
-
readonly type: "string";
|
|
118
|
-
}, {
|
|
119
|
-
readonly name: "name";
|
|
120
|
-
readonly type: "string";
|
|
121
|
-
}];
|
|
122
|
-
readonly Issuer: readonly [{
|
|
123
|
-
readonly name: "id";
|
|
124
|
-
readonly type: "string";
|
|
125
|
-
}, {
|
|
126
|
-
readonly name: "ethereumAddress";
|
|
127
|
-
readonly type: "string";
|
|
128
|
-
}];
|
|
129
|
-
};
|
|
130
|
-
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/lib/renown/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,0BAA0B,CAAC;AAClD,eAAO,MAAM,iBAAiB,WAAW,CAAC;AAC1C,eAAO,MAAM,eAAe,MAAM,CAAC;AAEnC,eAAO,MAAM,WAAW;;;;;;;;;;;;EAKd,CAAC;AAEX,eAAO,MAAM,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;EASpC,CAAC;AAEX,eAAO,MAAM,6BAA6B;;;;;;EAGhC,CAAC;AAEX,eAAO,MAAM,uBAAuB;;;;;;;;;EAI1B,CAAC;AAEX,eAAO,MAAM,WAAW;;;;;;EAGd,CAAC;AAEX,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAMnB,CAAC"}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
export const RENOWN_URL = "https://www.renown.id";
|
|
2
|
-
export const RENOWN_NETWORK_ID = "eip155";
|
|
3
|
-
export const RENOWN_CHAIN_ID = "1";
|
|
4
|
-
export const DOMAIN_TYPE = [
|
|
5
|
-
{ name: "name", type: "string" },
|
|
6
|
-
{ name: "version", type: "string" },
|
|
7
|
-
{ name: "chainId", type: "uint256" },
|
|
8
|
-
{ name: "verifyingContract", type: "address" },
|
|
9
|
-
];
|
|
10
|
-
export const VERIFIABLE_CREDENTIAL_EIP712_TYPE = [
|
|
11
|
-
{ name: "@context", type: "string[]" },
|
|
12
|
-
{ name: "type", type: "string[]" },
|
|
13
|
-
{ name: "id", type: "string" },
|
|
14
|
-
{ name: "issuer", type: "Issuer" },
|
|
15
|
-
{ name: "credentialSubject", type: "CredentialSubject" },
|
|
16
|
-
{ name: "credentialSchema", type: "CredentialSchema" },
|
|
17
|
-
{ name: "issuanceDate", type: "string" },
|
|
18
|
-
{ name: "expirationDate", type: "string" },
|
|
19
|
-
];
|
|
20
|
-
export const CREDENTIAL_SCHEMA_EIP712_TYPE = [
|
|
21
|
-
{ name: "id", type: "string" },
|
|
22
|
-
{ name: "type", type: "string" },
|
|
23
|
-
];
|
|
24
|
-
export const CREDENTIAL_SUBJECT_TYPE = [
|
|
25
|
-
{ name: "app", type: "string" },
|
|
26
|
-
{ name: "id", type: "string" },
|
|
27
|
-
{ name: "name", type: "string" },
|
|
28
|
-
];
|
|
29
|
-
export const ISSUER_TYPE = [
|
|
30
|
-
{ name: "id", type: "string" },
|
|
31
|
-
{ name: "ethereumAddress", type: "string" },
|
|
32
|
-
];
|
|
33
|
-
export const CREDENTIAL_TYPES = {
|
|
34
|
-
EIP712Domain: DOMAIN_TYPE,
|
|
35
|
-
VerifiableCredential: VERIFIABLE_CREDENTIAL_EIP712_TYPE,
|
|
36
|
-
CredentialSchema: CREDENTIAL_SCHEMA_EIP712_TYPE,
|
|
37
|
-
CredentialSubject: CREDENTIAL_SUBJECT_TYPE,
|
|
38
|
-
Issuer: ISSUER_TYPE,
|
|
39
|
-
};
|
|
40
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/lib/renown/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,uBAAuB,CAAC;AAClD,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAC1C,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AAEnC,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;IAChC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE;IACnC,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;IACpC,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,SAAS,EAAE;CACtC,CAAC;AAEX,MAAM,CAAC,MAAM,iCAAiC,GAAG;IAC/C,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,UAAU,EAAE;IACtC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,EAAE;IAClC,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC9B,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE;IAClC,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,mBAAmB,EAAE;IACxD,EAAE,IAAI,EAAE,kBAAkB,EAAE,IAAI,EAAE,kBAAkB,EAAE;IACtD,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,QAAQ,EAAE;IACxC,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,QAAQ,EAAE;CAClC,CAAC;AAEX,MAAM,CAAC,MAAM,6BAA6B,GAAG;IAC3C,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC9B,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;CACxB,CAAC;AAEX,MAAM,CAAC,MAAM,uBAAuB,GAAG;IACrC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC/B,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC9B,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE;CACxB,CAAC;AAEX,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;IAC9B,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,EAAE;CACnC,CAAC;AAEX,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,YAAY,EAAE,WAAW;IACzB,oBAAoB,EAAE,iCAAiC;IACvD,gBAAgB,EAAE,6BAA6B;IAC/C,iBAAiB,EAAE,uBAAuB;IAC1C,MAAM,EAAE,WAAW;CACX,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"credential.d.ts","sourceRoot":"","sources":["../../../../src/lib/renown/credential.ts"],"names":[],"mappings":""}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
// import { v4 as uuidv4 } from "uuid";
|
|
2
|
-
// import type { WalletClient } from "viem";
|
|
3
|
-
// import { CREDENTIAL_TYPES } from "./constants.js";
|
|
4
|
-
export {};
|
|
5
|
-
// export interface CreateEIP712CredentialParams {
|
|
6
|
-
// walletClient: WalletClient;
|
|
7
|
-
// chainId: number;
|
|
8
|
-
// app: string;
|
|
9
|
-
// connectId?: string;
|
|
10
|
-
// expiresInDays?: number;
|
|
11
|
-
// }
|
|
12
|
-
// /**
|
|
13
|
-
// * Create and sign an EIP-712 Verifiable Credential
|
|
14
|
-
// */
|
|
15
|
-
// export async function createEIP712Credential(
|
|
16
|
-
// params: CreateEIP712CredentialParams,
|
|
17
|
-
// ) {
|
|
18
|
-
// const { walletClient, chainId, app, connectId, expiresInDays = 7 } = params;
|
|
19
|
-
// if (!walletClient.account?.address) {
|
|
20
|
-
// throw new Error("Wallet not connected");
|
|
21
|
-
// }
|
|
22
|
-
// const address = walletClient.account.address;
|
|
23
|
-
// const issuerId = `did:pkh:eip155:${chainId}:${address.toLowerCase()}`;
|
|
24
|
-
// const credentialId = `urn:uuid:${uuidv4()}`;
|
|
25
|
-
// const now = new Date();
|
|
26
|
-
// const expirationDate = new Date(
|
|
27
|
-
// now.getTime() + expiresInDays * 24 * 60 * 60 * 1000,
|
|
28
|
-
// );
|
|
29
|
-
// // Build the credential
|
|
30
|
-
// const credential = {
|
|
31
|
-
// "@context": ["https://www.w3.org/2018/credentials/v1"],
|
|
32
|
-
// type: ["VerifiableCredential", "RenownCredential"],
|
|
33
|
-
// id: credentialId,
|
|
34
|
-
// issuer: {
|
|
35
|
-
// id: issuerId,
|
|
36
|
-
// ethereumAddress: address,
|
|
37
|
-
// },
|
|
38
|
-
// credentialSubject: {
|
|
39
|
-
// id: connectId || issuerId,
|
|
40
|
-
// app,
|
|
41
|
-
// },
|
|
42
|
-
// credentialSchema: {
|
|
43
|
-
// id: "https://renown.id/schemas/renown-credential/v1",
|
|
44
|
-
// type: "JsonSchemaValidator2018",
|
|
45
|
-
// },
|
|
46
|
-
// issuanceDate: now.toISOString(),
|
|
47
|
-
// expirationDate: expirationDate.toISOString(),
|
|
48
|
-
// };
|
|
49
|
-
// // EIP-712 domain
|
|
50
|
-
// const domain = {
|
|
51
|
-
// version: "1",
|
|
52
|
-
// chainId: BigInt(chainId),
|
|
53
|
-
// };
|
|
54
|
-
// // Sign with EIP-712
|
|
55
|
-
// const signature = await walletClient.signTypedData({
|
|
56
|
-
// account: walletClient.account,
|
|
57
|
-
// domain,
|
|
58
|
-
// types: CREDENTIAL_TYPES,
|
|
59
|
-
// primaryType: "VerifiableCredential",
|
|
60
|
-
// message: credential,
|
|
61
|
-
// });
|
|
62
|
-
// return {
|
|
63
|
-
// credential,
|
|
64
|
-
// signature,
|
|
65
|
-
// domain,
|
|
66
|
-
// };
|
|
67
|
-
// }
|
|
68
|
-
//# sourceMappingURL=credential.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"credential.js","sourceRoot":"","sources":["../../../../src/lib/renown/credential.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,4CAA4C;AAC5C,qDAAqD;;AAErD,kDAAkD;AAClD,gCAAgC;AAChC,qBAAqB;AACrB,iBAAiB;AACjB,wBAAwB;AACxB,4BAA4B;AAC5B,IAAI;AAEJ,MAAM;AACN,sDAAsD;AACtD,MAAM;AACN,gDAAgD;AAChD,0CAA0C;AAC1C,MAAM;AACN,iFAAiF;AAEjF,0CAA0C;AAC1C,+CAA+C;AAC/C,MAAM;AAEN,kDAAkD;AAClD,2EAA2E;AAC3E,iDAAiD;AACjD,4BAA4B;AAC5B,qCAAqC;AACrC,2DAA2D;AAC3D,OAAO;AAEP,4BAA4B;AAC5B,yBAAyB;AACzB,8DAA8D;AAC9D,0DAA0D;AAC1D,wBAAwB;AACxB,gBAAgB;AAChB,sBAAsB;AACtB,kCAAkC;AAClC,SAAS;AACT,2BAA2B;AAC3B,mCAAmC;AACnC,aAAa;AACb,SAAS;AACT,0BAA0B;AAC1B,8DAA8D;AAC9D,yCAAyC;AACzC,SAAS;AACT,uCAAuC;AACvC,oDAAoD;AACpD,OAAO;AAEP,sBAAsB;AACtB,qBAAqB;AACrB,oBAAoB;AACpB,gCAAgC;AAChC,OAAO;AAEP,yBAAyB;AACzB,yDAAyD;AACzD,qCAAqC;AACrC,cAAc;AACd,+BAA+B;AAC/B,2CAA2C;AAC3C,2BAA2B;AAC3B,QAAQ;AAER,aAAa;AACb,kBAAkB;AAClB,iBAAiB;AACjB,cAAc;AACd,OAAO;AACP,IAAI"}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* DID parsing utilities for extracting information from DID strings
|
|
3
|
-
*/
|
|
4
|
-
export type PKHDid = {
|
|
5
|
-
networkId: string;
|
|
6
|
-
chainId: number;
|
|
7
|
-
address: `0x${string}`;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Parse a DID:pkh string to extract network, chain ID, and address information
|
|
11
|
-
* @param did - The DID string in format "did:pkh:networkId:chainId:address"
|
|
12
|
-
* @returns Parsed DID information
|
|
13
|
-
* @throws Error if the DID format is invalid
|
|
14
|
-
*/
|
|
15
|
-
export declare function parsePkhDid(did: string): PKHDid;
|
|
16
|
-
/**
|
|
17
|
-
* Extract Ethereum address from a DID:pkh string
|
|
18
|
-
* @param did - The DID string
|
|
19
|
-
* @returns Ethereum address or null if invalid
|
|
20
|
-
*/
|
|
21
|
-
export declare function extractEthAddressFromDid(did: string): `0x${string}` | null;
|
|
22
|
-
/**
|
|
23
|
-
* Extract chain ID from a DID:pkh string
|
|
24
|
-
* @param did - The DID string
|
|
25
|
-
* @returns Chain ID or null if invalid
|
|
26
|
-
*/
|
|
27
|
-
export declare function extractChainIdFromDid(did: string): number | null;
|
|
28
|
-
//# sourceMappingURL=did-parser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"did-parser.d.ts","sourceRoot":"","sources":["../../../../src/lib/renown/did-parser.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,MAAM,MAAM,GAAG;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;CACxB,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAqB/C;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,GAAG,IAAI,CAO1E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAOhE"}
|