예제 #1
0
        public TxOutListBoxItem[] GetOutputs()
        {
            AssetDescriptor asset = (AssetDescriptor)comboBox1.SelectedItem;

            return(textBox1.Lines.Where(p => !string.IsNullOrWhiteSpace(p)).Select(p =>
            {
                string[] line = p.Split(new[] { ' ', '\t', ',' }, StringSplitOptions.RemoveEmptyEntries);
                return new TxOutListBoxItem
                {
                    AssetName = asset.AssetName,
                    AssetId = asset.AssetId,
                    Value = BigDecimal.Parse(line[1], asset.Decimals),
                    ScriptHash = Wallet.ToScriptHash(line[0])
                };
            }).Where(p => p.Value.Value != 0).ToArray());
        }
예제 #2
0
        public static AssetDescriptor CustomAssetDescriptor(UInt256 asset_id)
        {
            AssetDescriptor desc = new AssetDescriptor(asset_id);

            if (desc != null)
            {
                if (desc.AssetName == "NEO")
                {
                    desc.AssetName = "CRONIUM";
                }
                if (desc.AssetName == "NeoGas")
                {
                    desc.AssetName = "CRON";
                }
            }
            return(desc);
        }
예제 #3
0
 public BulkPayDialog(AssetDescriptor asset = null)
 {
     InitializeComponent();
     if (asset == null)
     {
         foreach (UInt256 asset_id in Program.CurrentWallet.FindUnspentCoins().Select(p => p.Output.AssetId).Distinct())
         {
             AssetState state = Blockchain.Default.GetAssetState(asset_id);
             comboBox1.Items.Add(new AssetDescriptor(state));
         }
         foreach (string s in Settings.Default.NEP5Watched)
         {
             UInt160 asset_id = UInt160.Parse(s);
             comboBox1.Items.Add(new AssetDescriptor(asset_id));
         }
     }
     else
     {
         comboBox1.Items.Add(asset);
         comboBox1.SelectedIndex = 0;
         comboBox1.Enabled       = false;
     }
 }