@taquito/ledger-signer
Advanced tools
Comparing version 16.1.2 to 16.2.0-beta-RC.0
@@ -16,3 +16,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.LedgerSigner = exports.VERSION = exports.HDPathTemplate = exports.InvalidDerivationPathError = exports.InvalidDerivationTypeError = exports.DerivationType = void 0; | ||
exports.LedgerSigner = exports.VERSION = exports.HDPathTemplate = exports.InvalidDerivationTypeError = exports.DerivationType = exports.InvalidDerivationPathError = void 0; | ||
const utils_1 = require("@taquito/utils"); | ||
@@ -22,2 +22,5 @@ const utils_2 = require("./utils"); | ||
const error_1 = require("./error"); | ||
const core_1 = require("@taquito/core"); | ||
var core_2 = require("@taquito/core"); | ||
Object.defineProperty(exports, "InvalidDerivationPathError", { enumerable: true, get: function () { return core_2.InvalidDerivationPathError; } }); | ||
var DerivationType; | ||
@@ -42,14 +45,2 @@ (function (DerivationType) { | ||
exports.InvalidDerivationTypeError = InvalidDerivationTypeError; | ||
/** | ||
* @category Error | ||
* @description Error that indicates an invalid derivation path being passed or used | ||
*/ | ||
class InvalidDerivationPathError extends Error { | ||
constructor(derivationPath) { | ||
super(`The derivation path ${derivationPath} is invalid. The derivation path must start with 44'/1729`); | ||
this.derivationPath = derivationPath; | ||
this.name = 'InvalidDerivationPathError'; | ||
} | ||
} | ||
exports.InvalidDerivationPathError = InvalidDerivationPathError; | ||
const HDPathTemplate = (account) => { | ||
@@ -106,4 +97,4 @@ return `44'/1729'/${account}'/0'`; | ||
this.transport.setScrambleKey('XTZ'); | ||
if (!path.startsWith("44'/1729'")) { | ||
throw new InvalidDerivationPathError(path); | ||
if (!path.startsWith(`44'/1729'`)) { | ||
throw new core_1.InvalidDerivationPathError(path, `: Invalid prefix expecting prefix "44'/1729'".`); | ||
} | ||
@@ -159,3 +150,3 @@ if (!Object.values(DerivationType).includes(derivationType)) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
throw new utils_1.ProhibitedActionError('Secret key cannot be exposed'); | ||
throw new core_1.ProhibitedActionError('Secret key cannot be exposed'); | ||
}); | ||
@@ -162,0 +153,0 @@ } |
@@ -6,5 +6,5 @@ "use strict"; | ||
exports.VERSION = { | ||
"commitHash": "bcc2118ddfafc1995fd125cd74d198fda042bf48", | ||
"version": "16.1.2" | ||
"commitHash": "babcbaf464fd3571a3b88cf7023fefe87809d86d", | ||
"version": "16.2.0-beta-RC.0" | ||
}; | ||
//# sourceMappingURL=version.js.map |
@@ -1,3 +0,5 @@ | ||
import { prefix, Prefix, b58cencode, ProhibitedActionError } from '@taquito/utils'; | ||
import { prefix, Prefix, b58cencode } from '@taquito/utils'; | ||
import { hash } from '@stablelib/blake2b'; | ||
import { InvalidDerivationPathError, ProhibitedActionError } from '@taquito/core'; | ||
export { InvalidDerivationPathError } from '@taquito/core'; | ||
@@ -183,4 +185,4 @@ /****************************************************************************** | ||
const VERSION = { | ||
"commitHash": "bcc2118ddfafc1995fd125cd74d198fda042bf48", | ||
"version": "16.1.2" | ||
"commitHash": "babcbaf464fd3571a3b88cf7023fefe87809d86d", | ||
"version": "16.2.0-beta-RC.0" | ||
}; | ||
@@ -210,13 +212,2 @@ | ||
} | ||
/** | ||
* @category Error | ||
* @description Error that indicates an invalid derivation path being passed or used | ||
*/ | ||
class InvalidDerivationPathError extends Error { | ||
constructor(derivationPath) { | ||
super(`The derivation path ${derivationPath} is invalid. The derivation path must start with 44'/1729`); | ||
this.derivationPath = derivationPath; | ||
this.name = 'InvalidDerivationPathError'; | ||
} | ||
} | ||
const HDPathTemplate = (account) => { | ||
@@ -270,4 +261,4 @@ return `44'/1729'/${account}'/0'`; | ||
this.transport.setScrambleKey('XTZ'); | ||
if (!path.startsWith("44'/1729'")) { | ||
throw new InvalidDerivationPathError(path); | ||
if (!path.startsWith(`44'/1729'`)) { | ||
throw new InvalidDerivationPathError(path, `: Invalid prefix expecting prefix "44'/1729'".`); | ||
} | ||
@@ -395,3 +386,3 @@ if (!Object.values(DerivationType).includes(derivationType)) { | ||
export { DerivationType, HDPathTemplate, InvalidDerivationPathError, InvalidDerivationTypeError, LedgerSigner, VERSION }; | ||
export { DerivationType, HDPathTemplate, InvalidDerivationTypeError, LedgerSigner, VERSION }; | ||
//# sourceMappingURL=taquito-ledger-signer.es6.js.map |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@taquito/utils'), require('@stablelib/blake2b')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@taquito/utils', '@stablelib/blake2b'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.taquitoLedgerSigner = {}, global.utils, global.blake2b)); | ||
})(this, (function (exports, utils, blake2b) { 'use strict'; | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@taquito/utils'), require('@stablelib/blake2b'), require('@taquito/core')) : | ||
typeof define === 'function' && define.amd ? define(['exports', '@taquito/utils', '@stablelib/blake2b', '@taquito/core'], factory) : | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.taquitoLedgerSigner = {}, global.utils, global.blake2b, global.core)); | ||
})(this, (function (exports, utils, blake2b, core) { 'use strict'; | ||
@@ -186,4 +186,4 @@ /****************************************************************************** | ||
const VERSION = { | ||
"commitHash": "bcc2118ddfafc1995fd125cd74d198fda042bf48", | ||
"version": "16.1.2" | ||
"commitHash": "babcbaf464fd3571a3b88cf7023fefe87809d86d", | ||
"version": "16.2.0-beta-RC.0" | ||
}; | ||
@@ -213,13 +213,2 @@ | ||
} | ||
/** | ||
* @category Error | ||
* @description Error that indicates an invalid derivation path being passed or used | ||
*/ | ||
class InvalidDerivationPathError extends Error { | ||
constructor(derivationPath) { | ||
super(`The derivation path ${derivationPath} is invalid. The derivation path must start with 44'/1729`); | ||
this.derivationPath = derivationPath; | ||
this.name = 'InvalidDerivationPathError'; | ||
} | ||
} | ||
const HDPathTemplate = (account) => { | ||
@@ -273,4 +262,4 @@ return `44'/1729'/${account}'/0'`; | ||
this.transport.setScrambleKey('XTZ'); | ||
if (!path.startsWith("44'/1729'")) { | ||
throw new InvalidDerivationPathError(path); | ||
if (!path.startsWith(`44'/1729'`)) { | ||
throw new core.InvalidDerivationPathError(path, `: Invalid prefix expecting prefix "44'/1729'".`); | ||
} | ||
@@ -326,3 +315,3 @@ if (!Object.values(exports.DerivationType).includes(derivationType)) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
throw new utils.ProhibitedActionError('Secret key cannot be exposed'); | ||
throw new core.ProhibitedActionError('Secret key cannot be exposed'); | ||
}); | ||
@@ -399,4 +388,7 @@ } | ||
Object.defineProperty(exports, 'InvalidDerivationPathError', { | ||
enumerable: true, | ||
get: function () { return core.InvalidDerivationPathError; } | ||
}); | ||
exports.HDPathTemplate = HDPathTemplate; | ||
exports.InvalidDerivationPathError = InvalidDerivationPathError; | ||
exports.InvalidDerivationTypeError = InvalidDerivationTypeError; | ||
@@ -403,0 +395,0 @@ exports.LedgerSigner = LedgerSigner; |
@@ -7,2 +7,3 @@ /** | ||
import Transport from '@ledgerhq/hw-transport'; | ||
export { InvalidDerivationPathError } from '@taquito/core'; | ||
export declare type LedgerTransport = Pick<Transport, 'send' | 'decorateAppAPIMethods' | 'setScrambleKey'>; | ||
@@ -24,11 +25,2 @@ export declare enum DerivationType { | ||
} | ||
/** | ||
* @category Error | ||
* @description Error that indicates an invalid derivation path being passed or used | ||
*/ | ||
export declare class InvalidDerivationPathError extends Error { | ||
derivationPath: string; | ||
name: string; | ||
constructor(derivationPath: string); | ||
} | ||
export declare const HDPathTemplate: (account: number) => string; | ||
@@ -35,0 +27,0 @@ export { VERSION } from './version'; |
{ | ||
"name": "@taquito/ledger-signer", | ||
"version": "16.1.2", | ||
"version": "16.2.0-beta-RC.0", | ||
"description": "Ledger signer provider", | ||
@@ -63,4 +63,4 @@ "keywords": [ | ||
"@stablelib/blake2b": "^1.0.1", | ||
"@taquito/taquito": "^16.1.2", | ||
"@taquito/utils": "^16.1.2", | ||
"@taquito/taquito": "^16.2.0-beta-RC.0", | ||
"@taquito/utils": "^16.2.0-beta-RC.0", | ||
"buffer": "^6.0.3" | ||
@@ -97,3 +97,3 @@ }, | ||
}, | ||
"gitHead": "f44e0fa20e017142543cf0ad49fc8220021f6d1c" | ||
"gitHead": "a909a1e61a626eb5a2e9ad269a80a96aceff4e28" | ||
} |
@@ -8,3 +8,3 @@ /** | ||
import Transport from '@ledgerhq/hw-transport'; | ||
import { b58cencode, prefix, Prefix, ProhibitedActionError } from '@taquito/utils'; | ||
import { b58cencode, prefix, Prefix } from '@taquito/utils'; | ||
import { | ||
@@ -24,3 +24,6 @@ appendWatermark, | ||
} from './error'; | ||
import { InvalidDerivationPathError, ProhibitedActionError } from '@taquito/core'; | ||
export { InvalidDerivationPathError } from '@taquito/core'; | ||
export type LedgerTransport = Pick<Transport, 'send' | 'decorateAppAPIMethods' | 'setScrambleKey'>; | ||
@@ -48,15 +51,2 @@ | ||
/** | ||
* @category Error | ||
* @description Error that indicates an invalid derivation path being passed or used | ||
*/ | ||
export class InvalidDerivationPathError extends Error { | ||
public name = 'InvalidDerivationPathError'; | ||
constructor(public derivationPath: string) { | ||
super( | ||
`The derivation path ${derivationPath} is invalid. The derivation path must start with 44'/1729` | ||
); | ||
} | ||
} | ||
export const HDPathTemplate = (account: number) => { | ||
@@ -117,4 +107,4 @@ return `44'/1729'/${account}'/0'`; | ||
this.transport.setScrambleKey('XTZ'); | ||
if (!path.startsWith("44'/1729'")) { | ||
throw new InvalidDerivationPathError(path); | ||
if (!path.startsWith(`44'/1729'`)) { | ||
throw new InvalidDerivationPathError(path, `: Invalid prefix expecting prefix "44'/1729'".`); | ||
} | ||
@@ -121,0 +111,0 @@ if (!Object.values(DerivationType).includes(derivationType)) { |
// IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN! | ||
export const VERSION = { | ||
commitHash: 'bcc2118ddfafc1995fd125cd74d198fda042bf48', | ||
version: '16.1.2', | ||
commitHash: 'babcbaf464fd3571a3b88cf7023fefe87809d86d', | ||
version: '16.2.0-beta-RC.0', | ||
}; |
@@ -31,3 +31,5 @@ import { LedgerSigner, DerivationType, HDPathTemplate } from '../src/taquito-ledger-signer'; | ||
new LedgerSigner(mockTransport, "4'/1729'/0'/0'", true, DerivationType.SECP256K1); | ||
}).toThrow("The derivation path 4'/1729'/0'/0' is invalid"); | ||
}).toThrow( | ||
`Invalid derivation path "4'/1729'/0'/0'": Invalid prefix expecting prefix "44'/1729'".` | ||
); | ||
}); | ||
@@ -34,0 +36,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
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
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
315208
2944
2