diff --git a/packages/transport/src/transports/abstract.ts b/packages/transport/src/transports/abstract.ts index b4587a79a23..bd1870a8b5a 100644 --- a/packages/transport/src/transports/abstract.ts +++ b/packages/transport/src/transports/abstract.ts @@ -13,7 +13,7 @@ import { TransportProtocolState, thp as protocolThp, } from '@trezor/protocol'; -import type { MessageFromTrezor as ProtobufMessageType } from '@trezor/protobuf'; +import { MessageFromTrezor as ProtobufMessageType, loadDefinitions } from '@trezor/protobuf'; import { Session, @@ -447,6 +447,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); }