@calimero-network/mero-js 15.3.3 → 15.3.4

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/index.mjs CHANGED
@@ -2843,8 +2843,16 @@ function encodeSignedInvitation(signed) {
2843
2843
  async function signMemberJoinOp(input) {
2844
2844
  const parents = input.parentOpHashes ?? [];
2845
2845
  const credential = fromHex(input.credential, "credential", input.credential.length / 2);
2846
- const rootOp = concat(
2847
- new Uint8Array([input.at ? ROOT_OP.MemberJoinedAt : ROOT_OP.MemberJoined]),
2846
+ const expires = BigInt(input.invitation.invitation.expiration_timestamp ?? 0) !== 0n;
2847
+ const joinedAt = input.joinedAt ?? BigInt(Math.floor(Date.now() / 1e3));
2848
+ const rootOp = expires ? concat(
2849
+ new Uint8Array([ROOT_OP.MemberJoinedAt]),
2850
+ fromHex(input.member, "member", 32),
2851
+ encodeSignedInvitation(input.invitation),
2852
+ u64le(joinedAt),
2853
+ credential
2854
+ ) : concat(
2855
+ new Uint8Array([ROOT_OP.MemberJoined]),
2848
2856
  fromHex(input.member, "member", 32),
2849
2857
  encodeSignedInvitation(input.invitation),
2850
2858
  credential