@owlmeans/did 0.1.18-rc.8 → 0.1.18

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.
Files changed (58) hide show
  1. package/README.md +2 -2
  2. package/agent-meta/manifest.json +3 -3
  3. package/agent-meta/skills/did/SKILL.md +113 -16
  4. package/build/consts.local.d.ts +2 -0
  5. package/build/consts.local.d.ts.map +1 -0
  6. package/build/consts.local.js +2 -0
  7. package/build/consts.local.js.map +1 -0
  8. package/build/i18n/fr.json +8 -0
  9. package/build/i18n/wallet-fr.json +99 -0
  10. package/build/i18n.js +19 -15
  11. package/build/i18n.js.map +1 -1
  12. package/build/model.d.ts.map +1 -1
  13. package/build/model.js +4 -4
  14. package/build/model.js.map +1 -1
  15. package/build/plugins/ed25519owl.js +5 -5
  16. package/build/plugins/ed25519owl.js.map +1 -1
  17. package/build/utils/index.d.ts +2 -0
  18. package/build/utils/index.d.ts.map +1 -1
  19. package/build/utils/index.js.map +1 -1
  20. package/build/utils/key.d.ts.map +1 -1
  21. package/build/utils/key.js +2 -2
  22. package/build/utils/key.js.map +1 -1
  23. package/build/utils/mnemonic/types.d.ts +13 -0
  24. package/build/utils/mnemonic/types.d.ts.map +1 -0
  25. package/build/utils/mnemonic/types.js +2 -0
  26. package/build/utils/mnemonic/types.js.map +1 -0
  27. package/build/utils/mnemonic.d.ts +3 -5
  28. package/build/utils/mnemonic.d.ts.map +1 -1
  29. package/build/utils/mnemonic.js +15 -11
  30. package/build/utils/mnemonic.js.map +1 -1
  31. package/build/utils/types.d.ts +11 -0
  32. package/build/utils/types.d.ts.map +1 -0
  33. package/build/utils/types.js +2 -0
  34. package/build/utils/types.js.map +1 -0
  35. package/build/utils.d.ts +3 -4
  36. package/build/utils.d.ts.map +1 -1
  37. package/build/utils.js +25 -21
  38. package/build/utils.js.map +1 -1
  39. package/build/wallet.d.ts.map +1 -1
  40. package/build/wallet.js +15 -15
  41. package/build/wallet.js.map +1 -1
  42. package/package.json +12 -11
  43. package/src/consts.local.ts +1 -0
  44. package/src/i18n/fr.json +8 -0
  45. package/src/i18n/wallet-fr.json +99 -0
  46. package/src/i18n.ts +20 -15
  47. package/src/model.ts +4 -4
  48. package/src/plugins/ed25519owl.ts +5 -5
  49. package/src/utils/index.ts +2 -0
  50. package/src/utils/key.ts +3 -3
  51. package/src/utils/mnemonic/types.ts +13 -0
  52. package/src/utils/mnemonic.ts +21 -14
  53. package/src/utils/types.ts +11 -0
  54. package/src/utils.ts +32 -26
  55. package/src/wallet.ts +19 -18
  56. package/tests/mnemonic.spec.ts +31 -0
  57. package/tsconfig.json +1 -1
  58. package/build/.gitkeep +0 -0
package/README.md CHANGED
@@ -12,7 +12,7 @@ Hierarchical deterministic (HD) wallet and DID document management for OwlMeans
12
12
  ## Installation
13
13
 
14
14
  ```bash
15
- bun add @owlmeans/did
15
+ bun add @owlmeans/did@^0.1.18
16
16
  ```
17
17
 
18
18
  ## Usage
@@ -65,7 +65,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
65
65
  your project's skill store (`.agents/skills/`):
66
66
 
67
67
  ```sh
68
- npx @owlmeans/agent-skills
68
+ npx @owlmeans/agent-skills@^0.1.18
69
69
  ```
70
70
 
71
71
  The embedded files are version-matched to this package release. Do not edit them
@@ -1,8 +1,8 @@
1
1
  {
2
- "schemaVersion": 2,
2
+ "schemaVersion": 3,
3
3
  "package": "@owlmeans/did",
4
- "version": "0.1.18-rc.7",
5
- "generatedAt": "2026-08-24T21:14:00.144Z",
4
+ "version": "0.1.18",
5
+ "generatedAt": "2026-10-28T00:31:34.773Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: did
3
- description: How to use @owlmeans/did — Decentralized Identifier (DID) management with wallet, key models, and DID method plugins. Auto-invoked when importing DID/wallet types or implementing identity workflows.
3
+ description: How to use @owlmeans/did — the owlmk derivable key type, makeDidKeyModel and its derive() paths, and makeWallet over a three-resource DID store with mnemonic seed, key metadata and per-entity key provisioning. Auto-invoked when importing DID or wallet types, deriving keys, or implementing identity workflows.
4
4
  user-invocable: false
5
5
  ---
6
6
  <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
@@ -8,31 +8,128 @@ user-invocable: false
8
8
  # @owlmeans/did
9
9
 
10
10
  **Layer:** Core
11
- **Install:** `"@owlmeans/did": "^0.1.18-rc.7"` in `dependencies`
11
+ **Install:** `"@owlmeans/did": "^0.1.18"` in `dependencies`
12
+
13
+ This package adds a **derivable** key type on top of `@owlmeans/basic-keys` and a wallet that stores
14
+ keys derived from one mnemonic seed. Importing it registers the `owlmk` key type into the shared
15
+ key-plugin registry, so `KEY_OWL` becomes a valid type anywhere a key type is accepted — that side
16
+ effect is the reason a package that only needs the type still imports this one.
12
17
 
13
18
  ## Key Exports
14
19
 
15
20
  | Export | Description |
16
21
  |--------|-------------|
17
- | Wallet model | Create/load wallets and derive keys |
18
- | DID model | DID document, key references, services |
19
- | DID errors | Typed errors for DID operations |
20
- | Plugins | Per-method DID plugin registry |
21
- | Constants | Default method names, key types |
22
- | i18n | Translatable error messages |
22
+ | `makeDidKeyModel(input?)` | A `KeyPairModel` that also derives children — same input rules as `makeKeyPairModel` |
23
+ | `DIDKeyModel` | `KeyPairModel` + `derive(path)`; its `keyPair` also carries `path` and `parent` (read the caveat below) |
24
+ | `DIDKeyPair` | `KeyPair` + `{ path?, parent? }` |
25
+ | `makeWallet(store, opts?)` | Open (or initialize) a wallet over a `DIDStore` |
26
+ | `DIDWallet` | `generate` / `mnemonic` / `master` / `add` / `meta` / `update` / `get` / `find` / `provide` (→ `DIDKeyModel[]`) / `remove` / `all` / `allMeta` |
27
+ | `DIDStore` | `{ master, keys, meta }` — three resources the host supplies |
28
+ | `KeyMeta` | What a key is for: `{ id, name, entityId?, ...Profile }` |
29
+ | `KeySeedRecord`, `KeyPairRecord`, `KeyMetaRecord` | The record shapes those resources hold |
30
+ | `MakeDIDWalletOptions`, `MnemonicOptions` | `{ force, allowEmpty, mnemonic, type, allowCustomType }`; `{ size }` |
31
+ | `WalletFacade`, `WalletKey`, `WalletOptions`, `NewKeyOptions`, `RequestReason` | The contract a wallet UI or a remote wallet exposes to an app |
32
+ | `plugins` | The shared `@owlmeans/basic-keys` registry, with `owlmk` added — the only plugin symbol this package exports |
33
+ | `DIDError`, `DIDKeyError`, `DIDWalletError`, `DIDWalletPermissionError`, `DIDInitializationError` | Registered `ResilientError` subclasses |
34
+ | `KEY_OWL` (`'owlmk'`), `MASTER`, `KP_SEP` (`'/'`), `MAX_DEPTH` (6) | Key type, master record id, path separator and depth cap |
35
+ | `SERVICE_PREFIX`, `ENTITY_PREFIX`, `PROFILE_PREFIX`, `PREFIX_SEP` | The segments a metadata-derived path is composed from |
36
+
37
+ ## Deriving keys
38
+
39
+ A DID here is what `exportAddress()` returns — `"<type>:<address>"` — and it is the id every stored
40
+ key and every metadata record is keyed by.
41
+
42
+ ```typescript
43
+ import { makeDidKeyModel, KEY_OWL } from '@owlmeans/did'
44
+
45
+ const master = makeDidKeyModel(KEY_OWL) // fresh derivable key
46
+ const child = master.derive('entity.acme/profile.42')
47
+ child.keyPair!.parent // the intermediate key's DID, not the master's
48
+ ```
49
+
50
+ `derive` splits on `/` and derives once per segment, so a multi-segment path is exactly repeated
51
+ single-step derivation. It throws `DIDKeyError` on a path deeper than `MAX_DEPTH`
52
+ (`did:wallet:too:deep`), on an empty path (`did:wallet:no:path`), and on a model with no private key
53
+ (`did:wallet:no:pk`).
54
+
55
+ **`path` and `parent` describe one step, not the whole chain.** Because the recursion re-derives per
56
+ segment, the model that comes back from `derive('entity.acme/profile.42')` carries
57
+ `keyPair.path === 'profile.42'` and a `keyPair.parent` that is the intermediate `entity.acme` key's
58
+ DID — not the master's. The full path lives only on the intermediate model that was thrown away.
59
+ Store the string you passed to `derive` if you need to re-derive later; `keyPair.path` will not
60
+ rebuild it.
61
+
62
+ A key type that cannot derive (plain `ed25519`, `xchacha`) is rejected **only when the model is
63
+ built from the bare type string** — `makeDidKeyModel('ed25519')` throws `DIDKeyError`
64
+ `did:wallet:non-derivable:ed25519`. Built from a `KeyPair` object — which is what the wallet does
65
+ for every record it loads — or with no argument at all, nothing checks, and `derive()` fails later
66
+ with a raw `TypeError: plugins[...].derive is not a function`. Guard the type yourself before
67
+ deriving from a stored key pair.
23
68
 
24
- ## Usage
69
+ ## The wallet
70
+
71
+ `makeWallet` needs a `DIDStore`: three resources — `master` for the seed record, `keys` for the key
72
+ pairs, `meta` for what each key is for. Any `@owlmeans/resource` implementation will do, and the
73
+ choice of store is what decides whether the wallet lives in memory, in a browser, or on a server.
25
74
 
26
75
  ```typescript
27
- import { Wallet, DidDocument } from '@owlmeans/did'
76
+ import { makeWallet } from '@owlmeans/did'
28
77
 
29
- const wallet = Wallet.create({ seed: '...' })
30
- const did = await wallet.createDid({ method: 'key' })
78
+ const wallet = await makeWallet(store, { force: true }) // force ⇒ generate a fresh seed
79
+ const master = await wallet.master()
80
+ const [key] = await wallet.provide({ name: 'signing', entityId })
31
81
  ```
32
82
 
83
+ Opening a store with no master record throws `DIDInitializationError` unless `force` (generate one
84
+ now) or `allowEmpty` (open it anyway) is passed. `{ type, allowCustomType: true }` is the only
85
+ public way to add another derivable key type: `makeWallet` builds a plugin for the named type and
86
+ puts it in the shared registry.
87
+
88
+ ### Seed and mnemonic
89
+
90
+ `generate()` derives the seed from a fresh mnemonic. `{ mnemonic: { size } }` must be between 12 and
91
+ 24 and defaults to **18**, but it is not a word count — it is mapped to BIP-39 entropy and rounded
92
+ up to the next whole 32-bit block, so 12 gives a 15-word phrase, 18 gives 21, and 21–23 all give 24.
93
+ **`size: 24` throws `TypeError: Invalid entropy`**, because the mapping overshoots the 256-bit
94
+ maximum. Stay at 23 or below.
95
+
96
+ `mnemonic()` does not recover the phrase of a wallet this package generated. `generate()` stores the
97
+ seed base64-encoded while `mnemonic()` hex-decodes what it reads, so the call throws in the decoder.
98
+ It returns `false` (or throws `DIDWalletError` when called as `mnemonic(true)`) only for a master
99
+ record that carries no seed at all. Do not build a recovery-phrase flow on it.
100
+
101
+ ### Providing keys
102
+
103
+ `provide(meta)` is the call an application actually makes: it looks for keys matching the metadata
104
+ and, finding none, derives one from the master at a path composed from that metadata — the service
105
+ scope, then the organization entity, then the profile — stores it with its metadata, and returns
106
+ **an array** (`DIDKeyModel[]`, one element for a freshly derived key). Destructure it;
107
+ `meta.name` is required and its absence throws `DIDKeyError` `did:wallet:no:name`.
108
+
109
+ Idempotence holds **only while the metadata carries no `id`.** The stored metadata record is always
110
+ keyed by the key's own DID, so a `meta.id` you pass in is discarded on save and the next
111
+ `find(meta)` — which matches `id` against the stored value — cannot find the key it just wrote. The
112
+ second `provide` re-derives the same key and `add` rejects it with `DIDWalletError`
113
+ `did:wallet:key:exists`. Identify a key by its scope fields (`entityId`, `scopes`) rather than by a
114
+ profile id, or catch that error.
115
+
116
+ Repeat the `name` verbatim as well: it takes part in the lookup (see below), so `provide` with a
117
+ changed name for the same scope finds nothing, re-derives the same key and fails with that same
118
+ `did:wallet:key:exists`.
119
+
120
+ `find(meta)` filters twice and likewise returns an array. Every **non-boolean** field of `meta` —
121
+ `name` among them — goes into the query it puts to the metadata resource, and each record that comes
122
+ back is re-checked in memory, where `name` is the one field skipped, a boolean is compared (those
123
+ never reach the query), and an array value must be contained in the stored array. So a `name` that
124
+ differs from the stored one still excludes the key at the store: this is not a name-insensitive
125
+ lookup. `get(did)` and `remove(did)` work by DID, and `add`/`update` take a model plus its metadata.
126
+ `add` refuses a key it cannot manage (no private key) and a DID already present.
127
+
33
128
  ## Depends On
34
129
 
35
- - `@owlmeans/basic-keys` — keypair generation
36
- - `@owlmeans/basic-envelope` — message wrapping
37
- - `@owlmeans/error` — DID error base class
38
- - `@owlmeans/i18n` — translatable errors
130
+ - `@owlmeans/basic-keys` — the key model, the plugin registry and the `utils` this extends
131
+ - `@owlmeans/resource` — the three stores a `DIDStore` is made of
132
+ - `@owlmeans/auth` — `Profile`, which `KeyMeta` extends
133
+ - `@owlmeans/error` — the base class the DID errors extend
134
+ - `@owlmeans/i18n` — importing this package registers the `keys` and `wallet` libraries under the `did` namespace
135
+ - `@scure/bip39` (mnemonic), `@scure/base`, `@noble/curves`, `@noble/hashes`
@@ -0,0 +1,2 @@
1
+ export declare const skipFields: string[];
2
+ //# sourceMappingURL=consts.local.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.d.ts","sourceRoot":"","sources":["../src/consts.local.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,UAAW,CAAA"}
@@ -0,0 +1,2 @@
1
+ export const skipFields = ['name'];
2
+ //# sourceMappingURL=consts.local.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consts.local.js","sourceRoot":"","sources":["../src/consts.local.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,MAAM,CAAC,CAAA"}
@@ -0,0 +1,8 @@
1
+ {
2
+ "address": {
3
+ "hint": "Adresse DID"
4
+ },
5
+ "master": {
6
+ "title": "Clé principale"
7
+ }
8
+ }
@@ -0,0 +1,99 @@
1
+ {
2
+ "createKey": {
3
+ "title": "Créer une clé",
4
+ "description": "Une organisation ou un service vous demande de créer une nouvelle clé cryptographique",
5
+ "unknown-reason": "Soyez prudent : nous ne savons pas pourquoi la création de cette clé vous est demandée.",
6
+ "proceed": {
7
+ "label": "Confirmer"
8
+ },
9
+ "cancel": {
10
+ "label": "Annuler"
11
+ }
12
+ },
13
+ "getEntityKey": {
14
+ "title": "Obtenir la clé publique d’une organisation",
15
+ "description": "Un service vous demande de fournir une clé publique et des données associées pour un profil d’organisation",
16
+ "unknown-reason": "Soyez prudent : nous ne savons pas pourquoi cette clé vous est demandée.",
17
+ "proceed": {
18
+ "label": "Confirmer"
19
+ },
20
+ "cancel": {
21
+ "label": "Annuler"
22
+ }
23
+ },
24
+ "sign": {
25
+ "title": "Signer avec la clé",
26
+ "description": "Un service vous demande de signer un document avec votre clé",
27
+ "unknown-reason": "Soyez prudent : nous ne savons pas pourquoi cette signature vous est demandée.",
28
+ "proceed": {
29
+ "label": "Confirmer"
30
+ },
31
+ "cancel": {
32
+ "label": "Annuler"
33
+ }
34
+ },
35
+ "masterSign": {
36
+ "title": "Signer avec la clé principale",
37
+ "description": "Un service vous demande de signer un document avec votre clé principale, qui devrait vraisemblablement être utilisée seulement avec les services OwlMeans",
38
+ "unknown-reason": "Soyez prudent : nous ne savons pas pourquoi cette signature vous est demandée.",
39
+ "proceed": {
40
+ "label": "Confirmer"
41
+ },
42
+ "cancel": {
43
+ "label": "Annuler"
44
+ }
45
+ },
46
+ "getMasterDid": {
47
+ "title": "Obtenir votre DID principal",
48
+ "description": "Un service vous demande votre adresse décentralisée principale, qui devrait vraisemblablement être partagée seulement avec les services OwlMeans",
49
+ "unknown-reason": "Soyez prudent : nous ne savons pas pourquoi le partage de votre DID principal vous est demandé.",
50
+ "proceed": {
51
+ "label": "Confirmer"
52
+ },
53
+ "cancel": {
54
+ "label": "Annuler"
55
+ }
56
+ },
57
+ "selectKey": {
58
+ "title": "Choisir une clé",
59
+ "description": "Un service vous demande de choisir une clé pour obtenir ses informations publiques",
60
+ "unknown-reason": "Soyez prudent : nous ne savons pas pourquoi les informations publiques d’une de vos clés vous sont demandées.",
61
+ "proceed": {
62
+ "label": "Confirmer"
63
+ },
64
+ "cancel": {
65
+ "label": "Annuler"
66
+ }
67
+ },
68
+ "getPublicDetails": {
69
+ "title": "Obtenir la clé publique",
70
+ "description": "Un service vous demande une clé publique liée au profil de votre organisation",
71
+ "unknown-reason": "Soyez prudent : nous ne savons pas pourquoi le partage de votre clé publique vous est demandé.",
72
+ "proceed": {
73
+ "label": "Confirmer"
74
+ },
75
+ "cancel": {
76
+ "label": "Annuler"
77
+ }
78
+ },
79
+ "requestPermissions": {
80
+ "title": "Autorisations demandées",
81
+ "description": "Un service demande à effectuer une suite d’actions avec votre portefeuille",
82
+ "unknown-reason": "Soyez prudent : nous ne savons pas pourquoi ces actions vous sont demandées.",
83
+ "proceed": {
84
+ "label": "Confirmer"
85
+ },
86
+ "cancel": {
87
+ "label": "Annuler"
88
+ },
89
+ "method": {
90
+ "createKey": "Créer une clé cryptographique",
91
+ "getEntityKey": "Obtenir la clé publique d’une organisation",
92
+ "sign": "Signer des données avec votre clé",
93
+ "masterSign": "Signer des données avec votre clé principale",
94
+ "getMasterDid": "Obtenir votre identifiant principal",
95
+ "selectKey": "Obtenir une de vos clés publiques",
96
+ "getPublicDetails": "Obtenir votre clé publique"
97
+ }
98
+ }
99
+ }
package/build/i18n.js CHANGED
@@ -1,4 +1,3 @@
1
- import { addI18nLib } from '@owlmeans/i18n';
2
1
  import en from './i18n/en.json' with { type: 'json' };
3
2
  import pl from './i18n/pl.json' with { type: 'json' };
4
3
  import ru from './i18n/ru.json' with { type: 'json' };
@@ -6,6 +5,7 @@ import be from './i18n/be.json' with { type: 'json' };
6
5
  import uk from './i18n/uk.json' with { type: 'json' };
7
6
  import es from './i18n/es.json' with { type: 'json' };
8
7
  import de from './i18n/de.json' with { type: 'json' };
8
+ import fr from './i18n/fr.json' with { type: 'json' };
9
9
  import walletEn from './i18n/wallet-en.json' with { type: 'json' };
10
10
  import walletPl from './i18n/wallet-pl.json' with { type: 'json' };
11
11
  import walletRu from './i18n/wallet-ru.json' with { type: 'json' };
@@ -13,18 +13,22 @@ import walletBe from './i18n/wallet-be.json' with { type: 'json' };
13
13
  import walletUk from './i18n/wallet-uk.json' with { type: 'json' };
14
14
  import walletEs from './i18n/wallet-es.json' with { type: 'json' };
15
15
  import walletDe from './i18n/wallet-de.json' with { type: 'json' };
16
- addI18nLib('en', 'keys', en, { ns: 'did' });
17
- addI18nLib('pl', 'keys', pl, { ns: 'did' });
18
- addI18nLib('ru', 'keys', ru, { ns: 'did' });
19
- addI18nLib('be', 'keys', be, { ns: 'did' });
20
- addI18nLib('uk', 'keys', uk, { ns: 'did' });
21
- addI18nLib('es', 'keys', es, { ns: 'did' });
22
- addI18nLib('de', 'keys', de, { ns: 'did' });
23
- addI18nLib('en', 'wallet', walletEn, { ns: 'did' });
24
- addI18nLib('pl', 'wallet', walletPl, { ns: 'did' });
25
- addI18nLib('ru', 'wallet', walletRu, { ns: 'did' });
26
- addI18nLib('be', 'wallet', walletBe, { ns: 'did' });
27
- addI18nLib('uk', 'wallet', walletUk, { ns: 'did' });
28
- addI18nLib('es', 'wallet', walletEs, { ns: 'did' });
29
- addI18nLib('de', 'wallet', walletDe, { ns: 'did' });
16
+ import walletFr from './i18n/wallet-fr.json' with { type: 'json' };
17
+ import { i18nHelper } from '@owlmeans/i18n';
18
+ i18nHelper.addI18nLib('en', 'keys', en, { ns: 'did' });
19
+ i18nHelper.addI18nLib('pl', 'keys', pl, { ns: 'did' });
20
+ i18nHelper.addI18nLib('ru', 'keys', ru, { ns: 'did' });
21
+ i18nHelper.addI18nLib('be', 'keys', be, { ns: 'did' });
22
+ i18nHelper.addI18nLib('uk', 'keys', uk, { ns: 'did' });
23
+ i18nHelper.addI18nLib('es', 'keys', es, { ns: 'did' });
24
+ i18nHelper.addI18nLib('de', 'keys', de, { ns: 'did' });
25
+ i18nHelper.addI18nLib('fr', 'keys', fr, { ns: 'did' });
26
+ i18nHelper.addI18nLib('en', 'wallet', walletEn, { ns: 'did' });
27
+ i18nHelper.addI18nLib('pl', 'wallet', walletPl, { ns: 'did' });
28
+ i18nHelper.addI18nLib('ru', 'wallet', walletRu, { ns: 'did' });
29
+ i18nHelper.addI18nLib('be', 'wallet', walletBe, { ns: 'did' });
30
+ i18nHelper.addI18nLib('uk', 'wallet', walletUk, { ns: 'did' });
31
+ i18nHelper.addI18nLib('es', 'wallet', walletEs, { ns: 'did' });
32
+ i18nHelper.addI18nLib('de', 'wallet', walletDe, { ns: 'did' });
33
+ i18nHelper.addI18nLib('fr', 'wallet', walletFr, { ns: 'did' });
30
34
  //# sourceMappingURL=i18n.js.map
package/build/i18n.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3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build/model.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import { makeKeyPairModel, plugins } from '@owlmeans/basic-keys';
2
2
  import { DIDKeyError } from './errors.js';
3
- import { assertType, prepareKey } from '@owlmeans/basic-keys/utils';
3
+ import { keyUtils } from '@owlmeans/basic-keys/utils';
4
4
  import { base64 } from '@scure/base';
5
5
  import { KP_SEP, MAX_DEPTH } from './consts.js';
6
- export const makeDidKeyModel = input => {
6
+ export const makeDidKeyModel = (input) => {
7
7
  if (typeof input == 'string') {
8
8
  const plugin = plugins[input];
9
9
  if (plugin != null && (plugin.fromSeed == null || plugin.derive == null)) {
@@ -15,7 +15,7 @@ export const makeDidKeyModel = input => {
15
15
  if (model.keyPair == null) {
16
16
  throw new DIDKeyError('no:keypair');
17
17
  }
18
- assertType(model.keyPair?.type);
18
+ keyUtils.assertType(model.keyPair?.type);
19
19
  if (model.keyPair.privateKey == null) {
20
20
  throw new DIDKeyError('no:pk');
21
21
  }
@@ -27,7 +27,7 @@ export const makeDidKeyModel = input => {
27
27
  if (item == null) {
28
28
  throw new DIDKeyError('no:path');
29
29
  }
30
- const newKey = [model.keyPair.type, base64.encode(plugins[model.keyPair.type].derive(prepareKey(model.keyPair.privateKey), item))].join(':');
30
+ const newKey = [model.keyPair.type, base64.encode(plugins[model.keyPair.type].derive(keyUtils.prepareKey(model.keyPair.privateKey), item))].join(':');
31
31
  const derived = makeDidKeyModel(newKey);
32
32
  if (derived.keyPair == null) {
33
33
  throw new DIDKeyError('derived:missgenerated');
@@ -1 +1 @@
1
- {"version":3,"file":"model.js","sourceRoot":"","sources":["../src/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,OAAO,EAAgB,MAAM,sBAAsB,CAAA;AAE9E,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;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AM,CAAC,MAAM,CAC/C,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,IAAI,CAAC,CACzF,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAEZ,MAAM,OAAO,GAAG,eAAe,CAAC,MAAM,CAAC,CAAA;QACvC,IAAI,OAAO,CAAC,OAAO,IAAI,IAAI,EAAE,CAAC;YAC5B,MAAM,IAAI,WAAW,CAAC,uBAAuB,CAAC,CAAA;QAChD,CAAC;QACD,OAAO,CAAC,OAAO,CAAC,IAAI,GAAG,IAAI,CAAA;QAC3B,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,KAAK,CAAC,aAAa,EAAE,CAAA;QAE9C,OAAO,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAA;IACxE,CAAC,CAAA;IAED,OAAO,KAAK,CAAA;AACd,CAAC,CAAA"}
@@ -1,10 +1,10 @@
1
- import { ed25519 } from '@noble/curves/ed25519';
1
+ import { ed25519 } from '@noble/curves/ed25519.js';
2
2
  import { KEY_OWL } from '../consts.js';
3
3
  import { base58, utf8 } from '@scure/base';
4
- import { concatBytes, randomBytes } from '@noble/hashes/utils';
5
- import { hmac } from '@noble/hashes/hmac';
6
- import { sha512 } from '@noble/hashes/sha512';
7
- import { keccak_256 } from '@noble/hashes/sha3';
4
+ import { concatBytes, randomBytes } from '@noble/hashes/utils.js';
5
+ import { hmac } from '@noble/hashes/hmac.js';
6
+ import { sha512 } from '@noble/hashes/sha2.js';
7
+ import { keccak_256 } from '@noble/hashes/sha3.js';
8
8
  export const ed25519owlPluginBuilder = (type = KEY_OWL) => {
9
9
  const key = {
10
10
  type: type,
@@ -1 +1 @@
1
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AG,GAAG,CAAC,IAAI,qBAAqB,CAAC,CAAA,CAAC,CAAC;KACrE,CAAA;IAED,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA"}
@@ -1,3 +1,5 @@
1
+ export type * from './types.js';
2
+ export type * from './mnemonic/types.js';
1
3
  export * from './mnemonic.js';
2
4
  export * from './key.js';
3
5
  export * from '../utils.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,mBAAmB,YAAY,CAAA;AAC/B,mBAAmB,qBAAqB,CAAA;AACxC,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAGA,cAAc,eAAe,CAAA;AAC7B,cAAc,UAAU,CAAA;AACxB,cAAc,aAAa,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/utils/key.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,eAAO,MAAM,UAAU,SAAU,MAAM,GAAG,UAAU,SAAQ,MAAM,eAoBjE,CAAA"}
1
+ {"version":3,"file":"key.d.ts","sourceRoot":"","sources":["../../src/utils/key.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,eAAO,MAAM,UAAU,SAAU,MAAM,GAAG,UAAU,SAAQ,MAAM,KAAa,UAoB9E,CAAA"}
@@ -1,4 +1,4 @@
1
- import { assertType } from '@owlmeans/basic-keys/utils';
1
+ import { keyUtils } from '@owlmeans/basic-keys/utils';
2
2
  import { KEY_OWL } from '../consts.js';
3
3
  import { base64 } from '@scure/base';
4
4
  import { plugins } from '../plugins/index.js';
@@ -7,7 +7,7 @@ export const produceKey = (seed, type = KEY_OWL) => {
7
7
  if (typeof seed === 'string') {
8
8
  seed = base64.decode(seed);
9
9
  }
10
- assertType(type);
10
+ keyUtils.assertType(type);
11
11
  if (plugins[type].fromSeed == null) {
12
12
  throw new DIDKeyError(`non-derivable:${type}`);
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"key.js","sourceRoot":"","sources":["../../src/utils/key.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAG1C,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,IAAyB,EAAE,IAAI,GAAW,OAAO,EAAE,EAAE;IAC9E,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE,CAAC;QAC7B,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC5B,CAAC;IACD,UAAU,CAAC,IAAI,CAAC,CAAA;IAEhB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,IAAI,IAAI,EAAE,CAAC;QACnC,MAAM,IAAI,WAAW,CAAC,iBAAiB,IAAI,EAAE,CAAC,CAAA;IAChD,CAAC;IAED,MAAM,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,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I,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAA;IACpD,MAAM,OAAO,GAAe;QAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,CAAC,UAAU,CAAC;QACrC,SAAS,EAAE,MAAM,CAAC,MAAM,CAAC,SAAS,CAAC;QACnC,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC;QAC1C,IAAI;KACL,CAAA;IAED,OAAO,OAAO,CAAA;AAChB,CAAC,CAAA"}
@@ -0,0 +1,13 @@
1
+ import type { MnemonicOptions } from '../../types.js';
2
+ /** BIP-39 mnemonics: generation and the seed and entropy derived from them. */
3
+ export interface MnemonicHelper {
4
+ /** A new mnemonic of `opts.size` words (12–24, default 18). @throws {SyntaxError} outside that range */
5
+ generateMnemonic: (opts?: MnemonicOptions) => string;
6
+ /** The BIP-39 seed of a mnemonic, base64. */
7
+ toSeed: (mnemonic: string) => string;
8
+ /** The BIP-39 seed of a mnemonic, hex. */
9
+ toEntropy: (mnemonic: string) => string;
10
+ /** The mnemonic of hex entropy. */
11
+ toMnemonic: (seed: string) => string;
12
+ }
13
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/utils/mnemonic/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD,+EAA+E;AAC/E,MAAM,WAAW,cAAc;IAC7B,wGAAwG;IACxG,gBAAgB,EAAE,CAAC,IAAI,CAAC,EAAE,eAAe,KAAK,MAAM,CAAA;IACpD,6CAA6C;IAC7C,MAAM,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;IACpC,0CAA0C;IAC1C,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAA;IACvC,mCAAmC;IACnC,UAAU,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAA;CACrC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/utils/mnemonic/types.ts"],"names":[],"mappings":""}
@@ -1,6 +1,4 @@
1
- import type { MnemonicOptions } from '../types.js';
2
- export declare const generateMnemonic: (opts?: MnemonicOptions) => string;
3
- export declare const toSeed: (mnemonic: string) => string;
4
- export declare const toEntropy: (mnemonic: string) => string;
5
- export declare const toMnemonic: (seed: string) => string;
1
+ import type { MnemonicHelper } from './mnemonic/types.js';
2
+ export declare const createMnemonicHelper: () => MnemonicHelper;
3
+ export declare const mnemonicHelper: MnemonicHelper;
6
4
  //# sourceMappingURL=mnemonic.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"mnemonic.d.ts","sourceRoot":"","sources":["../../src/utils/mnemonic.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAKlD,eAAO,MAAM,gBAAgB,UAAW,eAAe,KAAG,MASzD,CAAA;AAED,eAAO,MAAM,MAAM,aAAc,MAAM,KAAG,MACG,CAAA;AAE7C,eAAO,MAAM,SAAS,aAAc,MAAM,KAAG,MACH,CAAA;AAE1C,eAAO,MAAM,UAAU,SAAU,MAAM,KAAG,MACY,CAAA"}
1
+ {"version":3,"file":"mnemonic.d.ts","sourceRoot":"","sources":["../../src/utils/mnemonic.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAEzD,eAAO,MAAM,oBAAoB,QAAO,cAsBvC,CAAA;AAED,eAAO,MAAM,cAAc,gBAAyB,CAAA"}
@@ -1,15 +1,19 @@
1
1
  import { generateMnemonic as generate, mnemonicToSeedSync, entropyToMnemonic } from '@scure/bip39';
2
2
  import { hex, base64 } from '@scure/base';
3
- import { wordlist } from '@scure/bip39/wordlists/english';
4
- export const generateMnemonic = (opts) => {
5
- const size = opts?.size ?? 18;
6
- if (size < 12 || size > 24) {
7
- throw new SyntaxError('Mnemonic size should be between 12 and 24');
8
- }
9
- const strength = Math.round(256 * size / 24);
10
- return generate(wordlist, strength + (32 - strength % 32));
3
+ import { wordlist } from '@scure/bip39/wordlists/english.js';
4
+ export const createMnemonicHelper = () => {
5
+ const generateMnemonic = (opts) => {
6
+ const size = opts?.size ?? 18;
7
+ if (size < 12 || size > 24) {
8
+ throw new SyntaxError('Mnemonic size should be between 12 and 24');
9
+ }
10
+ const strength = Math.round(256 * size / 24);
11
+ return generate(wordlist, strength + (32 - strength % 32));
12
+ };
13
+ const toSeed = (mnemonic) => base64.encode(mnemonicToSeedSync(mnemonic));
14
+ const toEntropy = (mnemonic) => hex.encode(mnemonicToSeedSync(mnemonic));
15
+ const toMnemonic = (seed) => entropyToMnemonic(hex.decode(seed), wordlist);
16
+ return { generateMnemonic, toSeed, toEntropy, toMnemonic };
11
17
  };
12
- export const toSeed = (mnemonic) => base64.encode(mnemonicToSeedSync(mnemonic));
13
- export const toEntropy = (mnemonic) => hex.encode(mnemonicToSeedSync(mnemonic));
14
- export const toMnemonic = (seed) => entropyToMnemonic(hex.decode(seed), wordlist);
18
+ export const mnemonicHelper = createMnemonicHelper();
15
19
  //# sourceMappingURL=mnemonic.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mnemonic.js","sourceRoot":"","sources":["../../src/utils/mnemonic.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,IAAI,QAAQ,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAA;AAClG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAA;AAEzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,IAAsB,EAAU,EAAE;IACjE,MAAM,IAAI,GAAG,IAAI,EAAE,IAAI,IAAI,EAAE,CAAA;IAE7B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AI,GAAG,EAAE,EAAE,CAAC;YAC3B,MAAM,IAAI,WAAW,CAAC,2CAA2C,CAAC,CAAA;QACpE,CAAC;QAED,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,GAAG,EAAE,CAAC,CAAA;QAC5C,OAAO,QAAQ,CAAC,QAAe,EAAE,QAAQ,GAAG,CAAC,EAAE,GAAG,QAAQ,GAAG,EAAE,CAAC,CAAC,CAAA;IACnE,CAAC,CAAA;IAED,MAAM,MAAM,GAAG,CAAC,QAAgB,EAAU,EAAE,CAC1C,MAAM,CAAC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAA;IAE7C,MAAM,SAAS,GAAG,CAAC,QAAgB,EAAU,EAAE,CAC7C,GAAG,CAAC,MAAM,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,CAAA;IAE1C,MAAM,UAAU,GAAG,CAAC,IAAY,EAAU,EAAE,CAC1C,iBAAiB,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,QAAe,CAAC,CAAA;IAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,CAAA;AAC5D,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,cAAc,GAAG,oBAAoB,EAAE,CAAA"}
@@ -0,0 +1,11 @@
1
+ import type { KeyMeta } from '../types.js';
2
+ /** Wallet key paths composed from key metadata. */
3
+ export interface KeyPathUtils {
4
+ /** Join path items with the key-path separator; an array item is joined with the prefix one. */
5
+ toPath: (...args: (string | string[])[]) => string;
6
+ /** The derivation path of a key described by its metadata: service, entity, profile. */
7
+ mataToPath: (meta: Partial<KeyMeta>) => string;
8
+ /** Whether a key's metadata carries every field the needle asks for (`name` is ignored). */
9
+ matchMeta: (haystack: KeyMeta, needle: Partial<KeyMeta>) => boolean;
10
+ }
11
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAE1C,mDAAmD;AACnD,MAAM,WAAW,YAAY;IAC3B,gGAAgG;IAChG,MAAM,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,KAAK,MAAM,CAAA;IAClD,wFAAwF;IACxF,UAAU,EAAE,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,MAAM,CAAA;IAC9C,4FAA4F;IAC5F,SAAS,EAAE,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,OAAO,CAAA;CACpE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/utils/types.ts"],"names":[],"mappings":""}