@ledgerhq/context-module 0.0.0-develop-20241011001048 → 0.0.0-signer-eth-20250122093657
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/LICENSE.MD +202 -0
- 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 +54 -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 +54 -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 +48 -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 +128 -0
- package/lib/types/src/transaction/data/CalldataDto.d.ts.map +1 -0
- package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts +22 -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 +22 -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
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var t=require("purify-ts"),b=require("../../typed-data/domain/DefaultTypedDataContextLoader");describe("TokenContextLoader",()=>{const d={getTokenInfosPayload:jest.fn()},f={getTypedDataFilters:jest.fn()},c=new b.DefaultTypedDataContextLoader(f,d),n={PermitSingle:[{name:"details",type:"PermitDetails"},{name:"spender",type:"address"},{name:"sigDeadline",type:"uint256"}],PermitDetails:[{type:"address[]",name:"token"},{name:"amount",type:"uint160"},{name:"expiration",type:"uint48"},{name:"nonce",type:"uint48"}],EIP712Domain:[{name:"name",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}]},s=[{path:"details.token.[]",value:Uint8Array.from([124,235,35,253,107,192,173,213,158,98,172,37,87,130,112,207,241,185,246,25])},{path:"details.amount",value:Uint8Array.from([18])},{path:"spender",value:Uint8Array.from([18])},{path:"details.expiration",value:Uint8Array.from([18])}];beforeEach(()=>{jest.clearAllMocks(),jest.spyOn(d,"getTokenInfosPayload").mockImplementation(({address:a})=>Promise.resolve((0,t.Right)(`payload-${a}`)))}),describe("load function",()=>{it("success with referenced token",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:n,fieldsValues:s};jest.spyOn(f,"getTypedDataFilters").mockImplementation(()=>Promise.resolve((0,t.Right)({messageInfo:{displayName:"Permit2",filtersCount:4,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"},{type:"amount",displayName:"Amount allowance",path:"details.amount",tokenIndex:0,signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3"},{type:"raw",displayName:"Approve to spender",path:"spender",signature:"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb"},{type:"datetime",displayName:"Approval expire",path:"details.expiration",signature:"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b"}]})));const e=await c.load(a);expect(e).toEqual({type:"success",messageInfo:{displayName:"Permit2",filtersCount:4,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},tokens:{0:"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619"},filters:{"details.amount":{displayName:"Amount allowance",path:"details.amount",signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3",tokenIndex:0,type:"amount"},"details.expiration":{displayName:"Approval expire",path:"details.expiration",signature:"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b",type:"datetime"},"details.token.[]":{displayName:"Amount allowance",path:"details.token.[]",signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733",tokenIndex:0,type:"token"},spender:{displayName:"Approve to spender",path:"spender",signature:"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb",type:"raw"}}})}),it("success with referenced token verifying contract",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:n,fieldsValues:s};jest.spyOn(f,"getTypedDataFilters").mockImplementation(()=>Promise.resolve((0,t.Right)({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"},{type:"amount",displayName:"Amount allowance",path:"details.amount",tokenIndex:255,signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3"}]})));const e=await c.load(a);expect(e).toEqual({type:"success",messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},tokens:{0:"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",255:"payload-0x000000000022d473030f116ddee9f6b43ac78ba3"},filters:{"details.amount":{displayName:"Amount allowance",path:"details.amount",signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3",tokenIndex:255,type:"amount"},"details.token.[]":{displayName:"Amount allowance",path:"details.token.[]",signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733",tokenIndex:0,type:"token"}}})}),it("should return an error if filters are unavailable",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:n,fieldsValues:s};jest.spyOn(f,"getTypedDataFilters").mockImplementation(()=>Promise.resolve((0,t.Left)(new Error("error"))));const e=await c.load(a);expect(e).toEqual({type:"error",error:new Error("error")})}),it("success with unavailable tokens",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:n,fieldsValues:s};jest.spyOn(f,"getTypedDataFilters").mockImplementation(()=>Promise.resolve((0,t.Right)({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]}))),jest.spyOn(d,"getTokenInfosPayload").mockImplementation(()=>Promise.resolve((0,t.Left)(new Error("token error"))));const e=await c.load(a);expect(e).toEqual({type:"success",messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},tokens:{},filters:{"details.token.[]":{displayName:"Amount allowance",path:"details.token.[]",signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733",tokenIndex:0,type:"token"}}})}),it("success with several identic tokens",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:n,fieldsValues:[{path:"details.token.[]",value:Uint8Array.from([124,235,35,253,107,192,173,213,158,98,172,37,87,130,112,207,241,185,246,25])},...s]};jest.spyOn(f,"getTypedDataFilters").mockImplementation(()=>Promise.resolve((0,t.Right)({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]}))),jest.spyOn(d,"getTokenInfosPayload").mockImplementation(()=>Promise.resolve((0,t.Left)(new Error("token error"))));const e=await c.load(a);expect(d.getTokenInfosPayload).toHaveBeenCalledWith({address:"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",chainId:1}),expect(e.type).toEqual("success")}),it("success with several different tokens",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:n,fieldsValues:[{path:"details.token.[]",value:Uint8Array.from([124,235,35,253,107,192,173,213,158,98,172,37,87,130,112,207,241,185,246,255])},...s]};jest.spyOn(f,"getTypedDataFilters").mockImplementation(()=>Promise.resolve((0,t.Right)({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]})));const e=await c.load(a);expect(d.getTokenInfosPayload).not.toHaveBeenCalledWith({address:"0x7ceb23fd6bc0add59e62ac25578270cff1b9f6ff",chainId:1}),expect(d.getTokenInfosPayload).not.toHaveBeenCalledWith({address:"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",chainId:1}),expect(e.type).toEqual("success")}),it("should ignore the token if value is not found",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:n,fieldsValues:s};jest.spyOn(f,"getTypedDataFilters").mockImplementation(()=>Promise.resolve((0,t.Right)({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.badtoken",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]})));const e=await c.load(a);expect(e.type).toEqual("success"),e.type==="success"&&(expect(e.filters["details.badtoken"]?.displayName).toEqual("Amount allowance"),expect(e.tokens).toEqual({}))})})});
|
|
2
|
+
//# sourceMappingURL=DefaultTypedDataContextLoader.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/typed-data/domain/DefaultTypedDataContextLoader.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport type { TypedDataContext } from \"@/shared/model/TypedDataContext\";\nimport type { TokenDataSource } from \"@/token/data/TokenDataSource\";\nimport type { TypedDataDataSource } from \"@/typed-data/data/TypedDataDataSource\";\nimport { DefaultTypedDataContextLoader } from \"@/typed-data/domain/DefaultTypedDataContextLoader\";\n\ndescribe(\"TokenContextLoader\", () => {\n const mockTokenDataSource: TokenDataSource = {\n getTokenInfosPayload: jest.fn(),\n };\n const mockTypedDataDataSource: TypedDataDataSource = {\n getTypedDataFilters: jest.fn(),\n };\n const loader = new DefaultTypedDataContextLoader(\n mockTypedDataDataSource,\n mockTokenDataSource,\n );\n\n const TEST_TYPES = {\n PermitSingle: [\n {\n name: \"details\",\n type: \"PermitDetails\",\n },\n {\n name: \"spender\",\n type: \"address\",\n },\n {\n name: \"sigDeadline\",\n type: \"uint256\",\n },\n ],\n PermitDetails: [\n {\n type: \"address[]\",\n name: \"token\",\n },\n {\n name: \"amount\",\n type: \"uint160\",\n },\n {\n name: \"expiration\",\n type: \"uint48\",\n },\n {\n name: \"nonce\",\n type: \"uint48\",\n },\n ],\n EIP712Domain: [\n {\n name: \"name\",\n type: \"string\",\n },\n {\n name: \"chainId\",\n type: \"uint256\",\n },\n {\n name: \"verifyingContract\",\n type: \"address\",\n },\n ],\n };\n const TEST_VALUES = [\n {\n path: \"details.token.[]\",\n value: Uint8Array.from([\n 0x7c, 0xeb, 0x23, 0xfd, 0x6b, 0xc0, 0xad, 0xd5, 0x9e, 0x62, 0xac, 0x25,\n 0x57, 0x82, 0x70, 0xcf, 0xf1, 0xb9, 0xf6, 0x19,\n ]),\n },\n {\n path: \"details.amount\",\n value: Uint8Array.from([0x12]),\n },\n {\n path: \"spender\",\n value: Uint8Array.from([0x12]),\n },\n {\n path: \"details.expiration\",\n value: Uint8Array.from([0x12]),\n },\n ];\n\n beforeEach(() => {\n jest.clearAllMocks();\n jest\n .spyOn(mockTokenDataSource, \"getTokenInfosPayload\")\n .mockImplementation(({ address }) =>\n Promise.resolve(Right(`payload-${address}`)),\n );\n });\n\n describe(\"load function\", () => {\n it(\"success with referenced token\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 4,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n {\n type: \"amount\",\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n tokenIndex: 0,\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n },\n {\n type: \"raw\",\n displayName: \"Approve to spender\",\n path: \"spender\",\n signature:\n \"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb\",\n },\n {\n type: \"datetime\",\n displayName: \"Approval expire\",\n path: \"details.expiration\",\n signature:\n \"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b\",\n },\n ],\n }),\n ),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"success\",\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 4,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n tokens: {\n 0: \"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\",\n },\n filters: {\n \"details.amount\": {\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n tokenIndex: 0,\n type: \"amount\",\n },\n \"details.expiration\": {\n displayName: \"Approval expire\",\n path: \"details.expiration\",\n signature:\n \"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b\",\n type: \"datetime\",\n },\n \"details.token.[]\": {\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n tokenIndex: 0,\n type: \"token\",\n },\n spender: {\n displayName: \"Approve to spender\",\n path: \"spender\",\n signature:\n \"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb\",\n type: \"raw\",\n },\n },\n });\n });\n\n it(\"success with referenced token verifying contract\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n {\n type: \"amount\",\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n tokenIndex: 255,\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n },\n ],\n }),\n ),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"success\",\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n tokens: {\n 0: \"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\",\n 255: \"payload-0x000000000022d473030f116ddee9f6b43ac78ba3\",\n },\n filters: {\n \"details.amount\": {\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n tokenIndex: 255,\n type: \"amount\",\n },\n \"details.token.[]\": {\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n tokenIndex: 0,\n type: \"token\",\n },\n },\n });\n });\n\n it(\"should return an error if filters are unavailable\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() => Promise.resolve(Left(new Error(\"error\"))));\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"error\",\n error: new Error(\"error\"),\n });\n });\n\n it(\"success with unavailable tokens\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n jest\n .spyOn(mockTokenDataSource, \"getTokenInfosPayload\")\n .mockImplementation(() =>\n Promise.resolve(Left(new Error(\"token error\"))),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"success\",\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n tokens: {},\n filters: {\n \"details.token.[]\": {\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n tokenIndex: 0,\n type: \"token\",\n },\n },\n });\n });\n\n it(\"success with several identic tokens\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: [\n {\n path: \"details.token.[]\",\n value: Uint8Array.from([\n 0x7c, 0xeb, 0x23, 0xfd, 0x6b, 0xc0, 0xad, 0xd5, 0x9e, 0x62, 0xac,\n 0x25, 0x57, 0x82, 0x70, 0xcf, 0xf1, 0xb9, 0xf6, 0x19,\n ]),\n },\n ...TEST_VALUES,\n ],\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n jest\n .spyOn(mockTokenDataSource, \"getTokenInfosPayload\")\n .mockImplementation(() =>\n Promise.resolve(Left(new Error(\"token error\"))),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(mockTokenDataSource.getTokenInfosPayload).toHaveBeenCalledWith({\n address: \"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\",\n chainId: 1,\n });\n expect(result.type).toEqual(\"success\");\n });\n\n it(\"success with several different tokens\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: [\n {\n path: \"details.token.[]\",\n value: Uint8Array.from([\n 0x7c, 0xeb, 0x23, 0xfd, 0x6b, 0xc0, 0xad, 0xd5, 0x9e, 0x62, 0xac,\n 0x25, 0x57, 0x82, 0x70, 0xcf, 0xf1, 0xb9, 0xf6, 0xff,\n ]),\n },\n ...TEST_VALUES,\n ],\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(mockTokenDataSource.getTokenInfosPayload).not.toHaveBeenCalledWith(\n { address: \"0x7ceb23fd6bc0add59e62ac25578270cff1b9f6ff\", chainId: 1 },\n );\n expect(mockTokenDataSource.getTokenInfosPayload).not.toHaveBeenCalledWith(\n { address: \"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\", chainId: 1 },\n );\n expect(result.type).toEqual(\"success\");\n });\n\n it(\"should ignore the token if value is not found\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.badtoken\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result.type).toEqual(\"success\");\n if (result.type === \"success\") {\n expect(result.filters[\"details.badtoken\"]?.[\"displayName\"]).toEqual(\n \"Amount allowance\",\n );\n expect(result.tokens).toEqual({});\n }\n });\n });\n});\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["import_purify_ts", "import_DefaultTypedDataContextLoader", "mockTokenDataSource", "mockTypedDataDataSource", "loader", "TEST_TYPES", "TEST_VALUES", "address", "ctx", "result"]
|
|
7
|
+
}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
//# sourceMappingURL=TypedDataContextLoader.js.map
|
|
1
|
+
"use strict";var d=Object.defineProperty;var r=Object.getOwnPropertyDescriptor;var n=Object.getOwnPropertyNames;var y=Object.prototype.hasOwnProperty;var C=(t,e,p,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of n(e))!y.call(t,a)&&a!==p&&d(t,a,{get:()=>e[a],enumerable:!(o=r(e,a))||o.enumerable});return t};var x=t=>C(d({},"__esModule",{value:!0}),t);var D={};module.exports=x(D);
|
|
2
|
+
//# sourceMappingURL=TypedDataContextLoader.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/typed-data/domain/TypedDataContextLoader.ts"],
|
|
4
|
+
"sourcesContent": ["import type { TypedDataClearSignContext } from \"@/shared/model/TypedDataClearSignContext\";\nimport type { TypedDataContext } from \"@/shared/model/TypedDataContext\";\n\nexport interface TypedDataContextLoader {\n load(typedData: TypedDataContext): Promise<TypedDataClearSignContext>;\n}\n"],
|
|
5
|
+
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
|
+
"names": ["TypedDataContextLoader_exports", "__toCommonJS"]
|
|
7
|
+
}
|
package/lib/esm/index.js
CHANGED
package/lib/esm/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../index.ts"],
|
|
4
|
+
"sourcesContent": ["// inversify requirement\nimport \"reflect-metadata\";\n\nexport * from \"./src/index\";\n"],
|
|
5
|
+
"mappings": "AACA,MAAO,mBAEP,WAAc",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/lib/esm/package.json
CHANGED
|
@@ -1,63 +1,58 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
+
"private": false,
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"exports": {
|
|
7
|
+
".": {
|
|
8
|
+
"types": "./lib/types/index.d.ts",
|
|
9
|
+
"import": "./lib/esm/index.js",
|
|
10
|
+
"require": "./lib/cjs/index.js"
|
|
24
11
|
},
|
|
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:*"
|
|
12
|
+
"./*": {
|
|
13
|
+
"types": "./lib/types/*",
|
|
14
|
+
"import": "./lib/esm/*",
|
|
15
|
+
"require": "./lib/cjs/*"
|
|
62
16
|
}
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"./lib"
|
|
20
|
+
],
|
|
21
|
+
"scripts": {
|
|
22
|
+
"prebuild": "rimraf lib",
|
|
23
|
+
"build": "pnpm lmdk-build --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
24
|
+
"dev": "concurrently \"pnpm watch:builds\" \"pnpm watch:types\"",
|
|
25
|
+
"watch:builds": "pnpm lmdk-watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
26
|
+
"watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\"",
|
|
27
|
+
"lint": "eslint",
|
|
28
|
+
"lint:fix": "pnpm lint --fix",
|
|
29
|
+
"postpack": "find . -name '*.tgz' -exec cp {} ../../../dist/ \\; ",
|
|
30
|
+
"prettier": "prettier . --check",
|
|
31
|
+
"prettier:fix": "prettier . --write",
|
|
32
|
+
"test": "jest",
|
|
33
|
+
"test:watch": "pnpm test -- --watch",
|
|
34
|
+
"test:coverage": "pnpm test -- --coverage",
|
|
35
|
+
"typecheck": "tsc --noEmit"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"@ledgerhq/device-management-kit": "workspace:*",
|
|
39
|
+
"@ledgerhq/esbuild-tools": "workspace:*",
|
|
40
|
+
"@ledgerhq/eslint-config-dsdk": "workspace:*",
|
|
41
|
+
"@ledgerhq/jest-config-dsdk": "workspace:*",
|
|
42
|
+
"@ledgerhq/prettier-config-dsdk": "workspace:*",
|
|
43
|
+
"@ledgerhq/tsconfig-dsdk": "workspace:*",
|
|
44
|
+
"@types/crypto-js": "^4.2.2",
|
|
45
|
+
"ts-node": "^10.9.2"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"axios": "^1.7.9",
|
|
49
|
+
"crypto-js": "^4.2.0",
|
|
50
|
+
"ethers": "6.13.4",
|
|
51
|
+
"inversify": "^6.2.1",
|
|
52
|
+
"purify-ts": "^2.1.0",
|
|
53
|
+
"reflect-metadata": "^0.2.2"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"@ledgerhq/device-management-kit": "workspace:*"
|
|
57
|
+
}
|
|
63
58
|
}
|
|
@@ -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": "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",
|
|
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
|
+
}
|