@ledgerhq/device-trusted-app-kit-ledger-keyring-protocol 0.0.0-ledger-button-20250806141658
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.MD +202 -0
- package/README.md +32 -0
- package/lib/cjs/api/LedgerKeyringProtocol.js +2 -0
- package/lib/cjs/api/LedgerKeyringProtocol.js.map +7 -0
- package/lib/cjs/api/LedgerKeyringProtocolBuilder.js +2 -0
- package/lib/cjs/api/LedgerKeyringProtocolBuilder.js.map +7 -0
- package/lib/cjs/api/app-binder/AddToTrustchainDeviceActionTypes.js +2 -0
- package/lib/cjs/api/app-binder/AddToTrustchainDeviceActionTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/AuthenticateDeviceActionTypes.js +2 -0
- package/lib/cjs/api/app-binder/AuthenticateDeviceActionTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/Errors.js +2 -0
- package/lib/cjs/api/app-binder/Errors.js.map +7 -0
- package/lib/cjs/api/app-binder/GetAppNameCommandTypes.js +2 -0
- package/lib/cjs/api/app-binder/GetAppNameCommandTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/GetSeedIdCommandTypes.js +2 -0
- package/lib/cjs/api/app-binder/GetSeedIdCommandTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/GetVersionCommandTypes.js +2 -0
- package/lib/cjs/api/app-binder/GetVersionCommandTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/GetVersionDeviceActionTypes.js +2 -0
- package/lib/cjs/api/app-binder/GetVersionDeviceActionTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/InitCommandTypes.js +2 -0
- package/lib/cjs/api/app-binder/InitCommandTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/KeypairFromBytes.js +2 -0
- package/lib/cjs/api/app-binder/KeypairFromBytes.js.map +7 -0
- package/lib/cjs/api/app-binder/LKRPTypes.js +2 -0
- package/lib/cjs/api/app-binder/LKRPTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/ParseStreamBlockCommandCommandTypes.js +2 -0
- package/lib/cjs/api/app-binder/ParseStreamBlockCommandCommandTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/ParseStreamBlockHeaderCommandTypes.js +2 -0
- package/lib/cjs/api/app-binder/ParseStreamBlockHeaderCommandTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/ParseStreamBlockSignatureTypes.js +2 -0
- package/lib/cjs/api/app-binder/ParseStreamBlockSignatureTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/SetTrustedMemberTypes.js +2 -0
- package/lib/cjs/api/app-binder/SetTrustedMemberTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/SignBlockCommandTypes.js +2 -0
- package/lib/cjs/api/app-binder/SignBlockCommandTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/SignBlockHeaderCommandTypes.js +2 -0
- package/lib/cjs/api/app-binder/SignBlockHeaderCommandTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/SignBlockSignatureCommandTypes.js +2 -0
- package/lib/cjs/api/app-binder/SignBlockSignatureCommandTypes.js.map +7 -0
- package/lib/cjs/api/app-binder/SignBlockSingleCommandTypes.js +2 -0
- package/lib/cjs/api/app-binder/SignBlockSingleCommandTypes.js.map +7 -0
- package/lib/cjs/api/index.js +2 -0
- package/lib/cjs/api/index.js.map +7 -0
- package/lib/cjs/index.js +2 -0
- package/lib/cjs/index.js.map +7 -0
- package/lib/cjs/internal/DefaultLedgerKeyringProtocol.js +2 -0
- package/lib/cjs/internal/DefaultLedgerKeyringProtocol.js.map +7 -0
- package/lib/cjs/internal/app-binder/LedgerKeyringProtocolBinder.js +2 -0
- package/lib/cjs/internal/app-binder/LedgerKeyringProtocolBinder.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/GetAppNameCommand.js +2 -0
- package/lib/cjs/internal/app-binder/command/GetAppNameCommand.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/GetSeedIdCommand.js +2 -0
- package/lib/cjs/internal/app-binder/command/GetSeedIdCommand.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/GetSeedIdCommand.test.js +27 -0
- package/lib/cjs/internal/app-binder/command/GetSeedIdCommand.test.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/GetVersionCommand.js +2 -0
- package/lib/cjs/internal/app-binder/command/GetVersionCommand.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/InitCommand.js +2 -0
- package/lib/cjs/internal/app-binder/command/InitCommand.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/InitCommand.test.js +2 -0
- package/lib/cjs/internal/app-binder/command/InitCommand.test.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/ParseBlockSignatureCommand.js +2 -0
- package/lib/cjs/internal/app-binder/command/ParseBlockSignatureCommand.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/ParseBlockSignatureCommand.test.js +2 -0
- package/lib/cjs/internal/app-binder/command/ParseBlockSignatureCommand.test.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/ParseStreamBlockCommand.js +2 -0
- package/lib/cjs/internal/app-binder/command/ParseStreamBlockCommand.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/ParseStreamBlockCommand.test.js +2 -0
- package/lib/cjs/internal/app-binder/command/ParseStreamBlockCommand.test.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/ParseStreamBlockHeader.js +2 -0
- package/lib/cjs/internal/app-binder/command/ParseStreamBlockHeader.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/ParseStreamBlockHeader.test.js +2 -0
- package/lib/cjs/internal/app-binder/command/ParseStreamBlockHeader.test.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/SetTrustedMemberCommand.js +2 -0
- package/lib/cjs/internal/app-binder/command/SetTrustedMemberCommand.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/SetTrustedMemberCommand.test.js +2 -0
- package/lib/cjs/internal/app-binder/command/SetTrustedMemberCommand.test.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/SignBlockHeader.js +2 -0
- package/lib/cjs/internal/app-binder/command/SignBlockHeader.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/SignBlockHeader.test.js +2 -0
- package/lib/cjs/internal/app-binder/command/SignBlockHeader.test.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/SignBlockSignatureCommand.js +2 -0
- package/lib/cjs/internal/app-binder/command/SignBlockSignatureCommand.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/SignBlockSignatureCommand.test.js +2 -0
- package/lib/cjs/internal/app-binder/command/SignBlockSignatureCommand.test.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/SignBlockSingleCommand.js +2 -0
- package/lib/cjs/internal/app-binder/command/SignBlockSingleCommand.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/SignBlockSingleCommand.test.js +2 -0
- package/lib/cjs/internal/app-binder/command/SignBlockSingleCommand.test.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/utils/extractTrustedProperty.js +2 -0
- package/lib/cjs/internal/app-binder/command/utils/extractTrustedProperty.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/utils/ledgerKeyringProtocolErrors.js +2 -0
- package/lib/cjs/internal/app-binder/command/utils/ledgerKeyringProtocolErrors.js.map +7 -0
- package/lib/cjs/internal/app-binder/device-action/AddToTrustchainDeviceAction.js +2 -0
- package/lib/cjs/internal/app-binder/device-action/AddToTrustchainDeviceAction.js.map +7 -0
- package/lib/cjs/internal/app-binder/device-action/AuthenticateDeviceAction.js +2 -0
- package/lib/cjs/internal/app-binder/device-action/AuthenticateDeviceAction.js.map +7 -0
- package/lib/cjs/internal/app-binder/device-action/utils/raiseAndAssign.js +2 -0
- package/lib/cjs/internal/app-binder/device-action/utils/raiseAndAssign.js.map +7 -0
- package/lib/cjs/internal/app-binder/di/appBinderModule.js +2 -0
- package/lib/cjs/internal/app-binder/di/appBinderModule.js.map +7 -0
- package/lib/cjs/internal/app-binder/di/appBinderTypes.js +2 -0
- package/lib/cjs/internal/app-binder/di/appBinderTypes.js.map +7 -0
- package/lib/cjs/internal/app-binder/task/InitTask.js +2 -0
- package/lib/cjs/internal/app-binder/task/InitTask.js.map +7 -0
- package/lib/cjs/internal/app-binder/task/ParseStreamToDeviceTask.js +2 -0
- package/lib/cjs/internal/app-binder/task/ParseStreamToDeviceTask.js.map +7 -0
- package/lib/cjs/internal/app-binder/task/SignBlockTask.js +2 -0
- package/lib/cjs/internal/app-binder/task/SignBlockTask.js.map +7 -0
- package/lib/cjs/internal/app-binder/task/SignChallengeWithDeviceTask.js +2 -0
- package/lib/cjs/internal/app-binder/task/SignChallengeWithDeviceTask.js.map +7 -0
- package/lib/cjs/internal/app-binder/task/SignChallengeWithKeypairTask.js +2 -0
- package/lib/cjs/internal/app-binder/task/SignChallengeWithKeypairTask.js.map +7 -0
- package/lib/cjs/internal/app-binder/task/SignChallengeWithKeypairTask.test.js +2 -0
- package/lib/cjs/internal/app-binder/task/SignChallengeWithKeypairTask.test.js.map +7 -0
- package/lib/cjs/internal/app-binder/task/utils/TrustedProperties.js +2 -0
- package/lib/cjs/internal/app-binder/task/utils/TrustedProperties.js.map +7 -0
- package/lib/cjs/internal/di.js +2 -0
- package/lib/cjs/internal/di.js.map +7 -0
- package/lib/cjs/internal/externalTypes.js +2 -0
- package/lib/cjs/internal/externalTypes.js.map +7 -0
- package/lib/cjs/internal/lkrp-datasource/data/HttpLKRPDataSource.js +2 -0
- package/lib/cjs/internal/lkrp-datasource/data/HttpLKRPDataSource.js.map +7 -0
- package/lib/cjs/internal/lkrp-datasource/data/HttpLKRPDataSource.test.js +2 -0
- package/lib/cjs/internal/lkrp-datasource/data/HttpLKRPDataSource.test.js.map +7 -0
- package/lib/cjs/internal/lkrp-datasource/data/LKRPDataSource.js +2 -0
- package/lib/cjs/internal/lkrp-datasource/data/LKRPDataSource.js.map +7 -0
- package/lib/cjs/internal/lkrp-datasource/di/lkrpDatasourceModuleFactory.js +2 -0
- package/lib/cjs/internal/lkrp-datasource/di/lkrpDatasourceModuleFactory.js.map +7 -0
- package/lib/cjs/internal/lkrp-datasource/di/lkrpDatasourceTypes.js +2 -0
- package/lib/cjs/internal/lkrp-datasource/di/lkrpDatasourceTypes.js.map +7 -0
- package/lib/cjs/internal/use-cases/authentication/AuthenticateUseCase.js +2 -0
- package/lib/cjs/internal/use-cases/authentication/AuthenticateUseCase.js.map +7 -0
- package/lib/cjs/internal/use-cases/di/useCasesModule.js +2 -0
- package/lib/cjs/internal/use-cases/di/useCasesModule.js.map +7 -0
- package/lib/cjs/internal/use-cases/di/useCasesTypes.js +2 -0
- package/lib/cjs/internal/use-cases/di/useCasesTypes.js.map +7 -0
- package/lib/cjs/internal/utils/LKRPBlock.js +5 -0
- package/lib/cjs/internal/utils/LKRPBlock.js.map +7 -0
- package/lib/cjs/internal/utils/LKRPBlock.test.js +24 -0
- package/lib/cjs/internal/utils/LKRPBlock.test.js.map +7 -0
- package/lib/cjs/internal/utils/LKRPBlockStream.js +4 -0
- package/lib/cjs/internal/utils/LKRPBlockStream.js.map +7 -0
- package/lib/cjs/internal/utils/LKRPBlockStream.test.js +39 -0
- package/lib/cjs/internal/utils/LKRPBlockStream.test.js.map +7 -0
- package/lib/cjs/internal/utils/LKRPCommand.js +3 -0
- package/lib/cjs/internal/utils/LKRPCommand.js.map +7 -0
- package/lib/cjs/internal/utils/LKRPCommand.test.js +3 -0
- package/lib/cjs/internal/utils/LKRPCommand.test.js.map +7 -0
- package/lib/cjs/internal/utils/TLVBuilder.js +2 -0
- package/lib/cjs/internal/utils/TLVBuilder.js.map +7 -0
- package/lib/cjs/internal/utils/TLVParser.js +2 -0
- package/lib/cjs/internal/utils/TLVParser.js.map +7 -0
- package/lib/cjs/internal/utils/TLVParser.test.js +2 -0
- package/lib/cjs/internal/utils/TLVParser.test.js.map +7 -0
- package/lib/cjs/internal/utils/TLVTags.js +2 -0
- package/lib/cjs/internal/utils/TLVTags.js.map +7 -0
- package/lib/cjs/internal/utils/crypto.js +2 -0
- package/lib/cjs/internal/utils/crypto.js.map +7 -0
- package/lib/cjs/internal/utils/derivationPath.js +2 -0
- package/lib/cjs/internal/utils/derivationPath.js.map +7 -0
- package/lib/cjs/internal/utils/eitherSeqRecord.js +2 -0
- package/lib/cjs/internal/utils/eitherSeqRecord.js.map +7 -0
- package/lib/cjs/internal/utils/hex.js +2 -0
- package/lib/cjs/internal/utils/hex.js.map +7 -0
- package/lib/cjs/internal/utils/required.js +2 -0
- package/lib/cjs/internal/utils/required.js.map +7 -0
- package/lib/cjs/internal/utils/types.js +2 -0
- package/lib/cjs/internal/utils/types.js.map +7 -0
- package/lib/cjs/package.json +55 -0
- package/lib/esm/api/LedgerKeyringProtocol.js +1 -0
- package/lib/esm/api/LedgerKeyringProtocol.js.map +7 -0
- package/lib/esm/api/LedgerKeyringProtocolBuilder.js +2 -0
- package/lib/esm/api/LedgerKeyringProtocolBuilder.js.map +7 -0
- package/lib/esm/api/app-binder/AddToTrustchainDeviceActionTypes.js +1 -0
- package/lib/esm/api/app-binder/AddToTrustchainDeviceActionTypes.js.map +7 -0
- package/lib/esm/api/app-binder/AuthenticateDeviceActionTypes.js +1 -0
- package/lib/esm/api/app-binder/AuthenticateDeviceActionTypes.js.map +7 -0
- package/lib/esm/api/app-binder/Errors.js +2 -0
- package/lib/esm/api/app-binder/Errors.js.map +7 -0
- package/lib/esm/api/app-binder/GetAppNameCommandTypes.js +1 -0
- package/lib/esm/api/app-binder/GetAppNameCommandTypes.js.map +7 -0
- package/lib/esm/api/app-binder/GetSeedIdCommandTypes.js +1 -0
- package/lib/esm/api/app-binder/GetSeedIdCommandTypes.js.map +7 -0
- package/lib/esm/api/app-binder/GetVersionCommandTypes.js +1 -0
- package/lib/esm/api/app-binder/GetVersionCommandTypes.js.map +7 -0
- package/lib/esm/api/app-binder/GetVersionDeviceActionTypes.js +1 -0
- package/lib/esm/api/app-binder/GetVersionDeviceActionTypes.js.map +7 -0
- package/lib/esm/api/app-binder/InitCommandTypes.js +1 -0
- package/lib/esm/api/app-binder/InitCommandTypes.js.map +7 -0
- package/lib/esm/api/app-binder/KeypairFromBytes.js +2 -0
- package/lib/esm/api/app-binder/KeypairFromBytes.js.map +7 -0
- package/lib/esm/api/app-binder/LKRPTypes.js +2 -0
- package/lib/esm/api/app-binder/LKRPTypes.js.map +7 -0
- package/lib/esm/api/app-binder/ParseStreamBlockCommandCommandTypes.js +1 -0
- package/lib/esm/api/app-binder/ParseStreamBlockCommandCommandTypes.js.map +7 -0
- package/lib/esm/api/app-binder/ParseStreamBlockHeaderCommandTypes.js +1 -0
- package/lib/esm/api/app-binder/ParseStreamBlockHeaderCommandTypes.js.map +7 -0
- package/lib/esm/api/app-binder/ParseStreamBlockSignatureTypes.js +1 -0
- package/lib/esm/api/app-binder/ParseStreamBlockSignatureTypes.js.map +7 -0
- package/lib/esm/api/app-binder/SetTrustedMemberTypes.js +1 -0
- package/lib/esm/api/app-binder/SetTrustedMemberTypes.js.map +7 -0
- package/lib/esm/api/app-binder/SignBlockCommandTypes.js +1 -0
- package/lib/esm/api/app-binder/SignBlockCommandTypes.js.map +7 -0
- package/lib/esm/api/app-binder/SignBlockHeaderCommandTypes.js +1 -0
- package/lib/esm/api/app-binder/SignBlockHeaderCommandTypes.js.map +7 -0
- package/lib/esm/api/app-binder/SignBlockSignatureCommandTypes.js +1 -0
- package/lib/esm/api/app-binder/SignBlockSignatureCommandTypes.js.map +7 -0
- package/lib/esm/api/app-binder/SignBlockSingleCommandTypes.js +1 -0
- package/lib/esm/api/app-binder/SignBlockSingleCommandTypes.js.map +7 -0
- package/lib/esm/api/index.js +2 -0
- package/lib/esm/api/index.js.map +7 -0
- package/lib/esm/index.js +2 -0
- package/lib/esm/index.js.map +7 -0
- package/lib/esm/internal/DefaultLedgerKeyringProtocol.js +2 -0
- package/lib/esm/internal/DefaultLedgerKeyringProtocol.js.map +7 -0
- package/lib/esm/internal/app-binder/LedgerKeyringProtocolBinder.js +2 -0
- package/lib/esm/internal/app-binder/LedgerKeyringProtocolBinder.js.map +7 -0
- package/lib/esm/internal/app-binder/command/GetAppNameCommand.js +2 -0
- package/lib/esm/internal/app-binder/command/GetAppNameCommand.js.map +7 -0
- package/lib/esm/internal/app-binder/command/GetSeedIdCommand.js +2 -0
- package/lib/esm/internal/app-binder/command/GetSeedIdCommand.js.map +7 -0
- package/lib/esm/internal/app-binder/command/GetSeedIdCommand.test.js +27 -0
- package/lib/esm/internal/app-binder/command/GetSeedIdCommand.test.js.map +7 -0
- package/lib/esm/internal/app-binder/command/GetVersionCommand.js +2 -0
- package/lib/esm/internal/app-binder/command/GetVersionCommand.js.map +7 -0
- package/lib/esm/internal/app-binder/command/InitCommand.js +2 -0
- package/lib/esm/internal/app-binder/command/InitCommand.js.map +7 -0
- package/lib/esm/internal/app-binder/command/InitCommand.test.js +2 -0
- package/lib/esm/internal/app-binder/command/InitCommand.test.js.map +7 -0
- package/lib/esm/internal/app-binder/command/ParseBlockSignatureCommand.js +2 -0
- package/lib/esm/internal/app-binder/command/ParseBlockSignatureCommand.js.map +7 -0
- package/lib/esm/internal/app-binder/command/ParseBlockSignatureCommand.test.js +2 -0
- package/lib/esm/internal/app-binder/command/ParseBlockSignatureCommand.test.js.map +7 -0
- package/lib/esm/internal/app-binder/command/ParseStreamBlockCommand.js +2 -0
- package/lib/esm/internal/app-binder/command/ParseStreamBlockCommand.js.map +7 -0
- package/lib/esm/internal/app-binder/command/ParseStreamBlockCommand.test.js +2 -0
- package/lib/esm/internal/app-binder/command/ParseStreamBlockCommand.test.js.map +7 -0
- package/lib/esm/internal/app-binder/command/ParseStreamBlockHeader.js +2 -0
- package/lib/esm/internal/app-binder/command/ParseStreamBlockHeader.js.map +7 -0
- package/lib/esm/internal/app-binder/command/ParseStreamBlockHeader.test.js +2 -0
- package/lib/esm/internal/app-binder/command/ParseStreamBlockHeader.test.js.map +7 -0
- package/lib/esm/internal/app-binder/command/SetTrustedMemberCommand.js +2 -0
- package/lib/esm/internal/app-binder/command/SetTrustedMemberCommand.js.map +7 -0
- package/lib/esm/internal/app-binder/command/SetTrustedMemberCommand.test.js +2 -0
- package/lib/esm/internal/app-binder/command/SetTrustedMemberCommand.test.js.map +7 -0
- package/lib/esm/internal/app-binder/command/SignBlockHeader.js +2 -0
- package/lib/esm/internal/app-binder/command/SignBlockHeader.js.map +7 -0
- package/lib/esm/internal/app-binder/command/SignBlockHeader.test.js +2 -0
- package/lib/esm/internal/app-binder/command/SignBlockHeader.test.js.map +7 -0
- package/lib/esm/internal/app-binder/command/SignBlockSignatureCommand.js +2 -0
- package/lib/esm/internal/app-binder/command/SignBlockSignatureCommand.js.map +7 -0
- package/lib/esm/internal/app-binder/command/SignBlockSignatureCommand.test.js +2 -0
- package/lib/esm/internal/app-binder/command/SignBlockSignatureCommand.test.js.map +7 -0
- package/lib/esm/internal/app-binder/command/SignBlockSingleCommand.js +2 -0
- package/lib/esm/internal/app-binder/command/SignBlockSingleCommand.js.map +7 -0
- package/lib/esm/internal/app-binder/command/SignBlockSingleCommand.test.js +2 -0
- package/lib/esm/internal/app-binder/command/SignBlockSingleCommand.test.js.map +7 -0
- package/lib/esm/internal/app-binder/command/utils/extractTrustedProperty.js +2 -0
- package/lib/esm/internal/app-binder/command/utils/extractTrustedProperty.js.map +7 -0
- package/lib/esm/internal/app-binder/command/utils/ledgerKeyringProtocolErrors.js +2 -0
- package/lib/esm/internal/app-binder/command/utils/ledgerKeyringProtocolErrors.js.map +7 -0
- package/lib/esm/internal/app-binder/device-action/AddToTrustchainDeviceAction.js +2 -0
- package/lib/esm/internal/app-binder/device-action/AddToTrustchainDeviceAction.js.map +7 -0
- package/lib/esm/internal/app-binder/device-action/AuthenticateDeviceAction.js +2 -0
- package/lib/esm/internal/app-binder/device-action/AuthenticateDeviceAction.js.map +7 -0
- package/lib/esm/internal/app-binder/device-action/utils/raiseAndAssign.js +2 -0
- package/lib/esm/internal/app-binder/device-action/utils/raiseAndAssign.js.map +7 -0
- package/lib/esm/internal/app-binder/di/appBinderModule.js +2 -0
- package/lib/esm/internal/app-binder/di/appBinderModule.js.map +7 -0
- package/lib/esm/internal/app-binder/di/appBinderTypes.js +2 -0
- package/lib/esm/internal/app-binder/di/appBinderTypes.js.map +7 -0
- package/lib/esm/internal/app-binder/task/InitTask.js +2 -0
- package/lib/esm/internal/app-binder/task/InitTask.js.map +7 -0
- package/lib/esm/internal/app-binder/task/ParseStreamToDeviceTask.js +2 -0
- package/lib/esm/internal/app-binder/task/ParseStreamToDeviceTask.js.map +7 -0
- package/lib/esm/internal/app-binder/task/SignBlockTask.js +2 -0
- package/lib/esm/internal/app-binder/task/SignBlockTask.js.map +7 -0
- package/lib/esm/internal/app-binder/task/SignChallengeWithDeviceTask.js +2 -0
- package/lib/esm/internal/app-binder/task/SignChallengeWithDeviceTask.js.map +7 -0
- package/lib/esm/internal/app-binder/task/SignChallengeWithKeypairTask.js +2 -0
- package/lib/esm/internal/app-binder/task/SignChallengeWithKeypairTask.js.map +7 -0
- package/lib/esm/internal/app-binder/task/SignChallengeWithKeypairTask.test.js +2 -0
- package/lib/esm/internal/app-binder/task/SignChallengeWithKeypairTask.test.js.map +7 -0
- package/lib/esm/internal/app-binder/task/utils/TrustedProperties.js +2 -0
- package/lib/esm/internal/app-binder/task/utils/TrustedProperties.js.map +7 -0
- package/lib/esm/internal/di.js +2 -0
- package/lib/esm/internal/di.js.map +7 -0
- package/lib/esm/internal/externalTypes.js +2 -0
- package/lib/esm/internal/externalTypes.js.map +7 -0
- package/lib/esm/internal/lkrp-datasource/data/HttpLKRPDataSource.js +2 -0
- package/lib/esm/internal/lkrp-datasource/data/HttpLKRPDataSource.js.map +7 -0
- package/lib/esm/internal/lkrp-datasource/data/HttpLKRPDataSource.test.js +2 -0
- package/lib/esm/internal/lkrp-datasource/data/HttpLKRPDataSource.test.js.map +7 -0
- package/lib/esm/internal/lkrp-datasource/data/LKRPDataSource.js +1 -0
- package/lib/esm/internal/lkrp-datasource/data/LKRPDataSource.js.map +7 -0
- package/lib/esm/internal/lkrp-datasource/di/lkrpDatasourceModuleFactory.js +2 -0
- package/lib/esm/internal/lkrp-datasource/di/lkrpDatasourceModuleFactory.js.map +7 -0
- package/lib/esm/internal/lkrp-datasource/di/lkrpDatasourceTypes.js +2 -0
- package/lib/esm/internal/lkrp-datasource/di/lkrpDatasourceTypes.js.map +7 -0
- package/lib/esm/internal/use-cases/authentication/AuthenticateUseCase.js +2 -0
- package/lib/esm/internal/use-cases/authentication/AuthenticateUseCase.js.map +7 -0
- package/lib/esm/internal/use-cases/di/useCasesModule.js +2 -0
- package/lib/esm/internal/use-cases/di/useCasesModule.js.map +7 -0
- package/lib/esm/internal/use-cases/di/useCasesTypes.js +2 -0
- package/lib/esm/internal/use-cases/di/useCasesTypes.js.map +7 -0
- package/lib/esm/internal/utils/LKRPBlock.js +5 -0
- package/lib/esm/internal/utils/LKRPBlock.js.map +7 -0
- package/lib/esm/internal/utils/LKRPBlock.test.js +24 -0
- package/lib/esm/internal/utils/LKRPBlock.test.js.map +7 -0
- package/lib/esm/internal/utils/LKRPBlockStream.js +4 -0
- package/lib/esm/internal/utils/LKRPBlockStream.js.map +7 -0
- package/lib/esm/internal/utils/LKRPBlockStream.test.js +39 -0
- package/lib/esm/internal/utils/LKRPBlockStream.test.js.map +7 -0
- package/lib/esm/internal/utils/LKRPCommand.js +3 -0
- package/lib/esm/internal/utils/LKRPCommand.js.map +7 -0
- package/lib/esm/internal/utils/LKRPCommand.test.js +3 -0
- package/lib/esm/internal/utils/LKRPCommand.test.js.map +7 -0
- package/lib/esm/internal/utils/TLVBuilder.js +2 -0
- package/lib/esm/internal/utils/TLVBuilder.js.map +7 -0
- package/lib/esm/internal/utils/TLVParser.js +2 -0
- package/lib/esm/internal/utils/TLVParser.js.map +7 -0
- package/lib/esm/internal/utils/TLVParser.test.js +2 -0
- package/lib/esm/internal/utils/TLVParser.test.js.map +7 -0
- package/lib/esm/internal/utils/TLVTags.js +2 -0
- package/lib/esm/internal/utils/TLVTags.js.map +7 -0
- package/lib/esm/internal/utils/crypto.js +2 -0
- package/lib/esm/internal/utils/crypto.js.map +7 -0
- package/lib/esm/internal/utils/derivationPath.js +2 -0
- package/lib/esm/internal/utils/derivationPath.js.map +7 -0
- package/lib/esm/internal/utils/eitherSeqRecord.js +2 -0
- package/lib/esm/internal/utils/eitherSeqRecord.js.map +7 -0
- package/lib/esm/internal/utils/hex.js +2 -0
- package/lib/esm/internal/utils/hex.js.map +7 -0
- package/lib/esm/internal/utils/required.js +2 -0
- package/lib/esm/internal/utils/required.js.map +7 -0
- package/lib/esm/internal/utils/types.js +1 -0
- package/lib/esm/internal/utils/types.js.map +7 -0
- package/lib/esm/package.json +55 -0
- package/lib/types/api/LedgerKeyringProtocol.d.ts +9 -0
- package/lib/types/api/LedgerKeyringProtocol.d.ts.map +1 -0
- package/lib/types/api/LedgerKeyringProtocolBuilder.d.ts +14 -0
- package/lib/types/api/LedgerKeyringProtocolBuilder.d.ts.map +1 -0
- package/lib/types/api/app-binder/AddToTrustchainDeviceActionTypes.d.ts +27 -0
- package/lib/types/api/app-binder/AddToTrustchainDeviceActionTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/AuthenticateDeviceActionTypes.d.ts +37 -0
- package/lib/types/api/app-binder/AuthenticateDeviceActionTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/Errors.d.ts +27 -0
- package/lib/types/api/app-binder/Errors.d.ts.map +1 -0
- package/lib/types/api/app-binder/GetAppNameCommandTypes.d.ts +5 -0
- package/lib/types/api/app-binder/GetAppNameCommandTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/GetSeedIdCommandTypes.d.ts +14 -0
- package/lib/types/api/app-binder/GetSeedIdCommandTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/GetVersionCommandTypes.d.ts +5 -0
- package/lib/types/api/app-binder/GetVersionCommandTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/GetVersionDeviceActionTypes.d.ts +10 -0
- package/lib/types/api/app-binder/GetVersionDeviceActionTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/InitCommandTypes.d.ts +5 -0
- package/lib/types/api/app-binder/InitCommandTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/KeypairFromBytes.d.ts +11 -0
- package/lib/types/api/app-binder/KeypairFromBytes.d.ts.map +1 -0
- package/lib/types/api/app-binder/LKRPTypes.d.ts +24 -0
- package/lib/types/api/app-binder/LKRPTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/ParseStreamBlockCommandCommandTypes.d.ts +6 -0
- package/lib/types/api/app-binder/ParseStreamBlockCommandCommandTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/ParseStreamBlockHeaderCommandTypes.d.ts +5 -0
- package/lib/types/api/app-binder/ParseStreamBlockHeaderCommandTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/ParseStreamBlockSignatureTypes.d.ts +5 -0
- package/lib/types/api/app-binder/ParseStreamBlockSignatureTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/SetTrustedMemberTypes.d.ts +6 -0
- package/lib/types/api/app-binder/SetTrustedMemberTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/SignBlockCommandTypes.d.ts +9 -0
- package/lib/types/api/app-binder/SignBlockCommandTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/SignBlockHeaderCommandTypes.d.ts +5 -0
- package/lib/types/api/app-binder/SignBlockHeaderCommandTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/SignBlockSignatureCommandTypes.d.ts +6 -0
- package/lib/types/api/app-binder/SignBlockSignatureCommandTypes.d.ts.map +1 -0
- package/lib/types/api/app-binder/SignBlockSingleCommandTypes.d.ts +5 -0
- package/lib/types/api/app-binder/SignBlockSingleCommandTypes.d.ts.map +1 -0
- package/lib/types/api/index.d.ts +7 -0
- package/lib/types/api/index.d.ts.map +1 -0
- package/lib/types/index.d.ts +3 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/internal/DefaultLedgerKeyringProtocol.d.ts +20 -0
- package/lib/types/internal/DefaultLedgerKeyringProtocol.d.ts.map +1 -0
- package/lib/types/internal/app-binder/LedgerKeyringProtocolBinder.d.ts +29 -0
- package/lib/types/internal/app-binder/LedgerKeyringProtocolBinder.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/GetAppNameCommand.d.ts +9 -0
- package/lib/types/internal/app-binder/command/GetAppNameCommand.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/GetSeedIdCommand.d.ts +11 -0
- package/lib/types/internal/app-binder/command/GetSeedIdCommand.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/GetSeedIdCommand.test.d.ts +2 -0
- package/lib/types/internal/app-binder/command/GetSeedIdCommand.test.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/GetVersionCommand.d.ts +9 -0
- package/lib/types/internal/app-binder/command/GetVersionCommand.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/InitCommand.d.ts +11 -0
- package/lib/types/internal/app-binder/command/InitCommand.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/InitCommand.test.d.ts +2 -0
- package/lib/types/internal/app-binder/command/InitCommand.test.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/ParseBlockSignatureCommand.d.ts +11 -0
- package/lib/types/internal/app-binder/command/ParseBlockSignatureCommand.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/ParseBlockSignatureCommand.test.d.ts +2 -0
- package/lib/types/internal/app-binder/command/ParseBlockSignatureCommand.test.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/ParseStreamBlockCommand.d.ts +11 -0
- package/lib/types/internal/app-binder/command/ParseStreamBlockCommand.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/ParseStreamBlockCommand.test.d.ts +2 -0
- package/lib/types/internal/app-binder/command/ParseStreamBlockCommand.test.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/ParseStreamBlockHeader.d.ts +11 -0
- package/lib/types/internal/app-binder/command/ParseStreamBlockHeader.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/ParseStreamBlockHeader.test.d.ts +2 -0
- package/lib/types/internal/app-binder/command/ParseStreamBlockHeader.test.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/SetTrustedMemberCommand.d.ts +11 -0
- package/lib/types/internal/app-binder/command/SetTrustedMemberCommand.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/SetTrustedMemberCommand.test.d.ts +2 -0
- package/lib/types/internal/app-binder/command/SetTrustedMemberCommand.test.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/SignBlockHeader.d.ts +11 -0
- package/lib/types/internal/app-binder/command/SignBlockHeader.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/SignBlockHeader.test.d.ts +2 -0
- package/lib/types/internal/app-binder/command/SignBlockHeader.test.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/SignBlockSignatureCommand.d.ts +10 -0
- package/lib/types/internal/app-binder/command/SignBlockSignatureCommand.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/SignBlockSignatureCommand.test.d.ts +2 -0
- package/lib/types/internal/app-binder/command/SignBlockSignatureCommand.test.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/SignBlockSingleCommand.d.ts +11 -0
- package/lib/types/internal/app-binder/command/SignBlockSingleCommand.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/SignBlockSingleCommand.test.d.ts +2 -0
- package/lib/types/internal/app-binder/command/SignBlockSingleCommand.test.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/utils/extractTrustedProperty.d.ts +4 -0
- package/lib/types/internal/app-binder/command/utils/extractTrustedProperty.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/utils/ledgerKeyringProtocolErrors.d.ts +9 -0
- package/lib/types/internal/app-binder/command/utils/ledgerKeyringProtocolErrors.d.ts.map +1 -0
- package/lib/types/internal/app-binder/device-action/AddToTrustchainDeviceAction.d.ts +20 -0
- package/lib/types/internal/app-binder/device-action/AddToTrustchainDeviceAction.d.ts.map +1 -0
- package/lib/types/internal/app-binder/device-action/AuthenticateDeviceAction.d.ts +42 -0
- package/lib/types/internal/app-binder/device-action/AuthenticateDeviceAction.d.ts.map +1 -0
- package/lib/types/internal/app-binder/device-action/utils/raiseAndAssign.d.ts +41 -0
- package/lib/types/internal/app-binder/device-action/utils/raiseAndAssign.d.ts.map +1 -0
- package/lib/types/internal/app-binder/di/appBinderModule.d.ts +3 -0
- package/lib/types/internal/app-binder/di/appBinderModule.d.ts.map +1 -0
- package/lib/types/internal/app-binder/di/appBinderTypes.d.ts +4 -0
- package/lib/types/internal/app-binder/di/appBinderTypes.d.ts.map +1 -0
- package/lib/types/internal/app-binder/task/InitTask.d.ts +10 -0
- package/lib/types/internal/app-binder/task/InitTask.d.ts.map +1 -0
- package/lib/types/internal/app-binder/task/ParseStreamToDeviceTask.d.ts +26 -0
- package/lib/types/internal/app-binder/task/ParseStreamToDeviceTask.d.ts.map +1 -0
- package/lib/types/internal/app-binder/task/SignBlockTask.d.ts +68 -0
- package/lib/types/internal/app-binder/task/SignBlockTask.d.ts.map +1 -0
- package/lib/types/internal/app-binder/task/SignChallengeWithDeviceTask.d.ts +10 -0
- package/lib/types/internal/app-binder/task/SignChallengeWithDeviceTask.d.ts.map +1 -0
- package/lib/types/internal/app-binder/task/SignChallengeWithKeypairTask.d.ts +15 -0
- package/lib/types/internal/app-binder/task/SignChallengeWithKeypairTask.d.ts.map +1 -0
- package/lib/types/internal/app-binder/task/SignChallengeWithKeypairTask.test.d.ts +2 -0
- package/lib/types/internal/app-binder/task/SignChallengeWithKeypairTask.test.d.ts.map +1 -0
- package/lib/types/internal/app-binder/task/utils/TrustedProperties.d.ts +26 -0
- package/lib/types/internal/app-binder/task/utils/TrustedProperties.d.ts.map +1 -0
- package/lib/types/internal/di.d.ts +10 -0
- package/lib/types/internal/di.d.ts.map +1 -0
- package/lib/types/internal/externalTypes.d.ts +14 -0
- package/lib/types/internal/externalTypes.d.ts.map +1 -0
- package/lib/types/internal/lkrp-datasource/data/HttpLKRPDataSource.d.ts +22 -0
- package/lib/types/internal/lkrp-datasource/data/HttpLKRPDataSource.d.ts.map +1 -0
- package/lib/types/internal/lkrp-datasource/data/HttpLKRPDataSource.test.d.ts +2 -0
- package/lib/types/internal/lkrp-datasource/data/HttpLKRPDataSource.test.d.ts.map +1 -0
- package/lib/types/internal/lkrp-datasource/data/LKRPDataSource.d.ts +54 -0
- package/lib/types/internal/lkrp-datasource/data/LKRPDataSource.d.ts.map +1 -0
- package/lib/types/internal/lkrp-datasource/di/lkrpDatasourceModuleFactory.d.ts +4 -0
- package/lib/types/internal/lkrp-datasource/di/lkrpDatasourceModuleFactory.d.ts.map +1 -0
- package/lib/types/internal/lkrp-datasource/di/lkrpDatasourceTypes.d.ts +5 -0
- package/lib/types/internal/lkrp-datasource/di/lkrpDatasourceTypes.d.ts.map +1 -0
- package/lib/types/internal/use-cases/authentication/AuthenticateUseCase.d.ts +9 -0
- package/lib/types/internal/use-cases/authentication/AuthenticateUseCase.d.ts.map +1 -0
- package/lib/types/internal/use-cases/di/useCasesModule.d.ts +3 -0
- package/lib/types/internal/use-cases/di/useCasesModule.d.ts.map +1 -0
- package/lib/types/internal/use-cases/di/useCasesTypes.d.ts +4 -0
- package/lib/types/internal/use-cases/di/useCasesTypes.d.ts.map +1 -0
- package/lib/types/internal/utils/LKRPBlock.d.ts +17 -0
- package/lib/types/internal/utils/LKRPBlock.d.ts.map +1 -0
- package/lib/types/internal/utils/LKRPBlock.test.d.ts +2 -0
- package/lib/types/internal/utils/LKRPBlock.test.d.ts.map +1 -0
- package/lib/types/internal/utils/LKRPBlockStream.d.ts +26 -0
- package/lib/types/internal/utils/LKRPBlockStream.d.ts.map +1 -0
- package/lib/types/internal/utils/LKRPBlockStream.test.d.ts +2 -0
- package/lib/types/internal/utils/LKRPBlockStream.test.d.ts.map +1 -0
- package/lib/types/internal/utils/LKRPCommand.d.ts +18 -0
- package/lib/types/internal/utils/LKRPCommand.d.ts.map +1 -0
- package/lib/types/internal/utils/LKRPCommand.test.d.ts +2 -0
- package/lib/types/internal/utils/LKRPCommand.test.d.ts.map +1 -0
- package/lib/types/internal/utils/TLVBuilder.d.ts +15 -0
- package/lib/types/internal/utils/TLVBuilder.d.ts.map +1 -0
- package/lib/types/internal/utils/TLVParser.d.ts +59 -0
- package/lib/types/internal/utils/TLVParser.d.ts.map +1 -0
- package/lib/types/internal/utils/TLVParser.test.d.ts +2 -0
- package/lib/types/internal/utils/TLVParser.test.d.ts.map +1 -0
- package/lib/types/internal/utils/TLVTags.d.ts +27 -0
- package/lib/types/internal/utils/TLVTags.d.ts.map +1 -0
- package/lib/types/internal/utils/crypto.d.ts +19 -0
- package/lib/types/internal/utils/crypto.d.ts.map +1 -0
- package/lib/types/internal/utils/derivationPath.d.ts +3 -0
- package/lib/types/internal/utils/derivationPath.d.ts.map +1 -0
- package/lib/types/internal/utils/eitherSeqRecord.d.ts +29 -0
- package/lib/types/internal/utils/eitherSeqRecord.d.ts.map +1 -0
- package/lib/types/internal/utils/hex.d.ts +3 -0
- package/lib/types/internal/utils/hex.d.ts.map +1 -0
- package/lib/types/internal/utils/required.d.ts +3 -0
- package/lib/types/internal/utils/required.d.ts.map +1 -0
- package/lib/types/internal/utils/types.d.ts +73 -0
- package/lib/types/internal/utils/types.d.ts.map +1 -0
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { type InternalApi, UnknownDAError } from "@ledgerhq/device-management-kit";
|
|
2
|
+
import { Either, EitherAsync } from "purify-ts";
|
|
3
|
+
import { type LKRPHttpRequestError, type LKRPMissingDataError, type LKRPParsingError } from "../../../api/app-binder/Errors";
|
|
4
|
+
import { type JWT, type Keypair } from "../../../api/index";
|
|
5
|
+
import { type LKRPDeviceCommandError } from "../../app-binder/command/utils/ledgerKeyringProtocolErrors";
|
|
6
|
+
import { type LKRPDataSource } from "../../lkrp-datasource/data/LKRPDataSource";
|
|
7
|
+
import { LKRPBlock } from "../../utils/LKRPBlock";
|
|
8
|
+
import { LKRPCommand } from "../../utils/LKRPCommand";
|
|
9
|
+
import { CommandTags } from "../../utils/TLVTags";
|
|
10
|
+
import { type EncryptedCommand, type EncryptedDeriveCommand, type EncryptedPublishKeyCommand } from "../../utils/types";
|
|
11
|
+
import { TrustedProperties } from "./utils/TrustedProperties";
|
|
12
|
+
type BlockFlow = {
|
|
13
|
+
type: "derive";
|
|
14
|
+
data: AddMemberBlockData;
|
|
15
|
+
} | {
|
|
16
|
+
type: "addMember";
|
|
17
|
+
data: AddMemberBlockData;
|
|
18
|
+
};
|
|
19
|
+
type AddMemberBlockData = {
|
|
20
|
+
name: string;
|
|
21
|
+
publicKey: Uint8Array;
|
|
22
|
+
permissions: number;
|
|
23
|
+
};
|
|
24
|
+
type HeaderPayload = {
|
|
25
|
+
iv: Uint8Array;
|
|
26
|
+
issuer: Uint8Array;
|
|
27
|
+
};
|
|
28
|
+
type SignaturePayload = {
|
|
29
|
+
secret: Uint8Array;
|
|
30
|
+
signature: Uint8Array;
|
|
31
|
+
};
|
|
32
|
+
type EncryptedBlock = {
|
|
33
|
+
header: HeaderPayload;
|
|
34
|
+
commands: EncryptedCommand[];
|
|
35
|
+
signature: SignaturePayload;
|
|
36
|
+
};
|
|
37
|
+
export type SignBlockError = LKRPDeviceCommandError | LKRPParsingError | LKRPMissingDataError | LKRPHttpRequestError | UnknownDAError;
|
|
38
|
+
export type SignBlockTaskInput = {
|
|
39
|
+
lkrpDataSource: LKRPDataSource;
|
|
40
|
+
trustchainId: string;
|
|
41
|
+
path: string;
|
|
42
|
+
jwt: JWT;
|
|
43
|
+
parent: Uint8Array;
|
|
44
|
+
blockFlow: BlockFlow;
|
|
45
|
+
sessionKeypair: Keypair;
|
|
46
|
+
};
|
|
47
|
+
export declare const ISSUER_PLACEHOLDER: Uint8Array<ArrayBuffer>;
|
|
48
|
+
export declare class SignBlockTask {
|
|
49
|
+
private readonly api;
|
|
50
|
+
constructor(api: InternalApi);
|
|
51
|
+
run({ lkrpDataSource, trustchainId, path, jwt, parent, blockFlow, sessionKeypair, }: SignBlockTaskInput): EitherAsync<SignBlockError, void>;
|
|
52
|
+
signBlockHeader(parent: Uint8Array, commandCount: number): EitherAsync<SignBlockError, HeaderPayload>;
|
|
53
|
+
signBlockSignature(sessionKeypair: Keypair): EitherAsync<SignBlockError, SignaturePayload>;
|
|
54
|
+
signCommands(applicationPath: string, block: BlockFlow): EitherAsync<SignBlockError, EncryptedCommand>[];
|
|
55
|
+
signSingleCommand(command: Uint8Array): EitherAsync<SignBlockError, TrustedProperties>;
|
|
56
|
+
signDeriveCommand(applicationPath: string): EitherAsync<SignBlockError, EncryptedDeriveCommand>;
|
|
57
|
+
signAddMemberCommand({ name, publicKey, permissions }: AddMemberBlockData): EitherAsync<SignBlockError, {
|
|
58
|
+
type: CommandTags.AddMember;
|
|
59
|
+
name: string;
|
|
60
|
+
publicKey: Uint8Array;
|
|
61
|
+
permissions: number;
|
|
62
|
+
}>;
|
|
63
|
+
signPublishKeyCommand({ publicKey }: Pick<AddMemberBlockData, "publicKey">): EitherAsync<SignBlockError, EncryptedPublishKeyCommand>;
|
|
64
|
+
decryptBlock(parent: Uint8Array, { header, commands, signature }: EncryptedBlock): Either<SignBlockError, LKRPBlock>;
|
|
65
|
+
decryptCommand(secret: Uint8Array, command: EncryptedCommand): Either<UnknownDAError, LKRPCommand>;
|
|
66
|
+
}
|
|
67
|
+
export {};
|
|
68
|
+
//# sourceMappingURL=SignBlockTask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignBlockTask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SignBlockTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,WAAW,EAChB,cAAc,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,WAAW,EAAe,MAAM,WAAW,CAAC;AAE7D,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EACtB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,KAAK,GAAG,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAIpD,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,gEAAgE,CAAC;AAC7G,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,+CAA+C,CAAC;AAMpF,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAe,MAAM,yBAAyB,CAAC;AACnE,OAAO,EAEL,KAAK,gBAAgB,EACrB,KAAK,sBAAsB,EAC3B,KAAK,0BAA0B,EAChC,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAE9D,KAAK,SAAS,GACV;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,GAC5C;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,IAAI,EAAE,kBAAkB,CAAA;CAAE,CAAC;AAEpD,KAAK,kBAAkB,GAAG;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,UAAU,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,EAAE,EAAE,UAAU,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;CACpB,CAAC;AACF,KAAK,gBAAgB,GAAG;IACtB,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,UAAU,CAAC;CACvB,CAAC;AAEF,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,aAAa,CAAC;IACtB,QAAQ,EAAE,gBAAgB,EAAE,CAAC;IAC7B,SAAS,EAAE,gBAAgB,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,cAAc,GACtB,sBAAsB,GACtB,gBAAgB,GAChB,oBAAoB,GACpB,oBAAoB,GACpB,cAAc,CAAC;AAEnB,MAAM,MAAM,kBAAkB,GAAG;IAC/B,cAAc,EAAE,cAAc,CAAC;IAC/B,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,GAAG,CAAC;IACT,MAAM,EAAE,UAAU,CAAC;IACnB,SAAS,EAAE,SAAS,CAAC;IACrB,cAAc,EAAE,OAAO,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,kBAAkB,yBAG7B,CAAC;AAEH,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,WAAW;IAE7C,GAAG,CAAC,EACF,cAAc,EACd,YAAY,EACZ,IAAI,EACJ,GAAG,EACH,MAAM,EACN,SAAS,EACT,cAAc,GACf,EAAE,kBAAkB,GAAG,WAAW,CAAC,cAAc,EAAE,IAAI,CAAC;IAoBzD,eAAe,CACb,MAAM,EAAE,UAAU,EAClB,YAAY,EAAE,MAAM,GACnB,WAAW,CAAC,cAAc,EAAE,aAAa,CAAC;IAgC7C,kBAAkB,CAChB,cAAc,EAAE,OAAO,GACtB,WAAW,CAAC,cAAc,EAAE,gBAAgB,CAAC;IAmBhD,YAAY,CACV,eAAe,EAAE,MAAM,EACvB,KAAK,EAAE,SAAS,GACf,WAAW,CAAC,cAAc,EAAE,gBAAgB,CAAC,EAAE;IAgBlD,iBAAiB,CAAC,OAAO,EAAE,UAAU;IAkBrC,iBAAiB,CAAC,eAAe,EAAE,MAAM;IAsBzC,oBAAoB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,EAAE,kBAAkB;;;;;;IAsBzE,qBAAqB,CAAC,EAAE,SAAS,EAAE,EAAE,IAAI,CAAC,kBAAkB,EAAE,WAAW,CAAC;IAqB1E,YAAY,CACV,MAAM,EAAE,UAAU,EAClB,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,cAAc,GAC9C,MAAM,CAAC,cAAc,EAAE,SAAS,CAAC;IAkBpC,cAAc,CACZ,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,gBAAgB,GACxB,MAAM,CAAC,cAAc,EAAE,WAAW,CAAC;CAuBvC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type InternalApi } from "@ledgerhq/device-management-kit";
|
|
2
|
+
import { type Either } from "purify-ts";
|
|
3
|
+
import { type LKRPDeviceCommandError } from "../../app-binder/command/utils/ledgerKeyringProtocolErrors";
|
|
4
|
+
import { type AuthenticationPayload, type Challenge } from "../../lkrp-datasource/data/LKRPDataSource";
|
|
5
|
+
export declare class SignChallengeWithDeviceTask {
|
|
6
|
+
private readonly api;
|
|
7
|
+
constructor(api: InternalApi);
|
|
8
|
+
run(challenge: Challenge): Promise<Either<LKRPDeviceCommandError, AuthenticationPayload>>;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=SignChallengeWithDeviceTask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignChallengeWithDeviceTask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SignChallengeWithDeviceTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,KAAK,MAAM,EAAe,MAAM,WAAW,CAAC;AAGrD,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,gEAAgE,CAAC;AAC7G,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACf,MAAM,+CAA+C,CAAC;AAEvD,qBAAa,2BAA2B;IAC1B,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,WAAW;IAEvC,GAAG,CACP,SAAS,EAAE,SAAS,GACnB,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,qBAAqB,CAAC,CAAC;CAelE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { UnknownDAError } from "@ledgerhq/device-management-kit";
|
|
2
|
+
import { EitherAsync } from "purify-ts";
|
|
3
|
+
import { LKRPMissingDataError } from "../../../api/app-binder/Errors";
|
|
4
|
+
import { type Keypair } from "../../../api/app-binder/LKRPTypes";
|
|
5
|
+
import { type AuthenticationPayload, type Challenge } from "../../lkrp-datasource/data/LKRPDataSource";
|
|
6
|
+
export declare class SignChallengeWithKeypairTask {
|
|
7
|
+
private readonly keypair;
|
|
8
|
+
private readonly trustchainId;
|
|
9
|
+
constructor(keypair: Keypair, trustchainId: string);
|
|
10
|
+
run(challenge: Challenge): EitherAsync<LKRPMissingDataError | UnknownDAError, AuthenticationPayload>;
|
|
11
|
+
private getAttestation;
|
|
12
|
+
private getCredential;
|
|
13
|
+
private getUnsignedChallengeTLV;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=SignChallengeWithKeypairTask.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignChallengeWithKeypairTask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SignChallengeWithKeypairTask.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,cAAc,EACf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAe,WAAW,EAAe,MAAM,WAAW,CAAC;AAElE,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,SAAS,EACf,MAAM,+CAA+C,CAAC;AAKvD,qBAAa,4BAA4B;IAErC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,OAAO,EAAE,OAAO,EAChB,YAAY,EAAE,MAAM;IAGvC,GAAG,CACD,SAAS,EAAE,SAAS,GACnB,WAAW,CAAC,oBAAoB,GAAG,cAAc,EAAE,qBAAqB,CAAC;IAoB5E,OAAO,CAAC,cAAc;IAMtB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,uBAAuB;CAqDhC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SignChallengeWithKeypairTask.test.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SignChallengeWithKeypairTask.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Either } from "purify-ts";
|
|
2
|
+
import { type LKRPMissingDataError, LKRPParsingError } from "../../../../api/app-binder/Errors";
|
|
3
|
+
import { TPTags } from "../../../utils/TLVTags";
|
|
4
|
+
type EncryptedTPTag = Exclude<TPTags, TPTags.IV>;
|
|
5
|
+
type EncryptedTP = {
|
|
6
|
+
tag: EncryptedTPTag;
|
|
7
|
+
value: Uint8Array;
|
|
8
|
+
tlv: Uint8Array;
|
|
9
|
+
};
|
|
10
|
+
export declare class TrustedProperties {
|
|
11
|
+
readonly bytes: Uint8Array;
|
|
12
|
+
private readonly parser;
|
|
13
|
+
private iv;
|
|
14
|
+
private encryptedProps;
|
|
15
|
+
constructor(bytes: Uint8Array);
|
|
16
|
+
getIv(): Either<LKRPParsingError, Uint8Array>;
|
|
17
|
+
getIssuer(): Either<LKRPParsingError | LKRPMissingDataError, Uint8Array>;
|
|
18
|
+
getXPriv(): Either<LKRPParsingError | LKRPMissingDataError, Uint8Array>;
|
|
19
|
+
getEphemeralPublicKey(): Either<LKRPParsingError | LKRPMissingDataError, Uint8Array>;
|
|
20
|
+
getCommandIv(): Either<LKRPParsingError | LKRPMissingDataError, Uint8Array>;
|
|
21
|
+
getGroupKey(): Either<LKRPParsingError | LKRPMissingDataError, Uint8Array>;
|
|
22
|
+
getNewMember(): Either<LKRPParsingError | LKRPMissingDataError, Uint8Array>;
|
|
23
|
+
parseEncryptedProps(): Either<LKRPParsingError, Map<EncryptedTPTag, EncryptedTP>>;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=TrustedProperties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TrustedProperties.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/app-binder/task/utils/TrustedProperties.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAe,MAAM,WAAW,CAAC;AAEhD,OAAO,EACL,KAAK,oBAAoB,EACzB,gBAAgB,EACjB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAC;AAEjD,KAAK,cAAc,GAAG,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;AACjD,KAAK,WAAW,GAAG;IAAE,GAAG,EAAE,cAAc,CAAC;IAAC,KAAK,EAAE,UAAU,CAAC;IAAC,GAAG,EAAE,UAAU,CAAA;CAAE,CAAC;AAE/E,qBAAa,iBAAiB;aAKA,KAAK,EAAE,UAAU;IAJ7C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IACzC,OAAO,CAAC,EAAE,CAA2B;IACrC,OAAO,CAAC,cAAc,CAAiD;gBAE3C,KAAK,EAAE,UAAU;IAI7C,KAAK,IAAI,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAc7C,SAAS,IAAI,MAAM,CAAC,gBAAgB,GAAG,oBAAoB,EAAE,UAAU,CAAC;IASxE,QAAQ,IAAI,MAAM,CAAC,gBAAgB,GAAG,oBAAoB,EAAE,UAAU,CAAC;IASvE,qBAAqB,IAAI,MAAM,CAC7B,gBAAgB,GAAG,oBAAoB,EACvC,UAAU,CACX;IASD,YAAY,IAAI,MAAM,CAAC,gBAAgB,GAAG,oBAAoB,EAAE,UAAU,CAAC;IAS3E,WAAW,IAAI,MAAM,CAAC,gBAAgB,GAAG,oBAAoB,EAAE,UAAU,CAAC;IAS1E,YAAY,IAAI,MAAM,CAAC,gBAAgB,GAAG,oBAAoB,EAAE,UAAU,CAAC;IAS3E,mBAAmB,IAAI,MAAM,CAC3B,gBAAgB,EAChB,GAAG,CAAC,cAAc,EAAE,WAAW,CAAC,CACjC;CAUF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type DeviceManagementKit, type DeviceSessionId } from "@ledgerhq/device-management-kit";
|
|
2
|
+
import { Container } from "inversify";
|
|
3
|
+
export type MakeContainerProps = {
|
|
4
|
+
dmk: DeviceManagementKit;
|
|
5
|
+
sessionId: DeviceSessionId;
|
|
6
|
+
baseUrl?: string;
|
|
7
|
+
stub?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const makeContainer: ({ dmk, sessionId, baseUrl, stub, }: MakeContainerProps) => Container;
|
|
10
|
+
//# sourceMappingURL=di.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"di.d.ts","sourceRoot":"","sources":["../../../src/internal/di.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,mBAAmB,EACxB,KAAK,eAAe,EACrB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAQtC,MAAM,MAAM,kBAAkB,GAAG;IAC/B,GAAG,EAAE,mBAAmB,CAAC;IACzB,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,aAAa,GAAI,oCAK3B,kBAAkB,cAepB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare const externalTypes: {
|
|
2
|
+
Dmk: symbol;
|
|
3
|
+
SessionId: symbol;
|
|
4
|
+
};
|
|
5
|
+
export type TrustedProperty = {
|
|
6
|
+
iv: Uint8Array;
|
|
7
|
+
issuer: Uint8Array;
|
|
8
|
+
xpriv: Uint8Array;
|
|
9
|
+
ephemeralPubKey: Uint8Array;
|
|
10
|
+
commandIV: Uint8Array;
|
|
11
|
+
groupKey: Uint8Array;
|
|
12
|
+
newMember: Uint8Array;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=externalTypes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"externalTypes.d.ts","sourceRoot":"","sources":["../../../src/internal/externalTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;;CAGzB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG;IAC5B,EAAE,EAAE,UAAU,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;IACnB,KAAK,EAAE,UAAU,CAAC;IAClB,eAAe,EAAE,UAAU,CAAC;IAC5B,SAAS,EAAE,UAAU,CAAC;IACtB,QAAQ,EAAE,UAAU,CAAC;IACrB,SAAS,EAAE,UAAU,CAAC;CACvB,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { EitherAsync, Maybe } from "purify-ts";
|
|
2
|
+
import { LKRPHttpRequestError } from "../../../api/app-binder/Errors";
|
|
3
|
+
import { JWT } from "../../../api/app-binder/LKRPTypes";
|
|
4
|
+
import { LKRPBlock } from "../../utils/LKRPBlock";
|
|
5
|
+
import { LKRPBlockStream } from "../../utils/LKRPBlockStream";
|
|
6
|
+
import { AuthenticationPayload, Challenge, LKRPDataSource } from "./LKRPDataSource";
|
|
7
|
+
export declare class HttpLKRPDataSource implements LKRPDataSource {
|
|
8
|
+
private readonly baseUrl;
|
|
9
|
+
constructor(baseUrl: string);
|
|
10
|
+
getChallenge(): EitherAsync<LKRPHttpRequestError, Challenge>;
|
|
11
|
+
authenticate(payload: AuthenticationPayload): EitherAsync<LKRPHttpRequestError, {
|
|
12
|
+
jwt: JWT;
|
|
13
|
+
trustchainId: Maybe<string>;
|
|
14
|
+
}>;
|
|
15
|
+
getTrustchainById(id: string, jwt: JWT): EitherAsync<LKRPHttpRequestError, {
|
|
16
|
+
[k: string]: LKRPBlockStream;
|
|
17
|
+
}>;
|
|
18
|
+
postDerivation(id: string, block: LKRPBlock, jwt: JWT): EitherAsync<LKRPHttpRequestError, void>;
|
|
19
|
+
putCommands(id: string, path: string, block: LKRPBlock, jwt: JWT): EitherAsync<LKRPHttpRequestError, void>;
|
|
20
|
+
private request;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=HttpLKRPDataSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpLKRPDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/internal/lkrp-datasource/data/HttpLKRPDataSource.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAQ,KAAK,EAAkB,MAAM,WAAW,CAAC;AAErE,OAAO,EACL,oBAAoB,EAErB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,GAAG,EAAE,MAAM,2BAA2B,CAAC;AAEhD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAElE,OAAO,EACL,qBAAqB,EACrB,SAAS,EACT,cAAc,EACf,MAAM,kBAAkB,CAAC;AAE1B,qBACa,kBAAmB,YAAW,cAAc;IAEhB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAP,OAAO,EAAE,MAAM;IAGvE,YAAY;IAIZ,YAAY,CAAC,OAAO,EAAE,qBAAqB;;;;IAc3C,iBAAiB,CAAC,EAAE,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG;;;IActC,cAAc,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG;IAOrD,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG;IAOhE,OAAO,CAAC,OAAO;CA0ChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"HttpLKRPDataSource.test.d.ts","sourceRoot":"","sources":["../../../../../src/internal/lkrp-datasource/data/HttpLKRPDataSource.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { type EitherAsync, type Maybe } from "purify-ts";
|
|
2
|
+
import { type LKRPHttpRequestError } from "../../../api/app-binder/Errors";
|
|
3
|
+
import { type JWT } from "../../../api/app-binder/LKRPTypes";
|
|
4
|
+
import { type LKRPBlock } from "../../utils/LKRPBlock";
|
|
5
|
+
import { type Trustchain } from "../../utils/types";
|
|
6
|
+
export interface LKRPDataSource {
|
|
7
|
+
getChallenge(): EitherAsync<LKRPHttpRequestError, Challenge>;
|
|
8
|
+
authenticate(payload: AuthenticationPayload): EitherAsync<LKRPHttpRequestError, AuthenticationResponse>;
|
|
9
|
+
getTrustchainById(id: string, jwt: JWT): EitherAsync<LKRPHttpRequestError, Trustchain>;
|
|
10
|
+
postDerivation(id: string, blocks: LKRPBlock, jwt: JWT): EitherAsync<LKRPHttpRequestError, void>;
|
|
11
|
+
putCommands(id: string, path: string, block: LKRPBlock, jwt: JWT): EitherAsync<LKRPHttpRequestError, void>;
|
|
12
|
+
}
|
|
13
|
+
export type Challenge = {
|
|
14
|
+
json: ChallengeJSON;
|
|
15
|
+
tlv: string;
|
|
16
|
+
};
|
|
17
|
+
export type AuthenticationResponse = {
|
|
18
|
+
jwt: JWT;
|
|
19
|
+
trustchainId: Maybe<string>;
|
|
20
|
+
};
|
|
21
|
+
export type AuthenticationPayload = {
|
|
22
|
+
challenge: ChallengeJSON;
|
|
23
|
+
signature: ChallengeSignature;
|
|
24
|
+
};
|
|
25
|
+
type ChallengeJSON = {
|
|
26
|
+
version: number;
|
|
27
|
+
challenge: {
|
|
28
|
+
data: string;
|
|
29
|
+
expiry: string;
|
|
30
|
+
};
|
|
31
|
+
host: string;
|
|
32
|
+
rp: {
|
|
33
|
+
credential: Credential;
|
|
34
|
+
signature: string;
|
|
35
|
+
}[];
|
|
36
|
+
protocolVersion: {
|
|
37
|
+
major: number;
|
|
38
|
+
minor: number;
|
|
39
|
+
patch: number;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
type ChallengeSignature = {
|
|
43
|
+
credential: Credential;
|
|
44
|
+
signature: string;
|
|
45
|
+
attestation: string;
|
|
46
|
+
};
|
|
47
|
+
type Credential = {
|
|
48
|
+
version: number;
|
|
49
|
+
curveId: number;
|
|
50
|
+
signAlgorithm: number;
|
|
51
|
+
publicKey: string;
|
|
52
|
+
};
|
|
53
|
+
export {};
|
|
54
|
+
//# sourceMappingURL=LKRPDataSource.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LKRPDataSource.d.ts","sourceRoot":"","sources":["../../../../../src/internal/lkrp-datasource/data/LKRPDataSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,KAAK,EAAE,MAAM,WAAW,CAAC;AAEzD,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACnE,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,WAAW,cAAc;IAC7B,YAAY,IAAI,WAAW,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAC;IAE7D,YAAY,CACV,OAAO,EAAE,qBAAqB,GAC7B,WAAW,CAAC,oBAAoB,EAAE,sBAAsB,CAAC,CAAC;IAE7D,iBAAiB,CACf,EAAE,EAAE,MAAM,EACV,GAAG,EAAE,GAAG,GACP,WAAW,CAAC,oBAAoB,EAAE,UAAU,CAAC,CAAC;IAEjD,cAAc,CACZ,EAAE,EAAE,MAAM,EACV,MAAM,EAAE,SAAS,EACjB,GAAG,EAAE,GAAG,GACP,WAAW,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;IAE3C,WAAW,CACT,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,SAAS,EAChB,GAAG,EAAE,GAAG,GACP,WAAW,CAAC,oBAAoB,EAAE,IAAI,CAAC,CAAC;CAC5C;AAED,MAAM,MAAM,SAAS,GAAG;IAAE,IAAI,EAAE,aAAa,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7D,MAAM,MAAM,sBAAsB,GAAG;IACnC,GAAG,EAAE,GAAG,CAAC;IACT,YAAY,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,aAAa,CAAC;IACzB,SAAS,EAAE,kBAAkB,CAAC;CAC/B,CAAC;AAEF,KAAK,aAAa,GAAG;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE;QACT,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE;QAAE,UAAU,EAAE,UAAU,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IACpD,eAAe,EAAE;QACf,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;CACH,CAAC;AAEF,KAAK,kBAAkB,GAAG;IACxB,UAAU,EAAE,UAAU,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,KAAK,UAAU,GAAG;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ContainerModule } from "inversify";
|
|
2
|
+
import { type MakeContainerProps } from "../../di";
|
|
3
|
+
export declare const lkrpDatasourceModuleFactory: ({ baseUrl, }: Pick<MakeContainerProps, "stub" | "baseUrl">) => ContainerModule;
|
|
4
|
+
//# sourceMappingURL=lkrpDatasourceModuleFactory.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lkrpDatasourceModuleFactory.d.ts","sourceRoot":"","sources":["../../../../../src/internal/lkrp-datasource/di/lkrpDatasourceModuleFactory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAMvD,eAAO,MAAM,2BAA2B,GAAI,cAEzC,IAAI,CAAC,kBAAkB,EAAE,MAAM,GAAG,SAAS,CAAC,oBAM3C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lkrpDatasourceTypes.d.ts","sourceRoot":"","sources":["../../../../../src/internal/lkrp-datasource/di/lkrpDatasourceTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AuthenticateDAReturnType } from "../../../api/app-binder/AuthenticateDeviceActionTypes";
|
|
2
|
+
import { JWT, Keypair, Permissions } from "../../../api/app-binder/LKRPTypes";
|
|
3
|
+
import { LedgerKeyringProtocolBinder } from "../../app-binder/LedgerKeyringProtocolBinder";
|
|
4
|
+
export declare class AuthenticateUseCase {
|
|
5
|
+
private appBinder;
|
|
6
|
+
constructor(appBinder: LedgerKeyringProtocolBinder);
|
|
7
|
+
execute(keypair: Keypair, applicationId: number, clientName: string, permissions: Permissions, trustchainId?: string, jwt?: JWT): AuthenticateDAReturnType;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=AuthenticateUseCase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthenticateUseCase.d.ts","sourceRoot":"","sources":["../../../../../src/internal/use-cases/authentication/AuthenticateUseCase.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,wBAAwB,EAAE,MAAM,+CAA+C,CAAC;AACzF,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAE/F,qBACa,mBAAmB;IAG5B,OAAO,CAAC,SAAS;gBAAT,SAAS,EAAE,2BAA2B;IAGhD,OAAO,CACL,OAAO,EAAE,OAAO,EAChB,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,WAAW,EACxB,YAAY,CAAC,EAAE,MAAM,EACrB,GAAG,CAAC,EAAE,GAAG,GACR,wBAAwB;CAU5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCasesModule.d.ts","sourceRoot":"","sources":["../../../../../src/internal/use-cases/di/useCasesModule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAM5C,eAAO,MAAM,qBAAqB,uBAG9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useCasesTypes.d.ts","sourceRoot":"","sources":["../../../../../src/internal/use-cases/di/useCasesTypes.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa;;CAEzB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Either } from "purify-ts";
|
|
2
|
+
import { type LKRPParsingError } from "../../api/app-binder/Errors";
|
|
3
|
+
import { type LKRPBlockData, type LKRPBlockParsedData } from "./types";
|
|
4
|
+
export declare class LKRPBlock {
|
|
5
|
+
private readonly bytes;
|
|
6
|
+
private hashValue;
|
|
7
|
+
private data;
|
|
8
|
+
constructor(bytes: Uint8Array, data?: LKRPBlockParsedData);
|
|
9
|
+
static fromHex(hex: string): LKRPBlock;
|
|
10
|
+
static fromData(data: LKRPBlockData): LKRPBlock;
|
|
11
|
+
toString(): string;
|
|
12
|
+
toU8A(): Uint8Array;
|
|
13
|
+
parse(): Either<LKRPParsingError, LKRPBlockParsedData>;
|
|
14
|
+
toHuman(): Either<LKRPParsingError, string>;
|
|
15
|
+
hash(): string;
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=LKRPBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LKRPBlock.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/LKRPBlock.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAoC,MAAM,WAAW,CAAC;AAErE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK/D,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEvE,qBAAa,SAAS;IAKlB,OAAO,CAAC,QAAQ,CAAC,KAAK;IAJxB,OAAO,CAAC,SAAS,CAA0B;IAC3C,OAAO,CAAC,IAAI,CAAuD;gBAGhD,KAAK,EAAE,UAAU,EAClC,IAAI,CAAC,EAAE,mBAAmB;IAK5B,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS;IAItC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,aAAa,GAAG,SAAS;IAkB/C,QAAQ,IAAI,MAAM;IAIlB,KAAK,IAAI,UAAU;IAInB,KAAK,IAAI,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;IAQtD,OAAO,IAAI,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAmB3C,IAAI,IAAI,MAAM;CAMf"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LKRPBlock.test.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/LKRPBlock.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Either, Maybe } from "purify-ts";
|
|
2
|
+
import { type LKRPParsingError } from "../../api/app-binder/Errors";
|
|
3
|
+
import { type Keypair } from "../../api/app-binder/LKRPTypes";
|
|
4
|
+
import { LKRPBlock } from "./LKRPBlock";
|
|
5
|
+
import { type LKRPBlockData } from "./types";
|
|
6
|
+
import { type PublishedKey } from "./types";
|
|
7
|
+
export declare class LKRPBlockStream {
|
|
8
|
+
private readonly bytes;
|
|
9
|
+
private validation;
|
|
10
|
+
private blocks;
|
|
11
|
+
private path;
|
|
12
|
+
constructor(bytes: Uint8Array, blocks?: LKRPBlock[], path?: string);
|
|
13
|
+
static fromHex(hex: string): LKRPBlockStream;
|
|
14
|
+
static fromPath(path: string): LKRPBlockStream;
|
|
15
|
+
static fromData(blocksData: Omit<LKRPBlockData, "parent">[], parentHash?: string): Promise<LKRPBlockStream>;
|
|
16
|
+
toU8A(): Uint8Array;
|
|
17
|
+
toString(): string;
|
|
18
|
+
parse(): Either<LKRPParsingError, LKRPBlock[]>;
|
|
19
|
+
toHuman(): Either<LKRPParsingError, string>;
|
|
20
|
+
validate(streamParentHash?: string): Promise<boolean>;
|
|
21
|
+
getPath(): Maybe<string>;
|
|
22
|
+
getMemberBlock(member: string): Maybe<LKRPBlockData>;
|
|
23
|
+
hasMember(member: string): boolean;
|
|
24
|
+
getPublishedKey(keypair: Keypair): Maybe<PublishedKey>;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=LKRPBlockStream.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LKRPBlockStream.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/LKRPBlockStream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAQ,KAAK,EAAkB,MAAM,WAAW,CAAC;AAEhE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC/D,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,2BAA2B,CAAC;AAIzD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAA8B,KAAK,YAAY,EAAE,MAAM,SAAS,CAAC;AAExE,qBAAa,eAAe;IAMxB,OAAO,CAAC,QAAQ,CAAC,KAAK;IALxB,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,MAAM,CAAyD;IACvE,OAAO,CAAC,IAAI,CAA0B;gBAGnB,KAAK,EAAE,UAAU,EAClC,MAAM,CAAC,EAAE,SAAS,EAAE,EACpB,IAAI,CAAC,EAAE,MAAM;IAMf,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,eAAe;IAI5C,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,eAAe;WAIjC,QAAQ,CACnB,UAAU,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,EAAE,EAC3C,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,eAAe,CAAC;IAoB3B,KAAK,IAAI,UAAU;IAInB,QAAQ,IAAI,MAAM;IAIlB,KAAK,IAAI,MAAM,CAAC,gBAAgB,EAAE,SAAS,EAAE,CAAC;IAmB9C,OAAO,IAAI,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAOrC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAmC3D,OAAO,IAAI,KAAK,CAAC,MAAM,CAAC;IAsBxB,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,CAAC,aAAa,CAAC;IAoBpD,SAAS,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO;IAIlC,eAAe,CAAC,OAAO,EAAE,OAAO,GAAG,KAAK,CAAC,YAAY,CAAC;CAqBvD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LKRPBlockStream.test.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/LKRPBlockStream.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Either, Maybe } from "purify-ts";
|
|
2
|
+
import { type LKRPParsingError } from "../../api/app-binder/Errors";
|
|
3
|
+
import { type EncryptedPublishedKey, type LKRPCommandData, type UnsignedCommandData } from "./types";
|
|
4
|
+
export declare class LKRPCommand {
|
|
5
|
+
private bytes;
|
|
6
|
+
private data;
|
|
7
|
+
constructor(bytes: Uint8Array, data?: LKRPCommandData);
|
|
8
|
+
static fromHex(hex: string): LKRPCommand;
|
|
9
|
+
static fromData(data: LKRPCommandData): LKRPCommand;
|
|
10
|
+
static bytesFromUnsignedData(data: UnsignedCommandData): Uint8Array;
|
|
11
|
+
toString(): string;
|
|
12
|
+
toU8A(): Uint8Array;
|
|
13
|
+
parse(): Either<LKRPParsingError, LKRPCommandData>;
|
|
14
|
+
toHuman(): Either<LKRPParsingError, string>;
|
|
15
|
+
getPublicKey(): Maybe<string>;
|
|
16
|
+
getEncryptedPublichedKey(): Maybe<EncryptedPublishedKey>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=LKRPCommand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LKRPCommand.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/LKRPCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAQ,KAAK,EAAkB,MAAM,WAAW,CAAC;AAErE,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAO/D,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACzB,MAAM,SAAS,CAAC;AAEjB,qBAAa,WAAW;IAIpB,OAAO,CAAC,KAAK;IAHf,OAAO,CAAC,IAAI,CAAmD;gBAGrD,KAAK,EAAE,UAAU,EACzB,IAAI,CAAC,EAAE,eAAe;IAKxB,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,WAAW;IAIxC,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,eAAe,GAAG,WAAW;IA6CnD,MAAM,CAAC,qBAAqB,CAAC,IAAI,EAAE,mBAAmB,GAAG,UAAU;IA0BnE,QAAQ,IAAI,MAAM;IAIlB,KAAK,IAAI,UAAU;IAInB,KAAK,IAAI,MAAM,CAAC,gBAAgB,EAAE,eAAe,CAAC;IAQlD,OAAO,IAAI,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAa3C,YAAY,IAAI,KAAK,CAAC,MAAM,CAAC;IAuB7B,wBAAwB,IAAI,KAAK,CAAC,qBAAqB,CAAC;CAqBzD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LKRPCommand.test.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/LKRPCommand.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class TLVBuilder {
|
|
2
|
+
private items;
|
|
3
|
+
addNull(): this;
|
|
4
|
+
addInt(value: number, length: 1 | 2 | 4): this;
|
|
5
|
+
addHash(value: Uint8Array): this;
|
|
6
|
+
addSignature(value: Uint8Array): this;
|
|
7
|
+
addString(value: string): this;
|
|
8
|
+
addBytes(value: Uint8Array | number[]): this;
|
|
9
|
+
addPublicKey(value: Uint8Array): this;
|
|
10
|
+
build(): Uint8Array;
|
|
11
|
+
with(fn: (builder: TLVBuilder) => void): TLVBuilder;
|
|
12
|
+
push(item: Uint8Array): this;
|
|
13
|
+
private add;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=TLVBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TLVBuilder.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/TLVBuilder.ts"],"names":[],"mappings":"AAEA,qBAAa,UAAU;IACrB,OAAO,CAAC,KAAK,CAAoB;IAEjC,OAAO;IAIP,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC;IAgBvC,OAAO,CAAC,KAAK,EAAE,UAAU;IAIzB,YAAY,CAAC,KAAK,EAAE,UAAU;IAI9B,SAAS,CAAC,KAAK,EAAE,MAAM;IAIvB,QAAQ,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,EAAE;IAIrC,YAAY,CAAC,KAAK,EAAE,UAAU;IAI9B,KAAK,IAAI,UAAU;IAInB,IAAI,CAAC,EAAE,EAAE,CAAC,OAAO,EAAE,UAAU,KAAK,IAAI,GAAG,UAAU;IAKnD,IAAI,CAAC,IAAI,EAAE,UAAU;IAKrB,OAAO,CAAC,GAAG;CAIZ"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { type Either } from "purify-ts";
|
|
2
|
+
import { LKRPParsingError } from "../../api/app-binder/Errors";
|
|
3
|
+
import { LKRPCommand } from "./LKRPCommand";
|
|
4
|
+
import { CommandTags, GeneralTags } from "./TLVTags";
|
|
5
|
+
import { type LKRPBlockParsedData, type LKRPCommandData } from "./types";
|
|
6
|
+
type ParserValue = Either<LKRPParsingError, {
|
|
7
|
+
tag: GeneralTags.Null;
|
|
8
|
+
value: null;
|
|
9
|
+
} | {
|
|
10
|
+
tag: GeneralTags.Int;
|
|
11
|
+
value: number;
|
|
12
|
+
} | {
|
|
13
|
+
tag: GeneralTags.Hash;
|
|
14
|
+
value: Uint8Array;
|
|
15
|
+
} | {
|
|
16
|
+
tag: GeneralTags.Signature;
|
|
17
|
+
value: Uint8Array;
|
|
18
|
+
} | {
|
|
19
|
+
tag: GeneralTags.String;
|
|
20
|
+
value: string;
|
|
21
|
+
} | {
|
|
22
|
+
tag: GeneralTags.Bytes;
|
|
23
|
+
value: Uint8Array;
|
|
24
|
+
} | {
|
|
25
|
+
tag: GeneralTags.PublicKey;
|
|
26
|
+
value: Uint8Array;
|
|
27
|
+
} | {
|
|
28
|
+
tag: CommandTags;
|
|
29
|
+
value: Uint8Array;
|
|
30
|
+
} | {
|
|
31
|
+
tag: Exclude<number, GeneralTags | CommandTags>;
|
|
32
|
+
value: null | number | Uint8Array;
|
|
33
|
+
}>;
|
|
34
|
+
export declare class TLVParser {
|
|
35
|
+
private readonly bytes;
|
|
36
|
+
private readonly parser;
|
|
37
|
+
private offset;
|
|
38
|
+
constructor(bytes: Uint8Array);
|
|
39
|
+
get state(): {
|
|
40
|
+
offset: number;
|
|
41
|
+
isDone: boolean;
|
|
42
|
+
};
|
|
43
|
+
parse(): ParserValue;
|
|
44
|
+
tlvEncoded(fn: () => Either<LKRPParsingError, unknown>): Either<LKRPParsingError, Uint8Array>;
|
|
45
|
+
parseNull(): Either<LKRPParsingError, null>;
|
|
46
|
+
parseInt(): Either<LKRPParsingError, number>;
|
|
47
|
+
parseHash(): Either<LKRPParsingError, Uint8Array>;
|
|
48
|
+
parseSignature(): Either<LKRPParsingError, Uint8Array>;
|
|
49
|
+
parseString(): Either<LKRPParsingError, string>;
|
|
50
|
+
parseBytes(): Either<LKRPParsingError, Uint8Array>;
|
|
51
|
+
parsePublicKey(): Either<LKRPParsingError, Uint8Array>;
|
|
52
|
+
parseCommandBytes(): Either<LKRPParsingError, Uint8Array>;
|
|
53
|
+
parseCommandData(): Either<LKRPParsingError, LKRPCommandData>;
|
|
54
|
+
parseCommands(): Either<LKRPParsingError, LKRPCommand[]>;
|
|
55
|
+
parseBlockData(): Either<LKRPParsingError, LKRPBlockParsedData>;
|
|
56
|
+
private parseTLV;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
59
|
+
//# sourceMappingURL=TLVParser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TLVParser.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/TLVParser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAe,MAAM,WAAW,CAAC;AAErD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAK1D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACrD,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AAEzE,KAAK,WAAW,GAAG,MAAM,CACvB,gBAAgB,EACd;IAAE,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC;IAAC,KAAK,EAAE,IAAI,CAAA;CAAE,GACtC;IAAE,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GACvC;IAAE,GAAG,EAAE,WAAW,CAAC,IAAI,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GAC5C;IAAE,GAAG,EAAE,WAAW,CAAC,SAAS,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GACjD;IAAE,GAAG,EAAE,WAAW,CAAC,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAC1C;IAAE,GAAG,EAAE,WAAW,CAAC,KAAK,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GAC7C;IAAE,GAAG,EAAE,WAAW,CAAC,SAAS,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GACjD;IAAE,GAAG,EAAE,WAAW,CAAC;IAAC,KAAK,EAAE,UAAU,CAAA;CAAE,GACvC;IACE,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE,WAAW,GAAG,WAAW,CAAC,CAAC;IAChD,KAAK,EAAE,IAAI,GAAG,MAAM,GAAG,UAAU,CAAC;CACnC,CACJ,CAAC;AAMF,qBAAa,SAAS;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAa;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,MAAM,CAAK;gBAEP,KAAK,EAAE,UAAU;IAK7B,IAAI,KAAK;;;MAKR;IAED,KAAK,IAAI,WAAW;IAIpB,UAAU,CACR,EAAE,EAAE,MAAM,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,GAC1C,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAKvC,SAAS,IAAI,MAAM,CAAC,gBAAgB,EAAE,IAAI,CAAC;IAQ3C,QAAQ,IAAI,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAQ5C,SAAS,IAAI,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAQjD,cAAc,IAAI,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAQtD,WAAW,IAAI,MAAM,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAQ/C,UAAU,IAAI,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAQlD,cAAc,IAAI,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAQtD,iBAAiB,IAAI,MAAM,CAAC,gBAAgB,EAAE,UAAU,CAAC;IAazD,gBAAgB,IAAI,MAAM,CAAC,gBAAgB,EAAE,eAAe,CAAC;IAkE7D,aAAa,IAAI,MAAM,CAAC,gBAAgB,EAAE,WAAW,EAAE,CAAC;IAmBxD,cAAc,IAAI,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC;IAgB/D,OAAO,CAAE,QAAQ;CAkElB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TLVParser.test.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/TLVParser.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export declare enum GeneralTags {
|
|
2
|
+
Null = 0,
|
|
3
|
+
Int = 1,
|
|
4
|
+
Hash = 2,
|
|
5
|
+
Signature = 3,
|
|
6
|
+
String = 4,
|
|
7
|
+
Bytes = 5,
|
|
8
|
+
PublicKey = 6
|
|
9
|
+
}
|
|
10
|
+
export declare enum CommandTags {
|
|
11
|
+
Seed = 16,
|
|
12
|
+
AddMember = 17,
|
|
13
|
+
PublishKey = 18,
|
|
14
|
+
CloseStream = 19,
|
|
15
|
+
EditMember = 20,
|
|
16
|
+
Derive = 21
|
|
17
|
+
}
|
|
18
|
+
export declare enum TPTags {
|
|
19
|
+
IV = 0,
|
|
20
|
+
ISSUER = 129,
|
|
21
|
+
XPRIV = 130,
|
|
22
|
+
EPHEMERAL_PUBLIC_KEY = 3,
|
|
23
|
+
COMMAND_IV = 4,
|
|
24
|
+
GROUPKEY = 5,
|
|
25
|
+
NEW_MEMBER = 134
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=TLVTags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TLVTags.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/TLVTags.ts"],"names":[],"mappings":"AAAA,oBAAY,WAAW;IACrB,IAAI,IAAO;IACX,GAAG,IAAO;IACV,IAAI,IAAO;IACX,SAAS,IAAO;IAChB,MAAM,IAAO;IACb,KAAK,IAAO;IACZ,SAAS,IAAO;CACjB;AAED,oBAAY,WAAW;IACrB,IAAI,KAAO;IACX,SAAS,KAAO;IAChB,UAAU,KAAO;IACjB,WAAW,KAAO;IAClB,UAAU,KAAO;IACjB,MAAM,KAAO;CACd;AAID,oBAAY,MAAM;IAChB,EAAE,IAAO;IACT,MAAM,MAAoB;IAC1B,KAAK,MAAoB;IACzB,oBAAoB,IAAO;IAC3B,UAAU,IAAO;IACjB,QAAQ,IAAO;IACf,UAAU,MAAoB;CAC/B"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type Keypair } from "../../api/index";
|
|
2
|
+
export declare const AES_BLOCK_SIZE = 16;
|
|
3
|
+
export declare class CryptoUtils {
|
|
4
|
+
static randomBytes(len: number): Uint8Array;
|
|
5
|
+
static randomKeypair(): Keypair;
|
|
6
|
+
static encrypt(key: Uint8Array, iv: Uint8Array, cleartext: Uint8Array): Uint8Array;
|
|
7
|
+
static decrypt(key: Uint8Array, iv: Uint8Array, ciphertext: Uint8Array): Uint8Array;
|
|
8
|
+
static hash(bytes: Uint8Array): Uint8Array;
|
|
9
|
+
static hmac(key: Uint8Array, message: Uint8Array): Uint8Array;
|
|
10
|
+
/**
|
|
11
|
+
* DER specification: https://ledgerhq.atlassian.net/wiki/spaces/TrustServices/pages/3843719348/LNS+Arch+Common+Fields+for+Nano+certificates+and+descriptors#DER-Encoding-spec
|
|
12
|
+
* See: https://ledgerhq.atlassian.net/wiki/spaces/TrustServices/pages/3736863735/LNS+Arch+Nano+Trusted+Names+Descriptor+Format+APIs
|
|
13
|
+
* signature(r,s) = 0x30 & var(L,u8(~)) & sized(8*L, sig_components(r,s)); # DER encoding of the two 32 bytes signature components r & s
|
|
14
|
+
* sig_components(r,s) = 0x02 & var(Lr,u8(~)) & sized(8*Lr, r) & 0x02 & var(Ls,u8(~)) & sized(8*Ls, s);
|
|
15
|
+
*/
|
|
16
|
+
static derEncode(r: bigint, s: bigint): Uint8Array;
|
|
17
|
+
private static encodeSigComponent;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=crypto.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/crypto.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAE1C,eAAO,MAAM,cAAc,KAAK,CAAC;AAEjC,qBAAa,WAAW;IACtB,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,UAAU;IAI3C,MAAM,CAAC,aAAa,IAAI,OAAO;IAI/B,MAAM,CAAC,OAAO,CACZ,GAAG,EAAE,UAAU,EACf,EAAE,EAAE,UAAU,EACd,SAAS,EAAE,UAAU,GACpB,UAAU;IAKb,MAAM,CAAC,OAAO,CACZ,GAAG,EAAE,UAAU,EACf,EAAE,EAAE,UAAU,EACd,UAAU,EAAE,UAAU,GACrB,UAAU;IAKb,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,UAAU,GAAG,UAAU;IAI1C,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,GAAG,UAAU;IAI7D;;;;;OAKG;WACW,SAAS,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,UAAU;IAOzD,OAAO,CAAC,MAAM,CAAC,kBAAkB;CAMlC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"derivationPath.d.ts","sourceRoot":"","sources":["../../../../src/internal/utils/derivationPath.ts"],"names":[],"mappings":"AAAA,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAWhE;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,CAe9D"}
|