Download Latest Version 5.0.0 source code.tar.gz (132.2 MB)
Email in envelope

Get an email when there's a new version of Nethereum

Home / 4.28.0
Name Modified Size InfoDownloads / Week
Parent folder
4.28.0 source code.tar.gz 2025-01-07 131.7 MB
4.28.0 source code.zip 2025-01-07 133.3 MB
README.md 2025-01-07 9.2 kB
Totals: 3 Items   265.1 MB 0

Code generator (.net, typescript, vscode solidity)

  • Services now inherit from a base class with the core implementation, all methods are virtual, allowing to be overriden on the main class to add custom logic like validation.
  • Mud Table Service is extended to include Set and Get methods using parameters, so now Keys Values are needed.
  • Mud Table, includes accessors for both Keys and Value properties at top level, this way it can be easily accessed the data, but also in future use these properties as entities to get the data from a different storage or Api. Commits: https://github.com/Nethereum/Nethereum/commit/1beb31c45debcfefe007ff183ab395ac9fcbd4fe
Example of code generated file for both Mud table service and table :::csharp public partial class ItemTableService : TableService<ItemTableRecord, ItemTableRecord.ItemKey, ItemTableRecord.ItemValue> { public ItemTableService(IWeb3 web3, string contractAddress) : base(web3, contractAddress) {} public virtual Task<ItemTableRecord> GetTableRecordAsync(uint id, BlockParameter blockParameter = null) { var _key = new ItemTableRecord.ItemKey(); _key.Id = id; return GetTableRecordAsync(_key, blockParameter); } public virtual Task<string> SetRecordRequestAsync(uint id, uint price, string name, string description, string owner) { var _key = new ItemTableRecord.ItemKey(); _key.Id = id; var _values = new ItemTableRecord.ItemValue(); _values.Price = price; _values.Name = name; _values.Description = description; _values.Owner = owner; return SetRecordRequestAsync(_key, _values); } public virtual Task<TransactionReceipt> SetRecordRequestAndWaitForReceiptAsync(uint id, uint price, string name, string description, string owner) { var _key = new ItemTableRecord.ItemKey(); _key.Id = id; var _values = new ItemTableRecord.ItemValue(); _values.Price = price; _values.Name = name; _values.Description = description; _values.Owner = owner; return SetRecordRequestAndWaitForReceiptAsync(_key, _values); } } public partial class ItemTableRecord : TableRecord<ItemTableRecord.ItemKey, ItemTableRecord.ItemValue> { public ItemTableRecord() : base("MyWorld", "Item") { } /// /// Direct access to the key property 'Id'. /// public virtual uint Id => Keys.Id; /// /// Direct access to the value property 'Price'. /// public virtual uint Price => Values.Price; /// /// Direct access to the value property 'Name'. /// public virtual string Name => Values.Name; /// /// Direct access to the value property 'Description'. /// public virtual string Description => Values.Description; /// /// Direct access to the value property 'Owner'. /// public virtual string Owner => Values.Owner; public partial class ItemKey { [Parameter("uint32", "id", 1)] public virtual uint Id { get; set; } } public partial class ItemValue { [Parameter("uint32", "price", 1)] public virtual uint Price { get; set; } [Parameter("string", "name", 2)] public virtual string Name { get; set; } [Parameter("string", "description", 3)] public virtual string Description { get; set; } [Parameter("string", "owner", 4)] public virtual string Owner { get; set; } } }

Code generator .NET

Now supports GeneratorSets or ".nethereum-gen.multisettings" as a library and console, the same as the typescript and vscode-solidity version.

Commit: https://github.com/Nethereum/Nethereum/commit/a2113874599cb5d8c097e0f085b137d24d315c85

Console usage Nethereum.Generator.Console generate from-config defaults to ".nethereum-gen.multisettings" and current folder. See --help for more info.

Example of ".nethereum-gen.multisettings" :::json [ { "paths": ["out/ERC20.sol/Standard_Token.json"], "generatorConfigs": [ { "baseNamespace": "MyProject.Contracts", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts", "codeGenLang": 0, "generatorType": "ContractDefinition" }, { "baseNamespace": "MyProject.Contracts", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts", "codeGenLang": 0, "generatorType": "UnityRequest" } ] }, { "paths": ["out/IncrementSystem.sol/IncrementSystem.json"], "generatorConfigs": [ { "baseNamespace": "MyProject.Contracts.MyWorld1.Systems", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts/MyWorld1/Systems", "codeGenLang": 0, "generatorType": "ContractDefinition", "mudNamespace": "myworld1" }, { "baseNamespace": "MyProject.Contracts.MyWorld1.Systems", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts/MyWorld1/Systems", "codeGenLang": 0, "generatorType": "MudExtendedService", "mudNamespace": "myworld1" } ] }, { "paths": ["mudMultipleNamespace/mud.config.ts"], "generatorConfigs": [ { "baseNamespace": "MyProject.Contracts.MyWorld1.Tables", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts/MyWorld1/Tables", "generatorType": "MudTables", "mudNamespace": "myworld1" } ] }, { "paths": ["mudMultipleNamespace/mud.config.ts"], "generatorConfigs": [ { "baseNamespace": "MyProject.Contracts.MyWorld2.Tables", "basePath": "codeGenNodeTest/GeneratorSets/Example2/MyProject.Contracts/MyWorld2/Tables", "generatorType": "MudTables", "mudNamespace": "myworld2" } ] } ]

(Gnosis) Safe

  • Safe smart contract upgrade, signing and new contract handler extension. The new contract handler extension allows you to convert any smart contract service into a safe request signer using your private key (or keys).

Commits:: https://github.com/Nethereum/Nethereum/commit/255b5743ab58abc802c737a5a2e7604c23e92ede, https://github.com/Nethereum/Nethereum/commit/66da01728d7d188af0a805efbf067ff2275dbda2, https://github.com/Nethereum/Nethereum/commit/dddba5f28ee6064abc3b13f518af80624b003358,

:::csharp
            var privateKeySigner = "";
            var privatekeySender = "";
            var web3 = new Web3(new Nethereum.Web3.Accounts.Account(privateKey), "https://rpc.aboutcircles.com/");
            var hubService = new HubService(web3, v2HubAddress);
            hubService.ChangeContractHandlerToSafeExecTransaction(humanAddress1, privateKeySigner);

Other fixes

Unity Release

The unity release can be found here, follow the instructions for installation. https://github.com/Nethereum/Nethereum.Unity/

Full Changelog: https://github.com/Nethereum/Nethereum/compare/4.27.1...4.28.0

Source: README.md, updated 2025-01-07