mirror of
https://github.com/pezkuwichain/pezkuwi-ui.git
synced 2026-06-01 02:11:03 +00:00
Split Ledger (& transports) into package (#399)
* Split Ledger (& transports) into package * Fix browser/node resolution * Bump
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
// Copyright 2017-2020 @polkadot/ledger authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TransportDef } from './types';
|
||||
|
||||
import Transport from '@ledgerhq/hw-transport';
|
||||
import LedgerWebUSB from '@ledgerhq/hw-transport-webusb';
|
||||
|
||||
const transports: TransportDef[] = [
|
||||
// deprecated
|
||||
// import LedgerU2F from '@ledgerhq/hw-transport-u2f';
|
||||
// {
|
||||
// create: (): Promise<Transport> =>
|
||||
// LedgerU2F.create(),
|
||||
// type: 'u2f'
|
||||
// },
|
||||
{
|
||||
create: (): Promise<Transport> =>
|
||||
LedgerWebUSB.create(),
|
||||
type: 'webusb'
|
||||
}
|
||||
];
|
||||
|
||||
export default transports;
|
||||
@@ -0,0 +1,17 @@
|
||||
// Copyright 2017-2020 @polkadot/ledger authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TransportDef } from './types';
|
||||
|
||||
import Transport from '@ledgerhq/hw-transport';
|
||||
import LedgerHid from '@ledgerhq/hw-transport-node-hid';
|
||||
|
||||
const transports: TransportDef[] = [
|
||||
{
|
||||
create: (): Promise<Transport> =>
|
||||
LedgerHid.create(),
|
||||
type: 'hid'
|
||||
}
|
||||
];
|
||||
|
||||
export default transports;
|
||||
@@ -0,0 +1,8 @@
|
||||
// Copyright 2017-2020 @polkadot/ledger authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import { TransportDef } from './types';
|
||||
|
||||
const transports: TransportDef[] = [];
|
||||
|
||||
export default transports;
|
||||
@@ -0,0 +1,11 @@
|
||||
// Copyright 2017-2020 @polkadot/ledger authors & contributors
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
import Transport from '@ledgerhq/hw-transport';
|
||||
|
||||
export type LedgerTypes = 'hid' | 'u2f' | 'webusb';
|
||||
|
||||
export interface TransportDef {
|
||||
create (): Promise<Transport>;
|
||||
type: LedgerTypes;
|
||||
}
|
||||
Reference in New Issue
Block a user