github Nethereum/Nethereum 2.1.0
2.10

latest releases: 4.8.0, 4.7.0, 4.6.1...
6 years ago

2.1.0

The new 2.1.0 release includes:

  • CQS (Command Query Separation) for Contract deployment, Contract transactions and Contract querying calls.
    The separation removes the dependency of the knowledge of the whole contract, all commands and queries use a DTO / Message object that defines the ABI using its attributes

Example usage for Deployment:

//The deployment message class
 public class StandardTokenDeployment:ContractDeploymentMessage
 {
      public static string BYTECODE = "0x6060604052604....etc";

      public StandardTokenDeployment():base(BYTECODE) {}

      [Parameter("uint256","totalSupply")]
      public int TotalSupply { get; set; }
 }

 // the deployment  transaction
var deploymentMessage = new StandardTokenDeployment
{
        TotalSupply = 10000,
        FromAddress = senderAddress,
        Gas = new Hex.HexTypes.HexBigInteger(900000)
};

var deploymentHandler = web3.Eth.GetContractDeploymentHandler<StandardTokenDeployment>();
var transactionReceipt = await deploymentHandler.SendRequestAndWaitForReceiptAsync(deploymentMessage);

Full example in the unit test:

https://github.com/Nethereum/Nethereum/blob/master/src/Nethereum.Web3.Tests/Contract.CQS/ContractHandlers.cs

  • Nethereum.HdWallet

A separate library which uses BIP32 and BIP39 to generate an HD tree of Ethereum compatible addresses from a randomly generated word seeds.

This is compatible with keys generated using the standard (m/44'/60'/0'/0/x) used in BIP44, MetaMask, Jaxx, MyEtherWallet (default), TREZOR App, Exodus
or (m/44'/60'/0'/x) used in Electrum, MyEtherWallet (ledger), Ledger Chrome App, imToken

Example Usage:

 string words = "ripple scissors kick mammal hire column oak again sun offer wealth tomorrow wagon turn fatal";
 string password = "TREZOR";
 var wallet = new Wallet(words, password);
 var account = wallet.GetAccount(0);

A workbook sample is located here: https://github.com/Nethereum/Nethereum.Workbooks/blob/master/nethereum-hdwallet-infura-transfer.workbook

Note: This library is not supported in Portable.

  • General fixes

Note: All the changes do not affect the Unity3d libraries, use the 2.0.0 release files.

Don't miss a new Nethereum release

NewReleases is sending notifications on new releases.