0

Is there a way to get the status of a gnosis-safe transaction that was just signed and submitted to the blockchain? Basically, is there an API to check whether the submitted transaction is in mempool assuming all I have is the safeTxHash?

2 Answers 2

2

If you have the safeTxHash, you can look it up through the /v1/multisig-transactions/{safe_tx_hash} endpoint of the the TransactionService API (link for the Ethereum Safe API, as an example). The response will return the executed transactionHash.

Edit: Upon more discussion with Safe, it seems the transactionHash is not populated until the event is broadcast, when the transaction is fully executed. Therefore, the only way to get this information would be to engage in a third-party service that watches wallets for all of your signers.

1
  • thanks for quick response. Unless I'm doing something wrong, /v1/multisig-transactions/{safe_tx_hash} doesn't seem to immediately return the transactionHash unless the block/txn is minted. This is on polygon or eth mainnet.
    – hishboy
    Dec 5, 2022 at 21:03
0

Yes. You can use the safe-apps-sdk to retrieve transaction status with getBySafeTxHash.

    import SafeAppsSDK from '@gnosis.pm/safe-apps-sdk';

    ...
    
    const sdk = new SafeAppsSDK({
      allowedDomains: [/app.safe.global/],
      debug: false,
    });

    const signed = await sdk.txs.signMessage("Message to sign");

    const tx = await sdk.txs.getBySafeTxHash(signed?.safeTxHash);

6
  • This doesn't work for transactions that are submitted to blockchain but not yet mined
    – hishboy
    Feb 8, 2023 at 18:58
  • Did you try it? I think it gives you the txHash, which you can then use to look it up. github.com/safe-global/safe-apps-sdk/blob/…
    – einaralex
    Feb 15, 2023 at 13:06
  • Not sure we’re talking about the same thing. The API you shared works if the transaction has been mined. I want to know if the transaction has been submitted + is in the mempool but hasn’t confirmed yet. The API you’re referring to does not look at the mempool when I tried it.
    – hishboy
    Feb 16, 2023 at 14:08
  • I need this to show progress bar on the app side while the transaction is getting confirmed on the Blockchain. How this helps
    – hishboy
    Feb 16, 2023 at 14:09
  • Where do you see that it only works when it has been mined? The moment you sign, you'll get a safeTxHash. The documentation says: "Once you received safe transaction hash, you might want to get the status of the transaction (was it executed? how many confirmations does it have?):"
    – einaralex
    Feb 17, 2023 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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