12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- @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)
- {
- AccountModel.Current = acc;
- Console.WriteLine("acc found "+acc.Name);
- var bc = Blockchain.GetMain();
- if (bc != null)
- {
-
- var addr = await acc.GetOrCreateActualAddress(bc);
- var res = await bc.SendTransaction(Blockchain.GetMain().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";
- }
- }
|