Skip to main content

Class: Secp256k1Wallet

@shareledgerjs/signing.Secp256k1Wallet

A wallet that holds a single secp256k1 keypair.

If you want to work with BIP39 mnemonics and multiple accounts, use Secp256k1HdWallet.

Implements

Constructors

constructor

Private new Secp256k1Wallet(privkey, pubkey, prefix)

Parameters

NameType
privkeyUint8Array
pubkeyUint8Array
prefixstring

Properties

prefix

Private Readonly prefix: string


privkey

Private Readonly privkey: Uint8Array


pubkey

Private Readonly pubkey: Uint8Array

Accessors

address

Private get address(): string

Returns

string

Methods

getAccounts

getAccounts(): Promise<readonly AccountData[]>

Returns

Promise<readonly AccountData[]>

Implementation of

OfflineDirectSigner.getAccounts


signDirect

signDirect(address, signDoc): Promise<DirectSignResponse>

Parameters

NameType
addressstring
signDocSignDoc

Returns

Promise<DirectSignResponse>

Implementation of

OfflineDirectSigner.signDirect


fromKey

Static fromKey(privkey, prefix?): Promise<Secp256k1Wallet>

Creates a Secp256k1Wallet from the given private key

Parameters

NameTypeDefault valueDescription
privkeyUint8ArrayundefinedThe private key.
prefixstring"shareledger"The bech32 address prefix (human readable part). Defaults to "shareledger".

Returns

Promise<Secp256k1Wallet>