@ledgerhq/context-module 0.0.0-develop-20241011001048 → 0.0.0-develop-20241017000946
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.MD +202 -0
- package/lib/cjs/index.js +1126 -19
- package/lib/cjs/index.js.map +7 -1
- package/lib/esm/index.js +37618 -4
- package/lib/esm/index.js.map +7 -1
- 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.test.d.ts +2 -0
- package/lib/types/src/DefaultContextModule.test.d.ts.map +1 -0
- package/lib/types/src/config/model/ContextModuleConfig.d.ts +11 -0
- package/lib/types/src/config/model/ContextModuleConfig.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/forward-domain/data/HttpForwardDomainDataSource.test.d.ts +2 -0
- package/lib/types/src/forward-domain/data/HttpForwardDomainDataSource.test.d.ts.map +1 -0
- package/lib/types/src/forward-domain/domain/ForwardDomainContextLoader.test.d.ts +2 -0
- package/lib/types/src/forward-domain/domain/ForwardDomainContextLoader.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/index.d.ts +1 -0
- package/lib/{cjs → types}/src/index.d.ts.map +1 -1
- 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/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/{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/types/src/token/data/TokenDto.d.ts +16 -0
- package/lib/types/src/token/data/TokenDto.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/{esm → 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/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts +2 -0
- package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts.map +1 -0
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -0
- package/package.json +14 -22
- package/lib/cjs/package.json +0 -63
- package/lib/cjs/src/ContextModule.js +0 -3
- package/lib/cjs/src/ContextModule.js.map +0 -1
- package/lib/cjs/src/ContextModuleBuilder.js +0 -87
- package/lib/cjs/src/ContextModuleBuilder.js.map +0 -1
- package/lib/cjs/src/DefaultContextModule.js +0 -21
- package/lib/cjs/src/DefaultContextModule.js.map +0 -1
- package/lib/cjs/src/config/di/configModuleFactory.js +0 -10
- package/lib/cjs/src/config/di/configModuleFactory.js.map +0 -1
- package/lib/cjs/src/config/di/configTypes.js +0 -7
- package/lib/cjs/src/config/di/configTypes.js.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/config/model/ContextModuleConfig.js +0 -3
- package/lib/cjs/src/config/model/ContextModuleConfig.js.map +0 -1
- package/lib/cjs/src/di.js +0 -17
- package/lib/cjs/src/di.js.map +0 -1
- package/lib/cjs/src/external-plugin/data/DAppDto.js +0 -3
- package/lib/cjs/src/external-plugin/data/DAppDto.js.map +0 -1
- package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js +0 -3
- package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js.map +0 -1
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js +0 -83
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js.map +0 -1
- package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js +0 -13
- package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js.map +0 -1
- package/lib/cjs/src/external-plugin/di/externalPluginTypes.js +0 -8
- package/lib/cjs/src/external-plugin/di/externalPluginTypes.js.map +0 -1
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js +0 -136
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js.map +0 -1
- package/lib/cjs/src/external-plugin/model/DappInfos.js +0 -3
- package/lib/cjs/src/external-plugin/model/DappInfos.js.map +0 -1
- package/lib/cjs/src/external-plugin/model/SelectorDetails.js +0 -3
- package/lib/cjs/src/external-plugin/model/SelectorDetails.js.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.js +0 -40
- package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js.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.js +0 -8
- package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js.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.js +0 -30
- package/lib/cjs/src/index.js.map +0 -1
- package/lib/cjs/src/nft/data/HttpNftDataSource.js +0 -57
- package/lib/cjs/src/nft/data/HttpNftDataSource.js.map +0 -1
- package/lib/cjs/src/nft/data/NftDataSource.js +0 -3
- package/lib/cjs/src/nft/data/NftDataSource.js.map +0 -1
- package/lib/cjs/src/nft/di/nftModuleFactory.js +0 -13
- package/lib/cjs/src/nft/di/nftModuleFactory.js.map +0 -1
- package/lib/cjs/src/nft/di/nftTypes.js +0 -8
- package/lib/cjs/src/nft/di/nftTypes.js.map +0 -1
- package/lib/cjs/src/nft/domain/NftContextLoader.js +0 -111
- package/lib/cjs/src/nft/domain/NftContextLoader.js.map +0 -1
- package/lib/cjs/src/shared/domain/ContextLoader.js +0 -3
- package/lib/cjs/src/shared/domain/ContextLoader.js.map +0 -1
- package/lib/cjs/src/shared/model/ClearSignContext.js +0 -13
- package/lib/cjs/src/shared/model/ClearSignContext.js.map +0 -1
- package/lib/cjs/src/shared/model/TransactionContext.js +0 -3
- package/lib/cjs/src/shared/model/TransactionContext.js.map +0 -1
- package/lib/cjs/src/shared/model/TransactionSubset.js +0 -3
- package/lib/cjs/src/shared/model/TransactionSubset.js.map +0 -1
- package/lib/cjs/src/shared/model/TypedDataClearSignContext.js +0 -6
- package/lib/cjs/src/shared/model/TypedDataClearSignContext.js.map +0 -1
- package/lib/cjs/src/shared/model/TypedDataContext.js +0 -3
- package/lib/cjs/src/shared/model/TypedDataContext.js.map +0 -1
- package/lib/cjs/src/shared/utils/HexStringUtils.js +0 -15
- package/lib/cjs/src/shared/utils/HexStringUtils.js.map +0 -1
- package/lib/cjs/src/token/data/HttpTokenDataSource.js +0 -83
- package/lib/cjs/src/token/data/HttpTokenDataSource.js.map +0 -1
- package/lib/cjs/src/token/data/TokenDataSource.js +0 -3
- package/lib/cjs/src/token/data/TokenDataSource.js.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/data/TokenDto.js +0 -3
- package/lib/cjs/src/token/data/TokenDto.js.map +0 -1
- package/lib/cjs/src/token/di/tokenModuleFactory.js +0 -13
- package/lib/cjs/src/token/di/tokenModuleFactory.js.map +0 -1
- package/lib/cjs/src/token/di/tokenTypes.js +0 -8
- package/lib/cjs/src/token/di/tokenTypes.js.map +0 -1
- package/lib/cjs/src/token/domain/TokenContextLoader.js +0 -74
- package/lib/cjs/src/token/domain/TokenContextLoader.js.map +0 -1
- package/lib/cjs/src/typed-data/data/FiltersDto.d.ts +0 -55
- package/lib/cjs/src/typed-data/data/FiltersDto.d.ts.map +0 -1
- package/lib/cjs/src/typed-data/data/FiltersDto.js +0 -3
- package/lib/cjs/src/typed-data/data/FiltersDto.js.map +0 -1
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js +0 -163
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js.map +0 -1
- package/lib/cjs/src/typed-data/data/TypedDataDataSource.js +0 -3
- package/lib/cjs/src/typed-data/data/TypedDataDataSource.js.map +0 -1
- package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js +0 -13
- package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js.map +0 -1
- package/lib/cjs/src/typed-data/di/typedDataTypes.js +0 -8
- package/lib/cjs/src/typed-data/di/typedDataTypes.js.map +0 -1
- package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js +0 -127
- package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +0 -1
- package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js +0 -3
- package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js.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/package.json +0 -63
- package/lib/esm/src/ContextModule.d.ts +0 -9
- package/lib/esm/src/ContextModule.d.ts.map +0 -1
- package/lib/esm/src/ContextModule.js +0 -2
- package/lib/esm/src/ContextModule.js.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/ContextModuleBuilder.js +0 -83
- package/lib/esm/src/ContextModuleBuilder.js.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/DefaultContextModule.js +0 -17
- package/lib/esm/src/DefaultContextModule.js.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/configModuleFactory.js +0 -6
- package/lib/esm/src/config/di/configModuleFactory.js.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/di/configTypes.js +0 -4
- package/lib/esm/src/config/di/configTypes.js.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/config/model/ContextModuleConfig.js +0 -2
- package/lib/esm/src/config/model/ContextModuleConfig.js.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/di.js +0 -13
- package/lib/esm/src/di.js.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/DAppDto.js +0 -2
- package/lib/esm/src/external-plugin/data/DAppDto.js.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/ExternalPluginDataSource.js +0 -2
- package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js.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/data/HttpExternalPluginDataSource.js +0 -77
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js.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/externalPluginModuleFactory.js +0 -9
- package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js.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/di/externalPluginTypes.js +0 -5
- package/lib/esm/src/external-plugin/di/externalPluginTypes.js.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/domain/ExternalPluginContextLoader.js +0 -133
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js.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/DappInfos.js +0 -2
- package/lib/esm/src/external-plugin/model/DappInfos.js.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/external-plugin/model/SelectorDetails.js +0 -2
- package/lib/esm/src/external-plugin/model/SelectorDetails.js.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/index.js +0 -14
- package/lib/esm/src/index.js.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/HttpNftDataSource.js +0 -51
- package/lib/esm/src/nft/data/HttpNftDataSource.js.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/data/NftDataSource.js +0 -2
- package/lib/esm/src/nft/data/NftDataSource.js.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/nftModuleFactory.js +0 -9
- package/lib/esm/src/nft/di/nftModuleFactory.js.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/di/nftTypes.js +0 -5
- package/lib/esm/src/nft/di/nftTypes.js.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/nft/domain/NftContextLoader.js +0 -108
- package/lib/esm/src/nft/domain/NftContextLoader.js.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/domain/ContextLoader.js +0 -2
- package/lib/esm/src/shared/domain/ContextLoader.js.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/ClearSignContext.js +0 -10
- package/lib/esm/src/shared/model/ClearSignContext.js.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/TransactionContext.js +0 -2
- package/lib/esm/src/shared/model/TransactionContext.js.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/TransactionSubset.js +0 -2
- package/lib/esm/src/shared/model/TransactionSubset.js.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/TypedDataClearSignContext.js +0 -3
- package/lib/esm/src/shared/model/TypedDataClearSignContext.js.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/model/TypedDataContext.js +0 -2
- package/lib/esm/src/shared/model/TypedDataContext.js.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/shared/utils/HexStringUtils.js +0 -11
- package/lib/esm/src/shared/utils/HexStringUtils.js.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/HttpTokenDataSource.js +0 -77
- package/lib/esm/src/token/data/HttpTokenDataSource.js.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/TokenDataSource.js +0 -2
- package/lib/esm/src/token/data/TokenDataSource.js.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/data/TokenDto.js +0 -2
- package/lib/esm/src/token/data/TokenDto.js.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/tokenModuleFactory.js +0 -9
- package/lib/esm/src/token/di/tokenModuleFactory.js.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/di/tokenTypes.js +0 -5
- package/lib/esm/src/token/di/tokenTypes.js.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/token/domain/TokenContextLoader.js +0 -71
- package/lib/esm/src/token/domain/TokenContextLoader.js.map +0 -1
- package/lib/esm/src/typed-data/data/FiltersDto.d.ts.map +0 -1
- package/lib/esm/src/typed-data/data/FiltersDto.js +0 -2
- package/lib/esm/src/typed-data/data/FiltersDto.js.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/HttpTypedDataDataSource.js +0 -157
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js.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/data/TypedDataDataSource.js +0 -2
- package/lib/esm/src/typed-data/data/TypedDataDataSource.js.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/typedDataModuleFactory.js +0 -9
- package/lib/esm/src/typed-data/di/typedDataModuleFactory.js.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/di/typedDataTypes.js +0 -5
- package/lib/esm/src/typed-data/di/typedDataTypes.js.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/DefaultTypedDataContextLoader.js +0 -124
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js.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/src/typed-data/domain/TypedDataContextLoader.js +0 -2
- package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js.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/ContextModule.d.ts +0 -0
- /package/lib/{cjs → types}/src/ContextModule.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/ContextModuleBuilder.d.ts +0 -0
- /package/lib/{cjs → types}/src/ContextModuleBuilder.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/DefaultContextModule.d.ts +0 -0
- /package/lib/{cjs → types}/src/DefaultContextModule.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts +0 -0
- /package/lib/{cjs → types}/src/config/di/configModuleFactory.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/di.d.ts +0 -0
- /package/lib/{cjs → types}/src/di.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/ExternalPluginDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/data/ExternalPluginDataSource.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/DappInfos.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/model/DappInfos.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/forward-domain/data/ForwardDomainDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -0
- /package/lib/{cjs → types}/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/forward-domain/di/forwardDomainTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -0
- /package/lib/{cjs → types}/src/forward-domain/domain/ForwardDomainContextLoader.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/data/NftDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/nft/data/NftDataSource.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/nft/domain/NftContextLoader.d.ts +0 -0
- /package/lib/{cjs → types}/src/nft/domain/NftContextLoader.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/domain/ContextLoader.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/domain/ContextLoader.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/model/ClearSignContext.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/model/ClearSignContext.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/model/TransactionContext.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/model/TransactionContext.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/token/data/TokenDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/token/data/TokenDataSource.d.ts.map +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/token/domain/TokenContextLoader.d.ts +0 -0
- /package/lib/{cjs → types}/src/token/domain/TokenContextLoader.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/data/TypedDataDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/data/TypedDataDataSource.d.ts.map +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/DefaultTypedDataContextLoader.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -0
package/lib/cjs/package.json
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@ledgerhq/context-module",
|
|
3
|
-
"version": "0.1.0",
|
|
4
|
-
"license": "MIT",
|
|
5
|
-
"exports": {
|
|
6
|
-
".": {
|
|
7
|
-
"import": "./lib/esm/index.js",
|
|
8
|
-
"require": "./lib/cjs/index.js",
|
|
9
|
-
"default": "./index.ts",
|
|
10
|
-
"types": "./lib/esm/index.d.ts"
|
|
11
|
-
},
|
|
12
|
-
"./*.js": {
|
|
13
|
-
"import": "./lib/esm/*.js",
|
|
14
|
-
"require": "./lib/cjs/*.js",
|
|
15
|
-
"default": "./*.js",
|
|
16
|
-
"types": "./lib/esm/*.d.ts"
|
|
17
|
-
},
|
|
18
|
-
"./*": {
|
|
19
|
-
"import": "./lib/esm/*",
|
|
20
|
-
"require": "./lib/cjs/*",
|
|
21
|
-
"default": "./*",
|
|
22
|
-
"types": "./lib/esm/*"
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"files": [
|
|
26
|
-
"./lib"
|
|
27
|
-
],
|
|
28
|
-
"scripts": {
|
|
29
|
-
"build": "rimraf lib && zx scripts/build.mjs",
|
|
30
|
-
"dev": "concurrently \"pnpm dev:esm\" \"pnpm dev:cjs\"",
|
|
31
|
-
"dev:esm": "concurrently \"tsc --watch -p tsconfig.esm.json\" \"tsc-alias --watch -p tsconfig.esm.json\"",
|
|
32
|
-
"dev:cjs": "concurrently \"tsc --watch -p tsconfig.cjs.json\" \"tsc-alias --watch -p tsconfig.cjs.json\"",
|
|
33
|
-
"lint": "eslint",
|
|
34
|
-
"lint:fix": "pnpm lint --fix",
|
|
35
|
-
"postpack": "find . -name '*.tgz' -exec cp {} ../../../dist/ \\; ",
|
|
36
|
-
"prettier": "prettier . --check",
|
|
37
|
-
"prettier:fix": "prettier . --write",
|
|
38
|
-
"test": "jest",
|
|
39
|
-
"test:watch": "pnpm test -- --watch",
|
|
40
|
-
"test:coverage": "pnpm test -- --coverage",
|
|
41
|
-
"typecheck": "tsc --noEmit"
|
|
42
|
-
},
|
|
43
|
-
"devDependencies": {
|
|
44
|
-
"@ledgerhq/device-management-kit": "workspace:*",
|
|
45
|
-
"@ledgerhq/eslint-config-dsdk": "workspace:*",
|
|
46
|
-
"@ledgerhq/jest-config-dsdk": "workspace:*",
|
|
47
|
-
"@ledgerhq/prettier-config-dsdk": "workspace:*",
|
|
48
|
-
"@ledgerhq/tsconfig-dsdk": "workspace:*",
|
|
49
|
-
"@types/crypto-js": "^4.2.2",
|
|
50
|
-
"ts-node": "^10.9.2"
|
|
51
|
-
},
|
|
52
|
-
"dependencies": {
|
|
53
|
-
"axios": "^1.7.7",
|
|
54
|
-
"crypto-js": "^4.2.0",
|
|
55
|
-
"ethers": "^6.13.2",
|
|
56
|
-
"inversify": "^6.0.2",
|
|
57
|
-
"purify-ts": "^2.1.0",
|
|
58
|
-
"reflect-metadata": "^0.2.2"
|
|
59
|
-
},
|
|
60
|
-
"peerDependencies": {
|
|
61
|
-
"@ledgerhq/device-management-kit": "workspace:*"
|
|
62
|
-
}
|
|
63
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextModule.js","sourceRoot":"","sources":["../../../src/ContextModule.ts"],"names":[],"mappings":""}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ContextModuleBuilder = exports.DEFAULT_CONFIG = void 0;
|
|
4
|
-
const externalPluginTypes_1 = require("./external-plugin/di/externalPluginTypes");
|
|
5
|
-
const forwardDomainTypes_1 = require("./forward-domain/di/forwardDomainTypes");
|
|
6
|
-
const nftTypes_1 = require("./nft/di/nftTypes");
|
|
7
|
-
const tokenTypes_1 = require("./token/di/tokenTypes");
|
|
8
|
-
const typedDataTypes_1 = require("./typed-data/di/typedDataTypes");
|
|
9
|
-
const DefaultContextModule_1 = require("./DefaultContextModule");
|
|
10
|
-
const di_1 = require("./di");
|
|
11
|
-
const DEFAULT_CAL_URL = "https://crypto-assets-service.api.ledger.com/v1";
|
|
12
|
-
exports.DEFAULT_CONFIG = {
|
|
13
|
-
cal: {
|
|
14
|
-
url: DEFAULT_CAL_URL,
|
|
15
|
-
mode: "prod",
|
|
16
|
-
branch: "main",
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
class ContextModuleBuilder {
|
|
20
|
-
config = {};
|
|
21
|
-
customLoaders = [];
|
|
22
|
-
defaultLoaders = [];
|
|
23
|
-
customTypedDataLoader;
|
|
24
|
-
constructor() { }
|
|
25
|
-
/**
|
|
26
|
-
* Remove default loaders from the list of loaders
|
|
27
|
-
*
|
|
28
|
-
* @returns this
|
|
29
|
-
*/
|
|
30
|
-
withoutDefaultLoaders() {
|
|
31
|
-
this.defaultLoaders = [];
|
|
32
|
-
return this;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Add a custom loader to the list of loaders
|
|
36
|
-
*
|
|
37
|
-
* @param loader loader to add to the list of loaders
|
|
38
|
-
* @returns this
|
|
39
|
-
*/
|
|
40
|
-
addLoader(loader) {
|
|
41
|
-
this.customLoaders.push(loader);
|
|
42
|
-
return this;
|
|
43
|
-
}
|
|
44
|
-
/**
|
|
45
|
-
* Replace the default loader for typed data clear signing contexts
|
|
46
|
-
*
|
|
47
|
-
* @returns this
|
|
48
|
-
*/
|
|
49
|
-
withTypedDataLoader(loader) {
|
|
50
|
-
this.customTypedDataLoader = loader;
|
|
51
|
-
return this;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Set the configuration for the context module
|
|
55
|
-
*
|
|
56
|
-
* @param config configuration for the context module
|
|
57
|
-
* @returns this
|
|
58
|
-
*/
|
|
59
|
-
withConfig(config) {
|
|
60
|
-
this.config = config;
|
|
61
|
-
return this;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Build the context module
|
|
65
|
-
*
|
|
66
|
-
* @returns the context module
|
|
67
|
-
*/
|
|
68
|
-
build() {
|
|
69
|
-
const container = (0, di_1.makeContainer)({
|
|
70
|
-
config: { ...exports.DEFAULT_CONFIG, ...this.config },
|
|
71
|
-
});
|
|
72
|
-
this.defaultLoaders = [
|
|
73
|
-
container.get(externalPluginTypes_1.externalPluginTypes.ExternalPluginContextLoader),
|
|
74
|
-
container.get(forwardDomainTypes_1.forwardDomainTypes.ForwardDomainContextLoader),
|
|
75
|
-
container.get(nftTypes_1.nftTypes.NftContextLoader),
|
|
76
|
-
container.get(tokenTypes_1.tokenTypes.TokenContextLoader),
|
|
77
|
-
];
|
|
78
|
-
const defaultTypedDataLoader = container.get(typedDataTypes_1.typedDataTypes.TypedDataContextLoader);
|
|
79
|
-
const loaders = [...this.defaultLoaders, ...this.customLoaders];
|
|
80
|
-
return new DefaultContextModule_1.DefaultContextModule({
|
|
81
|
-
loaders,
|
|
82
|
-
typedDataLoader: this.customTypedDataLoader ?? defaultTypedDataLoader,
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
exports.ContextModuleBuilder = ContextModuleBuilder;
|
|
87
|
-
//# sourceMappingURL=ContextModuleBuilder.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextModuleBuilder.js","sourceRoot":"","sources":["../../../src/ContextModuleBuilder.ts"],"names":[],"mappings":";;;AAAA,kFAA+E;AAC/E,+EAA4E;AAC5E,gDAA6C;AAC7C,sDAAmD;AACnD,mEAAgE;AAUhE,iEAA8D;AAC9D,6BAAqC;AAErC,MAAM,eAAe,GAAG,iDAAiD,CAAC;AAE7D,QAAA,cAAc,GAAwB;IACjD,GAAG,EAAE;QACH,GAAG,EAAE,eAAe;QACpB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,MAAM;KACf;CACF,CAAC;AAEF,MAAa,oBAAoB;IACvB,MAAM,GAAiC,EAAE,CAAC;IAC1C,aAAa,GAAoB,EAAE,CAAC;IACpC,cAAc,GAAoB,EAAE,CAAC;IACrC,qBAAqB,CAA0B;IAEvD,gBAAe,CAAC;IAEhB;;;;OAIG;IACH,qBAAqB;QACnB,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;OAKG;IACH,SAAS,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;
|
|
4
|
-
class DefaultContextModule {
|
|
5
|
-
_loaders;
|
|
6
|
-
_typedDataLoader;
|
|
7
|
-
constructor(args) {
|
|
8
|
-
this._loaders = args.loaders;
|
|
9
|
-
this._typedDataLoader = args.typedDataLoader;
|
|
10
|
-
}
|
|
11
|
-
async getContexts(transaction) {
|
|
12
|
-
const promises = this._loaders.map((fetcher) => fetcher.load(transaction));
|
|
13
|
-
const responses = await Promise.all(promises);
|
|
14
|
-
return responses.flat();
|
|
15
|
-
}
|
|
16
|
-
async getTypedDataFilters(typedData) {
|
|
17
|
-
return this._typedDataLoader.load(typedData);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
exports.DefaultContextModule = DefaultContextModule;
|
|
21
|
-
//# sourceMappingURL=DefaultContextModule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultContextModule.js","sourceRoot":"","sources":["../../../src/DefaultContextModule.ts"],"names":[],"mappings":";;;AAcA,MAAa,oBAAoB;IACvB,QAAQ,CAAkB;IAC1B,gBAAgB,CAAyB;IAEjD,YAAY,IAAyC;QACnD,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC;QAC7B,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,eAAe,CAAC;IAC/C,CAAC;IAEM,KAAK,CAAC,WAAW,CACtB,WAA+B;QAE/B,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC;QAC3E,MAAM,SAAS,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;QAC9C,OAAO,SAAS,CAAC,IAAI,EAAE,CAAC;IAC1B,CAAC;IAEM,KAAK,CAAC,mBAAmB,CAC9B,SAA2B;QAE3B,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAC/C,CAAC;CACF;AAtBD,oDAsBC"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.configModuleFactory = void 0;
|
|
4
|
-
const inversify_1 = require("inversify");
|
|
5
|
-
const configTypes_1 = require("./configTypes");
|
|
6
|
-
const configModuleFactory = (config) => new inversify_1.ContainerModule((bind, _unbind, _isBound, _rebind) => {
|
|
7
|
-
bind(configTypes_1.configTypes.Config).toConstantValue(config);
|
|
8
|
-
});
|
|
9
|
-
exports.configModuleFactory = configModuleFactory;
|
|
10
|
-
//# sourceMappingURL=configModuleFactory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configModuleFactory.js","sourceRoot":"","sources":["../../../../../src/config/di/configModuleFactory.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAI5C,+CAA4C;AAErC,MAAM,mBAAmB,GAAG,CAAC,MAA2B,EAAE,EAAE,CACjE,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IACvD,IAAI,CAAsB,yBAAW,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;AACxE,CAAC,CAAC,CAAC;AAHQ,QAAA,mBAAmB,uBAG3B"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configTypes.js","sourceRoot":"","sources":["../../../../../src/config/di/configTypes.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC;CAC7B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextModuleConfig.d.ts","sourceRoot":"","sources":["../../../../../src/config/model/ContextModuleConfig.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,EAAE,sBAAsB,CAAC;CAC7B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ContextModuleConfig.js","sourceRoot":"","sources":["../../../../../src/config/model/ContextModuleConfig.ts"],"names":[],"mappings":""}
|
package/lib/cjs/src/di.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeContainer = void 0;
|
|
4
|
-
const inversify_1 = require("inversify");
|
|
5
|
-
const configModuleFactory_1 = require("./config/di/configModuleFactory");
|
|
6
|
-
const externalPluginModuleFactory_1 = require("./external-plugin/di/externalPluginModuleFactory");
|
|
7
|
-
const forwardDomainModuleFactory_1 = require("./forward-domain/di/forwardDomainModuleFactory");
|
|
8
|
-
const nftModuleFactory_1 = require("./nft/di/nftModuleFactory");
|
|
9
|
-
const tokenModuleFactory_1 = require("./token/di/tokenModuleFactory");
|
|
10
|
-
const typedDataModuleFactory_1 = require("./typed-data/di/typedDataModuleFactory");
|
|
11
|
-
const makeContainer = ({ config }) => {
|
|
12
|
-
const container = new inversify_1.Container();
|
|
13
|
-
container.load((0, configModuleFactory_1.configModuleFactory)(config), (0, externalPluginModuleFactory_1.externalPluginModuleFactory)(), (0, forwardDomainModuleFactory_1.forwardDomainModuleFactory)(), (0, nftModuleFactory_1.nftModuleFactory)(), (0, tokenModuleFactory_1.tokenModuleFactory)(), (0, typedDataModuleFactory_1.typedDataModuleFactory)());
|
|
14
|
-
return container;
|
|
15
|
-
};
|
|
16
|
-
exports.makeContainer = makeContainer;
|
|
17
|
-
//# sourceMappingURL=di.js.map
|
package/lib/cjs/src/di.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"di.js","sourceRoot":"","sources":["../../../src/di.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAEtC,yEAAsE;AAEtE,kGAA+F;AAC/F,+FAA4F;AAC5F,gEAA6D;AAC7D,sEAAmE;AACnE,mFAAgF;AAMzE,MAAM,aAAa,GAAG,CAAC,EAAE,MAAM,EAAqB,EAAE,EAAE;IAC7D,MAAM,SAAS,GAAG,IAAI,qBAAS,EAAE,CAAC;IAElC,SAAS,CAAC,IAAI,CACZ,IAAA,yCAAmB,EAAC,MAAM,CAAC,EAC3B,IAAA,yDAA2B,GAAE,EAC7B,IAAA,uDAA0B,GAAE,EAC5B,IAAA,mCAAgB,GAAE,EAClB,IAAA,uCAAkB,GAAE,EACpB,IAAA,+CAAsB,GAAE,CACzB,CAAC;IAEF,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAbW,QAAA,aAAa,iBAaxB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DAppDto.js","sourceRoot":"","sources":["../../../../../src/external-plugin/data/DAppDto.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalPluginDataSource.js","sourceRoot":"","sources":["../../../../../src/external-plugin/data/ExternalPluginDataSource.ts"],"names":[],"mappings":""}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
15
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
16
|
-
};
|
|
17
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.HttpExternalPluginDataSource = void 0;
|
|
19
|
-
const axios_1 = __importDefault(require("axios"));
|
|
20
|
-
const inversify_1 = require("inversify");
|
|
21
|
-
const purify_ts_1 = require("purify-ts");
|
|
22
|
-
const configTypes_1 = require("../../config/di/configTypes");
|
|
23
|
-
const package_json_1 = __importDefault(require("../../../package.json"));
|
|
24
|
-
let HttpExternalPluginDataSource = class HttpExternalPluginDataSource {
|
|
25
|
-
config;
|
|
26
|
-
constructor(config) {
|
|
27
|
-
this.config = config;
|
|
28
|
-
}
|
|
29
|
-
async getDappInfos({ chainId, address, selector, }) {
|
|
30
|
-
try {
|
|
31
|
-
const dappInfos = await axios_1.default.request({
|
|
32
|
-
method: "GET",
|
|
33
|
-
url: `${this.config.cal.url}/dapps`,
|
|
34
|
-
params: {
|
|
35
|
-
output: "b2c,b2c_signatures,abis",
|
|
36
|
-
chain_id: chainId,
|
|
37
|
-
contracts: address,
|
|
38
|
-
},
|
|
39
|
-
headers: {
|
|
40
|
-
"X-Ledger-Client-Version": `context-module/${package_json_1.default.version}`,
|
|
41
|
-
},
|
|
42
|
-
});
|
|
43
|
-
if (!dappInfos.data[0]) {
|
|
44
|
-
return (0, purify_ts_1.Right)(undefined);
|
|
45
|
-
}
|
|
46
|
-
// Normalize the address and selector
|
|
47
|
-
address = address.toLowerCase();
|
|
48
|
-
selector = `0x${selector.slice(2).toLowerCase()}`;
|
|
49
|
-
const { erc20OfInterest, method, plugin } = dappInfos.data[0].b2c?.contracts?.find((c) => c.address === address)
|
|
50
|
-
?.selectors?.[selector] || {};
|
|
51
|
-
const { signature, serialized_data: serializedData } = dappInfos.data[0].b2c_signatures?.[address]?.[selector] || {};
|
|
52
|
-
if (!erc20OfInterest ||
|
|
53
|
-
!method ||
|
|
54
|
-
!plugin ||
|
|
55
|
-
!signature ||
|
|
56
|
-
!serializedData) {
|
|
57
|
-
return (0, purify_ts_1.Right)(undefined);
|
|
58
|
-
}
|
|
59
|
-
const abi = dappInfos.data[0].abis?.[address];
|
|
60
|
-
if (!abi) {
|
|
61
|
-
return (0, purify_ts_1.Right)(undefined);
|
|
62
|
-
}
|
|
63
|
-
const selectorDetails = {
|
|
64
|
-
method,
|
|
65
|
-
plugin,
|
|
66
|
-
erc20OfInterest,
|
|
67
|
-
signature,
|
|
68
|
-
serializedData,
|
|
69
|
-
};
|
|
70
|
-
return (0, purify_ts_1.Right)({ selectorDetails, abi });
|
|
71
|
-
}
|
|
72
|
-
catch (_error) {
|
|
73
|
-
return (0, purify_ts_1.Left)(new Error("[ContextModule] HttpExternalPluginDataSource: Error fetching dapp infos"));
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
};
|
|
77
|
-
exports.HttpExternalPluginDataSource = HttpExternalPluginDataSource;
|
|
78
|
-
exports.HttpExternalPluginDataSource = HttpExternalPluginDataSource = __decorate([
|
|
79
|
-
(0, inversify_1.injectable)(),
|
|
80
|
-
__param(0, (0, inversify_1.inject)(configTypes_1.configTypes.Config)),
|
|
81
|
-
__metadata("design:paramtypes", [Object])
|
|
82
|
-
], HttpExternalPluginDataSource);
|
|
83
|
-
//# sourceMappingURL=HttpExternalPluginDataSource.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HttpExternalPluginDataSource.js","sourceRoot":"","sources":["../../../../../src/external-plugin/data/HttpExternalPluginDataSource.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AM,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,EAAE,GAClD,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,cAAc,EAAE,CAAC,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;YAEhE,IACE,CAAC,eAAe;gBAChB,CAAC,MAAM;gBACP,CAAC,MAAM;gBACP,CAAC,SAAS;gBACV,CAAC,cAAc,EACf,CAAC;gBACD,OAAO,IAAA,iBAAK,EAAC,SAAS,CAAC,CAAC;YAC1B,CAAC;YAED,MAAM,GAAG,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC;YAE9C,IAAI,CAAC,GAAG,EAAE,CAAC;gBACT,OAAO,IAAA,iBAAK,EAAC,SAAS,CAAC,CAAC;YAC1B,CAAC;YAED,MAAM,eAAe,GAAoB;gBACvC,MAAM;gBACN,MAAM;gBACN,eAAe;gBACf,SAAS;gBACT,cAAc;aACf,CAAC;YAEF,OAAO,IAAA,iBAAK,EAAC,EAAE,eAAe,EAAE,GAAG,EAAE,CAAC,CAAC;QACzC,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,OAAO,IAAA,gBAAI,EACT,IAAI,KAAK,CACP,yEAAyE,CAC1E,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AAvEY,oEAA4B;uCAA5B,4BAA4B;IADxC,IAAA,sBAAU,GAAE;IAGR,WAAA,IAAA,kBAAM,EAAC,yBAAW,CAAC,MAAM,CAAC,CAAA;;GAFlB,4BAA4B,CAuExC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.externalPluginModuleFactory = void 0;
|
|
4
|
-
const inversify_1 = require("inversify");
|
|
5
|
-
const HttpExternalPluginDataSource_1 = require("../../external-plugin/data/HttpExternalPluginDataSource");
|
|
6
|
-
const externalPluginTypes_1 = require("../../external-plugin/di/externalPluginTypes");
|
|
7
|
-
const ExternalPluginContextLoader_1 = require("../../external-plugin/domain/ExternalPluginContextLoader");
|
|
8
|
-
const externalPluginModuleFactory = () => new inversify_1.ContainerModule((bind, _unbind, _isBound, _rebind) => {
|
|
9
|
-
bind(externalPluginTypes_1.externalPluginTypes.ExternalPluginDataSource).to(HttpExternalPluginDataSource_1.HttpExternalPluginDataSource);
|
|
10
|
-
bind(externalPluginTypes_1.externalPluginTypes.ExternalPluginContextLoader).to(ExternalPluginContextLoader_1.ExternalPluginContextLoader);
|
|
11
|
-
});
|
|
12
|
-
exports.externalPluginModuleFactory = externalPluginModuleFactory;
|
|
13
|
-
//# sourceMappingURL=externalPluginModuleFactory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"externalPluginModuleFactory.js","sourceRoot":"","sources":["../../../../../src/external-plugin/di/externalPluginModuleFactory.ts"],"names":[],"mappings":";;;AAAA,yCAA4C;AAE5C,sGAAmG;AACnG,kFAA+E;AAC/E,sGAAmG;AAE5F,MAAM,2BAA2B,GAAG,GAAG,EAAE,CAC9C,IAAI,2BAAe,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IACvD,IAAI,CAAC,yCAAmB,CAAC,wBAAwB,CAAC,CAAC,EAAE,CACnD,2DAA4B,CAC7B,CAAC;IACF,IAAI,CAAC,yCAAmB,CAAC,2BAA2B,CAAC,CAAC,EAAE,CACtD,yDAA2B,CAC5B,CAAC;AACJ,CAAC,CAAC,CAAC;AARQ,QAAA,2BAA2B,+BAQnC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.externalPluginTypes = void 0;
|
|
4
|
-
exports.externalPluginTypes = {
|
|
5
|
-
ExternalPluginDataSource: Symbol.for("externalPluginDataSource"),
|
|
6
|
-
ExternalPluginContextLoader: Symbol.for("externalPluginContextLoader"),
|
|
7
|
-
};
|
|
8
|
-
//# sourceMappingURL=externalPluginTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"externalPluginTypes.js","sourceRoot":"","sources":["../../../../../src/external-plugin/di/externalPluginTypes.ts"],"names":[],"mappings":";;;AAAa,QAAA,mBAAmB,GAAG;IACjC,wBAAwB,EAAE,MAAM,CAAC,GAAG,CAAC,0BAA0B,CAAC;IAChE,2BAA2B,EAAE,MAAM,CAAC,GAAG,CAAC,6BAA6B,CAAC;CACvE,CAAC"}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
-
};
|
|
11
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
12
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.ExternalPluginContextLoader = void 0;
|
|
16
|
-
const device_management_kit_1 = require("@ledgerhq/device-management-kit");
|
|
17
|
-
const ethers_1 = require("ethers");
|
|
18
|
-
const inversify_1 = require("inversify");
|
|
19
|
-
const purify_ts_1 = require("purify-ts");
|
|
20
|
-
const externalPluginTypes_1 = require("../../external-plugin/di/externalPluginTypes");
|
|
21
|
-
const ClearSignContext_1 = require("../../shared/model/ClearSignContext");
|
|
22
|
-
const tokenTypes_1 = require("../../token/di/tokenTypes");
|
|
23
|
-
let ExternalPluginContextLoader = class ExternalPluginContextLoader {
|
|
24
|
-
_externalPluginDataSource;
|
|
25
|
-
_tokenDataSource;
|
|
26
|
-
constructor(externalPluginDataSource, tokenDataSource) {
|
|
27
|
-
this._externalPluginDataSource = externalPluginDataSource;
|
|
28
|
-
this._tokenDataSource = tokenDataSource;
|
|
29
|
-
}
|
|
30
|
-
async load(transaction) {
|
|
31
|
-
if (!transaction.to || !transaction.data || transaction.data === "0x") {
|
|
32
|
-
return [];
|
|
33
|
-
}
|
|
34
|
-
const selector = transaction.data.slice(0, 10);
|
|
35
|
-
if (!(0, device_management_kit_1.isHexaString)(selector)) {
|
|
36
|
-
return [
|
|
37
|
-
{
|
|
38
|
-
type: ClearSignContext_1.ClearSignContextType.ERROR,
|
|
39
|
-
error: new Error("Invalid selector"),
|
|
40
|
-
},
|
|
41
|
-
];
|
|
42
|
-
}
|
|
43
|
-
const eitherDappInfos = await this._externalPluginDataSource.getDappInfos({
|
|
44
|
-
address: transaction.to,
|
|
45
|
-
chainId: transaction.chainId,
|
|
46
|
-
selector,
|
|
47
|
-
});
|
|
48
|
-
return (0, purify_ts_1.EitherAsync)(async ({ liftEither }) => {
|
|
49
|
-
const dappInfos = await liftEither(eitherDappInfos);
|
|
50
|
-
// if the dappInfos is null, return an empty array
|
|
51
|
-
// this means that the selector is not a known selector
|
|
52
|
-
if (!dappInfos) {
|
|
53
|
-
return [];
|
|
54
|
-
}
|
|
55
|
-
const externalPluginContext = {
|
|
56
|
-
type: ClearSignContext_1.ClearSignContextType.EXTERNAL_PLUGIN,
|
|
57
|
-
payload: dappInfos.selectorDetails.serializedData.concat(dappInfos.selectorDetails.signature),
|
|
58
|
-
};
|
|
59
|
-
const decodedCallData = this.getDecodedCallData(dappInfos.abi, dappInfos.selectorDetails.method, transaction.data);
|
|
60
|
-
// if the call data cannot be decoded, return the error
|
|
61
|
-
// but also the externalPluginContext because it is still valid
|
|
62
|
-
if (decodedCallData.isLeft()) {
|
|
63
|
-
return [
|
|
64
|
-
{
|
|
65
|
-
type: ClearSignContext_1.ClearSignContextType.ERROR,
|
|
66
|
-
error: decodedCallData.extract(),
|
|
67
|
-
},
|
|
68
|
-
externalPluginContext,
|
|
69
|
-
];
|
|
70
|
-
}
|
|
71
|
-
// decodedCallData is a Right so we can extract it safely
|
|
72
|
-
const extractedDecodedCallData = decodedCallData.extract();
|
|
73
|
-
// get the token payload for each erc20OfInterest
|
|
74
|
-
// and return the payload or the error
|
|
75
|
-
const promises = dappInfos.selectorDetails.erc20OfInterest.map(async (erc20Path) => this.getTokenPayload(transaction, erc20Path, extractedDecodedCallData));
|
|
76
|
-
const tokensPayload = await Promise.all(promises);
|
|
77
|
-
// map the payload or the error to a ClearSignContext
|
|
78
|
-
const contexts = tokensPayload.map((eitherToken) => eitherToken.caseOf({
|
|
79
|
-
Left: (error) => ({ type: ClearSignContext_1.ClearSignContextType.ERROR, error }),
|
|
80
|
-
Right: (payload) => ({ type: ClearSignContext_1.ClearSignContextType.TOKEN, payload }),
|
|
81
|
-
}));
|
|
82
|
-
return [...contexts, externalPluginContext];
|
|
83
|
-
}).caseOf({
|
|
84
|
-
// parse all errors into ClearSignContext
|
|
85
|
-
Left: (error) => [{ type: ClearSignContext_1.ClearSignContextType.ERROR, error }],
|
|
86
|
-
Right: (contexts) => contexts,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
getTokenPayload(transaction, erc20Path, decodedCallData) {
|
|
90
|
-
const address = this.getAddressFromPath(erc20Path, decodedCallData);
|
|
91
|
-
return (0, purify_ts_1.EitherAsync)(({ fromPromise }) => fromPromise(this._tokenDataSource.getTokenInfosPayload({
|
|
92
|
-
address,
|
|
93
|
-
chainId: transaction.chainId,
|
|
94
|
-
})));
|
|
95
|
-
}
|
|
96
|
-
getDecodedCallData(abi, method, data) {
|
|
97
|
-
try {
|
|
98
|
-
const contractInterface = new ethers_1.Interface(abi);
|
|
99
|
-
return (0, purify_ts_1.Right)(contractInterface.decodeFunctionData(method, data));
|
|
100
|
-
}
|
|
101
|
-
catch (_error) {
|
|
102
|
-
return (0, purify_ts_1.Left)(new Error("[ContextModule] ExternalPluginContextLoader: Unable to parse abi"));
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
getAddressFromPath(path, decodedCallData) {
|
|
106
|
-
// ethers.Result is a record string, any
|
|
107
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
108
|
-
let value = decodedCallData;
|
|
109
|
-
for (const key of path.split(".")) {
|
|
110
|
-
// In Solidity, a struct cannot begin with a number
|
|
111
|
-
// Additionally, when we use -1, it signifies the last element of the array.
|
|
112
|
-
if (key === "-1") {
|
|
113
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
114
|
-
value = value[value.length - 1];
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
// This access can throw a RangeError error in case of an invalid key
|
|
118
|
-
// but is correctly caught by the liftEither above
|
|
119
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
|
|
120
|
-
value = value[key];
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (!(0, device_management_kit_1.isHexaString)(value)) {
|
|
124
|
-
throw new Error("[ContextModule] ExternalPluginContextLoader: Unable to get address");
|
|
125
|
-
}
|
|
126
|
-
return value;
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
exports.ExternalPluginContextLoader = ExternalPluginContextLoader;
|
|
130
|
-
exports.ExternalPluginContextLoader = ExternalPluginContextLoader = __decorate([
|
|
131
|
-
(0, inversify_1.injectable)(),
|
|
132
|
-
__param(0, (0, inversify_1.inject)(externalPluginTypes_1.externalPluginTypes.ExternalPluginDataSource)),
|
|
133
|
-
__param(1, (0, inversify_1.inject)(tokenTypes_1.tokenTypes.TokenDataSource)),
|
|
134
|
-
__metadata("design:paramtypes", [Object, Object])
|
|
135
|
-
], ExternalPluginContextLoader);
|
|
136
|
-
//# sourceMappingURL=ExternalPluginContextLoader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ExternalPluginContextLoader.js","sourceRoot":"","sources":["../../../../../src/external-plugin/domain/ExternalPluginContextLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2EAA2E;AAC3E,mCAA2C;AAC3C,yCAA+C;AAC/C,yCAA6D;AAG7D,kFAA+E;AAE/E,sEAGyC;AAGzC,sDAAmD;AAG5C,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAC9B,yBAAyB,CAA2B;IACpD,gBAAgB,CAAkB;IAE1C,YAEE,wBAAkD,EACd,eAAgC;QAEpE,IAAI,CAAC,yBAAyB,GAAG,wBAAwB,CAAC;QAC1D,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAC;IAC1C,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,WAA+B;QACxC,IAAI,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,WAAW,CAAC,IAAI,IAAI,WAAW,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;YACtE,OAAO,EAAE,CAAC;QACZ,CAAC;QAED,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAE/C,IAAI,CAAC,IAAA,oCAAY,EAAC,QAAQ,CAAC,EAAE,CAAC;YAC5B,OAAO;gBACL;oBACE,IAAI,EAAE,uCAAoB,CAAC,KAAK;oBAChC,KAAK,EAAE,IAAI,KAAK,CAAC,kBAAkB,CAAC;iBACrC;aACF,CAAC;QACJ,CAAC;QAED,MAAM,eAAe,GAAG,MAAM,IAAI,CAAC,yBAAyB,CAAC,YAAY,CAAC;Y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B,CAAC,kBAAkB,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC,CAAC;QACnE,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,OAAO,IAAA,gBAAI,EACT,IAAI,KAAK,CACP,kEAAkE,CACnE,CACF,CAAC;QACJ,CAAC;IACH,CAAC;IAEO,kBAAkB,CACxB,IAAY,EACZ,eAA8B;QAE9B,wCAAwC;QACxC,8DAA8D;QAC9D,IAAI,KAAK,GAAQ,eAAe,CAAC;QACjC,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,CAAC;YAClC,mDAAmD;YACnD,4EAA4E;YAC5E,IAAI,GAAG,KAAK,IAAI,EAAE,CAAC;gBACjB,+GAA+G;gBAC/G,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YAClC,CAAC;iBAAM,CAAC;gBACN,qEAAqE;gBACrE,kDAAkD;gBAClD,+GAA+G;gBAC/G,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC;YACrB,CAAC;QACH,CAAC;QAED,IAAI,CAAC,IAAA,oCAAY,EAAC,KAAK,CAAC,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CACb,oEAAoE,CACrE,CAAC;QACJ,CAAC;QAED,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAA;AArKY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,sBAAU,GAAE;IAMR,WAAA,IAAA,kBAAM,EAAC,yCAAmB,CAAC,wBAAwB,CAAC,CAAA;IAEpD,WAAA,IAAA,kBAAM,EAAC,uBAAU,CAAC,eAAe,CAAC,CAAA;;GAP1B,2BAA2B,CAqKvC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DappInfos.js","sourceRoot":"","sources":["../../../../../src/external-plugin/model/DappInfos.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SelectorDetails.js","sourceRoot":"","sources":["../../../../../src/external-plugin/model/SelectorDetails.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ForwardDomainDataSource.js","sourceRoot":"","sources":["../../../../../src/forward-domain/data/ForwardDomainDataSource.ts"],"names":[],"mappings":""}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
-
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;
|
|
6
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
-
};
|
|
8
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.HttpForwardDomainDataSource = void 0;
|
|
13
|
-
const axios_1 = __importDefault(require("axios"));
|
|
14
|
-
const inversify_1 = require("inversify");
|
|
15
|
-
const purify_ts_1 = require("purify-ts");
|
|
16
|
-
const package_json_1 = __importDefault(require("../../../package.json"));
|
|
17
|
-
let HttpForwardDomainDataSource = class HttpForwardDomainDataSource {
|
|
18
|
-
async getDomainNamePayload({ domain, challenge, }) {
|
|
19
|
-
try {
|
|
20
|
-
const response = await axios_1.default.request({
|
|
21
|
-
method: "GET",
|
|
22
|
-
url: `https://nft.api.live.ledger.com/v1/names/ens/forward/${domain}?challenge=${challenge}`,
|
|
23
|
-
headers: {
|
|
24
|
-
"X-Ledger-Client-Version": `context-module/${package_json_1.default.version}`,
|
|
25
|
-
},
|
|
26
|
-
});
|
|
27
|
-
return response.data.payload
|
|
28
|
-
? (0, purify_ts_1.Right)(response.data.payload)
|
|
29
|
-
: (0, purify_ts_1.Left)(new Error("[ContextModule] HttpForwardDomainDataSource: error getting domain payload"));
|
|
30
|
-
}
|
|
31
|
-
catch (_error) {
|
|
32
|
-
return (0, purify_ts_1.Left)(new Error("[ContextModule] HttpForwardDomainDataSource: Failed to fetch domain name"));
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
};
|
|
36
|
-
exports.HttpForwardDomainDataSource = HttpForwardDomainDataSource;
|
|
37
|
-
exports.HttpForwardDomainDataSource = HttpForwardDomainDataSource = __decorate([
|
|
38
|
-
(0, inversify_1.injectable)()
|
|
39
|
-
], HttpForwardDomainDataSource);
|
|
40
|
-
//# sourceMappingURL=HttpForwardDomainDataSource.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HttpForwardDomainDataSource.js","sourceRoot":"","sources":["../../../../../src/forward-domain/data/HttpForwardDomainDataSource.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA0B;AAC1B,yCAAuC;AACvC,yCAAgD;AAMhD,sEAAyC;AAGlC,IAAM,2BAA2B,GAAjC,MAAM,2BAA2B;IAC/B,KAAK,CAAC,oBAAoB,CAAC,EAChC,MAAM,EACN,SAAS,GACmB;QAC5B,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,MAAM,eAAK,CAAC,OAAO,CAAsB;gBACxD,MAAM,EAAE,KAAK;gBACb,GAAG,EAAE,wDAAwD,MAAM,cAAc,SAAS,EAAE;gBAC5F,OAAO,EAAE;oBACP,yBAAyB,EAAE,kBAAkB,sBAAO,CAAC,OAAO,EAAE;iBAC/D;aACF,CAAC,CAAC;YAEH,OAAO,QAAQ,CAAC,IAAI,CAAC,OAAO;gBAC1B,CAAC,CAAC,IAAA,iBAAK,EAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC;gBAC9B,CAAC,CAAC,IAAA,gBAAI,EACF,IAAI,KAAK,CACP,2EAA2E,CAC5E,CACF,CAAC;QACR,CAAC;QAAC,OAAO,MAAM,EAAE,CAAC;YAChB,OAAO,IAAA,gBAAI,EACT,IAAI,KAAK,CACP,0EAA0E,CAC3E,CACF,CAAC;QACJ,CAAC;IACH,CAAC;CACF,CAAA;AA7BY,kEAA2B;sCAA3B,2BAA2B;IADvC,IAAA,sBAAU,GAAE;GACA,2BAA2B,CA6BvC"}
|