A collection of kotlin functions for signing data on Ethereum.
Ethereum-Sign-Util that is currently under development, alpha builds are available in the Sonatype staging repository.
repositories {
mavenCentral()
// If you need to get Ethereum-Sign-Util versions that are not uploaded to Maven Central.
maven { url "https://s01.oss.sonatype.org/content/repositories/staging/" }
}
dependencies {
implementation 'com.portto.ethereum:sign:0.1.0'
}
Create an Ethereum-specific signature for a message.
fun personalSign(privateKey: ByteArray, data: Any): String
Sign typed data according to EIP-712. The signing differs based upon the version
.
fun signTypedData(
privateKey: ByteArray,
data: String,
version: SignTypedDataVersion = SignTypedDataVersion.V4,
): String
Hash a typed message according to EIP-712.
fun eip712Hash(typedData: String): ByteArray
Generate the "V1" hash for the provided typed message.
fun typedSignatureHash(typedData: TypedDataV1): String
Kihon, kihon@portto.com
Ethereum-Sign-Util is maintained by portto. Licensed under the MIT license.