diff --git a/packages/hw-ledger/src/bundle.ts b/packages/hw-ledger/src/bundle.ts index 2b9bcb5c6..c6ba8d44c 100644 --- a/packages/hw-ledger/src/bundle.ts +++ b/packages/hw-ledger/src/bundle.ts @@ -2,7 +2,6 @@ // SPDX-License-Identifier: Apache-2.0 import type { SubstrateApp } from '@zondax/ledger-substrate'; -import type { ResponseBase } from '@zondax/ledger-substrate/dist/common'; import type { AccountOptions, LedgerAddress, LedgerSignature, LedgerTypes, LedgerVersion } from './types'; import { newSubstrateApp } from '@zondax/ledger-substrate'; @@ -17,8 +16,10 @@ export { packageInfo } from './packageInfo'; type Chain = keyof typeof ledgerApps; -/** @internal */ -async function wrapError (promise: Promise): Promise { +type WrappedResult = Awaited>; + +/** @internal Wraps a SubstrateApp call, checking the result for any errors which result in a rejection */ +async function wrapError (promise: Promise): Promise { const result = await promise; if (result.return_code !== LEDGER_SUCCESS_CODE) {