Skip to content

Commit b980db7

Browse files
committed
feat: add wallet generation script for faucet
1 parent 2e4bee7 commit b980db7

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
import { ShelleyWallet } from "./lib/helpers/crypto";
2+
3+
(async () => {
4+
try {
5+
console.log("\nGenerating your wallet... πŸ”");
6+
const wallet = await ShelleyWallet.generate();
7+
const walletJson = wallet.json();
8+
9+
// Display wallet details
10+
console.log("\nπŸŽ‰ Wallet generated successfully!");
11+
console.log("-----------------------------------");
12+
console.log("πŸ’Ό Wallet:", walletJson);
13+
console.log(`πŸ”‘ Payment Private Key: ${walletJson.payment.private}`);
14+
console.log(`πŸ”— Stake Public Key Hash: ${walletJson.stake.pkh}`);
15+
console.log(`🏠 Wallet Address: ${walletJson.address}`);
16+
console.log("-----------------------------------");
17+
18+
// Instructions for environment variables
19+
console.log(
20+
"\nπŸ“‹ Please copy the following to your environment variables:"
21+
);
22+
console.log(`1. Set FAUCET_PAYMENT_PRIVATE=${walletJson.payment.private}`);
23+
console.log(`2. Set FAUCET_STAKE_PKH=${walletJson.stake.pkh}`);
24+
console.log(`3. Set FAUCET_ADDRESS=${walletJson.address}`);
25+
26+
console.log("\n🎈 All done! Have fun with your new wallet!");
27+
} catch (error) {
28+
console.error("\n❌ An error occurred:", error.message);
29+
}
30+
})();

β€Žtests/govtool-frontend/playwright/package.jsonβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
"test:headless:usersnap": "npx playwright test userSnap.spec.ts",
4545
"test:headless:misc": "npx playwright test miscellaneous",
4646
"format": "prettier . --write",
47-
"generate-wallets": "ts-node ./generate_wallets.ts 23"
47+
"generate-wallets": "ts-node ./generate_wallets.ts 23",
48+
"generate-faucet-wallet": "ts-node ./generate_faucet_wallet.ts"
4849
},
4950
"dependencies": {
5051
"@cardanoapi/cardano-test-wallet": "^3.3.1",

0 commit comments

Comments
Β (0)