Class: Signer
@fuel-ts/account.Signer
Constructors
constructor
• new Signer(privateKey
): Signer
Create a Signer instance from a given private key
Parameters
Name | Type | Description |
---|---|---|
privateKey | BytesLike | The private key to use for signing |
Returns
A new Signer instance
Defined in
packages/account/src/signer/signer.ts:24
Properties
address
• Readonly
address: Address
Defined in
packages/account/src/signer/signer.ts:10
compressedPublicKey
• Readonly
compressedPublicKey: string
Defined in
packages/account/src/signer/signer.ts:14
privateKey
• Readonly
privateKey: string
Defined in
packages/account/src/signer/signer.ts:16
publicKey
• Readonly
publicKey: string
Defined in
packages/account/src/signer/signer.ts:12
Methods
addPoint
▸ addPoint(point
): string
Add point on the current elliptic curve
Parameters
Name | Type | Description |
---|---|---|
point | BytesLike | Point to add on the curve |
Returns
string
compressed point on the curve
Defined in
packages/account/src/signer/signer.ts:72
extendPublicKey
▸ extendPublicKey(publicKey
): string
Extended publicKey from a compact publicKey
Parameters
Name | Type | Description |
---|---|---|
publicKey | BytesLike | Compact publicKey |
Returns
string
extended publicKey
Defined in
packages/account/src/signer/signer.ts:130
generatePrivateKey
▸ generatePrivateKey(entropy?
): string
| Uint8Array
Generate a random privateKey
Parameters
Name | Type | Description |
---|---|---|
entropy? | BytesLike | Adds extra entropy to generate the privateKey |
Returns
string
| Uint8Array
random 32-byte hashed
Defined in
packages/account/src/signer/signer.ts:120
recoverAddress
▸ recoverAddress(data
, signature
): Address
Recover the address from a signature performed with sign
.
Parameters
Name | Type | Description |
---|---|---|
data | BytesLike | Data |
signature | BytesLike | Signature |
Returns
Address from signature
Defined in
packages/account/src/signer/signer.ts:110
recoverPublicKey
▸ recoverPublicKey(data
, signature
): string
Recover the public key from a signature performed with sign
.
Parameters
Name | Type | Description |
---|---|---|
data | BytesLike | Data |
signature | BytesLike | hashed signature |
Returns
string
public key from signature from the