예제 #1
0
    public void AddToken(string address, string name, string symbol, int decimals)
    {
        if (addableTokens.Contains(address = address.ToLower()))
        {
            return;
        }

        addableTokens.Add(new TokenInfo(address, name, symbol, decimals));
    }
예제 #2
0
    /// <summary>
    /// Adds a new wallet to the list of WalletInfo.
    /// </summary>
    /// <param name="walletName"> The name of the wallet. </param>
    /// <param name="walletAddresses"> The array of addresses associated with the wallet. </param>
    /// <param name="encryptionHashes"> The encrypted hashes used to encrypt the seed of the wallet. </param>
    /// <param name="encryptedSeed"> The encrypted wallet seed. </param>
    /// <param name="passwordHash"> The pbkdf2 password hash of the password used to encrypt the wallet. </param>
    public void AddWalletInfo(string walletName, string[][] walletAddresses, string[] encryptionHashes, string encryptedSeed, string passwordHash)
    {
        var encryptedWalletData = new WalletInfo.EncryptedDataContainer(encryptionHashes, encryptedSeed, passwordHash);
        var walletInfo          = new WalletInfo(encryptedWalletData, walletName, (string[][])walletAddresses.Clone(), wallets.Count + 1);

        wallets.Add(walletInfo);
    }
    /// <summary>
    /// Adds a token given the info of the token.
    /// </summary>
    /// <param name="tokenInfo"> The info of the token to add. </param>
    /// <returns> The newly created ERC20 token from this TokenInfo. </returns>
    public ERC20 AddToken(TokenInfo tokenInfo)
    {
        ERC20 erc20Token = new ERC20(tokenInfo.Address, tokenInfo.Name, tokenInfo.Symbol, tokenInfo.Decimals);

        tokens.Add(tokenInfo);

        return(erc20Token);
    }