Send Transaction
let evmBaseTransaction = EVMBaseTransaction(
to: "0x...", // contract address that user want to interact with.
from: "0x...", // user address.
value: "0x64", // 100 wei hex string with 0x prefix, default is 0.
data: functionData) // functionData stands for data in ethereum transaction, default is Empty data.
BloctoSDK.shared.evm.sendTransaction(
blockchain: .ethereum,
transaction: evmBaseTransaction
) { [weak self] result in
guard let self = self else { return }
switch result {
case let .success(txHsh):
// handle txHash here.
case let .failure(error):
// handle error here.
}
}Last updated
Was this helpful?