encodeTyped

open fun encodeTyped(messageJson: String): Array<Byte>

Compute the hash of a struct, used for signing, according to EIP712 ("v4"). Input is a Json object (as string), with following fields: - types: map of used struct types (see makeTypes()) - primaryType: the type of the message (string) - domain: EIP712 domain specifier values - message: the message (object). Throws on error. Example input: R"({ "types": { "EIP712Domain": [ {"name": "name", "type": "string"}, {"name": "version", "type": "string"}, {"name": "chainId", "type": "uint256"}, {"name": "verifyingContract", "type": "address"} ], "Person": [ {"name": "name", "type": "string"}, {"name": "wallet", "type": "address"} ] }, "primaryType": "Person", "domain": { "name": "Ether Person", "version": "1", "chainId": 1, "verifyingContract": "0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC" }, "message": { "name": "Cow", "wallet": "CD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826" } })"); On error, empty Data is returned. Returned data must be deleted (hint: use WRAPD() macro).

Return

Non-null block of data, encoded abi input

Parameters

messageJson

Non-null json abi input