mirror of
https://github.com/cosmos/cosmjs.git
synced 2025-03-10 21:49:15 +00:00
scripts: Update for hd wallet change
This commit is contained in:
parent
9496fc2540
commit
798c801525
@ -21,7 +21,7 @@ const codeMeta = {
|
||||
};
|
||||
|
||||
async function main() {
|
||||
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, undefined, "wasm");
|
||||
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, { prefix: "wasm" });
|
||||
const client = await SigningCosmWasmClient.connectWithSigner(endpoint, wallet);
|
||||
|
||||
const wasm = fs.readFileSync(__dirname + "/contracts/cw1_subkeys.wasm");
|
||||
|
@ -63,7 +63,7 @@ const initData = [
|
||||
];
|
||||
|
||||
async function main() {
|
||||
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, undefined, "wasm");
|
||||
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, { prefix: "wasm" });
|
||||
const client = await SigningCosmWasmClient.connectWithSigner(endpoint, wallet);
|
||||
|
||||
const wasm = fs.readFileSync(__dirname + "/contracts/cw3_fixed_multisig.wasm");
|
||||
|
@ -48,7 +48,7 @@ const inits = [
|
||||
];
|
||||
|
||||
async function main() {
|
||||
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, undefined, "wasm");
|
||||
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(alice.mnemonic, { prefix: "wasm" });
|
||||
const client = await SigningCosmWasmClient.connectWithSigner(endpoint, wallet);
|
||||
|
||||
const wasm = fs.readFileSync(__dirname + "/contracts/hackatom.wasm");
|
||||
|
@ -37,7 +37,10 @@ async function main() {
|
||||
for (const { mnemonic, accountNumbers } of accountsToCreate) {
|
||||
const wallets = await Promise.all(
|
||||
accountNumbers.map((accountNumber) =>
|
||||
Secp256k1HdWallet.fromMnemonic(mnemonic, makeCosmoshubPath(accountNumber), prefix),
|
||||
Secp256k1HdWallet.fromMnemonic(mnemonic, {
|
||||
hdPath: makeCosmoshubPath(accountNumber),
|
||||
prefix: prefix,
|
||||
}),
|
||||
),
|
||||
);
|
||||
const accounts = (await Promise.all(wallets.map((wallet) => wallet.getAccounts()))).map(
|
||||
|
@ -16,7 +16,7 @@ const faucet = {
|
||||
};
|
||||
|
||||
async function main() {
|
||||
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic, undefined, prefix);
|
||||
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(faucet.mnemonic, { prefix: prefix });
|
||||
const client = await SigningStargateClient.connectWithSigner(rpcUrl, wallet);
|
||||
const recipient = Bech32.encode(prefix, Random.getBytes(20));
|
||||
const amount = coins(226644, "ucosm");
|
||||
|
Loading…
x
Reference in New Issue
Block a user