StarkNet SDK for Kotlin
starknet.kt
StarkNet SDK for Kotlin
Ensuring idiomatic Java code
We want this library to be used by both kotlin & java users. In order to ensure a nice API for java always follow those rules:
- When using file level functions use
@file:JvmName(NAME)
to ensure a nice name withoutKt
suffix. - When using a companion object mark every property/function with
@JvmStatic
. This way they are accessible as static from the class. Without itClass.INSTANCE
would have to be used. - When defining an immutable constant use
@field:JvmField
. This makes them static properties without getters/setters in java. - If you are not sure how something would work in java just create a new java class, import your code and check yourself.