@taquito/ledger-signer
Advanced tools
Comparing version 16.2.0 to 17.0.0-beta-RC.0
@@ -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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
318292
2967
3918
2
171
4
0
32
+ Added@noble/hashes@1.6.1(transitive)
+ Added@taquito/core@17.5.2(transitive)
+ Added@taquito/http-utils@17.5.2(transitive)
+ Added@taquito/local-forging@17.5.2(transitive)
+ Added@taquito/michel-codec@17.5.2(transitive)
+ Added@taquito/michelson-encoder@17.5.2(transitive)
+ Added@taquito/rpc@17.5.2(transitive)
+ Added@taquito/taquito@17.5.2(transitive)
+ Added@taquito/utils@17.5.2(transitive)
+ Added@types/node@22.10.3(transitive)
+ Addedbase-x@4.0.0(transitive)
+ Addedbs58@5.0.0(transitive)
+ Addedbs58check@3.0.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addednode-fetch@2.7.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)
- Removed@taquito/core@16.2.0(transitive)
- Removed@taquito/http-utils@16.2.0(transitive)
- Removed@taquito/local-forging@16.2.0(transitive)
- Removed@taquito/michel-codec@16.2.0(transitive)
- Removed@taquito/michelson-encoder@16.2.0(transitive)
- Removed@taquito/rpc@16.2.0(transitive)
- Removed@taquito/taquito@16.2.0(transitive)
- Removed@taquito/utils@16.2.0(transitive)
- Removed@types/node@22.10.5(transitive)
- Removedaxios@0.26.1(transitive)
- Removedbase-x@3.0.10(transitive)
- Removedbs58@4.0.1(transitive)
- Removedbs58check@2.1.2(transitive)
- Removedcipher-base@1.0.6(transitive)
- Removedcreate-hash@1.2.0(transitive)
- Removedfollow-redirects@1.15.9(transitive)
- Removedhash-base@3.1.0(transitive)
- Removedmd5.js@1.3.5(transitive)
- Removedreadable-stream@3.6.2(transitive)
- Removedripemd160@2.0.2(transitive)
- Removedrxjs@6.6.7(transitive)
- Removedsafe-buffer@5.2.1(transitive)
- Removedsha.js@2.4.11(transitive)
- Removedstring_decoder@1.3.0(transitive)
- Removedtslib@1.14.1(transitive)
- Removedutil-deprecate@1.0.2(transitive)