diff --git a/.DS_Store b/.DS_Store index 081ed9b..975e9c2 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.projenrc.ts b/.projenrc.ts index 1060601..0d10732 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -7,9 +7,10 @@ const project = new typescript.TypeScriptProject({ // github github: true, - authorName: 'Fluidkey', + authorName: 'Fluid Privacy SA', authorEmail: 'it@fluidkey.com', gitignore: ['.idea/', '.env', '.yalc'], + license: 'MIT', // NPMjs Configuration authorOrganization: true, diff --git a/LICENSE b/LICENSE index d9c63e1..7056b07 100644 --- a/LICENSE +++ b/LICENSE @@ -1,5 +1,3 @@ -MIT License - Copyright (c) 2024 Fluid Privacy SA Permission is hereby granted, free of charge, to any person obtaining a copy diff --git a/package.json b/package.json index 418112c..ae82aca 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "projen": "npx projen" }, "author": { - "name": "Fluidkey", + "name": "Fluid Privacy SA", "email": "it@fluidkey.com", "organization": true }, @@ -46,7 +46,7 @@ "viem": "1.21.4" }, "main": "lib/index.js", - "license": "Apache-2.0", + "license": "MIT", "version": "0.0.0", "jest": { "testMatch": [ diff --git a/src/extractViewingPrivateKeyNode.ts b/src/extractViewingPrivateKeyNode.ts index 4bb8e71..3186680 100644 --- a/src/extractViewingPrivateKeyNode.ts +++ b/src/extractViewingPrivateKeyNode.ts @@ -22,9 +22,9 @@ export function extractViewingPrivateKeyNode( // Convert the private viewing key to Uint8Array const uint8PrivateViewingKey = toBytes(privateViewingKey); - // generate the master HDKey from the private viewing key + // Generate the master HDKey from the private viewing key const hdkey = HDKey.fromMasterSeed(uint8PrivateViewingKey); - // derive the node m/5564'/N to be shared with the server + // Derive the node m/5564'/N to be shared with the server return hdkey.derive(`m/5564'/${node}'`); } diff --git a/src/predictStealthSafeAddress.ts b/src/predictStealthSafeAddress.ts index 5fcac57..9cf9395 100644 --- a/src/predictStealthSafeAddress.ts +++ b/src/predictStealthSafeAddress.ts @@ -15,6 +15,7 @@ import * as chains from 'viem/chains'; * @param transport (optional) a custom viem transport to use for the simulation * @return Promise<{ stealthSafeAddress }> the predicted Safe address (not deployed) */ + export async function predictStealthSafeAddress({ chainId, threshold, diff --git a/test/extractViewingPrivateKeyNode.test.ts b/test/extractViewingPrivateKeyNode.test.ts index 3191345..e827456 100644 --- a/test/extractViewingPrivateKeyNode.test.ts +++ b/test/extractViewingPrivateKeyNode.test.ts @@ -51,4 +51,10 @@ describe('extractPrivateViewingKeyNode', () => { expect(Array.from(result.privateKey!)).toEqual(expectedPrivateKey); expect(Array.from(result.publicKey!)).toEqual(expectedPublicKey); }); + + it('should throw an error if the private viewing key is not a valid hex string', () => { + expect(() => extractViewingPrivateKeyNode('0xinvalid')).toThrow( + 'Hex private viewing key is not valid.', + ); + }); });