@cardano-sdk/key-management 0.3.1-nightly.3 → 0.4.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 +10 -8
- package/dist/cjs/InMemoryKeyAgent.d.ts.map +1 -1
- package/dist/cjs/InMemoryKeyAgent.js +38 -38
- package/dist/cjs/InMemoryKeyAgent.js.map +1 -1
- package/dist/cjs/KeyAgentBase.d.ts +9 -7
- package/dist/cjs/KeyAgentBase.d.ts.map +1 -1
- package/dist/cjs/KeyAgentBase.js +35 -25
- package/dist/cjs/KeyAgentBase.js.map +1 -1
- package/dist/cjs/LedgerKeyAgent.d.ts +4 -3
- package/dist/cjs/LedgerKeyAgent.d.ts.map +1 -1
- package/dist/cjs/LedgerKeyAgent.js +7 -3
- package/dist/cjs/LedgerKeyAgent.js.map +1 -1
- package/dist/cjs/TrezorKeyAgent.d.ts +3 -2
- package/dist/cjs/TrezorKeyAgent.d.ts.map +1 -1
- package/dist/cjs/TrezorKeyAgent.js +27 -3
- package/dist/cjs/TrezorKeyAgent.js.map +1 -1
- package/dist/cjs/cip8/cip30signData.d.ts +3 -2
- package/dist/cjs/cip8/cip30signData.d.ts.map +1 -1
- package/dist/cjs/cip8/cip30signData.js +9 -9
- package/dist/cjs/cip8/cip30signData.js.map +1 -1
- package/dist/cjs/cip8/types.d.ts +3 -3
- package/dist/cjs/cip8/types.d.ts.map +1 -1
- package/dist/cjs/emip3.d.ts +3 -3
- package/dist/cjs/emip3.d.ts.map +1 -1
- package/dist/cjs/emip3.js +5 -5
- package/dist/cjs/emip3.js.map +1 -1
- package/dist/cjs/errors/AuthenticationError.d.ts +1 -1
- package/dist/cjs/errors/AuthenticationError.js +2 -2
- package/dist/cjs/errors/HwMappingError.d.ts +1 -1
- package/dist/cjs/errors/HwMappingError.js +2 -2
- package/dist/cjs/errors/ProofGenerationError.d.ts +1 -1
- package/dist/cjs/errors/ProofGenerationError.js +2 -2
- package/dist/cjs/errors/TransportError.d.ts +1 -1
- package/dist/cjs/errors/TransportError.js +2 -2
- package/dist/cjs/restoreKeyAgent.d.ts +4 -4
- package/dist/cjs/restoreKeyAgent.d.ts.map +1 -1
- package/dist/cjs/restoreKeyAgent.js +4 -4
- package/dist/cjs/restoreKeyAgent.js.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/cjs/types.d.ts +20 -17
- package/dist/cjs/types.d.ts.map +1 -1
- package/dist/cjs/types.js.map +1 -1
- package/dist/cjs/util/createAsyncKeyAgent.d.ts.map +1 -1
- package/dist/cjs/util/createAsyncKeyAgent.js +1 -0
- package/dist/cjs/util/createAsyncKeyAgent.js.map +1 -1
- package/dist/cjs/util/key.d.ts +5 -4
- package/dist/cjs/util/key.d.ts.map +1 -1
- package/dist/cjs/util/key.js +9 -17
- package/dist/cjs/util/key.js.map +1 -1
- package/dist/cjs/util/mapHardwareSigningData.d.ts +2 -1
- package/dist/cjs/util/mapHardwareSigningData.d.ts.map +1 -1
- package/dist/cjs/util/mapHardwareSigningData.js +3 -3
- package/dist/cjs/util/mapHardwareSigningData.js.map +1 -1
- package/dist/cjs/util/ownSignatureKeyPaths.js +1 -1
- package/dist/cjs/util/ownSignatureKeyPaths.js.map +1 -1
- package/dist/cjs/util/stubSignTransaction.d.ts.map +1 -1
- package/dist/cjs/util/stubSignTransaction.js +26 -3
- package/dist/cjs/util/stubSignTransaction.js.map +1 -1
- package/dist/esm/InMemoryKeyAgent.d.ts +10 -8
- package/dist/esm/InMemoryKeyAgent.d.ts.map +1 -1
- package/dist/esm/InMemoryKeyAgent.js +33 -33
- package/dist/esm/InMemoryKeyAgent.js.map +1 -1
- package/dist/esm/KeyAgentBase.d.ts +9 -7
- package/dist/esm/KeyAgentBase.d.ts.map +1 -1
- package/dist/esm/KeyAgentBase.js +35 -25
- package/dist/esm/KeyAgentBase.js.map +1 -1
- package/dist/esm/LedgerKeyAgent.d.ts +4 -3
- package/dist/esm/LedgerKeyAgent.d.ts.map +1 -1
- package/dist/esm/LedgerKeyAgent.js +9 -5
- package/dist/esm/LedgerKeyAgent.js.map +1 -1
- package/dist/esm/TrezorKeyAgent.d.ts +3 -2
- package/dist/esm/TrezorKeyAgent.d.ts.map +1 -1
- package/dist/esm/TrezorKeyAgent.js +5 -4
- package/dist/esm/TrezorKeyAgent.js.map +1 -1
- package/dist/esm/cip8/cip30signData.d.ts +3 -2
- package/dist/esm/cip8/cip30signData.d.ts.map +1 -1
- package/dist/esm/cip8/cip30signData.js +2 -2
- package/dist/esm/cip8/cip30signData.js.map +1 -1
- package/dist/esm/cip8/types.d.ts +3 -3
- package/dist/esm/cip8/types.d.ts.map +1 -1
- package/dist/esm/emip3.d.ts +3 -3
- package/dist/esm/emip3.d.ts.map +1 -1
- package/dist/esm/emip3.js +5 -5
- package/dist/esm/emip3.js.map +1 -1
- package/dist/esm/errors/AuthenticationError.d.ts +1 -1
- package/dist/esm/errors/AuthenticationError.js +1 -1
- package/dist/esm/errors/HwMappingError.d.ts +1 -1
- package/dist/esm/errors/HwMappingError.js +1 -1
- package/dist/esm/errors/ProofGenerationError.d.ts +1 -1
- package/dist/esm/errors/ProofGenerationError.js +1 -1
- package/dist/esm/errors/TransportError.d.ts +1 -1
- package/dist/esm/errors/TransportError.js +1 -1
- package/dist/esm/restoreKeyAgent.d.ts +4 -4
- package/dist/esm/restoreKeyAgent.d.ts.map +1 -1
- package/dist/esm/restoreKeyAgent.js +4 -4
- package/dist/esm/restoreKeyAgent.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/types.d.ts +20 -17
- package/dist/esm/types.d.ts.map +1 -1
- package/dist/esm/types.js.map +1 -1
- package/dist/esm/util/createAsyncKeyAgent.d.ts.map +1 -1
- package/dist/esm/util/createAsyncKeyAgent.js +1 -0
- package/dist/esm/util/createAsyncKeyAgent.js.map +1 -1
- package/dist/esm/util/key.d.ts +5 -4
- package/dist/esm/util/key.d.ts.map +1 -1
- package/dist/esm/util/key.js +9 -17
- package/dist/esm/util/key.js.map +1 -1
- package/dist/esm/util/mapHardwareSigningData.d.ts +2 -1
- package/dist/esm/util/mapHardwareSigningData.d.ts.map +1 -1
- package/dist/esm/util/mapHardwareSigningData.js +3 -3
- package/dist/esm/util/mapHardwareSigningData.js.map +1 -1
- package/dist/esm/util/ownSignatureKeyPaths.js +1 -1
- package/dist/esm/util/ownSignatureKeyPaths.js.map +1 -1
- package/dist/esm/util/stubSignTransaction.d.ts.map +1 -1
- package/dist/esm/util/stubSignTransaction.js +3 -3
- package/dist/esm/util/stubSignTransaction.js.map +1 -1
- package/package.json +7 -5
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Crypto from '@cardano-sdk/crypto';
|
|
2
|
+
import { AccountKeyDerivationPath, GetPassphrase, KeyAgent, KeyAgentDependencies, KeyPair, SerializableInMemoryKeyAgentData, SignBlobResult, SignTransactionOptions } from './types';
|
|
2
3
|
import { Cardano } from '@cardano-sdk/core';
|
|
4
|
+
import { HexBlob } from '@cardano-sdk/util';
|
|
3
5
|
import { KeyAgentBase } from './KeyAgentBase';
|
|
4
6
|
export interface InMemoryKeyAgentProps extends Omit<SerializableInMemoryKeyAgentData, '__typename'> {
|
|
5
|
-
|
|
7
|
+
getPassphrase: GetPassphrase;
|
|
6
8
|
}
|
|
7
9
|
export interface FromBip39MnemonicWordsProps {
|
|
8
10
|
chainId: Cardano.ChainId;
|
|
9
11
|
mnemonicWords: string[];
|
|
10
|
-
mnemonic2ndFactorPassphrase?:
|
|
11
|
-
|
|
12
|
+
mnemonic2ndFactorPassphrase?: string;
|
|
13
|
+
getPassphrase: GetPassphrase;
|
|
12
14
|
accountIndex?: number;
|
|
13
15
|
}
|
|
14
16
|
export declare class InMemoryKeyAgent extends KeyAgentBase implements KeyAgent {
|
|
15
17
|
#private;
|
|
16
|
-
constructor({
|
|
17
|
-
signBlob({ index, role: type }: AccountKeyDerivationPath, blob:
|
|
18
|
-
exportRootPrivateKey(): Promise<
|
|
19
|
-
static fromBip39MnemonicWords({ chainId,
|
|
18
|
+
constructor({ getPassphrase, ...serializableData }: InMemoryKeyAgentProps, dependencies: KeyAgentDependencies);
|
|
19
|
+
signBlob({ index, role: type }: AccountKeyDerivationPath, blob: HexBlob): Promise<SignBlobResult>;
|
|
20
|
+
exportRootPrivateKey(): Promise<Crypto.Bip32PrivateKeyHex>;
|
|
21
|
+
static fromBip39MnemonicWords({ chainId, getPassphrase, mnemonicWords, mnemonic2ndFactorPassphrase, accountIndex }: FromBip39MnemonicWordsProps, dependencies: KeyAgentDependencies): Promise<InMemoryKeyAgent>;
|
|
20
22
|
signTransaction({ body, hash }: Cardano.TxBodyWithHash, { additionalKeyPaths }?: SignTransactionOptions | undefined): Promise<Cardano.Signatures>;
|
|
21
23
|
exportExtendedKeyPair(derivationPath: number[]): Promise<KeyPair>;
|
|
22
24
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InMemoryKeyAgent.d.ts","sourceRoot":"","sources":["../../src/InMemoryKeyAgent.ts"],"names":[],"mappings":"
|
|
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,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAY9C,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,gCAAgC,EAAE,YAAY,CAAC;IACjG,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,MAAM,WAAW,2BAA2B;IAC1C,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;IACzB,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,2BAA2B,CAAC,EAAE,MAAM,CAAC;IACrC,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAUD,qBAAa,gBAAiB,SAAQ,YAAa,YAAW,QAAQ;;gBAGxD,EAAE,aAAa,EAAE,GAAG,gBAAgB,EAAE,EAAE,qBAAqB,EAAE,YAAY,EAAE,oBAAoB;IAKvG,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,wBAAwB,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC;IAqBjG,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC;WAOnD,sBAAsB,CACjC,EACE,OAAO,EACP,aAAa,EACb,aAAa,EACb,2BAAgC,EAChC,YAAgB,EACjB,EAAE,2BAA2B,EAC9B,YAAY,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;IAsBxB,qBAAqB,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAwBxE"}
|
|
@@ -36,72 +36,75 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
36
36
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
37
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
38
|
};
|
|
39
|
-
var _InMemoryKeyAgent_instances,
|
|
39
|
+
var _InMemoryKeyAgent_instances, _InMemoryKeyAgent_getPassphrase, _InMemoryKeyAgent_decryptRootPrivateKey;
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.InMemoryKeyAgent = void 0;
|
|
42
|
+
const Crypto = __importStar(require("@cardano-sdk/crypto"));
|
|
42
43
|
const errors = __importStar(require("./errors"));
|
|
43
44
|
const types_1 = require("./types");
|
|
44
|
-
const
|
|
45
|
+
const util_1 = require("@cardano-sdk/util");
|
|
45
46
|
const KeyAgentBase_1 = require("./KeyAgentBase");
|
|
46
|
-
const
|
|
47
|
+
const util_2 = require("./util");
|
|
47
48
|
const emip3_1 = require("./emip3");
|
|
48
49
|
const uniqBy_1 = __importDefault(require("lodash/uniqBy"));
|
|
49
|
-
const
|
|
50
|
+
const getPassphraseRethrowTypedError = async (getPassphrase) => {
|
|
50
51
|
try {
|
|
51
|
-
return await
|
|
52
|
+
return await getPassphrase();
|
|
52
53
|
}
|
|
53
54
|
catch (error) {
|
|
54
|
-
throw new errors.AuthenticationError('Failed to enter
|
|
55
|
+
throw new errors.AuthenticationError('Failed to enter passphrase', error);
|
|
55
56
|
}
|
|
56
57
|
};
|
|
57
58
|
class InMemoryKeyAgent extends KeyAgentBase_1.KeyAgentBase {
|
|
58
|
-
constructor({
|
|
59
|
+
constructor({ getPassphrase, ...serializableData }, dependencies) {
|
|
59
60
|
super({ ...serializableData, __typename: types_1.KeyAgentType.InMemory }, dependencies);
|
|
60
61
|
_InMemoryKeyAgent_instances.add(this);
|
|
61
|
-
|
|
62
|
-
__classPrivateFieldSet(this,
|
|
62
|
+
_InMemoryKeyAgent_getPassphrase.set(this, void 0);
|
|
63
|
+
__classPrivateFieldSet(this, _InMemoryKeyAgent_getPassphrase, getPassphrase, "f");
|
|
63
64
|
}
|
|
64
65
|
async signBlob({ index, role: type }, blob) {
|
|
65
66
|
const rootPrivateKey = await __classPrivateFieldGet(this, _InMemoryKeyAgent_instances, "m", _InMemoryKeyAgent_decryptRootPrivateKey).call(this);
|
|
66
|
-
const accountKey = (0,
|
|
67
|
+
const accountKey = await (0, util_2.deriveAccountPrivateKey)({
|
|
67
68
|
accountIndex: this.accountIndex,
|
|
69
|
+
bip32Ed25519: this.bip32Ed25519,
|
|
68
70
|
rootPrivateKey
|
|
69
71
|
});
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
const
|
|
72
|
+
const bip32SigningKey = await this.bip32Ed25519.derivePrivateKey(accountKey, [type, index]);
|
|
73
|
+
const signingKey = await this.bip32Ed25519.getRawPrivateKey(bip32SigningKey);
|
|
74
|
+
const signature = await this.bip32Ed25519.sign(signingKey, blob);
|
|
75
|
+
const publicKey = await this.bip32Ed25519.getPublicKey(signingKey);
|
|
73
76
|
return { publicKey, signature };
|
|
74
77
|
}
|
|
75
78
|
async exportRootPrivateKey() {
|
|
76
|
-
|
|
77
|
-
return core_1.Cardano.Bip32PrivateKey.fromHexBlob(core_1.util.bytesToHex(rootPrivateKey.as_bytes()));
|
|
79
|
+
return await __classPrivateFieldGet(this, _InMemoryKeyAgent_instances, "m", _InMemoryKeyAgent_decryptRootPrivateKey).call(this, true);
|
|
78
80
|
}
|
|
79
|
-
static async fromBip39MnemonicWords({ chainId,
|
|
80
|
-
const mnemonic = (0,
|
|
81
|
-
const validMnemonic = (0,
|
|
81
|
+
static async fromBip39MnemonicWords({ chainId, getPassphrase, mnemonicWords, mnemonic2ndFactorPassphrase = '', accountIndex = 0 }, dependencies) {
|
|
82
|
+
const mnemonic = (0, util_2.joinMnemonicWords)(mnemonicWords);
|
|
83
|
+
const validMnemonic = (0, util_2.validateMnemonic)(mnemonic);
|
|
82
84
|
if (!validMnemonic)
|
|
83
85
|
throw new errors.InvalidMnemonicError();
|
|
84
|
-
const entropy = Buffer.from((0,
|
|
85
|
-
const rootPrivateKey =
|
|
86
|
-
const
|
|
87
|
-
const encryptedRootPrivateKey = await (0, emip3_1.emip3encrypt)(
|
|
88
|
-
const accountPrivateKey = (0,
|
|
86
|
+
const entropy = Buffer.from((0, util_2.mnemonicWordsToEntropy)(mnemonicWords), 'hex');
|
|
87
|
+
const rootPrivateKey = await dependencies.bip32Ed25519.fromBip39Entropy(entropy, mnemonic2ndFactorPassphrase);
|
|
88
|
+
const passphrase = await getPassphraseRethrowTypedError(getPassphrase);
|
|
89
|
+
const encryptedRootPrivateKey = await (0, emip3_1.emip3encrypt)(Buffer.from(rootPrivateKey, 'hex'), passphrase);
|
|
90
|
+
const accountPrivateKey = await (0, util_2.deriveAccountPrivateKey)({
|
|
89
91
|
accountIndex,
|
|
92
|
+
bip32Ed25519: dependencies.bip32Ed25519,
|
|
90
93
|
rootPrivateKey
|
|
91
94
|
});
|
|
92
|
-
const extendedAccountPublicKey =
|
|
95
|
+
const extendedAccountPublicKey = await dependencies.bip32Ed25519.getBip32PublicKey(accountPrivateKey);
|
|
93
96
|
return new InMemoryKeyAgent({
|
|
94
97
|
accountIndex,
|
|
95
98
|
chainId,
|
|
96
99
|
encryptedRootPrivateKeyBytes: [...encryptedRootPrivateKey],
|
|
97
100
|
extendedAccountPublicKey,
|
|
98
|
-
|
|
101
|
+
getPassphrase,
|
|
99
102
|
knownAddresses: []
|
|
100
103
|
}, dependencies);
|
|
101
104
|
}
|
|
102
105
|
async signTransaction({ body, hash }, { additionalKeyPaths = [] } = {}) {
|
|
103
|
-
const blob =
|
|
104
|
-
const derivationPaths = await (0,
|
|
106
|
+
const blob = (0, util_1.HexBlob)(hash.toString());
|
|
107
|
+
const derivationPaths = await (0, util_2.ownSignatureKeyPaths)(body, this.knownAddresses, this.inputResolver);
|
|
105
108
|
const keyPaths = (0, uniqBy_1.default)([...derivationPaths, ...additionalKeyPaths], ({ role, index }) => `${role}.${index}`);
|
|
106
109
|
return new Map(await Promise.all(keyPaths.map(async ({ role, index }) => {
|
|
107
110
|
const { publicKey, signature } = await this.signBlob({ index, role }, blob);
|
|
@@ -110,27 +113,24 @@ class InMemoryKeyAgent extends KeyAgentBase_1.KeyAgentBase {
|
|
|
110
113
|
}
|
|
111
114
|
async exportExtendedKeyPair(derivationPath) {
|
|
112
115
|
const rootPrivateKey = await this.exportRootPrivateKey();
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
for (const val of derivationPath) {
|
|
116
|
-
cslPrivateKey = cslPrivateKey.derive((0, util_1.harden)(val));
|
|
117
|
-
}
|
|
116
|
+
const hardenedIndices = derivationPath.map((index) => (0, util_2.harden)(index));
|
|
117
|
+
const childKey = await this.bip32Ed25519.derivePrivateKey(rootPrivateKey, hardenedIndices);
|
|
118
118
|
return {
|
|
119
|
-
skey:
|
|
120
|
-
vkey:
|
|
119
|
+
skey: childKey,
|
|
120
|
+
vkey: await this.bip32Ed25519.getBip32PublicKey(childKey)
|
|
121
121
|
};
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
124
|
exports.InMemoryKeyAgent = InMemoryKeyAgent;
|
|
125
|
-
|
|
126
|
-
const
|
|
125
|
+
_InMemoryKeyAgent_getPassphrase = new WeakMap(), _InMemoryKeyAgent_instances = new WeakSet(), _InMemoryKeyAgent_decryptRootPrivateKey = async function _InMemoryKeyAgent_decryptRootPrivateKey(noCache) {
|
|
126
|
+
const passphrase = await getPassphraseRethrowTypedError(() => __classPrivateFieldGet(this, _InMemoryKeyAgent_getPassphrase, "f").call(this, noCache));
|
|
127
127
|
let decryptedRootKeyBytes;
|
|
128
128
|
try {
|
|
129
|
-
decryptedRootKeyBytes = await (0, emip3_1.emip3decrypt)(new Uint8Array(this.serializableData.encryptedRootPrivateKeyBytes),
|
|
129
|
+
decryptedRootKeyBytes = await (0, emip3_1.emip3decrypt)(new Uint8Array(this.serializableData.encryptedRootPrivateKeyBytes), passphrase);
|
|
130
130
|
}
|
|
131
131
|
catch (error) {
|
|
132
132
|
throw new errors.AuthenticationError('Failed to decrypt root private key', error);
|
|
133
133
|
}
|
|
134
|
-
return
|
|
134
|
+
return Crypto.Bip32PrivateKeyHex(Buffer.from(decryptedRootKeyBytes).toString('hex'));
|
|
135
135
|
};
|
|
136
136
|
//# sourceMappingURL=InMemoryKeyAgent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InMemoryKeyAgent.js","sourceRoot":"","sources":["../../src/InMemoryKeyAgent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iDAAmC;AACnC,mCAUiB;
|
|
1
|
+
{"version":3,"file":"InMemoryKeyAgent.js","sourceRoot":"","sources":["../../src/InMemoryKeyAgent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA8C;AAC9C,iDAAmC;AACnC,mCAUiB;AAEjB,4CAA4C;AAC5C,iDAA8C;AAC9C,iCAOgB;AAChB,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;QACd,MAAM,IAAI,MAAM,CAAC,mBAAmB,CAAC,4BAA4B,EAAE,KAAK,CAAC,CAAC;KAC3E;AACH,CAAC,CAAC;AAEF,MAAa,gBAAiB,SAAQ,2BAAY;IAGhD,YAAY,EAAE,aAAa,EAAE,GAAG,gBAAgB,EAAyB,EAAE,YAAkC;QAC3G,KAAK,CAAC,EAAE,GAAG,gBAAgB,EAAE,UAAU,EAAE,oBAAY,CAAC,QAAQ,EAAE,EAAE,YAAY,CAAC,CAAC;;QAHlF,kDAAuC;QAIrC,uBAAA,IAAI,mCAAkB,aAAa,MAAA,CAAC;IACtC,CAAC;IAED,KAAK,CAAC,QAAQ,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAA4B,EAAE,IAAa;QAC3E,MAAM,cAAc,GAAG,MAAM,uBAAA,IAAI,4EAAuB,MAA3B,IAAI,CAAyB,CAAC;QAC3D,MAAM,UAAU,GAAG,MAAM,IAAA,8BAAuB,EAAC;YAC/C,YAAY,EAAE,IAAI,CAAC,YAAY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F,CAAC"}
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
+
import * as Crypto from '@cardano-sdk/crypto';
|
|
1
2
|
import { AccountAddressDerivationPath, AccountKeyDerivationPath, GroupedAddress, KeyAgent, KeyAgentDependencies, SerializableKeyAgentData, SignBlobResult, SignTransactionOptions } from './types';
|
|
2
|
-
import {
|
|
3
|
+
import { Cardano } from '@cardano-sdk/core';
|
|
4
|
+
import { HexBlob } from '@cardano-sdk/util';
|
|
3
5
|
export declare abstract class KeyAgentBase implements KeyAgent {
|
|
4
6
|
#private;
|
|
5
7
|
protected readonly inputResolver: Cardano.util.InputResolver;
|
|
6
8
|
get knownAddresses(): GroupedAddress[];
|
|
7
9
|
set knownAddresses(addresses: GroupedAddress[]);
|
|
8
10
|
get serializableData(): SerializableKeyAgentData;
|
|
9
|
-
get extendedAccountPublicKey():
|
|
11
|
+
get extendedAccountPublicKey(): Crypto.Bip32PublicKeyHex;
|
|
10
12
|
get chainId(): Cardano.ChainId;
|
|
11
13
|
get accountIndex(): number;
|
|
12
|
-
|
|
13
|
-
abstract
|
|
14
|
+
get bip32Ed25519(): Crypto.Bip32Ed25519;
|
|
15
|
+
abstract signBlob(derivationPath: AccountKeyDerivationPath, blob: HexBlob): Promise<SignBlobResult>;
|
|
16
|
+
abstract exportRootPrivateKey(): Promise<Crypto.Bip32PrivateKeyHex>;
|
|
14
17
|
abstract signTransaction(txInternals: Cardano.TxBodyWithHash, signTransactionOptions?: SignTransactionOptions): Promise<Cardano.Signatures>;
|
|
15
|
-
constructor(serializableData: SerializableKeyAgentData, { inputResolver }: KeyAgentDependencies);
|
|
18
|
+
constructor(serializableData: SerializableKeyAgentData, { inputResolver, bip32Ed25519 }: KeyAgentDependencies);
|
|
16
19
|
deriveAddress({ index, type }: AccountAddressDerivationPath): Promise<GroupedAddress>;
|
|
17
|
-
derivePublicKey(derivationPath: AccountKeyDerivationPath): Promise<
|
|
18
|
-
protected deriveCmlPublicKey({ index, role: type }: AccountKeyDerivationPath): Promise<CML.PublicKey>;
|
|
20
|
+
derivePublicKey(derivationPath: AccountKeyDerivationPath): Promise<Crypto.Ed25519PublicKeyHex>;
|
|
19
21
|
}
|
|
20
22
|
//# sourceMappingURL=KeyAgentBase.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyAgentBase.d.ts","sourceRoot":"","sources":["../../src/KeyAgentBase.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,cAAc,EACd,QAAQ,EACR,oBAAoB,EAEpB,wBAAwB,EACxB,cAAc,EACd,sBAAsB,EACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"KeyAgentBase.d.ts","sourceRoot":"","sources":["../../src/KeyAgentBase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EACL,4BAA4B,EAC5B,wBAAwB,EACxB,cAAc,EACd,QAAQ,EACR,oBAAoB,EAEpB,wBAAwB,EACxB,cAAc,EACd,sBAAsB,EACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAO,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAiB,MAAM,mBAAmB,CAAC;AAG3D,8BAAsB,YAAa,YAAW,QAAQ;;IAGpD,SAAS,CAAC,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,aAAa,CAAC;IAE7D,IAAI,cAAc,IAAI,cAAc,EAAE,CAErC;IACD,IAAI,cAAc,CAAC,SAAS,EAAE,cAAc,EAAE,EAE7C;IACD,IAAI,gBAAgB,IAAI,wBAAwB,CAE/C;IACD,IAAI,wBAAwB,IAAI,MAAM,CAAC,iBAAiB,CAEvD;IACD,IAAI,OAAO,IAAI,OAAO,CAAC,OAAO,CAE7B;IACD,IAAI,YAAY,IAAI,MAAM,CAEzB;IACD,IAAI,YAAY,IAAI,MAAM,CAAC,YAAY,CAEtC;IAED,QAAQ,CAAC,QAAQ,CAAC,cAAc,EAAE,wBAAwB,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,cAAc,CAAC;IACnG,QAAQ,CAAC,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC;IACnE,QAAQ,CAAC,eAAe,CACtB,WAAW,EAAE,OAAO,CAAC,cAAc,EACnC,sBAAsB,CAAC,EAAE,sBAAsB,GAC9C,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;gBAElB,gBAAgB,EAAE,wBAAwB,EAAE,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,oBAAoB;IASvG,aAAa,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,4BAA4B,GAAG,OAAO,CAAC,cAAc,CAAC;IAuDrF,eAAe,CAAC,cAAc,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC;CAQrG"}
|
package/dist/cjs/KeyAgentBase.js
CHANGED
|
@@ -10,16 +10,19 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
10
10
|
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");
|
|
11
11
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
12
|
};
|
|
13
|
-
var _KeyAgentBase_serializableData;
|
|
13
|
+
var _KeyAgentBase_serializableData, _KeyAgentBase_bip32Ed25519;
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.KeyAgentBase = void 0;
|
|
16
16
|
const core_1 = require("@cardano-sdk/core");
|
|
17
|
-
const util_1 = require("
|
|
17
|
+
const util_1 = require("@cardano-sdk/util");
|
|
18
|
+
const util_2 = require("./util");
|
|
18
19
|
class KeyAgentBase {
|
|
19
|
-
constructor(serializableData, { inputResolver }) {
|
|
20
|
+
constructor(serializableData, { inputResolver, bip32Ed25519 }) {
|
|
20
21
|
_KeyAgentBase_serializableData.set(this, void 0);
|
|
22
|
+
_KeyAgentBase_bip32Ed25519.set(this, void 0);
|
|
21
23
|
__classPrivateFieldSet(this, _KeyAgentBase_serializableData, serializableData, "f");
|
|
22
24
|
this.inputResolver = inputResolver;
|
|
25
|
+
__classPrivateFieldSet(this, _KeyAgentBase_bip32Ed25519, bip32Ed25519, "f");
|
|
23
26
|
}
|
|
24
27
|
get knownAddresses() {
|
|
25
28
|
return __classPrivateFieldGet(this, _KeyAgentBase_serializableData, "f").knownAddresses;
|
|
@@ -39,40 +42,47 @@ class KeyAgentBase {
|
|
|
39
42
|
get accountIndex() {
|
|
40
43
|
return this.serializableData.accountIndex;
|
|
41
44
|
}
|
|
45
|
+
get bip32Ed25519() {
|
|
46
|
+
return __classPrivateFieldGet(this, _KeyAgentBase_bip32Ed25519, "f");
|
|
47
|
+
}
|
|
42
48
|
async deriveAddress({ index, type }) {
|
|
43
49
|
const knownAddress = this.knownAddresses.find((addr) => addr.type === type && addr.index === index);
|
|
44
50
|
if (knownAddress)
|
|
45
51
|
return knownAddress;
|
|
46
|
-
const derivedPublicPaymentKey = await this.
|
|
52
|
+
const derivedPublicPaymentKey = await this.derivePublicKey({
|
|
47
53
|
index,
|
|
48
54
|
role: type
|
|
49
55
|
});
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
const derivedPublicPaymentKeyHash = await __classPrivateFieldGet(this, _KeyAgentBase_bip32Ed25519, "f").getPubKeyHash(derivedPublicPaymentKey);
|
|
57
|
+
const publicStakeKey = await this.derivePublicKey(util_2.STAKE_KEY_DERIVATION_PATH);
|
|
58
|
+
const publicStakeKeyHash = await __classPrivateFieldGet(this, _KeyAgentBase_bip32Ed25519, "f").getPubKeyHash(publicStakeKey);
|
|
59
|
+
const groupedAddress = (0, util_1.usingAutoFree)((scope) => {
|
|
60
|
+
const stakeKeyCredential = scope.manage(core_1.CML.StakeCredential.from_keyhash(scope.manage(core_1.CML.Ed25519KeyHash.from_bytes(Buffer.from(publicStakeKeyHash, 'hex')))));
|
|
61
|
+
const address = scope.manage(scope
|
|
62
|
+
.manage(core_1.CML.BaseAddress.new(this.chainId.networkId, scope.manage(core_1.CML.StakeCredential.from_keyhash(scope.manage(core_1.CML.Ed25519KeyHash.from_bytes(Buffer.from(derivedPublicPaymentKeyHash, 'hex'))))), stakeKeyCredential))
|
|
63
|
+
.to_address());
|
|
64
|
+
const rewardAccount = scope.manage(scope.manage(core_1.CML.RewardAddress.new(this.chainId.networkId, stakeKeyCredential)).to_address());
|
|
65
|
+
return {
|
|
66
|
+
accountIndex: this.accountIndex,
|
|
67
|
+
address: core_1.Cardano.Address(address.to_bech32()),
|
|
68
|
+
index,
|
|
69
|
+
networkId: this.chainId.networkId,
|
|
70
|
+
rewardAccount: core_1.Cardano.RewardAccount(rewardAccount.to_bech32()),
|
|
71
|
+
stakeKeyDerivationPath: util_2.STAKE_KEY_DERIVATION_PATH,
|
|
72
|
+
type
|
|
73
|
+
};
|
|
74
|
+
});
|
|
63
75
|
this.knownAddresses = [...this.knownAddresses, groupedAddress];
|
|
64
76
|
return groupedAddress;
|
|
65
77
|
}
|
|
66
78
|
async derivePublicKey(derivationPath) {
|
|
67
|
-
const
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const accountPublicKey = core_1.CML.Bip32PublicKey.from_bytes(accountPublicKeyBytes);
|
|
73
|
-
return accountPublicKey.derive(type).derive(index).to_raw_key();
|
|
79
|
+
const childKey = await __classPrivateFieldGet(this, _KeyAgentBase_bip32Ed25519, "f").derivePublicKey(this.extendedAccountPublicKey, [
|
|
80
|
+
derivationPath.role,
|
|
81
|
+
derivationPath.index
|
|
82
|
+
]);
|
|
83
|
+
return await __classPrivateFieldGet(this, _KeyAgentBase_bip32Ed25519, "f").getRawPublicKey(childKey);
|
|
74
84
|
}
|
|
75
85
|
}
|
|
76
86
|
exports.KeyAgentBase = KeyAgentBase;
|
|
77
|
-
_KeyAgentBase_serializableData = new WeakMap();
|
|
87
|
+
_KeyAgentBase_serializableData = new WeakMap(), _KeyAgentBase_bip32Ed25519 = new WeakMap();
|
|
78
88
|
//# sourceMappingURL=KeyAgentBase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyAgentBase.js","sourceRoot":"","sources":["../../src/KeyAgentBase.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"KeyAgentBase.js","sourceRoot":"","sources":["../../src/KeyAgentBase.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAYA,4CAAiD;AACjD,4CAA2D;AAC3D,iCAAmD;AAEnD,MAAsB,YAAY;IAkChC,YAAY,gBAA0C,EAAE,EAAE,aAAa,EAAE,YAAY,EAAwB;QAjC7G,iDAAqD;QACrD,6CAA4C;QAiC1C,uBAAA,IAAI,kCAAqB,gBAAgB,MAAA,CAAC;QAC1C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,uBAAA,IAAI,8BAAiB,YAAY,MAAA,CAAC;IACpC,CAAC;IAjCD,IAAI,cAAc;QAChB,OAAO,uBAAA,IAAI,sCAAkB,CAAC,cAAc,CAAC;IAC/C,CAAC;IACD,IAAI,cAAc,CAAC,SAA2B;QAC5C,uBAAA,IAAI,sCAAkB,CAAC,cAAc,GAAG,SAAS,CAAC;IACpD,CAAC;IACD,IAAI,gBAAgB;QAClB,OAAO,uBAAA,IAAI,sCAAkB,CAAC;IAChC,CAAC;IACD,IAAI,wBAAwB;QAC1B,OAAO,IAAI,CAAC,gBAAgB,CAAC,wBAAwB,CAAC;IACxD,CAAC;IACD,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,C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|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as Crypto from '@cardano-sdk/crypto';
|
|
1
2
|
import { Cardano } from '@cardano-sdk/core';
|
|
2
3
|
import { CommunicationType, KeyAgentDependencies, LedgerTransportType, SerializableLedgerKeyAgentData, SignBlobResult } from './types';
|
|
3
4
|
import { KeyAgentBase } from './KeyAgentBase';
|
|
@@ -31,11 +32,11 @@ export declare class LedgerKeyAgent extends KeyAgentBase {
|
|
|
31
32
|
static createDeviceConnection(activeTransport: LedgerTransport): Promise<LedgerConnection>;
|
|
32
33
|
static establishDeviceConnection(communicationType: CommunicationType, devicePath?: string): Promise<LedgerConnection>;
|
|
33
34
|
static checkDeviceConnection(communicationType: CommunicationType, deviceConnection?: LedgerConnection): Promise<LedgerConnection>;
|
|
34
|
-
static getXpub({ deviceConnection, communicationType, accountIndex }: GetLedgerXpubProps): Promise<
|
|
35
|
+
static getXpub({ deviceConnection, communicationType, accountIndex }: GetLedgerXpubProps): Promise<Crypto.Bip32PublicKeyHex>;
|
|
35
36
|
static getAppVersion(communicationType: CommunicationType, deviceConnection?: LedgerConnection): Promise<GetVersionResponse>;
|
|
36
37
|
static createWithDevice({ chainId, accountIndex, communicationType, deviceConnection }: CreateLedgerKeyAgentProps, dependencies: KeyAgentDependencies): Promise<LedgerKeyAgent>;
|
|
37
|
-
signTransaction({ body }: Cardano.TxBodyWithHash): Promise<Cardano.Signatures>;
|
|
38
|
+
signTransaction({ body, hash }: Cardano.TxBodyWithHash): Promise<Cardano.Signatures>;
|
|
38
39
|
signBlob(): Promise<SignBlobResult>;
|
|
39
|
-
exportRootPrivateKey(): Promise<
|
|
40
|
+
exportRootPrivateKey(): Promise<Crypto.Bip32PrivateKeyHex>;
|
|
40
41
|
}
|
|
41
42
|
//# sourceMappingURL=LedgerKeyAgent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LedgerKeyAgent.d.ts","sourceRoot":"","sources":["../../src/LedgerKeyAgent.ts"],"names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,YAAY,EAAE,oBAAoB;WASjG,gBAAgB,CAAC,iBAAiB,EAAE,iBAAiB,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;WAWzE,eAAe,CAAC,EAC3B,iBAAiB,EACjB,eAAe,EACf,UAAe,EAChB,EAAE,0BAA0B,GAAG,OAAO,CAAC,mBAAmB,CAAC;WAgB/C,sBAAsB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;WAcnF,yBAAyB,CACpC,iBAAiB,EAAE,iBAAiB,EACpC,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,gBAAgB,CAAC;WA+Bf,qBAAqB,CAChC,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,CAAC,EAAE,gBAAgB,GAClC,OAAO,CAAC,gBAAgB,CAAC;WAmBf,OAAO,CAAC,EACnB,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACb,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,CAAC,iBAAiB,CAAC;WAoB5C,aAAa,CACxB,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,CAAC,EAAE,gBAAgB,GAClC,OAAO,CAAC,kBAAkB,CAAC;WASjB,gBAAgB,CAC3B,EAAE,OAAO,EAAE,YAAgB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,EAAE,yBAAyB,EAC7F,YAAY,EAAE,oBAAoB;IA0B9B,eAAe,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;IAyCpF,QAAQ,IAAI,OAAO,CAAC,cAAc,CAAC;IAInC,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC;CAGjE"}
|
|
@@ -39,6 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
39
39
|
var _LedgerKeyAgent_communicationType;
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.LedgerKeyAgent = void 0;
|
|
42
|
+
const Crypto = __importStar(require("@cardano-sdk/crypto"));
|
|
42
43
|
const errors_1 = require("./errors");
|
|
43
44
|
const core_1 = require("@cardano-sdk/core");
|
|
44
45
|
const types_1 = require("./types");
|
|
@@ -134,7 +135,7 @@ class LedgerKeyAgent extends KeyAgentBase_1.KeyAgentBase {
|
|
|
134
135
|
path: ledgerjs_hw_app_cardano_1.utils.str_to_path(derivationPath)
|
|
135
136
|
});
|
|
136
137
|
const xPubHex = `${extendedPublicKey.publicKeyHex}${extendedPublicKey.chainCodeHex}`;
|
|
137
|
-
return
|
|
138
|
+
return Crypto.Bip32PublicKeyHex(xPubHex);
|
|
138
139
|
}
|
|
139
140
|
catch (error) {
|
|
140
141
|
if (error.code === 28169) {
|
|
@@ -166,7 +167,7 @@ class LedgerKeyAgent extends KeyAgentBase_1.KeyAgentBase {
|
|
|
166
167
|
knownAddresses: []
|
|
167
168
|
}, dependencies);
|
|
168
169
|
}
|
|
169
|
-
async signTransaction({ body }) {
|
|
170
|
+
async signTransaction({ body, hash }) {
|
|
170
171
|
const scope = new util_1.ManagedFreeableScope();
|
|
171
172
|
try {
|
|
172
173
|
const cslTxBody = core_1.coreToCml.txBody(scope, body);
|
|
@@ -178,12 +179,15 @@ class LedgerKeyAgent extends KeyAgentBase_1.KeyAgentBase {
|
|
|
178
179
|
});
|
|
179
180
|
const deviceConnection = await LedgerKeyAgent.checkDeviceConnection(__classPrivateFieldGet(this, _LedgerKeyAgent_communicationType, "f"), this.deviceConnection);
|
|
180
181
|
const result = await deviceConnection.signTransaction(ledgerTxData);
|
|
182
|
+
if (result.txHashHex !== hash.toString()) {
|
|
183
|
+
throw new errors_1.HwMappingError('Ledger computed a different transaction id');
|
|
184
|
+
}
|
|
181
185
|
return new Map(await Promise.all(result.witnesses.map(async (witness) => {
|
|
182
186
|
const publicKey = await this.derivePublicKey({
|
|
183
187
|
index: witness.path[types_1.Cip1852PathLevelIndexes.INDEX],
|
|
184
188
|
role: witness.path[types_1.Cip1852PathLevelIndexes.ROLE]
|
|
185
189
|
});
|
|
186
|
-
const signature =
|
|
190
|
+
const signature = Crypto.Ed25519SignatureHex(witness.witnessSignatureHex);
|
|
187
191
|
return [publicKey, signature];
|
|
188
192
|
})));
|
|
189
193
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LedgerKeyAgent.js","sourceRoot":"","sources":["../../src/LedgerKeyAgent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,qCAA+
|
|
1
|
+
{"version":3,"file":"LedgerKeyAgent.js","sourceRoot":"","sources":["../../src/LedgerKeyAgent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4DAA8C;AAC9C,qCAA+E;AAC/E,4CAA4E;AAC5E,mCASiB;AACjB,iDAA8C;AAC9C,4CAAyD;AACzD,iCAAoC;AACpC,uGAA0G;AAC1G,8GAAwE;AACxE,wFAA4D;AA0B5D,MAAM,mBAAmB,GAAG,CAAC,KAAW,EAAE,EAAE,CAC1C,IAAI,4BAAmB,CAAC,yBAAyB,EAAE,IAAI,uBAAc,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC,CAAC;AAE3G,MAAa,cAAe,SAAQ,2BAAY;IAI9C,YAAY,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,EAAuB,EAAE,YAAkC;QAC5G,KAAK,CAAC,EAAE,GAAG,gBAAgB,EAAE,UAAU,EAAE,oBAAY,CAAC,MAAM,EAAE,EAAE,YAAY,CAAC,CAAC;QAHhF,oDAA+C;QAI7C,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,uBAAA,IAAI,qCAAsB,gBAAgB,CAAC,iBAAiB,MAAA,CAAC;IAC/D,CAAC;IAKD,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,iBAAoC;QAChE,IAAI;YACF,OAAO,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E,EAAE;gBACxC,MAAM,IAAI,uBAAc,CAAC,4CAA4C,CAAC,CAAC;aACxE;YAED,OAAO,IAAI,GAAG,CACZ,MAAM,OAAO,CAAC,GAAG,CACf,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;gBACrC,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,eAAe,CAAC;oBAC3C,KAAK,EAAE,OAAO,CAAC,IAAI,CAAC,+BAAuB,CAAC,KAAK,CAAC;oBAClD,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,+BAAuB,CAAC,IAAI,CAAC;iBACjD,CAAC,CAAC;gBACH,MAAM,SAAS,GAAG,MAAM,CAAC,mBAAmB,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;gBAC1E,OAAO,CAAC,SAAS,EAAE,SAAS,CAAU,CAAC;YACzC,CAAC,CAAC,CACH,CACF,CAAC;SACH;QAAC,OAAO,KAAU,EAAE;YACnB,IAAI,KAAK,CAAC,IAAI,KAAK,KAAM,EAAE;gBACzB,MAAM,IAAI,4BAAmB,CAAC,6BAA6B,EAAE,KAAK,CAAC,CAAC;aACrE;YACD,MAAM,mBAAmB,CAAC,KAAK,CAAC,CAAC;SAClC;gBAAS;YACR,KAAK,CAAC,OAAO,EAAE,CAAC;SACjB;IACH,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;AAlOD,wCAkOC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as Crypto from '@cardano-sdk/crypto';
|
|
1
2
|
import { Cardano } from '@cardano-sdk/core';
|
|
2
3
|
import { KeyAgentDependencies, SerializableTrezorKeyAgentData, SignBlobResult, TrezorConfig } from './types';
|
|
3
4
|
import { KeyAgentBase } from './KeyAgentBase';
|
|
@@ -18,10 +19,10 @@ export declare class TrezorKeyAgent extends KeyAgentBase {
|
|
|
18
19
|
constructor({ isTrezorInitialized, ...serializableData }: TrezorKeyAgentProps, dependencies: KeyAgentDependencies);
|
|
19
20
|
static initializeTrezorTransport({ manifest, communicationType, silentMode, lazyLoad }: TrezorConfig): Promise<boolean>;
|
|
20
21
|
static checkDeviceConnection(): Promise<Features>;
|
|
21
|
-
static getXpub({ accountIndex }: GetTrezorXpubProps): Promise<
|
|
22
|
+
static getXpub({ accountIndex }: GetTrezorXpubProps): Promise<Crypto.Bip32PublicKeyHex>;
|
|
22
23
|
static createWithDevice({ chainId, accountIndex, trezorConfig }: CreateTrezorKeyAgentProps, dependencies: KeyAgentDependencies): Promise<TrezorKeyAgent>;
|
|
23
24
|
signTransaction({ body }: Cardano.TxBodyWithHash): Promise<Cardano.Signatures>;
|
|
24
25
|
signBlob(): Promise<SignBlobResult>;
|
|
25
|
-
exportRootPrivateKey(): Promise<
|
|
26
|
+
exportRootPrivateKey(): Promise<Crypto.Bip32PrivateKeyHex>;
|
|
26
27
|
}
|
|
27
28
|
//# sourceMappingURL=TrezorKeyAgent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TrezorKeyAgent.d.ts","sourceRoot":"","sources":["../../src/TrezorKeyAgent.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TrezorKeyAgent.d.ts","sourceRoot":"","sources":["../../src/TrezorKeyAgent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAE9C,OAAO,EAAE,OAAO,EAAkC,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAGL,oBAAoB,EAEpB,8BAA8B,EAC9B,cAAc,EACd,YAAY,EACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAG9C,OAAsB,EAAE,QAAQ,EAAE,MAAM,gBAAg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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
|
+
};
|
|
2
25
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
27
|
};
|
|
5
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
29
|
exports.TrezorKeyAgent = void 0;
|
|
30
|
+
const Crypto = __importStar(require("@cardano-sdk/crypto"));
|
|
7
31
|
const errors_1 = require("./errors");
|
|
8
32
|
const core_1 = require("@cardano-sdk/core");
|
|
9
33
|
const types_1 = require("./types");
|
|
@@ -60,7 +84,7 @@ class TrezorKeyAgent extends KeyAgentBase_1.KeyAgentBase {
|
|
|
60
84
|
if (!extendedPublicKey.success) {
|
|
61
85
|
throw new errors_1.TransportError('Failed to export extended account public key', extendedPublicKey.payload);
|
|
62
86
|
}
|
|
63
|
-
return
|
|
87
|
+
return Crypto.Bip32PublicKeyHex(extendedPublicKey.payload.publicKey);
|
|
64
88
|
}
|
|
65
89
|
catch (error) {
|
|
66
90
|
throw transportTypedError(error);
|
|
@@ -96,8 +120,8 @@ class TrezorKeyAgent extends KeyAgentBase_1.KeyAgentBase {
|
|
|
96
120
|
}
|
|
97
121
|
const signedData = result.payload;
|
|
98
122
|
return new Map(await Promise.all(signedData.witnesses.map(async (witness) => {
|
|
99
|
-
const publicKey =
|
|
100
|
-
const signature =
|
|
123
|
+
const publicKey = Crypto.Ed25519PublicKeyHex(witness.pubKey);
|
|
124
|
+
const signature = Crypto.Ed25519SignatureHex(witness.signature);
|
|
101
125
|
return [publicKey, signature];
|
|
102
126
|
})));
|
|
103
127
|
}
|
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,4DAA8C;AAC9C,qCAA+D;AAC/D,4CAA4E;AAC5E,mCAQiB;AACjB,iDAA8C;AAC9C,4CAAyD;AACzD,iCAAoC;AACpC,oEAAyD;AAgBzD,MAAM,mBAAmB,GAAG,CAAC,KAAW,EAAE,EAAE,CAC1C,IAAI,4BAAmB,CAAC,yBAAyB,EAAE,IAAI,uBAAc,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC,CAAC;AAE3G,MAAa,cAAe,SAAQ,2BAAY;IAG9C,YAAY,EAAE,mBAAmB,EAAE,GAAG,gBAAgB,EAAuB,EAAE,YAAkC;QAC/G,KAAK,CAAC,EAAE,GAAG,gBAAgB,EAAE,UAAU,EAAE,oBAAY,CAAC,MAAM,EAAE,EAAE,YAAY,CAAC,CAAC;QAC9E,IAAI,CAAC,mBAAmB,EAAE;YACxB,IAAI,CAA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,MAAM,IAAI,0BAAmB,CAAC,0BAA0B,CAAC,CAAC;IAC5D,CAAC;CACF;AAhJD,wCAgJC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { AsyncKeyAgent } from '../types';
|
|
2
|
-
import { Cardano
|
|
2
|
+
import { Cardano } from '@cardano-sdk/core';
|
|
3
3
|
import { Cip30DataSignature } from '@cardano-sdk/dapp-connector';
|
|
4
|
+
import { ComposableError, HexBlob } from '@cardano-sdk/util';
|
|
4
5
|
export interface Cip30SignDataRequest {
|
|
5
6
|
keyAgent: AsyncKeyAgent;
|
|
6
7
|
signWith: Cardano.Address | Cardano.RewardAccount;
|
|
7
|
-
payload:
|
|
8
|
+
payload: HexBlob;
|
|
8
9
|
}
|
|
9
10
|
export declare enum Cip30DataSignErrorCode {
|
|
10
11
|
ProofGeneration = 1,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cip30signData.d.ts","sourceRoot":"","sources":["../../../src/cip8/cip30signData.ts"],"names":[],"mappings":"
|
|
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,EAAyB,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,eAAe,EAAE,OAAO,EAAiB,MAAM,mBAAmB,CAAC;AAK5E,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,aAAa,CAAC;IACxB,QAAQ,EAAE,OAAO,CAAC,OAAO,GAAG,OAAO,CAAC,aAAa,CAAC;IAClD,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;AA2DD,eAAO,MAAM,aAAa,oCAIvB,oBAAoB,KAAG,QAAQ,kBAAkB,CAmBnD,CAAC"}
|