123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- @page "/WebAPI"
- @page "/WebAPI/{Smart:int}"
- @using HyperCube.Models;
- <h3>WebAPI</h3>
- @Smart
- @code
- {
- protected override async Task OnInitializedAsync()
- {
- Console.WriteLine($"WebAPI OnInitializedAsync {Smart}");
- }
- protected override async Task OnParametersSetAsync()
- {
-
- await Transfer50();
- }
- private async Task Transfer50()
- {
-
- var acc = AccountModel.FindByMail("valafar@mail.ru");
- if (acc != null)
- {
- Console.WriteLine("acc found "+acc.Name);
- var bc = await acc.GetSelectedBlockChain();
- if (bc != null)
- {
-
- var addr = await acc.GetOrCreateActualAddress(bc);
- var res = await bc.SendTransaction(bc.address, addr, Smart);
- }
- else
- Console.WriteLine("bc null ");
- }
- else
- Console.WriteLine("account null ");
- }
- [Parameter]
- public int Smart { get; set; }
- async Task<string> Verify()
- {
- Console.WriteLine($"Verify starting");
- try
- {
-
-
-
-
-
-
-
-
-
- }
- catch (Exception e)
- {
- Console.WriteLine(e.Message + "stack trace" + e.StackTrace);
- }
- return "Verify failed";
- }
- }
|