@calimero-network/mero-react 9.16.1 → 10.0.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 CHANGED
@@ -505,7 +505,7 @@ useGroupMetadata, useMemberMetadata, useUpdateMemberRole
505
505
  useSetDefaultCapabilities, useDefaultCapabilities
506
506
  useSetSubgroupVisibility, useSubgroupVisibility, useSetTeeAdmissionPolicy
507
507
  useDetachContextFromGroup
508
- useNamespaces, useNamespace, useNamespaceGroups, useNamespaceIdentity
508
+ useNamespaces, useNamespace, useNamespaceGroups, useNodeIdentity
509
509
  useNamespacesForApplication, useCreateNamespace, useDeleteNamespace
510
510
  useJoinNamespace, useRedeemInvitation, useCreateNamespaceInvitation, useCreateGroupInNamespace
511
511
  useBlobInfo, useBlobUrl, useUploadBlob
package/dist/index.cjs CHANGED
@@ -855,7 +855,6 @@ function AccountSignInPanel({
855
855
  );
856
856
  }
857
857
  var DEVICE_KEY = "calimero.device";
858
- var STATE_KEY = "calimero.enrol.state";
859
858
  var HOSTED_WALLET = "https://wallet.cloud.calimero.network/account-enroll";
860
859
  var hex = (b) => [...new Uint8Array(b)].map((x) => x.toString(16).padStart(2, "0")).join("");
861
860
  function executorOf(relay) {
@@ -961,28 +960,10 @@ function useAccountEnrolment({
961
960
  (async () => {
962
961
  try {
963
962
  const keys = await deviceKeys();
964
- const sent = (() => {
965
- try {
966
- return sessionStorage.getItem(STATE_KEY);
967
- } catch {
968
- return null;
969
- }
970
- })();
971
- try {
972
- sessionStorage.removeItem(STATE_KEY);
973
- } catch {
974
- }
975
- if (!sent) {
976
- setNote(
977
- 'This enrolment could not be verified as one this tab started, so it was not accepted. Start again from "Enrol with your account".'
978
- );
979
- return;
980
- }
981
963
  const enrolled = await meroJs.completeDeviceEnrolment({
982
964
  ...back,
983
965
  devicePublicKey: keys.signPk,
984
- kemPublicKey: keys.kemPk,
985
- expectState: sent
966
+ kemPublicKey: keys.kemPk
986
967
  });
987
968
  meroJs.saveDelegatedCredential({
988
969
  account: enrolled.account,
@@ -1021,18 +1002,12 @@ function useAccountEnrolment({
1021
1002
  setNote(e instanceof Error ? e.message : String(e));
1022
1003
  return;
1023
1004
  }
1024
- const state = hex(crypto.getRandomValues(new Uint8Array(16)));
1025
- try {
1026
- sessionStorage.setItem(STATE_KEY, state);
1027
- } catch {
1028
- }
1029
1005
  window.location.assign(
1030
1006
  meroJs.deviceEnrolmentUrl({
1031
1007
  walletUrl,
1032
1008
  devicePublicKey: keys.signPk,
1033
1009
  kemPublicKey: keys.kemPk,
1034
- returnTo: window.location.origin + window.location.pathname,
1035
- state
1010
+ returnTo: window.location.origin + window.location.pathname
1036
1011
  })
1037
1012
  );
1038
1013
  }, [walletUrl]);
@@ -2880,15 +2855,6 @@ function useNodeIdentity() {
2880
2855
  );
2881
2856
  return { identity: data, loading, error, refetch };
2882
2857
  }
2883
- function useNamespaceIdentity(namespaceId) {
2884
- const { admin } = useMero();
2885
- const { data, loading, error, refetch } = useAsyncResource(
2886
- admin && namespaceId ? () => admin.getNamespaceIdentity(namespaceId) : null,
2887
- null,
2888
- [admin, namespaceId]
2889
- );
2890
- return { identity: data, loading, error, refetch };
2891
- }
2892
2858
  function useNamespacesForApplication(applicationId) {
2893
2859
  const { admin, isDelegated } = useMero();
2894
2860
  const { data, loading, error, refetch } = useAsyncResource(
@@ -5383,7 +5349,6 @@ exports.useMigrationStatus = useMigrationStatus;
5383
5349
  exports.useMyAuthoredMigration = useMyAuthoredMigration;
5384
5350
  exports.useNamespace = useNamespace;
5385
5351
  exports.useNamespaceGroups = useNamespaceGroups;
5386
- exports.useNamespaceIdentity = useNamespaceIdentity;
5387
5352
  exports.useNamespaces = useNamespaces;
5388
5353
  exports.useNamespacesForApplication = useNamespacesForApplication;
5389
5354
  exports.useNodeIdentity = useNodeIdentity;