@ledgerhq/context-module 1.0.0 → 1.2.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 +54 -59
- package/lib/cjs/src/ContextModule.js +2 -3
- package/lib/cjs/src/ContextModule.js.map +7 -1
- package/lib/cjs/src/ContextModuleBuilder.js +2 -87
- package/lib/cjs/src/ContextModuleBuilder.js.map +7 -1
- package/lib/cjs/src/ContextModuleBuilder.test.js +2 -0
- package/lib/cjs/src/ContextModuleBuilder.test.js.map +7 -0
- package/lib/cjs/src/DefaultContextModule.js +2 -21
- package/lib/cjs/src/DefaultContextModule.js.map +7 -1
- package/lib/cjs/src/DefaultContextModule.test.js +2 -0
- package/lib/cjs/src/DefaultContextModule.test.js.map +7 -0
- package/lib/cjs/src/config/di/configModuleFactory.js +2 -10
- package/lib/cjs/src/config/di/configModuleFactory.js.map +7 -1
- package/lib/cjs/src/config/di/configTypes.js +2 -7
- package/lib/cjs/src/config/di/configTypes.js.map +7 -1
- package/lib/cjs/src/config/model/ContextModuleConfig.js +2 -3
- package/lib/cjs/src/config/model/ContextModuleConfig.js.map +7 -1
- package/lib/cjs/src/di.js +2 -17
- package/lib/cjs/src/di.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/DAppDto.js +2 -3
- package/lib/cjs/src/external-plugin/data/DAppDto.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js +2 -3
- package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -83
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
- package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js +2 -13
- package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
- package/lib/cjs/src/external-plugin/di/externalPluginTypes.js +2 -8
- package/lib/cjs/src/external-plugin/di/externalPluginTypes.js.map +7 -1
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -136
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
- package/lib/cjs/src/external-plugin/model/DappInfos.js +2 -3
- package/lib/cjs/src/external-plugin/model/DappInfos.js.map +7 -1
- package/lib/cjs/src/external-plugin/model/SelectorDetails.js +2 -3
- package/lib/cjs/src/external-plugin/model/SelectorDetails.js.map +7 -1
- package/lib/cjs/src/index.js +2 -30
- package/lib/cjs/src/index.js.map +7 -1
- package/lib/cjs/src/nft/data/HttpNftDataSource.js +2 -57
- package/lib/cjs/src/nft/data/HttpNftDataSource.js.map +7 -1
- package/lib/cjs/src/nft/data/HttpNftDataSource.test.js +2 -0
- package/lib/cjs/src/nft/data/HttpNftDataSource.test.js.map +7 -0
- package/lib/cjs/src/nft/data/NftDataSource.js +2 -3
- package/lib/cjs/src/nft/data/NftDataSource.js.map +7 -1
- package/lib/cjs/src/nft/di/nftModuleFactory.js +2 -13
- package/lib/cjs/src/nft/di/nftModuleFactory.js.map +7 -1
- package/lib/cjs/src/nft/di/nftTypes.js +2 -8
- package/lib/cjs/src/nft/di/nftTypes.js.map +7 -1
- package/lib/cjs/src/nft/domain/NftContextLoader.js +2 -111
- package/lib/cjs/src/nft/domain/NftContextLoader.js.map +7 -1
- package/lib/cjs/src/nft/domain/NftContextLoader.test.js +2 -0
- package/lib/cjs/src/nft/domain/NftContextLoader.test.js.map +7 -0
- package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.js +2 -0
- package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.js.map +7 -0
- package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.test.js +2 -0
- package/lib/cjs/src/pki/data/HttpPkiCertificateDataSource.test.js.map +7 -0
- package/lib/cjs/src/pki/data/PkiCertificateDataSource.js +2 -0
- package/lib/cjs/src/pki/data/PkiCertificateDataSource.js.map +7 -0
- package/lib/cjs/src/pki/data/pkiDataSourceTypes.js +2 -0
- package/lib/cjs/src/pki/data/pkiDataSourceTypes.js.map +7 -0
- package/lib/cjs/src/pki/di/pkiModuleFactory.js +2 -0
- package/lib/cjs/src/pki/di/pkiModuleFactory.js.map +7 -0
- package/lib/cjs/src/pki/di/pkiTypes.js +2 -0
- package/lib/cjs/src/pki/di/pkiTypes.js.map +7 -0
- package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.js +2 -0
- package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.js.map +7 -0
- package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.test.js +2 -0
- package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.test.js.map +7 -0
- package/lib/cjs/src/pki/domain/PkiCertificateLoader.js +2 -0
- package/lib/cjs/src/pki/domain/PkiCertificateLoader.js.map +7 -0
- package/lib/cjs/src/pki/model/KeyId.js +2 -0
- package/lib/cjs/src/pki/model/KeyId.js.map +7 -0
- package/lib/cjs/src/pki/model/KeyUsage.js +2 -0
- package/lib/cjs/src/pki/model/KeyUsage.js.map +7 -0
- package/lib/cjs/src/pki/model/PkiCertificate.js +2 -0
- package/lib/cjs/src/pki/model/PkiCertificate.js.map +7 -0
- package/lib/cjs/src/pki/model/PkiCertificateInfo.js +2 -0
- package/lib/cjs/src/pki/model/PkiCertificateInfo.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/SignatureTags.js +2 -0
- package/lib/cjs/src/shared/model/SignatureTags.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/shared/utils/HexStringUtils.test.js +2 -0
- package/lib/cjs/src/shared/utils/HexStringUtils.test.js.map +7 -0
- package/lib/cjs/src/shared/utils/KeyUsageMapper.js +2 -0
- package/lib/cjs/src/shared/utils/KeyUsageMapper.js.map +7 -0
- package/lib/cjs/src/shared/utils/KeyUsageMapper.test.js +2 -0
- package/lib/cjs/src/shared/utils/KeyUsageMapper.test.js.map +7 -0
- 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/cjs/src/uniswap/constants/plugin.js +2 -0
- package/lib/cjs/src/uniswap/constants/plugin.js.map +7 -0
- package/lib/cjs/src/uniswap/constants/uniswap.js +2 -0
- package/lib/cjs/src/uniswap/constants/uniswap.js.map +7 -0
- package/lib/cjs/src/uniswap/constants/weth.js +2 -0
- package/lib/cjs/src/uniswap/constants/weth.js.map +7 -0
- package/lib/cjs/src/uniswap/data/AbiDecoderDataSource.js +2 -0
- package/lib/cjs/src/uniswap/data/AbiDecoderDataSource.js.map +7 -0
- package/lib/cjs/src/uniswap/data/CommandDecoderDataSource.js +2 -0
- package/lib/cjs/src/uniswap/data/CommandDecoderDataSource.js.map +7 -0
- package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.js +2 -0
- package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.js.map +7 -0
- package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.test.js +2 -0
- package/lib/cjs/src/uniswap/data/DefaultCommandDecoderDataSource.test.js.map +7 -0
- package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.js +2 -0
- package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.js.map +7 -0
- package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.test.js +2 -0
- package/lib/cjs/src/uniswap/data/EthersAbiDecoderDataSource.test.js.map +7 -0
- package/lib/cjs/src/uniswap/di/uniswapModuleFactory.js +2 -0
- package/lib/cjs/src/uniswap/di/uniswapModuleFactory.js.map +7 -0
- package/lib/cjs/src/uniswap/di/uniswapTypes.js +2 -0
- package/lib/cjs/src/uniswap/di/uniswapTypes.js.map +7 -0
- package/lib/cjs/src/uniswap/domain/UniswapContextLoader.js +2 -0
- package/lib/cjs/src/uniswap/domain/UniswapContextLoader.js.map +7 -0
- package/lib/cjs/src/uniswap/domain/UniswapContextLoader.test.js +2 -0
- package/lib/cjs/src/uniswap/domain/UniswapContextLoader.test.js.map +7 -0
- package/lib/esm/index.js +2 -4
- package/lib/esm/index.js.map +7 -1
- package/lib/esm/package.json +54 -59
- package/lib/esm/src/ContextModule.js +1 -2
- package/lib/esm/src/ContextModule.js.map +7 -1
- package/lib/esm/src/ContextModuleBuilder.js +2 -83
- package/lib/esm/src/ContextModuleBuilder.js.map +7 -1
- package/lib/esm/src/ContextModuleBuilder.test.js +2 -0
- package/lib/esm/src/ContextModuleBuilder.test.js.map +7 -0
- package/lib/esm/src/DefaultContextModule.js +2 -17
- package/lib/esm/src/DefaultContextModule.js.map +7 -1
- package/lib/esm/src/DefaultContextModule.test.js +2 -0
- package/lib/esm/src/DefaultContextModule.test.js.map +7 -0
- package/lib/esm/src/config/di/configModuleFactory.js +2 -6
- package/lib/esm/src/config/di/configModuleFactory.js.map +7 -1
- package/lib/esm/src/config/di/configTypes.js +2 -4
- package/lib/esm/src/config/di/configTypes.js.map +7 -1
- package/lib/esm/src/config/model/ContextModuleConfig.js +1 -2
- package/lib/esm/src/config/model/ContextModuleConfig.js.map +7 -1
- package/lib/esm/src/di.js +2 -13
- package/lib/esm/src/di.js.map +7 -1
- package/lib/esm/src/external-plugin/data/DAppDto.js +1 -2
- package/lib/esm/src/external-plugin/data/DAppDto.js.map +7 -1
- package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js +1 -2
- package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -77
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
- package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js +2 -9
- package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
- package/lib/esm/src/external-plugin/di/externalPluginTypes.js +2 -5
- package/lib/esm/src/external-plugin/di/externalPluginTypes.js.map +7 -1
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -133
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
- package/lib/esm/src/external-plugin/model/DappInfos.js +1 -2
- package/lib/esm/src/external-plugin/model/DappInfos.js.map +7 -1
- package/lib/esm/src/external-plugin/model/SelectorDetails.js +1 -2
- package/lib/esm/src/external-plugin/model/SelectorDetails.js.map +7 -1
- package/lib/esm/src/index.js +2 -14
- package/lib/esm/src/index.js.map +7 -1
- package/lib/esm/src/nft/data/HttpNftDataSource.js +2 -51
- package/lib/esm/src/nft/data/HttpNftDataSource.js.map +7 -1
- package/lib/esm/src/nft/data/HttpNftDataSource.test.js +2 -0
- package/lib/esm/src/nft/data/HttpNftDataSource.test.js.map +7 -0
- package/lib/esm/src/nft/data/NftDataSource.js +1 -2
- package/lib/esm/src/nft/data/NftDataSource.js.map +7 -1
- package/lib/esm/src/nft/di/nftModuleFactory.js +2 -9
- package/lib/esm/src/nft/di/nftModuleFactory.js.map +7 -1
- package/lib/esm/src/nft/di/nftTypes.js +2 -5
- package/lib/esm/src/nft/di/nftTypes.js.map +7 -1
- package/lib/esm/src/nft/domain/NftContextLoader.js +2 -108
- package/lib/esm/src/nft/domain/NftContextLoader.js.map +7 -1
- package/lib/esm/src/nft/domain/NftContextLoader.test.js +2 -0
- package/lib/esm/src/nft/domain/NftContextLoader.test.js.map +7 -0
- package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.js +2 -0
- package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.js.map +7 -0
- package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.test.js +2 -0
- package/lib/esm/src/pki/data/HttpPkiCertificateDataSource.test.js.map +7 -0
- package/lib/esm/src/pki/data/PkiCertificateDataSource.js +1 -0
- package/lib/esm/src/pki/data/PkiCertificateDataSource.js.map +7 -0
- package/lib/esm/src/pki/data/pkiDataSourceTypes.js +1 -0
- package/lib/esm/src/pki/data/pkiDataSourceTypes.js.map +7 -0
- package/lib/esm/src/pki/di/pkiModuleFactory.js +2 -0
- package/lib/esm/src/pki/di/pkiModuleFactory.js.map +7 -0
- package/lib/esm/src/pki/di/pkiTypes.js +2 -0
- package/lib/esm/src/pki/di/pkiTypes.js.map +7 -0
- package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.js +2 -0
- package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.js.map +7 -0
- package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.test.js +2 -0
- package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.test.js.map +7 -0
- package/lib/esm/src/pki/domain/PkiCertificateLoader.js +1 -0
- package/lib/esm/src/pki/domain/PkiCertificateLoader.js.map +7 -0
- package/lib/esm/src/pki/model/KeyId.js +2 -0
- package/lib/esm/src/pki/model/KeyId.js.map +7 -0
- package/lib/esm/src/pki/model/KeyUsage.js +2 -0
- package/lib/esm/src/pki/model/KeyUsage.js.map +7 -0
- package/lib/esm/src/pki/model/PkiCertificate.js +1 -0
- package/lib/esm/src/pki/model/PkiCertificate.js.map +7 -0
- package/lib/esm/src/pki/model/PkiCertificateInfo.js +1 -0
- package/lib/esm/src/pki/model/PkiCertificateInfo.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/SignatureTags.js +2 -0
- package/lib/esm/src/shared/model/SignatureTags.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/shared/utils/HexStringUtils.test.js +2 -0
- package/lib/esm/src/shared/utils/HexStringUtils.test.js.map +7 -0
- package/lib/esm/src/shared/utils/KeyUsageMapper.js +2 -0
- package/lib/esm/src/shared/utils/KeyUsageMapper.js.map +7 -0
- package/lib/esm/src/shared/utils/KeyUsageMapper.test.js +2 -0
- package/lib/esm/src/shared/utils/KeyUsageMapper.test.js.map +7 -0
- 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/esm/src/uniswap/constants/plugin.js +2 -0
- package/lib/esm/src/uniswap/constants/plugin.js.map +7 -0
- package/lib/esm/src/uniswap/constants/uniswap.js +2 -0
- package/lib/esm/src/uniswap/constants/uniswap.js.map +7 -0
- package/lib/esm/src/uniswap/constants/weth.js +2 -0
- package/lib/esm/src/uniswap/constants/weth.js.map +7 -0
- package/lib/esm/src/uniswap/data/AbiDecoderDataSource.js +1 -0
- package/lib/esm/src/uniswap/data/AbiDecoderDataSource.js.map +7 -0
- package/lib/esm/src/uniswap/data/CommandDecoderDataSource.js +1 -0
- package/lib/esm/src/uniswap/data/CommandDecoderDataSource.js.map +7 -0
- package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.js +2 -0
- package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.js.map +7 -0
- package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.test.js +2 -0
- package/lib/esm/src/uniswap/data/DefaultCommandDecoderDataSource.test.js.map +7 -0
- package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.js +2 -0
- package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.js.map +7 -0
- package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.test.js +2 -0
- package/lib/esm/src/uniswap/data/EthersAbiDecoderDataSource.test.js.map +7 -0
- package/lib/esm/src/uniswap/di/uniswapModuleFactory.js +2 -0
- package/lib/esm/src/uniswap/di/uniswapModuleFactory.js.map +7 -0
- package/lib/esm/src/uniswap/di/uniswapTypes.js +2 -0
- package/lib/esm/src/uniswap/di/uniswapTypes.js.map +7 -0
- package/lib/esm/src/uniswap/domain/UniswapContextLoader.js +2 -0
- package/lib/esm/src/uniswap/domain/UniswapContextLoader.js.map +7 -0
- package/lib/esm/src/uniswap/domain/UniswapContextLoader.test.js +2 -0
- package/lib/esm/src/uniswap/domain/UniswapContextLoader.test.js.map +7 -0
- 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 +8 -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/pki/data/HttpPkiCertificateDataSource.d.ts +12 -0
- package/lib/types/src/pki/data/HttpPkiCertificateDataSource.d.ts.map +1 -0
- package/lib/types/src/pki/data/HttpPkiCertificateDataSource.test.d.ts +2 -0
- package/lib/types/src/pki/data/HttpPkiCertificateDataSource.test.d.ts.map +1 -0
- package/lib/types/src/pki/data/PkiCertificateDataSource.d.ts +7 -0
- package/lib/types/src/pki/data/PkiCertificateDataSource.d.ts.map +1 -0
- package/lib/types/src/pki/data/pkiDataSourceTypes.d.ts +23 -0
- package/lib/types/src/pki/data/pkiDataSourceTypes.d.ts.map +1 -0
- package/lib/types/src/pki/di/pkiModuleFactory.d.ts +3 -0
- package/lib/types/src/pki/di/pkiModuleFactory.d.ts.map +1 -0
- package/lib/types/src/pki/di/pkiTypes.d.ts +5 -0
- package/lib/types/src/pki/di/pkiTypes.d.ts.map +1 -0
- package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.d.ts +10 -0
- package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.d.ts.map +1 -0
- package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.test.d.ts +2 -0
- package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.test.d.ts.map +1 -0
- package/lib/types/src/pki/domain/PkiCertificateLoader.d.ts +6 -0
- package/lib/types/src/pki/domain/PkiCertificateLoader.d.ts.map +1 -0
- package/lib/types/src/pki/model/KeyId.d.ts +14 -0
- package/lib/types/src/pki/model/KeyId.d.ts.map +1 -0
- package/lib/types/src/pki/model/KeyUsage.d.ts +15 -0
- package/lib/types/src/pki/model/KeyUsage.d.ts.map +1 -0
- package/lib/types/src/pki/model/PkiCertificate.d.ts +5 -0
- package/lib/types/src/pki/model/PkiCertificate.d.ts.map +1 -0
- package/lib/types/src/pki/model/PkiCertificateInfo.d.ts +7 -0
- package/lib/types/src/pki/model/PkiCertificateInfo.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 +51 -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/SignatureTags.d.ts +3 -0
- package/lib/types/src/shared/model/SignatureTags.d.ts.map +1 -0
- package/lib/types/src/shared/model/TransactionContext.d.ts +21 -0
- package/lib/types/src/shared/model/TransactionContext.d.ts.map +1 -0
- package/lib/types/src/shared/utils/HexStringUtils.d.ts +5 -0
- package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts.map +1 -1
- package/lib/types/src/shared/utils/HexStringUtils.test.d.ts +2 -0
- package/lib/types/src/shared/utils/HexStringUtils.test.d.ts.map +1 -0
- package/lib/types/src/shared/utils/KeyUsageMapper.d.ts +6 -0
- package/lib/types/src/shared/utils/KeyUsageMapper.d.ts.map +1 -0
- package/lib/types/src/shared/utils/KeyUsageMapper.test.d.ts +2 -0
- package/lib/types/src/shared/utils/KeyUsageMapper.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts.map +1 -1
- package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts +2 -0
- package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/token/data/TokenDataSource.d.ts +1 -1
- package/lib/types/src/token/data/TokenDataSource.d.ts.map +1 -0
- package/lib/types/src/token/data/TokenDto.d.ts +16 -0
- package/lib/types/src/token/data/TokenDto.d.ts.map +1 -0
- package/lib/{cjs → types}/src/token/domain/TokenContextLoader.d.ts +2 -1
- package/lib/types/src/token/domain/TokenContextLoader.d.ts.map +1 -0
- package/lib/types/src/token/domain/TokenContextLoader.test.d.ts +2 -0
- package/lib/types/src/token/domain/TokenContextLoader.test.d.ts.map +1 -0
- package/lib/types/src/transaction/data/CalldataDto.d.ts +128 -0
- package/lib/types/src/transaction/data/CalldataDto.d.ts.map +1 -0
- package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts +23 -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 +13 -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/src/uniswap/constants/plugin.d.ts +3 -0
- package/lib/types/src/uniswap/constants/plugin.d.ts.map +1 -0
- package/lib/types/src/uniswap/constants/uniswap.d.ts +21 -0
- package/lib/types/src/uniswap/constants/uniswap.d.ts.map +1 -0
- package/lib/types/src/uniswap/constants/weth.d.ts +20 -0
- package/lib/types/src/uniswap/constants/weth.d.ts.map +1 -0
- package/lib/types/src/uniswap/data/AbiDecoderDataSource.d.ts +5 -0
- package/lib/types/src/uniswap/data/AbiDecoderDataSource.d.ts.map +1 -0
- package/lib/types/src/uniswap/data/CommandDecoderDataSource.d.ts +6 -0
- package/lib/types/src/uniswap/data/CommandDecoderDataSource.d.ts.map +1 -0
- package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.d.ts +14 -0
- package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.d.ts.map +1 -0
- package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.test.d.ts +2 -0
- package/lib/types/src/uniswap/data/DefaultCommandDecoderDataSource.test.d.ts.map +1 -0
- package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.d.ts +5 -0
- package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.d.ts.map +1 -0
- package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.test.d.ts +2 -0
- package/lib/types/src/uniswap/data/EthersAbiDecoderDataSource.test.d.ts.map +1 -0
- package/lib/types/src/uniswap/di/uniswapModuleFactory.d.ts +3 -0
- package/lib/types/src/uniswap/di/uniswapModuleFactory.d.ts.map +1 -0
- package/lib/types/src/uniswap/di/uniswapTypes.d.ts +6 -0
- package/lib/types/src/uniswap/di/uniswapTypes.d.ts.map +1 -0
- package/lib/types/src/uniswap/domain/UniswapContextLoader.d.ts +105 -0
- package/lib/types/src/uniswap/domain/UniswapContextLoader.d.ts.map +1 -0
- package/lib/types/src/uniswap/domain/UniswapContextLoader.test.d.ts +2 -0
- package/lib/types/src/uniswap/domain/UniswapContextLoader.test.d.ts.map +1 -0
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -0
- package/package.json +25 -30
- 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/shared/utils/HexStringUtils.d.ts +0 -4
- 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/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
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export const configModuleFactory = (config) => new ContainerModule((bind, _unbind, _isBound, _rebind) => {
|
|
4
|
-
bind(configTypes.Config).toConstantValue(config);
|
|
5
|
-
});
|
|
6
|
-
//# sourceMappingURL=configModuleFactory.js.map
|
|
1
|
+
import{ContainerModule as t}from"inversify";import{configTypes as e}from"./configTypes";const u=o=>new t((n,i,r,f)=>{n(e.Config).toConstantValue(o)});export{u as configModuleFactory};
|
|
2
|
+
//# sourceMappingURL=configModuleFactory.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/config/di/configModuleFactory.ts"],
|
|
4
|
+
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\n\nimport { configTypes } from \"./configTypes\";\n\nexport const configModuleFactory = (config: ContextModuleConfig) =>\n new ContainerModule((bind, _unbind, _isBound, _rebind) => {\n bind<ContextModuleConfig>(configTypes.Config).toConstantValue(config);\n });\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAIhC,OAAS,eAAAC,MAAmB,gBAErB,MAAMC,EAAuBC,GAClC,IAAIH,EAAgB,CAACI,EAAMC,EAASC,EAAUC,IAAY,CACxDH,EAA0BH,EAAY,MAAM,EAAE,gBAAgBE,CAAM,CACtE,CAAC",
|
|
6
|
+
"names": ["ContainerModule", "configTypes", "configModuleFactory", "config", "bind", "_unbind", "_isBound", "_rebind"]
|
|
7
|
+
}
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/config/di/configTypes.ts"],
|
|
4
|
+
"sourcesContent": ["export const configTypes = {\n Config: Symbol.for(\"config\"),\n};\n"],
|
|
5
|
+
"mappings": "AAAO,MAAMA,EAAc,CACzB,OAAQ,OAAO,IAAI,QAAQ,CAC7B",
|
|
6
|
+
"names": ["configTypes"]
|
|
7
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=ContextModuleConfig.js.map
|
|
1
|
+
//# sourceMappingURL=ContextModuleConfig.js.map
|
package/lib/esm/src/di.js
CHANGED
|
@@ -1,13 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { externalPluginModuleFactory } from "./external-plugin/di/externalPluginModuleFactory";
|
|
4
|
-
import { forwardDomainModuleFactory } from "./forward-domain/di/forwardDomainModuleFactory";
|
|
5
|
-
import { nftModuleFactory } from "./nft/di/nftModuleFactory";
|
|
6
|
-
import { tokenModuleFactory } from "./token/di/tokenModuleFactory";
|
|
7
|
-
import { typedDataModuleFactory } from "./typed-data/di/typedDataModuleFactory";
|
|
8
|
-
export const makeContainer = ({ config }) => {
|
|
9
|
-
const container = new Container();
|
|
10
|
-
container.load(configModuleFactory(config), externalPluginModuleFactory(), forwardDomainModuleFactory(), nftModuleFactory(), tokenModuleFactory(), typedDataModuleFactory());
|
|
11
|
-
return container;
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=di.js.map
|
|
1
|
+
import{Container as t}from"inversify";import{configModuleFactory as e}from"./config/di/configModuleFactory";import{externalPluginModuleFactory as n}from"./external-plugin/di/externalPluginModuleFactory";import{nftModuleFactory as a}from"./nft/di/nftModuleFactory";import{nanoPkiModuleFactory as i}from"./pki/di/pkiModuleFactory";import{tokenModuleFactory as m}from"./token/di/tokenModuleFactory";import{transactionModuleFactory as f}from"./transaction/di/transactionModuleFactory";import{trustedNameModuleFactory as p}from"./trusted-name/di/trustedNameModuleFactory";import{typedDataModuleFactory as c}from"./typed-data/di/typedDataModuleFactory";import{uniswapModuleFactory as u}from"./uniswap/di/uniswapModuleFactory";const w=({config:r})=>{const o=new t;return o.load(e(r),n(),a(),m(),f(),p(),c(),i(),u()),o};export{w as makeContainer};
|
|
2
|
+
//# sourceMappingURL=di.js.map
|
package/lib/esm/src/di.js.map
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/di.ts"],
|
|
4
|
+
"sourcesContent": ["import { Container } from \"inversify\";\n\nimport { configModuleFactory } from \"@/config/di/configModuleFactory\";\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { externalPluginModuleFactory } from \"@/external-plugin/di/externalPluginModuleFactory\";\nimport { nftModuleFactory } from \"@/nft/di/nftModuleFactory\";\nimport { nanoPkiModuleFactory } from \"@/pki/di/pkiModuleFactory\";\nimport { tokenModuleFactory } from \"@/token/di/tokenModuleFactory\";\nimport { transactionModuleFactory } from \"@/transaction/di/transactionModuleFactory\";\nimport { trustedNameModuleFactory } from \"@/trusted-name/di/trustedNameModuleFactory\";\nimport { typedDataModuleFactory } from \"@/typed-data/di/typedDataModuleFactory\";\nimport { uniswapModuleFactory } from \"@/uniswap/di/uniswapModuleFactory\";\n\ntype MakeContainerArgs = {\n config: ContextModuleConfig;\n};\n\nexport const makeContainer = ({ config }: MakeContainerArgs) => {\n const container = new Container();\n\n container.load(\n configModuleFactory(config),\n externalPluginModuleFactory(),\n nftModuleFactory(),\n tokenModuleFactory(),\n transactionModuleFactory(),\n trustedNameModuleFactory(),\n typedDataModuleFactory(),\n nanoPkiModuleFactory(),\n uniswapModuleFactory(),\n );\n\n return container;\n};\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,aAAAA,MAAiB,YAE1B,OAAS,uBAAAC,MAA2B,kCAEpC,OAAS,+BAAAC,MAAmC,mDAC5C,OAAS,oBAAAC,MAAwB,4BACjC,OAAS,wBAAAC,MAA4B,4BACrC,OAAS,sBAAAC,MAA0B,gCACnC,OAAS,4BAAAC,MAAgC,4CACzC,OAAS,4BAAAC,MAAgC,6CACzC,OAAS,0BAAAC,MAA8B,yCACvC,OAAS,wBAAAC,MAA4B,oCAM9B,MAAMC,EAAgB,CAAC,CAAE,OAAAC,CAAO,IAAyB,CAC9D,MAAMC,EAAY,IAAIZ,EAEtB,OAAAY,EAAU,KACRX,EAAoBU,CAAM,EAC1BT,EAA4B,EAC5BC,EAAiB,EACjBE,EAAmB,EACnBC,EAAyB,EACzBC,EAAyB,EACzBC,EAAuB,EACvBJ,EAAqB,EACrBK,EAAqB,CACvB,EAEOG,CACT",
|
|
6
|
+
"names": ["Container", "configModuleFactory", "externalPluginModuleFactory", "nftModuleFactory", "nanoPkiModuleFactory", "tokenModuleFactory", "transactionModuleFactory", "trustedNameModuleFactory", "typedDataModuleFactory", "uniswapModuleFactory", "makeContainer", "config", "container"]
|
|
7
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=DAppDto.js.map
|
|
1
|
+
//# sourceMappingURL=DAppDto.js.map
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=ExternalPluginDataSource.js.map
|
|
1
|
+
//# sourceMappingURL=ExternalPluginDataSource.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": [],
|
|
4
|
+
"sourcesContent": [],
|
|
5
|
+
"mappings": "",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,77 +1,2 @@
|
|
|
1
|
-
var
|
|
2
|
-
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
-
};
|
|
13
|
-
import axios from "axios";
|
|
14
|
-
import { inject, injectable } from "inversify";
|
|
15
|
-
import { Left, Right } from "purify-ts";
|
|
16
|
-
import { configTypes } from "../../config/di/configTypes";
|
|
17
|
-
import PACKAGE from "../../../package.json";
|
|
18
|
-
let HttpExternalPluginDataSource = class HttpExternalPluginDataSource {
|
|
19
|
-
config;
|
|
20
|
-
constructor(config) {
|
|
21
|
-
this.config = config;
|
|
22
|
-
}
|
|
23
|
-
async getDappInfos({ chainId, address, selector, }) {
|
|
24
|
-
try {
|
|
25
|
-
const dappInfos = await axios.request({
|
|
26
|
-
method: "GET",
|
|
27
|
-
url: `${this.config.cal.url}/dapps`,
|
|
28
|
-
params: {
|
|
29
|
-
output: "b2c,b2c_signatures,abis",
|
|
30
|
-
chain_id: chainId,
|
|
31
|
-
contracts: address,
|
|
32
|
-
},
|
|
33
|
-
headers: {
|
|
34
|
-
"X-Ledger-Client-Version": `context-module/${PACKAGE.version}`,
|
|
35
|
-
},
|
|
36
|
-
});
|
|
37
|
-
if (!dappInfos.data[0]) {
|
|
38
|
-
return Right(undefined);
|
|
39
|
-
}
|
|
40
|
-
// Normalize the address and selector
|
|
41
|
-
address = address.toLowerCase();
|
|
42
|
-
selector = `0x${selector.slice(2).toLowerCase()}`;
|
|
43
|
-
const { erc20OfInterest, method, plugin } = dappInfos.data[0].b2c?.contracts?.find((c) => c.address === address)
|
|
44
|
-
?.selectors?.[selector] || {};
|
|
45
|
-
const { signature, serialized_data: serializedData } = dappInfos.data[0].b2c_signatures?.[address]?.[selector] || {};
|
|
46
|
-
if (!erc20OfInterest ||
|
|
47
|
-
!method ||
|
|
48
|
-
!plugin ||
|
|
49
|
-
!signature ||
|
|
50
|
-
!serializedData) {
|
|
51
|
-
return Right(undefined);
|
|
52
|
-
}
|
|
53
|
-
const abi = dappInfos.data[0].abis?.[address];
|
|
54
|
-
if (!abi) {
|
|
55
|
-
return Right(undefined);
|
|
56
|
-
}
|
|
57
|
-
const selectorDetails = {
|
|
58
|
-
method,
|
|
59
|
-
plugin,
|
|
60
|
-
erc20OfInterest,
|
|
61
|
-
signature,
|
|
62
|
-
serializedData,
|
|
63
|
-
};
|
|
64
|
-
return Right({ selectorDetails, abi });
|
|
65
|
-
}
|
|
66
|
-
catch (_error) {
|
|
67
|
-
return Left(new Error("[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos"));
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
};
|
|
71
|
-
HttpExternalPluginDataSource = __decorate([
|
|
72
|
-
injectable(),
|
|
73
|
-
__param(0, inject(configTypes.Config)),
|
|
74
|
-
__metadata("design:paramtypes", [Object])
|
|
75
|
-
], HttpExternalPluginDataSource);
|
|
76
|
-
export { HttpExternalPluginDataSource };
|
|
77
|
-
//# sourceMappingURL=HttpExternalPluginDataSource.js.map
|
|
1
|
+
var D=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var u=(a,r,o,e)=>{for(var t=e>1?void 0:e?C(r,o):r,i=a.length-1,n;i>=0;i--)(n=a[i])&&(t=(e?n(r,o,t):n(t))||t);return e&&t&&D(r,o,t),t},d=(a,r)=>(o,e)=>r(o,e,a);import h from"axios";import{inject as b,injectable as x}from"inversify";import{Left as E,Right as s}from"purify-ts";import{configTypes as I}from"../../config/di/configTypes";import y from"../../../package.json";let f=class{constructor(r){this.config=r}async getDappInfos({chainId:r,address:o,selector:e}){try{const t=await h.request({method:"GET",url:`${this.config.cal.url}/dapps`,params:{output:"b2c,b2c_signatures,abis",chain_id:r,contracts:o},headers:{"X-Ledger-Client-Version":`context-module/${y.version}`}});if(!t.data[0])return s(void 0);o=o.toLowerCase(),e=`0x${e.slice(2).toLowerCase()}`;const{erc20OfInterest:i,method:n,plugin:p}=t.data[0].b2c?.contracts?.find(g=>g.address===o)?.selectors?.[e]||{},{signature:c,serialized_data:m}=t.data[0].b2c_signatures?.[o]?.[e]||{};if(!i||!n||!p||!c||!m)return s(void 0);const l=t.data[0].abis?.[o];return l?s({selectorDetails:{method:n,plugin:p,erc20OfInterest:i,signature:c,serializedData:m},abi:l}):s(void 0)}catch{return E(new Error("[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos"))}}};f=u([x(),d(0,b(I.Config))],f);export{f as HttpExternalPluginDataSource};
|
|
2
|
+
//# sourceMappingURL=HttpExternalPluginDataSource.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/external-plugin/data/HttpExternalPluginDataSource.ts"],
|
|
4
|
+
"sourcesContent": ["import axios from \"axios\";\nimport { inject, injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport { configTypes } from \"@/config/di/configTypes\";\nimport type { ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { DAppDto } from \"@/external-plugin/data/DAppDto\";\nimport {\n ExternalPluginDataSource,\n GetDappInfos,\n} from \"@/external-plugin/data/ExternalPluginDataSource\";\nimport { DappInfos } from \"@/external-plugin/model/DappInfos\";\nimport { SelectorDetails } from \"@/external-plugin/model/SelectorDetails\";\nimport PACKAGE from \"@root/package.json\";\n\n@injectable()\nexport class HttpExternalPluginDataSource implements ExternalPluginDataSource {\n constructor(\n @inject(configTypes.Config) private readonly config: ContextModuleConfig,\n ) {}\n\n async getDappInfos({\n chainId,\n address,\n selector,\n }: GetDappInfos): Promise<Either<Error, DappInfos | undefined>> {\n try {\n const dappInfos = await axios.request<DAppDto[]>({\n method: \"GET\",\n url: `${this.config.cal.url}/dapps`,\n params: {\n output: \"b2c,b2c_signatures,abis\",\n chain_id: chainId,\n contracts: address,\n },\n headers: {\n \"X-Ledger-Client-Version\": `context-module/${PACKAGE.version}`,\n },\n });\n\n if (!dappInfos.data[0]) {\n return Right(undefined);\n }\n\n // Normalize the address and selector\n address = address.toLowerCase();\n selector = `0x${selector.slice(2).toLowerCase()}`;\n\n const { erc20OfInterest, method, plugin } =\n dappInfos.data[0].b2c?.contracts?.find((c) => c.address === address)\n ?.selectors?.[selector] || {};\n const { signature, serialized_data: serializedData } =\n dappInfos.data[0].b2c_signatures?.[address]?.[selector] || {};\n\n if (\n !erc20OfInterest ||\n !method ||\n !plugin ||\n !signature ||\n !serializedData\n ) {\n return Right(undefined);\n }\n\n const abi = dappInfos.data[0].abis?.[address];\n\n if (!abi) {\n return Right(undefined);\n }\n\n const selectorDetails: SelectorDetails = {\n method,\n plugin,\n erc20OfInterest,\n signature,\n serializedData,\n };\n\n return Right({ selectorDetails, abi });\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos\",\n ),\n );\n }\n }\n}\n"],
|
|
5
|
+
"mappings": "iOAAA,OAAOA,MAAW,QAClB,OAAS,UAAAC,EAAQ,cAAAC,MAAkB,YACnC,OAAiB,QAAAC,EAAM,SAAAC,MAAa,YAEpC,OAAS,eAAAC,MAAmB,0BAS5B,OAAOC,MAAa,qBAGb,IAAMC,EAAN,KAAuE,CAC5E,YAC+CC,EAC7C,CAD6C,YAAAA,CAC5C,CAEH,MAAM,aAAa,CACjB,QAAAC,EACA,QAAAC,EACA,SAAAC,CACF,EAAgE,CAC9D,GAAI,CACF,MAAMC,EAAY,MAAMC,EAAM,QAAmB,CAC/C,OAAQ,MACR,IAAK,GAAG,KAAK,OAAO,IAAI,GAAG,SAC3B,OAAQ,CACN,OAAQ,0BACR,SAAUJ,EACV,UAAWC,CACb,EACA,QAAS,CACP,0BAA2B,kBAAkBI,EAAQ,OAAO,EAC9D,CACF,CAAC,EAED,GAAI,CAACF,EAAU,KAAK,CAAC,EACnB,OAAOG,EAAM,MAAS,EAIxBL,EAAUA,EAAQ,YAAY,EAC9BC,EAAW,KAAKA,EAAS,MAAM,CAAC,EAAE,YAAY,CAAC,GAE/C,KAAM,CAAE,gBAAAK,EAAiB,OAAAC,EAAQ,OAAAC,CAAO,EACtCN,EAAU,KAAK,CAAC,EAAE,KAAK,WAAW,KAAMO,GAAMA,EAAE,UAAYT,CAAO,GAC/D,YAAYC,CAAQ,GAAK,CAAC,EAC1B,CAAE,UAAAS,EAAW,gBAAiBC,CAAe,EACjDT,EAAU,KAAK,CAAC,EAAE,iBAAiBF,CAAO,IAAIC,CAAQ,GAAK,CAAC,EAE9D,GACE,CAACK,GACD,CAACC,GACD,CAACC,GACD,CAACE,GACD,CAACC,EAED,OAAON,EAAM,MAAS,EAGxB,MAAMO,EAAMV,EAAU,KAAK,CAAC,EAAE,OAAOF,CAAO,EAE5C,OAAKY,EAYEP,EAAM,CAAE,gBAR0B,CACvC,OAAAE,EACA,OAAAC,EACA,gBAAAF,EACA,UAAAI,EACA,eAAAC,CACF,EAEgC,IAAAC,CAAI,CAAC,EAX5BP,EAAM,MAAS,CAY1B,MAAiB,CACf,OAAOQ,EACL,IAAI,MACF,yEACF,CACF,CACF,CACF,CACF,EAvEahB,EAANiB,EAAA,CADNC,EAAW,EAGPC,EAAA,EAAAC,EAAOC,EAAY,MAAM,IAFjBrB",
|
|
6
|
+
"names": ["axios", "inject", "injectable", "Left", "Right", "configTypes", "PACKAGE", "HttpExternalPluginDataSource", "config", "chainId", "address", "selector", "dappInfos", "axios", "PACKAGE", "Right", "erc20OfInterest", "method", "plugin", "c", "signature", "serializedData", "abi", "Left", "__decorateClass", "injectable", "__decorateParam", "inject", "configTypes"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import n from"axios";import u from"@/external-plugin/__tests__/abi.json";import{HttpExternalPluginDataSource as d}from"../../external-plugin/data/HttpExternalPluginDataSource";import l from"../../../package.json";vi.mock("axios");const a=t=>({data:t});describe("HttpExternalPuginDataSource",()=>{let t;const i={blockchainName:"ethereum",chainId:1,contracts:[{address:"0x1ef",contractName:"otherName",selectors:{"0x01ee":{erc20OfInterest:["fromToken"],method:"swap",plugin:"plugin"}}},{address:"0x0abc",contractName:"name",selectors:{"0x01ff":{erc20OfInterest:["fromToken"],method:"swap",plugin:"plugin"}}}],name:"test"},r={"0x1ef":u,"0x0abc":u},o={"0x1ef":{"0x01ee":{plugin:"plugin",serialized_data:"0x001",signature:"0x002"}},"0x0abc":{"0x01ff":{plugin:"plugin",serialized_data:"0x001",signature:"0x002"}}};beforeAll(()=>{const s={cal:{url:"https://crypto-assets-service.api.ledger.com/v1"}};t=new d(s),vi.clearAllMocks()}),it("should call axios with the ledger client version header",async()=>{const s=`context-module/${l.version}`,e=vi.fn(()=>Promise.resolve({data:[]}));vi.spyOn(n,"request").mockImplementation(e),await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"}),expect(e).toHaveBeenCalledWith(expect.objectContaining({headers:{"X-Ledger-Client-Version":s}}))}),it("should return undefined when no abis is undefined",async()=>{const s=a([{b2c:i,b2c_signatures:o}]);vi.spyOn(n,"request").mockResolvedValue(s);const e=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(e.extract()).toEqual(void 0)}),it("should return undefined when no selectors",async()=>{const s=a([{abis:r,b2c_signatures:o}]);vi.spyOn(n,"request").mockResolvedValue(s);const e=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(e.extract()).toEqual(void 0)}),it("should return undefined when no abis data",async()=>{const s=a([{abis:{},b2c:i,b2c_signatures:o}]);vi.spyOn(n,"request").mockResolvedValue(s);const e=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(e.extract()).toEqual(void 0)}),it("should return undefined when no abis data",async()=>{const s=a([{abis:{},b2c:i,b2c_signatures:o}]);vi.spyOn(n,"request").mockResolvedValue(s);const e=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(e.extract()).toEqual(void 0)}),it("should return undefined when no abis data for the contract address",async()=>{const e=a([{abis:{"0x1":u},b2c:i,b2c_signatures:o}]);vi.spyOn(n,"request").mockResolvedValue(e);const c=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(c.extract()).toEqual(void 0)}),it("should return undefined when no b2c signature",async()=>{const s=a([{b2c:i,abis:r}]);vi.spyOn(n,"request").mockResolvedValue(s);const e=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(e.extract()).toEqual(void 0)}),it("should return undefined when no ecc20OfInterest",async()=>{const e=a([{b2c:{blockchainName:"ethereum",chainId:1,contracts:[{address:"0x0abc",contractName:"name",selectors:{"0x01ff":{method:"swap",plugin:"plugin"}}}],name:"test"},abis:r,b2c_signatures:o}]);vi.spyOn(n,"request").mockResolvedValue(e);const c=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(c.extract()).toEqual(void 0)}),it("should return undefined when no method",async()=>{const e=a([{b2c:{blockchainName:"ethereum",chainId:1,contracts:[{address:"0x0abc",contractName:"name",selectors:{"0x01ff":{erc20OfInterest:["fromToken"],plugin:"plugin"}}}],name:"test"},abis:r,b2c_signatures:o}]);vi.spyOn(n,"request").mockResolvedValue(e);const c=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(c.extract()).toEqual(void 0)}),it("should return undefined when no plugin",async()=>{const e=a([{b2c:{blockchainName:"ethereum",chainId:1,contracts:[{address:"0x0abc",contractName:"name",selectors:{"0x01ff":{erc20OfInterest:["fromToken"],method:"swap"}}}],name:"test"},abis:r,b2c_signatures:o}]);vi.spyOn(n,"request").mockResolvedValue(e);const c=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(c.extract()).toEqual(void 0)}),it("should return undefined when no method",async()=>{const e=a([{b2c:{blockchainName:"ethereum",chainId:1,contracts:[{address:"0x0abc",contractName:"name",selectors:{"0x01ff":{erc20OfInterest:["fromToken"],plugin:"plugin"}}}],name:"test"},abis:r,b2c_signatures:o}]);vi.spyOn(n,"request").mockResolvedValue(e);const c=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(c.extract()).toEqual(void 0)}),it("should return undefined when no signature",async()=>{const e=a([{b2c:i,abis:r,b2c_signatures:{"0x0abc":{"0x01ff":{plugin:"plugin",serialized_data:"0x001"}}}}]);vi.spyOn(n,"request").mockResolvedValue(e);const c=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(c.extract()).toEqual(void 0)}),it("should return undefined when no serialized data",async()=>{const e=a([{b2c:i,abis:r,b2c_signatures:{"0x0abc":{"0x01ff":{plugin:"plugin",signature:"0x002"}}}}]);vi.spyOn(n,"request").mockResolvedValue(e);const c=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(c.extract()).toEqual(void 0)}),it("should return a correct response",async()=>{const s=a([{b2c:i,abis:r,b2c_signatures:o}]);vi.spyOn(n,"request").mockResolvedValue(s);const e=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(e.extract()).toEqual({abi:u,selectorDetails:{erc20OfInterest:["fromToken"],method:"swap",plugin:"plugin",serializedData:"0x001",signature:"0x002"}})}),it("should normalize the address and selector",async()=>{const s=a([{b2c:i,abis:r,b2c_signatures:o}]);vi.spyOn(n,"request").mockResolvedValue(s);const e=await t.getDappInfos({chainId:1,address:"0x0AbC",selector:"0x01Ff"});expect(e.extract()).toEqual({abi:u,selectorDetails:{erc20OfInterest:["fromToken"],method:"swap",plugin:"plugin",serializedData:"0x001",signature:"0x002"}})}),it("should return an error when axios throws an error",async()=>{vi.spyOn(n,"request").mockRejectedValue(new Error("error"));const s=await t.getDappInfos({chainId:1,address:"0x0abc",selector:"0x01ff"});expect(s.extract()).toEqual(new Error("[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos"))})});
|
|
2
|
+
//# sourceMappingURL=HttpExternalPluginDataSource.test.js.map
|
|
@@ -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\nvi.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 vi.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 = vi.fn(() => Promise.resolve({ data: [] }));\n vi.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 vi.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 vi.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 vi.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 vi.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 vi.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 vi.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 vi.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 vi.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 vi.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 vi.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 vi.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 vi.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 vi.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 vi.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 vi.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": "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",
|
|
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": "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",
|
|
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:vi.fn()},s={getDappInfos:vi.fn()},n=new m(s,d);beforeEach(()=>{vi.clearAllMocks(),vi.spyOn(d,"getTokenInfosPayload").mockImplementation(({address:e})=>Promise.resolve(c(`payload-${e}`)))}),describe("load function",async()=>{it("should return an empty array if no destination address is provided",async()=>{const e={},a=()=>n.load(e);await 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"]);vi.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"]);vi.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"]);vi.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"]);vi.spyOn(s,"getDappInfos").mockResolvedValue(c(e)),vi.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"]);vi.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"]]);vi.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"]);vi.spyOn(s,"getDappInfos").mockResolvedValue(c(e)),vi.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"]);vi.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"]);vi.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"]]);vi.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"]}}]}}]);vi.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"]);vi.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
|