michielpost / MetaMask.Blazor

Use MetaMask with Blazor WebAssembly
MIT License
44 stars 21 forks source link

Add support for Nethereum FunctionMessage-derived methods #12

Closed robertmclaws closed 1 year ago

robertmclaws commented 2 years ago

Given the following code:

[Function("deposit")]
public class DepositFunction : FunctionMessage
{
}

var deposit = new DepositFunction()
{
    FromAddress = someAddress,
    AmountToSend = Web3.Convert.ToWei(tokensRequested * AppState.CurrentSale.MintPrice)
};

I need to be able to call something like MetaMaskService.SendTransaction(contractAddress, deposit);, and have it properly construct the entire transaction (including the properties in ContractMessageBase).

I need it to be functionally equivalent to this, without the convoluted architecture or setup hassle.

Thanks!

michielpost commented 2 years ago

This library does not have easy helpers yet for ERC20 transfers. It would be very useful to have these helpers. I'm not actively developing them right now, a PR is always welcome.

robertmclaws commented 1 year ago

Hello! This was closed as completed, is there some code I can see for the implementation?

michielpost commented 1 year ago

Hello! This was closed as completed, is there some code I can see for the implementation?

Yes, I'd love to see some code for this. But there was no PR submitted yet? Are you still planning on submitting the PR? Then I will reopen.