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
Name | Type |
---|---|
privkey | Uint8Array |
pubkey | Uint8Array |
prefix | string |
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
Name | Type |
---|---|
address | string |
signDoc | SignDoc |
Returns
Promise
<DirectSignResponse
>
Implementation of
OfflineDirectSigner.signDirect
fromKey
▸ Static
fromKey(privkey
, prefix?
): Promise
<Secp256k1Wallet
>
Creates a Secp256k1Wallet from the given private key
Parameters
Name | Type | Default value | Description |
---|---|---|---|
privkey | Uint8Array | undefined | The private key. |
prefix | string | "shareledger" | The bech32 address prefix (human readable part). Defaults to "shareledger". |
Returns
Promise
<Secp256k1Wallet
>