/ethereum-delegated-tx-widget

Embeddable widget which performs Ethereum delegated transactions with particular setup, as well as it works as a stand-alone page.

Primary LanguageJavaScript

Ethereum Delegated Transactions Widget

Actions Status

Elegant Ethereum delegated transactions implementation.

Primarily, delegated transactions, or meta transactions allow users to pay fee in tokens instead of Ether, making crypto user experience great again. This widget is shipped with the back end, which can be used for any token or smart contract supporting doing-something-via-signature.

  • Highly customizable widget and a stand-alone page
  • Can work with any token which supports function delegation (but you have to set up a back end for it)
  • Helpful hints, which allow to quickly onboard inexperienced users
  • Signature standard-free paradigm (use any signature your contract supports, e.g. eth_personalSign, eth_signTypedData)
  • Automatically picks an icon of your token (from Trust Wallet repository)


→ CHECK THE DEMO HERE! ←

screenshot

Need test tokens? Use this widget via this link and mint some test tokens in Kovan network
by calling mintTokens function (mints 10 tokens to a calling account).
Need some Ether in Kovan? Find any faucet that can give you some.

Embedding

<iframe src="https://zitros.github.io/ethereum-delegated-tx-widget/?contractAddress=0x82f4ded9cec9b5750fbff5c2185aee35afc16587&otherParams=abc"
        frameborder="0">
</iframe>

Widget Customization:

URL Parameter Default Example Description
fixed false true Disable all inputs
contractAddress 0x82f4ded..fc16587 0x1234..cdef Smart contract address (usually token address) which is supported by at least one back end
functionName transfer approveAndCall Smart contract function name which is supported by at least one back end
functionArguments 0x17A8..a29D,1000000 0x1aa4..cdaf,20000000 Comma-separated arguments of the function (in this example, transfer("0x1aa4..cdaf", 20000000)).
customBackEnds my-website.com/api/kovan,my-website.com/api/mainnet Custom delegated transactions back end APIs list (see ethereum-delegated-tx-service). Otherwise, pre-defined back ends are used.
successRedirectUrl my-website.com/handle-redirect URL the user is redirected to once the transaction is mined.

Development

To start development server, run the following:

npm install
npm run start

To build and deploy the project to GitHub (access is restricted), run

npm run deploy