@digitalshieldfe/airgap-core
v0.1.3
Published
Shared UR helpers and registry types for Digital Shield air-gap
Readme
@digitalshieldfe/airgap-core
Shared UR encode/decode helpers, registry type constants, chain crypto utilities, and AirGapError (stable codes for host i18n).
UR types (URType)
| Constant | UR type string |
|----------|----------------|
| CryptoMultiAccounts | crypto-multi-accounts |
| CryptoHDKey | crypto-hdkey |
| CryptoPsbt | crypto-psbt |
| EthSignRequest / EthSignature | eth-sign-request / eth-signature |
| SolSignRequest / SolSignature | sol-sign-request / sol-signature |
| TronSignRequest / TronSignature | tron-sign-request / tron-signature |
| KeystoneSignRequest / KeystoneSignResult | keystone-sign-request / keystone-sign-result |
| DeviceCall | digitalshield-app-call-device |
DeviceCall helpers
buildDeviceCall/buildDeviceCallData/deviceCallToUrparseDeviceCallshortXfp— last 8 hex, aligned with DSgetShortXfp
Payload CBOR is UTF-8 JSON (same as ds__release DigitalShieldRequestDeviceQR).
Shared crypto / encoding
Used by airgap-hot and airgap-cold (no duplicate implementations in those packages):
| Module | Exports (examples) |
|--------|---------------------|
| bytes.js | hexToBytes, bytesToHex, buffer helpers |
| base58.js | Base58Check encode/decode |
| rlp.js | RLP encode/decode for legacy ETH txs |
| ethAddress.js | ETH address derivation / checksum |
| tronAddress.js | TRON address helpers |
UR session
decodeFrames/encodeAnimated/encodeSinglePart/urToJson- Incomplete frame sets throw
AirGapErrorwithUR_DECODE_INCOMPLETE
AirGapError
All SDK packages throw AirGapError for user-facing failures:
import {
AirGapError,
AirGapErrorCode,
isAirGapError,
getAirGapErrorCode,
airGapError,
} from "@digitalshieldfe/airgap-core";| Field | Purpose |
|-------|---------|
| code | Stable string for i18n mapping (AirGapErrorCode.*) |
| message | Default English description (fallback UI) |
| params | Optional interpolation, e.g. { failedAttempts, maxAttempts } |
Full enum: src/errors.ts. PIN-specific subclasses live in @digitalshieldfe/airgap-keyring (PinLockedError, VaultWipedError).
See root README §12.
