Skip to content

Commit 3b5def6

Browse files
committed
Support asset deposit entry
1 parent 3f5f19f commit 3b5def6

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
### v0.5.6
2+
- Support asset deposit entry
3+
14
### v0.5.5
25
- Add search user
36

library/src/main/kotlin/one/mixin/bot/vo/Asset.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ data class Asset(
1111
val iconUrl: String,
1212
val balance: String,
1313
val destination: String,
14+
@SerializedName("deposit_entries")
15+
val depositEntries: List<DepositEntry>?,
1416
val tag: String?,
1517
@SerializedName("price_btc")
1618
val priceBtc: String,
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
package one.mixin.bot.vo
2+
3+
import com.google.gson.annotations.SerializedName
4+
5+
class DepositEntry(
6+
@SerializedName("destination")
7+
val destination: String,
8+
@SerializedName("tag")
9+
val tag: String?,
10+
@SerializedName("properties")
11+
val properties: List<String>?
12+
)

samples/src/main/java/jvmMain/kotlin/Sample.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,9 @@ internal suspend fun transferToUser(
159159

160160
private suspend fun getAsset(client: HttpClient) {
161161
// Get asset
162-
val assetResponse = client.assetService.getAsset(CNB_ID)
162+
val assetResponse = client.assetService.getAsset(BTC_ID)
163163
if (assetResponse.isSuccess()) {
164-
println("Assets ${assetResponse.data?.symbol}: ${assetResponse.data?.balance}")
164+
println("Assets ${assetResponse.data?.symbol}: ${assetResponse.data?.balance} ${assetResponse.data?.depositEntries?.last()?.properties}")
165165
} else {
166166
println("Assets failure ${assetResponse.error}")
167167
}

0 commit comments

Comments
 (0)