Skip to main content

DefaultSigner

@opcat-labs/scrypt-ts-opcat v1.0.4


@opcat-labs/scrypt-ts-opcat / DefaultSigner

Class: DefaultSigner

Defined in: packages/scrypt-ts-opcat/src/signers/defaultSigner.ts:33

An implemention of a simple signer which should just be used in nodejs environments.

Implements​

Constructors​

new DefaultSigner()​

new DefaultSigner(privateKey): DefaultSigner

Defined in: packages/scrypt-ts-opcat/src/signers/defaultSigner.ts:37

Parameters​

privateKey​

PrivateKey = ...

Returns​

DefaultSigner

Properties​

network​

readonly network: Network

Defined in: packages/scrypt-ts-opcat/src/signers/defaultSigner.ts:36

Methods​

getAddress()​

getAddress(): Promise\<string>

Defined in: packages/scrypt-ts-opcat/src/signers/defaultSigner.ts:49

Gets the address derived from the signer's private key and network.

Returns​

Promise\<string>

A promise resolving to the address string.

Implementation of​

Signer.getAddress


getPublicKey()​

getPublicKey(): Promise\<string>

Defined in: packages/scrypt-ts-opcat/src/signers/defaultSigner.ts:59

Returns the public key in hexadecimal format derived from the private key.

Returns​

Promise\<string>

A promise that resolves to the public key as a hex string.

Implementation of​

Signer.getPublicKey


signPsbt()​

signPsbt(psbtHex, options?): Promise\<string>

Defined in: packages/scrypt-ts-opcat/src/signers/defaultSigner.ts:74

Signs a PSBT (Partially Signed Bitcoin Transaction) with the signer's key pair.

Parameters​

psbtHex​

string

The PSBT in hexadecimal format to be signed

options?​

SignOptions

Optional signing configuration including inputs to sign

Returns​

Promise\<string>

Promise resolving to the signed PSBT in hexadecimal format

Remarks​

  • If options are provided, only specified inputs matching the signer's address/public key will be signed
  • If no options are provided, all inputs will be signed with SIGHASH_ALL

Implementation of​

Signer.signPsbt


signPsbts()​

signPsbts(reqs): Promise\<string[]>

Defined in: packages/scrypt-ts-opcat/src/signers/defaultSigner.ts:105

Signs multiple PSBTs (Partially Signed Bitcoin Transactions) in parallel.

Parameters​

reqs​

object[]

Array of objects containing PSBT hex strings and optional signing options

Returns​

Promise\<string[]>

Promise resolving to an array of signed PSBT hex strings

Implementation of​

Signer.signPsbts