@cardano-sdk/key-management 0.10.3 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/InMemoryKeyAgent.d.ts.map +1 -1
- package/dist/cjs/InMemoryKeyAgent.js +11 -10
- package/dist/cjs/InMemoryKeyAgent.js.map +1 -1
- package/dist/cjs/TrezorKeyAgent.d.ts +5 -8
- package/dist/cjs/TrezorKeyAgent.d.ts.map +1 -1
- package/dist/cjs/TrezorKeyAgent.js +10 -150
- package/dist/cjs/TrezorKeyAgent.js.map +1 -1
- package/dist/cjs/cip8/cip30signData.d.ts +1 -1
- package/dist/cjs/cip8/cip30signData.d.ts.map +1 -1
- package/dist/cjs/cip8/cip30signData.js +6 -0
- package/dist/cjs/cip8/cip30signData.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/cjs/util/index.d.ts +0 -1
- package/dist/cjs/util/index.d.ts.map +1 -1
- package/dist/cjs/util/index.js +0 -1
- package/dist/cjs/util/index.js.map +1 -1
- package/dist/cjs/util/ownSignatureKeyPaths.d.ts +23 -1
- package/dist/cjs/util/ownSignatureKeyPaths.d.ts.map +1 -1
- package/dist/cjs/util/ownSignatureKeyPaths.js +186 -46
- package/dist/cjs/util/ownSignatureKeyPaths.js.map +1 -1
- package/dist/cjs/util/stubSignTransaction.d.ts +10 -1
- package/dist/cjs/util/stubSignTransaction.d.ts.map +1 -1
- package/dist/cjs/util/stubSignTransaction.js +4 -2
- package/dist/cjs/util/stubSignTransaction.js.map +1 -1
- package/dist/esm/InMemoryKeyAgent.d.ts.map +1 -1
- package/dist/esm/InMemoryKeyAgent.js +3 -2
- package/dist/esm/InMemoryKeyAgent.js.map +1 -1
- package/dist/esm/TrezorKeyAgent.d.ts +5 -8
- package/dist/esm/TrezorKeyAgent.d.ts.map +1 -1
- package/dist/esm/TrezorKeyAgent.js +11 -125
- package/dist/esm/TrezorKeyAgent.js.map +1 -1
- package/dist/esm/cip8/cip30signData.d.ts +1 -1
- package/dist/esm/cip8/cip30signData.d.ts.map +1 -1
- package/dist/esm/cip8/cip30signData.js +7 -1
- package/dist/esm/cip8/cip30signData.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/util/index.d.ts +0 -1
- package/dist/esm/util/index.d.ts.map +1 -1
- package/dist/esm/util/index.js +0 -1
- package/dist/esm/util/index.js.map +1 -1
- package/dist/esm/util/ownSignatureKeyPaths.d.ts +23 -1
- package/dist/esm/util/ownSignatureKeyPaths.d.ts.map +1 -1
- package/dist/esm/util/ownSignatureKeyPaths.js +182 -45
- package/dist/esm/util/ownSignatureKeyPaths.js.map +1 -1
- package/dist/esm/util/stubSignTransaction.d.ts +10 -1
- package/dist/esm/util/stubSignTransaction.d.ts.map +1 -1
- package/dist/esm/util/stubSignTransaction.js +4 -2
- package/dist/esm/util/stubSignTransaction.js.map +1 -1
- package/package.json +7 -8
- package/dist/cjs/util/mapHardwareSigningData.d.ts +0 -37
- package/dist/cjs/util/mapHardwareSigningData.d.ts.map +0 -1
- package/dist/cjs/util/mapHardwareSigningData.js +0 -885
- package/dist/cjs/util/mapHardwareSigningData.js.map +0 -1
- package/dist/esm/util/mapHardwareSigningData.d.ts +0 -37
- package/dist/esm/util/mapHardwareSigningData.d.ts.map +0 -1
- package/dist/esm/util/mapHardwareSigningData.js +0 -854
- package/dist/esm/util/mapHardwareSigningData.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InMemoryKeyAgent.d.ts","sourceRoot":"","sources":["../../src/InMemoryKeyAgent.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EACL,wBAAwB,EACxB,aAAa,EACb,QAAQ,EACR,oBAAoB,EAEpB,OAAO,EACP,gCAAgC,EAChC,cAAc,EACd,sBAAsB,EACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EA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EAAE,oBAAoB,GACjC,OAAO,CAAC,gBAAgB,CAAC;IA6BtB,eAAe,CACnB,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,cAAc,EACtC,EAAE,kBAAuB,EAAE,GAAE,sBAAsB,GAAG,SAAc,GACnE,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;IAyBxB,qBAAqB,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAwBxE"}
|
|
@@ -42,9 +42,9 @@ exports.InMemoryKeyAgent = void 0;
|
|
|
42
42
|
const Crypto = __importStar(require("@cardano-sdk/crypto"));
|
|
43
43
|
const errors = __importStar(require("./errors"));
|
|
44
44
|
const types_1 = require("./types");
|
|
45
|
-
const util_1 = require("
|
|
45
|
+
const util_1 = require("./util");
|
|
46
|
+
const util_2 = require("@cardano-sdk/util");
|
|
46
47
|
const KeyAgentBase_1 = require("./KeyAgentBase");
|
|
47
|
-
const util_2 = require("./util");
|
|
48
48
|
const emip3_1 = require("./emip3");
|
|
49
49
|
const uniqBy_1 = __importDefault(require("lodash/uniqBy"));
|
|
50
50
|
const getPassphraseRethrowTypedError = async (getPassphrase) => {
|
|
@@ -64,7 +64,7 @@ class InMemoryKeyAgent extends KeyAgentBase_1.KeyAgentBase {
|
|
|
64
64
|
}
|
|
65
65
|
async signBlob({ index, role: type }, blob) {
|
|
66
66
|
const rootPrivateKey = await __classPrivateFieldGet(this, _InMemoryKeyAgent_instances, "m", _InMemoryKeyAgent_decryptRootPrivateKey).call(this);
|
|
67
|
-
const accountKey = await (0,
|
|
67
|
+
const accountKey = await (0, util_1.deriveAccountPrivateKey)({
|
|
68
68
|
accountIndex: this.accountIndex,
|
|
69
69
|
bip32Ed25519: this.bip32Ed25519,
|
|
70
70
|
rootPrivateKey
|
|
@@ -79,15 +79,15 @@ class InMemoryKeyAgent extends KeyAgentBase_1.KeyAgentBase {
|
|
|
79
79
|
return await __classPrivateFieldGet(this, _InMemoryKeyAgent_instances, "m", _InMemoryKeyAgent_decryptRootPrivateKey).call(this, true);
|
|
80
80
|
}
|
|
81
81
|
static async fromBip39MnemonicWords({ chainId, getPassphrase, mnemonicWords, mnemonic2ndFactorPassphrase = '', accountIndex = 0 }, dependencies) {
|
|
82
|
-
const mnemonic = (0,
|
|
83
|
-
const validMnemonic = (0,
|
|
82
|
+
const mnemonic = (0, util_1.joinMnemonicWords)(mnemonicWords);
|
|
83
|
+
const validMnemonic = (0, util_1.validateMnemonic)(mnemonic);
|
|
84
84
|
if (!validMnemonic)
|
|
85
85
|
throw new errors.InvalidMnemonicError();
|
|
86
|
-
const entropy = Buffer.from((0,
|
|
86
|
+
const entropy = Buffer.from((0, util_1.mnemonicWordsToEntropy)(mnemonicWords), 'hex');
|
|
87
87
|
const rootPrivateKey = await dependencies.bip32Ed25519.fromBip39Entropy(entropy, mnemonic2ndFactorPassphrase);
|
|
88
88
|
const passphrase = await getPassphraseRethrowTypedError(getPassphrase);
|
|
89
89
|
const encryptedRootPrivateKey = await (0, emip3_1.emip3encrypt)(Buffer.from(rootPrivateKey, 'hex'), passphrase);
|
|
90
|
-
const accountPrivateKey = await (0,
|
|
90
|
+
const accountPrivateKey = await (0, util_1.deriveAccountPrivateKey)({
|
|
91
91
|
accountIndex,
|
|
92
92
|
bip32Ed25519: dependencies.bip32Ed25519,
|
|
93
93
|
rootPrivateKey
|
|
@@ -103,8 +103,9 @@ class InMemoryKeyAgent extends KeyAgentBase_1.KeyAgentBase {
|
|
|
103
103
|
}, dependencies);
|
|
104
104
|
}
|
|
105
105
|
async signTransaction({ body, hash }, { additionalKeyPaths = [] } = {}) {
|
|
106
|
-
const blob = (0,
|
|
107
|
-
const
|
|
106
|
+
const blob = (0, util_2.HexBlob)(hash);
|
|
107
|
+
const dRepKeyHash = (await Crypto.Ed25519PublicKey.fromHex(await this.derivePublicKey(util_1.DREP_KEY_DERIVATION_PATH)).hash()).hex();
|
|
108
|
+
const derivationPaths = await (0, util_1.ownSignatureKeyPaths)(body, this.knownAddresses, this.inputResolver, dRepKeyHash);
|
|
108
109
|
const keyPaths = (0, uniqBy_1.default)([...derivationPaths, ...additionalKeyPaths], ({ role, index }) => `${role}.${index}`);
|
|
109
110
|
return new Map(await Promise.all(keyPaths.map(async ({ role, index }) => {
|
|
110
111
|
const { publicKey, signature } = await this.signBlob({ index, role }, blob);
|
|
@@ -113,7 +114,7 @@ class InMemoryKeyAgent extends KeyAgentBase_1.KeyAgentBase {
|
|
|
113
114
|
}
|
|
114
115
|
async exportExtendedKeyPair(derivationPath) {
|
|
115
116
|
const rootPrivateKey = await this.exportRootPrivateKey();
|
|
116
|
-
const hardenedIndices = derivationPath.map((index) => (0,
|
|
117
|
+
const hardenedIndices = derivationPath.map((index) => (0, util_1.harden)(index));
|
|
117
118
|
const childKey = await this.bip32Ed25519.derivePrivateKey(rootPrivateKey, hardenedIndices);
|
|
118
119
|
return {
|
|
119
120
|
skey: childKey,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InMemoryKeyAgent.js","sourceRoot":"","sources":["../../src/InMemoryKeyAgent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA8C;AAC9C,iDAAmC;AACnC,mCAUiB;AAEjB,4CAA4C;AAC5C,iDAA8C;AAC9C,
|
|
1
|
+
{"version":3,"file":"InMemoryKeyAgent.js","sourceRoot":"","sources":["../../src/InMemoryKeyAgent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA8C;AAC9C,iDAAmC;AACnC,mCAUiB;AAEjB,iCAQgB;AAChB,4CAA4C;AAC5C,iDAA8C;AAC9C,mCAAqD;AACrD,2DAAmC;AAcnC,MAAM,8BAA8B,GAAG,KAAK,EAAE,aAA4B,EAAE,EAAE;IAC5E,IAAI;QACF,OAAO,MAAM,aAAa,EAAE,CAAC;KAC9B;IAAC,OAAO,KAAK,EAAE;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AM,QAAQ,GAAG,MAAM,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,cAAc,EAAE,eAAe,CAAC,CAAC;QAE3F,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,iBAAiB,CAAC,QAAQ,CAAC;SAC1D,CAAC;IACJ,CAAC;CAeF;AA9HD,4CA8HC;wIAbC,KAAK,kDAAwB,OAAc;IACzC,MAAM,UAAU,GAAG,MAAM,8BAA8B,CAAC,GAAG,EAAE,CAAC,uBAAA,IAAI,uCAAe,MAAnB,IAAI,EAAgB,OAAO,CAAC,CAAC,CAAC;IAC5F,IAAI,qBAAiC,CAAC;IACtC,IAAI;QACF,qBAAqB,GAAG,MAAM,IAAA,oBAAY,EACxC,IAAI,UAAU,CAAE,IAAI,CAAC,gBAAqD,CAAC,4BAA4B,CAAC,EACxG,UAAU,CACX,CAAC;KACH;IAAC,OAAO,KAAK,EAAE;QACd,MAAM,IAAI,MAAM,CAAC,mBAAmB,CAAC,oCAAoC,EAAE,KAAK,CAAC,CAAC;KACnF;IACD,OAAO,MAAM,CAAC,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;AACvF,CAAC"}
|
|
@@ -18,14 +18,11 @@ export interface CreateTrezorKeyAgentProps {
|
|
|
18
18
|
}
|
|
19
19
|
export declare type TrezorConnectInstanceType = typeof TrezorConnectNode | typeof TrezorConnectWeb;
|
|
20
20
|
export declare class TrezorKeyAgent extends KeyAgentBase {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
static
|
|
25
|
-
|
|
26
|
-
static getXpub({ accountIndex, communicationType }: GetTrezorXpubProps): Promise<Crypto.Bip32PublicKeyHex>;
|
|
27
|
-
static createWithDevice({ chainId, accountIndex, trezorConfig }: CreateTrezorKeyAgentProps, dependencies: KeyAgentDependencies): Promise<TrezorKeyAgent>;
|
|
28
|
-
signTransaction({ body }: Cardano.TxBodyWithHash): Promise<Cardano.Signatures>;
|
|
21
|
+
static initializeTrezorTransport(__config: TrezorConfig): Promise<boolean>;
|
|
22
|
+
static checkDeviceConnection(_communicationType: CommunicationType): Promise<Features>;
|
|
23
|
+
static getXpub(_props: GetTrezorXpubProps): Promise<Crypto.Bip32PublicKeyHex>;
|
|
24
|
+
static createWithDevice(_props: CreateTrezorKeyAgentProps, _dependencies: KeyAgentDependencies): Promise<TrezorKeyAgent>;
|
|
25
|
+
signTransaction(_body: Cardano.TxBodyWithHash): Promise<Cardano.Signatures>;
|
|
29
26
|
signBlob(): Promise<SignBlobResult>;
|
|
30
27
|
exportRootPrivateKey(): Promise<Crypto.Bip32PrivateKeyHex>;
|
|
31
28
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrezorKeyAgent.d.ts","sourceRoot":"","sources":["../../src/TrezorKeyAgent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"TrezorKeyAgent.d.ts","sourceRoot":"","sources":["../../src/TrezorKeyAgent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAuB,MAAM,mBAAmB,CAAC;AACjE,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,8BAA8B,EAC9B,cAAc,EACd,YAAY,EACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,iBAAiB,EAAE,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC9D,OAAO,gBAAgB,MAAM,qBAAqB,CAAC;AAEnD,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,8BAA8B,EAAE,YAAY,CAAC;IAC7F,mBAAmB,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB,EAAE,iBAAiB,CAAC;CACtC;AAED,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,YAAY,CAAC;CAC5B;AAED,oBAAY,yBAAyB,GAAG,OAAO,iBAAiB,GAAG,OAAO,gBAAgB,CAAC;AAE3F,qBAAa,cAAe,SAAQ,YAAY;WACjC,yBAAyB,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC;WAInE,qBAAqB,CAAC,kBAAkB,EAAE,iBAAiB,GAAG,OAAO,CAAC,QAAQ,CAAC;WAI/E,OAAO,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC;WAItE,gBAAgB,CAC3B,MAAM,EAAE,yBAAyB,EACjC,aAAa,EAAE,oBAAoB,GAClC,OAAO,CAAC,cAAc,CAAC;IAIpB,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;IAI3E,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC;IAInC,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC;CAGjE"}
|
|
@@ -1,162 +1,23 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
26
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
27
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
28
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
29
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
30
|
-
};
|
|
31
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
32
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
33
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
34
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
35
|
-
};
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
|
-
var _TrezorKeyAgent_communicationType;
|
|
40
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
3
|
exports.TrezorKeyAgent = void 0;
|
|
42
|
-
const Crypto = __importStar(require("@cardano-sdk/crypto"));
|
|
43
|
-
const errors_1 = require("./errors");
|
|
44
4
|
const core_1 = require("@cardano-sdk/core");
|
|
45
|
-
const types_1 = require("./types");
|
|
46
5
|
const KeyAgentBase_1 = require("./KeyAgentBase");
|
|
47
|
-
const util_1 = require("@cardano-sdk/util");
|
|
48
|
-
const util_2 = require("./util");
|
|
49
|
-
const connect_1 = __importDefault(require("@trezor/connect"));
|
|
50
|
-
const connect_web_1 = __importDefault(require("@trezor/connect-web"));
|
|
51
|
-
const getTrezorConnect = (communicationType) => communicationType === types_1.CommunicationType.Node ? connect_1.default : connect_web_1.default;
|
|
52
|
-
const transportTypedError = (error) => new errors_1.AuthenticationError('Trezor transport failed', new errors_1.TransportError('Trezor transport failed', error));
|
|
53
6
|
class TrezorKeyAgent extends KeyAgentBase_1.KeyAgentBase {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
_TrezorKeyAgent_communicationType.set(this, void 0);
|
|
57
|
-
if (!isTrezorInitialized) {
|
|
58
|
-
this.isTrezorInitialized = TrezorKeyAgent.initializeTrezorTransport(serializableData.trezorConfig);
|
|
59
|
-
}
|
|
60
|
-
__classPrivateFieldSet(this, _TrezorKeyAgent_communicationType, serializableData.trezorConfig.communicationType, "f");
|
|
61
|
-
}
|
|
62
|
-
static async initializeTrezorTransport({ manifest, communicationType, silentMode = false, lazyLoad = false }) {
|
|
63
|
-
const trezorConnect = getTrezorConnect(communicationType);
|
|
64
|
-
try {
|
|
65
|
-
await trezorConnect.init({
|
|
66
|
-
lazyLoad: communicationType !== types_1.CommunicationType.Node && lazyLoad,
|
|
67
|
-
manifest,
|
|
68
|
-
popup: communicationType !== types_1.CommunicationType.Node && !silentMode
|
|
69
|
-
});
|
|
70
|
-
return true;
|
|
71
|
-
}
|
|
72
|
-
catch (error) {
|
|
73
|
-
if (error.code === 'Init_AlreadyInitialized')
|
|
74
|
-
return true;
|
|
75
|
-
throw transportTypedError(error);
|
|
76
|
-
}
|
|
7
|
+
static async initializeTrezorTransport(__config) {
|
|
8
|
+
throw new core_1.NotImplementedError('initializeTrezorTransport');
|
|
77
9
|
}
|
|
78
|
-
static async checkDeviceConnection(
|
|
79
|
-
|
|
80
|
-
try {
|
|
81
|
-
const deviceFeatures = await trezorConnect.getFeatures();
|
|
82
|
-
if (!deviceFeatures.success) {
|
|
83
|
-
throw new errors_1.TransportError('Failed to get device', deviceFeatures.payload);
|
|
84
|
-
}
|
|
85
|
-
if (deviceFeatures.payload.model !== 'T') {
|
|
86
|
-
throw new errors_1.TransportError(`Trezor device model "${deviceFeatures.payload.model}" is not supported.`);
|
|
87
|
-
}
|
|
88
|
-
return deviceFeatures.payload;
|
|
89
|
-
}
|
|
90
|
-
catch (error) {
|
|
91
|
-
throw transportTypedError(error);
|
|
92
|
-
}
|
|
10
|
+
static async checkDeviceConnection(_communicationType) {
|
|
11
|
+
throw new core_1.NotImplementedError('checkDeviceConnection');
|
|
93
12
|
}
|
|
94
|
-
static async getXpub(
|
|
95
|
-
|
|
96
|
-
await TrezorKeyAgent.checkDeviceConnection(communicationType);
|
|
97
|
-
const derivationPath = `m/${types_1.CardanoKeyConst.PURPOSE}'/${types_1.CardanoKeyConst.COIN_TYPE}'/${accountIndex}'`;
|
|
98
|
-
const trezorConnect = getTrezorConnect(communicationType);
|
|
99
|
-
const extendedPublicKey = await trezorConnect.cardanoGetPublicKey({
|
|
100
|
-
path: derivationPath,
|
|
101
|
-
showOnTrezor: true
|
|
102
|
-
});
|
|
103
|
-
if (!extendedPublicKey.success) {
|
|
104
|
-
throw new errors_1.TransportError('Failed to export extended account public key', extendedPublicKey.payload);
|
|
105
|
-
}
|
|
106
|
-
return Crypto.Bip32PublicKeyHex(extendedPublicKey.payload.publicKey);
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
throw transportTypedError(error);
|
|
110
|
-
}
|
|
13
|
+
static async getXpub(_props) {
|
|
14
|
+
throw new core_1.NotImplementedError('getXpub');
|
|
111
15
|
}
|
|
112
|
-
static async createWithDevice(
|
|
113
|
-
|
|
114
|
-
const extendedAccountPublicKey = await TrezorKeyAgent.getXpub({
|
|
115
|
-
accountIndex,
|
|
116
|
-
communicationType: trezorConfig.communicationType
|
|
117
|
-
});
|
|
118
|
-
return new TrezorKeyAgent({
|
|
119
|
-
accountIndex,
|
|
120
|
-
chainId,
|
|
121
|
-
extendedAccountPublicKey,
|
|
122
|
-
isTrezorInitialized,
|
|
123
|
-
knownAddresses: [],
|
|
124
|
-
trezorConfig
|
|
125
|
-
}, dependencies);
|
|
16
|
+
static async createWithDevice(_props, _dependencies) {
|
|
17
|
+
throw new core_1.NotImplementedError('createWithDevice');
|
|
126
18
|
}
|
|
127
|
-
async signTransaction(
|
|
128
|
-
|
|
129
|
-
try {
|
|
130
|
-
await this.isTrezorInitialized;
|
|
131
|
-
const cslTxBody = core_1.coreToCml.txBody(scope, body);
|
|
132
|
-
const trezorTxData = await (0, util_2.txToTrezor)({
|
|
133
|
-
accountIndex: this.accountIndex,
|
|
134
|
-
chainId: this.chainId,
|
|
135
|
-
cslTxBody,
|
|
136
|
-
inputResolver: this.inputResolver,
|
|
137
|
-
knownAddresses: this.knownAddresses
|
|
138
|
-
});
|
|
139
|
-
const trezorConnect = getTrezorConnect(__classPrivateFieldGet(this, _TrezorKeyAgent_communicationType, "f"));
|
|
140
|
-
const result = await trezorConnect.cardanoSignTransaction(trezorTxData);
|
|
141
|
-
if (!result.success) {
|
|
142
|
-
throw new errors_1.TransportError('Failed to export extended account public key', result.payload);
|
|
143
|
-
}
|
|
144
|
-
const signedData = result.payload;
|
|
145
|
-
return new Map(await Promise.all(signedData.witnesses.map(async (witness) => {
|
|
146
|
-
const publicKey = Crypto.Ed25519PublicKeyHex(witness.pubKey);
|
|
147
|
-
const signature = Crypto.Ed25519SignatureHex(witness.signature);
|
|
148
|
-
return [publicKey, signature];
|
|
149
|
-
})));
|
|
150
|
-
}
|
|
151
|
-
catch (error) {
|
|
152
|
-
if (error.innerError.code === 'Failure_ActionCancelled') {
|
|
153
|
-
throw new errors_1.AuthenticationError('Transaction signing aborted', error);
|
|
154
|
-
}
|
|
155
|
-
throw transportTypedError(error);
|
|
156
|
-
}
|
|
157
|
-
finally {
|
|
158
|
-
scope.dispose();
|
|
159
|
-
}
|
|
19
|
+
async signTransaction(_body) {
|
|
20
|
+
throw new core_1.NotImplementedError('signTransaction');
|
|
160
21
|
}
|
|
161
22
|
async signBlob() {
|
|
162
23
|
throw new core_1.NotImplementedError('signBlob');
|
|
@@ -166,5 +27,4 @@ class TrezorKeyAgent extends KeyAgentBase_1.KeyAgentBase {
|
|
|
166
27
|
}
|
|
167
28
|
}
|
|
168
29
|
exports.TrezorKeyAgent = TrezorKeyAgent;
|
|
169
|
-
_TrezorKeyAgent_communicationType = new WeakMap();
|
|
170
30
|
//# sourceMappingURL=TrezorKeyAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrezorKeyAgent.js","sourceRoot":"","sources":["../../src/TrezorKeyAgent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TrezorKeyAgent.js","sourceRoot":"","sources":["../../src/TrezorKeyAgent.ts"],"names":[],"mappings":";;;AAEA,4CAAiE;AAQjE,iDAA8C;AAqB9C,MAAa,cAAe,SAAQ,2BAAY;IAC9C,MAAM,CAAC,KAAK,CAAC,yBAAyB,CAAC,QAAsB;QAC3D,MAAM,IAAI,0BAAmB,CAAC,2BAA2B,CAAC,CAAC;IAC7D,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,qBAAqB,CAAC,kBAAqC;QACtE,MAAM,IAAI,0BAAmB,CAAC,uBAAuB,CAAC,CAAC;IACzD,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,OAAO,CAAC,MAA0B;QAC7C,MAAM,IAAI,0BAAmB,CAAC,SAAS,CAAC,CAAC;IAC3C,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAC3B,MAAiC,EACjC,aAAmC;QAEnC,MAAM,IAAI,0BAAmB,CAAC,kBAAkB,CAAC,CAAC;IACpD,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,KAA6B;QACjD,MAAM,IAAI,0BAAmB,CAAC,iBAAiB,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,QAAQ;QACZ,MAAM,IAAI,0BAAmB,CAAC,UAAU,CAAC,CAAC;IAC5C,CAAC;IAED,KAAK,CAAC,oBAAoB;QACxB,MAAM,IAAI,0BAAmB,CAAC,0BAA0B,CAAC,CAAC;IAC5D,CAAC;CACF;AA/BD,wCA+BC"}
|
|
@@ -4,7 +4,7 @@ import { Cip30DataSignature } from '@cardano-sdk/dapp-connector';
|
|
|
4
4
|
import { ComposableError, HexBlob } from '@cardano-sdk/util';
|
|
5
5
|
export interface Cip30SignDataRequest {
|
|
6
6
|
keyAgent: AsyncKeyAgent;
|
|
7
|
-
signWith: Cardano.PaymentAddress | Cardano.RewardAccount;
|
|
7
|
+
signWith: Cardano.PaymentAddress | Cardano.RewardAccount | Cardano.DRepID;
|
|
8
8
|
payload: HexBlob;
|
|
9
9
|
}
|
|
10
10
|
export declare enum Cip30DataSignErrorCode {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cip30signData.d.ts","sourceRoot":"","sources":["../../../src/cip8/cip30signData.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAW,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,OAAO,EAAQ,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAK7D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"cip30signData.d.ts","sourceRoot":"","sources":["../../../src/cip8/cip30signData.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,aAAa,EAAW,MAAM,UAAU,CAAC;AAClD,OAAO,EAAE,OAAO,EAAQ,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAK7D,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAC1E,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,oBAAY,sBAAsB;IAChC,eAAe,IAAI;IACnB,YAAY,IAAI;IAChB,YAAY,IAAI;CACjB;AAED,qBAAa,kBAAkB,CAAC,UAAU,GAAG,OAAO,CAAE,SAAQ,eAAe,CAAC,UAAU,CAAC;aAC3D,IAAI,EAAE,sBAAsB;aAAkB,IAAI,EAAE,MAAM;gBAA1D,IAAI,EAAE,sBAAsB,EAAkB,IAAI,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,UAAU;CAGhH;AA+ED,eAAO,MAAM,aAAa,oCAIvB,oBAAoB,KAAG,QAAQ,kBAAkB,CAsBnD,CAAC"}
|
|
@@ -29,6 +29,9 @@ const getAddressBytes = (signWith) => {
|
|
|
29
29
|
return Buffer.from(address.toBytes(), 'hex');
|
|
30
30
|
};
|
|
31
31
|
const getDerivationPath = async (signWith, keyAgent) => {
|
|
32
|
+
if (core_1.Cardano.DRepID.isValid(signWith)) {
|
|
33
|
+
return util_3.DREP_KEY_DERIVATION_PATH;
|
|
34
|
+
}
|
|
32
35
|
const isRewardAccount = signWith.startsWith('stake');
|
|
33
36
|
const knownAddresses = await (0, rxjs_1.firstValueFrom)(keyAgent.knownAddresses$.pipe((0, rxjs_1.filter)((addresses) => addresses.length > 0)));
|
|
34
37
|
if (isRewardAccount) {
|
|
@@ -67,6 +70,9 @@ const createCoseKey = (addressBytes, publicKey) => {
|
|
|
67
70
|
return coseKey;
|
|
68
71
|
};
|
|
69
72
|
const cip30signData = async ({ keyAgent, signWith, payload }) => {
|
|
73
|
+
if (core_1.Cardano.DRepID.isValid(signWith) && !core_1.Cardano.DRepID.canSign(signWith)) {
|
|
74
|
+
throw new Cip30DataSignError(Cip30DataSignErrorCode.AddressNotPK, 'Invalid address');
|
|
75
|
+
}
|
|
70
76
|
const addressBytes = getAddressBytes(signWith);
|
|
71
77
|
const derivationPath = await getDerivationPath(signWith, keyAgent);
|
|
72
78
|
const builder = cardano_message_signing_nodejs_1.COSESign1Builder.new(cardano_message_signing_nodejs_1.Headers.new(cardano_message_signing_nodejs_1.ProtectedHeaderMap.new(createSigStructureHeaders(addressBytes)), cardano_message_signing_nodejs_1.HeaderMap.new()), Buffer.from(payload, 'hex'), false);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cip30signData.js","sourceRoot":"","sources":["../../../src/cip8/cip30signData.ts"],"names":[],"mappings":";;;AAEA,2FAYgD;AAEhD,4CAAkD;AAElD,4CAA6D;AAC7D,iCAAmC;AACnC,
|
|
1
|
+
{"version":3,"file":"cip30signData.js","sourceRoot":"","sources":["../../../src/cip8/cip30signData.ts"],"names":[],"mappings":";;;AAEA,2FAYgD;AAEhD,4CAAkD;AAElD,4CAA6D;AAC7D,iCAAmC;AACnC,kCAA8E;AAC9E,+BAA8C;AAQ9C,IAAY,sBAIX;AAJD,WAAY,sBAAsB;IAChC,yFAAmB,CAAA;IACnB,mFAAgB,CAAA;IAChB,mFAAgB,CAAA;AAClB,CAAC,EAJW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAIjC;AAED,MAAa,kBAAyC,SAAQ,sBAA2B;IACvF,YAA4B,IAA4B,EAAkB,IAAY,EAAE,UA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