@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.cjs CHANGED
@@ -2920,8 +2920,16 @@ function encodeSignedInvitation(signed) {
2920
2920
  async function signMemberJoinOp(input) {
2921
2921
  const parents = input.parentOpHashes ?? [];
2922
2922
  const credential = fromHex(input.credential, "credential", input.credential.length / 2);
2923
- const rootOp = concat(
2924
- new Uint8Array([input.at ? ROOT_OP.MemberJoinedAt : ROOT_OP.MemberJoined]),
2923
+ const expires = BigInt(input.invitation.invitation.expiration_timestamp ?? 0) !== 0n;
2924
+ const joinedAt = input.joinedAt ?? BigInt(Math.floor(Date.now() / 1e3));
2925
+ const rootOp = expires ? concat(
2926
+ new Uint8Array([ROOT_OP.MemberJoinedAt]),
2927
+ fromHex(input.member, "member", 32),
2928
+ encodeSignedInvitation(input.invitation),
2929
+ u64le(joinedAt),
2930
+ credential
2931
+ ) : concat(
2932
+ new Uint8Array([ROOT_OP.MemberJoined]),
2925
2933
  fromHex(input.member, "member", 32),
2926
2934
  encodeSignedInvitation(input.invitation),
2927
2935
  credential