-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from tyronbrand/new-gRPC-methods
new gRPC methods
- Loading branch information
Showing
15 changed files
with
383 additions
and
21 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
examples/Flow.Net.Examples/TransactionExamples/GetTransactionResultByIndexExample.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Flow.Net.Sdk.Client.Grpc; | ||
using Flow.Net.Sdk.Core.Client; | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Flow.Net.Examples.TransactionExamples | ||
{ | ||
public class GetTransactionResultByIndexExample : ExampleBase | ||
{ | ||
public static async Task RunAsync(IFlowClient flowClient) | ||
{ | ||
Console.WriteLine("\nRunning GetTransactionExample\n"); | ||
FlowClient = flowClient; | ||
await PrepTransactionId(); | ||
await Demo(); | ||
Console.WriteLine("\nGetTransactionExample Complete\n"); | ||
} | ||
|
||
private static async Task Demo() | ||
{ | ||
if(FlowClient is FlowGrpcClient grpcClient) | ||
{ | ||
var block = await grpcClient.GetLatestBlockAsync(); | ||
} | ||
} | ||
|
||
private static async Task<string> PrepTransactionId() | ||
{ | ||
return await RandomTransactionAsync(); | ||
} | ||
} | ||
} |
34 changes: 34 additions & 0 deletions
34
examples/Flow.Net.Examples/TransactionExamples/GetTransactionResultsByBlockIdExample.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Flow.Net.Sdk.Client.Grpc; | ||
using Flow.Net.Sdk.Core.Client; | ||
using System; | ||
using System.Threading.Tasks; | ||
|
||
namespace Flow.Net.Examples.TransactionExamples | ||
{ | ||
public class GetTransactionResultsByBlockIdExample : ExampleBase | ||
{ | ||
public static async Task RunAsync(IFlowClient flowClient) | ||
{ | ||
Console.WriteLine("\nRunning GetTransactionResultsByBlockId\n"); | ||
FlowClient = flowClient; | ||
await PrepTransactionId(); | ||
await Demo(); | ||
Console.WriteLine("\nGetTransactionResultsByBlockId Complete\n"); | ||
} | ||
|
||
private static async Task Demo() | ||
{ | ||
if(FlowClient is FlowGrpcClient grpcClient) | ||
{ | ||
var block = await grpcClient.GetLatestBlockAsync(); | ||
|
||
var response = await grpcClient.GetTransactionResultsByBlockIdAsync(block.Header.Id); | ||
} | ||
} | ||
|
||
private static async Task<string> PrepTransactionId() | ||
{ | ||
return await RandomTransactionAsync(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.