diff options
Diffstat (limited to 'packages')
-rw-r--r-- | packages/subproviders/src/globals.d.ts | 2 | ||||
-rw-r--r-- | packages/subproviders/src/index.ts | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/packages/subproviders/src/globals.d.ts b/packages/subproviders/src/globals.d.ts index 1f9c6e8a6..7fb0fc7e2 100644 --- a/packages/subproviders/src/globals.d.ts +++ b/packages/subproviders/src/globals.d.ts @@ -30,7 +30,7 @@ declare module 'ledgerco' { declare module 'semaphore-async-await' { class Semaphore { constructor(permits: number); - public wait(): void; + public wait(): Promise<void>; public signal(): void; } export default Semaphore; diff --git a/packages/subproviders/src/index.ts b/packages/subproviders/src/index.ts index 9560c3597..9b7cab3fa 100644 --- a/packages/subproviders/src/index.ts +++ b/packages/subproviders/src/index.ts @@ -17,12 +17,20 @@ export { LedgerCommunicationClient, } from './types'; +/** + * A factory method for creating a LedgerEthereumClient usable in a browser context. + * @return LedgerEthereumClient A browser client + */ export async function ledgerEthereumBrowserClientFactoryAsync(): Promise<LedgerEthereumClient> { const ledgerConnection = await LedgerBrowserCommunication.create_async(); const ledgerEthClient = new LedgerEthereumClientFn(ledgerConnection); return ledgerEthClient; } +/** + * A factory for creating a LedgerEthereumClient usable in a Node.js context. + * @return LedgerEthereumClient A Node.js client + */ export async function ledgerEthereumNodeJsClientFactoryAsync(): Promise<LedgerEthereumClient> { const ledgerConnection = await LedgerNodeCommunication.create_async(); const ledgerEthClient = new LedgerEthereumClientFn(ledgerConnection); |