@calimero-network/mero-react 9.11.2 → 9.11.3
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 +2 -0
- package/dist/index.cjs +7 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +19 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -130,6 +130,8 @@ Every hook in this package goes through that `admin`, never the raw `mero.admin`
|
|
|
130
130
|
|
|
131
131
|
How an account (delegated session) learns its `applicationId`: `packageName` decides. When the app passes one, the id is derived from the registry: `sha256(borsh((package, signerId)))` of the newest non-yanked bundle, exactly as merod computes it at install, so a brand-new account can found its first namespace (`admin.createNamespace({ applicationId })`) and an account already used in other apps is never handed one of THEIR ids. The account's own contexts on the relay are consulted only when the app passes no `packageName` (or the registry did not answer, after one `console.warn`): one distinct application across them is the answer; several leaves it `null` on purpose (nothing says which the tab is for). When the registry lists the package under more than one publisher, it stays `null`. `applicationIdForBundle` and `resolveApplicationIdFromRegistry` are exported for apps that need the same derivation.
|
|
132
132
|
|
|
133
|
+
On an account, `admin.createContext(request)` (and `useCreateContext`) signs a creation warrant the relay acts on: `applicationId`, `groupId`, `serviceName` (which service of a multi-service bundle, e.g. mero-docs' `registry`), `name`, `contextSeed` and `initializationParams` are all carried into it; `identitySecret` is not, since the account itself is the new context's member identity.
|
|
134
|
+
|
|
133
135
|
Through `mero` you access the full MeroJs API:
|
|
134
136
|
|
|
135
137
|
```tsx
|
package/dist/index.cjs
CHANGED
|
@@ -530,6 +530,8 @@ async function createDelegatedContext(s, req, deps = {}) {
|
|
|
530
530
|
const created = await client(s, relay, { next: async () => creationNonce }, deps.fetch).createContext({
|
|
531
531
|
groupId: req.groupId ?? req.namespaceId,
|
|
532
532
|
applicationId: req.applicationId,
|
|
533
|
+
serviceName: req.serviceName,
|
|
534
|
+
seed: req.contextSeed,
|
|
533
535
|
initArgs: initArgsOf(req.initializationParams),
|
|
534
536
|
name: req.name
|
|
535
537
|
});
|
|
@@ -907,6 +909,8 @@ function createAccountAdmin(input, deps = {}) {
|
|
|
907
909
|
namespaceId,
|
|
908
910
|
groupId: req.groupId,
|
|
909
911
|
applicationId: req.applicationId,
|
|
912
|
+
serviceName: req.serviceName,
|
|
913
|
+
contextSeed: req.contextSeed,
|
|
910
914
|
name: req.name,
|
|
911
915
|
initializationParams: req.initializationParams
|
|
912
916
|
});
|
|
@@ -3758,6 +3762,9 @@ function useCreateContext() {
|
|
|
3758
3762
|
() => createDelegatedContext(session, {
|
|
3759
3763
|
namespaceId: request.groupId,
|
|
3760
3764
|
applicationId: request.applicationId,
|
|
3765
|
+
serviceName: request.serviceName,
|
|
3766
|
+
contextSeed: request.contextSeed,
|
|
3767
|
+
name: request.name,
|
|
3761
3768
|
initializationParams: request.initializationParams
|
|
3762
3769
|
})
|
|
3763
3770
|
);
|