diff --git a/packages/launchpad/src/secp256k1wallet.spec.ts b/packages/launchpad/src/secp256k1wallet.spec.ts index 6ba21057..8f638ab2 100644 --- a/packages/launchpad/src/secp256k1wallet.spec.ts +++ b/packages/launchpad/src/secp256k1wallet.spec.ts @@ -10,16 +10,16 @@ describe("Secp256k1Wallet", () => { const defaultAddress = "cosmos1kxt5x5q2l57ma2d434pqpafxdm0mgeg9c8cvtx"; const defaultPubkey = fromHex("03f146c27639179e5b67b8646108f48e1a78b146c74939e34afaa5414ad5c93f8a"); - describe("fromPrivkey", () => { + describe("fromKey", () => { it("works", async () => { - const signer = await Secp256k1Wallet.fromPrivkey(defaultPrivkey); + const signer = await Secp256k1Wallet.fromKey(defaultPrivkey); expect(signer).toBeTruthy(); }); }); describe("getAccounts", () => { it("resolves to a list of accounts", async () => { - const signer = await Secp256k1Wallet.fromPrivkey(defaultPrivkey); + const signer = await Secp256k1Wallet.fromKey(defaultPrivkey); const accounts = await signer.getAccounts(); expect(accounts.length).toEqual(1); expect(accounts[0]).toEqual({ @@ -32,7 +32,7 @@ describe("Secp256k1Wallet", () => { describe("sign", () => { it("resolves to valid signature if enabled", async () => { - const signer = await Secp256k1Wallet.fromPrivkey(defaultPrivkey); + const signer = await Secp256k1Wallet.fromKey(defaultPrivkey); const signDoc: StdSignDoc = { msgs: [], fee: { amount: [], gas: "23" }, diff --git a/packages/launchpad/src/secp256k1wallet.ts b/packages/launchpad/src/secp256k1wallet.ts index 174a6b79..7580d484 100644 --- a/packages/launchpad/src/secp256k1wallet.ts +++ b/packages/launchpad/src/secp256k1wallet.ts @@ -12,12 +12,12 @@ import { AccountData, OfflineSigner, SignResponse } from "./signer"; */ export class Secp256k1Wallet implements OfflineSigner { /** - * Creates a Secp256k1 key signer from the given private key + * Creates a Secp256k1Wallet from the given private key * * @param privkey The private key. * @param prefix The bech32 address prefix (human readable part). Defaults to "cosmos". */ - public static async fromPrivkey(privkey: Uint8Array, prefix = "cosmos"): Promise { + public static async fromKey(privkey: Uint8Array, prefix = "cosmos"): Promise { const uncompressed = (await Secp256k1.makeKeypair(privkey)).pubkey; return new Secp256k1Wallet(privkey, Secp256k1.compressPubkey(uncompressed), prefix); } diff --git a/packages/launchpad/types/secp256k1wallet.d.ts b/packages/launchpad/types/secp256k1wallet.d.ts index 401201d8..ef0f87e7 100644 --- a/packages/launchpad/types/secp256k1wallet.d.ts +++ b/packages/launchpad/types/secp256k1wallet.d.ts @@ -7,12 +7,12 @@ import { AccountData, OfflineSigner, SignResponse } from "./signer"; */ export declare class Secp256k1Wallet implements OfflineSigner { /** - * Creates a Secp256k1 key signer from the given private key + * Creates a Secp256k1Wallet from the given private key * * @param privkey The private key. * @param prefix The bech32 address prefix (human readable part). Defaults to "cosmos". */ - static fromPrivkey(privkey: Uint8Array, prefix?: string): Promise; + static fromKey(privkey: Uint8Array, prefix?: string): Promise; private readonly pubkey; private readonly privkey; private readonly prefix;