0

How can I tell if a WalletOperation failed in Taquito?

After I dispatch a WalletOperation, I can await the results using the confirmation method like so:

const confirmation = await op.confirmation()

However, I'm not sure how to tell if the operation was successfully included in the blockchain. The value confirmation.completed and the function confirmation.isInCurrentBlock have true values even when the operation fails. Is this a bug or am I using the API incorrectly?

Thanks!

Clarification: I'm looking for something like tzkt.io's /v1/operations/{hash}, which returns an object with a status field that has values like "applied" or "failed". But I'd rather not rely on an external service.

1

After calling the confirmation method, the status method can be called on the WalletOperation object.

For example:

const operation = await Tezos.wallet.originate({...}).send();
await operation.confirmation();
const status = await operation.status();

The status can have the following value: 'applied' | 'failed' | 'skipped' | 'backtracked'

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.