sdk38: Rename Secp256k1OfflineWallet -> Secp256k1Wallet

This commit is contained in:
willclarktech
2020-07-14 14:35:12 +02:00
parent 0561dd5dd5
commit 21f083336e
28 changed files with 82 additions and 89 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
const wallet = await Secp256k1OfflineWallet.fromMnemonic(
const wallet = await Secp256k1Wallet.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 Secp256k1OfflineWallet.fromMnemonic(mnemonic, makeCosmoshubPath(i), "cosmos");
const wallet = await Secp256k1Wallet.fromMnemonic(mnemonic, makeCosmoshubPath(i), "cosmos");
const [{ address, pubkey }] = await wallet.getAccounts();
console.info(`Address ${i}: ${address}`);
console.info(`Pubkey ${i}: ${pubkey}`);
+1 -1
View File
@@ -1,5 +1,5 @@
const mnemonic = Bip39.encode(Random.getBytes(16)).toString();
const wallet = await Secp256k1OfflineWallet.fromMnemonic(mnemonic);
const wallet = await Secp256k1Wallet.fromMnemonic(mnemonic);
const [{ address, pubkey }] = await wallet.getAccounts();
console.info("mnemonic:", mnemonic);
+2 -2
View File
@@ -52,7 +52,7 @@ const connect = async (
}> => {
const options: Options = { ...defaultOptions, ...opts };
const feeTable = buildFeeTable(options.feeToken, options.gasPrice);
const wallet = await Secp256k1OfflineWallet.fromMnemonic(mnemonic);
const wallet = await Secp256k1Wallet.fromMnemonic(mnemonic);
const [{ address }] = await wallet.getAccounts();
const client = new SigningCosmWasmClient(options.httpUrl, address, wallet, feeTable);
@@ -92,7 +92,7 @@ const randomAddress = async (prefix: string): Promise<string> => {
};
const mnemonicToAddress = async (prefix: string, mnemonic: string): Promise<string> => {
const wallet = await Secp256k1OfflineWallet.fromMnemonic(mnemonic);
const wallet = await Secp256k1Wallet.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 Secp256k1OfflineWallet.fromMnemonic(faucetMnemonic);
const wallet = await Secp256k1Wallet.fromMnemonic(faucetMnemonic);
const client = new LcdClient(defaultHttpUrl);
+2 -2
View File
@@ -100,7 +100,7 @@ export function main(originalArgs: readonly string[]): void {
"OfflineSigner",
"PubKey",
"pubkeyToAddress",
"Secp256k1OfflineWallet",
"Secp256k1Wallet",
"SigningCosmosClient",
"StdFee",
"StdTx",
@@ -145,7 +145,7 @@ export function main(originalArgs: readonly string[]): void {
assert(Decimal.fromAtomics("12870000", 6).toString() === "12.87");
const mnemonic = Bip39.encode(Random.getBytes(16)).toString();
const wallet = await Secp256k1OfflineWallet.fromMnemonic(mnemonic, makeCosmoshubPath(0));
const wallet = await Secp256k1Wallet.fromMnemonic(mnemonic, makeCosmoshubPath(0));
const [{ address }] = await wallet.getAccounts();
const data = toAscii("foo bar");
const signature = await wallet.sign(address, data);