Skip to content
This repository was archived by the owner on Feb 28, 2019. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion src/Examples/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -135,4 +160,4 @@ static void Payment(KeyPair from, KeyPair to, long amount)
Console.WriteLine(response.ReasonPhrase);
}
}
}
}