Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@taquito/ledger-signer

Package Overview
Dependencies
Maintainers
4
Versions
172
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@taquito/ledger-signer - npm Package Compare versions

Comparing version 16.2.0 to 17.0.0-beta-RC.0

dist/lib/errors.js

26

dist/lib/taquito-ledger-signer.js

@@ -20,3 +20,3 @@ "use strict";

const blake2b_1 = require("@stablelib/blake2b");
const error_1 = require("./error");
const errors_1 = require("./errors");
const core_1 = require("@taquito/core");

@@ -32,14 +32,4 @@ var core_2 = require("@taquito/core");

})(DerivationType = exports.DerivationType || (exports.DerivationType = {}));
/**
* @category Error
* @description Error that indicates an invalid derivation type being passed or used
*/
class InvalidDerivationTypeError extends Error {
constructor(derivationType) {
super(`The derivation type ${derivationType} is invalid. The derivation type must be DerivationType.ED25519, DerivationType.SECP256K1, DerivationType.P256 or DerivationType.BIP32_ED25519`);
this.derivationType = derivationType;
this.name = 'InvalidDerivationTypeError';
}
}
exports.InvalidDerivationTypeError = InvalidDerivationTypeError;
var errors_2 = require("./errors");
Object.defineProperty(exports, "InvalidDerivationTypeError", { enumerable: true, get: function () { return errors_2.InvalidDerivationTypeError; } });
const HDPathTemplate = (account) => {

@@ -97,6 +87,6 @@ return `44'/1729'/${account}'/0'`;

if (!path.startsWith(`44'/1729'`)) {
throw new core_1.InvalidDerivationPathError(path, `: Invalid prefix expecting prefix "44'/1729'".`);
throw new core_1.InvalidDerivationPathError(path, `${utils_1.invalidDetail(utils_1.ValidationResult.NO_PREFIX_MATCHED)} expecting prefix "44'/1729'".`);
}
if (!Object.values(DerivationType).includes(derivationType)) {
throw new InvalidDerivationTypeError(derivationType.toString());
throw new errors_1.InvalidDerivationTypeError(derivationType.toString());
}

@@ -112,3 +102,3 @@ }

}
throw new error_1.PublicKeyHashRetrievalError();
throw new errors_1.PublicKeyHashRetrievalError();
});

@@ -144,3 +134,3 @@ }

catch (error) {
throw new error_1.PublicKeyRetrievalError();
throw new errors_1.PublicKeyRetrievalError(error);
}

@@ -169,3 +159,3 @@ });

if (!utils_2.validateResponse(ledgerResponse)) {
throw new error_1.InvalidLedgerResponseError('Cannot parse ledger response');
throw new errors_1.InvalidLedgerResponseError('Invalid signature return by ledger unable to parse the response');
}

@@ -172,0 +162,0 @@ const idxLengthRVal = 3; // Third element of response is length of r value

@@ -6,5 +6,5 @@ "use strict";

exports.VERSION = {
"commitHash": "adc0f8c31492e8eb2f03b06ac36ba053e8ba6224",
"version": "16.2.0"
"commitHash": "1169170fdbf4efd03283dc902bc03b9df5bb2fb1",
"version": "17.0.0-beta-RC.0"
};
//# sourceMappingURL=version.js.map

@@ -1,4 +0,4 @@

import { prefix, Prefix, b58cencode } from '@taquito/utils';
import { invalidDetail, ValidationResult, prefix, Prefix, b58cencode } from '@taquito/utils';
import { hash } from '@stablelib/blake2b';
import { InvalidDerivationPathError, ProhibitedActionError } from '@taquito/core';
import { ParameterValidationError, TaquitoError, InvalidDerivationPathError, ProhibitedActionError } from '@taquito/core';
export { InvalidDerivationPathError } from '@taquito/core';

@@ -153,7 +153,7 @@

* @category Error
* @description Error that indicates an invalid or unparseable ledger response
* @description Error indicates an invalid or unparseable ledger response
*/
class InvalidLedgerResponseError extends Error {
class InvalidLedgerResponseError extends TaquitoError {
constructor(message) {
super(message);
super();
this.message = message;

@@ -165,8 +165,10 @@ this.name = 'InvalidLedgerResponseError';

* @category Error
* @description Error that indicates a failure when trying to retrieve a Public Key from Ledger signer
* @description Error indicates a failure when trying to retrieve a Public Key from Ledger signer
*/
class PublicKeyRetrievalError extends Error {
constructor() {
super(`Unable to retrieve Public Key from Ledger`);
class PublicKeyRetrievalError extends TaquitoError {
constructor(cause) {
super();
this.cause = cause;
this.name = 'PublicKeyRetrievalError';
this.message = `Unable to retrieve Public Key from Ledger`;
}

@@ -176,15 +178,28 @@ }

* @category Error
* @description Error that indicates a failure when trying to retrieve a Public Key Hash from Ledger signer
* @description Error indicates a failure when trying to retrieve a Public Key Hash from Ledger signer
*/
class PublicKeyHashRetrievalError extends Error {
class PublicKeyHashRetrievalError extends TaquitoError {
constructor() {
super(`Unable to retrieve Public Key Hash from Ledger`);
super();
this.name = 'PublicKeyHashRetrievalError';
this.message = 'Unable to retrieve Public Key Hash from Ledger';
}
}
/**
* @category Error
* @description Error indicates an invalid derivation type being passed or used
*/
class InvalidDerivationTypeError extends ParameterValidationError {
constructor(derivationType) {
super();
this.derivationType = derivationType;
this.name = 'InvalidDerivationTypeError';
this.message = `Invalid derivation type ${derivationType} expecting one of the following: DerivationType.ED25519, DerivationType.SECP256K1, DerivationType.P256 or DerivationType.BIP32_ED25519`;
}
}
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
const VERSION = {
"commitHash": "adc0f8c31492e8eb2f03b06ac36ba053e8ba6224",
"version": "16.2.0"
"commitHash": "1169170fdbf4efd03283dc902bc03b9df5bb2fb1",
"version": "17.0.0-beta-RC.0"
};

@@ -203,13 +218,2 @@

})(DerivationType || (DerivationType = {}));
/**
* @category Error
* @description Error that indicates an invalid derivation type being passed or used
*/
class InvalidDerivationTypeError extends Error {
constructor(derivationType) {
super(`The derivation type ${derivationType} is invalid. The derivation type must be DerivationType.ED25519, DerivationType.SECP256K1, DerivationType.P256 or DerivationType.BIP32_ED25519`);
this.derivationType = derivationType;
this.name = 'InvalidDerivationTypeError';
}
}
const HDPathTemplate = (account) => {

@@ -264,3 +268,3 @@ return `44'/1729'/${account}'/0'`;

if (!path.startsWith(`44'/1729'`)) {
throw new InvalidDerivationPathError(path, `: Invalid prefix expecting prefix "44'/1729'".`);
throw new InvalidDerivationPathError(path, `${invalidDetail(ValidationResult.NO_PREFIX_MATCHED)} expecting prefix "44'/1729'".`);
}

@@ -310,3 +314,3 @@ if (!Object.values(DerivationType).includes(derivationType)) {

catch (error) {
throw new PublicKeyRetrievalError();
throw new PublicKeyRetrievalError(error);
}

@@ -335,3 +339,3 @@ });

if (!validateResponse(ledgerResponse)) {
throw new InvalidLedgerResponseError('Cannot parse ledger response');
throw new InvalidLedgerResponseError('Invalid signature return by ledger unable to parse the response');
}

@@ -338,0 +342,0 @@ const idxLengthRVal = 3; // Third element of response is length of r value

@@ -154,7 +154,7 @@ (function (global, factory) {

* @category Error
* @description Error that indicates an invalid or unparseable ledger response
* @description Error indicates an invalid or unparseable ledger response
*/
class InvalidLedgerResponseError extends Error {
class InvalidLedgerResponseError extends core.TaquitoError {
constructor(message) {
super(message);
super();
this.message = message;

@@ -166,8 +166,10 @@ this.name = 'InvalidLedgerResponseError';

* @category Error
* @description Error that indicates a failure when trying to retrieve a Public Key from Ledger signer
* @description Error indicates a failure when trying to retrieve a Public Key from Ledger signer
*/
class PublicKeyRetrievalError extends Error {
constructor() {
super(`Unable to retrieve Public Key from Ledger`);
class PublicKeyRetrievalError extends core.TaquitoError {
constructor(cause) {
super();
this.cause = cause;
this.name = 'PublicKeyRetrievalError';
this.message = `Unable to retrieve Public Key from Ledger`;
}

@@ -177,15 +179,28 @@ }

* @category Error
* @description Error that indicates a failure when trying to retrieve a Public Key Hash from Ledger signer
* @description Error indicates a failure when trying to retrieve a Public Key Hash from Ledger signer
*/
class PublicKeyHashRetrievalError extends Error {
class PublicKeyHashRetrievalError extends core.TaquitoError {
constructor() {
super(`Unable to retrieve Public Key Hash from Ledger`);
super();
this.name = 'PublicKeyHashRetrievalError';
this.message = 'Unable to retrieve Public Key Hash from Ledger';
}
}
/**
* @category Error
* @description Error indicates an invalid derivation type being passed or used
*/
class InvalidDerivationTypeError extends core.ParameterValidationError {
constructor(derivationType) {
super();
this.derivationType = derivationType;
this.name = 'InvalidDerivationTypeError';
this.message = `Invalid derivation type ${derivationType} expecting one of the following: DerivationType.ED25519, DerivationType.SECP256K1, DerivationType.P256 or DerivationType.BIP32_ED25519`;
}
}
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
const VERSION = {
"commitHash": "adc0f8c31492e8eb2f03b06ac36ba053e8ba6224",
"version": "16.2.0"
"commitHash": "1169170fdbf4efd03283dc902bc03b9df5bb2fb1",
"version": "17.0.0-beta-RC.0"
};

@@ -204,13 +219,2 @@

})(exports.DerivationType || (exports.DerivationType = {}));
/**
* @category Error
* @description Error that indicates an invalid derivation type being passed or used
*/
class InvalidDerivationTypeError extends Error {
constructor(derivationType) {
super(`The derivation type ${derivationType} is invalid. The derivation type must be DerivationType.ED25519, DerivationType.SECP256K1, DerivationType.P256 or DerivationType.BIP32_ED25519`);
this.derivationType = derivationType;
this.name = 'InvalidDerivationTypeError';
}
}
const HDPathTemplate = (account) => {

@@ -265,3 +269,3 @@ return `44'/1729'/${account}'/0'`;

if (!path.startsWith(`44'/1729'`)) {
throw new core.InvalidDerivationPathError(path, `: Invalid prefix expecting prefix "44'/1729'".`);
throw new core.InvalidDerivationPathError(path, `${utils.invalidDetail(utils.ValidationResult.NO_PREFIX_MATCHED)} expecting prefix "44'/1729'".`);
}

@@ -311,3 +315,3 @@ if (!Object.values(exports.DerivationType).includes(derivationType)) {

catch (error) {
throw new PublicKeyRetrievalError();
throw new PublicKeyRetrievalError(error);
}

@@ -336,3 +340,3 @@ });

if (!validateResponse(ledgerResponse)) {
throw new InvalidLedgerResponseError('Cannot parse ledger response');
throw new InvalidLedgerResponseError('Invalid signature return by ledger unable to parse the response');
}

@@ -339,0 +343,0 @@ const idxLengthRVal = 3; // Third element of response is length of r value

@@ -15,11 +15,3 @@ /**

}
/**
* @category Error
* @description Error that indicates an invalid derivation type being passed or used
*/
export declare class InvalidDerivationTypeError extends Error {
derivationType: string;
name: string;
constructor(derivationType: string);
}
export { InvalidDerivationTypeError } from './errors';
export declare const HDPathTemplate: (account: number) => string;

@@ -26,0 +18,0 @@ export { VERSION } from './version';

{
"name": "@taquito/ledger-signer",
"version": "16.2.0",
"version": "17.0.0-beta-RC.0",
"description": "Ledger signer provider",

@@ -63,4 +63,4 @@ "keywords": [

"@stablelib/blake2b": "^1.0.1",
"@taquito/taquito": "^16.2.0",
"@taquito/utils": "^16.2.0",
"@taquito/taquito": "^17.0.0-beta-RC.0",
"@taquito/utils": "^17.0.0-beta-RC.0",
"buffer": "^6.0.3"

@@ -97,3 +97,3 @@ },

},
"gitHead": "148b11675d2c3d3a10ce20c02dcece388ef59414"
"gitHead": "8acebfdf7b4361533d963eed87f03f8983dc679b"
}

@@ -8,3 +8,3 @@ /**

import Transport from '@ledgerhq/hw-transport';
import { b58cencode, prefix, Prefix } from '@taquito/utils';
import { b58cencode, invalidDetail, prefix, Prefix, ValidationResult } from '@taquito/utils';
import {

@@ -23,3 +23,4 @@ appendWatermark,

InvalidLedgerResponseError,
} from './error';
InvalidDerivationTypeError,
} from './errors';
import { InvalidDerivationPathError, ProhibitedActionError } from '@taquito/core';

@@ -38,14 +39,3 @@

/**
* @category Error
* @description Error that indicates an invalid derivation type being passed or used
*/
export class InvalidDerivationTypeError extends Error {
public name = 'InvalidDerivationTypeError';
constructor(public derivationType: string) {
super(
`The derivation type ${derivationType} is invalid. The derivation type must be DerivationType.ED25519, DerivationType.SECP256K1, DerivationType.P256 or DerivationType.BIP32_ED25519`
);
}
}
export { InvalidDerivationTypeError } from './errors';

@@ -108,3 +98,6 @@ export const HDPathTemplate = (account: number) => {

if (!path.startsWith(`44'/1729'`)) {
throw new InvalidDerivationPathError(path, `: Invalid prefix expecting prefix "44'/1729'".`);
throw new InvalidDerivationPathError(
path,
`${invalidDetail(ValidationResult.NO_PREFIX_MATCHED)} expecting prefix "44'/1729'".`
);
}

@@ -159,3 +152,3 @@ if (!Object.values(DerivationType).includes(derivationType)) {

} catch (error) {
throw new PublicKeyRetrievalError();
throw new PublicKeyRetrievalError(error);
}

@@ -183,3 +176,5 @@ }

if (!validateResponse(ledgerResponse)) {
throw new InvalidLedgerResponseError('Cannot parse ledger response');
throw new InvalidLedgerResponseError(
'Invalid signature return by ledger unable to parse the response'
);
}

@@ -186,0 +181,0 @@ const idxLengthRVal = 3; // Third element of response is length of r value

// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
export const VERSION = {
commitHash: 'adc0f8c31492e8eb2f03b06ac36ba053e8ba6224',
version: '16.2.0',
commitHash: '1169170fdbf4efd03283dc902bc03b9df5bb2fb1',
version: '17.0.0-beta-RC.0',
};

@@ -32,3 +32,3 @@ import { LedgerSigner, DerivationType, HDPathTemplate } from '../src/taquito-ledger-signer';

}).toThrow(
`Invalid derivation path "4'/1729'/0'/0'": Invalid prefix expecting prefix "44'/1729'".`
`Invalid derivation path "4'/1729'/0'/0'" with unsupported prefix expecting prefix "44'/1729'".`
);

@@ -35,0 +35,0 @@ });

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc