<EtherspotContractTransaction />
Introduction
This component allows you to tell TransactionKit that there will be a blockchain transaction performed, and it will be against a Smart Contract. This component is specifically tailored to Smart Contracts. If you are looking to send a simple transaction, then <EtherspotTransaction />
is what you may be looking for.
You can have 1 or many <EtherspotContractTransaction />
components inside an <EtherspotBatch />
component to be sent at the same time (i.e. as part of the same "batch").
Component Properties
id
Optional: An ID (which can be a string
, number
etc) that allows you to define the ID of this batch group. We will use this ID if you provide it internally, but also allows you to use it to keep track elsewhere within your app.
contractAddress
The destination Smart Contract address on the blockchain. Every Smart Contract has a unique address, including tokens.
abi
The "Application Binary Interface" of the Smart Contract... in other words, a dictionary of all the things we can do with this Smart Contract, and what data it needs.
method
The name of the function we want to call on the Smart Contract
params
The parameter(s), if any, we want to provide to the "method" above.
value
Optional: The amount of native token we want to send along. This can either be a string represented in Ether or as a BigNumber (see example).
How to use
Below is an example of how to use the <EtherspotContractTransaction />
component.
Sending a token
Sending a token is a very common practice within the blockchain ecosystem. When you send a token, you are interacting with the Smart Contract for that token. For example - you might want to send 10 USDC to pay for something, or, you might want to send 200 SHIB to a friend. Here's how to do that.
🎉 Congratulations!
You have learned how to send transactions that interact with Smart Contract and tokens with TransactionKit.
Last updated