@opendatalabs/vana-sdk 0.1.0-alpha.e2e45dd → 0.1.0-alpha.e2f8234
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -300
- package/dist/__tests__/waitForTransactionEvents.test.d.ts +1 -0
- package/dist/browser.cjs +29 -0
- package/dist/browser.cjs.map +1 -0
- package/dist/browser.d.ts +36 -1
- package/dist/browser.js +1 -290
- package/dist/browser.js.map +1 -1
- package/dist/{chains.browser.cjs → chains/definitions.cjs} +16 -17
- package/dist/chains/definitions.cjs.map +1 -0
- package/dist/{chains.browser.d.cts → chains/definitions.d.ts} +9 -11
- package/dist/chains/definitions.js +67 -0
- package/dist/chains/definitions.js.map +1 -0
- package/dist/chains/index.cjs +37 -0
- package/dist/chains/index.cjs.map +1 -0
- package/dist/chains/index.d.ts +34 -0
- package/dist/chains/index.js +15 -0
- package/dist/chains/index.js.map +1 -0
- package/dist/chains.browser.d.ts +5 -50
- package/dist/chains.browser.js +7 -57
- package/dist/chains.browser.js.map +1 -1
- package/dist/chains.cjs +6 -65
- package/dist/chains.cjs.map +1 -1
- package/dist/chains.d.ts +8 -2
- package/dist/chains.js +7 -57
- package/dist/chains.js.map +1 -1
- package/dist/chains.node.cjs +6 -65
- package/dist/chains.node.cjs.map +1 -1
- package/dist/chains.node.d.ts +8 -2
- package/dist/chains.node.js +7 -57
- package/dist/chains.node.js.map +1 -1
- package/dist/client/__tests__/enhancedResponse.test.d.ts +1 -0
- package/dist/client/enhancedResponse.cjs +164 -0
- package/dist/client/enhancedResponse.cjs.map +1 -0
- package/dist/client/enhancedResponse.d.ts +120 -0
- package/dist/client/enhancedResponse.js +138 -0
- package/dist/client/enhancedResponse.js.map +1 -0
- package/dist/config/chains.cjs +93 -0
- package/dist/config/chains.cjs.map +1 -0
- package/dist/config/chains.d.ts +180 -0
- package/dist/config/chains.js +67 -0
- package/dist/config/chains.js.map +1 -0
- package/dist/config/contracts.config.cjs +400 -0
- package/dist/config/contracts.config.cjs.map +1 -0
- package/dist/config/contracts.config.d.ts +84 -0
- package/dist/config/contracts.config.js +375 -0
- package/dist/config/contracts.config.js.map +1 -0
- package/dist/config/default-services.cjs +60 -0
- package/dist/config/default-services.cjs.map +1 -0
- package/dist/config/default-services.d.ts +46 -0
- package/dist/config/default-services.js +33 -0
- package/dist/config/default-services.js.map +1 -0
- package/dist/config/default-services.test.d.ts +1 -0
- package/dist/config/features.cjs +52 -0
- package/dist/config/features.cjs.map +1 -0
- package/dist/config/features.d.ts +62 -0
- package/dist/config/features.js +28 -0
- package/dist/config/features.js.map +1 -0
- package/dist/config/tests/addresses.test.d.ts +1 -0
- package/dist/contracts/contractController.cjs +126 -0
- package/dist/contracts/contractController.cjs.map +1 -0
- package/dist/contracts/contractController.d.ts +135 -0
- package/dist/contracts/contractController.js +100 -0
- package/dist/contracts/contractController.js.map +1 -0
- package/dist/contracts/tests/contractController.test.d.ts +1 -0
- package/dist/controllers/__tests__/data-consistency-integration.test.d.ts +7 -0
- package/dist/controllers/__tests__/operations.processQueue.test.d.ts +1 -0
- package/dist/controllers/__tests__/schemas-edge-cases.test.d.ts +1 -0
- package/dist/controllers/accessSettlement.cjs +289 -0
- package/dist/controllers/accessSettlement.cjs.map +1 -0
- package/dist/controllers/accessSettlement.d.ts +157 -0
- package/dist/controllers/accessSettlement.js +265 -0
- package/dist/controllers/accessSettlement.js.map +1 -0
- package/dist/controllers/accessSettlement.test.d.ts +1 -0
- package/dist/controllers/base.cjs +116 -0
- package/dist/controllers/base.cjs.map +1 -0
- package/dist/controllers/base.d.ts +94 -0
- package/dist/controllers/base.js +92 -0
- package/dist/controllers/base.js.map +1 -0
- package/dist/controllers/data-error-handling.test.d.ts +1 -0
- package/dist/controllers/data.cjs +2633 -0
- package/dist/controllers/data.cjs.map +1 -0
- package/dist/controllers/data.d.ts +1067 -0
- package/dist/controllers/data.js +2626 -0
- package/dist/controllers/data.js.map +1 -0
- package/dist/controllers/operations.cjs +430 -0
- package/dist/controllers/operations.cjs.map +1 -0
- package/dist/controllers/operations.d.ts +229 -0
- package/dist/controllers/operations.js +406 -0
- package/dist/controllers/operations.js.map +1 -0
- package/dist/controllers/permissions.cjs +4363 -0
- package/dist/controllers/permissions.cjs.map +1 -0
- package/dist/controllers/permissions.d.ts +1411 -0
- package/dist/controllers/permissions.js +4339 -0
- package/dist/controllers/permissions.js.map +1 -0
- package/dist/controllers/protocol.cjs +183 -0
- package/dist/controllers/protocol.cjs.map +1 -0
- package/dist/controllers/protocol.d.ts +138 -0
- package/dist/controllers/protocol.js +163 -0
- package/dist/controllers/protocol.js.map +1 -0
- package/dist/controllers/runtimePermissions.cjs +285 -0
- package/dist/controllers/runtimePermissions.cjs.map +1 -0
- package/dist/controllers/runtimePermissions.d.ts +152 -0
- package/dist/controllers/runtimePermissions.js +264 -0
- package/dist/controllers/runtimePermissions.js.map +1 -0
- package/dist/controllers/runtimePermissions.test.d.ts +1 -0
- package/dist/controllers/schemas.cjs +678 -0
- package/dist/controllers/schemas.cjs.map +1 -0
- package/dist/controllers/schemas.d.ts +293 -0
- package/dist/controllers/schemas.js +654 -0
- package/dist/controllers/schemas.js.map +1 -0
- package/dist/controllers/server-additional.test.d.ts +1 -0
- package/dist/controllers/server.cjs +643 -0
- package/dist/controllers/server.cjs.map +1 -0
- package/dist/controllers/server.d.ts +322 -0
- package/dist/controllers/server.js +624 -0
- package/dist/controllers/server.js.map +1 -0
- package/dist/core/__tests__/health.test.d.ts +1 -0
- package/dist/core/__tests__/inMemoryNonceManager.test.d.ts +1 -0
- package/dist/core/__tests__/nonceManager.test.d.ts +1 -0
- package/dist/core/__tests__/pollingManager.test.d.ts +4 -0
- package/dist/core/apiClient.cjs +378 -0
- package/dist/core/apiClient.cjs.map +1 -0
- package/dist/core/apiClient.d.ts +286 -0
- package/dist/core/apiClient.js +359 -0
- package/dist/core/apiClient.js.map +1 -0
- package/dist/core/client.cjs +70 -0
- package/dist/core/client.cjs.map +1 -0
- package/dist/core/client.d.ts +89 -0
- package/dist/core/client.js +47 -0
- package/dist/core/client.js.map +1 -0
- package/dist/core/core.test.d.ts +1 -0
- package/dist/core/generics.cjs +417 -0
- package/dist/core/generics.cjs.map +1 -0
- package/dist/core/generics.d.ts +205 -0
- package/dist/core/generics.js +386 -0
- package/dist/core/generics.js.map +1 -0
- package/dist/core/health.cjs +289 -0
- package/dist/core/health.cjs.map +1 -0
- package/dist/core/health.d.ts +143 -0
- package/dist/core/health.js +265 -0
- package/dist/core/health.js.map +1 -0
- package/dist/core/inMemoryNonceManager.cjs +138 -0
- package/dist/core/inMemoryNonceManager.cjs.map +1 -0
- package/dist/core/inMemoryNonceManager.d.ts +69 -0
- package/dist/core/inMemoryNonceManager.js +114 -0
- package/dist/core/inMemoryNonceManager.js.map +1 -0
- package/dist/core/nonceManager.cjs +304 -0
- package/dist/core/nonceManager.cjs.map +1 -0
- package/dist/core/nonceManager.d.ts +116 -0
- package/dist/core/nonceManager.js +280 -0
- package/dist/core/nonceManager.js.map +1 -0
- package/dist/core/pollingManager.cjs +292 -0
- package/dist/core/pollingManager.cjs.map +1 -0
- package/dist/core/pollingManager.d.ts +120 -0
- package/dist/core/pollingManager.js +268 -0
- package/dist/core/pollingManager.js.map +1 -0
- package/dist/core/tests/apiClient.test.d.ts +1 -0
- package/dist/core/tests/client.test.d.ts +1 -0
- package/dist/core/tests/generics.test.d.ts +1 -0
- package/dist/core.cjs +785 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.ts +499 -0
- package/dist/core.js +760 -0
- package/dist/core.js.map +1 -0
- package/dist/crypto/ecies/__tests__/base.test.d.ts +4 -0
- package/dist/crypto/ecies/__tests__/compatibility.test.d.ts +8 -0
- package/dist/crypto/ecies/__tests__/constants.test.d.ts +4 -0
- package/dist/crypto/ecies/__tests__/interface.test.d.ts +1 -0
- package/dist/crypto/ecies/__tests__/native-parity.test.d.ts +7 -0
- package/dist/crypto/ecies/__tests__/normalization.test.d.ts +1 -0
- package/dist/crypto/ecies/__tests__/serialization.test.d.ts +8 -0
- package/dist/crypto/ecies/__tests__/test-vectors.cjs +102 -0
- package/dist/crypto/ecies/__tests__/test-vectors.cjs.map +1 -0
- package/dist/crypto/ecies/__tests__/test-vectors.d.ts +38 -0
- package/dist/crypto/ecies/__tests__/test-vectors.js +77 -0
- package/dist/crypto/ecies/__tests__/test-vectors.js.map +1 -0
- package/dist/crypto/ecies/__tests__/utils.test.d.ts +1 -0
- package/dist/crypto/ecies/base.cjs +268 -0
- package/dist/crypto/ecies/base.cjs.map +1 -0
- package/dist/crypto/ecies/base.d.ts +140 -0
- package/dist/crypto/ecies/base.js +244 -0
- package/dist/crypto/ecies/base.js.map +1 -0
- package/dist/crypto/ecies/browser.cjs +165 -0
- package/dist/crypto/ecies/browser.cjs.map +1 -0
- package/dist/crypto/ecies/browser.d.ts +43 -0
- package/dist/crypto/ecies/browser.js +131 -0
- package/dist/crypto/ecies/browser.js.map +1 -0
- package/dist/crypto/ecies/constants.cjs +123 -0
- package/dist/crypto/ecies/constants.cjs.map +1 -0
- package/dist/crypto/ecies/constants.d.ts +111 -0
- package/dist/crypto/ecies/constants.js +94 -0
- package/dist/crypto/ecies/constants.js.map +1 -0
- package/dist/crypto/ecies/index.cjs +35 -0
- package/dist/crypto/ecies/index.cjs.map +1 -0
- package/dist/crypto/ecies/index.d.ts +8 -0
- package/dist/crypto/ecies/index.js +13 -0
- package/dist/crypto/ecies/index.js.map +1 -0
- package/dist/crypto/ecies/interface.cjs +104 -0
- package/dist/crypto/ecies/interface.cjs.map +1 -0
- package/dist/crypto/ecies/interface.d.ts +174 -0
- package/dist/crypto/ecies/interface.js +77 -0
- package/dist/crypto/ecies/interface.js.map +1 -0
- package/dist/crypto/ecies/node.cjs +167 -0
- package/dist/crypto/ecies/node.cjs.map +1 -0
- package/dist/crypto/ecies/node.d.ts +45 -0
- package/dist/crypto/ecies/node.js +139 -0
- package/dist/crypto/ecies/node.js.map +1 -0
- package/dist/crypto/ecies/test-vectors/eccrypto-vectors.json +72 -0
- package/dist/crypto/ecies/utils.cjs +52 -0
- package/dist/crypto/ecies/utils.cjs.map +1 -0
- package/dist/crypto/ecies/utils.d.ts +30 -0
- package/dist/crypto/ecies/utils.js +26 -0
- package/dist/crypto/ecies/utils.js.map +1 -0
- package/dist/crypto/services/WalletKeyEncryptionService.cjs +128 -0
- package/dist/crypto/services/WalletKeyEncryptionService.cjs.map +1 -0
- package/dist/crypto/services/WalletKeyEncryptionService.d.ts +88 -0
- package/dist/crypto/services/WalletKeyEncryptionService.js +108 -0
- package/dist/crypto/services/WalletKeyEncryptionService.js.map +1 -0
- package/dist/crypto/services/WalletKeyEncryptionService.test.d.ts +1 -0
- package/dist/diagnostics.cjs +37 -0
- package/dist/diagnostics.cjs.map +1 -0
- package/dist/diagnostics.d.ts +24 -0
- package/dist/diagnostics.js +13 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/diagnostics.test.d.ts +1 -0
- package/dist/errors.cjs +186 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.ts +452 -0
- package/dist/errors.js +148 -0
- package/dist/errors.js.map +1 -0
- package/dist/generated/abi/AccessSettlementImplementation.cjs +635 -0
- package/dist/generated/abi/AccessSettlementImplementation.cjs.map +1 -0
- package/dist/generated/abi/AccessSettlementImplementation.d.ts +468 -0
- package/dist/generated/abi/AccessSettlementImplementation.js +611 -0
- package/dist/generated/abi/AccessSettlementImplementation.js.map +1 -0
- package/dist/generated/abi/AttestationPolicyImplementation.cjs +614 -0
- package/dist/generated/abi/AttestationPolicyImplementation.cjs.map +1 -0
- package/dist/generated/abi/AttestationPolicyImplementation.d.ts +449 -0
- package/dist/generated/abi/AttestationPolicyImplementation.js +590 -0
- package/dist/generated/abi/AttestationPolicyImplementation.js.map +1 -0
- package/dist/generated/abi/ComputeEngineImplementation.cjs +1313 -0
- package/dist/generated/abi/ComputeEngineImplementation.cjs.map +1 -0
- package/dist/generated/abi/ComputeEngineImplementation.d.ts +995 -0
- package/dist/generated/abi/ComputeEngineImplementation.js +1289 -0
- package/dist/generated/abi/ComputeEngineImplementation.js.map +1 -0
- package/dist/generated/abi/ComputeEngineTreasuryImplementation.cjs +536 -0
- package/dist/generated/abi/ComputeEngineTreasuryImplementation.cjs.map +1 -0
- package/dist/generated/abi/ComputeEngineTreasuryImplementation.d.ts +393 -0
- package/dist/generated/abi/ComputeEngineTreasuryImplementation.js +512 -0
- package/dist/generated/abi/ComputeEngineTreasuryImplementation.js.map +1 -0
- package/dist/generated/abi/ComputeInstructionRegistryImplementation.cjs +734 -0
- package/dist/generated/abi/ComputeInstructionRegistryImplementation.cjs.map +1 -0
- package/dist/generated/abi/ComputeInstructionRegistryImplementation.d.ts +544 -0
- package/dist/generated/abi/ComputeInstructionRegistryImplementation.js +710 -0
- package/dist/generated/abi/ComputeInstructionRegistryImplementation.js.map +1 -0
- package/dist/generated/abi/DATFactoryImplementation.cjs +882 -0
- package/dist/generated/abi/DATFactoryImplementation.cjs.map +1 -0
- package/dist/generated/abi/DATFactoryImplementation.d.ts +660 -0
- package/dist/generated/abi/DATFactoryImplementation.js +858 -0
- package/dist/generated/abi/DATFactoryImplementation.js.map +1 -0
- package/dist/generated/abi/DATImplementation.cjs +934 -0
- package/dist/generated/abi/DATImplementation.cjs.map +1 -0
- package/dist/generated/abi/DATImplementation.d.ts +692 -0
- package/dist/generated/abi/DATImplementation.js +910 -0
- package/dist/generated/abi/DATImplementation.js.map +1 -0
- package/dist/generated/abi/DATPausableImplementation.cjs +1523 -0
- package/dist/generated/abi/DATPausableImplementation.cjs.map +1 -0
- package/dist/generated/abi/DATPausableImplementation.d.ts +1144 -0
- package/dist/generated/abi/DATPausableImplementation.js +1499 -0
- package/dist/generated/abi/DATPausableImplementation.js.map +1 -0
- package/dist/generated/abi/DATVotesImplementation.cjs +1460 -0
- package/dist/generated/abi/DATVotesImplementation.cjs.map +1 -0
- package/dist/generated/abi/DATVotesImplementation.d.ts +1094 -0
- package/dist/generated/abi/DATVotesImplementation.js +1436 -0
- package/dist/generated/abi/DATVotesImplementation.js.map +1 -0
- package/dist/generated/abi/DLPPerformanceImplementation.cjs +1202 -0
- package/dist/generated/abi/DLPPerformanceImplementation.cjs.map +1 -0
- package/dist/generated/abi/DLPPerformanceImplementation.d.ts +914 -0
- package/dist/generated/abi/DLPPerformanceImplementation.js +1178 -0
- package/dist/generated/abi/DLPPerformanceImplementation.js.map +1 -0
- package/dist/generated/abi/DLPRegistryImplementation.cjs +1469 -0
- package/dist/generated/abi/DLPRegistryImplementation.cjs.map +1 -0
- package/dist/generated/abi/DLPRegistryImplementation.d.ts +1122 -0
- package/dist/generated/abi/DLPRegistryImplementation.js +1445 -0
- package/dist/generated/abi/DLPRegistryImplementation.js.map +1 -0
- package/dist/generated/abi/DLPRegistryTreasuryImplementation.cjs +612 -0
- package/dist/generated/abi/DLPRegistryTreasuryImplementation.cjs.map +1 -0
- package/dist/generated/abi/DLPRegistryTreasuryImplementation.d.ts +451 -0
- package/dist/generated/abi/DLPRegistryTreasuryImplementation.js +588 -0
- package/dist/generated/abi/DLPRegistryTreasuryImplementation.js.map +1 -0
- package/dist/generated/abi/DLPRewardDeployerImplementation.cjs +1112 -0
- package/dist/generated/abi/DLPRewardDeployerImplementation.cjs.map +1 -0
- package/dist/generated/abi/DLPRewardDeployerImplementation.d.ts +840 -0
- package/dist/generated/abi/DLPRewardDeployerImplementation.js +1088 -0
- package/dist/generated/abi/DLPRewardDeployerImplementation.js.map +1 -0
- package/dist/generated/abi/DLPRewardDeployerTreasuryImplementation.cjs +612 -0
- package/dist/generated/abi/DLPRewardDeployerTreasuryImplementation.cjs.map +1 -0
- package/dist/generated/abi/DLPRewardDeployerTreasuryImplementation.d.ts +451 -0
- package/dist/generated/abi/DLPRewardDeployerTreasuryImplementation.js +588 -0
- package/dist/generated/abi/DLPRewardDeployerTreasuryImplementation.js.map +1 -0
- package/dist/generated/abi/DLPRewardSwapImplementation.cjs +939 -0
- package/dist/generated/abi/DLPRewardSwapImplementation.cjs.map +1 -0
- package/dist/generated/abi/DLPRewardSwapImplementation.d.ts +705 -0
- package/dist/generated/abi/DLPRewardSwapImplementation.js +915 -0
- package/dist/generated/abi/DLPRewardSwapImplementation.js.map +1 -0
- package/dist/generated/abi/DLPRootImplementation.cjs +1644 -0
- package/dist/generated/abi/DLPRootImplementation.cjs.map +1 -0
- package/dist/generated/abi/DLPRootImplementation.d.ts +1246 -0
- package/dist/generated/abi/DLPRootImplementation.js +1620 -0
- package/dist/generated/abi/DLPRootImplementation.js.map +1 -0
- package/dist/generated/abi/DataLiquidityPoolImplementation.cjs +1167 -0
- package/dist/generated/abi/DataLiquidityPoolImplementation.cjs.map +1 -0
- package/dist/generated/abi/DataLiquidityPoolImplementation.d.ts +874 -0
- package/dist/generated/abi/DataLiquidityPoolImplementation.js +1143 -0
- package/dist/generated/abi/DataLiquidityPoolImplementation.js.map +1 -0
- package/dist/generated/abi/DataPortabilityGranteesImplementation.cjs +1036 -0
- package/dist/generated/abi/DataPortabilityGranteesImplementation.cjs.map +1 -0
- package/dist/generated/abi/DataPortabilityGranteesImplementation.d.ts +773 -0
- package/dist/generated/abi/DataPortabilityGranteesImplementation.js +1012 -0
- package/dist/generated/abi/DataPortabilityGranteesImplementation.js.map +1 -0
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.cjs +1298 -0
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.cjs.map +1 -0
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.d.ts +974 -0
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.js +1274 -0
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.js.map +1 -0
- package/dist/generated/abi/DataPortabilityServersImplementation.cjs +1419 -0
- package/dist/generated/abi/DataPortabilityServersImplementation.cjs.map +1 -0
- package/dist/generated/abi/DataPortabilityServersImplementation.d.ts +1071 -0
- package/dist/generated/abi/DataPortabilityServersImplementation.js +1395 -0
- package/dist/generated/abi/DataPortabilityServersImplementation.js.map +1 -0
- package/dist/generated/abi/DataRefinerRegistryImplementation.cjs +984 -0
- package/dist/generated/abi/DataRefinerRegistryImplementation.cjs.map +1 -0
- package/dist/generated/abi/DataRefinerRegistryImplementation.d.ts +736 -0
- package/dist/generated/abi/DataRefinerRegistryImplementation.js +960 -0
- package/dist/generated/abi/DataRefinerRegistryImplementation.js.map +1 -0
- package/dist/generated/abi/DataRegistryImplementation.cjs +1328 -0
- package/dist/generated/abi/DataRegistryImplementation.cjs.map +1 -0
- package/dist/generated/abi/DataRegistryImplementation.d.ts +1003 -0
- package/dist/generated/abi/DataRegistryImplementation.js +1304 -0
- package/dist/generated/abi/DataRegistryImplementation.js.map +1 -0
- package/dist/generated/abi/DatasetRegistryImplementation.cjs +751 -0
- package/dist/generated/abi/DatasetRegistryImplementation.cjs.map +1 -0
- package/dist/generated/abi/DatasetRegistryImplementation.d.ts +557 -0
- package/dist/generated/abi/DatasetRegistryImplementation.js +727 -0
- package/dist/generated/abi/DatasetRegistryImplementation.js.map +1 -0
- package/dist/generated/abi/ProtocolConfigImplementation.cjs +578 -0
- package/dist/generated/abi/ProtocolConfigImplementation.cjs.map +1 -0
- package/dist/generated/abi/ProtocolConfigImplementation.d.ts +423 -0
- package/dist/generated/abi/ProtocolConfigImplementation.js +554 -0
- package/dist/generated/abi/ProtocolConfigImplementation.js.map +1 -0
- package/dist/generated/abi/QueryEngineImplementation.cjs +1319 -0
- package/dist/generated/abi/QueryEngineImplementation.cjs.map +1 -0
- package/dist/generated/abi/QueryEngineImplementation.d.ts +1000 -0
- package/dist/generated/abi/QueryEngineImplementation.js +1295 -0
- package/dist/generated/abi/QueryEngineImplementation.js.map +1 -0
- package/dist/generated/abi/SwapHelperImplementation.cjs +976 -0
- package/dist/generated/abi/SwapHelperImplementation.cjs.map +1 -0
- package/dist/generated/abi/SwapHelperImplementation.d.ts +728 -0
- package/dist/generated/abi/SwapHelperImplementation.js +952 -0
- package/dist/generated/abi/SwapHelperImplementation.js.map +1 -0
- package/dist/generated/abi/TeePoolDedicatedGpuImplementation.cjs +936 -0
- package/dist/generated/abi/TeePoolDedicatedGpuImplementation.cjs.map +1 -0
- package/dist/generated/abi/TeePoolDedicatedGpuImplementation.d.ts +700 -0
- package/dist/generated/abi/TeePoolDedicatedGpuImplementation.js +912 -0
- package/dist/generated/abi/TeePoolDedicatedGpuImplementation.js.map +1 -0
- package/dist/generated/abi/TeePoolDedicatedStandardImplementation.cjs +936 -0
- package/dist/generated/abi/TeePoolDedicatedStandardImplementation.cjs.map +1 -0
- package/dist/generated/abi/TeePoolDedicatedStandardImplementation.d.ts +700 -0
- package/dist/generated/abi/TeePoolDedicatedStandardImplementation.js +912 -0
- package/dist/generated/abi/TeePoolDedicatedStandardImplementation.js.map +1 -0
- package/dist/generated/abi/TeePoolEphemeralStandardImplementation.cjs +936 -0
- package/dist/generated/abi/TeePoolEphemeralStandardImplementation.cjs.map +1 -0
- package/dist/generated/abi/TeePoolEphemeralStandardImplementation.d.ts +700 -0
- package/dist/generated/abi/TeePoolEphemeralStandardImplementation.js +912 -0
- package/dist/generated/abi/TeePoolEphemeralStandardImplementation.js.map +1 -0
- package/dist/generated/abi/TeePoolImplementation.cjs +1313 -0
- package/dist/generated/abi/TeePoolImplementation.cjs.map +1 -0
- package/dist/generated/abi/TeePoolImplementation.d.ts +992 -0
- package/dist/generated/abi/TeePoolImplementation.js +1289 -0
- package/dist/generated/abi/TeePoolImplementation.js.map +1 -0
- package/dist/generated/abi/TeePoolPersistentGpuImplementation.cjs +936 -0
- package/dist/generated/abi/TeePoolPersistentGpuImplementation.cjs.map +1 -0
- package/dist/generated/abi/TeePoolPersistentGpuImplementation.d.ts +700 -0
- package/dist/generated/abi/TeePoolPersistentGpuImplementation.js +912 -0
- package/dist/generated/abi/TeePoolPersistentGpuImplementation.js.map +1 -0
- package/dist/generated/abi/TeePoolPersistentStandardImplementation.cjs +936 -0
- package/dist/generated/abi/TeePoolPersistentStandardImplementation.cjs.map +1 -0
- package/dist/generated/abi/TeePoolPersistentStandardImplementation.d.ts +700 -0
- package/dist/generated/abi/TeePoolPersistentStandardImplementation.js +912 -0
- package/dist/generated/abi/TeePoolPersistentStandardImplementation.js.map +1 -0
- package/dist/generated/abi/TeePoolPhalaImplementation.cjs +1313 -0
- package/dist/generated/abi/TeePoolPhalaImplementation.cjs.map +1 -0
- package/dist/generated/abi/TeePoolPhalaImplementation.d.ts +992 -0
- package/dist/generated/abi/TeePoolPhalaImplementation.js +1289 -0
- package/dist/generated/abi/TeePoolPhalaImplementation.js.map +1 -0
- package/dist/generated/abi/UniswapV3NonfungiblePositionManagerImplementation.cjs +1251 -0
- package/dist/generated/abi/UniswapV3NonfungiblePositionManagerImplementation.cjs.map +1 -0
- package/dist/generated/abi/UniswapV3NonfungiblePositionManagerImplementation.d.ts +948 -0
- package/dist/generated/abi/UniswapV3NonfungiblePositionManagerImplementation.js +1227 -0
- package/dist/generated/abi/UniswapV3NonfungiblePositionManagerImplementation.js.map +1 -0
- package/dist/generated/abi/UniswapV3QuoterV2Implementation.cjs +297 -0
- package/dist/generated/abi/UniswapV3QuoterV2Implementation.cjs.map +1 -0
- package/dist/generated/abi/UniswapV3QuoterV2Implementation.d.ts +206 -0
- package/dist/generated/abi/UniswapV3QuoterV2Implementation.js +273 -0
- package/dist/generated/abi/UniswapV3QuoterV2Implementation.js.map +1 -0
- package/dist/generated/abi/VanaEpochImplementation.cjs +1383 -0
- package/dist/generated/abi/VanaEpochImplementation.cjs.map +1 -0
- package/dist/generated/abi/VanaEpochImplementation.d.ts +1050 -0
- package/dist/generated/abi/VanaEpochImplementation.js +1359 -0
- package/dist/generated/abi/VanaEpochImplementation.js.map +1 -0
- package/dist/generated/abi/VanaPoolEntityImplementation.cjs +1191 -0
- package/dist/generated/abi/VanaPoolEntityImplementation.cjs.map +1 -0
- package/dist/generated/abi/VanaPoolEntityImplementation.d.ts +899 -0
- package/dist/generated/abi/VanaPoolEntityImplementation.js +1167 -0
- package/dist/generated/abi/VanaPoolEntityImplementation.js.map +1 -0
- package/dist/generated/abi/VanaPoolStakingImplementation.cjs +1033 -0
- package/dist/generated/abi/VanaPoolStakingImplementation.cjs.map +1 -0
- package/dist/generated/abi/VanaPoolStakingImplementation.d.ts +776 -0
- package/dist/generated/abi/VanaPoolStakingImplementation.js +1009 -0
- package/dist/generated/abi/VanaPoolStakingImplementation.js.map +1 -0
- package/dist/generated/abi/VanaPoolTreasuryImplementation.cjs +538 -0
- package/dist/generated/abi/VanaPoolTreasuryImplementation.cjs.map +1 -0
- package/dist/generated/abi/VanaPoolTreasuryImplementation.d.ts +393 -0
- package/dist/generated/abi/VanaPoolTreasuryImplementation.js +514 -0
- package/dist/generated/abi/VanaPoolTreasuryImplementation.js.map +1 -0
- package/dist/generated/abi/VanaRuntimePermissionsImplementation.cjs +759 -0
- package/dist/generated/abi/VanaRuntimePermissionsImplementation.cjs.map +1 -0
- package/dist/generated/abi/VanaRuntimePermissionsImplementation.d.ts +563 -0
- package/dist/generated/abi/VanaRuntimePermissionsImplementation.js +735 -0
- package/dist/generated/abi/VanaRuntimePermissionsImplementation.js.map +1 -0
- package/dist/generated/abi/VanaRuntimeServersImplementation.cjs +820 -0
- package/dist/generated/abi/VanaRuntimeServersImplementation.cjs.map +1 -0
- package/dist/generated/abi/VanaRuntimeServersImplementation.d.ts +609 -0
- package/dist/generated/abi/VanaRuntimeServersImplementation.js +796 -0
- package/dist/generated/abi/VanaRuntimeServersImplementation.js.map +1 -0
- package/dist/generated/abi/VanaTreasuryImplementation.cjs +536 -0
- package/dist/generated/abi/VanaTreasuryImplementation.cjs.map +1 -0
- package/dist/generated/abi/VanaTreasuryImplementation.d.ts +393 -0
- package/dist/generated/abi/VanaTreasuryImplementation.js +512 -0
- package/dist/generated/abi/VanaTreasuryImplementation.js.map +1 -0
- package/dist/generated/abi/WVANAImplementation.cjs +339 -0
- package/dist/generated/abi/WVANAImplementation.cjs.map +1 -0
- package/dist/generated/abi/WVANAImplementation.d.ts +244 -0
- package/dist/generated/abi/WVANAImplementation.js +315 -0
- package/dist/generated/abi/WVANAImplementation.js.map +1 -0
- package/dist/generated/abi/index.cjs +209 -0
- package/dist/generated/abi/index.cjs.map +1 -0
- package/dist/{index.node.d.cts → generated/abi/index.d.ts} +16715 -21763
- package/dist/generated/abi/index.js +142 -0
- package/dist/generated/abi/index.js.map +1 -0
- package/dist/generated/addresses.cjs +424 -0
- package/dist/generated/addresses.cjs.map +1 -0
- package/dist/generated/addresses.d.ts +373 -0
- package/dist/generated/addresses.js +394 -0
- package/dist/generated/addresses.js.map +1 -0
- package/dist/generated/event-types.cjs +17 -0
- package/dist/generated/event-types.cjs.map +1 -0
- package/dist/generated/event-types.d.ts +937 -0
- package/dist/generated/event-types.js +1 -0
- package/dist/generated/event-types.js.map +1 -0
- package/dist/generated/eventRegistry.cjs +5228 -0
- package/dist/generated/eventRegistry.cjs.map +1 -0
- package/dist/generated/eventRegistry.d.ts +14 -0
- package/dist/generated/eventRegistry.js +5203 -0
- package/dist/generated/eventRegistry.js.map +1 -0
- package/dist/generated/server/server-exports.cjs +45 -0
- package/dist/generated/server/server-exports.cjs.map +1 -0
- package/dist/generated/server/server-exports.d.ts +39 -0
- package/dist/generated/server/server-exports.js +19 -0
- package/dist/generated/server/server-exports.js.map +1 -0
- package/dist/generated/server/server.cjs +17 -0
- package/dist/generated/server/server.cjs.map +1 -0
- package/dist/generated/server/server.d.ts +907 -0
- package/dist/generated/server/server.js +1 -0
- package/dist/generated/server/server.js.map +1 -0
- package/dist/generated/subgraph.cjs +1440 -0
- package/dist/generated/subgraph.cjs.map +1 -0
- package/dist/generated/subgraph.d.ts +6113 -0
- package/dist/generated/subgraph.js +1404 -0
- package/dist/generated/subgraph.js.map +1 -0
- package/dist/index.browser.d.ts +50 -36684
- package/dist/index.browser.js +91 -45518
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +5 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +0 -0
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -0
- package/dist/index.node.cjs +131 -46017
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +94 -36795
- package/dist/index.node.js +108 -45905
- package/dist/index.node.js.map +1 -1
- package/dist/lib/__tests__/redisAtomicStore.test.d.ts +1 -0
- package/dist/lib/redisAtomicStore.cjs +201 -0
- package/dist/lib/redisAtomicStore.cjs.map +1 -0
- package/dist/lib/redisAtomicStore.d.ts +120 -0
- package/dist/lib/redisAtomicStore.js +177 -0
- package/dist/lib/redisAtomicStore.js.map +1 -0
- package/dist/node.cjs +2 -323
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.ts +42 -1
- package/dist/node.js +1 -309
- package/dist/node.js.map +1 -1
- package/dist/platform/browser-only.cjs +37 -0
- package/dist/platform/browser-only.cjs.map +1 -0
- package/dist/platform/browser-only.d.ts +22 -0
- package/dist/platform/browser-only.js +12 -0
- package/dist/platform/browser-only.js.map +1 -0
- package/dist/platform/browser-only.test.d.ts +1 -0
- package/dist/platform/browser-safe.cjs +57 -0
- package/dist/platform/browser-safe.cjs.map +1 -0
- package/dist/platform/browser-safe.d.ts +29 -0
- package/dist/platform/browser-safe.js +31 -0
- package/dist/platform/browser-safe.js.map +1 -0
- package/dist/platform/browser-safe.test.d.ts +1 -0
- package/dist/platform/browser.cjs +488 -0
- package/dist/platform/browser.cjs.map +1 -0
- package/dist/platform/browser.d.ts +291 -0
- package/dist/platform/browser.js +454 -0
- package/dist/platform/browser.js.map +1 -0
- package/dist/platform/browser.test.d.ts +1 -0
- package/dist/platform/index.cjs +50 -0
- package/dist/platform/index.cjs.map +1 -0
- package/dist/platform/index.d.ts +11 -0
- package/dist/platform/index.js +27 -0
- package/dist/platform/index.js.map +1 -0
- package/dist/platform/interface.cjs +17 -0
- package/dist/platform/interface.cjs.map +1 -0
- package/dist/platform/interface.d.ts +409 -0
- package/dist/platform/interface.js +1 -0
- package/dist/platform/interface.js.map +1 -0
- package/dist/platform/node.cjs +512 -0
- package/dist/platform/node.cjs.map +1 -0
- package/dist/platform/node.d.ts +86 -0
- package/dist/platform/node.js +481 -0
- package/dist/platform/node.js.map +1 -0
- package/dist/platform/ports/openpgp-port.cjs +74 -0
- package/dist/platform/ports/openpgp-port.cjs.map +1 -0
- package/dist/platform/ports/openpgp-port.d.ts +13 -0
- package/dist/platform/ports/openpgp-port.js +59 -0
- package/dist/platform/ports/openpgp-port.js.map +1 -0
- package/dist/platform/ports/pgp-port.cjs +17 -0
- package/dist/platform/ports/pgp-port.cjs.map +1 -0
- package/dist/platform/ports/pgp-port.d.ts +35 -0
- package/dist/platform/ports/pgp-port.js +1 -0
- package/dist/platform/ports/pgp-port.js.map +1 -0
- package/dist/platform/shared/error-utils.cjs +43 -0
- package/dist/platform/shared/error-utils.cjs.map +1 -0
- package/dist/platform/shared/error-utils.d.ts +23 -0
- package/dist/platform/shared/error-utils.js +18 -0
- package/dist/platform/shared/error-utils.js.map +1 -0
- package/dist/platform/shared/pgp-utils.cjs +55 -0
- package/dist/platform/shared/pgp-utils.cjs.map +1 -0
- package/dist/platform/shared/pgp-utils.d.ts +59 -0
- package/dist/platform/shared/pgp-utils.js +29 -0
- package/dist/platform/shared/pgp-utils.js.map +1 -0
- package/dist/platform/shared/stream-utils.cjs +49 -0
- package/dist/platform/shared/stream-utils.cjs.map +1 -0
- package/dist/platform/shared/stream-utils.d.ts +14 -0
- package/dist/platform/shared/stream-utils.js +25 -0
- package/dist/platform/shared/stream-utils.js.map +1 -0
- package/dist/platform/utils.cjs +114 -0
- package/dist/platform/utils.cjs.map +1 -0
- package/dist/platform/utils.d.ts +49 -0
- package/dist/platform/utils.js +76 -0
- package/dist/platform/utils.js.map +1 -0
- package/dist/platform/utils.test.d.ts +1 -0
- package/dist/platform.browser.d.ts +6 -57
- package/dist/platform.browser.js +10 -356
- package/dist/platform.browser.js.map +1 -1
- package/dist/platform.cjs +14 -698
- package/dist/platform.cjs.map +1 -1
- package/dist/platform.d.ts +11 -2
- package/dist/platform.js +14 -684
- package/dist/platform.js.map +1 -1
- package/dist/platform.node.cjs +14 -698
- package/dist/platform.node.cjs.map +1 -1
- package/dist/platform.node.d.ts +7 -98
- package/dist/platform.node.js +14 -684
- package/dist/platform.node.js.map +1 -1
- package/dist/schemas/dataSchema.schema.json +53 -0
- package/dist/schemas/grantFile.schema.json +43 -0
- package/dist/server/relayerHandler.cjs +452 -0
- package/dist/server/relayerHandler.cjs.map +1 -0
- package/dist/server/relayerHandler.d.ts +69 -0
- package/dist/server/relayerHandler.js +428 -0
- package/dist/server/relayerHandler.js.map +1 -0
- package/dist/storage/index.cjs +47 -0
- package/dist/storage/index.cjs.map +1 -0
- package/dist/storage/index.d.ts +57 -0
- package/dist/storage/index.js +17 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/manager.cjs +272 -0
- package/dist/storage/manager.cjs.map +1 -0
- package/dist/storage/manager.d.ts +241 -0
- package/dist/storage/manager.js +248 -0
- package/dist/storage/manager.js.map +1 -0
- package/dist/storage/providers/callback-storage.cjs +248 -0
- package/dist/storage/providers/callback-storage.cjs.map +1 -0
- package/dist/storage/providers/callback-storage.d.ts +183 -0
- package/dist/storage/providers/callback-storage.js +226 -0
- package/dist/storage/providers/callback-storage.js.map +1 -0
- package/dist/storage/providers/dropbox.cjs +237 -0
- package/dist/storage/providers/dropbox.cjs.map +1 -0
- package/dist/storage/providers/dropbox.d.ts +39 -0
- package/dist/storage/providers/dropbox.js +215 -0
- package/dist/storage/providers/dropbox.js.map +1 -0
- package/dist/storage/providers/dropbox.test.d.ts +1 -0
- package/dist/storage/providers/google-drive.cjs +516 -0
- package/dist/storage/providers/google-drive.cjs.map +1 -0
- package/dist/storage/providers/google-drive.d.ts +152 -0
- package/dist/storage/providers/google-drive.js +494 -0
- package/dist/storage/providers/google-drive.js.map +1 -0
- package/dist/storage/providers/google-drive.test.d.ts +1 -0
- package/dist/storage/providers/ipfs.cjs +283 -0
- package/dist/storage/providers/ipfs.cjs.map +1 -0
- package/dist/storage/providers/ipfs.d.ts +160 -0
- package/dist/storage/providers/ipfs.js +261 -0
- package/dist/storage/providers/ipfs.js.map +1 -0
- package/dist/storage/providers/pinata.cjs +339 -0
- package/dist/storage/providers/pinata.cjs.map +1 -0
- package/dist/storage/providers/pinata.d.ts +168 -0
- package/dist/storage/providers/pinata.js +317 -0
- package/dist/storage/providers/pinata.js.map +1 -0
- package/dist/storage/tests/callbackStorage.test.d.ts +1 -0
- package/dist/storage/tests/googleDriveStorage.test.d.ts +1 -0
- package/dist/storage/tests/ipfsStorage.test.d.ts +1 -0
- package/dist/storage/tests/pinataStorage.test.d.ts +1 -0
- package/dist/storage/tests/storageManager.test.d.ts +1 -0
- package/dist/tests/abi.test.d.ts +1 -0
- package/dist/tests/chains-definitions.test.d.ts +1 -0
- package/dist/tests/core-encryption.test.d.ts +1 -0
- package/dist/tests/core-extended.test.d.ts +1 -0
- package/dist/tests/core-generics-coverage.test.d.ts +1 -0
- package/dist/tests/coverage-boost.test.d.ts +1 -0
- package/dist/tests/crypto-cross-platform-compatibility.test.d.ts +1 -0
- package/dist/tests/data-addfile-permissions-schema.test.d.ts +1 -0
- package/dist/tests/data-additional-methods.test.d.ts +1 -0
- package/dist/tests/data-controller-edge-cases.test.d.ts +1 -0
- package/dist/tests/data-ipfs-gateways.test.d.ts +1 -0
- package/dist/tests/data-relayer.test.d.ts +1 -0
- package/dist/tests/data-schema-validation.test.d.ts +1 -0
- package/dist/tests/data-simple-methods.test.d.ts +1 -0
- package/dist/tests/data-upload-owner-validation.test.d.ts +1 -0
- package/dist/tests/data.test.d.ts +1 -0
- package/dist/tests/demo-integration.test.d.ts +1 -0
- package/dist/tests/demo-trusted-server-integration.test.d.ts +1 -0
- package/dist/tests/download-relayer.test.d.ts +1 -0
- package/dist/tests/dual-mode-permissions.test.d.ts +1 -0
- package/dist/tests/dual-mode-trusted-servers.test.d.ts +1 -0
- package/dist/tests/encryption-correct-implementation.test.d.ts +1 -0
- package/dist/tests/encryption-coverage.test.d.ts +1 -0
- package/dist/tests/encryption-edge-cases.test.d.ts +1 -0
- package/dist/tests/encryption-utils-updated.test.d.ts +1 -0
- package/dist/tests/errors-coverage.test.d.ts +1 -0
- package/dist/tests/errors.test.d.ts +1 -0
- package/dist/tests/factories/mockFactory.d.ts +316 -0
- package/dist/tests/fakes/FakeStorageManager.d.ts +200 -0
- package/dist/tests/fakes/FakeStorageManager.test.d.ts +1 -0
- package/dist/tests/fakes/FakeWaitForTransactionEvents.d.ts +170 -0
- package/dist/tests/fakes/FakeWaitForTransactionEvents.test.d.ts +1 -0
- package/dist/tests/fakes/fake-pgp-port.d.ts +13 -0
- package/dist/tests/grantValidation-edge-cases.test.d.ts +1 -0
- package/dist/tests/grantValidation-unreachable-branch.test.d.ts +1 -0
- package/dist/tests/helper-methods.test.d.ts +1 -0
- package/dist/tests/helpers/platformTestHelpers.d.ts +106 -0
- package/dist/tests/helpers/typedMocks.d.ts +64 -0
- package/dist/tests/index-browser.test.d.ts +1 -0
- package/dist/tests/index-node.test.d.ts +1 -0
- package/dist/tests/index.test.d.ts +1 -0
- package/dist/tests/mocks/platformAdapter.d.ts +12 -0
- package/dist/tests/new-permissions-methods.test.d.ts +1 -0
- package/dist/tests/no-buffer-browser.test.d.ts +1 -0
- package/dist/tests/permissions-grantee.test.d.ts +1 -0
- package/dist/tests/permissions-revoke-relayer.test.d.ts +1 -0
- package/dist/tests/permissions-schema-validation.test.d.ts +1 -0
- package/dist/tests/permissions-server-files.test.d.ts +1 -0
- package/dist/tests/permissions-transaction-options.test.d.ts +1 -0
- package/dist/tests/permissions-trust-servers.test.d.ts +1 -0
- package/dist/tests/permissions.test.d.ts +1 -0
- package/dist/tests/personal.test.d.ts +1 -0
- package/dist/tests/platform-browser.test.d.ts +1 -0
- package/dist/tests/platform-crypto-expanded.test.d.ts +1 -0
- package/dist/tests/platform-crypto.test.d.ts +1 -0
- package/dist/tests/platform-index.test.d.ts +1 -0
- package/dist/tests/platform-node.test.d.ts +1 -0
- package/dist/tests/platform-shared-utils.test.d.ts +1 -0
- package/dist/tests/platform-updated.test.d.ts +1 -0
- package/dist/tests/protocol-additional-methods.test.d.ts +1 -0
- package/dist/tests/protocol.test.d.ts +1 -0
- package/dist/tests/read-only-mode.test.d.ts +1 -0
- package/dist/tests/relayer-integration.test.d.ts +1 -0
- package/dist/tests/relayer-unified.test.d.ts +1 -0
- package/dist/tests/schemas.test.d.ts +1 -0
- package/dist/tests/server-relayer-handler.test.d.ts +1 -0
- package/dist/tests/setup.d.ts +7 -0
- package/dist/tests/signatureFormatter.test.d.ts +1 -0
- package/dist/tests/trusted-server-queries.test.d.ts +1 -0
- package/dist/tests/typedDataConverter.test.d.ts +1 -0
- package/dist/tests/types-contracts.test.d.ts +1 -0
- package/dist/tests/types-data.test.d.ts +1 -0
- package/dist/tests/types-external-apis.test.d.ts +1 -0
- package/dist/tests/types-generics.test.d.ts +1 -0
- package/dist/tests/types-permissions.test.d.ts +1 -0
- package/dist/tests/types-upload-params.test.d.ts +1 -0
- package/dist/tests/types.test.d.ts +1 -0
- package/dist/tests/utils-formatters.test.d.ts +1 -0
- package/dist/tests/utils-grantFiles-edge-cases.test.d.ts +1 -0
- package/dist/tests/utils-grantFiles-validation.test.d.ts +1 -0
- package/dist/tests/utils-grantFiles.test.d.ts +1 -0
- package/dist/tests/utils-grantValidation-consolidated.test.d.ts +1 -0
- package/dist/tests/utils-grants.test.d.ts +1 -0
- package/dist/tests/utils-ipfs-additional.test.d.ts +1 -0
- package/dist/tests/utils-ipfs.test.d.ts +4 -0
- package/dist/tests/utils-schemaValidation.test.d.ts +1 -0
- package/dist/tests/vana.test.d.ts +1 -0
- package/dist/tests/wallet-crypto-compatibility.test.d.ts +1 -0
- package/dist/types/accessSettlement.cjs +17 -0
- package/dist/types/accessSettlement.cjs.map +1 -0
- package/dist/types/accessSettlement.d.ts +66 -0
- package/dist/types/accessSettlement.js +1 -0
- package/dist/types/accessSettlement.js.map +1 -0
- package/dist/types/atomicStore.cjs +31 -0
- package/dist/types/atomicStore.cjs.map +1 -0
- package/dist/types/atomicStore.d.ts +236 -0
- package/dist/types/atomicStore.js +7 -0
- package/dist/types/atomicStore.js.map +1 -0
- package/dist/types/blockchain.cjs +17 -0
- package/dist/types/blockchain.cjs.map +1 -0
- package/dist/types/blockchain.d.ts +85 -0
- package/dist/types/blockchain.js +1 -0
- package/dist/types/blockchain.js.map +1 -0
- package/dist/types/chains-additional.test.d.ts +1 -0
- package/dist/types/chains.cjs +36 -0
- package/dist/types/chains.cjs.map +1 -0
- package/dist/types/chains.d.ts +98 -0
- package/dist/types/chains.js +11 -0
- package/dist/types/chains.js.map +1 -0
- package/dist/types/config.cjs +51 -0
- package/dist/types/config.cjs.map +1 -0
- package/dist/types/config.d.ts +720 -0
- package/dist/types/config.js +23 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/contracts.cjs +17 -0
- package/dist/types/contracts.cjs.map +1 -0
- package/dist/types/contracts.d.ts +129 -0
- package/dist/types/contracts.js +1 -0
- package/dist/types/contracts.js.map +1 -0
- package/dist/types/controller-context.cjs +17 -0
- package/dist/types/controller-context.cjs.map +1 -0
- package/dist/types/controller-context.d.ts +68 -0
- package/dist/types/controller-context.js +1 -0
- package/dist/types/controller-context.js.map +1 -0
- package/dist/types/data.cjs +17 -0
- package/dist/types/data.cjs.map +1 -0
- package/dist/types/data.d.ts +763 -0
- package/dist/types/data.js +1 -0
- package/dist/types/data.js.map +1 -0
- package/dist/types/eccrypto-js.d.cjs +2 -0
- package/dist/types/eccrypto-js.d.cjs.map +1 -0
- package/dist/types/eccrypto-js.d.js +1 -0
- package/dist/types/eccrypto-js.d.js.map +1 -0
- package/dist/types/external-apis.cjs +61 -0
- package/dist/types/external-apis.cjs.map +1 -0
- package/dist/types/external-apis.d.ts +184 -0
- package/dist/types/external-apis.js +34 -0
- package/dist/types/external-apis.js.map +1 -0
- package/dist/types/generics.cjs +17 -0
- package/dist/types/generics.cjs.map +1 -0
- package/dist/types/generics.d.ts +518 -0
- package/dist/types/generics.js +1 -0
- package/dist/types/generics.js.map +1 -0
- package/dist/types/index.cjs +65 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.ts +50 -0
- package/dist/types/index.js +42 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/operationStore.cjs +17 -0
- package/dist/types/operationStore.cjs.map +1 -0
- package/dist/types/operationStore.d.ts +171 -0
- package/dist/types/operationStore.js +1 -0
- package/dist/types/operationStore.js.map +1 -0
- package/dist/types/operations.cjs +53 -0
- package/dist/types/operations.cjs.map +1 -0
- package/dist/types/operations.d.ts +204 -0
- package/dist/types/operations.js +26 -0
- package/dist/types/operations.js.map +1 -0
- package/dist/types/options.cjs +17 -0
- package/dist/types/options.cjs.map +1 -0
- package/dist/types/options.d.ts +308 -0
- package/dist/types/options.js +1 -0
- package/dist/types/options.js.map +1 -0
- package/dist/types/permissions.cjs +17 -0
- package/dist/types/permissions.cjs.map +1 -0
- package/dist/types/permissions.d.ts +953 -0
- package/dist/types/permissions.js +1 -0
- package/dist/types/permissions.js.map +1 -0
- package/dist/types/personal.cjs +17 -0
- package/dist/types/personal.cjs.map +1 -0
- package/dist/types/personal.d.ts +174 -0
- package/dist/types/personal.js +1 -0
- package/dist/types/personal.js.map +1 -0
- package/dist/types/relayer.cjs +17 -0
- package/dist/types/relayer.cjs.map +1 -0
- package/dist/types/relayer.d.ts +553 -0
- package/dist/types/relayer.js +1 -0
- package/dist/types/relayer.js.map +1 -0
- package/dist/types/runtimePermissions.cjs +17 -0
- package/dist/types/runtimePermissions.cjs.map +1 -0
- package/dist/types/runtimePermissions.d.ts +122 -0
- package/dist/types/runtimePermissions.js +1 -0
- package/dist/types/runtimePermissions.js.map +1 -0
- package/dist/types/storage.cjs +39 -0
- package/dist/types/storage.cjs.map +1 -0
- package/dist/types/storage.d.ts +117 -0
- package/dist/types/storage.js +15 -0
- package/dist/types/storage.js.map +1 -0
- package/dist/types/transactionResults.cjs +17 -0
- package/dist/types/transactionResults.cjs.map +1 -0
- package/dist/types/transactionResults.d.ts +193 -0
- package/dist/types/transactionResults.js +1 -0
- package/dist/types/transactionResults.js.map +1 -0
- package/dist/types/utils.cjs +17 -0
- package/dist/types/utils.cjs.map +1 -0
- package/dist/types/utils.d.ts +771 -0
- package/dist/types/utils.js +1 -0
- package/dist/types/utils.js.map +1 -0
- package/dist/types.cjs +23 -0
- package/dist/types.cjs.map +1 -0
- package/dist/types.d.ts +30 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/__tests__/chainQuery.test.d.ts +1 -0
- package/dist/utils/__tests__/parseTransaction.test.d.ts +1 -0
- package/dist/utils/__tests__/pojo-serialization.test.d.ts +1 -0
- package/dist/utils/__tests__/signatureCache.test.d.ts +1 -0
- package/dist/utils/__tests__/subgraphConsistency.test.d.ts +4 -0
- package/dist/utils/__tests__/subgraphPagination.test.d.ts +4 -0
- package/dist/utils/__tests__/transaction-edge-cases.test.d.ts +1 -0
- package/dist/utils/__tests__/transactionHelpers.test.d.ts +1 -0
- package/dist/utils/__tests__/urlResolver.test.d.ts +4 -0
- package/dist/utils/blockchain/registry.cjs +81 -0
- package/dist/utils/blockchain/registry.cjs.map +1 -0
- package/dist/utils/blockchain/registry.d.ts +32 -0
- package/dist/utils/blockchain/registry.js +56 -0
- package/dist/utils/blockchain/registry.js.map +1 -0
- package/dist/utils/blockchain/registry.test.d.ts +1 -0
- package/dist/utils/chainQuery.cjs +107 -0
- package/dist/utils/chainQuery.cjs.map +1 -0
- package/dist/utils/chainQuery.d.ts +31 -0
- package/dist/utils/chainQuery.js +82 -0
- package/dist/utils/chainQuery.js.map +1 -0
- package/dist/utils/crypto-utils.cjs +108 -0
- package/dist/utils/crypto-utils.cjs.map +1 -0
- package/dist/utils/crypto-utils.d.ts +100 -0
- package/dist/utils/crypto-utils.js +76 -0
- package/dist/utils/crypto-utils.js.map +1 -0
- package/dist/utils/crypto-utils.test.d.ts +1 -0
- package/dist/utils/download.cjs +69 -0
- package/dist/utils/download.cjs.map +1 -0
- package/dist/utils/download.d.ts +40 -0
- package/dist/utils/download.js +45 -0
- package/dist/utils/download.js.map +1 -0
- package/dist/utils/encoding.cjs +66 -0
- package/dist/utils/encoding.cjs.map +1 -0
- package/dist/utils/encoding.d.ts +52 -0
- package/dist/utils/encoding.js +39 -0
- package/dist/utils/encoding.js.map +1 -0
- package/dist/utils/encoding.test.d.ts +1 -0
- package/dist/utils/encryption.cjs +176 -0
- package/dist/utils/encryption.cjs.map +1 -0
- package/dist/utils/encryption.d.ts +271 -0
- package/dist/utils/encryption.js +142 -0
- package/dist/utils/encryption.js.map +1 -0
- package/dist/utils/formatters.cjs +55 -0
- package/dist/utils/formatters.cjs.map +1 -0
- package/dist/utils/formatters.d.ts +118 -0
- package/dist/utils/formatters.js +28 -0
- package/dist/utils/formatters.js.map +1 -0
- package/dist/utils/grantFiles.cjs +181 -0
- package/dist/utils/grantFiles.cjs.map +1 -0
- package/dist/utils/grantFiles.d.ts +172 -0
- package/dist/utils/grantFiles.js +143 -0
- package/dist/utils/grantFiles.js.map +1 -0
- package/dist/utils/grantValidation.cjs +243 -0
- package/dist/utils/grantValidation.cjs.map +1 -0
- package/dist/utils/grantValidation.d.ts +226 -0
- package/dist/utils/grantValidation.js +201 -0
- package/dist/utils/grantValidation.js.map +1 -0
- package/dist/utils/grants.cjs +108 -0
- package/dist/utils/grants.cjs.map +1 -0
- package/dist/utils/grants.d.ts +148 -0
- package/dist/utils/grants.js +82 -0
- package/dist/utils/grants.js.map +1 -0
- package/dist/utils/ipfs.cjs +128 -0
- package/dist/utils/ipfs.cjs.map +1 -0
- package/dist/utils/ipfs.d.ts +88 -0
- package/dist/utils/ipfs.js +97 -0
- package/dist/utils/ipfs.js.map +1 -0
- package/dist/utils/lazy-import.cjs +38 -0
- package/dist/utils/lazy-import.cjs.map +1 -0
- package/dist/utils/lazy-import.d.ts +43 -0
- package/dist/utils/lazy-import.js +14 -0
- package/dist/utils/lazy-import.js.map +1 -0
- package/dist/utils/multicall.cjs +233 -0
- package/dist/utils/multicall.cjs.map +1 -0
- package/dist/utils/multicall.d.ts +126 -0
- package/dist/utils/multicall.js +208 -0
- package/dist/utils/multicall.js.map +1 -0
- package/dist/utils/parseTransactionPojo.cjs +87 -0
- package/dist/utils/parseTransactionPojo.cjs.map +1 -0
- package/dist/utils/parseTransactionPojo.d.ts +31 -0
- package/dist/utils/parseTransactionPojo.js +63 -0
- package/dist/utils/parseTransactionPojo.js.map +1 -0
- package/dist/utils/runtimeGrantFiles.cjs +84 -0
- package/dist/utils/runtimeGrantFiles.cjs.map +1 -0
- package/dist/utils/runtimeGrantFiles.d.ts +66 -0
- package/dist/utils/runtimeGrantFiles.js +58 -0
- package/dist/utils/runtimeGrantFiles.js.map +1 -0
- package/dist/utils/schemaValidation.cjs +258 -0
- package/dist/utils/schemaValidation.cjs.map +1 -0
- package/dist/utils/schemaValidation.d.ts +168 -0
- package/dist/utils/schemaValidation.js +219 -0
- package/dist/utils/schemaValidation.js.map +1 -0
- package/dist/utils/signatureCache.cjs +192 -0
- package/dist/utils/signatureCache.cjs.map +1 -0
- package/dist/utils/signatureCache.d.ts +172 -0
- package/dist/utils/signatureCache.js +167 -0
- package/dist/utils/signatureCache.js.map +1 -0
- package/dist/utils/signatureFormatter.cjs +42 -0
- package/dist/utils/signatureFormatter.cjs.map +1 -0
- package/dist/utils/signatureFormatter.d.ts +36 -0
- package/dist/utils/signatureFormatter.js +18 -0
- package/dist/utils/signatureFormatter.js.map +1 -0
- package/dist/utils/subgraphConsistency.cjs +184 -0
- package/dist/utils/subgraphConsistency.cjs.map +1 -0
- package/dist/utils/subgraphConsistency.d.ts +65 -0
- package/dist/utils/subgraphConsistency.js +155 -0
- package/dist/utils/subgraphConsistency.js.map +1 -0
- package/dist/utils/subgraphMetaCache.cjs +101 -0
- package/dist/utils/subgraphMetaCache.cjs.map +1 -0
- package/dist/utils/subgraphMetaCache.d.ts +56 -0
- package/dist/utils/subgraphMetaCache.js +76 -0
- package/dist/utils/subgraphMetaCache.js.map +1 -0
- package/dist/utils/subgraphPagination.cjs +104 -0
- package/dist/utils/subgraphPagination.cjs.map +1 -0
- package/dist/utils/subgraphPagination.d.ts +78 -0
- package/dist/utils/subgraphPagination.js +78 -0
- package/dist/utils/subgraphPagination.js.map +1 -0
- package/dist/utils/tests/multicall.test.d.ts +1 -0
- package/dist/utils/transactionHelpers.cjs +54 -0
- package/dist/utils/transactionHelpers.cjs.map +1 -0
- package/dist/utils/transactionHelpers.d.ts +80 -0
- package/dist/utils/transactionHelpers.js +29 -0
- package/dist/utils/transactionHelpers.js.map +1 -0
- package/dist/utils/typeGuards.cjs +109 -0
- package/dist/utils/typeGuards.cjs.map +1 -0
- package/dist/utils/typeGuards.d.ts +138 -0
- package/dist/utils/typeGuards.js +74 -0
- package/dist/utils/typeGuards.js.map +1 -0
- package/dist/utils/typedDataConverter.cjs +43 -0
- package/dist/utils/typedDataConverter.cjs.map +1 -0
- package/dist/utils/typedDataConverter.d.ts +46 -0
- package/dist/utils/typedDataConverter.js +19 -0
- package/dist/utils/typedDataConverter.js.map +1 -0
- package/dist/utils/urlResolver.cjs +62 -0
- package/dist/utils/urlResolver.cjs.map +1 -0
- package/dist/utils/urlResolver.d.ts +56 -0
- package/dist/utils/urlResolver.js +37 -0
- package/dist/utils/urlResolver.js.map +1 -0
- package/dist/utils/wallet.cjs +63 -0
- package/dist/utils/wallet.cjs.map +1 -0
- package/dist/utils/wallet.d.ts +94 -0
- package/dist/utils/wallet.js +37 -0
- package/dist/utils/wallet.js.map +1 -0
- package/dist/utils/withEvents.cjs +44 -0
- package/dist/utils/withEvents.cjs.map +1 -0
- package/dist/utils/withEvents.d.ts +56 -0
- package/dist/utils/withEvents.js +18 -0
- package/dist/utils/withEvents.js.map +1 -0
- package/package.json +79 -37
- package/dist/browser-cRpdLQ3-.d.ts +0 -237
- package/dist/chains.browser.cjs.map +0 -1
- package/dist/chains.d.cts +0 -2
- package/dist/chains.node.d.cts +0 -2
- package/dist/index.d.cts +0 -2
- package/dist/node-CkdgwBiv.d.cts +0 -237
- package/dist/node-CkdgwBiv.d.ts +0 -237
- package/dist/node.d.cts +0 -1
- package/dist/platform.d.cts +0 -2
- package/dist/platform.node.d.cts +0 -101
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"metadata": {
|
|
3
|
+
"generated": "2025-08-17T15:03:45.067Z",
|
|
4
|
+
"eccryptoVersion": "1.1.6",
|
|
5
|
+
"description": "Test vectors from eccrypto to ensure backward compatibility",
|
|
6
|
+
"format": "eccrypto ECIES format: [iv(16)] [ephemPublicKey(65)] [ciphertext(variable)] [mac(32)]"
|
|
7
|
+
},
|
|
8
|
+
"vectors": [
|
|
9
|
+
{
|
|
10
|
+
"name": "Simple text message",
|
|
11
|
+
"privateKey": "1878693c39d810ce44ee40f9fdd068a0414615e74a7ff58adaba74063b2402e4",
|
|
12
|
+
"publicKey": "0486c0312c4609fc3d53c35cbd1b7af82c8900c056a0389e1697720e3b60284aa2996a6c16c9b65eeb830c9016c5ab49481a406c88666de95f8fc236d0cbb7bb79",
|
|
13
|
+
"message": "48656c6c6f2c20454349455321",
|
|
14
|
+
"encrypted": {
|
|
15
|
+
"iv": "9da6a7f84a8a192eeb787fd5907bf23a",
|
|
16
|
+
"ephemPublicKey": "0442fdf37e36007921c07e5447bdae847f04a46e7bde3f3c8cca37d2766633d8e52c734a183d5e61f24bd50c677c8bd9491ba46a29c97b5d3c4dce93477c66deb6",
|
|
17
|
+
"ciphertext": "44070d8d4d2dc7ac70c77732c22b87aa",
|
|
18
|
+
"mac": "901a65fb7c13995727904e99618d73de370d37913e0c33fc38c9c87737ccdf8a"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "Binary data (64 bytes)",
|
|
23
|
+
"privateKey": "21796c4692ba9d34b7f273c0099b96625e8dec49ada0390724d23dc35f4986d1",
|
|
24
|
+
"publicKey": "04ab33f0e766d672f89c844633eb491e1ce75bce281423c11e1247503374e42f4b3877fab9a5b762ac78c8a639a0277d178280e580ffa992056b6d2ed3679f18ef",
|
|
25
|
+
"message": "0b35fb489cd6f2bd6ab923382053a2cffc1054371a8009cae0009a8fc4c75ecc52e937d6571ea9e29d40c29cffd2cf2a0a14021871017a6ac171e48d7feda637",
|
|
26
|
+
"encrypted": {
|
|
27
|
+
"iv": "a9e389c20c31d8aed19da6367a7d28e8",
|
|
28
|
+
"ephemPublicKey": "04fd61f7e70726779fd8e13bcbd5a41d2d8d7e3d24053eef6493bbae390e05e1a6fce46b6012549edcc267c5b6aa64f747b9466bcf086695c5a1344dcb187c41a2",
|
|
29
|
+
"ciphertext": "1c233cdaa6514370daaf3371c2f566522181c115bb445883caa0e97d205a46741c1d0726901da59978c346da826ccd7ff4c1d92742f43adef98faf5f7498c3ad811d3dda1f5e8be425051d4fb973bc3c",
|
|
30
|
+
"mac": "f18a5a0338c4a9c1b5242949873095a6d0ef2707918d05d89f745f27ed119c73"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "Large data (1KB)",
|
|
35
|
+
"privateKey": "ae1a9ea14589c1d18c6f4c9683d4ee970d389cac2844cece049e1a2f5ee3f62e",
|
|
36
|
+
"publicKey": "045c0e8e526fba2c2aa05834c06db12d737bcb899f7763d46690f36eadb490c3ba4cdaf0bcb8799b903378dc5f9d350bbe3b935e5f323be3d477c9deb4fdb05212",
|
|
37
|
+
"message": "faab9c147b1f99687b418fd3e3fc5b9365aa16b5098c32e9db14ff0e79cc1fa36ab8454686a5ef2484479d1e4eb9a611996c26d3a0db5783dc152fa375114ca9fda31db7f7d3fa4db79b8607797cb3c7e5b8964f9ac65e1c4f2f039d39c4ac4ea708f37f578a19efe03b502a44d1aa092530f3f1129ba9972af48ff22376605bb9b9070602f6cc1f929129dff4c1a41c91339b613014e5aedf4ac83e67353e6005bc6c432610b10aa1d3a57a4e4083d57994f47e0b10dca68e7a7759e882ccc07712407d428b3236aca46c0d33e05cde10731f205dd89982afa2bd3df9ee04677de68e3a8fb8ec3cb18add7ff94b5dfc6eaf8d3df9650703ffe00349af79495059e7de7805813d51616228a5e4d18e85967b3c9838141b286be56ccb373f53952fbbc99f0e3bfbdf4107c917ab5ea6cd87bba0a0cef53ff3b64580a843005426d685a467196707386e52b3f1aa0af2dacf8e8df5479bc1a26923c5c39469ac562798357ecea355e740bc370ae623acadfeac0f42e3bf8ee2dac60cd1898bbcfea1ddbc54b3acebf5dd089fdbe9764d1577bec35b31ec14260ae62bbbad3e8748025abfece65a5986e1bd86446ca7c56789b6e7356538a75ac56c8ac14450ef62ae19fab518061cba066b90ac3e380d7526d8ab0e82bfa13a65dd0e5994610fb2beb1f324ca7beff4ca1466bc74e0a5f8d548a3f8f5681979130b890f03473564dc5a3b1374ca9e39def4ecde100e484816af89ed4d59aef54ffc51b075fa917d28412ad49eb3a79fb036b5caa101f46a61936cd7cf68dfd943547d3f34b19b6ae7c3a73cbebca8189708fa9a78a42f7ca121683a7f1dba1e70ac79fb7b51bae3392f5ea7872f11b74fdb135e090834136048680a077ab4cbfd9da21f39f51b26d83aed8786da2d803994089706518254beaff040a50b565d5d8ee7d93923102dcbb2514bf54f61d1546e88da96b407eda179ef7fbc2535342e24ae12fb4e7835c611b3ac588e2c2419b1215083e7b4023d2926e67aed81d475618b819c941e4f279d237b50cfff94149dc1f6066bdcdf808d14b7e7dddfd319202755494df8e06f677209c9f864fcf15247b947eca71d87e7d6f77581bbec95363e8ed6b5dc601f206cb61309c7d440fa6941bcd00b20ac45f42916712e9ec7951bd3e4d3d97382f570b0679519a8cde90a6a2ff37b5c34ecc155be5f8a900aad21e69ecf605cc5a30a8cb11e7ec748ade5033e2ef649b1bc0f09e910589dbd8f8144138365e636474dad70edcc8b83ba5f83bf5123a2cf40d3409fcc8927cea503780c7d0f2a34496a3c2669ca1f26a4bcfe5dc008e4504a226e0a38735c1b78a628e6283e4808718f304ebbcb9fa84c6c3c4080a9e6a4c252582e508d2336080a461fc2dc6216a2e006d2d35cbb837b7f85282d110c37bd5710d3fe388f7edca3e17a334a85",
|
|
38
|
+
"encrypted": {
|
|
39
|
+
"iv": "fb1452dae55b431b99a88376dbd732b8",
|
|
40
|
+
"ephemPublicKey": "04698c369bf59ef9477d1aa837cd384eb7768e76de2de7fc37d5b5abe1c7f81cd37453359979b7fc3947dd2bd499fe01bcaab265b0970f99150380f48ecfe5fc13",
|
|
41
|
+
"ciphertext": "87eb187e200fe08714ff110586afcce49f3f98045f44b6c5f752b25550cc96323808200b7e766cbc8af9b704252eaca6aeddbd4fc1da03118afb525c8fda4fdd354250f965a8ab02d1d66fb624ccaffa033aa7db4e151833075a81ecd43483f05e4bb8f46e4f1e5ea780ff0bcee3bc31d0d41851a43184e9e0bd499b03750445b8467a4085b056381ac04a11fda032b96fb1c90cf3c05bc3470a319568b8ddc993f822f7366e11ce326b5d9da9c72039a6e8746382f10c8bd8e1637d61c75bec11121457e29fabcc2a17ac613f5c8a2dcab3f3c1b2687f5c66deb29f95f0f4e1c83ce2c8d65a7f5139c04110f691e8d4eafa4f6891a6da1fa5f575e5c4fe7c350bffbd43df796b40b7d2804b883572695c2d1a384517500a42b10ecb512f4fba28f90a7c745f2dcd7193dfe91439aa54864be5273cd18e07c28c9fd117682765a78f8aae43edc378388098622628fbc7b7824a70dc8599400d45a850130e52363e8e1818626079e31593e67a2f5e1a5eae17dd52ca03680676b7db18bd0295a8f24ced48e5b57b7112fd4931898a5f8866b08ad4f647925586e16a3bb775316cde7bc298725e4c0fb0d66421e6dfde9d495bc3e4f7eea20fa184e2befd7499158e135e43afff610d310c9318a7c61858b09d51a7878dec4976d7647ab548819e91abb01971a77869ee16282b18cf323d3853846e509434a69fce2f378e286fa9a85f43938d961b9b95c9936f21e70a2164db96d6d6e6fa23ea742559abc01ea1b82ff8bb855cb350d894581818640e0d563bdf8e14dd80a43f46f8213e18377be29f4bea6ce2b2f3038be944a61cd8d82c3bf738f3800189e5aa41e1ddad4d6c2fca33c67bc11d9fec2296e8bab773bbc8b1127b74764ba16fcfd40d28ca43f8e8fc9bca197d5571196296e674091ff2ac93839a01d5650d1dbf851cfb6726c65847b39b4ec781794e1f54e12ec837cf773b4313566f665f80a0db3f299891b7c25bb733d52f7c2199b614669a4ae2eff3e2bd99806487178864c7acab76fdf09a406ca117d83f0f412af66e05152d4339f3d2f705976419cb5e75bc5d5e13b279e3b6065b83f61a0bd891d7932dbe802ee5390fc7b7ca3d117c14f6c3786e3578545583eef5107ea4fadf306c460c93bc1f96df692c988e9ce22329eec36bafbb8cfa3ddb30e3e33d71eb86830f54cf2a680b127f65e96b3842f966c466c705ce64450ab8d885f68c645046fbff85914f94ed72b92937d70f686abd933183974dc1086af958322d375d1728cea8902e00a0600f12c6b593f1382c61f97233bba6cd45392690a1c5d03f1b4aadacd1e723a5785850bb79d9e3f341e388b099947b61cf9ac83db5b8f01c888f245ed6a23f8dc519920b52576670ee567a923e68bd32a7c2ac364c342551060de4efcba0a078c40c7a8ec9db4a03bf5cc578ece351c6da0553341bbc89bb871c90ab2a45",
|
|
42
|
+
"mac": "faafe7a325f36260015408ef2d859f71628cb7ff5287c6f3ccf6eadba27abe3f"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "UTF-8 text with special characters",
|
|
47
|
+
"privateKey": "d447811abc5bae2fd9c53f97569c50338108154cfa36f18fdbc300bcad37f493",
|
|
48
|
+
"publicKey": "045cb6eecff8afd418c2e590a956dae270a0342a9b1c9180f1500f7719da4b17702eed93f08415ebcf65036af2dc14f677e79aaa1cff54828285ff8686bc6c72bc",
|
|
49
|
+
"message": "48656c6c6f20e4b896e7958c2120f09f8e89205370656369616c2063686172733a20c3a0c3a9c3aec3b5c3bc",
|
|
50
|
+
"messageText": "Hello 世界! 🎉 Special chars: àéîõü",
|
|
51
|
+
"encrypted": {
|
|
52
|
+
"iv": "a6f108c025f8e041a79f085aa42e2a92",
|
|
53
|
+
"ephemPublicKey": "041cfe2092b3d086b60b15a74ab9850878d02dfb0b72976e593027fb6cfdef2634fffdd67639b02bd8c1ed222d22f3eaf8b2f262c38415ddc97629fc7c818670d7",
|
|
54
|
+
"ciphertext": "5b675b04b3a7d93883a9dc0962b47d421966a8fe400c2125b17d30e93b6a8999fb8fe7e82bf7c63fd08092debaafba3c",
|
|
55
|
+
"mac": "e786868550c316b5f31f696bf1aa2f7c59b795033456205f71603cc4d3a0a95b"
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "Known private key test",
|
|
60
|
+
"privateKey": "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef",
|
|
61
|
+
"publicKey": "04bb50e2d89a4ed70663d080659fe0ad4b9bc3e06c17a227433966cb59ceee020decddbf6e00192011648d13b1c00af770c0c1bb609d4d3a5c98a43772e0e18ef4",
|
|
62
|
+
"message": "54657374206d6573736167652077697468206b6e6f776e206b6579",
|
|
63
|
+
"messageText": "Test message with known key",
|
|
64
|
+
"encrypted": {
|
|
65
|
+
"iv": "c8dffc7f392098524aa6acec38f36835",
|
|
66
|
+
"ephemPublicKey": "04b663805d764f8cde462c54019dc76d2f4ec6389f2ee5ca6bf9e13d12fc75c059390c624ae7d35ef2fd6bea4f5a93ccc0fc3a505d222490d9091de379cf2bd3c4",
|
|
67
|
+
"ciphertext": "2beecd177fffa8e07bd1119a208d3303a5a4b24f516b03876bbd319f4b32f1ec",
|
|
68
|
+
"mac": "ace56259ef19fe19aee629eac25327a6b4832ae258521e4dc41823dde910e86d"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
]
|
|
72
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var utils_exports = {};
|
|
20
|
+
__export(utils_exports, {
|
|
21
|
+
bufferToBytes: () => bufferToBytes,
|
|
22
|
+
bytesToBuffer: () => bytesToBuffer,
|
|
23
|
+
constantTimeEqual: () => constantTimeEqual
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(utils_exports);
|
|
26
|
+
function constantTimeEqual(a, b) {
|
|
27
|
+
if (a.length !== b.length) return false;
|
|
28
|
+
let result = 0;
|
|
29
|
+
for (let i = 0; i < a.length; i++) {
|
|
30
|
+
result |= a[i] ^ b[i];
|
|
31
|
+
}
|
|
32
|
+
return result === 0;
|
|
33
|
+
}
|
|
34
|
+
function bufferToBytes(buffer) {
|
|
35
|
+
if (buffer instanceof Uint8Array) {
|
|
36
|
+
return buffer;
|
|
37
|
+
}
|
|
38
|
+
return new Uint8Array(buffer);
|
|
39
|
+
}
|
|
40
|
+
function bytesToBuffer(bytes) {
|
|
41
|
+
if (typeof Buffer === "undefined") {
|
|
42
|
+
throw new Error("Buffer is not available in browser environment");
|
|
43
|
+
}
|
|
44
|
+
return Buffer.from(bytes);
|
|
45
|
+
}
|
|
46
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
47
|
+
0 && (module.exports = {
|
|
48
|
+
bufferToBytes,
|
|
49
|
+
bytesToBuffer,
|
|
50
|
+
constantTimeEqual
|
|
51
|
+
});
|
|
52
|
+
//# sourceMappingURL=utils.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/crypto/ecies/utils.ts"],"sourcesContent":["/**\n * Utility functions for ECIES operations\n *\n * Provides conversion utilities between different data formats\n * to bridge platform-specific implementations.\n */\n\n/**\n * Checks if two Uint8Arrays are equal in constant time\n *\n * @param a - First array to compare\n * @param b - Second array to compare\n * @returns `true` if arrays are equal\n */\nexport function constantTimeEqual(a: Uint8Array, b: Uint8Array): boolean {\n if (a.length !== b.length) return false;\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n result |= a[i] ^ b[i];\n }\n return result === 0;\n}\n\n/**\n * Converts Buffer to Uint8Array (for Node.js compatibility layer)\n * In browser, this is a no-op if already Uint8Array\n *\n * @param buffer - Buffer or Uint8Array to convert\n * @returns Uint8Array representation\n */\nexport function bufferToBytes(buffer: Buffer | Uint8Array): Uint8Array {\n if (buffer instanceof Uint8Array) {\n return buffer;\n }\n // Node.js Buffer is a subclass of Uint8Array\n return new Uint8Array(buffer);\n}\n\n/**\n * Converts Uint8Array to Buffer (for Node.js compatibility layer)\n * Only available in Node.js environment\n *\n * @param bytes - Uint8Array to convert to Buffer\n * @returns Buffer representation\n */\nexport function bytesToBuffer(bytes: Uint8Array): Buffer {\n if (typeof Buffer === \"undefined\") {\n throw new Error(\"Buffer is not available in browser environment\");\n }\n return Buffer.from(bytes);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAcO,SAAS,kBAAkB,GAAe,GAAwB;AACvE,MAAI,EAAE,WAAW,EAAE,OAAQ,QAAO;AAClC,MAAI,SAAS;AACb,WAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,KAAK;AACjC,cAAU,EAAE,CAAC,IAAI,EAAE,CAAC;AAAA,EACtB;AACA,SAAO,WAAW;AACpB;AASO,SAAS,cAAc,QAAyC;AACrE,MAAI,kBAAkB,YAAY;AAChC,WAAO;AAAA,EACT;AAEA,SAAO,IAAI,WAAW,MAAM;AAC9B;AASO,SAAS,cAAc,OAA2B;AACvD,MAAI,OAAO,WAAW,aAAa;AACjC,UAAM,IAAI,MAAM,gDAAgD;AAAA,EAClE;AACA,SAAO,OAAO,KAAK,KAAK;AAC1B;","names":[]}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for ECIES operations
|
|
3
|
+
*
|
|
4
|
+
* Provides conversion utilities between different data formats
|
|
5
|
+
* to bridge platform-specific implementations.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Checks if two Uint8Arrays are equal in constant time
|
|
9
|
+
*
|
|
10
|
+
* @param a - First array to compare
|
|
11
|
+
* @param b - Second array to compare
|
|
12
|
+
* @returns `true` if arrays are equal
|
|
13
|
+
*/
|
|
14
|
+
export declare function constantTimeEqual(a: Uint8Array, b: Uint8Array): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Converts Buffer to Uint8Array (for Node.js compatibility layer)
|
|
17
|
+
* In browser, this is a no-op if already Uint8Array
|
|
18
|
+
*
|
|
19
|
+
* @param buffer - Buffer or Uint8Array to convert
|
|
20
|
+
* @returns Uint8Array representation
|
|
21
|
+
*/
|
|
22
|
+
export declare function bufferToBytes(buffer: Buffer | Uint8Array): Uint8Array;
|
|
23
|
+
/**
|
|
24
|
+
* Converts Uint8Array to Buffer (for Node.js compatibility layer)
|
|
25
|
+
* Only available in Node.js environment
|
|
26
|
+
*
|
|
27
|
+
* @param bytes - Uint8Array to convert to Buffer
|
|
28
|
+
* @returns Buffer representation
|
|
29
|
+
*/
|
|
30
|
+
export declare function bytesToBuffer(bytes: Uint8Array): Buffer;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
function constantTimeEqual(a, b) {
|
|
2
|
+
if (a.length !== b.length) return false;
|
|
3
|
+
let result = 0;
|
|
4
|
+
for (let i = 0; i < a.length; i++) {
|
|
5
|
+
result |= a[i] ^ b[i];
|
|
6
|
+
}
|
|
7
|
+
return result === 0;
|
|
8
|
+
}
|
|
9
|
+
function bufferToBytes(buffer) {
|
|
10
|
+
if (buffer instanceof Uint8Array) {
|
|
11
|
+
return buffer;
|
|
12
|
+
}
|
|
13
|
+
return new Uint8Array(buffer);
|
|
14
|
+
}
|
|
15
|
+
function bytesToBuffer(bytes) {
|
|
16
|
+
if (typeof Buffer === "undefined") {
|
|
17
|
+
throw new Error("Buffer is not available in browser environment");
|
|
18
|
+
}
|
|
19
|
+
return Buffer.from(bytes);
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
bufferToBytes,
|
|
23
|
+
bytesToBuffer,
|
|
24
|
+
constantTimeEqual
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/crypto/ecies/utils.ts"],"sourcesContent":["/**\n * Utility functions for ECIES operations\n *\n * Provides conversion utilities between different data formats\n * to bridge platform-specific implementations.\n */\n\n/**\n * Checks if two Uint8Arrays are equal in constant time\n *\n * @param a - First array to compare\n * @param b - Second array to compare\n * @returns `true` if arrays are equal\n */\nexport function constantTimeEqual(a: Uint8Array, b: Uint8Array): boolean {\n if (a.length !== b.length) return false;\n let result = 0;\n for (let i = 0; i < a.length; i++) {\n result |= a[i] ^ b[i];\n }\n return result === 0;\n}\n\n/**\n * Converts Buffer to Uint8Array (for Node.js compatibility layer)\n * In browser, this is a no-op if already Uint8Array\n *\n * @param buffer - Buffer or Uint8Array to convert\n * @returns Uint8Array representation\n */\nexport function bufferToBytes(buffer: Buffer | Uint8Array): Uint8Array {\n if (buffer instanceof Uint8Array) {\n return buffer;\n }\n // Node.js Buffer is a subclass of Uint8Array\n return new Uint8Array(buffer);\n}\n\n/**\n * Converts Uint8Array to Buffer (for Node.js compatibility layer)\n * Only available in Node.js environment\n *\n * @param bytes - Uint8Array to convert to Buffer\n * @returns Buffer representation\n */\nexport function bytesToBuffer(bytes: Uint8Array): Buffer {\n if (typeof Buffer === \"undefined\") {\n throw new Error(\"Buffer is not available in browser environment\");\n }\n return Buffer.from(bytes);\n}\n"],"mappings":"AAcO,SAAS,kBAAkB,GAAe,GAAwB;AACvE,MAAI,EAAE,WAAW,EAAE,OAAQ,QAAO;AAClC,MAAI,SAAS;AACb,WAAS,IAAI,GAAG,IAAI,EAAE,QAAQ,KAAK;AACjC,cAAU,EAAE,CAAC,IAAI,EAAE,CAAC;AAAA,EACtB;AACA,SAAO,WAAW;AACpB;AASO,SAAS,cAAc,QAAyC;AACrE,MAAI,kBAAkB,YAAY;AAChC,WAAO;AAAA,EACT;AAEA,SAAO,IAAI,WAAW,MAAM;AAC9B;AASO,SAAS,cAAc,OAA2B;AACvD,MAAI,OAAO,WAAW,aAAa;AACjC,UAAM,IAAI,MAAM,gDAAgD;AAAA,EAClE;AACA,SAAO,OAAO,KAAK,KAAK;AAC1B;","names":[]}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var WalletKeyEncryptionService_exports = {};
|
|
20
|
+
__export(WalletKeyEncryptionService_exports, {
|
|
21
|
+
WalletKeyEncryptionService: () => WalletKeyEncryptionService
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(WalletKeyEncryptionService_exports);
|
|
24
|
+
var import_crypto_utils = require("../../utils/crypto-utils");
|
|
25
|
+
var import_viem = require("viem");
|
|
26
|
+
class WalletKeyEncryptionService {
|
|
27
|
+
eciesProvider;
|
|
28
|
+
constructor(config) {
|
|
29
|
+
this.eciesProvider = config.eciesProvider;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Encrypts data using a wallet's public key.
|
|
33
|
+
*
|
|
34
|
+
* @param data - The plaintext message to encrypt for the wallet owner.
|
|
35
|
+
* @param publicKey - The recipient wallet's public key for encryption.
|
|
36
|
+
* @returns A promise that resolves to the encrypted data as a hex string.
|
|
37
|
+
* @throws {Error} When encryption fails due to invalid key format.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```typescript
|
|
41
|
+
* const encrypted = await processor.encryptWithWalletPublicKey(
|
|
42
|
+
* "Secret message",
|
|
43
|
+
* "0x04..." // 65-byte uncompressed public key
|
|
44
|
+
* );
|
|
45
|
+
* console.log(`Encrypted: ${encrypted}`);
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
async encryptWithWalletPublicKey(data, publicKey) {
|
|
49
|
+
const publicKeyBytes = (0, import_crypto_utils.processWalletPublicKey)(publicKey);
|
|
50
|
+
const normalizedKey = this.eciesProvider.normalizeToUncompressed(publicKeyBytes);
|
|
51
|
+
const dataBytes = (0, import_viem.stringToBytes)(data);
|
|
52
|
+
const encrypted = await this.eciesProvider.encrypt(
|
|
53
|
+
normalizedKey,
|
|
54
|
+
dataBytes
|
|
55
|
+
);
|
|
56
|
+
const result = (0, import_viem.concat)([
|
|
57
|
+
encrypted.iv,
|
|
58
|
+
encrypted.ephemPublicKey,
|
|
59
|
+
encrypted.ciphertext,
|
|
60
|
+
encrypted.mac
|
|
61
|
+
]);
|
|
62
|
+
return (0, import_viem.toHex)(result).slice(2);
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Decrypts data using a wallet's private key.
|
|
66
|
+
*
|
|
67
|
+
* @param encryptedData - The hex-encoded encrypted data to decrypt.
|
|
68
|
+
* @param privateKey - The wallet's private key for decryption.
|
|
69
|
+
* @returns A promise that resolves to the decrypted plaintext message.
|
|
70
|
+
* @throws {Error} When decryption fails due to invalid data or key format.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* const decrypted = await processor.decryptWithWalletPrivateKey(
|
|
75
|
+
* encryptedHexString,
|
|
76
|
+
* "0x..." // 32-byte private key
|
|
77
|
+
* );
|
|
78
|
+
* console.log(`Decrypted: ${decrypted}`);
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
async decryptWithWalletPrivateKey(encryptedData, privateKey) {
|
|
82
|
+
const privateKeyBytes = (0, import_crypto_utils.processWalletPrivateKey)(privateKey);
|
|
83
|
+
const prefixedHex = encryptedData.startsWith("0x") ? encryptedData : `0x${encryptedData}`;
|
|
84
|
+
const encryptedBytes = (0, import_viem.fromHex)(prefixedHex, "bytes");
|
|
85
|
+
const encrypted = (0, import_crypto_utils.parseEncryptedDataBuffer)(encryptedBytes);
|
|
86
|
+
const decrypted = await this.eciesProvider.decrypt(
|
|
87
|
+
privateKeyBytes,
|
|
88
|
+
encrypted
|
|
89
|
+
);
|
|
90
|
+
return (0, import_viem.bytesToString)(decrypted);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Encrypts a Uint8Array with a wallet public key
|
|
94
|
+
*
|
|
95
|
+
* @param data - Binary data to encrypt
|
|
96
|
+
* @param publicKey - Public key as hex string or Uint8Array
|
|
97
|
+
* @returns Encrypted data structure
|
|
98
|
+
*/
|
|
99
|
+
async encryptBinary(data, publicKey) {
|
|
100
|
+
const publicKeyBytes = (0, import_crypto_utils.processWalletPublicKey)(publicKey);
|
|
101
|
+
const normalizedKey = this.eciesProvider.normalizeToUncompressed(publicKeyBytes);
|
|
102
|
+
return this.eciesProvider.encrypt(normalizedKey, data);
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Decrypts to a Uint8Array with a wallet private key
|
|
106
|
+
*
|
|
107
|
+
* @param encrypted - Encrypted data structure
|
|
108
|
+
* @param privateKey - Private key as hex string or Uint8Array
|
|
109
|
+
* @returns Decrypted binary data
|
|
110
|
+
*/
|
|
111
|
+
async decryptBinary(encrypted, privateKey) {
|
|
112
|
+
const privateKeyBytes = (0, import_crypto_utils.processWalletPrivateKey)(privateKey);
|
|
113
|
+
return this.eciesProvider.decrypt(privateKeyBytes, encrypted);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Gets the underlying ECIES provider
|
|
117
|
+
*
|
|
118
|
+
* @returns The ECIES provider instance
|
|
119
|
+
*/
|
|
120
|
+
getECIESProvider() {
|
|
121
|
+
return this.eciesProvider;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
125
|
+
0 && (module.exports = {
|
|
126
|
+
WalletKeyEncryptionService
|
|
127
|
+
});
|
|
128
|
+
//# sourceMappingURL=WalletKeyEncryptionService.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/crypto/services/WalletKeyEncryptionService.ts"],"sourcesContent":["/**\n * Service for wallet key encryption and decryption operations.\n *\n * @remarks\n * This service separates business logic (wallet key processing) from crypto primitives\n * (ECIES operations). It handles key normalization, data conversion, and format transformation\n * while delegating actual cryptographic operations to the provided ECIES provider.\n *\n * @category Cryptography\n * @internal\n */\n\nimport type { ECIESProvider, ECIESEncrypted } from \"../ecies/interface\";\nimport {\n processWalletPublicKey,\n processWalletPrivateKey,\n parseEncryptedDataBuffer,\n} from \"../../utils/crypto-utils\";\nimport { stringToBytes, bytesToString, toHex, fromHex, concat } from \"viem\";\n\nexport interface WalletKeyEncryptionServiceConfig {\n /** ECIES provider for encryption/decryption */\n eciesProvider: ECIESProvider;\n}\n\n/**\n * Service for wallet key encryption and decryption operations\n *\n * @remarks\n * This service encapsulates the business logic for wallet key operations,\n * delegating actual cryptographic operations to the provided ECIES provider.\n * It handles key normalization, data conversion, and format transformation.\n *\n * @internal\n */\nexport class WalletKeyEncryptionService {\n private readonly eciesProvider: ECIESProvider;\n\n constructor(config: WalletKeyEncryptionServiceConfig) {\n this.eciesProvider = config.eciesProvider;\n }\n\n /**\n * Encrypts data using a wallet's public key.\n *\n * @param data - The plaintext message to encrypt for the wallet owner.\n * @param publicKey - The recipient wallet's public key for encryption.\n * @returns A promise that resolves to the encrypted data as a hex string.\n * @throws {Error} When encryption fails due to invalid key format.\n *\n * @example\n * ```typescript\n * const encrypted = await processor.encryptWithWalletPublicKey(\n * \"Secret message\",\n * \"0x04...\" // 65-byte uncompressed public key\n * );\n * console.log(`Encrypted: ${encrypted}`);\n * ```\n */\n async encryptWithWalletPublicKey(\n data: string,\n publicKey: string | Uint8Array,\n ): Promise<string> {\n // Process the public key to ensure correct format\n const publicKeyBytes = processWalletPublicKey(publicKey);\n\n // Normalize to uncompressed format using the provider\n // This handles compressed keys, raw coordinates, and validates the format\n const normalizedKey =\n this.eciesProvider.normalizeToUncompressed(publicKeyBytes);\n\n // Convert string data to bytes\n const dataBytes = stringToBytes(data);\n\n // Perform ECIES encryption\n const encrypted = await this.eciesProvider.encrypt(\n normalizedKey,\n dataBytes,\n );\n\n // Concatenate all components for legacy format compatibility\n const result = concat([\n encrypted.iv,\n encrypted.ephemPublicKey,\n encrypted.ciphertext,\n encrypted.mac,\n ]);\n\n // Return as hex string without 0x prefix for API compatibility\n return toHex(result).slice(2);\n }\n\n /**\n * Decrypts data using a wallet's private key.\n *\n * @param encryptedData - The hex-encoded encrypted data to decrypt.\n * @param privateKey - The wallet's private key for decryption.\n * @returns A promise that resolves to the decrypted plaintext message.\n * @throws {Error} When decryption fails due to invalid data or key format.\n *\n * @example\n * ```typescript\n * const decrypted = await processor.decryptWithWalletPrivateKey(\n * encryptedHexString,\n * \"0x...\" // 32-byte private key\n * );\n * console.log(`Decrypted: ${decrypted}`);\n * ```\n */\n async decryptWithWalletPrivateKey(\n encryptedData: string,\n privateKey: string | Uint8Array,\n ): Promise<string> {\n // Process the private key to ensure correct format\n const privateKeyBytes = processWalletPrivateKey(privateKey);\n\n // Convert hex string to bytes and parse encrypted components\n const prefixedHex = encryptedData.startsWith(\"0x\")\n ? encryptedData\n : `0x${encryptedData}`;\n const encryptedBytes = fromHex(prefixedHex as `0x${string}`, \"bytes\");\n const encrypted = parseEncryptedDataBuffer(encryptedBytes);\n\n // Perform ECIES decryption\n const decrypted = await this.eciesProvider.decrypt(\n privateKeyBytes,\n encrypted,\n );\n\n // Convert bytes back to string\n return bytesToString(decrypted);\n }\n\n /**\n * Encrypts a Uint8Array with a wallet public key\n *\n * @param data - Binary data to encrypt\n * @param publicKey - Public key as hex string or Uint8Array\n * @returns Encrypted data structure\n */\n async encryptBinary(\n data: Uint8Array,\n publicKey: string | Uint8Array,\n ): Promise<ECIESEncrypted> {\n const publicKeyBytes = processWalletPublicKey(publicKey);\n const normalizedKey =\n this.eciesProvider.normalizeToUncompressed(publicKeyBytes);\n return this.eciesProvider.encrypt(normalizedKey, data);\n }\n\n /**\n * Decrypts to a Uint8Array with a wallet private key\n *\n * @param encrypted - Encrypted data structure\n * @param privateKey - Private key as hex string or Uint8Array\n * @returns Decrypted binary data\n */\n async decryptBinary(\n encrypted: ECIESEncrypted,\n privateKey: string | Uint8Array,\n ): Promise<Uint8Array> {\n const privateKeyBytes = processWalletPrivateKey(privateKey);\n return this.eciesProvider.decrypt(privateKeyBytes, encrypted);\n }\n\n /**\n * Gets the underlying ECIES provider\n *\n * @returns The ECIES provider instance\n */\n getECIESProvider(): ECIESProvider {\n return this.eciesProvider;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,0BAIO;AACP,kBAAqE;AAiB9D,MAAM,2BAA2B;AAAA,EACrB;AAAA,EAEjB,YAAY,QAA0C;AACpD,SAAK,gBAAgB,OAAO;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBA,MAAM,2BACJ,MACA,WACiB;AAEjB,UAAM,qBAAiB,4CAAuB,SAAS;AAIvD,UAAM,gBACJ,KAAK,cAAc,wBAAwB,cAAc;AAG3D,UAAM,gBAAY,2BAAc,IAAI;AAGpC,UAAM,YAAY,MAAM,KAAK,cAAc;AAAA,MACzC;AAAA,MACA;AAAA,IACF;AAGA,UAAM,aAAS,oBAAO;AAAA,MACpB,UAAU;AAAA,MACV,UAAU;AAAA,MACV,UAAU;AAAA,MACV,UAAU;AAAA,IACZ,CAAC;AAGD,eAAO,mBAAM,MAAM,EAAE,MAAM,CAAC;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBA,MAAM,4BACJ,eACA,YACiB;AAEjB,UAAM,sBAAkB,6CAAwB,UAAU;AAG1D,UAAM,cAAc,cAAc,WAAW,IAAI,IAC7C,gBACA,KAAK,aAAa;AACtB,UAAM,qBAAiB,qBAAQ,aAA8B,OAAO;AACpE,UAAM,gBAAY,8CAAyB,cAAc;AAGzD,UAAM,YAAY,MAAM,KAAK,cAAc;AAAA,MACzC;AAAA,MACA;AAAA,IACF;AAGA,eAAO,2BAAc,SAAS;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,cACJ,MACA,WACyB;AACzB,UAAM,qBAAiB,4CAAuB,SAAS;AACvD,UAAM,gBACJ,KAAK,cAAc,wBAAwB,cAAc;AAC3D,WAAO,KAAK,cAAc,QAAQ,eAAe,IAAI;AAAA,EACvD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,cACJ,WACA,YACqB;AACrB,UAAM,sBAAkB,6CAAwB,UAAU;AAC1D,WAAO,KAAK,cAAc,QAAQ,iBAAiB,SAAS;AAAA,EAC9D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,mBAAkC;AAChC,WAAO,KAAK;AAAA,EACd;AACF;","names":[]}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Service for wallet key encryption and decryption operations.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This service separates business logic (wallet key processing) from crypto primitives
|
|
6
|
+
* (ECIES operations). It handles key normalization, data conversion, and format transformation
|
|
7
|
+
* while delegating actual cryptographic operations to the provided ECIES provider.
|
|
8
|
+
*
|
|
9
|
+
* @category Cryptography
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
import type { ECIESProvider, ECIESEncrypted } from "../ecies/interface";
|
|
13
|
+
export interface WalletKeyEncryptionServiceConfig {
|
|
14
|
+
/** ECIES provider for encryption/decryption */
|
|
15
|
+
eciesProvider: ECIESProvider;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Service for wallet key encryption and decryption operations
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
* This service encapsulates the business logic for wallet key operations,
|
|
22
|
+
* delegating actual cryptographic operations to the provided ECIES provider.
|
|
23
|
+
* It handles key normalization, data conversion, and format transformation.
|
|
24
|
+
*
|
|
25
|
+
* @internal
|
|
26
|
+
*/
|
|
27
|
+
export declare class WalletKeyEncryptionService {
|
|
28
|
+
private readonly eciesProvider;
|
|
29
|
+
constructor(config: WalletKeyEncryptionServiceConfig);
|
|
30
|
+
/**
|
|
31
|
+
* Encrypts data using a wallet's public key.
|
|
32
|
+
*
|
|
33
|
+
* @param data - The plaintext message to encrypt for the wallet owner.
|
|
34
|
+
* @param publicKey - The recipient wallet's public key for encryption.
|
|
35
|
+
* @returns A promise that resolves to the encrypted data as a hex string.
|
|
36
|
+
* @throws {Error} When encryption fails due to invalid key format.
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* const encrypted = await processor.encryptWithWalletPublicKey(
|
|
41
|
+
* "Secret message",
|
|
42
|
+
* "0x04..." // 65-byte uncompressed public key
|
|
43
|
+
* );
|
|
44
|
+
* console.log(`Encrypted: ${encrypted}`);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
encryptWithWalletPublicKey(data: string, publicKey: string | Uint8Array): Promise<string>;
|
|
48
|
+
/**
|
|
49
|
+
* Decrypts data using a wallet's private key.
|
|
50
|
+
*
|
|
51
|
+
* @param encryptedData - The hex-encoded encrypted data to decrypt.
|
|
52
|
+
* @param privateKey - The wallet's private key for decryption.
|
|
53
|
+
* @returns A promise that resolves to the decrypted plaintext message.
|
|
54
|
+
* @throws {Error} When decryption fails due to invalid data or key format.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```typescript
|
|
58
|
+
* const decrypted = await processor.decryptWithWalletPrivateKey(
|
|
59
|
+
* encryptedHexString,
|
|
60
|
+
* "0x..." // 32-byte private key
|
|
61
|
+
* );
|
|
62
|
+
* console.log(`Decrypted: ${decrypted}`);
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
decryptWithWalletPrivateKey(encryptedData: string, privateKey: string | Uint8Array): Promise<string>;
|
|
66
|
+
/**
|
|
67
|
+
* Encrypts a Uint8Array with a wallet public key
|
|
68
|
+
*
|
|
69
|
+
* @param data - Binary data to encrypt
|
|
70
|
+
* @param publicKey - Public key as hex string or Uint8Array
|
|
71
|
+
* @returns Encrypted data structure
|
|
72
|
+
*/
|
|
73
|
+
encryptBinary(data: Uint8Array, publicKey: string | Uint8Array): Promise<ECIESEncrypted>;
|
|
74
|
+
/**
|
|
75
|
+
* Decrypts to a Uint8Array with a wallet private key
|
|
76
|
+
*
|
|
77
|
+
* @param encrypted - Encrypted data structure
|
|
78
|
+
* @param privateKey - Private key as hex string or Uint8Array
|
|
79
|
+
* @returns Decrypted binary data
|
|
80
|
+
*/
|
|
81
|
+
decryptBinary(encrypted: ECIESEncrypted, privateKey: string | Uint8Array): Promise<Uint8Array>;
|
|
82
|
+
/**
|
|
83
|
+
* Gets the underlying ECIES provider
|
|
84
|
+
*
|
|
85
|
+
* @returns The ECIES provider instance
|
|
86
|
+
*/
|
|
87
|
+
getECIESProvider(): ECIESProvider;
|
|
88
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import {
|
|
2
|
+
processWalletPublicKey,
|
|
3
|
+
processWalletPrivateKey,
|
|
4
|
+
parseEncryptedDataBuffer
|
|
5
|
+
} from "../../utils/crypto-utils";
|
|
6
|
+
import { stringToBytes, bytesToString, toHex, fromHex, concat } from "viem";
|
|
7
|
+
class WalletKeyEncryptionService {
|
|
8
|
+
eciesProvider;
|
|
9
|
+
constructor(config) {
|
|
10
|
+
this.eciesProvider = config.eciesProvider;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Encrypts data using a wallet's public key.
|
|
14
|
+
*
|
|
15
|
+
* @param data - The plaintext message to encrypt for the wallet owner.
|
|
16
|
+
* @param publicKey - The recipient wallet's public key for encryption.
|
|
17
|
+
* @returns A promise that resolves to the encrypted data as a hex string.
|
|
18
|
+
* @throws {Error} When encryption fails due to invalid key format.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* const encrypted = await processor.encryptWithWalletPublicKey(
|
|
23
|
+
* "Secret message",
|
|
24
|
+
* "0x04..." // 65-byte uncompressed public key
|
|
25
|
+
* );
|
|
26
|
+
* console.log(`Encrypted: ${encrypted}`);
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
async encryptWithWalletPublicKey(data, publicKey) {
|
|
30
|
+
const publicKeyBytes = processWalletPublicKey(publicKey);
|
|
31
|
+
const normalizedKey = this.eciesProvider.normalizeToUncompressed(publicKeyBytes);
|
|
32
|
+
const dataBytes = stringToBytes(data);
|
|
33
|
+
const encrypted = await this.eciesProvider.encrypt(
|
|
34
|
+
normalizedKey,
|
|
35
|
+
dataBytes
|
|
36
|
+
);
|
|
37
|
+
const result = concat([
|
|
38
|
+
encrypted.iv,
|
|
39
|
+
encrypted.ephemPublicKey,
|
|
40
|
+
encrypted.ciphertext,
|
|
41
|
+
encrypted.mac
|
|
42
|
+
]);
|
|
43
|
+
return toHex(result).slice(2);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Decrypts data using a wallet's private key.
|
|
47
|
+
*
|
|
48
|
+
* @param encryptedData - The hex-encoded encrypted data to decrypt.
|
|
49
|
+
* @param privateKey - The wallet's private key for decryption.
|
|
50
|
+
* @returns A promise that resolves to the decrypted plaintext message.
|
|
51
|
+
* @throws {Error} When decryption fails due to invalid data or key format.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* const decrypted = await processor.decryptWithWalletPrivateKey(
|
|
56
|
+
* encryptedHexString,
|
|
57
|
+
* "0x..." // 32-byte private key
|
|
58
|
+
* );
|
|
59
|
+
* console.log(`Decrypted: ${decrypted}`);
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
async decryptWithWalletPrivateKey(encryptedData, privateKey) {
|
|
63
|
+
const privateKeyBytes = processWalletPrivateKey(privateKey);
|
|
64
|
+
const prefixedHex = encryptedData.startsWith("0x") ? encryptedData : `0x${encryptedData}`;
|
|
65
|
+
const encryptedBytes = fromHex(prefixedHex, "bytes");
|
|
66
|
+
const encrypted = parseEncryptedDataBuffer(encryptedBytes);
|
|
67
|
+
const decrypted = await this.eciesProvider.decrypt(
|
|
68
|
+
privateKeyBytes,
|
|
69
|
+
encrypted
|
|
70
|
+
);
|
|
71
|
+
return bytesToString(decrypted);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Encrypts a Uint8Array with a wallet public key
|
|
75
|
+
*
|
|
76
|
+
* @param data - Binary data to encrypt
|
|
77
|
+
* @param publicKey - Public key as hex string or Uint8Array
|
|
78
|
+
* @returns Encrypted data structure
|
|
79
|
+
*/
|
|
80
|
+
async encryptBinary(data, publicKey) {
|
|
81
|
+
const publicKeyBytes = processWalletPublicKey(publicKey);
|
|
82
|
+
const normalizedKey = this.eciesProvider.normalizeToUncompressed(publicKeyBytes);
|
|
83
|
+
return this.eciesProvider.encrypt(normalizedKey, data);
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Decrypts to a Uint8Array with a wallet private key
|
|
87
|
+
*
|
|
88
|
+
* @param encrypted - Encrypted data structure
|
|
89
|
+
* @param privateKey - Private key as hex string or Uint8Array
|
|
90
|
+
* @returns Decrypted binary data
|
|
91
|
+
*/
|
|
92
|
+
async decryptBinary(encrypted, privateKey) {
|
|
93
|
+
const privateKeyBytes = processWalletPrivateKey(privateKey);
|
|
94
|
+
return this.eciesProvider.decrypt(privateKeyBytes, encrypted);
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Gets the underlying ECIES provider
|
|
98
|
+
*
|
|
99
|
+
* @returns The ECIES provider instance
|
|
100
|
+
*/
|
|
101
|
+
getECIESProvider() {
|
|
102
|
+
return this.eciesProvider;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
WalletKeyEncryptionService
|
|
107
|
+
};
|
|
108
|
+
//# sourceMappingURL=WalletKeyEncryptionService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/crypto/services/WalletKeyEncryptionService.ts"],"sourcesContent":["/**\n * Service for wallet key encryption and decryption operations.\n *\n * @remarks\n * This service separates business logic (wallet key processing) from crypto primitives\n * (ECIES operations). It handles key normalization, data conversion, and format transformation\n * while delegating actual cryptographic operations to the provided ECIES provider.\n *\n * @category Cryptography\n * @internal\n */\n\nimport type { ECIESProvider, ECIESEncrypted } from \"../ecies/interface\";\nimport {\n processWalletPublicKey,\n processWalletPrivateKey,\n parseEncryptedDataBuffer,\n} from \"../../utils/crypto-utils\";\nimport { stringToBytes, bytesToString, toHex, fromHex, concat } from \"viem\";\n\nexport interface WalletKeyEncryptionServiceConfig {\n /** ECIES provider for encryption/decryption */\n eciesProvider: ECIESProvider;\n}\n\n/**\n * Service for wallet key encryption and decryption operations\n *\n * @remarks\n * This service encapsulates the business logic for wallet key operations,\n * delegating actual cryptographic operations to the provided ECIES provider.\n * It handles key normalization, data conversion, and format transformation.\n *\n * @internal\n */\nexport class WalletKeyEncryptionService {\n private readonly eciesProvider: ECIESProvider;\n\n constructor(config: WalletKeyEncryptionServiceConfig) {\n this.eciesProvider = config.eciesProvider;\n }\n\n /**\n * Encrypts data using a wallet's public key.\n *\n * @param data - The plaintext message to encrypt for the wallet owner.\n * @param publicKey - The recipient wallet's public key for encryption.\n * @returns A promise that resolves to the encrypted data as a hex string.\n * @throws {Error} When encryption fails due to invalid key format.\n *\n * @example\n * ```typescript\n * const encrypted = await processor.encryptWithWalletPublicKey(\n * \"Secret message\",\n * \"0x04...\" // 65-byte uncompressed public key\n * );\n * console.log(`Encrypted: ${encrypted}`);\n * ```\n */\n async encryptWithWalletPublicKey(\n data: string,\n publicKey: string | Uint8Array,\n ): Promise<string> {\n // Process the public key to ensure correct format\n const publicKeyBytes = processWalletPublicKey(publicKey);\n\n // Normalize to uncompressed format using the provider\n // This handles compressed keys, raw coordinates, and validates the format\n const normalizedKey =\n this.eciesProvider.normalizeToUncompressed(publicKeyBytes);\n\n // Convert string data to bytes\n const dataBytes = stringToBytes(data);\n\n // Perform ECIES encryption\n const encrypted = await this.eciesProvider.encrypt(\n normalizedKey,\n dataBytes,\n );\n\n // Concatenate all components for legacy format compatibility\n const result = concat([\n encrypted.iv,\n encrypted.ephemPublicKey,\n encrypted.ciphertext,\n encrypted.mac,\n ]);\n\n // Return as hex string without 0x prefix for API compatibility\n return toHex(result).slice(2);\n }\n\n /**\n * Decrypts data using a wallet's private key.\n *\n * @param encryptedData - The hex-encoded encrypted data to decrypt.\n * @param privateKey - The wallet's private key for decryption.\n * @returns A promise that resolves to the decrypted plaintext message.\n * @throws {Error} When decryption fails due to invalid data or key format.\n *\n * @example\n * ```typescript\n * const decrypted = await processor.decryptWithWalletPrivateKey(\n * encryptedHexString,\n * \"0x...\" // 32-byte private key\n * );\n * console.log(`Decrypted: ${decrypted}`);\n * ```\n */\n async decryptWithWalletPrivateKey(\n encryptedData: string,\n privateKey: string | Uint8Array,\n ): Promise<string> {\n // Process the private key to ensure correct format\n const privateKeyBytes = processWalletPrivateKey(privateKey);\n\n // Convert hex string to bytes and parse encrypted components\n const prefixedHex = encryptedData.startsWith(\"0x\")\n ? encryptedData\n : `0x${encryptedData}`;\n const encryptedBytes = fromHex(prefixedHex as `0x${string}`, \"bytes\");\n const encrypted = parseEncryptedDataBuffer(encryptedBytes);\n\n // Perform ECIES decryption\n const decrypted = await this.eciesProvider.decrypt(\n privateKeyBytes,\n encrypted,\n );\n\n // Convert bytes back to string\n return bytesToString(decrypted);\n }\n\n /**\n * Encrypts a Uint8Array with a wallet public key\n *\n * @param data - Binary data to encrypt\n * @param publicKey - Public key as hex string or Uint8Array\n * @returns Encrypted data structure\n */\n async encryptBinary(\n data: Uint8Array,\n publicKey: string | Uint8Array,\n ): Promise<ECIESEncrypted> {\n const publicKeyBytes = processWalletPublicKey(publicKey);\n const normalizedKey =\n this.eciesProvider.normalizeToUncompressed(publicKeyBytes);\n return this.eciesProvider.encrypt(normalizedKey, data);\n }\n\n /**\n * Decrypts to a Uint8Array with a wallet private key\n *\n * @param encrypted - Encrypted data structure\n * @param privateKey - Private key as hex string or Uint8Array\n * @returns Decrypted binary data\n */\n async decryptBinary(\n encrypted: ECIESEncrypted,\n privateKey: string | Uint8Array,\n ): Promise<Uint8Array> {\n const privateKeyBytes = processWalletPrivateKey(privateKey);\n return this.eciesProvider.decrypt(privateKeyBytes, encrypted);\n }\n\n /**\n * Gets the underlying ECIES provider\n *\n * @returns The ECIES provider instance\n */\n getECIESProvider(): ECIESProvider {\n return this.eciesProvider;\n }\n}\n"],"mappings":"AAaA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,eAAe,eAAe,OAAO,SAAS,cAAc;AAiB9D,MAAM,2BAA2B;AAAA,EACrB;AAAA,EAEjB,YAAY,QAA0C;AACpD,SAAK,gBAAgB,OAAO;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBA,MAAM,2BACJ,MACA,WACiB;AAEjB,UAAM,iBAAiB,uBAAuB,SAAS;AAIvD,UAAM,gBACJ,KAAK,cAAc,wBAAwB,cAAc;AAG3D,UAAM,YAAY,cAAc,IAAI;AAGpC,UAAM,YAAY,MAAM,KAAK,cAAc;AAAA,MACzC;AAAA,MACA;AAAA,IACF;AAGA,UAAM,SAAS,OAAO;AAAA,MACpB,UAAU;AAAA,MACV,UAAU;AAAA,MACV,UAAU;AAAA,MACV,UAAU;AAAA,IACZ,CAAC;AAGD,WAAO,MAAM,MAAM,EAAE,MAAM,CAAC;AAAA,EAC9B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAmBA,MAAM,4BACJ,eACA,YACiB;AAEjB,UAAM,kBAAkB,wBAAwB,UAAU;AAG1D,UAAM,cAAc,cAAc,WAAW,IAAI,IAC7C,gBACA,KAAK,aAAa;AACtB,UAAM,iBAAiB,QAAQ,aAA8B,OAAO;AACpE,UAAM,YAAY,yBAAyB,cAAc;AAGzD,UAAM,YAAY,MAAM,KAAK,cAAc;AAAA,MACzC;AAAA,MACA;AAAA,IACF;AAGA,WAAO,cAAc,SAAS;AAAA,EAChC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,cACJ,MACA,WACyB;AACzB,UAAM,iBAAiB,uBAAuB,SAAS;AACvD,UAAM,gBACJ,KAAK,cAAc,wBAAwB,cAAc;AAC3D,WAAO,KAAK,cAAc,QAAQ,eAAe,IAAI;AAAA,EACvD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAM,cACJ,WACA,YACqB;AACrB,UAAM,kBAAkB,wBAAwB,UAAU;AAC1D,WAAO,KAAK,cAAc,QAAQ,iBAAiB,SAAS;AAAA,EAC9D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,mBAAkC;AAChC,WAAO,KAAK;AAAA,EACd;AACF;","names":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var diagnostics_exports = {};
|
|
20
|
+
__export(diagnostics_exports, {
|
|
21
|
+
warnOnce: () => warnOnce
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(diagnostics_exports);
|
|
24
|
+
const seen = /* @__PURE__ */ new Set();
|
|
25
|
+
const SILENCE = typeof process !== "undefined" && process?.env?.VANA_SDK_SILENCE_WARNINGS === "1";
|
|
26
|
+
function warnOnce(...msg) {
|
|
27
|
+
if (SILENCE) return;
|
|
28
|
+
const key = msg.join(" ");
|
|
29
|
+
if (seen.has(key)) return;
|
|
30
|
+
seen.add(key);
|
|
31
|
+
console.warn("[vana-sdk]", ...msg);
|
|
32
|
+
}
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
warnOnce
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=diagnostics.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/diagnostics.ts"],"sourcesContent":["/**\n * Provides diagnostic warnings for SDK configuration and environment issues.\n *\n * @remarks\n * Warnings are deduplicated by message and can be silenced via\n * the VANA_SDK_SILENCE_WARNINGS environment variable.\n *\n * @category Diagnostics\n */\n\n/** Tracks seen warning messages to prevent duplicate output. */\nconst seen = new Set<string>();\n\n/** Checks if warnings are silenced via environment variable. */\nconst SILENCE =\n typeof process !== \"undefined\" &&\n process?.env?.VANA_SDK_SILENCE_WARNINGS === \"1\";\n\n/**\n * Emits a warning message once per unique message content.\n *\n * @remarks\n * Warnings are automatically prefixed with \"[vana-sdk]\" and deduplicated.\n * Set `VANA_SDK_SILENCE_WARNINGS=1` to disable all warnings.\n *\n * @param msg - Warning message components to display.\n *\n * @example\n * ```typescript\n * warnOnce(\"AES-256-CBC not available.\", \"ECIES will fail.\");\n * ```\n */\nexport function warnOnce(...msg: unknown[]): void {\n if (SILENCE) return;\n const key = msg.join(\" \");\n if (seen.has(key)) return;\n seen.add(key);\n console.warn(\"[vana-sdk]\", ...msg);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,MAAM,OAAO,oBAAI,IAAY;AAG7B,MAAM,UACJ,OAAO,YAAY,eACnB,SAAS,KAAK,8BAA8B;AAgBvC,SAAS,YAAY,KAAsB;AAChD,MAAI,QAAS;AACb,QAAM,MAAM,IAAI,KAAK,GAAG;AACxB,MAAI,KAAK,IAAI,GAAG,EAAG;AACnB,OAAK,IAAI,GAAG;AACZ,UAAQ,KAAK,cAAc,GAAG,GAAG;AACnC;","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Provides diagnostic warnings for SDK configuration and environment issues.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Warnings are deduplicated by message and can be silenced via
|
|
6
|
+
* the VANA_SDK_SILENCE_WARNINGS environment variable.
|
|
7
|
+
*
|
|
8
|
+
* @category Diagnostics
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Emits a warning message once per unique message content.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* Warnings are automatically prefixed with "[vana-sdk]" and deduplicated.
|
|
15
|
+
* Set `VANA_SDK_SILENCE_WARNINGS=1` to disable all warnings.
|
|
16
|
+
*
|
|
17
|
+
* @param msg - Warning message components to display.
|
|
18
|
+
*
|
|
19
|
+
* @example
|
|
20
|
+
* ```typescript
|
|
21
|
+
* warnOnce("AES-256-CBC not available.", "ECIES will fail.");
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export declare function warnOnce(...msg: unknown[]): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2
|
+
const SILENCE = typeof process !== "undefined" && process?.env?.VANA_SDK_SILENCE_WARNINGS === "1";
|
|
3
|
+
function warnOnce(...msg) {
|
|
4
|
+
if (SILENCE) return;
|
|
5
|
+
const key = msg.join(" ");
|
|
6
|
+
if (seen.has(key)) return;
|
|
7
|
+
seen.add(key);
|
|
8
|
+
console.warn("[vana-sdk]", ...msg);
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
warnOnce
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=diagnostics.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/diagnostics.ts"],"sourcesContent":["/**\n * Provides diagnostic warnings for SDK configuration and environment issues.\n *\n * @remarks\n * Warnings are deduplicated by message and can be silenced via\n * the VANA_SDK_SILENCE_WARNINGS environment variable.\n *\n * @category Diagnostics\n */\n\n/** Tracks seen warning messages to prevent duplicate output. */\nconst seen = new Set<string>();\n\n/** Checks if warnings are silenced via environment variable. */\nconst SILENCE =\n typeof process !== \"undefined\" &&\n process?.env?.VANA_SDK_SILENCE_WARNINGS === \"1\";\n\n/**\n * Emits a warning message once per unique message content.\n *\n * @remarks\n * Warnings are automatically prefixed with \"[vana-sdk]\" and deduplicated.\n * Set `VANA_SDK_SILENCE_WARNINGS=1` to disable all warnings.\n *\n * @param msg - Warning message components to display.\n *\n * @example\n * ```typescript\n * warnOnce(\"AES-256-CBC not available.\", \"ECIES will fail.\");\n * ```\n */\nexport function warnOnce(...msg: unknown[]): void {\n if (SILENCE) return;\n const key = msg.join(\" \");\n if (seen.has(key)) return;\n seen.add(key);\n console.warn(\"[vana-sdk]\", ...msg);\n}\n"],"mappings":"AAWA,MAAM,OAAO,oBAAI,IAAY;AAG7B,MAAM,UACJ,OAAO,YAAY,eACnB,SAAS,KAAK,8BAA8B;AAgBvC,SAAS,YAAY,KAAsB;AAChD,MAAI,QAAS;AACb,QAAM,MAAM,IAAI,KAAK,GAAG;AACxB,MAAI,KAAK,IAAI,GAAG,EAAG;AACnB,OAAK,IAAI,GAAG;AACZ,UAAQ,KAAK,cAAc,GAAG,GAAG;AACnC;","names":[]}
|