Merge pull request #518 from public-awesome/DirectSecp256k1Wallet

Add DirectSecp256k1Wallet
This commit is contained in:
Will Clark
2020-11-12 10:57:26 +01:00
committed by GitHub
13 changed files with 316 additions and 165 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
import { pathToString } from "@cosmjs/crypto";
import { makeCosmoshubPath, Secp256k1HdWallet, SigningCosmosClient } from "@cosmjs/launchpad";
import { DirectSecp256k1Wallet, isOfflineDirectSigner, OfflineSigner } from "@cosmjs/proto-signing";
import { DirectSecp256k1HdWallet, isOfflineDirectSigner, OfflineSigner } from "@cosmjs/proto-signing";
import { SigningStargateClient } from "@cosmjs/stargate";
import * as constants from "./constants";
@@ -12,7 +12,7 @@ export async function createWallets(
stargate = true,
logging = false,
): Promise<ReadonlyArray<readonly [string, OfflineSigner]>> {
const createWallet = stargate ? DirectSecp256k1Wallet.fromMnemonic : Secp256k1HdWallet.fromMnemonic;
const createWallet = stargate ? DirectSecp256k1HdWallet.fromMnemonic : Secp256k1HdWallet.fromMnemonic;
const wallets = new Array<readonly [string, OfflineSigner]>();
// first account is the token holder