-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DRAFT: MPT Support #558
base: mpt-amounts
Are you sure you want to change the base?
DRAFT: MPT Support #558
Conversation
…t a different approach to MptAmounts
xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/flags/MpTokenAuthorizeFlags.java
Outdated
Show resolved
Hide resolved
xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/flags/MpTokenFlags.java
Outdated
Show resolved
Hide resolved
xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/flags/MpTokenIssuanceCreateFlags.java
Outdated
Show resolved
Hide resolved
/** | ||
* Constant {@link MpTokenIssuanceFlags} for the {@code lsfMPTLocked} account flag. | ||
*/ | ||
public static final MpTokenIssuanceFlags LOCKED = new MpTokenIssuanceFlags(0x00000001); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's discuss this one in particular.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"this one" meaning LOCKED
or MpTokenIssuanceFlags
having an of(long)
method?
xrpl4j-core/src/main/java/org/xrpl/xrpl4j/model/flags/MpTokenIssuanceSetFlags.java
Outdated
Show resolved
Hide resolved
|
||
@Override | ||
public MpTokenIssuanceId deserialize(JsonParser jsonParser, DeserializationContext ctxt) throws IOException { | ||
return MpTokenIssuanceId.of(jsonParser.getText()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this value expected to be in HEX? Just thinking out loud if MpTokenIssuanceId
should be represented as a String
in Java.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so? Isn't it the hash of the issuer address concatenated with the sequence?
/** | ||
* Custom Jackson serializer for {@link MpTokenObjectAmount}s. | ||
*/ | ||
public class MpTokenObjectAmountSerializer extends StdScalarSerializer<MpTokenObjectAmount> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify what this object is?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is for MPT amounts that aren't MpTokenAmount
s, ie for sfMaximumAmount
, sfOutstandingAmount
and sfMPTAmount
. I have a separate type for all of these because they're UInt64s, but are serialized in JSON as base 10 rather than base 16.
To your comment below about if this could be replaced by MpTokenAmount
, I don't see how that's possible, as MpTokenAmount
holds the issuance ID as well as the amount. In the places MpTokenObjectAmount
s show up, there isn't necessarily an issuance ID present
Optional<AssetScale> assetScale(); | ||
|
||
@JsonProperty("MaximumAmount") | ||
Optional<MpTokenObjectAmount> maximumAmount(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any world where MpTokenObjectAmount
can be replaced by MpTokenAmount
(esp if this suggestion is taken)?
($) -> fail() | ||
); | ||
|
||
void handleWithNulls() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Still need handleMpt
, mapMpt
, and maxMpt
.
Deserialize mpt amounts as base 10
No description provided.