Name | Modified | Size | Downloads / 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
- Mud Call From and Batching removing the namespace prefixes from the generated function messages, and other general improvements Commits: https://github.com/Nethereum/Nethereum/commit/7019a21651c04b94c3b7ed0e577f687054483b25, https://github.com/Nethereum/Nethereum/commit/0b73515ef1e5c961d502402887e90c967dcdc4f9, https://github.com/Nethereum/Nethereum/commit/3fcd9ae95deb03b2f596efa2c3ad9353e3c41d45, https://github.com/Nethereum/Nethereum/commit/69d4fa10af46695a07fb8cfb3fe1fd31fba3cd68, https://github.com/Nethereum/Nethereum/commit/69345dc9261c9d6afd0238042bc48801ff1be448
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