UNPKG

airsign-sdk-core

Version:

AirSign Protocol Core SDK - secure nearby crypto & data exchange

43 lines 1.31 kB
/** * AirSign Protocol Core Types * * Type definitions for the AirSign Protocol message format, * presence packets, and cryptographic operations. */ /** * Protocol message types supported by AirSign */ export var MessageType; (function (MessageType) { MessageType["PAYMENT_URI"] = "payment_uri"; MessageType["WALLET_ADDRESS"] = "wallet_address"; MessageType["SIGNED_TX"] = "signed_tx"; MessageType["FILE"] = "file"; })(MessageType || (MessageType = {})); /** * Custom error class for AirSign protocol errors */ export class AirSignError extends Error { code; details; constructor(message, code, details) { super(message); this.code = code; this.details = details; this.name = 'AirSignError'; } } /** * Error codes for different failure scenarios */ export var ErrorCode; (function (ErrorCode) { ErrorCode["INVALID_PRESENCE"] = "INVALID_PRESENCE"; ErrorCode["INVALID_MESSAGE"] = "INVALID_MESSAGE"; ErrorCode["CRYPTO_ERROR"] = "CRYPTO_ERROR"; ErrorCode["EXPIRED_MESSAGE"] = "EXPIRED_MESSAGE"; ErrorCode["REPLAY_DETECTED"] = "REPLAY_DETECTED"; ErrorCode["INVALID_SIGNATURE"] = "INVALID_SIGNATURE"; ErrorCode["MISSING_FIELD"] = "MISSING_FIELD"; })(ErrorCode || (ErrorCode = {})); //# sourceMappingURL=types.js.map