diff --git a/data/wallet.ts b/data/wallet.ts index 0f4000b..8afc73b 100644 --- a/data/wallet.ts +++ b/data/wallet.ts @@ -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; }