diff --git a/src/Examples/Program.cs b/src/Examples/Program.cs index c46c909..4c8b457 100644 --- a/src/Examples/Program.cs +++ b/src/Examples/Program.cs @@ -106,6 +106,31 @@ private static void DecodeTxFee(string result) var txResult = Stellar.Generated.LedgerEntryChanges.Decode(reader); } + + static void ChangeTrust(KeyPair IssuerAccount_From, KeyPair TrustLineAcc_to) + { + + // Change Trust is required for Creating trustLine + Account destination = new Account(TrustLineAcc_to, GetSequence(TrustLineAcc_to.Address), 0); + + Asset asset = new Asset("XYZ", IssuerAccount_From); + long limit = 922337203685; + + destination.IncrementSequenceNumber(); + + Transaction Transaction = new Transaction.Builder(destination) + .AddOperation(new ChangeTrustOperation.Builder(asset, limit).Build()) + .Build(); + + Transaction.Sign(destination.KeyPair); + + var tx = Transaction.ToEnvelopeXdrBase64(); + + var response = PostResult(tx); + + Console.WriteLine("Trust Line: " + response.ReasonPhrase + "For Asset NECP"); + Console.WriteLine(""); + } static void Payment(KeyPair from, KeyPair to, long amount) { @@ -135,4 +160,4 @@ static void Payment(KeyPair from, KeyPair to, long amount) Console.WriteLine(response.ReasonPhrase); } } -} \ No newline at end of file +}