Skip to content

Commit

Permalink
Support asset deposit entry
Browse files Browse the repository at this point in the history
  • Loading branch information
SeniorZhai committed Jul 4, 2022
1 parent 3f5f19f commit 3b5def6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### v0.5.6
- Support asset deposit entry

### v0.5.5
- Add search user

Expand Down
2 changes: 2 additions & 0 deletions library/src/main/kotlin/one/mixin/bot/vo/Asset.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ data class Asset(
val iconUrl: String,
val balance: String,
val destination: String,
@SerializedName("deposit_entries")
val depositEntries: List<DepositEntry>?,
val tag: String?,
@SerializedName("price_btc")
val priceBtc: String,
Expand Down
12 changes: 12 additions & 0 deletions library/src/main/kotlin/one/mixin/bot/vo/DepositEntry.kt
Original file line number Diff line number Diff line change
@@ -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<String>?
)
4 changes: 2 additions & 2 deletions samples/src/main/java/jvmMain/kotlin/Sample.kt
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
}
Expand Down

0 comments on commit 3b5def6

Please sign in to comment.