|
1 | 1 | package com.getcode.solana.organizer |
2 | 2 |
|
3 | | -import android.content.Context |
4 | 3 | import com.getcode.crypt.DerivePath |
5 | 4 | import com.getcode.crypt.DerivedKey |
6 | 5 | import com.getcode.crypt.MnemonicPhrase |
7 | 6 | import com.getcode.model.AccountInfo |
8 | 7 | import com.getcode.model.Domain |
9 | 8 | import com.getcode.model.Kin |
10 | 9 | import com.getcode.model.RelationshipBox |
| 10 | +import com.getcode.model.description |
11 | 11 | import com.getcode.solana.keys.PublicKey |
| 12 | +import com.getcode.solana.keys.base58 |
12 | 13 | import com.getcode.utils.TraceType |
13 | | -import com.getcode.utils.timedTrace |
| 14 | +import com.getcode.utils.padded |
14 | 15 | import com.getcode.utils.trace |
15 | 16 | import kotlin.math.min |
16 | 17 |
|
@@ -866,6 +867,29 @@ class Tray( |
866 | 867 | return container |
867 | 868 | } |
868 | 869 |
|
| 870 | + fun reportableRepresentation(): List<String> { |
| 871 | + return listOf( |
| 872 | + string(named = "Primary ", partialAccount = owner), |
| 873 | + string(named = "Incoming ", partialAccount = incoming), |
| 874 | + string(named = "Outgoing ", partialAccount = outgoing), |
| 875 | + string("1 ", slot = slot(SlotType.Bucket1)), |
| 876 | + string("10 ", slot = slot(SlotType.Bucket10)), |
| 877 | + string("100 ", slot = slot(SlotType.Bucket100)), |
| 878 | + string("1k ", slot = slot(SlotType.Bucket1k)), |
| 879 | + string("10k ", slot = slot(SlotType.Bucket10k)), |
| 880 | + string("100k ", slot = slot(SlotType.Bucket100k)), |
| 881 | + string("1m ", slot = slot(SlotType.Bucket1m)), |
| 882 | + ) |
| 883 | + } |
| 884 | + |
| 885 | + private fun string(named: String, partialAccount: PartialAccount): String { |
| 886 | + return "$named ${partialAccount.getCluster().vaultPublicKey.base58().padded(44)}) ${partialAccount.partialBalance.description}" |
| 887 | + } |
| 888 | + |
| 889 | + private fun string(named: String, slot: Slot): String { |
| 890 | + return "$named ${slot.getCluster().vaultPublicKey.base58().padded(44)}) ${slot.partialBalance.description}" |
| 891 | + } |
| 892 | + |
869 | 893 | override fun equals(other: Any?): Boolean { |
870 | 894 | if (this === other) return true |
871 | 895 | if (javaClass != other?.javaClass) return false |
|
0 commit comments