MCPcopy Create free account
hub / github.com/ccxt/ccxt / hashMessage

Method hashMessage

ts/src/aster.ts:4101–4108  ·  view source on GitHub ↗
(binaryMessage)

Source from the content-addressed store, hash-verified

4099 }
4100
4101 hashMessage (binaryMessage) {
4102 // const binaryMessage = this.encode (message);
4103 const binaryMessageLength = this.binaryLength (binaryMessage);
4104 const x19 = this.base16ToBinary ('19');
4105 const newline = this.base16ToBinary ('0a');
4106 const prefix = this.binaryConcat (x19, this.encode ('Ethereum Signed Message:'), newline, this.encode ((this.numberToString (binaryMessageLength) as string)));
4107 return '0x' + this.hash (this.binaryConcat (prefix, binaryMessage), keccak, 'hex');
4108 }
4109
4110 signHash (hash, privateKey) {
4111 this.checkRequiredCredentials ();

Callers

nothing calls this directly

Calls 6

binaryLengthMethod · 0.45
base16ToBinaryMethod · 0.45
binaryConcatMethod · 0.45
encodeMethod · 0.45
numberToStringMethod · 0.45
hashMethod · 0.45

Tested by

no test coverage detected