@ledgerhq/context-module 0.0.0-develop-20260209001501 → 0.0.0-develop-20260211001836
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/lib/cjs/package.json +1 -1
- package/lib/cjs/src/ContextModuleBuilder.js +1 -1
- package/lib/cjs/src/ContextModuleBuilder.js.map +3 -3
- package/lib/cjs/src/signing-tracker/data/SigningTrackerDataSource.js +2 -0
- package/lib/cjs/src/signing-tracker/data/SigningTrackerDataSource.js.map +7 -0
- package/lib/esm/package.json +1 -1
- package/lib/esm/src/ContextModuleBuilder.js +1 -1
- package/lib/esm/src/ContextModuleBuilder.js.map +3 -3
- package/lib/esm/src/signing-tracker/data/SigningTrackerDataSource.js +1 -0
- package/lib/esm/src/signing-tracker/data/SigningTrackerDataSource.js.map +7 -0
- package/lib/types/src/ContextModuleBuilder.d.ts.map +1 -1
- package/lib/types/src/signing-tracker/data/SigningTrackerDataSource.d.ts +40 -0
- package/lib/types/src/signing-tracker/data/SigningTrackerDataSource.d.ts.map +1 -0
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +5 -5
package/lib/cjs/package.json
CHANGED
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"watch:builds": "pnpm ldmk-tool watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
59
59
|
"watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
|
|
60
60
|
},
|
|
61
|
-
"version": "0.0.0-develop-
|
|
61
|
+
"version": "0.0.0-develop-20260211001836"
|
|
62
62
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
"use strict";var i=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var g=Object.prototype.hasOwnProperty;var l=(t,e)=>{for(var o in e)i(t,o,{get:e[o],enumerable:!0})},C=(t,e,o,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of u(e))!g.call(t,a)&&a!==o&&i(t,a,{get:()=>e[a],enumerable:!(n=c(e,a))||n.enumerable});return t};var f=t=>C(i({},"__esModule",{value:!0}),t);var x={};l(x,{ContextModuleBuilder:()=>L,DEFAULT_CONFIG:()=>r});module.exports=f(x);var s=require("@ledgerhq/device-management-kit"),d=require("./DefaultContextModule");const m="https://crypto-assets-service.api.ledger.com/v1",h="https://web3checks-backend.api.ledger.com/v3",p="https://nft.api.live.ledger.com",r={cal:{url:m,mode:"prod",branch:"main"},web3checks:{url:h},metadataServiceDomain:{url:p},defaultLoaders:!0,customLoaders:[],defaultFieldLoaders:!0,customFieldLoaders:[],customTypedDataLoader:void 0,customSolanaLoader:void 0,loggerFactory:s.noopLoggerFactory};class L{config;originToken;constructor({originToken:e,loggerFactory:o}){this.originToken=e,this.config={...r,cal:{...r.cal},web3checks:{...r.web3checks},metadataServiceDomain:{...r.metadataServiceDomain},customLoaders:[...r.customLoaders],customFieldLoaders:[...r.customFieldLoaders]},o&&(this.config.loggerFactory=o)}removeDefaultLoaders(){return this.config.defaultLoaders=!1,this}addLoader(e){return this.config.customLoaders.push(e),this}addTypedDataLoader(e){return this.config.customTypedDataLoader=e,this}addSolanaLoader(e){return this.config.customSolanaLoader=e,this}setCalConfig(e){return this.config.cal=e,this}setMetadataServiceConfig(e){return this.config.metadataServiceDomain=e,this}setWeb3ChecksConfig(e){return this.config.web3checks=e,this}setDatasourceConfig(e){return this.config.datasource=e,this}setTrustedNameDataSource(e){return this.config.customTrustedNameDataSource=e,this}setLoggerFactory(e){return this.config.loggerFactory=e,this}build(){const e={...this.config,originToken:this.originToken};return new d.DefaultContextModule(e)}}0&&(module.exports={ContextModuleBuilder,DEFAULT_CONFIG});
|
|
2
2
|
//# sourceMappingURL=ContextModuleBuilder.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/ContextModuleBuilder.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,
|
|
6
|
-
"names": ["ContextModuleBuilder_exports", "__export", "ContextModuleBuilder", "DEFAULT_CONFIG", "__toCommonJS", "
|
|
4
|
+
"sourcesContent": ["import {\n type LoggerPublisherService,\n noopLoggerFactory,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { type ContextModuleConstructorArgs } from \"./config/model/ContextModuleBuildArgs\";\nimport {\n type ContextModuleCalConfig,\n type ContextModuleConfig,\n type ContextModuleDatasourceConfig,\n type ContextModuleMetadataServiceConfig,\n type ContextModuleWeb3ChecksConfig,\n} from \"./config/model/ContextModuleConfig\";\nimport { type ContextLoader } from \"./shared/domain/ContextLoader\";\nimport { type SolanaContextLoader } from \"./solana/domain/SolanaContextLoader\";\nimport { type TrustedNameDataSource } from \"./trusted-name/data/TrustedNameDataSource\";\nimport { type TypedDataContextLoader } from \"./typed-data/domain/TypedDataContextLoader\";\nimport { type ContextModule } from \"./ContextModule\";\nimport { DefaultContextModule } from \"./DefaultContextModule\";\n\nconst DEFAULT_CAL_URL = \"https://crypto-assets-service.api.ledger.com/v1\";\nconst DEFAULT_WEB3_CHECKS_URL = \"https://web3checks-backend.api.ledger.com/v3\";\nconst DEFAULT_METADATA_SERVICE_DOMAIN = \"https://nft.api.live.ledger.com\";\n\nexport const DEFAULT_CONFIG: ContextModuleConfig = {\n cal: {\n url: DEFAULT_CAL_URL,\n mode: \"prod\",\n branch: \"main\",\n },\n web3checks: {\n url: DEFAULT_WEB3_CHECKS_URL,\n },\n metadataServiceDomain: {\n url: DEFAULT_METADATA_SERVICE_DOMAIN,\n },\n defaultLoaders: true,\n customLoaders: [],\n defaultFieldLoaders: true,\n customFieldLoaders: [],\n customTypedDataLoader: undefined,\n customSolanaLoader: undefined,\n loggerFactory: noopLoggerFactory,\n};\n\nexport class ContextModuleBuilder {\n private config: ContextModuleConfig;\n private originToken?: string;\n\n constructor({ originToken, loggerFactory }: ContextModuleConstructorArgs) {\n this.originToken = originToken;\n\n this.config = {\n ...DEFAULT_CONFIG,\n cal: { ...DEFAULT_CONFIG.cal },\n web3checks: { ...DEFAULT_CONFIG.web3checks },\n metadataServiceDomain: { ...DEFAULT_CONFIG.metadataServiceDomain },\n customLoaders: [...DEFAULT_CONFIG.customLoaders],\n customFieldLoaders: [...DEFAULT_CONFIG.customFieldLoaders],\n };\n if (loggerFactory) {\n this.config.loggerFactory = loggerFactory;\n }\n }\n\n /**\n * Remove default loaders from the list of loaders\n *\n * @returns this\n */\n removeDefaultLoaders() {\n this.config.defaultLoaders = false;\n return this;\n }\n\n /**\n * Add a custom loader to the list of loaders\n *\n * @param loader loader to add to the list of loaders\n * @returns this\n */\n addLoader(loader: ContextLoader) {\n this.config.customLoaders.push(loader);\n return this;\n }\n\n /**\n * Replace the default loader for typed data clear signing contexts\n *\n * @param loader loader to use for typed data clear signing contexts\n * @returns this\n */\n addTypedDataLoader(loader: TypedDataContextLoader) {\n this.config.customTypedDataLoader = loader;\n return this;\n }\n\n /**\n * Replace the default loader for Solana context\n *\n * @param loader loader to use for Solana context\n * @returns this\n */\n addSolanaLoader(loader: SolanaContextLoader) {\n this.config.customSolanaLoader = loader;\n return this;\n }\n\n /**\n * Add a custom CAL configuration\n *\n * @param calConfig\n * @returns this\n */\n setCalConfig(calConfig: ContextModuleCalConfig) {\n this.config.cal = calConfig;\n return this;\n }\n\n /**\n * Add a custom metadata service configuration\n *\n * @param metadataServiceConfig\n * @returns this\n */\n setMetadataServiceConfig(\n metadataServiceConfig: ContextModuleMetadataServiceConfig,\n ) {\n this.config.metadataServiceDomain = metadataServiceConfig;\n return this;\n }\n\n /**\n * Add a custom web3 checks configuration\n *\n * @param web3ChecksConfig\n * @returns this\n */\n setWeb3ChecksConfig(web3ChecksConfig: ContextModuleWeb3ChecksConfig) {\n this.config.web3checks = web3ChecksConfig;\n return this;\n }\n\n /**\n * Add datasource configuration\n *\n * @param datasourceConfig\n * @returns this\n */\n setDatasourceConfig(datasourceConfig: ContextModuleDatasourceConfig) {\n this.config.datasource = datasourceConfig;\n return this;\n }\n\n /**\n * Set a custom trusted name data source\n *\n * @param dataSource data source to use for trusted name resolution\n * @returns this\n */\n setTrustedNameDataSource(dataSource: TrustedNameDataSource) {\n this.config.customTrustedNameDataSource = dataSource;\n return this;\n }\n\n /**\n * Set a custom logger factory\n *\n * @param loggerFactory\n * @returns this\n */\n setLoggerFactory(loggerFactory: (tag: string) => LoggerPublisherService) {\n this.config.loggerFactory = loggerFactory;\n return this;\n }\n\n /**\n * Build the context module\n *\n * @returns the context module\n */\n build(): ContextModule {\n const config = { ...this.config, originToken: this.originToken };\n return new DefaultContextModule(config);\n }\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,0BAAAE,EAAA,mBAAAC,IAAA,eAAAC,EAAAJ,GAAA,IAAAK,EAGO,2CAePC,EAAqC,kCAErC,MAAMC,EAAkB,kDAClBC,EAA0B,+CAC1BC,EAAkC,kCAE3BN,EAAsC,CACjD,IAAK,CACH,IAAKI,EACL,KAAM,OACN,OAAQ,MACV,EACA,WAAY,CACV,IAAKC,CACP,EACA,sBAAuB,CACrB,IAAKC,CACP,EACA,eAAgB,GAChB,cAAe,CAAC,EAChB,oBAAqB,GACrB,mBAAoB,CAAC,EACrB,sBAAuB,OACvB,mBAAoB,OACpB,cAAe,mBACjB,EAEO,MAAMP,CAAqB,CACxB,OACA,YAER,YAAY,CAAE,YAAAQ,EAAa,cAAAC,CAAc,EAAiC,CACxE,KAAK,YAAcD,EAEnB,KAAK,OAAS,CACZ,GAAGP,EACH,IAAK,CAAE,GAAGA,EAAe,GAAI,EAC7B,WAAY,CAAE,GAAGA,EAAe,UAAW,EAC3C,sBAAuB,CAAE,GAAGA,EAAe,qBAAsB,EACjE,cAAe,CAAC,GAAGA,EAAe,aAAa,EAC/C,mBAAoB,CAAC,GAAGA,EAAe,kBAAkB,CAC3D,EACIQ,IACF,KAAK,OAAO,cAAgBA,EAEhC,CAOA,sBAAuB,CACrB,YAAK,OAAO,eAAiB,GACtB,IACT,CAQA,UAAUC,EAAuB,CAC/B,YAAK,OAAO,cAAc,KAAKA,CAAM,EAC9B,IACT,CAQA,mBAAmBA,EAAgC,CACjD,YAAK,OAAO,sBAAwBA,EAC7B,IACT,CAQA,gBAAgBA,EAA6B,CAC3C,YAAK,OAAO,mBAAqBA,EAC1B,IACT,CAQA,aAAaC,EAAmC,CAC9C,YAAK,OAAO,IAAMA,EACX,IACT,CAQA,yBACEC,EACA,CACA,YAAK,OAAO,sBAAwBA,EAC7B,IACT,CAQA,oBAAoBC,EAAiD,CACnE,YAAK,OAAO,WAAaA,EAClB,IACT,CAQA,oBAAoBC,EAAiD,CACnE,YAAK,OAAO,WAAaA,EAClB,IACT,CAQA,yBAAyBC,EAAmC,CAC1D,YAAK,OAAO,4BAA8BA,EACnC,IACT,CAQA,iBAAiBN,EAAwD,CACvE,YAAK,OAAO,cAAgBA,EACrB,IACT,CAOA,OAAuB,CACrB,MAAMO,EAAS,CAAE,GAAG,KAAK,OAAQ,YAAa,KAAK,WAAY,EAC/D,OAAO,IAAI,uBAAqBA,CAAM,CACxC,CACF",
|
|
6
|
+
"names": ["ContextModuleBuilder_exports", "__export", "ContextModuleBuilder", "DEFAULT_CONFIG", "__toCommonJS", "import_device_management_kit", "import_DefaultContextModule", "DEFAULT_CAL_URL", "DEFAULT_WEB3_CHECKS_URL", "DEFAULT_METADATA_SERVICE_DOMAIN", "originToken", "loggerFactory", "loader", "calConfig", "metadataServiceConfig", "web3ChecksConfig", "datasourceConfig", "dataSource", "config"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var o=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var p=(n,r,t,i)=>{if(r&&typeof r=="object"||typeof r=="function")for(let e of g(r))!c.call(n,e)&&e!==t&&o(n,e,{get:()=>r[e],enumerable:!(i=a(r,e))||i.enumerable});return n};var s=n=>p(o({},"__esModule",{value:!0}),n);var S={};module.exports=s(S);
|
|
2
|
+
//# sourceMappingURL=SigningTrackerDataSource.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/signing-tracker/data/SigningTrackerDataSource.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Data source for tracking signing events.\n *\n * Implement this interface to POST signing context to an external API\n * for blind-signing tracking or auditing purposes.\n *\n * The `reportSigningContext` method is called just before the device\n * signature request, after contexts have been provided to the device,\n * when the blind-sign status is known.\n *\n * @example\n * ```ts\n * const myTracker: SigningTrackerDataSource = {\n * reportSigningContext: async (params) => {\n * await fetch(\"https://my-api.example.com/signing-events\", {\n * method: \"POST\",\n * headers: { \"Content-Type\": \"application/json\" },\n * body: JSON.stringify(params),\n * });\n * },\n * };\n *\n * const contextModule = new ContextModuleBuilder({ ... })\n * .setSigningTrackerDataSource(myTracker)\n * .build();\n * ```\n */\nexport interface SigningTrackerDataSource {\n /**\n * Report signing context to an external API.\n *\n * Called with the full signing context info (including `isBlindSign`\n * status) just before the signature is requested from the device.\n *\n * @param params - The signing context info. Shape varies by signer\n * (ETH vs Solana) but always contains `signatureId` and `isBlindSign`.\n */\n reportSigningContext(params: Record<string, unknown>): Promise<void>;\n}\n"],
|
|
5
|
+
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
|
+
"names": ["SigningTrackerDataSource_exports", "__toCommonJS"]
|
|
7
|
+
}
|
package/lib/esm/package.json
CHANGED
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"watch:builds": "pnpm ldmk-tool watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
59
59
|
"watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
|
|
60
60
|
},
|
|
61
|
-
"version": "0.0.0-develop-
|
|
61
|
+
"version": "0.0.0-develop-20260211001836"
|
|
62
62
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DefaultContextModule as a}from"./DefaultContextModule";const i=
|
|
1
|
+
import{noopLoggerFactory as r}from"@ledgerhq/device-management-kit";import{DefaultContextModule as a}from"./DefaultContextModule";const i="https://crypto-assets-service.api.ledger.com/v1",n="https://web3checks-backend.api.ledger.com/v3",s="https://nft.api.live.ledger.com",t={cal:{url:i,mode:"prod",branch:"main"},web3checks:{url:n},metadataServiceDomain:{url:s},defaultLoaders:!0,customLoaders:[],defaultFieldLoaders:!0,customFieldLoaders:[],customTypedDataLoader:void 0,customSolanaLoader:void 0,loggerFactory:r};class g{config;originToken;constructor({originToken:e,loggerFactory:o}){this.originToken=e,this.config={...t,cal:{...t.cal},web3checks:{...t.web3checks},metadataServiceDomain:{...t.metadataServiceDomain},customLoaders:[...t.customLoaders],customFieldLoaders:[...t.customFieldLoaders]},o&&(this.config.loggerFactory=o)}removeDefaultLoaders(){return this.config.defaultLoaders=!1,this}addLoader(e){return this.config.customLoaders.push(e),this}addTypedDataLoader(e){return this.config.customTypedDataLoader=e,this}addSolanaLoader(e){return this.config.customSolanaLoader=e,this}setCalConfig(e){return this.config.cal=e,this}setMetadataServiceConfig(e){return this.config.metadataServiceDomain=e,this}setWeb3ChecksConfig(e){return this.config.web3checks=e,this}setDatasourceConfig(e){return this.config.datasource=e,this}setTrustedNameDataSource(e){return this.config.customTrustedNameDataSource=e,this}setLoggerFactory(e){return this.config.loggerFactory=e,this}build(){const e={...this.config,originToken:this.originToken};return new a(e)}}export{g as ContextModuleBuilder,t as DEFAULT_CONFIG};
|
|
2
2
|
//# sourceMappingURL=ContextModuleBuilder.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/ContextModuleBuilder.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["
|
|
4
|
+
"sourcesContent": ["import {\n type LoggerPublisherService,\n noopLoggerFactory,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { type ContextModuleConstructorArgs } from \"./config/model/ContextModuleBuildArgs\";\nimport {\n type ContextModuleCalConfig,\n type ContextModuleConfig,\n type ContextModuleDatasourceConfig,\n type ContextModuleMetadataServiceConfig,\n type ContextModuleWeb3ChecksConfig,\n} from \"./config/model/ContextModuleConfig\";\nimport { type ContextLoader } from \"./shared/domain/ContextLoader\";\nimport { type SolanaContextLoader } from \"./solana/domain/SolanaContextLoader\";\nimport { type TrustedNameDataSource } from \"./trusted-name/data/TrustedNameDataSource\";\nimport { type TypedDataContextLoader } from \"./typed-data/domain/TypedDataContextLoader\";\nimport { type ContextModule } from \"./ContextModule\";\nimport { DefaultContextModule } from \"./DefaultContextModule\";\n\nconst DEFAULT_CAL_URL = \"https://crypto-assets-service.api.ledger.com/v1\";\nconst DEFAULT_WEB3_CHECKS_URL = \"https://web3checks-backend.api.ledger.com/v3\";\nconst DEFAULT_METADATA_SERVICE_DOMAIN = \"https://nft.api.live.ledger.com\";\n\nexport const DEFAULT_CONFIG: ContextModuleConfig = {\n cal: {\n url: DEFAULT_CAL_URL,\n mode: \"prod\",\n branch: \"main\",\n },\n web3checks: {\n url: DEFAULT_WEB3_CHECKS_URL,\n },\n metadataServiceDomain: {\n url: DEFAULT_METADATA_SERVICE_DOMAIN,\n },\n defaultLoaders: true,\n customLoaders: [],\n defaultFieldLoaders: true,\n customFieldLoaders: [],\n customTypedDataLoader: undefined,\n customSolanaLoader: undefined,\n loggerFactory: noopLoggerFactory,\n};\n\nexport class ContextModuleBuilder {\n private config: ContextModuleConfig;\n private originToken?: string;\n\n constructor({ originToken, loggerFactory }: ContextModuleConstructorArgs) {\n this.originToken = originToken;\n\n this.config = {\n ...DEFAULT_CONFIG,\n cal: { ...DEFAULT_CONFIG.cal },\n web3checks: { ...DEFAULT_CONFIG.web3checks },\n metadataServiceDomain: { ...DEFAULT_CONFIG.metadataServiceDomain },\n customLoaders: [...DEFAULT_CONFIG.customLoaders],\n customFieldLoaders: [...DEFAULT_CONFIG.customFieldLoaders],\n };\n if (loggerFactory) {\n this.config.loggerFactory = loggerFactory;\n }\n }\n\n /**\n * Remove default loaders from the list of loaders\n *\n * @returns this\n */\n removeDefaultLoaders() {\n this.config.defaultLoaders = false;\n return this;\n }\n\n /**\n * Add a custom loader to the list of loaders\n *\n * @param loader loader to add to the list of loaders\n * @returns this\n */\n addLoader(loader: ContextLoader) {\n this.config.customLoaders.push(loader);\n return this;\n }\n\n /**\n * Replace the default loader for typed data clear signing contexts\n *\n * @param loader loader to use for typed data clear signing contexts\n * @returns this\n */\n addTypedDataLoader(loader: TypedDataContextLoader) {\n this.config.customTypedDataLoader = loader;\n return this;\n }\n\n /**\n * Replace the default loader for Solana context\n *\n * @param loader loader to use for Solana context\n * @returns this\n */\n addSolanaLoader(loader: SolanaContextLoader) {\n this.config.customSolanaLoader = loader;\n return this;\n }\n\n /**\n * Add a custom CAL configuration\n *\n * @param calConfig\n * @returns this\n */\n setCalConfig(calConfig: ContextModuleCalConfig) {\n this.config.cal = calConfig;\n return this;\n }\n\n /**\n * Add a custom metadata service configuration\n *\n * @param metadataServiceConfig\n * @returns this\n */\n setMetadataServiceConfig(\n metadataServiceConfig: ContextModuleMetadataServiceConfig,\n ) {\n this.config.metadataServiceDomain = metadataServiceConfig;\n return this;\n }\n\n /**\n * Add a custom web3 checks configuration\n *\n * @param web3ChecksConfig\n * @returns this\n */\n setWeb3ChecksConfig(web3ChecksConfig: ContextModuleWeb3ChecksConfig) {\n this.config.web3checks = web3ChecksConfig;\n return this;\n }\n\n /**\n * Add datasource configuration\n *\n * @param datasourceConfig\n * @returns this\n */\n setDatasourceConfig(datasourceConfig: ContextModuleDatasourceConfig) {\n this.config.datasource = datasourceConfig;\n return this;\n }\n\n /**\n * Set a custom trusted name data source\n *\n * @param dataSource data source to use for trusted name resolution\n * @returns this\n */\n setTrustedNameDataSource(dataSource: TrustedNameDataSource) {\n this.config.customTrustedNameDataSource = dataSource;\n return this;\n }\n\n /**\n * Set a custom logger factory\n *\n * @param loggerFactory\n * @returns this\n */\n setLoggerFactory(loggerFactory: (tag: string) => LoggerPublisherService) {\n this.config.loggerFactory = loggerFactory;\n return this;\n }\n\n /**\n * Build the context module\n *\n * @returns the context module\n */\n build(): ContextModule {\n const config = { ...this.config, originToken: this.originToken };\n return new DefaultContextModule(config);\n }\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAEE,qBAAAA,MACK,kCAeP,OAAS,wBAAAC,MAA4B,yBAErC,MAAMC,EAAkB,kDAClBC,EAA0B,+CAC1BC,EAAkC,kCAE3BC,EAAsC,CACjD,IAAK,CACH,IAAKH,EACL,KAAM,OACN,OAAQ,MACV,EACA,WAAY,CACV,IAAKC,CACP,EACA,sBAAuB,CACrB,IAAKC,CACP,EACA,eAAgB,GAChB,cAAe,CAAC,EAChB,oBAAqB,GACrB,mBAAoB,CAAC,EACrB,sBAAuB,OACvB,mBAAoB,OACpB,cAAeJ,CACjB,EAEO,MAAMM,CAAqB,CACxB,OACA,YAER,YAAY,CAAE,YAAAC,EAAa,cAAAC,CAAc,EAAiC,CACxE,KAAK,YAAcD,EAEnB,KAAK,OAAS,CACZ,GAAGF,EACH,IAAK,CAAE,GAAGA,EAAe,GAAI,EAC7B,WAAY,CAAE,GAAGA,EAAe,UAAW,EAC3C,sBAAuB,CAAE,GAAGA,EAAe,qBAAsB,EACjE,cAAe,CAAC,GAAGA,EAAe,aAAa,EAC/C,mBAAoB,CAAC,GAAGA,EAAe,kBAAkB,CAC3D,EACIG,IACF,KAAK,OAAO,cAAgBA,EAEhC,CAOA,sBAAuB,CACrB,YAAK,OAAO,eAAiB,GACtB,IACT,CAQA,UAAUC,EAAuB,CAC/B,YAAK,OAAO,cAAc,KAAKA,CAAM,EAC9B,IACT,CAQA,mBAAmBA,EAAgC,CACjD,YAAK,OAAO,sBAAwBA,EAC7B,IACT,CAQA,gBAAgBA,EAA6B,CAC3C,YAAK,OAAO,mBAAqBA,EAC1B,IACT,CAQA,aAAaC,EAAmC,CAC9C,YAAK,OAAO,IAAMA,EACX,IACT,CAQA,yBACEC,EACA,CACA,YAAK,OAAO,sBAAwBA,EAC7B,IACT,CAQA,oBAAoBC,EAAiD,CACnE,YAAK,OAAO,WAAaA,EAClB,IACT,CAQA,oBAAoBC,EAAiD,CACnE,YAAK,OAAO,WAAaA,EAClB,IACT,CAQA,yBAAyBC,EAAmC,CAC1D,YAAK,OAAO,4BAA8BA,EACnC,IACT,CAQA,iBAAiBN,EAAwD,CACvE,YAAK,OAAO,cAAgBA,EACrB,IACT,CAOA,OAAuB,CACrB,MAAMO,EAAS,CAAE,GAAG,KAAK,OAAQ,YAAa,KAAK,WAAY,EAC/D,OAAO,IAAId,EAAqBc,CAAM,CACxC,CACF",
|
|
6
|
+
"names": ["noopLoggerFactory", "DefaultContextModule", "DEFAULT_CAL_URL", "DEFAULT_WEB3_CHECKS_URL", "DEFAULT_METADATA_SERVICE_DOMAIN", "DEFAULT_CONFIG", "ContextModuleBuilder", "originToken", "loggerFactory", "loader", "calConfig", "metadataServiceConfig", "web3ChecksConfig", "datasourceConfig", "dataSource", "config"]
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=SigningTrackerDataSource.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextModuleBuilder.d.ts","sourceRoot":"","sources":["../../../src/ContextModuleBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ContextModuleBuilder.d.ts","sourceRoot":"","sources":["../../../src/ContextModuleBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAE5B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,4BAA4B,EAAE,MAAM,uCAAuC,CAAC;AAC1F,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACxB,KAAK,6BAA6B,EAClC,KAAK,kCAAkC,EACvC,KAAK,6BAA6B,EACnC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC/E,OAAO,EAAE,KAAK,qBAAqB,EAAE,MAAM,2CAA2C,CAAC;AACvF,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAOrD,eAAO,MAAM,cAAc,EAAE,mBAmB5B,CAAC;AAEF,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,WAAW,CAAC,CAAS;gBAEjB,EAAE,WAAW,EAAE,aAAa,EAAE,EAAE,4BAA4B;IAgBxE;;;;OAIG;IACH,oBAAoB;IAKpB;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,aAAa;IAK/B;;;;;OAKG;IACH,kBAAkB,CAAC,MAAM,EAAE,sBAAsB;IAKjD;;;;;OAKG;IACH,eAAe,CAAC,MAAM,EAAE,mBAAmB;IAK3C;;;;;OAKG;IACH,YAAY,CAAC,SAAS,EAAE,sBAAsB;IAK9C;;;;;OAKG;IACH,wBAAwB,CACtB,qBAAqB,EAAE,kCAAkC;IAM3D;;;;;OAKG;IACH,mBAAmB,CAAC,gBAAgB,EAAE,6BAA6B;IAKnE;;;;;OAKG;IACH,mBAAmB,CAAC,gBAAgB,EAAE,6BAA6B;IAKnE;;;;;OAKG;IACH,wBAAwB,CAAC,UAAU,EAAE,qBAAqB;IAK1D;;;;;OAKG;IACH,gBAAgB,CAAC,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,sBAAsB;IAKvE;;;;OAIG;IACH,KAAK,IAAI,aAAa;CAIvB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data source for tracking signing events.
|
|
3
|
+
*
|
|
4
|
+
* Implement this interface to POST signing context to an external API
|
|
5
|
+
* for blind-signing tracking or auditing purposes.
|
|
6
|
+
*
|
|
7
|
+
* The `reportSigningContext` method is called just before the device
|
|
8
|
+
* signature request, after contexts have been provided to the device,
|
|
9
|
+
* when the blind-sign status is known.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* const myTracker: SigningTrackerDataSource = {
|
|
14
|
+
* reportSigningContext: async (params) => {
|
|
15
|
+
* await fetch("https://my-api.example.com/signing-events", {
|
|
16
|
+
* method: "POST",
|
|
17
|
+
* headers: { "Content-Type": "application/json" },
|
|
18
|
+
* body: JSON.stringify(params),
|
|
19
|
+
* });
|
|
20
|
+
* },
|
|
21
|
+
* };
|
|
22
|
+
*
|
|
23
|
+
* const contextModule = new ContextModuleBuilder({ ... })
|
|
24
|
+
* .setSigningTrackerDataSource(myTracker)
|
|
25
|
+
* .build();
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export interface SigningTrackerDataSource {
|
|
29
|
+
/**
|
|
30
|
+
* Report signing context to an external API.
|
|
31
|
+
*
|
|
32
|
+
* Called with the full signing context info (including `isBlindSign`
|
|
33
|
+
* status) just before the signature is requested from the device.
|
|
34
|
+
*
|
|
35
|
+
* @param params - The signing context info. Shape varies by signer
|
|
36
|
+
* (ETH vs Solana) but always contains `signatureId` and `isBlindSign`.
|
|
37
|
+
*/
|
|
38
|
+
reportSigningContext(params: Record<string, unknown>): Promise<void>;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=SigningTrackerDataSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SigningTrackerDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/signing-tracker/data/SigningTrackerDataSource.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;;;;OAQG;IACH,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtE"}
|