@ledgerhq/context-module 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -6
- package/lib/cjs/index.js +2 -20
- package/lib/cjs/index.js.map +7 -1
- package/lib/cjs/package.json +53 -59
- package/lib/cjs/src/ContextModule.js +2 -3
- package/lib/cjs/src/ContextModule.js.map +7 -1
- package/lib/cjs/src/ContextModuleBuilder.js +2 -87
- package/lib/cjs/src/ContextModuleBuilder.js.map +7 -1
- package/lib/cjs/src/ContextModuleBuilder.test.js +2 -0
- package/lib/cjs/src/ContextModuleBuilder.test.js.map +7 -0
- package/lib/cjs/src/DefaultContextModule.js +2 -21
- package/lib/cjs/src/DefaultContextModule.js.map +7 -1
- package/lib/cjs/src/DefaultContextModule.test.js +2 -0
- package/lib/cjs/src/DefaultContextModule.test.js.map +7 -0
- package/lib/cjs/src/config/di/configModuleFactory.js +2 -10
- package/lib/cjs/src/config/di/configModuleFactory.js.map +7 -1
- package/lib/cjs/src/config/di/configTypes.js +2 -7
- package/lib/cjs/src/config/di/configTypes.js.map +7 -1
- package/lib/cjs/src/config/model/ContextModuleConfig.js +2 -3
- package/lib/cjs/src/config/model/ContextModuleConfig.js.map +7 -1
- package/lib/cjs/src/di.js +2 -17
- package/lib/cjs/src/di.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/DAppDto.js +2 -3
- package/lib/cjs/src/external-plugin/data/DAppDto.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js +2 -3
- package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -83
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
- package/lib/cjs/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
- package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js +2 -13
- package/lib/cjs/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
- package/lib/cjs/src/external-plugin/di/externalPluginTypes.js +2 -8
- package/lib/cjs/src/external-plugin/di/externalPluginTypes.js.map +7 -1
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -136
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
- package/lib/cjs/src/external-plugin/model/DappInfos.js +2 -3
- package/lib/cjs/src/external-plugin/model/DappInfos.js.map +7 -1
- package/lib/cjs/src/external-plugin/model/SelectorDetails.js +2 -3
- package/lib/cjs/src/external-plugin/model/SelectorDetails.js.map +7 -1
- package/lib/cjs/src/index.js +2 -30
- package/lib/cjs/src/index.js.map +7 -1
- package/lib/cjs/src/nft/data/HttpNftDataSource.js +2 -57
- package/lib/cjs/src/nft/data/HttpNftDataSource.js.map +7 -1
- package/lib/cjs/src/nft/data/HttpNftDataSource.test.js +2 -0
- package/lib/cjs/src/nft/data/HttpNftDataSource.test.js.map +7 -0
- package/lib/cjs/src/nft/data/NftDataSource.js +2 -3
- package/lib/cjs/src/nft/data/NftDataSource.js.map +7 -1
- package/lib/cjs/src/nft/di/nftModuleFactory.js +2 -13
- package/lib/cjs/src/nft/di/nftModuleFactory.js.map +7 -1
- package/lib/cjs/src/nft/di/nftTypes.js +2 -8
- package/lib/cjs/src/nft/di/nftTypes.js.map +7 -1
- package/lib/cjs/src/nft/domain/NftContextLoader.js +2 -111
- package/lib/cjs/src/nft/domain/NftContextLoader.js.map +7 -1
- package/lib/cjs/src/nft/domain/NftContextLoader.test.js +2 -0
- package/lib/cjs/src/nft/domain/NftContextLoader.test.js.map +7 -0
- package/lib/cjs/src/shared/domain/ContextLoader.js +2 -3
- package/lib/cjs/src/shared/domain/ContextLoader.js.map +7 -1
- package/lib/cjs/src/shared/model/ClearSignContext.js +2 -13
- package/lib/cjs/src/shared/model/ClearSignContext.js.map +7 -1
- package/lib/cjs/src/shared/model/GenericPath.js +2 -0
- package/lib/cjs/src/shared/model/GenericPath.js.map +7 -0
- package/lib/cjs/src/shared/model/TransactionContext.js +2 -3
- package/lib/cjs/src/shared/model/TransactionContext.js.map +7 -1
- package/lib/cjs/src/shared/model/TransactionSubset.js +2 -3
- package/lib/cjs/src/shared/model/TransactionSubset.js.map +7 -1
- package/lib/cjs/src/shared/model/TypedDataClearSignContext.js +2 -6
- package/lib/cjs/src/shared/model/TypedDataClearSignContext.js.map +7 -1
- package/lib/cjs/src/shared/model/TypedDataContext.js +2 -3
- package/lib/cjs/src/shared/model/TypedDataContext.js.map +7 -1
- package/lib/cjs/src/shared/utils/HexStringUtils.js +2 -15
- package/lib/cjs/src/shared/utils/HexStringUtils.js.map +7 -1
- package/lib/cjs/src/token/data/HttpTokenDataSource.js +2 -83
- package/lib/cjs/src/token/data/HttpTokenDataSource.js.map +7 -1
- package/lib/cjs/src/token/data/HttpTokenDataSource.test.js +2 -0
- package/lib/cjs/src/token/data/HttpTokenDataSource.test.js.map +7 -0
- package/lib/cjs/src/token/data/TokenDataSource.js +2 -3
- package/lib/cjs/src/token/data/TokenDataSource.js.map +7 -1
- package/lib/cjs/src/token/data/TokenDto.js +2 -3
- package/lib/cjs/src/token/data/TokenDto.js.map +7 -1
- package/lib/cjs/src/token/di/tokenModuleFactory.js +2 -13
- package/lib/cjs/src/token/di/tokenModuleFactory.js.map +7 -1
- package/lib/cjs/src/token/di/tokenTypes.js +2 -8
- package/lib/cjs/src/token/di/tokenTypes.js.map +7 -1
- package/lib/cjs/src/token/domain/TokenContextLoader.js +2 -74
- package/lib/cjs/src/token/domain/TokenContextLoader.js.map +7 -1
- package/lib/cjs/src/token/domain/TokenContextLoader.test.js +2 -0
- package/lib/cjs/src/token/domain/TokenContextLoader.test.js.map +7 -0
- package/lib/cjs/src/transaction/data/CalldataDto.js +2 -0
- package/lib/cjs/src/transaction/data/CalldataDto.js.map +7 -0
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js +2 -0
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
- package/lib/cjs/src/transaction/data/TransactionDataSource.js +2 -0
- package/lib/cjs/src/transaction/data/TransactionDataSource.js.map +7 -0
- package/lib/cjs/src/transaction/di/transactionModuleFactory.js +2 -0
- package/lib/cjs/src/transaction/di/transactionModuleFactory.js.map +7 -0
- package/lib/cjs/src/transaction/di/transactionTypes.js +2 -0
- package/lib/cjs/src/transaction/di/transactionTypes.js.map +7 -0
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.js +2 -0
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.js.map +7 -0
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js +2 -0
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
- package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js +2 -0
- package/lib/cjs/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
- package/lib/cjs/src/trusted-name/data/TrustedNameDto.js +2 -0
- package/lib/cjs/src/trusted-name/data/TrustedNameDto.js.map +7 -0
- package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
- package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
- package/lib/cjs/src/trusted-name/di/trustedNameTypes.js +2 -0
- package/lib/cjs/src/trusted-name/di/trustedNameTypes.js.map +7 -0
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
- package/lib/cjs/src/typed-data/data/FiltersDto.js +2 -3
- package/lib/cjs/src/typed-data/data/FiltersDto.js.map +7 -1
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js +2 -163
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -1
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
- package/lib/cjs/src/typed-data/data/TypedDataDataSource.js +2 -3
- package/lib/cjs/src/typed-data/data/TypedDataDataSource.js.map +7 -1
- package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js +2 -13
- package/lib/cjs/src/typed-data/di/typedDataModuleFactory.js.map +7 -1
- package/lib/cjs/src/typed-data/di/typedDataTypes.js +2 -8
- package/lib/cjs/src/typed-data/di/typedDataTypes.js.map +7 -1
- package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -127
- package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -1
- package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
- package/lib/cjs/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
- package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js +2 -3
- package/lib/cjs/src/typed-data/domain/TypedDataContextLoader.js.map +7 -1
- package/lib/esm/index.js +2 -4
- package/lib/esm/index.js.map +7 -1
- package/lib/esm/package.json +53 -59
- package/lib/esm/src/ContextModule.js +1 -2
- package/lib/esm/src/ContextModule.js.map +7 -1
- package/lib/esm/src/ContextModuleBuilder.js +2 -83
- package/lib/esm/src/ContextModuleBuilder.js.map +7 -1
- package/lib/esm/src/ContextModuleBuilder.test.js +2 -0
- package/lib/esm/src/ContextModuleBuilder.test.js.map +7 -0
- package/lib/esm/src/DefaultContextModule.js +2 -17
- package/lib/esm/src/DefaultContextModule.js.map +7 -1
- package/lib/esm/src/DefaultContextModule.test.js +2 -0
- package/lib/esm/src/DefaultContextModule.test.js.map +7 -0
- package/lib/esm/src/config/di/configModuleFactory.js +2 -6
- package/lib/esm/src/config/di/configModuleFactory.js.map +7 -1
- package/lib/esm/src/config/di/configTypes.js +2 -4
- package/lib/esm/src/config/di/configTypes.js.map +7 -1
- package/lib/esm/src/config/model/ContextModuleConfig.js +1 -2
- package/lib/esm/src/config/model/ContextModuleConfig.js.map +7 -1
- package/lib/esm/src/di.js +2 -13
- package/lib/esm/src/di.js.map +7 -1
- package/lib/esm/src/external-plugin/data/DAppDto.js +1 -2
- package/lib/esm/src/external-plugin/data/DAppDto.js.map +7 -1
- package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js +1 -2
- package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.js.map +7 -1
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js +2 -77
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.js.map +7 -1
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js +2 -0
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.test.js.map +7 -0
- package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js +2 -9
- package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.js.map +7 -1
- package/lib/esm/src/external-plugin/di/externalPluginTypes.js +2 -5
- package/lib/esm/src/external-plugin/di/externalPluginTypes.js.map +7 -1
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js +2 -133
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.js.map +7 -1
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js +2 -0
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +7 -0
- package/lib/esm/src/external-plugin/model/DappInfos.js +1 -2
- package/lib/esm/src/external-plugin/model/DappInfos.js.map +7 -1
- package/lib/esm/src/external-plugin/model/SelectorDetails.js +1 -2
- package/lib/esm/src/external-plugin/model/SelectorDetails.js.map +7 -1
- package/lib/esm/src/index.js +2 -14
- package/lib/esm/src/index.js.map +7 -1
- package/lib/esm/src/nft/data/HttpNftDataSource.js +2 -51
- package/lib/esm/src/nft/data/HttpNftDataSource.js.map +7 -1
- package/lib/esm/src/nft/data/HttpNftDataSource.test.js +2 -0
- package/lib/esm/src/nft/data/HttpNftDataSource.test.js.map +7 -0
- package/lib/esm/src/nft/data/NftDataSource.js +1 -2
- package/lib/esm/src/nft/data/NftDataSource.js.map +7 -1
- package/lib/esm/src/nft/di/nftModuleFactory.js +2 -9
- package/lib/esm/src/nft/di/nftModuleFactory.js.map +7 -1
- package/lib/esm/src/nft/di/nftTypes.js +2 -5
- package/lib/esm/src/nft/di/nftTypes.js.map +7 -1
- package/lib/esm/src/nft/domain/NftContextLoader.js +2 -108
- package/lib/esm/src/nft/domain/NftContextLoader.js.map +7 -1
- package/lib/esm/src/nft/domain/NftContextLoader.test.js +2 -0
- package/lib/esm/src/nft/domain/NftContextLoader.test.js.map +7 -0
- package/lib/esm/src/shared/domain/ContextLoader.js +1 -2
- package/lib/esm/src/shared/domain/ContextLoader.js.map +7 -1
- package/lib/esm/src/shared/model/ClearSignContext.js +2 -10
- package/lib/esm/src/shared/model/ClearSignContext.js.map +7 -1
- package/lib/esm/src/shared/model/GenericPath.js +2 -0
- package/lib/esm/src/shared/model/GenericPath.js.map +7 -0
- package/lib/esm/src/shared/model/TransactionContext.js +1 -2
- package/lib/esm/src/shared/model/TransactionContext.js.map +7 -1
- package/lib/esm/src/shared/model/TransactionSubset.js +1 -2
- package/lib/esm/src/shared/model/TransactionSubset.js.map +7 -1
- package/lib/esm/src/shared/model/TypedDataClearSignContext.js +2 -3
- package/lib/esm/src/shared/model/TypedDataClearSignContext.js.map +7 -1
- package/lib/esm/src/shared/model/TypedDataContext.js +1 -2
- package/lib/esm/src/shared/model/TypedDataContext.js.map +7 -1
- package/lib/esm/src/shared/utils/HexStringUtils.js +2 -11
- package/lib/esm/src/shared/utils/HexStringUtils.js.map +7 -1
- package/lib/esm/src/token/data/HttpTokenDataSource.js +2 -77
- package/lib/esm/src/token/data/HttpTokenDataSource.js.map +7 -1
- package/lib/esm/src/token/data/HttpTokenDataSource.test.js +2 -0
- package/lib/esm/src/token/data/HttpTokenDataSource.test.js.map +7 -0
- package/lib/esm/src/token/data/TokenDataSource.js +1 -2
- package/lib/esm/src/token/data/TokenDataSource.js.map +7 -1
- package/lib/esm/src/token/data/TokenDto.js +1 -2
- package/lib/esm/src/token/data/TokenDto.js.map +7 -1
- package/lib/esm/src/token/di/tokenModuleFactory.js +2 -9
- package/lib/esm/src/token/di/tokenModuleFactory.js.map +7 -1
- package/lib/esm/src/token/di/tokenTypes.js +2 -5
- package/lib/esm/src/token/di/tokenTypes.js.map +7 -1
- package/lib/esm/src/token/domain/TokenContextLoader.js +2 -71
- package/lib/esm/src/token/domain/TokenContextLoader.js.map +7 -1
- package/lib/esm/src/token/domain/TokenContextLoader.test.js +2 -0
- package/lib/esm/src/token/domain/TokenContextLoader.test.js.map +7 -0
- package/lib/esm/src/transaction/data/CalldataDto.js +1 -0
- package/lib/esm/src/transaction/data/CalldataDto.js.map +7 -0
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.js +2 -0
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.js.map +7 -0
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js +2 -0
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js.map +7 -0
- package/lib/esm/src/transaction/data/TransactionDataSource.js +1 -0
- package/lib/esm/src/transaction/data/TransactionDataSource.js.map +7 -0
- package/lib/esm/src/transaction/di/transactionModuleFactory.js +2 -0
- package/lib/esm/src/transaction/di/transactionModuleFactory.js.map +7 -0
- package/lib/esm/src/transaction/di/transactionTypes.js +2 -0
- package/lib/esm/src/transaction/di/transactionTypes.js.map +7 -0
- package/lib/esm/src/transaction/domain/TransactionContextLoader.js +2 -0
- package/lib/esm/src/transaction/domain/TransactionContextLoader.js.map +7 -0
- package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js +2 -0
- package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js.map +7 -0
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js +2 -0
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js.map +7 -0
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js +2 -0
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +7 -0
- package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js +1 -0
- package/lib/esm/src/trusted-name/data/TrustedNameDataSource.js.map +7 -0
- package/lib/esm/src/trusted-name/data/TrustedNameDto.js +1 -0
- package/lib/esm/src/trusted-name/data/TrustedNameDto.js.map +7 -0
- package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js +2 -0
- package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js.map +7 -0
- package/lib/esm/src/trusted-name/di/trustedNameTypes.js +2 -0
- package/lib/esm/src/trusted-name/di/trustedNameTypes.js.map +7 -0
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js +2 -0
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js.map +7 -0
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js +2 -0
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +7 -0
- package/lib/esm/src/typed-data/data/FiltersDto.js +1 -2
- package/lib/esm/src/typed-data/data/FiltersDto.js.map +7 -1
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js +2 -157
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js.map +7 -1
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js +2 -0
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.test.js.map +7 -0
- package/lib/esm/src/typed-data/data/TypedDataDataSource.js +1 -2
- package/lib/esm/src/typed-data/data/TypedDataDataSource.js.map +7 -1
- package/lib/esm/src/typed-data/di/typedDataModuleFactory.js +2 -9
- package/lib/esm/src/typed-data/di/typedDataModuleFactory.js.map +7 -1
- package/lib/esm/src/typed-data/di/typedDataTypes.js +2 -5
- package/lib/esm/src/typed-data/di/typedDataTypes.js.map +7 -1
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js +2 -124
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.js.map +7 -1
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js +2 -0
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.test.js.map +7 -0
- package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js +1 -2
- package/lib/esm/src/typed-data/domain/TypedDataContextLoader.js.map +7 -1
- package/lib/{cjs → types}/src/ContextModule.d.ts +3 -2
- package/lib/types/src/ContextModule.d.ts.map +1 -0
- package/lib/{cjs → types}/src/ContextModuleBuilder.d.ts +9 -11
- package/lib/types/src/ContextModuleBuilder.d.ts.map +1 -0
- package/lib/types/src/ContextModuleBuilder.test.d.ts +2 -0
- package/lib/types/src/ContextModuleBuilder.test.d.ts.map +1 -0
- package/lib/types/src/DefaultContextModule.d.ts +18 -0
- package/lib/types/src/DefaultContextModule.d.ts.map +1 -0
- package/lib/types/src/DefaultContextModule.test.d.ts +2 -0
- package/lib/types/src/DefaultContextModule.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts +1 -1
- package/lib/{cjs → types}/src/config/di/configModuleFactory.d.ts.map +1 -1
- package/lib/types/src/config/model/ContextModuleConfig.d.ts +16 -0
- package/lib/types/src/config/model/ContextModuleConfig.d.ts.map +1 -0
- package/lib/{cjs → types}/src/di.d.ts +1 -1
- package/lib/types/src/di.d.ts.map +1 -0
- package/lib/{cjs → types}/src/external-plugin/data/ExternalPluginDataSource.d.ts +3 -3
- package/lib/types/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +1 -0
- package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts +2 -0
- package/lib/types/src/external-plugin/data/HttpExternalPluginDataSource.test.d.ts.map +1 -0
- package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts +2 -0
- package/lib/types/src/external-plugin/domain/ExternalPluginContextLoader.test.d.ts.map +1 -0
- package/lib/types/src/external-plugin/model/DappInfos.d.ts +6 -0
- package/lib/types/src/external-plugin/model/DappInfos.d.ts.map +1 -0
- package/lib/{cjs → types}/src/index.d.ts +3 -1
- package/lib/types/src/index.d.ts.map +1 -0
- package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts +2 -0
- package/lib/types/src/nft/data/HttpNftDataSource.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/nft/data/NftDataSource.d.ts +1 -1
- package/lib/types/src/nft/data/NftDataSource.d.ts.map +1 -0
- package/lib/{cjs → types}/src/nft/domain/NftContextLoader.d.ts +2 -1
- package/lib/types/src/nft/domain/NftContextLoader.d.ts.map +1 -0
- package/lib/types/src/nft/domain/NftContextLoader.test.d.ts +2 -0
- package/lib/types/src/nft/domain/NftContextLoader.test.d.ts.map +1 -0
- package/lib/types/src/shared/domain/ContextLoader.d.ts +7 -0
- package/lib/types/src/shared/domain/ContextLoader.d.ts.map +1 -0
- package/lib/types/src/shared/model/ClearSignContext.d.ts +40 -0
- package/lib/types/src/shared/model/ClearSignContext.d.ts.map +1 -0
- package/lib/types/src/shared/model/GenericPath.d.ts +105 -0
- package/lib/types/src/shared/model/GenericPath.d.ts.map +1 -0
- package/lib/types/src/shared/model/TransactionContext.d.ts +19 -0
- package/lib/types/src/shared/model/TransactionContext.d.ts.map +1 -0
- package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts.map +1 -1
- package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts +2 -0
- package/lib/types/src/token/data/HttpTokenDataSource.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/token/data/TokenDataSource.d.ts +1 -1
- package/lib/types/src/token/data/TokenDataSource.d.ts.map +1 -0
- package/lib/types/src/token/data/TokenDto.d.ts +16 -0
- package/lib/types/src/token/data/TokenDto.d.ts.map +1 -0
- package/lib/{cjs → types}/src/token/domain/TokenContextLoader.d.ts +2 -1
- package/lib/types/src/token/domain/TokenContextLoader.d.ts.map +1 -0
- package/lib/types/src/token/domain/TokenContextLoader.test.d.ts +2 -0
- package/lib/types/src/token/domain/TokenContextLoader.test.d.ts.map +1 -0
- package/lib/types/src/transaction/data/CalldataDto.d.ts +117 -0
- package/lib/types/src/transaction/data/CalldataDto.d.ts.map +1 -0
- package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts +19 -0
- package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts.map +1 -0
- package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts +2 -0
- package/lib/types/src/transaction/data/HttpTransactionDataSource.test.d.ts.map +1 -0
- package/lib/types/src/transaction/data/TransactionDataSource.d.ts +12 -0
- package/lib/types/src/transaction/data/TransactionDataSource.d.ts.map +1 -0
- package/lib/types/src/transaction/di/transactionModuleFactory.d.ts +3 -0
- package/lib/types/src/transaction/di/transactionModuleFactory.d.ts.map +1 -0
- package/lib/types/src/transaction/di/transactionTypes.d.ts +5 -0
- package/lib/types/src/transaction/di/transactionTypes.d.ts.map +1 -0
- package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts +10 -0
- package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts.map +1 -0
- package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts +2 -0
- package/lib/types/src/transaction/domain/TransactionContextLoader.test.d.ts.map +1 -0
- package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts +11 -0
- package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.d.ts.map +1 -0
- package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts +2 -0
- package/lib/types/src/trusted-name/data/HttpTrustedNameDataSource.test.d.ts.map +1 -0
- package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts +16 -0
- package/lib/types/src/trusted-name/data/TrustedNameDataSource.d.ts.map +1 -0
- package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts +15 -0
- package/lib/types/src/trusted-name/data/TrustedNameDto.d.ts.map +1 -0
- package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts +3 -0
- package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts.map +1 -0
- package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts +5 -0
- package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts.map +1 -0
- package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts +12 -0
- package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts.map +1 -0
- package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts +2 -0
- package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/typed-data/data/FiltersDto.d.ts +3 -0
- package/lib/types/src/typed-data/data/FiltersDto.d.ts.map +1 -0
- package/lib/types/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +1 -0
- package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts +3 -0
- package/lib/types/src/typed-data/data/HttpTypedDataDataSource.test.d.ts.map +1 -0
- package/lib/{cjs → types}/src/typed-data/data/TypedDataDataSource.d.ts +3 -3
- package/lib/types/src/typed-data/data/TypedDataDataSource.d.ts.map +1 -0
- package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +1 -1
- package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts +2 -0
- package/lib/types/src/typed-data/domain/DefaultTypedDataContextLoader.test.d.ts.map +1 -0
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -0
- package/package.json +21 -27
- package/lib/cjs/src/ContextModule.d.ts.map +0 -1
- package/lib/cjs/src/ContextModuleBuilder.d.ts.map +0 -1
- package/lib/cjs/src/DefaultContextModule.d.ts +0 -20
- package/lib/cjs/src/DefaultContextModule.d.ts.map +0 -1
- package/lib/cjs/src/config/model/ContextModuleConfig.d.ts +0 -9
- package/lib/cjs/src/config/model/ContextModuleConfig.d.ts.map +0 -1
- package/lib/cjs/src/di.d.ts.map +0 -1
- package/lib/cjs/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -1
- package/lib/cjs/src/external-plugin/model/DappInfos.d.ts +0 -6
- package/lib/cjs/src/external-plugin/model/DappInfos.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
- package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js +0 -3
- package/lib/cjs/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
- package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
- package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -40
- package/lib/cjs/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
- package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
- package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js +0 -13
- package/lib/cjs/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
- package/lib/cjs/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
- package/lib/cjs/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js +0 -8
- package/lib/cjs/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
- package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
- package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
- package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -66
- package/lib/cjs/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
- package/lib/cjs/src/index.d.ts.map +0 -1
- package/lib/cjs/src/nft/data/NftDataSource.d.ts.map +0 -1
- package/lib/cjs/src/nft/domain/NftContextLoader.d.ts.map +0 -1
- package/lib/cjs/src/shared/domain/ContextLoader.d.ts +0 -6
- package/lib/cjs/src/shared/domain/ContextLoader.d.ts.map +0 -1
- package/lib/cjs/src/shared/model/ClearSignContext.d.ts +0 -21
- package/lib/cjs/src/shared/model/ClearSignContext.d.ts.map +0 -1
- package/lib/cjs/src/shared/model/TransactionContext.d.ts +0 -6
- package/lib/cjs/src/shared/model/TransactionContext.d.ts.map +0 -1
- package/lib/cjs/src/token/data/TokenDataSource.d.ts.map +0 -1
- package/lib/cjs/src/token/data/TokenDto.d.ts +0 -6
- package/lib/cjs/src/token/data/TokenDto.d.ts.map +0 -1
- package/lib/cjs/src/token/domain/TokenContextLoader.d.ts.map +0 -1
- package/lib/cjs/src/typed-data/data/FiltersDto.d.ts.map +0 -1
- package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
- package/lib/cjs/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -1
- package/lib/cjs/tsconfig.cjs.tsbuildinfo +0 -1
- package/lib/esm/index.d.ts +0 -3
- package/lib/esm/index.d.ts.map +0 -1
- package/lib/esm/src/ContextModule.d.ts +0 -9
- package/lib/esm/src/ContextModule.d.ts.map +0 -1
- package/lib/esm/src/ContextModuleBuilder.d.ts +0 -45
- package/lib/esm/src/ContextModuleBuilder.d.ts.map +0 -1
- package/lib/esm/src/DefaultContextModule.d.ts +0 -20
- package/lib/esm/src/DefaultContextModule.d.ts.map +0 -1
- package/lib/esm/src/config/di/configModuleFactory.d.ts +0 -4
- package/lib/esm/src/config/di/configModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/config/di/configTypes.d.ts +0 -4
- package/lib/esm/src/config/di/configTypes.d.ts.map +0 -1
- package/lib/esm/src/config/model/ContextModuleConfig.d.ts +0 -9
- package/lib/esm/src/config/model/ContextModuleConfig.d.ts.map +0 -1
- package/lib/esm/src/di.d.ts +0 -8
- package/lib/esm/src/di.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/data/DAppDto.d.ts +0 -38
- package/lib/esm/src/external-plugin/data/DAppDto.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts +0 -12
- package/lib/esm/src/external-plugin/data/ExternalPluginDataSource.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -10
- package/lib/esm/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -3
- package/lib/esm/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts +0 -5
- package/lib/esm/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -15
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/model/DappInfos.d.ts +0 -6
- package/lib/esm/src/external-plugin/model/DappInfos.d.ts.map +0 -1
- package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts +0 -8
- package/lib/esm/src/external-plugin/model/SelectorDetails.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts +0 -9
- package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js +0 -2
- package/lib/esm/src/forward-domain/data/ForwardDomainDataSource.js.map +0 -1
- package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts +0 -6
- package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js +0 -34
- package/lib/esm/src/forward-domain/data/HttpForwardDomainDataSource.js.map +0 -1
- package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts +0 -3
- package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js +0 -9
- package/lib/esm/src/forward-domain/di/forwardDomainModuleFactory.js.map +0 -1
- package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts +0 -5
- package/lib/esm/src/forward-domain/di/forwardDomainTypes.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/di/forwardDomainTypes.js +0 -5
- package/lib/esm/src/forward-domain/di/forwardDomainTypes.js.map +0 -1
- package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts +0 -11
- package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.d.ts.map +0 -1
- package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js +0 -63
- package/lib/esm/src/forward-domain/domain/ForwardDomainContextLoader.js.map +0 -1
- package/lib/esm/src/index.d.ts +0 -14
- package/lib/esm/src/index.d.ts.map +0 -1
- package/lib/esm/src/nft/data/HttpNftDataSource.d.ts +0 -7
- package/lib/esm/src/nft/data/HttpNftDataSource.d.ts.map +0 -1
- package/lib/esm/src/nft/data/NftDataSource.d.ts +0 -15
- package/lib/esm/src/nft/data/NftDataSource.d.ts.map +0 -1
- package/lib/esm/src/nft/di/nftModuleFactory.d.ts +0 -3
- package/lib/esm/src/nft/di/nftModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/nft/di/nftTypes.d.ts +0 -5
- package/lib/esm/src/nft/di/nftTypes.d.ts.map +0 -1
- package/lib/esm/src/nft/domain/NftContextLoader.d.ts +0 -11
- package/lib/esm/src/nft/domain/NftContextLoader.d.ts.map +0 -1
- package/lib/esm/src/shared/domain/ContextLoader.d.ts +0 -6
- package/lib/esm/src/shared/domain/ContextLoader.d.ts.map +0 -1
- package/lib/esm/src/shared/model/ClearSignContext.d.ts +0 -21
- package/lib/esm/src/shared/model/ClearSignContext.d.ts.map +0 -1
- package/lib/esm/src/shared/model/TransactionContext.d.ts +0 -6
- package/lib/esm/src/shared/model/TransactionContext.d.ts.map +0 -1
- package/lib/esm/src/shared/model/TransactionSubset.d.ts +0 -6
- package/lib/esm/src/shared/model/TransactionSubset.d.ts.map +0 -1
- package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts +0 -33
- package/lib/esm/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -1
- package/lib/esm/src/shared/model/TypedDataContext.d.ts +0 -16
- package/lib/esm/src/shared/model/TypedDataContext.d.ts.map +0 -1
- package/lib/esm/src/shared/utils/HexStringUtils.d.ts +0 -4
- package/lib/esm/src/shared/utils/HexStringUtils.d.ts.map +0 -1
- package/lib/esm/src/token/data/HttpTokenDataSource.d.ts +0 -9
- package/lib/esm/src/token/data/HttpTokenDataSource.d.ts.map +0 -1
- package/lib/esm/src/token/data/TokenDataSource.d.ts +0 -9
- package/lib/esm/src/token/data/TokenDataSource.d.ts.map +0 -1
- package/lib/esm/src/token/data/TokenDto.d.ts +0 -6
- package/lib/esm/src/token/data/TokenDto.d.ts.map +0 -1
- package/lib/esm/src/token/di/tokenModuleFactory.d.ts +0 -3
- package/lib/esm/src/token/di/tokenModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/token/di/tokenTypes.d.ts +0 -5
- package/lib/esm/src/token/di/tokenTypes.d.ts.map +0 -1
- package/lib/esm/src/token/domain/TokenContextLoader.d.ts +0 -15
- package/lib/esm/src/token/domain/TokenContextLoader.d.ts.map +0 -1
- package/lib/esm/src/typed-data/data/FiltersDto.d.ts +0 -55
- package/lib/esm/src/typed-data/data/FiltersDto.d.ts.map +0 -1
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -14
- package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +0 -1
- package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts +0 -17
- package/lib/esm/src/typed-data/data/TypedDataDataSource.d.ts.map +0 -1
- package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts +0 -3
- package/lib/esm/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -1
- package/lib/esm/src/typed-data/di/typedDataTypes.d.ts +0 -5
- package/lib/esm/src/typed-data/di/typedDataTypes.d.ts.map +0 -1
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -13
- package/lib/esm/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts.map +0 -1
- package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -6
- package/lib/esm/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -1
- package/lib/esm/tsconfig.esm.tsbuildinfo +0 -1
- /package/lib/{cjs → types}/index.d.ts +0 -0
- /package/lib/{cjs → types}/index.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/config/di/configTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/config/di/configTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/data/DAppDto.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/data/HttpExternalPluginDataSource.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/di/externalPluginModuleFactory.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/di/externalPluginTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/domain/ExternalPluginContextLoader.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts +0 -0
- /package/lib/{cjs → types}/src/external-plugin/model/SelectorDetails.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/nft/data/HttpNftDataSource.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts +0 -0
- /package/lib/{cjs → types}/src/nft/di/nftModuleFactory.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/nft/di/nftTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/model/TransactionSubset.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataClearSignContext.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/model/TypedDataContext.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts +0 -0
- /package/lib/{cjs → types}/src/shared/utils/HexStringUtils.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/token/data/HttpTokenDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts +0 -0
- /package/lib/{cjs → types}/src/token/di/tokenModuleFactory.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/token/di/tokenTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/di/typedDataModuleFactory.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/di/typedDataTypes.d.ts.map +0 -0
- /package/lib/{cjs → types}/src/typed-data/domain/DefaultTypedDataContextLoader.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts +0 -0
- /package/lib/{cjs → types}/src/typed-data/domain/TypedDataContextLoader.d.ts.map +0 -0
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/typed-data/domain/DefaultTypedDataContextLoader.ts"],
|
|
4
|
+
"sourcesContent": ["import type { HexaString } from \"@ledgerhq/device-management-kit\";\nimport { inject, injectable } from \"inversify\";\n\nimport type {\n TypedDataClearSignContext,\n TypedDataFilter,\n TypedDataFilterPath,\n TypedDataToken,\n TypedDataTokenIndex,\n} from \"@/shared/model/TypedDataClearSignContext\";\nimport { VERIFYING_CONTRACT_TOKEN_INDEX } from \"@/shared/model/TypedDataClearSignContext\";\nimport type { TypedDataContext } from \"@/shared/model/TypedDataContext\";\nimport type { TokenDataSource } from \"@/token/data/TokenDataSource\";\nimport { tokenTypes } from \"@/token/di/tokenTypes\";\nimport type { TypedDataDataSource } from \"@/typed-data/data/TypedDataDataSource\";\nimport { typedDataTypes } from \"@/typed-data/di/typedDataTypes\";\nimport type { TypedDataContextLoader } from \"@/typed-data/domain/TypedDataContextLoader\";\n\n@injectable()\nexport class DefaultTypedDataContextLoader implements TypedDataContextLoader {\n constructor(\n @inject(typedDataTypes.TypedDataDataSource)\n private dataSource: TypedDataDataSource,\n @inject(tokenTypes.TokenDataSource)\n private tokenDataSource: TokenDataSource,\n ) {}\n\n async load(typedData: TypedDataContext): Promise<TypedDataClearSignContext> {\n // Get the typed data filters from the data source\n const data = await this.dataSource.getTypedDataFilters({\n address: typedData.verifyingContract,\n chainId: typedData.chainId,\n version: typedData.version,\n schema: typedData.schema,\n });\n\n // If there was an error getting the typed data filters, return an error immediately\n if (data.isLeft()) {\n return {\n type: \"error\",\n error: data.extract(),\n };\n }\n\n // Else, extract the message info and filters\n const { messageInfo, filters } = data.unsafeCoerce();\n\n // Loop through the typed data filters to extract informations\n const mappedFilters: Record<TypedDataFilterPath, TypedDataFilter> = {};\n const mappedTokens: Record<TypedDataTokenIndex, TypedDataToken> = {};\n for (const filter of filters) {\n // Add the filter to the clear signing context\n mappedFilters[filter.path] = filter;\n if (filter.type !== \"token\" && filter.type !== \"amount\") {\n continue; // no token reference\n }\n\n // If the filter references a token, retrieve its descriptor from the tokens data source\n const tokenIndex = filter.tokenIndex;\n if (mappedTokens[tokenIndex] !== undefined) {\n continue; // Already fetched for a previous filter\n }\n\n // If the filter is a token, get token address from typed message values, and fetch descriptor\n if (filter.type === \"token\") {\n const values = typedData.fieldsValues.filter(\n (entry) => entry.path === filter.path,\n );\n if (values.length === 0) {\n // No value matching the referenced token. It may be located in an empty array.\n continue;\n }\n const value = values[0]!;\n const address = this.convertAddressToHexaString(value.value);\n\n // Arrays with different tokens are not supported since there is only 1 tokenIndex per filter.\n // Only fetch tokens if all values are the same.\n if (\n values.every(\n (entry) => this.convertAddressToHexaString(entry.value) === address,\n )\n ) {\n // Fetch descriptor\n const chainId = typedData.chainId;\n const payload = await this.tokenDataSource.getTokenInfosPayload({\n address,\n chainId,\n });\n payload.ifRight((p) => {\n mappedTokens[tokenIndex] = p;\n });\n }\n }\n\n // If the filter is an amount with a reference to the verifyingContract, fetch verifyingContract descriptor.\n // This is because descriptors data-sources should be compatible with Ledger devices specifications:\n // https://github.com/LedgerHQ/app-ethereum/blob/develop/doc/ethapp.adoc#amount-join-value\n else if (\n filter.type === \"amount\" &&\n tokenIndex === VERIFYING_CONTRACT_TOKEN_INDEX\n ) {\n const address = typedData.verifyingContract;\n const chainId = typedData.chainId;\n const payload = await this.tokenDataSource.getTokenInfosPayload({\n address,\n chainId,\n });\n payload.ifRight((p) => {\n mappedTokens[tokenIndex] = p;\n });\n }\n }\n\n return {\n type: \"success\",\n messageInfo,\n filters: mappedFilters,\n tokens: mappedTokens,\n };\n }\n\n private convertAddressToHexaString(address: Uint8Array): HexaString {\n // Address size is 20 bytes so 40 characters, padded with zeros on the left\n return `0x${Array.from(address, (byte) =>\n byte.toString(16).padStart(2, \"0\"),\n )\n .join(\"\")\n .padStart(40, \"0\")}`;\n }\n}\n"],
|
|
5
|
+
"mappings": "iOACA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YASnC,OAAS,kCAAAC,MAAsC,2CAG/C,OAAS,cAAAC,MAAkB,wBAE3B,OAAS,kBAAAC,MAAsB,iCAIxB,IAAMC,EAAN,KAAsE,CAC3E,YAEUC,EAEAC,EACR,CAHQ,gBAAAD,EAEA,qBAAAC,CACP,CAEH,MAAM,KAAKC,EAAiE,CAE1E,MAAMC,EAAO,MAAM,KAAK,WAAW,oBAAoB,CACrD,QAASD,EAAU,kBACnB,QAASA,EAAU,QACnB,QAASA,EAAU,QACnB,OAAQA,EAAU,MACpB,CAAC,EAGD,GAAIC,EAAK,OAAO,EACd,MAAO,CACL,KAAM,QACN,MAAOA,EAAK,QAAQ,CACtB,EAIF,KAAM,CAAE,YAAAC,EAAa,QAAAC,CAAQ,EAAIF,EAAK,aAAa,EAG7CG,EAA8D,CAAC,EAC/DC,EAA4D,CAAC,EACnE,UAAWC,KAAUH,EAAS,CAG5B,GADAC,EAAcE,EAAO,IAAI,EAAIA,EACzBA,EAAO,OAAS,SAAWA,EAAO,OAAS,SAC7C,SAIF,MAAMC,EAAaD,EAAO,WAC1B,GAAID,EAAaE,CAAU,IAAM,QAKjC,GAAID,EAAO,OAAS,QAAS,CAC3B,MAAME,EAASR,EAAU,aAAa,OACnCS,GAAUA,EAAM,OAASH,EAAO,IACnC,EACA,GAAIE,EAAO,SAAW,EAEpB,SAEF,MAAME,EAAQF,EAAO,CAAC,EAChBG,EAAU,KAAK,2BAA2BD,EAAM,KAAK,EAI3D,GACEF,EAAO,MACJC,GAAU,KAAK,2BAA2BA,EAAM,KAAK,IAAME,CAC9D,EACA,CAEA,MAAMC,EAAUZ,EAAU,SACV,MAAM,KAAK,gBAAgB,qBAAqB,CAC9D,QAAAW,EACA,QAAAC,CACF,CAAC,GACO,QAASC,GAAM,CACrBR,EAAaE,CAAU,EAAIM,CAC7B,CAAC,CACH,CACF,SAMEP,EAAO,OAAS,UAChBC,IAAeO,EACf,CACA,MAAMH,EAAUX,EAAU,kBACpBY,EAAUZ,EAAU,SACV,MAAM,KAAK,gBAAgB,qBAAqB,CAC9D,QAAAW,EACA,QAAAC,CACF,CAAC,GACO,QAASC,GAAM,CACrBR,EAAaE,CAAU,EAAIM,CAC7B,CAAC,CACH,EACF,CAEA,MAAO,CACL,KAAM,UACN,YAAAX,EACA,QAASE,EACT,OAAQC,CACV,CACF,CAEQ,2BAA2BM,EAAiC,CAElE,MAAO,KAAK,MAAM,KAAKA,EAAUI,GAC/BA,EAAK,SAAS,EAAE,EAAE,SAAS,EAAG,GAAG,CACnC,EACG,KAAK,EAAE,EACP,SAAS,GAAI,GAAG,CAAC,EACtB,CACF,EA9GalB,EAANmB,EAAA,CADNC,EAAW,EAGPC,EAAA,EAAAC,EAAOC,EAAe,mBAAmB,GAEzCF,EAAA,EAAAC,EAAOE,EAAW,eAAe,IAJzBxB",
|
|
6
|
+
"names": ["inject", "injectable", "VERIFYING_CONTRACT_TOKEN_INDEX", "tokenTypes", "typedDataTypes", "DefaultTypedDataContextLoader", "dataSource", "tokenDataSource", "typedData", "data", "messageInfo", "filters", "mappedFilters", "mappedTokens", "filter", "tokenIndex", "values", "entry", "value", "address", "chainId", "p", "VERIFYING_CONTRACT_TOKEN_INDEX", "byte", "__decorateClass", "injectable", "__decorateParam", "inject", "typedDataTypes", "tokenTypes"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{Left as b,Right as s}from"purify-ts";import{DefaultTypedDataContextLoader as o}from"../../typed-data/domain/DefaultTypedDataContextLoader";describe("TokenContextLoader",()=>{const f={getTokenInfosPayload:jest.fn()},t={getTypedDataFilters:jest.fn()},d=new o(t,f),c={PermitSingle:[{name:"details",type:"PermitDetails"},{name:"spender",type:"address"},{name:"sigDeadline",type:"uint256"}],PermitDetails:[{type:"address[]",name:"token"},{name:"amount",type:"uint160"},{name:"expiration",type:"uint48"},{name:"nonce",type:"uint48"}],EIP712Domain:[{name:"name",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"}]},n=[{path:"details.token.[]",value:Uint8Array.from([124,235,35,253,107,192,173,213,158,98,172,37,87,130,112,207,241,185,246,25])},{path:"details.amount",value:Uint8Array.from([18])},{path:"spender",value:Uint8Array.from([18])},{path:"details.expiration",value:Uint8Array.from([18])}];beforeEach(()=>{jest.clearAllMocks(),jest.spyOn(f,"getTokenInfosPayload").mockImplementation(({address:a})=>Promise.resolve(s(`payload-${a}`)))}),describe("load function",()=>{it("success with referenced token",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:c,fieldsValues:n};jest.spyOn(t,"getTypedDataFilters").mockImplementation(()=>Promise.resolve(s({messageInfo:{displayName:"Permit2",filtersCount:4,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"},{type:"amount",displayName:"Amount allowance",path:"details.amount",tokenIndex:0,signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3"},{type:"raw",displayName:"Approve to spender",path:"spender",signature:"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb"},{type:"datetime",displayName:"Approval expire",path:"details.expiration",signature:"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b"}]})));const e=await d.load(a);expect(e).toEqual({type:"success",messageInfo:{displayName:"Permit2",filtersCount:4,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},tokens:{0:"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619"},filters:{"details.amount":{displayName:"Amount allowance",path:"details.amount",signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3",tokenIndex:0,type:"amount"},"details.expiration":{displayName:"Approval expire",path:"details.expiration",signature:"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b",type:"datetime"},"details.token.[]":{displayName:"Amount allowance",path:"details.token.[]",signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733",tokenIndex:0,type:"token"},spender:{displayName:"Approve to spender",path:"spender",signature:"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb",type:"raw"}}})}),it("success with referenced token verifying contract",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:c,fieldsValues:n};jest.spyOn(t,"getTypedDataFilters").mockImplementation(()=>Promise.resolve(s({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"},{type:"amount",displayName:"Amount allowance",path:"details.amount",tokenIndex:255,signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3"}]})));const e=await d.load(a);expect(e).toEqual({type:"success",messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},tokens:{0:"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",255:"payload-0x000000000022d473030f116ddee9f6b43ac78ba3"},filters:{"details.amount":{displayName:"Amount allowance",path:"details.amount",signature:"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3",tokenIndex:255,type:"amount"},"details.token.[]":{displayName:"Amount allowance",path:"details.token.[]",signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733",tokenIndex:0,type:"token"}}})}),it("should return an error if filters are unavailable",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:c,fieldsValues:n};jest.spyOn(t,"getTypedDataFilters").mockImplementation(()=>Promise.resolve(b(new Error("error"))));const e=await d.load(a);expect(e).toEqual({type:"error",error:new Error("error")})}),it("success with unavailable tokens",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:c,fieldsValues:n};jest.spyOn(t,"getTypedDataFilters").mockImplementation(()=>Promise.resolve(s({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]}))),jest.spyOn(f,"getTokenInfosPayload").mockImplementation(()=>Promise.resolve(b(new Error("token error"))));const e=await d.load(a);expect(e).toEqual({type:"success",messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},tokens:{},filters:{"details.token.[]":{displayName:"Amount allowance",path:"details.token.[]",signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733",tokenIndex:0,type:"token"}}})}),it("success with several identic tokens",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:c,fieldsValues:[{path:"details.token.[]",value:Uint8Array.from([124,235,35,253,107,192,173,213,158,98,172,37,87,130,112,207,241,185,246,25])},...n]};jest.spyOn(t,"getTypedDataFilters").mockImplementation(()=>Promise.resolve(s({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]}))),jest.spyOn(f,"getTokenInfosPayload").mockImplementation(()=>Promise.resolve(b(new Error("token error"))));const e=await d.load(a);expect(f.getTokenInfosPayload).toHaveBeenCalledWith({address:"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",chainId:1}),expect(e.type).toEqual("success")}),it("success with several different tokens",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:c,fieldsValues:[{path:"details.token.[]",value:Uint8Array.from([124,235,35,253,107,192,173,213,158,98,172,37,87,130,112,207,241,185,246,255])},...n]};jest.spyOn(t,"getTypedDataFilters").mockImplementation(()=>Promise.resolve(s({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.token.[]",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]})));const e=await d.load(a);expect(f.getTokenInfosPayload).not.toHaveBeenCalledWith({address:"0x7ceb23fd6bc0add59e62ac25578270cff1b9f6ff",chainId:1}),expect(f.getTokenInfosPayload).not.toHaveBeenCalledWith({address:"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619",chainId:1}),expect(e.type).toEqual("success")}),it("should ignore the token if value is not found",async()=>{const a={verifyingContract:"0x000000000022d473030f116ddee9f6b43ac78ba3",chainId:1,version:"v2",schema:c,fieldsValues:n};jest.spyOn(t,"getTypedDataFilters").mockImplementation(()=>Promise.resolve(s({messageInfo:{displayName:"Permit2",filtersCount:2,signature:"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3"},filters:[{type:"token",displayName:"Amount allowance",path:"details.badtoken",tokenIndex:0,signature:"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733"}]})));const e=await d.load(a);expect(e.type).toEqual("success"),e.type==="success"&&(expect(e.filters["details.badtoken"]?.displayName).toEqual("Amount allowance"),expect(e.tokens).toEqual({}))})})});
|
|
2
|
+
//# sourceMappingURL=DefaultTypedDataContextLoader.test.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/typed-data/domain/DefaultTypedDataContextLoader.test.ts"],
|
|
4
|
+
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport type { TypedDataContext } from \"@/shared/model/TypedDataContext\";\nimport type { TokenDataSource } from \"@/token/data/TokenDataSource\";\nimport type { TypedDataDataSource } from \"@/typed-data/data/TypedDataDataSource\";\nimport { DefaultTypedDataContextLoader } from \"@/typed-data/domain/DefaultTypedDataContextLoader\";\n\ndescribe(\"TokenContextLoader\", () => {\n const mockTokenDataSource: TokenDataSource = {\n getTokenInfosPayload: jest.fn(),\n };\n const mockTypedDataDataSource: TypedDataDataSource = {\n getTypedDataFilters: jest.fn(),\n };\n const loader = new DefaultTypedDataContextLoader(\n mockTypedDataDataSource,\n mockTokenDataSource,\n );\n\n const TEST_TYPES = {\n PermitSingle: [\n {\n name: \"details\",\n type: \"PermitDetails\",\n },\n {\n name: \"spender\",\n type: \"address\",\n },\n {\n name: \"sigDeadline\",\n type: \"uint256\",\n },\n ],\n PermitDetails: [\n {\n type: \"address[]\",\n name: \"token\",\n },\n {\n name: \"amount\",\n type: \"uint160\",\n },\n {\n name: \"expiration\",\n type: \"uint48\",\n },\n {\n name: \"nonce\",\n type: \"uint48\",\n },\n ],\n EIP712Domain: [\n {\n name: \"name\",\n type: \"string\",\n },\n {\n name: \"chainId\",\n type: \"uint256\",\n },\n {\n name: \"verifyingContract\",\n type: \"address\",\n },\n ],\n };\n const TEST_VALUES = [\n {\n path: \"details.token.[]\",\n value: Uint8Array.from([\n 0x7c, 0xeb, 0x23, 0xfd, 0x6b, 0xc0, 0xad, 0xd5, 0x9e, 0x62, 0xac, 0x25,\n 0x57, 0x82, 0x70, 0xcf, 0xf1, 0xb9, 0xf6, 0x19,\n ]),\n },\n {\n path: \"details.amount\",\n value: Uint8Array.from([0x12]),\n },\n {\n path: \"spender\",\n value: Uint8Array.from([0x12]),\n },\n {\n path: \"details.expiration\",\n value: Uint8Array.from([0x12]),\n },\n ];\n\n beforeEach(() => {\n jest.clearAllMocks();\n jest\n .spyOn(mockTokenDataSource, \"getTokenInfosPayload\")\n .mockImplementation(({ address }) =>\n Promise.resolve(Right(`payload-${address}`)),\n );\n });\n\n describe(\"load function\", () => {\n it(\"success with referenced token\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 4,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n {\n type: \"amount\",\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n tokenIndex: 0,\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n },\n {\n type: \"raw\",\n displayName: \"Approve to spender\",\n path: \"spender\",\n signature:\n \"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb\",\n },\n {\n type: \"datetime\",\n displayName: \"Approval expire\",\n path: \"details.expiration\",\n signature:\n \"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b\",\n },\n ],\n }),\n ),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"success\",\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 4,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n tokens: {\n 0: \"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\",\n },\n filters: {\n \"details.amount\": {\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n tokenIndex: 0,\n type: \"amount\",\n },\n \"details.expiration\": {\n displayName: \"Approval expire\",\n path: \"details.expiration\",\n signature:\n \"3044022056b3381e4540629ad73bc434ec49d80523234b82f62340fbb77157fb0eb21a680220459fe9cf6ca309f9c7dfc6d4711fea1848dba661563c57f77b3c2dc480b3a63b\",\n type: \"datetime\",\n },\n \"details.token.[]\": {\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n tokenIndex: 0,\n type: \"token\",\n },\n spender: {\n displayName: \"Approve to spender\",\n path: \"spender\",\n signature:\n \"3044022033e5713d9cb9bc375b56a9fb53b736c81ea3c4ac5cfb2d3ca7f8b8f0558fe2430220543ca4fef6d6f725f29e343f167fe9dd582aa856ecb5797259050eb990a1befb\",\n type: \"raw\",\n },\n },\n });\n });\n\n it(\"success with referenced token verifying contract\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n {\n type: \"amount\",\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n tokenIndex: 255,\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n },\n ],\n }),\n ),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"success\",\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n tokens: {\n 0: \"payload-0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\",\n 255: \"payload-0x000000000022d473030f116ddee9f6b43ac78ba3\",\n },\n filters: {\n \"details.amount\": {\n displayName: \"Amount allowance\",\n path: \"details.amount\",\n signature:\n \"304402201a46e6b4ef89eaf9fcf4945d053bfc5616a826400fd758312fbbe976bafc07ec022025a9b408722baf983ee053f90179c75b0c55bb0668f437d55493e36069bbd5a3\",\n tokenIndex: 255,\n type: \"amount\",\n },\n \"details.token.[]\": {\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n tokenIndex: 0,\n type: \"token\",\n },\n },\n });\n });\n\n it(\"should return an error if filters are unavailable\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() => Promise.resolve(Left(new Error(\"error\"))));\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"error\",\n error: new Error(\"error\"),\n });\n });\n\n it(\"success with unavailable tokens\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n jest\n .spyOn(mockTokenDataSource, \"getTokenInfosPayload\")\n .mockImplementation(() =>\n Promise.resolve(Left(new Error(\"token error\"))),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result).toEqual({\n type: \"success\",\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n tokens: {},\n filters: {\n \"details.token.[]\": {\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n tokenIndex: 0,\n type: \"token\",\n },\n },\n });\n });\n\n it(\"success with several identic tokens\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: [\n {\n path: \"details.token.[]\",\n value: Uint8Array.from([\n 0x7c, 0xeb, 0x23, 0xfd, 0x6b, 0xc0, 0xad, 0xd5, 0x9e, 0x62, 0xac,\n 0x25, 0x57, 0x82, 0x70, 0xcf, 0xf1, 0xb9, 0xf6, 0x19,\n ]),\n },\n ...TEST_VALUES,\n ],\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n jest\n .spyOn(mockTokenDataSource, \"getTokenInfosPayload\")\n .mockImplementation(() =>\n Promise.resolve(Left(new Error(\"token error\"))),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(mockTokenDataSource.getTokenInfosPayload).toHaveBeenCalledWith({\n address: \"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\",\n chainId: 1,\n });\n expect(result.type).toEqual(\"success\");\n });\n\n it(\"success with several different tokens\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: [\n {\n path: \"details.token.[]\",\n value: Uint8Array.from([\n 0x7c, 0xeb, 0x23, 0xfd, 0x6b, 0xc0, 0xad, 0xd5, 0x9e, 0x62, 0xac,\n 0x25, 0x57, 0x82, 0x70, 0xcf, 0xf1, 0xb9, 0xf6, 0xff,\n ]),\n },\n ...TEST_VALUES,\n ],\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.token.[]\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(mockTokenDataSource.getTokenInfosPayload).not.toHaveBeenCalledWith(\n { address: \"0x7ceb23fd6bc0add59e62ac25578270cff1b9f6ff\", chainId: 1 },\n );\n expect(mockTokenDataSource.getTokenInfosPayload).not.toHaveBeenCalledWith(\n { address: \"0x7ceb23fd6bc0add59e62ac25578270cff1b9f619\", chainId: 1 },\n );\n expect(result.type).toEqual(\"success\");\n });\n\n it(\"should ignore the token if value is not found\", async () => {\n // GIVEN\n const ctx = {\n verifyingContract: \"0x000000000022d473030f116ddee9f6b43ac78ba3\",\n chainId: 1,\n version: \"v2\",\n schema: TEST_TYPES,\n fieldsValues: TEST_VALUES,\n } as TypedDataContext;\n jest\n .spyOn(mockTypedDataDataSource, \"getTypedDataFilters\")\n .mockImplementation(() =>\n Promise.resolve(\n Right({\n messageInfo: {\n displayName: \"Permit2\",\n filtersCount: 2,\n signature:\n \"3045022100e3c597d13d28a87a88b0239404c668373cf5063362f2a81d09eed4582941dfe802207669aabb504fd5b95b2734057f6b8bbf51f14a69a5f9bdf658a5952cefbf44d3\",\n },\n filters: [\n {\n type: \"token\",\n displayName: \"Amount allowance\",\n path: \"details.badtoken\",\n tokenIndex: 0,\n signature:\n \"3044022075103b38995e031d1ebbfe38ac6603bec32854b5146a664e49b4cc4f460c1da6022029f4b0fd1f3b7995ffff1627d4b57f27888a2dcc9b3a4e85c37c67571092c733\",\n },\n ],\n }),\n ),\n );\n\n // WHEN\n const result = await loader.load(ctx);\n\n // THEN\n expect(result.type).toEqual(\"success\");\n if (result.type === \"success\") {\n expect(result.filters[\"details.badtoken\"]?.[\"displayName\"]).toEqual(\n \"Amount allowance\",\n );\n expect(result.tokens).toEqual({});\n }\n });\n });\n});\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Left", "Right", "DefaultTypedDataContextLoader", "mockTokenDataSource", "mockTypedDataDataSource", "loader", "TEST_TYPES", "TEST_VALUES", "address", "ctx", "result"]
|
|
7
|
+
}
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
//# sourceMappingURL=TypedDataContextLoader.js.map
|
|
1
|
+
//# sourceMappingURL=TypedDataContextLoader.js.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { ClearSignContext } from "./shared/model/ClearSignContext";
|
|
2
|
-
import { TransactionContext } from "./shared/model/TransactionContext";
|
|
1
|
+
import { type ClearSignContext } from "./shared/model/ClearSignContext";
|
|
2
|
+
import { type TransactionContext, type TransactionFieldContext } from "./shared/model/TransactionContext";
|
|
3
3
|
import { type TypedDataClearSignContext } from "./shared/model/TypedDataClearSignContext";
|
|
4
4
|
import { type TypedDataContext } from "./shared/model/TypedDataContext";
|
|
5
5
|
export interface ContextModule {
|
|
6
|
+
getContext(field: TransactionFieldContext): Promise<ClearSignContext>;
|
|
6
7
|
getContexts(transaction: TransactionContext): Promise<ClearSignContext[]>;
|
|
7
8
|
getTypedDataFilters(typedData: TypedDataContext): Promise<TypedDataClearSignContext>;
|
|
8
9
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextModule.d.ts","sourceRoot":"","sources":["../../../src/ContextModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IACtE,WAAW,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC1E,mBAAmB,CACjB,SAAS,EAAE,gBAAgB,GAC1B,OAAO,CAAC,yBAAyB,CAAC,CAAC;CACvC"}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import { ContextModuleConfig } from "./config/model/ContextModuleConfig";
|
|
2
|
-
import { ContextLoader } from "./shared/domain/ContextLoader";
|
|
1
|
+
import { type ContextModuleCalConfig, type ContextModuleConfig } from "./config/model/ContextModuleConfig";
|
|
2
|
+
import { type ContextLoader } from "./shared/domain/ContextLoader";
|
|
3
3
|
import { type TypedDataContextLoader } from "./typed-data/domain/TypedDataContextLoader";
|
|
4
|
-
import { ContextModule } from "./ContextModule";
|
|
4
|
+
import { type ContextModule } from "./ContextModule";
|
|
5
5
|
export declare const DEFAULT_CONFIG: ContextModuleConfig;
|
|
6
6
|
export declare class ContextModuleBuilder {
|
|
7
7
|
private config;
|
|
8
|
-
private customLoaders;
|
|
9
|
-
private defaultLoaders;
|
|
10
|
-
private customTypedDataLoader?;
|
|
11
8
|
constructor();
|
|
12
9
|
/**
|
|
13
10
|
* Remove default loaders from the list of loaders
|
|
14
11
|
*
|
|
15
12
|
* @returns this
|
|
16
13
|
*/
|
|
17
|
-
|
|
14
|
+
removeDefaultLoaders(): this;
|
|
18
15
|
/**
|
|
19
16
|
* Add a custom loader to the list of loaders
|
|
20
17
|
*
|
|
@@ -25,16 +22,17 @@ export declare class ContextModuleBuilder {
|
|
|
25
22
|
/**
|
|
26
23
|
* Replace the default loader for typed data clear signing contexts
|
|
27
24
|
*
|
|
25
|
+
* @param loader loader to use for typed data clear signing contexts
|
|
28
26
|
* @returns this
|
|
29
27
|
*/
|
|
30
|
-
|
|
28
|
+
addTypedDataLoader(loader: TypedDataContextLoader): this;
|
|
31
29
|
/**
|
|
32
|
-
*
|
|
30
|
+
* Add a custom CAL configuration
|
|
33
31
|
*
|
|
34
|
-
* @param
|
|
32
|
+
* @param calConfig
|
|
35
33
|
* @returns this
|
|
36
34
|
*/
|
|
37
|
-
|
|
35
|
+
addCalConfig(calConfig: ContextModuleCalConfig): this;
|
|
38
36
|
/**
|
|
39
37
|
* Build the context module
|
|
40
38
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextModuleBuilder.d.ts","sourceRoot":"","sources":["../../../src/ContextModuleBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,sBAAsB,EAC3B,KAAK,mBAAmB,EACzB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKrD,eAAO,MAAM,cAAc,EAAE,mBAS5B,CAAC;AAEF,qBAAa,oBAAoB;IAC/B,OAAO,CAAC,MAAM,CAAuC;;IAIrD;;;;OAIG;IACH,oBAAoB;IAKpB;;;;;OAKG;IACH,SAAS,CAAC,MAAM,EAAE,aAAa;IAK/B;;;;;OAKG;IACH,kBAAkB,CAAC,MAAM,EAAE,sBAAsB;IAKjD;;;;;OAKG;IACH,YAAY,CAAC,SAAS,EAAE,sBAAsB;IAK9C;;;;OAIG;IACH,KAAK,IAAI,aAAa;CAGvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextModuleBuilder.test.d.ts","sourceRoot":"","sources":["../../../src/ContextModuleBuilder.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TypedDataClearSignContext } from "./shared/model/TypedDataClearSignContext";
|
|
2
|
+
import type { TypedDataContext } from "./shared/model/TypedDataContext";
|
|
3
|
+
import { type ContextModuleConfig } from "./config/model/ContextModuleConfig";
|
|
4
|
+
import { type ClearSignContext } from "./shared/model/ClearSignContext";
|
|
5
|
+
import { type TransactionContext, type TransactionFieldContext } from "./shared/model/TransactionContext";
|
|
6
|
+
import { type ContextModule } from "./ContextModule";
|
|
7
|
+
export declare class DefaultContextModule implements ContextModule {
|
|
8
|
+
private _container;
|
|
9
|
+
private _loaders;
|
|
10
|
+
private _typedDataLoader;
|
|
11
|
+
constructor(args: ContextModuleConfig);
|
|
12
|
+
private _getDefaultLoaders;
|
|
13
|
+
private _getDefaultTypedDataLoader;
|
|
14
|
+
getContexts(transaction: TransactionContext): Promise<ClearSignContext[]>;
|
|
15
|
+
getContext(field: TransactionFieldContext): Promise<ClearSignContext>;
|
|
16
|
+
getTypedDataFilters(typedData: TypedDataContext): Promise<TypedDataClearSignContext>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=DefaultContextModule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultContextModule.d.ts","sourceRoot":"","sources":["../../../src/DefaultContextModule.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAIxE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAM9E,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAC;AAO3C,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGrD,qBAAa,oBAAqB,YAAW,aAAa;IACxD,OAAO,CAAC,UAAU,CAAY;IAC9B,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,gBAAgB,CAAyB;gBAErC,IAAI,EAAE,mBAAmB;IAQrC,OAAO,CAAC,kBAAkB;IAgB1B,OAAO,CAAC,0BAA0B;IAMrB,WAAW,CACtB,WAAW,EAAE,kBAAkB,GAC9B,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAMjB,UAAU,CACrB,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,gBAAgB,CAAC;IAaf,mBAAmB,CAC9B,SAAS,EAAE,gBAAgB,GAC1B,OAAO,CAAC,yBAAyB,CAAC;CAGtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DefaultContextModule.test.d.ts","sourceRoot":"","sources":["../../../src/DefaultContextModule.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { ContainerModule } from "inversify";
|
|
2
|
-
import { ContextModuleConfig } from "../../config/model/ContextModuleConfig";
|
|
2
|
+
import { type ContextModuleConfig } from "../../config/model/ContextModuleConfig";
|
|
3
3
|
export declare const configModuleFactory: (config: ContextModuleConfig) => ContainerModule;
|
|
4
4
|
//# sourceMappingURL=configModuleFactory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configModuleFactory.d.ts","sourceRoot":"","sources":["../../../../../src/config/di/configModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"configModuleFactory.d.ts","sourceRoot":"","sources":["../../../../../src/config/di/configModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAI9E,eAAO,MAAM,mBAAmB,WAAY,mBAAmB,oBAG3D,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ContextLoader } from "../../shared/domain/ContextLoader";
|
|
2
|
+
import { type TypedDataContextLoader } from "../../typed-data/domain/TypedDataContextLoader";
|
|
3
|
+
export type ContextModuleCalMode = "prod" | "test";
|
|
4
|
+
export type ContextModuleCalBranch = "next" | "main" | "demo";
|
|
5
|
+
export type ContextModuleCalConfig = {
|
|
6
|
+
url: string;
|
|
7
|
+
mode: ContextModuleCalMode;
|
|
8
|
+
branch: ContextModuleCalBranch;
|
|
9
|
+
};
|
|
10
|
+
export type ContextModuleConfig = {
|
|
11
|
+
cal: ContextModuleCalConfig;
|
|
12
|
+
defaultLoaders: boolean;
|
|
13
|
+
customLoaders: ContextLoader[];
|
|
14
|
+
customTypedDataLoader?: TypedDataContextLoader;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=ContextModuleConfig.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextModuleConfig.d.ts","sourceRoot":"","sources":["../../../../../src/config/model/ContextModuleConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAEzF,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG,MAAM,CAAC;AACnD,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAE9D,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,oBAAoB,CAAC;IAC3B,MAAM,EAAE,sBAAsB,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,GAAG,EAAE,sBAAsB,CAAC;IAC5B,cAAc,EAAE,OAAO,CAAC;IACxB,aAAa,EAAE,aAAa,EAAE,CAAC;IAC/B,qBAAqB,CAAC,EAAE,sBAAsB,CAAC;CAChD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"di.d.ts","sourceRoot":"","sources":["../../../src/di.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAQ9E,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,aAAa,eAAgB,iBAAiB,cAc1D,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HexaString } from "@ledgerhq/device-management-kit";
|
|
2
|
-
import { Either } from "purify-ts";
|
|
3
|
-
import { DappInfos } from "../../external-plugin/model/DappInfos";
|
|
1
|
+
import { type HexaString } from "@ledgerhq/device-management-kit";
|
|
2
|
+
import { type Either } from "purify-ts";
|
|
3
|
+
import { type DappInfos } from "../../external-plugin/model/DappInfos";
|
|
4
4
|
export type GetDappInfos = {
|
|
5
5
|
address: string;
|
|
6
6
|
selector: HexaString;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExternalPluginDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/external-plugin/data/ExternalPluginDataSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAEnE,MAAM,MAAM,YAAY,GAAG;IACzB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,UAAU,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,wBAAwB;IACvC,YAAY,CACV,MAAM,EAAE,YAAY,GACnB,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC,CAAC;CAClD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpExternalPluginDataSource.test.d.ts","sourceRoot":"","sources":["../../../../../src/external-plugin/data/HttpExternalPluginDataSource.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExternalPluginContextLoader.test.d.ts","sourceRoot":"","sources":["../../../../../src/external-plugin/domain/ExternalPluginContextLoader.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DappInfos.d.ts","sourceRoot":"","sources":["../../../../../src/external-plugin/model/DappInfos.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,yCAAyC,CAAC;AAE/E,MAAM,MAAM,SAAS,GAAG;IAAE,eAAe,EAAE,eAAe,CAAC;IAAC,GAAG,EAAE,MAAM,EAAE,CAAA;CAAE,CAAC"}
|
|
@@ -3,12 +3,14 @@ export * from "./ContextModule";
|
|
|
3
3
|
export * from "./ContextModuleBuilder";
|
|
4
4
|
export * from "./DefaultContextModule";
|
|
5
5
|
export * from "./external-plugin/domain/ExternalPluginContextLoader";
|
|
6
|
-
export * from "./forward-domain/domain/ForwardDomainContextLoader";
|
|
7
6
|
export * from "./nft/domain/NftContextLoader";
|
|
7
|
+
export * from "./shared/domain/ContextLoader";
|
|
8
8
|
export * from "./shared/model/ClearSignContext";
|
|
9
|
+
export * from "./shared/model/GenericPath";
|
|
9
10
|
export * from "./shared/model/TransactionContext";
|
|
10
11
|
export * from "./shared/model/TransactionSubset";
|
|
11
12
|
export * from "./shared/model/TypedDataClearSignContext";
|
|
12
13
|
export * from "./shared/model/TypedDataContext";
|
|
13
14
|
export * from "./token/domain/TokenContextLoader";
|
|
15
|
+
export * from "./trusted-name/domain/TrustedNameContextLoader";
|
|
14
16
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sDAAsD,CAAC;AACrE,cAAc,+BAA+B,CAAC;AAC9C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,iCAAiC,CAAC;AAChD,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mCAAmC,CAAC;AAClD,cAAc,kCAAkC,CAAC;AACjD,cAAc,0CAA0C,CAAC;AACzD,cAAc,iCAAiC,CAAC;AAChD,cAAc,mCAAmC,CAAC;AAClD,cAAc,gDAAgD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpNftDataSource.test.d.ts","sourceRoot":"","sources":["../../../../../src/nft/data/HttpNftDataSource.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NftDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/nft/data/NftDataSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,MAAM,MAAM,yBAAyB,GAAG;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,WAAW,aAAa;IAC5B,kBAAkB,CAChB,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;IAClC,mBAAmB,CACjB,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;CACnC"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { NftDataSource } from "../../nft/data/NftDataSource";
|
|
2
2
|
import { ContextLoader } from "../../shared/domain/ContextLoader";
|
|
3
3
|
import { ClearSignContext } from "../../shared/model/ClearSignContext";
|
|
4
|
-
import { TransactionContext } from "../../shared/model/TransactionContext";
|
|
4
|
+
import { TransactionContext, TransactionFieldContext } from "../../shared/model/TransactionContext";
|
|
5
5
|
export declare class NftContextLoader implements ContextLoader {
|
|
6
6
|
private _dataSource;
|
|
7
7
|
constructor(dataSource: NftDataSource);
|
|
8
8
|
load(transaction: TransactionContext): Promise<ClearSignContext[]>;
|
|
9
|
+
loadField(field: TransactionFieldContext): Promise<ClearSignContext | null>;
|
|
9
10
|
private isSelectorSupported;
|
|
10
11
|
}
|
|
11
12
|
//# sourceMappingURL=NftContextLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NftContextLoader.d.ts","sourceRoot":"","sources":["../../../../../src/nft/domain/NftContextLoader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAEjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,mCAAmC,CAAC;AAqB3C,qBACa,gBAAiB,YAAW,aAAa;IACpD,OAAO,CAAC,WAAW,CAAgB;gBAES,UAAU,EAAE,aAAa;IAI/D,IAAI,CAAC,WAAW,EAAE,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IA2ElE,SAAS,CACb,KAAK,EAAE,uBAAuB,GAC7B,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;IAoBnC,OAAO,CAAC,mBAAmB;CAG5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NftContextLoader.test.d.ts","sourceRoot":"","sources":["../../../../../src/nft/domain/NftContextLoader.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ClearSignContext } from "../../shared/model/ClearSignContext";
|
|
2
|
+
import { type TransactionContext, type TransactionFieldContext } from "../../shared/model/TransactionContext";
|
|
3
|
+
export type ContextLoader = {
|
|
4
|
+
load: (transaction: TransactionContext) => Promise<ClearSignContext[]>;
|
|
5
|
+
loadField?: (field: TransactionFieldContext) => Promise<ClearSignContext | null>;
|
|
6
|
+
};
|
|
7
|
+
//# sourceMappingURL=ContextLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextLoader.d.ts","sourceRoot":"","sources":["../../../../../src/shared/domain/ContextLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAC;AAE3C,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,EAAE,CAAC,WAAW,EAAE,kBAAkB,KAAK,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IACvE,SAAS,CAAC,EAAE,CACV,KAAK,EAAE,uBAAuB,KAC3B,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;CACvC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { type GenericPath } from "./GenericPath";
|
|
2
|
+
export declare enum ClearSignContextType {
|
|
3
|
+
TOKEN = "token",
|
|
4
|
+
NFT = "nft",
|
|
5
|
+
TRUSTED_NAME = "trustedName",
|
|
6
|
+
PLUGIN = "plugin",
|
|
7
|
+
EXTERNAL_PLUGIN = "externalPlugin",
|
|
8
|
+
TRANSACTION_INFO = "transactionInfo",
|
|
9
|
+
ENUM = "enum",
|
|
10
|
+
TRANSACTION_FIELD_DESCRIPTION = "transactionFieldDescription",
|
|
11
|
+
ERROR = "error"
|
|
12
|
+
}
|
|
13
|
+
export type ClearSignContextReference = {
|
|
14
|
+
type: ClearSignContextType.TOKEN | ClearSignContextType.NFT;
|
|
15
|
+
valuePath: GenericPath;
|
|
16
|
+
} | {
|
|
17
|
+
type: ClearSignContextType.TRUSTED_NAME;
|
|
18
|
+
valuePath: GenericPath;
|
|
19
|
+
types: string[];
|
|
20
|
+
sources: string[];
|
|
21
|
+
};
|
|
22
|
+
export type ClearSignContextSuccess = {
|
|
23
|
+
type: Exclude<ClearSignContextType, ClearSignContextType.ERROR>;
|
|
24
|
+
/**
|
|
25
|
+
* Hexadecimal string representation of the payload.
|
|
26
|
+
*/
|
|
27
|
+
payload: string;
|
|
28
|
+
/**
|
|
29
|
+
* Optional reference to another asset descriptor.
|
|
30
|
+
* ie: a 'transactionFieldDescription' descriptor can reference a token or
|
|
31
|
+
* a trusted name.
|
|
32
|
+
*/
|
|
33
|
+
reference?: ClearSignContextReference;
|
|
34
|
+
};
|
|
35
|
+
export type ClearSignContextError = {
|
|
36
|
+
type: ClearSignContextType.ERROR;
|
|
37
|
+
error: Error;
|
|
38
|
+
};
|
|
39
|
+
export type ClearSignContext = ClearSignContextSuccess | ClearSignContextError;
|
|
40
|
+
//# sourceMappingURL=ClearSignContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ClearSignContext.d.ts","sourceRoot":"","sources":["../../../../../src/shared/model/ClearSignContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjD,oBAAY,oBAAoB;IAC9B,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,YAAY,gBAAgB;IAC5B,MAAM,WAAW;IACjB,eAAe,mBAAmB;IAClC,gBAAgB,oBAAoB;IACpC,IAAI,SAAS;IACb,6BAA6B,gCAAgC;IAC7D,KAAK,UAAU;CAChB;AAED,MAAM,MAAM,yBAAyB,GACjC;IACE,IAAI,EAAE,oBAAoB,CAAC,KAAK,GAAG,oBAAoB,CAAC,GAAG,CAAC;IAC5D,SAAS,EAAE,WAAW,CAAC;CACxB,GACD;IACE,IAAI,EAAE,oBAAoB,CAAC,YAAY,CAAC;IACxC,SAAS,EAAE,WAAW,CAAC;IACvB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;CACnB,CAAC;AAEN,MAAM,MAAM,uBAAuB,GAAG;IACpC,IAAI,EAAE,OAAO,CAAC,oBAAoB,EAAE,oBAAoB,CAAC,KAAK,CAAC,CAAC;IAChE;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,yBAAyB,CAAC;CACvC,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,oBAAoB,CAAC,KAAK,CAAC;IACjC,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG,uBAAuB,GAAG,qBAAqB,CAAC"}
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic binary paths are a way to to navigate in any kind of structured binary data such as:
|
|
3
|
+
* - transactions
|
|
4
|
+
* - typed messages (EIP-712)
|
|
5
|
+
* - meta transactions (EIP-2771)
|
|
6
|
+
* - user operations (EIP-4337)
|
|
7
|
+
* - ...
|
|
8
|
+
* We follow here the concepts defined in the clear signing standard:
|
|
9
|
+
* https://github.com/LedgerHQ/clear-signing-erc7730-registry/blob/master/specs/erc-7730.md#structured-data
|
|
10
|
+
*
|
|
11
|
+
* - The container is the structure to be signed, for instance a transaction
|
|
12
|
+
* - The structured data is the data we want to navigate in, for instance a transaction calldata
|
|
13
|
+
*
|
|
14
|
+
* A generic path is either a field of the container, or a path in the structured data.
|
|
15
|
+
* Those path will also be handled by the devices:
|
|
16
|
+
* https://github.com/LedgerHQ/generic_parser/blob/master/specs.md#path_element
|
|
17
|
+
*/
|
|
18
|
+
export type GenericPath = ContainerPathValues | DataPathElement[];
|
|
19
|
+
export declare enum ContainerPath {
|
|
20
|
+
FROM = "FROM",
|
|
21
|
+
TO = "TO",
|
|
22
|
+
VALUE = "VALUE"
|
|
23
|
+
}
|
|
24
|
+
export type ContainerPathValues = keyof typeof ContainerPath;
|
|
25
|
+
/**
|
|
26
|
+
* A path in binary data will be composed of:
|
|
27
|
+
* - any number of steps of which:
|
|
28
|
+
* - Tuple: a set of elements which size if known
|
|
29
|
+
* - Array: an array of elements with dynamic size
|
|
30
|
+
* - Reference: a pointer to dereference
|
|
31
|
+
* - one leaf at the end to indicate the returned element type
|
|
32
|
+
* - static leaf: 1 fixed-size chunk is returned
|
|
33
|
+
* - dynamic leaf: element of variable size is returned
|
|
34
|
+
* - optionally a slice element, only allowed after the leaf, to slice the result
|
|
35
|
+
*
|
|
36
|
+
* An example for a transaction with that ethereum smart contract:
|
|
37
|
+
* function requestWithdrawalsWithPermit(uint256[] _amounts, address _owner, (uint256,uint256,uint8,bytes32,bytes32) _permit)
|
|
38
|
+
* In that case:
|
|
39
|
+
* - _amounts is an array
|
|
40
|
+
* - _permit is a tuple
|
|
41
|
+
* We could have a tuple in an array, or an array in a tuple, in which case we would have several steps in the binary path.
|
|
42
|
+
*/
|
|
43
|
+
export type DataPathElement = DataPathElementTuple | DataPathElementArray | DataPathElementRef | DataPathElementLeaf | DataPathElementSlice;
|
|
44
|
+
export declare enum DataPathElementType {
|
|
45
|
+
TUPLE = "TUPLE",
|
|
46
|
+
ARRAY = "ARRAY",
|
|
47
|
+
REF = "REF",
|
|
48
|
+
LEAF = "LEAF",
|
|
49
|
+
SLICE = "SLICE"
|
|
50
|
+
}
|
|
51
|
+
export type DataPathElementTypeValues = keyof typeof DataPathElementType;
|
|
52
|
+
/**
|
|
53
|
+
* Path element to navigate in a tuple.
|
|
54
|
+
* - offset: the item of the tuple to select
|
|
55
|
+
*/
|
|
56
|
+
export interface DataPathElementTuple {
|
|
57
|
+
type: "TUPLE";
|
|
58
|
+
offset: number;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Path element to navigate in an array of variable size.
|
|
62
|
+
* - itemSize: the length of each item in that array (not the number of items which is variable).
|
|
63
|
+
* - start: the start of the array slice to iterate on. If unset, start from the beginning of that array.
|
|
64
|
+
* - length: the length of the array slice to iterate on. If unset, iterate until the end of that array.
|
|
65
|
+
*/
|
|
66
|
+
export interface DataPathElementArray {
|
|
67
|
+
type: "ARRAY";
|
|
68
|
+
itemSize: number;
|
|
69
|
+
start?: number;
|
|
70
|
+
length?: number;
|
|
71
|
+
}
|
|
72
|
+
export interface DataPathElementRef {
|
|
73
|
+
type: "REF";
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Path element to represent the leaf of the path, to be returned.
|
|
77
|
+
* It is mandatory, and only allowed at the end of the path.
|
|
78
|
+
* It indicates the type of data to return:
|
|
79
|
+
* - Static leaf: data of static size, typically 1 chunk
|
|
80
|
+
* - Dynamic leaf: data of dynamic size, typically length+data
|
|
81
|
+
* - Tuple leaf: returned data is a tuple (a set of a static number of elements)
|
|
82
|
+
* - Array leaf: returned data is an array (dynamic number of elements)
|
|
83
|
+
*/
|
|
84
|
+
export interface DataPathElementLeaf {
|
|
85
|
+
type: "LEAF";
|
|
86
|
+
leafType: DataPathLeafTypeValues;
|
|
87
|
+
}
|
|
88
|
+
export declare enum DataPathLeafType {
|
|
89
|
+
STATIC_LEAF = "STATIC_LEAF",
|
|
90
|
+
DYNAMIC_LEAF = "DYNAMIC_LEAF",
|
|
91
|
+
TUPLE_LEAF = "TUPLE_LEAF",
|
|
92
|
+
ARRAY_LEAF = "ARRAY_LEAF"
|
|
93
|
+
}
|
|
94
|
+
export type DataPathLeafTypeValues = keyof typeof DataPathLeafType;
|
|
95
|
+
/**
|
|
96
|
+
* Path element to represent a slice.
|
|
97
|
+
* It is optional and only allowed at the end of a path, after the leaf.
|
|
98
|
+
* It means the leaf shall be sliced before being returned.
|
|
99
|
+
*/
|
|
100
|
+
export interface DataPathElementSlice {
|
|
101
|
+
type: "SLICE";
|
|
102
|
+
start?: number;
|
|
103
|
+
end?: number;
|
|
104
|
+
}
|
|
105
|
+
//# sourceMappingURL=GenericPath.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericPath.d.ts","sourceRoot":"","sources":["../../../../../src/shared/model/GenericPath.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,eAAe,EAAE,CAAC;AAGlE,oBAAY,aAAa;IACvB,IAAI,SAAS;IACb,EAAE,OAAO;IACT,KAAK,UAAU;CAChB;AACD,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,aAAa,CAAC;AAE7D;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,eAAe,GACvB,oBAAoB,GACpB,oBAAoB,GACpB,kBAAkB,GAClB,mBAAmB,GACnB,oBAAoB,CAAC;AACzB,oBAAY,mBAAmB;IAC7B,KAAK,UAAU;IACf,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,KAAK,UAAU;CAChB;AACD,MAAM,MAAM,yBAAyB,GAAG,MAAM,OAAO,mBAAmB,CAAC;AAEzE;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAGD,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,KAAK,CAAC;CACb;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,sBAAsB,CAAC;CAClC;AACD,oBAAY,gBAAgB;IAC1B,WAAW,gBAAgB;IAC3B,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,UAAU,eAAe;CAC1B;AACD,MAAM,MAAM,sBAAsB,GAAG,MAAM,OAAO,gBAAgB,CAAC;AAEnE;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ClearSignContextType } from "../../shared/model/ClearSignContext";
|
|
2
|
+
import { type TransactionSubset } from "../../shared/model/TransactionSubset";
|
|
3
|
+
export type TransactionFieldContext = {
|
|
4
|
+
type: ClearSignContextType.TOKEN | ClearSignContextType.NFT;
|
|
5
|
+
chainId: number;
|
|
6
|
+
address: string;
|
|
7
|
+
} | {
|
|
8
|
+
type: ClearSignContextType.TRUSTED_NAME;
|
|
9
|
+
chainId: number;
|
|
10
|
+
address: string;
|
|
11
|
+
challenge: string;
|
|
12
|
+
types: string[];
|
|
13
|
+
sources: string[];
|
|
14
|
+
};
|
|
15
|
+
export type TransactionContext = TransactionSubset & {
|
|
16
|
+
challenge: string;
|
|
17
|
+
domain?: string;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=TransactionContext.d.ts.map
|