Skip to content

Commit

Permalink
remove generate nonce (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-t-wang authored Jul 29, 2024
1 parent 9507374 commit 367795c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 10 deletions.
9 changes: 0 additions & 9 deletions src/helpers/siwe/siwe.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { SiweMessage } from "types/wallet-auth";
import { ethers } from "ethers";
import { MiniAppWalletAuthSuccessPayload } from "types/responses";
import { randomBytes } from "crypto";

const PREAMBLE = " wants you to sign in with your Ethereum account:";
const URI_TAG = "URI: ";
Expand Down Expand Up @@ -200,11 +199,3 @@ export const verifySiweMessage = async (
}
return { isValid: true, siweMessageData: siweMessageData };
};

export const generateNonce = (): string => {
const nonce = randomBytes(12).toString("hex"); // Generates a 24-character hex string
if (!nonce || nonce.length < 8) {
throw new Error("Error during nonce creation.");
}
return nonce;
};
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export {
parseSiweMessage,
SAFE_CONTRACT_ABI,
verifySiweMessage,
generateNonce,
} from "helpers/siwe/siwe";

export {
Expand Down

0 comments on commit 367795c

Please sign in to comment.