7. Troubleshooting

Common integration failures and fixes for the Ledger Multisig API tutorials.

chevron-rightTypeError: SafeApiKit is not a constructorhashtag

Cause

ESM/CJS interop differences in @safe-global/api-kit and @safe-global/protocol-kit.

Fix

Use interop-safe constructor resolution:

import SafeApiKitModule from "@safe-global/api-kit";

const SafeApiKit =
  typeof SafeApiKitModule === "function"
    ? SafeApiKitModule
    : (SafeApiKitModule as unknown as { default: typeof SafeApiKitModule }).default;

Apply the same pattern for SafeModule from @safe-global/protocol-kit.

chevron-rightisExecuted is false right after executionhashtag

Cause

Transaction Service indexing lag. Execution is on-chain, but API indexing is delayed.

Fix

  • Wait 10-60 seconds, then query again.

  • Verify by safeTxHash directly (getTransaction(safeTxHash)), not by "latest tx".

chevron-rightexecuteTransaction returns hash but tx failedhashtag

Cause

executeTransaction can return a submitted hash even when the EVM call reverts.

Fix

Always wait for receipt and check status:

const receipt = await publicClient.waitForTransactionReceipt({
  hash: executionResult.hash as `0x${string}`,
  timeout: 120_000,
});

if (receipt.status === "reverted") {
  throw new Error("Transaction reverted on-chain");
}
chevron-rightWrong confirmationsRequired after threshold/owner changehashtag

Cause

Safe state changed on-chain, but Transaction Service still serves stale indexed state.

Fix

Poll getSafeInfo until threshold matches expected value before proposing the next tx in the flow.

chevron-rightgetSafeBalances method missinghashtag

Cause

@safe-global/api-kit v2.5.7 does not wrap balances.

Fix

Use direct HTTP request:

GET /v2/safes/{address}/balances/

under the configured base URL:

https://app.multisig.ledger.com/api/safe-transaction-service/{chainId}
chevron-rightPrivate key formatting issues (0x0x...)hashtag

Cause

Mixing prefixed and non-prefixed private key formats.

Fix

Normalize once:

chevron-rightRPC instability on Sepoliahashtag

Cause

Public Sepolia RPC endpoints can be slow or timeout.

Fix

  • Retry with backoff.

  • Use a dedicated provider (Alchemy/Infura/QuickNode) for stable integration tests.

chevron-rightURL confusion: public Safe service vs Ledger-hosted servicehashtag

Cause

Using public Safe Transaction Service endpoints by mistake.

Fix

Use Ledger-hosted base URL:

Transactions proposed through this backend appear in Ledger Multisig UI.

See also

Last updated