TAALSigner
scrypt-ts / TAALSigner
Class: TAALSigner
A Signer is a class which in some way directly or indirectly has access to a private key, which can sign messages and transactions to authorize the network to perform operations.
Hierarchy
↳
TAALSigner
Table of contents
Constructors
Properties
Accessors
Methods
- connect
- getBalance
- getDefaultAddress
- getDefaultPubKey
- getNetwork
- getPubKey
- getSignatures
- isAuthenticated
- listUnspent
- requestAuth
- signAndsendTransaction
- signMessage
- signRawTransaction
- signTransaction
- updateInputsWithInfo
- isSigner
Constructors
constructor
• new TAALSigner(provider, app_name?)
Parameters
| Name | Type |
|---|---|
provider | Provider |
app_name? | string |
Overrides
Defined in
dist/bsv/signers/taal-signer/index.d.ts:14
Properties
_app_name
• Private _app_name: any
Defined in
dist/bsv/signers/taal-signer/index.d.ts:13
_isSigner
• Readonly _isSigner: boolean
Inherited from
Defined in
dist/bsv/abstract-signer.d.ts:57
_port
• Private _port: any
Defined in
dist/bsv/signers/taal-signer/index.d.ts:12
assertIsAuthenticated
• Private assertIsAuthenticated: any
Defined in
dist/bsv/signers/taal-signer/index.d.ts:20
provider
• Optional provider: Provider
Inherited from
Defined in
dist/bsv/abstract-signer.d.ts:56
signCustomInput
• Private signCustomInput: any
Defined in
dist/bsv/signers/taal-signer/index.d.ts:41
Accessors
connectedProvider
• get connectedProvider(): Provider
Get the connected provider.
Throws
if no provider is connected to this.
Returns
the connected provider.
Inherited from
Signer.connectedProvider
Defined in
dist/bsv/abstract-signer.d.ts:133
Methods
connect
▸ connect(provider?): Promise<TAALSigner>
Connect a provider to this. If a new provider is specified when connecting,
a connection will be established for the new provider and then switched to the new provider.
If no new provider is specified, a connection is established for signer's built-in provider.
If neither exists, an exception is thrown.
Parameters
| Name | Type | Description |
|---|---|---|
provider? | Provider | The target provider. |
Returns
Promise<TAALSigner>
Overrides
Defined in
dist/bsv/signers/taal-signer/index.d.ts:21
getBalance
▸ getBalance(address?): Promise<{ confirmed: number ; unconfirmed: number }>
Get the balance of BSVs in satoshis for an address.
Parameters
| Name | Type | Description |
|---|---|---|
address? | Address | The query address. |
Returns
Promise<{ confirmed: number ; unconfirmed: number }>
A promise which resolves to the address balance status.
Overrides
Defined in
dist/bsv/signers/taal-signer/index.d.ts:37
getDefaultAddress
▸ getDefaultAddress(): Promise<Address>
Returns
Promise<Address>
A promise which resolves to the address to the default private key of the signer.
Overrides
Defined in
dist/bsv/signers/taal-signer/index.d.ts:22
getDefaultPubKey
▸ getDefaultPubKey(): Promise<PublicKey>
Returns
Promise<PublicKey>
A promise which resolves to the public key of the default private key of the signer.
Overrides
Defined in
dist/bsv/signers/taal-signer/index.d.ts:23
getNetwork
▸ getNetwork(): Promise<any>
Returns
Promise<any>
Defined in
dist/bsv/signers/taal-signer/index.d.ts:26
getPubKey
▸ getPubKey(address): Promise<PublicKey>
Throws
If the private key for the address does not belong this signer.
Parameters
| Name | Type | Description |
|---|---|---|
address | Address | The request address, using the default address if omitted. |
Returns
Promise<PublicKey>
The public key result.
Overrides
Defined in
dist/bsv/signers/taal-signer/index.d.ts:24
getSignatures
▸ getSignatures(rawTxHex, sigRequests): Promise<SignatureResponse[]>
Get signatures with api
Parameters
| Name | Type | Description |
|---|---|---|
rawTxHex | string | a transation raw hex |
sigRequests | SignatureRequest[] | a SignatureRequest array for the some inputs of the transaction. |
Returns
Promise<SignatureResponse[]>
a SignatureResponse array
Overrides
Defined in
dist/bsv/signers/taal-signer/index.d.ts:35
isAuthenticated
▸ isAuthenticated(): Promise<boolean>
Check if the wallet has been authenticated
Returns
Promise<boolean>
true | false
Overrides
Defined in
dist/bsv/signers/taal-signer/index.d.ts:15
listUnspent
▸ listUnspent(address, options?): Promise<IUnspentOutput[]>
Get a list of the P2PKH UTXOs.
Parameters
| Name | Type | Description |
|---|---|---|
address | Address | The address of the returned UTXOs belongs to. |
options? | UtxoQueryOptions | The optional query conditions, see details in UtxoQueryOptions. |
Returns
Promise<IUnspentOutput[]>
A promise which resolves to a list of UTXO for the query options.
Inherited from
Defined in
dist/bsv/abstract-signer.d.ts:147
requestAuth
▸ requestAuth(): Promise<{ error: string ; isAuthenticated: boolean }>
Request wallet authentication
Returns
Promise<{ error: string ; isAuthenticated: boolean }>
A promise which resolves to if the wallet has been authenticated and the authenticate error message
Overrides
Defined in
dist/bsv/signers/taal-signer/index.d.ts:16
signAndsendTransaction
▸ signAndsendTransaction(tx, options?): Promise<TransactionResponse>
Sign transaction and broadcast it
Parameters
| Name | Type | Description |
|---|---|---|
tx | Transaction | A transaction is signed and broadcast |
options? | SignTransactionOptions | The options for signing, see the details of SignTransactionOptions. |
Returns
Promise<TransactionResponse>
A promise which resolves to the transaction id.
Inherited from
Defined in
dist/bsv/abstract-signer.d.ts:140
signMessage
▸ signMessage(message, address?): Promise<string>
Sign a message string.
Parameters
| Name | Type | Description |
|---|---|---|
message | string | The message to be signed. |
address? | Address | The optional address whose private key will be used to sign message, using the default private key if omitted. |
Returns
Promise<string>
A promise which resolves to the signautre of the message.
Overrides
Defined in
dist/bsv/signers/taal-signer/index.d.ts:36
signRawTransaction
▸ signRawTransaction(rawTxHex, options): Promise<string>
Sign a raw transaction hex string.
Throws
If any input of the transaction can not be signed properly.
Parameters
| Name | Type | Description |
|---|---|---|
rawTxHex | string | The raw transaction hex to sign. |
options | SignTransactionOptions | The options for signing, see the details of SignTransactionOptions. |
Returns
Promise<string>
A promise which resolves to the signed transaction hex string.
Overrides
Defined in
dist/bsv/signers/taal-signer/index.d.ts:25
signTransaction
▸ signTransaction(tx, options?): Promise<Transaction>
Sign a transaction object.
Parameters
| Name | Type | Description |
|---|---|---|
tx | Transaction | The transaction object to sign. |
options? | SignTransactionOptions | The options for signing, see the details of SignTransactionOptions. |
Returns
Promise<Transaction>
A promise which resolves to the signed transaction object.
Overrides
Defined in
dist/bsv/signers/taal-signer/index.d.ts:28
updateInputsWithInfo
▸ updateInputsWithInfo(tx, inputInfos): Transaction
Parameters
| Name | Type |
|---|---|
tx | Transaction |
inputInfos | InputInfo[] |
Returns
Defined in
dist/bsv/signers/taal-signer/index.d.ts:27
isSigner
▸ Static isSigner(value): value is Signer
Check if an object is a Signer
Parameters
| Name | Type | Description |
|---|---|---|
value | any | The target object |
Returns
value is Signer
Returns true if and only if object is a Provider.
Inherited from
Defined in
dist/bsv/abstract-signer.d.ts:162