@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
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"FiltersDto.js","sourceRoot":"","sources":["../../../../../src/typed-data/data/FiltersDto.ts"],"names":[],"mappings":""}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Either } from "purify-ts";
|
|
2
|
-
import type { ContextModuleConfig } from "../../config/model/ContextModuleConfig";
|
|
3
|
-
import { GetTypedDataFiltersParams, GetTypedDataFiltersResult, TypedDataDataSource } from "./TypedDataDataSource";
|
|
4
|
-
export declare class HttpTypedDataDataSource implements TypedDataDataSource {
|
|
5
|
-
private readonly config;
|
|
6
|
-
constructor(config: ContextModuleConfig);
|
|
7
|
-
getTypedDataFilters({ chainId, address, schema, version, }: GetTypedDataFiltersParams): Promise<Either<Error, GetTypedDataFiltersResult>>;
|
|
8
|
-
private isInstructionFieldV1;
|
|
9
|
-
private isInstructionFieldV2;
|
|
10
|
-
private isInstructionFieldV2WithCoinRef;
|
|
11
|
-
private isInstructionContractInfo;
|
|
12
|
-
private sortTypes;
|
|
13
|
-
}
|
|
14
|
-
//# sourceMappingURL=HttpTypedDataDataSource.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HttpTypedDataDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/typed-data/data/HttpTypedDataDataSource.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAe,MAAM,WAAW,CAAC;AAGhD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAgB9E,OAAO,EACL,yBAAyB,EACzB,yBAAyB,EACzB,mBAAmB,EACpB,MAAM,uBAAuB,CAAC;AAE/B,qBACa,uBAAwB,YAAW,mBAAmB;IAEnC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,mBAAmB;IAG7D,mBAAmB,CAAC,EAC/B,OAAO,EACP,OAAO,EACP,MAAM,EACN,OAAO,GACR,EAAE,yBAAyB,GAAG,OAAO,CACpC,MAAM,CAAC,KAAK,EAAE,yBAAyB,CAAC,CACzC;IAsGD,OAAO,CAAC,oBAAoB;IAe5B,OAAO,CAAC,oBAAoB;IAgB5B,OAAO,CAAC,+BAA+B;IAgBvC,OAAO,CAAC,yBAAyB;IAcjC,OAAO,CAAC,SAAS;CAUlB"}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
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 SHA224 from "crypto-js/sha224";
|
|
15
|
-
import { inject, injectable } from "inversify";
|
|
16
|
-
import { Left, Right } from "purify-ts";
|
|
17
|
-
import { configTypes } from "../../config/di/configTypes";
|
|
18
|
-
import PACKAGE from "../../../package.json";
|
|
19
|
-
let HttpTypedDataDataSource = class HttpTypedDataDataSource {
|
|
20
|
-
config;
|
|
21
|
-
constructor(config) {
|
|
22
|
-
this.config = config;
|
|
23
|
-
}
|
|
24
|
-
async getTypedDataFilters({ chainId, address, schema, version, }) {
|
|
25
|
-
let messageInfo = undefined;
|
|
26
|
-
try {
|
|
27
|
-
const response = await axios.request({
|
|
28
|
-
method: "GET",
|
|
29
|
-
url: `${this.config.cal.url}/dapps`,
|
|
30
|
-
params: {
|
|
31
|
-
contracts: address,
|
|
32
|
-
chain_id: chainId,
|
|
33
|
-
output: "descriptors_eip712",
|
|
34
|
-
descriptors_eip712_version: version,
|
|
35
|
-
descriptors_eip712: "<set>",
|
|
36
|
-
ref: `branch:${this.config.cal.branch}`,
|
|
37
|
-
},
|
|
38
|
-
headers: {
|
|
39
|
-
"X-Ledger-Client-Version": `context-module/${PACKAGE.version}`,
|
|
40
|
-
},
|
|
41
|
-
});
|
|
42
|
-
// Try to get the filters JSON descriptor, from address and schema hash
|
|
43
|
-
const schemaHash = SHA224(JSON.stringify(this.sortTypes(schema)).replace(" ", "")).toString();
|
|
44
|
-
address = address.toLowerCase();
|
|
45
|
-
const filtersJson = response.data?.[0]?.descriptors_eip712?.[address]?.[schemaHash];
|
|
46
|
-
if (!filtersJson) {
|
|
47
|
-
return Left(new Error(`[ContextModule] HttpTypedDataDataSource: no typed data filters for address ${address} on chain ${chainId} for schema ${schemaHash}`));
|
|
48
|
-
}
|
|
49
|
-
// Parse the message type, if available
|
|
50
|
-
if (!filtersJson.schema || !Array.isArray(filtersJson.instructions)) {
|
|
51
|
-
return Left(new Error(`[ContextModule] HttpTypedDataDataSource: no message info for address ${address} on chain ${chainId} for schema ${schemaHash}`));
|
|
52
|
-
}
|
|
53
|
-
// Parse all the filters
|
|
54
|
-
const filters = [];
|
|
55
|
-
for (const field of filtersJson.instructions) {
|
|
56
|
-
if (this.isInstructionContractInfo(field)) {
|
|
57
|
-
messageInfo = {
|
|
58
|
-
displayName: field.display_name,
|
|
59
|
-
signature: field.signatures[this.config.cal.mode],
|
|
60
|
-
filtersCount: field.field_mappers_count,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
else if (version === "v1" && this.isInstructionFieldV1(field)) {
|
|
64
|
-
filters.push({
|
|
65
|
-
type: "raw",
|
|
66
|
-
displayName: field.display_name,
|
|
67
|
-
path: field.field_path,
|
|
68
|
-
signature: field.signatures[this.config.cal.mode],
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
else if (this.isInstructionFieldV2(field)) {
|
|
72
|
-
filters.push({
|
|
73
|
-
type: field.format,
|
|
74
|
-
displayName: field.display_name,
|
|
75
|
-
path: field.field_path,
|
|
76
|
-
signature: field.signatures[this.config.cal.mode],
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
else if (this.isInstructionFieldV2WithCoinRef(field)) {
|
|
80
|
-
filters.push({
|
|
81
|
-
type: field.format,
|
|
82
|
-
displayName: field.display_name,
|
|
83
|
-
path: field.field_path,
|
|
84
|
-
signature: field.signatures[this.config.cal.mode],
|
|
85
|
-
tokenIndex: field.coin_ref,
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
else {
|
|
89
|
-
return Left(new Error(`[ContextModule] HttpTypedDataDataSource: invalid typed data field for address ${address} on chain ${chainId} for schema ${schemaHash}`));
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
if (!messageInfo) {
|
|
93
|
-
return Left(new Error(`[ContextModule] HttpTypedDataDataSource: no message info for address ${address} on chain ${chainId} for schema ${schemaHash}`));
|
|
94
|
-
}
|
|
95
|
-
return Right({ messageInfo, filters });
|
|
96
|
-
}
|
|
97
|
-
catch (_error) {
|
|
98
|
-
return Left(new Error("[ContextModule] HttpTypedDataDataSource: Failed to fetch typed data informations"));
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
isInstructionFieldV1(data) {
|
|
102
|
-
// NOTE: Currently the backend return the same structure for V1 and V2,
|
|
103
|
-
// so we can't distinguish them here, but we can still check the required fields
|
|
104
|
-
return (typeof data === "object" &&
|
|
105
|
-
typeof data.display_name === "string" &&
|
|
106
|
-
typeof data.field_path === "string" &&
|
|
107
|
-
typeof data.signatures === "object" &&
|
|
108
|
-
typeof data.signatures.prod === "string" &&
|
|
109
|
-
typeof data.signatures.test === "string");
|
|
110
|
-
}
|
|
111
|
-
isInstructionFieldV2(data) {
|
|
112
|
-
return (typeof data === "object" &&
|
|
113
|
-
typeof data.display_name === "string" &&
|
|
114
|
-
typeof data.field_path === "string" &&
|
|
115
|
-
typeof data.signatures === "object" &&
|
|
116
|
-
typeof data.signatures.prod === "string" &&
|
|
117
|
-
typeof data.signatures.test === "string" &&
|
|
118
|
-
typeof data.format === "string" &&
|
|
119
|
-
["raw", "datetime"].includes(data.format) &&
|
|
120
|
-
data.coin_ref === undefined);
|
|
121
|
-
}
|
|
122
|
-
isInstructionFieldV2WithCoinRef(data) {
|
|
123
|
-
return (typeof data === "object" &&
|
|
124
|
-
typeof data.display_name === "string" &&
|
|
125
|
-
typeof data.field_path === "string" &&
|
|
126
|
-
typeof data.signatures === "object" &&
|
|
127
|
-
typeof data.signatures.prod === "string" &&
|
|
128
|
-
typeof data.signatures.test === "string" &&
|
|
129
|
-
typeof data.format === "string" &&
|
|
130
|
-
["token", "amount"].includes(data.format) &&
|
|
131
|
-
typeof data.coin_ref === "number");
|
|
132
|
-
}
|
|
133
|
-
isInstructionContractInfo(data) {
|
|
134
|
-
return (typeof data === "object" &&
|
|
135
|
-
typeof data.display_name === "string" &&
|
|
136
|
-
typeof data.field_mappers_count === "number" &&
|
|
137
|
-
typeof data.signatures === "object" &&
|
|
138
|
-
typeof data.signatures.prod === "string" &&
|
|
139
|
-
typeof data.signatures.test === "string" &&
|
|
140
|
-
data.field_path === undefined);
|
|
141
|
-
}
|
|
142
|
-
sortTypes(types) {
|
|
143
|
-
return Object.fromEntries(Object.entries(types)
|
|
144
|
-
.sort(([aKey], [bKey]) => aKey.localeCompare(bKey))
|
|
145
|
-
.map(([key, value]) => [
|
|
146
|
-
key,
|
|
147
|
-
value.map((v) => ({ name: v.name, type: v.type })),
|
|
148
|
-
]));
|
|
149
|
-
}
|
|
150
|
-
};
|
|
151
|
-
HttpTypedDataDataSource = __decorate([
|
|
152
|
-
injectable(),
|
|
153
|
-
__param(0, inject(configTypes.Config)),
|
|
154
|
-
__metadata("design:paramtypes", [Object])
|
|
155
|
-
], HttpTypedDataDataSource);
|
|
156
|
-
export { HttpTypedDataDataSource };
|
|
157
|
-
//# sourceMappingURL=HttpTypedDataDataSource.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HttpTypedDataDataSource.js","sour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|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Either } from "purify-ts";
|
|
2
|
-
import { TypedDataFilter, TypedDataMessageInfo } from "../../shared/model/TypedDataClearSignContext";
|
|
3
|
-
import { TypedDataSchema } from "../../shared/model/TypedDataContext";
|
|
4
|
-
export type GetTypedDataFiltersParams = {
|
|
5
|
-
address: string;
|
|
6
|
-
chainId: number;
|
|
7
|
-
version: "v1" | "v2";
|
|
8
|
-
schema: TypedDataSchema;
|
|
9
|
-
};
|
|
10
|
-
export type GetTypedDataFiltersResult = {
|
|
11
|
-
messageInfo: TypedDataMessageInfo;
|
|
12
|
-
filters: TypedDataFilter[];
|
|
13
|
-
};
|
|
14
|
-
export interface TypedDataDataSource {
|
|
15
|
-
getTypedDataFilters(params: GetTypedDataFiltersParams): Promise<Either<Error, GetTypedDataFiltersResult>>;
|
|
16
|
-
}
|
|
17
|
-
//# sourceMappingURL=TypedDataDataSource.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TypedDataDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/typed-data/data/TypedDataDataSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,OAAO,EACL,eAAe,EACf,oBAAoB,EACrB,MAAM,0CAA0C,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,MAAM,EAAE,eAAe,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,WAAW,EAAE,oBAAoB,CAAC;IAClC,OAAO,EAAE,eAAe,EAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,WAAW,mBAAmB;IAClC,mBAAmB,CACjB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,yBAAyB,CAAC,CAAC,CAAC;CACtD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TypedDataDataSource.js","sourceRoot":"","sources":["../../../../../src/typed-data/data/TypedDataDataSource.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typedDataModuleFactory.d.ts","sourceRoot":"","sources":["../../../../../src/typed-data/di/typedDataModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAM5C,eAAO,MAAM,sBAAsB,uBAM/B,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ContainerModule } from "inversify";
|
|
2
|
-
import { HttpTypedDataDataSource } from "../../typed-data/data/HttpTypedDataDataSource";
|
|
3
|
-
import { typedDataTypes } from "../../typed-data/di/typedDataTypes";
|
|
4
|
-
import { DefaultTypedDataContextLoader } from "../../typed-data/domain/DefaultTypedDataContextLoader";
|
|
5
|
-
export const typedDataModuleFactory = () => new ContainerModule((bind, _unbind, _isBound, _rebind) => {
|
|
6
|
-
bind(typedDataTypes.TypedDataDataSource).to(HttpTypedDataDataSource);
|
|
7
|
-
bind(typedDataTypes.TypedDataContextLoader).to(DefaultTypedDataContextLoader);
|
|
8
|
-
});
|
|
9
|
-
//# sourceMappingURL=typedDataModuleFactory.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typedDataModuleFactory.js","sourceRoot":"","sources":["../../../../../src/typed-data/di/typedDataModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,6BAA6B,EAAE,MAAM,mDAAmD,CAAC;AAElG,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,EAAE,CACzC,IAAI,eAAe,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE;IACvD,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC;IACrE,IAAI,CAAC,cAAc,CAAC,sBAAsB,CAAC,CAAC,EAAE,CAC5C,6BAA6B,CAC9B,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typedDataTypes.d.ts","sourceRoot":"","sources":["../../../../../src/typed-data/di/typedDataTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc;;;CAG1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typedDataTypes.js","sourceRoot":"","sources":["../../../../../src/typed-data/di/typedDataTypes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,mBAAmB,EAAE,MAAM,CAAC,GAAG,CAAC,qBAAqB,CAAC;IACtD,sBAAsB,EAAE,MAAM,CAAC,GAAG,CAAC,wBAAwB,CAAC;CAC7D,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { TypedDataClearSignContext } from "../../shared/model/TypedDataClearSignContext";
|
|
2
|
-
import type { TypedDataContext } from "../../shared/model/TypedDataContext";
|
|
3
|
-
import type { TokenDataSource } from "../../token/data/TokenDataSource";
|
|
4
|
-
import type { TypedDataDataSource } from "../../typed-data/data/TypedDataDataSource";
|
|
5
|
-
import type { TypedDataContextLoader } from "../../typed-data/domain/TypedDataContextLoader";
|
|
6
|
-
export declare class DefaultTypedDataContextLoader implements TypedDataContextLoader {
|
|
7
|
-
private dataSource;
|
|
8
|
-
private tokenDataSource;
|
|
9
|
-
constructor(dataSource: TypedDataDataSource, tokenDataSource: TokenDataSource);
|
|
10
|
-
load(typedData: TypedDataContext): Promise<TypedDataClearSignContext>;
|
|
11
|
-
private convertAddressToHexaString;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=DefaultTypedDataContextLoader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultTypedDataContextLoader.d.ts","sourceRoot":"","sources":["../../../../../src/typed-data/domain/DefaultTypedDataContextLoader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,yBAAyB,EAK1B,MAAM,0CAA0C,CAAC;AAElD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAEpE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAEjF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAEzF,qBACa,6BAA8B,YAAW,sBAAsB;IAGxE,OAAO,CAAC,UAAU;IAElB,OAAO,CAAC,eAAe;gBAFf,UAAU,EAAE,mBAAmB,EAE/B,eAAe,EAAE,eAAe;IAGpC,IAAI,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,yBAAyB,CAAC;IAoG3E,OAAO,CAAC,0BAA0B;CAQnC"}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
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 { inject, injectable } from "inversify";
|
|
14
|
-
import { VERIFYING_CONTRACT_TOKEN_INDEX } from "../../shared/model/TypedDataClearSignContext";
|
|
15
|
-
import { tokenTypes } from "../../token/di/tokenTypes";
|
|
16
|
-
import { typedDataTypes } from "../../typed-data/di/typedDataTypes";
|
|
17
|
-
let DefaultTypedDataContextLoader = class DefaultTypedDataContextLoader {
|
|
18
|
-
dataSource;
|
|
19
|
-
tokenDataSource;
|
|
20
|
-
constructor(dataSource, tokenDataSource) {
|
|
21
|
-
this.dataSource = dataSource;
|
|
22
|
-
this.tokenDataSource = tokenDataSource;
|
|
23
|
-
}
|
|
24
|
-
async load(typedData) {
|
|
25
|
-
// Get the typed data filters from the data source
|
|
26
|
-
const data = await this.dataSource.getTypedDataFilters({
|
|
27
|
-
address: typedData.verifyingContract,
|
|
28
|
-
chainId: typedData.chainId,
|
|
29
|
-
version: typedData.version,
|
|
30
|
-
schema: typedData.schema,
|
|
31
|
-
});
|
|
32
|
-
// If there was an error getting the typed data filters, return an error immediately
|
|
33
|
-
if (data.isLeft()) {
|
|
34
|
-
return {
|
|
35
|
-
type: "error",
|
|
36
|
-
error: data.extract(),
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
// Else, extract the message info and filters
|
|
40
|
-
const { messageInfo, filters } = data.unsafeCoerce();
|
|
41
|
-
// Loop through the typed data filters to extract informations
|
|
42
|
-
const mappedFilters = {};
|
|
43
|
-
const mappedTokens = {};
|
|
44
|
-
for (const filter of filters) {
|
|
45
|
-
// Add the filter to the clear signing context
|
|
46
|
-
mappedFilters[filter.path] = filter;
|
|
47
|
-
if (filter.type !== "token" && filter.type !== "amount") {
|
|
48
|
-
continue; // no token reference
|
|
49
|
-
}
|
|
50
|
-
// If the filter references a token, retrieve its descriptor from the tokens data source
|
|
51
|
-
const tokenIndex = filter.tokenIndex;
|
|
52
|
-
if (mappedTokens[tokenIndex] !== undefined) {
|
|
53
|
-
continue; // Already fetched for a previous filter
|
|
54
|
-
}
|
|
55
|
-
// If the filter is a token, get token address from typed message values, and fetch descriptor
|
|
56
|
-
if (filter.type === "token") {
|
|
57
|
-
const value = typedData.fieldsValues.find((entry) => entry.path === filter.path);
|
|
58
|
-
if (value === undefined) {
|
|
59
|
-
return {
|
|
60
|
-
type: "error",
|
|
61
|
-
error: new Error(`The token filter references the value ${filter.path} which is absent from the message`),
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
// Fetch descriptor
|
|
65
|
-
const address = this.convertAddressToHexaString(value.value);
|
|
66
|
-
const chainId = typedData.chainId;
|
|
67
|
-
const payload = await this.tokenDataSource.getTokenInfosPayload({
|
|
68
|
-
address,
|
|
69
|
-
chainId,
|
|
70
|
-
});
|
|
71
|
-
if (payload.isLeft()) {
|
|
72
|
-
return {
|
|
73
|
-
type: "error",
|
|
74
|
-
error: payload.extract(),
|
|
75
|
-
};
|
|
76
|
-
}
|
|
77
|
-
payload.ifRight((payload) => {
|
|
78
|
-
mappedTokens[tokenIndex] = payload;
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
// If the filter is an amount with a reference to the verifyingContract, fetch verifyingContract descriptor.
|
|
82
|
-
// This is because descriptors data-sources should be compatible with Ledger devices specifications:
|
|
83
|
-
// https://github.com/LedgerHQ/app-ethereum/blob/develop/doc/ethapp.adoc#amount-join-value
|
|
84
|
-
else if (filter.type === "amount" &&
|
|
85
|
-
tokenIndex === VERIFYING_CONTRACT_TOKEN_INDEX) {
|
|
86
|
-
const address = typedData.verifyingContract;
|
|
87
|
-
const chainId = typedData.chainId;
|
|
88
|
-
const payload = await this.tokenDataSource.getTokenInfosPayload({
|
|
89
|
-
address,
|
|
90
|
-
chainId,
|
|
91
|
-
});
|
|
92
|
-
if (payload.isLeft()) {
|
|
93
|
-
return {
|
|
94
|
-
type: "error",
|
|
95
|
-
error: payload.extract(),
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
payload.ifRight((payload) => {
|
|
99
|
-
mappedTokens[tokenIndex] = payload;
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
return {
|
|
104
|
-
type: "success",
|
|
105
|
-
messageInfo,
|
|
106
|
-
filters: mappedFilters,
|
|
107
|
-
tokens: mappedTokens,
|
|
108
|
-
};
|
|
109
|
-
}
|
|
110
|
-
convertAddressToHexaString(address) {
|
|
111
|
-
// Address size is 20 bytes so 40 characters, padded with zeros on the left
|
|
112
|
-
return `0x${Array.from(address, (byte) => byte.toString(16).padStart(2, "0"))
|
|
113
|
-
.join("")
|
|
114
|
-
.padStart(40, "0")}`;
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
DefaultTypedDataContextLoader = __decorate([
|
|
118
|
-
injectable(),
|
|
119
|
-
__param(0, inject(typedDataTypes.TypedDataDataSource)),
|
|
120
|
-
__param(1, inject(tokenTypes.TokenDataSource)),
|
|
121
|
-
__metadata("design:paramtypes", [Object, Object])
|
|
122
|
-
], DefaultTypedDataContextLoader);
|
|
123
|
-
export { DefaultTypedDataContextLoader };
|
|
124
|
-
//# sourceMappingURL=DefaultTypedDataContextLoader.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultTypedDataContextLoader.js","sourceRoot":"","sources":["../../../../../src/typed-data/domain/DefaultTypedDataContextLoader.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAS/C,OAAO,EAAE,8BAA8B,EAAE,MAAM,0CAA0C,CAAC;AAG1F,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAA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GAAG,MAAM,IAAI,CAAC,eAAe,CAAC,oBAAoB,CAAC;oBAC9D,OAAO;oBACP,OAAO;iBACR,CAAC,CAAC;gBACH,IAAI,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC;oBACrB,OAAO;wBACL,IAAI,EAAE,OAAO;wBACb,KAAK,EAAE,OAAO,CAAC,OAAO,EAAE;qBACzB,CAAC;gBACJ,CAAC;gBACD,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;oBAC1B,YAAY,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC;gBACrC,CAAC,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAED,OAAO;YACL,IAAI,EAAE,SAAS;YACf,WAAW;YACX,OAAO,EAAE,aAAa;YACtB,MAAM,EAAE,YAAY;SACrB,CAAC;IACJ,CAAC;IAEO,0BAA0B,CAAC,OAAmB;QACpD,2EAA2E;QAC3E,OAAO,KAAK,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE,CACvC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CACnC;aACE,IAAI,CAAC,EAAE,CAAC;aACR,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC;IACzB,CAAC;CACF,CAAA;AApHY,6BAA6B;IADzC,UAAU,EAAE;IAGR,WAAA,MAAM,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAA;IAE1C,WAAA,MAAM,CAAC,UAAU,CAAC,eAAe,CAAC,CAAA;;GAJ1B,6BAA6B,CAoHzC"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { TypedDataClearSignContext } from "../../shared/model/TypedDataClearSignContext";
|
|
2
|
-
import type { TypedDataContext } from "../../shared/model/TypedDataContext";
|
|
3
|
-
export interface TypedDataContextLoader {
|
|
4
|
-
load(typedData: TypedDataContext): Promise<TypedDataClearSignContext>;
|
|
5
|
-
}
|
|
6
|
-
//# sourceMappingURL=TypedDataContextLoader.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TypedDataContextLoader.d.ts","sourceRoot":"","sources":["../../../../../src/typed-data/domain/TypedDataContextLoader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,MAAM,WAAW,sBAAsB;IACrC,IAAI,CAAC,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACvE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TypedDataContextLoader.js","sourceRoot":"","sources":["../../../../../src/typed-data/domain/TypedDataContextLoader.ts"],"names":[],"mappings":""}
|