@ledgerhq/context-module 2.4.1 → 2.5.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/lib/cjs/package.json +1 -1
- package/lib/cjs/src/ContextModule.js +1 -1
- package/lib/cjs/src/ContextModule.js.map +1 -1
- package/lib/cjs/src/ContextModuleBuilder.js +1 -1
- package/lib/cjs/src/ContextModuleBuilder.js.map +2 -2
- package/lib/cjs/src/DefaultContextModule.js +1 -1
- package/lib/cjs/src/DefaultContextModule.js.map +2 -2
- package/lib/cjs/src/di.js +1 -1
- package/lib/cjs/src/di.js.map +3 -3
- package/lib/cjs/src/index.js +1 -1
- package/lib/cjs/src/index.js.map +2 -2
- package/lib/cjs/src/modules/multichain/reporter/data/BlindSigningReporterDatasource.js.map +1 -1
- package/lib/cjs/src/modules/multichain/reporter/data/HttpBlindSigningReporterDatasource.js +1 -1
- package/lib/cjs/src/modules/multichain/reporter/data/HttpBlindSigningReporterDatasource.js.map +2 -2
- package/lib/cjs/src/modules/multichain/reporter/data/HttpBlindSigningReporterDatasource.test.js +1 -1
- package/lib/cjs/src/modules/multichain/reporter/data/HttpBlindSigningReporterDatasource.test.js.map +2 -2
- package/lib/cjs/src/modules/multichain/reporter/data/dto/BlindSigningEventDto.js.map +1 -1
- package/lib/cjs/src/modules/multichain/reporter/domain/DefaultBlindSigningReporter.test.js +1 -1
- package/lib/cjs/src/modules/multichain/reporter/domain/DefaultBlindSigningReporter.test.js.map +2 -2
- package/lib/cjs/src/modules/multichain/reporter/model/BlindSigningEvent.js +1 -1
- package/lib/cjs/src/modules/multichain/reporter/model/BlindSigningEvent.js.map +2 -2
- package/lib/cjs/src/modules/multichain/sign-reporter/data/HttpSignReporterDatasource.js +2 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/data/HttpSignReporterDatasource.js.map +7 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/data/HttpSignReporterDatasource.test.js +2 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/data/HttpSignReporterDatasource.test.js.map +7 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/data/SignReporterDatasource.js +2 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/data/SignReporterDatasource.js.map +7 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/data/dto/SigningEventDto.js +2 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/data/dto/SigningEventDto.js.map +7 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/di/signReporterModuleFactory.js +2 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/di/signReporterModuleFactory.js.map +7 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/di/signReporterTypes.js +2 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/di/signReporterTypes.js.map +7 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/domain/DefaultSignReporter.js +2 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/domain/DefaultSignReporter.js.map +7 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/domain/DefaultSignReporter.test.js +2 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/domain/DefaultSignReporter.test.js.map +7 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/domain/SignReporter.js +2 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/domain/SignReporter.js.map +7 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/model/SignReportParams.js +2 -0
- package/lib/cjs/src/modules/multichain/sign-reporter/model/SignReportParams.js.map +7 -0
- package/lib/cjs/src/{modules/multichain/reporter → shared}/model/BlindSigningModelId.js.map +1 -1
- package/lib/esm/package.json +1 -1
- package/lib/esm/src/ContextModuleBuilder.js +1 -1
- package/lib/esm/src/ContextModuleBuilder.js.map +2 -2
- package/lib/esm/src/DefaultContextModule.js +1 -1
- package/lib/esm/src/DefaultContextModule.js.map +2 -2
- package/lib/esm/src/di.js +1 -1
- package/lib/esm/src/di.js.map +3 -3
- package/lib/esm/src/index.js +1 -1
- package/lib/esm/src/index.js.map +2 -2
- package/lib/esm/src/modules/multichain/reporter/data/HttpBlindSigningReporterDatasource.js +1 -1
- package/lib/esm/src/modules/multichain/reporter/data/HttpBlindSigningReporterDatasource.js.map +2 -2
- package/lib/esm/src/modules/multichain/reporter/data/HttpBlindSigningReporterDatasource.test.js +1 -1
- package/lib/esm/src/modules/multichain/reporter/data/HttpBlindSigningReporterDatasource.test.js.map +2 -2
- package/lib/esm/src/modules/multichain/reporter/domain/DefaultBlindSigningReporter.test.js +1 -1
- package/lib/esm/src/modules/multichain/reporter/domain/DefaultBlindSigningReporter.test.js.map +2 -2
- package/lib/esm/src/modules/multichain/reporter/model/BlindSigningEvent.js +1 -1
- package/lib/esm/src/modules/multichain/reporter/model/BlindSigningEvent.js.map +2 -2
- package/lib/esm/src/modules/multichain/sign-reporter/data/HttpSignReporterDatasource.js +2 -0
- package/lib/esm/src/modules/multichain/sign-reporter/data/HttpSignReporterDatasource.js.map +7 -0
- package/lib/esm/src/modules/multichain/sign-reporter/data/HttpSignReporterDatasource.test.js +2 -0
- package/lib/esm/src/modules/multichain/sign-reporter/data/HttpSignReporterDatasource.test.js.map +7 -0
- package/lib/esm/src/modules/multichain/sign-reporter/data/SignReporterDatasource.js +1 -0
- package/lib/esm/src/modules/multichain/sign-reporter/data/SignReporterDatasource.js.map +7 -0
- package/lib/esm/src/modules/multichain/sign-reporter/data/dto/SigningEventDto.js +1 -0
- package/lib/esm/src/modules/multichain/sign-reporter/data/dto/SigningEventDto.js.map +7 -0
- package/lib/esm/src/modules/multichain/sign-reporter/di/signReporterModuleFactory.js +2 -0
- package/lib/esm/src/modules/multichain/sign-reporter/di/signReporterModuleFactory.js.map +7 -0
- package/lib/esm/src/modules/multichain/sign-reporter/di/signReporterTypes.js +2 -0
- package/lib/esm/src/modules/multichain/sign-reporter/di/signReporterTypes.js.map +7 -0
- package/lib/esm/src/modules/multichain/sign-reporter/domain/DefaultSignReporter.js +2 -0
- package/lib/esm/src/modules/multichain/sign-reporter/domain/DefaultSignReporter.js.map +7 -0
- package/lib/esm/src/modules/multichain/sign-reporter/domain/DefaultSignReporter.test.js +2 -0
- package/lib/esm/src/modules/multichain/sign-reporter/domain/DefaultSignReporter.test.js.map +7 -0
- package/lib/esm/src/modules/multichain/sign-reporter/domain/SignReporter.js +1 -0
- package/lib/esm/src/modules/multichain/sign-reporter/domain/SignReporter.js.map +7 -0
- package/lib/esm/src/modules/multichain/sign-reporter/model/SignReportParams.js +2 -0
- package/lib/esm/src/modules/multichain/sign-reporter/model/SignReportParams.js.map +7 -0
- package/lib/esm/src/{modules/multichain/reporter → shared}/model/BlindSigningModelId.js.map +1 -1
- package/lib/types/src/ContextModule.d.ts +2 -0
- package/lib/types/src/ContextModule.d.ts.map +1 -1
- package/lib/types/src/DefaultContextModule.d.ts +3 -0
- package/lib/types/src/DefaultContextModule.d.ts.map +1 -1
- package/lib/types/src/di.d.ts.map +1 -1
- package/lib/types/src/index.d.ts +2 -1
- package/lib/types/src/index.d.ts.map +1 -1
- package/lib/types/src/modules/multichain/reporter/data/BlindSigningReporterDatasource.d.ts +1 -1
- package/lib/types/src/modules/multichain/reporter/data/BlindSigningReporterDatasource.d.ts.map +1 -1
- package/lib/types/src/modules/multichain/reporter/data/dto/BlindSigningEventDto.d.ts +1 -1
- package/lib/types/src/modules/multichain/reporter/data/dto/BlindSigningEventDto.d.ts.map +1 -1
- package/lib/types/src/modules/multichain/reporter/model/BlindSigningEvent.d.ts +1 -0
- package/lib/types/src/modules/multichain/reporter/model/BlindSigningEvent.d.ts.map +1 -1
- package/lib/types/src/modules/multichain/sign-reporter/data/HttpSignReporterDatasource.d.ts +14 -0
- package/lib/types/src/modules/multichain/sign-reporter/data/HttpSignReporterDatasource.d.ts.map +1 -0
- package/lib/types/src/modules/multichain/sign-reporter/data/HttpSignReporterDatasource.test.d.ts +2 -0
- package/lib/types/src/modules/multichain/sign-reporter/data/HttpSignReporterDatasource.test.d.ts.map +1 -0
- package/lib/types/src/modules/multichain/sign-reporter/data/SignReporterDatasource.d.ts +6 -0
- package/lib/types/src/modules/multichain/sign-reporter/data/SignReporterDatasource.d.ts.map +1 -0
- package/lib/types/src/modules/multichain/sign-reporter/data/dto/SigningEventDto.d.ts +48 -0
- package/lib/types/src/modules/multichain/sign-reporter/data/dto/SigningEventDto.d.ts.map +1 -0
- package/lib/types/src/modules/multichain/sign-reporter/di/signReporterModuleFactory.d.ts +3 -0
- package/lib/types/src/modules/multichain/sign-reporter/di/signReporterModuleFactory.d.ts.map +1 -0
- package/lib/types/src/modules/multichain/sign-reporter/di/signReporterTypes.d.ts +5 -0
- package/lib/types/src/modules/multichain/sign-reporter/di/signReporterTypes.d.ts.map +1 -0
- package/lib/types/src/modules/multichain/sign-reporter/domain/DefaultSignReporter.d.ts +10 -0
- package/lib/types/src/modules/multichain/sign-reporter/domain/DefaultSignReporter.d.ts.map +1 -0
- package/lib/types/src/modules/multichain/sign-reporter/domain/DefaultSignReporter.test.d.ts +2 -0
- package/lib/types/src/modules/multichain/sign-reporter/domain/DefaultSignReporter.test.d.ts.map +1 -0
- package/lib/types/src/modules/multichain/sign-reporter/domain/SignReporter.d.ts +6 -0
- package/lib/types/src/modules/multichain/sign-reporter/domain/SignReporter.d.ts.map +1 -0
- package/lib/types/src/modules/multichain/sign-reporter/model/SignReportParams.d.ts +45 -0
- package/lib/types/src/modules/multichain/sign-reporter/model/SignReportParams.d.ts.map +1 -0
- package/lib/types/src/shared/model/BlindSigningModelId.d.ts.map +1 -0
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/lib/types/src/modules/multichain/reporter/model/BlindSigningModelId.d.ts.map +0 -1
- /package/lib/cjs/src/{modules/multichain/reporter → shared}/model/BlindSigningModelId.js +0 -0
- /package/lib/esm/src/{modules/multichain/reporter → shared}/model/BlindSigningModelId.js +0 -0
- /package/lib/types/src/{modules/multichain/reporter → shared}/model/BlindSigningModelId.d.ts +0 -0
package/lib/esm/src/di.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/di.ts"],
|
|
4
|
-
"sourcesContent": ["import { type LoggerPublisherService } from \"@ledgerhq/device-management-kit\";\nimport { Container } from \"inversify\";\n\nimport { configModuleFactory } from \"@/config/di/configModuleFactory\";\nimport { configTypes } from \"@/config/di/configTypes\";\nimport {\n type ContextModuleLoaderConfig,\n type ContextModuleServiceConfig,\n} from \"@/config/model/ContextModuleConfig\";\nimport { accountOwnershipModuleFactory } from \"@/modules/concordium/account-ownership/di/accountOwnershipModuleFactory\";\nimport { calldataModuleFactory } from \"@/modules/ethereum/calldata/di/calldataModuleFactory\";\nimport { dynamicNetworkModuleFactory } from \"@/modules/ethereum/dynamic-network/di/dynamicNetworkModuleFactory\";\nimport { externalPluginModuleFactory } from \"@/modules/ethereum/external-plugin/di/externalPluginModuleFactory\";\nimport { gatedSigningModuleFactory } from \"@/modules/ethereum/gated-signing/di/gatedSigningModuleFactory\";\nimport { nftModuleFactory } from \"@/modules/ethereum/nft/di/nftModuleFactory\";\nimport { proxyModuleFactory } from \"@/modules/ethereum/proxy/di/proxyModuleFactory\";\nimport { safeModuleFactory } from \"@/modules/ethereum/safe/di/safeModuleFactory\";\nimport { tokenModuleFactory as ethereumTokenModuleFactory } from \"@/modules/ethereum/token/di/tokenModuleFactory\";\nimport { trustedNameModuleFactory } from \"@/modules/ethereum/trusted-name/di/trustedNameModuleFactory\";\nimport { typedDataModuleFactory } from \"@/modules/ethereum/typed-data/di/typedDataModuleFactory\";\nimport { uniswapModuleFactory } from \"@/modules/ethereum/uniswap/di/uniswapModuleFactory\";\nimport { nanoPkiModuleFactory } from \"@/modules/multichain/pki/di/pkiModuleFactory\";\nimport { reporterModuleFactory } from \"@/modules/multichain/reporter/di/reporterModuleFactory\";\nimport { ethereumTransactionCheckModuleFactory } from \"@/modules/multichain/transaction-check/di/ethereumTransactionCheckModuleFactory\";\nimport { solanaTransactionCheckModuleFactory } from \"@/modules/multichain/transaction-check/di/solanaTransactionCheckModuleFactory\";\nimport { altResolutionModuleFactory } from \"@/modules/solana/alt-resolution/di/altResolutionModuleFactory\";\nimport { enumVariantModuleFactory } from \"@/modules/solana/enum-variant/di/enumVariantModuleFactory\";\nimport { instructionInfoModuleFactory } from \"@/modules/solana/instruction-info/di/instructionInfoModuleFactory\";\nimport { lifiModuleFactory } from \"@/modules/solana/lifi/di/lifiModuleFactory\";\nimport { ownerInfoModuleFactory } from \"@/modules/solana/owner-info/di/ownerInfoModuleFactory\";\nimport { tokenModuleFactory as solanaTokenModuleFactory } from \"@/modules/solana/token/di/tokenModuleFactory\";\nimport { tokenAccountStateModuleFactory } from \"@/modules/solana/token-account-state/di/tokenAccountStateModuleFactory\";\nimport { tokenInfoModuleFactory } from \"@/modules/solana/token-info/di/tokenInfoModuleFactory\";\nimport { solanaTrustedNameModuleFactory } from \"@/modules/solana/trusted-name/di/trustedNameModuleFactory\";\nimport { ContextModuleChainID } from \"@/shared/domain/ContextModuleChainID\";\nimport { networkModuleFactory } from \"@/shared/network/di/networkModuleFactory\";\n\ntype MakeContainerArgs = {\n config: ContextModuleServiceConfig & ContextModuleLoaderConfig;\n};\n\nexport const makeContainer = ({ config }: MakeContainerArgs) => {\n const container = new Container();\n\n container\n .bind<\n (tag: string) => LoggerPublisherService\n >(configTypes.ContextModuleLoggerFactory)\n .toConstantValue(config.loggerFactory);\n\n const { chain } = config;\n\n // infrastructure modules needed by all chains\n container.loadSync(configModuleFactory(config), networkModuleFactory(config));\n\n switch (chain) {\n case ContextModuleChainID.Ethereum:\n container.loadSync(\n nanoPkiModuleFactory(),\n reporterModuleFactory(),\n trustedNameModuleFactory(config.customTrustedNameDataSource),\n externalPluginModuleFactory(),\n dynamicNetworkModuleFactory(),\n nftModuleFactory(),\n proxyModuleFactory(config.datasource),\n safeModuleFactory(),\n gatedSigningModuleFactory(),\n ethereumTokenModuleFactory(),\n calldataModuleFactory(),\n typedDataModuleFactory(),\n uniswapModuleFactory(),\n ethereumTransactionCheckModuleFactory(),\n );\n break;\n case ContextModuleChainID.Solana:\n container.loadSync(\n nanoPkiModuleFactory(),\n ownerInfoModuleFactory(),\n solanaTokenModuleFactory(),\n lifiModuleFactory(),\n solanaTransactionCheckModuleFactory(),\n instructionInfoModuleFactory(),\n enumVariantModuleFactory(),\n tokenInfoModuleFactory(),\n tokenAccountStateModuleFactory(),\n altResolutionModuleFactory(),\n solanaTrustedNameModuleFactory(),\n );\n break;\n case ContextModuleChainID.Concordium:\n container.loadSync(\n nanoPkiModuleFactory(),\n accountOwnershipModuleFactory(),\n );\n break;\n default: {\n // ensure exhaustive check at compile time when new chains are added\n const exhaustiveCheck: never = chain;\n void exhaustiveCheck;\n }\n }\n\n return container;\n};\n"],
|
|
5
|
-
"mappings": "AACA,OAAS,aAAAA,MAAiB,YAE1B,OAAS,uBAAAC,MAA2B,kCACpC,OAAS,eAAAC,MAAmB,0BAK5B,OAAS,iCAAAC,MAAqC,0EAC9C,OAAS,yBAAAC,MAA6B,uDACtC,OAAS,+BAAAC,MAAmC,oEAC5C,OAAS,+BAAAC,MAAmC,oEAC5C,OAAS,6BAAAC,MAAiC,gEAC1C,OAAS,oBAAAC,MAAwB,6CACjC,OAAS,sBAAAC,MAA0B,iDACnC,OAAS,qBAAAC,MAAyB,+CAClC,OAAS,sBAAsBC,MAAkC,iDACjE,OAAS,4BAAAC,MAAgC,8DACzC,OAAS,0BAAAC,MAA8B,0DACvC,OAAS,wBAAAC,MAA4B,qDACrC,OAAS,wBAAAC,MAA4B,+CACrC,OAAS,yBAAAC,MAA6B,yDACtC,OAAS,yCAAAC,MAA6C,kFACtD,OAAS,uCAAAC,MAA2C,gFACpD,OAAS,8BAAAC,MAAkC,gEAC3C,OAAS,4BAAAC,MAAgC,4DACzC,OAAS,gCAAAC,MAAoC,oEAC7C,OAAS,qBAAAC,MAAyB,6CAClC,OAAS,0BAAAC,MAA8B,wDACvC,OAAS,sBAAsBC,MAAgC,+CAC/D,OAAS,kCAAAC,MAAsC,yEAC/C,OAAS,0BAAAC,MAA8B,wDACvC,OAAS,kCAAAC,MAAsC,4DAC/C,OAAS,wBAAAC,MAA4B,uCACrC,OAAS,wBAAAC,MAA4B,2CAM9B,MAAMC,GAAgB,CAAC,CAAE,OAAAC,CAAO,IAAyB,CAC9D,MAAMC,EAAY,
|
|
6
|
-
"names": ["Container", "configModuleFactory", "configTypes", "accountOwnershipModuleFactory", "calldataModuleFactory", "dynamicNetworkModuleFactory", "externalPluginModuleFactory", "gatedSigningModuleFactory", "nftModuleFactory", "proxyModuleFactory", "safeModuleFactory", "ethereumTokenModuleFactory", "trustedNameModuleFactory", "typedDataModuleFactory", "uniswapModuleFactory", "nanoPkiModuleFactory", "reporterModuleFactory", "ethereumTransactionCheckModuleFactory", "solanaTransactionCheckModuleFactory", "altResolutionModuleFactory", "enumVariantModuleFactory", "instructionInfoModuleFactory", "lifiModuleFactory", "ownerInfoModuleFactory", "solanaTokenModuleFactory", "tokenAccountStateModuleFactory", "tokenInfoModuleFactory", "solanaTrustedNameModuleFactory", "ContextModuleChainID", "networkModuleFactory", "makeContainer", "config", "container", "chain", "exhaustiveCheck"]
|
|
4
|
+
"sourcesContent": ["import { type LoggerPublisherService } from \"@ledgerhq/device-management-kit\";\nimport { Container } from \"inversify\";\n\nimport { configModuleFactory } from \"@/config/di/configModuleFactory\";\nimport { configTypes } from \"@/config/di/configTypes\";\nimport {\n type ContextModuleLoaderConfig,\n type ContextModuleServiceConfig,\n} from \"@/config/model/ContextModuleConfig\";\nimport { accountOwnershipModuleFactory } from \"@/modules/concordium/account-ownership/di/accountOwnershipModuleFactory\";\nimport { calldataModuleFactory } from \"@/modules/ethereum/calldata/di/calldataModuleFactory\";\nimport { dynamicNetworkModuleFactory } from \"@/modules/ethereum/dynamic-network/di/dynamicNetworkModuleFactory\";\nimport { externalPluginModuleFactory } from \"@/modules/ethereum/external-plugin/di/externalPluginModuleFactory\";\nimport { gatedSigningModuleFactory } from \"@/modules/ethereum/gated-signing/di/gatedSigningModuleFactory\";\nimport { nftModuleFactory } from \"@/modules/ethereum/nft/di/nftModuleFactory\";\nimport { proxyModuleFactory } from \"@/modules/ethereum/proxy/di/proxyModuleFactory\";\nimport { safeModuleFactory } from \"@/modules/ethereum/safe/di/safeModuleFactory\";\nimport { tokenModuleFactory as ethereumTokenModuleFactory } from \"@/modules/ethereum/token/di/tokenModuleFactory\";\nimport { trustedNameModuleFactory } from \"@/modules/ethereum/trusted-name/di/trustedNameModuleFactory\";\nimport { typedDataModuleFactory } from \"@/modules/ethereum/typed-data/di/typedDataModuleFactory\";\nimport { uniswapModuleFactory } from \"@/modules/ethereum/uniswap/di/uniswapModuleFactory\";\nimport { nanoPkiModuleFactory } from \"@/modules/multichain/pki/di/pkiModuleFactory\";\nimport { reporterModuleFactory } from \"@/modules/multichain/reporter/di/reporterModuleFactory\";\nimport { signReporterModuleFactory } from \"@/modules/multichain/sign-reporter/di/signReporterModuleFactory\";\nimport { ethereumTransactionCheckModuleFactory } from \"@/modules/multichain/transaction-check/di/ethereumTransactionCheckModuleFactory\";\nimport { solanaTransactionCheckModuleFactory } from \"@/modules/multichain/transaction-check/di/solanaTransactionCheckModuleFactory\";\nimport { altResolutionModuleFactory } from \"@/modules/solana/alt-resolution/di/altResolutionModuleFactory\";\nimport { enumVariantModuleFactory } from \"@/modules/solana/enum-variant/di/enumVariantModuleFactory\";\nimport { instructionInfoModuleFactory } from \"@/modules/solana/instruction-info/di/instructionInfoModuleFactory\";\nimport { lifiModuleFactory } from \"@/modules/solana/lifi/di/lifiModuleFactory\";\nimport { ownerInfoModuleFactory } from \"@/modules/solana/owner-info/di/ownerInfoModuleFactory\";\nimport { tokenModuleFactory as solanaTokenModuleFactory } from \"@/modules/solana/token/di/tokenModuleFactory\";\nimport { tokenAccountStateModuleFactory } from \"@/modules/solana/token-account-state/di/tokenAccountStateModuleFactory\";\nimport { tokenInfoModuleFactory } from \"@/modules/solana/token-info/di/tokenInfoModuleFactory\";\nimport { solanaTrustedNameModuleFactory } from \"@/modules/solana/trusted-name/di/trustedNameModuleFactory\";\nimport { ContextModuleChainID } from \"@/shared/domain/ContextModuleChainID\";\nimport { networkModuleFactory } from \"@/shared/network/di/networkModuleFactory\";\n\ntype MakeContainerArgs = {\n config: ContextModuleServiceConfig & ContextModuleLoaderConfig;\n};\n\nexport const makeContainer = ({ config }: MakeContainerArgs) => {\n const container = new Container();\n\n container\n .bind<\n (tag: string) => LoggerPublisherService\n >(configTypes.ContextModuleLoggerFactory)\n .toConstantValue(config.loggerFactory);\n\n const { chain } = config;\n\n // infrastructure modules needed by all chains\n container.loadSync(configModuleFactory(config), networkModuleFactory(config));\n\n switch (chain) {\n case ContextModuleChainID.Ethereum:\n container.loadSync(\n nanoPkiModuleFactory(),\n reporterModuleFactory(),\n signReporterModuleFactory(),\n trustedNameModuleFactory(config.customTrustedNameDataSource),\n externalPluginModuleFactory(),\n dynamicNetworkModuleFactory(),\n nftModuleFactory(),\n proxyModuleFactory(config.datasource),\n safeModuleFactory(),\n gatedSigningModuleFactory(),\n ethereumTokenModuleFactory(),\n calldataModuleFactory(),\n typedDataModuleFactory(),\n uniswapModuleFactory(),\n ethereumTransactionCheckModuleFactory(),\n );\n break;\n case ContextModuleChainID.Solana:\n container.loadSync(\n nanoPkiModuleFactory(),\n signReporterModuleFactory(),\n ownerInfoModuleFactory(),\n solanaTokenModuleFactory(),\n lifiModuleFactory(),\n solanaTransactionCheckModuleFactory(),\n instructionInfoModuleFactory(),\n enumVariantModuleFactory(),\n tokenInfoModuleFactory(),\n tokenAccountStateModuleFactory(),\n altResolutionModuleFactory(),\n solanaTrustedNameModuleFactory(),\n );\n break;\n case ContextModuleChainID.Concordium:\n container.loadSync(\n nanoPkiModuleFactory(),\n accountOwnershipModuleFactory(),\n );\n break;\n default: {\n // ensure exhaustive check at compile time when new chains are added\n const exhaustiveCheck: never = chain;\n void exhaustiveCheck;\n }\n }\n\n return container;\n};\n"],
|
|
5
|
+
"mappings": "AACA,OAAS,aAAAA,MAAiB,YAE1B,OAAS,uBAAAC,MAA2B,kCACpC,OAAS,eAAAC,MAAmB,0BAK5B,OAAS,iCAAAC,MAAqC,0EAC9C,OAAS,yBAAAC,MAA6B,uDACtC,OAAS,+BAAAC,MAAmC,oEAC5C,OAAS,+BAAAC,MAAmC,oEAC5C,OAAS,6BAAAC,MAAiC,gEAC1C,OAAS,oBAAAC,MAAwB,6CACjC,OAAS,sBAAAC,MAA0B,iDACnC,OAAS,qBAAAC,MAAyB,+CAClC,OAAS,sBAAsBC,MAAkC,iDACjE,OAAS,4BAAAC,MAAgC,8DACzC,OAAS,0BAAAC,MAA8B,0DACvC,OAAS,wBAAAC,MAA4B,qDACrC,OAAS,wBAAAC,MAA4B,+CACrC,OAAS,yBAAAC,MAA6B,yDACtC,OAAS,6BAAAC,MAAiC,kEAC1C,OAAS,yCAAAC,MAA6C,kFACtD,OAAS,uCAAAC,MAA2C,gFACpD,OAAS,8BAAAC,MAAkC,gEAC3C,OAAS,4BAAAC,MAAgC,4DACzC,OAAS,gCAAAC,MAAoC,oEAC7C,OAAS,qBAAAC,MAAyB,6CAClC,OAAS,0BAAAC,MAA8B,wDACvC,OAAS,sBAAsBC,MAAgC,+CAC/D,OAAS,kCAAAC,MAAsC,yEAC/C,OAAS,0BAAAC,MAA8B,wDACvC,OAAS,kCAAAC,MAAsC,4DAC/C,OAAS,wBAAAC,MAA4B,uCACrC,OAAS,wBAAAC,MAA4B,2CAM9B,MAAMC,GAAgB,CAAC,CAAE,OAAAC,CAAO,IAAyB,CAC9D,MAAMC,EAAY,IAAIjC,EAEtBiC,EACG,KAEC/B,EAAY,0BAA0B,EACvC,gBAAgB8B,EAAO,aAAa,EAEvC,KAAM,CAAE,MAAAE,CAAM,EAAIF,EAKlB,OAFAC,EAAU,SAAShC,EAAoB+B,CAAM,EAAGF,EAAqBE,CAAM,CAAC,EAEpEE,EAAO,CACb,KAAKL,EAAqB,SACxBI,EAAU,SACRlB,EAAqB,EACrBC,EAAsB,EACtBC,EAA0B,EAC1BL,EAAyBoB,EAAO,2BAA2B,EAC3D1B,EAA4B,EAC5BD,EAA4B,EAC5BG,EAAiB,EACjBC,EAAmBuB,EAAO,UAAU,EACpCtB,EAAkB,EAClBH,EAA0B,EAC1BI,EAA2B,EAC3BP,EAAsB,EACtBS,EAAuB,EACvBC,EAAqB,EACrBI,EAAsC,CACxC,EACA,MACF,KAAKW,EAAqB,OACxBI,EAAU,SACRlB,EAAqB,EACrBE,EAA0B,EAC1BO,EAAuB,EACvBC,EAAyB,EACzBF,EAAkB,EAClBJ,EAAoC,EACpCG,EAA6B,EAC7BD,EAAyB,EACzBM,EAAuB,EACvBD,EAA+B,EAC/BN,EAA2B,EAC3BQ,EAA+B,CACjC,EACA,MACF,KAAKC,EAAqB,WACxBI,EAAU,SACRlB,EAAqB,EACrBZ,EAA8B,CAChC,EACA,MACF,QAAS,CAEP,MAAMgC,EAAyBD,CAEjC,CACF,CAEA,OAAOD,CACT",
|
|
6
|
+
"names": ["Container", "configModuleFactory", "configTypes", "accountOwnershipModuleFactory", "calldataModuleFactory", "dynamicNetworkModuleFactory", "externalPluginModuleFactory", "gatedSigningModuleFactory", "nftModuleFactory", "proxyModuleFactory", "safeModuleFactory", "ethereumTokenModuleFactory", "trustedNameModuleFactory", "typedDataModuleFactory", "uniswapModuleFactory", "nanoPkiModuleFactory", "reporterModuleFactory", "signReporterModuleFactory", "ethereumTransactionCheckModuleFactory", "solanaTransactionCheckModuleFactory", "altResolutionModuleFactory", "enumVariantModuleFactory", "instructionInfoModuleFactory", "lifiModuleFactory", "ownerInfoModuleFactory", "solanaTokenModuleFactory", "tokenAccountStateModuleFactory", "tokenInfoModuleFactory", "solanaTrustedNameModuleFactory", "ContextModuleChainID", "networkModuleFactory", "makeContainer", "config", "container", "chain", "exhaustiveCheck"]
|
|
7
7
|
}
|
package/lib/esm/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export*from"./ContextModule";export*from"./ContextModuleBuilder";export*from"./DefaultContextModule";export*from"./modules/concordium/account-ownership/data/AccountOwnershipDataSource";export*from"./modules/concordium/account-ownership/data/AccountOwnershipError";export*from"./modules/concordium/account-ownership/data/HttpAccountOwnershipDataSource";export*from"./modules/concordium/account-ownership/domain/AccountOwnershipContextLoader";export*from"./modules/ethereum/calldata/data/CalldataDescriptorDataSource";export*from"./modules/ethereum/calldata/data/HttpCalldataDescriptorDataSource";export*from"./modules/ethereum/calldata/domain/CalldataContextLoader";export*from"./modules/ethereum/dynamic-network/data/DynamicNetworkDataSource";export*from"./modules/ethereum/dynamic-network/data/HttpDynamicNetworkDataSource";export*from"./modules/ethereum/dynamic-network/domain/DynamicNetworkContextLoader";export*from"./modules/ethereum/dynamic-network/model/DynamicNetworkConfiguration";export*from"./modules/ethereum/external-plugin/data/ExternalPluginDataSource";export*from"./modules/ethereum/external-plugin/data/HttpExternalPluginDataSource";export*from"./modules/ethereum/external-plugin/domain/ExternalPluginContextLoader";export*from"./modules/ethereum/gated-signing/data/GatedDescriptorDataSource";export*from"./modules/ethereum/gated-signing/data/HttpGatedDescriptorDataSource";export*from"./modules/ethereum/gated-signing/domain/GatedSigningContextLoader";export*from"./modules/ethereum/gated-signing/domain/GatedSigningTypedDataContextLoader";export*from"./modules/ethereum/model/EthereumClearSignContext";export*from"./modules/ethereum/model/TypedDataClearSignContext";export*from"./modules/ethereum/model/TypedDataContext";export*from"./modules/ethereum/nft/data/HttpNftDataSource";export*from"./modules/ethereum/nft/data/NftDataSource";export*from"./modules/ethereum/nft/domain/NftContextFieldLoader";export*from"./modules/ethereum/nft/domain/NftContextLoader";export*from"./modules/ethereum/proxy/data/HttpProxyDataSource";export*from"./modules/ethereum/proxy/data/HttpSafeProxyDataSource";export*from"./modules/ethereum/proxy/data/ProxyDataSource";export*from"./modules/ethereum/proxy/domain/ProxyContextFieldLoader";export*from"./modules/ethereum/token/data/HttpTokenDataSource";export*from"./modules/ethereum/token/data/TokenDataSource";export*from"./modules/ethereum/token/domain/TokenContextFieldLoader";export*from"./modules/ethereum/token/domain/TokenContextLoader";export*from"./modules/ethereum/trusted-name/data/HttpTrustedNameDataSource";export*from"./modules/ethereum/trusted-name/data/TrustedNameDataSource";export*from"./modules/ethereum/trusted-name/domain/TrustedNameContextFieldLoader";export*from"./modules/ethereum/trusted-name/domain/TrustedNameContextLoader";export*from"./modules/ethereum/typed-data/data/HttpTypedDataDataSource";export*from"./modules/ethereum/typed-data/data/TypedDataDataSource";export*from"./modules/ethereum/typed-data/domain/DefaultTypedDataContextLoader";export*from"./modules/ethereum/typed-data/domain/TypedDataContextLoader";export*from"./modules/ethereum/typed-data/utils/getSchemaHash";export*from"./modules/ethereum/uniswap/data/AbiDecoderDataSource";export*from"./modules/ethereum/uniswap/data/CommandDecoderDataSource";export*from"./modules/ethereum/uniswap/data/DefaultCommandDecoderDataSource";export*from"./modules/ethereum/uniswap/data/EthersAbiDecoderDataSource";export*from"./modules/ethereum/uniswap/domain/UniswapContextLoader";export*from"./modules/multichain/pki/data/HttpPkiCertificateDataSource";export*from"./modules/multichain/pki/data/PkiCertificateDataSource";export*from"./modules/multichain/pki/domain/DefaultPkiCertificateLoader";export*from"./modules/multichain/pki/domain/PkiCertificateLoader";export*from"./modules/multichain/pki/model/KeyId";export*from"./modules/multichain/pki/model/KeyUsage";export*from"./modules/multichain/pki/model/PkiCertificate";export*from"./modules/multichain/pki/model/PkiCertificateInfo";export*from"./modules/multichain/reporter/data/BlindSigningReporterDatasource";export*from"./modules/multichain/reporter/data/HttpBlindSigningReporterDatasource";export*from"./modules/multichain/reporter/domain/BlindSigningReporter";export*from"./modules/multichain/reporter/domain/DefaultBlindSigningReporter";export*from"./modules/multichain/reporter/model/BlindSigningEvent";export*from"./modules/multichain/reporter/model/
|
|
1
|
+
export*from"./ContextModule";export*from"./ContextModuleBuilder";export*from"./DefaultContextModule";export*from"./modules/concordium/account-ownership/data/AccountOwnershipDataSource";export*from"./modules/concordium/account-ownership/data/AccountOwnershipError";export*from"./modules/concordium/account-ownership/data/HttpAccountOwnershipDataSource";export*from"./modules/concordium/account-ownership/domain/AccountOwnershipContextLoader";export*from"./modules/ethereum/calldata/data/CalldataDescriptorDataSource";export*from"./modules/ethereum/calldata/data/HttpCalldataDescriptorDataSource";export*from"./modules/ethereum/calldata/domain/CalldataContextLoader";export*from"./modules/ethereum/dynamic-network/data/DynamicNetworkDataSource";export*from"./modules/ethereum/dynamic-network/data/HttpDynamicNetworkDataSource";export*from"./modules/ethereum/dynamic-network/domain/DynamicNetworkContextLoader";export*from"./modules/ethereum/dynamic-network/model/DynamicNetworkConfiguration";export*from"./modules/ethereum/external-plugin/data/ExternalPluginDataSource";export*from"./modules/ethereum/external-plugin/data/HttpExternalPluginDataSource";export*from"./modules/ethereum/external-plugin/domain/ExternalPluginContextLoader";export*from"./modules/ethereum/gated-signing/data/GatedDescriptorDataSource";export*from"./modules/ethereum/gated-signing/data/HttpGatedDescriptorDataSource";export*from"./modules/ethereum/gated-signing/domain/GatedSigningContextLoader";export*from"./modules/ethereum/gated-signing/domain/GatedSigningTypedDataContextLoader";export*from"./modules/ethereum/model/EthereumClearSignContext";export*from"./modules/ethereum/model/TypedDataClearSignContext";export*from"./modules/ethereum/model/TypedDataContext";export*from"./modules/ethereum/nft/data/HttpNftDataSource";export*from"./modules/ethereum/nft/data/NftDataSource";export*from"./modules/ethereum/nft/domain/NftContextFieldLoader";export*from"./modules/ethereum/nft/domain/NftContextLoader";export*from"./modules/ethereum/proxy/data/HttpProxyDataSource";export*from"./modules/ethereum/proxy/data/HttpSafeProxyDataSource";export*from"./modules/ethereum/proxy/data/ProxyDataSource";export*from"./modules/ethereum/proxy/domain/ProxyContextFieldLoader";export*from"./modules/ethereum/token/data/HttpTokenDataSource";export*from"./modules/ethereum/token/data/TokenDataSource";export*from"./modules/ethereum/token/domain/TokenContextFieldLoader";export*from"./modules/ethereum/token/domain/TokenContextLoader";export*from"./modules/ethereum/trusted-name/data/HttpTrustedNameDataSource";export*from"./modules/ethereum/trusted-name/data/TrustedNameDataSource";export*from"./modules/ethereum/trusted-name/domain/TrustedNameContextFieldLoader";export*from"./modules/ethereum/trusted-name/domain/TrustedNameContextLoader";export*from"./modules/ethereum/typed-data/data/HttpTypedDataDataSource";export*from"./modules/ethereum/typed-data/data/TypedDataDataSource";export*from"./modules/ethereum/typed-data/domain/DefaultTypedDataContextLoader";export*from"./modules/ethereum/typed-data/domain/TypedDataContextLoader";export*from"./modules/ethereum/typed-data/utils/getSchemaHash";export*from"./modules/ethereum/uniswap/data/AbiDecoderDataSource";export*from"./modules/ethereum/uniswap/data/CommandDecoderDataSource";export*from"./modules/ethereum/uniswap/data/DefaultCommandDecoderDataSource";export*from"./modules/ethereum/uniswap/data/EthersAbiDecoderDataSource";export*from"./modules/ethereum/uniswap/domain/UniswapContextLoader";export*from"./modules/multichain/pki/data/HttpPkiCertificateDataSource";export*from"./modules/multichain/pki/data/PkiCertificateDataSource";export*from"./modules/multichain/pki/domain/DefaultPkiCertificateLoader";export*from"./modules/multichain/pki/domain/PkiCertificateLoader";export*from"./modules/multichain/pki/model/KeyId";export*from"./modules/multichain/pki/model/KeyUsage";export*from"./modules/multichain/pki/model/PkiCertificate";export*from"./modules/multichain/pki/model/PkiCertificateInfo";export*from"./modules/multichain/reporter/data/BlindSigningReporterDatasource";export*from"./modules/multichain/reporter/data/HttpBlindSigningReporterDatasource";export*from"./modules/multichain/reporter/domain/BlindSigningReporter";export*from"./modules/multichain/reporter/domain/DefaultBlindSigningReporter";export*from"./modules/multichain/reporter/model/BlindSigningEvent";export*from"./modules/multichain/sign-reporter/model/SignReportParams";export*from"./modules/multichain/transaction-check/utils/constants";export*from"./modules/solana/alt-resolution/data/AltResolutionDataSource";export*from"./modules/solana/alt-resolution/data/HttpAltResolutionDataSource";export*from"./modules/solana/alt-resolution/domain/AltResolutionContextLoader";export*from"./modules/solana/enum-variant/domain/EnumVariantContextLoader";export*from"./modules/solana/instruction-info/data/HttpInstructionInfoDataSource";export*from"./modules/solana/instruction-info/data/InstructionInfoDataSource";export*from"./modules/solana/instruction-info/domain/InstructionInfoContextLoader";export*from"./modules/solana/model/SolanaClearSignContext";export*from"./modules/solana/model/SolanaContextTypes";export*from"./modules/solana/model/SolanaTransactionScanChainId";export*from"./modules/solana/owner-info/data/HttpOwnerInfoDataSource";export*from"./modules/solana/owner-info/data/OwnerInfoDataSource";export*from"./modules/solana/owner-info/domain/OwnerInfoContextLoader";export*from"./modules/solana/owner-info/domain/solanaContextTypes";export*from"./modules/solana/token-account-state/data/HttpTokenAccountStateDataSource";export*from"./modules/solana/token-account-state/data/TokenAccountStateDataSource";export*from"./modules/solana/token-account-state/domain/TokenAccountStateContextLoader";export*from"./modules/solana/token-info/data/HttpTokenInfoDataSource";export*from"./modules/solana/token-info/data/TokenInfoDataSource";export*from"./modules/solana/token-info/domain/TokenInfoContextLoader";export*from"./modules/solana/trusted-name/data/HttpTrustedNameDataSource";export*from"./modules/solana/trusted-name/data/TrustedNameDataSource";export*from"./modules/solana/trusted-name/domain/TrustedNameContextLoader";export*from"./shared/domain/ContextFieldLoader";export*from"./shared/domain/ContextLoader";export*from"./shared/domain/ContextModuleChainID";export*from"./shared/model/BlindSigningModelId";export*from"./shared/model/ClearSignContext";export*from"./shared/model/GenericPath";export*from"./shared/model/TransactionSubset";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/lib/esm/src/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/index.ts"],
|
|
4
|
-
"sourcesContent": ["export type {\n ContextModuleCalBranch,\n ContextModuleCalConfig,\n ContextModuleCalMode,\n ContextModuleConfig,\n ContextModuleDatasourceConfig,\n ContextModuleMetadataServiceConfig,\n ContextModuleReporterConfig,\n ContextModuleWeb3ChecksConfig,\n} from \"./config/model/ContextModuleConfig\";\nexport * from \"./ContextModule\";\nexport * from \"./ContextModuleBuilder\";\nexport * from \"./DefaultContextModule\";\nexport * from \"./modules/concordium/account-ownership/data/AccountOwnershipDataSource\";\nexport * from \"./modules/concordium/account-ownership/data/AccountOwnershipError\";\nexport * from \"./modules/concordium/account-ownership/data/HttpAccountOwnershipDataSource\";\nexport * from \"./modules/concordium/account-ownership/domain/AccountOwnershipContextLoader\";\nexport * from \"./modules/ethereum/calldata/data/CalldataDescriptorDataSource\";\nexport * from \"./modules/ethereum/calldata/data/HttpCalldataDescriptorDataSource\";\nexport * from \"./modules/ethereum/calldata/domain/CalldataContextLoader\";\nexport * from \"./modules/ethereum/dynamic-network/data/DynamicNetworkDataSource\";\nexport * from \"./modules/ethereum/dynamic-network/data/HttpDynamicNetworkDataSource\";\nexport * from \"./modules/ethereum/dynamic-network/domain/DynamicNetworkContextLoader\";\nexport * from \"./modules/ethereum/dynamic-network/model/DynamicNetworkConfiguration\";\nexport * from \"./modules/ethereum/external-plugin/data/ExternalPluginDataSource\";\nexport * from \"./modules/ethereum/external-plugin/data/HttpExternalPluginDataSource\";\nexport * from \"./modules/ethereum/external-plugin/domain/ExternalPluginContextLoader\";\nexport * from \"./modules/ethereum/gated-signing/data/GatedDescriptorDataSource\";\nexport * from \"./modules/ethereum/gated-signing/data/HttpGatedDescriptorDataSource\";\nexport * from \"./modules/ethereum/gated-signing/domain/GatedSigningContextLoader\";\nexport * from \"./modules/ethereum/gated-signing/domain/GatedSigningTypedDataContextLoader\";\nexport * from \"./modules/ethereum/model/EthereumClearSignContext\";\nexport * from \"./modules/ethereum/model/TypedDataClearSignContext\";\nexport * from \"./modules/ethereum/model/TypedDataContext\";\nexport * from \"./modules/ethereum/nft/data/HttpNftDataSource\";\nexport * from \"./modules/ethereum/nft/data/NftDataSource\";\nexport * from \"./modules/ethereum/nft/domain/NftContextFieldLoader\";\nexport * from \"./modules/ethereum/nft/domain/NftContextLoader\";\nexport * from \"./modules/ethereum/proxy/data/HttpProxyDataSource\";\nexport * from \"./modules/ethereum/proxy/data/HttpSafeProxyDataSource\";\nexport * from \"./modules/ethereum/proxy/data/ProxyDataSource\";\nexport * from \"./modules/ethereum/proxy/domain/ProxyContextFieldLoader\";\nexport * from \"./modules/ethereum/token/data/HttpTokenDataSource\";\nexport * from \"./modules/ethereum/token/data/TokenDataSource\";\nexport * from \"./modules/ethereum/token/domain/TokenContextFieldLoader\";\nexport * from \"./modules/ethereum/token/domain/TokenContextLoader\";\nexport * from \"./modules/ethereum/trusted-name/data/HttpTrustedNameDataSource\";\nexport * from \"./modules/ethereum/trusted-name/data/TrustedNameDataSource\";\nexport * from \"./modules/ethereum/trusted-name/domain/TrustedNameContextFieldLoader\";\nexport * from \"./modules/ethereum/trusted-name/domain/TrustedNameContextLoader\";\nexport * from \"./modules/ethereum/typed-data/data/HttpTypedDataDataSource\";\nexport * from \"./modules/ethereum/typed-data/data/TypedDataDataSource\";\nexport * from \"./modules/ethereum/typed-data/domain/DefaultTypedDataContextLoader\";\nexport * from \"./modules/ethereum/typed-data/domain/TypedDataContextLoader\";\nexport * from \"./modules/ethereum/typed-data/utils/getSchemaHash\";\nexport * from \"./modules/ethereum/uniswap/data/AbiDecoderDataSource\";\nexport * from \"./modules/ethereum/uniswap/data/CommandDecoderDataSource\";\nexport * from \"./modules/ethereum/uniswap/data/DefaultCommandDecoderDataSource\";\nexport * from \"./modules/ethereum/uniswap/data/EthersAbiDecoderDataSource\";\nexport * from \"./modules/ethereum/uniswap/domain/UniswapContextLoader\";\nexport * from \"./modules/multichain/pki/data/HttpPkiCertificateDataSource\";\nexport * from \"./modules/multichain/pki/data/PkiCertificateDataSource\";\nexport * from \"./modules/multichain/pki/domain/DefaultPkiCertificateLoader\";\nexport * from \"./modules/multichain/pki/domain/PkiCertificateLoader\";\nexport * from \"./modules/multichain/pki/model/KeyId\";\nexport * from \"./modules/multichain/pki/model/KeyUsage\";\nexport * from \"./modules/multichain/pki/model/PkiCertificate\";\nexport * from \"./modules/multichain/pki/model/PkiCertificateInfo\";\nexport * from \"./modules/multichain/reporter/data/BlindSigningReporterDatasource\";\nexport * from \"./modules/multichain/reporter/data/HttpBlindSigningReporterDatasource\";\nexport * from \"./modules/multichain/reporter/domain/BlindSigningReporter\";\nexport * from \"./modules/multichain/reporter/domain/DefaultBlindSigningReporter\";\nexport * from \"./modules/multichain/reporter/model/BlindSigningEvent\";\nexport * from \"./modules/multichain/reporter/model/
|
|
5
|
-
"mappings": "AAUA,WAAc,kBACd,WAAc,yBACd,WAAc,yBACd,WAAc,yEACd,WAAc,oEACd,WAAc,6EACd,WAAc,8EACd,WAAc,gEACd,WAAc,oEACd,WAAc,2DACd,WAAc,mEACd,WAAc,uEACd,WAAc,wEACd,WAAc,uEACd,WAAc,mEACd,WAAc,uEACd,WAAc,wEACd,WAAc,kEACd,WAAc,sEACd,WAAc,oEACd,WAAc,6EACd,WAAc,oDACd,WAAc,qDACd,WAAc,4CACd,WAAc,gDACd,WAAc,4CACd,WAAc,sDACd,WAAc,iDACd,WAAc,oDACd,WAAc,wDACd,WAAc,gDACd,WAAc,0DACd,WAAc,oDACd,WAAc,gDACd,WAAc,0DACd,WAAc,qDACd,WAAc,iEACd,WAAc,6DACd,WAAc,uEACd,WAAc,kEACd,WAAc,6DACd,WAAc,yDACd,WAAc,qEACd,WAAc,8DACd,WAAc,oDACd,WAAc,uDACd,WAAc,2DACd,WAAc,kEACd,WAAc,6DACd,WAAc,yDACd,WAAc,6DACd,WAAc,yDACd,WAAc,8DACd,WAAc,uDACd,WAAc,uCACd,WAAc,0CACd,WAAc,gDACd,WAAc,oDACd,WAAc,oEACd,WAAc,wEACd,WAAc,4DACd,WAAc,mEACd,WAAc,wDACd,WAAc,
|
|
4
|
+
"sourcesContent": ["export type {\n ContextModuleCalBranch,\n ContextModuleCalConfig,\n ContextModuleCalMode,\n ContextModuleConfig,\n ContextModuleDatasourceConfig,\n ContextModuleMetadataServiceConfig,\n ContextModuleReporterConfig,\n ContextModuleWeb3ChecksConfig,\n} from \"./config/model/ContextModuleConfig\";\nexport * from \"./ContextModule\";\nexport * from \"./ContextModuleBuilder\";\nexport * from \"./DefaultContextModule\";\nexport * from \"./modules/concordium/account-ownership/data/AccountOwnershipDataSource\";\nexport * from \"./modules/concordium/account-ownership/data/AccountOwnershipError\";\nexport * from \"./modules/concordium/account-ownership/data/HttpAccountOwnershipDataSource\";\nexport * from \"./modules/concordium/account-ownership/domain/AccountOwnershipContextLoader\";\nexport * from \"./modules/ethereum/calldata/data/CalldataDescriptorDataSource\";\nexport * from \"./modules/ethereum/calldata/data/HttpCalldataDescriptorDataSource\";\nexport * from \"./modules/ethereum/calldata/domain/CalldataContextLoader\";\nexport * from \"./modules/ethereum/dynamic-network/data/DynamicNetworkDataSource\";\nexport * from \"./modules/ethereum/dynamic-network/data/HttpDynamicNetworkDataSource\";\nexport * from \"./modules/ethereum/dynamic-network/domain/DynamicNetworkContextLoader\";\nexport * from \"./modules/ethereum/dynamic-network/model/DynamicNetworkConfiguration\";\nexport * from \"./modules/ethereum/external-plugin/data/ExternalPluginDataSource\";\nexport * from \"./modules/ethereum/external-plugin/data/HttpExternalPluginDataSource\";\nexport * from \"./modules/ethereum/external-plugin/domain/ExternalPluginContextLoader\";\nexport * from \"./modules/ethereum/gated-signing/data/GatedDescriptorDataSource\";\nexport * from \"./modules/ethereum/gated-signing/data/HttpGatedDescriptorDataSource\";\nexport * from \"./modules/ethereum/gated-signing/domain/GatedSigningContextLoader\";\nexport * from \"./modules/ethereum/gated-signing/domain/GatedSigningTypedDataContextLoader\";\nexport * from \"./modules/ethereum/model/EthereumClearSignContext\";\nexport * from \"./modules/ethereum/model/TypedDataClearSignContext\";\nexport * from \"./modules/ethereum/model/TypedDataContext\";\nexport * from \"./modules/ethereum/nft/data/HttpNftDataSource\";\nexport * from \"./modules/ethereum/nft/data/NftDataSource\";\nexport * from \"./modules/ethereum/nft/domain/NftContextFieldLoader\";\nexport * from \"./modules/ethereum/nft/domain/NftContextLoader\";\nexport * from \"./modules/ethereum/proxy/data/HttpProxyDataSource\";\nexport * from \"./modules/ethereum/proxy/data/HttpSafeProxyDataSource\";\nexport * from \"./modules/ethereum/proxy/data/ProxyDataSource\";\nexport * from \"./modules/ethereum/proxy/domain/ProxyContextFieldLoader\";\nexport * from \"./modules/ethereum/token/data/HttpTokenDataSource\";\nexport * from \"./modules/ethereum/token/data/TokenDataSource\";\nexport * from \"./modules/ethereum/token/domain/TokenContextFieldLoader\";\nexport * from \"./modules/ethereum/token/domain/TokenContextLoader\";\nexport * from \"./modules/ethereum/trusted-name/data/HttpTrustedNameDataSource\";\nexport * from \"./modules/ethereum/trusted-name/data/TrustedNameDataSource\";\nexport * from \"./modules/ethereum/trusted-name/domain/TrustedNameContextFieldLoader\";\nexport * from \"./modules/ethereum/trusted-name/domain/TrustedNameContextLoader\";\nexport * from \"./modules/ethereum/typed-data/data/HttpTypedDataDataSource\";\nexport * from \"./modules/ethereum/typed-data/data/TypedDataDataSource\";\nexport * from \"./modules/ethereum/typed-data/domain/DefaultTypedDataContextLoader\";\nexport * from \"./modules/ethereum/typed-data/domain/TypedDataContextLoader\";\nexport * from \"./modules/ethereum/typed-data/utils/getSchemaHash\";\nexport * from \"./modules/ethereum/uniswap/data/AbiDecoderDataSource\";\nexport * from \"./modules/ethereum/uniswap/data/CommandDecoderDataSource\";\nexport * from \"./modules/ethereum/uniswap/data/DefaultCommandDecoderDataSource\";\nexport * from \"./modules/ethereum/uniswap/data/EthersAbiDecoderDataSource\";\nexport * from \"./modules/ethereum/uniswap/domain/UniswapContextLoader\";\nexport * from \"./modules/multichain/pki/data/HttpPkiCertificateDataSource\";\nexport * from \"./modules/multichain/pki/data/PkiCertificateDataSource\";\nexport * from \"./modules/multichain/pki/domain/DefaultPkiCertificateLoader\";\nexport * from \"./modules/multichain/pki/domain/PkiCertificateLoader\";\nexport * from \"./modules/multichain/pki/model/KeyId\";\nexport * from \"./modules/multichain/pki/model/KeyUsage\";\nexport * from \"./modules/multichain/pki/model/PkiCertificate\";\nexport * from \"./modules/multichain/pki/model/PkiCertificateInfo\";\nexport * from \"./modules/multichain/reporter/data/BlindSigningReporterDatasource\";\nexport * from \"./modules/multichain/reporter/data/HttpBlindSigningReporterDatasource\";\nexport * from \"./modules/multichain/reporter/domain/BlindSigningReporter\";\nexport * from \"./modules/multichain/reporter/domain/DefaultBlindSigningReporter\";\nexport * from \"./modules/multichain/reporter/model/BlindSigningEvent\";\nexport * from \"./modules/multichain/sign-reporter/model/SignReportParams\";\nexport * from \"./modules/multichain/transaction-check/utils/constants\";\nexport * from \"./modules/solana/alt-resolution/data/AltResolutionDataSource\";\nexport * from \"./modules/solana/alt-resolution/data/HttpAltResolutionDataSource\";\nexport * from \"./modules/solana/alt-resolution/domain/AltResolutionContextLoader\";\nexport * from \"./modules/solana/enum-variant/domain/EnumVariantContextLoader\";\nexport * from \"./modules/solana/instruction-info/data/HttpInstructionInfoDataSource\";\nexport * from \"./modules/solana/instruction-info/data/InstructionInfoDataSource\";\nexport * from \"./modules/solana/instruction-info/domain/InstructionInfoContextLoader\";\nexport * from \"./modules/solana/model/SolanaClearSignContext\";\nexport * from \"./modules/solana/model/SolanaContextTypes\";\nexport * from \"./modules/solana/model/SolanaTransactionScanChainId\";\nexport * from \"./modules/solana/owner-info/data/HttpOwnerInfoDataSource\";\nexport * from \"./modules/solana/owner-info/data/OwnerInfoDataSource\";\nexport * from \"./modules/solana/owner-info/domain/OwnerInfoContextLoader\";\nexport * from \"./modules/solana/owner-info/domain/solanaContextTypes\";\nexport * from \"./modules/solana/token-account-state/data/HttpTokenAccountStateDataSource\";\nexport * from \"./modules/solana/token-account-state/data/TokenAccountStateDataSource\";\nexport * from \"./modules/solana/token-account-state/domain/TokenAccountStateContextLoader\";\nexport * from \"./modules/solana/token-info/data/HttpTokenInfoDataSource\";\nexport * from \"./modules/solana/token-info/data/TokenInfoDataSource\";\nexport * from \"./modules/solana/token-info/domain/TokenInfoContextLoader\";\nexport * from \"./modules/solana/trusted-name/data/HttpTrustedNameDataSource\";\nexport * from \"./modules/solana/trusted-name/data/TrustedNameDataSource\";\nexport * from \"./modules/solana/trusted-name/domain/TrustedNameContextLoader\";\nexport * from \"./shared/domain/ContextFieldLoader\";\nexport * from \"./shared/domain/ContextLoader\";\nexport * from \"./shared/domain/ContextModuleChainID\";\nexport * from \"./shared/model/BlindSigningModelId\";\nexport * from \"./shared/model/ClearSignContext\";\nexport * from \"./shared/model/GenericPath\";\nexport * from \"./shared/model/TransactionSubset\";\n"],
|
|
5
|
+
"mappings": "AAUA,WAAc,kBACd,WAAc,yBACd,WAAc,yBACd,WAAc,yEACd,WAAc,oEACd,WAAc,6EACd,WAAc,8EACd,WAAc,gEACd,WAAc,oEACd,WAAc,2DACd,WAAc,mEACd,WAAc,uEACd,WAAc,wEACd,WAAc,uEACd,WAAc,mEACd,WAAc,uEACd,WAAc,wEACd,WAAc,kEACd,WAAc,sEACd,WAAc,oEACd,WAAc,6EACd,WAAc,oDACd,WAAc,qDACd,WAAc,4CACd,WAAc,gDACd,WAAc,4CACd,WAAc,sDACd,WAAc,iDACd,WAAc,oDACd,WAAc,wDACd,WAAc,gDACd,WAAc,0DACd,WAAc,oDACd,WAAc,gDACd,WAAc,0DACd,WAAc,qDACd,WAAc,iEACd,WAAc,6DACd,WAAc,uEACd,WAAc,kEACd,WAAc,6DACd,WAAc,yDACd,WAAc,qEACd,WAAc,8DACd,WAAc,oDACd,WAAc,uDACd,WAAc,2DACd,WAAc,kEACd,WAAc,6DACd,WAAc,yDACd,WAAc,6DACd,WAAc,yDACd,WAAc,8DACd,WAAc,uDACd,WAAc,uCACd,WAAc,0CACd,WAAc,gDACd,WAAc,oDACd,WAAc,oEACd,WAAc,wEACd,WAAc,4DACd,WAAc,mEACd,WAAc,wDACd,WAAc,4DACd,WAAc,yDACd,WAAc,+DACd,WAAc,mEACd,WAAc,oEACd,WAAc,gEACd,WAAc,uEACd,WAAc,mEACd,WAAc,wEACd,WAAc,gDACd,WAAc,4CACd,WAAc,sDACd,WAAc,2DACd,WAAc,uDACd,WAAc,4DACd,WAAc,wDACd,WAAc,4EACd,WAAc,wEACd,WAAc,6EACd,WAAc,2DACd,WAAc,uDACd,WAAc,4DACd,WAAc,+DACd,WAAc,2DACd,WAAc,gEACd,WAAc,qCACd,WAAc,gCACd,WAAc,uCACd,WAAc,qCACd,WAAc,kCACd,WAAc,6BACd,WAAc",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var c=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var l=(i,r,e,o)=>{for(var t=o>1?void 0:o?f(r,e):r,p=i.length-1,m;p>=0;p--)(m=i[p])&&(t=(o?m(r,e,t):m(t))||t);return o&&t&&c(r,e,t),t},s=(i,r)=>(e,o)=>r(e,o,i);import{inject as a,injectable as g}from"inversify";import{Left as d,Right as y}from"purify-ts";import{configTypes as h}from"../../../../config/di/configTypes";import{networkTypes as C}from"../../../../shared/network/di/networkTypes";import{networkClientFactory as u}from"../../../../shared/network/networkClientFactory";let n=class{constructor(r,e){this.config=r;this.http=e??u(r)}http;async report(r){try{await this.http.post(`${this.config.reporter.url}/blind-signing-events`,{...r,source:this.config.appSource},{responseType:"void"})}catch{return d(new Error("[ContextModule] HttpBlindSigningReporterDatasource: Failed to report blind signing event"))}return y(void 0)}};n=l([g(),s(0,a(h.Config)),s(1,a(C.NetworkClient))],n);export{n as HttpBlindSigningReporterDatasource};
|
|
1
|
+
var c=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var l=(i,r,e,o)=>{for(var t=o>1?void 0:o?f(r,e):r,p=i.length-1,m;p>=0;p--)(m=i[p])&&(t=(o?m(r,e,t):m(t))||t);return o&&t&&c(r,e,t),t},s=(i,r)=>(e,o)=>r(e,o,i);import{inject as a,injectable as g}from"inversify";import{Left as d,Right as y}from"purify-ts";import{configTypes as h}from"../../../../config/di/configTypes";import{networkTypes as C}from"../../../../shared/network/di/networkTypes";import{networkClientFactory as u}from"../../../../shared/network/networkClientFactory";let n=class{constructor(r,e){this.config=r;this.http=e??u(r)}http;async report(r){try{await this.http.post(`${this.config.reporter.url}/v1/blind-signing-events`,{...r,source:this.config.appSource},{responseType:"void"})}catch{return d(new Error("[ContextModule] HttpBlindSigningReporterDatasource: Failed to report blind signing event"))}return y(void 0)}};n=l([g(),s(0,a(h.Config)),s(1,a(C.NetworkClient))],n);export{n as HttpBlindSigningReporterDatasource};
|
|
2
2
|
//# sourceMappingURL=HttpBlindSigningReporterDatasource.js.map
|
package/lib/esm/src/modules/multichain/reporter/data/HttpBlindSigningReporterDatasource.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/modules/multichain/reporter/data/HttpBlindSigningReporterDatasource.ts"],
|
|
4
|
-
"sourcesContent": ["import { DmkNetworkClient } from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\nimport { type Either, Left, Right } from \"purify-ts\";\n\nimport { configTypes } from \"@/config/di/configTypes\";\nimport { type ContextModuleServiceConfig } from \"@/config/model/ContextModuleConfig\";\nimport { networkTypes } from \"@/shared/network/di/networkTypes\";\nimport { networkClientFactory } from \"@/shared/network/networkClientFactory\";\n\nimport {\n type BlindSigningReporterDatasource,\n type BlindSigningReportParams,\n} from \"./BlindSigningReporterDatasource\";\n\n@injectable()\nexport class HttpBlindSigningReporterDatasource\n implements BlindSigningReporterDatasource\n{\n private readonly http: DmkNetworkClient;\n\n constructor(\n @inject(configTypes.Config)\n private readonly config: ContextModuleServiceConfig,\n @inject(networkTypes.NetworkClient)\n networkClient?: DmkNetworkClient,\n ) {\n this.http = networkClient ?? networkClientFactory(config);\n }\n\n async report(params: BlindSigningReportParams): Promise<Either<Error, void>> {\n try {\n await this.http.post(\n `${this.config.reporter.url}/blind-signing-events`,\n { ...params, source: this.config.appSource },\n { responseType: \"void\" },\n );\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpBlindSigningReporterDatasource: Failed to report blind signing event\",\n ),\n );\n }\n\n return Right(undefined);\n }\n}\n"],
|
|
5
|
-
"mappings": "iOACA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YACnC,OAAsB,QAAAC,EAAM,SAAAC,MAAa,YAEzC,OAAS,eAAAC,MAAmB,0BAE5B,OAAS,gBAAAC,MAAoB,mCAC7B,OAAS,wBAAAC,MAA4B,wCAQ9B,IAAMC,EAAN,KAEP,CAGE,YAEmBC,EAEjBC,EACA,CAHiB,YAAAD,EAIjB,KAAK,KAAOC,GAAiBC,EAAqBF,CAAM,CAC1D,CATiB,KAWjB,MAAM,OAAOG,EAAgE,CAC3E,GAAI,CACF,MAAM,KAAK,KAAK,KACd,GAAG,KAAK,OAAO,SAAS,GAAG,
|
|
4
|
+
"sourcesContent": ["import { DmkNetworkClient } from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\nimport { type Either, Left, Right } from \"purify-ts\";\n\nimport { configTypes } from \"@/config/di/configTypes\";\nimport { type ContextModuleServiceConfig } from \"@/config/model/ContextModuleConfig\";\nimport { networkTypes } from \"@/shared/network/di/networkTypes\";\nimport { networkClientFactory } from \"@/shared/network/networkClientFactory\";\n\nimport {\n type BlindSigningReporterDatasource,\n type BlindSigningReportParams,\n} from \"./BlindSigningReporterDatasource\";\n\n@injectable()\nexport class HttpBlindSigningReporterDatasource\n implements BlindSigningReporterDatasource\n{\n private readonly http: DmkNetworkClient;\n\n constructor(\n @inject(configTypes.Config)\n private readonly config: ContextModuleServiceConfig,\n @inject(networkTypes.NetworkClient)\n networkClient?: DmkNetworkClient,\n ) {\n this.http = networkClient ?? networkClientFactory(config);\n }\n\n async report(params: BlindSigningReportParams): Promise<Either<Error, void>> {\n try {\n await this.http.post(\n `${this.config.reporter.url}/v1/blind-signing-events`,\n { ...params, source: this.config.appSource },\n { responseType: \"void\" },\n );\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpBlindSigningReporterDatasource: Failed to report blind signing event\",\n ),\n );\n }\n\n return Right(undefined);\n }\n}\n"],
|
|
5
|
+
"mappings": "iOACA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YACnC,OAAsB,QAAAC,EAAM,SAAAC,MAAa,YAEzC,OAAS,eAAAC,MAAmB,0BAE5B,OAAS,gBAAAC,MAAoB,mCAC7B,OAAS,wBAAAC,MAA4B,wCAQ9B,IAAMC,EAAN,KAEP,CAGE,YAEmBC,EAEjBC,EACA,CAHiB,YAAAD,EAIjB,KAAK,KAAOC,GAAiBC,EAAqBF,CAAM,CAC1D,CATiB,KAWjB,MAAM,OAAOG,EAAgE,CAC3E,GAAI,CACF,MAAM,KAAK,KAAK,KACd,GAAG,KAAK,OAAO,SAAS,GAAG,2BAC3B,CAAE,GAAGA,EAAQ,OAAQ,KAAK,OAAO,SAAU,EAC3C,CAAE,aAAc,MAAO,CACzB,CACF,MAAiB,CACf,OAAOC,EACL,IAAI,MACF,0FACF,CACF,CACF,CAEA,OAAOC,EAAM,MAAS,CACxB,CACF,EA/BaN,EAANO,EAAA,CADNC,EAAW,EAOPC,EAAA,EAAAC,EAAOC,EAAY,MAAM,GAEzBF,EAAA,EAAAC,EAAOE,EAAa,aAAa,IARzBZ",
|
|
6
6
|
"names": ["inject", "injectable", "Left", "Right", "configTypes", "networkTypes", "networkClientFactory", "HttpBlindSigningReporterDatasource", "config", "networkClient", "networkClientFactory", "params", "Left", "Right", "__decorateClass", "injectable", "__decorateParam", "inject", "configTypes", "networkTypes"]
|
|
7
7
|
}
|
package/lib/esm/src/modules/multichain/reporter/data/HttpBlindSigningReporterDatasource.test.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Left as i,Right as s}from"purify-ts";import{HttpBlindSigningReporterDatasource as p}from"../../../../modules/multichain/reporter/data/HttpBlindSigningReporterDatasource";import{BlindSigningMethod as a,BlindSigningPlatform as d,BlindSignReason as l,ClearSigningType as c}from"../../../../modules/multichain/reporter/model/BlindSigningEvent";import{BlindSigningModelId as g}from"../../../../
|
|
1
|
+
import{Left as i,Right as s}from"purify-ts";import{HttpBlindSigningReporterDatasource as p}from"../../../../modules/multichain/reporter/data/HttpBlindSigningReporterDatasource";import{BlindSigningMethod as a,BlindSigningPlatform as d,BlindSignReason as l,ClearSigningType as c}from"../../../../modules/multichain/reporter/model/BlindSigningEvent";import{BlindSigningModelId as g}from"../../../../shared/model/BlindSigningModelId";describe("HttpBlindSigningReporterDatasource",()=>{const o={reporter:{url:"https://reporter.test"},originToken:"originToken",appSource:"third-party"},n={signatureId:"a3f8Kb-1738850400000",signingMethod:a.ETH_SIGN_TRANSACTION,isBlindSign:!0,chainId:1,targetAddress:"0xdAC17F958D2ee523a2206206994597C13D831ec7",blindSignReason:l.NO_CLEAR_SIGNING_CONTEXT,modelId:g.NANO_X,signerAppVersion:"1.12.1",deviceVersion:"2.2.3",ethContext:{clearSigningType:c.EIP7730,partialContextErrors:0}};let e,r;beforeEach(()=>{vi.resetAllMocks(),e={post:vi.fn()},r=new p(o,e)}),describe("report",()=>{it("should return Right(undefined) on success",async()=>{e.post.mockResolvedValueOnce(void 0);const t=await r.report(n);expect(t).toEqual(s(void 0))}),it("should return Left(Error) when the request fails",async()=>{e.post.mockRejectedValueOnce(new Error("network error"));const t=await r.report(n);expect(t).toEqual(i(new Error("[ContextModule] HttpBlindSigningReporterDatasource: Failed to report blind signing event")))}),it("should call http.post with the correct URL, body and options",async()=>{e.post.mockResolvedValueOnce(void 0),await r.report(n),expect(e.post).toHaveBeenCalledWith(`${o.reporter.url}/v1/blind-signing-events`,{...n,source:o.appSource},{responseType:"void"})}),it("should forward optional DTO fields when provided",async()=>{e.post.mockResolvedValueOnce(void 0);const t={...n,platform:d.DESKTOP,appVersion:"2.80.0",platformOS:"macOS",platformVersion:"14.5",liveAppContext:"swap",sessionId:"session-123"};await r.report(t),expect(e.post).toHaveBeenCalledWith(`${o.reporter.url}/v1/blind-signing-events`,{...t,source:o.appSource},{responseType:"void"})})})});
|
|
2
2
|
//# sourceMappingURL=HttpBlindSigningReporterDatasource.test.js.map
|
package/lib/esm/src/modules/multichain/reporter/data/HttpBlindSigningReporterDatasource.test.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/modules/multichain/reporter/data/HttpBlindSigningReporterDatasource.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { type DmkNetworkClient } from \"@ledgerhq/device-management-kit\";\nimport { Left, Right } from \"purify-ts\";\n\nimport { type ContextModuleServiceConfig } from \"@/config/model/ContextModuleConfig\";\nimport { type BlindSigningReportParams } from \"@/modules/multichain/reporter/data/BlindSigningReporterDatasource\";\nimport { HttpBlindSigningReporterDatasource } from \"@/modules/multichain/reporter/data/HttpBlindSigningReporterDatasource\";\nimport {\n BlindSigningMethod,\n BlindSigningPlatform,\n BlindSignReason,\n ClearSigningType,\n} from \"@/modules/multichain/reporter/model/BlindSigningEvent\";\nimport { BlindSigningModelId } from \"@/
|
|
5
|
-
"mappings": "AACA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAI5B,OAAS,sCAAAC,MAA0C,wEACnD,OACE,sBAAAC,EACA,wBAAAC,EACA,mBAAAC,EACA,oBAAAC,MACK,wDACP,OAAS,uBAAAC,MAA2B,
|
|
4
|
+
"sourcesContent": ["import { type DmkNetworkClient } from \"@ledgerhq/device-management-kit\";\nimport { Left, Right } from \"purify-ts\";\n\nimport { type ContextModuleServiceConfig } from \"@/config/model/ContextModuleConfig\";\nimport { type BlindSigningReportParams } from \"@/modules/multichain/reporter/data/BlindSigningReporterDatasource\";\nimport { HttpBlindSigningReporterDatasource } from \"@/modules/multichain/reporter/data/HttpBlindSigningReporterDatasource\";\nimport {\n BlindSigningMethod,\n BlindSigningPlatform,\n BlindSignReason,\n ClearSigningType,\n} from \"@/modules/multichain/reporter/model/BlindSigningEvent\";\nimport { BlindSigningModelId } from \"@/shared/model/BlindSigningModelId\";\n\ndescribe(\"HttpBlindSigningReporterDatasource\", () => {\n const config = {\n reporter: {\n url: \"https://reporter.test\",\n },\n originToken: \"originToken\",\n appSource: \"third-party\",\n } as ContextModuleServiceConfig;\n\n const params: BlindSigningReportParams = {\n signatureId: \"a3f8Kb-1738850400000\",\n signingMethod: BlindSigningMethod.ETH_SIGN_TRANSACTION,\n isBlindSign: true,\n chainId: 1,\n targetAddress: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n blindSignReason: BlindSignReason.NO_CLEAR_SIGNING_CONTEXT,\n modelId: BlindSigningModelId.NANO_X,\n signerAppVersion: \"1.12.1\",\n deviceVersion: \"2.2.3\",\n ethContext: {\n clearSigningType: ClearSigningType.EIP7730,\n partialContextErrors: 0,\n },\n };\n\n let httpMock: { post: ReturnType<typeof vi.fn> };\n let dataSource: HttpBlindSigningReporterDatasource;\n\n beforeEach(() => {\n vi.resetAllMocks();\n httpMock = { post: vi.fn() };\n dataSource = new HttpBlindSigningReporterDatasource(\n config,\n httpMock as unknown as DmkNetworkClient,\n );\n });\n\n describe(\"report\", () => {\n it(\"should return Right(undefined) on success\", async () => {\n // GIVEN\n httpMock.post.mockResolvedValueOnce(undefined);\n\n // WHEN\n const result = await dataSource.report(params);\n\n // THEN\n expect(result).toEqual(Right(undefined));\n });\n\n it(\"should return Left(Error) when the request fails\", async () => {\n // GIVEN\n httpMock.post.mockRejectedValueOnce(new Error(\"network error\"));\n\n // WHEN\n const result = await dataSource.report(params);\n\n // THEN\n expect(result).toEqual(\n Left(\n new Error(\n \"[ContextModule] HttpBlindSigningReporterDatasource: Failed to report blind signing event\",\n ),\n ),\n );\n });\n\n it(\"should call http.post with the correct URL, body and options\", async () => {\n // GIVEN\n httpMock.post.mockResolvedValueOnce(undefined);\n\n // WHEN\n await dataSource.report(params);\n\n // THEN\n expect(httpMock.post).toHaveBeenCalledWith(\n `${config.reporter!.url}/v1/blind-signing-events`,\n { ...params, source: config.appSource },\n { responseType: \"void\" },\n );\n });\n\n it(\"should forward optional DTO fields when provided\", async () => {\n // GIVEN\n httpMock.post.mockResolvedValueOnce(undefined);\n const paramsWithOptionalFields: BlindSigningReportParams = {\n ...params,\n platform: BlindSigningPlatform.DESKTOP,\n appVersion: \"2.80.0\",\n platformOS: \"macOS\",\n platformVersion: \"14.5\",\n liveAppContext: \"swap\",\n sessionId: \"session-123\",\n };\n\n // WHEN\n await dataSource.report(paramsWithOptionalFields);\n\n // THEN\n expect(httpMock.post).toHaveBeenCalledWith(\n `${config.reporter!.url}/v1/blind-signing-events`,\n { ...paramsWithOptionalFields, source: config.appSource },\n { responseType: \"void\" },\n );\n });\n });\n});\n"],
|
|
5
|
+
"mappings": "AACA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAI5B,OAAS,sCAAAC,MAA0C,wEACnD,OACE,sBAAAC,EACA,wBAAAC,EACA,mBAAAC,EACA,oBAAAC,MACK,wDACP,OAAS,uBAAAC,MAA2B,qCAEpC,SAAS,qCAAsC,IAAM,CACnD,MAAMC,EAAS,CACb,SAAU,CACR,IAAK,uBACP,EACA,YAAa,cACb,UAAW,aACb,EAEMC,EAAmC,CACvC,YAAa,uBACb,cAAeN,EAAmB,qBAClC,YAAa,GACb,QAAS,EACT,cAAe,6CACf,gBAAiBE,EAAgB,yBACjC,QAASE,EAAoB,OAC7B,iBAAkB,SAClB,cAAe,QACf,WAAY,CACV,iBAAkBD,EAAiB,QACnC,qBAAsB,CACxB,CACF,EAEA,IAAII,EACAC,EAEJ,WAAW,IAAM,CACf,GAAG,cAAc,EACjBD,EAAW,CAAE,KAAM,GAAG,GAAG,CAAE,EAC3BC,EAAa,IAAIT,EACfM,EACAE,CACF,CACF,CAAC,EAED,SAAS,SAAU,IAAM,CACvB,GAAG,4CAA6C,SAAY,CAE1DA,EAAS,KAAK,sBAAsB,MAAS,EAG7C,MAAME,EAAS,MAAMD,EAAW,OAAOF,CAAM,EAG7C,OAAOG,CAAM,EAAE,QAAQX,EAAM,MAAS,CAAC,CACzC,CAAC,EAED,GAAG,mDAAoD,SAAY,CAEjES,EAAS,KAAK,sBAAsB,IAAI,MAAM,eAAe,CAAC,EAG9D,MAAME,EAAS,MAAMD,EAAW,OAAOF,CAAM,EAG7C,OAAOG,CAAM,EAAE,QACbZ,EACE,IAAI,MACF,0FACF,CACF,CACF,CACF,CAAC,EAED,GAAG,+DAAgE,SAAY,CAE7EU,EAAS,KAAK,sBAAsB,MAAS,EAG7C,MAAMC,EAAW,OAAOF,CAAM,EAG9B,OAAOC,EAAS,IAAI,EAAE,qBACpB,GAAGF,EAAO,SAAU,GAAG,2BACvB,CAAE,GAAGC,EAAQ,OAAQD,EAAO,SAAU,EACtC,CAAE,aAAc,MAAO,CACzB,CACF,CAAC,EAED,GAAG,mDAAoD,SAAY,CAEjEE,EAAS,KAAK,sBAAsB,MAAS,EAC7C,MAAMG,EAAqD,CACzD,GAAGJ,EACH,SAAUL,EAAqB,QAC/B,WAAY,SACZ,WAAY,QACZ,gBAAiB,OACjB,eAAgB,OAChB,UAAW,aACb,EAGA,MAAMO,EAAW,OAAOE,CAAwB,EAGhD,OAAOH,EAAS,IAAI,EAAE,qBACpB,GAAGF,EAAO,SAAU,GAAG,2BACvB,CAAE,GAAGK,EAA0B,OAAQL,EAAO,SAAU,EACxD,CAAE,aAAc,MAAO,CACzB,CACF,CAAC,CACH,CAAC,CACH,CAAC",
|
|
6
6
|
"names": ["Left", "Right", "HttpBlindSigningReporterDatasource", "BlindSigningMethod", "BlindSigningPlatform", "BlindSignReason", "ClearSigningType", "BlindSigningModelId", "config", "params", "httpMock", "dataSource", "result", "paramsWithOptionalFields"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Left as o,Right as i}from"purify-ts";import{BlindSigningMethod as s,BlindSignReason as l,ClearSigningType as c}from"../../../../modules/multichain/reporter/model/BlindSigningEvent";import{BlindSigningModelId as p}from"../../../../
|
|
1
|
+
import{Left as o,Right as i}from"purify-ts";import{BlindSigningMethod as s,BlindSignReason as l,ClearSigningType as c}from"../../../../modules/multichain/reporter/model/BlindSigningEvent";import{BlindSigningModelId as p}from"../../../../shared/model/BlindSigningModelId";import{DefaultBlindSigningReporter as a}from"./DefaultBlindSigningReporter";describe("DefaultBlindSigningReporter",()=>{const r={signatureId:"a3f8Kb-1738850400000",signingMethod:s.ETH_SIGN_TRANSACTION,isBlindSign:!0,chainId:1,targetAddress:"0xdAC17F958D2ee523a2206206994597C13D831ec7",blindSignReason:l.NO_CLEAR_SIGNING_CONTEXT,modelId:p.NANO_X,signerAppVersion:"1.12.1",deviceVersion:"2.2.3",ethContext:{clearSigningType:c.EIP7730,partialContextErrors:0}};it("should delegate to the datasource and return Right on success",async()=>{const e={report:vi.fn().mockResolvedValueOnce(i(void 0))},n=await new a(e).report(r);expect(e.report).toHaveBeenCalledWith(r),expect(n).toEqual(i(void 0))}),it("should delegate to the datasource and return Left on failure",async()=>{const e=new Error("report failed"),t={report:vi.fn().mockResolvedValueOnce(o(e))},d=await new a(t).report(r);expect(t.report).toHaveBeenCalledWith(r),expect(d).toEqual(o(e))})});
|
|
2
2
|
//# sourceMappingURL=DefaultBlindSigningReporter.test.js.map
|
package/lib/esm/src/modules/multichain/reporter/domain/DefaultBlindSigningReporter.test.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/modules/multichain/reporter/domain/DefaultBlindSigningReporter.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport { type BlindSigningReporterDatasource } from \"@/modules/multichain/reporter/data/BlindSigningReporterDatasource\";\nimport {\n BlindSigningMethod,\n BlindSignReason,\n ClearSigningType,\n} from \"@/modules/multichain/reporter/model/BlindSigningEvent\";\nimport { BlindSigningModelId } from \"@/
|
|
5
|
-
"mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAG5B,OACE,sBAAAC,EACA,mBAAAC,EACA,oBAAAC,MACK,wDACP,OAAS,uBAAAC,MAA2B,
|
|
4
|
+
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport { type BlindSigningReporterDatasource } from \"@/modules/multichain/reporter/data/BlindSigningReporterDatasource\";\nimport {\n BlindSigningMethod,\n BlindSignReason,\n ClearSigningType,\n} from \"@/modules/multichain/reporter/model/BlindSigningEvent\";\nimport { BlindSigningModelId } from \"@/shared/model/BlindSigningModelId\";\n\nimport { DefaultBlindSigningReporter } from \"./DefaultBlindSigningReporter\";\n\ndescribe(\"DefaultBlindSigningReporter\", () => {\n const params = {\n signatureId: \"a3f8Kb-1738850400000\",\n signingMethod: BlindSigningMethod.ETH_SIGN_TRANSACTION,\n isBlindSign: true,\n chainId: 1,\n targetAddress: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n blindSignReason: BlindSignReason.NO_CLEAR_SIGNING_CONTEXT,\n modelId: BlindSigningModelId.NANO_X,\n signerAppVersion: \"1.12.1\",\n deviceVersion: \"2.2.3\",\n ethContext: {\n clearSigningType: ClearSigningType.EIP7730,\n partialContextErrors: 0,\n },\n };\n\n it(\"should delegate to the datasource and return Right on success\", async () => {\n // GIVEN\n const dataSource: BlindSigningReporterDatasource = {\n report: vi.fn().mockResolvedValueOnce(Right(undefined)),\n };\n const reporter = new DefaultBlindSigningReporter(dataSource);\n\n // WHEN\n const result = await reporter.report(params);\n\n // THEN\n expect(dataSource.report).toHaveBeenCalledWith(params);\n expect(result).toEqual(Right(undefined));\n });\n\n it(\"should delegate to the datasource and return Left on failure\", async () => {\n // GIVEN\n const error = new Error(\"report failed\");\n const dataSource: BlindSigningReporterDatasource = {\n report: vi.fn().mockResolvedValueOnce(Left(error)),\n };\n const reporter = new DefaultBlindSigningReporter(dataSource);\n\n // WHEN\n const result = await reporter.report(params);\n\n // THEN\n expect(dataSource.report).toHaveBeenCalledWith(params);\n expect(result).toEqual(Left(error));\n });\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAG5B,OACE,sBAAAC,EACA,mBAAAC,EACA,oBAAAC,MACK,wDACP,OAAS,uBAAAC,MAA2B,qCAEpC,OAAS,+BAAAC,MAAmC,gCAE5C,SAAS,8BAA+B,IAAM,CAC5C,MAAMC,EAAS,CACb,YAAa,uBACb,cAAeL,EAAmB,qBAClC,YAAa,GACb,QAAS,EACT,cAAe,6CACf,gBAAiBC,EAAgB,yBACjC,QAASE,EAAoB,OAC7B,iBAAkB,SAClB,cAAe,QACf,WAAY,CACV,iBAAkBD,EAAiB,QACnC,qBAAsB,CACxB,CACF,EAEA,GAAG,gEAAiE,SAAY,CAE9E,MAAMI,EAA6C,CACjD,OAAQ,GAAG,GAAG,EAAE,sBAAsBP,EAAM,MAAS,CAAC,CACxD,EAIMQ,EAAS,MAHE,IAAIH,EAA4BE,CAAU,EAG7B,OAAOD,CAAM,EAG3C,OAAOC,EAAW,MAAM,EAAE,qBAAqBD,CAAM,EACrD,OAAOE,CAAM,EAAE,QAAQR,EAAM,MAAS,CAAC,CACzC,CAAC,EAED,GAAG,+DAAgE,SAAY,CAE7E,MAAMS,EAAQ,IAAI,MAAM,eAAe,EACjCF,EAA6C,CACjD,OAAQ,GAAG,GAAG,EAAE,sBAAsBR,EAAKU,CAAK,CAAC,CACnD,EAIMD,EAAS,MAHE,IAAIH,EAA4BE,CAAU,EAG7B,OAAOD,CAAM,EAG3C,OAAOC,EAAW,MAAM,EAAE,qBAAqBD,CAAM,EACrD,OAAOE,CAAM,EAAE,QAAQT,EAAKU,CAAK,CAAC,CACpC,CAAC,CACH,CAAC",
|
|
6
6
|
"names": ["Left", "Right", "BlindSigningMethod", "BlindSignReason", "ClearSigningType", "BlindSigningModelId", "DefaultBlindSigningReporter", "params", "dataSource", "result", "error"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e=Object.freeze({ETH_SIGN_TRANSACTION:"eth_signTransaction",ETH_SIGN_TYPED_DATA:"eth_signTypedData"}),n=Object.freeze({NO_CLEAR_SIGNING_CONTEXT:"no_clear_signing_context",DEVICE_REJECTED_CONTEXT:"device_rejected_context"}),
|
|
1
|
+
const e=Object.freeze({ETH_SIGN_TRANSACTION:"eth_signTransaction",ETH_SIGN_TYPED_DATA:"eth_signTypedData"}),n=Object.freeze({NO_CLEAR_SIGNING_CONTEXT:"no_clear_signing_context",DEVICE_REJECTED_CONTEXT:"device_rejected_context",UNRECOGNIZED_PROGRAM:"unrecognized_program"}),i=Object.freeze({BASIC:"basic",EIP7730:"eip7730"}),t=Object.freeze({DESKTOP:"desktop",MOBILE:"mobile"});export{n as BlindSignReason,e as BlindSigningMethod,t as BlindSigningPlatform,i as ClearSigningType};
|
|
2
2
|
//# sourceMappingURL=BlindSigningEvent.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/modules/multichain/reporter/model/BlindSigningEvent.ts"],
|
|
4
|
-
"sourcesContent": ["export const BlindSigningMethod = Object.freeze({\n ETH_SIGN_TRANSACTION: \"eth_signTransaction\",\n ETH_SIGN_TYPED_DATA: \"eth_signTypedData\",\n} as const);\nexport type BlindSigningMethod =\n (typeof BlindSigningMethod)[keyof typeof BlindSigningMethod];\n\nexport const BlindSignReason = Object.freeze({\n NO_CLEAR_SIGNING_CONTEXT: \"no_clear_signing_context\",\n DEVICE_REJECTED_CONTEXT: \"device_rejected_context\",\n} as const);\nexport type BlindSignReason =\n (typeof BlindSignReason)[keyof typeof BlindSignReason];\n\nexport const ClearSigningType = Object.freeze({\n BASIC: \"basic\",\n EIP7730: \"eip7730\",\n} as const);\nexport type ClearSigningType =\n (typeof ClearSigningType)[keyof typeof ClearSigningType];\n\nexport const BlindSigningPlatform = Object.freeze({\n DESKTOP: \"desktop\",\n MOBILE: \"mobile\",\n} as const);\nexport type BlindSigningPlatform =\n (typeof BlindSigningPlatform)[keyof typeof BlindSigningPlatform];\n"],
|
|
5
|
-
"mappings": "AAAO,MAAMA,EAAqB,OAAO,OAAO,CAC9C,qBAAsB,sBACtB,oBAAqB,mBACvB,CAAU,EAIGC,EAAkB,OAAO,OAAO,CAC3C,yBAA0B,2BAC1B,wBAAyB,
|
|
4
|
+
"sourcesContent": ["export const BlindSigningMethod = Object.freeze({\n ETH_SIGN_TRANSACTION: \"eth_signTransaction\",\n ETH_SIGN_TYPED_DATA: \"eth_signTypedData\",\n} as const);\nexport type BlindSigningMethod =\n (typeof BlindSigningMethod)[keyof typeof BlindSigningMethod];\n\nexport const BlindSignReason = Object.freeze({\n NO_CLEAR_SIGNING_CONTEXT: \"no_clear_signing_context\",\n DEVICE_REJECTED_CONTEXT: \"device_rejected_context\",\n UNRECOGNIZED_PROGRAM: \"unrecognized_program\",\n} as const);\nexport type BlindSignReason =\n (typeof BlindSignReason)[keyof typeof BlindSignReason];\n\nexport const ClearSigningType = Object.freeze({\n BASIC: \"basic\",\n EIP7730: \"eip7730\",\n} as const);\nexport type ClearSigningType =\n (typeof ClearSigningType)[keyof typeof ClearSigningType];\n\nexport const BlindSigningPlatform = Object.freeze({\n DESKTOP: \"desktop\",\n MOBILE: \"mobile\",\n} as const);\nexport type BlindSigningPlatform =\n (typeof BlindSigningPlatform)[keyof typeof BlindSigningPlatform];\n"],
|
|
5
|
+
"mappings": "AAAO,MAAMA,EAAqB,OAAO,OAAO,CAC9C,qBAAsB,sBACtB,oBAAqB,mBACvB,CAAU,EAIGC,EAAkB,OAAO,OAAO,CAC3C,yBAA0B,2BAC1B,wBAAyB,0BACzB,qBAAsB,sBACxB,CAAU,EAIGC,EAAmB,OAAO,OAAO,CAC5C,MAAO,QACP,QAAS,SACX,CAAU,EAIGC,EAAuB,OAAO,OAAO,CAChD,QAAS,UACT,OAAQ,QACV,CAAU",
|
|
6
6
|
"names": ["BlindSigningMethod", "BlindSignReason", "ClearSigningType", "BlindSigningPlatform"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var u=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var c=(o,e,n,t)=>{for(var i=t>1?void 0:t?f(e,n):e,d=o.length-1,l;d>=0;d--)(l=o[d])&&(i=(t?l(e,n,i):l(i))||i);return t&&i&&u(e,n,i),i},r=(o,e)=>(n,t)=>e(n,t,o);import{inject as s,injectable as h}from"inversify";import{Left as S,Right as a}from"purify-ts";import{configTypes as p}from"../../../../config/di/configTypes";import{networkTypes as v}from"../../../../shared/network/di/networkTypes";import{networkClientFactory as y}from"../../../../shared/network/networkClientFactory";let g=class{constructor(e,n,t){this.config=e;this.http=t??y(e),this.logger=n("HttpSignReporterDatasource")}http;logger;async report(e){try{const n=this.buildDto(e,this.config.appSource);this.logger.debug("[report] Posting signing event",{data:n}),await this.http.post(`${this.config.reporter.url}/v2/blind-signing-events`,n,{responseType:"void"})}catch{return S(new Error("[ContextModule] HttpSignReporterDatasource: Failed to report signing event"))}return a(void 0)}buildDto(e,n){const t={isBlindSign:e.isBlindSign,sessionId:e.sessionId??null,envData:{modelId:e.modelId,signerAppVersion:e.signerAppVersion,deviceVersion:e.deviceVersion,source:n,...e.platform!==void 0&&{platform:e.platform},...e.appVersion!==void 0&&{appVersion:e.appVersion},...e.platformOS!==void 0&&{platformOS:e.platformOS},...e.platformVersion!==void 0&&{platformVersion:e.platformVersion},...e.liveAppContext!==void 0&&{liveAppContext:e.liveAppContext}}};switch(e.chain){case"ETH":return{...t,chain:"ETH",chainData:{chain:"ETH",signatureId:e.signatureId,signingMethod:e.signingMethod,targetAddress:e.targetAddress,chainId:e.chainId,blindSignReason:e.blindSignReason,...e.selectorId!==void 0&&{selectorId:e.selectorId},...e.clearSigningType!==void 0&&{clearSigningType:e.clearSigningType},...e.partialContextErrors!==void 0&&{partialContextErrors:e.partialContextErrors}}};case"SOL":return{...t,chain:"SOL",chainData:{chain:"SOL",signatureId:e.signatureId,signingMethod:e.signingMethod,targetAddress:e.targetAddress,blindSignReason:e.blindSignReason,programIds:e.programIds,unrecognizedPrograms:e.unrecognizedPrograms,...e.transactionSignature!==void 0&&{transactionSignature:e.transactionSignature}}}}}};g=c([h(),r(0,s(p.Config)),r(1,s(p.ContextModuleLoggerFactory)),r(2,s(v.NetworkClient))],g);export{g as HttpSignReporterDatasource};
|
|
2
|
+
//# sourceMappingURL=HttpSignReporterDatasource.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/modules/multichain/sign-reporter/data/HttpSignReporterDatasource.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n type DmkNetworkClient,\n type LoggerPublisherService,\n} from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\nimport { type Either, Left, Right } from \"purify-ts\";\n\nimport { configTypes } from \"@/config/di/configTypes\";\nimport { type ContextModuleServiceConfig } from \"@/config/model/ContextModuleConfig\";\nimport { type SignReportParams } from \"@/modules/multichain/sign-reporter/model/SignReportParams\";\nimport { networkTypes } from \"@/shared/network/di/networkTypes\";\nimport { networkClientFactory } from \"@/shared/network/networkClientFactory\";\n\nimport { type SigningEventDto } from \"./dto/SigningEventDto\";\nimport { type SignReporterDatasource } from \"./SignReporterDatasource\";\n\n@injectable()\nexport class HttpSignReporterDatasource implements SignReporterDatasource {\n private readonly http: DmkNetworkClient;\n private readonly logger: LoggerPublisherService;\n\n constructor(\n @inject(configTypes.Config)\n private readonly config: ContextModuleServiceConfig,\n @inject(configTypes.ContextModuleLoggerFactory)\n loggerFactory: (tag: string) => LoggerPublisherService,\n @inject(networkTypes.NetworkClient)\n networkClient?: DmkNetworkClient,\n ) {\n this.http = networkClient ?? networkClientFactory(config);\n this.logger = loggerFactory(\"HttpSignReporterDatasource\");\n }\n\n async report(params: SignReportParams): Promise<Either<Error, void>> {\n try {\n const dto = this.buildDto(params, this.config.appSource);\n this.logger.debug(\"[report] Posting signing event\", { data: dto });\n await this.http.post(\n `${this.config.reporter.url}/v2/blind-signing-events`,\n dto,\n { responseType: \"void\" },\n );\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpSignReporterDatasource: Failed to report signing event\",\n ),\n );\n }\n\n return Right(undefined);\n }\n\n private buildDto(params: SignReportParams, source: string): SigningEventDto {\n const base = {\n isBlindSign: params.isBlindSign,\n sessionId: params.sessionId ?? null,\n envData: {\n modelId: params.modelId,\n signerAppVersion: params.signerAppVersion,\n deviceVersion: params.deviceVersion,\n source,\n ...(params.platform !== undefined && { platform: params.platform }),\n ...(params.appVersion !== undefined && {\n appVersion: params.appVersion,\n }),\n ...(params.platformOS !== undefined && {\n platformOS: params.platformOS,\n }),\n ...(params.platformVersion !== undefined && {\n platformVersion: params.platformVersion,\n }),\n ...(params.liveAppContext !== undefined && {\n liveAppContext: params.liveAppContext,\n }),\n },\n };\n\n switch (params.chain) {\n case \"ETH\":\n return {\n ...base,\n chain: \"ETH\",\n chainData: {\n chain: \"ETH\",\n signatureId: params.signatureId,\n signingMethod: params.signingMethod,\n targetAddress: params.targetAddress,\n chainId: params.chainId,\n blindSignReason: params.blindSignReason,\n ...(params.selectorId !== undefined && {\n selectorId: params.selectorId,\n }),\n ...(params.clearSigningType !== undefined && {\n clearSigningType: params.clearSigningType,\n }),\n ...(params.partialContextErrors !== undefined && {\n partialContextErrors: params.partialContextErrors,\n }),\n },\n };\n case \"SOL\":\n return {\n ...base,\n chain: \"SOL\",\n chainData: {\n chain: \"SOL\",\n signatureId: params.signatureId,\n signingMethod: params.signingMethod,\n targetAddress: params.targetAddress,\n blindSignReason: params.blindSignReason,\n programIds: params.programIds,\n unrecognizedPrograms: params.unrecognizedPrograms,\n ...(params.transactionSignature !== undefined && {\n transactionSignature: params.transactionSignature,\n }),\n },\n };\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "iOAIA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YACnC,OAAsB,QAAAC,EAAM,SAAAC,MAAa,YAEzC,OAAS,eAAAC,MAAmB,0BAG5B,OAAS,gBAAAC,MAAoB,mCAC7B,OAAS,wBAAAC,MAA4B,wCAM9B,IAAMC,EAAN,KAAmE,CAIxE,YAEmBC,EAEjBC,EAEAC,EACA,CALiB,YAAAF,EAMjB,KAAK,KAAOE,GAAiBC,EAAqBH,CAAM,EACxD,KAAK,OAASC,EAAc,4BAA4B,CAC1D,CAbiB,KACA,OAcjB,MAAM,OAAOG,EAAwD,CACnE,GAAI,CACF,MAAMC,EAAM,KAAK,SAASD,EAAQ,KAAK,OAAO,SAAS,EACvD,KAAK,OAAO,MAAM,iCAAkC,CAAE,KAAMC,CAAI,CAAC,EACjE,MAAM,KAAK,KAAK,KACd,GAAG,KAAK,OAAO,SAAS,GAAG,2BAC3BA,EACA,CAAE,aAAc,MAAO,CACzB,CACF,MAAiB,CACf,OAAOC,EACL,IAAI,MACF,4EACF,CACF,CACF,CAEA,OAAOC,EAAM,MAAS,CACxB,CAEQ,SAASH,EAA0BI,EAAiC,CAC1E,MAAMC,EAAO,CACX,YAAaL,EAAO,YACpB,UAAWA,EAAO,WAAa,KAC/B,QAAS,CACP,QAASA,EAAO,QAChB,iBAAkBA,EAAO,iBACzB,cAAeA,EAAO,cACtB,OAAAI,EACA,GAAIJ,EAAO,WAAa,QAAa,CAAE,SAAUA,EAAO,QAAS,EACjE,GAAIA,EAAO,aAAe,QAAa,CACrC,WAAYA,EAAO,UACrB,EACA,GAAIA,EAAO,aAAe,QAAa,CACrC,WAAYA,EAAO,UACrB,EACA,GAAIA,EAAO,kBAAoB,QAAa,CAC1C,gBAAiBA,EAAO,eAC1B,EACA,GAAIA,EAAO,iBAAmB,QAAa,CACzC,eAAgBA,EAAO,cACzB,CACF,CACF,EAEA,OAAQA,EAAO,MAAO,CACpB,IAAK,MACH,MAAO,CACL,GAAGK,EACH,MAAO,MACP,UAAW,CACT,MAAO,MACP,YAAaL,EAAO,YACpB,cAAeA,EAAO,cACtB,cAAeA,EAAO,cACtB,QAASA,EAAO,QAChB,gBAAiBA,EAAO,gBACxB,GAAIA,EAAO,aAAe,QAAa,CACrC,WAAYA,EAAO,UACrB,EACA,GAAIA,EAAO,mBAAqB,QAAa,CAC3C,iBAAkBA,EAAO,gBAC3B,EACA,GAAIA,EAAO,uBAAyB,QAAa,CAC/C,qBAAsBA,EAAO,oBAC/B,CACF,CACF,EACF,IAAK,MACH,MAAO,CACL,GAAGK,EACH,MAAO,MACP,UAAW,CACT,MAAO,MACP,YAAaL,EAAO,YACpB,cAAeA,EAAO,cACtB,cAAeA,EAAO,cACtB,gBAAiBA,EAAO,gBACxB,WAAYA,EAAO,WACnB,qBAAsBA,EAAO,qBAC7B,GAAIA,EAAO,uBAAyB,QAAa,CAC/C,qBAAsBA,EAAO,oBAC/B,CACF,CACF,CACJ,CACF,CACF,EAvGaL,EAANW,EAAA,CADNC,EAAW,EAMPC,EAAA,EAAAC,EAAOC,EAAY,MAAM,GAEzBF,EAAA,EAAAC,EAAOC,EAAY,0BAA0B,GAE7CF,EAAA,EAAAC,EAAOE,EAAa,aAAa,IATzBhB",
|
|
6
|
+
"names": ["inject", "injectable", "Left", "Right", "configTypes", "networkTypes", "networkClientFactory", "HttpSignReporterDatasource", "config", "loggerFactory", "networkClient", "networkClientFactory", "params", "dto", "Left", "Right", "source", "base", "__decorateClass", "injectable", "__decorateParam", "inject", "configTypes", "networkTypes"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Left as c,Right as l}from"purify-ts";import{BlindSignReason as p}from"../../../../modules/multichain/reporter/model/BlindSigningEvent";import{BlindSigningModelId as a}from"../../../../shared/model/BlindSigningModelId";import{HttpSignReporterDatasource as g}from"./HttpSignReporterDatasource";describe("HttpSignReporterDatasource",()=>{const s={reporter:{url:"https://reporter.test"},appSource:"third-party",originToken:"originToken"},d={modelId:a.NANO_X,signerAppVersion:"1.4.0",deviceVersion:"2.2.3"},t={...d,chain:"SOL",signatureId:"abc123-1738850400000",signingMethod:"sol_signTransaction",isBlindSign:!0,targetAddress:"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",blindSignReason:p.UNRECOGNIZED_PROGRAM,programIds:["JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4","TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"],unrecognizedPrograms:["JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"]},i={...d,chain:"ETH",signatureId:"def456-1738850400000",signingMethod:"eth_signTransaction",isBlindSign:!1,chainId:1,targetAddress:"0xdAC17F958D2ee523a2206206994597C13D831ec7",blindSignReason:null};let e,n;beforeEach(()=>{vi.resetAllMocks(),e={post:vi.fn()},n=new g(s,()=>({debug:vi.fn(),info:vi.fn(),warn:vi.fn(),error:vi.fn()}),e)}),describe("report",()=>{it("should return Right(undefined) on success",async()=>{e.post.mockResolvedValueOnce(void 0);const r=await n.report(t);expect(r).toEqual(l(void 0))}),it("should return Left(Error) when the request fails",async()=>{e.post.mockRejectedValueOnce(new Error("network error"));const r=await n.report(t);expect(r).toEqual(c(new Error("[ContextModule] HttpSignReporterDatasource: Failed to report signing event")))}),it("should call the v2 endpoint with the correct URL",async()=>{e.post.mockResolvedValueOnce(void 0),await n.report(t),expect(e.post).toHaveBeenCalledWith(`${s.reporter.url}/v2/blind-signing-events`,expect.anything(),{responseType:"void"})}),it("should build correct three-layer body for SOL params",async()=>{e.post.mockResolvedValueOnce(void 0),await n.report(t),expect(e.post).toHaveBeenCalledWith(expect.any(String),{chain:"SOL",isBlindSign:!0,sessionId:null,chainData:{chain:"SOL",signatureId:t.signatureId,signingMethod:"sol_signTransaction",targetAddress:t.targetAddress,blindSignReason:p.UNRECOGNIZED_PROGRAM,programIds:t.programIds,unrecognizedPrograms:t.unrecognizedPrograms},envData:{modelId:a.NANO_X,signerAppVersion:"1.4.0",deviceVersion:"2.2.3",source:"third-party"}},{responseType:"void"})}),it("should build correct three-layer body for ETH params",async()=>{e.post.mockResolvedValueOnce(void 0),await n.report(i),expect(e.post).toHaveBeenCalledWith(expect.any(String),{chain:"ETH",isBlindSign:!1,sessionId:null,chainData:{chain:"ETH",signatureId:i.signatureId,signingMethod:"eth_signTransaction",targetAddress:i.targetAddress,chainId:1,blindSignReason:null},envData:{modelId:a.NANO_X,signerAppVersion:"1.4.0",deviceVersion:"2.2.3",source:"third-party"}},{responseType:"void"})}),it("should include optional env fields when provided",async()=>{e.post.mockResolvedValueOnce(void 0);const r={...t,platform:"desktop",appVersion:"2.80.0",platformOS:"macOS",platformVersion:"14.5",liveAppContext:"swap",sessionId:"session-abc"};await n.report(r);const o=e.post.mock.calls[0][1];expect(o.envData.platform).toBe("desktop"),expect(o.envData.appVersion).toBe("2.80.0"),expect(o.envData.platformOS).toBe("macOS"),expect(o.envData.platformVersion).toBe("14.5"),expect(o.envData.liveAppContext).toBe("swap"),expect(o.sessionId).toBe("session-abc")}),it("should include transactionSignature in SOL chainData when provided",async()=>{e.post.mockResolvedValueOnce(void 0);const r={...t,transactionSignature:"5yJ9..."};await n.report(r);const o=e.post.mock.calls[0][1];expect(o.chainData.transactionSignature).toBe("5yJ9...")})})});
|
|
2
|
+
//# sourceMappingURL=HttpSignReporterDatasource.test.js.map
|
package/lib/esm/src/modules/multichain/sign-reporter/data/HttpSignReporterDatasource.test.js.map
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/modules/multichain/sign-reporter/data/HttpSignReporterDatasource.test.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n type DmkNetworkClient,\n type LoggerPublisherService,\n} from \"@ledgerhq/device-management-kit\";\nimport { Left, Right } from \"purify-ts\";\n\nimport { type ContextModuleServiceConfig } from \"@/config/model/ContextModuleConfig\";\nimport { BlindSignReason } from \"@/modules/multichain/reporter/model/BlindSigningEvent\";\nimport {\n type EthSignReportParams,\n type SolSignReportParams,\n} from \"@/modules/multichain/sign-reporter/model/SignReportParams\";\nimport { BlindSigningModelId } from \"@/shared/model/BlindSigningModelId\";\n\nimport { HttpSignReporterDatasource } from \"./HttpSignReporterDatasource\";\n\ndescribe(\"HttpSignReporterDatasource\", () => {\n const config = {\n reporter: { url: \"https://reporter.test\" },\n appSource: \"third-party\",\n originToken: \"originToken\",\n } as ContextModuleServiceConfig;\n\n const envFields = {\n modelId: BlindSigningModelId.NANO_X,\n signerAppVersion: \"1.4.0\",\n deviceVersion: \"2.2.3\",\n };\n\n const solParams: SolSignReportParams = {\n ...envFields,\n chain: \"SOL\",\n signatureId: \"abc123-1738850400000\",\n signingMethod: \"sol_signTransaction\",\n isBlindSign: true,\n targetAddress: \"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4\",\n blindSignReason: BlindSignReason.UNRECOGNIZED_PROGRAM,\n programIds: [\n \"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4\",\n \"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA\",\n ],\n unrecognizedPrograms: [\"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4\"],\n };\n\n const ethParams: EthSignReportParams = {\n ...envFields,\n chain: \"ETH\",\n signatureId: \"def456-1738850400000\",\n signingMethod: \"eth_signTransaction\",\n isBlindSign: false,\n chainId: 1,\n targetAddress: \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n blindSignReason: null,\n };\n\n let httpMock: { post: ReturnType<typeof vi.fn> };\n let dataSource: HttpSignReporterDatasource;\n\n beforeEach(() => {\n vi.resetAllMocks();\n httpMock = { post: vi.fn() };\n dataSource = new HttpSignReporterDatasource(\n config,\n () =>\n ({\n debug: vi.fn(),\n info: vi.fn(),\n warn: vi.fn(),\n error: vi.fn(),\n }) as unknown as LoggerPublisherService,\n httpMock as unknown as DmkNetworkClient,\n );\n });\n\n describe(\"report\", () => {\n it(\"should return Right(undefined) on success\", async () => {\n // GIVEN\n httpMock.post.mockResolvedValueOnce(undefined);\n\n // WHEN\n const result = await dataSource.report(solParams);\n\n // THEN\n expect(result).toEqual(Right(undefined));\n });\n\n it(\"should return Left(Error) when the request fails\", async () => {\n // GIVEN\n httpMock.post.mockRejectedValueOnce(new Error(\"network error\"));\n\n // WHEN\n const result = await dataSource.report(solParams);\n\n // THEN\n expect(result).toEqual(\n Left(\n new Error(\n \"[ContextModule] HttpSignReporterDatasource: Failed to report signing event\",\n ),\n ),\n );\n });\n\n it(\"should call the v2 endpoint with the correct URL\", async () => {\n // GIVEN\n httpMock.post.mockResolvedValueOnce(undefined);\n\n // WHEN\n await dataSource.report(solParams);\n\n // THEN\n expect(httpMock.post).toHaveBeenCalledWith(\n `${config.reporter.url}/v2/blind-signing-events`,\n expect.anything(),\n { responseType: \"void\" },\n );\n });\n\n it(\"should build correct three-layer body for SOL params\", async () => {\n // GIVEN\n httpMock.post.mockResolvedValueOnce(undefined);\n\n // WHEN\n await dataSource.report(solParams);\n\n // THEN\n expect(httpMock.post).toHaveBeenCalledWith(\n expect.any(String),\n {\n chain: \"SOL\",\n isBlindSign: true,\n sessionId: null,\n chainData: {\n chain: \"SOL\",\n signatureId: solParams.signatureId,\n signingMethod: \"sol_signTransaction\",\n targetAddress: solParams.targetAddress,\n blindSignReason: BlindSignReason.UNRECOGNIZED_PROGRAM,\n programIds: solParams.programIds,\n unrecognizedPrograms: solParams.unrecognizedPrograms,\n },\n envData: {\n modelId: BlindSigningModelId.NANO_X,\n signerAppVersion: \"1.4.0\",\n deviceVersion: \"2.2.3\",\n source: \"third-party\",\n },\n },\n { responseType: \"void\" },\n );\n });\n\n it(\"should build correct three-layer body for ETH params\", async () => {\n // GIVEN\n httpMock.post.mockResolvedValueOnce(undefined);\n\n // WHEN\n await dataSource.report(ethParams);\n\n // THEN\n expect(httpMock.post).toHaveBeenCalledWith(\n expect.any(String),\n {\n chain: \"ETH\",\n isBlindSign: false,\n sessionId: null,\n chainData: {\n chain: \"ETH\",\n signatureId: ethParams.signatureId,\n signingMethod: \"eth_signTransaction\",\n targetAddress: ethParams.targetAddress,\n chainId: 1,\n blindSignReason: null,\n },\n envData: {\n modelId: BlindSigningModelId.NANO_X,\n signerAppVersion: \"1.4.0\",\n deviceVersion: \"2.2.3\",\n source: \"third-party\",\n },\n },\n { responseType: \"void\" },\n );\n });\n\n it(\"should include optional env fields when provided\", async () => {\n // GIVEN\n httpMock.post.mockResolvedValueOnce(undefined);\n const paramsWithOptional: SolSignReportParams = {\n ...solParams,\n platform: \"desktop\",\n appVersion: \"2.80.0\",\n platformOS: \"macOS\",\n platformVersion: \"14.5\",\n liveAppContext: \"swap\",\n sessionId: \"session-abc\",\n };\n\n // WHEN\n await dataSource.report(paramsWithOptional);\n\n // THEN\n const body = httpMock.post.mock.calls[0]![1];\n expect(body.envData.platform).toBe(\"desktop\");\n expect(body.envData.appVersion).toBe(\"2.80.0\");\n expect(body.envData.platformOS).toBe(\"macOS\");\n expect(body.envData.platformVersion).toBe(\"14.5\");\n expect(body.envData.liveAppContext).toBe(\"swap\");\n expect(body.sessionId).toBe(\"session-abc\");\n });\n\n it(\"should include transactionSignature in SOL chainData when provided\", async () => {\n // GIVEN\n httpMock.post.mockResolvedValueOnce(undefined);\n const paramsWithSig: SolSignReportParams = {\n ...solParams,\n transactionSignature: \"5yJ9...\",\n };\n\n // WHEN\n await dataSource.report(paramsWithSig);\n\n // THEN\n const body = httpMock.post.mock.calls[0]![1];\n expect(body.chainData.transactionSignature).toBe(\"5yJ9...\");\n });\n });\n});\n"],
|
|
5
|
+
"mappings": "AAIA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAG5B,OAAS,mBAAAC,MAAuB,wDAKhC,OAAS,uBAAAC,MAA2B,qCAEpC,OAAS,8BAAAC,MAAkC,+BAE3C,SAAS,6BAA8B,IAAM,CAC3C,MAAMC,EAAS,CACb,SAAU,CAAE,IAAK,uBAAwB,EACzC,UAAW,cACX,YAAa,aACf,EAEMC,EAAY,CAChB,QAASH,EAAoB,OAC7B,iBAAkB,QAClB,cAAe,OACjB,EAEMI,EAAiC,CACrC,GAAGD,EACH,MAAO,MACP,YAAa,uBACb,cAAe,sBACf,YAAa,GACb,cAAe,8CACf,gBAAiBJ,EAAgB,qBACjC,WAAY,CACV,8CACA,6CACF,EACA,qBAAsB,CAAC,6CAA6C,CACtE,EAEMM,EAAiC,CACrC,GAAGF,EACH,MAAO,MACP,YAAa,uBACb,cAAe,sBACf,YAAa,GACb,QAAS,EACT,cAAe,6CACf,gBAAiB,IACnB,EAEA,IAAIG,EACAC,EAEJ,WAAW,IAAM,CACf,GAAG,cAAc,EACjBD,EAAW,CAAE,KAAM,GAAG,GAAG,CAAE,EAC3BC,EAAa,IAAIN,EACfC,EACA,KACG,CACC,MAAO,GAAG,GAAG,EACb,KAAM,GAAG,GAAG,EACZ,KAAM,GAAG,GAAG,EACZ,MAAO,GAAG,GAAG,CACf,GACFI,CACF,CACF,CAAC,EAED,SAAS,SAAU,IAAM,CACvB,GAAG,4CAA6C,SAAY,CAE1DA,EAAS,KAAK,sBAAsB,MAAS,EAG7C,MAAME,EAAS,MAAMD,EAAW,OAAOH,CAAS,EAGhD,OAAOI,CAAM,EAAE,QAAQV,EAAM,MAAS,CAAC,CACzC,CAAC,EAED,GAAG,mDAAoD,SAAY,CAEjEQ,EAAS,KAAK,sBAAsB,IAAI,MAAM,eAAe,CAAC,EAG9D,MAAME,EAAS,MAAMD,EAAW,OAAOH,CAAS,EAGhD,OAAOI,CAAM,EAAE,QACbX,EACE,IAAI,MACF,4EACF,CACF,CACF,CACF,CAAC,EAED,GAAG,mDAAoD,SAAY,CAEjES,EAAS,KAAK,sBAAsB,MAAS,EAG7C,MAAMC,EAAW,OAAOH,CAAS,EAGjC,OAAOE,EAAS,IAAI,EAAE,qBACpB,GAAGJ,EAAO,SAAS,GAAG,2BACtB,OAAO,SAAS,EAChB,CAAE,aAAc,MAAO,CACzB,CACF,CAAC,EAED,GAAG,uDAAwD,SAAY,CAErEI,EAAS,KAAK,sBAAsB,MAAS,EAG7C,MAAMC,EAAW,OAAOH,CAAS,EAGjC,OAAOE,EAAS,IAAI,EAAE,qBACpB,OAAO,IAAI,MAAM,EACjB,CACE,MAAO,MACP,YAAa,GACb,UAAW,KACX,UAAW,CACT,MAAO,MACP,YAAaF,EAAU,YACvB,cAAe,sBACf,cAAeA,EAAU,cACzB,gBAAiBL,EAAgB,qBACjC,WAAYK,EAAU,WACtB,qBAAsBA,EAAU,oBAClC,EACA,QAAS,CACP,QAASJ,EAAoB,OAC7B,iBAAkB,QAClB,cAAe,QACf,OAAQ,aACV,CACF,EACA,CAAE,aAAc,MAAO,CACzB,CACF,CAAC,EAED,GAAG,uDAAwD,SAAY,CAErEM,EAAS,KAAK,sBAAsB,MAAS,EAG7C,MAAMC,EAAW,OAAOF,CAAS,EAGjC,OAAOC,EAAS,IAAI,EAAE,qBACpB,OAAO,IAAI,MAAM,EACjB,CACE,MAAO,MACP,YAAa,GACb,UAAW,KACX,UAAW,CACT,MAAO,MACP,YAAaD,EAAU,YACvB,cAAe,sBACf,cAAeA,EAAU,cACzB,QAAS,EACT,gBAAiB,IACnB,EACA,QAAS,CACP,QAASL,EAAoB,OAC7B,iBAAkB,QAClB,cAAe,QACf,OAAQ,aACV,CACF,EACA,CAAE,aAAc,MAAO,CACzB,CACF,CAAC,EAED,GAAG,mDAAoD,SAAY,CAEjEM,EAAS,KAAK,sBAAsB,MAAS,EAC7C,MAAMG,EAA0C,CAC9C,GAAGL,EACH,SAAU,UACV,WAAY,SACZ,WAAY,QACZ,gBAAiB,OACjB,eAAgB,OAChB,UAAW,aACb,EAGA,MAAMG,EAAW,OAAOE,CAAkB,EAG1C,MAAMC,EAAOJ,EAAS,KAAK,KAAK,MAAM,CAAC,EAAG,CAAC,EAC3C,OAAOI,EAAK,QAAQ,QAAQ,EAAE,KAAK,SAAS,EAC5C,OAAOA,EAAK,QAAQ,UAAU,EAAE,KAAK,QAAQ,EAC7C,OAAOA,EAAK,QAAQ,UAAU,EAAE,KAAK,OAAO,EAC5C,OAAOA,EAAK,QAAQ,eAAe,EAAE,KAAK,MAAM,EAChD,OAAOA,EAAK,QAAQ,cAAc,EAAE,KAAK,MAAM,EAC/C,OAAOA,EAAK,SAAS,EAAE,KAAK,aAAa,CAC3C,CAAC,EAED,GAAG,qEAAsE,SAAY,CAEnFJ,EAAS,KAAK,sBAAsB,MAAS,EAC7C,MAAMK,EAAqC,CACzC,GAAGP,EACH,qBAAsB,SACxB,EAGA,MAAMG,EAAW,OAAOI,CAAa,EAGrC,MAAMD,EAAOJ,EAAS,KAAK,KAAK,MAAM,CAAC,EAAG,CAAC,EAC3C,OAAOI,EAAK,UAAU,oBAAoB,EAAE,KAAK,SAAS,CAC5D,CAAC,CACH,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["Left", "Right", "BlindSignReason", "BlindSigningModelId", "HttpSignReporterDatasource", "config", "envFields", "solParams", "ethParams", "httpMock", "dataSource", "result", "paramsWithOptional", "body", "paramsWithSig"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=SignReporterDatasource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=SigningEventDto.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ContainerModule as e}from"inversify";import{HttpSignReporterDatasource as t}from"../../../../modules/multichain/sign-reporter/data/HttpSignReporterDatasource";import{signReporterTypes as o}from"../../../../modules/multichain/sign-reporter/di/signReporterTypes";import{DefaultSignReporter as p}from"../../../../modules/multichain/sign-reporter/domain/DefaultSignReporter";const g=()=>new e(({bind:r})=>{r(o.SignReporterDatasource).to(t),r(o.SignReporter).to(p)});export{g as signReporterModuleFactory};
|
|
2
|
+
//# sourceMappingURL=signReporterModuleFactory.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/modules/multichain/sign-reporter/di/signReporterModuleFactory.ts"],
|
|
4
|
+
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpSignReporterDatasource } from \"@/modules/multichain/sign-reporter/data/HttpSignReporterDatasource\";\nimport { signReporterTypes } from \"@/modules/multichain/sign-reporter/di/signReporterTypes\";\nimport { DefaultSignReporter } from \"@/modules/multichain/sign-reporter/domain/DefaultSignReporter\";\n\nexport const signReporterModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(signReporterTypes.SignReporterDatasource).to(\n HttpSignReporterDatasource,\n );\n bind(signReporterTypes.SignReporter).to(DefaultSignReporter);\n });\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,8BAAAC,MAAkC,qEAC3C,OAAS,qBAAAC,MAAyB,0DAClC,OAAS,uBAAAC,MAA2B,gEAE7B,MAAMC,EAA4B,IACvC,IAAIJ,EAAgB,CAAC,CAAE,KAAAK,CAAK,IAAM,CAChCA,EAAKH,EAAkB,sBAAsB,EAAE,GAC7CD,CACF,EACAI,EAAKH,EAAkB,YAAY,EAAE,GAAGC,CAAmB,CAC7D,CAAC",
|
|
6
|
+
"names": ["ContainerModule", "HttpSignReporterDatasource", "signReporterTypes", "DefaultSignReporter", "signReporterModuleFactory", "bind"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/modules/multichain/sign-reporter/di/signReporterTypes.ts"],
|
|
4
|
+
"sourcesContent": ["export const signReporterTypes = {\n SignReporterDatasource: Symbol.for(\"SignReporterDatasource\"),\n SignReporter: Symbol.for(\"SignReporter\"),\n};\n"],
|
|
5
|
+
"mappings": "AAAO,MAAMA,EAAoB,CAC/B,uBAAwB,OAAO,IAAI,wBAAwB,EAC3D,aAAc,OAAO,IAAI,cAAc,CACzC",
|
|
6
|
+
"names": ["signReporterTypes"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var c=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var s=(e,r,p,t)=>{for(var o=t>1?void 0:t?y(r,p):r,m=e.length-1,a;m>=0;m--)(a=e[m])&&(o=(t?a(r,p,o):a(o))||o);return t&&o&&c(r,p,o),o},n=(e,r)=>(p,t)=>r(p,t,e);import{inject as S,injectable as g}from"inversify";import{signReporterTypes as R}from"../../../../modules/multichain/sign-reporter/di/signReporterTypes";let i=class{constructor(r){this.dataSource=r}async report(r){return this.dataSource.report(r)}};i=s([g(),n(0,S(R.SignReporterDatasource))],i);export{i as DefaultSignReporter};
|
|
2
|
+
//# sourceMappingURL=DefaultSignReporter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/modules/multichain/sign-reporter/domain/DefaultSignReporter.ts"],
|
|
4
|
+
"sourcesContent": ["import { inject, injectable } from \"inversify\";\nimport { type Either } from \"purify-ts\";\n\nimport { type SignReporterDatasource } from \"@/modules/multichain/sign-reporter/data/SignReporterDatasource\";\nimport { signReporterTypes } from \"@/modules/multichain/sign-reporter/di/signReporterTypes\";\nimport { type SignReportParams } from \"@/modules/multichain/sign-reporter/model/SignReportParams\";\n\nimport { type SignReporter } from \"./SignReporter\";\n\n@injectable()\nexport class DefaultSignReporter implements SignReporter {\n constructor(\n @inject(signReporterTypes.SignReporterDatasource)\n private readonly dataSource: SignReporterDatasource,\n ) {}\n\n async report(params: SignReportParams): Promise<Either<Error, void>> {\n return this.dataSource.report(params);\n }\n}\n"],
|
|
5
|
+
"mappings": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YAInC,OAAS,qBAAAC,MAAyB,0DAM3B,IAAMC,EAAN,KAAkD,CACvD,YAEmBC,EACjB,CADiB,gBAAAA,CAChB,CAEH,MAAM,OAAOC,EAAwD,CACnE,OAAO,KAAK,WAAW,OAAOA,CAAM,CACtC,CACF,EATaF,EAANG,EAAA,CADNC,EAAW,EAGPC,EAAA,EAAAC,EAAOC,EAAkB,sBAAsB,IAFvCP",
|
|
6
|
+
"names": ["inject", "injectable", "signReporterTypes", "DefaultSignReporter", "dataSource", "params", "__decorateClass", "injectable", "__decorateParam", "inject", "signReporterTypes"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Left as n,Right as a}from"purify-ts";import{BlindSignReason as d}from"../../../../modules/multichain/reporter/model/BlindSigningEvent";import{BlindSigningModelId as p}from"../../../../shared/model/BlindSigningModelId";import{DefaultSignReporter as i}from"./DefaultSignReporter";describe("DefaultSignReporter",()=>{const r={chain:"SOL",signatureId:"abc123-1738850400000",signingMethod:"sol_signTransaction",isBlindSign:!0,targetAddress:null,blindSignReason:d.NO_CLEAR_SIGNING_CONTEXT,programIds:["11111111111111111111111111111111"],unrecognizedPrograms:[],modelId:p.FLEX,signerAppVersion:"1.4.0",deviceVersion:"2.2.3"};it("should delegate to the datasource and return Right on success",async()=>{const e={report:vi.fn().mockResolvedValueOnce(a(void 0))},o=await new i(e).report(r);expect(e.report).toHaveBeenCalledWith(r),expect(o).toEqual(a(void 0))}),it("should delegate to the datasource and return Left on failure",async()=>{const e=new Error("report failed"),t={report:vi.fn().mockResolvedValueOnce(n(e))},s=await new i(t).report(r);expect(t.report).toHaveBeenCalledWith(r),expect(s).toEqual(n(e))})});
|
|
2
|
+
//# sourceMappingURL=DefaultSignReporter.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/modules/multichain/sign-reporter/domain/DefaultSignReporter.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport { BlindSignReason } from \"@/modules/multichain/reporter/model/BlindSigningEvent\";\nimport { type SignReporterDatasource } from \"@/modules/multichain/sign-reporter/data/SignReporterDatasource\";\nimport { type SolSignReportParams } from \"@/modules/multichain/sign-reporter/model/SignReportParams\";\nimport { BlindSigningModelId } from \"@/shared/model/BlindSigningModelId\";\n\nimport { DefaultSignReporter } from \"./DefaultSignReporter\";\n\ndescribe(\"DefaultSignReporter\", () => {\n const params: SolSignReportParams = {\n chain: \"SOL\",\n signatureId: \"abc123-1738850400000\",\n signingMethod: \"sol_signTransaction\",\n isBlindSign: true,\n targetAddress: null,\n blindSignReason: BlindSignReason.NO_CLEAR_SIGNING_CONTEXT,\n programIds: [\"11111111111111111111111111111111\"],\n unrecognizedPrograms: [],\n modelId: BlindSigningModelId.FLEX,\n signerAppVersion: \"1.4.0\",\n deviceVersion: \"2.2.3\",\n };\n\n it(\"should delegate to the datasource and return Right on success\", async () => {\n // GIVEN\n const dataSource: SignReporterDatasource = {\n report: vi.fn().mockResolvedValueOnce(Right(undefined)),\n };\n const reporter = new DefaultSignReporter(dataSource);\n\n // WHEN\n const result = await reporter.report(params);\n\n // THEN\n expect(dataSource.report).toHaveBeenCalledWith(params);\n expect(result).toEqual(Right(undefined));\n });\n\n it(\"should delegate to the datasource and return Left on failure\", async () => {\n // GIVEN\n const error = new Error(\"report failed\");\n const dataSource: SignReporterDatasource = {\n report: vi.fn().mockResolvedValueOnce(Left(error)),\n };\n const reporter = new DefaultSignReporter(dataSource);\n\n // WHEN\n const result = await reporter.report(params);\n\n // THEN\n expect(dataSource.report).toHaveBeenCalledWith(params);\n expect(result).toEqual(Left(error));\n });\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAE5B,OAAS,mBAAAC,MAAuB,wDAGhC,OAAS,uBAAAC,MAA2B,qCAEpC,OAAS,uBAAAC,MAA2B,wBAEpC,SAAS,sBAAuB,IAAM,CACpC,MAAMC,EAA8B,CAClC,MAAO,MACP,YAAa,uBACb,cAAe,sBACf,YAAa,GACb,cAAe,KACf,gBAAiBH,EAAgB,yBACjC,WAAY,CAAC,kCAAkC,EAC/C,qBAAsB,CAAC,EACvB,QAASC,EAAoB,KAC7B,iBAAkB,QAClB,cAAe,OACjB,EAEA,GAAG,gEAAiE,SAAY,CAE9E,MAAMG,EAAqC,CACzC,OAAQ,GAAG,GAAG,EAAE,sBAAsBL,EAAM,MAAS,CAAC,CACxD,EAIMM,EAAS,MAHE,IAAIH,EAAoBE,CAAU,EAGrB,OAAOD,CAAM,EAG3C,OAAOC,EAAW,MAAM,EAAE,qBAAqBD,CAAM,EACrD,OAAOE,CAAM,EAAE,QAAQN,EAAM,MAAS,CAAC,CACzC,CAAC,EAED,GAAG,+DAAgE,SAAY,CAE7E,MAAMO,EAAQ,IAAI,MAAM,eAAe,EACjCF,EAAqC,CACzC,OAAQ,GAAG,GAAG,EAAE,sBAAsBN,EAAKQ,CAAK,CAAC,CACnD,EAIMD,EAAS,MAHE,IAAIH,EAAoBE,CAAU,EAGrB,OAAOD,CAAM,EAG3C,OAAOC,EAAW,MAAM,EAAE,qBAAqBD,CAAM,EACrD,OAAOE,CAAM,EAAE,QAAQP,EAAKQ,CAAK,CAAC,CACpC,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["Left", "Right", "BlindSignReason", "BlindSigningModelId", "DefaultSignReporter", "params", "dataSource", "result", "error"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=SignReporter.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/modules/multichain/sign-reporter/model/SignReportParams.ts"],
|
|
4
|
+
"sourcesContent": ["import { type BlindSignReason } from \"@/modules/multichain/reporter/model/BlindSigningEvent\";\nimport { type BlindSigningModelId } from \"@/shared/model/BlindSigningModelId\";\n\nexport const SigningMethod = Object.freeze({\n ETH_SIGN_TRANSACTION: \"eth_signTransaction\",\n ETH_SIGN_TYPED_DATA: \"eth_signTypedData\",\n SOL_SIGN_TRANSACTION: \"sol_signTransaction\",\n} as const);\nexport type SigningMethod = (typeof SigningMethod)[keyof typeof SigningMethod];\n\ntype SignReportEnvData = {\n modelId: BlindSigningModelId;\n signerAppVersion: string;\n deviceVersion: string | null;\n platform?: \"desktop\" | \"mobile\";\n appVersion?: string;\n platformOS?: string;\n platformVersion?: string;\n liveAppContext?: string | null;\n sessionId?: string | null;\n};\n\nexport type EthSignReportParams = SignReportEnvData & {\n chain: \"ETH\";\n signatureId: string;\n signingMethod:\n | typeof SigningMethod.ETH_SIGN_TRANSACTION\n | typeof SigningMethod.ETH_SIGN_TYPED_DATA;\n isBlindSign: boolean;\n chainId: number | null;\n targetAddress: string | null;\n selectorId?: string | null;\n blindSignReason: BlindSignReason | null;\n clearSigningType?: \"basic\" | \"eip7730\" | null;\n partialContextErrors?: number | null;\n};\n\nexport type SolSignReportParams = SignReportEnvData & {\n chain: \"SOL\";\n signatureId: string;\n signingMethod: typeof SigningMethod.SOL_SIGN_TRANSACTION;\n isBlindSign: boolean;\n targetAddress: string | null;\n blindSignReason: BlindSignReason | null;\n programIds: string[];\n unrecognizedPrograms: string[];\n transactionSignature?: string | null;\n};\n\nexport type SignReportParams = EthSignReportParams | SolSignReportParams;\n"],
|
|
5
|
+
"mappings": "AAGO,MAAMA,EAAgB,OAAO,OAAO,CACzC,qBAAsB,sBACtB,oBAAqB,oBACrB,qBAAsB,qBACxB,CAAU",
|
|
6
|
+
"names": ["SigningMethod"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["
|
|
3
|
+
"sources": ["../../../../../src/shared/model/BlindSigningModelId.ts"],
|
|
4
4
|
"sourcesContent": ["import { DeviceModelId } from \"@ledgerhq/device-management-kit\";\n\nexport const BlindSigningModelId = Object.freeze({\n NANO_S: \"nanoS\",\n NANO_SP: \"nanoSP\",\n NANO_X: \"nanoX\",\n STAX: \"stax\",\n FLEX: \"flex\",\n APEX_P: \"apexP\",\n} as const);\nexport type BlindSigningModelId =\n (typeof BlindSigningModelId)[keyof typeof BlindSigningModelId];\n\nconst deviceModelIdToBlindSigningModelId: Record<\n DeviceModelId,\n BlindSigningModelId\n> = {\n [DeviceModelId.NANO_S]: BlindSigningModelId.NANO_S,\n [DeviceModelId.NANO_SP]: BlindSigningModelId.NANO_SP,\n [DeviceModelId.NANO_X]: BlindSigningModelId.NANO_X,\n [DeviceModelId.STAX]: BlindSigningModelId.STAX,\n [DeviceModelId.FLEX]: BlindSigningModelId.FLEX,\n [DeviceModelId.APEX]: BlindSigningModelId.APEX_P,\n};\n\nexport function mapDeviceModelId(id: DeviceModelId): BlindSigningModelId {\n return deviceModelIdToBlindSigningModelId[id];\n}\n"],
|
|
5
5
|
"mappings": "AAAA,OAAS,iBAAAA,MAAqB,kCAEvB,MAAMC,EAAsB,OAAO,OAAO,CAC/C,OAAQ,QACR,QAAS,SACT,OAAQ,QACR,KAAM,OACN,KAAM,OACN,OAAQ,OACV,CAAU,EAIJC,EAGF,CACF,CAACF,EAAc,MAAM,EAAGC,EAAoB,OAC5C,CAACD,EAAc,OAAO,EAAGC,EAAoB,QAC7C,CAACD,EAAc,MAAM,EAAGC,EAAoB,OAC5C,CAACD,EAAc,IAAI,EAAGC,EAAoB,KAC1C,CAACD,EAAc,IAAI,EAAGC,EAAoB,KAC1C,CAACD,EAAc,IAAI,EAAGC,EAAoB,MAC5C,EAEO,SAASE,EAAiBC,EAAwC,CACvE,OAAOF,EAAmCE,CAAE,CAC9C",
|
|
6
6
|
"names": ["DeviceModelId", "BlindSigningModelId", "deviceModelIdToBlindSigningModelId", "mapDeviceModelId", "id"]
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type BlindSigningReportParams } from "./modules/multichain/reporter/data/BlindSigningReporterDatasource";
|
|
2
|
+
import { type SignReportParams } from "./modules/multichain/sign-reporter/model/SignReportParams";
|
|
2
3
|
import { type ClearSignContext, type ClearSignContextType } from "./shared/model/ClearSignContext";
|
|
3
4
|
import { type TypedDataClearSignContext } from "./modules/ethereum/model/TypedDataClearSignContext";
|
|
4
5
|
import { type TypedDataContext } from "./modules/ethereum/model/TypedDataContext";
|
|
@@ -7,5 +8,6 @@ export interface ContextModule {
|
|
|
7
8
|
getFieldContext<TInput>(field: TInput, expectedType: ClearSignContextType): Promise<ClearSignContext>;
|
|
8
9
|
getTypedDataFilters(typedData: TypedDataContext): Promise<TypedDataClearSignContext>;
|
|
9
10
|
report(params: BlindSigningReportParams): Promise<void>;
|
|
11
|
+
signReport?(params: SignReportParams): Promise<void>;
|
|
10
12
|
}
|
|
11
13
|
//# sourceMappingURL=ContextModule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextModule.d.ts","sourceRoot":"","sources":["../../../src/ContextModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,mEAAmE,CAAC;AAClH,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAC1B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAElF,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,aAAa,CAAC,EAAE,oBAAoB,EAAE,GACrC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC/B,eAAe,CAAC,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,oBAAoB,GACjC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC7B,mBAAmB,CACjB,SAAS,EAAE,gBAAgB,GAC1B,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACtC,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"ContextModule.d.ts","sourceRoot":"","sources":["../../../src/ContextModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,mEAAmE,CAAC;AAClH,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,2DAA2D,CAAC;AAClG,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EAC1B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,oDAAoD,CAAC;AACpG,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAElF,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,aAAa,CAAC,EAAE,oBAAoB,EAAE,GACrC,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC/B,eAAe,CAAC,MAAM,EACpB,KAAK,EAAE,MAAM,EACb,YAAY,EAAE,oBAAoB,GACjC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC7B,mBAAmB,CACjB,SAAS,EAAE,gBAAgB,GAC1B,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACtC,MAAM,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,UAAU,CAAC,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACtD"}
|
|
@@ -3,6 +3,7 @@ import { type ContextModule } from "./ContextModule";
|
|
|
3
3
|
import type { TypedDataClearSignContext } from "./modules/ethereum/model/TypedDataClearSignContext";
|
|
4
4
|
import type { TypedDataContext } from "./modules/ethereum/model/TypedDataContext";
|
|
5
5
|
import { type BlindSigningReportParams } from "./modules/multichain/reporter/data/BlindSigningReporterDatasource";
|
|
6
|
+
import { type SignReportParams } from "./modules/multichain/sign-reporter/model/SignReportParams";
|
|
6
7
|
import { type ClearSignContext, ClearSignContextType } from "./shared/model/ClearSignContext";
|
|
7
8
|
export declare class DefaultContextModule implements ContextModule {
|
|
8
9
|
private _container;
|
|
@@ -11,6 +12,7 @@ export declare class DefaultContextModule implements ContextModule {
|
|
|
11
12
|
private _typedDataLoader;
|
|
12
13
|
private _fieldLoaders;
|
|
13
14
|
private _blindSigningReporter;
|
|
15
|
+
private _signReporter;
|
|
14
16
|
constructor(args: ContextModuleServiceConfig & ContextModuleLoaderConfig);
|
|
15
17
|
private _getDefaultFieldLoaders;
|
|
16
18
|
private _getDefaultLoaders;
|
|
@@ -20,5 +22,6 @@ export declare class DefaultContextModule implements ContextModule {
|
|
|
20
22
|
getFieldContext<TInput>(field: TInput, expectedType: ClearSignContextType): Promise<ClearSignContext>;
|
|
21
23
|
getTypedDataFilters(typedData: TypedDataContext): Promise<TypedDataClearSignContext>;
|
|
22
24
|
report(params: BlindSigningReportParams): Promise<void>;
|
|
25
|
+
signReport(params: SignReportParams): Promise<void>;
|
|
23
26
|
}
|
|
24
27
|
//# sourceMappingURL=DefaultContextModule.d.ts.map
|