Beispiel #1
0
        public async Task CanEstablishTrust()
        {
            AccountInfo accountInfo = await client.AccountInfo("rwEHFU98CjH59UX2VqAgeCzRFU9KVvV71V");

            ITrustSetTransaction trustSet = new TrustSetTransaction();

            trustSet.LimitAmount = new Currency {
                CurrencyCode = "XYZ", Issuer = "rEqtEHKbinqm18wQSQGstmqg9SFpUELasT", Value = "1000000"
            };
            trustSet.Account  = "rwEHFU98CjH59UX2VqAgeCzRFU9KVvV71V";
            trustSet.Sequence = accountInfo.AccountData.Sequence;

            var      json     = trustSet.ToJson();
            TxSigner signer   = TxSigner.FromSecret("xxxxxxx");
            SignedTx signedTx = signer.SignJson(JObject.Parse(json));

            SubmitBlobRequest request = new SubmitBlobRequest();

            request.TransactionBlob = signedTx.TxBlob;

            Submit result = await client.SubmitTransactionBlob(request);

            Assert.IsNotNull(result);
            Assert.AreEqual("tesSUCCESS", result.EngineResult);
            Assert.IsNotNull(result.Transaction.Hash);
        }
        public async Task CanGetAccountInfo()
        {
            AccountInfo accountInfo = await client.AccountInfo(account);

            Assert.IsNotNull(accountInfo);
        }