-
Notifications
You must be signed in to change notification settings - Fork 159
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
AMM SDK Updates #359
AMM SDK Updates #359
Conversation
xdrgen -o src/main/java/org/stellar/sdk/xdr --language=java -n org.stellar.sdk.xdr xdr/Stellar-*
src/main/java/org/stellar/sdk/LiquidityPoolConstantProductParameters.java
Outdated
Show resolved
Hide resolved
src/main/java/org/stellar/sdk/LiquidityPoolConstantProductParameters.java
Show resolved
Hide resolved
@@ -32,6 +32,13 @@ public static Asset create(String type, String code, String issuer) { | |||
} | |||
} | |||
|
|||
public static Asset create(ChangeTrustAsset.Wrapper wrapped) { |
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'm not sure if these methods are useful because calling wrapped.getAsset()
is just as easy as calling Asset.create(wrapped)
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.
Yeah, my thinking was that the conversions would be more symmetric this way. e.g. ChangeTrustAsset.create(native)
, or Asset.create(changeTrustAsset)
src/main/java/org/stellar/sdk/LiquidityPoolDepositOperation.java
Outdated
Show resolved
Hide resolved
src/main/java/org/stellar/sdk/responses/LiquidityPoolResponse.java
Outdated
Show resolved
Hide resolved
src/main/java/org/stellar/sdk/responses/effects/LiquidityPool.java
Outdated
Show resolved
Hide resolved
* @see org.stellar.sdk.Server#effects() | ||
*/ | ||
public class LiquidityPoolTradeEffectResponse extends EffectResponse { | ||
@SerializedName("liquidity_pool") |
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.
Shouldn't this be "liquidity_pool_id" ?
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.
@Kirbyrawr the field should be liquidity_pool but the type of the field is wrong. the fix is here #363
Fixes #357
This adds the new functionality and updates for AMMs, into the java sdk.
I'm definitely not a Java expert, so feedback here would be great.
Stuff I'm not sure about:
Optional.absent
vsnull
for missing fields. In other fields we've usednull
, butOptional.absent
seems cleaner? Not sure what the convention is here.Id
instances toID
?hashCode
on everything?toString
on everything?ChangeTrustAsset
andTrustLineAsset
be sortable?