Skip to content

Commit 821e672

Browse files
author
astinz
committed
feat: add addr formating
1 parent 69df08f commit 821e672

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

library/src/commonMain/kotlin/xyz/mcxross/mbl/model/AccountAddress.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ package xyz.mcxross.mbl.model
1818
data class AccountAddress(
1919
val data: ByteArray
2020
) {
21+
22+
override fun toString(): String {
23+
return buildString {
24+
append("0x")
25+
data.forEach { byte ->
26+
append(byte.toInt().and(0xFF).toString(16).padStart(2, '0'))
27+
}
28+
}
29+
}
30+
2131
override fun equals(other: Any?): Boolean {
2232
if (this === other) return true
2333
if (other == null || this::class != other::class) return false

0 commit comments

Comments
 (0)