Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update base-helpers.ts options #557

Merged
merged 3 commits into from Nov 18, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions contracts/base-helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,22 @@ const pebblenetOptions: Options = {
gasPrice: GasPrice.fromString("0.01upebble"),
}

const uniOptions: Options = {
httpUrl: 'https://rpc.uni.juno.deuslabs.fi',
networkId: 'uni',
bech32prefix: 'juno',
feeToken: 'ujunox',
faucetUrl: 'https://faucet.uni.juno.deuslabs.fi/credit',
hdPath: makeCosmoshubPath(0),
defaultKeyFile: path.join(process.env.HOME, ".uni.key"),
fees: {
upload: 6000000,
init: 500000,
exec: 200000,
},
gasPrice: GasPrice.fromString("0.025ujunox"),
}

interface Network {
setup: (password: string, filename?: string) => Promise<[string, SigningCosmWasmClient]>
recoverMnemonic: (password: string, filename?: string) => Promise<string>
Expand Down Expand Up @@ -95,8 +111,8 @@ const useOptions = (options: Options): Network => {

const setup = async (password: string, filename?: string): Promise<[string, SigningCosmWasmClient]> => {
const keyfile = filename || options.defaultKeyFile;
const wallet = await loadOrCreateWallet(pebblenetOptions, keyfile, password);
const client = await connect(wallet, pebblenetOptions);
const wallet = await loadOrCreateWallet(options, keyfile, password);
const client = await connect(wallet, options);

const [account] = await wallet.getAccounts();
// ensure we have some tokens
Expand All @@ -113,7 +129,7 @@ const useOptions = (options: Options): Network => {

const recoverMnemonic = async (password: string, filename?: string): Promise<string> => {
const keyfile = filename || options.defaultKeyFile;
const wallet = await loadOrCreateWallet(pebblenetOptions, keyfile, password);
const wallet = await loadOrCreateWallet(options, keyfile, password);
return wallet.mnemonic;
}

Expand Down