public async Task <TransferPage> CreateTransferPage(BlockchainClient client, String pid) { TransferPage package = new TransferPage(client, pid); await package.getLocation(); return(package); }
public static string DoSignVTHOTx(List <string[]> transactions, string privateKey, bool isSend, int?gasLimit) { byte chainTag = 0; byte[] blockRef = null; var clauses = new List <ToClause>(); foreach (var transaction in transactions) { var amount = Amount.VTHO(); amount.SetDecimalAmount(transaction[1]); clauses.Add( ERC20Contract.BuildTranferToClause(ERC20Token.VTHO, Address.FromHexString(transaction[0]), amount)); chainTag = ByteUtils.ToByteArray(transaction[2])[0]; blockRef = transaction[3] == null?BlockchainClient.GetBlockRef(null).ToByteArray() : ByteUtils.ToByteArray(transaction[3]); } int gas = clauses.Count * gasLimit ?? 80000; var rawTransaction = RawTransactionFactory.Instance.CreateRawTransaction(chainTag, blockRef, 720, gas, (byte)0x0, CryptoUtils.GenerateTxNonce(), clauses.ToArray()); if (isSend) { var result = TransactionClient.SignThenTransfer(rawTransaction, ECKeyPair.Create(privateKey)); return(JsonConvert.SerializeObject(result)); } else { var result = TransactionClient.Sign(rawTransaction, ECKeyPair.Create(privateKey)); return(ByteUtils.ToHexString(result.Encode(), Prefix.ZeroLowerX)); } }
public static void GetChainTag() { byte chainTagByte = BlockchainClient.GetChainTag(); string chainTag = string.Format("%02x", chainTagByte); WriteLine("ChainTag:"); WriteLine("0x" + chainTag); }
public TransferPage(BlockchainClient client, String pid) { this.client = client; InitializeComponent(); propertyId.Text = pid; NavigationPage.SetHasNavigationBar(this, false); }
public void init() { mockBlockService = new Mock <IBlockchainService>(); clientWithMock = new BlockchainClient(mockBlockService.Object); user = new User() { username = "******" }; }
void updateAssetList(BlockchainClient localClient) { properties.Clear(); var props = Task.Run(() => localClient.GetMyProperties()).Result; foreach (Property obj in props) { properties.Add(obj); } }
void UpdateTransactionList(BlockchainClient localClient) { transactions.Clear(); var Results = Task.Run(() => localClient.GetUserTransactions()).Result; foreach (var transaction in Results) { transactions.Add(transaction); } }
void UpdatePackageList(BlockchainClient localClient) { packagesOwn.Clear(); var packages = Task.Run(() => localClient.GetMyPackages()).Result; foreach (var package in packages) { packagesOwn.Add(package); } }
public HistoryDetailPage(CreatePackage package, BlockchainClient client) { this.client = client; this.package = package; InitializeComponent(); NavigationPage.SetHasNavigationBar(this, false); BindingContext = package; recipient.Text = package.recipient.Substring(35); sender.Text = package.sender.Substring(35); propertyListView.ItemsSource = GetProperties(package).Split(new char[] { ',' }); }
public HistoryPage(BlockchainClient client) { this.client = client; transactions = new ObservableCollection <CreatePackage>(); NavigationPage.SetHasNavigationBar(this, false); InitializeComponent(); UpdateTransactionList(client); listView.ItemsSource = transactions; }
public PackagesPage(BlockchainClient client) { this.client = client; packagesOwn = new ObservableCollection <Package>(); InitializeComponent(); NavigationPage.SetHasNavigationBar(this, false); UpdatePackageList(client); listView.ItemsSource = packagesOwn; }
public async Task <ActionResult <string> > Post(IFormFile file) { var impl = new FingerPrintImpl(); var chain = new BlockchainClient(); var content = file.OpenReadStream(); var signature = impl.DoFingerPrint(content); await chain.CreateToken(signature); return(signature); }
public UserPage(BlockchainClient client) { this.client = client; properties = new ObservableCollection <Property>(); InitializeComponent(); NavigationPage.SetHasNavigationBar(this, false); updateAssetList(client); current_asset_list.ItemsSource = properties; }
public WelcomePage(BlockchainClient client) { if (client == null) { throw new ArgumentException(); } BindingContext = client.thisTrader; this.client = client; properties = new ObservableCollection <Property>(); InitializeComponent(); updateAssetList(client); }
public CreatePackagePage(BlockchainClient client, List <Property> props) { this.client = client; SelectedDataList = new ObservableCollection <SelectedData <Property> >(); props.ForEach(prop => SelectedDataList.Add(new SelectedData <Property>() { data = prop, selected = false })); InitializeComponent(); NavigationPage.SetHasNavigationBar(this, false); property_list.ItemsSource = SelectedDataList; }
public TabbedPage1(BlockchainClient client) { InitializeComponent(); this.Title = String.Format("Hello, {0}!", client.thisTrader.fullName); NavigationPage.SetHasNavigationBar(this, false); var userPage = new NavigationPage(new UserPage(client)); var packagesPage = new NavigationPage(new PackagesPage(client)); var historyPage = new NavigationPage(new HistoryPage(client)); userPage.Title = "My Properties"; packagesPage.Title = "My Packages"; historyPage.Title = "My History"; InitializeComponent(); Children.Add(userPage); Children.Add(packagesPage); Children.Add(historyPage); }
public HomeController(IOptions <BlockchainClient> blockchainClient_) { _blockchainClient = blockchainClient_.Value; }
public RegisterPropertyPage(BlockchainClient blockchainclient) { InitializeComponent(); NavigationPage.SetHasNavigationBar(this, false); client = blockchainclient; }
public SendEmailPage(BlockchainClient client, String pid) { this.client = client; packageId = pid; InitializeComponent(); }
public RegisterPage(BlockchainClient client) { this.client = client; InitializeComponent(); NavigationPage.SetHasNavigationBar(this, false); }
public BlockchainController(IWalletService walletService) { _blockchainClient = new BlockchainClient(); _walletService = walletService; }
public TransferController(IBlockchainService service) { client = new BlockchainClient(service); }
public MainPage(IBlockchainService bcservice) { client = new BlockchainClient(bcservice); InitializeComponent(); NavigationPage.SetHasNavigationBar(this, false); }