@ledgerhq/context-module 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -6
- package/lib/cjs/index.js +2 -20
- package/lib/cjs/index.js.map +7 -1
- package/lib/cjs/package.json +53 -59
- package/lib/cjs/src/ContextModule.js +2 -3
- package/lib/cjs/src/ContextModule.js.map +7 -1
- package/lib/cjs/src/ContextModuleBuilder.js +2 -87
- package/lib/cjs/src/ContextModuleBuilder.js.map +7 -1
- package/lib/cjs/src/ContextModuleBuilder.test.js +2 -0
- package/lib/cjs/src/ContextModuleBuilder.test.js.map +7 -0
- package/lib/cjs/src/DefaultContextModule.js +2 -21
- package/lib/cjs/src/DefaultContextModule.js.map +7 -1
- package/lib/cjs/src/DefaultContextModule.test.js +2 -0
- package/lib/cjs/src/DefaultContextModule.test.js.map +7 -0
- package/lib/cjs/src/config/di/configModuleFactory.js +2 -10
- package/lib/cjs/src/config/di/configModuleFactory.js.map +7 -1
- package/lib/cjs/src/config/di/configTypes.js +2 -7
- package/lib/cjs/src/config/di/configTypes.js.map +7 -1
- package/lib/cjs/src/config/model/ContextModuleConfig.js +2 -3
- package/lib/cjs/src/config/model/ContextModuleConfig.js.map +7 -1
- package/lib/cjs/src/di.js +2 -17
- package/lib/cjs/src/di.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/DAppDto.js +2 -3
- package/lib/cjs/src/external-plugin/data/DAppDto.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js +2 -3
- package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -83
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
- package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js +2 -13
- package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
- package/lib/cjs/src/external-plugin/di/externalPluginTypes.js +2 -8
- package/lib/cjs/src/external-plugin/di/externalPluginTypes.js.map +7 -1
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -136
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
- package/lib/cjs/src/external-plugin/model/DappInfos.js +2 -3
- package/lib/cjs/src/external-plugin/model/DappInfos.js.map +7 -1
- package/lib/cjs/src/external-plugin/model/SelectorDetails.js +2 -3
- package/lib/cjs/src/external-plugin/model/SelectorDetails.js.map +7 -1
- package/lib/cjs/src/index.js +2 -30
- package/lib/cjs/src/index.js.map +7 -1
- package/lib/cjs/src/nft/data/HttpNftDataSource.js +2 -57
- package/lib/cjs/src/nft/data/HttpNftDataSource.js.map +7 -1
- package/lib/cjs/src/nft/data/HttpNftDataSource.test.js +2 -0
- package/lib/cjs/src/nft/data/HttpNftDataSource.test.js.map +7 -0
- package/lib/cjs/src/nft/data/NftDataSource.js +2 -3
- package/lib/cjs/src/nft/data/NftDataSource.js.map +7 -1
- package/lib/cjs/src/nft/di/nftModuleFactory.js +2 -13
- package/lib/cjs/src/nft/di/nftModuleFactory.js.map +7 -1
- package/lib/cjs/src/nft/di/nftTypes.js +2 -8
- package/lib/cjs/src/nft/di/nftTypes.js.map +7 -1
- package/lib/cjs/src/nft/domain/NftContextLoader.js +2 -111
- package/lib/cjs/src/nft/domain/NftContextLoader.js.map +7 -1
- package/lib/cjs/src/nft/domain/NftContextLoader.test.js +2 -0
- package/lib/cjs/src/nft/domain/NftContextLoader.test.js.map +7 -0
- package/lib/cjs/src/shared/domain/ContextLoader.js +2 -3
- package/lib/cjs/src/shared/domain/ContextLoader.js.map +7 -1
- package/lib/cjs/src/shared/model/ClearSignContext.js +2 -13
- package/lib/cjs/src/shared/model/ClearSignContext.js.map +7 -1
- package/lib/cjs/src/shared/model/GenericPath.js +2 -0
- package/lib/cjs/src/shared/model/GenericPath.js.map +7 -0
- package/lib/cjs/src/shared/model/TransactionContext.js +2 -3
- package/lib/cjs/src/shared/model/TransactionContext.js.map +7 -1
- package/lib/cjs/src/shared/model/TransactionSubset.js +2 -3
- package/lib/cjs/src/shared/model/TransactionSubset.js.map +7 -1
- package/lib/cjs/src/shared/model/TypedDataClearSignContext.js +2 -6
- package/lib/cjs/src/shared/model/TypedDataClearSignContext.js.map +7 -1
- package/lib/cjs/src/shared/model/TypedDataContext.js +2 -3
- package/lib/cjs/src/shared/model/TypedDataContext.js.map +7 -1
- package/lib/cjs/src/shared/utils/HexStringUtils.js +2 -15
- package/lib/cjs/src/shared/utils/HexStringUtils.js.map +7 -1
- package/lib/cjs/src/token/data/HttpTokenDataSource.js +2 -83
- package/lib/cjs/src/token/data/HttpTokenDataSource.js.map +7 -1
- package/lib/cjs/src/token/data/HttpTokenDataSource.test.js +2 -0
- package/lib/cjs/src/token/data/HttpTokenDataSource.test.js.map +7 -0
- package/lib/cjs/src/token/data/TokenDataSource.js +2 -3
- package/lib/cjs/src/token/data/TokenDataSource.js.map +7 -1
- package/lib/cjs/src/token/data/TokenDto.js +2 -3
- package/lib/cjs/src/token/data/TokenDto.js.map +7 -1
- package/lib/cjs/src/token/di/tokenModuleFactory.js +2 -13
- package/lib/cjs/src/token/di/tokenModuleFactory.js.map +7 -1
- package/lib/cjs/src/token/di/tokenTypes.js +2 -8
- package/lib/cjs/src/token/di/tokenTypes.js.map +7 -1
- package/lib/cjs/src/token/domain/TokenContextLoader.js +2 -74
- package/lib/cjs/src/token/domain/TokenContextLoader.js.map +7 -1
- package/lib/cjs/src/token/domain/TokenContextLoader.test.js +2 -0
- package/lib/cjs/src/token/domain/TokenContextLoader.test.js.map +7 -0
- package/lib/cjs/src/transaction/data/CalldataDto.js +2 -0
- package/lib/cjs/src/transaction/data/CalldataDto.js.map +7 -0
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js +2 -0
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
- package/lib/cjs/src/transaction/data/TransactionDataSource.js +2 -0
- package/lib/cjs/src/transaction/data/TransactionDataSource.js.map +7 -0
- package/lib/cjs/src/transaction/di/transactionModuleFactory.js +2 -0
- package/lib/cjs/src/transaction/di/transactionModuleFactory.js.map +7 -0
- package/lib/cjs/src/transaction/di/transactionTypes.js +2 -0
- package/lib/cjs/src/transaction/di/transactionTypes.js.map +7 -0
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.js +2 -0
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.js.map +7 -0
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js +2 -0
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
- package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js +2 -0
- package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
- package/lib/cjs/src/trusted-name/data/TrustedNameDto.js +2 -0
- package/lib/cjs/src/trusted-name/data/TrustedNameDto.js.map +7 -0
- package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
- package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
- package/lib/cjs/src/trusted-name/di/trustedNameTypes.js +2 -0
- package/lib/cjs/src/trusted-name/di/trustedNameTypes.js.map +7 -0
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
- package/lib/cjs/src/typed-data/data/FiltersDto.js +2 -3
- package/lib/cjs/src/typed-data/data/FiltersDto.js.map +7 -1
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js +2 -163
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -1
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
- package/lib/cjs/src/typed-data/data/TypedDataDataSource.js +2 -3
- package/lib/cjs/src/typed-data/data/TypedDataDataSource.js.map +7 -1
- package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js +2 -13
- package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js.map +7 -1
- package/lib/cjs/src/typed-data/di/typedDataTypes.js +2 -8
- package/lib/cjs/src/typed-data/di/typedDataTypes.js.map +7 -1
- package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -127
- package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -1
- package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
- package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
- package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js +2 -3
- package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js.map +7 -1
- package/lib/esm/index.js +2 -4
- package/lib/esm/index.js.map +7 -1
- package/lib/esm/package.json +53 -59
- package/lib/esm/src/ContextModule.js +1 -2
- package/lib/esm/src/ContextModule.js.map +7 -1
- package/lib/esm/src/ContextModuleBuilder.js +2 -83
- package/lib/esm/src/ContextModuleBuilder.js.map +7 -1
- package/lib/esm/src/ContextModuleBuilder.test.js +2 -0
- package/lib/esm/src/ContextModuleBuilder.test.js.map +7 -0
- package/lib/esm/src/DefaultContextModule.js +2 -17
- package/lib/esm/src/DefaultContextModule.js.map +7 -1
- package/lib/esm/src/DefaultContextModule.test.js +2 -0
- package/lib/esm/src/DefaultContextModule.test.js.map +7 -0
- package/lib/esm/src/config/di/configModuleFactory.js +2 -6
- package/lib/esm/src/config/di/configModuleFactory.js.map +7 -1
- package/lib/esm/src/config/di/configTypes.js +2 -4
- package/lib/esm/src/config/di/configTypes.js.map +7 -1
- package/lib/esm/src/config/model/ContextModuleConfig.js +1 -2
- package/lib/esm/src/config/model/ContextModuleConfig.js.map +7 -1
- package/lib/esm/src/di.js +2 -13
- package/lib/esm/src/di.js.map +7 -1
- package/lib/esm/src/external-plugin/data/DAppDto.js +1 -2
- package/lib/esm/src/external-plugin/data/DAppDto.js.map +7 -1
- package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js +1 -2
- package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -77
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
- package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js +2 -9
- package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
- package/lib/esm/src/external-plugin/di/externalPluginTypes.js +2 -5
- package/lib/esm/src/external-plugin/di/externalPluginTypes.js.map +7 -1
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -133
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
- package/lib/esm/src/external-plugin/model/DappInfos.js +1 -2
- package/lib/esm/src/external-plugin/model/DappInfos.js.map +7 -1
- package/lib/esm/src/external-plugin/model/SelectorDetails.js +1 -2
- package/lib/esm/src/external-plugin/model/SelectorDetails.js.map +7 -1
- package/lib/esm/src/index.js +2 -14
- package/lib/esm/src/index.js.map +7 -1
- package/lib/esm/src/nft/data/HttpNftDataSource.js +2 -51
- package/lib/esm/src/nft/data/HttpNftDataSource.js.map +7 -1
- package/lib/esm/src/nft/data/HttpNftDataSource.test.js +2 -0
- package/lib/esm/src/nft/data/HttpNftDataSource.test.js.map +7 -0
- package/lib/esm/src/nft/data/NftDataSource.js +1 -2
- package/lib/esm/src/nft/data/NftDataSource.js.map +7 -1
- package/lib/esm/src/nft/di/nftModuleFactory.js +2 -9
- package/lib/esm/src/nft/di/nftModuleFactory.js.map +7 -1
- package/lib/esm/src/nft/di/nftTypes.js +2 -5
- package/lib/esm/src/nft/di/nftTypes.js.map +7 -1
- package/lib/esm/src/nft/domain/NftContextLoader.js +2 -108
- package/lib/esm/src/nft/domain/NftContextLoader.js.map +7 -1
- package/lib/esm/src/nft/domain/NftContextLoader.test.js +2 -0
- package/lib/esm/src/nft/domain/NftContextLoader.test.js.map +7 -0
- package/lib/esm/src/shared/domain/ContextLoader.js +1 -2
- package/lib/esm/src/shared/domain/ContextLoader.js.map +7 -1
- package/lib/esm/src/shared/model/ClearSignContext.js +2 -10
- package/lib/esm/src/shared/model/ClearSignContext.js.map +7 -1
- package/lib/esm/src/shared/model/GenericPath.js +2 -0
- package/lib/esm/src/shared/model/GenericPath.js.map +7 -0
- package/lib/esm/src/shared/model/TransactionContext.js +1 -2
- package/lib/esm/src/shared/model/TransactionContext.js.map +7 -1
- package/lib/esm/src/shared/model/TransactionSubset.js +1 -2
- package/lib/esm/src/shared/model/TransactionSubset.js.map +7 -1
- package/lib/esm/src/shared/model/TypedDataClearSignContext.js +2 -3
- package/lib/esm/src/shared/model/TypedDataClearSignContext.js.map +7 -1
- package/lib/esm/src/shared/model/TypedDataContext.js +1 -2
- package/lib/esm/src/shared/model/TypedDataContext.js.map +7 -1
- package/lib/esm/src/shared/utils/HexStringUtils.js +2 -11
- package/lib/esm/src/shared/utils/HexStringUtils.js.map +7 -1
- package/lib/esm/src/token/data/HttpTokenDataSource.js +2 -77
- package/lib/esm/src/token/data/HttpTokenDataSource.js.map +7 -1
- package/lib/esm/src/token/data/HttpTokenDataSource.test.js +2 -0
- package/lib/esm/src/token/data/HttpTokenDataSource.test.js.map +7 -0
- package/lib/esm/src/token/data/TokenDataSource.js +1 -2
- package/lib/esm/src/token/data/TokenDataSource.js.map +7 -1
- package/lib/esm/src/token/data/TokenDto.js +1 -2
- package/lib/esm/src/token/data/TokenDto.js.map +7 -1
- package/lib/esm/src/token/di/tokenModuleFactory.js +2 -9
- package/lib/esm/src/token/di/tokenModuleFactory.js.map +7 -1
- package/lib/esm/src/token/di/tokenTypes.js +2 -5
- package/lib/esm/src/token/di/tokenTypes.js.map +7 -1
- package/lib/esm/src/token/domain/TokenContextLoader.js +2 -71
- package/lib/esm/src/token/domain/TokenContextLoader.js.map +7 -1
- package/lib/esm/src/token/domain/TokenContextLoader.test.js +2 -0
- package/lib/esm/src/token/domain/TokenContextLoader.test.js.map +7 -0
- package/lib/esm/src/transaction/data/CalldataDto.js +1 -0
- package/lib/esm/src/transaction/data/CalldataDto.js.map +7 -0
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.js +2 -0
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
- package/lib/esm/src/transaction/data/TransactionDataSource.js +1 -0
- package/lib/esm/src/transaction/data/TransactionDataSource.js.map +7 -0
- package/lib/esm/src/transaction/di/transactionModuleFactory.js +2 -0
- package/lib/esm/src/transaction/di/transactionModuleFactory.js.map +7 -0
- package/lib/esm/src/transaction/di/transactionTypes.js +2 -0
- package/lib/esm/src/transaction/di/transactionTypes.js.map +7 -0
- package/lib/esm/src/transaction/domain/TransactionContextLoader.js +2 -0
- package/lib/esm/src/transaction/domain/TransactionContextLoader.js.map +7 -0
- package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js +2 -0
- package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
- package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js +1 -0
- package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
- package/lib/esm/src/trusted-name/data/TrustedNameDto.js +1 -0
- package/lib/esm/src/trusted-name/data/TrustedNameDto.js.map +7 -0
- package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
- package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
- package/lib/esm/src/trusted-name/di/trustedNameTypes.js +2 -0
- package/lib/esm/src/trusted-name/di/trustedNameTypes.js.map +7 -0
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
- package/lib/esm/src/typed-data/data/FiltersDto.js +1 -2
- package/lib/esm/src/typed-data/data/FiltersDto.js.map +7 -1
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js +2 -157
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -1
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
- package/lib/esm/src/typed-data/data/TypedDataDataSource.js +1 -2
- package/lib/esm/src/typed-data/data/TypedDataDataSource.js.map +7 -1
- package/lib/esm/src/typed-data/di/typedDataModuleFactory.js +2 -9
- package/lib/esm/src/typed-data/di/typedDataModuleFactory.js.map +7 -1
- package/lib/esm/src/typed-data/di/typedDataTypes.js +2 -5
- package/lib/esm/src/typed-data/di/typedDataTypes.js.map +7 -1
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -124
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -1
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
- package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js +1 -2
- package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js.map +7 -1
- package/lib/{cjs → types}/src/ContextModule.d.ts +3 -2
- package/lib/types/src/ContextModule.d.ts.map +1 -0
- package/lib/{cjs → types}/src/ContextModuleBuilder.d.ts +9 -11
- package/lib/types/src/ContextModuleBuilder.d.ts.map +1 -0
- package/lib/types/src/ContextModuleBuilder.test.d.ts +2 -0
- package/lib/types/src/ContextModuleBuilder.test.d.ts.map +1 -0
- package/lib/types/src/DefaultContextModule.d.ts +18 -0
- package/lib/types/src/DefaultContextModule.d.ts.map +1 -0
- package/lib/types/src/DefaultContextModule.test.d.ts +2 -0
- package/lib/types/src/DefaultContextModule.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts +1 -1
- package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts.map +1 -1
- package/lib/types/src/config/model/ContextModuleConfig.d.ts +16 -0
- package/lib/types/src/config/model/ContextModuleConfig.d.ts.map +1 -0
- package/lib/{cjs → types}/src/di.d.ts +1 -1
- package/lib/types/src/di.d.ts.map +1 -0
- package/lib/{cjs → types}/src/external-plugin/data/ExternalPluginDataSource.d.ts +3 -3
- package/lib/types/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +1 -0
- package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts +2 -0
- package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts.map +1 -0
- package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts +2 -0
- package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts.map +1 -0
- package/lib/types/src/external-plugin/model/DappInfos.d.ts +6 -0
- package/lib/types/src/external-plugin/model/DappInfos.d.ts.map +1 -0
- package/lib/{cjs → types}/src/index.d.ts +3 -1
- package/lib/types/src/index.d.ts.map +1 -0
- package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts +2 -0
- package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/nft/data/NftDataSource.d.ts +1 -1
- package/lib/types/src/nft/data/NftDataSource.d.ts.map +1 -0
- package/lib/{cjs → types}/src/nft/domain/NftContextLoader.d.ts +2 -1
- package/lib/types/src/nft/domain/NftContextLoader.d.ts.map +1 -0
- package/lib/types/src/nft/domain/NftContextLoader.test.d.ts +2 -0
- package/lib/types/src/nft/domain/NftContextLoader.test.d.ts.map +1 -0
- package/lib/types/src/shared/domain/ContextLoader.d.ts +7 -0
- package/lib/types/src/shared/domain/ContextLoader.d.ts.map +1 -0
- package/lib/types/src/shared/model/ClearSignContext.d.ts +40 -0
- package/lib/types/src/shared/model/ClearSignContext.d.ts.map +1 -0
- package/lib/types/src/shared/model/GenericPath.d.ts +105 -0
- package/lib/types/src/shared/model/GenericPath.d.ts.map +1 -0
- package/lib/types/src/shared/model/TransactionContext.d.ts +19 -0
- package/lib/types/src/shared/model/TransactionContext.d.ts.map +1 -0
- package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts.map +1 -1
- package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts +2 -0
- package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/token/data/TokenDataSource.d.ts +1 -1
- package/lib/types/src/token/data/TokenDataSource.d.ts.map +1 -0
- package/lib/types/src/token/data/TokenDto.d.ts +16 -0
- package/lib/types/src/token/data/TokenDto.d.ts.map +1 -0
- package/lib/{cjs → types}/src/token/domain/TokenContextLoader.d.ts +2 -1
- package/lib/types/src/token/domain/TokenContextLoader.d.ts.map +1 -0
- package/lib/types/src/token/domain/TokenContextLoader.test.d.ts +2 -0
- package/lib/types/src/token/domain/TokenContextLoader.test.d.ts.map +1 -0
- package/lib/types/src/transaction/data/CalldataDto.d.ts +117 -0
- package/lib/types/src/transaction/data/CalldataDto.d.ts.map +1 -0
- package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts +19 -0
- package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts.map +1 -0
- package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts +2 -0
- package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts.map +1 -0
- package/lib/types/src/transaction/data/TransactionDataSource.d.ts +12 -0
- package/lib/types/src/transaction/data/TransactionDataSource.d.ts.map +1 -0
- package/lib/types/src/transaction/di/transactionModuleFactory.d.ts +3 -0
- package/lib/types/src/transaction/di/transactionModuleFactory.d.ts.map +1 -0
- package/lib/types/src/transaction/di/transactionTypes.d.ts +5 -0
- package/lib/types/src/transaction/di/transactionTypes.d.ts.map +1 -0
- package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts +10 -0
- package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts.map +1 -0
- package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts +2 -0
- package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts.map +1 -0
- package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts +11 -0
- package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts.map +1 -0
- package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts +2 -0
- package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts.map +1 -0
- package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts +16 -0
- package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts.map +1 -0
- package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts +15 -0
- package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts.map +1 -0
- package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts +3 -0
- package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts.map +1 -0
- package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts +5 -0
- package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts.map +1 -0
- package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts +12 -0
- package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts.map +1 -0
- package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts +2 -0
- package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/typed-data/data/FiltersDto.d.ts +3 -0
- package/lib/types/src/typed-data/data/FiltersDto.d.ts.map +1 -0
- package/lib/types/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +1 -0
- package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts +3 -0
- package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/typed-data/data/TypedDataDataSource.d.ts +3 -3
- package/lib/types/src/typed-data/data/TypedDataDataSource.d.ts.map +1 -0
- package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +1 -1
- package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts +2 -0
- package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts.map +1 -0
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -0
- package/package.json +21 -27
- package/lib/cjs/src/ContextModule.d.ts.map +0 -1
- package/lib/cjs/src/ContextModuleBuilder.d.ts.map +0 -1
- package/lib/cjs/src/DefaultContextModule.d.ts +0 -20
- package/lib/cjs/src/DefaultContextModule.d.ts.map +0 -1
- package/lib/cjs/src/config/model/ContextModuleConfig.d.ts +0 -9
- package/lib/cjs/src/config/model/ContextModuleConfig.d.ts.map +0 -1
- package/lib/cjs/src/di.d.ts.map +0 -1
- package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -1
- package/lib/cjs/src/external-plugin/model/DappInfos.d.ts +0 -6
- package/lib/cjs/src/external-plugin/model/DappInfos.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
- package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js +0 -3
- package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
- package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
- package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -40
- package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
- package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
- package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js +0 -13
- package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
- package/lib/cjs/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
- package/lib/cjs/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js +0 -8
- package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
- package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
- package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -66
- package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
- package/lib/cjs/src/index.d.ts.map +0 -1
- package/lib/cjs/src/nft/data/NftDataSource.d.ts.map +0 -1
- package/lib/cjs/src/nft/domain/NftContextLoader.d.ts.map +0 -1
- package/lib/cjs/src/shared/domain/ContextLoader.d.ts +0 -6
- package/lib/cjs/src/shared/domain/ContextLoader.d.ts.map +0 -1
- package/lib/cjs/src/shared/model/ClearSignContext.d.ts +0 -21
- package/lib/cjs/src/shared/model/ClearSignContext.d.ts.map +0 -1
- package/lib/cjs/src/shared/model/TransactionContext.d.ts +0 -6
- package/lib/cjs/src/shared/model/TransactionContext.d.ts.map +0 -1
- package/lib/cjs/src/token/data/TokenDataSource.d.ts.map +0 -1
- package/lib/cjs/src/token/data/TokenDto.d.ts +0 -6
- package/lib/cjs/src/token/data/TokenDto.d.ts.map +0 -1
- package/lib/cjs/src/token/domain/TokenContextLoader.d.ts.map +0 -1
- package/lib/cjs/src/typed-data/data/FiltersDto.d.ts.map +0 -1
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
- package/lib/cjs/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -1
- package/lib/cjs/tsconfig.cjs.tsbuildinfo +0 -1
- package/lib/esm/index.d.ts +0 -3
- package/lib/esm/index.d.ts.map +0 -1
- package/lib/esm/src/ContextModule.d.ts +0 -9
- package/lib/esm/src/ContextModule.d.ts.map +0 -1
- package/lib/esm/src/ContextModuleBuilder.d.ts +0 -45
- package/lib/esm/src/ContextModuleBuilder.d.ts.map +0 -1
- package/lib/esm/src/DefaultContextModule.d.ts +0 -20
- package/lib/esm/src/DefaultContextModule.d.ts.map +0 -1
- package/lib/esm/src/config/di/configModuleFactory.d.ts +0 -4
- package/lib/esm/src/config/di/configModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/config/di/configTypes.d.ts +0 -4
- package/lib/esm/src/config/di/configTypes.d.ts.map +0 -1
- package/lib/esm/src/config/model/ContextModuleConfig.d.ts +0 -9
- package/lib/esm/src/config/model/ContextModuleConfig.d.ts.map +0 -1
- package/lib/esm/src/di.d.ts +0 -8
- package/lib/esm/src/di.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/data/DAppDto.d.ts +0 -38
- package/lib/esm/src/external-plugin/data/DAppDto.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts +0 -12
- package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -10
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -3
- package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts +0 -5
- package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -15
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/model/DappInfos.d.ts +0 -6
- package/lib/esm/src/external-plugin/model/DappInfos.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts +0 -8
- package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
- package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js +0 -2
- package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
- package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
- package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -34
- package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
- package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
- package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js +0 -9
- package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
- package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
- package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/di/forwardDomainTypes.js +0 -5
- package/lib/esm/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
- package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
- package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -63
- package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
- package/lib/esm/src/index.d.ts +0 -14
- package/lib/esm/src/index.d.ts.map +0 -1
- package/lib/esm/src/nft/data/HttpNftDataSource.d.ts +0 -7
- package/lib/esm/src/nft/data/HttpNftDataSource.d.ts.map +0 -1
- package/lib/esm/src/nft/data/NftDataSource.d.ts +0 -15
- package/lib/esm/src/nft/data/NftDataSource.d.ts.map +0 -1
- package/lib/esm/src/nft/di/nftModuleFactory.d.ts +0 -3
- package/lib/esm/src/nft/di/nftModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/nft/di/nftTypes.d.ts +0 -5
- package/lib/esm/src/nft/di/nftTypes.d.ts.map +0 -1
- package/lib/esm/src/nft/domain/NftContextLoader.d.ts +0 -11
- package/lib/esm/src/nft/domain/NftContextLoader.d.ts.map +0 -1
- package/lib/esm/src/shared/domain/ContextLoader.d.ts +0 -6
- package/lib/esm/src/shared/domain/ContextLoader.d.ts.map +0 -1
- package/lib/esm/src/shared/model/ClearSignContext.d.ts +0 -21
- package/lib/esm/src/shared/model/ClearSignContext.d.ts.map +0 -1
- package/lib/esm/src/shared/model/TransactionContext.d.ts +0 -6
- package/lib/esm/src/shared/model/TransactionContext.d.ts.map +0 -1
- package/lib/esm/src/shared/model/TransactionSubset.d.ts +0 -6
- package/lib/esm/src/shared/model/TransactionSubset.d.ts.map +0 -1
- package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts +0 -33
- package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -1
- package/lib/esm/src/shared/model/TypedDataContext.d.ts +0 -16
- package/lib/esm/src/shared/model/TypedDataContext.d.ts.map +0 -1
- package/lib/esm/src/shared/utils/HexStringUtils.d.ts +0 -4
- package/lib/esm/src/shared/utils/HexStringUtils.d.ts.map +0 -1
- package/lib/esm/src/token/data/HttpTokenDataSource.d.ts +0 -9
- package/lib/esm/src/token/data/HttpTokenDataSource.d.ts.map +0 -1
- package/lib/esm/src/token/data/TokenDataSource.d.ts +0 -9
- package/lib/esm/src/token/data/TokenDataSource.d.ts.map +0 -1
- package/lib/esm/src/token/data/TokenDto.d.ts +0 -6
- package/lib/esm/src/token/data/TokenDto.d.ts.map +0 -1
- package/lib/esm/src/token/di/tokenModuleFactory.d.ts +0 -3
- package/lib/esm/src/token/di/tokenModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/token/di/tokenTypes.d.ts +0 -5
- package/lib/esm/src/token/di/tokenTypes.d.ts.map +0 -1
- package/lib/esm/src/token/domain/TokenContextLoader.d.ts +0 -15
- package/lib/esm/src/token/domain/TokenContextLoader.d.ts.map +0 -1
- package/lib/esm/src/typed-data/data/FiltersDto.d.ts +0 -55
- package/lib/esm/src/typed-data/data/FiltersDto.d.ts.map +0 -1
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -14
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
- package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts +0 -17
- package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -1
- package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts +0 -3
- package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/typed-data/di/typedDataTypes.d.ts +0 -5
- package/lib/esm/src/typed-data/di/typedDataTypes.d.ts.map +0 -1
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -13
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +0 -1
- package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -6
- package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -1
- package/lib/esm/tsconfig.esm.tsbuildinfo +0 -1
- /package/lib/{cjs → types}/index.d.ts +0 -0
- /package/lib/{cjs → types}/index.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/config/di/configTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/config/di/configTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts +0 -0
- /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts +0 -0
- /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -0
package/lib/esm/package.json
CHANGED
|
@@ -1,63 +1,57 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"types": "./lib/esm/index.d.ts"
|
|
11
|
-
},
|
|
12
|
-
"./*.js": {
|
|
13
|
-
"import": "./lib/esm/*.js",
|
|
14
|
-
"require": "./lib/cjs/*.js",
|
|
15
|
-
"default": "./*.js",
|
|
16
|
-
"types": "./lib/esm/*.d.ts"
|
|
17
|
-
},
|
|
18
|
-
"./*": {
|
|
19
|
-
"import": "./lib/esm/*",
|
|
20
|
-
"require": "./lib/cjs/*",
|
|
21
|
-
"default": "./*",
|
|
22
|
-
"types": "./lib/esm/*"
|
|
23
|
-
}
|
|
2
|
+
"name": "@ledgerhq/context-module",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"exports": {
|
|
6
|
+
".": {
|
|
7
|
+
"types": "./lib/types/index.d.ts",
|
|
8
|
+
"import": "./lib/esm/index.js",
|
|
9
|
+
"require": "./lib/cjs/index.js"
|
|
24
10
|
},
|
|
25
|
-
"
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"build": "rimraf lib && zx scripts/build.mjs",
|
|
30
|
-
"dev": "concurrently \"pnpm dev:esm\" \"pnpm dev:cjs\"",
|
|
31
|
-
"dev:esm": "concurrently \"tsc --watch -p tsconfig.esm.json\" \"tsc-alias --watch -p tsconfig.esm.json\"",
|
|
32
|
-
"dev:cjs": "concurrently \"tsc --watch -p tsconfig.cjs.json\" \"tsc-alias --watch -p tsconfig.cjs.json\"",
|
|
33
|
-
"lint": "eslint",
|
|
34
|
-
"lint:fix": "pnpm lint --fix",
|
|
35
|
-
"postpack": "find . -name '*.tgz' -exec cp {} ../../../dist/ \\; ",
|
|
36
|
-
"prettier": "prettier . --check",
|
|
37
|
-
"prettier:fix": "prettier . --write",
|
|
38
|
-
"test": "jest",
|
|
39
|
-
"test:watch": "pnpm test -- --watch",
|
|
40
|
-
"test:coverage": "pnpm test -- --coverage",
|
|
41
|
-
"typecheck": "tsc --noEmit"
|
|
42
|
-
},
|
|
43
|
-
"devDependencies": {
|
|
44
|
-
"@ledgerhq/device-management-kit": "workspace:*",
|
|
45
|
-
"@ledgerhq/eslint-config-dsdk": "workspace:*",
|
|
46
|
-
"@ledgerhq/jest-config-dsdk": "workspace:*",
|
|
47
|
-
"@ledgerhq/prettier-config-dsdk": "workspace:*",
|
|
48
|
-
"@ledgerhq/tsconfig-dsdk": "workspace:*",
|
|
49
|
-
"@types/crypto-js": "^4.2.2",
|
|
50
|
-
"ts-node": "^10.9.2"
|
|
51
|
-
},
|
|
52
|
-
"dependencies": {
|
|
53
|
-
"axios": "^1.7.7",
|
|
54
|
-
"crypto-js": "^4.2.0",
|
|
55
|
-
"ethers": "^6.13.2",
|
|
56
|
-
"inversify": "^6.0.2",
|
|
57
|
-
"purify-ts": "^2.1.0",
|
|
58
|
-
"reflect-metadata": "^0.2.2"
|
|
59
|
-
},
|
|
60
|
-
"peerDependencies": {
|
|
61
|
-
"@ledgerhq/device-management-kit": "workspace:*"
|
|
11
|
+
"./*": {
|
|
12
|
+
"types": "./lib/types/*",
|
|
13
|
+
"import": "./lib/esm/*",
|
|
14
|
+
"require": "./lib/cjs/*"
|
|
62
15
|
}
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"./lib"
|
|
19
|
+
],
|
|
20
|
+
"scripts": {
|
|
21
|
+
"prebuild": "rimraf lib",
|
|
22
|
+
"build": "pnpm lmdk-build --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
23
|
+
"dev": "concurrently \"pnpm watch:builds\" \"pnpm watch:types\"",
|
|
24
|
+
"watch:builds": "pnpm lmdk-watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
25
|
+
"watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\"",
|
|
26
|
+
"lint": "eslint",
|
|
27
|
+
"lint:fix": "pnpm lint --fix",
|
|
28
|
+
"postpack": "find . -name '*.tgz' -exec cp {} ../../../dist/ \\; ",
|
|
29
|
+
"prettier": "prettier . --check",
|
|
30
|
+
"prettier:fix": "prettier . --write",
|
|
31
|
+
"test": "jest",
|
|
32
|
+
"test:watch": "pnpm test -- --watch",
|
|
33
|
+
"test:coverage": "pnpm test -- --coverage",
|
|
34
|
+
"typecheck": "tsc --noEmit"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@ledgerhq/device-management-kit": "workspace:*",
|
|
38
|
+
"@ledgerhq/esbuild-tools": "workspace:*",
|
|
39
|
+
"@ledgerhq/eslint-config-dsdk": "workspace:*",
|
|
40
|
+
"@ledgerhq/jest-config-dsdk": "workspace:*",
|
|
41
|
+
"@ledgerhq/prettier-config-dsdk": "workspace:*",
|
|
42
|
+
"@ledgerhq/tsconfig-dsdk": "workspace:*",
|
|
43
|
+
"@types/crypto-js": "^4.2.2",
|
|
44
|
+
"ts-node": "^10.9.2"
|
|
45
|
+
},
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"axios": "^1.7.9",
|
|
48
|
+
"crypto-js": "^4.2.0",
|
|
49
|
+
"ethers": "6.13.4",
|
|
50
|
+
"inversify": "^6.1.6",
|
|
51
|
+
"purify-ts": "^2.1.0",
|
|
52
|
+
"reflect-metadata": "^0.2.2"
|
|
53
|
+
},
|
|
54
|
+
"peerDependencies": {
|
|
55
|
+
"@ledgerhq/device-management-kit": "^0.5.1"
|
|
56
|
+
}
|
|
63
57
|
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=ContextModule.js.map
|
|
1
|
+
//# sourceMappingURL=ContextModule.js.map
|
|
@@ -1,83 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { nftTypes } from "./nft/di/nftTypes";
|
|
4
|
-
import { tokenTypes } from "./token/di/tokenTypes";
|
|
5
|
-
import { typedDataTypes } from "./typed-data/di/typedDataTypes";
|
|
6
|
-
import { DefaultContextModule } from "./DefaultContextModule";
|
|
7
|
-
import { makeContainer } from "./di";
|
|
8
|
-
const DEFAULT_CAL_URL = "https://crypto-assets-service.api.ledger.com/v1";
|
|
9
|
-
export const DEFAULT_CONFIG = {
|
|
10
|
-
cal: {
|
|
11
|
-
url: DEFAULT_CAL_URL,
|
|
12
|
-
mode: "prod",
|
|
13
|
-
branch: "main",
|
|
14
|
-
},
|
|
15
|
-
};
|
|
16
|
-
export class ContextModuleBuilder {
|
|
17
|
-
config = {};
|
|
18
|
-
customLoaders = [];
|
|
19
|
-
defaultLoaders = [];
|
|
20
|
-
customTypedDataLoader;
|
|
21
|
-
constructor() { }
|
|
22
|
-
/**
|
|
23
|
-
* Remove default loaders from the list of loaders
|
|
24
|
-
*
|
|
25
|
-
* @returns this
|
|
26
|
-
*/
|
|
27
|
-
withoutDefaultLoaders() {
|
|
28
|
-
this.defaultLoaders = [];
|
|
29
|
-
return this;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Add a custom loader to the list of loaders
|
|
33
|
-
*
|
|
34
|
-
* @param loader loader to add to the list of loaders
|
|
35
|
-
* @returns this
|
|
36
|
-
*/
|
|
37
|
-
addLoader(loader) {
|
|
38
|
-
this.customLoaders.push(loader);
|
|
39
|
-
return this;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Replace the default loader for typed data clear signing contexts
|
|
43
|
-
*
|
|
44
|
-
* @returns this
|
|
45
|
-
*/
|
|
46
|
-
withTypedDataLoader(loader) {
|
|
47
|
-
this.customTypedDataLoader = loader;
|
|
48
|
-
return this;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* Set the configuration for the context module
|
|
52
|
-
*
|
|
53
|
-
* @param config configuration for the context module
|
|
54
|
-
* @returns this
|
|
55
|
-
*/
|
|
56
|
-
withConfig(config) {
|
|
57
|
-
this.config = config;
|
|
58
|
-
return this;
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Build the context module
|
|
62
|
-
*
|
|
63
|
-
* @returns the context module
|
|
64
|
-
*/
|
|
65
|
-
build() {
|
|
66
|
-
const container = makeContainer({
|
|
67
|
-
config: { ...DEFAULT_CONFIG, ...this.config },
|
|
68
|
-
});
|
|
69
|
-
this.defaultLoaders = [
|
|
70
|
-
container.get(externalPluginTypes.ExternalPluginContextLoader),
|
|
71
|
-
container.get(forwardDomainTypes.ForwardDomainContextLoader),
|
|
72
|
-
container.get(nftTypes.NftContextLoader),
|
|
73
|
-
container.get(tokenTypes.TokenContextLoader),
|
|
74
|
-
];
|
|
75
|
-
const defaultTypedDataLoader = container.get(typedDataTypes.TypedDataContextLoader);
|
|
76
|
-
const loaders = [...this.defaultLoaders, ...this.customLoaders];
|
|
77
|
-
return new DefaultContextModule({
|
|
78
|
-
loaders,
|
|
79
|
-
typedDataLoader: this.customTypedDataLoader ?? defaultTypedDataLoader,
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=ContextModuleBuilder.js.map
|
|
1
|
+
import{DefaultContextModule as e}from"./DefaultContextModule";const r="https://crypto-assets-service.api.ledger.com/v1",o={cal:{url:r,mode:"prod",branch:"main"},defaultLoaders:!0,customLoaders:[],customTypedDataLoader:void 0};class n{config=o;constructor(){}removeDefaultLoaders(){return this.config.defaultLoaders=!1,this}addLoader(t){return this.config.customLoaders.push(t),this}addTypedDataLoader(t){return this.config.customTypedDataLoader=t,this}addCalConfig(t){return this.config.cal={...o.cal,...t},this}build(){return new e(this.config)}}export{n as ContextModuleBuilder,o as DEFAULT_CONFIG};
|
|
2
|
+
//# sourceMappingURL=ContextModuleBuilder.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ContextModuleBuilder.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n type ContextModuleCalConfig,\n type ContextModuleConfig,\n} from \"./config/model/ContextModuleConfig\";\nimport { type ContextLoader } from \"./shared/domain/ContextLoader\";\nimport { type TypedDataContextLoader } from \"./typed-data/domain/TypedDataContextLoader\";\nimport { type ContextModule } from \"./ContextModule\";\nimport { DefaultContextModule } from \"./DefaultContextModule\";\n\nconst DEFAULT_CAL_URL = \"https://crypto-assets-service.api.ledger.com/v1\";\n\nexport const DEFAULT_CONFIG: ContextModuleConfig = {\n cal: {\n url: DEFAULT_CAL_URL,\n mode: \"prod\",\n branch: \"main\",\n },\n defaultLoaders: true,\n customLoaders: [],\n customTypedDataLoader: undefined,\n};\n\nexport class ContextModuleBuilder {\n private config: ContextModuleConfig = DEFAULT_CONFIG;\n\n constructor() {}\n\n /**\n * Remove default loaders from the list of loaders\n *\n * @returns this\n */\n removeDefaultLoaders() {\n this.config.defaultLoaders = false;\n return this;\n }\n\n /**\n * Add a custom loader to the list of loaders\n *\n * @param loader loader to add to the list of loaders\n * @returns this\n */\n addLoader(loader: ContextLoader) {\n this.config.customLoaders.push(loader);\n return this;\n }\n\n /**\n * Replace the default loader for typed data clear signing contexts\n *\n * @param loader loader to use for typed data clear signing contexts\n * @returns this\n */\n addTypedDataLoader(loader: TypedDataContextLoader) {\n this.config.customTypedDataLoader = loader;\n return this;\n }\n\n /**\n * Add a custom CAL configuration\n *\n * @param calConfig\n * @returns this\n */\n addCalConfig(calConfig: ContextModuleCalConfig) {\n this.config.cal = { ...DEFAULT_CONFIG.cal, ...calConfig };\n return this;\n }\n\n /**\n * Build the context module\n *\n * @returns the context module\n */\n build(): ContextModule {\n return new DefaultContextModule(this.config);\n }\n}\n"],
|
|
5
|
+
"mappings": "AAOA,OAAS,wBAAAA,MAA4B,yBAErC,MAAMC,EAAkB,kDAEXC,EAAsC,CACjD,IAAK,CACH,IAAKD,EACL,KAAM,OACN,OAAQ,MACV,EACA,eAAgB,GAChB,cAAe,CAAC,EAChB,sBAAuB,MACzB,EAEO,MAAME,CAAqB,CACxB,OAA8BD,EAEtC,aAAc,CAAC,CAOf,sBAAuB,CACrB,YAAK,OAAO,eAAiB,GACtB,IACT,CAQA,UAAUE,EAAuB,CAC/B,YAAK,OAAO,cAAc,KAAKA,CAAM,EAC9B,IACT,CAQA,mBAAmBA,EAAgC,CACjD,YAAK,OAAO,sBAAwBA,EAC7B,IACT,CAQA,aAAaC,EAAmC,CAC9C,YAAK,OAAO,IAAM,CAAE,GAAGH,EAAe,IAAK,GAAGG,CAAU,EACjD,IACT,CAOA,OAAuB,CACrB,OAAO,IAAIL,EAAqB,KAAK,MAAM,CAC7C,CACF",
|
|
6
|
+
"names": ["DefaultContextModule", "DEFAULT_CAL_URL", "DEFAULT_CONFIG", "ContextModuleBuilder", "loader", "calConfig"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{ContextModuleBuilder as o}from"./ContextModuleBuilder";import{DefaultContextModule as d}from"./DefaultContextModule";describe("ContextModuleBuilder",()=>{const u={url:"https://crypto-assets-service.api.ledger.com/v1",mode:"prod",branch:"main"};it("should return a default context module",()=>{const e=new o().build();expect(e).toBeInstanceOf(d)}),it("should return a custom context module",()=>{const t=new o,e={load:jest.fn()},n=t.removeDefaultLoaders().addLoader(e).build();expect(n).toBeInstanceOf(d)}),it("should return a custom context module with a custom typed data loader",()=>{const t=new o,e={load:jest.fn()},n=t.removeDefaultLoaders().addTypedDataLoader(e).build();expect(n).toBeInstanceOf(d)}),it("should return a custom context module with a custom config",()=>{const e=new o().addCalConfig(u).build();expect(e).toBeInstanceOf(d)})});
|
|
2
|
+
//# sourceMappingURL=ContextModuleBuilder.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/ContextModuleBuilder.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { type ContextModuleCalConfig } from \"./config/model/ContextModuleConfig\";\nimport { ContextModuleBuilder } from \"./ContextModuleBuilder\";\nimport { DefaultContextModule } from \"./DefaultContextModule\";\n\ndescribe(\"ContextModuleBuilder\", () => {\n const defaultCalConfig: ContextModuleCalConfig = {\n url: \"https://crypto-assets-service.api.ledger.com/v1\",\n mode: \"prod\",\n branch: \"main\",\n };\n it(\"should return a default context module\", () => {\n const contextModuleBuilder = new ContextModuleBuilder();\n\n const res = contextModuleBuilder.build();\n\n expect(res).toBeInstanceOf(DefaultContextModule);\n });\n\n it(\"should return a custom context module\", () => {\n const contextModuleBuilder = new ContextModuleBuilder();\n const customLoader = { load: jest.fn() };\n\n const res = contextModuleBuilder\n .removeDefaultLoaders()\n .addLoader(customLoader)\n .build();\n\n expect(res).toBeInstanceOf(DefaultContextModule);\n });\n\n it(\"should return a custom context module with a custom typed data loader\", () => {\n const contextModuleBuilder = new ContextModuleBuilder();\n const customLoader = { load: jest.fn() };\n\n const res = contextModuleBuilder\n .removeDefaultLoaders()\n .addTypedDataLoader(customLoader)\n .build();\n\n expect(res).toBeInstanceOf(DefaultContextModule);\n });\n\n it(\"should return a custom context module with a custom config\", () => {\n const contextModuleBuilder = new ContextModuleBuilder();\n\n const res = contextModuleBuilder.addCalConfig(defaultCalConfig).build();\n\n expect(res).toBeInstanceOf(DefaultContextModule);\n });\n});\n"],
|
|
5
|
+
"mappings": "AACA,OAAS,wBAAAA,MAA4B,yBACrC,OAAS,wBAAAC,MAA4B,yBAErC,SAAS,uBAAwB,IAAM,CACrC,MAAMC,EAA2C,CAC/C,IAAK,kDACL,KAAM,OACN,OAAQ,MACV,EACA,GAAG,yCAA0C,IAAM,CAGjD,MAAMC,EAFuB,IAAIH,EAAqB,EAErB,MAAM,EAEvC,OAAOG,CAAG,EAAE,eAAeF,CAAoB,CACjD,CAAC,EAED,GAAG,wCAAyC,IAAM,CAChD,MAAMG,EAAuB,IAAIJ,EAC3BK,EAAe,CAAE,KAAM,KAAK,GAAG,CAAE,EAEjCF,EAAMC,EACT,qBAAqB,EACrB,UAAUC,CAAY,EACtB,MAAM,EAET,OAAOF,CAAG,EAAE,eAAeF,CAAoB,CACjD,CAAC,EAED,GAAG,wEAAyE,IAAM,CAChF,MAAMG,EAAuB,IAAIJ,EAC3BK,EAAe,CAAE,KAAM,KAAK,GAAG,CAAE,EAEjCF,EAAMC,EACT,qBAAqB,EACrB,mBAAmBC,CAAY,EAC/B,MAAM,EAET,OAAOF,CAAG,EAAE,eAAeF,CAAoB,CACjD,CAAC,EAED,GAAG,6DAA8D,IAAM,CAGrE,MAAME,EAFuB,IAAIH,EAAqB,EAErB,aAAaE,CAAgB,EAAE,MAAM,EAEtE,OAAOC,CAAG,EAAE,eAAeF,CAAoB,CACjD,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["ContextModuleBuilder", "DefaultContextModule", "defaultCalConfig", "res", "contextModuleBuilder", "customLoader"]
|
|
7
|
+
}
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
_typedDataLoader;
|
|
4
|
-
constructor(args) {
|
|
5
|
-
this._loaders = args.loaders;
|
|
6
|
-
this._typedDataLoader = args.typedDataLoader;
|
|
7
|
-
}
|
|
8
|
-
async getContexts(transaction) {
|
|
9
|
-
const promises = this._loaders.map((fetcher) => fetcher.load(transaction));
|
|
10
|
-
const responses = await Promise.all(promises);
|
|
11
|
-
return responses.flat();
|
|
12
|
-
}
|
|
13
|
-
async getTypedDataFilters(typedData) {
|
|
14
|
-
return this._typedDataLoader.load(typedData);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=DefaultContextModule.js.map
|
|
1
|
+
import{transactionTypes as r}from"./transaction/di/transactionTypes";import{trustedNameTypes as n}from"./trusted-name/di/trustedNameTypes";import{externalPluginTypes as i}from"./external-plugin/di/externalPluginTypes";import{nftTypes as p}from"./nft/di/nftTypes";import{ClearSignContextType as d}from"./shared/model/ClearSignContext";import{tokenTypes as s}from"./token/di/tokenTypes";import{typedDataTypes as m}from"./typed-data/di/typedDataTypes";import{makeContainer as C}from"./di";class g{_container;_loaders;_typedDataLoader;constructor(t){this._container=C({config:t}),this._loaders=t.defaultLoaders?this._getDefaultLoaders():[],this._loaders.push(...t.customLoaders),this._typedDataLoader=t.customTypedDataLoader??this._getDefaultTypedDataLoader()}_getDefaultLoaders(){return[this._container.get(i.ExternalPluginContextLoader),this._container.get(n.TrustedNameContextLoader),this._container.get(p.NftContextLoader),this._container.get(s.TokenContextLoader),this._container.get(r.TransactionContextLoader)]}_getDefaultTypedDataLoader(){return this._container.get(m.TypedDataContextLoader)}async getContexts(t){const o=this._loaders.map(e=>e.load(t));return(await Promise.all(o)).flat()}async getContext(t){const o=this._loaders.filter(e=>e.loadField).map(e=>e.loadField(t));return(await Promise.all(o)).find(e=>e!==null)||{type:d.ERROR,error:new Error(`Field type not supported: ${t.type}`)}}async getTypedDataFilters(t){return this._typedDataLoader.load(t)}}export{g as DefaultContextModule};
|
|
2
|
+
//# sourceMappingURL=DefaultContextModule.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/DefaultContextModule.ts"],
|
|
4
|
+
"sourcesContent": ["import { type Container } from \"inversify\";\n\nimport type { TypedDataClearSignContext } from \"@/shared/model/TypedDataClearSignContext\";\nimport type { TypedDataContext } from \"@/shared/model/TypedDataContext\";\nimport { transactionTypes } from \"@/transaction/di/transactionTypes\";\nimport { trustedNameTypes } from \"@/trusted-name/di/trustedNameTypes\";\n\nimport { type ContextModuleConfig } from \"./config/model/ContextModuleConfig\";\nimport { externalPluginTypes } from \"./external-plugin/di/externalPluginTypes\";\nimport { type ExternalPluginContextLoader } from \"./external-plugin/domain/ExternalPluginContextLoader\";\nimport { nftTypes } from \"./nft/di/nftTypes\";\nimport { type NftContextLoader } from \"./nft/domain/NftContextLoader\";\nimport { type ContextLoader } from \"./shared/domain/ContextLoader\";\nimport {\n type ClearSignContext,\n ClearSignContextType,\n} from \"./shared/model/ClearSignContext\";\nimport {\n type TransactionContext,\n type TransactionFieldContext,\n} from \"./shared/model/TransactionContext\";\nimport { tokenTypes } from \"./token/di/tokenTypes\";\nimport { type TokenContextLoader } from \"./token/domain/TokenContextLoader\";\nimport { type TransactionContextLoader } from \"./transaction/domain/TransactionContextLoader\";\nimport { type TrustedNameContextLoader } from \"./trusted-name/domain/TrustedNameContextLoader\";\nimport { typedDataTypes } from \"./typed-data/di/typedDataTypes\";\nimport type { TypedDataContextLoader } from \"./typed-data/domain/TypedDataContextLoader\";\nimport { type ContextModule } from \"./ContextModule\";\nimport { makeContainer } from \"./di\";\n\nexport class DefaultContextModule implements ContextModule {\n private _container: Container;\n private _loaders: ContextLoader[];\n private _typedDataLoader: TypedDataContextLoader;\n\n constructor(args: ContextModuleConfig) {\n this._container = makeContainer({ config: args });\n this._loaders = args.defaultLoaders ? this._getDefaultLoaders() : [];\n this._loaders.push(...args.customLoaders);\n this._typedDataLoader =\n args.customTypedDataLoader ?? this._getDefaultTypedDataLoader();\n }\n\n private _getDefaultLoaders(): ContextLoader[] {\n return [\n this._container.get<ExternalPluginContextLoader>(\n externalPluginTypes.ExternalPluginContextLoader,\n ),\n this._container.get<TrustedNameContextLoader>(\n trustedNameTypes.TrustedNameContextLoader,\n ),\n this._container.get<NftContextLoader>(nftTypes.NftContextLoader),\n this._container.get<TokenContextLoader>(tokenTypes.TokenContextLoader),\n this._container.get<TransactionContextLoader>(\n transactionTypes.TransactionContextLoader,\n ),\n ];\n }\n\n private _getDefaultTypedDataLoader(): TypedDataContextLoader {\n return this._container.get<TypedDataContextLoader>(\n typedDataTypes.TypedDataContextLoader,\n );\n }\n\n public async getContexts(\n transaction: TransactionContext,\n ): Promise<ClearSignContext[]> {\n const promises = this._loaders.map((fetcher) => fetcher.load(transaction));\n const responses = await Promise.all(promises);\n return responses.flat();\n }\n\n public async getContext(\n field: TransactionFieldContext,\n ): Promise<ClearSignContext> {\n const promises = this._loaders\n .filter((fetcher) => fetcher.loadField)\n .map((fetcher) => fetcher.loadField!(field));\n const responses = await Promise.all(promises);\n return (\n responses.find((resp) => resp !== null) || {\n type: ClearSignContextType.ERROR,\n error: new Error(`Field type not supported: ${field.type}`),\n }\n );\n }\n\n public async getTypedDataFilters(\n typedData: TypedDataContext,\n ): Promise<TypedDataClearSignContext> {\n return this._typedDataLoader.load(typedData);\n }\n}\n"],
|
|
5
|
+
"mappings": "AAIA,OAAS,oBAAAA,MAAwB,oCACjC,OAAS,oBAAAC,MAAwB,qCAGjC,OAAS,uBAAAC,MAA2B,2CAEpC,OAAS,YAAAC,MAAgB,oBAGzB,OAEE,wBAAAC,MACK,kCAKP,OAAS,cAAAC,MAAkB,wBAI3B,OAAS,kBAAAC,MAAsB,iCAG/B,OAAS,iBAAAC,MAAqB,OAEvB,MAAMC,CAA8C,CACjD,WACA,SACA,iBAER,YAAYC,EAA2B,CACrC,KAAK,WAAaF,EAAc,CAAE,OAAQE,CAAK,CAAC,EAChD,KAAK,SAAWA,EAAK,eAAiB,KAAK,mBAAmB,EAAI,CAAC,EACnE,KAAK,SAAS,KAAK,GAAGA,EAAK,aAAa,EACxC,KAAK,iBACHA,EAAK,uBAAyB,KAAK,2BAA2B,CAClE,CAEQ,oBAAsC,CAC5C,MAAO,CACL,KAAK,WAAW,IACdP,EAAoB,2BACtB,EACA,KAAK,WAAW,IACdD,EAAiB,wBACnB,EACA,KAAK,WAAW,IAAsBE,EAAS,gBAAgB,EAC/D,KAAK,WAAW,IAAwBE,EAAW,kBAAkB,EACrE,KAAK,WAAW,IACdL,EAAiB,wBACnB,CACF,CACF,CAEQ,4BAAqD,CAC3D,OAAO,KAAK,WAAW,IACrBM,EAAe,sBACjB,CACF,CAEA,MAAa,YACXI,EAC6B,CAC7B,MAAMC,EAAW,KAAK,SAAS,IAAKC,GAAYA,EAAQ,KAAKF,CAAW,CAAC,EAEzE,OADkB,MAAM,QAAQ,IAAIC,CAAQ,GAC3B,KAAK,CACxB,CAEA,MAAa,WACXE,EAC2B,CAC3B,MAAMF,EAAW,KAAK,SACnB,OAAQC,GAAYA,EAAQ,SAAS,EACrC,IAAKA,GAAYA,EAAQ,UAAWC,CAAK,CAAC,EAE7C,OADkB,MAAM,QAAQ,IAAIF,CAAQ,GAEhC,KAAMG,GAASA,IAAS,IAAI,GAAK,CACzC,KAAMV,EAAqB,MAC3B,MAAO,IAAI,MAAM,6BAA6BS,EAAM,IAAI,EAAE,CAC5D,CAEJ,CAEA,MAAa,oBACXE,EACoC,CACpC,OAAO,KAAK,iBAAiB,KAAKA,CAAS,CAC7C,CACF",
|
|
6
|
+
"names": ["transactionTypes", "trustedNameTypes", "externalPluginTypes", "nftTypes", "ClearSignContextType", "tokenTypes", "typedDataTypes", "makeContainer", "DefaultContextModule", "args", "transaction", "promises", "fetcher", "field", "resp", "typedData"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{DefaultContextModule as a}from"./DefaultContextModule";const l=()=>({load:jest.fn(),loadField:jest.fn()});describe("DefaultContextModule",()=>{const s={load:jest.fn()},o={customLoaders:[],defaultLoaders:!1,customTypedDataLoader:s,cal:{url:"https://crypto-assets-service.api.ledger.com/v1",mode:"prod",branch:"main"}};beforeEach(()=>{jest.restoreAllMocks()}),it("should initialize the context module with all the default loaders",async()=>{const t=await new a(o).getContexts({});expect(t).toEqual([])}),it("should return an empty array when no loaders",async()=>{const t=await new a(o).getContexts({});expect(t).toEqual([])}),it("should call all fetch method from metadata fetcher",async()=>{const e=l();await new a({...o,customLoaders:[e,e]}).getContexts({}),expect(e.load).toHaveBeenCalledTimes(2)}),it("should return an array of context response",async()=>{const e=l(),t=[[{type:"provideERC20Info",payload:"payload1"}],[{type:"provideERC20Info",payload:"payload2"},{type:"plugin",payload:"payload3"}]];jest.spyOn(e,"load").mockResolvedValueOnce(t[0]).mockResolvedValueOnce(t[1]);const n=await new a({...o,customLoaders:[e,e]}).getContexts({});expect(e.load).toHaveBeenCalledTimes(2),expect(n).toEqual(t.flat())}),it("should call the typed data loader",async()=>{await new a({...o,customTypedDataLoader:s}).getTypedDataFilters({}),expect(s.load).toHaveBeenCalledTimes(1)}),it("should return a single context",async()=>{const e=l(),t=[null,{type:"token",payload:"payload"}];jest.spyOn(e,"loadField").mockResolvedValueOnce(t[0]).mockResolvedValueOnce(t[1]);const n=await new a({...o,customLoaders:[e,{load:jest.fn()},e]}).getContext({type:"token"});expect(e.loadField).toHaveBeenCalledTimes(2),expect(n).toEqual({type:"token",payload:"payload"})}),it("context field not supported",async()=>{const e=l(),t=[null,null];jest.spyOn(e,"loadField").mockResolvedValueOnce(t[0]).mockResolvedValueOnce(t[1]);const n=await new a({...o,customLoaders:[e,{load:jest.fn()},e]}).getContext({type:"token"});expect(e.loadField).toHaveBeenCalledTimes(2),expect(n).toEqual({type:"error",error:new Error("Field type not supported: token")})}),it("getField not implemented",async()=>{const t=await new a({...o,customLoaders:[{load:jest.fn()}]}).getContext({type:"token"});expect(t).toEqual({type:"error",error:new Error("Field type not supported: token")})})});
|
|
2
|
+
//# sourceMappingURL=DefaultContextModule.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/DefaultContextModule.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { type ContextModuleConfig } from \"./config/model/ContextModuleConfig\";\nimport {\n type TransactionContext,\n type TransactionFieldContext,\n} from \"./shared/model/TransactionContext\";\nimport { type TypedDataContext } from \"./shared/model/TypedDataContext\";\nimport type { TypedDataContextLoader } from \"./typed-data/domain/TypedDataContextLoader\";\nimport { DefaultContextModule } from \"./DefaultContextModule\";\n\nconst contextLoaderStubBuilder = () => {\n return { load: jest.fn(), loadField: jest.fn() };\n};\n\ndescribe(\"DefaultContextModule\", () => {\n const typedDataLoader: TypedDataContextLoader = { load: jest.fn() };\n const defaultContextModuleConfig: ContextModuleConfig = {\n customLoaders: [],\n defaultLoaders: false,\n customTypedDataLoader: typedDataLoader,\n cal: {\n url: \"https://crypto-assets-service.api.ledger.com/v1\",\n mode: \"prod\",\n branch: \"main\",\n },\n };\n\n beforeEach(() => {\n jest.restoreAllMocks();\n });\n\n it(\"should initialize the context module with all the default loaders\", async () => {\n const contextModule = new DefaultContextModule(defaultContextModuleConfig);\n\n const res = await contextModule.getContexts({} as TransactionContext);\n\n expect(res).toEqual([]);\n });\n\n it(\"should return an empty array when no loaders\", async () => {\n const contextModule = new DefaultContextModule(defaultContextModuleConfig);\n\n const res = await contextModule.getContexts({} as TransactionContext);\n\n expect(res).toEqual([]);\n });\n\n it(\"should call all fetch method from metadata fetcher\", async () => {\n const loader = contextLoaderStubBuilder();\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customLoaders: [loader, loader],\n });\n\n await contextModule.getContexts({} as TransactionContext);\n\n expect(loader.load).toHaveBeenCalledTimes(2);\n });\n\n it(\"should return an array of context response\", async () => {\n const loader = contextLoaderStubBuilder();\n const responses = [\n [{ type: \"provideERC20Info\", payload: \"payload1\" }],\n [\n { type: \"provideERC20Info\", payload: \"payload2\" },\n { type: \"plugin\", payload: \"payload3\" },\n ],\n ];\n jest\n .spyOn(loader, \"load\")\n .mockResolvedValueOnce(responses[0])\n .mockResolvedValueOnce(responses[1]);\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customLoaders: [loader, loader],\n });\n\n const res = await contextModule.getContexts({} as TransactionContext);\n\n expect(loader.load).toHaveBeenCalledTimes(2);\n expect(res).toEqual(responses.flat());\n });\n\n it(\"should call the typed data loader\", async () => {\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customTypedDataLoader: typedDataLoader,\n });\n\n await contextModule.getTypedDataFilters({} as TypedDataContext);\n\n expect(typedDataLoader.load).toHaveBeenCalledTimes(1);\n });\n\n it(\"should return a single context\", async () => {\n const loader = contextLoaderStubBuilder();\n const responses = [null, { type: \"token\", payload: \"payload\" }];\n jest\n .spyOn(loader, \"loadField\")\n .mockResolvedValueOnce(responses[0])\n .mockResolvedValueOnce(responses[1]);\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customLoaders: [loader, { load: jest.fn() }, loader],\n });\n\n const res = await contextModule.getContext({\n type: \"token\",\n } as TransactionFieldContext);\n\n expect(loader.loadField).toHaveBeenCalledTimes(2);\n expect(res).toEqual({ type: \"token\", payload: \"payload\" });\n });\n\n it(\"context field not supported\", async () => {\n const loader = contextLoaderStubBuilder();\n const responses = [null, null];\n jest\n .spyOn(loader, \"loadField\")\n .mockResolvedValueOnce(responses[0])\n .mockResolvedValueOnce(responses[1]);\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customLoaders: [loader, { load: jest.fn() }, loader],\n });\n\n const res = await contextModule.getContext({\n type: \"token\",\n } as TransactionFieldContext);\n\n expect(loader.loadField).toHaveBeenCalledTimes(2);\n expect(res).toEqual({\n type: \"error\",\n error: new Error(\"Field type not supported: token\"),\n });\n });\n\n it(\"getField not implemented\", async () => {\n const contextModule = new DefaultContextModule({\n ...defaultContextModuleConfig,\n customLoaders: [{ load: jest.fn() }],\n });\n\n const res = await contextModule.getContext({\n type: \"token\",\n } as TransactionFieldContext);\n\n expect(res).toEqual({\n type: \"error\",\n error: new Error(\"Field type not supported: token\"),\n });\n });\n});\n"],
|
|
5
|
+
"mappings": "AAOA,OAAS,wBAAAA,MAA4B,yBAErC,MAAMC,EAA2B,KACxB,CAAE,KAAM,KAAK,GAAG,EAAG,UAAW,KAAK,GAAG,CAAE,GAGjD,SAAS,uBAAwB,IAAM,CACrC,MAAMC,EAA0C,CAAE,KAAM,KAAK,GAAG,CAAE,EAC5DC,EAAkD,CACtD,cAAe,CAAC,EAChB,eAAgB,GAChB,sBAAuBD,EACvB,IAAK,CACH,IAAK,kDACL,KAAM,OACN,OAAQ,MACV,CACF,EAEA,WAAW,IAAM,CACf,KAAK,gBAAgB,CACvB,CAAC,EAED,GAAG,oEAAqE,SAAY,CAGlF,MAAME,EAAM,MAFU,IAAIJ,EAAqBG,CAA0B,EAEzC,YAAY,CAAC,CAAuB,EAEpE,OAAOC,CAAG,EAAE,QAAQ,CAAC,CAAC,CACxB,CAAC,EAED,GAAG,+CAAgD,SAAY,CAG7D,MAAMA,EAAM,MAFU,IAAIJ,EAAqBG,CAA0B,EAEzC,YAAY,CAAC,CAAuB,EAEpE,OAAOC,CAAG,EAAE,QAAQ,CAAC,CAAC,CACxB,CAAC,EAED,GAAG,qDAAsD,SAAY,CACnE,MAAMC,EAASJ,EAAyB,EAMxC,MALsB,IAAID,EAAqB,CAC7C,GAAGG,EACH,cAAe,CAACE,EAAQA,CAAM,CAChC,CAAC,EAEmB,YAAY,CAAC,CAAuB,EAExD,OAAOA,EAAO,IAAI,EAAE,sBAAsB,CAAC,CAC7C,CAAC,EAED,GAAG,6CAA8C,SAAY,CAC3D,MAAMA,EAASJ,EAAyB,EAClCK,EAAY,CAChB,CAAC,CAAE,KAAM,mBAAoB,QAAS,UAAW,CAAC,EAClD,CACE,CAAE,KAAM,mBAAoB,QAAS,UAAW,EAChD,CAAE,KAAM,SAAU,QAAS,UAAW,CACxC,CACF,EACA,KACG,MAAMD,EAAQ,MAAM,EACpB,sBAAsBC,EAAU,CAAC,CAAC,EAClC,sBAAsBA,EAAU,CAAC,CAAC,EAMrC,MAAMF,EAAM,MALU,IAAIJ,EAAqB,CAC7C,GAAGG,EACH,cAAe,CAACE,EAAQA,CAAM,CAChC,CAAC,EAE+B,YAAY,CAAC,CAAuB,EAEpE,OAAOA,EAAO,IAAI,EAAE,sBAAsB,CAAC,EAC3C,OAAOD,CAAG,EAAE,QAAQE,EAAU,KAAK,CAAC,CACtC,CAAC,EAED,GAAG,oCAAqC,SAAY,CAMlD,MALsB,IAAIN,EAAqB,CAC7C,GAAGG,EACH,sBAAuBD,CACzB,CAAC,EAEmB,oBAAoB,CAAC,CAAqB,EAE9D,OAAOA,EAAgB,IAAI,EAAE,sBAAsB,CAAC,CACtD,CAAC,EAED,GAAG,iCAAkC,SAAY,CAC/C,MAAMG,EAASJ,EAAyB,EAClCK,EAAY,CAAC,KAAM,CAAE,KAAM,QAAS,QAAS,SAAU,CAAC,EAC9D,KACG,MAAMD,EAAQ,WAAW,EACzB,sBAAsBC,EAAU,CAAC,CAAC,EAClC,sBAAsBA,EAAU,CAAC,CAAC,EAMrC,MAAMF,EAAM,MALU,IAAIJ,EAAqB,CAC7C,GAAGG,EACH,cAAe,CAACE,EAAQ,CAAE,KAAM,KAAK,GAAG,CAAE,EAAGA,CAAM,CACrD,CAAC,EAE+B,WAAW,CACzC,KAAM,OACR,CAA4B,EAE5B,OAAOA,EAAO,SAAS,EAAE,sBAAsB,CAAC,EAChD,OAAOD,CAAG,EAAE,QAAQ,CAAE,KAAM,QAAS,QAAS,SAAU,CAAC,CAC3D,CAAC,EAED,GAAG,8BAA+B,SAAY,CAC5C,MAAMC,EAASJ,EAAyB,EAClCK,EAAY,CAAC,KAAM,IAAI,EAC7B,KACG,MAAMD,EAAQ,WAAW,EACzB,sBAAsBC,EAAU,CAAC,CAAC,EAClC,sBAAsBA,EAAU,CAAC,CAAC,EAMrC,MAAMF,EAAM,MALU,IAAIJ,EAAqB,CAC7C,GAAGG,EACH,cAAe,CAACE,EAAQ,CAAE,KAAM,KAAK,GAAG,CAAE,EAAGA,CAAM,CACrD,CAAC,EAE+B,WAAW,CACzC,KAAM,OACR,CAA4B,EAE5B,OAAOA,EAAO,SAAS,EAAE,sBAAsB,CAAC,EAChD,OAAOD,CAAG,EAAE,QAAQ,CAClB,KAAM,QACN,MAAO,IAAI,MAAM,iCAAiC,CACpD,CAAC,CACH,CAAC,EAED,GAAG,2BAA4B,SAAY,CAMzC,MAAMA,EAAM,MALU,IAAIJ,EAAqB,CAC7C,GAAGG,EACH,cAAe,CAAC,CAAE,KAAM,KAAK,GAAG,CAAE,CAAC,CACrC,CAAC,EAE+B,WAAW,CACzC,KAAM,OACR,CAA4B,EAE5B,OAAOC,CAAG,EAAE,QAAQ,CAClB,KAAM,QACN,MAAO,IAAI,MAAM,iCAAiC,CACpD,CAAC,CACH,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["DefaultContextModule", "contextLoaderStubBuilder", "typedDataLoader", "defaultContextModuleConfig", "res", "loader", "responses"]
|
|
7
|
+
}
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export const configModuleFactory = (config) => new ContainerModule((bind, _unbind, _isBound, _rebind) => {
|
|
4
|
-
bind(configTypes.Config).toConstantValue(config);
|
|
5
|
-
});
|
|
6
|
-
//# sourceMappingURL=configModuleFactory.js.map
|
|
1
|
+
import{ContainerModule as t}from"inversify";import{configTypes as e}from"./configTypes";const u=o=>new t((n,i,r,f)=>{n(e.Config).toConstantValue(o)});export{u as configModuleFactory};
|
|
2
|
+
//# sourceMappingURL=configModuleFactory.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/config/di/configModuleFactory.ts"],
|
|
4
|
+
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\n\nimport { configTypes } from \"./configTypes\";\n\nexport const configModuleFactory = (config: ContextModuleConfig) =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind<ContextModuleConfig>(configTypes.Config).toConstantValue(config);\n });\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAIhC,OAAS,eAAAC,MAAmB,gBAErB,MAAMC,EAAuBC,GAClC,IAAIH,EAAgB,CAACI,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAA0BH,EAAY,MAAM,EAAE,gBAAgBE,CAAM,CACtE,CAAC",
|
|
6
|
+
"names": ["ContainerModule", "configTypes", "configModuleFactory", "config", "bind", "_unbind", "_isBound", "_rebind"]
|
|
7
|
+
}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/config/di/configTypes.ts"],
|
|
4
|
+
"sourcesContent": ["export const configTypes = {\n Config: Symbol.for(\"config\"),\n};\n"],
|
|
5
|
+
"mappings": "AAAO,MAAMA,EAAc,CACzB,OAAQ,OAAO,IAAI,QAAQ,CAC7B",
|
|
6
|
+
"names": ["configTypes"]
|
|
7
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=ContextModuleConfig.js.map
|
|
1
|
+
//# sourceMappingURL=ContextModuleConfig.js.map
|
package/lib/esm/src/di.js
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { externalPluginModuleFactory } from "./external-plugin/di/externalPluginModuleFactory";
|
|
4
|
-
import { forwardDomainModuleFactory } from "./forward-domain/di/forwardDomainModuleFactory";
|
|
5
|
-
import { nftModuleFactory } from "./nft/di/nftModuleFactory";
|
|
6
|
-
import { tokenModuleFactory } from "./token/di/tokenModuleFactory";
|
|
7
|
-
import { typedDataModuleFactory } from "./typed-data/di/typedDataModuleFactory";
|
|
8
|
-
export const makeContainer = ({ config }) => {
|
|
9
|
-
const container = new Container();
|
|
10
|
-
container.load(configModuleFactory(config), externalPluginModuleFactory(), forwardDomainModuleFactory(), nftModuleFactory(), tokenModuleFactory(), typedDataModuleFactory());
|
|
11
|
-
return container;
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=di.js.map
|
|
1
|
+
import{Container as r}from"inversify";import{configModuleFactory as e}from"./config/di/configModuleFactory";import{externalPluginModuleFactory as n}from"./external-plugin/di/externalPluginModuleFactory";import{nftModuleFactory as a}from"./nft/di/nftModuleFactory";import{tokenModuleFactory as i}from"./token/di/tokenModuleFactory";import{transactionModuleFactory as m}from"./transaction/di/transactionModuleFactory";import{trustedNameModuleFactory as f}from"./trusted-name/di/trustedNameModuleFactory";import{typedDataModuleFactory as c}from"./typed-data/di/typedDataModuleFactory";const F=({config:t})=>{const o=new r;return o.load(e(t),n(),a(),i(),m(),f(),c()),o};export{F as makeContainer};
|
|
2
|
+
//# sourceMappingURL=di.js.map
|
package/lib/esm/src/di.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/di.ts"],
|
|
4
|
+
"sourcesContent": ["import { Container } from \"inversify\";\n\nimport { configModuleFactory } from \"@/config/di/configModuleFactory\";\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { externalPluginModuleFactory } from \"@/external-plugin/di/externalPluginModuleFactory\";\nimport { nftModuleFactory } from \"@/nft/di/nftModuleFactory\";\nimport { tokenModuleFactory } from \"@/token/di/tokenModuleFactory\";\nimport { transactionModuleFactory } from \"@/transaction/di/transactionModuleFactory\";\nimport { trustedNameModuleFactory } from \"@/trusted-name/di/trustedNameModuleFactory\";\nimport { typedDataModuleFactory } from \"@/typed-data/di/typedDataModuleFactory\";\n\ntype MakeContainerArgs = {\n config: ContextModuleConfig;\n};\n\nexport const makeContainer = ({ config }: MakeContainerArgs) => {\n const container = new Container();\n\n container.load(\n configModuleFactory(config),\n externalPluginModuleFactory(),\n nftModuleFactory(),\n tokenModuleFactory(),\n transactionModuleFactory(),\n trustedNameModuleFactory(),\n typedDataModuleFactory(),\n );\n\n return container;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,aAAAA,MAAiB,YAE1B,OAAS,uBAAAC,MAA2B,kCAEpC,OAAS,+BAAAC,MAAmC,mDAC5C,OAAS,oBAAAC,MAAwB,4BACjC,OAAS,sBAAAC,MAA0B,gCACnC,OAAS,4BAAAC,MAAgC,4CACzC,OAAS,4BAAAC,MAAgC,6CACzC,OAAS,0BAAAC,MAA8B,yCAMhC,MAAMC,EAAgB,CAAC,CAAE,OAAAC,CAAO,IAAyB,CAC9D,MAAMC,EAAY,IAAIV,EAEtB,OAAAU,EAAU,KACRT,EAAoBQ,CAAM,EAC1BP,EAA4B,EAC5BC,EAAiB,EACjBC,EAAmB,EACnBC,EAAyB,EACzBC,EAAyB,EACzBC,EAAuB,CACzB,EAEOG,CACT",
|
|
6
|
+
"names": ["Container", "configModuleFactory", "externalPluginModuleFactory", "nftModuleFactory", "tokenModuleFactory", "transactionModuleFactory", "trustedNameModuleFactory", "typedDataModuleFactory", "makeContainer", "config", "container"]
|
|
7
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=DAppDto.js.map
|
|
1
|
+
//# sourceMappingURL=DAppDto.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=ExternalPluginDataSource.js.map
|
|
1
|
+
//# sourceMappingURL=ExternalPluginDataSource.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,77 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
-
};
|
|
13
|
-
import axios from "axios";
|
|
14
|
-
import { inject, injectable } from "inversify";
|
|
15
|
-
import { Left, Right } from "purify-ts";
|
|
16
|
-
import { configTypes } from "../../config/di/configTypes";
|
|
17
|
-
import PACKAGE from "../../../package.json";
|
|
18
|
-
let HttpExternalPluginDataSource = class HttpExternalPluginDataSource {
|
|
19
|
-
config;
|
|
20
|
-
constructor(config) {
|
|
21
|
-
this.config = config;
|
|
22
|
-
}
|
|
23
|
-
async getDappInfos({ chainId, address, selector, }) {
|
|
24
|
-
try {
|
|
25
|
-
const dappInfos = await axios.request({
|
|
26
|
-
method: "GET",
|
|
27
|
-
url: `${this.config.cal.url}/dapps`,
|
|
28
|
-
params: {
|
|
29
|
-
output: "b2c,b2c_signatures,abis",
|
|
30
|
-
chain_id: chainId,
|
|
31
|
-
contracts: address,
|
|
32
|
-
},
|
|
33
|
-
headers: {
|
|
34
|
-
"X-Ledger-Client-Version": `context-module/${PACKAGE.version}`,
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
if (!dappInfos.data[0]) {
|
|
38
|
-
return Right(undefined);
|
|
39
|
-
}
|
|
40
|
-
// Normalize the address and selector
|
|
41
|
-
address = address.toLowerCase();
|
|
42
|
-
selector = `0x${selector.slice(2).toLowerCase()}`;
|
|
43
|
-
const { erc20OfInterest, method, plugin } = dappInfos.data[0].b2c?.contracts?.find((c) => c.address === address)
|
|
44
|
-
?.selectors?.[selector] || {};
|
|
45
|
-
const { signature, serialized_data: serializedData } = dappInfos.data[0].b2c_signatures?.[address]?.[selector] || {};
|
|
46
|
-
if (!erc20OfInterest ||
|
|
47
|
-
!method ||
|
|
48
|
-
!plugin ||
|
|
49
|
-
!signature ||
|
|
50
|
-
!serializedData) {
|
|
51
|
-
return Right(undefined);
|
|
52
|
-
}
|
|
53
|
-
const abi = dappInfos.data[0].abis?.[address];
|
|
54
|
-
if (!abi) {
|
|
55
|
-
return Right(undefined);
|
|
56
|
-
}
|
|
57
|
-
const selectorDetails = {
|
|
58
|
-
method,
|
|
59
|
-
plugin,
|
|
60
|
-
erc20OfInterest,
|
|
61
|
-
signature,
|
|
62
|
-
serializedData,
|
|
63
|
-
};
|
|
64
|
-
return Right({ selectorDetails, abi });
|
|
65
|
-
}
|
|
66
|
-
catch (_error) {
|
|
67
|
-
return Left(new Error("[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos"));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
HttpExternalPluginDataSource = __decorate([
|
|
72
|
-
injectable(),
|
|
73
|
-
__param(0, inject(configTypes.Config)),
|
|
74
|
-
__metadata("design:paramtypes", [Object])
|
|
75
|
-
], HttpExternalPluginDataSource);
|
|
76
|
-
export { HttpExternalPluginDataSource };
|
|
77
|
-
//# sourceMappingURL=HttpExternalPluginDataSource.js.map
|
|
1
|
+
var D=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var u=(a,r,o,e)=>{for(var t=e>1?void 0:e?C(r,o):r,i=a.length-1,n;i>=0;i--)(n=a[i])&&(t=(e?n(r,o,t):n(t))||t);return e&&t&&D(r,o,t),t},d=(a,r)=>(o,e)=>r(o,e,a);import h from"axios";import{inject as b,injectable as x}from"inversify";import{Left as E,Right as s}from"purify-ts";import{configTypes as I}from"../../config/di/configTypes";import y from"../../../package.json";let f=class{constructor(r){this.config=r}async getDappInfos({chainId:r,address:o,selector:e}){try{const t=await h.request({method:"GET",url:`${this.config.cal.url}/dapps`,params:{output:"b2c,b2c_signatures,abis",chain_id:r,contracts:o},headers:{"X-Ledger-Client-Version":`context-module/${y.version}`}});if(!t.data[0])return s(void 0);o=o.toLowerCase(),e=`0x${e.slice(2).toLowerCase()}`;const{erc20OfInterest:i,method:n,plugin:p}=t.data[0].b2c?.contracts?.find(g=>g.address===o)?.selectors?.[e]||{},{signature:c,serialized_data:m}=t.data[0].b2c_signatures?.[o]?.[e]||{};if(!i||!n||!p||!c||!m)return s(void 0);const l=t.data[0].abis?.[o];return l?s({selectorDetails:{method:n,plugin:p,erc20OfInterest:i,signature:c,serializedData:m},abi:l}):s(void 0)}catch{return E(new Error("[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos"))}}};f=u([x(),d(0,b(I.Config))],f);export{f as HttpExternalPluginDataSource};
|
|
2
|
+
//# sourceMappingURL=HttpExternalPluginDataSource.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/external-plugin/data/HttpExternalPluginDataSource.ts"],
|
|
4
|
+
"sourcesContent": ["import axios from \"axios\";\nimport { inject, injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport { configTypes } from \"@/config/di/configTypes\";\nimport type { ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { DAppDto } from \"@/external-plugin/data/DAppDto\";\nimport {\n ExternalPluginDataSource,\n GetDappInfos,\n} from \"@/external-plugin/data/ExternalPluginDataSource\";\nimport { DappInfos } from \"@/external-plugin/model/DappInfos\";\nimport { SelectorDetails } from \"@/external-plugin/model/SelectorDetails\";\nimport PACKAGE from \"@root/package.json\";\n\n@injectable()\nexport class HttpExternalPluginDataSource implements ExternalPluginDataSource {\n constructor(\n @inject(configTypes.Config) private readonly config: ContextModuleConfig,\n ) {}\n\n async getDappInfos({\n chainId,\n address,\n selector,\n }: GetDappInfos): Promise<Either<Error, DappInfos | undefined>> {\n try {\n const dappInfos = await axios.request<DAppDto[]>({\n method: \"GET\",\n url: `${this.config.cal.url}/dapps`,\n params: {\n output: \"b2c,b2c_signatures,abis\",\n chain_id: chainId,\n contracts: address,\n },\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n if (!dappInfos.data[0]) {\n return Right(undefined);\n }\n\n // Normalize the address and selector\n address = address.toLowerCase();\n selector = `0x${selector.slice(2).toLowerCase()}`;\n\n const { erc20OfInterest, method, plugin } =\n dappInfos.data[0].b2c?.contracts?.find((c) => c.address === address)\n ?.selectors?.[selector] || {};\n const { signature, serialized_data: serializedData } =\n dappInfos.data[0].b2c_signatures?.[address]?.[selector] || {};\n\n if (\n !erc20OfInterest ||\n !method ||\n !plugin ||\n !signature ||\n !serializedData\n ) {\n return Right(undefined);\n }\n\n const abi = dappInfos.data[0].abis?.[address];\n\n if (!abi) {\n return Right(undefined);\n }\n\n const selectorDetails: SelectorDetails = {\n method,\n plugin,\n erc20OfInterest,\n signature,\n serializedData,\n };\n\n return Right({ selectorDetails, abi });\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos\",\n ),\n );\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "iOAAA,OAAOA,MAAW,QAClB,OAAS,UAAAC,EAAQ,cAAAC,MAAkB,YACnC,OAAiB,QAAAC,EAAM,SAAAC,MAAa,YAEpC,OAAS,eAAAC,MAAmB,0BAS5B,OAAOC,MAAa,qBAGb,IAAMC,EAAN,KAAuE,CAC5E,YAC+CC,EAC7C,CAD6C,YAAAA,CAC5C,CAEH,MAAM,aAAa,CACjB,QAAAC,EACA,QAAAC,EACA,SAAAC,CACF,EAAgE,CAC9D,GAAI,CACF,MAAMC,EAAY,MAAMC,EAAM,QAAmB,CAC/C,OAAQ,MACR,IAAK,GAAG,KAAK,OAAO,IAAI,GAAG,SAC3B,OAAQ,CACN,OAAQ,0BACR,SAAUJ,EACV,UAAWC,CACb,EACA,QAAS,CACP,0BAA2B,kBAAkBI,EAAQ,OAAO,EAC9D,CACF,CAAC,EAED,GAAI,CAACF,EAAU,KAAK,CAAC,EACnB,OAAOG,EAAM,MAAS,EAIxBL,EAAUA,EAAQ,YAAY,EAC9BC,EAAW,KAAKA,EAAS,MAAM,CAAC,EAAE,YAAY,CAAC,GAE/C,KAAM,CAAE,gBAAAK,EAAiB,OAAAC,EAAQ,OAAAC,CAAO,EACtCN,EAAU,KAAK,CAAC,EAAE,KAAK,WAAW,KAAMO,GAAMA,EAAE,UAAYT,CAAO,GAC/D,YAAYC,CAAQ,GAAK,CAAC,EAC1B,CAAE,UAAAS,EAAW,gBAAiBC,CAAe,EACjDT,EAAU,KAAK,CAAC,EAAE,iBAAiBF,CAAO,IAAIC,CAAQ,GAAK,CAAC,EAE9D,GACE,CAACK,GACD,CAACC,GACD,CAACC,GACD,CAACE,GACD,CAACC,EAED,OAAON,EAAM,MAAS,EAGxB,MAAMO,EAAMV,EAAU,KAAK,CAAC,EAAE,OAAOF,CAAO,EAE5C,OAAKY,EAYEP,EAAM,CAAE,gBAR0B,CACvC,OAAAE,EACA,OAAAC,EACA,gBAAAF,EACA,UAAAI,EACA,eAAAC,CACF,EAEgC,IAAAC,CAAI,CAAC,EAX5BP,EAAM,MAAS,CAY1B,MAAiB,CACf,OAAOQ,EACL,IAAI,MACF,yEACF,CACF,CACF,CACF,CACF,EAvEahB,EAANiB,EAAA,CADNC,EAAW,EAGPC,EAAA,EAAAC,EAAOC,EAAY,MAAM,IAFjBrB",
|
|
6
|
+
"names": ["axios", "inject", "injectable", "Left", "Right", "configTypes", "PACKAGE", "HttpExternalPluginDataSource", "config", "chainId", "address", "selector", "dappInfos", "axios", "PACKAGE", "Right", "erc20OfInterest", "method", "plugin", "c", "signature", "serializedData", "abi", "Left", "__decorateClass", "injectable", "__decorateParam", "inject", "configTypes"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import n from"axios";import u from"@/external-plugin/__tests__/abi.json";import{HttpExternalPluginDataSource as d}from"../../external-plugin/data/HttpExternalPluginDataSource";import l from"../../../package.json";jest.mock("axios");const a=t=>({data:t});describe("HttpExternalPuginDataSource",()=>{let t;const i={blockchainName:"ethereum",chainId:1,contracts:[{address:"0x1ef",contractName:"otherName",selectors:{"0x01ee":{erc20OfInterest:["fromToken"],method:"swap",plugin:"plugin"}}},{address:"0x0abc",contractName:"name",selectors:{"0x01ff":{erc20OfInterest:["fromToken"],method:"swap",plugin:"plugin"}}}],name:"test"},r={"0x1ef":u,"0x0abc":u},o={"0x1ef":{"0x01ee":{plugin:"plugin",serialized_data:"0x001",signature:"0x002"}},"0x0abc":{"0x01ff":{plugin:"plugin",serialized_data:"0x001",signature:"0x002"}}};beforeAll(()=>{const s={cal:{url:"https://crypto-assets-service.api.ledger.com/v1"}};t=new d(s),jest.clearAllMocks()}),it("should call axios with the ledger client version header",async()=>{const s=`context-module/${l.version}`,e=jest.fn(()=>Promise.resolve({data:[]}));jest.spyOn(n,"request").mockImplementation(e),await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"}),expect(e).toHaveBeenCalledWith(expect.objectContaining({headers:{"X-Ledger-Client-Version":s}}))}),it("should return undefined when no abis is undefined",async()=>{const s=a([{b2c:i,b2c_signatures:o}]);jest.spyOn(n,"request").mockResolvedValue(s);const e=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(e.extract()).toEqual(void 0)}),it("should return undefined when no selectors",async()=>{const s=a([{abis:r,b2c_signatures:o}]);jest.spyOn(n,"request").mockResolvedValue(s);const e=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(e.extract()).toEqual(void 0)}),it("should return undefined when no abis data",async()=>{const s=a([{abis:{},b2c:i,b2c_signatures:o}]);jest.spyOn(n,"request").mockResolvedValue(s);const e=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(e.extract()).toEqual(void 0)}),it("should return undefined when no abis data",async()=>{const s=a([{abis:{},b2c:i,b2c_signatures:o}]);jest.spyOn(n,"request").mockResolvedValue(s);const e=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(e.extract()).toEqual(void 0)}),it("should return undefined when no abis data for the contract address",async()=>{const e=a([{abis:{"0x1":u},b2c:i,b2c_signatures:o}]);jest.spyOn(n,"request").mockResolvedValue(e);const c=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(c.extract()).toEqual(void 0)}),it("should return undefined when no b2c signature",async()=>{const s=a([{b2c:i,abis:r}]);jest.spyOn(n,"request").mockResolvedValue(s);const e=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(e.extract()).toEqual(void 0)}),it("should return undefined when no ecc20OfInterest",async()=>{const e=a([{b2c:{blockchainName:"ethereum",chainId:1,contracts:[{address:"0x0abc",contractName:"name",selectors:{"0x01ff":{method:"swap",plugin:"plugin"}}}],name:"test"},abis:r,b2c_signatures:o}]);jest.spyOn(n,"request").mockResolvedValue(e);const c=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(c.extract()).toEqual(void 0)}),it("should return undefined when no method",async()=>{const e=a([{b2c:{blockchainName:"ethereum",chainId:1,contracts:[{address:"0x0abc",contractName:"name",selectors:{"0x01ff":{erc20OfInterest:["fromToken"],plugin:"plugin"}}}],name:"test"},abis:r,b2c_signatures:o}]);jest.spyOn(n,"request").mockResolvedValue(e);const c=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(c.extract()).toEqual(void 0)}),it("should return undefined when no plugin",async()=>{const e=a([{b2c:{blockchainName:"ethereum",chainId:1,contracts:[{address:"0x0abc",contractName:"name",selectors:{"0x01ff":{erc20OfInterest:["fromToken"],method:"swap"}}}],name:"test"},abis:r,b2c_signatures:o}]);jest.spyOn(n,"request").mockResolvedValue(e);const c=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(c.extract()).toEqual(void 0)}),it("should return undefined when no method",async()=>{const e=a([{b2c:{blockchainName:"ethereum",chainId:1,contracts:[{address:"0x0abc",contractName:"name",selectors:{"0x01ff":{erc20OfInterest:["fromToken"],plugin:"plugin"}}}],name:"test"},abis:r,b2c_signatures:o}]);jest.spyOn(n,"request").mockResolvedValue(e);const c=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(c.extract()).toEqual(void 0)}),it("should return undefined when no signature",async()=>{const e=a([{b2c:i,abis:r,b2c_signatures:{"0x0abc":{"0x01ff":{plugin:"plugin",serialized_data:"0x001"}}}}]);jest.spyOn(n,"request").mockResolvedValue(e);const c=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(c.extract()).toEqual(void 0)}),it("should return undefined when no serialized data",async()=>{const e=a([{b2c:i,abis:r,b2c_signatures:{"0x0abc":{"0x01ff":{plugin:"plugin",signature:"0x002"}}}}]);jest.spyOn(n,"request").mockResolvedValue(e);const c=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(c.extract()).toEqual(void 0)}),it("should return a correct response",async()=>{const s=a([{b2c:i,abis:r,b2c_signatures:o}]);jest.spyOn(n,"request").mockResolvedValue(s);const e=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(e.extract()).toEqual({abi:u,selectorDetails:{erc20OfInterest:["fromToken"],method:"swap",plugin:"plugin",serializedData:"0x001",signature:"0x002"}})}),it("should normalize the address and selector",async()=>{const s=a([{b2c:i,abis:r,b2c_signatures:o}]);jest.spyOn(n,"request").mockResolvedValue(s);const e=await t.getDappInfos({chainId:1,address:"0x0AbC",selector:"0x01Ff"});expect(e.extract()).toEqual({abi:u,selectorDetails:{erc20OfInterest:["fromToken"],method:"swap",plugin:"plugin",serializedData:"0x001",signature:"0x002"}})}),it("should return an error when axios throws an error",async()=>{jest.spyOn(n,"request").mockRejectedValue(new Error("error"));const s=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(s.extract()).toEqual(new Error("[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos"))})});
|
|
2
|
+
//# sourceMappingURL=HttpExternalPluginDataSource.test.js.map
|