diff --git a/StellarDotnetSdk.Tests/Assets/ChangeTrustAssetTest.cs b/StellarDotnetSdk.Tests/Assets/ChangeTrustAssetTest.cs index eda1cb1c..482bb772 100644 --- a/StellarDotnetSdk.Tests/Assets/ChangeTrustAssetTest.cs +++ b/StellarDotnetSdk.Tests/Assets/ChangeTrustAssetTest.cs @@ -35,8 +35,8 @@ public void TestCreateLiquidityPoolParameters() var liquidityPoolShareChangeTrustAsset2 = (LiquidityPoolShareChangeTrustAsset)ChangeTrustAsset.FromXdr(liquidityPoolShareChangeTrustAsset.ToXdr()); - Assert.AreEqual(liquidityPoolShareChangeTrustAsset.Parameters.GetID(), - liquidityPoolShareChangeTrustAsset2.Parameters.GetID()); + Assert.AreEqual(liquidityPoolShareChangeTrustAsset.Parameters.GetId(), + liquidityPoolShareChangeTrustAsset2.Parameters.GetId()); } [TestMethod] diff --git a/StellarDotnetSdk.Tests/Assets/LiquidityPoolShareTrustlineAssetTest.cs b/StellarDotnetSdk.Tests/Assets/LiquidityPoolShareTrustlineAssetTest.cs index 15d02e89..abb7abac 100644 --- a/StellarDotnetSdk.Tests/Assets/LiquidityPoolShareTrustlineAssetTest.cs +++ b/StellarDotnetSdk.Tests/Assets/LiquidityPoolShareTrustlineAssetTest.cs @@ -22,7 +22,7 @@ public void TestEquality() var trustlineAsset = (LiquidityPoolShareTrustlineAsset)TrustlineAsset.Create( LiquidityPoolParameters.Create(LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, assetA, assetB, 30)); - var trustlineAsset2 = new LiquidityPoolShareTrustlineAsset(trustlineAsset.ID); + var trustlineAsset2 = new LiquidityPoolShareTrustlineAsset(trustlineAsset.Id); Assert.IsTrue(trustlineAsset.Equals(trustlineAsset2)); } diff --git a/StellarDotnetSdk.Tests/Assets/TrustlineAssetTest.cs b/StellarDotnetSdk.Tests/Assets/TrustlineAssetTest.cs index 2f49ed12..2769936f 100644 --- a/StellarDotnetSdk.Tests/Assets/TrustlineAssetTest.cs +++ b/StellarDotnetSdk.Tests/Assets/TrustlineAssetTest.cs @@ -37,8 +37,8 @@ public void TestCreateParameters() var trustlineAsset = (LiquidityPoolShareTrustlineAsset)TrustlineAsset.Create( LiquidityPoolParameters.Create(XDR.LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, assetA, assetB, 30)); - var trustlineAsset2 = new LiquidityPoolShareTrustlineAsset(trustlineAsset.ID); - Assert.AreEqual(trustlineAsset.ID, trustlineAsset2.ID); + var trustlineAsset2 = new LiquidityPoolShareTrustlineAsset(trustlineAsset.Id); + Assert.AreEqual(trustlineAsset.Id, trustlineAsset2.Id); } [TestMethod] @@ -56,8 +56,8 @@ public void TestCreateShareChangeTrust() var trustlineAsset = (LiquidityPoolShareTrustlineAsset)TrustlineAsset.Create( new LiquidityPoolShareChangeTrustAsset(liquidityPoolParameters)); - var trustlineAsset2 = new LiquidityPoolShareTrustlineAsset(trustlineAsset.ID); - Assert.AreEqual(trustlineAsset.ID, trustlineAsset2.ID); + var trustlineAsset2 = new LiquidityPoolShareTrustlineAsset(trustlineAsset.Id); + Assert.AreEqual(trustlineAsset.Id, trustlineAsset2.Id); } [TestMethod] @@ -75,8 +75,8 @@ public void TestCreateLiquidityPoolId() var trustlineAsset = (LiquidityPoolShareTrustlineAsset)TrustlineAsset.Create( new LiquidityPoolShareChangeTrustAsset(liquidityPoolParameters)); - var trustlineAsset2 = (LiquidityPoolShareTrustlineAsset)TrustlineAsset.Create(trustlineAsset.ID); - Assert.AreEqual(trustlineAsset.ID, trustlineAsset2.ID); + var trustlineAsset2 = (LiquidityPoolShareTrustlineAsset)TrustlineAsset.Create(trustlineAsset.Id); + Assert.AreEqual(trustlineAsset.Id, trustlineAsset2.Id); } [TestMethod] @@ -132,6 +132,6 @@ public void TestLiquidityPoolShareTrustlineAsset() 1000)); var xdrAsset = asset.ToXdr(); var decodedAsset = (LiquidityPoolShareTrustlineAsset)TrustlineAsset.FromXdr(xdrAsset); - CollectionAssert.AreEqual(asset.ID.Hash, decodedAsset.ID.Hash); + CollectionAssert.AreEqual(asset.Id.Hash, decodedAsset.Id.Hash); } } \ No newline at end of file diff --git a/StellarDotnetSdk.Tests/ClaimLiquidityAtomTest.cs b/StellarDotnetSdk.Tests/ClaimLiquidityAtomTest.cs index 3555166e..acdad3a4 100644 --- a/StellarDotnetSdk.Tests/ClaimLiquidityAtomTest.cs +++ b/StellarDotnetSdk.Tests/ClaimLiquidityAtomTest.cs @@ -22,7 +22,7 @@ public void TestFromXdr() claimLiquidityAtomXdr.AssetBought = asset1.ToXdr(); claimLiquidityAtomXdr.AssetSold = asset2.ToXdr(); - var liquidityPool = new LiquidityPoolID(LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, + var liquidityPool = new LiquidityPoolId(LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, asset1, asset2, 100); claimLiquidityAtomXdr.LiquidityPoolID = liquidityPool.ToXdr(); var claimAtom = new StellarDotnetSdk.Xdr.ClaimAtom diff --git a/StellarDotnetSdk.Tests/LedgerEntryTest.cs b/StellarDotnetSdk.Tests/LedgerEntryTest.cs index 12237f1f..bfa252ad 100644 --- a/StellarDotnetSdk.Tests/LedgerEntryTest.cs +++ b/StellarDotnetSdk.Tests/LedgerEntryTest.cs @@ -1343,9 +1343,9 @@ public void TestStateArchivalSettings() var decodedConfigSetting = (StateArchivalSettings)LedgerEntry.FromXdrBase64(entryXdrBase64); // Assert - Assert.AreEqual(xdrConfigSetting.MaxEntryTTL.InnerValue, decodedConfigSetting.MaxEntryTTL); - Assert.AreEqual(xdrConfigSetting.MinTemporaryTTL.InnerValue, decodedConfigSetting.MinTemporaryTTL); - Assert.AreEqual(xdrConfigSetting.MinPersistentTTL.InnerValue, decodedConfigSetting.MinPersistentTTL); + Assert.AreEqual(xdrConfigSetting.MaxEntryTTL.InnerValue, decodedConfigSetting.MaxEntryTtl); + Assert.AreEqual(xdrConfigSetting.MinTemporaryTTL.InnerValue, decodedConfigSetting.MinTemporaryTtl); + Assert.AreEqual(xdrConfigSetting.MinPersistentTTL.InnerValue, decodedConfigSetting.MinPersistentTtl); Assert.AreEqual(xdrConfigSetting.PersistentRentRateDenominator.InnerValue, decodedConfigSetting.PersistentRentRateDenominator); Assert.AreEqual(xdrConfigSetting.TempRentRateDenominator.InnerValue, @@ -1508,7 +1508,7 @@ public void TestLedgerEntryTtlWithAllPropertiesPopulated() var os = new XdrDataOutputStream(); StellarDotnetSdk.Xdr.LedgerEntry.LedgerEntryData.Encode(os, xdrLedgerEntryData); var entryXdrBase64 = Convert.ToBase64String(os.ToArray()); - var decodedLedgerEntry = (LedgerEntryTTL)LedgerEntry.FromXdrBase64(entryXdrBase64); + var decodedLedgerEntry = (LedgerEntryTtl)LedgerEntry.FromXdrBase64(entryXdrBase64); // Assert CollectionAssert.AreEqual(xdrTtlEntry.KeyHash.InnerValue, decodedLedgerEntry.KeyHash); diff --git a/StellarDotnetSdk.Tests/LedgerKeyTest.cs b/StellarDotnetSdk.Tests/LedgerKeyTest.cs index ee8fa217..df930e5e 100644 --- a/StellarDotnetSdk.Tests/LedgerKeyTest.cs +++ b/StellarDotnetSdk.Tests/LedgerKeyTest.cs @@ -90,6 +90,7 @@ public void TestLedgerKeyTrustline() public void TestLedgerKeyClaimableBalance() { var balanceId = Util.HexToBytes("c582697b67cbec7f9ce64f4dc67bfb2bfd26318bb9f964f4d70e3f41f650b1e6"); + var ledgerKey = LedgerKey.ClaimableBalance(balanceId); // Act @@ -105,14 +106,14 @@ public void TestLedgerKeyLiquidityPool() { var hash = new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2 }; - var ledgerKey = LedgerKey.LiquidityPool(new LiquidityPoolID(hash)); + var ledgerKey = LedgerKey.LiquidityPool(new LiquidityPoolId(hash)); // Act var ledgerKeyXdrBase64 = ledgerKey.ToXdrBase64(); var decodedLedgerKey = (LedgerKeyLiquidityPool)LedgerKey.FromXdrBase64(ledgerKeyXdrBase64); // Assert - CollectionAssert.AreEqual(hash, decodedLedgerKey.LiquidityPoolID.Hash); + CollectionAssert.AreEqual(hash, decodedLedgerKey.LiquidityPoolId.Hash); } [TestMethod] @@ -189,17 +190,17 @@ public void TestLedgerKeyConfigSetting() var decodedLedgerKey = (LedgerKeyConfigSetting)LedgerKey.FromXdrBase64(ledgerKeyXdrBase64); // Assert - Assert.AreEqual(ledgerKey.ConfigSettingID.InnerValue, decodedLedgerKey.ConfigSettingID.InnerValue); + Assert.AreEqual(ledgerKey.ConfigSettingId.InnerValue, decodedLedgerKey.ConfigSettingId.InnerValue); } [TestMethod] public void TestLedgerKeyTtlCreationFromValidHashString() { - var ledgerKey = (LedgerKeyTTL)LedgerKey.TTL("AQIDBAUGBwgJAAECAwQFBgcICQABAgMEBQYHCAkAAQI="); + var ledgerKey = (LedgerKeyTtl)LedgerKey.Ttl("AQIDBAUGBwgJAAECAwQFBgcICQABAgMEBQYHCAkAAQI="); // Act var ledgerKeyXdrBase64 = ledgerKey.ToXdrBase64(); - var decodedLedgerKey = (LedgerKeyTTL)LedgerKey.FromXdrBase64(ledgerKeyXdrBase64); + var decodedLedgerKey = (LedgerKeyTtl)LedgerKey.FromXdrBase64(ledgerKeyXdrBase64); // Assert CollectionAssert.AreEqual(ledgerKey.Key, decodedLedgerKey.Key); diff --git a/StellarDotnetSdk.Tests/LiquidityPoolIDTest.cs b/StellarDotnetSdk.Tests/LiquidityPoolIDTest.cs index 5c509b7d..f05dfd74 100644 --- a/StellarDotnetSdk.Tests/LiquidityPoolIDTest.cs +++ b/StellarDotnetSdk.Tests/LiquidityPoolIDTest.cs @@ -15,7 +15,7 @@ public void TestCreate() var assetA = Asset.Create("native"); var assetB = Asset.CreateNonNativeAsset("ABC", "GDQNY3PBOJOKYZSRMK2S7LHHGWZIUISD4QORETLMXEWXBI7KFZZMKTL3"); - var liquidityPoolId = new LiquidityPoolID( + var liquidityPoolId = new LiquidityPoolId( XDR.LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, assetA, assetB, LiquidityPoolParameters.Fee); Assert.AreEqual("cc22414997d7e3d9a9ac3b1d65ca9cc3e5f35ce33e0bd6a885648b11aaa3b72d", liquidityPoolId.ToString()); @@ -28,7 +28,7 @@ public void TestNotLexicographicOrder() var assetB = Asset.CreateNonNativeAsset("ABC", "GDQNY3PBOJOKYZSRMK2S7LHHGWZIUISD4QORETLMXEWXBI7KFZZMKTL3"); Assert.ThrowsException( - () => new LiquidityPoolID(XDR.LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, + () => new LiquidityPoolId(XDR.LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, assetB, assetA, LiquidityPoolParameters.Fee), "Asset A must be < Asset B (Lexicographic Order)"); } @@ -39,7 +39,7 @@ public void TestEquality() var assetA = Asset.Create("native"); var assetB = Asset.CreateNonNativeAsset("ABC", "GDQNY3PBOJOKYZSRMK2S7LHHGWZIUISD4QORETLMXEWXBI7KFZZMKTL3"); - var pool1 = new LiquidityPoolID(XDR.LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, + var pool1 = new LiquidityPoolId(XDR.LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, assetA, assetB, LiquidityPoolParameters.Fee); Assert.AreEqual(pool1, pool1); @@ -52,10 +52,10 @@ public void TestInequality() var assetB = Asset.CreateNonNativeAsset("ABC", "GDQNY3PBOJOKYZSRMK2S7LHHGWZIUISD4QORETLMXEWXBI7KFZZMKTL3"); var assetC = Asset.CreateNonNativeAsset("ABCD", "GDQNY3PBOJOKYZSRMK2S7LHHGWZIUISD4QORETLMXEWXBI7KFZZMKTL3"); - var pool1 = new LiquidityPoolID(XDR.LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, + var pool1 = new LiquidityPoolId(XDR.LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, assetA, assetB, LiquidityPoolParameters.Fee); - var pool2 = new LiquidityPoolID(XDR.LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, + var pool2 = new LiquidityPoolId(XDR.LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, assetB, assetC, LiquidityPoolParameters.Fee); Assert.AreNotEqual(pool1, pool2); diff --git a/StellarDotnetSdk.Tests/Operations/InvokeHostFunctionOperationTest.cs b/StellarDotnetSdk.Tests/Operations/InvokeHostFunctionOperationTest.cs index f3792371..2addccb3 100644 --- a/StellarDotnetSdk.Tests/Operations/InvokeHostFunctionOperationTest.cs +++ b/StellarDotnetSdk.Tests/Operations/InvokeHostFunctionOperationTest.cs @@ -61,8 +61,8 @@ public void TestCreateContractOperationWithMissingSourceAccount() var xdrOperation = operation.ToXdr(); var decodedOperation = (CreateContractOperation)Operation.FromXdr(xdrOperation); - var contractIdPreimage = (ContractIDAddressPreimage)operation.HostFunction.ContractIDPreimage; - var decodedContractIdPreimage = (ContractIDAddressPreimage)decodedOperation.HostFunction.ContractIDPreimage; + var contractIdPreimage = (ContractIdAddressPreimage)operation.HostFunction.ContractIdPreimage; + var decodedContractIdPreimage = (ContractIdAddressPreimage)decodedOperation.HostFunction.ContractIdPreimage; var address = (SCAccountId)contractIdPreimage.Address; var decodedAddress = (SCAccountId)decodedContractIdPreimage.Address; @@ -90,8 +90,8 @@ public void TestCreateContractOperationFromAddressWithMissingAuthorizationEntry( var xdrOperation = operation.ToXdr(); var decodedOperation = (CreateContractOperation)Operation.FromXdr(xdrOperation); - var contractIdPreimage = (ContractIDAddressPreimage)operation.HostFunction.ContractIDPreimage; - var decodedContractIdPreimage = (ContractIDAddressPreimage)decodedOperation.HostFunction.ContractIDPreimage; + var contractIdPreimage = (ContractIdAddressPreimage)operation.HostFunction.ContractIdPreimage; + var decodedContractIdPreimage = (ContractIdAddressPreimage)decodedOperation.HostFunction.ContractIdPreimage; var address = (SCAccountId)contractIdPreimage.Address; var decodedAddress = (SCAccountId)decodedContractIdPreimage.Address; @@ -126,8 +126,8 @@ public void TestCreateContractOperationFromAddressWithValidArguments() var xdrOperation = operation.ToXdr(); var decodedOperation = (CreateContractOperation)Operation.FromXdr(xdrOperation); - var contractIdPreimage = (ContractIDAddressPreimage)operation.HostFunction.ContractIDPreimage; - var decodedContractIdPreimage = (ContractIDAddressPreimage)decodedOperation.HostFunction.ContractIDPreimage; + var contractIdPreimage = (ContractIdAddressPreimage)operation.HostFunction.ContractIdPreimage; + var decodedContractIdPreimage = (ContractIdAddressPreimage)decodedOperation.HostFunction.ContractIdPreimage; var address = (SCAccountId)contractIdPreimage.Address; var decodedAddress = (SCAccountId)decodedContractIdPreimage.Address; @@ -189,8 +189,8 @@ public void TestCreateContractOperationWithStellarAssetExecutable() var xdrOperation = operation.ToXdr(); var decodedOperation = (CreateContractOperation)Operation.FromXdr(xdrOperation); - var contractIdPreimage = (ContractIDAssetPreimage)operation.HostFunction.ContractIDPreimage; - var decodedContractIdPreimage = (ContractIDAssetPreimage)decodedOperation.HostFunction.ContractIDPreimage; + var contractIdPreimage = (ContractIdAssetPreimage)operation.HostFunction.ContractIdPreimage; + var decodedContractIdPreimage = (ContractIdAssetPreimage)decodedOperation.HostFunction.ContractIdPreimage; var asset = (AssetTypeCreditAlphaNum4)contractIdPreimage.Asset; var decodedAsset = (AssetTypeCreditAlphaNum4)decodedContractIdPreimage.Asset; diff --git a/StellarDotnetSdk.Tests/Operations/OperationTest.cs b/StellarDotnetSdk.Tests/Operations/OperationTest.cs index f84b5793..c8286035 100644 --- a/StellarDotnetSdk.Tests/Operations/OperationTest.cs +++ b/StellarDotnetSdk.Tests/Operations/OperationTest.cs @@ -733,7 +733,7 @@ public void TestRevokeClaimableBalanceSponsorshipOperation() { var operation = RevokeLedgerEntrySponsorshipOperation.ForClaimableBalance( - "c8789370cda62cdb5be83642f5af61829c0c77afde7d0fb7577a8f320467563f"); + "00000000d1d73327fc560cc09f54a11c7a64180611e1f480f3bf60117e41d19d9593b780"); var xdrOperation = operation.ToXdr(); var decodedOperation = (RevokeLedgerEntrySponsorshipOperation)Operation.FromXdr(xdrOperation); @@ -873,7 +873,7 @@ public void TestLiquidityPoolDepositOperationConstructor1() var parsedOperation = (LiquidityPoolDepositOperation)Operation.FromXdr(xdr); Assert.IsNotNull(parsedOperation.SourceAccount); Assert.AreEqual(source.AccountId, parsedOperation.SourceAccount.AccountId); - Assert.AreEqual(operation.LiquidityPoolID, parsedOperation.LiquidityPoolID); + Assert.AreEqual(operation.LiquidityPoolId, parsedOperation.LiquidityPoolId); Assert.AreEqual(operation.MaxAmountA, parsedOperation.MaxAmountA); Assert.AreEqual(operation.MaxAmountB, parsedOperation.MaxAmountB); Assert.AreEqual(operation.MinPrice, parsedOperation.MinPrice); @@ -894,7 +894,7 @@ public void TestLiquidityPoolDepositOperationConstructor2() var assetA = Asset.Create($"EUR:{keypairAssetA.AccountId}"); var assetB = Asset.Create($"USD:{keypairAssetB.AccountId}"); - var liquidityPoolId = new LiquidityPoolID( + var liquidityPoolId = new LiquidityPoolId( xdrSDK.LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, assetA, assetB, @@ -910,7 +910,7 @@ public void TestLiquidityPoolDepositOperationConstructor2() var parsedOperation = (LiquidityPoolDepositOperation)Operation.FromXdr(xdr); Assert.IsNotNull(parsedOperation.SourceAccount); Assert.AreEqual(source.AccountId, parsedOperation.SourceAccount.AccountId); - Assert.AreEqual(operation.LiquidityPoolID, parsedOperation.LiquidityPoolID); + Assert.AreEqual(operation.LiquidityPoolId, parsedOperation.LiquidityPoolId); Assert.AreEqual(operation.MaxAmountA, parsedOperation.MaxAmountA); Assert.AreEqual(operation.MaxAmountB, parsedOperation.MaxAmountB); Assert.AreEqual(operation.MinPrice, parsedOperation.MinPrice); @@ -981,7 +981,7 @@ public void TestLiquidityPoolWithdrawOperationConstructor2() var assetA = Asset.Create($"EUR:{keypairAssetA.AccountId}"); var assetB = Asset.Create($"USD:{keypairAssetB.AccountId}"); - var liquidityPoolId = new LiquidityPoolID( + var liquidityPoolId = new LiquidityPoolId( xdrSDK.LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, assetA, assetB, @@ -1063,8 +1063,8 @@ public void TestCreateContractOperation() var decodedExecutable = (ContractExecutableWasm)decodedHostFunction.Executable; Assert.AreEqual(executable.WasmHash.ToLower(), decodedExecutable.WasmHash.ToLower()); - var preimage = (ContractIDAddressPreimage)hostFunction.ContractIDPreimage; - var decodedPreimage = (ContractIDAddressPreimage)decodedHostFunction.ContractIDPreimage; + var preimage = (ContractIdAddressPreimage)hostFunction.ContractIdPreimage; + var decodedPreimage = (ContractIdAddressPreimage)decodedHostFunction.ContractIdPreimage; Assert.AreEqual(((SCAccountId)preimage.Address).InnerValue, ((SCAccountId)decodedPreimage.Address).InnerValue); CollectionAssert.AreEqual(preimage.Salt, decodedPreimage.Salt); @@ -1157,10 +1157,10 @@ public void TestDeploySacOperation() Assert.IsInstanceOfType(hostFunction.Executable, typeof(ContractExecutableStellarAsset)); Assert.IsInstanceOfType(decodedHostFunction.Executable, typeof(ContractExecutableStellarAsset)); - Assert.IsInstanceOfType(hostFunction.ContractIDPreimage, typeof(ContractIDAssetPreimage)); - Assert.IsInstanceOfType(decodedHostFunction.ContractIDPreimage, typeof(ContractIDAssetPreimage)); + Assert.IsInstanceOfType(hostFunction.ContractIdPreimage, typeof(ContractIdAssetPreimage)); + Assert.IsInstanceOfType(decodedHostFunction.ContractIdPreimage, typeof(ContractIdAssetPreimage)); - var decodedAsset = ((ContractIDAssetPreimage)decodedHostFunction.ContractIDPreimage).Asset; + var decodedAsset = ((ContractIdAssetPreimage)decodedHostFunction.ContractIdPreimage).Asset; Assert.AreEqual(((AssetTypeCreditAlphaNum4)asset).Code, ((AssetTypeCreditAlphaNum4)decodedAsset).Code); Assert.AreEqual(((AssetTypeCreditAlphaNum4)asset).Issuer, ((AssetTypeCreditAlphaNum4)decodedAsset).Issuer); } diff --git a/StellarDotnetSdk.Tests/Responses/Effects/EffectDeserializerTest.cs b/StellarDotnetSdk.Tests/Responses/Effects/EffectDeserializerTest.cs index bc1c6bc1..c069f5ae 100644 --- a/StellarDotnetSdk.Tests/Responses/Effects/EffectDeserializerTest.cs +++ b/StellarDotnetSdk.Tests/Responses/Effects/EffectDeserializerTest.cs @@ -1739,10 +1739,10 @@ public void TestSerializeDeserializeLiquidityPoolCreatedEffect() Assert.AreEqual(effect.AccountMuxedId, 1278881UL); - Assert.AreEqual(effect.LiquidityPool.ID.ToString(), + Assert.AreEqual(effect.LiquidityPool.Id.ToString(), "4f7f29db33ead1a38c2edf17aa0416c369c207ca081de5c686c050c1ad320385"); - Assert.AreEqual(effect.LiquidityPool.FeeBP, 30); + Assert.AreEqual(effect.LiquidityPool.FeeBp, 30); Assert.AreEqual(effect.LiquidityPool.TotalTrustlines, 1); Assert.AreEqual(effect.LiquidityPool.TotalShares, "0.0000000"); @@ -1768,10 +1768,10 @@ public void TestSerializeDeserializeLiquidityPoolDepositedEffect() Assert.AreEqual(effect.AccountMuxedId, 1278881UL); - Assert.AreEqual(effect.LiquidityPool.ID.ToString(), + Assert.AreEqual(effect.LiquidityPool.Id.ToString(), "4f7f29db33ead1a38c2edf17aa0416c369c207ca081de5c686c050c1ad320385"); - Assert.AreEqual(effect.LiquidityPool.FeeBP, 30); + Assert.AreEqual(effect.LiquidityPool.FeeBp, 30); Assert.AreEqual(effect.LiquidityPool.TotalTrustlines, 1); Assert.AreEqual(effect.LiquidityPool.TotalShares, "1500.0000000"); @@ -1816,10 +1816,10 @@ public void TestSerializeDeserializeLiquidityPoolRevokedEffect() Assert.AreEqual(effect.AccountMuxedId, 1278881UL); - Assert.AreEqual(effect.LiquidityPool.ID.ToString(), + Assert.AreEqual(effect.LiquidityPool.Id.ToString(), "4f7f29db33ead1a38c2edf17aa0416c369c207ca081de5c686c050c1ad320385"); - Assert.AreEqual(effect.LiquidityPool.FeeBP, 30); + Assert.AreEqual(effect.LiquidityPool.FeeBp, 30); Assert.AreEqual(effect.LiquidityPool.TotalTrustlines, 1); Assert.AreEqual(effect.LiquidityPool.TotalShares, "0.0000000"); @@ -1851,7 +1851,7 @@ public void TestSerializeDeserializeLiquidityPoolTradeEffect() Assert.IsTrue(back is LiquidityPoolTradeEffectResponse); var effect = (LiquidityPoolTradeEffectResponse)back; - Assert.AreEqual(effect.LiquidityPool.ID.ToString(), + Assert.AreEqual(effect.LiquidityPool.Id.ToString(), "4f7f29db33ead1a38c2edf17aa0416c369c207ca081de5c686c050c1ad320385"); Assert.AreEqual(effect.Sold.Asset.CanonicalName(), diff --git a/StellarDotnetSdk.Tests/Responses/LiquidityPoolDeserializerTest.cs b/StellarDotnetSdk.Tests/Responses/LiquidityPoolDeserializerTest.cs index 5dd3341a..d48ecd61 100644 --- a/StellarDotnetSdk.Tests/Responses/LiquidityPoolDeserializerTest.cs +++ b/StellarDotnetSdk.Tests/Responses/LiquidityPoolDeserializerTest.cs @@ -18,7 +18,7 @@ public void TestDeserialize() var json = File.ReadAllText(jsonPath); var instance = JsonSingleton.GetInstance(json); Assert.IsNotNull(instance); - Assert.AreEqual(new LiquidityPoolID("67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9"), + Assert.AreEqual(new LiquidityPoolId("67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9"), instance.Id); Assert.AreEqual("113725249324879873", instance.PagingToken); Assert.AreEqual(30, instance.FeeBp); @@ -56,7 +56,7 @@ public void TestSerializeDeserialize() var serialized = JsonConvert.SerializeObject(instance); var parsed = JsonConvert.DeserializeObject(serialized); Assert.IsNotNull(parsed); - Assert.AreEqual(new LiquidityPoolID("67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9"), + Assert.AreEqual(new LiquidityPoolId("67260c4c1807b262ff851b0a3fe141194936bb0215b2f77447f1df11998eabb9"), parsed.Id); Assert.AreEqual("113725249324879873", parsed.PagingToken); Assert.AreEqual(30, parsed.FeeBp); diff --git a/StellarDotnetSdk.Tests/Responses/Operations/LiquidityPoolOperationResponseTest.cs b/StellarDotnetSdk.Tests/Responses/Operations/LiquidityPoolOperationResponseTest.cs index 243878c0..1cf02ba0 100644 --- a/StellarDotnetSdk.Tests/Responses/Operations/LiquidityPoolOperationResponseTest.cs +++ b/StellarDotnetSdk.Tests/Responses/Operations/LiquidityPoolOperationResponseTest.cs @@ -22,8 +22,8 @@ public void TestPoolDeposit() Assert.IsTrue(back is LiquidityPoolDepositOperationResponse); Assert.IsNotNull(instance); var response = (LiquidityPoolDepositOperationResponse)instance; - Assert.AreEqual(new LiquidityPoolID("b26c0d6545349ad7f44ba758b7c705459537201583f2e524635be04aff84bc69"), - response.LiquidityPoolID); + Assert.AreEqual(new LiquidityPoolId("b26c0d6545349ad7f44ba758b7c705459537201583f2e524635be04aff84bc69"), + response.LiquidityPoolId); Assert.AreEqual("1508315204960257", response.PagingToken); Assert.AreEqual("1.0000000", response.MinPrice); @@ -58,8 +58,8 @@ public void TestPoolWithdraw() Assert.IsTrue(back is LiquidityPoolWithdrawOperationResponse); Assert.IsNotNull(instance); var response = (LiquidityPoolWithdrawOperationResponse)instance; - Assert.AreEqual(new LiquidityPoolID("b26c0d6545349ad7f44ba758b7c705459537201583f2e524635be04aff84bc69"), - response.LiquidityPoolID); + Assert.AreEqual(new LiquidityPoolId("b26c0d6545349ad7f44ba758b7c705459537201583f2e524635be04aff84bc69"), + response.LiquidityPoolId); Assert.AreEqual("1508641622462465", response.PagingToken); Assert.AreEqual("0.0000000", response.ReservesMin[0].Amount); diff --git a/StellarDotnetSdk.Tests/Responses/Operations/PaymentOperationResponseTest.cs b/StellarDotnetSdk.Tests/Responses/Operations/PaymentOperationResponseTest.cs index bad49ba9..f5db7e09 100644 --- a/StellarDotnetSdk.Tests/Responses/Operations/PaymentOperationResponseTest.cs +++ b/StellarDotnetSdk.Tests/Responses/Operations/PaymentOperationResponseTest.cs @@ -47,7 +47,7 @@ public static void AssertPaymentOperationTestData(PaymentOperationResponse opera Assert.AreEqual(operation.From, "GCKICEQ2SA3KWH3UMQFJE4BFXCBFHW46BCVJBRCLK76ZY5RO6TY5D7Q2"); Assert.IsNull(operation.FromMuxed); - Assert.IsNull(operation.FromMuxedID); + Assert.IsNull(operation.FromMuxedId); Assert.AreEqual(operation.To, "GDWNY2POLGK65VVKIH5KQSH7VWLKRTQ5M6ADLJAYC2UEHEBEARCZJWWI"); Assert.AreEqual(operation.Amount, "100.0"); Assert.AreEqual(operation.Asset, new AssetTypeNative()); @@ -166,7 +166,7 @@ public static void AssertPaymentOperationTestDataMuxed(OperationResponse instanc Assert.AreEqual(operation.From, "GCKICEQ2SA3KWH3UMQFJE4BFXCBFHW46BCVJBRCLK76ZY5RO6TY5D7Q2"); Assert.AreEqual(operation.FromMuxed, "MAAAAAABGFQ36FMUQEJBVEBWVMPXIZAKSJYCLOECKPNZ4CFKSDCEWV75TR3C55HR2FJ24"); - Assert.AreEqual(operation.FromMuxedID, 5123456789UL); + Assert.AreEqual(operation.FromMuxedId, 5123456789UL); Assert.AreEqual(operation.To, "GDWNY2POLGK65VVKIH5KQSH7VWLKRTQ5M6ADLJAYC2UEHEBEARCZJWWI"); Assert.AreEqual(operation.Amount, "100.0"); Assert.AreEqual(operation.Asset, new AssetTypeNative()); diff --git a/StellarDotnetSdk.Tests/Responses/Operations/RevokeSponsorshipOperationResponseTest.cs b/StellarDotnetSdk.Tests/Responses/Operations/RevokeSponsorshipOperationResponseTest.cs index 32a438e7..368d1e06 100644 --- a/StellarDotnetSdk.Tests/Responses/Operations/RevokeSponsorshipOperationResponseTest.cs +++ b/StellarDotnetSdk.Tests/Responses/Operations/RevokeSponsorshipOperationResponseTest.cs @@ -28,7 +28,7 @@ private static void AssertRevokeSponsorshipAccountIdData(OperationResponse insta var operation = (RevokeSponsorshipOperationResponse)instance; Assert.AreEqual(286156491067394, operation.Id); - Assert.AreEqual("GCLHBHJAYWFT6JA27KEPUQCCGIHUB33HURYAKNWIY4FB7IY3K24PRXET", operation.AccountID); + Assert.AreEqual("GCLHBHJAYWFT6JA27KEPUQCCGIHUB33HURYAKNWIY4FB7IY3K24PRXET", operation.AccountId); } //Revoke Sponsorship Claimable Balance @@ -51,7 +51,7 @@ private static void AssertRevokeSponsorshipClaimableBalanceData(OperationRespons Assert.AreEqual(287054139232258, operation.Id); Assert.AreEqual("00000000c582697b67cbec7f9ce64f4dc67bfb2bfd26318bb9f964f4d70e3f41f650b1e6", - operation.ClaimableBalanceID); + operation.ClaimableBalanceId); } //Revoke Sponsorship Data @@ -73,7 +73,7 @@ private static void AssertRevokeSponsorshipDataData(OperationResponse instance) var operation = (RevokeSponsorshipOperationResponse)instance; Assert.AreEqual(286800736161794, operation.Id); - Assert.AreEqual("GDHSYF7V3DZRM7Q2HS5J6FHAHNWETMBFMG7DOSWU3GA7OM4KGOPZM3FB", operation.DataAccountID); + Assert.AreEqual("GDHSYF7V3DZRM7Q2HS5J6FHAHNWETMBFMG7DOSWU3GA7OM4KGOPZM3FB", operation.DataAccountId); Assert.AreEqual("hello", operation.DataName); } @@ -96,7 +96,7 @@ private static void AssertRevokeSponsorshipOfferData(OperationResponse instance) var operation = (RevokeSponsorshipOperationResponse)instance; Assert.AreEqual(286800736161794, operation.Id); - Assert.IsNull(operation.OfferID); + Assert.IsNull(operation.OfferId); } //Revoke Sponsorship Signer Key @@ -118,7 +118,7 @@ private static void AssertRevokeSponsorshipSignerKeyData(OperationResponse insta var operation = (RevokeSponsorshipOperationResponse)instance; Assert.AreEqual(287363376877570, operation.Id); - Assert.AreEqual("GAXHU2XHSMTZYAKFCVTULAYUL34BFPPLRVJYZMEOHP7IWPZJKSVY67RJ", operation.SignerAccountID); + Assert.AreEqual("GAXHU2XHSMTZYAKFCVTULAYUL34BFPPLRVJYZMEOHP7IWPZJKSVY67RJ", operation.SignerAccountId); Assert.AreEqual("XAMF7DNTEJY74JPVMGTPZE4LFYTEGBXMGBHNUUMAA7IXMSBGHAMWSND6", operation.SignerKey); } @@ -141,7 +141,7 @@ private static void AssertRevokeSponsorshipTrustlineData(OperationResponse insta var operation = (RevokeSponsorshipOperationResponse)instance; Assert.AreEqual(286500088451074, operation.Id); - Assert.AreEqual("GDHSYF7V3DZRM7Q2HS5J6FHAHNWETMBFMG7DOSWU3GA7OM4KGOPZM3FB", operation.TrustlineAccountID); + Assert.AreEqual("GDHSYF7V3DZRM7Q2HS5J6FHAHNWETMBFMG7DOSWU3GA7OM4KGOPZM3FB", operation.TrustlineAccountId); Assert.AreEqual("XYZ:GD2I2F7SWUHBAD7XBIZTF7MBMWQYWJVEFMWTXK76NSYVOY52OJRYNTIY", operation.TrustlineAsset); } } \ No newline at end of file diff --git a/StellarDotnetSdk.Tests/Responses/TransactionDeserializerTest.cs b/StellarDotnetSdk.Tests/Responses/TransactionDeserializerTest.cs index 6edc52ef..79aab82b 100644 --- a/StellarDotnetSdk.Tests/Responses/TransactionDeserializerTest.cs +++ b/StellarDotnetSdk.Tests/Responses/TransactionDeserializerTest.cs @@ -251,11 +251,11 @@ public void TestDeserializeMuxed() Assert.AreEqual("GCKICEQ2SA3KWH3UMQFJE4BFXCBFHW46BCVJBRCLK76ZY5RO6TY5D7Q2", transaction.SourceAccount); Assert.AreEqual("MAAAAAABGFQ36FMUQEJBVEBWVMPXIZAKSJYCLOECKPNZ4CFKSDCEWV75TR3C55HR2FJ24", transaction.AccountMuxed); - Assert.AreEqual(5123456789UL, transaction.AccountMuxedID); + Assert.AreEqual(5123456789UL, transaction.AccountMuxedId); Assert.AreEqual("GCKICEQ2SA3KWH3UMQFJE4BFXCBFHW46BCVJBRCLK76ZY5RO6TY5D7Q2", transaction.FeeAccount); Assert.AreEqual("MAAAAAABGFQ36FMUQEJBVEBWVMPXIZAKSJYCLOECKPNZ4CFKSDCEWV75TR3C55HR2FJ24", transaction.FeeAccountMuxed); - Assert.AreEqual(5123456789UL, transaction.FeeAccountMuxedID); + Assert.AreEqual(5123456789UL, transaction.FeeAccountMuxedId); } } \ No newline at end of file diff --git a/StellarDotnetSdk.Tests/SorobanAuthorizationTest.cs b/StellarDotnetSdk.Tests/SorobanAuthorizationTest.cs index 3810160e..b92627f3 100644 --- a/StellarDotnetSdk.Tests/SorobanAuthorizationTest.cs +++ b/StellarDotnetSdk.Tests/SorobanAuthorizationTest.cs @@ -124,7 +124,7 @@ public void TestSorobanAuthorizationEntryWithEmptySubInvocations() var salt = new byte[32]; RandomNumberGenerator.Create().GetBytes(salt); - var preimage = new ContractIDAddressPreimage(_accountAddress.InnerValue, salt); + var preimage = new ContractIdAddressPreimage(_accountAddress.InnerValue, salt); var rootInvocation = new SorobanAuthorizedInvocation( new SorobanAuthorizedCreateContractFunction( new CreateContractHostFunction(preimage, _contractExecutableWasm)), @@ -149,8 +149,8 @@ public void TestSorobanAuthorizationEntryWithEmptySubInvocations() var decodedRootFunction = ((SorobanAuthorizedCreateContractFunction)decodedAuth.RootInvocation.Function).HostFunction; Assert.IsNotNull(decodedRootFunction); - Assert.IsInstanceOfType(decodedRootFunction.ContractIDPreimage, typeof(ContractIDAddressPreimage)); - var decodedPreimage = (ContractIDAddressPreimage)decodedRootFunction.ContractIDPreimage; + Assert.IsInstanceOfType(decodedRootFunction.ContractIdPreimage, typeof(ContractIdAddressPreimage)); + var decodedPreimage = (ContractIdAddressPreimage)decodedRootFunction.ContractIdPreimage; Assert.AreEqual(_accountAddress.InnerValue, ((SCAccountId)decodedPreimage.Address).InnerValue); CollectionAssert.AreEqual(salt, decodedPreimage.Salt); Assert.IsInstanceOfType(decodedRootFunction.Executable, typeof(ContractExecutableWasm)); @@ -191,10 +191,10 @@ public void TestSorobanAuthorizationEntryContainingAuthorizedCreateContractFunct var decodedRootFunction = ((SorobanAuthorizedCreateContractFunction)decodedAuth.RootInvocation.Function).HostFunction; Assert.IsNotNull(decodedRootFunction); - Assert.IsInstanceOfType(decodedRootFunction.ContractIDPreimage, typeof(ContractIDAddressPreimage)); - var decodedPreimage = (ContractIDAddressPreimage)decodedRootFunction.ContractIDPreimage; + Assert.IsInstanceOfType(decodedRootFunction.ContractIdPreimage, typeof(ContractIdAddressPreimage)); + var decodedPreimage = (ContractIdAddressPreimage)decodedRootFunction.ContractIdPreimage; Assert.AreEqual(_accountAddress.InnerValue, ((SCAccountId)decodedPreimage.Address).InnerValue); - var salt = ((ContractIDAddressPreimage)hostFunction.ContractIDPreimage).Salt; + var salt = ((ContractIdAddressPreimage)hostFunction.ContractIdPreimage).Salt; CollectionAssert.AreEqual(salt, decodedPreimage.Salt); Assert.IsInstanceOfType(decodedRootFunction.Executable, typeof(ContractExecutableWasm)); var decodedExecutable = (ContractExecutableWasm)decodedRootFunction.Executable; @@ -207,8 +207,8 @@ public void TestSorobanAuthorizationEntryContainingAuthorizedCreateContractFunct var decodedSubFunction = ((SorobanAuthorizedCreateContractFunction)decodedSubInvocations[0].Function).HostFunction; Assert.IsNotNull(decodedSubFunction); - Assert.IsInstanceOfType(decodedSubFunction.ContractIDPreimage, typeof(ContractIDAddressPreimage)); - decodedPreimage = (ContractIDAddressPreimage)decodedSubFunction.ContractIDPreimage; + Assert.IsInstanceOfType(decodedSubFunction.ContractIdPreimage, typeof(ContractIdAddressPreimage)); + decodedPreimage = (ContractIdAddressPreimage)decodedSubFunction.ContractIdPreimage; Assert.AreEqual(_accountAddress.InnerValue, ((SCAccountId)decodedPreimage.Address).InnerValue); CollectionAssert.AreEqual(salt, decodedPreimage.Salt); Assert.IsInstanceOfType(decodedSubFunction.Executable, typeof(ContractExecutableWasm)); @@ -250,10 +250,10 @@ public void TestSorobanAuthorizationEntryContainingAuthorizedCreateContractV2Fun var decodedRootFunction = ((SorobanAuthorizedCreateContractV2Function)decodedAuth.RootInvocation.Function).HostFunction; Assert.IsNotNull(decodedRootFunction); - Assert.IsInstanceOfType(decodedRootFunction.ContractIDPreimage, typeof(ContractIDAddressPreimage)); - var decodedPreimage = (ContractIDAddressPreimage)decodedRootFunction.ContractIDPreimage; + Assert.IsInstanceOfType(decodedRootFunction.ContractIdPreimage, typeof(ContractIdAddressPreimage)); + var decodedPreimage = (ContractIdAddressPreimage)decodedRootFunction.ContractIdPreimage; Assert.AreEqual(_accountAddress.InnerValue, ((SCAccountId)decodedPreimage.Address).InnerValue); - var salt = ((ContractIDAddressPreimage)hostFunction.ContractIDPreimage).Salt; + var salt = ((ContractIdAddressPreimage)hostFunction.ContractIdPreimage).Salt; CollectionAssert.AreEqual(salt, decodedPreimage.Salt); Assert.IsInstanceOfType(decodedRootFunction.Executable, typeof(ContractExecutableWasm)); var decodedExecutable = (ContractExecutableWasm)decodedRootFunction.Executable; @@ -266,8 +266,8 @@ public void TestSorobanAuthorizationEntryContainingAuthorizedCreateContractV2Fun var decodedSubFunction = ((SorobanAuthorizedCreateContractV2Function)decodedSubInvocations[0].Function).HostFunction; Assert.IsNotNull(decodedSubFunction); - Assert.IsInstanceOfType(decodedSubFunction.ContractIDPreimage, typeof(ContractIDAddressPreimage)); - decodedPreimage = (ContractIDAddressPreimage)decodedSubFunction.ContractIDPreimage; + Assert.IsInstanceOfType(decodedSubFunction.ContractIdPreimage, typeof(ContractIdAddressPreimage)); + decodedPreimage = (ContractIdAddressPreimage)decodedSubFunction.ContractIdPreimage; Assert.AreEqual(_accountAddress.InnerValue, ((SCAccountId)decodedPreimage.Address).InnerValue); CollectionAssert.AreEqual(salt, decodedPreimage.Salt); Assert.IsInstanceOfType(decodedSubFunction.Executable, typeof(ContractExecutableWasm)); diff --git a/StellarDotnetSdk.Tests/SorobanServerTest.cs b/StellarDotnetSdk.Tests/SorobanServerTest.cs index f143e405..63ba9dce 100644 --- a/StellarDotnetSdk.Tests/SorobanServerTest.cs +++ b/StellarDotnetSdk.Tests/SorobanServerTest.cs @@ -812,7 +812,7 @@ public async Task TestGetLedgerEntriesOfTypeLiquidityPool() Assert.IsNotNull(ledgerKey); Assert.AreEqual(457976U, ledgerEntry.LastModifiedLedgerSeq); Assert.AreEqual("fd498c395920d57156e86b2d52acd2bbbfc164836a204c73d3b64bec33874d38", - ledgerKey.LiquidityPoolID.ToString()); + ledgerKey.LiquidityPoolId.ToString()); Assert.AreEqual("fd498c395920d57156e86b2d52acd2bbbfc164836a204c73d3b64bec33874d38", ledgerEntry.LiquidityPoolId.ToString()); Assert.IsInstanceOfType(ledgerEntry.LiquidityPoolBody, typeof(LiquidityPoolConstantProduct)); @@ -1659,9 +1659,9 @@ public async Task TestGetLedgerEntriesOfTypeConfigSetting() var entry10 = entries[10] as StateArchivalSettings; Assert.IsNotNull(entry10); - Assert.AreEqual(3110400U, entry10.MaxEntryTTL); - Assert.AreEqual(17280U, entry10.MinTemporaryTTL); - Assert.AreEqual(2073600U, entry10.MinPersistentTTL); + Assert.AreEqual(3110400U, entry10.MaxEntryTtl); + Assert.AreEqual(17280U, entry10.MinTemporaryTtl); + Assert.AreEqual(2073600U, entry10.MinPersistentTtl); Assert.AreEqual(2103L, entry10.PersistentRentRateDenominator); Assert.AreEqual(4206L, entry10.TempRentRateDenominator); Assert.AreEqual(1000U, entry10.MaxEntriesToArchive); @@ -1705,7 +1705,7 @@ public async Task TestGetLedgerEntriesOfTypeTtl() var ledgerKeyTtl = new LedgerKey[] { - new LedgerKeyTTL("fsh67B45yRcC/gKPI2ky8EPbFMtc8y0fnjUDaI36OKc="), + new LedgerKeyTtl("fsh67B45yRcC/gKPI2ky8EPbFMtc8y0fnjUDaI36OKc="), }; using var sorobanServer = Utils.CreateTestSorobanServerWithContent(json); diff --git a/StellarDotnetSdk/Assets/AssetTypeCreditAlphaNum12.cs b/StellarDotnetSdk/Assets/AssetTypeCreditAlphaNum12.cs index 48c46a6b..7ec5355a 100644 --- a/StellarDotnetSdk/Assets/AssetTypeCreditAlphaNum12.cs +++ b/StellarDotnetSdk/Assets/AssetTypeCreditAlphaNum12.cs @@ -29,11 +29,11 @@ public override Xdr.Asset ToXdr() { AssetCode = new AssetCode12(Util.PaddedByteArray(Code, 12)), }; - var accountID = new AccountID + var accountId = new AccountID { InnerValue = KeyPair.FromAccountId(Issuer).XdrPublicKey, }; - credit.Issuer = accountID; + credit.Issuer = accountId; thisXdr.AlphaNum12 = credit; return thisXdr; } diff --git a/StellarDotnetSdk/Assets/AssetTypeCreditAlphaNum4.cs b/StellarDotnetSdk/Assets/AssetTypeCreditAlphaNum4.cs index cd3e30a7..89946dce 100644 --- a/StellarDotnetSdk/Assets/AssetTypeCreditAlphaNum4.cs +++ b/StellarDotnetSdk/Assets/AssetTypeCreditAlphaNum4.cs @@ -30,11 +30,11 @@ public override Xdr.Asset ToXdr() { AssetCode = new AssetCode4(Util.PaddedByteArray(Code, 4)), }; - var accountID = new AccountID + var accountId = new AccountID { InnerValue = KeyPair.FromAccountId(Issuer).XdrPublicKey, }; - credit.Issuer = accountID; + credit.Issuer = accountId; thisXdr.AlphaNum4 = credit; return thisXdr; } diff --git a/StellarDotnetSdk/Assets/ChangeTrustAsset.cs b/StellarDotnetSdk/Assets/ChangeTrustAsset.cs index df743eb5..b6e5633c 100644 --- a/StellarDotnetSdk/Assets/ChangeTrustAsset.cs +++ b/StellarDotnetSdk/Assets/ChangeTrustAsset.cs @@ -29,9 +29,9 @@ public static ChangeTrustAsset Create(LiquidityPoolParameters parameters) return new LiquidityPoolShareChangeTrustAsset(parameters); } - public static ChangeTrustAsset Create(Asset assetA, Asset assetB, int feeBP) + public static ChangeTrustAsset Create(Asset assetA, Asset assetB, int feeBp) { - return new LiquidityPoolShareChangeTrustAsset(assetA, assetB, feeBP); + return new LiquidityPoolShareChangeTrustAsset(assetA, assetB, feeBp); } public static ChangeTrustAsset Create(TrustlineAsset.Wrapper wrapper) @@ -46,7 +46,7 @@ public static ChangeTrustAsset CreateNonNativeAsset(string code, string issuer) public static ChangeTrustAsset FromXdr(Xdr.ChangeTrustAsset changeTrustXdr) { - string accountID; + string accountId; string assetCode; switch (changeTrustXdr.Discriminant.InnerValue) @@ -56,13 +56,13 @@ public static ChangeTrustAsset FromXdr(Xdr.ChangeTrustAsset changeTrustXdr) case AssetType.AssetTypeEnum.ASSET_TYPE_CREDIT_ALPHANUM4: assetCode = Util.PaddedByteArrayToString(changeTrustXdr.AlphaNum4.AssetCode.InnerValue); - accountID = KeyPair.FromXdrPublicKey(changeTrustXdr.AlphaNum4.Issuer.InnerValue).AccountId; - return Create(new AssetTypeCreditAlphaNum4(assetCode, accountID)); + accountId = KeyPair.FromXdrPublicKey(changeTrustXdr.AlphaNum4.Issuer.InnerValue).AccountId; + return Create(new AssetTypeCreditAlphaNum4(assetCode, accountId)); case AssetType.AssetTypeEnum.ASSET_TYPE_CREDIT_ALPHANUM12: assetCode = Util.PaddedByteArrayToString(changeTrustXdr.AlphaNum12.AssetCode.InnerValue); - accountID = KeyPair.FromXdrPublicKey(changeTrustXdr.AlphaNum12.Issuer.InnerValue).AccountId; - return Create(new AssetTypeCreditAlphaNum12(assetCode, accountID)); + accountId = KeyPair.FromXdrPublicKey(changeTrustXdr.AlphaNum12.Issuer.InnerValue).AccountId; + return Create(new AssetTypeCreditAlphaNum12(assetCode, accountId)); case AssetType.AssetTypeEnum.ASSET_TYPE_POOL_SHARE: return new LiquidityPoolShareChangeTrustAsset( diff --git a/StellarDotnetSdk/Assets/LiquidityPoolShareChangeTrustAsset.cs b/StellarDotnetSdk/Assets/LiquidityPoolShareChangeTrustAsset.cs index 0caf8b31..5c79329b 100644 --- a/StellarDotnetSdk/Assets/LiquidityPoolShareChangeTrustAsset.cs +++ b/StellarDotnetSdk/Assets/LiquidityPoolShareChangeTrustAsset.cs @@ -20,24 +20,24 @@ public LiquidityPoolShareChangeTrustAsset(LiquidityPoolParameters parameters) /// /// /// - /// - public LiquidityPoolShareChangeTrustAsset(Asset assetA, Asset assetB, int feeBP) + /// + public LiquidityPoolShareChangeTrustAsset(Asset assetA, Asset assetB, int feeBp) { - Parameters = new LiquidityPoolConstantProductParameters(assetA, assetB, feeBP); + Parameters = new LiquidityPoolConstantProductParameters(assetA, assetB, feeBp); } public LiquidityPoolParameters Parameters { get; set; } public override string Type => RestApiType; - public LiquidityPoolID GetLiquidityPoolID() + public LiquidityPoolId GetLiquidityPoolId() { - return Parameters.GetID(); + return Parameters.GetId(); } public override string ToString() { - return GetLiquidityPoolID().ToString(); + return GetLiquidityPoolId().ToString(); } public override int GetHashCode() diff --git a/StellarDotnetSdk/Assets/LiquidityPoolShareTrustlineAsset.cs b/StellarDotnetSdk/Assets/LiquidityPoolShareTrustlineAsset.cs index 9a024580..3b4172fa 100644 --- a/StellarDotnetSdk/Assets/LiquidityPoolShareTrustlineAsset.cs +++ b/StellarDotnetSdk/Assets/LiquidityPoolShareTrustlineAsset.cs @@ -11,26 +11,26 @@ public class LiquidityPoolShareTrustlineAsset : TrustlineAsset public LiquidityPoolShareTrustlineAsset(LiquidityPoolParameters parameters) { - ID = parameters.GetID() ?? throw new ArgumentNullException(nameof(parameters), "parameters cannot be null"); + Id = parameters.GetId() ?? throw new ArgumentNullException(nameof(parameters), "parameters cannot be null"); } - public LiquidityPoolShareTrustlineAsset(LiquidityPoolID id) + public LiquidityPoolShareTrustlineAsset(LiquidityPoolId id) { - ID = id ?? throw new ArgumentNullException(nameof(id), "id cannot be null"); + Id = id ?? throw new ArgumentNullException(nameof(id), "id cannot be null"); } - public LiquidityPoolID ID { get; } + public LiquidityPoolId Id { get; } public override string Type => RestApiType; public override string ToString() { - return ID.ToString(); + return Id.ToString(); } public override int GetHashCode() { - return ID.GetHashCode(); + return Id.GetHashCode(); } public override bool Equals(object? obj) @@ -56,7 +56,7 @@ public TrustLineAsset ToXdrTrustLineAsset() var xdr = new TrustLineAsset { Discriminant = AssetType.Create(AssetType.AssetTypeEnum.ASSET_TYPE_POOL_SHARE), - LiquidityPoolID = ID.ToXdr(), + LiquidityPoolID = Id.ToXdr(), }; return xdr; } diff --git a/StellarDotnetSdk/Assets/TrustlineAsset.cs b/StellarDotnetSdk/Assets/TrustlineAsset.cs index b8c24f60..670926ec 100644 --- a/StellarDotnetSdk/Assets/TrustlineAsset.cs +++ b/StellarDotnetSdk/Assets/TrustlineAsset.cs @@ -30,7 +30,7 @@ public static TrustlineAsset Create(LiquidityPoolParameters parameters) return new LiquidityPoolShareTrustlineAsset(parameters); } - public static TrustlineAsset Create(LiquidityPoolID id) + public static TrustlineAsset Create(LiquidityPoolId id) { return new LiquidityPoolShareTrustlineAsset(id); } @@ -64,7 +64,7 @@ public static TrustlineAsset FromXdr(TrustLineAsset trustLineAssetXdr) Util.PaddedByteArrayToString(trustLineAssetXdr.AlphaNum12.AssetCode.InnerValue), KeyPair.FromXdrPublicKey(trustLineAssetXdr.AlphaNum12.Issuer.InnerValue).AccountId)), AssetType.AssetTypeEnum.ASSET_TYPE_POOL_SHARE - => new LiquidityPoolShareTrustlineAsset(LiquidityPoolID.FromXdr(trustLineAssetXdr.LiquidityPoolID)), + => new LiquidityPoolShareTrustlineAsset(LiquidityPoolId.FromXdr(trustLineAssetXdr.LiquidityPoolID)), _ => throw new ArgumentException($"Unknown asset type {trustLineAssetXdr.Discriminant.InnerValue}"), }; } diff --git a/StellarDotnetSdk/ClaimAtom.cs b/StellarDotnetSdk/ClaimAtom.cs index 3f55f8d8..99997cfc 100644 --- a/StellarDotnetSdk/ClaimAtom.cs +++ b/StellarDotnetSdk/ClaimAtom.cs @@ -115,7 +115,7 @@ public static ClaimAtomV0 FromXdr(Xdr.ClaimAtom xdrClaimAtom) public class ClaimAtomLiquidityPool : ClaimAtom { private ClaimAtomLiquidityPool( - LiquidityPoolID liquidityPoolId, + LiquidityPoolId liquidityPoolId, Asset assetSold, string amountSold, Asset assetBought, @@ -127,7 +127,7 @@ private ClaimAtomLiquidityPool( /// /// The Liquidity Pool ID /// - public LiquidityPoolID LiquidityPoolId { get; } + public LiquidityPoolId LiquidityPoolId { get; } /// /// Get new ClaimLiquidityAtom object parsed from an XDR ClaimLiquidityAtom. @@ -138,7 +138,7 @@ public static ClaimAtomLiquidityPool FromXdr(Xdr.ClaimAtom xdrClaimAtom) { var claimLiquidityAtomXdr = xdrClaimAtom.LiquidityPool; return new ClaimAtomLiquidityPool( - LiquidityPoolID.FromXdr(claimLiquidityAtomXdr.LiquidityPoolID), + LiquidityPoolId.FromXdr(claimLiquidityAtomXdr.LiquidityPoolID), Asset.FromXdr(claimLiquidityAtomXdr.AssetSold), Amount.FromXdr(claimLiquidityAtomXdr.AmountSold.InnerValue), Asset.FromXdr(claimLiquidityAtomXdr.AssetBought), diff --git a/StellarDotnetSdk/Converters/LiquidityPoolIDJsonConverter.cs b/StellarDotnetSdk/Converters/LiquidityPoolIDJsonConverter.cs index ea215fb8..6e2aca0b 100644 --- a/StellarDotnetSdk/Converters/LiquidityPoolIDJsonConverter.cs +++ b/StellarDotnetSdk/Converters/LiquidityPoolIDJsonConverter.cs @@ -4,15 +4,15 @@ namespace StellarDotnetSdk.Converters; -public class LiquidityPoolIdJsonConverter : JsonConverter +public class LiquidityPoolIdJsonConverter : JsonConverter { - public override LiquidityPoolID? ReadJson(JsonReader reader, Type objectType, LiquidityPoolID? existingValue, + public override LiquidityPoolId? ReadJson(JsonReader reader, Type objectType, LiquidityPoolId? existingValue, bool hasExistingValue, JsonSerializer serializer) { - return reader.Value != null ? new LiquidityPoolID((string)reader.Value) : null; + return reader.Value != null ? new LiquidityPoolId((string)reader.Value) : null; } - public override void WriteJson(JsonWriter writer, LiquidityPoolID? value, JsonSerializer serializer) + public override void WriteJson(JsonWriter writer, LiquidityPoolId? value, JsonSerializer serializer) { writer.WriteValue(value?.ToString()); } diff --git a/StellarDotnetSdk/Converters/LiquidityPoolTypeEnumJsonConverter.cs b/StellarDotnetSdk/Converters/LiquidityPoolTypeEnumJsonConverter.cs index 7e0c65f4..2b5f3a0a 100644 --- a/StellarDotnetSdk/Converters/LiquidityPoolTypeEnumJsonConverter.cs +++ b/StellarDotnetSdk/Converters/LiquidityPoolTypeEnumJsonConverter.cs @@ -12,7 +12,7 @@ public override LiquidityPoolType.LiquidityPoolTypeEnum ReadJson(JsonReader read return reader.Value switch { "constant_product" => LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, - _ => throw new Exception("tywpe is not readable"), + _ => throw new Exception("type is not readable"), }; } diff --git a/StellarDotnetSdk/Exceptions/SubmitTransactionUnknownResponseException.cs b/StellarDotnetSdk/Exceptions/SubmitTransactionUnknownResponseException.cs index 62142c28..5e3852cc 100644 --- a/StellarDotnetSdk/Exceptions/SubmitTransactionUnknownResponseException.cs +++ b/StellarDotnetSdk/Exceptions/SubmitTransactionUnknownResponseException.cs @@ -1,7 +1,7 @@ using System; using System.Net; -namespace stellar_dotnet_sdk; +namespace StellarDotnetSdk.Exceptions; public class SubmitTransactionUnknownResponseException : Exception { diff --git a/StellarDotnetSdk/LedgerEntries/LedgerEntry.cs b/StellarDotnetSdk/LedgerEntries/LedgerEntry.cs index 92cc5978..aa6df3f5 100644 --- a/StellarDotnetSdk/LedgerEntries/LedgerEntry.cs +++ b/StellarDotnetSdk/LedgerEntries/LedgerEntry.cs @@ -53,7 +53,7 @@ private static LedgerEntry FromXdr(Xdr.LedgerEntry.LedgerEntryData xdrLedgerEntr LedgerEntryType.LedgerEntryTypeEnum.CONFIG_SETTING => LedgerEntryConfigSetting.FromXdrLedgerEntryData(xdrLedgerEntryData), LedgerEntryType.LedgerEntryTypeEnum.TTL => - LedgerEntryTTL.FromXdrLedgerEntryData(xdrLedgerEntryData), + LedgerEntryTtl.FromXdrLedgerEntryData(xdrLedgerEntryData), _ => throw new InvalidOperationException("Unknown LedgerEntry type"), }; } diff --git a/StellarDotnetSdk/LedgerEntries/LedgerEntryLiquidityPool.cs b/StellarDotnetSdk/LedgerEntries/LedgerEntryLiquidityPool.cs index c455e3fd..d8f229c2 100644 --- a/StellarDotnetSdk/LedgerEntries/LedgerEntryLiquidityPool.cs +++ b/StellarDotnetSdk/LedgerEntries/LedgerEntryLiquidityPool.cs @@ -6,13 +6,13 @@ namespace StellarDotnetSdk.LedgerEntries; public class LedgerEntryLiquidityPool : LedgerEntry { - private LedgerEntryLiquidityPool(LiquidityPoolID liquidityPoolId, LiquidityPoolEntryBody liquidityPoolBody) + private LedgerEntryLiquidityPool(LiquidityPoolId liquidityPoolId, LiquidityPoolEntryBody liquidityPoolBody) { LiquidityPoolId = liquidityPoolId; LiquidityPoolBody = liquidityPoolBody; } - public LiquidityPoolID LiquidityPoolId { get; } + public LiquidityPoolId LiquidityPoolId { get; } public LiquidityPoolEntryBody LiquidityPoolBody { get; } /// @@ -37,7 +37,7 @@ private static LedgerEntryLiquidityPool FromXdr(Xdr.LedgerEntry.LedgerEntryData var xdrLiquidityPoolEntry = xdrLedgerEntryData.LiquidityPool; var ledgerEntryLiquidityPool = new LedgerEntryLiquidityPool( - LiquidityPoolID.FromXdr(xdrLiquidityPoolEntry.LiquidityPoolID), + LiquidityPoolId.FromXdr(xdrLiquidityPoolEntry.LiquidityPoolID), LiquidityPoolEntryBody.FromXdr(xdrLiquidityPoolEntry.Body)); return ledgerEntryLiquidityPool; diff --git a/StellarDotnetSdk/LedgerEntries/LedgerEntryTTL.cs b/StellarDotnetSdk/LedgerEntries/LedgerEntryTtl.cs similarity index 80% rename from StellarDotnetSdk/LedgerEntries/LedgerEntryTTL.cs rename to StellarDotnetSdk/LedgerEntries/LedgerEntryTtl.cs index 60be2d64..32a1b85b 100644 --- a/StellarDotnetSdk/LedgerEntries/LedgerEntryTTL.cs +++ b/StellarDotnetSdk/LedgerEntries/LedgerEntryTtl.cs @@ -3,9 +3,9 @@ namespace StellarDotnetSdk.LedgerEntries; -public class LedgerEntryTTL : LedgerEntry +public class LedgerEntryTtl : LedgerEntry { - private LedgerEntryTTL(byte[] keyHash, uint liveUntilLedgerSequence) + private LedgerEntryTtl(byte[] keyHash, uint liveUntilLedgerSequence) { KeyHash = keyHash; LiveUntilLedgerSequence = liveUntilLedgerSequence; @@ -20,7 +20,7 @@ private LedgerEntryTTL(byte[] keyHash, uint liveUntilLedgerSequence) /// A object. /// A LedgerEntryTTL object. /// Throws when the parameter is not a valid TTLEntry. - public static LedgerEntryTTL FromXdrLedgerEntryData(Xdr.LedgerEntry.LedgerEntryData xdrLedgerEntryData) + public static LedgerEntryTtl FromXdrLedgerEntryData(Xdr.LedgerEntry.LedgerEntryData xdrLedgerEntryData) { if (xdrLedgerEntryData.Discriminant.InnerValue != LedgerEntryType.LedgerEntryTypeEnum.TTL) { @@ -30,9 +30,9 @@ public static LedgerEntryTTL FromXdrLedgerEntryData(Xdr.LedgerEntry.LedgerEntryD return FromXdr(xdrLedgerEntryData.Ttl); } - private static LedgerEntryTTL FromXdr(TTLEntry xdrTtlEntry) + private static LedgerEntryTtl FromXdr(TTLEntry xdrTtlEntry) { - return new LedgerEntryTTL( + return new LedgerEntryTtl( xdrTtlEntry.KeyHash.InnerValue, xdrTtlEntry.LiveUntilLedgerSeq.InnerValue); } diff --git a/StellarDotnetSdk/LedgerEntries/StateArchivalSettings.cs b/StellarDotnetSdk/LedgerEntries/StateArchivalSettings.cs index 3c13d605..ffca8197 100644 --- a/StellarDotnetSdk/LedgerEntries/StateArchivalSettings.cs +++ b/StellarDotnetSdk/LedgerEntries/StateArchivalSettings.cs @@ -2,14 +2,14 @@ public class StateArchivalSettings : LedgerEntryConfigSetting { - private StateArchivalSettings(uint maxEntryTTL, uint minTemporaryTTL, uint minPersistentTTL, + private StateArchivalSettings(uint maxEntryTtl, uint minTemporaryTtl, uint minPersistentTtl, long persistentRentRateDenominator, long tempRentRateDenominator, uint maxEntriesToArchive, uint bucketListSizeWindowSampleSize, uint bucketListWindowSamplePeriod, uint evictionScanSize, uint startingEvictionScanLevel) { - MaxEntryTTL = maxEntryTTL; - MinTemporaryTTL = minTemporaryTTL; - MinPersistentTTL = minPersistentTTL; + MaxEntryTtl = maxEntryTtl; + MinTemporaryTtl = minTemporaryTtl; + MinPersistentTtl = minPersistentTtl; PersistentRentRateDenominator = persistentRentRateDenominator; TempRentRateDenominator = tempRentRateDenominator; MaxEntriesToArchive = maxEntriesToArchive; @@ -19,9 +19,9 @@ private StateArchivalSettings(uint maxEntryTTL, uint minTemporaryTTL, uint minPe StartingEvictionScanLevel = startingEvictionScanLevel; } - public uint MaxEntryTTL { get; } - public uint MinTemporaryTTL { get; } - public uint MinPersistentTTL { get; } + public uint MaxEntryTtl { get; } + public uint MinTemporaryTtl { get; } + public uint MinPersistentTtl { get; } public long PersistentRentRateDenominator { get; } public long TempRentRateDenominator { get; } public uint MaxEntriesToArchive { get; } diff --git a/StellarDotnetSdk/LedgerKeys/LedgerKey.cs b/StellarDotnetSdk/LedgerKeys/LedgerKey.cs index 05d58eb0..fccfc385 100644 --- a/StellarDotnetSdk/LedgerKeys/LedgerKey.cs +++ b/StellarDotnetSdk/LedgerKeys/LedgerKey.cs @@ -37,7 +37,7 @@ public static LedgerKey Trustline(KeyPair account, TrustlineAsset asset) return new LedgerKeyTrustline(account, asset); } - public static LedgerKey LiquidityPool(LiquidityPoolID poolId) + public static LedgerKey LiquidityPool(LiquidityPoolId poolId) { return new LedgerKeyLiquidityPool(poolId); } @@ -57,9 +57,9 @@ public static LedgerKey ConfigSetting(ConfigSettingID settingId) return new LedgerKeyConfigSetting(settingId); } - public static LedgerKey TTL(string key) + public static LedgerKey Ttl(string key) { - return new LedgerKeyTTL(key); + return new LedgerKeyTtl(key); } public static LedgerKey FromXdr(Xdr.LedgerKey xdr) @@ -76,7 +76,7 @@ public static LedgerKey FromXdr(Xdr.LedgerKey xdr) LedgerEntryType.LedgerEntryTypeEnum.CONTRACT_DATA => LedgerKeyContractData.FromXdr(xdr.ContractData), LedgerEntryType.LedgerEntryTypeEnum.CONTRACT_CODE => LedgerKeyContractCode.FromXdr(xdr.ContractCode), LedgerEntryType.LedgerEntryTypeEnum.CONFIG_SETTING => LedgerKeyConfigSetting.FromXdr(xdr.ConfigSetting), - LedgerEntryType.LedgerEntryTypeEnum.TTL => LedgerKeyTTL.FromXdr(xdr.Ttl), + LedgerEntryType.LedgerEntryTypeEnum.TTL => LedgerKeyTtl.FromXdr(xdr.Ttl), _ => throw new Exception("Unknown ledger key " + xdr.Discriminant.InnerValue), }; } diff --git a/StellarDotnetSdk/LedgerKeys/LedgerKeyConfigSetting.cs b/StellarDotnetSdk/LedgerKeys/LedgerKeyConfigSetting.cs index 394a11a2..573a996d 100644 --- a/StellarDotnetSdk/LedgerKeys/LedgerKeyConfigSetting.cs +++ b/StellarDotnetSdk/LedgerKeys/LedgerKeyConfigSetting.cs @@ -6,10 +6,10 @@ public class LedgerKeyConfigSetting : LedgerKey { public LedgerKeyConfigSetting(ConfigSettingID settingId) { - ConfigSettingID = settingId; + ConfigSettingId = settingId; } - public ConfigSettingID ConfigSettingID { get; } + public ConfigSettingID ConfigSettingId { get; } public override Xdr.LedgerKey ToXdr() { @@ -19,7 +19,7 @@ public override Xdr.LedgerKey ToXdr() new LedgerEntryType { InnerValue = LedgerEntryType.LedgerEntryTypeEnum.CONFIG_SETTING }, ConfigSetting = new Xdr.LedgerKey.LedgerKeyConfigSetting { - ConfigSettingID = ConfigSettingID, + ConfigSettingID = ConfigSettingId, }, }; } diff --git a/StellarDotnetSdk/LedgerKeys/LedgerKeyLiquidityPool.cs b/StellarDotnetSdk/LedgerKeys/LedgerKeyLiquidityPool.cs index c7769af9..6dfa8f9d 100644 --- a/StellarDotnetSdk/LedgerKeys/LedgerKeyLiquidityPool.cs +++ b/StellarDotnetSdk/LedgerKeys/LedgerKeyLiquidityPool.cs @@ -6,18 +6,18 @@ namespace StellarDotnetSdk.LedgerKeys; public class LedgerKeyLiquidityPool : LedgerKey { - public LedgerKeyLiquidityPool(LiquidityPoolID poolId) + public LedgerKeyLiquidityPool(LiquidityPoolId poolId) { - LiquidityPoolID = poolId; + LiquidityPoolId = poolId; } public LedgerKeyLiquidityPool(Assets_Asset assetA, Assets_Asset assetB, int fee) { - LiquidityPoolID = new LiquidityPoolID(LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, + LiquidityPoolId = new LiquidityPoolId(LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, assetA, assetB, fee); } - public LiquidityPoolID LiquidityPoolID { get; } + public LiquidityPoolId LiquidityPoolId { get; } public override Xdr.LedgerKey ToXdr() { @@ -27,13 +27,13 @@ public override Xdr.LedgerKey ToXdr() new LedgerEntryType { InnerValue = LedgerEntryType.LedgerEntryTypeEnum.LIQUIDITY_POOL }, LiquidityPool = new Xdr.LedgerKey.LedgerKeyLiquidityPool { - LiquidityPoolID = new PoolID(new Hash(LiquidityPoolID.Hash)), + LiquidityPoolID = new PoolID(new Hash(LiquidityPoolId.Hash)), }, }; } public static LedgerKeyLiquidityPool FromXdr(Xdr.LedgerKey.LedgerKeyLiquidityPool xdr) { - return new LedgerKeyLiquidityPool(new LiquidityPoolID(xdr.LiquidityPoolID.InnerValue.InnerValue)); + return new LedgerKeyLiquidityPool(new LiquidityPoolId(xdr.LiquidityPoolID.InnerValue.InnerValue)); } } \ No newline at end of file diff --git a/StellarDotnetSdk/LedgerKeys/LedgerKeyTTL.cs b/StellarDotnetSdk/LedgerKeys/LedgerKeyTtl.cs similarity index 78% rename from StellarDotnetSdk/LedgerKeys/LedgerKeyTTL.cs rename to StellarDotnetSdk/LedgerKeys/LedgerKeyTtl.cs index f8df6a47..7ffd8dc6 100644 --- a/StellarDotnetSdk/LedgerKeys/LedgerKeyTTL.cs +++ b/StellarDotnetSdk/LedgerKeys/LedgerKeyTtl.cs @@ -3,17 +3,17 @@ namespace StellarDotnetSdk.LedgerKeys; -public class LedgerKeyTTL : LedgerKey +public class LedgerKeyTtl : LedgerKey { /// /// Constructs a LedgerKeyTTL object from a base-64 encoded string of the hash of the ledger entry. /// /// A base-64 encoded string. - public LedgerKeyTTL(string base64String) : this(Convert.FromBase64String(base64String)) + public LedgerKeyTtl(string base64String) : this(Convert.FromBase64String(base64String)) { } - private LedgerKeyTTL(byte[] key) + private LedgerKeyTtl(byte[] key) { if (key.Length != 32) { @@ -37,8 +37,8 @@ public override Xdr.LedgerKey ToXdr() }; } - public static LedgerKeyTTL FromXdr(Xdr.LedgerKey.LedgerKeyTtl xdr) + public static LedgerKeyTtl FromXdr(Xdr.LedgerKey.LedgerKeyTtl xdr) { - return new LedgerKeyTTL(Convert.ToBase64String(xdr.KeyHash.InnerValue)); + return new LedgerKeyTtl(Convert.ToBase64String(xdr.KeyHash.InnerValue)); } } \ No newline at end of file diff --git a/StellarDotnetSdk/LiquidityPool/LiquidityPool.cs b/StellarDotnetSdk/LiquidityPool/LiquidityPool.cs index a01a4d16..e43c1179 100644 --- a/StellarDotnetSdk/LiquidityPool/LiquidityPool.cs +++ b/StellarDotnetSdk/LiquidityPool/LiquidityPool.cs @@ -7,25 +7,25 @@ namespace StellarDotnetSdk.LiquidityPool; public class LiquidityPool { - public LiquidityPool(LiquidityPoolID id, + public LiquidityPool(LiquidityPoolId id, int feeBp, LiquidityPoolType.LiquidityPoolTypeEnum type, int totalTrustlines, string totalShares, AssetAmount[] reserves) { - ID = id; - FeeBP = feeBp; + Id = id; + FeeBp = feeBp; Type = type; TotalTrustlines = totalTrustlines; TotalShares = totalShares; Reserves = reserves; } - [JsonProperty(PropertyName = "id")] public LiquidityPoolID ID { get; } + [JsonProperty(PropertyName = "id")] public LiquidityPoolId Id { get; } [JsonProperty(PropertyName = "fee_bp")] - public int FeeBP { get; } + public int FeeBp { get; } [JsonConverter(typeof(LiquidityPoolTypeEnumJsonConverter))] [JsonProperty(PropertyName = "type")] diff --git a/StellarDotnetSdk/LiquidityPool/LiquidityPoolConstantProductParameters.cs b/StellarDotnetSdk/LiquidityPool/LiquidityPoolConstantProductParameters.cs index e0fa9d3c..950d4fde 100644 --- a/StellarDotnetSdk/LiquidityPool/LiquidityPoolConstantProductParameters.cs +++ b/StellarDotnetSdk/LiquidityPool/LiquidityPoolConstantProductParameters.cs @@ -72,9 +72,9 @@ public static LiquidityPoolConstantProductParameters FromXdr( liquidityPoolConstantProductParametersXdr.Fee.InnerValue); } - public override LiquidityPoolID GetID() + public override LiquidityPoolId GetId() { - return new LiquidityPoolID(LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, AssetA, + return new LiquidityPoolId(LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, AssetA, AssetB, Fee); } } \ No newline at end of file diff --git a/StellarDotnetSdk/LiquidityPool/LiquidityPoolID.cs b/StellarDotnetSdk/LiquidityPool/LiquidityPoolId.cs similarity index 77% rename from StellarDotnetSdk/LiquidityPool/LiquidityPoolID.cs rename to StellarDotnetSdk/LiquidityPool/LiquidityPoolId.cs index 1e968008..08410307 100644 --- a/StellarDotnetSdk/LiquidityPool/LiquidityPoolID.cs +++ b/StellarDotnetSdk/LiquidityPool/LiquidityPoolId.cs @@ -7,9 +7,9 @@ namespace StellarDotnetSdk.LiquidityPool; [JsonConverter(typeof(LiquidityPoolIdJsonConverter))] -public class LiquidityPoolID +public class LiquidityPoolId { - public LiquidityPoolID(LiquidityPoolType.LiquidityPoolTypeEnum type, Asset assetA, Asset assetB, int fee) + public LiquidityPoolId(LiquidityPoolType.LiquidityPoolTypeEnum type, Asset assetA, Asset assetB, int fee) { var xdrDataOutputStream = new XdrDataOutputStream(); @@ -27,21 +27,21 @@ public LiquidityPoolID(LiquidityPoolType.LiquidityPoolTypeEnum type, Asset asset } [JsonConstructor] - public LiquidityPoolID(string hex) + public LiquidityPoolId(string hex) { Hash = Util.HexToBytes(hex); } - public LiquidityPoolID(byte[] hash) + public LiquidityPoolId(byte[] hash) { Hash = hash; } public byte[] Hash { get; } - public static LiquidityPoolID FromXdr(PoolID poolIdXdr) + public static LiquidityPoolId FromXdr(PoolID poolIdXdr) { - return new LiquidityPoolID(poolIdXdr.InnerValue.InnerValue); + return new LiquidityPoolId(poolIdXdr.InnerValue.InnerValue); } public override string ToString() @@ -56,7 +56,7 @@ public PoolID ToXdr() public override bool Equals(object? obj) { - return obj is LiquidityPoolID other && Equals(ToString(), other.ToString()); + return obj is LiquidityPoolId other && Equals(ToString(), other.ToString()); } public override int GetHashCode() diff --git a/StellarDotnetSdk/LiquidityPool/LiquidityPoolParameters.cs b/StellarDotnetSdk/LiquidityPool/LiquidityPoolParameters.cs index 2231fde4..4240b3ae 100644 --- a/StellarDotnetSdk/LiquidityPool/LiquidityPoolParameters.cs +++ b/StellarDotnetSdk/LiquidityPool/LiquidityPoolParameters.cs @@ -8,8 +8,11 @@ public abstract class LiquidityPoolParameters { public const int Fee = 30; - public static LiquidityPoolParameters Create(LiquidityPoolType.LiquidityPoolTypeEnum type, Asset assetA, - Asset assetB, int feeBp) + public static LiquidityPoolParameters Create( + LiquidityPoolType.LiquidityPoolTypeEnum type, + Asset assetA, + Asset assetB, + int feeBp) { if (type != LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT) { @@ -34,5 +37,5 @@ public static LiquidityPoolParameters FromXdr(Xdr.LiquidityPoolParameters liquid public abstract Xdr.LiquidityPoolParameters ToXdr(); - public abstract LiquidityPoolID GetID(); + public abstract LiquidityPoolId GetId(); } \ No newline at end of file diff --git a/StellarDotnetSdk/Operations/ExtendFootprintOperation.cs b/StellarDotnetSdk/Operations/ExtendFootprintOperation.cs index fbaa69df..23d49115 100644 --- a/StellarDotnetSdk/Operations/ExtendFootprintOperation.cs +++ b/StellarDotnetSdk/Operations/ExtendFootprintOperation.cs @@ -51,11 +51,11 @@ public override Xdr.Operation.OperationBody ToOperationBody() }; } - public static ExtendFootprintOperation FromXdr(ExtendFootprintTTLOp extendFootprintTTLOp) + public static ExtendFootprintOperation FromXdr(ExtendFootprintTTLOp extendFootprintTtlOp) { return new ExtendFootprintOperation( - extendFootprintTTLOp.ExtendTo.InnerValue, - ExtensionPoint.FromXdr(extendFootprintTTLOp.Ext) + extendFootprintTtlOp.ExtendTo.InnerValue, + ExtensionPoint.FromXdr(extendFootprintTtlOp.Ext) ); } } \ No newline at end of file diff --git a/StellarDotnetSdk/Operations/InvokeHostFunctionOperation.cs b/StellarDotnetSdk/Operations/InvokeHostFunctionOperation.cs index 6459ce1c..24f1adae 100644 --- a/StellarDotnetSdk/Operations/InvokeHostFunctionOperation.cs +++ b/StellarDotnetSdk/Operations/InvokeHostFunctionOperation.cs @@ -160,7 +160,7 @@ public static CreateContractOperation FromAddress( { return new CreateContractOperation( new CreateContractV2HostFunction( - new ContractIDAddressPreimage(accountId, salt), + new ContractIdAddressPreimage(accountId, salt), new ContractExecutableWasm(wasmHash), arguments ?? [] ), @@ -184,7 +184,7 @@ public static CreateContractOperation FromAsset( { return new CreateContractOperation( new CreateContractV2HostFunction( - new ContractIDAssetPreimage(asset), + new ContractIdAssetPreimage(asset), new ContractExecutableStellarAsset(), arguments ?? [] ), @@ -216,7 +216,7 @@ public static CreateContractOperation FromXdr(InvokeHostFunctionOp invokeHostFun var createContractArgs = invokeHostFunctionOp.HostFunction.CreateContractV2; return new CreateContractOperation( new CreateContractV2HostFunction( - ContractIDPreimage.FromXdr(createContractArgs.ContractIDPreimage), + ContractIdPreimage.FromXdr(createContractArgs.ContractIDPreimage), ContractExecutable.FromXdr(createContractArgs.Executable), createContractArgs.ConstructorArgs.Select(SCVal.FromXdr).ToArray() ) @@ -320,11 +320,11 @@ public InvokeContractArgs ToXdr() public class CreateContractHostFunction : HostFunction { public CreateContractHostFunction( - ContractIDPreimage contractIDPreimage, + ContractIdPreimage contractIdPreimage, ContractExecutable executable ) { - ContractIDPreimage = contractIDPreimage; + ContractIdPreimage = contractIdPreimage; Executable = executable; } @@ -336,17 +336,17 @@ ContractExecutable executable /// (Optional) A salt. Will be randomly generated if not provided. public CreateContractHostFunction(string wasmHash, string address, byte[]? salt = null) { - ContractIDPreimage = new ContractIDAddressPreimage(address, salt); + ContractIdPreimage = new ContractIdAddressPreimage(address, salt); Executable = new ContractExecutableWasm(wasmHash); } - public ContractIDPreimage ContractIDPreimage { get; } + public ContractIdPreimage ContractIdPreimage { get; } public ContractExecutable Executable { get; } public static CreateContractHostFunction FromXdr(CreateContractArgs xdrCreateContractArgs) { return new CreateContractHostFunction( - ContractIDPreimage.FromXdr(xdrCreateContractArgs.ContractIDPreimage), + ContractIdPreimage.FromXdr(xdrCreateContractArgs.ContractIDPreimage), ContractExecutable.FromXdr(xdrCreateContractArgs.Executable) ); } @@ -355,7 +355,7 @@ public CreateContractArgs ToXdr() { return new CreateContractArgs { - ContractIDPreimage = ContractIDPreimage.ToXdr(), + ContractIDPreimage = ContractIdPreimage.ToXdr(), Executable = Executable.ToXdr(), }; } @@ -367,12 +367,12 @@ public CreateContractArgs ToXdr() public class CreateContractV2HostFunction : HostFunction { public CreateContractV2HostFunction( - ContractIDPreimage contractIdPreimage, + ContractIdPreimage contractIdPreimage, ContractExecutable executable, SCVal[] arguments ) { - ContractIDPreimage = contractIdPreimage; + ContractIdPreimage = contractIdPreimage; Executable = executable; Arguments = arguments; } @@ -390,19 +390,19 @@ public CreateContractV2HostFunction( byte[]? salt = null ) { - ContractIDPreimage = new ContractIDAddressPreimage(address, salt); + ContractIdPreimage = new ContractIdAddressPreimage(address, salt); Executable = new ContractExecutableWasm(wasmHash); Arguments = arguments; } - public ContractIDPreimage ContractIDPreimage { get; } + public ContractIdPreimage ContractIdPreimage { get; } public ContractExecutable Executable { get; } public SCVal[] Arguments { get; } public static CreateContractV2HostFunction FromXdr(CreateContractArgsV2 xdrCreateContractArgs) { return new CreateContractV2HostFunction( - ContractIDPreimage.FromXdr(xdrCreateContractArgs.ContractIDPreimage), + ContractIdPreimage.FromXdr(xdrCreateContractArgs.ContractIDPreimage), ContractExecutable.FromXdr(xdrCreateContractArgs.Executable), xdrCreateContractArgs.ConstructorArgs.Select(SCVal.FromXdr).ToArray() ); @@ -412,7 +412,7 @@ public CreateContractArgsV2 ToXdr() { return new CreateContractArgsV2 { - ContractIDPreimage = ContractIDPreimage.ToXdr(), + ContractIDPreimage = ContractIdPreimage.ToXdr(), Executable = Executable.ToXdr(), ConstructorArgs = Arguments.Select(a => a.ToXdr()).ToArray(), }; @@ -760,34 +760,34 @@ public Xdr.SorobanAuthorizedFunction ToSorobanAuthorizedFunctionXdr() } } -public abstract class ContractIDPreimage +public abstract class ContractIdPreimage { - public Xdr.ContractIDPreimage ToXdr() + public ContractIDPreimage ToXdr() { return this switch { - ContractIDAddressPreimage fromAddress => fromAddress.ToContractIDPreimageXdr(), - ContractIDAssetPreimage fromAsset => fromAsset.ToContractIDPreimageXdr(), + ContractIdAddressPreimage fromAddress => fromAddress.ToContractIdPreimageXdr(), + ContractIdAssetPreimage fromAsset => fromAsset.ToContractIdPreimageXdr(), _ => throw new InvalidOperationException("Unknown ContractIDPreimage type"), }; } - public static ContractIDPreimage FromXdr(Xdr.ContractIDPreimage xdrContractIDPreimage) + public static ContractIdPreimage FromXdr(ContractIDPreimage xdrContractIdPreimage) { - return xdrContractIDPreimage.Discriminant.InnerValue switch + return xdrContractIdPreimage.Discriminant.InnerValue switch { PreimageType.CONTRACT_ID_PREIMAGE_FROM_ADDRESS => - ContractIDAddressPreimage.FromContractIDPreimageXdr(xdrContractIDPreimage), + ContractIdAddressPreimage.FromContractIdPreimageXdr(xdrContractIdPreimage), PreimageType.CONTRACT_ID_PREIMAGE_FROM_ASSET => - ContractIDAssetPreimage.FromContractIDPreimageXdr(xdrContractIDPreimage), - _ => throw new InvalidOperationException("Unknown ContractIDPreimage type"), + ContractIdAssetPreimage.FromContractIdPreimageXdr(xdrContractIdPreimage), + _ => throw new InvalidOperationException("Unknown ContractIdPreimage type"), }; } } -public class ContractIDAddressPreimage : ContractIDPreimage +public class ContractIdAddressPreimage : ContractIdPreimage { - public ContractIDAddressPreimage(string address, byte[]? salt = null) + public ContractIdAddressPreimage(string address, byte[]? salt = null) { Address = new SCAccountId(address); @@ -810,28 +810,28 @@ public ContractIDAddressPreimage(string address, byte[]? salt = null) public SCAddress Address { get; } public byte[] Salt { get; } - public static ContractIDPreimage FromContractIDPreimageXdr(Xdr.ContractIDPreimage xdrContractIDPreimage) + public static ContractIdPreimage FromContractIdPreimageXdr(ContractIDPreimage xdrContractIdPreimage) { - if (xdrContractIDPreimage.Discriminant.InnerValue != PreimageType.CONTRACT_ID_PREIMAGE_FROM_ADDRESS) + if (xdrContractIdPreimage.Discriminant.InnerValue != PreimageType.CONTRACT_ID_PREIMAGE_FROM_ADDRESS) { throw new InvalidOperationException("Invalid ContractIdPreimage type"); } - return new ContractIDAddressPreimage( - KeyPair.FromXdrPublicKey(xdrContractIDPreimage.FromAddress.Address.AccountId.InnerValue).AccountId, - xdrContractIDPreimage.FromAddress.Salt.InnerValue + return new ContractIdAddressPreimage( + KeyPair.FromXdrPublicKey(xdrContractIdPreimage.FromAddress.Address.AccountId.InnerValue).AccountId, + xdrContractIdPreimage.FromAddress.Salt.InnerValue ); } - public Xdr.ContractIDPreimage ToContractIDPreimageXdr() + public ContractIDPreimage ToContractIdPreimageXdr() { - return new Xdr.ContractIDPreimage + return new ContractIDPreimage { Discriminant = new ContractIDPreimageType { InnerValue = PreimageType.CONTRACT_ID_PREIMAGE_FROM_ADDRESS, }, - FromAddress = new Xdr.ContractIDPreimage.ContractIDPreimageFromAddress + FromAddress = new ContractIDPreimage.ContractIDPreimageFromAddress { Address = Address.ToXdr(), Salt = new Uint256(Salt), @@ -840,28 +840,28 @@ public Xdr.ContractIDPreimage ToContractIDPreimageXdr() } } -public class ContractIDAssetPreimage : ContractIDPreimage +public class ContractIdAssetPreimage : ContractIdPreimage { - public ContractIDAssetPreimage(Asset asset) + public ContractIdAssetPreimage(Asset asset) { Asset = asset; } public Asset Asset { get; } - public static ContractIDPreimage FromContractIDPreimageXdr(Xdr.ContractIDPreimage xdrContractIDPreimage) + public static ContractIdPreimage FromContractIdPreimageXdr(ContractIDPreimage xdrContractIdPreimage) { - if (xdrContractIDPreimage.Discriminant.InnerValue != PreimageType.CONTRACT_ID_PREIMAGE_FROM_ASSET) + if (xdrContractIdPreimage.Discriminant.InnerValue != PreimageType.CONTRACT_ID_PREIMAGE_FROM_ASSET) { - throw new InvalidOperationException("Invalid ContractIDPreimage type"); + throw new InvalidOperationException("Invalid ContractIdPreimage type"); } - return new ContractIDAssetPreimage(Asset.FromXdr(xdrContractIDPreimage.FromAsset)); + return new ContractIdAssetPreimage(Asset.FromXdr(xdrContractIdPreimage.FromAsset)); } - public Xdr.ContractIDPreimage ToContractIDPreimageXdr() + public ContractIDPreimage ToContractIdPreimageXdr() { - return new Xdr.ContractIDPreimage + return new ContractIDPreimage { Discriminant = new ContractIDPreimageType { diff --git a/StellarDotnetSdk/Operations/LiquidityPoolDepositOperation.cs b/StellarDotnetSdk/Operations/LiquidityPoolDepositOperation.cs index fe1cb0cb..9ff32581 100644 --- a/StellarDotnetSdk/Operations/LiquidityPoolDepositOperation.cs +++ b/StellarDotnetSdk/Operations/LiquidityPoolDepositOperation.cs @@ -27,13 +27,13 @@ public class LiquidityPoolDepositOperation : Operation /// Maximum depositA/depositB. /// (Optional) Source account of the operation. public LiquidityPoolDepositOperation( - LiquidityPoolID liquidityPoolId, + LiquidityPoolId liquidityPoolId, string maxAmountA, string maxAmountB, Price minPrice, Price maxPrice, IAccountId? sourceAccount = null) : base(sourceAccount) { - LiquidityPoolID = liquidityPoolId ?? + LiquidityPoolId = liquidityPoolId ?? throw new ArgumentNullException(nameof(liquidityPoolId), "liquidityPoolID cannot be null"); MaxAmountA = maxAmountA ?? throw new ArgumentNullException(nameof(maxAmountA), "maxAmountA cannot be null"); MaxAmountB = maxAmountB ?? throw new ArgumentNullException(nameof(maxAmountB), "maxAmountB cannot be null"); @@ -46,7 +46,7 @@ public LiquidityPoolDepositOperation(AssetAmount assetAmountA, Price minPrice, Price maxPrice, IAccountId? sourceAccount = null) - : this(new LiquidityPoolID( + : this(new LiquidityPoolId( LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, assetAmountA.Asset, assetAmountB.Asset, @@ -62,7 +62,7 @@ public LiquidityPoolDepositOperation(AssetAmount assetAmountA, /// /// The PoolID for the Liquidity Pool to deposit into. /// - public LiquidityPoolID LiquidityPoolID { get; } + public LiquidityPoolId LiquidityPoolId { get; } /// /// Maximum amount of first asset to deposit. @@ -91,7 +91,7 @@ public override Xdr.Operation.OperationBody ToOperationBody() Discriminant = OperationType.Create(OperationType.OperationTypeEnum.LIQUIDITY_POOL_DEPOSIT), LiquidityPoolDepositOp = new LiquidityPoolDepositOp { - LiquidityPoolID = LiquidityPoolID.ToXdr(), + LiquidityPoolID = LiquidityPoolId.ToXdr(), MaxAmountA = new xdr_Int64(ToXdrAmount(MaxAmountA)), MaxAmountB = new xdr_Int64(ToXdrAmount(MaxAmountB)), MinPrice = MinPrice.ToXdr(), @@ -103,7 +103,7 @@ public override Xdr.Operation.OperationBody ToOperationBody() public static LiquidityPoolDepositOperation FromXdr(LiquidityPoolDepositOp liquidityPoolDepositOp) { return new LiquidityPoolDepositOperation( - LiquidityPoolID.FromXdr(liquidityPoolDepositOp.LiquidityPoolID), + LiquidityPoolId.FromXdr(liquidityPoolDepositOp.LiquidityPoolID), FromXdrAmount(liquidityPoolDepositOp.MaxAmountA.InnerValue), FromXdrAmount(liquidityPoolDepositOp.MaxAmountB.InnerValue), Price.FromXdr(liquidityPoolDepositOp.MinPrice), diff --git a/StellarDotnetSdk/Operations/LiquidityPoolWithdrawOperation.cs b/StellarDotnetSdk/Operations/LiquidityPoolWithdrawOperation.cs index 981a3696..b47b5d2b 100644 --- a/StellarDotnetSdk/Operations/LiquidityPoolWithdrawOperation.cs +++ b/StellarDotnetSdk/Operations/LiquidityPoolWithdrawOperation.cs @@ -22,20 +22,20 @@ public class LiquidityPoolWithdrawOperation : Operation /// /// Constructs a new LiquidityPoolWithdrawOperation. /// - /// The PoolID for the Liquidity Pool to withdraw from. + /// The Pool ID for the Liquidity Pool to withdraw from. /// Amount of pool shares to withdraw. /// Minimum amount of the first asset to withdraw. /// Minimum amount of the second asset to withdraw. /// (Optional) Source account of the operation. public LiquidityPoolWithdrawOperation( - LiquidityPoolID liquidityPoolId, + LiquidityPoolId liquidityPoolId, string amount, string minAmountA, string minAmountB, IAccountId? sourceAccount = null) : base(sourceAccount) { LiquidityPoolId = liquidityPoolId ?? - throw new ArgumentNullException(nameof(liquidityPoolId), "liquidityPoolID cannot be null"); + throw new ArgumentNullException(nameof(liquidityPoolId), "liquidityPoolId cannot be null"); Amount = amount ?? throw new ArgumentNullException(nameof(amount), "amount cannot be null"); MinAmountA = minAmountA ?? throw new ArgumentNullException(nameof(minAmountA), "minAmountA cannot be null"); MinAmountB = minAmountB ?? throw new ArgumentNullException(nameof(minAmountB), "minAmountB cannot be null"); @@ -47,7 +47,7 @@ public LiquidityPoolWithdrawOperation( AssetAmount assetB, string amount, IAccountId? sourceAccount = null) - : this(new LiquidityPoolID( + : this(new LiquidityPoolId( LiquidityPoolType.LiquidityPoolTypeEnum.LIQUIDITY_POOL_CONSTANT_PRODUCT, assetA.Asset, assetB.Asset, @@ -60,9 +60,9 @@ public LiquidityPoolWithdrawOperation( } /// - /// The PoolID for the Liquidity Pool to withdraw from. + /// The Pool ID for the Liquidity Pool to withdraw from. /// - public LiquidityPoolID LiquidityPoolId { get; } + public LiquidityPoolId LiquidityPoolId { get; } /// /// Amount of pool shares to withdraw. @@ -98,7 +98,7 @@ public override Xdr.Operation.OperationBody ToOperationBody() public static LiquidityPoolWithdrawOperation FromXdr(LiquidityPoolWithdrawOp liquidityPoolWithdrawOp) { return new LiquidityPoolWithdrawOperation( - LiquidityPoolID.FromXdr(liquidityPoolWithdrawOp.LiquidityPoolID), + LiquidityPoolId.FromXdr(liquidityPoolWithdrawOp.LiquidityPoolID), StellarDotnetSdk.Amount.FromXdr(liquidityPoolWithdrawOp.Amount.InnerValue), StellarDotnetSdk.Amount.FromXdr(liquidityPoolWithdrawOp.MinAmountA.InnerValue), StellarDotnetSdk.Amount.FromXdr(liquidityPoolWithdrawOp.MinAmountB.InnerValue) diff --git a/StellarDotnetSdk/Operations/PathPaymentStrictReceiveOperation.cs b/StellarDotnetSdk/Operations/PathPaymentStrictReceiveOperation.cs index 00a43154..f25aece2 100644 --- a/StellarDotnetSdk/Operations/PathPaymentStrictReceiveOperation.cs +++ b/StellarDotnetSdk/Operations/PathPaymentStrictReceiveOperation.cs @@ -50,7 +50,7 @@ public PathPaymentStrictReceiveOperation( DestAsset = destAsset ?? throw new ArgumentNullException(nameof(destAsset), "destAsset cannot be null"); DestAmount = destAmount ?? throw new ArgumentNullException(nameof(destAmount), "destAmount cannot be null"); - path ??= Array.Empty(); + path ??= []; if (path.Length > 5) { throw new ArgumentException("The maximum number of assets in the path is 5.", nameof(path)); diff --git a/StellarDotnetSdk/Operations/PathPaymentStrictSendOperation.cs b/StellarDotnetSdk/Operations/PathPaymentStrictSendOperation.cs index 8c994659..0c640d8d 100644 --- a/StellarDotnetSdk/Operations/PathPaymentStrictSendOperation.cs +++ b/StellarDotnetSdk/Operations/PathPaymentStrictSendOperation.cs @@ -46,7 +46,7 @@ public PathPaymentStrictSendOperation( DestAsset = destAsset ?? throw new ArgumentNullException(nameof(destAsset), "destAsset cannot be null"); DestMin = destMin ?? throw new ArgumentNullException(nameof(destMin), "destMin cannot be null"); - path ??= Array.Empty(); + path ??= []; if (path.Length > 5) { throw new ArgumentException("The maximum number of assets in the path is 5", nameof(path)); diff --git a/StellarDotnetSdk/Operations/RevokeLedgerEntrySponsorshipOperation.cs b/StellarDotnetSdk/Operations/RevokeLedgerEntrySponsorshipOperation.cs index ed4e1279..9ee08445 100644 --- a/StellarDotnetSdk/Operations/RevokeLedgerEntrySponsorshipOperation.cs +++ b/StellarDotnetSdk/Operations/RevokeLedgerEntrySponsorshipOperation.cs @@ -47,9 +47,15 @@ public static RevokeLedgerEntrySponsorshipOperation ForAccount(KeyPair account, } /// - /// Creates a new revoke balance entry sponsorship operation. + /// Constructs new revoke balance entry sponsorship operation. /// - /// Hex-encoded ID of the balance entry to be revoked. + /// + /// Hex-encoded ID of the claimable balance entry to be revoked. + /// For example: + /// Either 00000000d1d73327fc560cc09f54a11c7a64180611e1f480f3bf60117e41d19d9593b780 + /// or + /// d1d73327fc560cc09f54a11c7a64180611e1f480f3bf60117e41d19d9593b780 is accepted. + /// public static RevokeLedgerEntrySponsorshipOperation ForClaimableBalance( string balanceId, IAccountId? sourceAccount = null) diff --git a/StellarDotnetSdk/Requests/EffectsRequestBuilder.cs b/StellarDotnetSdk/Requests/EffectsRequestBuilder.cs index f23cba3a..24475832 100644 --- a/StellarDotnetSdk/Requests/EffectsRequestBuilder.cs +++ b/StellarDotnetSdk/Requests/EffectsRequestBuilder.cs @@ -59,14 +59,14 @@ public EffectsRequestBuilder ForOperation(long operationId) return this; } - public EffectsRequestBuilder ForLiquidityPool(LiquidityPoolID liquidityPoolID) + public EffectsRequestBuilder ForLiquidityPool(LiquidityPoolId liquidityPoolId) { - return ForLiquidityPool(liquidityPoolID.ToString()); + return ForLiquidityPool(liquidityPoolId.ToString()); } - public EffectsRequestBuilder ForLiquidityPool(string liquidityPoolID) + public EffectsRequestBuilder ForLiquidityPool(string liquidityPoolId) { - SetSegments("liquidity_pools", liquidityPoolID, "effects"); + SetSegments("liquidity_pools", liquidityPoolId, "effects"); return this; } } \ No newline at end of file diff --git a/StellarDotnetSdk/Requests/LiquidityPoolsRequestBuilder.cs b/StellarDotnetSdk/Requests/LiquidityPoolsRequestBuilder.cs index 95f33f6d..8b0c23cd 100644 --- a/StellarDotnetSdk/Requests/LiquidityPoolsRequestBuilder.cs +++ b/StellarDotnetSdk/Requests/LiquidityPoolsRequestBuilder.cs @@ -30,9 +30,9 @@ public async Task LiquidityPool(string liquidityPoolId) return await LiquidityPool(BuildUri()); } - public async Task LiquidityPool(LiquidityPoolID liquidityPoolID) + public async Task LiquidityPool(LiquidityPoolId liquidityPoolId) { - return await LiquidityPool(liquidityPoolID.ToString()); + return await LiquidityPool(liquidityPoolId.ToString()); } public LiquidityPoolsRequestBuilder ForReserves(params string[] reserves) diff --git a/StellarDotnetSdk/Requests/UriTemplate.cs b/StellarDotnetSdk/Requests/UriTemplate.cs index 80b73ed9..6d1eee66 100644 --- a/StellarDotnetSdk/Requests/UriTemplate.cs +++ b/StellarDotnetSdk/Requests/UriTemplate.cs @@ -7,7 +7,7 @@ namespace StellarDotnetSdk.Requests; /// /// Partial implement of the Uri Template Spec (RFC 6570). -/// In particular it implements: +/// In particular, it implements: /// * Query component expressions ( {?var1,var2,...,varn} ) /// * Simple variables ( {var} ) /// diff --git a/StellarDotnetSdk/Responses/Effects/LiquidityPoolRemovedEffectResponse.cs b/StellarDotnetSdk/Responses/Effects/LiquidityPoolRemovedEffectResponse.cs index 6677be2d..743e5a73 100644 --- a/StellarDotnetSdk/Responses/Effects/LiquidityPoolRemovedEffectResponse.cs +++ b/StellarDotnetSdk/Responses/Effects/LiquidityPoolRemovedEffectResponse.cs @@ -9,5 +9,5 @@ public class LiquidityPoolRemovedEffectResponse : EffectResponse public override int TypeId => 94; [JsonProperty(PropertyName = "liquidity_pool_id")] - public LiquidityPoolID LiquidityPoolId { get; private set; } + public LiquidityPoolId LiquidityPoolId { get; private set; } } \ No newline at end of file diff --git a/StellarDotnetSdk/Responses/LiquidityPoolResponse.cs b/StellarDotnetSdk/Responses/LiquidityPoolResponse.cs index 868a40e3..34189a85 100644 --- a/StellarDotnetSdk/Responses/LiquidityPoolResponse.cs +++ b/StellarDotnetSdk/Responses/LiquidityPoolResponse.cs @@ -8,7 +8,7 @@ namespace StellarDotnetSdk.Responses; public class LiquidityPoolResponse : Response, IPagingToken { - [JsonProperty(PropertyName = "id")] public LiquidityPoolID Id { get; init; } + [JsonProperty(PropertyName = "id")] public LiquidityPoolId Id { get; init; } [JsonProperty(PropertyName = "fee_bp")] public int FeeBp { get; init; } diff --git a/StellarDotnetSdk/Responses/Operations/LiquidityPoolDepositOperationResponse.cs b/StellarDotnetSdk/Responses/Operations/LiquidityPoolDepositOperationResponse.cs index b75e3ce1..9cf490e0 100644 --- a/StellarDotnetSdk/Responses/Operations/LiquidityPoolDepositOperationResponse.cs +++ b/StellarDotnetSdk/Responses/Operations/LiquidityPoolDepositOperationResponse.cs @@ -9,7 +9,7 @@ public class LiquidityPoolDepositOperationResponse : OperationResponse { public override int TypeId => 22; - [JsonProperty("liquidity_pool_id")] public LiquidityPoolID LiquidityPoolID { get; init; } + [JsonProperty("liquidity_pool_id")] public LiquidityPoolId LiquidityPoolId { get; init; } [JsonProperty("reserves_max")] public List ReservesMax { get; init; } diff --git a/StellarDotnetSdk/Responses/Operations/LiquidityPoolWithdrawOperationResponse.cs b/StellarDotnetSdk/Responses/Operations/LiquidityPoolWithdrawOperationResponse.cs index 085d388a..6724e5b9 100644 --- a/StellarDotnetSdk/Responses/Operations/LiquidityPoolWithdrawOperationResponse.cs +++ b/StellarDotnetSdk/Responses/Operations/LiquidityPoolWithdrawOperationResponse.cs @@ -9,7 +9,7 @@ public class LiquidityPoolWithdrawOperationResponse : OperationResponse { public override int TypeId => 23; - [JsonProperty("liquidity_pool_id")] public LiquidityPoolID LiquidityPoolID { get; init; } + [JsonProperty("liquidity_pool_id")] public LiquidityPoolId LiquidityPoolId { get; init; } [JsonProperty("reserves_min")] public List ReservesMin { get; init; } diff --git a/StellarDotnetSdk/Responses/Operations/OperationResponse.cs b/StellarDotnetSdk/Responses/Operations/OperationResponse.cs index 85469d87..6e19da35 100644 --- a/StellarDotnetSdk/Responses/Operations/OperationResponse.cs +++ b/StellarDotnetSdk/Responses/Operations/OperationResponse.cs @@ -16,7 +16,7 @@ namespace StellarDotnetSdk.Responses.Operations; public abstract class OperationResponse : Response, IPagingToken { /// - /// Id of the operation + /// ID of the operation /// [JsonProperty(PropertyName = "id")] public long Id { get; private set; } diff --git a/StellarDotnetSdk/Responses/Operations/PaymentOperationResponse.cs b/StellarDotnetSdk/Responses/Operations/PaymentOperationResponse.cs index 3454a2c2..f54063d6 100644 --- a/StellarDotnetSdk/Responses/Operations/PaymentOperationResponse.cs +++ b/StellarDotnetSdk/Responses/Operations/PaymentOperationResponse.cs @@ -46,7 +46,7 @@ public class PaymentOperationResponse : OperationResponse public string FromMuxed { get; init; } [JsonProperty(PropertyName = "from_muxed_id")] - public ulong? FromMuxedID { get; init; } + public ulong? FromMuxedId { get; init; } /// /// @@ -57,7 +57,7 @@ public class PaymentOperationResponse : OperationResponse public string ToMuxed { get; init; } [JsonProperty(PropertyName = "to_muxed_id")] - public ulong? ToMuxedID { get; init; } + public ulong? ToMuxedId { get; init; } /// /// Account address that receives the payment. diff --git a/StellarDotnetSdk/Responses/Operations/RevokeSponsorshipOperationResponse.cs b/StellarDotnetSdk/Responses/Operations/RevokeSponsorshipOperationResponse.cs index 82452fdb..a7e464d2 100644 --- a/StellarDotnetSdk/Responses/Operations/RevokeSponsorshipOperationResponse.cs +++ b/StellarDotnetSdk/Responses/Operations/RevokeSponsorshipOperationResponse.cs @@ -11,28 +11,28 @@ public class RevokeSponsorshipOperationResponse : OperationResponse public override int TypeId => 18; [JsonProperty(PropertyName = "account_id")] - public string AccountID { get; init; } + public string AccountId { get; init; } [JsonProperty(PropertyName = "claimable_balance_id")] - public string ClaimableBalanceID { get; init; } + public string ClaimableBalanceId { get; init; } [JsonProperty(PropertyName = "data_account_id")] - public string DataAccountID { get; init; } + public string DataAccountId { get; init; } [JsonProperty(PropertyName = "data_name")] public string DataName { get; init; } [JsonProperty(PropertyName = "offer_id")] - public string OfferID { get; init; } + public string OfferId { get; init; } [JsonProperty(PropertyName = "trustline_account_id")] - public string TrustlineAccountID { get; init; } + public string TrustlineAccountId { get; init; } [JsonProperty(PropertyName = "trustline_asset")] public string TrustlineAsset { get; init; } [JsonProperty(PropertyName = "signer_account_id")] - public string SignerAccountID { get; init; } + public string SignerAccountId { get; init; } [JsonProperty(PropertyName = "signer_key")] public string SignerKey { get; init; } diff --git a/StellarDotnetSdk/Responses/TradeResponse.cs b/StellarDotnetSdk/Responses/TradeResponse.cs index a71658e0..d188d4bf 100644 --- a/StellarDotnetSdk/Responses/TradeResponse.cs +++ b/StellarDotnetSdk/Responses/TradeResponse.cs @@ -26,7 +26,7 @@ public class TradeResponse : Response, IPagingToken public string BaseAccount { get; init; } [JsonProperty(PropertyName = "base_liquidity_pool_id")] - public LiquidityPoolID BaseLiquidityPoolId { get; set; } + public LiquidityPoolId BaseLiquidityPoolId { get; set; } [JsonProperty(PropertyName = "base_offer_id")] public string BaseOfferId { get; init; } @@ -47,7 +47,7 @@ public class TradeResponse : Response, IPagingToken public string CounterAccount { get; init; } [JsonProperty(PropertyName = "counter_liquidity_pool_id")] - public LiquidityPoolID CounterLiquidityPoolId { get; init; } + public LiquidityPoolId CounterLiquidityPoolId { get; init; } [JsonProperty(PropertyName = "counter_offer_id")] public string CounterOfferId { get; init; } diff --git a/StellarDotnetSdk/Responses/TransactionResponse.cs b/StellarDotnetSdk/Responses/TransactionResponse.cs index 4bedd383..37f68a0c 100644 --- a/StellarDotnetSdk/Responses/TransactionResponse.cs +++ b/StellarDotnetSdk/Responses/TransactionResponse.cs @@ -71,13 +71,13 @@ public class TransactionResponse : Response, IPagingToken #nullable restore [JsonProperty(PropertyName = "account_muxed_id")] - public ulong? AccountMuxedID { get; init; } + public ulong? AccountMuxedId { get; init; } [JsonProperty(PropertyName = "account_muxed")] public string? AccountMuxed { get; init; } [JsonProperty(PropertyName = "fee_account_muxed_id")] - public ulong? FeeAccountMuxedID { get; set; } + public ulong? FeeAccountMuxedId { get; set; } [JsonProperty(PropertyName = "memo")] public string? MemoValue { get; init; } diff --git a/StellarDotnetSdk/Server.cs b/StellarDotnetSdk/Server.cs index 05edeced..4f3ddc4b 100644 --- a/StellarDotnetSdk/Server.cs +++ b/StellarDotnetSdk/Server.cs @@ -5,7 +5,6 @@ using System.Net.Http; using System.Reflection; using System.Threading.Tasks; -using stellar_dotnet_sdk; using StellarDotnetSdk.Accounts; using StellarDotnetSdk.Exceptions; using StellarDotnetSdk.Federation; diff --git a/StellarDotnetSdk/Soroban/TransactionMetaV3.cs b/StellarDotnetSdk/Soroban/TransactionMetaV3.cs index 54b187f4..b9176070 100644 --- a/StellarDotnetSdk/Soroban/TransactionMetaV3.cs +++ b/StellarDotnetSdk/Soroban/TransactionMetaV3.cs @@ -26,13 +26,13 @@ public class TransactionMetaV3 /// Transaction level changes after operations are applied if any. /// public ledgerentries_LedgerEntryChange[] TransactionChangesAfter { get; private set; } = - Array.Empty(); + []; /// /// Meta for each operation. /// public ledgerentries_LedgerEntryChange[][] Operations { get; private set; } = - Array.Empty(); + []; // TODO Unit test with actual data can be done with the case of sponsoring trustline. AAAAAwAAAAAAAAACAAAAAwAIZwEAAAAAAAAAACMRtl/+ZI8994htM6K35GWqLqFTU3LGv/gzRqx0bXTQAAAAFd6pPdoAAB82AAAAegAAAAkAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAAGAAAAAAAAAAMAAAAAAAhmpwAAAABl7pTNAAAAAAAAAAEACGcBAAAAAAAAAAAjEbZf/mSPPfeIbTOit+Rlqi6hU1Nyxr/4M0asdG100AAAABXeqT3aAAAfNgAAAHsAAAAJAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAABgAAAAAAAAADAAAAAAAIZwEAAAAAZe6WoQAAAAAAAAADAAAAAAAAAAUAAAAAAAhnAQAAAAEAAAAAWOReMQoIuRGVqVdU95hGUv9sNNBwapkLkukv70rxmD4AAAABQUFBAAAAAAAjEbZf/mSPPfeIbTOit+Rlqi6hU1Nyxr/4M0asdG100AAAAAAAAAAAf/////////8AAAABAAAAAAAAAAEAAAABAAAAACMRtl/+ZI8994htM6K35GWqLqFTU3LGv/gzRqx0bXTQAAAAAAAAAAMACGcBAAAAAAAAAAAjEbZf/mSPPfeIbTOit+Rlqi6hU1Nyxr/4M0asdG100AAAABXeqT3aAAAfNgAAAHsAAAAJAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAAAAAAABgAAAAAAAAADAAAAAAAIZwEAAAAAZe6WoQAAAAAAAAABAAhnAQAAAAAAAAAAIxG2X/5kjz33iG0zorfkZaouoVNTcsa/+DNGrHRtdNAAAAAV3qk92gAAHzYAAAB7AAAACQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAAcAAAAAAAAAAwAAAAAACGcBAAAAAGXulqEAAAAAAAAAAwAHr8EAAAAAAAAAAFjkXjEKCLkRlalXVPeYRlL/bDTQcGqZC5LpL+9K8Zg+AAAAAAAAAAAAB6/BAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAIAAAAAAAAAAAAAAAAAAAABAAAAAQAAAAC0nk2pUBTErnUCqsB7QlRaLeMjIrls0Ry+aM4Mz43/lgAAAAAAAAABAAhnAQAAAAAAAAAAWOReMQoIuRGVqVdU95hGUv9sNNBwapkLkukv70rxmD4AAAAAAAAAAAAHr8EAAAAAAAAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAwAAAAAAAAAAAAAAAAAAAAEAAAABAAAAALSeTalQFMSudQKqwHtCVFot4yMiuWzRHL5ozgzPjf+WAAAAAAAAAAAAAAAAAAAAAA== ///