1

I am trying to send automatic payments in C# by linking a button to web3 code for a transfer.

Essentially I need to create a function/button that sends Ether or Tokens out of my wallet when it is clicked.

So for example I could just hit the button and the transaction sends to the address I hardcoded in at the amount of gwei I chose. I would like to do this in C#.

For for example in C#, it might look something like

public void sendMoney(){
transfer.initiate(AMOUNT_OF_ETH, MY_PRIVATE_KEY, DestinationWallet.eth, 1 gwei, GAS_LIMIT_HERE);
}

Now I'd have a function that I could call anytime to send the ETH or tokens to my destination wallet.

I understand the wallet could be totally drained if the button is spammed, and that's no problem.

Is there a way to set up these auto buttons so payments could be send without using metamask?

Thanks for any input

Intheether
  • 11
  • 3
  • You can HTTP RPC a geth node to do it. Works with any language, even with just curl. See https://github.com/ethereum/wiki/wiki/JSON-RPC. You might want to look into sendRawTransaction – libertylocked Nov 13 '17 at 03:29

1 Answers1

0

In order to interact with the blockchain, you need to chose a language/platform that implements web3 functionalities.

For example, you could set up a NODE.JS server that would handle requests from your C# calls.

Your node server should have the web3js module and a geth node running and synced with your blockchain.

How to set up web3js

Be aware: If you are on public network, you will need ether to send transactions. I would recommend that you launch first on testnet (rinkeby or ropsten) to... well, test it, and when everything works, go to main net.

Also, as pointed out here, you have other possibilities to interact with an Ethereum blockchain. Chose the one that suits you!

Edit: With some google research (first result, you could have find it by yourself), you could use this library: Nethereum

Itération 122442
  • 2,052
  • 1
  • 12
  • 33