@canton-network/core-signing-participant 0.9.0 → 0.10.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/index.cjs +47 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.js +45 -3
- package/dist/index.js.map +1 -0
- package/package.json +19 -8
- package/dist/controller.js +0 -38
- package/dist/controller.test.d.ts +0 -2
- package/dist/controller.test.d.ts.map +0 -1
- package/dist/controller.test.js +0 -26
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var coreSigningLib = require('@canton-network/core-signing-lib');
|
|
4
|
+
var crypto = require('crypto');
|
|
5
|
+
|
|
6
|
+
var __defProp = Object.defineProperty;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
9
|
+
var ParticipantSigningDriver = class {
|
|
10
|
+
constructor() {
|
|
11
|
+
__publicField(this, "partyMode", coreSigningLib.PartyMode.INTERNAL);
|
|
12
|
+
__publicField(this, "signingProvider", coreSigningLib.SigningProvider.PARTICIPANT);
|
|
13
|
+
__publicField(this, "controller", (_userId) => coreSigningLib.buildController({
|
|
14
|
+
signTransaction: async (params) => {
|
|
15
|
+
return Promise.resolve({
|
|
16
|
+
txId: params.internalTxId || crypto.randomUUID(),
|
|
17
|
+
status: "signed"
|
|
18
|
+
});
|
|
19
|
+
},
|
|
20
|
+
getTransaction: function() {
|
|
21
|
+
throw new Error("Function not implemented.");
|
|
22
|
+
},
|
|
23
|
+
getTransactions: function() {
|
|
24
|
+
throw new Error("Function not implemented.");
|
|
25
|
+
},
|
|
26
|
+
getKeys: function() {
|
|
27
|
+
throw new Error("Function not implemented.");
|
|
28
|
+
},
|
|
29
|
+
createKey: function() {
|
|
30
|
+
throw new Error("Function not implemented.");
|
|
31
|
+
},
|
|
32
|
+
getConfiguration: function() {
|
|
33
|
+
throw new Error("Function not implemented.");
|
|
34
|
+
},
|
|
35
|
+
setConfiguration: function() {
|
|
36
|
+
throw new Error("Function not implemented.");
|
|
37
|
+
},
|
|
38
|
+
subscribeTransactions: function() {
|
|
39
|
+
throw new Error("Function not implemented.");
|
|
40
|
+
}
|
|
41
|
+
}));
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
exports.ParticipantSigningDriver = ParticipantSigningDriver;
|
|
46
|
+
//# sourceMappingURL=index.cjs.map
|
|
47
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/controller.ts"],"names":["PartyMode","SigningProvider","buildController","randomUUID"],"mappings":";;;;;;;;AAqBO,IAAM,2BAAN,MAAiE;AAAA,EAAjE,WAAA,GAAA;AACH,IAAA,aAAA,CAAA,IAAA,EAAO,aAAYA,wBAAA,CAAU,QAAA,CAAA;AAC7B,IAAA,aAAA,CAAA,IAAA,EAAO,mBAAkBC,8BAAA,CAAgB,WAAA,CAAA;AAEzC,IAAA,aAAA,CAAA,IAAA,EAAO,YAAA,EAAa,CAChB,OAAA,KAEAC,8BAAA,CAAgB;AAAA,MACZ,eAAA,EAAiB,OACb,MAAA,KACiC;AACjC,QAAA,OAAO,QAAQ,OAAA,CAAQ;AAAA,UACnB,IAAA,EAAM,MAAA,CAAO,YAAA,IAAgBC,iBAAA,EAAW;AAAA,UACxC,MAAA,EAAQ;AAAA,SACX,CAAA;AAAA,MACL,CAAA;AAAA,MACA,gBAAgB,WAA2C;AACvD,QAAA,MAAM,IAAI,MAAM,2BAA2B,CAAA;AAAA,MAC/C,CAAA;AAAA,MACA,iBAAiB,WAA4C;AACzD,QAAA,MAAM,IAAI,MAAM,2BAA2B,CAAA;AAAA,MAC/C,CAAA;AAAA,MACA,SAAS,WAAoC;AACzC,QAAA,MAAM,IAAI,MAAM,2BAA2B,CAAA;AAAA,MAC/C,CAAA;AAAA,MACA,WAAW,WAAsC;AAC7C,QAAA,MAAM,IAAI,MAAM,2BAA2B,CAAA;AAAA,MAC/C,CAAA;AAAA,MACA,kBAAkB,WAA6C;AAC3D,QAAA,MAAM,IAAI,MAAM,2BAA2B,CAAA;AAAA,MAC/C,CAAA;AAAA,MACA,kBAAkB,WAA6C;AAC3D,QAAA,MAAM,IAAI,MAAM,2BAA2B,CAAA;AAAA,MAC/C,CAAA;AAAA,MACA,uBACI,WAAkD;AAC9C,QAAA,MAAM,IAAI,MAAM,2BAA2B,CAAA;AAAA,MAC/C;AAAA,KACP,CAAA,CAAA;AAAA,EAAA;AACT","file":"index.cjs","sourcesContent":["// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n buildController,\n CreateKeyResult,\n GetConfigurationResult,\n GetKeysResult,\n GetTransactionResult,\n GetTransactionsResult,\n PartyMode,\n SetConfigurationResult,\n SigningDriverInterface,\n SigningProvider,\n SignTransactionParams,\n SignTransactionResult,\n SubscribeTransactionsResult,\n} from '@canton-network/core-signing-lib'\nimport { AuthContext } from '@canton-network/core-wallet-auth'\nimport { randomUUID } from 'node:crypto'\n\nexport class ParticipantSigningDriver implements SigningDriverInterface {\n public partyMode = PartyMode.INTERNAL\n public signingProvider = SigningProvider.PARTICIPANT\n\n public controller = (\n _userId: AuthContext['userId'] | undefined // eslint-disable-line @typescript-eslint/no-unused-vars\n ) =>\n buildController({\n signTransaction: async (\n params: SignTransactionParams\n ): Promise<SignTransactionResult> => {\n return Promise.resolve({\n txId: params.internalTxId || randomUUID(),\n status: 'signed',\n })\n },\n getTransaction: function (): Promise<GetTransactionResult> {\n throw new Error('Function not implemented.')\n },\n getTransactions: function (): Promise<GetTransactionsResult> {\n throw new Error('Function not implemented.')\n },\n getKeys: function (): Promise<GetKeysResult> {\n throw new Error('Function not implemented.')\n },\n createKey: function (): Promise<CreateKeyResult> {\n throw new Error('Function not implemented.')\n },\n getConfiguration: function (): Promise<GetConfigurationResult> {\n throw new Error('Function not implemented.')\n },\n setConfiguration: function (): Promise<SetConfigurationResult> {\n throw new Error('Function not implemented.')\n },\n subscribeTransactions:\n function (): Promise<SubscribeTransactionsResult> {\n throw new Error('Function not implemented.')\n },\n })\n}\n"]}
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,45 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { PartyMode, SigningProvider, buildController } from '@canton-network/core-signing-lib';
|
|
2
|
+
import { randomUUID } from 'crypto';
|
|
3
|
+
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
|
+
var ParticipantSigningDriver = class {
|
|
8
|
+
constructor() {
|
|
9
|
+
__publicField(this, "partyMode", PartyMode.INTERNAL);
|
|
10
|
+
__publicField(this, "signingProvider", SigningProvider.PARTICIPANT);
|
|
11
|
+
__publicField(this, "controller", (_userId) => buildController({
|
|
12
|
+
signTransaction: async (params) => {
|
|
13
|
+
return Promise.resolve({
|
|
14
|
+
txId: params.internalTxId || randomUUID(),
|
|
15
|
+
status: "signed"
|
|
16
|
+
});
|
|
17
|
+
},
|
|
18
|
+
getTransaction: function() {
|
|
19
|
+
throw new Error("Function not implemented.");
|
|
20
|
+
},
|
|
21
|
+
getTransactions: function() {
|
|
22
|
+
throw new Error("Function not implemented.");
|
|
23
|
+
},
|
|
24
|
+
getKeys: function() {
|
|
25
|
+
throw new Error("Function not implemented.");
|
|
26
|
+
},
|
|
27
|
+
createKey: function() {
|
|
28
|
+
throw new Error("Function not implemented.");
|
|
29
|
+
},
|
|
30
|
+
getConfiguration: function() {
|
|
31
|
+
throw new Error("Function not implemented.");
|
|
32
|
+
},
|
|
33
|
+
setConfiguration: function() {
|
|
34
|
+
throw new Error("Function not implemented.");
|
|
35
|
+
},
|
|
36
|
+
subscribeTransactions: function() {
|
|
37
|
+
throw new Error("Function not implemented.");
|
|
38
|
+
}
|
|
39
|
+
}));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export { ParticipantSigningDriver };
|
|
44
|
+
//# sourceMappingURL=index.js.map
|
|
45
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/controller.ts"],"names":[],"mappings":";;;;;;AAqBO,IAAM,2BAAN,MAAiE;AAAA,EAAjE,WAAA,GAAA;AACH,IAAA,aAAA,CAAA,IAAA,EAAO,aAAY,SAAA,CAAU,QAAA,CAAA;AAC7B,IAAA,aAAA,CAAA,IAAA,EAAO,mBAAkB,eAAA,CAAgB,WAAA,CAAA;AAEzC,IAAA,aAAA,CAAA,IAAA,EAAO,YAAA,EAAa,CAChB,OAAA,KAEA,eAAA,CAAgB;AAAA,MACZ,eAAA,EAAiB,OACb,MAAA,KACiC;AACjC,QAAA,OAAO,QAAQ,OAAA,CAAQ;AAAA,UACnB,IAAA,EAAM,MAAA,CAAO,YAAA,IAAgB,UAAA,EAAW;AAAA,UACxC,MAAA,EAAQ;AAAA,SACX,CAAA;AAAA,MACL,CAAA;AAAA,MACA,gBAAgB,WAA2C;AACvD,QAAA,MAAM,IAAI,MAAM,2BAA2B,CAAA;AAAA,MAC/C,CAAA;AAAA,MACA,iBAAiB,WAA4C;AACzD,QAAA,MAAM,IAAI,MAAM,2BAA2B,CAAA;AAAA,MAC/C,CAAA;AAAA,MACA,SAAS,WAAoC;AACzC,QAAA,MAAM,IAAI,MAAM,2BAA2B,CAAA;AAAA,MAC/C,CAAA;AAAA,MACA,WAAW,WAAsC;AAC7C,QAAA,MAAM,IAAI,MAAM,2BAA2B,CAAA;AAAA,MAC/C,CAAA;AAAA,MACA,kBAAkB,WAA6C;AAC3D,QAAA,MAAM,IAAI,MAAM,2BAA2B,CAAA;AAAA,MAC/C,CAAA;AAAA,MACA,kBAAkB,WAA6C;AAC3D,QAAA,MAAM,IAAI,MAAM,2BAA2B,CAAA;AAAA,MAC/C,CAAA;AAAA,MACA,uBACI,WAAkD;AAC9C,QAAA,MAAM,IAAI,MAAM,2BAA2B,CAAA;AAAA,MAC/C;AAAA,KACP,CAAA,CAAA;AAAA,EAAA;AACT","file":"index.js","sourcesContent":["// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n buildController,\n CreateKeyResult,\n GetConfigurationResult,\n GetKeysResult,\n GetTransactionResult,\n GetTransactionsResult,\n PartyMode,\n SetConfigurationResult,\n SigningDriverInterface,\n SigningProvider,\n SignTransactionParams,\n SignTransactionResult,\n SubscribeTransactionsResult,\n} from '@canton-network/core-signing-lib'\nimport { AuthContext } from '@canton-network/core-wallet-auth'\nimport { randomUUID } from 'node:crypto'\n\nexport class ParticipantSigningDriver implements SigningDriverInterface {\n public partyMode = PartyMode.INTERNAL\n public signingProvider = SigningProvider.PARTICIPANT\n\n public controller = (\n _userId: AuthContext['userId'] | undefined // eslint-disable-line @typescript-eslint/no-unused-vars\n ) =>\n buildController({\n signTransaction: async (\n params: SignTransactionParams\n ): Promise<SignTransactionResult> => {\n return Promise.resolve({\n txId: params.internalTxId || randomUUID(),\n status: 'signed',\n })\n },\n getTransaction: function (): Promise<GetTransactionResult> {\n throw new Error('Function not implemented.')\n },\n getTransactions: function (): Promise<GetTransactionsResult> {\n throw new Error('Function not implemented.')\n },\n getKeys: function (): Promise<GetKeysResult> {\n throw new Error('Function not implemented.')\n },\n createKey: function (): Promise<CreateKeyResult> {\n throw new Error('Function not implemented.')\n },\n getConfiguration: function (): Promise<GetConfigurationResult> {\n throw new Error('Function not implemented.')\n },\n setConfiguration: function (): Promise<SetConfigurationResult> {\n throw new Error('Function not implemented.')\n },\n subscribeTransactions:\n function (): Promise<SubscribeTransactionsResult> {\n throw new Error('Function not implemented.')\n },\n })\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,23 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canton-network/core-signing-participant",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"packageManager": "yarn@4.9.4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"description": "Wallet Gateway driver for Canton participant internal parties",
|
|
7
7
|
"repository": "github:hyperledger-labs/splice-wallet-kernel",
|
|
8
8
|
"license": "Apache-2.0",
|
|
9
|
-
"main": "dist/index.
|
|
10
|
-
"
|
|
9
|
+
"main": "dist/index.cjs",
|
|
10
|
+
"module": "dist/index.js",
|
|
11
|
+
"types": "dist/types/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/types/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js",
|
|
16
|
+
"require": "./dist/index.cjs",
|
|
17
|
+
"default": "./dist/index.js"
|
|
18
|
+
}
|
|
19
|
+
},
|
|
11
20
|
"scripts": {
|
|
12
|
-
"build": "tsc -
|
|
21
|
+
"build": "tsup && tsc -p tsconfig.types.json",
|
|
22
|
+
"dev": "tsup --watch --onSuccess \"tsc -p tsconfig.types.json\"",
|
|
13
23
|
"clean": "tsc -b --clean && rm -rf ./dist",
|
|
14
24
|
"flatpack": "yarn pack --out \"$FLATPACK_OUTDIR\"",
|
|
15
|
-
"test": "
|
|
25
|
+
"test": "jest --passWithNoTests"
|
|
16
26
|
},
|
|
17
27
|
"dependencies": {
|
|
18
|
-
"@canton-network/core-ledger-client": "^0.
|
|
19
|
-
"@canton-network/core-signing-lib": "^0.
|
|
20
|
-
"@canton-network/core-wallet-auth": "^0.
|
|
28
|
+
"@canton-network/core-ledger-client": "^0.16.0",
|
|
29
|
+
"@canton-network/core-signing-lib": "^0.12.0",
|
|
30
|
+
"@canton-network/core-wallet-auth": "^0.11.0"
|
|
21
31
|
},
|
|
22
32
|
"devDependencies": {
|
|
23
33
|
"@jest/globals": "^29.0.0",
|
|
@@ -29,6 +39,7 @@
|
|
|
29
39
|
"@types/node": "^22.15.29",
|
|
30
40
|
"jest": "^29.7.0",
|
|
31
41
|
"ts-jest-resolver": "^2.0.1",
|
|
42
|
+
"tsup": "^8.5.0",
|
|
32
43
|
"typescript": "^5.8.3"
|
|
33
44
|
},
|
|
34
45
|
"files": [
|
package/dist/controller.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { buildController, PartyMode, SigningProvider, } from '@canton-network/core-signing-lib';
|
|
4
|
-
import { randomUUID } from 'node:crypto';
|
|
5
|
-
export class ParticipantSigningDriver {
|
|
6
|
-
partyMode = PartyMode.INTERNAL;
|
|
7
|
-
signingProvider = SigningProvider.PARTICIPANT;
|
|
8
|
-
controller = (_userId // eslint-disable-line @typescript-eslint/no-unused-vars
|
|
9
|
-
) => buildController({
|
|
10
|
-
signTransaction: async (params) => {
|
|
11
|
-
return Promise.resolve({
|
|
12
|
-
txId: params.internalTxId || randomUUID(),
|
|
13
|
-
status: 'signed',
|
|
14
|
-
});
|
|
15
|
-
},
|
|
16
|
-
getTransaction: function () {
|
|
17
|
-
throw new Error('Function not implemented.');
|
|
18
|
-
},
|
|
19
|
-
getTransactions: function () {
|
|
20
|
-
throw new Error('Function not implemented.');
|
|
21
|
-
},
|
|
22
|
-
getKeys: function () {
|
|
23
|
-
throw new Error('Function not implemented.');
|
|
24
|
-
},
|
|
25
|
-
createKey: function () {
|
|
26
|
-
throw new Error('Function not implemented.');
|
|
27
|
-
},
|
|
28
|
-
getConfiguration: function () {
|
|
29
|
-
throw new Error('Function not implemented.');
|
|
30
|
-
},
|
|
31
|
-
setConfiguration: function () {
|
|
32
|
-
throw new Error('Function not implemented.');
|
|
33
|
-
},
|
|
34
|
-
subscribeTransactions: function () {
|
|
35
|
-
throw new Error('Function not implemented.');
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"controller.test.d.ts","sourceRoot":"","sources":["../src/controller.test.ts"],"names":[],"mappings":""}
|
package/dist/controller.test.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.
|
|
2
|
-
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
-
import { expect, test } from '@jest/globals';
|
|
4
|
-
import { ParticipantSigningDriver } from './controller.js';
|
|
5
|
-
const TEST_TRANSACTION = 'test-tx';
|
|
6
|
-
const TEST_TRANSACTION_HASH = '88beb0783e394f6128699bad42906374ab64197d260db05bb0cfeeb518ba3ac2';
|
|
7
|
-
const authContext = {
|
|
8
|
-
userId: 'test-user-id',
|
|
9
|
-
accessToken: 'test-access-token',
|
|
10
|
-
};
|
|
11
|
-
test('driver properties', async () => {
|
|
12
|
-
const signingDriver = new ParticipantSigningDriver();
|
|
13
|
-
expect(signingDriver.partyMode).toBe('internal');
|
|
14
|
-
expect(signingDriver.signingProvider).toBe('participant');
|
|
15
|
-
});
|
|
16
|
-
test('transaction signature', async () => {
|
|
17
|
-
const signingDriver = new ParticipantSigningDriver();
|
|
18
|
-
const tx = await signingDriver
|
|
19
|
-
.controller(authContext.userId)
|
|
20
|
-
.signTransaction({
|
|
21
|
-
tx: TEST_TRANSACTION,
|
|
22
|
-
txHash: TEST_TRANSACTION_HASH,
|
|
23
|
-
publicKey: '',
|
|
24
|
-
});
|
|
25
|
-
expect(tx.status).toBe('signed');
|
|
26
|
-
});
|