mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
Merge pull request #178 from CosmWasm/update-cli
Update CLI for 0.8 demo net
This commit is contained in:
commit
9d4fdbc514
@ -83,7 +83,7 @@ quick queries on a chain, you can use an extended set of helpers:
|
||||
|
||||
Start with `./bin/cosmwasm-cli --init examples/helpers.ts`
|
||||
|
||||
(This points to the Demonet at https://lcd.demo-071.cosmwasm.com for ease of use. Other networks, look below)
|
||||
(This points to the Demonet at https://lcd.demo-08.cosmwasm.com for ease of use. Other networks, look below)
|
||||
|
||||
Setup Account:
|
||||
|
||||
|
@ -7,14 +7,14 @@ interface Options {
|
||||
};
|
||||
|
||||
const defaultOptions: Options = {
|
||||
httpUrl: "https://lcd.demo-071.cosmwasm.com",
|
||||
httpUrl: "https://lcd.demo-08.cosmwasm.com",
|
||||
networkId: "testing",
|
||||
feeToken: "ucosm",
|
||||
gasPrice: 0.025,
|
||||
bech32prefix: "cosmos",
|
||||
}
|
||||
|
||||
const defaultFaucetUrl = "https://faucet.demo-071.cosmwasm.com/credit";
|
||||
const defaultFaucetUrl = "https://faucet.demo-08.cosmwasm.com/credit";
|
||||
|
||||
const buildFeeTable = (feeToken: string, gasPrice: number): FeeTable => {
|
||||
const stdFee = (gas: number, denom: string, price: number) => {
|
||||
@ -88,6 +88,10 @@ const hitFaucet = async (faucetUrl: string, address: string, ticker: string): Pr
|
||||
|
||||
const randomAddress = async (prefix: string): Promise<string> => {
|
||||
const mnemonic = Bip39.encode(Random.getBytes(16)).toString();
|
||||
return mnemonicToAddress(prefix, mnemonic);
|
||||
}
|
||||
|
||||
const mnemonicToAddress = async (prefix: string, mnemonic: string): Promise<string> => {
|
||||
const pen = await Secp256k1Pen.fromMnemonic(mnemonic);
|
||||
const pubkey = encodeSecp256k1Pubkey(pen.pubkey);
|
||||
return pubkeyToAddress(pubkey, prefix);
|
||||
|
Loading…
x
Reference in New Issue
Block a user