@trezor/transport
Version:
Low level library facilitating protocol buffers based communication with Trezor devices
53 lines (52 loc) • 2.22 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.DEVICE_TYPE = exports.TRANSPORT = exports.ACTION_TIMEOUT = exports.TREZOR_USB_DESCRIPTORS = exports.WEBUSB_BOOTLOADER_PRODUCT = exports.T1_HID_PRODUCT = exports.T1_HID_VENDOR = exports.DEBUGLINK_ENDPOINT_ID = exports.DEBUGLINK_INTERFACE_ID = exports.ENDPOINT_ID = exports.INTERFACE_ID = exports.CONFIGURATION_ID = void 0;
exports.CONFIGURATION_ID = 1;
exports.INTERFACE_ID = 0;
exports.ENDPOINT_ID = 1;
exports.DEBUGLINK_INTERFACE_ID = 1;
exports.DEBUGLINK_ENDPOINT_ID = 2;
exports.T1_HID_VENDOR = 0x534c;
exports.T1_HID_PRODUCT = 0x0001;
const WEBUSB_FIRMWARE_PRODUCT = 0x53c1;
exports.WEBUSB_BOOTLOADER_PRODUCT = 0x53c0;
exports.TREZOR_USB_DESCRIPTORS = [{
vendorId: 0x534c,
productId: exports.T1_HID_PRODUCT
}, {
vendorId: 0x1209,
productId: exports.WEBUSB_BOOTLOADER_PRODUCT
}, {
vendorId: 0x1209,
productId: WEBUSB_FIRMWARE_PRODUCT
}];
exports.ACTION_TIMEOUT = 10000;
exports.TRANSPORT = {
START: 'transport-start',
ERROR: 'transport-error',
STOPPED: 'transport-stopped',
DEVICE_CONNECTED: 'transport-device_connected',
DEVICE_DISCONNECTED: 'transport-device_disconnected',
DEVICE_SESSION_CHANGED: 'transport-device_session_changed',
DEVICE_REQUEST_RELEASE: 'transport-device_request_release',
SEND_MESSAGE_PROGRESS: 'transport-send_message_progress',
TREZOR_PUSH_NOTIFICATION: 'trezor-push-notification',
BATTERY_LEVEL: 'battery-level',
DISABLE_WEBUSB: 'transport-disable_webusb',
REQUEST_DEVICE: 'transport-request_device',
GET_INFO: 'transport-get_info',
SET_TRANSPORTS: 'transport-set_transports'
};
var DEVICE_TYPE;
(function (DEVICE_TYPE) {
DEVICE_TYPE[DEVICE_TYPE["TypeT1Hid"] = 0] = "TypeT1Hid";
DEVICE_TYPE[DEVICE_TYPE["TypeT1Webusb"] = 1] = "TypeT1Webusb";
DEVICE_TYPE[DEVICE_TYPE["TypeT1WebusbBoot"] = 2] = "TypeT1WebusbBoot";
DEVICE_TYPE[DEVICE_TYPE["TypeT2"] = 3] = "TypeT2";
DEVICE_TYPE[DEVICE_TYPE["TypeT2Boot"] = 4] = "TypeT2Boot";
DEVICE_TYPE[DEVICE_TYPE["TypeEmulator"] = 5] = "TypeEmulator";
DEVICE_TYPE[DEVICE_TYPE["TypeBluetooth"] = 6] = "TypeBluetooth";
})(DEVICE_TYPE || (exports.DEVICE_TYPE = DEVICE_TYPE = {}));
//# sourceMappingURL=constants.js.map