소스 검색

Merge pull request #361 from icy-comet/patch-1

update: how-to-create-a-solana-token
Tony Boyle 5 달 전
부모
커밋
4d1639d7e4
1개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 2 2
      src/pages/guides/javascript/how-to-create-a-solana-token.md

+ 2 - 2
src/pages/guides/javascript/how-to-create-a-solana-token.md

@@ -122,10 +122,10 @@ const umi = createUmi("https://devnet-aura.metaplex.com/<YOUR_API_KEY>")
 
 // You will need to us fs and navigate the filesystem to
 // load the wallet you wish to use via relative pathing.
-const walletFile = fs.readFileSync('./keypair.json')
+const walletFile = fs.readFileSync('./keypair.json', {encoding: "utf-8"})
 
 // Convert your walletFile onto a keypair.
-let keypair = umi.eddsa.createKeypairFromSecretKey(new Uint8Array(walletFile));
+let keypair = umi.eddsa.createKeypairFromSecretKey(new Uint8Array(JSON.parse(walletFile)));
 
 // Load the keypair into umi.
 umi.use(keypairIdentity(umiSigner));