rise-wallet 0.3.3 → 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)
@@ -1036,11 +1043,11 @@ export async function sign(key: Key, parameters: sign.Parameters) {
1036
1043
 
1037
1044
  const { credential, rpId } = privateKey
1038
1045
 
1039
- const cacheKey = `porto.webauthnVerified.${key.hash}`
1046
+ const cacheKey = `risewallet.webauthnVerified.${key.hash}`
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 =
@@ -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