20.1.0 • Published 2 months ago

@taquito/ledger-signer v20.1.0

Weekly downloads
231
License
Apache-2.0
Repository
-
Last release
2 months ago

Taquito Ledger Signer package

Documentation can be found here
TypeDoc style documentation is available here

General Information

@taquito/ledger-signer is an npm package that provides developers with ledger signing functionality for Taquito. It implements the Signer interface of Taquito, allowing you to sign operations from a Ledger Nano device.

Install

Install the package as follows

npm install @taquito/ledger-signer

Usage

Prerequisites

To use the Ledger Signer we must first import the desired transport from the LedgerJs library.

The Ledger Signer has currently been tested with @ledgerhq/hw-transport-node-hid for Node-based applications and with @ledgerhq/hw-transport-webhid for web applications.

Pass an instance of the transport of your choice to the Ledger Signer as follows:

import transportWeb from '@ledgerhq/hw-transport-webhid';
import { LedgerSigner } from '@taquito/ledger-signer';

const transport = await transportWeb.create();
const ledgerSigner = new LedgerSigner(transport);

The constructor of the LedgerSigner class takes three other optional parameters. If none are specified, the following default values are used:

  • path: default value is "44'/1729'/0'/0'"
    You can use as a parameter the HDPathTemplate which refers to 44'/1729'/${account}'/0'. You have to specify the index of the account you want to use. Or you can also use a complete path as a parameter. More details about paths here
  • prompt: default is true
    If true, you will be asked on your Ledger device to send your public key for validation. Note that confirmation is required when using @ledgerhq/hw-transport-webhid, so you should not set this parameter to false if you are using this transport.
  • derivationType: default is DerivationType.ED25519
    It can be DerivationType.ED25519 | DerivationType.BIP32_ED25519 (tz1), DerivationType.SECP256K1 (tz2) or DerivationType.P256 (tz3).
import { LedgerSigner, DerivationType, HDPathTemplate } from '@taquito/ledger-signer';

const ledgerSigner = new LedgerSigner(
  transport, //required
  HDPathTemplate(1), // path optional (equivalent to "44'/1729'/1'/0'")
  true, // prompt optional
  DerivationType.ED25519 // derivationType optional
);

Code Example

import { LedgerSigner } from '@taquito/ledger-signer';
import TransportWeb from '@ledgerhq/hw-transport-webhid';
import { TezosToolkit } from '@taquito/taquito';

const Tezos = new TezosToolkit('https://YOUR_PREFERRED_RPC_URL');

const transport = await TransportWeb.create();
const ledgerSigner = new LedgerSigner(transport);

Tezos.setProvider({ signer: ledgerSigner });

//Get the public key and the public key hash from the Ledger
const publicKey = await Tezos.signer.publicKey();
const publicKeyHash = await Tezos.signer.publicKeyHash();

Additional Info

See the top-level https://github.com/ecadlabs/taquito file for details on reporting issues, contributing and versioning.

Disclaimer

THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

20.1.0

2 months ago

20.1.0-RC.0

2 months ago

20.0.2-beta.1

5 months ago

20.0.2-beta.2

4 months ago

20.0.2-beta.0

5 months ago

21.0.0-beta.0

3 months ago

20.0.0-RC.1

7 months ago

20.0.1

6 months ago

20.0.0

7 months ago

20.0.0-RC.0

7 months ago

19.2.1

7 months ago

20.0.0-beta.1

7 months ago

19.2.1-beta.2

8 months ago

19.2.1-beta.1

8 months ago

19.2.1-beta.0

8 months ago

20.0.0-beta.0

8 months ago

19.2.0

9 months ago

19.2.0-RC.0

9 months ago

19.1.0

10 months ago

19.1.0-RC.2

10 months ago

19.1.0-RC.1

10 months ago

19.1.0-beta-RC.0

10 months ago

19.0.2

10 months ago

19.0.1

11 months ago

19.0.0

11 months ago

19.0.0-beta-RC.0

11 months ago

17.5.2

12 months ago

17.5.1

12 months ago

17.5.0

1 year ago

17.3.0-beta.1

1 year ago

18.0.0-RC.0

1 year ago

17.3.0

1 year ago

17.3.2

1 year ago

17.3.1

1 year ago

17.4.0

1 year ago

17.1.1

1 year ago

17.1.0

1 year ago

17.2.0

1 year ago

17.0.0

2 years ago

17.0.0-beta-RC.0

2 years ago

16.2.0-beta-RC.0

2 years ago

16.2.0

2 years ago

16.1.2

2 years ago

16.1.1

2 years ago

16.1.0

2 years ago

16.0.0-beta-RC.0

2 years ago

16.1.2-beta-RC.0

2 years ago

16.0.1

2 years ago

16.0.0

2 years ago

15.1.0-beta-RC.0

2 years ago

15.1.0-beta-RC.1

2 years ago

15.0.0

2 years ago

15.0.1

2 years ago

15.1.0

2 years ago

15.0.0-beta-RC.0

2 years ago

14.1.0-beta-RC.0

2 years ago

14.2.0-beta-RC.0

2 years ago

14.1.0

2 years ago

14.2.0

2 years ago

14.0.0-beta-RC.0

2 years ago

14.0.0

2 years ago

13.0.0

3 years ago

13.0.1

2 years ago

13.0.0-beta-RC.0

3 years ago

12.1.1

3 years ago

12.0.3

3 years ago

12.0.1

3 years ago

12.0.2

3 years ago

12.1.0-beta-RC.0

3 years ago

12.1.0

3 years ago

12.0.0

3 years ago

12.0.0-beta-RC.0

3 years ago

11.2.0

3 years ago

11.2.0-beta-RC.0

3 years ago

11.0.2

3 years ago

11.0.0

3 years ago

11.0.1

3 years ago

11.1.0-beta-RC.0

3 years ago

11.0.0-beta-RC.0

3 years ago

11.0.0-beta-RC.1

3 years ago

11.1.0

3 years ago

10.2.1

3 years ago

10.2.0

3 years ago

10.2.0-beta-RC.0

3 years ago

10.1.3

3 years ago

10.1.2

3 years ago

10.1.1

3 years ago

10.1.0-beta-RC.0

3 years ago

10.1.0

3 years ago

10.0.0-beta-RC.0

3 years ago

10.0.0

3 years ago

9.2.0

3 years ago

9.2.0-beta-RC.1

3 years ago

9.2.0-beta-RC.0

3 years ago

9.2.0-beta-RC.2

3 years ago

9.1.1-beacon.2

4 years ago

9.1.1-beacon.3

3 years ago

9.1.1

4 years ago

9.1.1-beta-RC.0

4 years ago

9.1.0-beta-RC.1

4 years ago

9.1.0-beta-RC.0

4 years ago

9.1.0

4 years ago

9.1.1-beacon.1

4 years ago

9.0.1

4 years ago

9.0.0

4 years ago

9.0.0-beta-RC.1

4 years ago

9.0.0-beta-RC.0

4 years ago

8.1.1

4 years ago

8.1.0

4 years ago

8.1.0-beta-RC.0

4 years ago

8.0.6-beta.0

4 years ago

8.0.6-beta-RC.0

4 years ago

8.0.5-preview.0

4 years ago

8.0.5-pack.1

4 years ago

8.0.5-pack.0

4 years ago

8.0.4-beta.0

4 years ago

8.0.4-beta-RC.0

4 years ago

8.0.3-beta.0

4 years ago

8.0.2-beta.0

4 years ago

8.0.1-beta.1

4 years ago

8.0.1-RC.3

4 years ago

8.0.1-edo2net.0

4 years ago

8.0.1-RC.1

4 years ago

8.0.1-RC.2

4 years ago

8.0.0-beta.7

4 years ago

8.0.0-beta.6

4 years ago

8.0.0-beta.5

4 years ago

8.0.0-beta.4

4 years ago

8.0.0-beta.3

4 years ago

8.0.0-beta.2

4 years ago

8.0.0-beta.1

4 years ago

7.2.0-beta.2

4 years ago

8.0.0-alpha.0

4 years ago

7.1.1-preview.0

4 years ago

7.2.0-alpha.2

4 years ago

7.2.0-alpha.1

4 years ago

7.2.0-alpha.0

4 years ago

7.1.0-beta.0

4 years ago

7.1.0-preview.10

4 years ago

7.1.0-preview.9

4 years ago

7.1.0-preview.8

4 years ago

7.1.0-preview.5

4 years ago

7.1.0-preview.6

4 years ago

7.1.0-preview.7

4 years ago

7.1.0-preview.4

4 years ago

7.1.0-preview.2

4 years ago

7.1.0-preview.3

4 years ago

7.1.0-preview.1

4 years ago

7.0.1-beta.0

4 years ago

7.0.0-beta.0

4 years ago

7.0.0-beta-RC.0

4 years ago

7.0.0-beta.pre.0

4 years ago

6.4.0-ledger.0

4 years ago