@cardano-sdk/key-management 0.21.1 → 0.22.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 +3 -0
- package/dist/cjs/InMemoryKeyAgent.d.ts.map +1 -1
- package/dist/cjs/InMemoryKeyAgent.js +4 -0
- package/dist/cjs/InMemoryKeyAgent.js.map +1 -1
- package/dist/cjs/KeyAgentBase.d.ts +3 -0
- package/dist/cjs/KeyAgentBase.d.ts.map +1 -1
- package/dist/cjs/KeyAgentBase.js.map +1 -1
- package/dist/cjs/cip8/cip30signData.d.ts +7 -4
- package/dist/cjs/cip8/cip30signData.d.ts.map +1 -1
- package/dist/cjs/cip8/cip30signData.js +18 -17
- package/dist/cjs/cip8/cip30signData.js.map +1 -1
- package/dist/cjs/cip8/index.d.ts +2 -0
- package/dist/cjs/cip8/index.d.ts.map +1 -1
- package/dist/cjs/cip8/index.js +2 -0
- package/dist/cjs/cip8/index.js.map +1 -1
- package/dist/cjs/cip8/types.d.ts +12 -0
- package/dist/cjs/cip8/types.d.ts.map +1 -1
- package/dist/cjs/tsconfig.tsbuildinfo +1 -1
- package/dist/cjs/types.d.ts +7 -6
- 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/createWitnesser.d.ts +4 -3
- package/dist/cjs/util/createWitnesser.d.ts.map +1 -1
- package/dist/cjs/util/createWitnesser.js +2 -2
- package/dist/cjs/util/createWitnesser.js.map +1 -1
- package/dist/cjs/util/key.d.ts +1 -1
- package/dist/cjs/util/key.d.ts.map +1 -1
- package/dist/cjs/util/key.js +1 -1
- package/dist/cjs/util/key.js.map +1 -1
- package/dist/esm/InMemoryKeyAgent.d.ts +3 -0
- package/dist/esm/InMemoryKeyAgent.d.ts.map +1 -1
- package/dist/esm/InMemoryKeyAgent.js +4 -0
- package/dist/esm/InMemoryKeyAgent.js.map +1 -1
- package/dist/esm/KeyAgentBase.d.ts +3 -0
- package/dist/esm/KeyAgentBase.d.ts.map +1 -1
- package/dist/esm/KeyAgentBase.js.map +1 -1
- package/dist/esm/cip8/cip30signData.d.ts +7 -4
- package/dist/esm/cip8/cip30signData.d.ts.map +1 -1
- package/dist/esm/cip8/cip30signData.js +7 -8
- package/dist/esm/cip8/cip30signData.js.map +1 -1
- package/dist/esm/cip8/index.d.ts +2 -0
- package/dist/esm/cip8/index.d.ts.map +1 -1
- package/dist/esm/cip8/index.js +2 -0
- package/dist/esm/cip8/index.js.map +1 -1
- package/dist/esm/cip8/types.d.ts +12 -0
- package/dist/esm/cip8/types.d.ts.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/dist/esm/types.d.ts +7 -6
- 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/createWitnesser.d.ts +4 -3
- package/dist/esm/util/createWitnesser.d.ts.map +1 -1
- package/dist/esm/util/createWitnesser.js +2 -2
- package/dist/esm/util/createWitnesser.js.map +1 -1
- package/dist/esm/util/key.d.ts +1 -1
- package/dist/esm/util/key.d.ts.map +1 -1
- package/dist/esm/util/key.js +1 -1
- package/dist/esm/util/key.js.map +1 -1
- package/package.json +5 -5
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as Crypto from '@cardano-sdk/crypto';
|
|
2
2
|
import { AccountKeyDerivationPath, GetPassphrase, KeyAgent, KeyAgentDependencies, KeyPair, KeyPurpose, SerializableInMemoryKeyAgentData, SignBlobResult, SignTransactionContext, SignTransactionOptions } from './types';
|
|
3
3
|
import { Cardano } from '@cardano-sdk/core';
|
|
4
|
+
import { Cip30DataSignature } from '@cardano-sdk/dapp-connector';
|
|
5
|
+
import { Cip8SignDataContext } from './cip8';
|
|
4
6
|
import { HexBlob } from '@cardano-sdk/util';
|
|
5
7
|
import { KeyAgentBase } from './KeyAgentBase';
|
|
6
8
|
export interface InMemoryKeyAgentProps extends Omit<SerializableInMemoryKeyAgentData, '__typename'> {
|
|
@@ -18,6 +20,7 @@ export declare class InMemoryKeyAgent extends KeyAgentBase implements KeyAgent {
|
|
|
18
20
|
#private;
|
|
19
21
|
constructor({ getPassphrase, ...serializableData }: InMemoryKeyAgentProps, dependencies: KeyAgentDependencies);
|
|
20
22
|
signBlob({ index, role: type }: AccountKeyDerivationPath, blob: HexBlob): Promise<SignBlobResult>;
|
|
23
|
+
signCip8Data(context: Cip8SignDataContext): Promise<Cip30DataSignature>;
|
|
21
24
|
exportRootPrivateKey(): Promise<Crypto.Bip32PrivateKeyHex>;
|
|
22
25
|
static fromBip39MnemonicWords({ chainId, getPassphrase, mnemonicWords, mnemonic2ndFactorPassphrase, accountIndex, purpose }: FromBip39MnemonicWordsProps, dependencies: KeyAgentDependencies): Promise<InMemoryKeyAgent>;
|
|
23
26
|
signTransaction({ body, hash }: Cardano.TxBodyWithHash, { txInKeyPathMap, knownAddresses }: SignTransactionContext, { additionalKeyPaths }?: SignTransactionOptions): Promise<Cardano.Signatures>;
|
|
@@ -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,UAAU,EACV,gCAAgC,EAChC,cAAc,EACd,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAm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AO,EAAE,mBAAmB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IASvE,oBAAoB,IAAI,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC;WAOnD,sBAAsB,CACjC,EACE,OAAO,EACP,aAAa,EACb,aAAa,EACb,2BAAgC,EAChC,YAAgB,EAChB,OAA6B,EAC9B,EAAE,2BAA2B,EAC9B,YAAY,EAAE,oBAAoB,GACjC,OAAO,CAAC,gBAAgB,CAAC;IA8BtB,eAAe,CACnB,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,OAAO,CAAC,cAAc,EACtC,EAAE,cAAc,EAAE,cAAc,EAAE,EAAE,sBAAsB,EAC1D,EAAE,kBAAuB,EAAE,GAAE,sBAA2B,GACvD,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;IAuBxB,qBAAqB,CAAC,cAAc,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC;CAyBxE"}
|
|
@@ -42,6 +42,7 @@ 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 cip8_1 = require("./cip8");
|
|
45
46
|
const util_1 = require("./util");
|
|
46
47
|
const util_2 = require("@cardano-sdk/util");
|
|
47
48
|
const KeyAgentBase_1 = require("./KeyAgentBase");
|
|
@@ -76,6 +77,9 @@ class InMemoryKeyAgent extends KeyAgentBase_1.KeyAgentBase {
|
|
|
76
77
|
const publicKey = await this.bip32Ed25519.getPublicKey(signingKey);
|
|
77
78
|
return { publicKey, signature };
|
|
78
79
|
}
|
|
80
|
+
async signCip8Data(context) {
|
|
81
|
+
return await (0, cip8_1.cip30signData)(this, context);
|
|
82
|
+
}
|
|
79
83
|
async exportRootPrivateKey() {
|
|
80
84
|
return await __classPrivateFieldGet(this, _InMemoryKeyAgent_instances, "m", _InMemoryKeyAgent_decryptRootPrivateKey).call(this, true);
|
|
81
85
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InMemoryKeyAgent.js","sourceRoot":"","sources":["../../src/InMemoryKeyAgent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA8C;AAC9C,iDAAmC;AACnC,mCAYiB;
|
|
1
|
+
{"version":3,"file":"InMemoryKeyAgent.js","sourceRoot":"","sources":["../../src/InMemoryKeyAgent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4DAA8C;AAC9C,iDAAmC;AACnC,mCAYiB;AAGjB,iCAA4D;AAC5D,iCAQgB;AAChB,4CAA4C;AAC5C,iDAA8C;AAC9C,mCAAqD;AACrD,iEAAsC;AAetC,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,8BA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AC;IAC5F,IAAI,qBAAiC,CAAC;IAEtC,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"}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as Crypto from '@cardano-sdk/crypto';
|
|
2
2
|
import { AccountAddressDerivationPath, AccountKeyDerivationPath, GroupedAddress, KeyAgent, KeyAgentDependencies, KeyPurpose, SerializableKeyAgentData, SignBlobResult, SignTransactionContext, SignTransactionOptions } from './types';
|
|
3
3
|
import { Cardano } from '@cardano-sdk/core';
|
|
4
|
+
import { Cip30DataSignature } from '@cardano-sdk/dapp-connector';
|
|
5
|
+
import { Cip8SignDataContext } from './cip8';
|
|
4
6
|
import { HexBlob } from '@cardano-sdk/util';
|
|
5
7
|
export declare abstract class KeyAgentBase implements KeyAgent {
|
|
6
8
|
#private;
|
|
@@ -11,6 +13,7 @@ export declare abstract class KeyAgentBase implements KeyAgent {
|
|
|
11
13
|
get bip32Ed25519(): Crypto.Bip32Ed25519;
|
|
12
14
|
get purpose(): KeyPurpose;
|
|
13
15
|
abstract signBlob(derivationPath: AccountKeyDerivationPath, blob: HexBlob): Promise<SignBlobResult>;
|
|
16
|
+
abstract signCip8Data(context: Cip8SignDataContext): Promise<Cip30DataSignature>;
|
|
14
17
|
abstract exportRootPrivateKey(): Promise<Crypto.Bip32PrivateKeyHex>;
|
|
15
18
|
abstract signTransaction(txInternals: Cardano.TxBodyWithHash, context: SignTransactionContext, signTransactionOptions?: SignTransactionOptions): Promise<Cardano.Signatures>;
|
|
16
19
|
constructor(serializableData: SerializableKeyAgentData, { bip32Ed25519 }: KeyAgentDependencies);
|
|
@@ -1 +1 @@
|
|
|
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,EACpB,UAAU,EACV,wBAAwB,EACxB,cAAc,EACd,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,SAAS,CAAC;AAEjB,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,8BAAsB,YAAa,YAAW,QAAQ;;IAKpD,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,IAAI,OAAO,IAAI,UAAU,CAExB;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,OAAO,EAAE,sBAAsB,EAC/B,sBAAsB,CAAC,EAAE,sBAAsB,GAC9C,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;gBAElB,gBAAgB,EAAE,wBAAwB,EAAE,EAAE,YAAY,EAAE,EAA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B,IAAI,OAAO,CAAC,MAAM,CAAC,kBAAkB,CAAC;IACnE,QAAQ,CAAC,eAAe,CACtB,WAAW,EAAE,OAAO,CAAC,cAAc,EACnC,OAAO,EAAE,sBAAsB,EAC/B,sBAAsB,CAAC,EAAE,sBAAsB,GAC9C,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC;gBAElB,gBAAgB,EAAE,wBAAwB,EAAE,EAAE,YAAY,EAAE,EAAE,oBAAoB;IAOxF,aAAa,CACjB,wBAAwB,EAAE,4BAA4B,EACtD,uBAAuB,EAAE,MAAM,GAC9B,OAAO,CAAC,cAAc,CAAC;IAIpB,eAAe,CAAC,cAAc,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,mBAAmB,CAAC;CAGrG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KeyAgentBase.js","sourceRoot":"","sources":["../../src/KeyAgentBase.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,mCAWiB;AACjB,iDAA8C;
|
|
1
|
+
{"version":3,"file":"KeyAgentBase.js","sourceRoot":"","sources":["../../src/KeyAgentBase.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AACA,mCAWiB;AACjB,iDAA8C;AAM9C,MAAsB,YAAY;IAkChC,YAAY,gBAA0C,EAAE,EAAE,YAAY,EAAwB;QAjC9F,iDAAqD;QACrD,6CAA4C;QAC5C,wCAAgC;QAgC9B,uBAAA,IAAI,kCAAqB,gBAAgB,MAAA,CAAC;QAC1C,uBAAA,IAAI,8BAAiB,YAAY,MAAA,CAAC;QAClC,uBAAA,IAAI,yBAAY,IAAI,2BAAY,CAAC,gBAAgB,CAAC,MAAA,CAAC;IACrD,CAAC;IAjCD,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,CAAC;IACvC,CAAC;IACD,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC;IAC5C,CAAC;IACD,IAAI,YAAY;QACd,OAAO,uBAAA,IAAI,kCAAc,CAAC;IAC5B,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,gBAAgB,CAAC,OAAO,IAAI,kBAAU,CAAC,QAAQ,CAAC;IAC9D,CAAC;IAkBD,KAAK,CAAC,aAAa,CACjB,wBAAsD,EACtD,uBAA+B;QAE/B,OAAO,uBAAA,IAAI,6BAAS,CAAC,aAAa,CAAC,wBAAwB,EAAE,uBAAuB,CAAC,CAAC;IACxF,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,cAAwC;QAC5D,OAAO,CAAC,MAAM,uBAAA,IAAI,6BAAS,CAAC,eAAe,CAAC,cAAc,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC;IACrE,CAAC;CACF;AAnDD,oCAmDC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import * as Crypto from '@cardano-sdk/crypto';
|
|
2
|
+
import { GroupedAddress, KeyAgent, MessageSender } from '../types';
|
|
3
|
+
import { COSEKey } from '@emurgo/cardano-message-signing-nodejs';
|
|
3
4
|
import { Cardano } from '@cardano-sdk/core';
|
|
4
5
|
import { Cip30DataSignature } from '@cardano-sdk/dapp-connector';
|
|
6
|
+
import { Cip8SignDataContext } from './types';
|
|
5
7
|
import { ComposableError, HexBlob } from '@cardano-sdk/util';
|
|
6
8
|
export interface Cip30SignDataRequest {
|
|
7
9
|
knownAddresses: GroupedAddress[];
|
|
8
|
-
witnesser: Bip32Ed25519Witnesser;
|
|
9
10
|
signWith: Cardano.PaymentAddress | Cardano.RewardAccount | Cardano.DRepID;
|
|
10
11
|
payload: HexBlob;
|
|
11
12
|
sender?: MessageSender;
|
|
@@ -20,5 +21,7 @@ export declare class Cip30DataSignError<InnerError = unknown> extends Composable
|
|
|
20
21
|
readonly info: string;
|
|
21
22
|
constructor(code: Cip30DataSignErrorCode, info: string, innerError?: InnerError);
|
|
22
23
|
}
|
|
23
|
-
export declare const
|
|
24
|
+
export declare const getAddressBytes: (signWith: Cardano.PaymentAddress | Cardano.RewardAccount | Cardano.DRepID) => Buffer;
|
|
25
|
+
export declare const createCoseKey: (addressBytes: Uint8Array, publicKey: Crypto.Ed25519PublicKeyHex) => COSEKey;
|
|
26
|
+
export declare const cip30signData: (keyAgent: KeyAgent, { knownAddresses, signWith, payload }: Cip8SignDataContext) => Promise<Cip30DataSignature>;
|
|
24
27
|
//# sourceMappingURL=cip30signData.d.ts.map
|
|
@@ -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":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAA4B,cAAc,EAAE,QAAQ,EAAW,aAAa,EAAE,MAAM,UAAU,CAAC;AACtG,OAAO,EAGL,OAAO,EASR,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,OAAO,EAAQ,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAI7D,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,cAAc,EAAE,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAC1E,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,aAAa,CAAC;CACxB;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;AAED,eAAO,MAAM,eAAe,aAAc,QAAQ,cAAc,GAAG,QAAQ,aAAa,GAAG,QAAQ,MAAM,WAQxG,CAAC;AAmDF,eAAO,MAAM,aAAa,iBAAkB,UAAU,aAAa,OAAO,mBAAmB,YAO5F,CAAC;AAQF,eAAO,MAAM,aAAa,aACd,QAAQ,yCACqB,mBAAmB,KACzD,QAAQ,kBAAkB,CAuB5B,CAAC"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cip30signData = exports.Cip30DataSignError = exports.Cip30DataSignErrorCode = void 0;
|
|
3
|
+
exports.cip30signData = exports.createCoseKey = exports.getAddressBytes = exports.Cip30DataSignError = exports.Cip30DataSignErrorCode = void 0;
|
|
4
4
|
const cardano_message_signing_nodejs_1 = require("@emurgo/cardano-message-signing-nodejs");
|
|
5
|
-
const util_1 = require("../util");
|
|
6
5
|
const core_1 = require("@cardano-sdk/core");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
6
|
+
const util_1 = require("@cardano-sdk/util");
|
|
7
|
+
const util_2 = require("./util");
|
|
8
|
+
const util_3 = require("../util");
|
|
9
9
|
var Cip30DataSignErrorCode;
|
|
10
10
|
(function (Cip30DataSignErrorCode) {
|
|
11
11
|
Cip30DataSignErrorCode[Cip30DataSignErrorCode["ProofGeneration"] = 1] = "ProofGeneration";
|
|
12
12
|
Cip30DataSignErrorCode[Cip30DataSignErrorCode["AddressNotPK"] = 2] = "AddressNotPK";
|
|
13
13
|
Cip30DataSignErrorCode[Cip30DataSignErrorCode["UserDeclined"] = 3] = "UserDeclined";
|
|
14
14
|
})(Cip30DataSignErrorCode = exports.Cip30DataSignErrorCode || (exports.Cip30DataSignErrorCode = {}));
|
|
15
|
-
class Cip30DataSignError extends
|
|
15
|
+
class Cip30DataSignError extends util_1.ComposableError {
|
|
16
16
|
constructor(code, info, innerError) {
|
|
17
17
|
super(`DataSignError code: ${code}`, innerError);
|
|
18
18
|
this.code = code;
|
|
@@ -27,16 +27,17 @@ const getAddressBytes = (signWith) => {
|
|
|
27
27
|
}
|
|
28
28
|
return Buffer.from(address.toBytes(), 'hex');
|
|
29
29
|
};
|
|
30
|
+
exports.getAddressBytes = getAddressBytes;
|
|
30
31
|
const getDerivationPath = async (signWith, knownAddresses) => {
|
|
31
32
|
if (core_1.Cardano.DRepID.isValid(signWith)) {
|
|
32
|
-
return
|
|
33
|
+
return util_3.DREP_KEY_DERIVATION_PATH;
|
|
33
34
|
}
|
|
34
35
|
const isRewardAccount = signWith.startsWith('stake');
|
|
35
36
|
if (isRewardAccount) {
|
|
36
37
|
const knownRewardAddress = knownAddresses.find(({ rewardAccount }) => rewardAccount === signWith);
|
|
37
38
|
if (!knownRewardAddress)
|
|
38
39
|
throw new Cip30DataSignError(Cip30DataSignErrorCode.ProofGeneration, 'Unknown reward address');
|
|
39
|
-
return knownRewardAddress.stakeKeyDerivationPath ||
|
|
40
|
+
return knownRewardAddress.stakeKeyDerivationPath || util_3.STAKE_KEY_DERIVATION_PATH;
|
|
40
41
|
}
|
|
41
42
|
const knownAddress = knownAddresses.find(({ address }) => address === signWith);
|
|
42
43
|
if (!knownAddress) {
|
|
@@ -47,14 +48,13 @@ const getDerivationPath = async (signWith, knownAddresses) => {
|
|
|
47
48
|
const createSigStructureHeaders = (addressBytes) => {
|
|
48
49
|
const protectedHeaders = cardano_message_signing_nodejs_1.HeaderMap.new();
|
|
49
50
|
protectedHeaders.set_key_id(addressBytes);
|
|
50
|
-
protectedHeaders.set_header(
|
|
51
|
+
protectedHeaders.set_header(util_2.CoseLabel.address, cardano_message_signing_nodejs_1.CBORValue.new_bytes(addressBytes));
|
|
51
52
|
protectedHeaders.set_algorithm_id(cardano_message_signing_nodejs_1.Label.from_algorithm_id(cardano_message_signing_nodejs_1.AlgorithmId.EdDSA));
|
|
52
53
|
return protectedHeaders;
|
|
53
54
|
};
|
|
54
|
-
const signSigStructure = (
|
|
55
|
+
const signSigStructure = (keyAgent, derivationPath, sigStructure) => {
|
|
55
56
|
try {
|
|
56
|
-
|
|
57
|
-
return witnesser.signBlob(derivationPath, core_1.util.bytesToHex(sigStructure.to_bytes()), { address, payload, sender });
|
|
57
|
+
return keyAgent.signBlob(derivationPath, core_1.util.bytesToHex(sigStructure.to_bytes()));
|
|
58
58
|
}
|
|
59
59
|
catch (error) {
|
|
60
60
|
throw new Cip30DataSignError(Cip30DataSignErrorCode.UserDeclined, 'Failed to sign', error);
|
|
@@ -64,21 +64,22 @@ const createCoseKey = (addressBytes, publicKey) => {
|
|
|
64
64
|
const coseKey = cardano_message_signing_nodejs_1.COSEKey.new(cardano_message_signing_nodejs_1.Label.from_key_type(cardano_message_signing_nodejs_1.KeyType.OKP));
|
|
65
65
|
coseKey.set_key_id(addressBytes);
|
|
66
66
|
coseKey.set_algorithm_id(cardano_message_signing_nodejs_1.Label.from_algorithm_id(cardano_message_signing_nodejs_1.AlgorithmId.EdDSA));
|
|
67
|
-
coseKey.set_header(
|
|
68
|
-
coseKey.set_header(
|
|
67
|
+
coseKey.set_header(util_2.CoseLabel.crv, cardano_message_signing_nodejs_1.CBORValue.from_label(cardano_message_signing_nodejs_1.Label.from_curve_type(cardano_message_signing_nodejs_1.CurveType.Ed25519)));
|
|
68
|
+
coseKey.set_header(util_2.CoseLabel.x, cardano_message_signing_nodejs_1.CBORValue.new_bytes(Buffer.from(publicKey, 'hex')));
|
|
69
69
|
return coseKey;
|
|
70
70
|
};
|
|
71
|
-
|
|
71
|
+
exports.createCoseKey = createCoseKey;
|
|
72
|
+
const cip30signData = async (keyAgent, { knownAddresses, signWith, payload }) => {
|
|
72
73
|
if (core_1.Cardano.DRepID.isValid(signWith) && !core_1.Cardano.DRepID.canSign(signWith)) {
|
|
73
74
|
throw new Cip30DataSignError(Cip30DataSignErrorCode.AddressNotPK, 'Invalid address');
|
|
74
75
|
}
|
|
75
|
-
const addressBytes = getAddressBytes(signWith);
|
|
76
|
+
const addressBytes = (0, exports.getAddressBytes)(signWith);
|
|
76
77
|
const derivationPath = await getDerivationPath(signWith, knownAddresses);
|
|
77
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);
|
|
78
79
|
const sigStructure = builder.make_data_to_sign();
|
|
79
|
-
const { signature, publicKey } = await signSigStructure(
|
|
80
|
+
const { signature, publicKey } = await signSigStructure(keyAgent, derivationPath, sigStructure);
|
|
80
81
|
const coseSign1 = builder.build(Buffer.from(signature, 'hex'));
|
|
81
|
-
const coseKey = createCoseKey(addressBytes, publicKey);
|
|
82
|
+
const coseKey = (0, exports.createCoseKey)(addressBytes, publicKey);
|
|
82
83
|
return {
|
|
83
84
|
key: core_1.util.bytesToHex(coseKey.to_bytes()),
|
|
84
85
|
signature: core_1.util.bytesToHex(coseSign1.to_bytes())
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cip30signData.js","sourceRoot":"","sources":["../../../src/cip8/cip30signData.ts"],"names":[],"mappings":";;;AAEA,2FAYgD;AAChD,
|
|
1
|
+
{"version":3,"file":"cip30signData.js","sourceRoot":"","sources":["../../../src/cip8/cip30signData.ts"],"names":[],"mappings":";;;AAEA,2FAYgD;AAChD,4CAAkD;AAGlD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wCAAO,CAAC,GAAG,CAAC,mDAAkB,CAAC,GAAG,CAAC,yBAAyB,CAAC,YAAY,CAAC,CAAC,EAAE,0CAAS,CAAC,GAAG,EAAE,CAAC,EAC7F,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,EAC3B,KAAK,CACN,CAAC;IACF,MAAM,YAAY,GAAG,OAAO,CAAC,iBAAiB,EAAE,CAAC;IACjD,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,MAAM,gBAAgB,CAAC,QAAQ,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;IAEhG,MAAM,SAAS,GAAG,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC;IAE/D,MAAM,OAAO,GAAG,IAAA,qBAAa,EAAC,YAAY,EAAE,SAAS,CAAC,CAAC;IAEvD,OAAO;QACL,GAAG,EAAE,WAAI,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACxC,SAAS,EAAE,WAAI,CAAC,UAAU,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC;KACjD,CAAC;AACJ,CAAC,CAAC;AA1BW,QAAA,aAAa,iBA0BxB"}
|
package/dist/cjs/cip8/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cip8/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cip8/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC"}
|
package/dist/cjs/cip8/index.js
CHANGED
|
@@ -15,4 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./cip30signData"), exports);
|
|
18
|
+
__exportStar(require("./types"), exports);
|
|
19
|
+
__exportStar(require("./util"), exports);
|
|
18
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cip8/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/cip8/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,kDAAgC;AAChC,0CAAwB;AACxB,yCAAuB"}
|
package/dist/cjs/cip8/types.d.ts
CHANGED
|
@@ -1,4 +1,16 @@
|
|
|
1
|
+
import * as Crypto from '@cardano-sdk/crypto';
|
|
2
|
+
import { Cardano } from '@cardano-sdk/core';
|
|
3
|
+
import { GroupedAddress } from '../types';
|
|
1
4
|
import { HexBlob } from '@cardano-sdk/util';
|
|
2
5
|
export declare type CoseSign1CborHex = HexBlob;
|
|
3
6
|
export declare type CoseKeyCborHex = HexBlob;
|
|
7
|
+
export interface Cip8SignDataContext {
|
|
8
|
+
knownAddresses: GroupedAddress[];
|
|
9
|
+
signWith: Cardano.PaymentAddress | Cardano.RewardAccount | Cardano.DRepID;
|
|
10
|
+
payload: HexBlob;
|
|
11
|
+
}
|
|
12
|
+
export interface Cip8SignResult {
|
|
13
|
+
publicKey: Crypto.Ed25519PublicKeyHex;
|
|
14
|
+
signature: Crypto.Ed25519SignatureHex;
|
|
15
|
+
}
|
|
4
16
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cip8/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,oBAAY,gBAAgB,GAAG,OAAO,CAAC;AACvC,oBAAY,cAAc,GAAG,OAAO,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/cip8/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAE5C,oBAAY,gBAAgB,GAAG,OAAO,CAAC;AACvC,oBAAY,cAAc,GAAG,OAAO,CAAC;AAErC,MAAM,WAAW,mBAAmB;IAClC,cAAc,EAAE,cAAc,EAAE,CAAC;IACjC,QAAQ,EAAE,OAAO,CAAC,cAAc,GAAG,OAAO,CAAC,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;IAC1E,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC,mBAAmB,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC,mBAAmB,CAAC;CACvC"}
|