Updated on 2026-08-14
This commit is contained in:
parent
9082083c95
commit
bf1c374582
9 changed files with 412 additions and 7 deletions
|
|
@ -8,30 +8,45 @@ import com.tangem.wallet.eth.EthData;
|
|||
|
||||
public class TokenData extends EthData {
|
||||
private CoinEngine.InternalAmount balanceAlter = null;
|
||||
|
||||
private Integer sequence = null;
|
||||
|
||||
@Override
|
||||
public void clearInfo() {
|
||||
super.clearInfo();
|
||||
balanceAlter = null;
|
||||
sequence = null;
|
||||
}
|
||||
|
||||
public CoinEngine.InternalAmount getBalanceAlterInInternalUnits() {
|
||||
return balanceAlter;
|
||||
|
||||
}
|
||||
|
||||
public void setBalanceAlterInInternalUnits(CoinEngine.InternalAmount value) {
|
||||
balanceAlter = value;
|
||||
}
|
||||
|
||||
public Integer getSequence() {
|
||||
return sequence;
|
||||
}
|
||||
|
||||
public void setSequence(Integer sequence) {
|
||||
this.sequence = sequence;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadFromBundle(Bundle B) {
|
||||
super.loadFromBundle(B);
|
||||
|
||||
if( B.containsKey("BalanceDecimalAlter" )) {
|
||||
if (B.containsKey("BalanceDecimalAlter")) {
|
||||
balanceAlter = new CoinEngine.InternalAmount(B.getString("BalanceDecimalAlter"), "wei");
|
||||
}else{
|
||||
balanceAlter=null;
|
||||
} else {
|
||||
balanceAlter = null;
|
||||
}
|
||||
if (B.containsKey("Sequence")) {
|
||||
sequence = B.getInt("Sequence");
|
||||
} else {
|
||||
sequence = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -40,9 +55,12 @@ public class TokenData extends EthData {
|
|||
super.saveToBundle(B);
|
||||
|
||||
try {
|
||||
if( balanceAlter!=null ) {
|
||||
if (balanceAlter != null) {
|
||||
B.putString("BalanceDecimalAlter", balanceAlter.toString());
|
||||
}
|
||||
if (sequence != null) {
|
||||
B.putInt("Sequence", sequence);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Log.e("Can't save to bundle ", e.getMessage());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue