@ledgerhq/context-module 0.0.0-multisig-20250821134850 → 0.0.0-multisig-20250905101831
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/src/ContextModule.js +1 -1
- package/lib/cjs/src/ContextModule.js.map +1 -1
- package/lib/cjs/src/DefaultContextModule.js +1 -1
- package/lib/cjs/src/DefaultContextModule.js.map +3 -3
- package/lib/cjs/src/DefaultContextModule.test.js +1 -1
- package/lib/cjs/src/DefaultContextModule.test.js.map +2 -2
- package/lib/cjs/src/di.js +1 -1
- package/lib/cjs/src/di.js.map +3 -3
- package/lib/cjs/src/dynamic-network/data/DynamicNetworkDataSource.js +2 -0
- package/lib/cjs/src/dynamic-network/data/DynamicNetworkDataSource.js.map +7 -0
- package/lib/cjs/src/dynamic-network/data/HttpDynamicNetworkDataSource.js +2 -0
- package/lib/cjs/src/dynamic-network/data/HttpDynamicNetworkDataSource.js.map +7 -0
- package/lib/cjs/src/dynamic-network/data/HttpDynamicNetworkDataSource.test.js +2 -0
- package/lib/cjs/src/dynamic-network/data/HttpDynamicNetworkDataSource.test.js.map +7 -0
- package/lib/cjs/src/dynamic-network/data/dto/DynamicNetworkApiResponseDto.js +2 -0
- package/lib/cjs/src/dynamic-network/data/dto/DynamicNetworkApiResponseDto.js.map +7 -0
- package/lib/cjs/src/dynamic-network/di/dynamicNetworkModuleFactory.js +2 -0
- package/lib/cjs/src/dynamic-network/di/dynamicNetworkModuleFactory.js.map +7 -0
- package/lib/cjs/src/dynamic-network/di/dynamicNetworkTypes.js +2 -0
- package/lib/cjs/src/dynamic-network/di/dynamicNetworkTypes.js.map +7 -0
- package/lib/cjs/src/dynamic-network/domain/DynamicNetworkContextLoader.js +2 -0
- package/lib/cjs/src/dynamic-network/domain/DynamicNetworkContextLoader.js.map +7 -0
- package/lib/cjs/src/dynamic-network/domain/DynamicNetworkContextLoader.test.js +2 -0
- package/lib/cjs/src/dynamic-network/domain/DynamicNetworkContextLoader.test.js.map +7 -0
- package/lib/cjs/src/dynamic-network/model/DynamicNetworkConfiguration.js +2 -0
- package/lib/cjs/src/dynamic-network/model/DynamicNetworkConfiguration.js.map +7 -0
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js +1 -1
- package/lib/cjs/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +2 -2
- package/lib/cjs/src/index.js +1 -1
- package/lib/cjs/src/index.js.map +2 -2
- package/lib/cjs/src/nft/di/nftModuleFactory.js +1 -1
- package/lib/cjs/src/nft/di/nftModuleFactory.js.map +3 -3
- package/lib/cjs/src/nft/di/nftTypes.js +1 -1
- package/lib/cjs/src/nft/di/nftTypes.js.map +2 -2
- package/lib/cjs/src/nft/domain/NftContextFieldLoader.js +2 -0
- package/lib/cjs/src/nft/domain/NftContextFieldLoader.js.map +7 -0
- package/lib/cjs/src/nft/domain/NftContextLoader.js +1 -1
- package/lib/cjs/src/nft/domain/NftContextLoader.js.map +3 -3
- package/lib/cjs/src/nft/domain/NftContextLoader.test.js +1 -1
- package/lib/cjs/src/nft/domain/NftContextLoader.test.js.map +3 -3
- package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.js +1 -1
- package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.js.map +3 -3
- package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.test.js +1 -1
- package/lib/cjs/src/pki/domain/DefaultPkiCertificateLoader.test.js.map +3 -3
- package/lib/cjs/src/shared/domain/ContextFieldLoader.js +2 -0
- package/lib/cjs/src/shared/domain/ContextFieldLoader.js.map +7 -0
- package/lib/cjs/src/shared/model/ClearSignContext.js +1 -1
- package/lib/cjs/src/shared/model/ClearSignContext.js.map +3 -3
- package/lib/cjs/src/shared/model/TransactionContext.js +1 -1
- package/lib/cjs/src/shared/model/TransactionContext.js.map +1 -1
- package/lib/cjs/src/shared/model/TransactionSubset.js +1 -1
- package/lib/cjs/src/shared/model/TransactionSubset.js.map +1 -1
- package/lib/cjs/src/token/di/tokenModuleFactory.js +1 -1
- package/lib/cjs/src/token/di/tokenModuleFactory.js.map +3 -3
- package/lib/cjs/src/token/di/tokenTypes.js +1 -1
- package/lib/cjs/src/token/di/tokenTypes.js.map +2 -2
- package/lib/cjs/src/token/domain/TokenContextFieldLoader.js +2 -0
- package/lib/cjs/src/token/domain/TokenContextFieldLoader.js.map +7 -0
- package/lib/cjs/src/token/domain/TokenContextLoader.js +1 -1
- package/lib/cjs/src/token/domain/TokenContextLoader.js.map +3 -3
- package/lib/cjs/src/token/domain/TokenContextLoader.test.js +1 -1
- package/lib/cjs/src/token/domain/TokenContextLoader.test.js.map +3 -3
- package/lib/cjs/src/transaction/data/HttpProxyDataSource.js +1 -1
- package/lib/cjs/src/transaction/data/HttpProxyDataSource.js.map +1 -1
- package/lib/cjs/src/transaction/data/HttpProxyDataSource.test.js +1 -1
- package/lib/cjs/src/transaction/data/HttpProxyDataSource.test.js.map +1 -1
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js +1 -1
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.js.map +2 -2
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js +1 -1
- package/lib/cjs/src/transaction/data/HttpTransactionDataSource.test.js.map +3 -3
- package/lib/cjs/src/transaction/data/dto/CalldataDto.js +1 -1
- package/lib/cjs/src/transaction/data/dto/CalldataDto.js.map +1 -1
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.js +1 -1
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.js.map +2 -2
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js +1 -1
- package/lib/cjs/src/transaction/domain/TransactionContextLoader.test.js.map +1 -1
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js +1 -1
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.js.map +1 -1
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js +1 -1
- package/lib/cjs/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +1 -1
- package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js +1 -1
- package/lib/cjs/src/trusted-name/di/trustedNameModuleFactory.js.map +3 -3
- package/lib/cjs/src/trusted-name/di/trustedNameTypes.js +1 -1
- package/lib/cjs/src/trusted-name/di/trustedNameTypes.js.map +2 -2
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextFieldLoader.js +2 -0
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextFieldLoader.js.map +7 -0
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js +1 -1
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.js.map +3 -3
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js +1 -1
- package/lib/cjs/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +3 -3
- package/lib/esm/src/DefaultContextModule.js +1 -1
- package/lib/esm/src/DefaultContextModule.js.map +3 -3
- package/lib/esm/src/DefaultContextModule.test.js +1 -1
- package/lib/esm/src/DefaultContextModule.test.js.map +2 -2
- package/lib/esm/src/di.js +1 -1
- package/lib/esm/src/di.js.map +3 -3
- package/lib/esm/src/dynamic-network/data/DynamicNetworkDataSource.js +1 -0
- package/lib/esm/src/dynamic-network/data/DynamicNetworkDataSource.js.map +7 -0
- package/lib/esm/src/dynamic-network/data/HttpDynamicNetworkDataSource.js +2 -0
- package/lib/esm/src/dynamic-network/data/HttpDynamicNetworkDataSource.js.map +7 -0
- package/lib/esm/src/dynamic-network/data/HttpDynamicNetworkDataSource.test.js +2 -0
- package/lib/esm/src/dynamic-network/data/HttpDynamicNetworkDataSource.test.js.map +7 -0
- package/lib/esm/src/dynamic-network/data/dto/DynamicNetworkApiResponseDto.js +1 -0
- package/lib/esm/src/dynamic-network/data/dto/DynamicNetworkApiResponseDto.js.map +7 -0
- package/lib/esm/src/dynamic-network/di/dynamicNetworkModuleFactory.js +2 -0
- package/lib/esm/src/dynamic-network/di/dynamicNetworkModuleFactory.js.map +7 -0
- package/lib/esm/src/dynamic-network/di/dynamicNetworkTypes.js +2 -0
- package/lib/esm/src/dynamic-network/di/dynamicNetworkTypes.js.map +7 -0
- package/lib/esm/src/dynamic-network/domain/DynamicNetworkContextLoader.js +2 -0
- package/lib/esm/src/dynamic-network/domain/DynamicNetworkContextLoader.js.map +7 -0
- package/lib/esm/src/dynamic-network/domain/DynamicNetworkContextLoader.test.js +2 -0
- package/lib/esm/src/dynamic-network/domain/DynamicNetworkContextLoader.test.js.map +7 -0
- package/lib/esm/src/dynamic-network/model/DynamicNetworkConfiguration.js +1 -0
- package/lib/esm/src/dynamic-network/model/DynamicNetworkConfiguration.js.map +7 -0
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js +1 -1
- package/lib/esm/src/external-plugin/domain/ExternalPluginContextLoader.test.js.map +2 -2
- package/lib/esm/src/index.js +1 -1
- package/lib/esm/src/index.js.map +2 -2
- package/lib/esm/src/nft/di/nftModuleFactory.js +1 -1
- package/lib/esm/src/nft/di/nftModuleFactory.js.map +3 -3
- package/lib/esm/src/nft/di/nftTypes.js +1 -1
- package/lib/esm/src/nft/di/nftTypes.js.map +2 -2
- package/lib/esm/src/nft/domain/NftContextFieldLoader.js +2 -0
- package/lib/esm/src/nft/domain/NftContextFieldLoader.js.map +7 -0
- package/lib/esm/src/nft/domain/NftContextLoader.js +1 -1
- package/lib/esm/src/nft/domain/NftContextLoader.js.map +3 -3
- package/lib/esm/src/nft/domain/NftContextLoader.test.js +1 -1
- package/lib/esm/src/nft/domain/NftContextLoader.test.js.map +3 -3
- package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.js +1 -1
- package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.js.map +3 -3
- package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.test.js +1 -1
- package/lib/esm/src/pki/domain/DefaultPkiCertificateLoader.test.js.map +3 -3
- package/lib/esm/src/shared/domain/ContextFieldLoader.js +2 -0
- package/lib/esm/src/shared/domain/ContextFieldLoader.js.map +7 -0
- package/lib/esm/src/shared/model/ClearSignContext.js +1 -1
- package/lib/esm/src/shared/model/ClearSignContext.js.map +3 -3
- package/lib/esm/src/token/di/tokenModuleFactory.js +1 -1
- package/lib/esm/src/token/di/tokenModuleFactory.js.map +3 -3
- package/lib/esm/src/token/di/tokenTypes.js +1 -1
- package/lib/esm/src/token/di/tokenTypes.js.map +2 -2
- package/lib/esm/src/token/domain/TokenContextFieldLoader.js +2 -0
- package/lib/esm/src/token/domain/TokenContextFieldLoader.js.map +7 -0
- package/lib/esm/src/token/domain/TokenContextLoader.js +1 -1
- package/lib/esm/src/token/domain/TokenContextLoader.js.map +3 -3
- package/lib/esm/src/token/domain/TokenContextLoader.test.js +1 -1
- package/lib/esm/src/token/domain/TokenContextLoader.test.js.map +3 -3
- package/lib/esm/src/transaction/data/HttpProxyDataSource.js +1 -1
- package/lib/esm/src/transaction/data/HttpProxyDataSource.js.map +1 -1
- package/lib/esm/src/transaction/data/HttpProxyDataSource.test.js +1 -1
- package/lib/esm/src/transaction/data/HttpProxyDataSource.test.js.map +1 -1
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.js +1 -1
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.js.map +3 -3
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js +1 -1
- package/lib/esm/src/transaction/data/HttpTransactionDataSource.test.js.map +3 -3
- package/lib/esm/src/transaction/domain/TransactionContextLoader.js +1 -1
- package/lib/esm/src/transaction/domain/TransactionContextLoader.js.map +3 -3
- package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js +1 -1
- package/lib/esm/src/transaction/domain/TransactionContextLoader.test.js.map +1 -1
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js +1 -1
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.js.map +1 -1
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js +1 -1
- package/lib/esm/src/trusted-name/data/HttpTrustedNameDataSource.test.js.map +1 -1
- package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js +1 -1
- package/lib/esm/src/trusted-name/di/trustedNameModuleFactory.js.map +3 -3
- package/lib/esm/src/trusted-name/di/trustedNameTypes.js +1 -1
- package/lib/esm/src/trusted-name/di/trustedNameTypes.js.map +2 -2
- package/lib/esm/src/trusted-name/domain/TrustedNameContextFieldLoader.js +2 -0
- package/lib/esm/src/trusted-name/domain/TrustedNameContextFieldLoader.js.map +7 -0
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js +1 -1
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.js.map +3 -3
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js +1 -1
- package/lib/esm/src/trusted-name/domain/TrustedNameContextLoader.test.js.map +3 -3
- package/lib/types/src/ContextModule.d.ts +4 -2
- package/lib/types/src/ContextModule.d.ts.map +1 -1
- package/lib/types/src/DefaultContextModule.d.ts +6 -1
- package/lib/types/src/DefaultContextModule.d.ts.map +1 -1
- package/lib/types/src/di.d.ts.map +1 -1
- package/lib/types/src/dynamic-network/data/DynamicNetworkDataSource.d.ts +6 -0
- package/lib/types/src/dynamic-network/data/DynamicNetworkDataSource.d.ts.map +1 -0
- package/lib/types/src/dynamic-network/data/HttpDynamicNetworkDataSource.d.ts +13 -0
- package/lib/types/src/dynamic-network/data/HttpDynamicNetworkDataSource.d.ts.map +1 -0
- package/lib/types/src/dynamic-network/data/HttpDynamicNetworkDataSource.test.d.ts +2 -0
- package/lib/types/src/dynamic-network/data/HttpDynamicNetworkDataSource.test.d.ts.map +1 -0
- package/lib/types/src/dynamic-network/data/dto/DynamicNetworkApiResponseDto.d.ts +14 -0
- package/lib/types/src/dynamic-network/data/dto/DynamicNetworkApiResponseDto.d.ts.map +1 -0
- package/lib/types/src/dynamic-network/di/dynamicNetworkModuleFactory.d.ts +3 -0
- package/lib/types/src/dynamic-network/di/dynamicNetworkModuleFactory.d.ts.map +1 -0
- package/lib/types/src/dynamic-network/di/dynamicNetworkTypes.d.ts +5 -0
- package/lib/types/src/dynamic-network/di/dynamicNetworkTypes.d.ts.map +1 -0
- package/lib/types/src/dynamic-network/domain/DynamicNetworkContextLoader.d.ts +15 -0
- package/lib/types/src/dynamic-network/domain/DynamicNetworkContextLoader.d.ts.map +1 -0
- package/lib/types/src/dynamic-network/domain/DynamicNetworkContextLoader.test.d.ts +2 -0
- package/lib/types/src/dynamic-network/domain/DynamicNetworkContextLoader.test.d.ts.map +1 -0
- package/lib/types/src/dynamic-network/model/DynamicNetworkConfiguration.d.ts +16 -0
- package/lib/types/src/dynamic-network/model/DynamicNetworkConfiguration.d.ts.map +1 -0
- package/lib/types/src/index.d.ts +2 -0
- package/lib/types/src/index.d.ts.map +1 -1
- package/lib/types/src/nft/di/nftModuleFactory.d.ts.map +1 -1
- package/lib/types/src/nft/di/nftTypes.d.ts +1 -0
- package/lib/types/src/nft/di/nftTypes.d.ts.map +1 -1
- package/lib/types/src/nft/domain/NftContextFieldLoader.d.ts +11 -0
- package/lib/types/src/nft/domain/NftContextFieldLoader.d.ts.map +1 -0
- package/lib/types/src/nft/domain/NftContextLoader.d.ts +1 -2
- package/lib/types/src/nft/domain/NftContextLoader.d.ts.map +1 -1
- package/lib/types/src/pki/domain/DefaultPkiCertificateLoader.d.ts.map +1 -1
- package/lib/types/src/shared/domain/ContextFieldLoader.d.ts +13 -0
- package/lib/types/src/shared/domain/ContextFieldLoader.d.ts.map +1 -0
- package/lib/types/src/shared/model/ClearSignContext.d.ts +28 -8
- package/lib/types/src/shared/model/ClearSignContext.d.ts.map +1 -1
- package/lib/types/src/shared/model/TransactionContext.d.ts +10 -6
- package/lib/types/src/shared/model/TransactionContext.d.ts.map +1 -1
- package/lib/types/src/shared/model/TransactionSubset.d.ts +1 -0
- package/lib/types/src/shared/model/TransactionSubset.d.ts.map +1 -1
- package/lib/types/src/token/di/tokenModuleFactory.d.ts.map +1 -1
- package/lib/types/src/token/di/tokenTypes.d.ts +1 -0
- package/lib/types/src/token/di/tokenTypes.d.ts.map +1 -1
- package/lib/types/src/token/domain/TokenContextFieldLoader.d.ts +11 -0
- package/lib/types/src/token/domain/TokenContextFieldLoader.d.ts.map +1 -0
- package/lib/types/src/token/domain/TokenContextLoader.d.ts +1 -2
- package/lib/types/src/token/domain/TokenContextLoader.d.ts.map +1 -1
- package/lib/types/src/transaction/data/HttpTransactionDataSource.d.ts.map +1 -1
- package/lib/types/src/transaction/data/dto/CalldataDto.d.ts +10 -1
- package/lib/types/src/transaction/data/dto/CalldataDto.d.ts.map +1 -1
- package/lib/types/src/transaction/domain/TransactionContextLoader.d.ts.map +1 -1
- package/lib/types/src/trusted-name/di/trustedNameModuleFactory.d.ts.map +1 -1
- package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts +1 -0
- package/lib/types/src/trusted-name/di/trustedNameTypes.d.ts.map +1 -1
- package/lib/types/src/trusted-name/domain/TrustedNameContextFieldLoader.d.ts +11 -0
- package/lib/types/src/trusted-name/domain/TrustedNameContextFieldLoader.d.ts.map +1 -0
- package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts +1 -2
- package/lib/types/src/trusted-name/domain/TrustedNameContextLoader.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/trusted-name/data/HttpTrustedNameDataSource.test.ts"],
|
|
4
|
-
"sourcesContent": ["import axios from \"axios\";\nimport { Left, Right } from \"purify-ts\";\n\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport {\n LEDGER_CLIENT_VERSION_HEADER,\n LEDGER_ORIGIN_TOKEN_HEADER,\n} from \"@/shared/constant/HttpHeaders\";\nimport { HttpTrustedNameDataSource } from \"@/trusted-name/data/HttpTrustedNameDataSource\";\nimport { type TrustedNameDataSource } from \"@/trusted-name/data/TrustedNameDataSource\";\nimport PACKAGE from \"@root/package.json\";\n\nvi.mock(\"axios\");\n\nconst config = {\n cal: {\n url: \"https://crypto-assets-service.api.ledger.com/v1\",\n mode: \"prod\",\n branch: \"main\",\n },\n metadataServiceDomain: {\n url: \"https://nft.api.live.ledger.com\",\n },\n originToken: \"originToken\",\n} as ContextModuleConfig;\ndescribe(\"HttpTrustedNameDataSource\", () => {\n let datasource: TrustedNameDataSource;\n\n beforeAll(() => {\n datasource = new HttpTrustedNameDataSource(config);\n vi.clearAllMocks();\n });\n\n describe(\"getDomainNamePayload\", () => {\n it(\"should call axios with the correct url and ledger client version header\", async () => {\n // GIVEN\n const version = `context-module/${PACKAGE.version}`;\n const requestSpy = vi.fn(() => Promise.resolve({ data: [] }));\n vi.spyOn(axios, \"request\").mockImplementation(requestSpy);\n\n // WHEN\n await datasource.getDomainNamePayload({\n chainId: 137,\n challenge: \"9876\",\n domain: \"hello.eth\",\n });\n\n // THEN\n expect(requestSpy).toHaveBeenCalledWith(\n expect.objectContaining({\n url: `https://nft.api.live.ledger.com/
|
|
4
|
+
"sourcesContent": ["import axios from \"axios\";\nimport { Left, Right } from \"purify-ts\";\n\nimport { type ContextModuleConfig } from \"@/config/model/ContextModuleConfig\";\nimport {\n LEDGER_CLIENT_VERSION_HEADER,\n LEDGER_ORIGIN_TOKEN_HEADER,\n} from \"@/shared/constant/HttpHeaders\";\nimport { HttpTrustedNameDataSource } from \"@/trusted-name/data/HttpTrustedNameDataSource\";\nimport { type TrustedNameDataSource } from \"@/trusted-name/data/TrustedNameDataSource\";\nimport PACKAGE from \"@root/package.json\";\n\nvi.mock(\"axios\");\n\nconst config = {\n cal: {\n url: \"https://crypto-assets-service.api.ledger.com/v1\",\n mode: \"prod\",\n branch: \"main\",\n },\n metadataServiceDomain: {\n url: \"https://nft.api.live.ledger.com\",\n },\n originToken: \"originToken\",\n} as ContextModuleConfig;\ndescribe(\"HttpTrustedNameDataSource\", () => {\n let datasource: TrustedNameDataSource;\n\n beforeAll(() => {\n datasource = new HttpTrustedNameDataSource(config);\n vi.clearAllMocks();\n });\n\n describe(\"getDomainNamePayload\", () => {\n it(\"should call axios with the correct url and ledger client version header\", async () => {\n // GIVEN\n const version = `context-module/${PACKAGE.version}`;\n const requestSpy = vi.fn(() => Promise.resolve({ data: [] }));\n vi.spyOn(axios, \"request\").mockImplementation(requestSpy);\n\n // WHEN\n await datasource.getDomainNamePayload({\n chainId: 137,\n challenge: \"9876\",\n domain: \"hello.eth\",\n });\n\n // THEN\n expect(requestSpy).toHaveBeenCalledWith(\n expect.objectContaining({\n url: `https://nft.api.live.ledger.com/v2/names/ethereum/137/forward/hello.eth?types=eoa&sources=ens&challenge=9876`,\n headers: {\n [LEDGER_CLIENT_VERSION_HEADER]: version,\n [LEDGER_ORIGIN_TOKEN_HEADER]: config.originToken,\n },\n }),\n );\n });\n\n it(\"should throw an error when axios throws an error\", async () => {\n // GIVEN\n vi.spyOn(axios, \"request\").mockRejectedValue(new Error());\n\n // WHEN\n const result = await datasource.getDomainNamePayload({\n chainId: 137,\n challenge: \"\",\n domain: \"hello.eth\",\n });\n\n // THEN\n expect(result).toEqual(\n Left(\n new Error(\n \"[ContextModule] HttpTrustedNameDataSource: Failed to fetch domain name\",\n ),\n ),\n );\n });\n\n it(\"should return an error when no payload is returned\", async () => {\n // GIVEN\n const response = { data: { test: \"\" } };\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDomainNamePayload({\n chainId: 137,\n challenge: \"\",\n domain: \"hello.eth\",\n });\n\n // THEN\n expect(result).toEqual(\n Left(\n new Error(\n \"[ContextModule] HttpTrustedNameDataSource: error getting domain payload\",\n ),\n ),\n );\n });\n\n it(\"should return a payload\", async () => {\n // GIVEN\n const response = { data: { signedDescriptor: { data: \"payload\" } } };\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getDomainNamePayload({\n chainId: 137,\n challenge: \"challenge\",\n domain: \"hello.eth\",\n });\n\n // THEN\n expect(result).toEqual(Right(\"payload\"));\n });\n });\n\n describe(\"getTrustedNamePayload\", () => {\n it(\"should call axios with the correct url and ledger client version header\", async () => {\n // GIVEN\n const version = `context-module/${PACKAGE.version}`;\n const requestSpy = vi.fn(() => Promise.resolve({ data: [] }));\n vi.spyOn(axios, \"request\").mockImplementation(requestSpy);\n\n // WHEN\n await datasource.getTrustedNamePayload({\n chainId: 137,\n address: \"0x1234\",\n challenge: \"5678\",\n sources: [\"ens\", \"crypto_asset_list\"],\n types: [\"eoa\"],\n });\n\n // THEN\n expect(requestSpy).toHaveBeenCalledWith(\n expect.objectContaining({\n url: `https://nft.api.live.ledger.com/v2/names/ethereum/137/reverse/0x1234?types=eoa&sources=ens,crypto_asset_list&challenge=5678`,\n headers: {\n [LEDGER_CLIENT_VERSION_HEADER]: version,\n [LEDGER_ORIGIN_TOKEN_HEADER]: config.originToken,\n },\n }),\n );\n });\n\n it(\"should throw an error when axios throws an error\", async () => {\n // GIVEN\n vi.spyOn(axios, \"request\").mockRejectedValue(new Error());\n\n // WHEN\n const result = await datasource.getTrustedNamePayload({\n chainId: 137,\n address: \"0x1234\",\n challenge: \"\",\n sources: [\"ens\"],\n types: [\"eoa\"],\n });\n\n // THEN\n expect(result).toEqual(\n Left(\n new Error(\n \"[ContextModule] HttpTrustedNameDataSource: Failed to fetch trusted name\",\n ),\n ),\n );\n });\n\n it(\"should return an error when no payload is returned\", async () => {\n // GIVEN\n const response = { data: { test: \"\" } };\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getTrustedNamePayload({\n chainId: 137,\n address: \"0x1234\",\n challenge: \"\",\n sources: [\"ens\"],\n types: [\"eoa\"],\n });\n\n // THEN\n expect(result).toEqual(\n Left(\n new Error(\n \"[ContextModule] HttpTrustedNameDataSource: no trusted name metadata for address 0x1234\",\n ),\n ),\n );\n });\n\n it(\"should return a payload\", async () => {\n // GIVEN\n const response = {\n data: {\n signedDescriptor: { data: \"payload\" },\n },\n };\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getTrustedNamePayload({\n chainId: 137,\n address: \"0x1234\",\n challenge: \"\",\n sources: [\"ens\"],\n types: [\"eoa\"],\n });\n\n // THEN\n expect(result).toEqual(Right(\"payload\"));\n });\n\n it(\"should return a payload with a signature\", async () => {\n // GIVEN\n const response = {\n data: {\n signedDescriptor: { data: \"payload\", signatures: { prod: \"12345\" } },\n },\n };\n vi.spyOn(axios, \"request\").mockResolvedValue(response);\n\n // WHEN\n const result = await datasource.getTrustedNamePayload({\n chainId: 137,\n address: \"0x1234\",\n challenge: \"\",\n sources: [\"ens\"],\n types: [\"eoa\"],\n });\n\n // THEN\n expect(result).toEqual(Right(\"payload153012345\"));\n });\n });\n});\n"],
|
|
5
5
|
"mappings": "AAAA,OAAOA,MAAW,QAClB,OAAS,QAAAC,EAAM,SAAAC,MAAa,YAG5B,OACE,gCAAAC,EACA,8BAAAC,MACK,gCACP,OAAS,6BAAAC,MAAiC,gDAE1C,OAAOC,MAAa,qBAEpB,GAAG,KAAK,OAAO,EAEf,MAAMC,EAAS,CACb,IAAK,CACH,IAAK,kDACL,KAAM,OACN,OAAQ,MACV,EACA,sBAAuB,CACrB,IAAK,iCACP,EACA,YAAa,aACf,EACA,SAAS,4BAA6B,IAAM,CAC1C,IAAIC,EAEJ,UAAU,IAAM,CACdA,EAAa,IAAIH,EAA0BE,CAAM,EACjD,GAAG,cAAc,CACnB,CAAC,EAED,SAAS,uBAAwB,IAAM,CACrC,GAAG,0EAA2E,SAAY,CAExF,MAAME,EAAU,kBAAkBH,EAAQ,OAAO,GAC3CI,EAAa,GAAG,GAAG,IAAM,QAAQ,QAAQ,CAAE,KAAM,CAAC,CAAE,CAAC,CAAC,EAC5D,GAAG,MAAMV,EAAO,SAAS,EAAE,mBAAmBU,CAAU,EAGxD,MAAMF,EAAW,qBAAqB,CACpC,QAAS,IACT,UAAW,OACX,OAAQ,WACV,CAAC,EAGD,OAAOE,CAA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EAAE,QAAQT,EAAM,SAAS,CAAC,CACzC,CAAC,EAED,GAAG,2CAA4C,SAAY,CAEzD,MAAMU,EAAW,CACf,KAAM,CACJ,iBAAkB,CAAE,KAAM,UAAW,WAAY,CAAE,KAAM,OAAQ,CAAE,CACrE,CACF,EACA,GAAG,MAAMZ,EAAO,SAAS,EAAE,kBAAkBY,CAAQ,EAGrD,MAAMD,EAAS,MAAMH,EAAW,sBAAsB,CACpD,QAAS,IACT,QAAS,SACT,UAAW,GACX,QAAS,CAAC,KAAK,EACf,MAAO,CAAC,KAAK,CACf,CAAC,EAGD,OAAOG,CAAM,EAAE,QAAQT,EAAM,kBAAkB,CAAC,CAClD,CAAC,CACH,CAAC,CACH,CAAC",
|
|
6
6
|
"names": ["axios", "Left", "Right", "LEDGER_CLIENT_VERSION_HEADER", "LEDGER_ORIGIN_TOKEN_HEADER", "HttpTrustedNameDataSource", "PACKAGE", "config", "datasource", "version", "requestSpy", "result", "response"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ContainerModule as o}from"inversify";import{HttpTrustedNameDataSource as r}from"../../trusted-name/data/HttpTrustedNameDataSource";import{trustedNameTypes as
|
|
1
|
+
import{ContainerModule as o}from"inversify";import{HttpTrustedNameDataSource as r}from"../../trusted-name/data/HttpTrustedNameDataSource";import{trustedNameTypes as t}from"../../trusted-name/di/trustedNameTypes";import{TrustedNameContextFieldLoader as a}from"../../trusted-name/domain/TrustedNameContextFieldLoader";import{TrustedNameContextLoader as m}from"../../trusted-name/domain/TrustedNameContextLoader";const T=()=>new o(({bind:e})=>{e(t.TrustedNameDataSource).to(r),e(t.TrustedNameContextLoader).to(m),e(t.TrustedNameContextFieldLoader).to(a)});export{T as trustedNameModuleFactory};
|
|
2
2
|
//# sourceMappingURL=trustedNameModuleFactory.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/trusted-name/di/trustedNameModuleFactory.ts"],
|
|
4
|
-
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpTrustedNameDataSource } from \"@/trusted-name/data/HttpTrustedNameDataSource\";\nimport { trustedNameTypes } from \"@/trusted-name/di/trustedNameTypes\";\nimport { TrustedNameContextLoader } from \"@/trusted-name/domain/TrustedNameContextLoader\";\n\nexport const trustedNameModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(trustedNameTypes.TrustedNameDataSource).to(HttpTrustedNameDataSource);\n bind(trustedNameTypes.TrustedNameContextLoader).to(\n TrustedNameContextLoader,\n );\n });\n"],
|
|
5
|
-
"mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,6BAAAC,MAAiC,gDAC1C,OAAS,oBAAAC,MAAwB,qCACjC,OAAS,4BAAAC,MAAgC,iDAElC,MAAMC,EAA2B,IACtC,
|
|
6
|
-
"names": ["ContainerModule", "HttpTrustedNameDataSource", "trustedNameTypes", "TrustedNameContextLoader", "trustedNameModuleFactory", "bind"]
|
|
4
|
+
"sourcesContent": ["import { ContainerModule } from \"inversify\";\n\nimport { HttpTrustedNameDataSource } from \"@/trusted-name/data/HttpTrustedNameDataSource\";\nimport { trustedNameTypes } from \"@/trusted-name/di/trustedNameTypes\";\nimport { TrustedNameContextFieldLoader } from \"@/trusted-name/domain/TrustedNameContextFieldLoader\";\nimport { TrustedNameContextLoader } from \"@/trusted-name/domain/TrustedNameContextLoader\";\n\nexport const trustedNameModuleFactory = () =>\n new ContainerModule(({ bind }) => {\n bind(trustedNameTypes.TrustedNameDataSource).to(HttpTrustedNameDataSource);\n bind(trustedNameTypes.TrustedNameContextLoader).to(\n TrustedNameContextLoader,\n );\n bind(trustedNameTypes.TrustedNameContextFieldLoader).to(\n TrustedNameContextFieldLoader,\n );\n });\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,mBAAAA,MAAuB,YAEhC,OAAS,6BAAAC,MAAiC,gDAC1C,OAAS,oBAAAC,MAAwB,qCACjC,OAAS,iCAAAC,MAAqC,sDAC9C,OAAS,4BAAAC,MAAgC,iDAElC,MAAMC,EAA2B,IACtC,IAAIL,EAAgB,CAAC,CAAE,KAAAM,CAAK,IAAM,CAChCA,EAAKJ,EAAiB,qBAAqB,EAAE,GAAGD,CAAyB,EACzEK,EAAKJ,EAAiB,wBAAwB,EAAE,GAC9CE,CACF,EACAE,EAAKJ,EAAiB,6BAA6B,EAAE,GACnDC,CACF,CACF,CAAC",
|
|
6
|
+
"names": ["ContainerModule", "HttpTrustedNameDataSource", "trustedNameTypes", "TrustedNameContextFieldLoader", "TrustedNameContextLoader", "trustedNameModuleFactory", "bind"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const e={TrustedNameDataSource:Symbol.for("TrustedNameDataSource"),TrustedNameContextLoader:Symbol.for("TrustedNameContextLoader")};export{e as trustedNameTypes};
|
|
1
|
+
const e={TrustedNameDataSource:Symbol.for("TrustedNameDataSource"),TrustedNameContextLoader:Symbol.for("TrustedNameContextLoader"),TrustedNameContextFieldLoader:Symbol.for("TrustedNameContextFieldLoader")};export{e as trustedNameTypes};
|
|
2
2
|
//# sourceMappingURL=trustedNameTypes.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/trusted-name/di/trustedNameTypes.ts"],
|
|
4
|
-
"sourcesContent": ["export const trustedNameTypes = {\n TrustedNameDataSource: Symbol.for(\"TrustedNameDataSource\"),\n TrustedNameContextLoader: Symbol.for(\"TrustedNameContextLoader\"),\n};\n"],
|
|
5
|
-
"mappings": "AAAO,MAAMA,EAAmB,CAC9B,sBAAuB,OAAO,IAAI,uBAAuB,EACzD,yBAA0B,OAAO,IAAI,0BAA0B,
|
|
4
|
+
"sourcesContent": ["export const trustedNameTypes = {\n TrustedNameDataSource: Symbol.for(\"TrustedNameDataSource\"),\n TrustedNameContextLoader: Symbol.for(\"TrustedNameContextLoader\"),\n TrustedNameContextFieldLoader: Symbol.for(\"TrustedNameContextFieldLoader\"),\n};\n"],
|
|
5
|
+
"mappings": "AAAO,MAAMA,EAAmB,CAC9B,sBAAuB,OAAO,IAAI,uBAAuB,EACzD,yBAA0B,OAAO,IAAI,0BAA0B,EAC/D,8BAA+B,OAAO,IAAI,+BAA+B,CAC3E",
|
|
6
6
|
"names": ["trustedNameTypes"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var m=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var s=(r,e,o,t)=>{for(var a=t>1?void 0:t?p(e,o):e,i=r.length-1,d;i>=0;i--)(d=r[i])&&(a=(t?d(e,o,a):d(a))||a);return t&&a&&m(e,o,a),a},c=(r,e)=>(o,t)=>e(o,t,r);import{inject as S,injectable as T}from"inversify";import{ContextFieldLoaderKind as C}from"../../shared/domain/ContextFieldLoader";import{ClearSignContextType as l}from"../../shared/model/ClearSignContext";import{trustedNameTypes as u}from"../../trusted-name/di/trustedNameTypes";let n=class{constructor(e){this._dataSource=e}kind=C.TRUSTED_NAME;async loadField(e){return(await this._dataSource.getTrustedNamePayload({chainId:e.chainId,address:e.address,challenge:e.challenge,types:e.types,sources:e.sources})).caseOf({Left:t=>({type:l.ERROR,error:t}),Right:t=>({type:l.TRUSTED_NAME,payload:t})})}};n=s([T(),c(0,S(u.TrustedNameDataSource))],n);export{n as TrustedNameContextFieldLoader};
|
|
2
|
+
//# sourceMappingURL=TrustedNameContextFieldLoader.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../src/trusted-name/domain/TrustedNameContextFieldLoader.ts"],
|
|
4
|
+
"sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport {\n ContextFieldLoader,\n ContextFieldLoaderKind,\n} from \"@/shared/domain/ContextFieldLoader\";\nimport {\n ClearSignContext,\n ClearSignContextType,\n} from \"@/shared/model/ClearSignContext\";\nimport { TransactionFieldContext } from \"@/shared/model/TransactionContext\";\nimport * as TrustedNameDataSource from \"@/trusted-name/data/TrustedNameDataSource\";\nimport { trustedNameTypes } from \"@/trusted-name/di/trustedNameTypes\";\n\n@injectable()\nexport class TrustedNameContextFieldLoader\n implements ContextFieldLoader<ContextFieldLoaderKind.TRUSTED_NAME>\n{\n kind: ContextFieldLoaderKind.TRUSTED_NAME =\n ContextFieldLoaderKind.TRUSTED_NAME;\n\n constructor(\n @inject(trustedNameTypes.TrustedNameDataSource)\n private _dataSource: TrustedNameDataSource.TrustedNameDataSource,\n ) {}\n\n async loadField(\n field: TransactionFieldContext<ContextFieldLoaderKind.TRUSTED_NAME>,\n ): Promise<ClearSignContext> {\n const payload = await this._dataSource.getTrustedNamePayload({\n chainId: field.chainId,\n address: field.address,\n challenge: field.challenge,\n types: field.types,\n sources: field.sources,\n });\n return payload.caseOf({\n Left: (error): ClearSignContext => ({\n type: ClearSignContextType.ERROR,\n error,\n }),\n Right: (value): ClearSignContext => ({\n type: ClearSignContextType.TRUSTED_NAME,\n payload: value,\n }),\n });\n }\n}\n"],
|
|
5
|
+
"mappings": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YAEnC,OAEE,0BAAAC,MACK,qCACP,OAEE,wBAAAC,MACK,kCAGP,OAAS,oBAAAC,MAAwB,qCAG1B,IAAMC,EAAN,KAEP,CAIE,YAEUC,EACR,CADQ,iBAAAA,CACP,CANH,KACEC,EAAuB,aAOzB,MAAM,UACJC,EAC2B,CAQ3B,OAPgB,MAAM,KAAK,YAAY,sBAAsB,CAC3D,QAASA,EAAM,QACf,QAASA,EAAM,QACf,UAAWA,EAAM,UACjB,MAAOA,EAAM,MACb,QAASA,EAAM,OACjB,CAAC,GACc,OAAO,CACpB,KAAOC,IAA6B,CAClC,KAAMC,EAAqB,MAC3B,MAAAD,CACF,GACA,MAAQE,IAA6B,CACnC,KAAMD,EAAqB,aAC3B,QAASC,CACX,EACF,CAAC,CACH,CACF,EAhCaN,EAANO,EAAA,CADNC,EAAW,EAQPC,EAAA,EAAAC,EAAOC,EAAiB,qBAAqB,IAPrCX",
|
|
6
|
+
"names": ["inject", "injectable", "ContextFieldLoaderKind", "ClearSignContextType", "trustedNameTypes", "TrustedNameContextFieldLoader", "_dataSource", "ContextFieldLoaderKind", "field", "error", "ClearSignContextType", "value", "__decorateClass", "injectable", "__decorateParam", "inject", "trustedNameTypes"]
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var d=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var m=(n,t,r,e)=>{for(var a=e>1?void 0:e?p(t,r):t,i=n.length-1,o;i>=0;i--)(o=n[i])&&(a=(e?o(t,r,a):o(a))||a);return e&&a&&d(t,r,a),a},c=(n,t)=>(r,e)=>t(r,e,n);import{inject as u,injectable as S}from"inversify";import{ClearSignContextType as l}from"../../shared/model/ClearSignContext";import{trustedNameTypes as g}from"../../trusted-name/di/trustedNameTypes";let s=class{_dataSource;constructor(t){this._dataSource=t}async load(t){const{chainId:r,domain:e,challenge:a}=t;return!e||!a?[]:this.isDomainValid(e)?[(await this._dataSource.getDomainNamePayload({chainId:r,domain:e,challenge:a})).caseOf({Left:o=>({type:l.ERROR,error:o}),Right:o=>({type:l.TRUSTED_NAME,payload:o})})]:[{type:l.ERROR,error:new Error("[ContextModule] TrustedNameLoader: invalid domain")}]}isDomainValid(t){const r=t.length>0&&Number(t.length)<30,e=new RegExp("^[a-zA-Z0-9\\-\\_\\.]+$").test(t);return r&&e}};s=m([S(),c(0,u(g.TrustedNameDataSource))],s);export{s as TrustedNameContextLoader};
|
|
2
2
|
//# sourceMappingURL=TrustedNameContextLoader.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/trusted-name/domain/TrustedNameContextLoader.ts"],
|
|
4
|
-
"sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { ContextLoader } from \"@/shared/domain/ContextLoader\";\nimport {\n ClearSignContext,\n ClearSignContextType,\n} from \"@/shared/model/ClearSignContext\";\nimport {
|
|
5
|
-
"mappings": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YAGnC,OAEE,wBAAAC,MACK,
|
|
6
|
-
"names": ["inject", "injectable", "ClearSignContextType", "trustedNameTypes", "TrustedNameContextLoader", "dataSource", "ctx", "chainId", "domain", "challenge", "error", "ClearSignContextType", "value", "
|
|
4
|
+
"sourcesContent": ["import { inject, injectable } from \"inversify\";\n\nimport { ContextLoader } from \"@/shared/domain/ContextLoader\";\nimport {\n ClearSignContext,\n ClearSignContextType,\n} from \"@/shared/model/ClearSignContext\";\nimport { TransactionContext } from \"@/shared/model/TransactionContext\";\nimport type { TrustedNameDataSource } from \"@/trusted-name/data/TrustedNameDataSource\";\nimport { trustedNameTypes } from \"@/trusted-name/di/trustedNameTypes\";\n\n@injectable()\nexport class TrustedNameContextLoader implements ContextLoader {\n private _dataSource: TrustedNameDataSource;\n\n constructor(\n @inject(trustedNameTypes.TrustedNameDataSource)\n dataSource: TrustedNameDataSource,\n ) {\n this._dataSource = dataSource;\n }\n\n async load(ctx: TransactionContext): Promise<ClearSignContext[]> {\n const { chainId, domain, challenge } = ctx;\n\n if (!domain || !challenge) {\n return [];\n }\n\n if (!this.isDomainValid(domain)) {\n return [\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"[ContextModule] TrustedNameLoader: invalid domain\"),\n },\n ];\n }\n\n const payload = await this._dataSource.getDomainNamePayload({\n chainId,\n domain,\n challenge,\n });\n\n return [\n payload.caseOf({\n Left: (error): ClearSignContext => ({\n type: ClearSignContextType.ERROR,\n error: error,\n }),\n Right: (value): ClearSignContext => ({\n type: ClearSignContextType.TRUSTED_NAME,\n payload: value,\n }),\n }),\n ];\n }\n\n private isDomainValid(domain: string) {\n const lengthIsValid = domain.length > 0 && Number(domain.length) < 30;\n const containsOnlyValidChars = new RegExp(\"^[a-zA-Z0-9\\\\-\\\\_\\\\.]+$\").test(\n domain,\n );\n\n return lengthIsValid && containsOnlyValidChars;\n }\n}\n"],
|
|
5
|
+
"mappings": "iOAAA,OAAS,UAAAA,EAAQ,cAAAC,MAAkB,YAGnC,OAEE,wBAAAC,MACK,kCAGP,OAAS,oBAAAC,MAAwB,qCAG1B,IAAMC,EAAN,KAAwD,CACrD,YAER,YAEEC,EACA,CACA,KAAK,YAAcA,CACrB,CAEA,MAAM,KAAKC,EAAsD,CAC/D,KAAM,CAAE,QAAAC,EAAS,OAAAC,EAAQ,UAAAC,CAAU,EAAIH,EAEvC,MAAI,CAACE,GAAU,CAACC,EACP,CAAC,EAGL,KAAK,cAAcD,CAAM,EAevB,EANS,MAAM,KAAK,YAAY,qBAAqB,CAC1D,QAAAD,EACA,OAAAC,EACA,UAAAC,CACF,CAAC,GAGS,OAAO,CACb,KAAOC,IAA6B,CAClC,KAAMC,EAAqB,MAC3B,MAAOD,CACT,GACA,MAAQE,IAA6B,CACnC,KAAMD,EAAqB,aAC3B,QAASC,CACX,EACF,CAAC,CACH,EAzBS,CACL,CACE,KAAMD,EAAqB,MAC3B,MAAO,IAAI,MAAM,mDAAmD,CACtE,CACF,CAqBJ,CAEQ,cAAcH,EAAgB,CACpC,MAAMK,EAAgBL,EAAO,OAAS,GAAK,OAAOA,EAAO,MAAM,EAAI,GAC7DM,EAAyB,IAAI,OAAO,yBAAyB,EAAE,KACnEN,CACF,EAEA,OAAOK,GAAiBC,CAC1B,CACF,EAtDaV,EAANW,EAAA,CADNC,EAAW,EAKPC,EAAA,EAAAC,EAAOC,EAAiB,qBAAqB,IAJrCf",
|
|
6
|
+
"names": ["inject", "injectable", "ClearSignContextType", "trustedNameTypes", "TrustedNameContextLoader", "dataSource", "ctx", "chainId", "domain", "challenge", "error", "ClearSignContextType", "value", "lengthIsValid", "containsOnlyValidChars", "__decorateClass", "injectable", "__decorateParam", "inject", "trustedNameTypes"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Left as l,Right as s}from"purify-ts";import{ClearSignContextType as
|
|
1
|
+
import{Left as l,Right as s}from"purify-ts";import{ClearSignContextType as r}from"../../shared/model/ClearSignContext";import{TrustedNameContextLoader as n}from"../../trusted-name/domain/TrustedNameContextLoader";describe("TrustedNameContextLoader",()=>{const o={getDomainNamePayload:vi.fn(),getTrustedNamePayload:vi.fn()};beforeEach(()=>{vi.restoreAllMocks(),vi.spyOn(o,"getDomainNamePayload").mockResolvedValue(s("payload"))}),describe("load function",()=>{it("should return an empty array when no domain or registry",async()=>{const e={},t=new n(o),a=()=>t.load(e);await expect(a()).resolves.toEqual([])}),it("should return an error when domain > max length",async()=>{const e={domain:"maxlength-maxlength-maxlength-maxlength-maxlength-maxlength",challenge:"challenge"},a=await new n(o).load(e);expect(a).toEqual([{type:r.ERROR,error:new Error("[ContextModule] TrustedNameLoader: invalid domain")}])}),it("should return an error when domain is not valid",async()=>{const e={domain:"hello\u{1F44B}",challenge:"challenge"},a=await new n(o).load(e);expect(a).toEqual([{type:r.ERROR,error:new Error("[ContextModule] TrustedNameLoader: invalid domain")}])}),it("should return a payload",async()=>{const e={domain:"hello.eth",challenge:"challenge"},a=await new n(o).load(e);expect(a).toEqual([{type:r.TRUSTED_NAME,payload:"payload"}])}),it("should return an error when unable to fetch the datasource",async()=>{const e={domain:"hello.eth",challenge:"challenge"};vi.spyOn(o,"getDomainNamePayload").mockResolvedValue(l(new Error("error")));const a=await new n(o).load(e);expect(a).toEqual([{type:r.ERROR,error:new Error("error")}])}),it("should return an empty array when no challenge",async()=>{const e={domain:"hello.eth",challenge:void 0},a=await new n(o).load(e);expect(a).toEqual([])})})});
|
|
2
2
|
//# sourceMappingURL=TrustedNameContextLoader.test.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/trusted-name/domain/TrustedNameContextLoader.test.ts"],
|
|
4
|
-
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport { ClearSignContextType } from \"@/shared/model/ClearSignContext\";\nimport {
|
|
5
|
-
"mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAE5B,OAAS,wBAAAC,MAA4B,
|
|
6
|
-
"names": ["Left", "Right", "ClearSignContextType", "TrustedNameContextLoader", "mockTrustedNameDataSource", "transaction", "loader", "promise", "result"
|
|
4
|
+
"sourcesContent": ["import { Left, Right } from \"purify-ts\";\n\nimport { ClearSignContextType } from \"@/shared/model/ClearSignContext\";\nimport { type TransactionContext } from \"@/shared/model/TransactionContext\";\nimport { type TrustedNameDataSource } from \"@/trusted-name/data/TrustedNameDataSource\";\nimport { TrustedNameContextLoader } from \"@/trusted-name/domain/TrustedNameContextLoader\";\n\ndescribe(\"TrustedNameContextLoader\", () => {\n const mockTrustedNameDataSource: TrustedNameDataSource = {\n getDomainNamePayload: vi.fn(),\n getTrustedNamePayload: vi.fn(),\n };\n\n beforeEach(() => {\n vi.restoreAllMocks();\n vi.spyOn(\n mockTrustedNameDataSource,\n \"getDomainNamePayload\",\n ).mockResolvedValue(Right(\"payload\"));\n });\n\n describe(\"load function\", () => {\n it(\"should return an empty array when no domain or registry\", async () => {\n const transaction = {} as TransactionContext;\n const loader = new TrustedNameContextLoader(mockTrustedNameDataSource);\n const promise = () => loader.load(transaction);\n\n await expect(promise()).resolves.toEqual([]);\n });\n\n it(\"should return an error when domain > max length\", async () => {\n const transaction = {\n domain: \"maxlength-maxlength-maxlength-maxlength-maxlength-maxlength\",\n challenge: \"challenge\",\n } as TransactionContext;\n\n const loader = new TrustedNameContextLoader(mockTrustedNameDataSource);\n const result = await loader.load(transaction);\n\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"[ContextModule] TrustedNameLoader: invalid domain\"),\n },\n ]);\n });\n\n it(\"should return an error when domain is not valid\", async () => {\n const transaction = {\n domain: \"hello\uD83D\uDC4B\",\n challenge: \"challenge\",\n } as TransactionContext;\n\n const loader = new TrustedNameContextLoader(mockTrustedNameDataSource);\n const result = await loader.load(transaction);\n\n expect(result).toEqual([\n {\n type: ClearSignContextType.ERROR,\n error: new Error(\"[ContextModule] TrustedNameLoader: invalid domain\"),\n },\n ]);\n });\n\n it(\"should return a payload\", async () => {\n const transaction = {\n domain: \"hello.eth\",\n challenge: \"challenge\",\n } as TransactionContext;\n\n const loader = new TrustedNameContextLoader(mockTrustedNameDataSource);\n const result = await loader.load(transaction);\n\n expect(result).toEqual([\n {\n type: ClearSignContextType.TRUSTED_NAME,\n payload: \"payload\",\n },\n ]);\n });\n\n it(\"should return an error when unable to fetch the datasource\", async () => {\n // GIVEN\n const transaction = {\n domain: \"hello.eth\",\n challenge: \"challenge\",\n } as TransactionContext;\n\n // WHEN\n vi.spyOn(\n mockTrustedNameDataSource,\n \"getDomainNamePayload\",\n ).mockResolvedValue(Left(new Error(\"error\")));\n const loader = new TrustedNameContextLoader(mockTrustedNameDataSource);\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([\n { type: ClearSignContextType.ERROR, error: new Error(\"error\") },\n ]);\n });\n\n it(\"should return an empty array when no challenge\", async () => {\n // GIVEN\n const transaction = {\n domain: \"hello.eth\",\n challenge: undefined,\n } as TransactionContext;\n\n // WHEN\n const loader = new TrustedNameContextLoader(mockTrustedNameDataSource);\n const result = await loader.load(transaction);\n\n // THEN\n expect(result).toEqual([]);\n });\n });\n});\n"],
|
|
5
|
+
"mappings": "AAAA,OAAS,QAAAA,EAAM,SAAAC,MAAa,YAE5B,OAAS,wBAAAC,MAA4B,kCAGrC,OAAS,4BAAAC,MAAgC,iDAEzC,SAAS,2BAA4B,IAAM,CACzC,MAAMC,EAAmD,CACvD,qBAAsB,GAAG,GAAG,EAC5B,sBAAuB,GAAG,GAAG,CAC/B,EAEA,WAAW,IAAM,CACf,GAAG,gBAAgB,EACnB,GAAG,MACDA,EACA,sBACF,EAAE,kBAAkBH,EAAM,SAAS,CA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AM,EAAE,QAAQ,CACrB,CAAE,KAAMN,EAAqB,MAAO,MAAO,IAAI,MAAM,OAAO,CAAE,CAChE,CAAC,CACH,CAAC,EAED,GAAG,iDAAkD,SAAY,CAE/D,MAAMG,EAAc,CAClB,OAAQ,YACR,UAAW,MACb,EAIMG,EAAS,MADA,IAAIL,EAAyBC,CAAyB,EACzC,KAAKC,CAAW,EAG5C,OAAOG,CAAM,EAAE,QAAQ,CAAC,CAAC,CAC3B,CAAC,CACH,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["Left", "Right", "ClearSignContextType", "TrustedNameContextLoader", "mockTrustedNameDataSource", "transaction", "loader", "promise", "result"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type ClearSignContext } from "./shared/model/ClearSignContext";
|
|
2
|
+
import { type ContextFieldLoaderKind } from "./shared/domain/ContextFieldLoader";
|
|
2
3
|
import { type SolanaTransactionContext } from "./shared/model/SolanaTransactionContext";
|
|
3
4
|
import { type TransactionContext, type TransactionFieldContext } from "./shared/model/TransactionContext";
|
|
4
5
|
import { type TypedDataClearSignContext } from "./shared/model/TypedDataClearSignContext";
|
|
@@ -6,10 +7,11 @@ import { type TypedDataContext } from "./shared/model/TypedDataContext";
|
|
|
6
7
|
import { type SolanaTransactionContextResult } from "./solana/domain/solanaContextTypes";
|
|
7
8
|
import { type Web3CheckContext } from "./web3-check/domain/web3CheckTypes";
|
|
8
9
|
export interface ContextModule {
|
|
9
|
-
|
|
10
|
-
|
|
10
|
+
getContexts(ctx: TransactionContext): Promise<ClearSignContext[]>;
|
|
11
|
+
getFieldContext<T extends ContextFieldLoaderKind>(field: TransactionFieldContext<T>): Promise<ClearSignContext>;
|
|
11
12
|
getTypedDataFilters(typedData: TypedDataContext): Promise<TypedDataClearSignContext>;
|
|
12
13
|
getWeb3Checks(transactionContext: Web3CheckContext): Promise<ClearSignContext | null>;
|
|
14
|
+
getProxyDelegateCall(ctx: TransactionContext): Promise<ClearSignContext | null>;
|
|
13
15
|
getSolanaContext(transactionContext: SolanaTransactionContext): Promise<SolanaTransactionContextResult>;
|
|
14
16
|
}
|
|
15
17
|
//# sourceMappingURL=ContextModule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContextModule.d.ts","sourceRoot":"","sources":["../../../src/ContextModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,MAAM,WAAW,aAAa;IAC5B,
|
|
1
|
+
{"version":3,"file":"ContextModule.d.ts","sourceRoot":"","sources":["../../../src/ContextModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAExE,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AACjF,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,KAAK,8BAA8B,EAAE,MAAM,oCAAoC,CAAC;AACzF,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,MAAM,WAAW,aAAa;IAC5B,WAAW,CAAC,GAAG,EAAE,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAClE,eAAe,CAAC,CAAC,SAAS,sBAAsB,EAC9C,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAChC,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAC7B,mBAAmB,CACjB,SAAS,EAAE,gBAAgB,GAC1B,OAAO,CAAC,yBAAyB,CAAC,CAAC;IACtC,aAAa,CACX,kBAAkB,EAAE,gBAAgB,GACnC,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACpC,oBAAoB,CAClB,GAAG,EAAE,kBAAkB,GACtB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAAC;IACpC,gBAAgB,CACd,kBAAkB,EAAE,wBAAwB,GAC3C,OAAO,CAAC,8BAA8B,CAAC,CAAC;CAC5C"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { TypedDataClearSignContext } from "./shared/model/TypedDataClearSignContext";
|
|
2
2
|
import type { TypedDataContext } from "./shared/model/TypedDataContext";
|
|
3
3
|
import { type ContextModuleConfig } from "./config/model/ContextModuleConfig";
|
|
4
|
+
import { type ContextFieldLoaderKind } from "./shared/domain/ContextFieldLoader";
|
|
4
5
|
import { type ClearSignContext, type ClearSignContextSuccess, ClearSignContextType } from "./shared/model/ClearSignContext";
|
|
5
6
|
import { type SolanaTransactionContext } from "./shared/model/SolanaTransactionContext";
|
|
6
7
|
import { type TransactionContext, type TransactionFieldContext } from "./shared/model/TransactionContext";
|
|
@@ -13,15 +14,19 @@ export declare class DefaultContextModule implements ContextModule {
|
|
|
13
14
|
private _typedDataLoader;
|
|
14
15
|
private _web3CheckLoader;
|
|
15
16
|
private _solanaLoader;
|
|
17
|
+
private _fieldLoaders;
|
|
16
18
|
constructor(args: ContextModuleConfig);
|
|
17
19
|
private _getDefaultLoaders;
|
|
18
20
|
private _getDefaultTypedDataLoader;
|
|
19
21
|
private _getWeb3CheckLoader;
|
|
20
22
|
private _getSolanaLoader;
|
|
23
|
+
private _getProxyDataSource;
|
|
24
|
+
private _getCertificateLoader;
|
|
21
25
|
getContexts(transaction: TransactionContext): Promise<ClearSignContext[]>;
|
|
22
|
-
|
|
26
|
+
getFieldContext<T extends ContextFieldLoaderKind>(field: TransactionFieldContext<T>): Promise<ClearSignContext>;
|
|
23
27
|
getTypedDataFilters(typedData: TypedDataContext): Promise<TypedDataClearSignContext>;
|
|
24
28
|
getWeb3Checks(transactionContext: Web3CheckContext): Promise<ClearSignContextSuccess<ClearSignContextType.WEB3_CHECK> | null>;
|
|
29
|
+
getProxyDelegateCall(ctx: TransactionContext): Promise<ClearSignContextSuccess<ClearSignContextType.PROXY_DELEGATE_CALL> | null>;
|
|
25
30
|
getSolanaContext(transactionContext: SolanaTransactionContext): Promise<SolanaTransactionContextResult>;
|
|
26
31
|
}
|
|
27
32
|
//# sourceMappingURL=DefaultContextModule.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultContextModule.d.ts","sourceRoot":"","sources":["../../../src/DefaultContextModule.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DefaultContextModule.d.ts","sourceRoot":"","sources":["../../../src/DefaultContextModule.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0CAA0C,CAAC;AAC1F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAIxE,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAQ9E,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,E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AAI,CAAC;IA+BvE,gBAAgB,CAC3B,kBAAkB,EAAE,wBAAwB,GAC3C,OAAO,CAAC,8BAA8B,CAAC;CAG3C"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"di.d.ts","sourceRoot":"","sources":["../../../src/di.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"di.d.ts","sourceRoot":"","sources":["../../../src/di.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAa9E,KAAK,iBAAiB,GAAG;IACvB,MAAM,EAAE,mBAAmB,CAAC;CAC7B,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,YAAY,iBAAiB,cAmB1D,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type Either } from "purify-ts";
|
|
2
|
+
import { type DynamicNetworkConfiguration } from "../../dynamic-network/model/DynamicNetworkConfiguration";
|
|
3
|
+
export interface DynamicNetworkDataSource {
|
|
4
|
+
getDynamicNetworkConfiguration(chainId: number): Promise<Either<Error, DynamicNetworkConfiguration>>;
|
|
5
|
+
}
|
|
6
|
+
//# sourceMappingURL=DynamicNetworkDataSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicNetworkDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/dynamic-network/data/DynamicNetworkDataSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EAAE,KAAK,2BAA2B,EAAE,MAAM,qDAAqD,CAAC;AAEvG,MAAM,WAAW,wBAAwB;IACvC,8BAA8B,CAC5B,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,2BAA2B,CAAC,CAAC,CAAC;CACxD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Either } from "purify-ts";
|
|
2
|
+
import { type ContextModuleConfig } from "../../config/model/ContextModuleConfig";
|
|
3
|
+
import { type DynamicNetworkConfiguration } from "../../dynamic-network/model/DynamicNetworkConfiguration";
|
|
4
|
+
import { type DynamicNetworkDataSource } from "./DynamicNetworkDataSource";
|
|
5
|
+
export declare class HttpDynamicNetworkDataSource implements DynamicNetworkDataSource {
|
|
6
|
+
private readonly config;
|
|
7
|
+
constructor(config: ContextModuleConfig);
|
|
8
|
+
getDynamicNetworkConfiguration(chainId: number): Promise<Either<Error, DynamicNetworkConfiguration>>;
|
|
9
|
+
private isValidNetworkData;
|
|
10
|
+
private isValidDescriptor;
|
|
11
|
+
private transformToNetworkConfiguration;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=HttpDynamicNetworkDataSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpDynamicNetworkDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/dynamic-network/data/HttpDynamicNetworkDataSource.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,MAAM,EAAe,MAAM,WAAW,CAAC;AAGhD,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,qDAAqD,CAAC;AAK7D,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAE3E,qBACa,4BAA6B,YAAW,wBAAwB;IAE7C,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,mBAAmB;IAGpE,8BAA8B,CAClC,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,2BAA2B,CAAC,CAAC;IAyCtD,OAAO,CAAC,kBAAkB;IAkC1B,OAAO,CAAC,iBAAiB;IAkCzB,OAAO,CAAC,+BAA+B;CAsBxC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpDynamicNetworkDataSource.test.d.ts","sourceRoot":"","sources":["../../../../../src/dynamic-network/data/HttpDynamicNetworkDataSource.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type DynamicNetworkApiResponseDto = Array<{
|
|
2
|
+
id: string;
|
|
3
|
+
descriptors: Record<string, {
|
|
4
|
+
data: string;
|
|
5
|
+
descriptorType: string;
|
|
6
|
+
descriptorVersion: string;
|
|
7
|
+
signatures: {
|
|
8
|
+
prod: string;
|
|
9
|
+
test: string;
|
|
10
|
+
};
|
|
11
|
+
}>;
|
|
12
|
+
icons: Record<string, string>;
|
|
13
|
+
}>;
|
|
14
|
+
//# sourceMappingURL=DynamicNetworkApiResponseDto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicNetworkApiResponseDto.d.ts","sourceRoot":"","sources":["../../../../../../src/dynamic-network/data/dto/DynamicNetworkApiResponseDto.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,4BAA4B,GAAG,KAAK,CAAC;IAC/C,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CACjB,MAAM,EACN;QACE,IAAI,EAAE,MAAM,CAAC;QACb,cAAc,EAAE,MAAM,CAAC;QACvB,iBAAiB,EAAE,MAAM,CAAC;QAC1B,UAAU,EAAE;YACV,IAAI,EAAE,MAAM,CAAC;YACb,IAAI,EAAE,MAAM,CAAC;SACd,CAAC;KACH,CACF,CAAC;IACF,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC/B,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamicNetworkModuleFactory.d.ts","sourceRoot":"","sources":["../../../../../src/dynamic-network/di/dynamicNetworkModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAO5C,eAAO,MAAM,2BAA2B,uBAQpC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamicNetworkTypes.d.ts","sourceRoot":"","sources":["../../../../../src/dynamic-network/di/dynamicNetworkTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;CAG/B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ContextModuleConfig } from "../../config/model/ContextModuleConfig";
|
|
2
|
+
import { type DynamicNetworkDataSource } from "../../dynamic-network/data/DynamicNetworkDataSource";
|
|
3
|
+
import { type PkiCertificateLoader } from "../../pki/domain/PkiCertificateLoader";
|
|
4
|
+
import { ContextLoader } from "../../shared/domain/ContextLoader";
|
|
5
|
+
import { ClearSignContext } from "../../shared/model/ClearSignContext";
|
|
6
|
+
import { TransactionContext, TransactionFieldContext } from "../../shared/model/TransactionContext";
|
|
7
|
+
export declare class DynamicNetworkContextLoader implements ContextLoader {
|
|
8
|
+
private readonly _networkDataSource;
|
|
9
|
+
private readonly _config;
|
|
10
|
+
private readonly _certificateLoader;
|
|
11
|
+
constructor(networkDataSource: DynamicNetworkDataSource, config: ContextModuleConfig, certificateLoader: PkiCertificateLoader);
|
|
12
|
+
load(ctx: TransactionContext): Promise<ClearSignContext[]>;
|
|
13
|
+
loadField(_field: TransactionFieldContext): Promise<ClearSignContext | null>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=DynamicNetworkContextLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicNetworkContextLoader.d.ts","sourceRoot":"","sources":["../../../../../src/dynamic-network/domain/DynamicNetworkContextLoader.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,iDAAiD,CAAC;AAGhG,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAG9E,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAEjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EACL,kBAAkB,EAClB,uBAAuB,EACxB,MAAM,mCAAmC,CAAC;AAK3C,qBACa,2BAA4B,YAAW,aAAa;IAC/D,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAA2B;IAC9D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAsB;IAC9C,OAAO,CAAC,QAAQ,CAAC,kBAAkB,CAAuB;gBAIxD,iBAAiB,EAAE,wBAAwB,EAE3C,MAAM,EAAE,mBAAmB,EAE3B,iBAAiB,EAAE,oBAAoB;IAOnC,IAAI,CAAC,GAAG,EAAE,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAyDhE,SAAS,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC;CAG7E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicNetworkContextLoader.test.d.ts","sourceRoot":"","sources":["../../../../../src/dynamic-network/domain/DynamicNetworkContextLoader.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type DeviceModelId } from "@ledgerhq/device-management-kit";
|
|
2
|
+
export type DynamicNetworkDescriptor = {
|
|
3
|
+
descriptorType: string;
|
|
4
|
+
descriptorVersion: string;
|
|
5
|
+
data: string;
|
|
6
|
+
signatures: {
|
|
7
|
+
prod: string;
|
|
8
|
+
test: string;
|
|
9
|
+
};
|
|
10
|
+
icon: string | undefined;
|
|
11
|
+
};
|
|
12
|
+
export type DynamicNetworkConfiguration = {
|
|
13
|
+
id: string;
|
|
14
|
+
descriptors: Record<DeviceModelId, DynamicNetworkDescriptor>;
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=DynamicNetworkConfiguration.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DynamicNetworkConfiguration.d.ts","sourceRoot":"","sources":["../../../../../src/dynamic-network/model/DynamicNetworkConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,MAAM,MAAM,wBAAwB,GAAG;IACrC,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,WAAW,EAAE,MAAM,CAAC,aAAa,EAAE,wBAAwB,CAAC,CAAC;CAC9D,CAAC"}
|
package/lib/types/src/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export * from "./config/model/ContextModuleConfig";
|
|
|
2
2
|
export * from "./ContextModule";
|
|
3
3
|
export * from "./ContextModuleBuilder";
|
|
4
4
|
export * from "./DefaultContextModule";
|
|
5
|
+
export * from "./dynamic-network/domain/DynamicNetworkContextLoader";
|
|
6
|
+
export * from "./dynamic-network/model/DynamicNetworkConfiguration";
|
|
5
7
|
export * from "./external-plugin/domain/ExternalPluginContextLoader";
|
|
6
8
|
export * from "./nft/domain/NftContextLoader";
|
|
7
9
|
export * from "./pki/domain/PkiCertificateLoader";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oCAAoC,CAAC;AACnD,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,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CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nftModuleFactory.d.ts","sourceRoot":"","sources":["../../../../../src/nft/di/nftModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"nftModuleFactory.d.ts","sourceRoot":"","sources":["../../../../../src/nft/di/nftModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAO5C,eAAO,MAAM,gBAAgB,uBAKzB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"nftTypes.d.ts","sourceRoot":"","sources":["../../../../../src/nft/di/nftTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ
|
|
1
|
+
{"version":3,"file":"nftTypes.d.ts","sourceRoot":"","sources":["../../../../../src/nft/di/nftTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;CAIpB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as NftDataSource from "../../nft/data/NftDataSource";
|
|
2
|
+
import { type ContextFieldLoader, ContextFieldLoaderKind } from "../../shared/domain/ContextFieldLoader";
|
|
3
|
+
import { type ClearSignContext } from "../../shared/model/ClearSignContext";
|
|
4
|
+
import { type TransactionFieldContext } from "../../shared/model/TransactionContext";
|
|
5
|
+
export declare class NftContextFieldLoader implements ContextFieldLoader<ContextFieldLoaderKind.NFT> {
|
|
6
|
+
private _dataSource;
|
|
7
|
+
kind: ContextFieldLoaderKind.NFT;
|
|
8
|
+
constructor(_dataSource: NftDataSource.NftDataSource);
|
|
9
|
+
loadField(field: TransactionFieldContext<ContextFieldLoaderKind.NFT>): Promise<ClearSignContext>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=NftContextFieldLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NftContextFieldLoader.d.ts","sourceRoot":"","sources":["../../../../../src/nft/domain/NftContextFieldLoader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,aAAa,MAAM,0BAA0B,CAAC;AAE1D,OAAO,EACL,KAAK,kBAAkB,EACvB,sBAAsB,EACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,KAAK,gBAAgB,EAEtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAEjF,qBACa,qBACX,YAAW,kBAAkB,CAAC,sBAAsB,CAAC,GAAG,CAAC;IAMvD,OAAO,CAAC,WAAW;IAJrB,IAAI,EAAE,sBAAsB,CAAC,GAAG,CAA8B;gBAIpD,WAAW,EAAE,aAAa,CAAC,aAAa;IAG5C,SAAS,CACb,KAAK,EAAE,uBAAuB,CAAC,sBAAsB,CAAC,GAAG,CAAC,GACzD,OAAO,CAAC,gBAAgB,CAAC;CAgB7B"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { NftDataSource } from "../../nft/data/NftDataSource";
|
|
2
2
|
import { ContextLoader } from "../../shared/domain/ContextLoader";
|
|
3
3
|
import { ClearSignContext } from "../../shared/model/ClearSignContext";
|
|
4
|
-
import { TransactionContext
|
|
4
|
+
import { TransactionContext } from "../../shared/model/TransactionContext";
|
|
5
5
|
export declare class NftContextLoader implements ContextLoader {
|
|
6
6
|
private _dataSource;
|
|
7
7
|
constructor(dataSource: NftDataSource);
|
|
8
8
|
load(ctx: TransactionContext): Promise<ClearSignContext[]>;
|
|
9
|
-
loadField(field: TransactionFieldContext): Promise<ClearSignContext | null>;
|
|
10
9
|
private isSelectorSupported;
|
|
11
10
|
}
|
|
12
11
|
//# sourceMappingURL=NftContextLoader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NftContextLoader.d.ts","sourceRoot":"","sources":["../../../../../src/nft/domain/NftContextLoader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAEjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,
|
|
1
|
+
{"version":3,"file":"NftContextLoader.d.ts","sourceRoot":"","sources":["../../../../../src/nft/domain/NftContextLoader.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAE9D,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EACL,gBAAgB,EAEjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAqBvE,qBACa,gBAAiB,YAAW,aAAa;IACpD,OAAO,CAAC,WAAW,CAAgB;gBAES,UAAU,EAAE,aAAa;IAI/D,IAAI,CAAC,GAAG,EAAE,kBAAkB,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IA0EhE,OAAO,CAAC,mBAAmB;CAG5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DefaultPkiCertificateLoader.d.ts","sourceRoot":"","sources":["../../../../../src/pki/domain/DefaultPkiCertificateLoader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAEpF,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,qBACa,2BAA4B,YAAW,oBAAoB;IACtE,OAAO,CAAC,WAAW,CAA2B;gBAI5C,UAAU,EAAE,wBAAwB;IAKhC,eAAe,CACnB,gBAAgB,EAAE,kBAAkB,GACnC,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"DefaultPkiCertificateLoader.d.ts","sourceRoot":"","sources":["../../../../../src/pki/domain/DefaultPkiCertificateLoader.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,wBAAwB,EAAE,MAAM,qCAAqC,CAAC;AAEpF,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AAEzE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,qBACa,2BAA4B,YAAW,oBAAoB;IACtE,OAAO,CAAC,WAAW,CAA2B;gBAI5C,UAAU,EAAE,wBAAwB;IAKhC,eAAe,CACnB,gBAAgB,EAAE,kBAAkB,GACnC,OAAO,CAAC,cAAc,GAAG,SAAS,CAAC;CAOvC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ClearSignContext } from "../../shared/model/ClearSignContext";
|
|
2
|
+
import { type TransactionFieldContext } from "../../shared/model/TransactionContext";
|
|
3
|
+
export declare enum ContextFieldLoaderKind {
|
|
4
|
+
PROXY_DELEGATE_CALL = "proxy_delegate_call",
|
|
5
|
+
TOKEN = "token",
|
|
6
|
+
NFT = "nft",
|
|
7
|
+
TRUSTED_NAME = "trusted_name"
|
|
8
|
+
}
|
|
9
|
+
export interface ContextFieldLoader<T extends ContextFieldLoaderKind> {
|
|
10
|
+
kind: T;
|
|
11
|
+
loadField: (field: TransactionFieldContext<T>) => Promise<ClearSignContext>;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=ContextFieldLoader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextFieldLoader.d.ts","sourceRoot":"","sources":["../../../../../src/shared/domain/ContextFieldLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAEjF,oBAAY,sBAAsB;IAChC,mBAAmB,wBAAwB;IAC3C,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,YAAY,iBAAiB;CAC9B;AAED,MAAM,WAAW,kBAAkB,CAAC,CAAC,SAAS,sBAAsB;IAClE,IAAI,EAAE,CAAC,CAAC;IACR,SAAS,EAAE,CAAC,KAAK,EAAE,uBAAuB,CAAC,CAAC,CAAC,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;CAC7E"}
|