@canton-network/core-signing-lib 1.18.0 → 1.19.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.
@@ -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\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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MD,UAAAA,QAAK,KAAK,QAAQ;CAI9B,OAAO;EAAE,WAHSC,eAAAA,QAAS,aAAa,IAAI,SAG3B;EAAG,YAFDA,eAAAA,QAAS,aAAa,IAAI,SAEhB;CAAE;AACnC"}
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.ts'\nimport type { SignMessage } from './typings.ts'\nimport type { GetTransaction } from './typings.ts'\nimport type { GetTransactions } from './typings.ts'\nimport type { GetKeys } from './typings.ts'\nimport type { CreateKey } from './typings.ts'\nimport type { GetConfiguration } from './typings.ts'\nimport type { SetConfiguration } from './typings.ts'\nimport type { SubscribeTransactions } from './typings.ts'\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 nacl from 'tweetnacl'\nimport naclUtil from 'tweetnacl-util'\n\nimport { SigningProvider } from './config/schema.ts'\nimport type { Methods } from './rpc-gen/index.ts'\nimport type { Error as RpcError } from './rpc-gen/typings.ts'\n\n// Re-export SigningProvider from config schema\nexport { SigningProvider }\n\nexport { default as buildController, type Methods } from './rpc-gen/index.ts'\nexport * from './rpc-gen/typings.ts'\nexport * from './SigningDriverStore.ts'\nexport * from './config/schema.ts'\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,IAA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AClD;AAEA,MAAa,sBAA+B;CACxC,MAAM,MAAMD,UAAAA,QAAK,KAAK,QAAQ;CAI9B,OAAO;EAAE,WAHSC,eAAAA,QAAS,aAAa,IAAI,SAG3B;EAAG,YAFDA,eAAAA,QAAS,aAAa,IAAI,SAEhB;CAAE;AACnC"}
package/dist/index.d.ts CHANGED
@@ -1,12 +1,12 @@
1
1
  import type { AuthContext } from '@canton-network/core-wallet-auth';
2
- import type { Methods } from './rpc-gen/index.js';
3
- import type { Error as RpcError } from './rpc-gen/typings.js';
4
- import { SigningProvider } from './config/schema.js';
2
+ import { SigningProvider } from './config/schema.ts';
3
+ import type { Methods } from './rpc-gen/index.ts';
4
+ import type { Error as RpcError } from './rpc-gen/typings.ts';
5
5
  export { SigningProvider };
6
- export { default as buildController, type Methods } from './rpc-gen/index.js';
7
- export * from './rpc-gen/typings.js';
8
- export * from './SigningDriverStore.js';
9
- export * from './config/schema.js';
6
+ export { default as buildController, type Methods } from './rpc-gen/index.ts';
7
+ export * from './rpc-gen/typings.ts';
8
+ export * from './SigningDriverStore.ts';
9
+ export * from './config/schema.ts';
10
10
  export declare const CC_COIN_TYPE = 6767;
11
11
  export declare function isRpcError<T>(value: T | RpcError): value is RpcError;
12
12
  export declare enum PartyMode {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,KAAK,EAAE,KAAK,IAAI,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG7D,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAGpD,OAAO,EAAE,eAAe,EAAE,CAAA;AAE1B,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC7E,cAAc,sBAAsB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AAG7D,OAAO,EAAE,eAAe,EAAE,CAAA;AAE1B,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,KAAK,OAAO,EAAE,MAAM,oBAAoB,CAAA;AAC7E,cAAc,sBAAsB,CAAA;AACpC,cAAc,yBAAyB,CAAA;AACvC,cAAc,oBAAoB,CAAA;AAElC,eAAO,MAAM,YAAY,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.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\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,4BAA4B,EAAE,OAAO;CAC9C,UAAU,EAAE,WAAW,eAAe;CACtC,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS;AACvD,CAAC;AAGD,MAAa,sBAAsB,EAAE,OAAO,EACxC,SAAS,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,OAAO,KAAK,KAAK,SAAS,OACtB,SAAS,aAAa,MAAM,GAC5B,SAAS,aAAa,SAAS,GAC/B,SAAS,aAAa,SAAS,CACnC;AACJ;AAEA,MAAa,uBACT,QACA,eACS;CACT,MAAM,aAAa,SAAS,aAAa,UAAU;CAEnD,OAAO,SAAS,aACZ,KAAK,KAAK,SAAS,SAAS,aAAa,MAAM,GAAG,UAAU,CAChE;AACJ;AAEA,MAAa,eAAe,SAAiB,eAA+B;CACxE,MAAM,WAAW,IAAI,YAAY,CAAC,CAAC,OAAO,OAAO;CACjD,MAAM,aAAa,SAAS,aAAa,UAAU;CACnD,OAAO,SAAS,aAAa,KAAK,KAAK,SAAS,UAAU,UAAU,CAAC;AACzE;AAEA,MAAa,2BAA2B,qBAAqC;CACzE,MAAM,YAAY,SAAS,aAAa,gBAAgB;CACxD,MAAM,UAAU,KAAK,KAAK,QAAQ,cAAc,SAAS;CACzD,OAAO,SAAS,aAAa,QAAQ,SAAS;AAClD;AAEA,MAAa,sBAA+B;CACxC,MAAM,MAAM,KAAK,KAAK,QAAQ;CAI9B,OAAO;EAAE,WAHS,SAAS,aAAa,IAAI,SAG3B;EAAG,YAFD,SAAS,aAAa,IAAI,SAEhB;CAAE;AACnC"}
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.ts'\nimport type { SignMessage } from './typings.ts'\nimport type { GetTransaction } from './typings.ts'\nimport type { GetTransactions } from './typings.ts'\nimport type { GetKeys } from './typings.ts'\nimport type { CreateKey } from './typings.ts'\nimport type { GetConfiguration } from './typings.ts'\nimport type { SetConfiguration } from './typings.ts'\nimport type { SubscribeTransactions } from './typings.ts'\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 nacl from 'tweetnacl'\nimport naclUtil from 'tweetnacl-util'\n\nimport { SigningProvider } from './config/schema.ts'\nimport type { Methods } from './rpc-gen/index.ts'\nimport type { Error as RpcError } from './rpc-gen/typings.ts'\n\n// Re-export SigningProvider from config schema\nexport { SigningProvider }\n\nexport { default as buildController, type Methods } from './rpc-gen/index.ts'\nexport * from './rpc-gen/typings.ts'\nexport * from './SigningDriverStore.ts'\nexport * from './config/schema.ts'\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,4BAA4B,EAAE,OAAO;CAC9C,UAAU,EAAE,WAAW,eAAe;CACtC,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC,SAAS;AACvD,CAAC;AAGD,MAAa,sBAAsB,EAAE,OAAO,EACxC,SAAS,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;;ACpBA,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,OAAO,KAAK,KAAK,SAAS,OACtB,SAAS,aAAa,MAAM,GAC5B,SAAS,aAAa,SAAS,GAC/B,SAAS,aAAa,SAAS,CACnC;AACJ;AAEA,MAAa,uBACT,QACA,eACS;CACT,MAAM,aAAa,SAAS,aAAa,UAAU;CAEnD,OAAO,SAAS,aACZ,KAAK,KAAK,SAAS,SAAS,aAAa,MAAM,GAAG,UAAU,CAChE;AACJ;AAEA,MAAa,eAAe,SAAiB,eAA+B;CACxE,MAAM,WAAW,IAAI,YAAY,CAAC,CAAC,OAAO,OAAO;CACjD,MAAM,aAAa,SAAS,aAAa,UAAU;CACnD,OAAO,SAAS,aAAa,KAAK,KAAK,SAAS,UAAU,UAAU,CAAC;AACzE;AAEA,MAAa,2BAA2B,qBAAqC;CACzE,MAAM,YAAY,SAAS,aAAa,gBAAgB;CACxD,MAAM,UAAU,KAAK,KAAK,QAAQ,cAAc,SAAS;CACzD,OAAO,SAAS,aAAa,QAAQ,SAAS;AAClD;AAEA,MAAa,sBAA+B;CACxC,MAAM,MAAM,KAAK,KAAK,QAAQ;CAI9B,OAAO;EAAE,WAHS,SAAS,aAAa,IAAI,SAG3B;EAAG,YAFD,SAAS,aAAa,IAAI,SAEhB;CAAE;AACnC"}
@@ -1,12 +1,12 @@
1
- import type { SignTransaction } from './typings.js';
2
- import type { SignMessage } from './typings.js';
3
- import type { GetTransaction } from './typings.js';
4
- import type { GetTransactions } from './typings.js';
5
- import type { GetKeys } from './typings.js';
6
- import type { CreateKey } from './typings.js';
7
- import type { GetConfiguration } from './typings.js';
8
- import type { SetConfiguration } from './typings.js';
9
- import type { SubscribeTransactions } from './typings.js';
1
+ import type { SignTransaction } from './typings.ts';
2
+ import type { SignMessage } from './typings.ts';
3
+ import type { GetTransaction } from './typings.ts';
4
+ import type { GetTransactions } from './typings.ts';
5
+ import type { GetKeys } from './typings.ts';
6
+ import type { CreateKey } from './typings.ts';
7
+ import type { GetConfiguration } from './typings.ts';
8
+ import type { SetConfiguration } from './typings.ts';
9
+ import type { SubscribeTransactions } from './typings.ts';
10
10
  export type Methods = {
11
11
  signTransaction: SignTransaction;
12
12
  signMessage: SignMessage;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@canton-network/core-signing-lib",
3
- "version": "1.18.0",
3
+ "version": "1.19.0",
4
4
  "type": "module",
5
5
  "description": "Core library for signing driver implementations",
6
6
  "license": "Apache-2.0",
@@ -10,6 +10,7 @@
10
10
  "types": "dist/index.d.ts",
11
11
  "exports": {
12
12
  ".": {
13
+ "@canton-network/source": "./src/index.ts",
13
14
  "types": "./dist/index.d.ts",
14
15
  "import": "./dist/index.js",
15
16
  "require": "./dist/index.cjs",
@@ -17,7 +18,7 @@
17
18
  }
18
19
  },
19
20
  "dependencies": {
20
- "@canton-network/core-wallet-auth": "2.4.0",
21
+ "@canton-network/core-wallet-auth": "2.5.0",
21
22
  "tweetnacl": "^1.0.3",
22
23
  "tweetnacl-util": "^0.15.1",
23
24
  "zod": "^4.6.7"
@@ -46,7 +47,6 @@
46
47
  },
47
48
  "scripts": {
48
49
  "build": "tsdown --onSuccess \"tsc -p tsconfig.lib.json\"",
49
- "dev": "tsdown --watch --onSuccess \"tsc -p tsconfig.lib.json\"",
50
50
  "flatpack": "pnpm pack --pack-destination \"$FLATPACK_OUTDIR\"",
51
51
  "clean": "rm -rf dist"
52
52
  }