@canton-network/core-signing-lib 1.14.0 → 1.16.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/README.md +1 -1
- package/dist/config/schema.d.ts +1 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/index.cjs +11 -8
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -7
- package/dist/index.js.map +1 -1
- package/dist/rpc-gen/index.d.ts.map +1 -1
- package/dist/rpc-gen/typings.d.ts +17 -5
- package/dist/rpc-gen/typings.d.ts.map +1 -1
- package/package.json +11 -15
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ export interface SigningDriverInterface {
|
|
|
15
15
|
|
|
16
16
|
The `controller` function should be an implementation of `buildController` from [./src/rpc-gen/index.ts](./src/rpc-gen/index.ts) which takes an optional `AuthContext`.
|
|
17
17
|
|
|
18
|
-
To see a simple example of a signing driver, see [core/
|
|
18
|
+
To see a simple example of a signing driver, see [core/signing-internal](../signing-internal).
|
|
19
19
|
|
|
20
20
|
### Data Encodings
|
|
21
21
|
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ export declare enum SigningProvider {
|
|
|
8
8
|
SECUROSYS = "securosys",
|
|
9
9
|
BITGO = "bitgo"
|
|
10
10
|
}
|
|
11
|
+
export declare const SIGN_MESSAGE_CAPABLE_SIGNING_PROVIDERS: readonly SigningProvider[];
|
|
11
12
|
export declare const signingDriverConfigSchema: z.ZodObject<{
|
|
12
13
|
provider: z.ZodEnum<typeof SigningProvider>;
|
|
13
14
|
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,oBAAY,eAAe;IACvB,aAAa,kBAAkB;IAC/B,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,KAAK,UAAU;CAClB;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,oBAAY,eAAe;IACvB,aAAa,kBAAkB;IAC/B,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,KAAK,UAAU;CAClB;AAED,eAAO,MAAM,sCAAsC,EAAE,SAAS,eAAe,EAMxE,CAAA;AAGL,eAAO,MAAM,yBAAyB;;;iBAGpC,CAAA;AAGF,eAAO,MAAM,mBAAmB;;;;;iBAE9B,CAAA;AAGF,MAAM,MAAM,sBAAsB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAA;AAC9E,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -20,13 +20,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
20
20
|
value: mod,
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
|
-
//#endregion
|
|
24
23
|
let tweetnacl = require("tweetnacl");
|
|
25
24
|
tweetnacl = __toESM(tweetnacl, 1);
|
|
26
25
|
let tweetnacl_util = require("tweetnacl-util");
|
|
27
26
|
tweetnacl_util = __toESM(tweetnacl_util, 1);
|
|
28
27
|
let zod = require("zod");
|
|
29
|
-
|
|
28
|
+
// src/config/schema.ts
|
|
30
29
|
let SigningProvider = /* @__PURE__ */ function(SigningProvider) {
|
|
31
30
|
SigningProvider["WALLET_KERNEL"] = "wallet-kernel";
|
|
32
31
|
SigningProvider["PARTICIPANT"] = "participant";
|
|
@@ -37,13 +36,18 @@ let SigningProvider = /* @__PURE__ */ function(SigningProvider) {
|
|
|
37
36
|
SigningProvider["BITGO"] = "bitgo";
|
|
38
37
|
return SigningProvider;
|
|
39
38
|
}({});
|
|
39
|
+
const SIGN_MESSAGE_CAPABLE_SIGNING_PROVIDERS = [
|
|
40
|
+
"wallet-kernel",
|
|
41
|
+
"dfns",
|
|
42
|
+
"fireblocks",
|
|
43
|
+
"securosys"
|
|
44
|
+
];
|
|
40
45
|
const signingDriverConfigSchema = zod.z.object({
|
|
41
46
|
provider: zod.z.nativeEnum(SigningProvider),
|
|
42
47
|
properties: zod.z.record(zod.z.string(), zod.z.any()).optional()
|
|
43
48
|
});
|
|
44
49
|
const signingConfigSchema = zod.z.object({ drivers: zod.z.array(signingDriverConfigSchema).optional() });
|
|
45
|
-
|
|
46
|
-
//#region src/rpc-gen/index.ts
|
|
50
|
+
// src/rpc-gen/index.ts
|
|
47
51
|
function buildController(methods) {
|
|
48
52
|
return {
|
|
49
53
|
signTransaction: methods.signTransaction,
|
|
@@ -57,8 +61,7 @@ function buildController(methods) {
|
|
|
57
61
|
subscribeTransactions: methods.subscribeTransactions
|
|
58
62
|
};
|
|
59
63
|
}
|
|
60
|
-
|
|
61
|
-
//#region src/index.ts
|
|
64
|
+
// src/index.ts
|
|
62
65
|
const CC_COIN_TYPE = 6767;
|
|
63
66
|
function isRpcError(value) {
|
|
64
67
|
return value.error_description !== void 0;
|
|
@@ -92,9 +95,9 @@ const createKeyPair = () => {
|
|
|
92
95
|
privateKey: tweetnacl_util.default.encodeBase64(key.secretKey)
|
|
93
96
|
};
|
|
94
97
|
};
|
|
95
|
-
//#endregion
|
|
96
98
|
exports.CC_COIN_TYPE = CC_COIN_TYPE;
|
|
97
99
|
exports.PartyMode = PartyMode;
|
|
100
|
+
exports.SIGN_MESSAGE_CAPABLE_SIGNING_PROVIDERS = SIGN_MESSAGE_CAPABLE_SIGNING_PROVIDERS;
|
|
98
101
|
exports.SigningProvider = SigningProvider;
|
|
99
102
|
exports.buildController = buildController;
|
|
100
103
|
exports.createKeyPair = createKeyPair;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["z","nacl","naclUtil"],"sources":["../src/config/schema.ts","../src/rpc-gen/index.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { z } from 'zod'\n\nexport enum SigningProvider {\n WALLET_KERNEL = 'wallet-kernel',\n PARTICIPANT = 'participant',\n FIREBLOCKS = 'fireblocks',\n BLOCKDAEMON = 'blockdaemon',\n DFNS = 'dfns',\n SECUROSYS = 'securosys',\n BITGO = 'bitgo',\n}\n\n// Generic signing driver configuration schema\nexport const signingDriverConfigSchema = z.object({\n provider: z.nativeEnum(SigningProvider),\n properties: z.record(z.string(), z.any()).optional(),\n})\n\n// Top-level Signing Configuration Schema - array of driver configs\nexport const signingConfigSchema = z.object({\n drivers: z.array(signingDriverConfigSchema).optional(),\n})\n\n// Type exports\nexport type SigningDriverAppConfig = z.infer<typeof signingDriverConfigSchema>\nexport type SigningConfig = z.infer<typeof signingConfigSchema>\n","// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n// Code generated by rpc-generator DO NOT EDIT!!\n\nimport type { SignTransaction } from './typings.js'\nimport type { SignMessage } from './typings.js'\nimport type { GetTransaction } from './typings.js'\nimport type { GetTransactions } from './typings.js'\nimport type { GetKeys } from './typings.js'\nimport type { CreateKey } from './typings.js'\nimport type { GetConfiguration } from './typings.js'\nimport type { SetConfiguration } from './typings.js'\nimport type { SubscribeTransactions } from './typings.js'\n\nexport type Methods = {\n signTransaction: SignTransaction\n signMessage: SignMessage\n getTransaction: GetTransaction\n getTransactions: GetTransactions\n getKeys: GetKeys\n createKey: CreateKey\n getConfiguration: GetConfiguration\n setConfiguration: SetConfiguration\n subscribeTransactions: SubscribeTransactions\n}\n\nfunction buildController(methods: Methods) {\n return {\n signTransaction: methods.signTransaction,\n signMessage: methods.signMessage,\n getTransaction: methods.getTransaction,\n getTransactions: methods.getTransactions,\n getKeys: methods.getKeys,\n createKey: methods.createKey,\n getConfiguration: methods.getConfiguration,\n setConfiguration: methods.setConfiguration,\n subscribeTransactions: methods.subscribeTransactions,\n }\n}\n\nexport default buildController\n","// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { AuthContext } from '@canton-network/core-wallet-auth'\nimport type { Methods } from './rpc-gen/index.js'\nimport type { Error as RpcError } from './rpc-gen/typings.js'\nimport nacl from 'tweetnacl'\nimport naclUtil from 'tweetnacl-util'\nimport { SigningProvider } from './config/schema.js'\n\n// Re-export SigningProvider from config schema\nexport { SigningProvider }\n\nexport { default as buildController, type Methods } from './rpc-gen/index.js'\nexport * from './rpc-gen/typings.js'\nexport * from './SigningDriverStore.js'\nexport * from './config/schema.js'\n\nexport const CC_COIN_TYPE = 6767\n\nexport function isRpcError<T>(value: T | RpcError): value is RpcError {\n return (value as RpcError).error_description !== undefined\n}\n\nexport enum PartyMode {\n INTERNAL = 'internal',\n EXTERNAL = 'external',\n}\n\nexport type PublicKey = string\nexport type PrivateKey = string\n\nexport interface KeyPair {\n publicKey: PublicKey\n privateKey: PrivateKey\n}\n\nexport interface SigningDriverInterface {\n partyMode: PartyMode\n signingProvider: SigningProvider\n controller: (userId: AuthContext['userId'] | undefined) => Methods\n}\n\nexport const verifySignedTxHash = (\n txHash: string,\n publicKey: string,\n signature: string\n): boolean => {\n return nacl.sign.detached.verify(\n naclUtil.decodeBase64(txHash),\n naclUtil.decodeBase64(signature),\n naclUtil.decodeBase64(publicKey)\n )\n}\n\nexport const signTransactionHash = (\n txHash: string,\n privateKey: string\n): string => {\n const decodedKey = naclUtil.decodeBase64(privateKey)\n\n return naclUtil.encodeBase64(\n nacl.sign.detached(naclUtil.decodeBase64(txHash), decodedKey)\n )\n}\n\nexport const signMessage = (message: string, privateKey: string): string => {\n const msgBytes = new TextEncoder().encode(message)\n const decodedKey = naclUtil.decodeBase64(privateKey)\n return naclUtil.encodeBase64(nacl.sign.detached(msgBytes, decodedKey))\n}\n\nexport const getPublicKeyFromPrivate = (privateKeyBase64: string): string => {\n const secretKey = naclUtil.decodeBase64(privateKeyBase64)\n const keyPair = nacl.sign.keyPair.fromSecretKey(secretKey)\n return naclUtil.encodeBase64(keyPair.publicKey)\n}\n\nexport const createKeyPair = (): KeyPair => {\n const key = nacl.sign.keyPair()\n const publicKey = naclUtil.encodeBase64(key.publicKey)\n const privateKey = naclUtil.encodeBase64(key.secretKey)\n\n return { publicKey, privateKey }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["z","nacl","naclUtil"],"sources":["../src/config/schema.ts","../src/rpc-gen/index.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { z } from 'zod'\n\nexport enum SigningProvider {\n WALLET_KERNEL = 'wallet-kernel',\n PARTICIPANT = 'participant',\n FIREBLOCKS = 'fireblocks',\n BLOCKDAEMON = 'blockdaemon',\n DFNS = 'dfns',\n SECUROSYS = 'securosys',\n BITGO = 'bitgo',\n}\n\nexport const SIGN_MESSAGE_CAPABLE_SIGNING_PROVIDERS: readonly SigningProvider[] =\n [\n SigningProvider.WALLET_KERNEL,\n SigningProvider.DFNS,\n SigningProvider.FIREBLOCKS,\n SigningProvider.SECUROSYS,\n ]\n\n// Generic signing driver configuration schema\nexport const signingDriverConfigSchema = z.object({\n provider: z.nativeEnum(SigningProvider),\n properties: z.record(z.string(), z.any()).optional(),\n})\n\n// Top-level Signing Configuration Schema - array of driver configs\nexport const signingConfigSchema = z.object({\n drivers: z.array(signingDriverConfigSchema).optional(),\n})\n\n// Type exports\nexport type SigningDriverAppConfig = z.infer<typeof signingDriverConfigSchema>\nexport type SigningConfig = z.infer<typeof signingConfigSchema>\n","// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n// Code generated by rpc-generator DO NOT EDIT!!\n\nimport type { SignTransaction } from './typings.js'\nimport type { SignMessage } from './typings.js'\nimport type { GetTransaction } from './typings.js'\nimport type { GetTransactions } from './typings.js'\nimport type { GetKeys } from './typings.js'\nimport type { CreateKey } from './typings.js'\nimport type { GetConfiguration } from './typings.js'\nimport type { SetConfiguration } from './typings.js'\nimport type { SubscribeTransactions } from './typings.js'\n\nexport type Methods = {\n signTransaction: SignTransaction\n signMessage: SignMessage\n getTransaction: GetTransaction\n getTransactions: GetTransactions\n getKeys: GetKeys\n createKey: CreateKey\n getConfiguration: GetConfiguration\n setConfiguration: SetConfiguration\n subscribeTransactions: SubscribeTransactions\n}\n\nfunction buildController(methods: Methods) {\n return {\n signTransaction: methods.signTransaction,\n signMessage: methods.signMessage,\n getTransaction: methods.getTransaction,\n getTransactions: methods.getTransactions,\n getKeys: methods.getKeys,\n createKey: methods.createKey,\n getConfiguration: methods.getConfiguration,\n setConfiguration: methods.setConfiguration,\n subscribeTransactions: methods.subscribeTransactions,\n }\n}\n\nexport default buildController\n","// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { AuthContext } from '@canton-network/core-wallet-auth'\nimport type { Methods } from './rpc-gen/index.js'\nimport type { Error as RpcError } from './rpc-gen/typings.js'\nimport nacl from 'tweetnacl'\nimport naclUtil from 'tweetnacl-util'\nimport { SigningProvider } from './config/schema.js'\n\n// Re-export SigningProvider from config schema\nexport { SigningProvider }\n\nexport { default as buildController, type Methods } from './rpc-gen/index.js'\nexport * from './rpc-gen/typings.js'\nexport * from './SigningDriverStore.js'\nexport * from './config/schema.js'\n\nexport const CC_COIN_TYPE = 6767\n\nexport function isRpcError<T>(value: T | RpcError): value is RpcError {\n return (value as RpcError).error_description !== undefined\n}\n\nexport enum PartyMode {\n INTERNAL = 'internal',\n EXTERNAL = 'external',\n}\n\nexport type PublicKey = string\nexport type PrivateKey = string\n\nexport interface KeyPair {\n publicKey: PublicKey\n privateKey: PrivateKey\n}\n\nexport interface SigningDriverInterface {\n partyMode: PartyMode\n signingProvider: SigningProvider\n controller: (userId: AuthContext['userId'] | undefined) => Methods\n}\n\nexport const verifySignedTxHash = (\n txHash: string,\n publicKey: string,\n signature: string\n): boolean => {\n return nacl.sign.detached.verify(\n naclUtil.decodeBase64(txHash),\n naclUtil.decodeBase64(signature),\n naclUtil.decodeBase64(publicKey)\n )\n}\n\nexport const signTransactionHash = (\n txHash: string,\n privateKey: string\n): string => {\n const decodedKey = naclUtil.decodeBase64(privateKey)\n\n return naclUtil.encodeBase64(\n nacl.sign.detached(naclUtil.decodeBase64(txHash), decodedKey)\n )\n}\n\nexport const signMessage = (message: string, privateKey: string): string => {\n const msgBytes = new TextEncoder().encode(message)\n const decodedKey = naclUtil.decodeBase64(privateKey)\n return naclUtil.encodeBase64(nacl.sign.detached(msgBytes, decodedKey))\n}\n\nexport const getPublicKeyFromPrivate = (privateKeyBase64: string): string => {\n const secretKey = naclUtil.decodeBase64(privateKeyBase64)\n const keyPair = nacl.sign.keyPair.fromSecretKey(secretKey)\n return naclUtil.encodeBase64(keyPair.publicKey)\n}\n\nexport const createKeyPair = (): KeyPair => {\n const key = nacl.sign.keyPair()\n const publicKey = naclUtil.encodeBase64(key.publicKey)\n const privateKey = naclUtil.encodeBase64(key.secretKey)\n\n return { publicKey, privateKey }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,IAAY,kBAAL,yBAAA,iBAAA;CACH,gBAAA,mBAAA;CACA,gBAAA,iBAAA;CACA,gBAAA,gBAAA;CACA,gBAAA,iBAAA;CACA,gBAAA,UAAA;CACA,gBAAA,eAAA;CACA,gBAAA,WAAA;;AACJ,EAAA,CAAA,CAAA;AAEA,MAAa,yCACT;;;;;AAKA;AAGJ,MAAa,4BAA4BA,IAAAA,EAAE,OAAO;CAC9C,UAAUA,IAAAA,EAAE,WAAW,eAAe;CACtC,YAAYA,IAAAA,EAAE,OAAOA,IAAAA,EAAE,OAAO,GAAGA,IAAAA,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS;AACvD,CAAC;AAGD,MAAa,sBAAsBA,IAAAA,EAAE,OAAO,EACxC,SAASA,IAAAA,EAAE,MAAM,yBAAyB,CAAC,CAAC,SAAS,EACzD,CAAC;;ACLD,SAAS,gBAAgB,SAAkB;CACvC,OAAO;EACH,iBAAiB,QAAQ;EACzB,aAAa,QAAQ;EACrB,gBAAgB,QAAQ;EACxB,iBAAiB,QAAQ;EACzB,SAAS,QAAQ;EACjB,WAAW,QAAQ;EACnB,kBAAkB,QAAQ;EAC1B,kBAAkB,QAAQ;EAC1B,uBAAuB,QAAQ;CACnC;AACJ;;ACrBA,MAAa,eAAe;AAE5B,SAAgB,WAAc,OAAwC;CAClE,OAAQ,MAAmB,sBAAsB,KAAA;AACrD;AAEA,IAAY,YAAL,yBAAA,WAAA;CACH,UAAA,cAAA;CACA,UAAA,cAAA;;AACJ,EAAA,CAAA,CAAA;AAgBA,MAAa,sBACT,QACA,WACA,cACU;CACV,OAAOC,UAAAA,QAAK,KAAK,SAAS,OACtBC,eAAAA,QAAS,aAAa,MAAM,GAC5BA,eAAAA,QAAS,aAAa,SAAS,GAC/BA,eAAA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Y,OAAO,CAAA;AAEhC,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,QAAQ,GAAG,KAAK,IAAI,QAAQ,CAEpE;AAED,oBAAY,SAAS;IACjB,QAAQ,aAAa;IACrB,QAAQ,aAAa;CACxB;AAED,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAC9B,MAAM,MAAM,UAAU,GAAG,MAAM,CAAA;AAE/B,MAAM,WAAW,OAAO;IACpB,SAAS,EAAE,SAAS,CAAA;IACpB,UAAU,EAAE,UAAU,CAAA;CACzB;AAED,MAAM,WAAW,sBAAsB;IACnC,SAAS,EAAE,SAAS,CAAA;IACpB,eAAe,EAAE,eAAe,CAAA;IAChC,UAAU,EAAE,CAAC,MAAM,EAAE,WAAW,CAAC,QAAQ,CAAC,GAAG,SAAS,KAAK,OAAO,CAAA;CACrE;AAED,eAAO,MAAM,kBAAkB,WACnB,MAAM,aACH,MAAM,aACN,MAAM,KAClB,OAMF,CAAA;AAED,eAAO,MAAM,mBAAmB,WACpB,MAAM,cACF,MAAM,KACnB,MAMF,CAAA;AAED,eAAO,MAAM,WAAW,YAAa,MAAM,cAAc,MAAM,KAAG,MAIjE,CAAA;AAED,eAAO,MAAM,uBAAuB,qBAAsB,MAAM,KAAG,MAIlE,CAAA;AAED,eAAO,MAAM,aAAa,QAAO,OAMhC,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import nacl from "tweetnacl";
|
|
2
2
|
import naclUtil from "tweetnacl-util";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
|
|
4
|
+
// src/config/schema.ts
|
|
5
5
|
let SigningProvider = /* @__PURE__ */ function(SigningProvider) {
|
|
6
6
|
SigningProvider["WALLET_KERNEL"] = "wallet-kernel";
|
|
7
7
|
SigningProvider["PARTICIPANT"] = "participant";
|
|
@@ -12,13 +12,18 @@ let SigningProvider = /* @__PURE__ */ function(SigningProvider) {
|
|
|
12
12
|
SigningProvider["BITGO"] = "bitgo";
|
|
13
13
|
return SigningProvider;
|
|
14
14
|
}({});
|
|
15
|
+
const SIGN_MESSAGE_CAPABLE_SIGNING_PROVIDERS = [
|
|
16
|
+
"wallet-kernel",
|
|
17
|
+
"dfns",
|
|
18
|
+
"fireblocks",
|
|
19
|
+
"securosys"
|
|
20
|
+
];
|
|
15
21
|
const signingDriverConfigSchema = z.object({
|
|
16
22
|
provider: z.nativeEnum(SigningProvider),
|
|
17
23
|
properties: z.record(z.string(), z.any()).optional()
|
|
18
24
|
});
|
|
19
25
|
const signingConfigSchema = z.object({ drivers: z.array(signingDriverConfigSchema).optional() });
|
|
20
|
-
|
|
21
|
-
//#region src/rpc-gen/index.ts
|
|
26
|
+
// src/rpc-gen/index.ts
|
|
22
27
|
function buildController(methods) {
|
|
23
28
|
return {
|
|
24
29
|
signTransaction: methods.signTransaction,
|
|
@@ -32,8 +37,7 @@ function buildController(methods) {
|
|
|
32
37
|
subscribeTransactions: methods.subscribeTransactions
|
|
33
38
|
};
|
|
34
39
|
}
|
|
35
|
-
|
|
36
|
-
//#region src/index.ts
|
|
40
|
+
// src/index.ts
|
|
37
41
|
const CC_COIN_TYPE = 6767;
|
|
38
42
|
function isRpcError(value) {
|
|
39
43
|
return value.error_description !== void 0;
|
|
@@ -67,7 +71,6 @@ const createKeyPair = () => {
|
|
|
67
71
|
privateKey: naclUtil.encodeBase64(key.secretKey)
|
|
68
72
|
};
|
|
69
73
|
};
|
|
70
|
-
|
|
71
|
-
export { CC_COIN_TYPE, PartyMode, SigningProvider, buildController, createKeyPair, getPublicKeyFromPrivate, isRpcError, signMessage, signTransactionHash, signingConfigSchema, signingDriverConfigSchema, verifySignedTxHash };
|
|
74
|
+
export { CC_COIN_TYPE, PartyMode, SIGN_MESSAGE_CAPABLE_SIGNING_PROVIDERS, SigningProvider, buildController, createKeyPair, getPublicKeyFromPrivate, isRpcError, signMessage, signTransactionHash, signingConfigSchema, signingDriverConfigSchema, verifySignedTxHash };
|
|
72
75
|
|
|
73
76
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/config/schema.ts","../src/rpc-gen/index.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { z } from 'zod'\n\nexport enum SigningProvider {\n WALLET_KERNEL = 'wallet-kernel',\n PARTICIPANT = 'participant',\n FIREBLOCKS = 'fireblocks',\n BLOCKDAEMON = 'blockdaemon',\n DFNS = 'dfns',\n SECUROSYS = 'securosys',\n BITGO = 'bitgo',\n}\n\n// Generic signing driver configuration schema\nexport const signingDriverConfigSchema = z.object({\n provider: z.nativeEnum(SigningProvider),\n properties: z.record(z.string(), z.any()).optional(),\n})\n\n// Top-level Signing Configuration Schema - array of driver configs\nexport const signingConfigSchema = z.object({\n drivers: z.array(signingDriverConfigSchema).optional(),\n})\n\n// Type exports\nexport type SigningDriverAppConfig = z.infer<typeof signingDriverConfigSchema>\nexport type SigningConfig = z.infer<typeof signingConfigSchema>\n","// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n// Code generated by rpc-generator DO NOT EDIT!!\n\nimport type { SignTransaction } from './typings.js'\nimport type { SignMessage } from './typings.js'\nimport type { GetTransaction } from './typings.js'\nimport type { GetTransactions } from './typings.js'\nimport type { GetKeys } from './typings.js'\nimport type { CreateKey } from './typings.js'\nimport type { GetConfiguration } from './typings.js'\nimport type { SetConfiguration } from './typings.js'\nimport type { SubscribeTransactions } from './typings.js'\n\nexport type Methods = {\n signTransaction: SignTransaction\n signMessage: SignMessage\n getTransaction: GetTransaction\n getTransactions: GetTransactions\n getKeys: GetKeys\n createKey: CreateKey\n getConfiguration: GetConfiguration\n setConfiguration: SetConfiguration\n subscribeTransactions: SubscribeTransactions\n}\n\nfunction buildController(methods: Methods) {\n return {\n signTransaction: methods.signTransaction,\n signMessage: methods.signMessage,\n getTransaction: methods.getTransaction,\n getTransactions: methods.getTransactions,\n getKeys: methods.getKeys,\n createKey: methods.createKey,\n getConfiguration: methods.getConfiguration,\n setConfiguration: methods.setConfiguration,\n subscribeTransactions: methods.subscribeTransactions,\n }\n}\n\nexport default buildController\n","// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { AuthContext } from '@canton-network/core-wallet-auth'\nimport type { Methods } from './rpc-gen/index.js'\nimport type { Error as RpcError } from './rpc-gen/typings.js'\nimport nacl from 'tweetnacl'\nimport naclUtil from 'tweetnacl-util'\nimport { SigningProvider } from './config/schema.js'\n\n// Re-export SigningProvider from config schema\nexport { SigningProvider }\n\nexport { default as buildController, type Methods } from './rpc-gen/index.js'\nexport * from './rpc-gen/typings.js'\nexport * from './SigningDriverStore.js'\nexport * from './config/schema.js'\n\nexport const CC_COIN_TYPE = 6767\n\nexport function isRpcError<T>(value: T | RpcError): value is RpcError {\n return (value as RpcError).error_description !== undefined\n}\n\nexport enum PartyMode {\n INTERNAL = 'internal',\n EXTERNAL = 'external',\n}\n\nexport type PublicKey = string\nexport type PrivateKey = string\n\nexport interface KeyPair {\n publicKey: PublicKey\n privateKey: PrivateKey\n}\n\nexport interface SigningDriverInterface {\n partyMode: PartyMode\n signingProvider: SigningProvider\n controller: (userId: AuthContext['userId'] | undefined) => Methods\n}\n\nexport const verifySignedTxHash = (\n txHash: string,\n publicKey: string,\n signature: string\n): boolean => {\n return nacl.sign.detached.verify(\n naclUtil.decodeBase64(txHash),\n naclUtil.decodeBase64(signature),\n naclUtil.decodeBase64(publicKey)\n )\n}\n\nexport const signTransactionHash = (\n txHash: string,\n privateKey: string\n): string => {\n const decodedKey = naclUtil.decodeBase64(privateKey)\n\n return naclUtil.encodeBase64(\n nacl.sign.detached(naclUtil.decodeBase64(txHash), decodedKey)\n )\n}\n\nexport const signMessage = (message: string, privateKey: string): string => {\n const msgBytes = new TextEncoder().encode(message)\n const decodedKey = naclUtil.decodeBase64(privateKey)\n return naclUtil.encodeBase64(nacl.sign.detached(msgBytes, decodedKey))\n}\n\nexport const getPublicKeyFromPrivate = (privateKeyBase64: string): string => {\n const secretKey = naclUtil.decodeBase64(privateKeyBase64)\n const keyPair = nacl.sign.keyPair.fromSecretKey(secretKey)\n return naclUtil.encodeBase64(keyPair.publicKey)\n}\n\nexport const createKeyPair = (): KeyPair => {\n const key = nacl.sign.keyPair()\n const publicKey = naclUtil.encodeBase64(key.publicKey)\n const privateKey = naclUtil.encodeBase64(key.secretKey)\n\n return { publicKey, privateKey }\n}\n"],"mappings":";;;;AAKA,IAAY,kBAAL,yBAAA,iBAAA;CACH,gBAAA,mBAAA;CACA,gBAAA,iBAAA;CACA,gBAAA,gBAAA;CACA,gBAAA,iBAAA;CACA,gBAAA,UAAA;CACA,gBAAA,eAAA;CACA,gBAAA,WAAA;;AACJ,EAAA,CAAA,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/config/schema.ts","../src/rpc-gen/index.ts","../src/index.ts"],"sourcesContent":["// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { z } from 'zod'\n\nexport enum SigningProvider {\n WALLET_KERNEL = 'wallet-kernel',\n PARTICIPANT = 'participant',\n FIREBLOCKS = 'fireblocks',\n BLOCKDAEMON = 'blockdaemon',\n DFNS = 'dfns',\n SECUROSYS = 'securosys',\n BITGO = 'bitgo',\n}\n\nexport const SIGN_MESSAGE_CAPABLE_SIGNING_PROVIDERS: readonly SigningProvider[] =\n [\n SigningProvider.WALLET_KERNEL,\n SigningProvider.DFNS,\n SigningProvider.FIREBLOCKS,\n SigningProvider.SECUROSYS,\n ]\n\n// Generic signing driver configuration schema\nexport const signingDriverConfigSchema = z.object({\n provider: z.nativeEnum(SigningProvider),\n properties: z.record(z.string(), z.any()).optional(),\n})\n\n// Top-level Signing Configuration Schema - array of driver configs\nexport const signingConfigSchema = z.object({\n drivers: z.array(signingDriverConfigSchema).optional(),\n})\n\n// Type exports\nexport type SigningDriverAppConfig = z.infer<typeof signingDriverConfigSchema>\nexport type SigningConfig = z.infer<typeof signingConfigSchema>\n","// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\n// Code generated by rpc-generator DO NOT EDIT!!\n\nimport type { SignTransaction } from './typings.js'\nimport type { SignMessage } from './typings.js'\nimport type { GetTransaction } from './typings.js'\nimport type { GetTransactions } from './typings.js'\nimport type { GetKeys } from './typings.js'\nimport type { CreateKey } from './typings.js'\nimport type { GetConfiguration } from './typings.js'\nimport type { SetConfiguration } from './typings.js'\nimport type { SubscribeTransactions } from './typings.js'\n\nexport type Methods = {\n signTransaction: SignTransaction\n signMessage: SignMessage\n getTransaction: GetTransaction\n getTransactions: GetTransactions\n getKeys: GetKeys\n createKey: CreateKey\n getConfiguration: GetConfiguration\n setConfiguration: SetConfiguration\n subscribeTransactions: SubscribeTransactions\n}\n\nfunction buildController(methods: Methods) {\n return {\n signTransaction: methods.signTransaction,\n signMessage: methods.signMessage,\n getTransaction: methods.getTransaction,\n getTransactions: methods.getTransactions,\n getKeys: methods.getKeys,\n createKey: methods.createKey,\n getConfiguration: methods.getConfiguration,\n setConfiguration: methods.setConfiguration,\n subscribeTransactions: methods.subscribeTransactions,\n }\n}\n\nexport default buildController\n","// Copyright (c) 2025-2026 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { AuthContext } from '@canton-network/core-wallet-auth'\nimport type { Methods } from './rpc-gen/index.js'\nimport type { Error as RpcError } from './rpc-gen/typings.js'\nimport nacl from 'tweetnacl'\nimport naclUtil from 'tweetnacl-util'\nimport { SigningProvider } from './config/schema.js'\n\n// Re-export SigningProvider from config schema\nexport { SigningProvider }\n\nexport { default as buildController, type Methods } from './rpc-gen/index.js'\nexport * from './rpc-gen/typings.js'\nexport * from './SigningDriverStore.js'\nexport * from './config/schema.js'\n\nexport const CC_COIN_TYPE = 6767\n\nexport function isRpcError<T>(value: T | RpcError): value is RpcError {\n return (value as RpcError).error_description !== undefined\n}\n\nexport enum PartyMode {\n INTERNAL = 'internal',\n EXTERNAL = 'external',\n}\n\nexport type PublicKey = string\nexport type PrivateKey = string\n\nexport interface KeyPair {\n publicKey: PublicKey\n privateKey: PrivateKey\n}\n\nexport interface SigningDriverInterface {\n partyMode: PartyMode\n signingProvider: SigningProvider\n controller: (userId: AuthContext['userId'] | undefined) => Methods\n}\n\nexport const verifySignedTxHash = (\n txHash: string,\n publicKey: string,\n signature: string\n): boolean => {\n return nacl.sign.detached.verify(\n naclUtil.decodeBase64(txHash),\n naclUtil.decodeBase64(signature),\n naclUtil.decodeBase64(publicKey)\n )\n}\n\nexport const signTransactionHash = (\n txHash: string,\n privateKey: string\n): string => {\n const decodedKey = naclUtil.decodeBase64(privateKey)\n\n return naclUtil.encodeBase64(\n nacl.sign.detached(naclUtil.decodeBase64(txHash), decodedKey)\n )\n}\n\nexport const signMessage = (message: string, privateKey: string): string => {\n const msgBytes = new TextEncoder().encode(message)\n const decodedKey = naclUtil.decodeBase64(privateKey)\n return naclUtil.encodeBase64(nacl.sign.detached(msgBytes, decodedKey))\n}\n\nexport const getPublicKeyFromPrivate = (privateKeyBase64: string): string => {\n const secretKey = naclUtil.decodeBase64(privateKeyBase64)\n const keyPair = nacl.sign.keyPair.fromSecretKey(secretKey)\n return naclUtil.encodeBase64(keyPair.publicKey)\n}\n\nexport const createKeyPair = (): KeyPair => {\n const key = nacl.sign.keyPair()\n const publicKey = naclUtil.encodeBase64(key.publicKey)\n const privateKey = naclUtil.encodeBase64(key.secretKey)\n\n return { publicKey, privateKey }\n}\n"],"mappings":";;;;AAKA,IAAY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ChB,gBAAgB;IAChB,qBAAqB;EAE5B;eAEc,eAAe"}
|
|
@@ -48,10 +48,18 @@ export interface KeyIdentifierWithId {
|
|
|
48
48
|
export type KeyIdentifier = KeyIdentifierWithPublicKey | KeyIdentifierWithId;
|
|
49
49
|
/**
|
|
50
50
|
*
|
|
51
|
-
* Internal txId used by the Wallet Gateway to store the transaction
|
|
51
|
+
* Internal txId used by the Wallet Gateway to store the transaction
|
|
52
52
|
*
|
|
53
53
|
*/
|
|
54
54
|
export type InternalTxId = string;
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* Signing provider specific parameters, passed through to the signing driver as-is. Keys not supported by the driver are ignored.
|
|
58
|
+
*
|
|
59
|
+
*/
|
|
60
|
+
export interface ExtraParams {
|
|
61
|
+
[key: string]: any;
|
|
62
|
+
}
|
|
55
63
|
/**
|
|
56
64
|
*
|
|
57
65
|
* Arbitrary UTF-8 message to sign.
|
|
@@ -126,7 +134,9 @@ export interface Transaction {
|
|
|
126
134
|
metadata?: Metadata;
|
|
127
135
|
}
|
|
128
136
|
export interface SignatureResult {
|
|
129
|
-
|
|
137
|
+
status: SigningStatus;
|
|
138
|
+
signature?: Signature;
|
|
139
|
+
txId?: TxId;
|
|
130
140
|
}
|
|
131
141
|
/**
|
|
132
142
|
*
|
|
@@ -144,7 +154,7 @@ export interface Key {
|
|
|
144
154
|
}
|
|
145
155
|
/**
|
|
146
156
|
*
|
|
147
|
-
* List of keys
|
|
157
|
+
* List of keys available at the Wallet Provider
|
|
148
158
|
*
|
|
149
159
|
*/
|
|
150
160
|
export type KeysList = Key[];
|
|
@@ -156,11 +166,13 @@ export interface SignTransactionParams {
|
|
|
156
166
|
txHash: TxHash;
|
|
157
167
|
keyIdentifier: KeyIdentifier;
|
|
158
168
|
internalTxId?: InternalTxId;
|
|
159
|
-
|
|
169
|
+
extraParams?: ExtraParams;
|
|
160
170
|
}
|
|
161
171
|
export interface SignMessageParams {
|
|
162
172
|
message: Message;
|
|
163
|
-
keyIdentifier
|
|
173
|
+
keyIdentifier: KeyIdentifier;
|
|
174
|
+
internalTxId?: InternalTxId;
|
|
175
|
+
extraParams?: ExtraParams;
|
|
164
176
|
}
|
|
165
177
|
export interface GetTransactionParams {
|
|
166
178
|
txId: TxId;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typings.d.ts","sourceRoot":"","sources":["../../src/rpc-gen/typings.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,MAAM,MAAM,EAAE,GAAG,MAAM,CAAA;AACvB;;;;GAIG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAA;AAC3B;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAC9B;;;;GAIG;AACH,MAAM,MAAM,EAAE,GAAG,MAAM,CAAA;
|
|
1
|
+
{"version":3,"file":"typings.d.ts","sourceRoot":"","sources":["../../src/rpc-gen/typings.ts"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,MAAM,MAAM,EAAE,GAAG,MAAM,CAAA;AACvB;;;;GAIG;AACH,MAAM,MAAM,MAAM,GAAG,MAAM,CAAA;AAC3B;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,CAAA;AAC9B;;;;GAIG;AACH,MAAM,MAAM,EAAE,GAAG,MAAM,CAAA;AAEvB;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACvC,SAAS,EAAE,SAAS,CAAA;IACpB,EAAE,CAAC,EAAE,EAAE,CAAA;CACV;AACD;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAChC,SAAS,CAAC,EAAE,SAAS,CAAA;IACrB,EAAE,EAAE,EAAE,CAAA;CACT;AACD;;;;GAIG;AACH,MAAM,MAAM,aAAa,GAAG,0BAA0B,GAAG,mBAAmB,CAAA;AAC5E;;;;GAIG;AACH,MAAM,MAAM,YAAY,GAAG,MAAM,CAAA;AAEjC;;;;GAIG;AACH,MAAM,WAAW,WAAW;IACxB,CAAC,GAAG,EAAE,MA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AACpE,MAAM,MAAM,gBAAgB,GAAG,CAC3B,MAAM,EAAE,sBAAsB,KAC7B,OAAO,CAAC,sBAAsB,CAAC,CAAA;AACpC,MAAM,MAAM,qBAAqB,GAAG,CAChC,MAAM,EAAE,2BAA2B,KAClC,OAAO,CAAC,2BAA2B,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@canton-network/core-signing-lib",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.16.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Core library for signing driver implementations",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -17,21 +17,17 @@
|
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@canton-network/core-wallet-auth": "
|
|
21
|
-
"fs-extra": "^11.3.6",
|
|
22
|
-
"lodash": "^4.18.1",
|
|
20
|
+
"@canton-network/core-wallet-auth": "2.2.0",
|
|
23
21
|
"tweetnacl": "^1.0.3",
|
|
24
22
|
"tweetnacl-util": "^0.15.1",
|
|
25
|
-
"zod": "^4.
|
|
23
|
+
"zod": "^4.6.7"
|
|
26
24
|
},
|
|
27
25
|
"devDependencies": {
|
|
28
|
-
"@types/
|
|
29
|
-
"@
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"typescript": "^6.0.3",
|
|
34
|
-
"vitest": "^5.0.1"
|
|
26
|
+
"@types/node": "^25.9.9",
|
|
27
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
28
|
+
"tsdown": "^0.23.2",
|
|
29
|
+
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
30
|
+
"vitest": "^5.0.5"
|
|
35
31
|
},
|
|
36
32
|
"files": [
|
|
37
33
|
"dist/**"
|
|
@@ -49,9 +45,9 @@
|
|
|
49
45
|
"url": "https://github.com/canton-network/wallet/issues"
|
|
50
46
|
},
|
|
51
47
|
"scripts": {
|
|
52
|
-
"build": "tsdown --onSuccess \"tsc\"",
|
|
53
|
-
"dev": "tsdown --watch --onSuccess \"tsc\"",
|
|
48
|
+
"build": "tsdown --onSuccess \"tsc -p tsconfig.lib.json\"",
|
|
49
|
+
"dev": "tsdown --watch --onSuccess \"tsc -p tsconfig.lib.json\"",
|
|
54
50
|
"flatpack": "pnpm pack --pack-destination \"$FLATPACK_OUTDIR\"",
|
|
55
|
-
"clean": "
|
|
51
|
+
"clean": "rm -rf dist"
|
|
56
52
|
}
|
|
57
53
|
}
|