@denodeio/seshat 0.0.34 → 0.0.36

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.
@@ -21,7 +21,9 @@ type JwtPayload<T> = {
21
21
  iat: number;
22
22
  };
23
23
  export declare const validateJws: <T>(key: Key, input: JwsPayload) => JwtPayload<T> | undefined;
24
- export declare const validateJwsMultisig: <T>(keychain: Keychain, input: JwsPayload) => {
24
+ export declare const validateJwsMultisig: (keychain: Keychain, input: JwsPayload) => {
25
+ isVerified: boolean;
26
+ payload: any;
25
27
  verified: string[];
26
28
  unverified: string[];
27
29
  };
@@ -51,7 +51,9 @@ type JwtPayload<T> = {
51
51
  iat: number;
52
52
  };
53
53
  declare const validateJws: <T>(key: Key, input: JwsPayload) => JwtPayload<T> | undefined;
54
- declare const validateJwsMultisig: <T>(keychain: Keychain, input: JwsPayload) => {
54
+ declare const validateJwsMultisig: (keychain: Keychain, input: JwsPayload) => {
55
+ isVerified: boolean;
56
+ payload: any;
55
57
  verified: string[];
56
58
  unverified: string[];
57
59
  };
@@ -6672,6 +6672,7 @@ var utils = {};
6672
6672
  const validateJwsMultisig = (keychain, input) => {
6673
6673
  const verified = [];
6674
6674
  const unverified = [];
6675
+ const payload = JSON.parse(Buffer.from(input.payload, "base64").toString());
6675
6676
  for (const signature of input.signatures) {
6676
6677
  const key = keychain.get(signature.header.kid);
6677
6678
  if (key) {
@@ -6683,6 +6684,8 @@ var utils = {};
6683
6684
  }
6684
6685
  }
6685
6686
  return {
6687
+ isVerified: verified.length > 0,
6688
+ payload,
6686
6689
  verified,
6687
6690
  unverified
6688
6691
  };