Rename Secp256k1Wallet -> Secp256k1HdWallet
This commit is contained in:
@@ -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,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();
|
||||
|
||||
@@ -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,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);
|
||||
|
||||
@@ -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;
|
||||
};
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -113,7 +113,7 @@ export async function main(originalArgs: readonly string[]): Promise<void> {
|
||||
"OfflineSigner",
|
||||
"PubKey",
|
||||
"pubkeyToAddress",
|
||||
"Secp256k1Wallet",
|
||||
"Secp256k1HdWallet",
|
||||
"SigningCosmosClient",
|
||||
"StdFee",
|
||||
"StdSignDoc",
|
||||
@@ -160,7 +160,7 @@ export async function main(originalArgs: readonly string[]): Promise<void> {
|
||||
assert(Decimal.fromAtomics("12870000", 6).toString() === "12.87");
|
||||
|
||||
const mnemonic = Bip39.encode(Random.getBytes(16)).toString();
|
||||
const wallet = await Secp256k1Wallet.fromMnemonic(mnemonic, makeCosmoshubPath(0));
|
||||
const wallet = await Secp256k1HdWallet.fromMnemonic(mnemonic, makeCosmoshubPath(0));
|
||||
const [{ address }] = await wallet.getAccounts();
|
||||
const data = toAscii("foo bar");
|
||||
const fee: StdFee = {
|
||||
|
||||
Reference in New Issue
Block a user