/// <summary> /// The ledger_entry method returns a single ledger object from the XRP Ledger in its raw format. /// See ledger format for information on the different types of objects you can retrieve. /// </summary> public async Task <LedgerEntryResponse> LedgerEntry(LedgerEntryRequest request, CancellationToken cancellationToken = default) { jsonBuffer.Clear(); jsonWriter.Reset(); jsonWriter.WriteStartObject(); var requestId = WriteHeader(jsonWriter, "ledger_entry"); LedgerSpecification.Write(jsonWriter, request.Ledger); jsonWriter.WriteBoolean("binary", true); jsonWriter.WriteString("index", request.Index.ToString()); WriteFooter(jsonWriter); jsonWriter.WriteEndObject(); jsonWriter.Flush(); var response = await SendReceiveAsync(requestId, jsonBuffer.WrittenMemory, cancellationToken); return(new LedgerEntryResponse(response)); }
public void LedgerEntry() { // Arrange var request = new LedgerEntryRequest(); request.Params.Add(new LedgerEntryRequestParams { AccountRoot = "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", LedgerIndex = LedgerIndex.Validated.ToLower(), Type = LedgerEntryType.AccountRoot.ToSnakeCase() }); // Act var response = _client.Ledger.LedgerEntryAsync(request).Result; // Assert Assert.AreEqual(Status.Success, response.Result.Status); }
public async Task <RpcJsonResponse <LedgerEntryResult> > LedgerEntryAsync(LedgerEntryRequest request) { return(await PostAsync <RpcJsonResponse <LedgerEntryResult>, LedgerEntryResult>(request)); }