@ledgerhq/context-module 0.0.0-develop-20260224001409 → 0.0.0-develop-20260228001144

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.
Files changed (121) hide show
  1. package/lib/cjs/package.json +1 -1
  2. package/lib/cjs/src/DefaultContextModule.js +1 -1
  3. package/lib/cjs/src/DefaultContextModule.js.map +3 -3
  4. package/lib/cjs/src/di.js +1 -1
  5. package/lib/cjs/src/di.js.map +3 -3
  6. package/lib/cjs/src/gated-signing/data/GatedDescriptorDataSource.js +2 -0
  7. package/lib/cjs/src/gated-signing/data/GatedDescriptorDataSource.js.map +7 -0
  8. package/lib/cjs/src/gated-signing/data/HttpGatedDescriptorDataSource.js +2 -0
  9. package/lib/cjs/src/gated-signing/data/HttpGatedDescriptorDataSource.js.map +7 -0
  10. package/lib/cjs/src/gated-signing/data/HttpGatedDescriptorDataSource.test.js +2 -0
  11. package/lib/cjs/src/gated-signing/data/HttpGatedDescriptorDataSource.test.js.map +7 -0
  12. package/lib/cjs/src/gated-signing/data/dto/GatedDappsDto.js +2 -0
  13. package/lib/cjs/src/gated-signing/data/dto/GatedDappsDto.js.map +7 -0
  14. package/lib/cjs/src/gated-signing/di/gatedSigningModuleFactory.js +2 -0
  15. package/lib/cjs/src/gated-signing/di/gatedSigningModuleFactory.js.map +7 -0
  16. package/lib/cjs/src/gated-signing/di/gatedSigningTypes.js +2 -0
  17. package/lib/cjs/src/gated-signing/di/gatedSigningTypes.js.map +7 -0
  18. package/lib/cjs/src/gated-signing/domain/GatedSigningContextLoader.js +2 -0
  19. package/lib/cjs/src/gated-signing/domain/GatedSigningContextLoader.js.map +7 -0
  20. package/lib/cjs/src/gated-signing/domain/GatedSigningContextLoader.test.js +2 -0
  21. package/lib/cjs/src/gated-signing/domain/GatedSigningContextLoader.test.js.map +7 -0
  22. package/lib/cjs/src/gated-signing/domain/GatedSigningTypedDataContextLoader.js +2 -0
  23. package/lib/cjs/src/gated-signing/domain/GatedSigningTypedDataContextLoader.js.map +7 -0
  24. package/lib/cjs/src/gated-signing/domain/GatedSigningTypedDataContextLoader.test.js +2 -0
  25. package/lib/cjs/src/gated-signing/domain/GatedSigningTypedDataContextLoader.test.js.map +7 -0
  26. package/lib/cjs/src/index.js +1 -1
  27. package/lib/cjs/src/index.js.map +2 -2
  28. package/lib/cjs/src/pki/model/KeyId.js +1 -1
  29. package/lib/cjs/src/pki/model/KeyId.js.map +2 -2
  30. package/lib/cjs/src/pki/model/KeyUsage.js +1 -1
  31. package/lib/cjs/src/pki/model/KeyUsage.js.map +2 -2
  32. package/lib/cjs/src/shared/model/ClearSignContext.js +1 -1
  33. package/lib/cjs/src/shared/model/ClearSignContext.js.map +2 -2
  34. package/lib/cjs/src/shared/utils/KeyUsageMapper.js +1 -1
  35. package/lib/cjs/src/shared/utils/KeyUsageMapper.js.map +2 -2
  36. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js +1 -1
  37. package/lib/cjs/src/typed-data/data/HttpTypedDataDataSource.js.map +3 -3
  38. package/lib/cjs/src/typed-data/utils/getSchemaHash.js +2 -0
  39. package/lib/cjs/src/typed-data/utils/getSchemaHash.js.map +7 -0
  40. package/lib/cjs/src/typed-data/utils/getSchemaHash.test.js +2 -0
  41. package/lib/cjs/src/typed-data/utils/getSchemaHash.test.js.map +7 -0
  42. package/lib/esm/package.json +1 -1
  43. package/lib/esm/src/DefaultContextModule.js +1 -1
  44. package/lib/esm/src/DefaultContextModule.js.map +3 -3
  45. package/lib/esm/src/di.js +1 -1
  46. package/lib/esm/src/di.js.map +3 -3
  47. package/lib/esm/src/gated-signing/data/GatedDescriptorDataSource.js +1 -0
  48. package/lib/esm/src/gated-signing/data/GatedDescriptorDataSource.js.map +7 -0
  49. package/lib/esm/src/gated-signing/data/HttpGatedDescriptorDataSource.js +2 -0
  50. package/lib/esm/src/gated-signing/data/HttpGatedDescriptorDataSource.js.map +7 -0
  51. package/lib/esm/src/gated-signing/data/HttpGatedDescriptorDataSource.test.js +2 -0
  52. package/lib/esm/src/gated-signing/data/HttpGatedDescriptorDataSource.test.js.map +7 -0
  53. package/lib/esm/src/gated-signing/data/dto/GatedDappsDto.js +1 -0
  54. package/lib/esm/src/gated-signing/data/dto/GatedDappsDto.js.map +7 -0
  55. package/lib/esm/src/gated-signing/di/gatedSigningModuleFactory.js +2 -0
  56. package/lib/esm/src/gated-signing/di/gatedSigningModuleFactory.js.map +7 -0
  57. package/lib/esm/src/gated-signing/di/gatedSigningTypes.js +2 -0
  58. package/lib/esm/src/gated-signing/di/gatedSigningTypes.js.map +7 -0
  59. package/lib/esm/src/gated-signing/domain/GatedSigningContextLoader.js +2 -0
  60. package/lib/esm/src/gated-signing/domain/GatedSigningContextLoader.js.map +7 -0
  61. package/lib/esm/src/gated-signing/domain/GatedSigningContextLoader.test.js +2 -0
  62. package/lib/esm/src/gated-signing/domain/GatedSigningContextLoader.test.js.map +7 -0
  63. package/lib/esm/src/gated-signing/domain/GatedSigningTypedDataContextLoader.js +2 -0
  64. package/lib/esm/src/gated-signing/domain/GatedSigningTypedDataContextLoader.js.map +7 -0
  65. package/lib/esm/src/gated-signing/domain/GatedSigningTypedDataContextLoader.test.js +2 -0
  66. package/lib/esm/src/gated-signing/domain/GatedSigningTypedDataContextLoader.test.js.map +7 -0
  67. package/lib/esm/src/index.js +1 -1
  68. package/lib/esm/src/index.js.map +2 -2
  69. package/lib/esm/src/pki/model/KeyId.js +1 -1
  70. package/lib/esm/src/pki/model/KeyId.js.map +2 -2
  71. package/lib/esm/src/pki/model/KeyUsage.js +1 -1
  72. package/lib/esm/src/pki/model/KeyUsage.js.map +2 -2
  73. package/lib/esm/src/shared/model/ClearSignContext.js +1 -1
  74. package/lib/esm/src/shared/model/ClearSignContext.js.map +2 -2
  75. package/lib/esm/src/shared/utils/KeyUsageMapper.js +1 -1
  76. package/lib/esm/src/shared/utils/KeyUsageMapper.js.map +2 -2
  77. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js +1 -1
  78. package/lib/esm/src/typed-data/data/HttpTypedDataDataSource.js.map +3 -3
  79. package/lib/esm/src/typed-data/utils/getSchemaHash.js +2 -0
  80. package/lib/esm/src/typed-data/utils/getSchemaHash.js.map +7 -0
  81. package/lib/esm/src/typed-data/utils/getSchemaHash.test.js +2 -0
  82. package/lib/esm/src/typed-data/utils/getSchemaHash.test.js.map +7 -0
  83. package/lib/types/src/DefaultContextModule.d.ts.map +1 -1
  84. package/lib/types/src/di.d.ts.map +1 -1
  85. package/lib/types/src/gated-signing/data/GatedDescriptorDataSource.d.ts +20 -0
  86. package/lib/types/src/gated-signing/data/GatedDescriptorDataSource.d.ts.map +1 -0
  87. package/lib/types/src/gated-signing/data/HttpGatedDescriptorDataSource.d.ts +13 -0
  88. package/lib/types/src/gated-signing/data/HttpGatedDescriptorDataSource.d.ts.map +1 -0
  89. package/lib/types/src/gated-signing/data/HttpGatedDescriptorDataSource.test.d.ts +2 -0
  90. package/lib/types/src/gated-signing/data/HttpGatedDescriptorDataSource.test.d.ts.map +1 -0
  91. package/lib/types/src/gated-signing/data/dto/GatedDappsDto.d.ts +15 -0
  92. package/lib/types/src/gated-signing/data/dto/GatedDappsDto.d.ts.map +1 -0
  93. package/lib/types/src/gated-signing/di/gatedSigningModuleFactory.d.ts +3 -0
  94. package/lib/types/src/gated-signing/di/gatedSigningModuleFactory.d.ts.map +1 -0
  95. package/lib/types/src/gated-signing/di/gatedSigningTypes.d.ts +6 -0
  96. package/lib/types/src/gated-signing/di/gatedSigningTypes.d.ts.map +1 -0
  97. package/lib/types/src/gated-signing/domain/GatedSigningContextLoader.d.ts +22 -0
  98. package/lib/types/src/gated-signing/domain/GatedSigningContextLoader.d.ts.map +1 -0
  99. package/lib/types/src/gated-signing/domain/GatedSigningContextLoader.test.d.ts +2 -0
  100. package/lib/types/src/gated-signing/domain/GatedSigningContextLoader.test.d.ts.map +1 -0
  101. package/lib/types/src/gated-signing/domain/GatedSigningTypedDataContextLoader.d.ts +27 -0
  102. package/lib/types/src/gated-signing/domain/GatedSigningTypedDataContextLoader.d.ts.map +1 -0
  103. package/lib/types/src/gated-signing/domain/GatedSigningTypedDataContextLoader.test.d.ts +2 -0
  104. package/lib/types/src/gated-signing/domain/GatedSigningTypedDataContextLoader.test.d.ts.map +1 -0
  105. package/lib/types/src/index.d.ts +5 -0
  106. package/lib/types/src/index.d.ts.map +1 -1
  107. package/lib/types/src/pki/model/KeyId.d.ts +2 -1
  108. package/lib/types/src/pki/model/KeyId.d.ts.map +1 -1
  109. package/lib/types/src/pki/model/KeyUsage.d.ts +2 -1
  110. package/lib/types/src/pki/model/KeyUsage.d.ts.map +1 -1
  111. package/lib/types/src/shared/model/ClearSignContext.d.ts +2 -1
  112. package/lib/types/src/shared/model/ClearSignContext.d.ts.map +1 -1
  113. package/lib/types/src/shared/utils/KeyUsageMapper.d.ts.map +1 -1
  114. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.d.ts +0 -1
  115. package/lib/types/src/typed-data/data/HttpTypedDataDataSource.d.ts.map +1 -1
  116. package/lib/types/src/typed-data/utils/getSchemaHash.d.ts +12 -0
  117. package/lib/types/src/typed-data/utils/getSchemaHash.d.ts.map +1 -0
  118. package/lib/types/src/typed-data/utils/getSchemaHash.test.d.ts +2 -0
  119. package/lib/types/src/typed-data/utils/getSchemaHash.test.d.ts.map +1 -0
  120. package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
  121. package/package.json +5 -5
@@ -1,2 +1,2 @@
1
- "use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(f,e,p,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of c(e))!d.call(f,m)&&m!==p&&a(f,m,{get:()=>e[m],enumerable:!(x=b(e,m))||x.enumerable});return f},r=(f,e,p)=>(t(f,e,"default"),p&&t(p,e,"default"));var g=f=>t(a({},"__esModule",{value:!0}),f);var o={};module.exports=g(o);r(o,require("./calldata/data/CalldataDescriptorDataSource"),module.exports);r(o,require("./calldata/data/HttpCalldataDescriptorDataSource"),module.exports);r(o,require("./calldata/domain/CalldataContextLoader"),module.exports);r(o,require("./config/model/ContextModuleConfig"),module.exports);r(o,require("./ContextModule"),module.exports);r(o,require("./ContextModuleBuilder"),module.exports);r(o,require("./DefaultContextModule"),module.exports);r(o,require("./dynamic-network/data/DynamicNetworkDataSource"),module.exports);r(o,require("./dynamic-network/data/HttpDynamicNetworkDataSource"),module.exports);r(o,require("./dynamic-network/domain/DynamicNetworkContextLoader"),module.exports);r(o,require("./dynamic-network/model/DynamicNetworkConfiguration"),module.exports);r(o,require("./external-plugin/data/ExternalPluginDataSource"),module.exports);r(o,require("./external-plugin/data/HttpExternalPluginDataSource"),module.exports);r(o,require("./external-plugin/domain/ExternalPluginContextLoader"),module.exports);r(o,require("./nft/data/HttpNftDataSource"),module.exports);r(o,require("./nft/data/NftDataSource"),module.exports);r(o,require("./nft/domain/NftContextFieldLoader"),module.exports);r(o,require("./nft/domain/NftContextLoader"),module.exports);r(o,require("./pki/data/HttpPkiCertificateDataSource"),module.exports);r(o,require("./pki/data/PkiCertificateDataSource"),module.exports);r(o,require("./pki/domain/DefaultPkiCertificateLoader"),module.exports);r(o,require("./pki/domain/PkiCertificateLoader"),module.exports);r(o,require("./pki/model/KeyId"),module.exports);r(o,require("./pki/model/KeyUsage"),module.exports);r(o,require("./pki/model/PkiCertificate"),module.exports);r(o,require("./pki/model/PkiCertificateInfo"),module.exports);r(o,require("./proxy/data/HttpProxyDataSource"),module.exports);r(o,require("./proxy/data/HttpSafeProxyDataSource"),module.exports);r(o,require("./proxy/data/ProxyDataSource"),module.exports);r(o,require("./proxy/domain/ProxyContextFieldLoader"),module.exports);r(o,require("./shared/domain/ContextFieldLoader"),module.exports);r(o,require("./shared/domain/ContextLoader"),module.exports);r(o,require("./shared/model/ClearSignContext"),module.exports);r(o,require("./shared/model/GenericPath"),module.exports);r(o,require("./shared/model/SolanaContextTypes"),module.exports);r(o,require("./shared/model/TransactionSubset"),module.exports);r(o,require("./shared/model/TypedDataClearSignContext"),module.exports);r(o,require("./shared/model/TypedDataContext"),module.exports);r(o,require("./solana/data/HttpSolanaOwnerInfoDataSource"),module.exports);r(o,require("./solana/data/SolanaDataSource"),module.exports);r(o,require("./solana/domain/DefaultSolanaContextLoader"),module.exports);r(o,require("./solana/domain/SolanaContextLoader"),module.exports);r(o,require("./solana/domain/solanaContextTypes"),module.exports);r(o,require("./token/data/HttpTokenDataSource"),module.exports);r(o,require("./token/data/TokenDataSource"),module.exports);r(o,require("./token/domain/TokenContextFieldLoader"),module.exports);r(o,require("./token/domain/TokenContextLoader"),module.exports);r(o,require("./trusted-name/data/HttpTrustedNameDataSource"),module.exports);r(o,require("./trusted-name/data/TrustedNameDataSource"),module.exports);r(o,require("./trusted-name/domain/TrustedNameContextFieldLoader"),module.exports);r(o,require("./trusted-name/domain/TrustedNameContextLoader"),module.exports);r(o,require("./typed-data/data/HttpTypedDataDataSource"),module.exports);r(o,require("./typed-data/data/TypedDataDataSource"),module.exports);r(o,require("./typed-data/domain/DefaultTypedDataContextLoader"),module.exports);r(o,require("./typed-data/domain/TypedDataContextLoader"),module.exports);r(o,require("./uniswap/data/AbiDecoderDataSource"),module.exports);r(o,require("./uniswap/data/CommandDecoderDataSource"),module.exports);r(o,require("./uniswap/data/DefaultCommandDecoderDataSource"),module.exports);r(o,require("./uniswap/data/EthersAbiDecoderDataSource"),module.exports);r(o,require("./uniswap/domain/UniswapContextLoader"),module.exports);0&&(module.exports={...require("./calldata/data/CalldataDescriptorDataSource"),...require("./calldata/data/HttpCalldataDescriptorDataSource"),...require("./calldata/domain/CalldataContextLoader"),...require("./config/model/ContextModuleConfig"),...require("./ContextModule"),...require("./ContextModuleBuilder"),...require("./DefaultContextModule"),...require("./dynamic-network/data/DynamicNetworkDataSource"),...require("./dynamic-network/data/HttpDynamicNetworkDataSource"),...require("./dynamic-network/domain/DynamicNetworkContextLoader"),...require("./dynamic-network/model/DynamicNetworkConfiguration"),...require("./external-plugin/data/ExternalPluginDataSource"),...require("./external-plugin/data/HttpExternalPluginDataSource"),...require("./external-plugin/domain/ExternalPluginContextLoader"),...require("./nft/data/HttpNftDataSource"),...require("./nft/data/NftDataSource"),...require("./nft/domain/NftContextFieldLoader"),...require("./nft/domain/NftContextLoader"),...require("./pki/data/HttpPkiCertificateDataSource"),...require("./pki/data/PkiCertificateDataSource"),...require("./pki/domain/DefaultPkiCertificateLoader"),...require("./pki/domain/PkiCertificateLoader"),...require("./pki/model/KeyId"),...require("./pki/model/KeyUsage"),...require("./pki/model/PkiCertificate"),...require("./pki/model/PkiCertificateInfo"),...require("./proxy/data/HttpProxyDataSource"),...require("./proxy/data/HttpSafeProxyDataSource"),...require("./proxy/data/ProxyDataSource"),...require("./proxy/domain/ProxyContextFieldLoader"),...require("./shared/domain/ContextFieldLoader"),...require("./shared/domain/ContextLoader"),...require("./shared/model/ClearSignContext"),...require("./shared/model/GenericPath"),...require("./shared/model/SolanaContextTypes"),...require("./shared/model/TransactionSubset"),...require("./shared/model/TypedDataClearSignContext"),...require("./shared/model/TypedDataContext"),...require("./solana/data/HttpSolanaOwnerInfoDataSource"),...require("./solana/data/SolanaDataSource"),...require("./solana/domain/DefaultSolanaContextLoader"),...require("./solana/domain/SolanaContextLoader"),...require("./solana/domain/solanaContextTypes"),...require("./token/data/HttpTokenDataSource"),...require("./token/data/TokenDataSource"),...require("./token/domain/TokenContextFieldLoader"),...require("./token/domain/TokenContextLoader"),...require("./trusted-name/data/HttpTrustedNameDataSource"),...require("./trusted-name/data/TrustedNameDataSource"),...require("./trusted-name/domain/TrustedNameContextFieldLoader"),...require("./trusted-name/domain/TrustedNameContextLoader"),...require("./typed-data/data/HttpTypedDataDataSource"),...require("./typed-data/data/TypedDataDataSource"),...require("./typed-data/domain/DefaultTypedDataContextLoader"),...require("./typed-data/domain/TypedDataContextLoader"),...require("./uniswap/data/AbiDecoderDataSource"),...require("./uniswap/data/CommandDecoderDataSource"),...require("./uniswap/data/DefaultCommandDecoderDataSource"),...require("./uniswap/data/EthersAbiDecoderDataSource"),...require("./uniswap/domain/UniswapContextLoader")});
1
+ "use strict";var a=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var t=(f,e,p,x)=>{if(e&&typeof e=="object"||typeof e=="function")for(let m of c(e))!d.call(f,m)&&m!==p&&a(f,m,{get:()=>e[m],enumerable:!(x=b(e,m))||x.enumerable});return f},r=(f,e,p)=>(t(f,e,"default"),p&&t(p,e,"default"));var g=f=>t(a({},"__esModule",{value:!0}),f);var o={};module.exports=g(o);r(o,require("./calldata/data/CalldataDescriptorDataSource"),module.exports);r(o,require("./calldata/data/HttpCalldataDescriptorDataSource"),module.exports);r(o,require("./calldata/domain/CalldataContextLoader"),module.exports);r(o,require("./config/model/ContextModuleConfig"),module.exports);r(o,require("./ContextModule"),module.exports);r(o,require("./ContextModuleBuilder"),module.exports);r(o,require("./DefaultContextModule"),module.exports);r(o,require("./dynamic-network/data/DynamicNetworkDataSource"),module.exports);r(o,require("./dynamic-network/data/HttpDynamicNetworkDataSource"),module.exports);r(o,require("./dynamic-network/domain/DynamicNetworkContextLoader"),module.exports);r(o,require("./dynamic-network/model/DynamicNetworkConfiguration"),module.exports);r(o,require("./external-plugin/data/ExternalPluginDataSource"),module.exports);r(o,require("./external-plugin/data/HttpExternalPluginDataSource"),module.exports);r(o,require("./external-plugin/domain/ExternalPluginContextLoader"),module.exports);r(o,require("./gated-signing/data/GatedDescriptorDataSource"),module.exports);r(o,require("./gated-signing/data/HttpGatedDescriptorDataSource"),module.exports);r(o,require("./gated-signing/domain/GatedSigningContextLoader"),module.exports);r(o,require("./gated-signing/domain/GatedSigningTypedDataContextLoader"),module.exports);r(o,require("./nft/data/HttpNftDataSource"),module.exports);r(o,require("./nft/data/NftDataSource"),module.exports);r(o,require("./nft/domain/NftContextFieldLoader"),module.exports);r(o,require("./nft/domain/NftContextLoader"),module.exports);r(o,require("./pki/data/HttpPkiCertificateDataSource"),module.exports);r(o,require("./pki/data/PkiCertificateDataSource"),module.exports);r(o,require("./pki/domain/DefaultPkiCertificateLoader"),module.exports);r(o,require("./pki/domain/PkiCertificateLoader"),module.exports);r(o,require("./pki/model/KeyId"),module.exports);r(o,require("./pki/model/KeyUsage"),module.exports);r(o,require("./pki/model/PkiCertificate"),module.exports);r(o,require("./pki/model/PkiCertificateInfo"),module.exports);r(o,require("./proxy/data/HttpProxyDataSource"),module.exports);r(o,require("./proxy/data/HttpSafeProxyDataSource"),module.exports);r(o,require("./proxy/data/ProxyDataSource"),module.exports);r(o,require("./proxy/domain/ProxyContextFieldLoader"),module.exports);r(o,require("./shared/domain/ContextFieldLoader"),module.exports);r(o,require("./shared/domain/ContextLoader"),module.exports);r(o,require("./shared/model/ClearSignContext"),module.exports);r(o,require("./shared/model/GenericPath"),module.exports);r(o,require("./shared/model/SolanaContextTypes"),module.exports);r(o,require("./shared/model/TransactionSubset"),module.exports);r(o,require("./shared/model/TypedDataClearSignContext"),module.exports);r(o,require("./shared/model/TypedDataContext"),module.exports);r(o,require("./solana/data/HttpSolanaOwnerInfoDataSource"),module.exports);r(o,require("./solana/data/SolanaDataSource"),module.exports);r(o,require("./solana/domain/DefaultSolanaContextLoader"),module.exports);r(o,require("./solana/domain/SolanaContextLoader"),module.exports);r(o,require("./solana/domain/solanaContextTypes"),module.exports);r(o,require("./token/data/HttpTokenDataSource"),module.exports);r(o,require("./token/data/TokenDataSource"),module.exports);r(o,require("./token/domain/TokenContextFieldLoader"),module.exports);r(o,require("./token/domain/TokenContextLoader"),module.exports);r(o,require("./trusted-name/data/HttpTrustedNameDataSource"),module.exports);r(o,require("./trusted-name/data/TrustedNameDataSource"),module.exports);r(o,require("./trusted-name/domain/TrustedNameContextFieldLoader"),module.exports);r(o,require("./trusted-name/domain/TrustedNameContextLoader"),module.exports);r(o,require("./typed-data/data/HttpTypedDataDataSource"),module.exports);r(o,require("./typed-data/data/TypedDataDataSource"),module.exports);r(o,require("./typed-data/domain/DefaultTypedDataContextLoader"),module.exports);r(o,require("./typed-data/domain/TypedDataContextLoader"),module.exports);r(o,require("./typed-data/utils/getSchemaHash"),module.exports);r(o,require("./uniswap/data/AbiDecoderDataSource"),module.exports);r(o,require("./uniswap/data/CommandDecoderDataSource"),module.exports);r(o,require("./uniswap/data/DefaultCommandDecoderDataSource"),module.exports);r(o,require("./uniswap/data/EthersAbiDecoderDataSource"),module.exports);r(o,require("./uniswap/domain/UniswapContextLoader"),module.exports);0&&(module.exports={...require("./calldata/data/CalldataDescriptorDataSource"),...require("./calldata/data/HttpCalldataDescriptorDataSource"),...require("./calldata/domain/CalldataContextLoader"),...require("./config/model/ContextModuleConfig"),...require("./ContextModule"),...require("./ContextModuleBuilder"),...require("./DefaultContextModule"),...require("./dynamic-network/data/DynamicNetworkDataSource"),...require("./dynamic-network/data/HttpDynamicNetworkDataSource"),...require("./dynamic-network/domain/DynamicNetworkContextLoader"),...require("./dynamic-network/model/DynamicNetworkConfiguration"),...require("./external-plugin/data/ExternalPluginDataSource"),...require("./external-plugin/data/HttpExternalPluginDataSource"),...require("./external-plugin/domain/ExternalPluginContextLoader"),...require("./gated-signing/data/GatedDescriptorDataSource"),...require("./gated-signing/data/HttpGatedDescriptorDataSource"),...require("./gated-signing/domain/GatedSigningContextLoader"),...require("./gated-signing/domain/GatedSigningTypedDataContextLoader"),...require("./nft/data/HttpNftDataSource"),...require("./nft/data/NftDataSource"),...require("./nft/domain/NftContextFieldLoader"),...require("./nft/domain/NftContextLoader"),...require("./pki/data/HttpPkiCertificateDataSource"),...require("./pki/data/PkiCertificateDataSource"),...require("./pki/domain/DefaultPkiCertificateLoader"),...require("./pki/domain/PkiCertificateLoader"),...require("./pki/model/KeyId"),...require("./pki/model/KeyUsage"),...require("./pki/model/PkiCertificate"),...require("./pki/model/PkiCertificateInfo"),...require("./proxy/data/HttpProxyDataSource"),...require("./proxy/data/HttpSafeProxyDataSource"),...require("./proxy/data/ProxyDataSource"),...require("./proxy/domain/ProxyContextFieldLoader"),...require("./shared/domain/ContextFieldLoader"),...require("./shared/domain/ContextLoader"),...require("./shared/model/ClearSignContext"),...require("./shared/model/GenericPath"),...require("./shared/model/SolanaContextTypes"),...require("./shared/model/TransactionSubset"),...require("./shared/model/TypedDataClearSignContext"),...require("./shared/model/TypedDataContext"),...require("./solana/data/HttpSolanaOwnerInfoDataSource"),...require("./solana/data/SolanaDataSource"),...require("./solana/domain/DefaultSolanaContextLoader"),...require("./solana/domain/SolanaContextLoader"),...require("./solana/domain/solanaContextTypes"),...require("./token/data/HttpTokenDataSource"),...require("./token/data/TokenDataSource"),...require("./token/domain/TokenContextFieldLoader"),...require("./token/domain/TokenContextLoader"),...require("./trusted-name/data/HttpTrustedNameDataSource"),...require("./trusted-name/data/TrustedNameDataSource"),...require("./trusted-name/domain/TrustedNameContextFieldLoader"),...require("./trusted-name/domain/TrustedNameContextLoader"),...require("./typed-data/data/HttpTypedDataDataSource"),...require("./typed-data/data/TypedDataDataSource"),...require("./typed-data/domain/DefaultTypedDataContextLoader"),...require("./typed-data/domain/TypedDataContextLoader"),...require("./typed-data/utils/getSchemaHash"),...require("./uniswap/data/AbiDecoderDataSource"),...require("./uniswap/data/CommandDecoderDataSource"),...require("./uniswap/data/DefaultCommandDecoderDataSource"),...require("./uniswap/data/EthersAbiDecoderDataSource"),...require("./uniswap/domain/UniswapContextLoader")});
2
2
  //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/index.ts"],
4
- "sourcesContent": ["export * from \"./calldata/data/CalldataDescriptorDataSource\";\nexport * from \"./calldata/data/HttpCalldataDescriptorDataSource\";\nexport * from \"./calldata/domain/CalldataContextLoader\";\nexport * from \"./config/model/ContextModuleConfig\";\nexport * from \"./ContextModule\";\nexport * from \"./ContextModuleBuilder\";\nexport * from \"./DefaultContextModule\";\nexport * from \"./dynamic-network/data/DynamicNetworkDataSource\";\nexport * from \"./dynamic-network/data/HttpDynamicNetworkDataSource\";\nexport * from \"./dynamic-network/domain/DynamicNetworkContextLoader\";\nexport * from \"./dynamic-network/model/DynamicNetworkConfiguration\";\nexport * from \"./external-plugin/data/ExternalPluginDataSource\";\nexport * from \"./external-plugin/data/HttpExternalPluginDataSource\";\nexport * from \"./external-plugin/domain/ExternalPluginContextLoader\";\nexport * from \"./nft/data/HttpNftDataSource\";\nexport * from \"./nft/data/NftDataSource\";\nexport * from \"./nft/domain/NftContextFieldLoader\";\nexport * from \"./nft/domain/NftContextLoader\";\nexport * from \"./pki/data/HttpPkiCertificateDataSource\";\nexport * from \"./pki/data/PkiCertificateDataSource\";\nexport * from \"./pki/domain/DefaultPkiCertificateLoader\";\nexport * from \"./pki/domain/PkiCertificateLoader\";\nexport * from \"./pki/model/KeyId\";\nexport * from \"./pki/model/KeyUsage\";\nexport * from \"./pki/model/PkiCertificate\";\nexport * from \"./pki/model/PkiCertificateInfo\";\nexport * from \"./proxy/data/HttpProxyDataSource\";\nexport * from \"./proxy/data/HttpSafeProxyDataSource\";\nexport * from \"./proxy/data/ProxyDataSource\";\nexport * from \"./proxy/domain/ProxyContextFieldLoader\";\nexport * from \"./shared/domain/ContextFieldLoader\";\nexport * from \"./shared/domain/ContextLoader\";\nexport * from \"./shared/model/ClearSignContext\";\nexport * from \"./shared/model/GenericPath\";\nexport * from \"./shared/model/SolanaContextTypes\";\nexport * from \"./shared/model/TransactionSubset\";\nexport * from \"./shared/model/TypedDataClearSignContext\";\nexport * from \"./shared/model/TypedDataContext\";\nexport * from \"./solana/data/HttpSolanaOwnerInfoDataSource\";\nexport * from \"./solana/data/SolanaDataSource\";\nexport * from \"./solana/domain/DefaultSolanaContextLoader\";\nexport * from \"./solana/domain/SolanaContextLoader\";\nexport * from \"./solana/domain/solanaContextTypes\";\nexport * from \"./token/data/HttpTokenDataSource\";\nexport * from \"./token/data/TokenDataSource\";\nexport * from \"./token/domain/TokenContextFieldLoader\";\nexport * from \"./token/domain/TokenContextLoader\";\nexport * from \"./trusted-name/data/HttpTrustedNameDataSource\";\nexport * from \"./trusted-name/data/TrustedNameDataSource\";\nexport * from \"./trusted-name/domain/TrustedNameContextFieldLoader\";\nexport * from \"./trusted-name/domain/TrustedNameContextLoader\";\nexport * from \"./typed-data/data/HttpTypedDataDataSource\";\nexport * from \"./typed-data/data/TypedDataDataSource\";\nexport * from \"./typed-data/domain/DefaultTypedDataContextLoader\";\nexport * from \"./typed-data/domain/TypedDataContextLoader\";\nexport * from \"./uniswap/data/AbiDecoderDataSource\";\nexport * from \"./uniswap/data/CommandDecoderDataSource\";\nexport * from \"./uniswap/data/DefaultCommandDecoderDataSource\";\nexport * from \"./uniswap/data/EthersAbiDecoderDataSource\";\nexport * from \"./uniswap/domain/UniswapContextLoader\";\n"],
5
- "mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,wDAAd,gBACAE,EAAAF,EAAc,4DADd,gBAEAE,EAAAF,EAAc,mDAFd,gBAGAE,EAAAF,EAAc,8CAHd,gBAIAE,EAAAF,EAAc,2BAJd,gBAKAE,EAAAF,EAAc,kCALd,gBAMAE,EAAAF,EAAc,kCANd,gBAOAE,EAAAF,EAAc,2DAPd,gBAQAE,EAAAF,EAAc,+DARd,gBASAE,EAAAF,EAAc,gEATd,gBAUAE,EAAAF,EAAc,+DAVd,gBAWAE,EAAAF,EAAc,2DAXd,gBAYAE,EAAAF,EAAc,+DAZd,gBAaAE,EAAAF,EAAc,gEAbd,gBAcAE,EAAAF,EAAc,wCAdd,gBAeAE,EAAAF,EAAc,oCAfd,gBAgBAE,EAAAF,EAAc,8CAhBd,gBAiBAE,EAAAF,EAAc,yCAjBd,gBAkBAE,EAAAF,EAAc,mDAlBd,gBAmBAE,EAAAF,EAAc,+CAnBd,gBAoBAE,EAAAF,EAAc,oDApBd,gBAqBAE,EAAAF,EAAc,6CArBd,gBAsBAE,EAAAF,EAAc,6BAtBd,gBAuBAE,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CalldataDescriptorDataSource\";\nexport * from \"./calldata/domain/CalldataContextLoader\";\nexport * from \"./config/model/ContextModuleConfig\";\nexport * from \"./ContextModule\";\nexport * from \"./ContextModuleBuilder\";\nexport * from \"./DefaultContextModule\";\nexport * from \"./dynamic-network/data/DynamicNetworkDataSource\";\nexport * from \"./dynamic-network/data/HttpDynamicNetworkDataSource\";\nexport * from \"./dynamic-network/domain/DynamicNetworkContextLoader\";\nexport * from \"./dynamic-network/model/DynamicNetworkConfiguration\";\nexport * from \"./external-plugin/data/ExternalPluginDataSource\";\nexport * from \"./external-plugin/data/HttpExternalPluginDataSource\";\nexport * from \"./external-plugin/domain/ExternalPluginContextLoader\";\nexport * from \"./gated-signing/data/GatedDescriptorDataSource\";\nexport * from \"./gated-signing/data/HttpGatedDescriptorDataSource\";\nexport * from \"./gated-signing/domain/GatedSigningContextLoader\";\nexport * from \"./gated-signing/domain/GatedSigningTypedDataContextLoader\";\nexport * from \"./nft/data/HttpNftDataSource\";\nexport * from \"./nft/data/NftDataSource\";\nexport * from \"./nft/domain/NftContextFieldLoader\";\nexport * from \"./nft/domain/NftContextLoader\";\nexport * from \"./pki/data/HttpPkiCertificateDataSource\";\nexport * from \"./pki/data/PkiCertificateDataSource\";\nexport * from \"./pki/domain/DefaultPkiCertificateLoader\";\nexport * from \"./pki/domain/PkiCertificateLoader\";\nexport * from \"./pki/model/KeyId\";\nexport * from \"./pki/model/KeyUsage\";\nexport * from \"./pki/model/PkiCertificate\";\nexport * from \"./pki/model/PkiCertificateInfo\";\nexport * from \"./proxy/data/HttpProxyDataSource\";\nexport * from \"./proxy/data/HttpSafeProxyDataSource\";\nexport * from \"./proxy/data/ProxyDataSource\";\nexport * from \"./proxy/domain/ProxyContextFieldLoader\";\nexport * from \"./shared/domain/ContextFieldLoader\";\nexport * from \"./shared/domain/ContextLoader\";\nexport * from \"./shared/model/ClearSignContext\";\nexport * from \"./shared/model/GenericPath\";\nexport * from \"./shared/model/SolanaContextTypes\";\nexport * from \"./shared/model/TransactionSubset\";\nexport * from \"./shared/model/TypedDataClearSignContext\";\nexport * from \"./shared/model/TypedDataContext\";\nexport * from \"./solana/data/HttpSolanaOwnerInfoDataSource\";\nexport * from \"./solana/data/SolanaDataSource\";\nexport * from \"./solana/domain/DefaultSolanaContextLoader\";\nexport * from \"./solana/domain/SolanaContextLoader\";\nexport * from \"./solana/domain/solanaContextTypes\";\nexport * from \"./token/data/HttpTokenDataSource\";\nexport * from \"./token/data/TokenDataSource\";\nexport * from \"./token/domain/TokenContextFieldLoader\";\nexport * from \"./token/domain/TokenContextLoader\";\nexport * from \"./trusted-name/data/HttpTrustedNameDataSource\";\nexport * from \"./trusted-name/data/TrustedNameDataSource\";\nexport * from \"./trusted-name/domain/TrustedNameContextFieldLoader\";\nexport * from \"./trusted-name/domain/TrustedNameContextLoader\";\nexport * from \"./typed-data/data/HttpTypedDataDataSource\";\nexport * from \"./typed-data/data/TypedDataDataSource\";\nexport * from \"./typed-data/domain/DefaultTypedDataContextLoader\";\nexport * from \"./typed-data/domain/TypedDataContextLoader\";\nexport * from \"./typed-data/utils/getSchemaHash\";\nexport * from \"./uniswap/data/AbiDecoderDataSource\";\nexport * from \"./uniswap/data/CommandDecoderDataSource\";\nexport * from \"./uniswap/data/DefaultCommandDecoderDataSource\";\nexport * from \"./uniswap/data/EthersAbiDecoderDataSource\";\nexport * from \"./uniswap/domain/UniswapContextLoader\";\n"],
5
+ "mappings": "iaAAA,IAAAA,EAAA,kBAAAC,EAAAD,GAAAE,EAAAF,EAAc,wDAAd,gBACAE,EAAAF,EAAc,4DADd,gBAEAE,EAAAF,EAAc,mDAFd,gBAGAE,EAAAF,EAAc,8CAHd,gBAIAE,EAAAF,EAAc,2BAJd,gBAKAE,EAAAF,EAAc,kCALd,gBAMAE,EAAAF,EAAc,kCANd,gBAOAE,EAAAF,EAAc,2DAPd,gBAQAE,EAAAF,EAAc,+DARd,gBASAE,EAAAF,EAAc,gEATd,gBAUAE,EAAAF,EAAc,+DAVd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AF,EAAc,6CAlDd,gBAmDAE,EAAAF,EAAc,yDAnDd,gBAoDAE,EAAAF,EAAc,qDApDd,gBAqDAE,EAAAF,EAAc,+DArDd,gBAsDAE,EAAAF,EAAc,0DAtDd,gBAuDAE,EAAAF,EAAc,qDAvDd,gBAwDAE,EAAAF,EAAc,iDAxDd,gBAyDAE,EAAAF,EAAc,6DAzDd,gBA0DAE,EAAAF,EAAc,sDA1Dd,gBA2DAE,EAAAF,EAAc,4CA3Dd,gBA4DAE,EAAAF,EAAc,+CA5Dd,gBA6DAE,EAAAF,EAAc,mDA7Dd,gBA8DAE,EAAAF,EAAc,0DA9Dd,gBA+DAE,EAAAF,EAAc,qDA/Dd,gBAgEAE,EAAAF,EAAc,iDAhEd",
6
6
  "names": ["src_exports", "__toCommonJS", "__reExport"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var l=Object.defineProperty;var k=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var s=(e,t)=>{for(var _ in t)l(e,_,{get:t[_],enumerable:!0})},u=(e,t,_,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of m(t))!c.call(e,r)&&r!==_&&l(e,r,{get:()=>t[r],enumerable:!(o=k(t,r))||o.enumerable});return e};var d=e=>u(l({},"__esModule",{value:!0}),e);var g={};s(g,{KeyId:()=>n});module.exports=d(g);var n=(a=>(a.Test="test",a.PersoV2="persov2",a.LedgerRootV3="ledger_root_v3",a.PluginSelectorKey="plugin_selector_key",a.NftMetadataKey="nft_metadata_key",a.PartnerMetadataKey="partner_metadata_key",a.Erc20MetadataKey="erc20_metadata_key",a.DomainMetadataKey="domain_metadata_key",a.CalCalldataKey="cal_calldata_key",a.CalTrustedNameKey="cal_trusted_name_key",a.CalNetwork="cal_network",a))(n||{});0&&(module.exports={KeyId});
1
+ "use strict";var l=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var g=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var m=(e,t)=>{for(var r in t)l(e,r,{get:t[r],enumerable:!0})},i=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let _ of g(t))!k.call(e,_)&&_!==r&&l(e,_,{get:()=>t[_],enumerable:!(n=c(t,_))||n.enumerable});return e};var s=e=>i(l({},"__esModule",{value:!0}),e);var d={};m(d,{KeyId:()=>o});module.exports=s(d);var o=(a=>(a.Test="test",a.PersoV2="persov2",a.LedgerRootV3="ledger_root_v3",a.PluginSelectorKey="plugin_selector_key",a.NftMetadataKey="nft_metadata_key",a.PartnerMetadataKey="partner_metadata_key",a.Erc20MetadataKey="erc20_metadata_key",a.DomainMetadataKey="domain_metadata_key",a.CalCalldataKey="cal_calldata_key",a.CalTrustedNameKey="cal_trusted_name_key",a.CalNetwork="cal_network",a.CalGatedSigning="cal_gated_signing",a))(o||{});0&&(module.exports={KeyId});
2
2
  //# sourceMappingURL=KeyId.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/pki/model/KeyId.ts"],
4
- "sourcesContent": ["export enum KeyId {\n Test = \"test\",\n PersoV2 = \"persov2\",\n LedgerRootV3 = \"ledger_root_v3\",\n PluginSelectorKey = \"plugin_selector_key\",\n NftMetadataKey = \"nft_metadata_key\",\n PartnerMetadataKey = \"partner_metadata_key\",\n Erc20MetadataKey = \"erc20_metadata_key\",\n DomainMetadataKey = \"domain_metadata_key\",\n CalCalldataKey = \"cal_calldata_key\",\n CalTrustedNameKey = \"cal_trusted_name_key\",\n CalNetwork = \"cal_network\",\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GAAO,IAAKE,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,aAAe,iBACfA,EAAA,kBAAoB,sBACpBA,EAAA,eAAiB,mBACjBA,EAAA,mBAAqB,uBACrBA,EAAA,iBAAmB,qBACnBA,EAAA,kBAAoB,sBACpBA,EAAA,eAAiB,mBACjBA,EAAA,kBAAoB,uBACpBA,EAAA,WAAa,cAXHA,OAAA",
4
+ "sourcesContent": ["export enum KeyId {\n Test = \"test\",\n PersoV2 = \"persov2\",\n LedgerRootV3 = \"ledger_root_v3\",\n PluginSelectorKey = \"plugin_selector_key\",\n NftMetadataKey = \"nft_metadata_key\",\n PartnerMetadataKey = \"partner_metadata_key\",\n Erc20MetadataKey = \"erc20_metadata_key\",\n DomainMetadataKey = \"domain_metadata_key\",\n CalCalldataKey = \"cal_calldata_key\",\n CalTrustedNameKey = \"cal_trusted_name_key\",\n CalNetwork = \"cal_network\",\n CalGatedSigning = \"cal_gated_signing\",\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,WAAAE,IAAA,eAAAC,EAAAH,GAAO,IAAKE,OACVA,EAAA,KAAO,OACPA,EAAA,QAAU,UACVA,EAAA,aAAe,iBACfA,EAAA,kBAAoB,sBACpBA,EAAA,eAAiB,mBACjBA,EAAA,mBAAqB,uBACrBA,EAAA,iBAAmB,qBACnBA,EAAA,kBAAoB,sBACpBA,EAAA,eAAiB,mBACjBA,EAAA,kBAAoB,uBACpBA,EAAA,WAAa,cACbA,EAAA,gBAAkB,oBAZRA,OAAA",
6
6
  "names": ["KeyId_exports", "__export", "KeyId", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var u=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var e=(i,r)=>{for(var o in r)u(i,o,{get:r[o],enumerable:!0})},m=(i,r,o,a)=>{if(r&&typeof r=="object"||typeof r=="function")for(let n of d(r))!l.call(i,n)&&n!==o&&u(i,n,{get:()=>r[n],enumerable:!(a=_(r,n))||a.enumerable});return i};var h=i=>m(u({},"__esModule",{value:!0}),i);var p={};e(p,{KeyUsage:()=>c});module.exports=h(p);var c=(t=>(t.GenuineCheck="genuine_check",t.ExchangePayload="exchange_payload",t.NftMeta="nft_meta",t.TrustedName="trusted_name",t.BackupProvider="backup_provider",t.ProtectOrchestrator="protect_orchestrator",t.PluginMeta="plugin_meta",t.CoinMeta="coin_meta",t.SeedIdAuth="seed_id_auth",t.TxSimulationSigner="tx_simu_signer",t.Calldata="calldata",t.Network="network",t.LESMultisig="les_multisig",t))(c||{});0&&(module.exports={KeyUsage});
1
+ "use strict";var u=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var e=(n,i)=>{for(var o in i)u(n,o,{get:i[o],enumerable:!0})},m=(n,i,o,a)=>{if(i&&typeof i=="object"||typeof i=="function")for(let r of c(i))!l.call(n,r)&&r!==o&&u(n,r,{get:()=>i[r],enumerable:!(a=_(i,r))||a.enumerable});return n};var h=n=>m(u({},"__esModule",{value:!0}),n);var p={};e(p,{KeyUsage:()=>d});module.exports=h(p);var d=(t=>(t.GenuineCheck="genuine_check",t.ExchangePayload="exchange_payload",t.NftMeta="nft_meta",t.TrustedName="trusted_name",t.BackupProvider="backup_provider",t.ProtectOrchestrator="protect_orchestrator",t.PluginMeta="plugin_meta",t.CoinMeta="coin_meta",t.SeedIdAuth="seed_id_auth",t.TxSimulationSigner="tx_simu_signer",t.Calldata="calldata",t.Network="network",t.LESMultisig="les_multisig",t.GatedSigning="gated_signing",t))(d||{});0&&(module.exports={KeyUsage});
2
2
  //# sourceMappingURL=KeyUsage.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/pki/model/KeyUsage.ts"],
4
- "sourcesContent": ["export enum KeyUsage {\n GenuineCheck = \"genuine_check\",\n ExchangePayload = \"exchange_payload\",\n NftMeta = \"nft_meta\",\n TrustedName = \"trusted_name\",\n BackupProvider = \"backup_provider\",\n ProtectOrchestrator = \"protect_orchestrator\",\n PluginMeta = \"plugin_meta\",\n CoinMeta = \"coin_meta\",\n SeedIdAuth = \"seed_id_auth\",\n TxSimulationSigner = \"tx_simu_signer\",\n Calldata = \"calldata\",\n Network = \"network\",\n LESMultisig = \"les_multisig\",\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAAO,IAAKE,OACVA,EAAA,aAAe,gBACfA,EAAA,gBAAkB,mBAClBA,EAAA,QAAU,WACVA,EAAA,YAAc,eACdA,EAAA,eAAiB,kBACjBA,EAAA,oBAAsB,uBACtBA,EAAA,WAAa,cACbA,EAAA,SAAW,YACXA,EAAA,WAAa,eACbA,EAAA,mBAAqB,iBACrBA,EAAA,SAAW,WACXA,EAAA,QAAU,UACVA,EAAA,YAAc,eAbJA,OAAA",
4
+ "sourcesContent": ["export enum KeyUsage {\n GenuineCheck = \"genuine_check\",\n ExchangePayload = \"exchange_payload\",\n NftMeta = \"nft_meta\",\n TrustedName = \"trusted_name\",\n BackupProvider = \"backup_provider\",\n ProtectOrchestrator = \"protect_orchestrator\",\n PluginMeta = \"plugin_meta\",\n CoinMeta = \"coin_meta\",\n SeedIdAuth = \"seed_id_auth\",\n TxSimulationSigner = \"tx_simu_signer\",\n Calldata = \"calldata\",\n Network = \"network\",\n LESMultisig = \"les_multisig\",\n GatedSigning = \"gated_signing\",\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,cAAAE,IAAA,eAAAC,EAAAH,GAAO,IAAKE,OACVA,EAAA,aAAe,gBACfA,EAAA,gBAAkB,mBAClBA,EAAA,QAAU,WACVA,EAAA,YAAc,eACdA,EAAA,eAAiB,kBACjBA,EAAA,oBAAsB,uBACtBA,EAAA,WAAa,cACbA,EAAA,SAAW,YACXA,EAAA,WAAa,eACbA,EAAA,mBAAqB,iBACrBA,EAAA,SAAW,WACXA,EAAA,QAAU,UACVA,EAAA,YAAc,eACdA,EAAA,aAAe,gBAdLA,OAAA",
6
6
  "names": ["KeyUsage_exports", "__export", "KeyUsage", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var u=(n,t)=>{for(var c in t)i(n,c,{get:t[c],enumerable:!0})},y=(n,t,c,C)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of S(t))!T.call(n,r)&&r!==c&&i(n,r,{get:()=>t[r],enumerable:!(C=l(t,r))||C.enumerable});return n};var N=n=>y(i({},"__esModule",{value:!0}),n);var p={};u(p,{ClearSignContextReferenceType:()=>s,ClearSignContextType:()=>o});module.exports=N(p);var o=(e=>(e.TOKEN="token",e.NFT="nft",e.TRUSTED_NAME="trustedName",e.PLUGIN="plugin",e.EXTERNAL_PLUGIN="externalPlugin",e.TRANSACTION_INFO="transactionInfo",e.PROXY_INFO="proxyInfo",e.ENUM="enum",e.TRANSACTION_FIELD_DESCRIPTION="transactionFieldDescription",e.TRANSACTION_CHECK="transactionCheck",e.DYNAMIC_NETWORK="dynamicNetwork",e.DYNAMIC_NETWORK_ICON="dynamicNetworkIcon",e.ERROR="error",e.SAFE="safe",e.SIGNER="signer",e))(o||{}),s=(a=>(a.TOKEN="token",a.NFT="nft",a.TRUSTED_NAME="trustedName",a.ENUM="enum",a.CALLDATA="calldata",a))(s||{});0&&(module.exports={ClearSignContextReferenceType,ClearSignContextType});
1
+ "use strict";var i=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var S=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var N=(n,t)=>{for(var c in t)i(n,c,{get:t[c],enumerable:!0})},u=(n,t,c,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of S(t))!T.call(n,r)&&r!==c&&i(n,r,{get:()=>t[r],enumerable:!(s=l(t,r))||s.enumerable});return n};var y=n=>u(i({},"__esModule",{value:!0}),n);var p={};N(p,{ClearSignContextReferenceType:()=>o,ClearSignContextType:()=>C});module.exports=y(p);var C=(e=>(e.TOKEN="token",e.NFT="nft",e.TRUSTED_NAME="trustedName",e.PLUGIN="plugin",e.EXTERNAL_PLUGIN="externalPlugin",e.TRANSACTION_INFO="transactionInfo",e.PROXY_INFO="proxyInfo",e.ENUM="enum",e.TRANSACTION_FIELD_DESCRIPTION="transactionFieldDescription",e.TRANSACTION_CHECK="transactionCheck",e.DYNAMIC_NETWORK="dynamicNetwork",e.DYNAMIC_NETWORK_ICON="dynamicNetworkIcon",e.ERROR="error",e.SAFE="safe",e.SIGNER="signer",e.GATED_SIGNING="gatedSigning",e))(C||{}),o=(a=>(a.TOKEN="token",a.NFT="nft",a.TRUSTED_NAME="trustedName",a.ENUM="enum",a.CALLDATA="calldata",a))(o||{});0&&(module.exports={ClearSignContextReferenceType,ClearSignContextType});
2
2
  //# sourceMappingURL=ClearSignContext.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/shared/model/ClearSignContext.ts"],
4
- "sourcesContent": ["import { type PkiCertificate } from \"@/pki/model/PkiCertificate\";\n\nimport { type GenericPath } from \"./GenericPath\";\n\nexport enum ClearSignContextType {\n TOKEN = \"token\",\n NFT = \"nft\",\n TRUSTED_NAME = \"trustedName\",\n PLUGIN = \"plugin\",\n EXTERNAL_PLUGIN = \"externalPlugin\",\n TRANSACTION_INFO = \"transactionInfo\",\n PROXY_INFO = \"proxyInfo\",\n ENUM = \"enum\",\n TRANSACTION_FIELD_DESCRIPTION = \"transactionFieldDescription\",\n TRANSACTION_CHECK = \"transactionCheck\",\n DYNAMIC_NETWORK = \"dynamicNetwork\",\n DYNAMIC_NETWORK_ICON = \"dynamicNetworkIcon\",\n ERROR = \"error\",\n SAFE = \"safe\",\n SIGNER = \"signer\",\n}\n\nexport enum ClearSignContextReferenceType {\n TOKEN = ClearSignContextType.TOKEN,\n NFT = ClearSignContextType.NFT,\n TRUSTED_NAME = ClearSignContextType.TRUSTED_NAME,\n ENUM = ClearSignContextType.ENUM,\n CALLDATA = \"calldata\",\n}\n\ntype PathOnly = {\n valuePath: GenericPath;\n value?: never;\n callee?: GenericPath;\n selector?: GenericPath;\n amount?: GenericPath;\n spender?: GenericPath;\n chainId?: GenericPath;\n};\n\ntype ValueOnly = {\n value: string;\n valuePath?: never;\n};\n\ntype PathOrValue = PathOnly | ValueOnly;\n\n// per-type payloads for references\ntype ClearSignContextReferencePayloads = {\n [ClearSignContextReferenceType.ENUM]: {\n valuePath: GenericPath;\n id: number; // enum id to reference\n };\n [ClearSignContextReferenceType.TRUSTED_NAME]: {\n valuePath: GenericPath;\n types: string[];\n sources: string[];\n };\n [ClearSignContextReferenceType.CALLDATA]: {\n callee: GenericPath;\n valuePath: GenericPath;\n selector?: GenericPath;\n amount?: GenericPath;\n spender?: GenericPath;\n chainId?: GenericPath;\n };\n [ClearSignContextReferenceType.TOKEN]: PathOrValue;\n [ClearSignContextReferenceType.NFT]: PathOrValue;\n};\n\n// discriminated union of all reference shapes, built from the payload map\ntype ClearSignContextReferenceUnion = {\n [T in ClearSignContextReferenceType]: {\n type: T;\n } & ClearSignContextReferencePayloads[T];\n}[ClearSignContextReferenceType];\n\nexport type ClearSignContextReference<\n T extends ClearSignContextReferenceType = ClearSignContextReferenceType,\n> = Extract<ClearSignContextReferenceUnion, { type: T }>;\n\nexport type ClearSignContextSuccessType = Exclude<\n ClearSignContextType,\n ClearSignContextType.ERROR\n>;\n\n// base payload shared by most success contexts\ntype ClearSignContextSuccessBase = {\n payload: string;\n certificate?: PkiCertificate;\n};\n\n// map from ClearSign success type to payload\ntype ClearSignContextSuccessPayloadsBase = {\n [K in ClearSignContextSuccessType]: ClearSignContextSuccessBase;\n};\n\n// special cases overrides for certain context types\ntype ClearSignContextSuccessPayloadOverrides = {\n [ClearSignContextType.ENUM]: ClearSignContextSuccessBase & {\n id: number;\n value: number;\n };\n [ClearSignContextType.TRANSACTION_FIELD_DESCRIPTION]: ClearSignContextSuccessBase & {\n reference?: ClearSignContextReference;\n };\n};\n\ntype ClearSignContextSuccessPayloads = Omit<\n ClearSignContextSuccessPayloadsBase,\n ClearSignContextType.ENUM | ClearSignContextType.TRANSACTION_FIELD_DESCRIPTION\n> &\n ClearSignContextSuccessPayloadOverrides;\n\n// union of all success contexts, built from the payload map.\ntype ClearSignContextSuccessUnion = {\n [T in ClearSignContextSuccessType]: {\n type: T;\n } & ClearSignContextSuccessPayloads[T];\n}[ClearSignContextSuccessType];\n\nexport type ClearSignContextSuccess<\n T extends ClearSignContextSuccessType = ClearSignContextSuccessType,\n> = Extract<ClearSignContextSuccessUnion, { type: T }>;\n\nexport type ClearSignContextError = {\n type: ClearSignContextType.ERROR;\n error: Error;\n};\n\nexport type ClearSignContext = ClearSignContextSuccess | ClearSignContextError;\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mCAAAE,EAAA,yBAAAC,IAAA,eAAAC,EAAAJ,GAIO,IAAKG,OACVA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,aAAe,cACfA,EAAA,OAAS,SACTA,EAAA,gBAAkB,iBAClBA,EAAA,iBAAmB,kBACnBA,EAAA,WAAa,YACbA,EAAA,KAAO,OACPA,EAAA,8BAAgC,8BAChCA,EAAA,kBAAoB,mBACpBA,EAAA,gBAAkB,iBAClBA,EAAA,qBAAuB,qBACvBA,EAAA,MAAQ,QACRA,EAAA,KAAO,OACPA,EAAA,OAAS,SAfCA,OAAA,IAkBAD,OACVA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,aAAe,cACfA,EAAA,KAAO,OACPA,EAAA,SAAW,WALDA,OAAA",
4
+ "sourcesContent": ["import { type PkiCertificate } from \"@/pki/model/PkiCertificate\";\n\nimport { type GenericPath } from \"./GenericPath\";\n\nexport enum ClearSignContextType {\n TOKEN = \"token\",\n NFT = \"nft\",\n TRUSTED_NAME = \"trustedName\",\n PLUGIN = \"plugin\",\n EXTERNAL_PLUGIN = \"externalPlugin\",\n TRANSACTION_INFO = \"transactionInfo\",\n PROXY_INFO = \"proxyInfo\",\n ENUM = \"enum\",\n TRANSACTION_FIELD_DESCRIPTION = \"transactionFieldDescription\",\n TRANSACTION_CHECK = \"transactionCheck\",\n DYNAMIC_NETWORK = \"dynamicNetwork\",\n DYNAMIC_NETWORK_ICON = \"dynamicNetworkIcon\",\n ERROR = \"error\",\n SAFE = \"safe\",\n SIGNER = \"signer\",\n GATED_SIGNING = \"gatedSigning\",\n}\n\nexport enum ClearSignContextReferenceType {\n TOKEN = ClearSignContextType.TOKEN,\n NFT = ClearSignContextType.NFT,\n TRUSTED_NAME = ClearSignContextType.TRUSTED_NAME,\n ENUM = ClearSignContextType.ENUM,\n CALLDATA = \"calldata\",\n}\n\ntype PathOnly = {\n valuePath: GenericPath;\n value?: never;\n callee?: GenericPath;\n selector?: GenericPath;\n amount?: GenericPath;\n spender?: GenericPath;\n chainId?: GenericPath;\n};\n\ntype ValueOnly = {\n value: string;\n valuePath?: never;\n};\n\ntype PathOrValue = PathOnly | ValueOnly;\n\n// per-type payloads for references\ntype ClearSignContextReferencePayloads = {\n [ClearSignContextReferenceType.ENUM]: {\n valuePath: GenericPath;\n id: number; // enum id to reference\n };\n [ClearSignContextReferenceType.TRUSTED_NAME]: {\n valuePath: GenericPath;\n types: string[];\n sources: string[];\n };\n [ClearSignContextReferenceType.CALLDATA]: {\n callee: GenericPath;\n valuePath: GenericPath;\n selector?: GenericPath;\n amount?: GenericPath;\n spender?: GenericPath;\n chainId?: GenericPath;\n };\n [ClearSignContextReferenceType.TOKEN]: PathOrValue;\n [ClearSignContextReferenceType.NFT]: PathOrValue;\n};\n\n// discriminated union of all reference shapes, built from the payload map\ntype ClearSignContextReferenceUnion = {\n [T in ClearSignContextReferenceType]: {\n type: T;\n } & ClearSignContextReferencePayloads[T];\n}[ClearSignContextReferenceType];\n\nexport type ClearSignContextReference<\n T extends ClearSignContextReferenceType = ClearSignContextReferenceType,\n> = Extract<ClearSignContextReferenceUnion, { type: T }>;\n\nexport type ClearSignContextSuccessType = Exclude<\n ClearSignContextType,\n ClearSignContextType.ERROR\n>;\n\n// base payload shared by most success contexts\ntype ClearSignContextSuccessBase = {\n payload: string;\n certificate?: PkiCertificate;\n};\n\n// map from ClearSign success type to payload\ntype ClearSignContextSuccessPayloadsBase = {\n [K in ClearSignContextSuccessType]: ClearSignContextSuccessBase;\n};\n\n// special cases overrides for certain context types\ntype ClearSignContextSuccessPayloadOverrides = {\n [ClearSignContextType.ENUM]: ClearSignContextSuccessBase & {\n id: number;\n value: number;\n };\n [ClearSignContextType.TRANSACTION_FIELD_DESCRIPTION]: ClearSignContextSuccessBase & {\n reference?: ClearSignContextReference;\n };\n};\n\ntype ClearSignContextSuccessPayloads = Omit<\n ClearSignContextSuccessPayloadsBase,\n ClearSignContextType.ENUM | ClearSignContextType.TRANSACTION_FIELD_DESCRIPTION\n> &\n ClearSignContextSuccessPayloadOverrides;\n\n// union of all success contexts, built from the payload map.\ntype ClearSignContextSuccessUnion = {\n [T in ClearSignContextSuccessType]: {\n type: T;\n } & ClearSignContextSuccessPayloads[T];\n}[ClearSignContextSuccessType];\n\nexport type ClearSignContextSuccess<\n T extends ClearSignContextSuccessType = ClearSignContextSuccessType,\n> = Extract<ClearSignContextSuccessUnion, { type: T }>;\n\nexport type ClearSignContextError = {\n type: ClearSignContextType.ERROR;\n error: Error;\n};\n\nexport type ClearSignContext = ClearSignContextSuccess | ClearSignContextError;\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mCAAAE,EAAA,yBAAAC,IAAA,eAAAC,EAAAJ,GAIO,IAAKG,OACVA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,aAAe,cACfA,EAAA,OAAS,SACTA,EAAA,gBAAkB,iBAClBA,EAAA,iBAAmB,kBACnBA,EAAA,WAAa,YACbA,EAAA,KAAO,OACPA,EAAA,8BAAgC,8BAChCA,EAAA,kBAAoB,mBACpBA,EAAA,gBAAkB,iBAClBA,EAAA,qBAAuB,qBACvBA,EAAA,MAAQ,QACRA,EAAA,KAAO,OACPA,EAAA,OAAS,SACTA,EAAA,cAAgB,eAhBNA,OAAA,IAmBAD,OACVA,EAAA,MAAQ,QACRA,EAAA,IAAM,MACNA,EAAA,aAAe,cACfA,EAAA,KAAO,OACPA,EAAA,SAAW,WALDA,OAAA",
6
6
  "names": ["ClearSignContext_exports", "__export", "ClearSignContextReferenceType", "ClearSignContextType", "__toCommonJS"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var i=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var c=(t,a)=>{for(var s in a)i(t,s,{get:a[s],enumerable:!0})},p=(t,a,s,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of u(a))!o.call(t,r)&&r!==s&&i(t,r,{get:()=>a[r],enumerable:!(n=g(a,r))||n.enumerable});return t};var l=t=>p(i({},"__esModule",{value:!0}),t);var y={};c(y,{KeyUsageMapper:()=>m});module.exports=l(y);var e=require("../../pki/model/KeyUsage");class m{static keyUsageMap=new Map([[e.KeyUsage.GenuineCheck,1],[e.KeyUsage.ExchangePayload,2],[e.KeyUsage.NftMeta,3],[e.KeyUsage.TrustedName,4],[e.KeyUsage.BackupProvider,5],[e.KeyUsage.ProtectOrchestrator,6],[e.KeyUsage.PluginMeta,7],[e.KeyUsage.CoinMeta,8],[e.KeyUsage.SeedIdAuth,9],[e.KeyUsage.TxSimulationSigner,10],[e.KeyUsage.Calldata,11],[e.KeyUsage.Network,12],[e.KeyUsage.LESMultisig,14]]);static mapKeyUsageForFirmware(a){return Object.values(e.KeyUsage).includes(a)?this.keyUsageMap.get(a)??-1:-1}}0&&(module.exports={KeyUsageMapper});
1
+ "use strict";var s=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var o=Object.prototype.hasOwnProperty;var c=(t,a)=>{for(var i in a)s(t,i,{get:a[i],enumerable:!0})},p=(t,a,i,n)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of u(a))!o.call(t,r)&&r!==i&&s(t,r,{get:()=>a[r],enumerable:!(n=g(a,r))||n.enumerable});return t};var l=t=>p(s({},"__esModule",{value:!0}),t);var m={};c(m,{KeyUsageMapper:()=>d});module.exports=l(m);var e=require("../../pki/model/KeyUsage");class d{static keyUsageMap=new Map([[e.KeyUsage.GenuineCheck,1],[e.KeyUsage.ExchangePayload,2],[e.KeyUsage.NftMeta,3],[e.KeyUsage.TrustedName,4],[e.KeyUsage.BackupProvider,5],[e.KeyUsage.ProtectOrchestrator,6],[e.KeyUsage.PluginMeta,7],[e.KeyUsage.CoinMeta,8],[e.KeyUsage.SeedIdAuth,9],[e.KeyUsage.TxSimulationSigner,10],[e.KeyUsage.Calldata,11],[e.KeyUsage.Network,12],[e.KeyUsage.LESMultisig,14],[e.KeyUsage.GatedSigning,15]]);static mapKeyUsageForFirmware(a){return Object.values(e.KeyUsage).includes(a)?this.keyUsageMap.get(a)??-1:-1}}0&&(module.exports={KeyUsageMapper});
2
2
  //# sourceMappingURL=KeyUsageMapper.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/shared/utils/KeyUsageMapper.ts"],
4
- "sourcesContent": ["import { KeyUsage } from \"@/pki/model/KeyUsage\";\n\nexport class KeyUsageMapper {\n private static keyUsageMap = new Map<KeyUsage, number>([\n [KeyUsage.GenuineCheck, 1],\n [KeyUsage.ExchangePayload, 2],\n [KeyUsage.NftMeta, 3],\n [KeyUsage.TrustedName, 4],\n [KeyUsage.BackupProvider, 5],\n [KeyUsage.ProtectOrchestrator, 6],\n [KeyUsage.PluginMeta, 7],\n [KeyUsage.CoinMeta, 8],\n [KeyUsage.SeedIdAuth, 9],\n [KeyUsage.TxSimulationSigner, 10],\n [KeyUsage.Calldata, 11],\n [KeyUsage.Network, 12],\n [KeyUsage.LESMultisig, 14],\n ]);\n\n static mapKeyUsageForFirmware(keyUsage: string): number {\n if (Object.values(KeyUsage).includes(keyUsage as KeyUsage)) {\n return this.keyUsageMap.get(keyUsage as KeyUsage) ?? -1;\n }\n return -1;\n }\n}\n"],
5
- "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAyB,gCAElB,MAAMF,CAAe,CAC1B,OAAe,YAAc,IAAI,IAAsB,CACrD,CAAC,WAAS,aAAc,CAAC,EACzB,CAAC,WAAS,gBAAiB,CAAC,EAC5B,CAAC,WAAS,QAAS,CAAC,EACpB,CAAC,WAAS,YAAa,CAAC,EACxB,CAAC,WAAS,eAAgB,CAAC,EAC3B,CAAC,WAAS,oBAAqB,CAAC,EAChC,CAAC,WAAS,WAAY,CAAC,EACvB,CAAC,WAAS,SAAU,CAAC,EACrB,CAAC,WAAS,WAAY,CAAC,EACvB,CAAC,WAAS,mBAAoB,EAAE,EAChC,CAAC,WAAS,SAAU,EAAE,EACtB,CAAC,WAAS,QAAS,EAAE,EACrB,CAAC,WAAS,YAAa,EAAE,CAC3B,CAAC,EAED,OAAO,uBAAuBG,EAA0B,CACtD,OAAI,OAAO,OAAO,UAAQ,EAAE,SAASA,CAAoB,EAChD,KAAK,YAAY,IAAIA,CAAoB,GAAK,GAEhD,EACT,CACF",
4
+ "sourcesContent": ["import { KeyUsage } from \"@/pki/model/KeyUsage\";\n\nexport class KeyUsageMapper {\n private static keyUsageMap = new Map<KeyUsage, number>([\n [KeyUsage.GenuineCheck, 1],\n [KeyUsage.ExchangePayload, 2],\n [KeyUsage.NftMeta, 3],\n [KeyUsage.TrustedName, 4],\n [KeyUsage.BackupProvider, 5],\n [KeyUsage.ProtectOrchestrator, 6],\n [KeyUsage.PluginMeta, 7],\n [KeyUsage.CoinMeta, 8],\n [KeyUsage.SeedIdAuth, 9],\n [KeyUsage.TxSimulationSigner, 10],\n [KeyUsage.Calldata, 11],\n [KeyUsage.Network, 12],\n [KeyUsage.LESMultisig, 14],\n [KeyUsage.GatedSigning, 15],\n ]);\n\n static mapKeyUsageForFirmware(keyUsage: string): number {\n if (Object.values(KeyUsage).includes(keyUsage as KeyUsage)) {\n return this.keyUsageMap.get(keyUsage as KeyUsage) ?? -1;\n }\n return -1;\n }\n}\n"],
5
+ "mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAyB,gCAElB,MAAMF,CAAe,CAC1B,OAAe,YAAc,IAAI,IAAsB,CACrD,CAAC,WAAS,aAAc,CAAC,EACzB,CAAC,WAAS,gBAAiB,CAAC,EAC5B,CAAC,WAAS,QAAS,CAAC,EACpB,CAAC,WAAS,YAAa,CAAC,EACxB,CAAC,WAAS,eAAgB,CAAC,EAC3B,CAAC,WAAS,oBAAqB,CAAC,EAChC,CAAC,WAAS,WAAY,CAAC,EACvB,CAAC,WAAS,SAAU,CAAC,EACrB,CAAC,WAAS,WAAY,CAAC,EACvB,CAAC,WAAS,mBAAoB,EAAE,EAChC,CAAC,WAAS,SAAU,EAAE,EACtB,CAAC,WAAS,QAAS,EAAE,EACrB,CAAC,WAAS,YAAa,EAAE,EACzB,CAAC,WAAS,aAAc,EAAE,CAC5B,CAAC,EAED,OAAO,uBAAuBG,EAA0B,CACtD,OAAI,OAAO,OAAO,UAAQ,EAAE,SAASA,CAAoB,EAChD,KAAK,YAAY,IAAIA,CAAoB,GAAK,GAEhD,EACT,CACF",
6
6
  "names": ["KeyUsageMapper_exports", "__export", "KeyUsageMapper", "__toCommonJS", "import_KeyUsage", "keyUsage"]
7
7
  }
@@ -1,2 +1,2 @@
1
- "use strict";var v=Object.create;var f=Object.defineProperty;var C=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var V=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var S=(r,e)=>{for(var t in e)f(r,t,{get:e[t],enumerable:!0})},I=(r,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of E(e))!N.call(r,o)&&o!==t&&f(r,o,{get:()=>e[o],enumerable:!(i=C(e,o))||i.enumerable});return r};var _=(r,e,t)=>(t=r!=null?v(V(r)):{},I(e||!r||!r.__esModule?f(t,"default",{value:r,enumerable:!0}):t,r)),j=r=>I(f({},"__esModule",{value:!0}),r),F=(r,e,t,i)=>{for(var o=i>1?void 0:i?C(e,t):e,a=r.length-1,s;a>=0;a--)(s=r[a])&&(o=(i?s(e,t,o):s(o))||o);return i&&o&&f(e,t,o),o},x=(r,e)=>(t,i)=>e(t,i,r);var P={};S(P,{HttpTypedDataDataSource:()=>d});module.exports=j(P);var M=_(require("axios")),D=_(require("crypto-js/sha224")),y=require("inversify"),l=require("purify-ts"),T=require("../../config/di/configTypes"),m=require("../../shared/constant/HttpHeaders"),u=require("../../shared/model/TypedDataClearSignContext"),b=_(require("../../../package.json"));let d=class{constructor(e){this.config=e}async getTypedDataFilters({chainId:e,address:t,schema:i,version:o}){let a;try{const s=await M.default.request({method:"GET",url:`${this.config.cal.url}/dapps`,params:{contracts:t,chain_id:e,output:"descriptors_eip712",descriptors_eip712_version:o,descriptors_eip712:"<set>",ref:`branch:${this.config.cal.branch}`},headers:{[m.LEDGER_CLIENT_VERSION_HEADER]:`context-module/${b.default.version}`,[m.LEDGER_ORIGIN_TOKEN_HEADER]:this.config.originToken}}),c=(0,D.default)(JSON.stringify(this.sortTypes(i)).replace(" ","")).toString();t=t.toLowerCase();const g=(s.data??[]).map(n=>n?.descriptors_eip712?.[t]?.[c]).find(Boolean);if(!g)return(0,l.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: no typed data filters for address ${t} on chain ${e} for schema ${c}`));if(!Array.isArray(g.instructions))return(0,l.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: no message info for address ${t} on chain ${e} for schema ${c}`));const p=[],h={};for(const n of g.instructions)if(this.isInstructionContractInfo(n,this.config.cal.mode))a={displayName:n.display_name,signature:n.signatures[this.config.cal.mode],filtersCount:n.field_mappers_count};else if(o==="v1"&&this.isInstructionFieldV1(n,this.config.cal.mode))p.push({type:"raw",displayName:n.display_name,path:n.field_path,signature:n.signatures[this.config.cal.mode]});else if(this.isInstructionFieldV2(n,this.config.cal.mode))p.push({type:n.format,displayName:n.display_name,path:n.field_path,signature:n.signatures[this.config.cal.mode]});else if(this.isInstructionFieldV2WithCoinRef(n,this.config.cal.mode))p.push({type:n.format,displayName:n.display_name,path:n.field_path,signature:n.signatures[this.config.cal.mode],tokenIndex:n.coin_ref});else if(this.isInstructionFieldV2WithName(n,this.config.cal.mode))p.push({type:n.format,displayName:n.display_name,path:n.field_path,signature:n.signatures[this.config.cal.mode],types:n.name_types,sources:n.name_sources,typesAndSourcesPayload:this.formatTrustedNameTypesAndSources(n)});else if(this.isInstructionCalldataInfo(n,this.config.cal.mode))h[n.calldata_index]={displayName:n.display_name,calldataIndex:n.calldata_index,valueFlag:n.value_filter_flag,calleeFlag:this.convertCalldataPresenceFlag(n.callee_filter_flag),amountFlag:n.amount_filter_flag,spenderFlag:this.convertCalldataPresenceFlag(n.spender_filter_flag),chainIdFlag:n.chain_id_filter_flag,selectorFlag:n.selector_filter_flag,signature:n.signatures[this.config.cal.mode]};else if(this.isInstructionFieldV2Calldata(n,this.config.cal.mode))p.push({type:n.format,displayName:n.display_name,path:n.field_path,signature:n.signatures[this.config.cal.mode],calldataIndex:n.calldata_index});else return(0,l.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: invalid typed data field for address ${t} on chain ${e} for schema ${c}`));return a?(0,l.Right)({messageInfo:a,filters:p,calldatasInfos:h}):(0,l.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: no message info for address ${t} on chain ${e} for schema ${c}`))}catch{return(0,l.Left)(new Error("[ContextModule] HttpTypedDataDataSource: Failed to fetch typed data informations"))}}convertCalldataPresenceFlag(e){switch(e){case"none":return u.TypedDataCalldataParamPresence.None;case"present":return u.TypedDataCalldataParamPresence.Present;case"verifying_contract":return u.TypedDataCalldataParamPresence.VerifyingContract;default:{const t=e;throw new Error(`Unhandled flag: ${t}`)}}}formatTrustedNameTypesAndSources(e){const t=e.name_types.length,i=e.name_sources.length,o=e.descriptor.slice((t+i)*2*-1,i*2*-1),a=e.descriptor.slice(i*2*-1),s=t.toString(16).padStart(2,"0"),c=i.toString(16).padStart(2,"0");return s+o+c+a}isInstructionFieldV1(e,t){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_path=="string"&&typeof e.signatures=="object"&&typeof e.signatures[t]=="string"}isInstructionFieldV2(e,t){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_path=="string"&&typeof e.signatures=="object"&&typeof e.signatures[t]=="string"&&typeof e.format=="string"&&["raw","datetime"].includes(e.format)&&e.coin_ref===void 0}isInstructionFieldV2WithCoinRef(e,t){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_path=="string"&&typeof e.signatures=="object"&&typeof e.signatures[t]=="string"&&typeof e.format=="string"&&["token","amount"].includes(e.format)&&typeof e.coin_ref=="number"}isInstructionFieldV2WithName(e,t){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_path=="string"&&typeof e.signatures=="object"&&typeof e.signatures[t]=="string"&&typeof e.format=="string"&&e.format==="trusted-name"&&e.coin_ref===void 0&&Array.isArray(e.name_types)&&Array.isArray(e.name_sources)&&e.name_types.every(i=>typeof i=="string")&&e.name_sources.every(i=>typeof i=="string")}isInstructionContractInfo(e,t){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_mappers_count=="number"&&typeof e.signatures=="object"&&typeof e.signatures[t]=="string"&&e.field_path===void 0}isInstructionCalldataInfo(e,t){return typeof e=="object"&&typeof e.type=="string"&&e.type==="calldata"&&typeof e.display_name=="string"&&typeof e.calldata_index=="number"&&typeof e.value_filter_flag=="boolean"&&typeof e.chain_id_filter_flag=="boolean"&&typeof e.selector_filter_flag=="boolean"&&typeof e.amount_filter_flag=="boolean"&&["none","present","verifying_contract"].includes(e.callee_filter_flag)&&["none","present","verifying_contract"].includes(e.spender_filter_flag)&&typeof e.signatures=="object"&&typeof e.signatures[t]=="string"}isInstructionFieldV2Calldata(e,t){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_path=="string"&&typeof e.signatures=="object"&&typeof e.signatures[t]=="string"&&typeof e.format=="string"&&["calldata-value","calldata-callee","calldata-chain-id","calldata-selector","calldata-amount","calldata-spender"].includes(e.format)&&typeof e.calldata_index=="number"}sortTypes(e){return Object.fromEntries(Object.entries(e).sort(([t],[i])=>t.localeCompare(i)).map(([t,i])=>[t,i.map(o=>({name:o.name,type:o.type}))]))}};d=F([(0,y.injectable)(),x(0,(0,y.inject)(T.configTypes.Config))],d);0&&(module.exports={HttpTypedDataDataSource});
1
+ "use strict";var b=Object.create;var p=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,N=Object.prototype.hasOwnProperty;var P=(i,e)=>{for(var n in e)p(i,n,{get:e[n],enumerable:!0})},C=(i,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of V(e))!N.call(i,r)&&r!==n&&p(i,r,{get:()=>e[r],enumerable:!(o=h(e,r))||o.enumerable});return i};var I=(i,e,n)=>(n=i!=null?b(E(i)):{},C(e||!i||!i.__esModule?p(n,"default",{value:i,enumerable:!0}):n,i)),j=i=>C(p({},"__esModule",{value:!0}),i),F=(i,e,n,o)=>{for(var r=o>1?void 0:o?h(e,n):e,s=i.length-1,a;s>=0;s--)(a=i[s])&&(r=(o?a(e,n,r):a(r))||r);return o&&r&&p(e,n,r),r},M=(i,e)=>(n,o)=>e(n,o,i);var $={};P($,{HttpTypedDataDataSource:()=>d});module.exports=j($);var x=I(require("axios")),y=require("inversify"),l=require("purify-ts"),D=require("../../config/di/configTypes"),g=require("../../shared/constant/HttpHeaders"),u=require("../../shared/model/TypedDataClearSignContext"),T=require("../../typed-data/utils/getSchemaHash"),v=I(require("../../../package.json"));let d=class{constructor(e){this.config=e}async getTypedDataFilters({chainId:e,address:n,schema:o,version:r}){let s;try{const a=await x.default.request({method:"GET",url:`${this.config.cal.url}/dapps`,params:{contracts:n,chain_id:e,output:"descriptors_eip712",descriptors_eip712_version:r,descriptors_eip712:"<set>",ref:`branch:${this.config.cal.branch}`},headers:{[g.LEDGER_CLIENT_VERSION_HEADER]:`context-module/${v.default.version}`,[g.LEDGER_ORIGIN_TOKEN_HEADER]:this.config.originToken}}),c=(0,T.getSchemaHash)(o);n=n.toLowerCase();const m=(a.data??[]).map(t=>t?.descriptors_eip712?.[n]?.[c]).find(Boolean);if(!m)return(0,l.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: no typed data filters for address ${n} on chain ${e} for schema ${c}`));if(!Array.isArray(m.instructions))return(0,l.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: no message info for address ${n} on chain ${e} for schema ${c}`));const f=[],_={};for(const t of m.instructions)if(this.isInstructionContractInfo(t,this.config.cal.mode))s={displayName:t.display_name,signature:t.signatures[this.config.cal.mode],filtersCount:t.field_mappers_count};else if(r==="v1"&&this.isInstructionFieldV1(t,this.config.cal.mode))f.push({type:"raw",displayName:t.display_name,path:t.field_path,signature:t.signatures[this.config.cal.mode]});else if(this.isInstructionFieldV2(t,this.config.cal.mode))f.push({type:t.format,displayName:t.display_name,path:t.field_path,signature:t.signatures[this.config.cal.mode]});else if(this.isInstructionFieldV2WithCoinRef(t,this.config.cal.mode))f.push({type:t.format,displayName:t.display_name,path:t.field_path,signature:t.signatures[this.config.cal.mode],tokenIndex:t.coin_ref});else if(this.isInstructionFieldV2WithName(t,this.config.cal.mode))f.push({type:t.format,displayName:t.display_name,path:t.field_path,signature:t.signatures[this.config.cal.mode],types:t.name_types,sources:t.name_sources,typesAndSourcesPayload:this.formatTrustedNameTypesAndSources(t)});else if(this.isInstructionCalldataInfo(t,this.config.cal.mode))_[t.calldata_index]={displayName:t.display_name,calldataIndex:t.calldata_index,valueFlag:t.value_filter_flag,calleeFlag:this.convertCalldataPresenceFlag(t.callee_filter_flag),amountFlag:t.amount_filter_flag,spenderFlag:this.convertCalldataPresenceFlag(t.spender_filter_flag),chainIdFlag:t.chain_id_filter_flag,selectorFlag:t.selector_filter_flag,signature:t.signatures[this.config.cal.mode]};else if(this.isInstructionFieldV2Calldata(t,this.config.cal.mode))f.push({type:t.format,displayName:t.display_name,path:t.field_path,signature:t.signatures[this.config.cal.mode],calldataIndex:t.calldata_index});else return(0,l.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: invalid typed data field for address ${n} on chain ${e} for schema ${c}`));return s?(0,l.Right)({messageInfo:s,filters:f,calldatasInfos:_}):(0,l.Left)(new Error(`[ContextModule] HttpTypedDataDataSource: no message info for address ${n} on chain ${e} for schema ${c}`))}catch{return(0,l.Left)(new Error("[ContextModule] HttpTypedDataDataSource: Failed to fetch typed data informations"))}}convertCalldataPresenceFlag(e){switch(e){case"none":return u.TypedDataCalldataParamPresence.None;case"present":return u.TypedDataCalldataParamPresence.Present;case"verifying_contract":return u.TypedDataCalldataParamPresence.VerifyingContract;default:{const n=e;throw new Error(`Unhandled flag: ${n}`)}}}formatTrustedNameTypesAndSources(e){const n=e.name_types.length,o=e.name_sources.length,r=e.descriptor.slice((n+o)*2*-1,o*2*-1),s=e.descriptor.slice(o*2*-1),a=n.toString(16).padStart(2,"0"),c=o.toString(16).padStart(2,"0");return a+r+c+s}isInstructionFieldV1(e,n){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_path=="string"&&typeof e.signatures=="object"&&typeof e.signatures[n]=="string"}isInstructionFieldV2(e,n){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_path=="string"&&typeof e.signatures=="object"&&typeof e.signatures[n]=="string"&&typeof e.format=="string"&&["raw","datetime"].includes(e.format)&&e.coin_ref===void 0}isInstructionFieldV2WithCoinRef(e,n){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_path=="string"&&typeof e.signatures=="object"&&typeof e.signatures[n]=="string"&&typeof e.format=="string"&&["token","amount"].includes(e.format)&&typeof e.coin_ref=="number"}isInstructionFieldV2WithName(e,n){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_path=="string"&&typeof e.signatures=="object"&&typeof e.signatures[n]=="string"&&typeof e.format=="string"&&e.format==="trusted-name"&&e.coin_ref===void 0&&Array.isArray(e.name_types)&&Array.isArray(e.name_sources)&&e.name_types.every(o=>typeof o=="string")&&e.name_sources.every(o=>typeof o=="string")}isInstructionContractInfo(e,n){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_mappers_count=="number"&&typeof e.signatures=="object"&&typeof e.signatures[n]=="string"&&e.field_path===void 0}isInstructionCalldataInfo(e,n){return typeof e=="object"&&typeof e.type=="string"&&e.type==="calldata"&&typeof e.display_name=="string"&&typeof e.calldata_index=="number"&&typeof e.value_filter_flag=="boolean"&&typeof e.chain_id_filter_flag=="boolean"&&typeof e.selector_filter_flag=="boolean"&&typeof e.amount_filter_flag=="boolean"&&["none","present","verifying_contract"].includes(e.callee_filter_flag)&&["none","present","verifying_contract"].includes(e.spender_filter_flag)&&typeof e.signatures=="object"&&typeof e.signatures[n]=="string"}isInstructionFieldV2Calldata(e,n){return typeof e=="object"&&typeof e.display_name=="string"&&typeof e.field_path=="string"&&typeof e.signatures=="object"&&typeof e.signatures[n]=="string"&&typeof e.format=="string"&&["calldata-value","calldata-callee","calldata-chain-id","calldata-selector","calldata-amount","calldata-spender"].includes(e.format)&&typeof e.calldata_index=="number"}};d=F([(0,y.injectable)(),M(0,(0,y.inject)(D.configTypes.Config))],d);0&&(module.exports={HttpTypedDataDataSource});
2
2
  //# sourceMappingURL=HttpTypedDataDataSource.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/typed-data/data/HttpTypedDataDataSource.ts"],
4
- "sourcesContent": ["import axios from \"axios\";\nimport SHA224 from \"crypto-js/sha224\";\nimport { inject, injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport { configTypes } from \"@/config/di/configTypes\";\nimport type {\n ContextModuleCalMode,\n ContextModuleConfig,\n} from \"@/config/model/ContextModuleConfig\";\nimport {\n LEDGER_CLIENT_VERSION_HEADER,\n LEDGER_ORIGIN_TOKEN_HEADER,\n} from \"@/shared/constant/HttpHeaders\";\nimport type {\n TypedDataCalldataIndex,\n TypedDataFilter,\n TypedDataFilterCalldataInfo,\n TypedDataMessageInfo,\n} from \"@/shared/model/TypedDataClearSignContext\";\nimport { TypedDataCalldataParamPresence } from \"@/shared/model/TypedDataClearSignContext\";\nimport type { TypedDataSchema } from \"@/shared/model/TypedDataContext\";\nimport PACKAGE from \"@root/package.json\";\n\nimport type {\n FiltersDto,\n InstructionCalldataInfo,\n InstructionCalldataParamPresence,\n InstructionContractInfo,\n InstructionField,\n InstructionFieldV1,\n InstructionFieldV2,\n InstructionFieldV2Calldata,\n InstructionFieldV2WithCoinRef,\n InstructionFieldV2WithName,\n} from \"./FiltersDto\";\nimport {\n GetTypedDataFiltersParams,\n GetTypedDataFiltersResult,\n TypedDataDataSource,\n} from \"./TypedDataDataSource\";\n\n@injectable()\nexport class HttpTypedDataDataSource implements TypedDataDataSource {\n constructor(\n @inject(configTypes.Config) private readonly config: ContextModuleConfig,\n ) {}\n\n public async getTypedDataFilters({\n chainId,\n address,\n schema,\n version,\n }: GetTypedDataFiltersParams): Promise<\n Either<Error, GetTypedDataFiltersResult>\n > {\n let messageInfo: TypedDataMessageInfo | undefined = undefined;\n\n try {\n const response = await axios.request<FiltersDto[]>({\n method: \"GET\",\n url: `${this.config.cal.url}/dapps`,\n params: {\n contracts: address,\n chain_id: chainId,\n output: \"descriptors_eip712\",\n descriptors_eip712_version: version,\n descriptors_eip712: \"<set>\",\n ref: `branch:${this.config.cal.branch}`,\n },\n headers: {\n [LEDGER_CLIENT_VERSION_HEADER]: `context-module/${PACKAGE.version}`,\n [LEDGER_ORIGIN_TOKEN_HEADER]: this.config.originToken,\n },\n });\n\n // Try to get the filters JSON descriptor, from address and schema hash\n const schemaHash = SHA224(\n JSON.stringify(this.sortTypes(schema)).replace(\" \", \"\"),\n ).toString();\n address = address.toLowerCase();\n const dataArray = response.data ?? [];\n const filtersJson = dataArray\n .map((item) => item?.descriptors_eip712?.[address]?.[schemaHash])\n .find(Boolean);\n\n if (!filtersJson) {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: no typed data filters for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n\n // Parse the message type, if available\n if (!Array.isArray(filtersJson.instructions)) {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: no message info for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n\n // Parse all the filters\n const filters: TypedDataFilter[] = [];\n const calldatasInfos: Record<\n TypedDataCalldataIndex,\n TypedDataFilterCalldataInfo\n > = {};\n for (const field of filtersJson.instructions) {\n if (this.isInstructionContractInfo(field, this.config.cal.mode)) {\n messageInfo = {\n displayName: field.display_name,\n signature: field.signatures[this.config.cal.mode],\n filtersCount: field.field_mappers_count,\n };\n } else if (\n version === \"v1\" &&\n this.isInstructionFieldV1(field, this.config.cal.mode)\n ) {\n filters.push({\n type: \"raw\",\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n });\n } else if (this.isInstructionFieldV2(field, this.config.cal.mode)) {\n filters.push({\n type: field.format,\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n });\n } else if (\n this.isInstructionFieldV2WithCoinRef(field, this.config.cal.mode)\n ) {\n filters.push({\n type: field.format,\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n tokenIndex: field.coin_ref,\n });\n } else if (\n this.isInstructionFieldV2WithName(field, this.config.cal.mode)\n ) {\n filters.push({\n type: field.format,\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n types: field.name_types,\n sources: field.name_sources,\n typesAndSourcesPayload:\n this.formatTrustedNameTypesAndSources(field),\n });\n } else if (\n this.isInstructionCalldataInfo(field, this.config.cal.mode)\n ) {\n calldatasInfos[field.calldata_index] = {\n displayName: field.display_name,\n calldataIndex: field.calldata_index,\n valueFlag: field.value_filter_flag,\n calleeFlag: this.convertCalldataPresenceFlag(\n field.callee_filter_flag,\n ),\n amountFlag: field.amount_filter_flag,\n spenderFlag: this.convertCalldataPresenceFlag(\n field.spender_filter_flag,\n ),\n chainIdFlag: field.chain_id_filter_flag,\n selectorFlag: field.selector_filter_flag,\n signature: field.signatures[this.config.cal.mode],\n };\n } else if (\n this.isInstructionFieldV2Calldata(field, this.config.cal.mode)\n ) {\n filters.push({\n type: field.format,\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n calldataIndex: field.calldata_index,\n });\n } else {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: invalid typed data field for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n }\n\n if (!messageInfo) {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: no message info for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n\n return Right({ messageInfo, filters, calldatasInfos });\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpTypedDataDataSource: Failed to fetch typed data informations\",\n ),\n );\n }\n }\n\n private convertCalldataPresenceFlag(\n flag: InstructionCalldataParamPresence,\n ): TypedDataCalldataParamPresence {\n switch (flag) {\n case \"none\":\n return TypedDataCalldataParamPresence.None;\n case \"present\":\n return TypedDataCalldataParamPresence.Present;\n case \"verifying_contract\":\n return TypedDataCalldataParamPresence.VerifyingContract;\n default: {\n const uncoveredFlag: never = flag;\n throw new Error(`Unhandled flag: ${uncoveredFlag}`);\n }\n }\n }\n\n private formatTrustedNameTypesAndSources(\n field: InstructionFieldV2WithName,\n ): string {\n // Get number of types and sources\n const typesCount = field.name_types.length;\n const sourcesCount = field.name_sources.length;\n\n // Extract types and sources from the descriptor\n const types = field.descriptor.slice(\n (typesCount + sourcesCount) * 2 * -1,\n sourcesCount * 2 * -1,\n );\n const sources = field.descriptor.slice(sourcesCount * 2 * -1);\n\n // Convert counts into hex strings\n const typesCountHex = typesCount.toString(16).padStart(2, \"0\");\n const sourcesCountHex = sourcesCount.toString(16).padStart(2, \"0\");\n\n // Return the payload\n return typesCountHex + types + sourcesCountHex + sources;\n }\n\n private isInstructionFieldV1(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV1 & {\n signatures: { [_key in ContextModuleCalMode]: string };\n } {\n // NOTE: Currently the backend return the same structure for V1 and V2,\n // so we can't distinguish them here, but we can still check the required fields\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\"\n );\n }\n\n private isInstructionFieldV2(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV2 & {\n signatures: { [_key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n typeof data.format === \"string\" &&\n [\"raw\", \"datetime\"].includes(data.format) &&\n data.coin_ref === undefined\n );\n }\n\n private isInstructionFieldV2WithCoinRef(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV2WithCoinRef & {\n signatures: { [_key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n typeof data.format === \"string\" &&\n [\"token\", \"amount\"].includes(data.format) &&\n typeof data.coin_ref === \"number\"\n );\n }\n\n private isInstructionFieldV2WithName(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV2WithName & {\n signatures: { [_key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n typeof data.format === \"string\" &&\n data.format === \"trusted-name\" &&\n data.coin_ref === undefined &&\n Array.isArray(data.name_types) &&\n Array.isArray(data.name_sources) &&\n data.name_types.every((t) => typeof t === \"string\") &&\n data.name_sources.every((s) => typeof s === \"string\")\n );\n }\n\n private isInstructionContractInfo(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionContractInfo & {\n signatures: { [_key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_mappers_count === \"number\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n data.field_path === undefined\n );\n }\n\n private isInstructionCalldataInfo(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionCalldataInfo & {\n signatures: { [_key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.type === \"string\" &&\n data.type === \"calldata\" &&\n typeof data.display_name === \"string\" &&\n typeof data.calldata_index === \"number\" &&\n typeof data.value_filter_flag === \"boolean\" &&\n typeof data.chain_id_filter_flag === \"boolean\" &&\n typeof data.selector_filter_flag === \"boolean\" &&\n typeof data.amount_filter_flag === \"boolean\" &&\n [\"none\", \"present\", \"verifying_contract\"].includes(\n data.callee_filter_flag,\n ) &&\n [\"none\", \"present\", \"verifying_contract\"].includes(\n data.spender_filter_flag,\n ) &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\"\n );\n }\n\n private isInstructionFieldV2Calldata(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV2Calldata & {\n signatures: { [_key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n typeof data.format === \"string\" &&\n [\n \"calldata-value\",\n \"calldata-callee\",\n \"calldata-chain-id\",\n \"calldata-selector\",\n \"calldata-amount\",\n \"calldata-spender\",\n ].includes(data.format) &&\n typeof data.calldata_index === \"number\"\n );\n }\n\n private sortTypes(types: TypedDataSchema): TypedDataSchema {\n return Object.fromEntries(\n Object.entries(types)\n .sort(([aKey], [bKey]) => aKey.localeCompare(bKey))\n .map(([key, value]) => [\n key,\n value.map((v) => ({ name: v.name, type: v.type })),\n ]),\n );\n }\n}\n"],
5
- "mappings": "qtBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAkB,oBAClBC,EAAmB,+BACnBC,EAAmC,qBACnCC,EAAoC,qBAEpCC,EAA4B,mCAK5BC,EAGO,yCAOPC,EAA+C,oDAE/CC,EAAoB,iCAqBb,IAAMC,EAAN,KAA6D,CAClE,YAC+CC,EAC7C,CAD6C,YAAAA,CAC5C,CAEH,MAAa,oBAAoB,CAC/B,QAAAC,EACA,QAAAC,EACA,OAAAC,EACA,QAAAC,CACF,EAEE,CACA,IAAIC,EAEJ,GAAI,CACF,MAAMC,EAAW,MAAM,EAAAC,QAAM,QAAsB,CACjD,OAAQ,MACR,IAAK,GAAG,KAAK,OAAO,IAAI,GAAG,SAC3B,OAAQ,CACN,UAAWL,EACX,SAAUD,EACV,OAAQ,qBACR,2BAA4BG,EAC5B,mBAAoB,QACpB,IAAK,UAAU,KAAK,OAAO,IAAI,MAAM,EACvC,EACA,QAAS,CACP,CAAC,8BAA4B,EAAG,kBAAkB,EAAAI,QAAQ,OAAO,GACjE,CAAC,4BAA0B,EAAG,KAAK,OAAO,WAC5C,CACF,CAAC,EAGKC,KAAa,EAAAC,SACjB,KAAK,UAAU,KAAK,UAAUP,CAAM,CAAC,EAAE,QAAQ,IAAK,EAAE,CACxD,EAAE,SAAS,EACXD,EAAUA,EAAQ,YAAY,EAE9B,MAAMS,GADYL,EAAS,MAAQ,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,UAAUJ,EAAyC,CACzD,OAAO,OAAO,YACZ,OAAO,QAAQA,CAAK,EACjB,KAAK,CAAC,CAACQ,CAAI,EAAG,CAACC,CAAI,IAAMD,EAAK,cAAcC,CAAI,CAAC,EACjD,IAAI,CAAC,CAACC,EAAKC,CAAK,IAAM,CACrBD,EACAC,EAAM,IAAKC,IAAO,CAAE,KAAMA,EAAE,KAAM,KAAMA,EAAE,IAAK,EAAE,CACnD,CAAC,CACL,CACF,CACF,EAxWajC,EAANkC,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,cAAY,MAAM,IAFjBnC",
6
- "names": ["HttpTypedDataDataSource_exports", "__export", "HttpTypedDataDataSource", "__toCommonJS", "import_axios", "import_sha224", "import_inversify", "import_purify_ts", "import_configTypes", "import_HttpHeaders", "import_TypedDataClearSignContext", "import_package", "HttpTypedDataDataSource", "config", "chainId", "address", "schema", "version", "messageInfo", "response", "axios", "PACKAGE", "schemaHash", "SHA224", "filtersJson", "item", "filters", "calldatasInfos", "field", "flag", "uncoveredFlag", "typesCount", "sourcesCount", "types", "sources", "typesCountHex", "sourcesCountHex", "data", "mode", "t", "s", "aKey", "bKey", "key", "value", "v", "__decorateClass", "__decorateParam"]
4
+ "sourcesContent": ["import axios from \"axios\";\nimport { inject, injectable } from \"inversify\";\nimport { Either, Left, Right } from \"purify-ts\";\n\nimport { configTypes } from \"@/config/di/configTypes\";\nimport type {\n ContextModuleCalMode,\n ContextModuleConfig,\n} from \"@/config/model/ContextModuleConfig\";\nimport {\n LEDGER_CLIENT_VERSION_HEADER,\n LEDGER_ORIGIN_TOKEN_HEADER,\n} from \"@/shared/constant/HttpHeaders\";\nimport type {\n TypedDataCalldataIndex,\n TypedDataFilter,\n TypedDataFilterCalldataInfo,\n TypedDataMessageInfo,\n} from \"@/shared/model/TypedDataClearSignContext\";\nimport { TypedDataCalldataParamPresence } from \"@/shared/model/TypedDataClearSignContext\";\nimport { getSchemaHash } from \"@/typed-data/utils/getSchemaHash\";\nimport PACKAGE from \"@root/package.json\";\n\nimport type {\n FiltersDto,\n InstructionCalldataInfo,\n InstructionCalldataParamPresence,\n InstructionContractInfo,\n InstructionField,\n InstructionFieldV1,\n InstructionFieldV2,\n InstructionFieldV2Calldata,\n InstructionFieldV2WithCoinRef,\n InstructionFieldV2WithName,\n} from \"./FiltersDto\";\nimport {\n GetTypedDataFiltersParams,\n GetTypedDataFiltersResult,\n TypedDataDataSource,\n} from \"./TypedDataDataSource\";\n\n@injectable()\nexport class HttpTypedDataDataSource implements TypedDataDataSource {\n constructor(\n @inject(configTypes.Config) private readonly config: ContextModuleConfig,\n ) {}\n\n public async getTypedDataFilters({\n chainId,\n address,\n schema,\n version,\n }: GetTypedDataFiltersParams): Promise<\n Either<Error, GetTypedDataFiltersResult>\n > {\n let messageInfo: TypedDataMessageInfo | undefined = undefined;\n\n try {\n const response = await axios.request<FiltersDto[]>({\n method: \"GET\",\n url: `${this.config.cal.url}/dapps`,\n params: {\n contracts: address,\n chain_id: chainId,\n output: \"descriptors_eip712\",\n descriptors_eip712_version: version,\n descriptors_eip712: \"<set>\",\n ref: `branch:${this.config.cal.branch}`,\n },\n headers: {\n [LEDGER_CLIENT_VERSION_HEADER]: `context-module/${PACKAGE.version}`,\n [LEDGER_ORIGIN_TOKEN_HEADER]: this.config.originToken,\n },\n });\n\n // Try to get the filters JSON descriptor, from address and schema hash\n const schemaHash = getSchemaHash(schema);\n address = address.toLowerCase();\n const dataArray = response.data ?? [];\n const filtersJson = dataArray\n .map((item) => item?.descriptors_eip712?.[address]?.[schemaHash])\n .find(Boolean);\n\n if (!filtersJson) {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: no typed data filters for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n\n // Parse the message type, if available\n if (!Array.isArray(filtersJson.instructions)) {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: no message info for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n\n // Parse all the filters\n const filters: TypedDataFilter[] = [];\n const calldatasInfos: Record<\n TypedDataCalldataIndex,\n TypedDataFilterCalldataInfo\n > = {};\n for (const field of filtersJson.instructions) {\n if (this.isInstructionContractInfo(field, this.config.cal.mode)) {\n messageInfo = {\n displayName: field.display_name,\n signature: field.signatures[this.config.cal.mode],\n filtersCount: field.field_mappers_count,\n };\n } else if (\n version === \"v1\" &&\n this.isInstructionFieldV1(field, this.config.cal.mode)\n ) {\n filters.push({\n type: \"raw\",\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n });\n } else if (this.isInstructionFieldV2(field, this.config.cal.mode)) {\n filters.push({\n type: field.format,\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n });\n } else if (\n this.isInstructionFieldV2WithCoinRef(field, this.config.cal.mode)\n ) {\n filters.push({\n type: field.format,\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n tokenIndex: field.coin_ref,\n });\n } else if (\n this.isInstructionFieldV2WithName(field, this.config.cal.mode)\n ) {\n filters.push({\n type: field.format,\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n types: field.name_types,\n sources: field.name_sources,\n typesAndSourcesPayload:\n this.formatTrustedNameTypesAndSources(field),\n });\n } else if (\n this.isInstructionCalldataInfo(field, this.config.cal.mode)\n ) {\n calldatasInfos[field.calldata_index] = {\n displayName: field.display_name,\n calldataIndex: field.calldata_index,\n valueFlag: field.value_filter_flag,\n calleeFlag: this.convertCalldataPresenceFlag(\n field.callee_filter_flag,\n ),\n amountFlag: field.amount_filter_flag,\n spenderFlag: this.convertCalldataPresenceFlag(\n field.spender_filter_flag,\n ),\n chainIdFlag: field.chain_id_filter_flag,\n selectorFlag: field.selector_filter_flag,\n signature: field.signatures[this.config.cal.mode],\n };\n } else if (\n this.isInstructionFieldV2Calldata(field, this.config.cal.mode)\n ) {\n filters.push({\n type: field.format,\n displayName: field.display_name,\n path: field.field_path,\n signature: field.signatures[this.config.cal.mode],\n calldataIndex: field.calldata_index,\n });\n } else {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: invalid typed data field for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n }\n\n if (!messageInfo) {\n return Left(\n new Error(\n `[ContextModule] HttpTypedDataDataSource: no message info for address ${address} on chain ${chainId} for schema ${schemaHash}`,\n ),\n );\n }\n\n return Right({ messageInfo, filters, calldatasInfos });\n } catch (_error) {\n return Left(\n new Error(\n \"[ContextModule] HttpTypedDataDataSource: Failed to fetch typed data informations\",\n ),\n );\n }\n }\n\n private convertCalldataPresenceFlag(\n flag: InstructionCalldataParamPresence,\n ): TypedDataCalldataParamPresence {\n switch (flag) {\n case \"none\":\n return TypedDataCalldataParamPresence.None;\n case \"present\":\n return TypedDataCalldataParamPresence.Present;\n case \"verifying_contract\":\n return TypedDataCalldataParamPresence.VerifyingContract;\n default: {\n const uncoveredFlag: never = flag;\n throw new Error(`Unhandled flag: ${uncoveredFlag}`);\n }\n }\n }\n\n private formatTrustedNameTypesAndSources(\n field: InstructionFieldV2WithName,\n ): string {\n // Get number of types and sources\n const typesCount = field.name_types.length;\n const sourcesCount = field.name_sources.length;\n\n // Extract types and sources from the descriptor\n const types = field.descriptor.slice(\n (typesCount + sourcesCount) * 2 * -1,\n sourcesCount * 2 * -1,\n );\n const sources = field.descriptor.slice(sourcesCount * 2 * -1);\n\n // Convert counts into hex strings\n const typesCountHex = typesCount.toString(16).padStart(2, \"0\");\n const sourcesCountHex = sourcesCount.toString(16).padStart(2, \"0\");\n\n // Return the payload\n return typesCountHex + types + sourcesCountHex + sources;\n }\n\n private isInstructionFieldV1(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV1 & {\n signatures: { [_key in ContextModuleCalMode]: string };\n } {\n // NOTE: Currently the backend return the same structure for V1 and V2,\n // so we can't distinguish them here, but we can still check the required fields\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\"\n );\n }\n\n private isInstructionFieldV2(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV2 & {\n signatures: { [_key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n typeof data.format === \"string\" &&\n [\"raw\", \"datetime\"].includes(data.format) &&\n data.coin_ref === undefined\n );\n }\n\n private isInstructionFieldV2WithCoinRef(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV2WithCoinRef & {\n signatures: { [_key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n typeof data.format === \"string\" &&\n [\"token\", \"amount\"].includes(data.format) &&\n typeof data.coin_ref === \"number\"\n );\n }\n\n private isInstructionFieldV2WithName(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV2WithName & {\n signatures: { [_key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n typeof data.format === \"string\" &&\n data.format === \"trusted-name\" &&\n data.coin_ref === undefined &&\n Array.isArray(data.name_types) &&\n Array.isArray(data.name_sources) &&\n data.name_types.every((t) => typeof t === \"string\") &&\n data.name_sources.every((s) => typeof s === \"string\")\n );\n }\n\n private isInstructionContractInfo(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionContractInfo & {\n signatures: { [_key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_mappers_count === \"number\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n data.field_path === undefined\n );\n }\n\n private isInstructionCalldataInfo(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionCalldataInfo & {\n signatures: { [_key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.type === \"string\" &&\n data.type === \"calldata\" &&\n typeof data.display_name === \"string\" &&\n typeof data.calldata_index === \"number\" &&\n typeof data.value_filter_flag === \"boolean\" &&\n typeof data.chain_id_filter_flag === \"boolean\" &&\n typeof data.selector_filter_flag === \"boolean\" &&\n typeof data.amount_filter_flag === \"boolean\" &&\n [\"none\", \"present\", \"verifying_contract\"].includes(\n data.callee_filter_flag,\n ) &&\n [\"none\", \"present\", \"verifying_contract\"].includes(\n data.spender_filter_flag,\n ) &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\"\n );\n }\n\n private isInstructionFieldV2Calldata(\n data: InstructionField,\n mode: ContextModuleCalMode,\n ): data is InstructionFieldV2Calldata & {\n signatures: { [_key in ContextModuleCalMode]: string };\n } {\n return (\n typeof data === \"object\" &&\n typeof data.display_name === \"string\" &&\n typeof data.field_path === \"string\" &&\n typeof data.signatures === \"object\" &&\n typeof data.signatures[mode] === \"string\" &&\n typeof data.format === \"string\" &&\n [\n \"calldata-value\",\n \"calldata-callee\",\n \"calldata-chain-id\",\n \"calldata-selector\",\n \"calldata-amount\",\n \"calldata-spender\",\n ].includes(data.format) &&\n typeof data.calldata_index === \"number\"\n );\n }\n}\n"],
5
+ "mappings": "qtBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,6BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAkB,oBAClBC,EAAmC,qBACnCC,EAAoC,qBAEpCC,EAA4B,mCAK5BC,EAGO,yCAOPC,EAA+C,oDAC/CC,EAA8B,4CAC9BC,EAAoB,iCAqBb,IAAMC,EAAN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/B,OAAOA,EAAK,mBAAsB,WAClC,OAAOA,EAAK,sBAAyB,WACrC,OAAOA,EAAK,sBAAyB,WACrC,OAAOA,EAAK,oBAAuB,WACnC,CAAC,OAAQ,UAAW,oBAAoB,EAAE,SACxCA,EAAK,kBACP,GACA,CAAC,OAAQ,UAAW,oBAAoB,EAAE,SACxCA,EAAK,mBACP,GACA,OAAOA,EAAK,YAAe,UAC3B,OAAOA,EAAK,WAAWC,CAAI,GAAM,QAErC,CAEQ,6BACND,EACAC,EAGA,CACA,OACE,OAAOD,GAAS,UAChB,OAAOA,EAAK,cAAiB,UAC7B,OAAOA,EAAK,YAAe,UAC3B,OAAOA,EAAK,YAAe,UAC3B,OAAOA,EAAK,WAAWC,CAAI,GAAM,UACjC,OAAOD,EAAK,QAAW,UACvB,CACE,iBACA,kBACA,oBACA,oBACA,kBACA,kBACF,EAAE,SAASA,EAAK,MAAM,GACtB,OAAOA,EAAK,gBAAmB,QAEnC,CACF,EA3VaxB,EAAN4B,EAAA,IADN,cAAW,EAGPC,EAAA,eAAO,cAAY,MAAM,IAFjB7B",
6
+ "names": ["HttpTypedDataDataSource_exports", "__export", "HttpTypedDataDataSource", "__toCommonJS", "import_axios", "import_inversify", "import_purify_ts", "import_configTypes", "import_HttpHeaders", "import_TypedDataClearSignContext", "import_getSchemaHash", "import_package", "HttpTypedDataDataSource", "config", "chainId", "address", "schema", "version", "messageInfo", "response", "axios", "PACKAGE", "schemaHash", "filtersJson", "item", "filters", "calldatasInfos", "field", "flag", "uncoveredFlag", "typesCount", "sourcesCount", "types", "sources", "typesCountHex", "sourcesCountHex", "data", "mode", "t", "s", "__decorateClass", "__decorateParam"]
7
7
  }
@@ -0,0 +1,2 @@
1
+ "use strict";var p=Object.create;var o=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var S=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty;var y=(e,t)=>{for(var a in t)o(e,a,{get:t[a],enumerable:!0})},c=(e,t,a,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let m of s(t))!i.call(e,m)&&m!==a&&o(e,m,{get:()=>t[m],enumerable:!(r=h(t,m))||r.enumerable});return e};var d=(e,t,a)=>(a=e!=null?p(S(e)):{},c(t||!e||!e.__esModule?o(a,"default",{value:e,enumerable:!0}):a,e)),f=e=>c(o({},"__esModule",{value:!0}),e);var g={};y(g,{getSchemaHash:()=>T});module.exports=f(g);var n=d(require("crypto-js/sha224"));function D(e){return Object.fromEntries(Object.entries(e).sort(([t],[a])=>t.localeCompare(a)).map(([t,a])=>[t,a.map(r=>({name:r.name,type:r.type}))]))}function T(e){const t=D(e),a=JSON.stringify(t);return(0,n.default)(a).toString()}0&&(module.exports={getSchemaHash});
2
+ //# sourceMappingURL=getSchemaHash.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/typed-data/utils/getSchemaHash.ts"],
4
+ "sourcesContent": ["import SHA224 from \"crypto-js/sha224\";\n\nimport type { TypedDataSchema } from \"@/shared/model/TypedDataContext\";\n\n/**\n * Schema hash is the SHA-224 hex digest of the compact JSON UTF-8 representation\n * of the EIP-712 schema (types object), with keys sorted for deterministic output.\n */\nexport type SchemaHash = string;\n\n/**\n * Sorts the schema by type name and normalizes each type's fields to { name, type }\n * for deterministic JSON serialization.\n */\nfunction sortSchema(schema: TypedDataSchema): TypedDataSchema {\n return Object.fromEntries(\n Object.entries(schema)\n .sort(([aKey], [bKey]) => aKey.localeCompare(bKey))\n .map(([key, value]) => [\n key,\n value.map((v) => ({ name: v.name, type: v.type })),\n ]),\n );\n}\n\n/**\n * Computes the schema hash of an EIP-712 schema.\n * Schema hash is SHA-224 of the compact JSON UTF-8 encoded representation of the schema.\n */\nexport function getSchemaHash(schema: TypedDataSchema): SchemaHash {\n const sortedSchema = sortSchema(schema);\n const schemaStr = JSON.stringify(sortedSchema);\n return SHA224(schemaStr).toString();\n}\n"],
5
+ "mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,mBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAAmB,+BAcnB,SAASC,EAAWC,EAA0C,CAC5D,OAAO,OAAO,YACZ,OAAO,QAAQA,CAAM,EAClB,KAAK,CAAC,CAACC,CAAI,EAAG,CAACC,CAAI,IAAMD,EAAK,cAAcC,CAAI,CAAC,EACjD,IAAI,CAAC,CAACC,EAAKC,CAAK,IAAM,CACrBD,EACAC,EAAM,IAAKC,IAAO,CAAE,KAAMA,EAAE,KAAM,KAAMA,EAAE,IAAK,EAAE,CACnD,CAAC,CACL,CACF,CAMO,SAAST,EAAcI,EAAqC,CACjE,MAAMM,EAAeP,EAAWC,CAAM,EAChCO,EAAY,KAAK,UAAUD,CAAY,EAC7C,SAAO,EAAAE,SAAOD,CAAS,EAAE,SAAS,CACpC",
6
+ "names": ["getSchemaHash_exports", "__export", "getSchemaHash", "__toCommonJS", "import_sha224", "sortSchema", "schema", "aKey", "bKey", "key", "value", "v", "sortedSchema", "schemaStr", "SHA224"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";var e=require("vitest"),a=require("./getSchemaHash");(0,e.describe)("getSchemaHash",()=>{(0,e.it)("returns SHA-224 hex digest of compact sorted JSON",()=>{const n=(0,a.getSchemaHash)({Mail:[{name:"from",type:"Person"},{name:"to",type:"Person"},{name:"contents",type:"string"}],Person:[{name:"name",type:"string"},{name:"wallet",type:"address"}]});(0,e.expect)(n).toMatch(/^[a-f0-9]{56}$/),(0,e.expect)(typeof n).toBe("string")}),(0,e.it)("is deterministic: same schema yields same hash",()=>{const t={EIP712Domain:[{name:"name",type:"string"},{name:"chainId",type:"uint256"}],Mail:[{name:"subject",type:"string"}]};(0,e.expect)((0,a.getSchemaHash)(t)).toBe((0,a.getSchemaHash)(t))}),(0,e.it)("sorts schema by type name for canonical representation",()=>{const t={Mail:[{name:"x",type:"string"}],EIP712Domain:[{name:"y",type:"uint256"}]},n={EIP712Domain:[{name:"y",type:"uint256"}],Mail:[{name:"x",type:"string"}]};(0,e.expect)((0,a.getSchemaHash)(t)).toBe((0,a.getSchemaHash)(n))})});
2
+ //# sourceMappingURL=getSchemaHash.test.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../src/typed-data/utils/getSchemaHash.test.ts"],
4
+ "sourcesContent": ["import { describe, expect, it } from \"vitest\";\n\nimport type { TypedDataSchema } from \"@/shared/model/TypedDataContext\";\n\nimport { getSchemaHash } from \"./getSchemaHash\";\n\ndescribe(\"getSchemaHash\", () => {\n it(\"returns SHA-224 hex digest of compact sorted JSON\", () => {\n const schema: TypedDataSchema = {\n Mail: [\n { name: \"from\", type: \"Person\" },\n { name: \"to\", type: \"Person\" },\n { name: \"contents\", type: \"string\" },\n ],\n Person: [\n { name: \"name\", type: \"string\" },\n { name: \"wallet\", type: \"address\" },\n ],\n };\n const hash = getSchemaHash(schema);\n expect(hash).toMatch(/^[a-f0-9]{56}$/);\n expect(typeof hash).toBe(\"string\");\n });\n\n it(\"is deterministic: same schema yields same hash\", () => {\n const schema: TypedDataSchema = {\n EIP712Domain: [\n { name: \"name\", type: \"string\" },\n { name: \"chainId\", type: \"uint256\" },\n ],\n Mail: [{ name: \"subject\", type: \"string\" }],\n };\n expect(getSchemaHash(schema)).toBe(getSchemaHash(schema));\n });\n\n it(\"sorts schema by type name for canonical representation\", () => {\n const schemaA: TypedDataSchema = {\n Mail: [{ name: \"x\", type: \"string\" }],\n EIP712Domain: [{ name: \"y\", type: \"uint256\" }],\n };\n const schemaB: TypedDataSchema = {\n EIP712Domain: [{ name: \"y\", type: \"uint256\" }],\n Mail: [{ name: \"x\", type: \"string\" }],\n };\n expect(getSchemaHash(schemaA)).toBe(getSchemaHash(schemaB));\n });\n});\n"],
5
+ "mappings": "aAAA,IAAAA,EAAqC,kBAIrCC,EAA8B,8BAE9B,YAAS,gBAAiB,IAAM,IAC9B,MAAG,oDAAqD,IAAM,CAY5D,MAAMC,KAAO,iBAXmB,CAC9B,KAAM,CACJ,CAAE,KAAM,OAAQ,KAAM,QAAS,EAC/B,CAAE,KAAM,KAAM,KAAM,QAAS,EAC7B,CAAE,KAAM,WAAY,KAAM,QAAS,CACrC,EACA,OAAQ,CACN,CAAE,KAAM,OAAQ,KAAM,QAAS,EAC/B,CAAE,KAAM,SAAU,KAAM,SAAU,CACpC,CACF,CACiC,KACjC,UAAOA,CAAI,EAAE,QAAQ,gBAAgB,KACrC,UAAO,OAAOA,CAAI,EAAE,KAAK,QAAQ,CACnC,CAAC,KAED,MAAG,iDAAkD,IAAM,CACzD,MAAMC,EAA0B,CAC9B,aAAc,CACZ,CAAE,KAAM,OAAQ,KAAM,QAAS,EAC/B,CAAE,KAAM,UAAW,KAAM,SAAU,CACrC,EACA,KAAM,CAAC,CAAE,KAAM,UAAW,KAAM,QAAS,CAAC,CAC5C,KACA,aAAO,iBAAcA,CAAM,CAAC,EAAE,QAAK,iBAAcA,CAAM,CAAC,CAC1D,CAAC,KAED,MAAG,yDAA0D,IAAM,CACjE,MAAMC,EAA2B,CAC/B,KAAM,CAAC,CAAE,KAAM,IAAK,KAAM,QAAS,CAAC,EACpC,aAAc,CAAC,CAAE,KAAM,IAAK,KAAM,SAAU,CAAC,CAC/C,EACMC,EAA2B,CAC/B,aAAc,CAAC,CAAE,KAAM,IAAK,KAAM,SAAU,CAAC,EAC7C,KAAM,CAAC,CAAE,KAAM,IAAK,KAAM,QAAS,CAAC,CACtC,KACA,aAAO,iBAAcD,CAAO,CAAC,EAAE,QAAK,iBAAcC,CAAO,CAAC,CAC5D,CAAC,CACH,CAAC",
6
+ "names": ["import_vitest", "import_getSchemaHash", "hash", "schema", "schemaA", "schemaB"]
7
+ }
@@ -58,5 +58,5 @@
58
58
  "watch:builds": "pnpm ldmk-tool watch --entryPoints index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
59
59
  "watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
60
60
  },
61
- "version": "0.0.0-develop-20260224001409"
61
+ "version": "0.0.0-develop-20260228001144"
62
62
  }
@@ -1,2 +1,2 @@
1
- import{Left as C}from"purify-ts";import{calldataTypes as x}from"./calldata/di/calldataTypes";import{dynamicNetworkTypes as m}from"./dynamic-network/di/dynamicNetworkTypes";import{trustedNameTypes as i}from"./trusted-name/di/trustedNameTypes";import{externalPluginTypes as L}from"./external-plugin/di/externalPluginTypes";import{nftTypes as s}from"./nft/di/nftTypes";import{proxyTypes as y}from"./proxy/di/proxyTypes";import{safeTypes as c}from"./safe/di/safeTypes";import{ClearSignContextType as n}from"./shared/model/ClearSignContext";import{solanaContextTypes as f}from"./solana/di/solanaContextTypes";import{tokenTypes as l}from"./token/di/tokenTypes";import{transactionCheckTypes as p}from"./transaction-check/di/transactionCheckTypes";import{typedDataTypes as u}from"./typed-data/di/typedDataTypes";import{makeContainer as T}from"./di";class ${_container;_loaders;_typedDataLoader;_solanaLoader;_fieldLoaders;constructor(t){this._container=T({config:t}),this._loaders=t.defaultLoaders?this._getDefaultLoaders():[],this._loaders.push(...t.customLoaders),this._fieldLoaders=t.defaultFieldLoaders?this._getDefaultFieldLoaders():[],this._fieldLoaders.push(...t.customFieldLoaders),this._typedDataLoader=t.customTypedDataLoader??this._getDefaultTypedDataLoader(),this._solanaLoader=t.customSolanaLoader??this._getSolanaLoader()}_getDefaultFieldLoaders(){return[this._container.get(s.NftContextFieldLoader),this._container.get(l.TokenContextFieldLoader),this._container.get(i.TrustedNameContextFieldLoader),this._container.get(y.ProxyContextFieldLoader)]}_getDefaultLoaders(){return[this._container.get(L.ExternalPluginContextLoader),this._container.get(i.TrustedNameContextLoader),this._container.get(s.NftContextLoader),this._container.get(l.TokenContextLoader),this._container.get(x.CalldataContextLoader),this._container.get(m.DynamicNetworkContextLoader),this._container.get(c.SafeAddressLoader),this._container.get(p.TransactionCheckContextLoader),this._container.get(p.TypedDataCheckContextLoader)]}_getDefaultTypedDataLoader(){return this._container.get(u.TypedDataContextLoader)}_getSolanaLoader(){try{return this._container.get(f.SolanaContextLoader)}catch{return{load:async t=>C(new Error("[ContextModule] - DefaultContextModule: no SolanaContextLoader bound"))}}}async getContexts(t,e){const o=Object.values(n),r=this._loaders.filter(d=>d.canHandle(t,e??o)).map(d=>d.load(t));return(await Promise.all(r)).flat()}async getFieldContext(t,e){const o=this._fieldLoaders.filter(a=>a.canHandle(t,e));if(o.length===0)return Promise.resolve({type:n.ERROR,error:new Error(`Loader not found for field: ${t} and expected type: ${e}`)});for(const a of o){const r=await a.loadField(t);if(r.type!==n.ERROR)return r}return{type:n.ERROR,error:new Error(`Loader not found for field: ${t} and expected type: ${e}`)}}async getTypedDataFilters(t){return this._typedDataLoader.load(t)}async getSolanaContext(t){return await this._solanaLoader.load(t)}}export{$ as DefaultContextModule};
1
+ import{Left as x}from"purify-ts";import{calldataTypes as m}from"./calldata/di/calldataTypes";import{dynamicNetworkTypes as L}from"./dynamic-network/di/dynamicNetworkTypes";import{trustedNameTypes as i}from"./trusted-name/di/trustedNameTypes";import{externalPluginTypes as y}from"./external-plugin/di/externalPluginTypes";import{gatedSigningTypes as s}from"./gated-signing/di/gatedSigningTypes";import{nftTypes as l}from"./nft/di/nftTypes";import{proxyTypes as c}from"./proxy/di/proxyTypes";import{safeTypes as f}from"./safe/di/safeTypes";import{ClearSignContextType as n}from"./shared/model/ClearSignContext";import{solanaContextTypes as u}from"./solana/di/solanaContextTypes";import{tokenTypes as p}from"./token/di/tokenTypes";import{transactionCheckTypes as C}from"./transaction-check/di/transactionCheckTypes";import{typedDataTypes as g}from"./typed-data/di/typedDataTypes";import{makeContainer as T}from"./di";class H{_container;_loaders;_typedDataLoader;_solanaLoader;_fieldLoaders;constructor(t){this._container=T({config:t}),this._loaders=t.defaultLoaders?this._getDefaultLoaders():[],this._loaders.push(...t.customLoaders),this._fieldLoaders=t.defaultFieldLoaders?this._getDefaultFieldLoaders():[],this._fieldLoaders.push(...t.customFieldLoaders),this._typedDataLoader=t.customTypedDataLoader??this._getDefaultTypedDataLoader(),this._solanaLoader=t.customSolanaLoader??this._getSolanaLoader()}_getDefaultFieldLoaders(){return[this._container.get(l.NftContextFieldLoader),this._container.get(p.TokenContextFieldLoader),this._container.get(i.TrustedNameContextFieldLoader),this._container.get(c.ProxyContextFieldLoader)]}_getDefaultLoaders(){return[this._container.get(y.ExternalPluginContextLoader),this._container.get(i.TrustedNameContextLoader),this._container.get(l.NftContextLoader),this._container.get(p.TokenContextLoader),this._container.get(m.CalldataContextLoader),this._container.get(L.DynamicNetworkContextLoader),this._container.get(f.SafeAddressLoader),this._container.get(s.GatedSigningContextLoader),this._container.get(s.GatedSigningTypedDataContextLoader),this._container.get(C.TransactionCheckContextLoader),this._container.get(C.TypedDataCheckContextLoader)]}_getDefaultTypedDataLoader(){return this._container.get(g.TypedDataContextLoader)}_getSolanaLoader(){try{return this._container.get(u.SolanaContextLoader)}catch{return{load:async t=>x(new Error("[ContextModule] - DefaultContextModule: no SolanaContextLoader bound"))}}}async getContexts(t,e){const o=Object.values(n),r=this._loaders.filter(d=>d.canHandle(t,e??o)).map(d=>d.load(t));return(await Promise.all(r)).flat()}async getFieldContext(t,e){const o=this._fieldLoaders.filter(a=>a.canHandle(t,e));if(o.length===0)return Promise.resolve({type:n.ERROR,error:new Error(`Loader not found for field: ${t} and expected type: ${e}`)});for(const a of o){const r=await a.loadField(t);if(r.type!==n.ERROR)return r}return{type:n.ERROR,error:new Error(`Loader not found for field: ${t} and expected type: ${e}`)}}async getTypedDataFilters(t){return this._typedDataLoader.load(t)}async getSolanaContext(t){return await this._solanaLoader.load(t)}}export{H as DefaultContextModule};
2
2
  //# sourceMappingURL=DefaultContextModule.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/DefaultContextModule.ts"],
4
- "sourcesContent": ["import { type Container } from \"inversify\";\nimport { Left } from \"purify-ts\";\n\nimport { calldataTypes } from \"@/calldata/di/calldataTypes\";\nimport { dynamicNetworkTypes } from \"@/dynamic-network/di/dynamicNetworkTypes\";\nimport type { TypedDataClearSignContext } from \"@/shared/model/TypedDataClearSignContext\";\nimport type { TypedDataContext } from \"@/shared/model/TypedDataContext\";\nimport { trustedNameTypes } from \"@/trusted-name/di/trustedNameTypes\";\n\nimport { type ContextModuleConfig } from \"./config/model/ContextModuleConfig\";\nimport { externalPluginTypes } from \"./external-plugin/di/externalPluginTypes\";\nimport { nftTypes } from \"./nft/di/nftTypes\";\nimport { proxyTypes } from \"./proxy/di/proxyTypes\";\nimport { safeTypes } from \"./safe/di/safeTypes\";\nimport { type ContextFieldLoader } from \"./shared/domain/ContextFieldLoader\";\nimport { type ContextLoader } from \"./shared/domain/ContextLoader\";\nimport {\n type ClearSignContext,\n ClearSignContextType,\n} from \"./shared/model/ClearSignContext\";\nimport { type SolanaTransactionContext } from \"./shared/model/SolanaTransactionContext\";\nimport { solanaContextTypes } from \"./solana/di/solanaContextTypes\";\nimport { type SolanaContextLoader } from \"./solana/domain/SolanaContextLoader\";\nimport { type SolanaTransactionContextResult } from \"./solana/domain/solanaContextTypes\";\nimport { tokenTypes } from \"./token/di/tokenTypes\";\nimport { transactionCheckTypes } from \"./transaction-check/di/transactionCheckTypes\";\nimport { typedDataTypes } from \"./typed-data/di/typedDataTypes\";\nimport type { TypedDataContextLoader } from \"./typed-data/domain/TypedDataContextLoader\";\nimport { type ContextModule } from \"./ContextModule\";\nimport { makeContainer } from \"./di\";\n\nexport class DefaultContextModule implements ContextModule {\n private _container: Container;\n private _loaders: ContextLoader<unknown>[];\n private _typedDataLoader: TypedDataContextLoader;\n private _solanaLoader: SolanaContextLoader;\n private _fieldLoaders: ContextFieldLoader<unknown>[];\n\n constructor(args: ContextModuleConfig) {\n this._container = makeContainer({ config: args });\n\n this._loaders = args.defaultLoaders ? this._getDefaultLoaders() : [];\n this._loaders.push(...args.customLoaders);\n\n this._fieldLoaders = args.defaultFieldLoaders\n ? this._getDefaultFieldLoaders()\n : [];\n this._fieldLoaders.push(...args.customFieldLoaders);\n\n this._typedDataLoader =\n args.customTypedDataLoader ?? this._getDefaultTypedDataLoader();\n this._solanaLoader = args.customSolanaLoader ?? this._getSolanaLoader();\n }\n\n private _getDefaultFieldLoaders(): ContextFieldLoader[] {\n return [\n this._container.get<ContextFieldLoader>(nftTypes.NftContextFieldLoader),\n this._container.get<ContextFieldLoader>(\n tokenTypes.TokenContextFieldLoader,\n ),\n this._container.get<ContextFieldLoader>(\n trustedNameTypes.TrustedNameContextFieldLoader,\n ),\n this._container.get<ContextFieldLoader>(\n proxyTypes.ProxyContextFieldLoader,\n ),\n ];\n }\n\n private _getDefaultLoaders(): ContextLoader<unknown>[] {\n return [\n this._container.get<ContextLoader>(\n externalPluginTypes.ExternalPluginContextLoader,\n ),\n this._container.get<ContextLoader>(\n trustedNameTypes.TrustedNameContextLoader,\n ),\n this._container.get<ContextLoader>(nftTypes.NftContextLoader),\n this._container.get<ContextLoader>(tokenTypes.TokenContextLoader),\n this._container.get<ContextLoader>(calldataTypes.CalldataContextLoader),\n this._container.get<ContextLoader>(\n dynamicNetworkTypes.DynamicNetworkContextLoader,\n ),\n this._container.get<ContextLoader>(safeTypes.SafeAddressLoader),\n this._container.get<ContextLoader>(\n transactionCheckTypes.TransactionCheckContextLoader,\n ),\n this._container.get<ContextLoader>(\n transactionCheckTypes.TypedDataCheckContextLoader,\n ),\n ];\n }\n\n private _getDefaultTypedDataLoader(): TypedDataContextLoader {\n return this._container.get<TypedDataContextLoader>(\n typedDataTypes.TypedDataContextLoader,\n );\n }\n\n private _getSolanaLoader(): SolanaContextLoader {\n try {\n return this._container.get<SolanaContextLoader>(\n solanaContextTypes.SolanaContextLoader,\n );\n } catch {\n return {\n load: async (_ctx) =>\n Left(\n new Error(\n \"[ContextModule] - DefaultContextModule: no SolanaContextLoader bound\",\n ),\n ),\n };\n }\n }\n\n public async getContexts(\n input: unknown,\n expectedTypes?: ClearSignContextType[],\n ): Promise<ClearSignContext[]> {\n const allContextTypes = Object.values(ClearSignContextType);\n const loaders = this._loaders.filter((l) =>\n l.canHandle(input, expectedTypes ?? allContextTypes),\n );\n const promises = loaders.map((fetcher) => fetcher.load(input));\n const responses = await Promise.all(promises);\n return responses.flat();\n }\n\n public async getFieldContext<TInput>(\n field: TInput,\n expectedType: ClearSignContextType,\n ): Promise<ClearSignContext> {\n const loaders = this._fieldLoaders.filter((l) =>\n l.canHandle(field, expectedType),\n );\n if (loaders.length === 0) {\n return Promise.resolve({\n type: ClearSignContextType.ERROR,\n error: new Error(\n `Loader not found for field: ${field} and expected type: ${expectedType}`,\n ),\n });\n }\n\n for (const loader of loaders) {\n const context = await loader.loadField(field);\n if (context.type !== ClearSignContextType.ERROR) {\n return context;\n }\n }\n\n return {\n type: ClearSignContextType.ERROR,\n error: new Error(\n `Loader not found for field: ${field} and expected type: ${expectedType}`,\n ),\n };\n }\n\n public async getTypedDataFilters(\n typedData: TypedDataContext,\n ): Promise<TypedDataClearSignContext> {\n return this._typedDataLoader.load(typedData);\n }\n\n public async getSolanaContext(\n transactionContext: SolanaTransactionContext,\n ): Promise<SolanaTransactionContextResult> {\n return await this._solanaLoader.load(transactionContext);\n }\n}\n"],
5
- "mappings": "AACA,OAAS,QAAAA,MAAY,YAErB,OAAS,iBAAAC,MAAqB,8BAC9B,OAAS,uBAAAC,MAA2B,2CAGpC,OAAS,oBAAAC,MAAwB,qCAGjC,OAAS,uBAAAC,MAA2B,2CACpC,OAAS,YAAAC,MAAgB,oBACzB,OAAS,cAAAC,MAAkB,wBAC3B,OAAS,aAAAC,MAAiB,sBAG1B,OAEE,wBAAAC,MACK,kCAEP,OAAS,sBAAAC,MAA0B,iCAGnC,OAAS,cAAAC,MAAkB,wBAC3B,OAAS,yBAAAC,MAA6B,+CACtC,OAAS,kBAAAC,MAAsB,iCAG/B,OAAS,iBAAAC,MAAqB,OAEvB,MAAMC,CAA8C,CACjD,WACA,SACA,iBACA,cACA,cAER,YAAYC,EAA2B,CACrC,KAAK,WAAaF,EAAc,CAAE,OAAQ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,OAAQC,GACpCA,EAAE,UAAUJ,EAAOC,GAAiBC,CAAe,CACrD,EACyB,IAAKG,GAAYA,EAAQ,KAAKL,CAAK,CAAC,EAE7D,OADkB,MAAM,QAAQ,IAAIG,CAAQ,GAC3B,KAAK,CACxB,CAEA,MAAa,gBACXG,EACAC,EAC2B,CAC3B,MAAMC,EAAU,KAAK,cAAc,OAAQJ,GACzCA,EAAE,UAAUE,EAAOC,CAAY,CACjC,EACA,GAAIC,EAAQ,SAAW,EACrB,OAAO,QAAQ,QAAQ,CACrB,KAAMjB,EAAqB,MAC3B,MAAO,IAAI,MACT,+BAA+Be,CAAK,uBAAuBC,CAAY,EACzE,CACF,CAAC,EAGH,UAAWE,KAAUD,EAAS,CAC5B,MAAME,EAAU,MAAMD,EAAO,UAAUH,CAAK,EAC5C,GAAII,EAAQ,OAASnB,EAAqB,MACxC,OAAOmB,CAEX,CAEA,MAAO,CACL,KAAMnB,EAAqB,MAC3B,MAAO,IAAI,MACT,+BAA+Be,CAAK,uBAAuBC,CAAY,EACzE,CACF,CACF,CAEA,MAAa,oBACXI,EACoC,CACpC,OAAO,KAAK,iBAAiB,KAAKA,CAAS,CAC7C,CAEA,MAAa,iBACXC,EACyC,CACzC,OAAO,MAAM,KAAK,cAAc,KAAKA,CAAkB,CACzD,CACF",
6
- "names": ["Left", "calldataTypes", "dynamicNetworkTypes", "trustedNameTypes", "externalPluginTypes", "nftTypes", "proxyTypes", "safeTypes", "ClearSignContextType", "solanaContextTypes", "tokenTypes", "transactionCheckTypes", "typedDataTypes", "makeContainer", "DefaultContextModule", "args", "_ctx", "input", "expectedTypes", "allContextTypes", "promises", "l", "fetcher", "field", "expectedType", "loaders", "loader", "context", "typedData", "transactionContext"]
4
+ "sourcesContent": ["import { type Container } from \"inversify\";\nimport { Left } from \"purify-ts\";\n\nimport { calldataTypes } from \"@/calldata/di/calldataTypes\";\nimport { dynamicNetworkTypes } from \"@/dynamic-network/di/dynamicNetworkTypes\";\nimport type { TypedDataClearSignContext } from \"@/shared/model/TypedDataClearSignContext\";\nimport type { TypedDataContext } from \"@/shared/model/TypedDataContext\";\nimport { trustedNameTypes } from \"@/trusted-name/di/trustedNameTypes\";\n\nimport { type ContextModuleConfig } from \"./config/model/ContextModuleConfig\";\nimport { externalPluginTypes } from \"./external-plugin/di/externalPluginTypes\";\nimport { gatedSigningTypes } from \"./gated-signing/di/gatedSigningTypes\";\nimport { nftTypes } from \"./nft/di/nftTypes\";\nimport { proxyTypes } from \"./proxy/di/proxyTypes\";\nimport { safeTypes } from \"./safe/di/safeTypes\";\nimport { type ContextFieldLoader } from \"./shared/domain/ContextFieldLoader\";\nimport { type ContextLoader } from \"./shared/domain/ContextLoader\";\nimport {\n type ClearSignContext,\n ClearSignContextType,\n} from \"./shared/model/ClearSignContext\";\nimport { type SolanaTransactionContext } from \"./shared/model/SolanaTransactionContext\";\nimport { solanaContextTypes } from \"./solana/di/solanaContextTypes\";\nimport { type SolanaContextLoader } from \"./solana/domain/SolanaContextLoader\";\nimport { type SolanaTransactionContextResult } from \"./solana/domain/solanaContextTypes\";\nimport { tokenTypes } from \"./token/di/tokenTypes\";\nimport { transactionCheckTypes } from \"./transaction-check/di/transactionCheckTypes\";\nimport { typedDataTypes } from \"./typed-data/di/typedDataTypes\";\nimport type { TypedDataContextLoader } from \"./typed-data/domain/TypedDataContextLoader\";\nimport { type ContextModule } from \"./ContextModule\";\nimport { makeContainer } from \"./di\";\n\nexport class DefaultContextModule implements ContextModule {\n private _container: Container;\n private _loaders: ContextLoader<unknown>[];\n private _typedDataLoader: TypedDataContextLoader;\n private _solanaLoader: SolanaContextLoader;\n private _fieldLoaders: ContextFieldLoader<unknown>[];\n\n constructor(args: ContextModuleConfig) {\n this._container = makeContainer({ config: args });\n\n this._loaders = args.defaultLoaders ? this._getDefaultLoaders() : [];\n this._loaders.push(...args.customLoaders);\n\n this._fieldLoaders = args.defaultFieldLoaders\n ? this._getDefaultFieldLoaders()\n : [];\n this._fieldLoaders.push(...args.customFieldLoaders);\n\n this._typedDataLoader =\n args.customTypedDataLoader ?? this._getDefaultTypedDataLoader();\n this._solanaLoader = args.customSolanaLoader ?? this._getSolanaLoader();\n }\n\n private _getDefaultFieldLoaders(): ContextFieldLoader[] {\n return [\n this._container.get<ContextFieldLoader>(nftTypes.NftContextFieldLoader),\n this._container.get<ContextFieldLoader>(\n tokenTypes.TokenContextFieldLoader,\n ),\n this._container.get<ContextFieldLoader>(\n trustedNameTypes.TrustedNameContextFieldLoader,\n ),\n this._container.get<ContextFieldLoader>(\n proxyTypes.ProxyContextFieldLoader,\n ),\n ];\n }\n\n private _getDefaultLoaders(): ContextLoader<unknown>[] {\n return [\n this._container.get<ContextLoader>(\n externalPluginTypes.ExternalPluginContextLoader,\n ),\n this._container.get<ContextLoader>(\n trustedNameTypes.TrustedNameContextLoader,\n ),\n this._container.get<ContextLoader>(nftTypes.NftContextLoader),\n this._container.get<ContextLoader>(tokenTypes.TokenContextLoader),\n this._container.get<ContextLoader>(calldataTypes.CalldataContextLoader),\n this._container.get<ContextLoader>(\n dynamicNetworkTypes.DynamicNetworkContextLoader,\n ),\n this._container.get<ContextLoader>(safeTypes.SafeAddressLoader),\n this._container.get<ContextLoader>(\n gatedSigningTypes.GatedSigningContextLoader,\n ),\n this._container.get<ContextLoader>(\n gatedSigningTypes.GatedSigningTypedDataContextLoader,\n ),\n this._container.get<ContextLoader>(\n transactionCheckTypes.TransactionCheckContextLoader,\n ),\n this._container.get<ContextLoader>(\n transactionCheckTypes.TypedDataCheckContextLoader,\n ),\n ];\n }\n\n private _getDefaultTypedDataLoader(): TypedDataContextLoader {\n return this._container.get<TypedDataContextLoader>(\n typedDataTypes.TypedDataContextLoader,\n );\n }\n\n private _getSolanaLoader(): SolanaContextLoader {\n try {\n return this._container.get<SolanaContextLoader>(\n solanaContextTypes.SolanaContextLoader,\n );\n } catch {\n return {\n load: async (_ctx) =>\n Left(\n new Error(\n \"[ContextModule] - DefaultContextModule: no SolanaContextLoader bound\",\n ),\n ),\n };\n }\n }\n\n public async getContexts(\n input: unknown,\n expectedTypes?: ClearSignContextType[],\n ): Promise<ClearSignContext[]> {\n const allContextTypes = Object.values(ClearSignContextType);\n const loaders = this._loaders.filter((l) =>\n l.canHandle(input, expectedTypes ?? allContextTypes),\n );\n const promises = loaders.map((fetcher) => fetcher.load(input));\n const responses = await Promise.all(promises);\n return responses.flat();\n }\n\n public async getFieldContext<TInput>(\n field: TInput,\n expectedType: ClearSignContextType,\n ): Promise<ClearSignContext> {\n const loaders = this._fieldLoaders.filter((l) =>\n l.canHandle(field, expectedType),\n );\n if (loaders.length === 0) {\n return Promise.resolve({\n type: ClearSignContextType.ERROR,\n error: new Error(\n `Loader not found for field: ${field} and expected type: ${expectedType}`,\n ),\n });\n }\n\n for (const loader of loaders) {\n const context = await loader.loadField(field);\n if (context.type !== ClearSignContextType.ERROR) {\n return context;\n }\n }\n\n return {\n type: ClearSignContextType.ERROR,\n error: new Error(\n `Loader not found for field: ${field} and expected type: ${expectedType}`,\n ),\n };\n }\n\n public async getTypedDataFilters(\n typedData: TypedDataContext,\n ): Promise<TypedDataClearSignContext> {\n return this._typedDataLoader.load(typedData);\n }\n\n public async getSolanaContext(\n transactionContext: SolanaTransactionContext,\n ): Promise<SolanaTransactionContextResult> {\n return await this._solanaLoader.load(transactionContext);\n }\n}\n"],
5
+ "mappings": "AACA,OAAS,QAAAA,MAAY,YAErB,OAAS,iBAAAC,MAAqB,8BAC9B,OAAS,uBAAAC,MAA2B,2CAGpC,OAAS,oBAAAC,MAAwB,qCAGjC,OAAS,uBAAAC,MAA2B,2CACpC,OAAS,qBAAAC,MAAyB,uCAClC,OAAS,YAAAC,MAAgB,oBACzB,OAAS,cAAAC,MAAkB,wBAC3B,OAAS,aAAAC,MAAiB,sBAG1B,OAEE,wBAAAC,MACK,kCAEP,OAAS,sBAAAC,MAA0B,iCAGnC,OAAS,cAAAC,MAAkB,wBAC3B,OAAS,yBAAAC,MAA6B,+CACtC,OAAS,kBAAAC,MA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,IACrBH,EAAmB,mBACrB,CACF,MAAQ,CACN,MAAO,CACL,KAAM,MAAOO,GACXjB,EACE,IAAI,MACF,sEACF,CACF,CACJ,CACF,CACF,CAEA,MAAa,YACXkB,EACAC,EAC6B,CAC7B,MAAMC,EAAkB,OAAO,OAAOX,CAAoB,EAIpDY,EAHU,KAAK,SAAS,OAAQC,GACpCA,EAAE,UAAUJ,EAAOC,GAAiBC,CAAe,CACrD,EACyB,IAAKG,GAAYA,EAAQ,KAAKL,CAAK,CAAC,EAE7D,OADkB,MAAM,QAAQ,IAAIG,CAAQ,GAC3B,KAAK,CACxB,CAEA,MAAa,gBACXG,EACAC,EAC2B,CAC3B,MAAMC,EAAU,KAAK,cAAc,OAAQJ,GACzCA,EAAE,UAAUE,EAAOC,CAAY,CACjC,EACA,GAAIC,EAAQ,SAAW,EACrB,OAAO,QAAQ,QAAQ,CACrB,KAAMjB,EAAqB,MAC3B,MAAO,IAAI,MACT,+BAA+Be,CAAK,uBAAuBC,CAAY,EACzE,CACF,CAAC,EAGH,UAAWE,KAAUD,EAAS,CAC5B,MAAME,EAAU,MAAMD,EAAO,UAAUH,CAAK,EAC5C,GAAII,EAAQ,OAASnB,EAAqB,MACxC,OAAOmB,CAEX,CAEA,MAAO,CACL,KAAMnB,EAAqB,MAC3B,MAAO,IAAI,MACT,+BAA+Be,CAAK,uBAAuBC,CAAY,EACzE,CACF,CACF,CAEA,MAAa,oBACXI,EACoC,CACpC,OAAO,KAAK,iBAAiB,KAAKA,CAAS,CAC7C,CAEA,MAAa,iBACXC,EACyC,CACzC,OAAO,MAAM,KAAK,cAAc,KAAKA,CAAkB,CACzD,CACF",
6
+ "names": ["Left", "calldataTypes", "dynamicNetworkTypes", "trustedNameTypes", "externalPluginTypes", "gatedSigningTypes", "nftTypes", "proxyTypes", "safeTypes", "ClearSignContextType", "solanaContextTypes", "tokenTypes", "transactionCheckTypes", "typedDataTypes", "makeContainer", "DefaultContextModule", "args", "_ctx", "input", "expectedTypes", "allContextTypes", "promises", "l", "fetcher", "field", "expectedType", "loaders", "loader", "context", "typedData", "transactionContext"]
7
7
  }
package/lib/esm/src/di.js CHANGED
@@ -1,2 +1,2 @@
1
- import{Container as t}from"inversify";import{calldataModuleFactory as e}from"./calldata/di/calldataModuleFactory";import{configModuleFactory as a}from"./config/di/configModuleFactory";import{configTypes as m}from"./config/di/configTypes";import{dynamicNetworkModuleFactory as i}from"./dynamic-network/di/dynamicNetworkModuleFactory";import{externalPluginModuleFactory as n}from"./external-plugin/di/externalPluginModuleFactory";import{nftModuleFactory as l}from"./nft/di/nftModuleFactory";import{nanoPkiModuleFactory as c}from"./pki/di/pkiModuleFactory";import{proxyModuleFactory as p}from"./proxy/di/proxyModuleFactory";import{safeModuleFactory as u}from"./safe/di/safeModuleFactory";import{solanaContextModuleFactory as y}from"./solana/di/SolanaContextModuleFactory";import{solanaLifiModuleFactory as d}from"./solanaLifi/di/lifiModuleFactory";import{solanaTokenModuleFactory as f}from"./solanaToken/di/tokenModuleFactory";import{tokenModuleFactory as M}from"./token/di/tokenModuleFactory";import{transactionCheckModuleFactory as F}from"./transaction-check/di/transactionCheckModuleFactory";import{trustedNameModuleFactory as s}from"./trusted-name/di/trustedNameModuleFactory";import{typedDataModuleFactory as g}from"./typed-data/di/typedDataModuleFactory";import{uniswapModuleFactory as C}from"./uniswap/di/uniswapModuleFactory";const E=({config:o})=>{const r=new t;return r.bind(m.ContextModuleLoggerFactory).toConstantValue(o.loggerFactory),r.loadSync(a(o),n(),i(),l(),p(o),u(),M(),e(),s(o),g(),c(),C(),F(),y(),f(),d()),r};export{E as makeContainer};
1
+ import{Container as t}from"inversify";import{calldataModuleFactory as e}from"./calldata/di/calldataModuleFactory";import{configModuleFactory as a}from"./config/di/configModuleFactory";import{configTypes as m}from"./config/di/configTypes";import{dynamicNetworkModuleFactory as i}from"./dynamic-network/di/dynamicNetworkModuleFactory";import{externalPluginModuleFactory as n}from"./external-plugin/di/externalPluginModuleFactory";import{gatedSigningModuleFactory as l}from"./gated-signing/di/gatedSigningModuleFactory";import{nftModuleFactory as c}from"./nft/di/nftModuleFactory";import{nanoPkiModuleFactory as p}from"./pki/di/pkiModuleFactory";import{proxyModuleFactory as d}from"./proxy/di/proxyModuleFactory";import{safeModuleFactory as u}from"./safe/di/safeModuleFactory";import{solanaContextModuleFactory as y}from"./solana/di/SolanaContextModuleFactory";import{solanaLifiModuleFactory as f}from"./solanaLifi/di/lifiModuleFactory";import{solanaTokenModuleFactory as M}from"./solanaToken/di/tokenModuleFactory";import{tokenModuleFactory as F}from"./token/di/tokenModuleFactory";import{transactionCheckModuleFactory as g}from"./transaction-check/di/transactionCheckModuleFactory";import{trustedNameModuleFactory as s}from"./trusted-name/di/trustedNameModuleFactory";import{typedDataModuleFactory as C}from"./typed-data/di/typedDataModuleFactory";import{uniswapModuleFactory as k}from"./uniswap/di/uniswapModuleFactory";const H=({config:o})=>{const r=new t;return r.bind(m.ContextModuleLoggerFactory).toConstantValue(o.loggerFactory),r.loadSync(a(o),n(),i(),c(),d(o),u(),l(),F(),e(),s(o),C(),p(),k(),g(),y(),M(),f()),r};export{H as makeContainer};
2
2
  //# sourceMappingURL=di.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/di.ts"],
4
- "sourcesContent": ["import { type LoggerPublisherService } from \"@ledgerhq/device-management-kit\";\nimport { Container } from \"inversify\";\n\nimport { calldataModuleFactory } from \"@/calldata/di/calldataModuleFactory\";\nimport { configModuleFactory } from \"@/config/di/configModuleFactory\";\nimport { configTypes } from \"@/config/di/configTypes\";\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { dynamicNetworkModuleFactory } from \"@/dynamic-network/di/dynamicNetworkModuleFactory\";\nimport { externalPluginModuleFactory } from \"@/external-plugin/di/externalPluginModuleFactory\";\nimport { nftModuleFactory } from \"@/nft/di/nftModuleFactory\";\nimport { nanoPkiModuleFactory } from \"@/pki/di/pkiModuleFactory\";\nimport { proxyModuleFactory } from \"@/proxy/di/proxyModuleFactory\";\nimport { safeModuleFactory } from \"@/safe/di/safeModuleFactory\";\nimport { solanaContextModuleFactory } from \"@/solana/di/SolanaContextModuleFactory\";\nimport { solanaLifiModuleFactory } from \"@/solanaLifi/di/lifiModuleFactory\";\nimport { solanaTokenModuleFactory } from \"@/solanaToken/di/tokenModuleFactory\";\nimport { tokenModuleFactory } from \"@/token/di/tokenModuleFactory\";\nimport { transactionCheckModuleFactory } from \"@/transaction-check/di/transactionCheckModuleFactory\";\nimport { trustedNameModuleFactory } from \"@/trusted-name/di/trustedNameModuleFactory\";\nimport { typedDataModuleFactory } from \"@/typed-data/di/typedDataModuleFactory\";\nimport { uniswapModuleFactory } from \"@/uniswap/di/uniswapModuleFactory\";\n\ntype MakeContainerArgs = {\n config: ContextModuleConfig;\n};\n\nexport const makeContainer = ({ config }: MakeContainerArgs) => {\n const container = new Container();\n\n container\n .bind<\n (tag: string) => LoggerPublisherService\n >(configTypes.ContextModuleLoggerFactory)\n .toConstantValue(config.loggerFactory);\n\n container.loadSync(\n configModuleFactory(config),\n externalPluginModuleFactory(),\n dynamicNetworkModuleFactory(),\n nftModuleFactory(),\n proxyModuleFactory(config),\n safeModuleFactory(),\n tokenModuleFactory(),\n calldataModuleFactory(),\n trustedNameModuleFactory(config),\n typedDataModuleFactory(),\n nanoPkiModuleFactory(),\n uniswapModuleFactory(),\n transactionCheckModuleFactory(),\n solanaContextModuleFactory(),\n solanaTokenModuleFactory(),\n solanaLifiModuleFactory(),\n );\n\n return container;\n};\n"],
5
- "mappings": "AACA,OAAS,aAAAA,MAAiB,YAE1B,OAAS,yBAAAC,MAA6B,sCACtC,OAAS,uBAAAC,MAA2B,kCACpC,OAAS,eAAAC,MAAmB,0BAE5B,OAAS,+BAAAC,MAAmC,mDAC5C,OAAS,+BAAAC,MAAmC,mDAC5C,OAAS,oBAAAC,MAAwB,4BACjC,OAAS,wBAAAC,MAA4B,4BACrC,OAAS,sBAAAC,MAA0B,gCACnC,OAAS,qBAAAC,MAAyB,8BAClC,OAAS,8BAAAC,MAAkC,yCAC3C,OAAS,2BAAAC,MAA+B,oCACxC,OAAS,4BAAAC,MAAgC,sCACzC,OAAS,sBAAAC,MAA0B,gCACnC,OAAS,iCAAAC,MAAqC,uDAC9C,OAAS,4BAAAC,MAAgC,6CACzC,OAAS,0BAAAC,MAA8B,yCACvC,OAAS,wBAAAC,MAA4B,oCAM9B,MAAMC,EAAgB,CAAC,CAAE,OAAAC,CAAO,IAAyB,CAC9D,MAAMC,EAAY,IAAIpB,EAEtB,OAAAoB,EACG,KAECjB,EAAY,0BAA0B,EACvC,gBAAgBgB,EAAO,aAAa,EAEvCC,EAAU,SACRlB,EAAoBiB,CAAM,EAC1Bd,EAA4B,EAC5BD,EAA4B,EAC5BE,EAAiB,EACjBE,EAAmBW,CAAM,EACzBV,EAAkB,EAClBI,EAAmB,EACnBZ,EAAsB,EACtBc,EAAyBI,CAAM,EAC/BH,EAAuB,EACvBT,EAAqB,EACrBU,EAAqB,EACrBH,EAA8B,EAC9BJ,EAA2B,EAC3BE,EAAyB,EACzBD,EAAwB,CAC1B,EAEOS,CACT",
6
- "names": ["Container", "calldataModuleFactory", "configModuleFactory", "configTypes", "dynamicNetworkModuleFactory", "externalPluginModuleFactory", "nftModuleFactory", "nanoPkiModuleFactory", "proxyModuleFactory", "safeModuleFactory", "solanaContextModuleFactory", "solanaLifiModuleFactory", "solanaTokenModuleFactory", "tokenModuleFactory", "transactionCheckModuleFactory", "trustedNameModuleFactory", "typedDataModuleFactory", "uniswapModuleFactory", "makeContainer", "config", "container"]
4
+ "sourcesContent": ["import { type LoggerPublisherService } from \"@ledgerhq/device-management-kit\";\nimport { Container } from \"inversify\";\n\nimport { calldataModuleFactory } from \"@/calldata/di/calldataModuleFactory\";\nimport { configModuleFactory } from \"@/config/di/configModuleFactory\";\nimport { configTypes } from \"@/config/di/configTypes\";\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport { dynamicNetworkModuleFactory } from \"@/dynamic-network/di/dynamicNetworkModuleFactory\";\nimport { externalPluginModuleFactory } from \"@/external-plugin/di/externalPluginModuleFactory\";\nimport { gatedSigningModuleFactory } from \"@/gated-signing/di/gatedSigningModuleFactory\";\nimport { nftModuleFactory } from \"@/nft/di/nftModuleFactory\";\nimport { nanoPkiModuleFactory } from \"@/pki/di/pkiModuleFactory\";\nimport { proxyModuleFactory } from \"@/proxy/di/proxyModuleFactory\";\nimport { safeModuleFactory } from \"@/safe/di/safeModuleFactory\";\nimport { solanaContextModuleFactory } from \"@/solana/di/SolanaContextModuleFactory\";\nimport { solanaLifiModuleFactory } from \"@/solanaLifi/di/lifiModuleFactory\";\nimport { solanaTokenModuleFactory } from \"@/solanaToken/di/tokenModuleFactory\";\nimport { tokenModuleFactory } from \"@/token/di/tokenModuleFactory\";\nimport { transactionCheckModuleFactory } from \"@/transaction-check/di/transactionCheckModuleFactory\";\nimport { trustedNameModuleFactory } from \"@/trusted-name/di/trustedNameModuleFactory\";\nimport { typedDataModuleFactory } from \"@/typed-data/di/typedDataModuleFactory\";\nimport { uniswapModuleFactory } from \"@/uniswap/di/uniswapModuleFactory\";\n\ntype MakeContainerArgs = {\n config: ContextModuleConfig;\n};\n\nexport const makeContainer = ({ config }: MakeContainerArgs) => {\n const container = new Container();\n\n container\n .bind<\n (tag: string) => LoggerPublisherService\n >(configTypes.ContextModuleLoggerFactory)\n .toConstantValue(config.loggerFactory);\n\n container.loadSync(\n configModuleFactory(config),\n externalPluginModuleFactory(),\n dynamicNetworkModuleFactory(),\n nftModuleFactory(),\n proxyModuleFactory(config),\n safeModuleFactory(),\n gatedSigningModuleFactory(),\n tokenModuleFactory(),\n calldataModuleFactory(),\n trustedNameModuleFactory(config),\n typedDataModuleFactory(),\n nanoPkiModuleFactory(),\n uniswapModuleFactory(),\n transactionCheckModuleFactory(),\n solanaContextModuleFactory(),\n solanaTokenModuleFactory(),\n solanaLifiModuleFactory(),\n );\n\n return container;\n};\n"],
5
+ "mappings": "AACA,OAAS,aAAAA,MAAiB,YAE1B,OAAS,yBAAAC,MAA6B,sCACtC,OAAS,uBAAAC,MAA2B,kCACpC,OAAS,eAAAC,MAAmB,0BAE5B,OAAS,+BAAAC,MAAmC,mDAC5C,OAAS,+BAAAC,MAAmC,mDAC5C,OAAS,6BAAAC,MAAiC,+CAC1C,OAAS,oBAAAC,MAAwB,4BACjC,OAAS,wBAAAC,MAA4B,4BACrC,OAAS,sBAAAC,MAA0B,gCACnC,OAAS,qBAAAC,MAAyB,8BAClC,OAAS,8BAAAC,MAAkC,yCAC3C,OAAS,2BAAAC,MAA+B,oCACxC,OAAS,4BAAAC,MAAgC,sCACzC,OAAS,sBAAAC,MAA0B,gCACnC,OAAS,iCAAAC,MAAqC,uDAC9C,OAAS,4BAAAC,MAAgC,6CACzC,OAAS,0BAAAC,MAA8B,yCACvC,OAAS,wBAAAC,MAA4B,oCAM9B,MAAMC,EAAgB,CAAC,CAAE,OAAAC,CAAO,IAAyB,CAC9D,MAAMC,EAAY,IAAIrB,EAEtB,OAAAqB,EACG,KAEClB,EAAY,0BAA0B,EACvC,gBAAgBiB,EAAO,aAAa,EAEvCC,EAAU,SACRnB,EAAoBkB,CAAM,EAC1Bf,EAA4B,EAC5BD,EAA4B,EAC5BG,EAAiB,EACjBE,EAAmBW,CAAM,EACzBV,EAAkB,EAClBJ,EAA0B,EAC1BQ,EAAmB,EACnBb,EAAsB,EACtBe,EAAyBI,CAAM,EAC/BH,EAAuB,EACvBT,EAAqB,EACrBU,EAAqB,EACrBH,EAA8B,EAC9BJ,EAA2B,EAC3BE,EAAyB,EACzBD,EAAwB,CAC1B,EAEOS,CACT",
6
+ "names": ["Container", "calldataModuleFactory", "configModuleFactory", "configTypes", "dynamicNetworkModuleFactory", "externalPluginModuleFactory", "gatedSigningModuleFactory", "nftModuleFactory", "nanoPkiModuleFactory", "proxyModuleFactory", "safeModuleFactory", "solanaContextModuleFactory", "solanaLifiModuleFactory", "solanaTokenModuleFactory", "tokenModuleFactory", "transactionCheckModuleFactory", "trustedNameModuleFactory", "typedDataModuleFactory", "uniswapModuleFactory", "makeContainer", "config", "container"]
7
7
  }
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=GatedDescriptorDataSource.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }