Reference
Errors
Errors are classes with a code, so you can branch on the code instead of matching message strings. Messages name the environment variable, never its value.
Handling errors
TypeScript
import { HiveSdkError } from "hivexph-sdk";
try {
await hive.issuer.token.transfer({ from: hive.accounts.treasury, symbol: "MYTOKEN", account: "bob", quantity: "1" });
} catch (error) {
if (error instanceof HiveSdkError) {
console.error(error.code, error.message);
}
}Security
A missing key reports the variable name only — private keys never appear in messages, stack traces or logs.
Error codes
| Parameter | Type | Required | Description |
|---|---|---|---|
| VALIDATION_ERROR | HiveSdkError | No | Invalid symbol, quantity, action name or instance count. |
| CONFIG_NOT_FOUND | HiveConfigurationError | No | Unknown configuration name. |
| ACCOUNT_ALIAS_NOT_FOUND | HiveAccountNotFoundError | No | The account alias is not declared in the configuration. |
| ACCOUNT_RESOLUTION_ERROR | HiveAccountResolutionError | No | The alias exists but its account name could not be resolved. |
| ENV_VAR_MISSING | HiveEnvironmentVariableMissingError | No | An accountEnv or keyEnv variable is not set. |
| SIGNING_KEY_MISSING | HiveSigningKeyMissingError | No | No signing key is available for the account. |
| SIGNING_ERROR | HiveSigningError | No | The transaction could not be signed with the resolved key. |
| RPC_ERROR | HiveSdkError | No | Every node failed or returned an error response. |
| BROADCAST_ERROR | HiveSdkError | No | The node rejected the signed transaction. |
| KEYCHAIN_UNAVAILABLE | HiveSdkError | No | The extension is not installed or not injected yet. |
| KEYCHAIN_REJECTED | HiveSdkError | No | The user dismissed or rejected the popup. |
Protocol-invalid Custom JSON payloads are not errors: the reader collects them in invalid and the stream reports them through onInvalidPayload.
