11 lines
290 B
JavaScript
11 lines
290 B
JavaScript
|
|
const { Wallet } = require('ethers');
|
||
|
|
|
||
|
|
// Generate a random wallet
|
||
|
|
const wallet = Wallet.createRandom();
|
||
|
|
|
||
|
|
// Extract the private key and address
|
||
|
|
const privateKey = wallet.privateKey;
|
||
|
|
const address = wallet.address;
|
||
|
|
|
||
|
|
console.log('Private Key:', privateKey);
|
||
|
|
console.log('Address:', address);
|