Skip to main content
Use SDK helpers instead of parsing raw error messages.
import {
  isActionBlockedError,
  shlpApiErrorCode,
} from "@arc/shlp-sdk/errors";

try {
  await shlp.quoteDepositAction(input);
} catch (error) {
  const code = shlpApiErrorCode(error);

  if (isActionBlockedError(error)) {
    showProductState(code);
    return;
  }

  showRetryableError();
}

Product-state examples

CodePartner behavior
DEPOSITS_PAUSEDDisable deposit
DEPOSITS_NOT_READYDisable deposit and explain operations are not ready
OPERATIONS_NOT_READYDisable keeper-dependent action
MIN_DEPOSIT_NOT_METAsk for a larger amount
CAP_EXCEEDEDShow cap reached
BUFFER_SHORTOffer queued redeem
INSUFFICIENT_SHARESAsk user to reduce amount
REDEEM_NOT_CLAIMABLEKeep request pending
REDEEM_NOT_CANCELABLEHide cancel action

Infrastructure examples

Treat VAULT_READ_FAILED, INDEXER_UNAVAILABLE, and upstream fetch errors as retryable or temporarily unavailable states. Keep existing user balances visible only when the API has returned fresh enough data.