Closed OsmanRodrigues closed 1 month ago
Will keep here noted as a possible implementation for next versions. Usually web3 devs prefer to use its own Lib for this kind of tasks like Ethers/Viem, but yeah I think would be helpful to have a faster way to grab the responses. I was also thinking on maybe add an optional callback to the sendInput/deposits/executeVoucher so that function would be called with the transactionReceipt. What do you think?
Will keep here noted as a possible implementation for next versions. Usually web3 devs prefer to use its own Lib for this kind of tasks like Ethers/Viem, but yeah I think would be helpful to have a faster way to grab the responses. I was also thinking on maybe add an optional callback to the sendInput/deposits/executeVoucher so that function would be called with the transactionReceipt. What do you think?
Great, man!
Thanks for answer :pray:
I was thinking about a stuff like what you mentioned, returning a transaction receipt with all 32bytes data converted to utf8, but something independently of transactions sender methods in order to keep the separation of concerns, according to (S)OLID - SRP. Some getTransactionReceiptById
method or anything like that. :thinking:
It makes sense? :thinking:
Sure. We can work with it. I just disagree with the convertion to utf8 because there is no readable data on hash.
getTransactionReceiptByHash
could work for a matter of simplification. So we could use with any features that Tikua supports, like sendInput
, approvals
, deposits
, executeVoucher
, etc...
public getTransactionReceiptByHash = async (hash: string) => {
return await publicClient.waitForTransactionReceipt(
{ hash }
)
}
Sure. We can work with it. I just disagree with the convertion to utf8 because there is no readable data on hash.
getTransactionReceiptByHash
could work for a matter of simplification. So we could use with any features that Tikua supports, likesendInput
,approvals
,deposits
,executeVoucher
, etc...public getTransactionReceiptByHash = async (hash: string) => { return await publicClient.waitForTransactionReceipt( { hash } ) }
It seems cool, dude! :star_struck:
About the conversion, I expressed myself badly, what I meant is that have some readable data as possible, for example, if I not mistaken, the transaction status property that can be 0x0
or 0x1
, for reject/fail
or success
status respectively, right? :thinking:
Well, despite the conversion being considerable or not, I will eagerly await this feature! Just rocks it! :man_singer: :rocket:
Got it. As far as I know when you use waitForTransactionReceipt Viem already decode recognized data automatically (like transaction status). Anyway, unfortunatelly SendInput function from Cartesi InputBox never reject the transaction. Because it is only processed on Cartesi Machine after transaction confirmed inside blockchain. So there is no much thing to grab from there. But I can also think on a function to try decode all events inside logs after execute a voucher or something like this.
Will take a look into it for you and return here as soon as possible.
Hi everybody!
What do you think about develop a way to check a specific transaction status by the transaction hash (txHash, returned by sendInput)?