Rename Secp256k1Wallet -> Secp256k1HdWallet

This commit is contained in:
Simon Warta
2020-10-08 10:29:41 +02:00
parent 26a3684fe8
commit eba148326a
29 changed files with 126 additions and 121 deletions
+1 -1
View File
@@ -16,7 +16,7 @@ const coralnetOptions: Options = {
},
};
const wallet = await Secp256k1Wallet.generate(12, coralnetOptions.hdPath, coralnetOptions.bech32prefix);
const wallet = await Secp256k1HdWallet.generate(12, coralnetOptions.hdPath, coralnetOptions.bech32prefix);
const [{ address }] = await wallet.getAccounts();
const client = new SigningCosmWasmClient(
+1 -1
View File
@@ -1,4 +1,4 @@
const wallet = await Secp256k1Wallet.fromMnemonic(
const wallet = await Secp256k1HdWallet.fromMnemonic(
"enlist hip relief stomach skate base shallow young switch frequent cry park",
);
const [{ address: senderAddress }] = await wallet.getAccounts();
+1 -1
View File
@@ -2,7 +2,7 @@ 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 wallet = await Secp256k1Wallet.fromMnemonic(mnemonic, makeCosmoshubPath(i), "cosmos");
const wallet = await Secp256k1HdWallet.fromMnemonic(mnemonic, makeCosmoshubPath(i), "cosmos");
const [{ address, pubkey }] = await wallet.getAccounts();
console.info(`Address ${i}: ${address}`);
console.info(`Pubkey ${i}: ${toBase64(pubkey)}`);
+1 -1
View File
@@ -1,5 +1,5 @@
const mnemonic = Bip39.encode(Random.getBytes(16)).toString();
const wallet = await Secp256k1Wallet.fromMnemonic(mnemonic);
const wallet = await Secp256k1HdWallet.fromMnemonic(mnemonic);
const [{ address, pubkey }] = await wallet.getAccounts();
console.info("mnemonic:", mnemonic);
+2 -2
View File
@@ -33,7 +33,7 @@ const connect = async (
}> => {
const options: Options = { ...defaultOptions, ...opts };
const gasPrice = GasPrice.fromString(`${options.gasPrice}${options.feeToken}`);
const wallet = await Secp256k1Wallet.fromMnemonic(mnemonic);
const wallet = await Secp256k1HdWallet.fromMnemonic(mnemonic);
const [{ address }] = await wallet.getAccounts();
const client = new SigningCosmWasmClient(options.httpUrl, address, wallet, gasPrice);
@@ -68,7 +68,7 @@ const randomAddress = async (prefix: string): Promise<string> => {
};
const mnemonicToAddress = async (prefix: string, mnemonic: string): Promise<string> => {
const wallet = await Secp256k1Wallet.fromMnemonic(mnemonic);
const wallet = await Secp256k1HdWallet.fromMnemonic(mnemonic);
const [{ address }] = await wallet.getAccounts();
return address;
};
+1 -1
View File
@@ -14,5 +14,5 @@ const faucetMnemonic =
"economy stock theory fatal elder harbor betray wasp final emotion task crumble siren bottom lizard educate guess current outdoor pair theory focus wife stone";
const faucetAddress = "cosmos1pkptre7fdkl6gfrzlesjjvhxhlc3r4gmmk8rs6";
const wallet = await Secp256k1Wallet.fromMnemonic(faucetMnemonic);
const wallet = await Secp256k1HdWallet.fromMnemonic(faucetMnemonic);
const client = new LcdClient(defaultHttpUrl);