Send transactions
Sending Web3 transactions has never been easier
Last updated
Sending Web3 transactions has never been easier
Last updated
Considering that the authentication part is done, you can start to send transactions. You'll just need to create the transaction and send it to the SDK.
Depending on the UX you want to provide, there are different ways of sending transactions.
You can build a transaction object containing the targeted contract address, the value of the transaction, and the associated data in the transaction. This payload can be passed to the sendTransaction method of the SDK. A promise is returned by the method to wait for the validation of the transaction.
If this is the first transaction of the wallet, this sendTransaction will automatically be converted to a multi-call doing 2 transactions in one: deploy the Safe smart wallet and send the transaction
The user will have to sign before the transaction is sent.
To enable that feature, please contact us by planning a meeting
With Cometh Connect, you can pay the transaction gas fees of your users. You will need to add the contract address of your transaction as a sponsored address for your project. Remember, the contract address corresponds to the "to" field of your transaction.
Here is the API route to create the sponsored address:
After doing so, you'll be able to send gasless transactions.
With Cometh Connect, you can execute multiple actions in the same transaction. To do so you can call the sendBatchTransactions method.
In the same way, you'll then be asked to validate the transaction.
Another approach would be to use the provider offered by the SDK. You will need to instantiate the ComethProvider ( an Ethereum provider following EIP-1193 ), using the ComethWallet. You can then use your contract interface to directly call the contract methods. Checkout our Getting started for more details.
Create a new sponsored address for the project. The project is deduced from the API key.
An EVM address
"0x1396698619C2ba28420F78d120f5b683EC378c6b"
^0x[a-fA-F0-9]{40}$
Status of request
Indicates whether the request was successful or not.
true