Class: Signer
Defined in: Signer.ts:34
Class that signs BIP-322 signature using a private key. Reference: https://github.com/LegReq/bip0322-signatures/blob/master/BIP0322_signing.ipynb
Constructors
Constructor
new Signer():
Signer
Returns
Signer
Methods
sign()
static
sign(privateKeyOrWIF
,address
,message
,network
):any
Defined in: Signer.ts:43
Sign a BIP-322 signature from P2WPKH, P2SH-P2WPKH, and single-key-spend P2TR address and its corresponding private key.
Parameters
Parameter | Type | Default value | Description |
---|---|---|---|
privateKeyOrWIF | string | Buffer | undefined | - |
address | string | undefined | Address to be signing the message |
message | string | undefined | message_challenge to be signed by the address |
network | Network | bitcoin.networks.bitcoin | Network that the address is located, defaults to the Bitcoin mainnet |
Returns
any
BIP-322 simple signature, encoded in base-64
signAsync()
static
signAsync(signer
,address
,message
,network
):Promise
<any
>
Defined in: Signer.ts:104
Parameters
Parameter | Type | Default value |
---|---|---|
signer | string | Buffer | Signer | undefined |
address | string | undefined |
message | string | undefined |
network | Network | bitcoin.networks.bitcoin |
Returns
Promise
<any
>