Examples of Wallet


Examples of com.xeiam.xchange.dto.trade.Wallet

public class CoinbaseAdapterTest {

  @Test
  public void testAdaptAccountInfo() throws IOException {

    Wallet wallet = new Wallet("BTC", new BigDecimal("7.10770000"));
    List<Wallet> wallets = new ArrayList<Wallet>();
    wallets.add(wallet);
    AccountInfo expectedAccountInfo = new AccountInfo("demo@demo.com", wallets);

    // Read in the JSON from the example resources
View Full Code Here

Examples of com.xeiam.xchange.dto.trade.Wallet

    List<Wallet> wallets = new ArrayList<Wallet>();
    Map<String, BigDecimal> funds = btceAccountInfo.getFunds();

    for (String lcCurrency : funds.keySet()) {
      String currency = lcCurrency.toUpperCase();
      wallets.add(new Wallet(currency, funds.get(lcCurrency)));
    }
    return new AccountInfo(null, wallets);
  }
View Full Code Here

Examples of com.xeiam.xchange.dto.trade.Wallet

    Map<String, BigDecimal> funds = btceAccountInfo.getFunds();

    for (String lcCurrency : funds.keySet()) {
      String currency = lcCurrency.toUpperCase();

      wallets.add(new Wallet(currency, funds.get(lcCurrency)));
    }
    return new AccountInfo(null, wallets);
  }
View Full Code Here

Examples of de.willuhn.jameica.security.Wallet

  /**
   * @see de.willuhn.jameica.gui.dialogs.AbstractDialog#paint(org.eclipse.swt.widgets.Composite)
   */
  protected void paint(Composite parent) throws Exception
  {
    Wallet wallet = Settings.getWallet();
    List<Entry> entries = new ArrayList<Entry>();
    Enumeration e = wallet.getKeys();
    while (e.hasMoreElements())
    {
      String key = (String) e.nextElement();
      entries.add(new Entry(key,wallet.get(key)));
    }
   
    TablePart table = new TablePart(entries,null);
    table.addColumn(i18n.tr("Name"),"name");
    table.addColumn(i18n.tr("Wert"),"value");
View Full Code Here

Examples of de.willuhn.jameica.security.Wallet

        // im PassportHandle verarbeitet
        case NEED_PASSPHRASE_LOAD:
        case NEED_PASSPHRASE_SAVE:
         
          // Passwort aus dem Wallet laden
          Wallet w = Settings.getWallet();
          String pw = (String) w.get("hbci.passport.password." + passport.getClass().getName());
          if (pw != null && pw.length() > 0)
          {
            Logger.debug("using passport key from wallet, passport: " + passport.getClass().getName());
            retData.replace(0,retData.length(),pw);
            break;
          }
           
          // noch kein Passwort definiert. Dann erzeugen wir ein zufaelliges.
          Logger.debug("creating new random passport key, passport: " + passport.getClass().getName());
          byte[] pass = new byte[8];
          SecureRandom random = SecureRandom.getInstance("SHA1PRNG");
          random.nextBytes(pass);
          pw = Base64.encode(pass);

          // Und speichern es im Wallet.
          w.set("hbci.passport.password." + passport.getClass().getName(),pw);
          retData.replace(0,retData.length(),pw);
          break;

        case NEED_CONNECTION:
          if (!Settings.getOnlineMode())
View Full Code Here

Examples of de.willuhn.jameica.security.Wallet

   * @throws Exception
   */
  public static Wallet getWallet() throws Exception
  {
    if (wallet == null)
      wallet = new Wallet(HBCI.class);
   
    return wallet;
  }
View Full Code Here

Examples of org.ethereum.core.Wallet

        final Border line = BorderFactory.createLineBorder(Color.LIGHT_GRAY);
        JComponent editor = (JComponent)(creatorAddressCombo.getEditor().getEditorComponent());
        editor.setForeground(Color.RED);

        Wallet wallet = UIEthereumManager.ethereum.getWallet();
        Collection<Account> accounts = wallet.getAccountCollection();

        for (Account account : accounts) {
            creatorAddressCombo.addItem(new AccountWrapper(account));
        }
View Full Code Here

Examples of org.ethereum.core.Wallet

        setResizable(false);

        Container contentPane = this.getContentPane();
        contentPane.setBackground(new Color(255, 255, 255));

        Wallet wallet = UIEthereumManager.ethereum.getWallet();
        wallet.addListener(this);
        loadWallet();

    }
View Full Code Here

Examples of org.ethereum.core.Wallet

        Container contentPane = this.getContentPane();
        contentPane.removeAll();
        contentPane.setLayout(new FlowLayout());

        Wallet wallet = UIEthereumManager.ethereum.getWallet();

        for (Account account : wallet.getAccountCollection()) {
      WalletAddressPanel rowPanel = new WalletAddressPanel(account);
            contentPane.add(rowPanel);
        }

        WalletSumPanel sumPanel = new WalletSumPanel(wallet.totalBalance());
        contentPane.add(sumPanel);

        // TODO: move this to some add button method
        URL addAddressIconURL = ClassLoader.getSystemResource("buttons/add-address.png");
        ImageIcon addAddressIcon = new ImageIcon(addAddressIconURL);
        JLabel addAddressLabel = new JLabel(addAddressIcon);
        addAddressLabel.setToolTipText("Add new address");
        addAddressLabel.setCursor(new Cursor(Cursor.HAND_CURSOR));
        addAddressLabel.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent e) {

                Wallet wallet = UIEthereumManager.ethereum.getWallet();
        if (wallet.getAccountCollection().size() >= 5) {
                    JOptionPane.showMessageDialog(walletWindow,
                            "Hey do you really need more than 5 address for a demo wallet");
                    return;
                }

                wallet.addNewAccount();
                Dimension dimension = walletWindow.getSize();
                int height = dimension.height;
                int width = dimension.width;

                Dimension newDimension = new Dimension(width, (height + 45));
View Full Code Here

Examples of org.ethereum.core.Wallet

        ECKey cowKey = ECKey.fromPrivate(HashUtil.sha3("cow".getBytes()));
        repository.createAccount(cowKey.getAddress());
        repository.addBalance(cowKey.getAddress(), BigInteger.TEN);

        Wallet wallet = new Wallet();
        wallet.setWorldManager(worldManager);

        wallet.importKey(cowKey.getPrivKeyBytes());

        BigInteger walletBalance = wallet.getBalance(cowKey.getAddress());
        Assert.assertEquals(BigInteger.TEN, walletBalance);

    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.