rise-wallet 0.3.4 → 0.3.5

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/src/viem/Key.ts CHANGED
@@ -971,7 +971,14 @@ export function serialize(key: Key): Serialized {
971
971
  }
972
972
 
973
973
  export async function sign(key: Key, parameters: sign.Parameters) {
974
- const { address, storage, webAuthn, wrap = true, typedData } = parameters
974
+ const {
975
+ address,
976
+ storage,
977
+ webAuthn,
978
+ wrap = true,
979
+ typedData,
980
+ verificationOptional,
981
+ } = parameters
975
982
  const { privateKey, publicKey, type: keyType } = key
976
983
 
977
984
  if (!privateKey)
@@ -1040,7 +1047,7 @@ export async function sign(key: Key, parameters: sign.Parameters) {
1040
1047
  const now = Date.now()
1041
1048
  const verificationTimeout = 10 * 60 * 1_000 // 10 minutes in milliseconds
1042
1049
 
1043
- let requireVerification = true
1050
+ let requireVerification = !verificationOptional
1044
1051
  if (storage) {
1045
1052
  const lastVerified = await storage.getItem<number>(cacheKey)
1046
1053
  requireVerification =
@@ -1056,7 +1063,7 @@ export async function sign(key: Key, parameters: sign.Parameters) {
1056
1063
  credentialId: credential.id,
1057
1064
  getFn: webAuthn?.getFn,
1058
1065
  rpId,
1059
- userVerification: requireVerification ? 'required' : 'discouraged',
1066
+ userVerification: requireVerification ? 'required' : 'preferred',
1060
1067
  })
1061
1068
 
1062
1069
  const response = raw.response as AuthenticatorAssertionResponse
@@ -1206,6 +1213,7 @@ export declare namespace sign {
1206
1213
  | prepareCalls.ReturnType['typedData']
1207
1214
  | TypedData.Definition
1208
1215
  | undefined
1216
+ verificationOptional?: boolean | undefined
1209
1217
  }
1210
1218
  }
1211
1219