Skip to main content

Class: Secp256k1Wallet

@shareledgerjs/client.Secp256k1Wallet

A wallet that holds a single secp256k1 keypair.

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

Implements

  • OfflineDirectSigner

Constructors

constructor

Private new Secp256k1Wallet()

Properties

prefix

Private Readonly prefix: any


privkey

Private Readonly privkey: any


pubkey

Private Readonly pubkey: any

Accessors

address

Private get address(): any

Returns

any

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

NameTypeDescription
privkeyUint8ArrayThe private key.
prefix?stringThe bech32 address prefix (human readable part). Defaults to "shareledger".

Returns

Promise<Secp256k1Wallet>