-
@dtribble asked for a quick example of making an address using the cosmjs library. |
Beta Was this translation helpful? Give feedback.
Answered by
dckc
Jul 26, 2022
Replies: 1 comment 4 replies
-
The basic outline is: import { Random } from '@cosmjs/crypto';
import { DirectSecp256k1Wallet } from '@cosmjs/proto-signing';
export const bech32Config = {
bech32PrefixAccAddr: 'agoric',
// ...
};
const makeAddr = async () => {
const seed = Random.getBytes(32);
const wallet = await DirectSecp256k1Wallet.fromKey(seed, bech32Config.bech32PrefixAccAddr);
const accounts = await wallet.getAccounts()
console.log({ accounts });
};
makeAddr().catch(err => console.error(err)); and out comes
for a complete example including cc @dtribble |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
dckc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The basic outline is:
and out comes
for a complete example including
package.json
and all that, see https://gist.github.com/dckc/7aa4…