diff --git a/packages/transport/src/transports/abstract.ts b/packages/transport/src/transports/abstract.ts index 6b869e28c69..0f652576f01 100644 --- a/packages/transport/src/transports/abstract.ts +++ b/packages/transport/src/transports/abstract.ts @@ -7,7 +7,7 @@ import { TransportProtocolState, thp as protocolThp, } from '@trezor/protocol'; -import { MessageFromTrezor as ProtobufMessageType } from '@trezor/protobuf'; +import { MessageFromTrezor as ProtobufMessageType, loadDefinitions } from '@trezor/protobuf'; import { Session, @@ -355,6 +355,10 @@ export abstract class AbstractTransport extends TransportEmitter { this.messages = protobuf.Root.fromJSON(messages); } + public loadMessages(packageName: string, packageLoader: Parameters[2]) { + return loadDefinitions(this.messages, packageName, packageLoader); + } + protected success(payload: T): Success { return success(payload); }