mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-11 14:09:15 +00:00
Add address maker example
This commit is contained in:
parent
2e2b0b59e3
commit
407a0a1883
9
packages/cli/examples/faucet_addresses.ts
Normal file
9
packages/cli/examples/faucet_addresses.ts
Normal file
@ -0,0 +1,9 @@
|
||||
const mnemonic = "economy stock theory fatal elder harbor betray wasp final emotion task crumble siren bottom lizard educate guess current outdoor pair theory focus wife stone";
|
||||
|
||||
for (let i of [0, 1, 2, 3, 4]) {
|
||||
const pen = await Secp256k1Pen.fromMnemonic(mnemonic, makeCosmoshubPath(i));
|
||||
const pubkey = toBase64(pen.pubkey);
|
||||
const address = pubkeyToAddress(encodeSecp256k1Pubkey(pen.pubkey), "cosmos");
|
||||
console.info(`Address ${i}: ${address}`);
|
||||
console.info(`Pubkey ${i}: ${pubkey}`);
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user