Skip to content

Commit

Permalink
fix: return private key of new wallet
Browse files Browse the repository at this point in the history
  • Loading branch information
yongenaelf committed Jul 25, 2024
1 parent 2314005 commit d80d07a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion data/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ export function useWallet() {
if (existingWallets.length === 0) {
const newWallet = AElf.wallet.createNewWallet();
await db.wallet.add({ privateKey: newWallet.privateKey });
const res = await (
await(
await fetch(
`https://faucet.aelf.dev/api/claim?walletAddress=${newWallet.address}`,
{ method: "POST" }
)
).json();
return newWallet.privateKey as string;
} else {
return existingWallets[0].privateKey;
}
Expand Down

0 comments on commit d80d07a

Please sign in to comment.