@ledgerhq/context-module 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -6
- package/lib/cjs/index.js +2 -20
- package/lib/cjs/index.js.map +7 -1
- package/lib/cjs/package.json +53 -59
- package/lib/cjs/src/ContextModule.js +2 -3
- package/lib/cjs/src/ContextModule.js.map +7 -1
- package/lib/cjs/src/ContextModuleBuilder.js +2 -87
- package/lib/cjs/src/ContextModuleBuilder.js.map +7 -1
- package/lib/cjs/src/ContextModuleBuilder.test.js +2 -0
- package/lib/cjs/src/ContextModuleBuilder.test.js.map +7 -0
- package/lib/cjs/src/DefaultContextModule.js +2 -21
- package/lib/cjs/src/DefaultContextModule.js.map +7 -1
- package/lib/cjs/src/DefaultContextModule.test.js +2 -0
- package/lib/cjs/src/DefaultContextModule.test.js.map +7 -0
- package/lib/cjs/src/config/di/configModuleFactory.js +2 -10
- package/lib/cjs/src/config/di/configModuleFactory.js.map +7 -1
- package/lib/cjs/src/config/di/configTypes.js +2 -7
- package/lib/cjs/src/config/di/configTypes.js.map +7 -1
- package/lib/cjs/src/config/model/ContextModuleConfig.js +2 -3
- package/lib/cjs/src/config/model/ContextModuleConfig.js.map +7 -1
- package/lib/cjs/src/di.js +2 -17
- package/lib/cjs/src/di.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/DAppDto.js +2 -3
- package/lib/cjs/src/external-plugin/data/DAppDto.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js +2 -3
- package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -83
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
- package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js +2 -13
- package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
- package/lib/cjs/src/external-plugin/di/externalPluginTypes.js +2 -8
- package/lib/cjs/src/external-plugin/di/externalPluginTypes.js.map +7 -1
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -136
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
- package/lib/cjs/src/external-plugin/model/DappInfos.js +2 -3
- package/lib/cjs/src/external-plugin/model/DappInfos.js.map +7 -1
- package/lib/cjs/src/external-plugin/model/SelectorDetails.js +2 -3
- package/lib/cjs/src/external-plugin/model/SelectorDetails.js.map +7 -1
- package/lib/cjs/src/index.js +2 -30
- package/lib/cjs/src/index.js.map +7 -1
- package/lib/cjs/src/nft/data/HttpNftDataSource.js +2 -57
- package/lib/cjs/src/nft/data/HttpNftDataSource.js.map +7 -1
- package/lib/cjs/src/nft/data/HttpNftDataSource.test.js +2 -0
- package/lib/cjs/src/nft/data/HttpNftDataSource.test.js.map +7 -0
- package/lib/cjs/src/nft/data/NftDataSource.js +2 -3
- package/lib/cjs/src/nft/data/NftDataSource.js.map +7 -1
- package/lib/cjs/src/nft/di/nftModuleFactory.js +2 -13
- package/lib/cjs/src/nft/di/nftModuleFactory.js.map +7 -1
- package/lib/cjs/src/nft/di/nftTypes.js +2 -8
- package/lib/cjs/src/nft/di/nftTypes.js.map +7 -1
- package/lib/cjs/src/nft/domain/NftContextLoader.js +2 -111
- package/lib/cjs/src/nft/domain/NftContextLoader.js.map +7 -1
- package/lib/cjs/src/nft/domain/NftContextLoader.test.js +2 -0
- package/lib/cjs/src/nft/domain/NftContextLoader.test.js.map +7 -0
- package/lib/cjs/src/shared/domain/ContextLoader.js +2 -3
- package/lib/cjs/src/shared/domain/ContextLoader.js.map +7 -1
- package/lib/cjs/src/shared/model/ClearSignContext.js +2 -13
- package/lib/cjs/src/shared/model/ClearSignContext.js.map +7 -1
- package/lib/cjs/src/shared/model/GenericPath.js +2 -0
- package/lib/cjs/src/shared/model/GenericPath.js.map +7 -0
- package/lib/cjs/src/shared/model/TransactionContext.js +2 -3
- package/lib/cjs/src/shared/model/TransactionContext.js.map +7 -1
- package/lib/cjs/src/shared/model/TransactionSubset.js +2 -3
- package/lib/cjs/src/shared/model/TransactionSubset.js.map +7 -1
- package/lib/cjs/src/shared/model/TypedDataClearSignContext.js +2 -6
- package/lib/cjs/src/shared/model/TypedDataClearSignContext.js.map +7 -1
- package/lib/cjs/src/shared/model/TypedDataContext.js +2 -3
- package/lib/cjs/src/shared/model/TypedDataContext.js.map +7 -1
- package/lib/cjs/src/shared/utils/HexStringUtils.js +2 -15
- package/lib/cjs/src/shared/utils/HexStringUtils.js.map +7 -1
- package/lib/cjs/src/token/data/HttpTokenDataSource.js +2 -83
- package/lib/cjs/src/token/data/HttpTokenDataSource.js.map +7 -1
- package/lib/cjs/src/token/data/HttpTokenDataSource.test.js +2 -0
- package/lib/cjs/src/token/data/HttpTokenDataSource.test.js.map +7 -0
- package/lib/cjs/src/token/data/TokenDataSource.js +2 -3
- package/lib/cjs/src/token/data/TokenDataSource.js.map +7 -1
- package/lib/cjs/src/token/data/TokenDto.js +2 -3
- package/lib/cjs/src/token/data/TokenDto.js.map +7 -1
- package/lib/cjs/src/token/di/tokenModuleFactory.js +2 -13
- package/lib/cjs/src/token/di/tokenModuleFactory.js.map +7 -1
- package/lib/cjs/src/token/di/tokenTypes.js +2 -8
- package/lib/cjs/src/token/di/tokenTypes.js.map +7 -1
- package/lib/cjs/src/token/domain/TokenContextLoader.js +2 -74
- package/lib/cjs/src/token/domain/TokenContextLoader.js.map +7 -1
- package/lib/cjs/src/token/domain/TokenContextLoader.test.js +2 -0
- package/lib/cjs/src/token/domain/TokenContextLoader.test.js.map +7 -0
- package/lib/cjs/src/transaction/data/CalldataDto.js +2 -0
- package/lib/cjs/src/transaction/data/CalldataDto.js.map +7 -0
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js +2 -0
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
- package/lib/cjs/src/transaction/data/TransactionDataSource.js +2 -0
- package/lib/cjs/src/transaction/data/TransactionDataSource.js.map +7 -0
- package/lib/cjs/src/transaction/di/transactionModuleFactory.js +2 -0
- package/lib/cjs/src/transaction/di/transactionModuleFactory.js.map +7 -0
- package/lib/cjs/src/transaction/di/transactionTypes.js +2 -0
- package/lib/cjs/src/transaction/di/transactionTypes.js.map +7 -0
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.js +2 -0
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.js.map +7 -0
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js +2 -0
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
- package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js +2 -0
- package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
- package/lib/cjs/src/trusted-name/data/TrustedNameDto.js +2 -0
- package/lib/cjs/src/trusted-name/data/TrustedNameDto.js.map +7 -0
- package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
- package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
- package/lib/cjs/src/trusted-name/di/trustedNameTypes.js +2 -0
- package/lib/cjs/src/trusted-name/di/trustedNameTypes.js.map +7 -0
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
- package/lib/cjs/src/typed-data/data/FiltersDto.js +2 -3
- package/lib/cjs/src/typed-data/data/FiltersDto.js.map +7 -1
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js +2 -163
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -1
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
- package/lib/cjs/src/typed-data/data/TypedDataDataSource.js +2 -3
- package/lib/cjs/src/typed-data/data/TypedDataDataSource.js.map +7 -1
- package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js +2 -13
- package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js.map +7 -1
- package/lib/cjs/src/typed-data/di/typedDataTypes.js +2 -8
- package/lib/cjs/src/typed-data/di/typedDataTypes.js.map +7 -1
- package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -127
- package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -1
- package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
- package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
- package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js +2 -3
- package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js.map +7 -1
- package/lib/esm/index.js +2 -4
- package/lib/esm/index.js.map +7 -1
- package/lib/esm/package.json +53 -59
- package/lib/esm/src/ContextModule.js +1 -2
- package/lib/esm/src/ContextModule.js.map +7 -1
- package/lib/esm/src/ContextModuleBuilder.js +2 -83
- package/lib/esm/src/ContextModuleBuilder.js.map +7 -1
- package/lib/esm/src/ContextModuleBuilder.test.js +2 -0
- package/lib/esm/src/ContextModuleBuilder.test.js.map +7 -0
- package/lib/esm/src/DefaultContextModule.js +2 -17
- package/lib/esm/src/DefaultContextModule.js.map +7 -1
- package/lib/esm/src/DefaultContextModule.test.js +2 -0
- package/lib/esm/src/DefaultContextModule.test.js.map +7 -0
- package/lib/esm/src/config/di/configModuleFactory.js +2 -6
- package/lib/esm/src/config/di/configModuleFactory.js.map +7 -1
- package/lib/esm/src/config/di/configTypes.js +2 -4
- package/lib/esm/src/config/di/configTypes.js.map +7 -1
- package/lib/esm/src/config/model/ContextModuleConfig.js +1 -2
- package/lib/esm/src/config/model/ContextModuleConfig.js.map +7 -1
- package/lib/esm/src/di.js +2 -13
- package/lib/esm/src/di.js.map +7 -1
- package/lib/esm/src/external-plugin/data/DAppDto.js +1 -2
- package/lib/esm/src/external-plugin/data/DAppDto.js.map +7 -1
- package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js +1 -2
- package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -77
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
- package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js +2 -9
- package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
- package/lib/esm/src/external-plugin/di/externalPluginTypes.js +2 -5
- package/lib/esm/src/external-plugin/di/externalPluginTypes.js.map +7 -1
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -133
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
- package/lib/esm/src/external-plugin/model/DappInfos.js +1 -2
- package/lib/esm/src/external-plugin/model/DappInfos.js.map +7 -1
- package/lib/esm/src/external-plugin/model/SelectorDetails.js +1 -2
- package/lib/esm/src/external-plugin/model/SelectorDetails.js.map +7 -1
- package/lib/esm/src/index.js +2 -14
- package/lib/esm/src/index.js.map +7 -1
- package/lib/esm/src/nft/data/HttpNftDataSource.js +2 -51
- package/lib/esm/src/nft/data/HttpNftDataSource.js.map +7 -1
- package/lib/esm/src/nft/data/HttpNftDataSource.test.js +2 -0
- package/lib/esm/src/nft/data/HttpNftDataSource.test.js.map +7 -0
- package/lib/esm/src/nft/data/NftDataSource.js +1 -2
- package/lib/esm/src/nft/data/NftDataSource.js.map +7 -1
- package/lib/esm/src/nft/di/nftModuleFactory.js +2 -9
- package/lib/esm/src/nft/di/nftModuleFactory.js.map +7 -1
- package/lib/esm/src/nft/di/nftTypes.js +2 -5
- package/lib/esm/src/nft/di/nftTypes.js.map +7 -1
- package/lib/esm/src/nft/domain/NftContextLoader.js +2 -108
- package/lib/esm/src/nft/domain/NftContextLoader.js.map +7 -1
- package/lib/esm/src/nft/domain/NftContextLoader.test.js +2 -0
- package/lib/esm/src/nft/domain/NftContextLoader.test.js.map +7 -0
- package/lib/esm/src/shared/domain/ContextLoader.js +1 -2
- package/lib/esm/src/shared/domain/ContextLoader.js.map +7 -1
- package/lib/esm/src/shared/model/ClearSignContext.js +2 -10
- package/lib/esm/src/shared/model/ClearSignContext.js.map +7 -1
- package/lib/esm/src/shared/model/GenericPath.js +2 -0
- package/lib/esm/src/shared/model/GenericPath.js.map +7 -0
- package/lib/esm/src/shared/model/TransactionContext.js +1 -2
- package/lib/esm/src/shared/model/TransactionContext.js.map +7 -1
- package/lib/esm/src/shared/model/TransactionSubset.js +1 -2
- package/lib/esm/src/shared/model/TransactionSubset.js.map +7 -1
- package/lib/esm/src/shared/model/TypedDataClearSignContext.js +2 -3
- package/lib/esm/src/shared/model/TypedDataClearSignContext.js.map +7 -1
- package/lib/esm/src/shared/model/TypedDataContext.js +1 -2
- package/lib/esm/src/shared/model/TypedDataContext.js.map +7 -1
- package/lib/esm/src/shared/utils/HexStringUtils.js +2 -11
- package/lib/esm/src/shared/utils/HexStringUtils.js.map +7 -1
- package/lib/esm/src/token/data/HttpTokenDataSource.js +2 -77
- package/lib/esm/src/token/data/HttpTokenDataSource.js.map +7 -1
- package/lib/esm/src/token/data/HttpTokenDataSource.test.js +2 -0
- package/lib/esm/src/token/data/HttpTokenDataSource.test.js.map +7 -0
- package/lib/esm/src/token/data/TokenDataSource.js +1 -2
- package/lib/esm/src/token/data/TokenDataSource.js.map +7 -1
- package/lib/esm/src/token/data/TokenDto.js +1 -2
- package/lib/esm/src/token/data/TokenDto.js.map +7 -1
- package/lib/esm/src/token/di/tokenModuleFactory.js +2 -9
- package/lib/esm/src/token/di/tokenModuleFactory.js.map +7 -1
- package/lib/esm/src/token/di/tokenTypes.js +2 -5
- package/lib/esm/src/token/di/tokenTypes.js.map +7 -1
- package/lib/esm/src/token/domain/TokenContextLoader.js +2 -71
- package/lib/esm/src/token/domain/TokenContextLoader.js.map +7 -1
- package/lib/esm/src/token/domain/TokenContextLoader.test.js +2 -0
- package/lib/esm/src/token/domain/TokenContextLoader.test.js.map +7 -0
- package/lib/esm/src/transaction/data/CalldataDto.js +1 -0
- package/lib/esm/src/transaction/data/CalldataDto.js.map +7 -0
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.js +2 -0
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
- package/lib/esm/src/transaction/data/TransactionDataSource.js +1 -0
- package/lib/esm/src/transaction/data/TransactionDataSource.js.map +7 -0
- package/lib/esm/src/transaction/di/transactionModuleFactory.js +2 -0
- package/lib/esm/src/transaction/di/transactionModuleFactory.js.map +7 -0
- package/lib/esm/src/transaction/di/transactionTypes.js +2 -0
- package/lib/esm/src/transaction/di/transactionTypes.js.map +7 -0
- package/lib/esm/src/transaction/domain/TransactionContextLoader.js +2 -0
- package/lib/esm/src/transaction/domain/TransactionContextLoader.js.map +7 -0
- package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js +2 -0
- package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
- package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js +1 -0
- package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
- package/lib/esm/src/trusted-name/data/TrustedNameDto.js +1 -0
- package/lib/esm/src/trusted-name/data/TrustedNameDto.js.map +7 -0
- package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
- package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
- package/lib/esm/src/trusted-name/di/trustedNameTypes.js +2 -0
- package/lib/esm/src/trusted-name/di/trustedNameTypes.js.map +7 -0
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
- package/lib/esm/src/typed-data/data/FiltersDto.js +1 -2
- package/lib/esm/src/typed-data/data/FiltersDto.js.map +7 -1
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js +2 -157
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -1
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
- package/lib/esm/src/typed-data/data/TypedDataDataSource.js +1 -2
- package/lib/esm/src/typed-data/data/TypedDataDataSource.js.map +7 -1
- package/lib/esm/src/typed-data/di/typedDataModuleFactory.js +2 -9
- package/lib/esm/src/typed-data/di/typedDataModuleFactory.js.map +7 -1
- package/lib/esm/src/typed-data/di/typedDataTypes.js +2 -5
- package/lib/esm/src/typed-data/di/typedDataTypes.js.map +7 -1
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -124
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -1
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
- package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js +1 -2
- package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js.map +7 -1
- package/lib/{cjs → types}/src/ContextModule.d.ts +3 -2
- package/lib/types/src/ContextModule.d.ts.map +1 -0
- package/lib/{cjs → types}/src/ContextModuleBuilder.d.ts +9 -11
- package/lib/types/src/ContextModuleBuilder.d.ts.map +1 -0
- package/lib/types/src/ContextModuleBuilder.test.d.ts +2 -0
- package/lib/types/src/ContextModuleBuilder.test.d.ts.map +1 -0
- package/lib/types/src/DefaultContextModule.d.ts +18 -0
- package/lib/types/src/DefaultContextModule.d.ts.map +1 -0
- package/lib/types/src/DefaultContextModule.test.d.ts +2 -0
- package/lib/types/src/DefaultContextModule.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts +1 -1
- package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts.map +1 -1
- package/lib/types/src/config/model/ContextModuleConfig.d.ts +16 -0
- package/lib/types/src/config/model/ContextModuleConfig.d.ts.map +1 -0
- package/lib/{cjs → types}/src/di.d.ts +1 -1
- package/lib/types/src/di.d.ts.map +1 -0
- package/lib/{cjs → types}/src/external-plugin/data/ExternalPluginDataSource.d.ts +3 -3
- package/lib/types/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +1 -0
- package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts +2 -0
- package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts.map +1 -0
- package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts +2 -0
- package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts.map +1 -0
- package/lib/types/src/external-plugin/model/DappInfos.d.ts +6 -0
- package/lib/types/src/external-plugin/model/DappInfos.d.ts.map +1 -0
- package/lib/{cjs → types}/src/index.d.ts +3 -1
- package/lib/types/src/index.d.ts.map +1 -0
- package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts +2 -0
- package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/nft/data/NftDataSource.d.ts +1 -1
- package/lib/types/src/nft/data/NftDataSource.d.ts.map +1 -0
- package/lib/{cjs → types}/src/nft/domain/NftContextLoader.d.ts +2 -1
- package/lib/types/src/nft/domain/NftContextLoader.d.ts.map +1 -0
- package/lib/types/src/nft/domain/NftContextLoader.test.d.ts +2 -0
- package/lib/types/src/nft/domain/NftContextLoader.test.d.ts.map +1 -0
- package/lib/types/src/shared/domain/ContextLoader.d.ts +7 -0
- package/lib/types/src/shared/domain/ContextLoader.d.ts.map +1 -0
- package/lib/types/src/shared/model/ClearSignContext.d.ts +40 -0
- package/lib/types/src/shared/model/ClearSignContext.d.ts.map +1 -0
- package/lib/types/src/shared/model/GenericPath.d.ts +105 -0
- package/lib/types/src/shared/model/GenericPath.d.ts.map +1 -0
- package/lib/types/src/shared/model/TransactionContext.d.ts +19 -0
- package/lib/types/src/shared/model/TransactionContext.d.ts.map +1 -0
- package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts.map +1 -1
- package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts +2 -0
- package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/token/data/TokenDataSource.d.ts +1 -1
- package/lib/types/src/token/data/TokenDataSource.d.ts.map +1 -0
- package/lib/types/src/token/data/TokenDto.d.ts +16 -0
- package/lib/types/src/token/data/TokenDto.d.ts.map +1 -0
- package/lib/{cjs → types}/src/token/domain/TokenContextLoader.d.ts +2 -1
- package/lib/types/src/token/domain/TokenContextLoader.d.ts.map +1 -0
- package/lib/types/src/token/domain/TokenContextLoader.test.d.ts +2 -0
- package/lib/types/src/token/domain/TokenContextLoader.test.d.ts.map +1 -0
- package/lib/types/src/transaction/data/CalldataDto.d.ts +117 -0
- package/lib/types/src/transaction/data/CalldataDto.d.ts.map +1 -0
- package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts +19 -0
- package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts.map +1 -0
- package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts +2 -0
- package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts.map +1 -0
- package/lib/types/src/transaction/data/TransactionDataSource.d.ts +12 -0
- package/lib/types/src/transaction/data/TransactionDataSource.d.ts.map +1 -0
- package/lib/types/src/transaction/di/transactionModuleFactory.d.ts +3 -0
- package/lib/types/src/transaction/di/transactionModuleFactory.d.ts.map +1 -0
- package/lib/types/src/transaction/di/transactionTypes.d.ts +5 -0
- package/lib/types/src/transaction/di/transactionTypes.d.ts.map +1 -0
- package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts +10 -0
- package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts.map +1 -0
- package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts +2 -0
- package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts.map +1 -0
- package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts +11 -0
- package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts.map +1 -0
- package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts +2 -0
- package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts.map +1 -0
- package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts +16 -0
- package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts.map +1 -0
- package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts +15 -0
- package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts.map +1 -0
- package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts +3 -0
- package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts.map +1 -0
- package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts +5 -0
- package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts.map +1 -0
- package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts +12 -0
- package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts.map +1 -0
- package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts +2 -0
- package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/typed-data/data/FiltersDto.d.ts +3 -0
- package/lib/types/src/typed-data/data/FiltersDto.d.ts.map +1 -0
- package/lib/types/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +1 -0
- package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts +3 -0
- package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/typed-data/data/TypedDataDataSource.d.ts +3 -3
- package/lib/types/src/typed-data/data/TypedDataDataSource.d.ts.map +1 -0
- package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +1 -1
- package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts +2 -0
- package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts.map +1 -0
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -0
- package/package.json +21 -27
- package/lib/cjs/src/ContextModule.d.ts.map +0 -1
- package/lib/cjs/src/ContextModuleBuilder.d.ts.map +0 -1
- package/lib/cjs/src/DefaultContextModule.d.ts +0 -20
- package/lib/cjs/src/DefaultContextModule.d.ts.map +0 -1
- package/lib/cjs/src/config/model/ContextModuleConfig.d.ts +0 -9
- package/lib/cjs/src/config/model/ContextModuleConfig.d.ts.map +0 -1
- package/lib/cjs/src/di.d.ts.map +0 -1
- package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -1
- package/lib/cjs/src/external-plugin/model/DappInfos.d.ts +0 -6
- package/lib/cjs/src/external-plugin/model/DappInfos.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
- package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js +0 -3
- package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
- package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
- package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -40
- package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
- package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
- package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js +0 -13
- package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
- package/lib/cjs/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
- package/lib/cjs/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js +0 -8
- package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
- package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
- package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -66
- package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
- package/lib/cjs/src/index.d.ts.map +0 -1
- package/lib/cjs/src/nft/data/NftDataSource.d.ts.map +0 -1
- package/lib/cjs/src/nft/domain/NftContextLoader.d.ts.map +0 -1
- package/lib/cjs/src/shared/domain/ContextLoader.d.ts +0 -6
- package/lib/cjs/src/shared/domain/ContextLoader.d.ts.map +0 -1
- package/lib/cjs/src/shared/model/ClearSignContext.d.ts +0 -21
- package/lib/cjs/src/shared/model/ClearSignContext.d.ts.map +0 -1
- package/lib/cjs/src/shared/model/TransactionContext.d.ts +0 -6
- package/lib/cjs/src/shared/model/TransactionContext.d.ts.map +0 -1
- package/lib/cjs/src/token/data/TokenDataSource.d.ts.map +0 -1
- package/lib/cjs/src/token/data/TokenDto.d.ts +0 -6
- package/lib/cjs/src/token/data/TokenDto.d.ts.map +0 -1
- package/lib/cjs/src/token/domain/TokenContextLoader.d.ts.map +0 -1
- package/lib/cjs/src/typed-data/data/FiltersDto.d.ts.map +0 -1
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
- package/lib/cjs/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -1
- package/lib/cjs/tsconfig.cjs.tsbuildinfo +0 -1
- package/lib/esm/index.d.ts +0 -3
- package/lib/esm/index.d.ts.map +0 -1
- package/lib/esm/src/ContextModule.d.ts +0 -9
- package/lib/esm/src/ContextModule.d.ts.map +0 -1
- package/lib/esm/src/ContextModuleBuilder.d.ts +0 -45
- package/lib/esm/src/ContextModuleBuilder.d.ts.map +0 -1
- package/lib/esm/src/DefaultContextModule.d.ts +0 -20
- package/lib/esm/src/DefaultContextModule.d.ts.map +0 -1
- package/lib/esm/src/config/di/configModuleFactory.d.ts +0 -4
- package/lib/esm/src/config/di/configModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/config/di/configTypes.d.ts +0 -4
- package/lib/esm/src/config/di/configTypes.d.ts.map +0 -1
- package/lib/esm/src/config/model/ContextModuleConfig.d.ts +0 -9
- package/lib/esm/src/config/model/ContextModuleConfig.d.ts.map +0 -1
- package/lib/esm/src/di.d.ts +0 -8
- package/lib/esm/src/di.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/data/DAppDto.d.ts +0 -38
- package/lib/esm/src/external-plugin/data/DAppDto.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts +0 -12
- package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -10
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -3
- package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts +0 -5
- package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -15
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/model/DappInfos.d.ts +0 -6
- package/lib/esm/src/external-plugin/model/DappInfos.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts +0 -8
- package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
- package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js +0 -2
- package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
- package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
- package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -34
- package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
- package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
- package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js +0 -9
- package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
- package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
- package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/di/forwardDomainTypes.js +0 -5
- package/lib/esm/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
- package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
- package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -63
- package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
- package/lib/esm/src/index.d.ts +0 -14
- package/lib/esm/src/index.d.ts.map +0 -1
- package/lib/esm/src/nft/data/HttpNftDataSource.d.ts +0 -7
- package/lib/esm/src/nft/data/HttpNftDataSource.d.ts.map +0 -1
- package/lib/esm/src/nft/data/NftDataSource.d.ts +0 -15
- package/lib/esm/src/nft/data/NftDataSource.d.ts.map +0 -1
- package/lib/esm/src/nft/di/nftModuleFactory.d.ts +0 -3
- package/lib/esm/src/nft/di/nftModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/nft/di/nftTypes.d.ts +0 -5
- package/lib/esm/src/nft/di/nftTypes.d.ts.map +0 -1
- package/lib/esm/src/nft/domain/NftContextLoader.d.ts +0 -11
- package/lib/esm/src/nft/domain/NftContextLoader.d.ts.map +0 -1
- package/lib/esm/src/shared/domain/ContextLoader.d.ts +0 -6
- package/lib/esm/src/shared/domain/ContextLoader.d.ts.map +0 -1
- package/lib/esm/src/shared/model/ClearSignContext.d.ts +0 -21
- package/lib/esm/src/shared/model/ClearSignContext.d.ts.map +0 -1
- package/lib/esm/src/shared/model/TransactionContext.d.ts +0 -6
- package/lib/esm/src/shared/model/TransactionContext.d.ts.map +0 -1
- package/lib/esm/src/shared/model/TransactionSubset.d.ts +0 -6
- package/lib/esm/src/shared/model/TransactionSubset.d.ts.map +0 -1
- package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts +0 -33
- package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -1
- package/lib/esm/src/shared/model/TypedDataContext.d.ts +0 -16
- package/lib/esm/src/shared/model/TypedDataContext.d.ts.map +0 -1
- package/lib/esm/src/shared/utils/HexStringUtils.d.ts +0 -4
- package/lib/esm/src/shared/utils/HexStringUtils.d.ts.map +0 -1
- package/lib/esm/src/token/data/HttpTokenDataSource.d.ts +0 -9
- package/lib/esm/src/token/data/HttpTokenDataSource.d.ts.map +0 -1
- package/lib/esm/src/token/data/TokenDataSource.d.ts +0 -9
- package/lib/esm/src/token/data/TokenDataSource.d.ts.map +0 -1
- package/lib/esm/src/token/data/TokenDto.d.ts +0 -6
- package/lib/esm/src/token/data/TokenDto.d.ts.map +0 -1
- package/lib/esm/src/token/di/tokenModuleFactory.d.ts +0 -3
- package/lib/esm/src/token/di/tokenModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/token/di/tokenTypes.d.ts +0 -5
- package/lib/esm/src/token/di/tokenTypes.d.ts.map +0 -1
- package/lib/esm/src/token/domain/TokenContextLoader.d.ts +0 -15
- package/lib/esm/src/token/domain/TokenContextLoader.d.ts.map +0 -1
- package/lib/esm/src/typed-data/data/FiltersDto.d.ts +0 -55
- package/lib/esm/src/typed-data/data/FiltersDto.d.ts.map +0 -1
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -14
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
- package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts +0 -17
- package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -1
- package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts +0 -3
- package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/typed-data/di/typedDataTypes.d.ts +0 -5
- package/lib/esm/src/typed-data/di/typedDataTypes.d.ts.map +0 -1
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -13
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +0 -1
- package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -6
- package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -1
- package/lib/esm/tsconfig.esm.tsbuildinfo +0 -1
- /package/lib/{cjs → types}/index.d.ts +0 -0
- /package/lib/{cjs → types}/index.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/config/di/configTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/config/di/configTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts +0 -0
- /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts +0 -0
- /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/external-plugin/data/HttpExternalPluginDataSource.test.ts"],
|
|
4
|
+
"sourcesContent": ["import axios from \"axios\";\n\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport ABI from \"@/external-plugin/__tests__/abi.json\";\nimport {\n type Abis,\n type B2c,\n type B2cSignatures,\n type DAppDto,\n} from \"@/external-plugin/data/DAppDto\";\nimport { type ExternalPluginDataSource } from \"@/external-plugin/data/ExternalPluginDataSource\";\nimport { HttpExternalPluginDataSource } from \"@/external-plugin/data/HttpExternalPluginDataSource\";\nimport PACKAGE from \"@root/package.json\";\n\njest.mock(\"axios\");\n\nconst axiosResponseBuilder = (dto: Partial<DAppDto>[]) => {\n return { data: dto };\n};\n\ndescribe(\"HttpExternalPuginDataSource\", () => {\n let datasource: ExternalPluginDataSource;\n const exampleB2c: B2c = {\n blockchainName: \"ethereum\",\n chainId: 1,\n contracts: [\n {\n address: \"0x1ef\",\n contractName: \"otherName\",\n selectors: {\n \"0x01ee\": {\n erc20OfInterest: [\"fromToken\"],\n method: \"swap\",\n plugin: \"plugin\",\n },\n },\n },\n {\n address: \"0x0abc\",\n contractName: \"name\",\n selectors: {\n \"0x01ff\": {\n erc20OfInterest: [\"fromToken\"],\n method: \"swap\",\n plugin: \"plugin\",\n },\n },\n },\n ],\n name: \"test\",\n };\n const exampleAbis: Abis = { \"0x1ef\": ABI, \"0x0abc\": ABI };\n const exampleB2cSignatures: B2cSignatures = {\n \"0x1ef\": {\n \"0x01ee\": {\n plugin: \"plugin\",\n serialized_data: \"0x001\",\n signature: \"0x002\",\n },\n },\n \"0x0abc\": {\n \"0x01ff\": {\n plugin: \"plugin\",\n serialized_data: \"0x001\",\n signature: \"0x002\",\n },\n },\n };\n\n beforeAll(() => {\n const config = {\n cal: {\n url: \"https://crypto-assets-service.api.ledger.com/v1\",\n },\n } as ContextModuleConfig;\n datasource = new HttpExternalPluginDataSource(config);\n jest.clearAllMocks();\n });\n\n it(\"should call axios with the ledger client version header\", async () => {\n // GIVEN\n const version = `context-module/${PACKAGE.version}`;\n const requestSpy = jest.fn(() => Promise.resolve({ data: [] }));\n jest.spyOn(axios, \"request\").mockImplementation(requestSpy);\n\n // WHEN\n await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(requestSpy).toHaveBeenCalledWith(\n expect.objectContaining({\n headers: { \"X-Ledger-Client-Version\": version },\n }),\n );\n });\n\n it(\"should return undefined when no abis is undefined\", async () => {\n // GIVEN\n const response = axiosResponseBuilder([\n { b2c: exampleB2c, b2c_signatures: exampleB2cSignatures },\n ]);\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no selectors\", async () => {\n // GIVEN\n const response = axiosResponseBuilder([\n { abis: exampleAbis, b2c_signatures: exampleB2cSignatures },\n ]);\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no abis data\", async () => {\n // GIVEN\n const response = axiosResponseBuilder([\n { abis: {}, b2c: exampleB2c, b2c_signatures: exampleB2cSignatures },\n ]);\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no abis data\", async () => {\n // GIVEN\n const response = axiosResponseBuilder([\n { abis: {}, b2c: exampleB2c, b2c_signatures: exampleB2cSignatures },\n ]);\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no abis data for the contract address\", async () => {\n // GIVEN\n const abis: Abis = { \"0x1\": ABI };\n const response = axiosResponseBuilder([\n { abis, b2c: exampleB2c, b2c_signatures: exampleB2cSignatures },\n ]);\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no b2c signature\", async () => {\n // GIVEN\n const response = axiosResponseBuilder([\n { b2c: exampleB2c, abis: exampleAbis },\n ]);\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no ecc20OfInterest\", async () => {\n // GIVEN\n const b2c = {\n blockchainName: \"ethereum\",\n chainId: 1,\n contracts: [\n {\n address: \"0x0abc\",\n contractName: \"name\",\n selectors: {\n \"0x01ff\": { method: \"swap\", plugin: \"plugin\" },\n },\n },\n ],\n name: \"test\",\n } as unknown as B2c;\n const response = axiosResponseBuilder([\n { b2c, abis: exampleAbis, b2c_signatures: exampleB2cSignatures },\n ]);\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no method\", async () => {\n // GIVEN\n const b2c = {\n blockchainName: \"ethereum\",\n chainId: 1,\n contracts: [\n {\n address: \"0x0abc\",\n contractName: \"name\",\n selectors: {\n \"0x01ff\": { erc20OfInterest: [\"fromToken\"], plugin: \"plugin\" },\n },\n },\n ],\n name: \"test\",\n } as unknown as B2c;\n const response = axiosResponseBuilder([\n { b2c, abis: exampleAbis, b2c_signatures: exampleB2cSignatures },\n ]);\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no plugin\", async () => {\n // GIVEN\n const b2c = {\n blockchainName: \"ethereum\",\n chainId: 1,\n contracts: [\n {\n address: \"0x0abc\",\n contractName: \"name\",\n selectors: {\n \"0x01ff\": { erc20OfInterest: [\"fromToken\"], method: \"swap\" },\n },\n },\n ],\n name: \"test\",\n } as unknown as B2c;\n const response = axiosResponseBuilder([\n { b2c, abis: exampleAbis, b2c_signatures: exampleB2cSignatures },\n ]);\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no method\", async () => {\n // GIVEN\n const b2c = {\n blockchainName: \"ethereum\",\n chainId: 1,\n contracts: [\n {\n address: \"0x0abc\",\n contractName: \"name\",\n selectors: {\n \"0x01ff\": { erc20OfInterest: [\"fromToken\"], plugin: \"plugin\" },\n },\n },\n ],\n name: \"test\",\n } as unknown as B2c;\n const response = axiosResponseBuilder([\n { b2c, abis: exampleAbis, b2c_signatures: exampleB2cSignatures },\n ]);\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no signature\", async () => {\n // GIVEN\n const B2CSignature = {\n \"0x0abc\": { \"0x01ff\": { plugin: \"plugin\", serialized_data: \"0x001\" } },\n } as unknown as B2cSignatures;\n\n // FIXME\n const response = axiosResponseBuilder([\n { b2c: exampleB2c, abis: exampleAbis, b2c_signatures: B2CSignature },\n ]);\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return undefined when no serialized data\", async () => {\n // GIVEN\n const B2CSignature = {\n \"0x0abc\": { \"0x01ff\": { plugin: \"plugin\", signature: \"0x002\" } },\n } as unknown as B2cSignatures;\n\n // FIXME\n const response = axiosResponseBuilder([\n { b2c: exampleB2c, abis: exampleAbis, b2c_signatures: B2CSignature },\n ]);\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(undefined);\n });\n\n it(\"should return a correct response\", async () => {\n // GIVEN\n const response = axiosResponseBuilder([\n {\n b2c: exampleB2c,\n abis: exampleAbis,\n b2c_signatures: exampleB2cSignatures,\n },\n ]);\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"fromToken\"],\n method: \"swap\",\n plugin: \"plugin\",\n serializedData: \"0x001\",\n signature: \"0x002\",\n },\n });\n });\n\n it(\"should normalize the address and selector\", async () => {\n // GIVEN\n const response = axiosResponseBuilder([\n {\n b2c: exampleB2c,\n abis: exampleAbis,\n b2c_signatures: exampleB2cSignatures,\n },\n ]);\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0AbC\",\n selector: \"0x01Ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"fromToken\"],\n method: \"swap\",\n plugin: \"plugin\",\n serializedData: \"0x001\",\n signature: \"0x002\",\n },\n });\n });\n\n it(\"should return an error when axios throws an error\", async () => {\n // GIVEN\n jest.spyOn(axios, \"request\").mockRejectedValue(new Error(\"error\"));\n\n // WHEN\n const result = await datasource.getDappInfos({\n chainId: 1,\n address: \"0x0abc\",\n selector: \"0x01ff\",\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\n \"[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos\",\n ),\n );\n });\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAW,QAGlB,OAAOC,MAAS,uCAQhB,OAAS,gCAAAC,MAAoC,sDAC7C,OAAOC,MAAa,qBAEpB,KAAK,KAAK,OAAO,EAEjB,MAAMC,EAAwBC,IACrB,CAAE,KAAMA,CAAI,GAGrB,SAAS,8BAA+B,IAAM,CAC5C,IAAIC,EACJ,MAAMC,EAAkB,CACtB,eAAgB,WAChB,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AKG,EACL,KAAMC,EACN,eAAgBC,CAClB,CACF,CAAC,EACD,KAAK,MAAMT,EAAO,SAAS,EAAE,kBAAkBa,CAAQ,EAGvD,MAAMC,EAAS,MAAMR,EAAW,aAAa,CAC3C,QAAS,EACT,QAAS,SACT,SAAU,QACZ,CAAC,EAGD,OAAOQ,EAAO,QAAQ,CAAC,EAAE,QAAQ,CAC/B,IAAKb,EACL,gBAAiB,CACf,gBAAiB,CAAC,WAAW,EAC7B,OAAQ,OACR,OAAQ,SACR,eAAgB,QAChB,UAAW,OACb,CACF,CAAC,CACH,CAAC,EAED,GAAG,oDAAqD,SAAY,CAElE,KAAK,MAAMD,EAAO,SAAS,EAAE,kBAAkB,IAAI,MAAM,OAAO,CAAC,EAGjE,MAAMc,EAAS,MAAMR,EAAW,aAAa,CAC3C,QAAS,EACT,QAAS,SACT,SAAU,QACZ,CAAC,EAGD,OAAOQ,EAAO,QAAQ,CAAC,EAAE,QACvB,IAAI,MACF,yEACF,CACF,CACF,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["axios", "ABI", "HttpExternalPluginDataSource", "PACKAGE", "axiosResponseBuilder", "dto", "datasource", "exampleB2c", "exampleAbis", "exampleB2cSignatures", "config", "version", "requestSpy", "response", "result"]
|
|
7
|
+
}
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { externalPluginTypes } from "../../external-plugin/di/externalPluginTypes";
|
|
4
|
-
import { ExternalPluginContextLoader } from "../../external-plugin/domain/ExternalPluginContextLoader";
|
|
5
|
-
export const externalPluginModuleFactory = () => new ContainerModule((bind, _unbind, _isBound, _rebind) => {
|
|
6
|
-
bind(externalPluginTypes.ExternalPluginDataSource).to(HttpExternalPluginDataSource);
|
|
7
|
-
bind(externalPluginTypes.ExternalPluginContextLoader).to(ExternalPluginContextLoader);
|
|
8
|
-
});
|
|
9
|
-
//# sourceMappingURL=externalPluginModuleFactory.js.map
|
|
1
|
+
import{ContainerModule as r}from"inversify";import{HttpExternalPluginDataSource as e}from"../../external-plugin/data/HttpExternalPluginDataSource";import{externalPluginTypes as o}from"../../external-plugin/di/externalPluginTypes";import{ExternalPluginContextLoader as n}from"../../external-plugin/domain/ExternalPluginContextLoader";const d=()=>new r((t,a,l,i)=>{t(o.ExternalPluginDataSource).to(e),t(o.ExternalPluginContextLoader).to(n)});export{d as externalPluginModuleFactory};
|
|
2
|
+
//# sourceMappingURL=externalPluginModuleFactory.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/external-plugin/di/externalPluginModuleFactory.ts"],
|
|
4
|
+
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpExternalPluginDataSource } from \"@/external-plugin/data/HttpExternalPluginDataSource\";\nimport { externalPluginTypes } from \"@/external-plugin/di/externalPluginTypes\";\nimport { ExternalPluginContextLoader } from \"@/external-plugin/domain/ExternalPluginContextLoader\";\n\nexport const externalPluginModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(externalPluginTypes.ExternalPluginDataSource).to(\n HttpExternalPluginDataSource,\n );\n bind(externalPluginTypes.ExternalPluginContextLoader).to(\n ExternalPluginContextLoader,\n );\n });\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,gCAAAC,MAAoC,sDAC7C,OAAS,uBAAAC,MAA2B,2CACpC,OAAS,+BAAAC,MAAmC,uDAErC,MAAMC,EAA8B,IACzC,IAAIJ,EAAgB,CAACK,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAKH,EAAoB,wBAAwB,EAAE,GACjDD,CACF,EACAI,EAAKH,EAAoB,2BAA2B,EAAE,GACpDC,CACF,CACF,CAAC",
|
|
6
|
+
"names": ["ContainerModule", "HttpExternalPluginDataSource", "externalPluginTypes", "ExternalPluginContextLoader", "externalPluginModuleFactory", "bind", "_unbind", "_isBound", "_rebind"]
|
|
7
|
+
}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
ExternalPluginContextLoader: Symbol.for("externalPluginContextLoader"),
|
|
4
|
-
};
|
|
5
|
-
//# sourceMappingURL=externalPluginTypes.js.map
|
|
1
|
+
const e={ExternalPluginDataSource:Symbol.for("externalPluginDataSource"),ExternalPluginContextLoader:Symbol.for("externalPluginContextLoader")};export{e as externalPluginTypes};
|
|
2
|
+
//# sourceMappingURL=externalPluginTypes.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/external-plugin/di/externalPluginTypes.ts"],
|
|
4
|
+
"sourcesContent": ["export const externalPluginTypes = {\n ExternalPluginDataSource: Symbol.for(\"externalPluginDataSource\"),\n ExternalPluginContextLoader: Symbol.for(\"externalPluginContextLoader\"),\n};\n"],
|
|
5
|
+
"mappings": "AAAO,MAAMA,EAAsB,CACjC,yBAA0B,OAAO,IAAI,0BAA0B,EAC/D,4BAA6B,OAAO,IAAI,6BAA6B,CACvE",
|
|
6
|
+
"names": ["externalPluginTypes"]
|
|
7
|
+
}
|
|
@@ -1,133 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
-
};
|
|
13
|
-
import { isHexaString } from "@ledgerhq/device-management-kit";
|
|
14
|
-
import { Interface } from "ethers";
|
|
15
|
-
import { inject, injectable } from "inversify";
|
|
16
|
-
import { EitherAsync, Left, Right } from "purify-ts";
|
|
17
|
-
import { externalPluginTypes } from "../../external-plugin/di/externalPluginTypes";
|
|
18
|
-
import { ClearSignContextType, } from "../../shared/model/ClearSignContext";
|
|
19
|
-
import { tokenTypes } from "../../token/di/tokenTypes";
|
|
20
|
-
let ExternalPluginContextLoader = class ExternalPluginContextLoader {
|
|
21
|
-
_externalPluginDataSource;
|
|
22
|
-
_tokenDataSource;
|
|
23
|
-
constructor(externalPluginDataSource, tokenDataSource) {
|
|
24
|
-
this._externalPluginDataSource = externalPluginDataSource;
|
|
25
|
-
this._tokenDataSource = tokenDataSource;
|
|
26
|
-
}
|
|
27
|
-
async load(transaction) {
|
|
28
|
-
if (!transaction.to || !transaction.data || transaction.data === "0x") {
|
|
29
|
-
return [];
|
|
30
|
-
}
|
|
31
|
-
const selector = transaction.data.slice(0, 10);
|
|
32
|
-
if (!isHexaString(selector)) {
|
|
33
|
-
return [
|
|
34
|
-
{
|
|
35
|
-
type: ClearSignContextType.ERROR,
|
|
36
|
-
error: new Error("Invalid selector"),
|
|
37
|
-
},
|
|
38
|
-
];
|
|
39
|
-
}
|
|
40
|
-
const eitherDappInfos = await this._externalPluginDataSource.getDappInfos({
|
|
41
|
-
address: transaction.to,
|
|
42
|
-
chainId: transaction.chainId,
|
|
43
|
-
selector,
|
|
44
|
-
});
|
|
45
|
-
return EitherAsync(async ({ liftEither }) => {
|
|
46
|
-
const dappInfos = await liftEither(eitherDappInfos);
|
|
47
|
-
// if the dappInfos is null, return an empty array
|
|
48
|
-
// this means that the selector is not a known selector
|
|
49
|
-
if (!dappInfos) {
|
|
50
|
-
return [];
|
|
51
|
-
}
|
|
52
|
-
const externalPluginContext = {
|
|
53
|
-
type: ClearSignContextType.EXTERNAL_PLUGIN,
|
|
54
|
-
payload: dappInfos.selectorDetails.serializedData.concat(dappInfos.selectorDetails.signature),
|
|
55
|
-
};
|
|
56
|
-
const decodedCallData = this.getDecodedCallData(dappInfos.abi, dappInfos.selectorDetails.method, transaction.data);
|
|
57
|
-
// if the call data cannot be decoded, return the error
|
|
58
|
-
// but also the externalPluginContext because it is still valid
|
|
59
|
-
if (decodedCallData.isLeft()) {
|
|
60
|
-
return [
|
|
61
|
-
{
|
|
62
|
-
type: ClearSignContextType.ERROR,
|
|
63
|
-
error: decodedCallData.extract(),
|
|
64
|
-
},
|
|
65
|
-
externalPluginContext,
|
|
66
|
-
];
|
|
67
|
-
}
|
|
68
|
-
// decodedCallData is a Right so we can extract it safely
|
|
69
|
-
const extractedDecodedCallData = decodedCallData.extract();
|
|
70
|
-
// get the token payload for each erc20OfInterest
|
|
71
|
-
// and return the payload or the error
|
|
72
|
-
const promises = dappInfos.selectorDetails.erc20OfInterest.map(async (erc20Path) => this.getTokenPayload(transaction, erc20Path, extractedDecodedCallData));
|
|
73
|
-
const tokensPayload = await Promise.all(promises);
|
|
74
|
-
// map the payload or the error to a ClearSignContext
|
|
75
|
-
const contexts = tokensPayload.map((eitherToken) => eitherToken.caseOf({
|
|
76
|
-
Left: (error) => ({ type: ClearSignContextType.ERROR, error }),
|
|
77
|
-
Right: (payload) => ({ type: ClearSignContextType.TOKEN, payload }),
|
|
78
|
-
}));
|
|
79
|
-
return [...contexts, externalPluginContext];
|
|
80
|
-
}).caseOf({
|
|
81
|
-
// parse all errors into ClearSignContext
|
|
82
|
-
Left: (error) => [{ type: ClearSignContextType.ERROR, error }],
|
|
83
|
-
Right: (contexts) => contexts,
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
getTokenPayload(transaction, erc20Path, decodedCallData) {
|
|
87
|
-
const address = this.getAddressFromPath(erc20Path, decodedCallData);
|
|
88
|
-
return EitherAsync(({ fromPromise }) => fromPromise(this._tokenDataSource.getTokenInfosPayload({
|
|
89
|
-
address,
|
|
90
|
-
chainId: transaction.chainId,
|
|
91
|
-
})));
|
|
92
|
-
}
|
|
93
|
-
getDecodedCallData(abi, method, data) {
|
|
94
|
-
try {
|
|
95
|
-
const contractInterface = new Interface(abi);
|
|
96
|
-
return Right(contractInterface.decodeFunctionData(method, data));
|
|
97
|
-
}
|
|
98
|
-
catch (_error) {
|
|
99
|
-
return Left(new Error("[ContextModule] ExternalPluginContextLoader: Unable to parse abi"));
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
getAddressFromPath(path, decodedCallData) {
|
|
103
|
-
// ethers.Result is a record string, any
|
|
104
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
105
|
-
let value = decodedCallData;
|
|
106
|
-
for (const key of path.split(".")) {
|
|
107
|
-
// In Solidity, a struct cannot begin with a number
|
|
108
|
-
// Additionally, when we use -1, it signifies the last element of the array.
|
|
109
|
-
if (key === "-1") {
|
|
110
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
111
|
-
value = value[value.length - 1];
|
|
112
|
-
}
|
|
113
|
-
else {
|
|
114
|
-
// This access can throw a RangeError error in case of an invalid key
|
|
115
|
-
// but is correctly caught by the liftEither above
|
|
116
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
117
|
-
value = value[key];
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
if (!isHexaString(value)) {
|
|
121
|
-
throw new Error("[ContextModule] ExternalPluginContextLoader: Unable to get address");
|
|
122
|
-
}
|
|
123
|
-
return value;
|
|
124
|
-
}
|
|
125
|
-
};
|
|
126
|
-
ExternalPluginContextLoader = __decorate([
|
|
127
|
-
injectable(),
|
|
128
|
-
__param(0, inject(externalPluginTypes.ExternalPluginDataSource)),
|
|
129
|
-
__param(1, inject(tokenTypes.TokenDataSource)),
|
|
130
|
-
__metadata("design:paramtypes", [Object, Object])
|
|
131
|
-
], ExternalPluginContextLoader);
|
|
132
|
-
export { ExternalPluginContextLoader };
|
|
133
|
-
//# sourceMappingURL=ExternalPluginContextLoader.js.map
|
|
1
|
+
var C=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var g=(s,e,a,r)=>{for(var t=r>1?void 0:r?S(e,a):e,o=s.length-1,n;o>=0;o--)(n=s[o])&&(t=(r?n(e,a,t):n(t))||t);return r&&t&&C(e,a,t),t},p=(s,e)=>(a,r)=>e(a,r,s);import{isHexaString as x}from"@ledgerhq/device-management-kit";import{Interface as y}from"ethers";import{inject as f,injectable as E}from"inversify";import{EitherAsync as m,Left as R,Right as P}from"purify-ts";import{externalPluginTypes as k}from"../../external-plugin/di/externalPluginTypes";import{ClearSignContextType as i}from"../../shared/model/ClearSignContext";import{tokenTypes as T}from"../../token/di/tokenTypes";let l=class{_externalPluginDataSource;_tokenDataSource;constructor(e,a){this._externalPluginDataSource=e,this._tokenDataSource=a}async load(e){if(!e.to||!e.data||e.data==="0x")return[];const a=e.data.slice(0,10);if(!x(a))return[{type:i.ERROR,error:new Error("Invalid selector")}];const r=await this._externalPluginDataSource.getDappInfos({address:e.to,chainId:e.chainId,selector:a});return m(async({liftEither:t})=>{const o=await t(r);if(!o)return[];const n={type:i.EXTERNAL_PLUGIN,payload:o.selectorDetails.serializedData.concat(o.selectorDetails.signature)},c=this.getDecodedCallData(o.abi,o.selectorDetails.method,e.data);if(c.isLeft())return[{type:i.ERROR,error:c.extract()},n];const D=c.extract(),h=o.selectorDetails.erc20OfInterest.map(async d=>this.getTokenPayload(e,d,D));return[...(await Promise.all(h)).map(d=>d.caseOf({Left:u=>({type:i.ERROR,error:u}),Right:u=>({type:i.TOKEN,payload:u})})),n]}).caseOf({Left:t=>[{type:i.ERROR,error:t}],Right:t=>t})}getTokenPayload(e,a,r){const t=this.getAddressFromPath(a,r);return m(({fromPromise:o})=>o(this._tokenDataSource.getTokenInfosPayload({address:t,chainId:e.chainId})))}getDecodedCallData(e,a,r){try{const t=new y(e);return P(t.decodeFunctionData(a,r))}catch{return R(new Error("[ContextModule] ExternalPluginContextLoader: Unable to parse abi"))}}getAddressFromPath(e,a){let r=a;for(const t of e.split("."))t==="-1"?r=r[r.length-1]:r=r[t];if(!x(r))throw new Error("[ContextModule] ExternalPluginContextLoader: Unable to get address");return r}};l=g([E(),p(0,f(k.ExternalPluginDataSource)),p(1,f(T.TokenDataSource))],l);export{l as ExternalPluginContextLoader};
|
|
2
|
+
//# sourceMappingURL=ExternalPluginContextLoader.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/external-plugin/domain/ExternalPluginContextLoader.ts"],
|
|
4
|
+
"sourcesContent": ["import { HexaString, isHexaString } from \"@ledgerhq/device-management-kit\";\nimport { ethers, Interface } from \"ethers\";\nimport { inject, injectable } from \"inversify\";\nimport { Either, EitherAsync, Left, Right } from \"purify-ts\";\n\nimport type { ExternalPluginDataSource } from \"@/external-plugin/data/ExternalPluginDataSource\";\nimport { externalPluginTypes } from \"@/external-plugin/di/externalPluginTypes\";\nimport { ContextLoader } from \"@/shared/domain/ContextLoader\";\nimport {\n ClearSignContext,\n ClearSignContextType,\n} from \"@/shared/model/ClearSignContext\";\nimport { TransactionContext } from \"@/shared/model/TransactionContext\";\nimport type { TokenDataSource } from \"@/token/data/TokenDataSource\";\nimport { tokenTypes } from \"@/token/di/tokenTypes\";\n\n@injectable()\nexport class ExternalPluginContextLoader implements ContextLoader {\n private _externalPluginDataSource: ExternalPluginDataSource;\n private _tokenDataSource: TokenDataSource;\n\n constructor(\n @inject(externalPluginTypes.ExternalPluginDataSource)\n externalPluginDataSource: ExternalPluginDataSource,\n @inject(tokenTypes.TokenDataSource) tokenDataSource: TokenDataSource,\n ) {\n this._externalPluginDataSource = externalPluginDataSource;\n this._tokenDataSource = tokenDataSource;\n }\n\n async load(transaction: TransactionContext): Promise<ClearSignContext[]> {\n if (!transaction.to || !transaction.data || transaction.data === \"0x\") {\n return [];\n }\n\n const selector = transaction.data.slice(0, 10);\n\n if (!isHexaString(selector)) {\n return [\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"Invalid selector\"),\n },\n ];\n }\n\n const eitherDappInfos = await this._externalPluginDataSource.getDappInfos({\n address: transaction.to,\n chainId: transaction.chainId,\n selector,\n });\n\n return EitherAsync<Error, ClearSignContext[]>(async ({ liftEither }) => {\n const dappInfos = await liftEither(eitherDappInfos);\n\n // if the dappInfos is null, return an empty array\n // this means that the selector is not a known selector\n if (!dappInfos) {\n return [];\n }\n\n const externalPluginContext: ClearSignContext = {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: dappInfos.selectorDetails.serializedData.concat(\n dappInfos.selectorDetails.signature,\n ),\n };\n\n const decodedCallData = this.getDecodedCallData(\n dappInfos.abi,\n dappInfos.selectorDetails.method,\n transaction.data!, // trasaction.data is not null and not infered correctly\n );\n\n // if the call data cannot be decoded, return the error\n // but also the externalPluginContext because it is still valid\n if (decodedCallData.isLeft()) {\n return [\n {\n type: ClearSignContextType.ERROR,\n error: decodedCallData.extract(),\n },\n externalPluginContext,\n ];\n }\n\n // decodedCallData is a Right so we can extract it safely\n const extractedDecodedCallData =\n decodedCallData.extract() as ethers.Result;\n\n // get the token payload for each erc20OfInterest\n // and return the payload or the error\n const promises = dappInfos.selectorDetails.erc20OfInterest.map(\n async (erc20Path) =>\n this.getTokenPayload(\n transaction,\n erc20Path,\n extractedDecodedCallData,\n ),\n );\n\n const tokensPayload = await Promise.all(promises);\n\n // map the payload or the error to a ClearSignContext\n const contexts: ClearSignContext[] = tokensPayload.map((eitherToken) =>\n eitherToken.caseOf<ClearSignContext>({\n Left: (error) => ({ type: ClearSignContextType.ERROR, error }),\n Right: (payload) => ({ type: ClearSignContextType.TOKEN, payload }),\n }),\n );\n\n return [...contexts, externalPluginContext];\n }).caseOf<ClearSignContext[]>({\n // parse all errors into ClearSignContext\n Left: (error) => [{ type: ClearSignContextType.ERROR, error }],\n Right: (contexts) => contexts,\n });\n }\n\n private getTokenPayload(\n transaction: TransactionContext,\n erc20Path: string,\n decodedCallData: ethers.Result,\n ) {\n const address = this.getAddressFromPath(erc20Path, decodedCallData);\n\n return EitherAsync<Error, string>(({ fromPromise }) =>\n fromPromise(\n this._tokenDataSource.getTokenInfosPayload({\n address,\n chainId: transaction.chainId,\n }),\n ),\n );\n }\n\n private getDecodedCallData(\n abi: object[],\n method: string,\n data: string,\n ): Either<Error, ethers.Result> {\n try {\n const contractInterface = new Interface(abi);\n return Right(contractInterface.decodeFunctionData(method, data));\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] ExternalPluginContextLoader: Unable to parse abi\",\n ),\n );\n }\n }\n\n private getAddressFromPath(\n path: string,\n decodedCallData: ethers.Result,\n ): HexaString {\n // ethers.Result is a record string, any\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let value: any = decodedCallData;\n for (const key of path.split(\".\")) {\n // In Solidity, a struct cannot begin with a number\n // Additionally, when we use -1, it signifies the last element of the array.\n if (key === \"-1\") {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n value = value[value.length - 1];\n } else {\n // This access can throw a RangeError error in case of an invalid key\n // but is correctly caught by the liftEither above\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access\n value = value[key];\n }\n }\n\n if (!isHexaString(value)) {\n throw new Error(\n \"[ContextModule] ExternalPluginContextLoader: Unable to get address\",\n );\n }\n\n return value;\n }\n}\n"],
|
|
5
|
+
"mappings": "iOAAA,OAAqB,gBAAAA,MAAoB,kCACzC,OAAiB,aAAAC,MAAiB,SAClC,OAAS,UAAAC,EAAQ,cAAAC,MAAkB,YACnC,OAAiB,eAAAC,EAAa,QAAAC,EAAM,SAAAC,MAAa,YAGjD,OAAS,uBAAAC,MAA2B,2CAEpC,OAEE,wBAAAC,MACK,kCAGP,OAAS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MZ,EAAqB,MAAO,QAAAY,CAAQ,EACnE,CAAC,CACH,EAEqBP,CAAqB,CAC5C,CAAC,EAAE,OAA2B,CAE5B,KAAOM,GAAU,CAAC,CAAE,KAAMX,EAAqB,MAAO,MAAAW,CAAM,CAAC,EAC7D,MAAQE,GAAaA,CACvB,CAAC,CACH,CAEQ,gBACNhB,EACAY,EACAH,EACA,CACA,MAAMQ,EAAU,KAAK,mBAAmBL,EAAWH,CAAe,EAElE,OAAOJ,EAA2B,CAAC,CAAE,YAAAa,CAAY,IAC/CA,EACE,KAAK,iBAAiB,qBAAqB,CACzC,QAAAD,EACA,QAASjB,EAAY,OACvB,CAAC,CACH,CACF,CACF,CAEQ,mBACNmB,EACAC,EACAC,EAC8B,CAC9B,GAAI,CACF,MAAMC,EAAoB,IAAIC,EAAUJ,CAAG,EAC3C,OAAOK,EAAMF,EAAkB,mBAAmBF,EAAQC,CAAI,CAAC,CACjE,MAAiB,CACf,OAAOI,EACL,IAAI,MACF,kEACF,CACF,CACF,CACF,CAEQ,mBACNC,EACAjB,EACY,CAGZ,IAAIkB,EAAalB,EACjB,UAAWmB,KAAOF,EAAK,MAAM,GAAG,EAG1BE,IAAQ,KAEVD,EAAQA,EAAMA,EAAM,OAAS,CAAC,EAK9BA,EAAQA,EAAMC,CAAG,EAIrB,GAAI,CAAC1B,EAAayB,CAAK,EACrB,MAAM,IAAI,MACR,oEACF,EAGF,OAAOA,CACT,CACF,EArKa9B,EAANgC,EAAA,CADNC,EAAW,EAMPC,EAAA,EAAAC,EAAOC,EAAoB,wBAAwB,GAEnDF,EAAA,EAAAC,EAAOE,EAAW,eAAe,IAPzBrC",
|
|
6
|
+
"names": ["isHexaString", "Interface", "inject", "injectable", "EitherAsync", "Left", "Right", "externalPluginTypes", "ClearSignContextType", "tokenTypes", "ExternalPluginContextLoader", "externalPluginDataSource", "tokenDataSource", "transaction", "selector", "isHexaString", "ClearSignContextType", "eitherDappInfos", "EitherAsync", "liftEither", "dappInfos", "externalPluginContext", "decodedCallData", "extractedDecodedCallData", "promises", "erc20Path", "eitherToken", "error", "payload", "contexts", "address", "fromPromise", "abi", "method", "data", "contractInterface", "Interface", "Right", "Left", "path", "value", "key", "__decorateClass", "injectable", "__decorateParam", "inject", "externalPluginTypes", "tokenTypes"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Interface as u}from"ethers";import{Left as i,Right as c}from"purify-ts";import o from"@/external-plugin/__tests__/abi.json";import{ExternalPluginContextLoader as m}from"../../external-plugin/domain/ExternalPluginContextLoader";import{ClearSignContextType as t}from"../../shared/model/ClearSignContext";const p=({abi:d,selectorDetails:s})=>({abi:d,selectorDetails:{erc20OfInterest:[],method:"",plugin:"",serializedData:"123456",signature:"7890",...s}}),l=(d,s,n)=>({to:"0x0",data:new u(JSON.stringify(d)).encodeFunctionData(s,n)});describe("ExternalPluginContextLoader",()=>{const d={getTokenInfosPayload:jest.fn()},s={getDappInfos:jest.fn()},n=new m(s,d);beforeEach(()=>{jest.clearAllMocks(),jest.spyOn(d,"getTokenInfosPayload").mockImplementation(({address:e})=>Promise.resolve(c(`payload-${e}`)))}),describe("load function",()=>{it("should return an empty array if no destination address is provided",()=>{const e={},a=()=>n.load(e);expect(a()).resolves.toEqual([])}),it("should return an empty array if data is undefined",async()=>{const e={to:"0x0"},a=await n.load(e);expect(a).toEqual([])}),it("should return an empty array if no data provided",async()=>{const e={to:"0x0",data:"0x"},a=await n.load(e);expect(a).toEqual([])}),it("should return an empty array if no dapp info is povided",async()=>{const e=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);jest.spyOn(s,"getDappInfos").mockResolvedValue(c(void 0));const a=await n.load(e);expect(a).toEqual([])}),it("should return e plugin if no erc20OfInterest is provided",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:[],method:"singleParam"}}),a=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);jest.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual([{type:t.EXTERNAL_PLUGIN,payload:"1234567890"}])}),it("should return a list of context responses when one erc20OfInterest is provided for a single parameter",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["fromToken"],method:"singleParam"}}),a=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);jest.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual(expect.arrayContaining([{type:t.EXTERNAL_PLUGIN,payload:"1234567890"},{type:t.TOKEN,payload:"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"}]))}),it("should return a context response with only set external plugin when one erc20OfInterest is provided for a single parameter but no payload is feched",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["fromToken"],method:"singleParam"}}),a=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);jest.spyOn(s,"getDappInfos").mockResolvedValue(c(e)),jest.spyOn(d,"getTokenInfosPayload").mockResolvedValue(i(Error("error")));const r=await n.load(a);expect(r).toEqual([{type:t.ERROR,error:new Error("error")},{type:t.EXTERNAL_PLUGIN,payload:"1234567890"}])}),it("should return a list of context responses when two erc20OfInterest are provided for two parameters",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["fromToken","toToken"],method:"multipleParams"}}),a=l(o,"multipleParams",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7"]);jest.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual(expect.arrayContaining([{type:t.EXTERNAL_PLUGIN,payload:"1234567890"},{type:t.TOKEN,payload:"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{type:t.TOKEN,payload:"payload-0xdAC17F958D2ee523a2206206994597C13D831ec7"}]))}),it("should return a list of context responses when one erc20OfInterest is an array",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["fromToken.0","fromToken.1","fromToken.2","fromToken.-1"],method:"arrayParam"}}),a=l(o,"arrayParam",[["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7","0xB8c77482e45F1F44dE1745F52C74426C631bDD52"]]);jest.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual([{type:t.TOKEN,payload:"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{type:t.TOKEN,payload:"payload-0xdAC17F958D2ee523a2206206994597C13D831ec7"},{type:t.TOKEN,payload:"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52"},{type:t.TOKEN,payload:"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52"},{type:t.EXTERNAL_PLUGIN,payload:"1234567890"}])}),it("should return an error when a token datasource returns an error",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["fromToken"],method:"singleParam"}}),a=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);jest.spyOn(s,"getDappInfos").mockResolvedValue(c(e)),jest.spyOn(d,"getTokenInfosPayload").mockResolvedValue(i(new Error("error")));const r=await n.load(a);expect(r).toEqual([{type:t.ERROR,error:new Error("error")},{type:t.EXTERNAL_PLUGIN,payload:"1234567890"}])}),it("should return an error when the abi is not conform",async()=>{const e=p({abi:[{fakeabi:"notworking"}],selectorDetails:{erc20OfInterest:["fromToken"],method:"singleParam"}}),a=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);jest.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual([{type:t.ERROR,error:new Error("[ContextModule] ExternalPluginContextLoader: Unable to parse abi")},{type:t.EXTERNAL_PLUGIN,payload:"1234567890"}])}),it("should throw an error when the erc20OfInterest doest not exist in the transaction",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["notFound"],method:"singleParam"}}),a=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);jest.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual([{type:t.ERROR,error:new Error("[ContextModule] ExternalPluginContextLoader: Unable to get address")}])}),it("should throw an error when an out-of-bounds element is present in erc20OfInterest",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["fromToken.3"],method:"arrayParam"}}),a=l(o,"arrayParam",[["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48","0xdAC17F958D2ee523a2206206994597C13D831ec7","0xB8c77482e45F1F44dE1745F52C74426C631bDD52"]]);jest.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual([{type:t.ERROR,error:new RangeError("out of result range")}])}),it("should return a list of context responses when one erc20OfInterest is a complex struct",async()=>{const e=p({abi:o,selectorDetails:{erc20OfInterest:["complexStruct.address1","complexStruct.param1.param2.0.param3.addresses.0","complexStruct.param1.param2.0.param3.addresses.1","complexStruct.param1.param2.0.param3.addresses.-1","complexStruct.param1.param2.1.param3.addresses.0","complexStruct.param1.param2.-1.param3.addresses.0"],method:"complexStructParam"}}),a=l(o,"complexStructParam",[{address1:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",param1:{param2:[{param3:{addresses:["0xdAC17F958D2ee523a2206206994597C13D831ec7","0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE"]}},{param3:{addresses:["0xB8c77482e45F1F44dE1745F52C74426C631bDD52"]}}]}}]);jest.spyOn(s,"getDappInfos").mockResolvedValue(c(e));const r=await n.load(a);expect(r).toEqual([{type:t.TOKEN,payload:"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"},{type:t.TOKEN,payload:"payload-0xdAC17F958D2ee523a2206206994597C13D831ec7"},{type:t.TOKEN,payload:"payload-0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE"},{type:t.TOKEN,payload:"payload-0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE"},{type:t.TOKEN,payload:"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52"},{type:t.TOKEN,payload:"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52"},{type:t.EXTERNAL_PLUGIN,payload:"1234567890"}])}),it("should return an error when datasource return a Left",async()=>{const e=l(o,"singleParam",["0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48"]);jest.spyOn(s,"getDappInfos").mockResolvedValue(i(new Error("error")));const a=await n.load(e);expect(a).toEqual([{type:t.ERROR,error:new Error("error")}])}),it("should return an error when transaction data is not a valid hex string",async()=>{const e={to:"0x0",data:"notAHexString"},a=await n.load(e);expect(a).toEqual([{type:t.ERROR,error:new Error("Invalid selector")}])})})});
|
|
2
|
+
//# sourceMappingURL=ExternalPluginContextLoader.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/external-plugin/domain/ExternalPluginContextLoader.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { Interface } from \"ethers\";\nimport { Left, Right } from \"purify-ts\";\n\nimport ABI from \"@/external-plugin/__tests__/abi.json\";\nimport { type ExternalPluginDataSource } from \"@/external-plugin/data/ExternalPluginDataSource\";\nimport { ExternalPluginContextLoader } from \"@/external-plugin/domain/ExternalPluginContextLoader\";\nimport { type DappInfos } from \"@/external-plugin/model/DappInfos\";\nimport { type SelectorDetails } from \"@/external-plugin/model/SelectorDetails\";\nimport { ClearSignContextType } from \"@/shared/model/ClearSignContext\";\nimport { type TransactionContext } from \"@/shared/model/TransactionContext\";\nimport { type TokenDataSource } from \"@/token/data/TokenDataSource\";\n\nconst dappInfosBuilder = ({\n abi,\n selectorDetails,\n}: {\n abi?: object[];\n selectorDetails?: Partial<SelectorDetails>;\n}) => {\n return {\n abi: abi,\n selectorDetails: {\n erc20OfInterest: [],\n method: \"\",\n plugin: \"\",\n serializedData: \"123456\",\n signature: \"7890\",\n ...selectorDetails,\n },\n } as DappInfos;\n};\n\nconst transactionBuilder = (\n abi: object,\n functionName: string,\n params: unknown[],\n): TransactionContext => {\n const contract = new Interface(JSON.stringify(abi));\n const data = contract.encodeFunctionData(functionName, params);\n return {\n to: \"0x0\",\n data,\n } as TransactionContext;\n};\n\ndescribe(\"ExternalPluginContextLoader\", () => {\n const mockTokenDataSource: TokenDataSource = {\n getTokenInfosPayload: jest.fn(),\n };\n const mockExternalPluginDataSource: ExternalPluginDataSource = {\n getDappInfos: jest.fn(),\n };\n const loader = new ExternalPluginContextLoader(\n mockExternalPluginDataSource,\n mockTokenDataSource,\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(\"should return an empty array if no destination address is provided\", () => {\n // GIVEN\n const transaction = {} as TransactionContext;\n\n // WHEN\n const promise = () => loader.load(transaction);\n\n // THEN\n expect(promise()).resolves.toEqual([]);\n });\n\n it(\"should return an empty array if data is undefined\", async () => {\n // GIVEN\n const transaction = { to: \"0x0\" } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if no data provided\", async () => {\n // GIVEN\n const transaction = { to: \"0x0\", data: \"0x\" } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return an empty array if no dapp info is povided\", async () => {\n // GIVEN\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n jest\n .spyOn(mockExternalPluginDataSource, \"getDappInfos\")\n .mockResolvedValue(Right(undefined));\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([]);\n });\n\n it(\"should return e plugin if no erc20OfInterest is provided\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [],\n method: \"singleParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n jest\n .spyOn(mockExternalPluginDataSource, \"getDappInfos\")\n .mockResolvedValue(Right(dappInfos));\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n ]);\n });\n\n it(\"should return a list of context responses when one erc20OfInterest is provided for a single parameter\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"fromToken\"],\n method: \"singleParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n jest\n .spyOn(mockExternalPluginDataSource, \"getDappInfos\")\n .mockResolvedValue(Right(dappInfos));\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual(\n expect.arrayContaining([\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n },\n ]),\n );\n });\n\n it(\"should return a context response with only set external plugin when one erc20OfInterest is provided for a single parameter but no payload is feched\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"fromToken\"],\n method: \"singleParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n jest\n .spyOn(mockExternalPluginDataSource, \"getDappInfos\")\n .mockResolvedValue(Right(dappInfos));\n jest\n .spyOn(mockTokenDataSource, \"getTokenInfosPayload\")\n .mockResolvedValue(Left(Error(\"error\")));\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"error\"),\n },\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n ]);\n });\n\n it(\"should return a list of context responses when two erc20OfInterest are provided for two parameters\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"fromToken\", \"toToken\"],\n method: \"multipleParams\",\n },\n });\n const transaction = transactionBuilder(ABI, \"multipleParams\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n ]);\n jest\n .spyOn(mockExternalPluginDataSource, \"getDappInfos\")\n .mockResolvedValue(Right(dappInfos));\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual(\n expect.arrayContaining([\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n },\n ]),\n );\n });\n\n it(\"should return a list of context responses when one erc20OfInterest is an array\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\n \"fromToken.0\",\n \"fromToken.1\",\n \"fromToken.2\",\n \"fromToken.-1\",\n ],\n method: \"arrayParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"arrayParam\", [\n [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n \"0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\n ],\n ]);\n jest\n .spyOn(mockExternalPluginDataSource, \"getDappInfos\")\n .mockResolvedValue(Right(dappInfos));\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n },\n // fromToken.2\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\n },\n // fromToken.-1\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\n },\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n ]);\n });\n\n it(\"should return an error when a token datasource returns an error\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"fromToken\"],\n method: \"singleParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n jest\n .spyOn(mockExternalPluginDataSource, \"getDappInfos\")\n .mockResolvedValue(Right(dappInfos));\n jest\n .spyOn(mockTokenDataSource, \"getTokenInfosPayload\")\n .mockResolvedValue(Left(new Error(\"error\")));\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"error\"),\n },\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n ]);\n });\n\n it(\"should return an error when the abi is not conform\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: [{ fakeabi: \"notworking\" }],\n selectorDetails: {\n erc20OfInterest: [\"fromToken\"],\n method: \"singleParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n jest\n .spyOn(mockExternalPluginDataSource, \"getDappInfos\")\n .mockResolvedValue(Right(dappInfos));\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\n \"[ContextModule] ExternalPluginContextLoader: Unable to parse abi\",\n ),\n },\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n ]);\n });\n\n it(\"should throw an error when the erc20OfInterest doest not exist in the transaction\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"notFound\"],\n method: \"singleParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n jest\n .spyOn(mockExternalPluginDataSource, \"getDappInfos\")\n .mockResolvedValue(Right(dappInfos));\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\n \"[ContextModule] ExternalPluginContextLoader: Unable to get address\",\n ),\n },\n ]);\n });\n\n it(\"should throw an error when an out-of-bounds element is present in erc20OfInterest\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\"fromToken.3\"],\n method: \"arrayParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"arrayParam\", [\n [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n \"0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\n ],\n ]);\n jest\n .spyOn(mockExternalPluginDataSource, \"getDappInfos\")\n .mockResolvedValue(Right(dappInfos));\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new RangeError(\"out of result range\"),\n },\n ]);\n });\n\n it(\"should return a list of context responses when one erc20OfInterest is a complex struct\", async () => {\n // GIVEN\n const dappInfos = dappInfosBuilder({\n abi: ABI,\n selectorDetails: {\n erc20OfInterest: [\n \"complexStruct.address1\",\n \"complexStruct.param1.param2.0.param3.addresses.0\",\n \"complexStruct.param1.param2.0.param3.addresses.1\",\n \"complexStruct.param1.param2.0.param3.addresses.-1\",\n \"complexStruct.param1.param2.1.param3.addresses.0\",\n \"complexStruct.param1.param2.-1.param3.addresses.0\",\n ],\n method: \"complexStructParam\",\n },\n });\n const transaction = transactionBuilder(ABI, \"complexStructParam\", [\n {\n address1: \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n param1: {\n param2: [\n {\n param3: {\n addresses: [\n \"0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n \"0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE\",\n ],\n },\n },\n {\n param3: {\n addresses: [\"0xB8c77482e45F1F44dE1745F52C74426C631bDD52\"],\n },\n },\n ],\n },\n },\n ]);\n jest\n .spyOn(mockExternalPluginDataSource, \"getDappInfos\")\n .mockResolvedValue(Right(dappInfos));\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xdAC17F958D2ee523a2206206994597C13D831ec7\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\n },\n {\n type: ClearSignContextType.TOKEN,\n payload: \"payload-0xB8c77482e45F1F44dE1745F52C74426C631bDD52\",\n },\n {\n type: ClearSignContextType.EXTERNAL_PLUGIN,\n payload: \"1234567890\",\n },\n ]);\n });\n\n it(\"should return an error when datasource return a Left\", async () => {\n // GIVEN\n const transaction = transactionBuilder(ABI, \"singleParam\", [\n \"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48\",\n ]);\n jest\n .spyOn(mockExternalPluginDataSource, \"getDappInfos\")\n .mockResolvedValue(Left(new Error(\"error\")));\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"error\"),\n },\n ]);\n });\n\n it(\"should return an error when transaction data is not a valid hex string\", async () => {\n // GIVEN\n const transaction = {\n to: \"0x0\",\n data: \"notAHexString\",\n } as TransactionContext;\n\n // WHEN\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"Invalid selector\"),\n },\n ]);\n });\n });\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,aAAAA,MAAiB,SAC1B,OAAS,QAAAC,EAAM,SAAAC,MAAa,YAE5B,OAAOC,MAAS,uCAEhB,OAAS,+BAAAC,MAAmC,uDAG5C,OAAS,wBAAAC,MAA4B,kCAIrC,MAAMC,EAAmB,CAAC,CACxB,IAAAC,EACA,gBAAAC,CACF,KAIS,CACL,IAAKD,EACL,gBAAiB,CACf,gBAAiB,CAAC,EAClB,OAAQ,GACR,OAAQ,GACR,eAAgB,SAChB,UAAW,OACX,GAAGC,CACL,CACF,GAGIC,EAAqB,CACzBF,EACAG,EACAC,KAIO,CACL,GAAI,MACJ,KAJe,IAAIX,EAAU,KAAK,UAAUO,CAAG,CAAC,EAC5B,mBAAmBG,EAAcC,CAAM,CAI7D,GAGF,SAAS,8BAA+B,IAAM,CAC5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AMA,EAAqB,MAC3B,QAAS,oDACX,EACA,CACE,KAAMA,EAAqB,MAC3B,QAAS,oDACX,EACA,CACE,KAAMA,EAAqB,MAC3B,QAAS,oDACX,EACA,CACE,KAAMA,EAAqB,MAC3B,QAAS,oDACX,EACA,CACE,KAAMA,EAAqB,gBAC3B,QAAS,YACX,CACF,CAAC,CACH,CAAC,EAED,GAAG,uDAAwD,SAAY,CAErE,MAAMW,EAAcP,EAAmBN,EAAK,cAAe,CACzD,4CACF,CAAC,EACD,KACG,MAAMU,EAA8B,cAAc,EAClD,kBAAkBZ,EAAK,IAAI,MAAM,OAAO,CAAC,CAAC,EAG7C,MAAMiB,EAAS,MAAMJ,EAAO,KAAKE,CAAW,EAG5C,OAAOE,CAAM,EAAE,QAAQ,CACrB,CACE,KAAMb,EAAqB,MAC3B,MAAO,IAAI,MAAM,OAAO,CAC1B,CACF,CAAC,CACH,CAAC,EAED,GAAG,yEAA0E,SAAY,CAEvF,MAAMW,EAAc,CAClB,GAAI,MACJ,KAAM,eACR,EAGME,EAAS,MAAMJ,EAAO,KAAKE,CAAW,EAG5C,OAAOE,CAAM,EAAE,QAAQ,CACrB,CACE,KAAMb,EAAqB,MAC3B,MAAO,IAAI,MAAM,kBAAkB,CACrC,CACF,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["Interface", "Left", "Right", "ABI", "ExternalPluginContextLoader", "ClearSignContextType", "dappInfosBuilder", "abi", "selectorDetails", "transactionBuilder", "functionName", "params", "mockTokenDataSource", "mockExternalPluginDataSource", "loader", "address", "transaction", "promise", "result", "dappInfos"]
|
|
7
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=DappInfos.js.map
|
|
1
|
+
//# sourceMappingURL=DappInfos.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=SelectorDetails.js.map
|
|
1
|
+
//# sourceMappingURL=SelectorDetails.js.map
|
package/lib/esm/src/index.js
CHANGED
|
@@ -1,14 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
export * from "./ContextModuleBuilder";
|
|
4
|
-
export * from "./DefaultContextModule";
|
|
5
|
-
export * from "./external-plugin/domain/ExternalPluginContextLoader";
|
|
6
|
-
export * from "./forward-domain/domain/ForwardDomainContextLoader";
|
|
7
|
-
export * from "./nft/domain/NftContextLoader";
|
|
8
|
-
export * from "./shared/model/ClearSignContext";
|
|
9
|
-
export * from "./shared/model/TransactionContext";
|
|
10
|
-
export * from "./shared/model/TransactionSubset";
|
|
11
|
-
export * from "./shared/model/TypedDataClearSignContext";
|
|
12
|
-
export * from "./shared/model/TypedDataContext";
|
|
13
|
-
export * from "./token/domain/TokenContextLoader";
|
|
14
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export*from"./config/model/ContextModuleConfig";export*from"./ContextModule";export*from"./ContextModuleBuilder";export*from"./DefaultContextModule";export*from"./external-plugin/domain/ExternalPluginContextLoader";export*from"./nft/domain/NftContextLoader";export*from"./shared/domain/ContextLoader";export*from"./shared/model/ClearSignContext";export*from"./shared/model/GenericPath";export*from"./shared/model/TransactionContext";export*from"./shared/model/TransactionSubset";export*from"./shared/model/TypedDataClearSignContext";export*from"./shared/model/TypedDataContext";export*from"./token/domain/TokenContextLoader";export*from"./trusted-name/domain/TrustedNameContextLoader";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/lib/esm/src/index.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/index.ts"],
|
|
4
|
+
"sourcesContent": ["export * from \"./config/model/ContextModuleConfig\";\nexport * from \"./ContextModule\";\nexport * from \"./ContextModuleBuilder\";\nexport * from \"./DefaultContextModule\";\nexport * from \"./external-plugin/domain/ExternalPluginContextLoader\";\nexport * from \"./nft/domain/NftContextLoader\";\nexport * from \"./shared/domain/ContextLoader\";\nexport * from \"./shared/model/ClearSignContext\";\nexport * from \"./shared/model/GenericPath\";\nexport * from \"./shared/model/TransactionContext\";\nexport * from \"./shared/model/TransactionSubset\";\nexport * from \"./shared/model/TypedDataClearSignContext\";\nexport * from \"./shared/model/TypedDataContext\";\nexport * from \"./token/domain/TokenContextLoader\";\nexport * from \"./trusted-name/domain/TrustedNameContextLoader\";\n"],
|
|
5
|
+
"mappings": "AAAA,WAAc,qCACd,WAAc,kBACd,WAAc,yBACd,WAAc,yBACd,WAAc,uDACd,WAAc,gCACd,WAAc,gCACd,WAAc,kCACd,WAAc,6BACd,WAAc,oCACd,WAAc,mCACd,WAAc,2CACd,WAAc,kCACd,WAAc,oCACd,WAAc",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,51 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import axios from "axios";
|
|
8
|
-
import { injectable } from "inversify";
|
|
9
|
-
import { Left, Right } from "purify-ts";
|
|
10
|
-
import PACKAGE from "../../../package.json";
|
|
11
|
-
let HttpNftDataSource = class HttpNftDataSource {
|
|
12
|
-
async getSetPluginPayload({ chainId, address, selector, }) {
|
|
13
|
-
try {
|
|
14
|
-
const response = await axios.request({
|
|
15
|
-
method: "GET",
|
|
16
|
-
url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}/plugin-selector/${selector}`,
|
|
17
|
-
headers: {
|
|
18
|
-
"X-Ledger-Client-Version": `context-module/${PACKAGE.version}`,
|
|
19
|
-
},
|
|
20
|
-
});
|
|
21
|
-
return response.data.payload
|
|
22
|
-
? Right(response.data.payload)
|
|
23
|
-
: Left(new Error("[ContextModule] HttpNftDataSource: unexpected empty response"));
|
|
24
|
-
}
|
|
25
|
-
catch (_error) {
|
|
26
|
-
return Left(new Error("[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload"));
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
async getNftInfosPayload({ chainId, address, }) {
|
|
30
|
-
try {
|
|
31
|
-
const response = await axios.request({
|
|
32
|
-
method: "GET",
|
|
33
|
-
url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}`,
|
|
34
|
-
headers: {
|
|
35
|
-
"X-Ledger-Client-Version": `context-module/${PACKAGE.version}`,
|
|
36
|
-
},
|
|
37
|
-
});
|
|
38
|
-
return response.data.payload
|
|
39
|
-
? Right(response.data.payload)
|
|
40
|
-
: Left(new Error("[ContextModule] HttpNftDataSource: no nft metadata"));
|
|
41
|
-
}
|
|
42
|
-
catch (_error) {
|
|
43
|
-
return Left(new Error("[ContextModule] HttpNftDataSource: Failed to fetch nft informations"));
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
};
|
|
47
|
-
HttpNftDataSource = __decorate([
|
|
48
|
-
injectable()
|
|
49
|
-
], HttpNftDataSource);
|
|
50
|
-
export { HttpNftDataSource };
|
|
51
|
-
//# sourceMappingURL=HttpNftDataSource.js.map
|
|
1
|
+
var u=Object.defineProperty;var f=Object.getOwnPropertyDescriptor;var d=(i,r,o,e)=>{for(var t=e>1?void 0:e?f(r,o):r,s=i.length-1,l;s>=0;s--)(l=i[s])&&(t=(e?l(r,o,t):l(t))||t);return e&&t&&u(r,o,t),t};import m from"axios";import{injectable as g}from"inversify";import{Left as a,Right as p}from"purify-ts";import c from"../../../package.json";let n=class{async getSetPluginPayload({chainId:r,address:o,selector:e}){try{const t=await m.request({method:"GET",url:`https://nft.api.live.ledger.com/v1/ethereum/${r}/contracts/${o}/plugin-selector/${e}`,headers:{"X-Ledger-Client-Version":`context-module/${c.version}`}});return t.data.payload?p(t.data.payload):a(new Error("[ContextModule] HttpNftDataSource: unexpected empty response"))}catch{return a(new Error("[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload"))}}async getNftInfosPayload({chainId:r,address:o}){try{const e=await m.request({method:"GET",url:`https://nft.api.live.ledger.com/v1/ethereum/${r}/contracts/${o}`,headers:{"X-Ledger-Client-Version":`context-module/${c.version}`}});return e.data.payload?p(e.data.payload):a(new Error("[ContextModule] HttpNftDataSource: no nft metadata"))}catch{return a(new Error("[ContextModule] HttpNftDataSource: Failed to fetch nft informations"))}}};n=d([g()],n);export{n as HttpNftDataSource};
|
|
2
|
+
//# sourceMappingURL=HttpNftDataSource.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/nft/data/HttpNftDataSource.ts"],
|
|
4
|
+
"sourcesContent": ["import axios from \"axios\";\nimport { injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport {\n GetNftInformationsParams,\n GetSetPluginPayloadParams,\n NftDataSource,\n} from \"@/nft/data/NftDataSource\";\nimport PACKAGE from \"@root/package.json\";\n\n@injectable()\nexport class HttpNftDataSource implements NftDataSource {\n public async getSetPluginPayload({\n chainId,\n address,\n selector,\n }: GetSetPluginPayloadParams): Promise<Either<Error, string>> {\n try {\n const response = await axios.request<{ payload: string }>({\n method: \"GET\",\n url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}/plugin-selector/${selector}`,\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n return response.data.payload\n ? Right(response.data.payload)\n : Left(\n new Error(\n \"[ContextModule] HttpNftDataSource: unexpected empty response\",\n ),\n );\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload\",\n ),\n );\n }\n }\n\n public async getNftInfosPayload({\n chainId,\n address,\n }: GetNftInformationsParams): Promise<Either<Error, string>> {\n try {\n const response = await axios.request<{ payload: string }>({\n method: \"GET\",\n url: `https://nft.api.live.ledger.com/v1/ethereum/${chainId}/contracts/${address}`,\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n return response.data.payload\n ? Right(response.data.payload)\n : Left(new Error(\"[ContextModule] HttpNftDataSource: no nft metadata\"));\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch nft informations\",\n ),\n );\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "wMAAA,OAAOA,MAAW,QAClB,OAAS,cAAAC,MAAkB,YAC3B,OAAiB,QAAAC,EAAM,SAAAC,MAAa,YAOpC,OAAOC,MAAa,qBAGb,IAAMC,EAAN,KAAiD,CACtD,MAAa,oBAAoB,CAC/B,QAAAC,EACA,QAAAC,EACA,SAAAC,CACF,EAA8D,CAC5D,GAAI,CACF,MAAMC,EAAW,MAAMC,EAAM,QAA6B,CACxD,OAAQ,MACR,IAAK,+CAA+CJ,CAAO,cAAcC,CAAO,oBAAoBC,CAAQ,GAC5G,QAAS,CACP,0BAA2B,kBAAkBG,EAAQ,OAAO,EAC9D,CACF,CAAC,EAED,OAAOF,EAAS,KAAK,QACjBG,EAAMH,EAAS,KAAK,OAAO,EAC3BI,EACE,IAAI,MACF,8DACF,CACF,CACN,MAAiB,CACf,OAAOA,EACL,IAAI,MACF,uEACF,CACF,CACF,CACF,CAEA,MAAa,mBAAmB,CAC9B,QAAAP,EACA,QAAAC,CACF,EAA6D,CAC3D,GAAI,CACF,MAAME,EAAW,MAAMC,EAAM,QAA6B,CACxD,OAAQ,MACR,IAAK,+CAA+CJ,CAAO,cAAcC,CAAO,GAChF,QAAS,CACP,0BAA2B,kBAAkBI,EAAQ,OAAO,EAC9D,CACF,CAAC,EAED,OAAOF,EAAS,KAAK,QACjBG,EAAMH,EAAS,KAAK,OAAO,EAC3BI,EAAK,IAAI,MAAM,oDAAoD,CAAC,CAC1E,MAAiB,CACf,OAAOA,EACL,IAAI,MACF,qEACF,CACF,CACF,CACF,CACF,EAvDaR,EAANS,EAAA,CADNC,EAAW,GACCV",
|
|
6
|
+
"names": ["axios", "injectable", "Left", "Right", "PACKAGE", "HttpNftDataSource", "chainId", "address", "selector", "response", "axios", "PACKAGE", "Right", "Left", "__decorateClass", "injectable"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import o from"axios";import r from"../../../package.json";import{HttpNftDataSource as s}from"./HttpNftDataSource";jest.mock("axios");describe("HttpNftDataSource",()=>{let a;beforeAll(()=>{a=new s,jest.clearAllMocks()}),it("should call axios with the ledger client version header",async()=>{const e=`context-module/${r.version}`,t=jest.fn(()=>Promise.resolve({data:[]}));jest.spyOn(o,"request").mockImplementation(t),await a.getNftInfosPayload({address:"0x00",chainId:1}),await a.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"}),expect(t).toHaveBeenNthCalledWith(1,expect.objectContaining({headers:{"X-Ledger-Client-Version":e}})),expect(t).toHaveBeenNthCalledWith(2,expect.objectContaining({headers:{"X-Ledger-Client-Version":e}}))}),describe("getNftInfosPayload",()=>{it("should return an error when axios throws an error",async()=>{jest.spyOn(o,"request").mockRejectedValue(new Error("error"));const e=await a.getNftInfosPayload({address:"0x00",chainId:1});expect(e.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: Failed to fetch nft informations"))}),it("should return an error when the response is empty",async()=>{const e={data:{}};jest.spyOn(o,"request").mockResolvedValue(e);const t=await a.getNftInfosPayload({address:"0x00",chainId:1});expect(t.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: no nft metadata"))}),it("should return the payload",async()=>{const e={data:{payload:"payload"}};jest.spyOn(o,"request").mockResolvedValue(e);const t=await a.getNftInfosPayload({address:"0x00",chainId:1});expect(t.extract()).toEqual("payload")})}),describe("getSetPluginPayload",()=>{it("should return an error when axios throws an error",async()=>{jest.spyOn(o,"request").mockRejectedValue(new Error("error"));const e=await a.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"});expect(e.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload"))}),it("should return an error when the response is empty",async()=>{const e={data:{}};jest.spyOn(o,"request").mockResolvedValue(e);const t=await a.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"});expect(t.extract()).toEqual(new Error("[ContextModule] HttpNftDataSource: unexpected empty response"))}),it("should return the payload",async()=>{const e={data:{payload:"payload"}};jest.spyOn(o,"request").mockResolvedValue(e);const t=await a.getSetPluginPayload({address:"0x00",chainId:1,selector:"0x00"});expect(t.extract()).toEqual("payload")})})});
|
|
2
|
+
//# sourceMappingURL=HttpNftDataSource.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/nft/data/HttpNftDataSource.test.ts"],
|
|
4
|
+
"sourcesContent": ["import axios from \"axios\";\n\nimport PACKAGE from \"@root/package.json\";\n\nimport { HttpNftDataSource } from \"./HttpNftDataSource\";\nimport { type NftDataSource } from \"./NftDataSource\";\n\njest.mock(\"axios\");\n\ndescribe(\"HttpNftDataSource\", () => {\n let datasource: NftDataSource;\n\n beforeAll(() => {\n datasource = new HttpNftDataSource();\n jest.clearAllMocks();\n });\n\n it(\"should call axios with the ledger client version header\", async () => {\n // GIVEN\n const version = `context-module/${PACKAGE.version}`;\n const requestSpy = jest.fn(() => Promise.resolve({ data: [] }));\n jest.spyOn(axios, \"request\").mockImplementation(requestSpy);\n\n // WHEN\n await datasource.getNftInfosPayload({ address: \"0x00\", chainId: 1 });\n await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(requestSpy).toHaveBeenNthCalledWith(\n 1,\n expect.objectContaining({\n headers: { \"X-Ledger-Client-Version\": version },\n }),\n );\n expect(requestSpy).toHaveBeenNthCalledWith(\n 2,\n expect.objectContaining({\n headers: { \"X-Ledger-Client-Version\": version },\n }),\n );\n });\n\n describe(\"getNftInfosPayload\", () => {\n it(\"should return an error when axios throws an error\", async () => {\n // GIVEN\n jest.spyOn(axios, \"request\").mockRejectedValue(new Error(\"error\"));\n\n // WHEN\n const result = await datasource.getNftInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch nft informations\",\n ),\n );\n });\n\n it(\"should return an error when the response is empty\", async () => {\n // GIVEN\n const response = { data: {} };\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getNftInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\"[ContextModule] HttpNftDataSource: no nft metadata\"),\n );\n });\n\n it(\"should return the payload\", async () => {\n // GIVEN\n const response = { data: { payload: \"payload\" } };\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getNftInfosPayload({\n address: \"0x00\",\n chainId: 1,\n });\n\n // THEN\n expect(result.extract()).toEqual(\"payload\");\n });\n });\n\n describe(\"getSetPluginPayload\", () => {\n it(\"should return an error when axios throws an error\", async () => {\n // GIVEN\n jest.spyOn(axios, \"request\").mockRejectedValue(new Error(\"error\"));\n\n // WHEN\n const result = await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\n \"[ContextModule] HttpNftDataSource: Failed to fetch set plugin payload\",\n ),\n );\n });\n\n it(\"should return an error when the response is empty\", async () => {\n // GIVEN\n const response = { data: {} };\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(result.extract()).toEqual(\n new Error(\n \"[ContextModule] HttpNftDataSource: unexpected empty response\",\n ),\n );\n });\n\n it(\"should return the payload\", async () => {\n // GIVEN\n const response = { data: { payload: \"payload\" } };\n jest.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getSetPluginPayload({\n address: \"0x00\",\n chainId: 1,\n selector: \"0x00\",\n });\n\n // THEN\n expect(result.extract()).toEqual(\"payload\");\n });\n });\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAOA,MAAW,QAElB,OAAOC,MAAa,qBAEpB,OAAS,qBAAAC,MAAyB,sBAGlC,KAAK,KAAK,OAAO,EAEjB,SAAS,oBAAqB,IAAM,CAClC,IAAIC,EAEJ,UAAU,IAAM,CACdA,EAAa,IAAID,EACjB,KAAK,cAAc,CACrB,CAAC,EAED,GAAG,0DAA2D,SAAY,CAExE,MAAME,EAAU,kBAAkBH,EAAQ,OAAO,GAC3CI,EAAa,KAAK,GAAG,IAAM,QAAQ,QAAQ,CAAE,KAAM,CAAC,CAAE,CAAC,CAAC,EAC9D,KAAK,MAAML,EAAO,SAAS,EAAE,mBAAmBK,CAAU,EAG1D,MAAMF,EAAW,mBAAmB,CAAE,QAAS,OAAQ,QAAS,CAAE,CAAC,EACnE,MAAMA,EAAW,oBAAoB,CACnC,QAAS,OACT,QAAS,EACT,SAAU,MACZ,CAAC,EAGD,OAAOE,CAAU,EAAE,wBACjB,EACA,OAAO,iBAAiB,CACtB,QAAS,CAAE,0BAA2BD,CAAQ,CAChD,CAAC,CACH,EACA,OAAOC,CAAU,EAAE,wBACjB,EACA,OAAO,iBAAiB,CACtB,QAAS,CAAE,0BAA2BD,CAAQ,CAChD,CAAC,CACH,CACF,CAAC,EAED,SAAS,qBAAsB,IAAM,CACnC,GAAG,oDAAqD,SAAY,CAElE,KAAK,MAAMJ,EAAO,SAAS,EAAE,kBAAkB,IAAI,MAAM,OAAO,CAAC,EAGjE,MAAMM,EAAS,MAAMH,EAAW,mBAAmB,CACjD,QAAS,OACT,QAAS,CACX,CAAC,EAGD,OA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SAAY,CAE1C,MAAMC,EAAW,CAAE,KAAM,CAAE,QAAS,SAAU,CAAE,EAChD,KAAK,MAAMP,EAAO,SAAS,EAAE,kBAAkBO,CAAQ,EAGvD,MAAMD,EAAS,MAAMH,EAAW,oBAAoB,CAClD,QAAS,OACT,QAAS,EACT,SAAU,MACZ,CAAC,EAGD,OAAOG,EAAO,QAAQ,CAAC,EAAE,QAAQ,SAAS,CAC5C,CAAC,CACH,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["axios", "PACKAGE", "HttpNftDataSource", "datasource", "version", "requestSpy", "result", "response"]
|
|
7
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=NftDataSource.js.map
|
|
1
|
+
//# sourceMappingURL=NftDataSource.js.map
|
|
@@ -1,9 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { nftTypes } from "../../nft/di/nftTypes";
|
|
4
|
-
import { NftContextLoader } from "../../nft/domain/NftContextLoader";
|
|
5
|
-
export const nftModuleFactory = () => new ContainerModule((bind, _unbind, _isBound, _rebind) => {
|
|
6
|
-
bind(nftTypes.NftDataSource).to(HttpNftDataSource);
|
|
7
|
-
bind(nftTypes.NftContextLoader).to(NftContextLoader);
|
|
8
|
-
});
|
|
9
|
-
//# sourceMappingURL=nftModuleFactory.js.map
|
|
1
|
+
import{ContainerModule as r}from"inversify";import{HttpNftDataSource as e}from"../../nft/data/HttpNftDataSource";import{nftTypes as o}from"../../nft/di/nftTypes";import{NftContextLoader as n}from"../../nft/domain/NftContextLoader";const c=()=>new r((t,f,a,m)=>{t(o.NftDataSource).to(e),t(o.NftContextLoader).to(n)});export{c as nftModuleFactory};
|
|
2
|
+
//# sourceMappingURL=nftModuleFactory.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/nft/di/nftModuleFactory.ts"],
|
|
4
|
+
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpNftDataSource } from \"@/nft/data/HttpNftDataSource\";\nimport { nftTypes } from \"@/nft/di/nftTypes\";\nimport { NftContextLoader } from \"@/nft/domain/NftContextLoader\";\n\nexport const nftModuleFactory = () =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind(nftTypes.NftDataSource).to(HttpNftDataSource);\n bind(nftTypes.NftContextLoader).to(NftContextLoader);\n });\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,qBAAAC,MAAyB,+BAClC,OAAS,YAAAC,MAAgB,oBACzB,OAAS,oBAAAC,MAAwB,gCAE1B,MAAMC,EAAmB,IAC9B,IAAIJ,EAAgB,CAACK,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAAKH,EAAS,aAAa,EAAE,GAAGD,CAAiB,EACjDI,EAAKH,EAAS,gBAAgB,EAAE,GAAGC,CAAgB,CACrD,CAAC",
|
|
6
|
+
"names": ["ContainerModule", "HttpNftDataSource", "nftTypes", "NftContextLoader", "nftModuleFactory", "bind", "_unbind", "_isBound", "_rebind"]
|
|
7
|
+
}
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
|
|
3
|
-
NftContextLoader: Symbol.for("nftContextLoader"),
|
|
4
|
-
};
|
|
5
|
-
//# sourceMappingURL=nftTypes.js.map
|
|
1
|
+
const t={NftDataSource:Symbol.for("nftDataSource"),NftContextLoader:Symbol.for("nftContextLoader")};export{t as nftTypes};
|
|
2
|
+
//# sourceMappingURL=nftTypes.js.map
|