Class: Signature
Defined in: core-sdk/src/bytes/signature.ts:26
A 65-byte ECDSA signature (r || s || v), as produced by PrivateKey.sign.
Extends
Constructors
Constructor
new Signature(
bytes):Signature
Defined in: core-sdk/src/bytes/signature.ts:29
Parameters
bytes
string | Uint8Array<ArrayBufferLike> | Bytes
Returns
Signature
Overrides
Properties
length
readonlylength:number
Defined in: core-sdk/src/bytes/bytes.ts:19
Inherited from
LENGTH
readonlystaticLENGTH:65=65
Defined in: core-sdk/src/bytes/signature.ts:27
Methods
equals()
equals(
other):boolean
Defined in: core-sdk/src/bytes/bytes.ts:166
Byte-wise equality against another Bytes instance, raw bytes, or hex string.
Parameters
other
string | Uint8Array<ArrayBufferLike> | Bytes
Returns
boolean
Inherited from
isValid()
isValid(
digest,expectedAddress):boolean
Defined in: core-sdk/src/bytes/signature.ts:57
Returns whether this signature over digest was produced by the owner
of expectedAddress.
Parameters
digest
string | Uint8Array<ArrayBufferLike>
expectedAddress
string | Uint8Array<ArrayBufferLike> | EthAddress
Returns
boolean
offset()
offset(
index):Uint8Array
Defined in: core-sdk/src/bytes/bytes.ts:110
Returns a copy of the bytes from index to the end.
Parameters
index
number
Returns
Uint8Array
Inherited from
recoverPublicKey()
recoverPublicKey(
digest):PublicKey
Defined in: core-sdk/src/bytes/signature.ts:44
Recovers the public key that produced this signature over digest,
following the same personal_sign convention as PrivateKey.sign.
Parameters
digest
string | Uint8Array<ArrayBufferLike>
Returns
represent()
represent():
string
Defined in: core-sdk/src/bytes/bytes.ts:173
Human-readable representation, used by debuggers/loggers. Same as toHex.
Returns
string
Inherited from
toBase32()
toBase32():
string
Defined in: core-sdk/src/bytes/bytes.ts:138
Encodes as a padded base32 string.
Returns
string
Inherited from
toBase64()
toBase64():
string
Defined in: core-sdk/src/bytes/bytes.ts:131
Encodes as a padded base64 string.
Returns
string
Inherited from
toHex()
toHex():
string
Defined in: core-sdk/src/bytes/bytes.ts:124
Encodes as a lowercase hex string, with no 0x prefix.
Returns
string
Inherited from
toJSON()
toJSON():
unknown
Defined in: core-sdk/src/bytes/bytes.ts:159
Decodes the bytes as UTF-8 JSON.
Returns
unknown
Inherited from
toString()
toString():
string
Defined in: core-sdk/src/bytes/bytes.ts:145
Same as toHex.
Returns
string
Inherited from
toUint8Array()
toUint8Array():
Uint8Array
Defined in: core-sdk/src/bytes/bytes.ts:117
Returns a copy of the underlying bytes.
Returns
Uint8Array
Inherited from
toUtf8()
toUtf8():
string
Defined in: core-sdk/src/bytes/bytes.ts:152
Decodes the bytes as UTF-8 text.
Returns
string
Inherited from
concat()
staticconcat(...arrays):Uint8Array
Defined in: core-sdk/src/bytes/bytes.ts:75
Concatenates any number of byte arrays (or Bytes instances) into one new array.
Parameters
arrays
...(Uint8Array<ArrayBufferLike> | Bytes)[]
Returns
Uint8Array
Inherited from
fromSlice()
staticfromSlice(bytes,start):Signature
Defined in: core-sdk/src/bytes/signature.ts:36
Reads a 65-byte Signature out of a larger buffer, starting at start.
Parameters
bytes
Uint8Array
start
number
Returns
Signature
Overrides
fromUtf8()
staticfromUtf8(utf8):Bytes
Defined in: core-sdk/src/bytes/bytes.ts:92
Wraps the UTF-8 encoding of a string.
Parameters
utf8
string
Returns
Inherited from
keccak256()
statickeccak256(bytes):Bytes
Defined in: core-sdk/src/bytes/bytes.ts:68
Hashes bytes with keccak256 and wraps the 32-byte digest.
Parameters
bytes
string | ArrayBuffer | Uint8Array<ArrayBufferLike> | Bytes