From d0d40c211ee7711a556641e4b5e297413c0f239f Mon Sep 17 00:00:00 2001 From: Kevin Date: Thu, 21 Nov 2024 20:45:11 +0800 Subject: [PATCH] Update index.ts fix: readFileSync utf-8 --- 01-wallet/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/01-wallet/index.ts b/01-wallet/index.ts index 6626f95..eab4139 100644 --- a/01-wallet/index.ts +++ b/01-wallet/index.ts @@ -18,9 +18,9 @@ console.log("钱包私钥(base64):", Buffer.from(secretKey).toString("base64")); fs.writeFileSync("wallet.json", JSON.stringify(Array.from(secretKey))); // 导入钱包 -// const secretKey = Uint8Array.from(JSON.parse(fs.readFileSync("wallet.json"))); +// const secretKey = Uint8Array.from(JSON.parse(fs.readFileSync("wallet.json", "utf-8"))); // const wallet = Keypair.fromSecretKey(secretKey); // console.log("钱包公钥:", wallet.publicKey.toString()); // console.log("钱包私钥:", wallet.secretKey); -// console.log("钱包私钥(base64):", Buffer.from(secretKey).toString("base64")); \ No newline at end of file +// console.log("钱包私钥(base64):", Buffer.from(secretKey).toString("base64"));