Nethereum.Templates.Pack 2.1.0

Prefix Reserved
dotnet new install Nethereum.Templates.Pack::2.1.0                
This package contains a .NET Template Package you can call from the shell/command line.

Nethereum.Templates.Pack

Template pack for Nethereum

Templates included

Template Name                                                  Short Name           Language  Tags
-------------------------------------------------------------  -------------------  --------  -----------------------------------------------------
Nethereum Blazor Metamask Wasm-Server Projects                 nethereum-mm-blazor  [C#]      Nethereum/Blazor/Metamask
Nethereum Blazor SIWE Wasm/Server/RestApi Projects             nethereum-siwe       [C#]      Nethereum/SIWE/Blazor/Metamas/RestApi
Nethereum Default Smart contract Library / XUnit ERC20 sample  smartcontract        [C#]      Nethereum/Smart contracts
Nethereum ERC721, ERC1155 Open Zeppelin and  XUnit Projects    nethereum-erc721-oz  [C#]      Nethereum/Smart contracts/OpenZeppelin/ERC721/ERC1155
Nethereum WebSocket Streaming Examples                         nethereum-ws-stream  [C#]      Nethereum/WebSocketStreaming

Quick Start

  1. Open a command window and install the templates:
> dotnet new -i Nethereum.Templates.Pack
  1. Check the templates were installed ok:
> dotnet new --list

You should see a list of templates, including the templates in the pack:

Nethereum Blazor Metamask Wasm-Server Projects                 nethereum-mm-blazor  [C#]        Nethereum/Blazor/Metamask
Nethereum Blazor SIWE Wasm/Server/RestApi Projects             nethereum-siwe       [C#]        Nethereum/SIWE/Blazor/Metamas/RestApi
Nethereum Default Smart contract Library / XUnit ERC20 sample  smartcontract        [C#]        Nethereum/Smart contracts
Nethereum ERC721, ERC1155 Open Zeppelin and  XUnit Projects    nethereum-erc721-oz  [C#]        Nethereum/Smart contracts/OpenZeppelin/ERC721/ERC1155
Nethereum WebSocket Streaming Examples                         nethereum-ws-stream  [C#]        Nethereum/WebSocketStreaming
  1. To use a template, for example the smartcontract template:
> md mysmartcontractlib
> cd mysmartcontractlib
> dotnet new smartcontract --ContractLibrary mysmartcontractlib
The template "Nethereum Default Smart contract Library / XUnit ERC20 sample" was created successfully.
  1. Now you can open the solution file mycontractlib.sln and see the README.md for more information on that template.

Nethereum Templates Smart Contract Default C# Library

Template to create a smart contract library development solution including:

  • Smart contract example (ERC20)
  • Auto code generation settings for vscode
  • XUnit testing and testchains setup for Geth, Ganache, CustomUrl, etc
  • Examples of integration testing the smart contract ERC20 (Token transfer, balance, deployment, Events and Log Processing)
  • Examples of integration testing Ether transfers More info: https://github.com/Nethereum/Nethereum.Templates.SmartContractDefault

Smart contracts templates for ERC721 - ERC1155 - Governor using Open Zeppelin smart contract library

This template extends the standard contract template to provide the development environment to work with OpenZeppelin smart contracts for ERC721 NFTs - ERC1155 and DAO Governor including examples for integration testing

For more information on EIPs:

More info on the template: https://github.com/Nethereum/Nethereum.Templates.SmartContracts.OZ-Erc721-Erc1155/

Nethereum.Templates.Metamask.Blazor

This projects provides the quick start example/template on how to integrate Metamask + Nethereum using Blazor interop. The project allows you to work both in Wasm and Server side, so you can create a fully decentralised application using Wasm or semi-decentralised using server hosted components (Web3+Web2).

Both project types include and example on how to:

  • Configure Metamask as a UI host provider
  • Connect to Metamask
  • Interact with Ethereum using simple Web3 rpc calls (Blockhash and ChainId)
  • How to create a generic component for ERC20 token transfer including simple validation using FluentValidation
  • How to use the EthereumAuthenticationStateProvider and the claim role "EthereumConnected" with connected account
  • How to override the default styles of the Metmask component

Note If you want to create your own custom Metamask component or add remove functionality check https://github.com/Nethereum/Nethereum/blob/master/src/Nethereum.Metamask.Blazor/Metamask.razor

More info on the template: https://github.com/Nethereum/Nethereum.Templates.Metamask.Blazor

Nethereum SIWE Template

The Nethereum SIWE template provides an starting point of signing and authentication using Ethereum accounts and the standard SIWE message. The templates provides the following use cases, and how SIWE can be implemented using the Nethereum libraries.

  • Rest Api
  • Blazor Wasm + Rest Api
  • Blazor Server side (standalone)

SIWE Message, signing and recovery (Overall process)

A SIWE Message is a standard message that a user signs with their private key, the message is presented in plain text to the user. The message contains different attributes including the Domain, Address, Uri, Expiry etc. The issuer of the message can authenticate the signer (user), by matching the recovered address from the signed message to their user records. To prevent replay attacks a unique nonce (random value) is created for each session.

More information can be found here https://eips.ethereum.org/EIPS/eip-4361

More info on the template: https://github.com/Nethereum/Nethereum.Templates.Siwe

  • .NETStandard 2.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.1.0 1,284 3/27/2023
1.1.0 1,513 7/7/2022
1.0.0 1,049 6/29/2022