BmoniSignerError — a subclass of Error carrying:
errorCode— a numericBmoniSignerErrorCodevalue for programmatic branchingmessage— a human-readable descriptionerrorCodeHex— the code formatted the way the native SDKs log it, e.g.0x30010010
Use
error instanceof BmoniSignerError as your discriminator. Failures that are not BMONISigner errors — an unavailable native module, a keychain problem — reject with their original React Native error so you can tell them apart.Error codes
Signing errors (0x3001xxxx)
Originate inside the native BMONISigner SDK.
Storage failures (key creation, encrypt, decrypt) are also passed through
unmapped, and the native SDK uses a different range on each platform:
0x3000xxxx on iOS (Secure Enclave) and 0x3002xxxx on Android
(Keystore). Read errorCodeHex rather than matching a single prefix or
expecting a named constant for them.PIN errors (0x4xxxxxxx)
Generated by the TypeScript-layer PIN gate.
Bridge errors (0x5xxxxxxx)
Generated by the TypeScript ↔ native bridge.
Handling the most common cases
Platform errors
If the native module is missing — the app was not rebuilt after installing the package, or the New Architecture is disabled — the module lookup throws as soon as the SDK is imported:yarn ios / yarn android) rather than reloading the bundle. A Metro reload alone never picks up new native code.
