diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b2cc9f..fd98f19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### v0.5.6 +- Support asset deposit entry + ### v0.5.5 - Add search user diff --git a/library/src/main/kotlin/one/mixin/bot/vo/Asset.kt b/library/src/main/kotlin/one/mixin/bot/vo/Asset.kt index 44339c1..70ce7c7 100644 --- a/library/src/main/kotlin/one/mixin/bot/vo/Asset.kt +++ b/library/src/main/kotlin/one/mixin/bot/vo/Asset.kt @@ -11,6 +11,8 @@ data class Asset( val iconUrl: String, val balance: String, val destination: String, + @SerializedName("deposit_entries") + val depositEntries: List?, val tag: String?, @SerializedName("price_btc") val priceBtc: String, diff --git a/library/src/main/kotlin/one/mixin/bot/vo/DepositEntry.kt b/library/src/main/kotlin/one/mixin/bot/vo/DepositEntry.kt new file mode 100644 index 0000000..94ba2ee --- /dev/null +++ b/library/src/main/kotlin/one/mixin/bot/vo/DepositEntry.kt @@ -0,0 +1,12 @@ +package one.mixin.bot.vo + +import com.google.gson.annotations.SerializedName + +class DepositEntry( + @SerializedName("destination") + val destination: String, + @SerializedName("tag") + val tag: String?, + @SerializedName("properties") + val properties: List? +) diff --git a/samples/src/main/java/jvmMain/kotlin/Sample.kt b/samples/src/main/java/jvmMain/kotlin/Sample.kt index df66afa..4673362 100644 --- a/samples/src/main/java/jvmMain/kotlin/Sample.kt +++ b/samples/src/main/java/jvmMain/kotlin/Sample.kt @@ -159,9 +159,9 @@ internal suspend fun transferToUser( private suspend fun getAsset(client: HttpClient) { // Get asset - val assetResponse = client.assetService.getAsset(CNB_ID) + val assetResponse = client.assetService.getAsset(BTC_ID) if (assetResponse.isSuccess()) { - println("Assets ${assetResponse.data?.symbol}: ${assetResponse.data?.balance}") + println("Assets ${assetResponse.data?.symbol}: ${assetResponse.data?.balance} ${assetResponse.data?.depositEntries?.last()?.properties}") } else { println("Assets failure ${assetResponse.error}") }