-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
send transaction using a custom erc-20 token #9
Comments
The MetaMaskService.cs has a GenericRpc method. With this method you can send any command to the It results in this JavaScript call: MetaMask.Blazor/MetaMask.Blazor/wwwroot/metaMaskJsInterop.js Lines 169 to 172 in 72a0016
So yes it's possible. But you need to figure out the code you need to use to send matic or polygon. If these are on other networks, the user needs to select that network in their MetaMask extension. |
var result = await MetaMaskService.GenericRpc("eth_sendTransaction", parameters); any idea how to mount the parameters? I have tried lots of combination basically the javascript needs to receive ethereum |
Hi,
I don't have a sample with parameters. Currently on holiday, so can't have
a look now. Will try to create a sample later in August.
…On Thu, 21 Jul 2022 at 21:35, Ricardo Alex ***@***.***> wrote:
var result = await MetaMaskService.GenericRpc("eth_sendTransaction",
parameters);
any idea how to mount the parameters? I have tried lots of combination
basically the javascript needs to receive
ethereum
.request({
method: "eth_sendTransaction",
params: [
{
from: SelectedAddress,
to: ContractAddress,
data:
"0xa9059cbb000000000000000000000000e4cc0b4dea52652458d31548643bb90b06af5fa00000000000000000000000000000000000000000000000000b1a2bc2ec50000"
}
]
})
—
Reply to this email directly, view it on GitHub
<#9 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKBDEBTLY3I3C6FVMOHUQDVVGQ7NANCNFSM5KP4CBCA>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
If you already have the encoded data, like in your example, you can do this: var result = await MetaMaskService.SendTransaction(ContractAddress, weiValue, "0xa9059cbb000000000000000000000000e4cc0b4dea52652458d31548643bb90b06af5fa00000000000000000000000000000000000000000000000000b1a2bc2ec50000"); If you want to construct this data string based on a smart contract function call, an example can be found here: |
Thank you.I'll test it |
Hello any idea what is wrong on the last parameter of the function "functionCallEncoder.EncodeRequest" the new object[]... value? when i set it to null it works but not encoding the parameters value the way it is the program just stops and does not encode data
|
Solved
|
Is it possible to use sendransaction but not for eth but sending matic for example on polygon blockchain?
The text was updated successfully, but these errors were encountered: