diff --git a/StellarDotnetSdk/Operations/ChangeTrustOperation.cs b/StellarDotnetSdk/Operations/ChangeTrustOperation.cs index dce87d13..12805c26 100644 --- a/StellarDotnetSdk/Operations/ChangeTrustOperation.cs +++ b/StellarDotnetSdk/Operations/ChangeTrustOperation.cs @@ -49,15 +49,35 @@ public ChangeTrustOperation(Asset asset, string? limit = null, IAccountId? sourc /// /// Asset A. /// Asset B. + /// The fee for the liquidity pool /// /// The limit of the trustline. ///
Leave empty to default to the max int64.
///Set to 0 to remove the trust line.
/// - public ChangeTrustOperation(Asset assetA, Asset assetB, string? limit = null, IAccountId? sourceAccount = null) : + /// (Optional) Source account of the operation. + [Obsolete("Use the constructor with the ChangeTrustAsset parameter instead.")] + public ChangeTrustOperation(Asset assetA, Asset assetB, int? liquidityPoolFee = null, string? limit = null, IAccountId? sourceAccount = null) : + base(sourceAccount) + { + Asset = ChangeTrustAsset.Create(assetA, assetB, liquidityPoolFee ?? LiquidityPoolParameters.Fee); + Limit = limit ?? MaxLimit; + } + + ///Leave empty to default to the max int64.
+ ///Set to 0 to remove the trust line.
+ /// + /// (Optional) Source account of the operation. + public ChangeTrustOperation(ChangeTrustAsset changeTrustAsset, string? limit = null, IAccountId? sourceAccount = null) : base(sourceAccount) { - Asset = ChangeTrustAsset.Create(assetA, assetB, LiquidityPoolParameters.Fee); + Asset = changeTrustAsset; Limit = limit ?? MaxLimit; } @@ -99,7 +119,7 @@ public static ChangeTrustOperation FromXdr(ChangeTrustOp changeTrustOp) var parameters = (LiquidityPoolConstantProductParameters)liquidityPoolShareChangeTrustAsset.Parameters; return new ChangeTrustOperation( - parameters.AssetA, parameters.AssetB, Amount.FromXdr(changeTrustOp.Limit.InnerValue) + parameters.AssetA, parameters.AssetB, parameters.Fee, Amount.FromXdr(changeTrustOp.Limit.InnerValue) ); default: throw new ArgumentOutOfRangeException();