@cmdoss/memwal-sdk 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ARCHITECTURE.md +463 -0
- package/BENCHMARKS.md +238 -0
- package/README.md +142 -0
- package/dist/access/PermissionService.d.ts +179 -0
- package/dist/access/PermissionService.d.ts.map +1 -0
- package/dist/access/PermissionService.js +445 -0
- package/dist/access/PermissionService.js.map +1 -0
- package/dist/access/index.d.ts +8 -0
- package/dist/access/index.d.ts.map +1 -0
- package/dist/access/index.js +7 -0
- package/dist/access/index.js.map +1 -0
- package/dist/aggregation/AggregationService.d.ts +132 -0
- package/dist/aggregation/AggregationService.d.ts.map +1 -0
- package/dist/aggregation/AggregationService.js +225 -0
- package/dist/aggregation/AggregationService.js.map +1 -0
- package/dist/aggregation/index.d.ts +8 -0
- package/dist/aggregation/index.d.ts.map +1 -0
- package/dist/aggregation/index.js +7 -0
- package/dist/aggregation/index.js.map +1 -0
- package/dist/ai-sdk/PDWVectorStore.d.ts +124 -0
- package/dist/ai-sdk/PDWVectorStore.d.ts.map +1 -0
- package/dist/ai-sdk/PDWVectorStore.js +557 -0
- package/dist/ai-sdk/PDWVectorStore.js.map +1 -0
- package/dist/ai-sdk/index.d.ts +45 -0
- package/dist/ai-sdk/index.d.ts.map +1 -0
- package/dist/ai-sdk/index.js +45 -0
- package/dist/ai-sdk/index.js.map +1 -0
- package/dist/ai-sdk/tools.d.ts +153 -0
- package/dist/ai-sdk/tools.d.ts.map +1 -0
- package/dist/ai-sdk/tools.js +312 -0
- package/dist/ai-sdk/tools.js.map +1 -0
- package/dist/ai-sdk/types.d.ts +336 -0
- package/dist/ai-sdk/types.d.ts.map +1 -0
- package/dist/ai-sdk/types.js +36 -0
- package/dist/ai-sdk/types.js.map +1 -0
- package/dist/api/client.d.ts +43 -0
- package/dist/api/client.d.ts.map +1 -0
- package/dist/api/client.js +136 -0
- package/dist/api/client.js.map +1 -0
- package/dist/batch/BatchManager.d.ts +147 -0
- package/dist/batch/BatchManager.d.ts.map +1 -0
- package/dist/batch/BatchManager.js +427 -0
- package/dist/batch/BatchManager.js.map +1 -0
- package/dist/batch/BatchingService.d.ts +122 -0
- package/dist/batch/BatchingService.d.ts.map +1 -0
- package/dist/batch/BatchingService.js +301 -0
- package/dist/batch/BatchingService.js.map +1 -0
- package/dist/batch/MemoryProcessingCache.d.ts +147 -0
- package/dist/batch/MemoryProcessingCache.d.ts.map +1 -0
- package/dist/batch/MemoryProcessingCache.js +349 -0
- package/dist/batch/MemoryProcessingCache.js.map +1 -0
- package/dist/batch/index.d.ts +13 -0
- package/dist/batch/index.d.ts.map +1 -0
- package/dist/batch/index.js +10 -0
- package/dist/batch/index.js.map +1 -0
- package/dist/browser.d.ts +73 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +66 -0
- package/dist/browser.js.map +1 -0
- package/dist/chat/index.d.ts +13 -0
- package/dist/chat/index.d.ts.map +1 -0
- package/dist/chat/index.js +14 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/client/ClientMemoryManager.d.ts +202 -0
- package/dist/client/ClientMemoryManager.d.ts.map +1 -0
- package/dist/client/ClientMemoryManager.js +764 -0
- package/dist/client/ClientMemoryManager.js.map +1 -0
- package/dist/client/PersonalDataWallet.d.ts +406 -0
- package/dist/client/PersonalDataWallet.d.ts.map +1 -0
- package/dist/client/PersonalDataWallet.js +229 -0
- package/dist/client/PersonalDataWallet.js.map +1 -0
- package/dist/client/SimplePDWClient.d.ts +534 -0
- package/dist/client/SimplePDWClient.d.ts.map +1 -0
- package/dist/client/SimplePDWClient.js +876 -0
- package/dist/client/SimplePDWClient.js.map +1 -0
- package/dist/client/factory.d.ts +99 -0
- package/dist/client/factory.d.ts.map +1 -0
- package/dist/client/factory.js +126 -0
- package/dist/client/factory.js.map +1 -0
- package/dist/client/namespaces/AnalyticsNamespace.d.ts +178 -0
- package/dist/client/namespaces/AnalyticsNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/AnalyticsNamespace.js +261 -0
- package/dist/client/namespaces/AnalyticsNamespace.js.map +1 -0
- package/dist/client/namespaces/BatchNamespace.d.ts +120 -0
- package/dist/client/namespaces/BatchNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/BatchNamespace.js +261 -0
- package/dist/client/namespaces/BatchNamespace.js.map +1 -0
- package/dist/client/namespaces/CacheNamespace.d.ts +80 -0
- package/dist/client/namespaces/CacheNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/CacheNamespace.js +100 -0
- package/dist/client/namespaces/CacheNamespace.js.map +1 -0
- package/dist/client/namespaces/CapabilityNamespace.d.ts +145 -0
- package/dist/client/namespaces/CapabilityNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/CapabilityNamespace.js +181 -0
- package/dist/client/namespaces/CapabilityNamespace.js.map +1 -0
- package/dist/client/namespaces/ChatNamespace.d.ts +110 -0
- package/dist/client/namespaces/ChatNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/ChatNamespace.js +123 -0
- package/dist/client/namespaces/ChatNamespace.js.map +1 -0
- package/dist/client/namespaces/ClassifyNamespace.d.ts +96 -0
- package/dist/client/namespaces/ClassifyNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/ClassifyNamespace.js +149 -0
- package/dist/client/namespaces/ClassifyNamespace.js.map +1 -0
- package/dist/client/namespaces/ContextNamespace.d.ts +150 -0
- package/dist/client/namespaces/ContextNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/ContextNamespace.js +250 -0
- package/dist/client/namespaces/ContextNamespace.js.map +1 -0
- package/dist/client/namespaces/EmbeddingsNamespace.d.ts +64 -0
- package/dist/client/namespaces/EmbeddingsNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/EmbeddingsNamespace.js +86 -0
- package/dist/client/namespaces/EmbeddingsNamespace.js.map +1 -0
- package/dist/client/namespaces/EncryptionNamespace.d.ts +128 -0
- package/dist/client/namespaces/EncryptionNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/EncryptionNamespace.js +161 -0
- package/dist/client/namespaces/EncryptionNamespace.js.map +1 -0
- package/dist/client/namespaces/GraphNamespace.d.ts +168 -0
- package/dist/client/namespaces/GraphNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/GraphNamespace.js +314 -0
- package/dist/client/namespaces/GraphNamespace.js.map +1 -0
- package/dist/client/namespaces/IndexNamespace.d.ts +141 -0
- package/dist/client/namespaces/IndexNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/IndexNamespace.js +238 -0
- package/dist/client/namespaces/IndexNamespace.js.map +1 -0
- package/dist/client/namespaces/MemoryNamespace.d.ts +277 -0
- package/dist/client/namespaces/MemoryNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/MemoryNamespace.js +907 -0
- package/dist/client/namespaces/MemoryNamespace.js.map +1 -0
- package/dist/client/namespaces/PermissionsNamespace.d.ts +114 -0
- package/dist/client/namespaces/PermissionsNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/PermissionsNamespace.js +179 -0
- package/dist/client/namespaces/PermissionsNamespace.js.map +1 -0
- package/dist/client/namespaces/PipelineNamespace.d.ts +125 -0
- package/dist/client/namespaces/PipelineNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/PipelineNamespace.js +171 -0
- package/dist/client/namespaces/PipelineNamespace.js.map +1 -0
- package/dist/client/namespaces/SearchNamespace.d.ts +382 -0
- package/dist/client/namespaces/SearchNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/SearchNamespace.js +821 -0
- package/dist/client/namespaces/SearchNamespace.js.map +1 -0
- package/dist/client/namespaces/StorageNamespace.d.ts +180 -0
- package/dist/client/namespaces/StorageNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/StorageNamespace.js +354 -0
- package/dist/client/namespaces/StorageNamespace.js.map +1 -0
- package/dist/client/namespaces/TxNamespace.d.ts +143 -0
- package/dist/client/namespaces/TxNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/TxNamespace.js +208 -0
- package/dist/client/namespaces/TxNamespace.js.map +1 -0
- package/dist/client/namespaces/WalletNamespace.d.ts +124 -0
- package/dist/client/namespaces/WalletNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/WalletNamespace.js +197 -0
- package/dist/client/namespaces/WalletNamespace.js.map +1 -0
- package/dist/client/namespaces/consolidated/AINamespace.d.ts +265 -0
- package/dist/client/namespaces/consolidated/AINamespace.d.ts.map +1 -0
- package/dist/client/namespaces/consolidated/AINamespace.js +390 -0
- package/dist/client/namespaces/consolidated/AINamespace.js.map +1 -0
- package/dist/client/namespaces/consolidated/BlockchainNamespace.d.ts +265 -0
- package/dist/client/namespaces/consolidated/BlockchainNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/consolidated/BlockchainNamespace.js +412 -0
- package/dist/client/namespaces/consolidated/BlockchainNamespace.js.map +1 -0
- package/dist/client/namespaces/consolidated/SecurityNamespace.d.ts +354 -0
- package/dist/client/namespaces/consolidated/SecurityNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/consolidated/SecurityNamespace.js +522 -0
- package/dist/client/namespaces/consolidated/SecurityNamespace.js.map +1 -0
- package/dist/client/namespaces/consolidated/StorageNamespace.d.ts +235 -0
- package/dist/client/namespaces/consolidated/StorageNamespace.d.ts.map +1 -0
- package/dist/client/namespaces/consolidated/StorageNamespace.js +351 -0
- package/dist/client/namespaces/consolidated/StorageNamespace.js.map +1 -0
- package/dist/client/namespaces/consolidated/index.d.ts +17 -0
- package/dist/client/namespaces/consolidated/index.d.ts.map +1 -0
- package/dist/client/namespaces/consolidated/index.js +13 -0
- package/dist/client/namespaces/consolidated/index.js.map +1 -0
- package/dist/client/signers/KeypairSigner.d.ts +55 -0
- package/dist/client/signers/KeypairSigner.d.ts.map +1 -0
- package/dist/client/signers/KeypairSigner.js +84 -0
- package/dist/client/signers/KeypairSigner.js.map +1 -0
- package/dist/client/signers/UnifiedSigner.d.ts +88 -0
- package/dist/client/signers/UnifiedSigner.d.ts.map +1 -0
- package/dist/client/signers/UnifiedSigner.js +13 -0
- package/dist/client/signers/UnifiedSigner.js.map +1 -0
- package/dist/client/signers/WalletAdapterSigner.d.ts +94 -0
- package/dist/client/signers/WalletAdapterSigner.d.ts.map +1 -0
- package/dist/client/signers/WalletAdapterSigner.js +91 -0
- package/dist/client/signers/WalletAdapterSigner.js.map +1 -0
- package/dist/client/signers/index.d.ts +14 -0
- package/dist/client/signers/index.d.ts.map +1 -0
- package/dist/client/signers/index.js +12 -0
- package/dist/client/signers/index.js.map +1 -0
- package/dist/config/ConfigurationHelper.d.ts +167 -0
- package/dist/config/ConfigurationHelper.d.ts.map +1 -0
- package/dist/config/ConfigurationHelper.js +283 -0
- package/dist/config/ConfigurationHelper.js.map +1 -0
- package/dist/config/defaults.d.ts +9 -0
- package/dist/config/defaults.d.ts.map +1 -0
- package/dist/config/defaults.js +49 -0
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/index.d.ts +9 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +8 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/validation.d.ts +12 -0
- package/dist/config/validation.d.ts.map +1 -0
- package/dist/config/validation.js +61 -0
- package/dist/config/validation.js.map +1 -0
- package/dist/core/index.d.ts +11 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +13 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/interfaces/IService.d.ts +162 -0
- package/dist/core/interfaces/IService.d.ts.map +1 -0
- package/dist/core/interfaces/IService.js +159 -0
- package/dist/core/interfaces/IService.js.map +1 -0
- package/dist/core/interfaces/index.d.ts +7 -0
- package/dist/core/interfaces/index.d.ts.map +1 -0
- package/dist/core/interfaces/index.js +7 -0
- package/dist/core/interfaces/index.js.map +1 -0
- package/dist/core/types/capability.d.ts +268 -0
- package/dist/core/types/capability.d.ts.map +1 -0
- package/dist/core/types/capability.js +16 -0
- package/dist/core/types/capability.js.map +1 -0
- package/dist/core/types/index.d.ts +750 -0
- package/dist/core/types/index.d.ts.map +1 -0
- package/dist/core/types/index.js +6 -0
- package/dist/core/types/index.js.map +1 -0
- package/dist/core/types/wallet.d.ts +254 -0
- package/dist/core/types/wallet.d.ts.map +1 -0
- package/dist/core/types/wallet.js +27 -0
- package/dist/core/types/wallet.js.map +1 -0
- package/dist/core/types.d.ts +8 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +8 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/wallet.d.ts +209 -0
- package/dist/core/wallet.d.ts.map +1 -0
- package/dist/core/wallet.js +27 -0
- package/dist/core/wallet.js.map +1 -0
- package/dist/embedding/index.d.ts +9 -0
- package/dist/embedding/index.d.ts.map +1 -0
- package/dist/embedding/index.js +8 -0
- package/dist/embedding/index.js.map +1 -0
- package/dist/embedding/types.d.ts +302 -0
- package/dist/embedding/types.d.ts.map +1 -0
- package/dist/embedding/types.js +9 -0
- package/dist/embedding/types.js.map +1 -0
- package/dist/encryption/index.d.ts +14 -0
- package/dist/encryption/index.d.ts.map +1 -0
- package/dist/encryption/index.js +14 -0
- package/dist/encryption/index.js.map +1 -0
- package/dist/errors/index.d.ts +149 -0
- package/dist/errors/index.d.ts.map +1 -0
- package/dist/errors/index.js +301 -0
- package/dist/errors/index.js.map +1 -0
- package/dist/errors/recovery.d.ts +128 -0
- package/dist/errors/recovery.d.ts.map +1 -0
- package/dist/errors/recovery.js +320 -0
- package/dist/errors/recovery.js.map +1 -0
- package/dist/errors/validation.d.ts +106 -0
- package/dist/errors/validation.d.ts.map +1 -0
- package/dist/errors/validation.js +354 -0
- package/dist/errors/validation.js.map +1 -0
- package/dist/generated/pdw/capability.d.ts +223 -0
- package/dist/generated/pdw/capability.d.ts.map +1 -0
- package/dist/generated/pdw/capability.js +238 -0
- package/dist/generated/pdw/capability.js.map +1 -0
- package/dist/generated/pdw/deps/sui/object.d.ts +9 -0
- package/dist/generated/pdw/deps/sui/object.d.ts.map +1 -0
- package/dist/generated/pdw/deps/sui/object.js +11 -0
- package/dist/generated/pdw/deps/sui/object.js.map +1 -0
- package/dist/generated/pdw/deps/sui/vec_map.d.ts +37 -0
- package/dist/generated/pdw/deps/sui/vec_map.d.ts.map +1 -0
- package/dist/generated/pdw/deps/sui/vec_map.js +28 -0
- package/dist/generated/pdw/deps/sui/vec_map.js.map +1 -0
- package/dist/generated/pdw/memory.d.ts +676 -0
- package/dist/generated/pdw/memory.d.ts.map +1 -0
- package/dist/generated/pdw/memory.js +681 -0
- package/dist/generated/pdw/memory.js.map +1 -0
- package/dist/generated/pdw/wallet.d.ts +78 -0
- package/dist/generated/pdw/wallet.d.ts.map +1 -0
- package/dist/generated/pdw/wallet.js +89 -0
- package/dist/generated/pdw/wallet.js.map +1 -0
- package/dist/generated/utils/index.d.ts +12 -0
- package/dist/generated/utils/index.d.ts.map +1 -0
- package/dist/generated/utils/index.js +132 -0
- package/dist/generated/utils/index.js.map +1 -0
- package/dist/graph/BrowserKnowledgeGraphManager.d.ts +101 -0
- package/dist/graph/BrowserKnowledgeGraphManager.d.ts.map +1 -0
- package/dist/graph/BrowserKnowledgeGraphManager.js +411 -0
- package/dist/graph/BrowserKnowledgeGraphManager.js.map +1 -0
- package/dist/graph/GraphService.d.ts +194 -0
- package/dist/graph/GraphService.d.ts.map +1 -0
- package/dist/graph/GraphService.js +662 -0
- package/dist/graph/GraphService.js.map +1 -0
- package/dist/graph/KnowledgeGraphManager.d.ts +161 -0
- package/dist/graph/KnowledgeGraphManager.d.ts.map +1 -0
- package/dist/graph/KnowledgeGraphManager.js +495 -0
- package/dist/graph/KnowledgeGraphManager.js.map +1 -0
- package/dist/graph/index.d.ts +11 -0
- package/dist/graph/index.d.ts.map +1 -0
- package/dist/graph/index.js +9 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/hooks.wip/index.d.ts +55 -0
- package/dist/hooks.wip/index.d.ts.map +1 -0
- package/dist/hooks.wip/index.js +58 -0
- package/dist/hooks.wip/index.js.map +1 -0
- package/dist/hooks.wip/useCreateMemory.d.ts +111 -0
- package/dist/hooks.wip/useCreateMemory.d.ts.map +1 -0
- package/dist/hooks.wip/useCreateMemory.js +149 -0
- package/dist/hooks.wip/useCreateMemory.js.map +1 -0
- package/dist/hooks.wip/useCreateMemoryBatch.d.ts +122 -0
- package/dist/hooks.wip/useCreateMemoryBatch.d.ts.map +1 -0
- package/dist/hooks.wip/useCreateMemoryBatch.js +221 -0
- package/dist/hooks.wip/useCreateMemoryBatch.js.map +1 -0
- package/dist/hooks.wip/useKnowledgeGraph.d.ts +66 -0
- package/dist/hooks.wip/useKnowledgeGraph.d.ts.map +1 -0
- package/dist/hooks.wip/useKnowledgeGraph.js +229 -0
- package/dist/hooks.wip/useKnowledgeGraph.js.map +1 -0
- package/dist/hooks.wip/useMemoryChat.d.ts +106 -0
- package/dist/hooks.wip/useMemoryChat.d.ts.map +1 -0
- package/dist/hooks.wip/useMemoryChat.js +284 -0
- package/dist/hooks.wip/useMemoryChat.js.map +1 -0
- package/dist/hooks.wip/useMemoryIndex.d.ts +90 -0
- package/dist/hooks.wip/useMemoryIndex.d.ts.map +1 -0
- package/dist/hooks.wip/useMemoryIndex.js +218 -0
- package/dist/hooks.wip/useMemoryIndex.js.map +1 -0
- package/dist/hooks.wip/useMemoryManager.d.ts +35 -0
- package/dist/hooks.wip/useMemoryManager.d.ts.map +1 -0
- package/dist/hooks.wip/useMemoryManager.js +86 -0
- package/dist/hooks.wip/useMemoryManager.js.map +1 -0
- package/dist/hooks.wip/useMemorySearch.d.ts +100 -0
- package/dist/hooks.wip/useMemorySearch.d.ts.map +1 -0
- package/dist/hooks.wip/useMemorySearch.js +278 -0
- package/dist/hooks.wip/useMemorySearch.js.map +1 -0
- package/dist/hooks.wip/useMemoryServices.d.ts +80 -0
- package/dist/hooks.wip/useMemoryServices.d.ts.map +1 -0
- package/dist/hooks.wip/useMemoryServices.js +264 -0
- package/dist/hooks.wip/useMemoryServices.js.map +1 -0
- package/dist/hooks.wip/usePDWRAG.d.ts +112 -0
- package/dist/hooks.wip/usePDWRAG.d.ts.map +1 -0
- package/dist/hooks.wip/usePDWRAG.js +121 -0
- package/dist/hooks.wip/usePDWRAG.js.map +1 -0
- package/dist/hooks.wip/usePDWVectorStore.d.ts +68 -0
- package/dist/hooks.wip/usePDWVectorStore.d.ts.map +1 -0
- package/dist/hooks.wip/usePDWVectorStore.js +102 -0
- package/dist/hooks.wip/usePDWVectorStore.js.map +1 -0
- package/dist/hooks.wip/useRetrieveEmbedding.d.ts +138 -0
- package/dist/hooks.wip/useRetrieveEmbedding.d.ts.map +1 -0
- package/dist/hooks.wip/useRetrieveEmbedding.js +121 -0
- package/dist/hooks.wip/useRetrieveEmbedding.js.map +1 -0
- package/dist/hooks.wip/useSearchMemories.d.ts +103 -0
- package/dist/hooks.wip/useSearchMemories.d.ts.map +1 -0
- package/dist/hooks.wip/useSearchMemories.js +146 -0
- package/dist/hooks.wip/useSearchMemories.js.map +1 -0
- package/dist/hooks.wip/useStoreEmbedding.d.ts +174 -0
- package/dist/hooks.wip/useStoreEmbedding.d.ts.map +1 -0
- package/dist/hooks.wip/useStoreEmbedding.js +167 -0
- package/dist/hooks.wip/useStoreEmbedding.js.map +1 -0
- package/dist/hooks.wip/useWalletMemories.d.ts +119 -0
- package/dist/hooks.wip/useWalletMemories.d.ts.map +1 -0
- package/dist/hooks.wip/useWalletMemories.js +166 -0
- package/dist/hooks.wip/useWalletMemories.js.map +1 -0
- package/dist/hooks.wip/utils/cache.d.ts +25 -0
- package/dist/hooks.wip/utils/cache.d.ts.map +1 -0
- package/dist/hooks.wip/utils/cache.js +38 -0
- package/dist/hooks.wip/utils/cache.js.map +1 -0
- package/dist/hooks.wip/utils/types.d.ts +138 -0
- package/dist/hooks.wip/utils/types.d.ts.map +1 -0
- package/dist/hooks.wip/utils/types.js +5 -0
- package/dist/hooks.wip/utils/types.js.map +1 -0
- package/dist/index.d.ts +190 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +298 -0
- package/dist/index.js.map +1 -0
- package/dist/infrastructure/ai/EmbeddingService.d.ts +101 -0
- package/dist/infrastructure/ai/EmbeddingService.d.ts.map +1 -0
- package/dist/infrastructure/ai/EmbeddingService.js +242 -0
- package/dist/infrastructure/ai/EmbeddingService.js.map +1 -0
- package/dist/infrastructure/ai/GeminiAIService.d.ts +84 -0
- package/dist/infrastructure/ai/GeminiAIService.d.ts.map +1 -0
- package/dist/infrastructure/ai/GeminiAIService.js +300 -0
- package/dist/infrastructure/ai/GeminiAIService.js.map +1 -0
- package/dist/infrastructure/ai/index.d.ts +8 -0
- package/dist/infrastructure/ai/index.d.ts.map +1 -0
- package/dist/infrastructure/ai/index.js +8 -0
- package/dist/infrastructure/ai/index.js.map +1 -0
- package/dist/infrastructure/index.d.ts +16 -0
- package/dist/infrastructure/index.d.ts.map +1 -0
- package/dist/infrastructure/index.js +19 -0
- package/dist/infrastructure/index.js.map +1 -0
- package/dist/infrastructure/seal/EncryptionService.d.ts +162 -0
- package/dist/infrastructure/seal/EncryptionService.d.ts.map +1 -0
- package/dist/infrastructure/seal/EncryptionService.js +466 -0
- package/dist/infrastructure/seal/EncryptionService.js.map +1 -0
- package/dist/infrastructure/seal/SealService.d.ts +132 -0
- package/dist/infrastructure/seal/SealService.d.ts.map +1 -0
- package/dist/infrastructure/seal/SealService.js +473 -0
- package/dist/infrastructure/seal/SealService.js.map +1 -0
- package/dist/infrastructure/seal/index.d.ts +8 -0
- package/dist/infrastructure/seal/index.d.ts.map +1 -0
- package/dist/infrastructure/seal/index.js +8 -0
- package/dist/infrastructure/seal/index.js.map +1 -0
- package/dist/infrastructure/sui/BlockchainManager.d.ts +161 -0
- package/dist/infrastructure/sui/BlockchainManager.d.ts.map +1 -0
- package/dist/infrastructure/sui/BlockchainManager.js +421 -0
- package/dist/infrastructure/sui/BlockchainManager.js.map +1 -0
- package/dist/infrastructure/sui/SuiService.d.ts +179 -0
- package/dist/infrastructure/sui/SuiService.d.ts.map +1 -0
- package/dist/infrastructure/sui/SuiService.js +658 -0
- package/dist/infrastructure/sui/SuiService.js.map +1 -0
- package/dist/infrastructure/sui/index.d.ts +8 -0
- package/dist/infrastructure/sui/index.d.ts.map +1 -0
- package/dist/infrastructure/sui/index.js +8 -0
- package/dist/infrastructure/sui/index.js.map +1 -0
- package/dist/infrastructure/walrus/StorageManager.d.ts +207 -0
- package/dist/infrastructure/walrus/StorageManager.d.ts.map +1 -0
- package/dist/infrastructure/walrus/StorageManager.js +413 -0
- package/dist/infrastructure/walrus/StorageManager.js.map +1 -0
- package/dist/infrastructure/walrus/WalrusStorageService.d.ts +177 -0
- package/dist/infrastructure/walrus/WalrusStorageService.d.ts.map +1 -0
- package/dist/infrastructure/walrus/WalrusStorageService.js +403 -0
- package/dist/infrastructure/walrus/WalrusStorageService.js.map +1 -0
- package/dist/infrastructure/walrus/index.d.ts +8 -0
- package/dist/infrastructure/walrus/index.d.ts.map +1 -0
- package/dist/infrastructure/walrus/index.js +8 -0
- package/dist/infrastructure/walrus/index.js.map +1 -0
- package/dist/langchain/PDWEmbeddings.d.ts +77 -0
- package/dist/langchain/PDWEmbeddings.d.ts.map +1 -0
- package/dist/langchain/PDWEmbeddings.js +96 -0
- package/dist/langchain/PDWEmbeddings.js.map +1 -0
- package/dist/langchain/PDWVectorStore.d.ts +173 -0
- package/dist/langchain/PDWVectorStore.d.ts.map +1 -0
- package/dist/langchain/PDWVectorStore.js +304 -0
- package/dist/langchain/PDWVectorStore.js.map +1 -0
- package/dist/langchain/createPDWRAG.d.ts +115 -0
- package/dist/langchain/createPDWRAG.d.ts.map +1 -0
- package/dist/langchain/createPDWRAG.js +181 -0
- package/dist/langchain/createPDWRAG.js.map +1 -0
- package/dist/langchain/index.d.ts +35 -0
- package/dist/langchain/index.d.ts.map +1 -0
- package/dist/langchain/index.js +35 -0
- package/dist/langchain/index.js.map +1 -0
- package/dist/memory/index.d.ts +13 -0
- package/dist/memory/index.d.ts.map +1 -0
- package/dist/memory/index.js +14 -0
- package/dist/memory/index.js.map +1 -0
- package/dist/permissions/ConsentRepository.d.ts +71 -0
- package/dist/permissions/ConsentRepository.d.ts.map +1 -0
- package/dist/permissions/ConsentRepository.js +297 -0
- package/dist/permissions/ConsentRepository.js.map +1 -0
- package/dist/permissions/index.d.ts +9 -0
- package/dist/permissions/index.d.ts.map +1 -0
- package/dist/permissions/index.js +8 -0
- package/dist/permissions/index.js.map +1 -0
- package/dist/pipeline/MemoryPipeline.d.ts +191 -0
- package/dist/pipeline/MemoryPipeline.d.ts.map +1 -0
- package/dist/pipeline/MemoryPipeline.js +588 -0
- package/dist/pipeline/MemoryPipeline.js.map +1 -0
- package/dist/pipeline/PipelineManager.d.ts +178 -0
- package/dist/pipeline/PipelineManager.d.ts.map +1 -0
- package/dist/pipeline/PipelineManager.js +485 -0
- package/dist/pipeline/PipelineManager.js.map +1 -0
- package/dist/pipeline/index.d.ts +13 -0
- package/dist/pipeline/index.d.ts.map +1 -0
- package/dist/pipeline/index.js +11 -0
- package/dist/pipeline/index.js.map +1 -0
- package/dist/retrieval/AdvancedSearchService.d.ts +231 -0
- package/dist/retrieval/AdvancedSearchService.d.ts.map +1 -0
- package/dist/retrieval/AdvancedSearchService.js +384 -0
- package/dist/retrieval/AdvancedSearchService.js.map +1 -0
- package/dist/retrieval/MemoryAnalyticsService.d.ts +227 -0
- package/dist/retrieval/MemoryAnalyticsService.d.ts.map +1 -0
- package/dist/retrieval/MemoryAnalyticsService.js +417 -0
- package/dist/retrieval/MemoryAnalyticsService.js.map +1 -0
- package/dist/retrieval/MemoryDecryptionPipeline.d.ts +191 -0
- package/dist/retrieval/MemoryDecryptionPipeline.d.ts.map +1 -0
- package/dist/retrieval/MemoryDecryptionPipeline.js +623 -0
- package/dist/retrieval/MemoryDecryptionPipeline.js.map +1 -0
- package/dist/retrieval/MemoryRetrievalService.d.ts +248 -0
- package/dist/retrieval/MemoryRetrievalService.d.ts.map +1 -0
- package/dist/retrieval/MemoryRetrievalService.js +519 -0
- package/dist/retrieval/MemoryRetrievalService.js.map +1 -0
- package/dist/retrieval/index.d.ts +14 -0
- package/dist/retrieval/index.d.ts.map +1 -0
- package/dist/retrieval/index.js +10 -0
- package/dist/retrieval/index.js.map +1 -0
- package/dist/services/BatchService.d.ts +109 -0
- package/dist/services/BatchService.d.ts.map +1 -0
- package/dist/services/BatchService.js +259 -0
- package/dist/services/BatchService.js.map +1 -0
- package/dist/services/CapabilityService.d.ts +141 -0
- package/dist/services/CapabilityService.d.ts.map +1 -0
- package/dist/services/CapabilityService.js +361 -0
- package/dist/services/CapabilityService.js.map +1 -0
- package/dist/services/ChatService.d.ts +89 -0
- package/dist/services/ChatService.d.ts.map +1 -0
- package/dist/services/ChatService.js +319 -0
- package/dist/services/ChatService.js.map +1 -0
- package/dist/services/ClassifierService.d.ts +104 -0
- package/dist/services/ClassifierService.d.ts.map +1 -0
- package/dist/services/ClassifierService.js +374 -0
- package/dist/services/ClassifierService.js.map +1 -0
- package/dist/services/CrossContextPermissionService.d.ts +149 -0
- package/dist/services/CrossContextPermissionService.d.ts.map +1 -0
- package/dist/services/CrossContextPermissionService.js +337 -0
- package/dist/services/CrossContextPermissionService.js.map +1 -0
- package/dist/services/EmbeddingService.d.ts +206 -0
- package/dist/services/EmbeddingService.d.ts.map +1 -0
- package/dist/services/EmbeddingService.js +504 -0
- package/dist/services/EmbeddingService.js.map +1 -0
- package/dist/services/EncryptionService.d.ts +201 -0
- package/dist/services/EncryptionService.d.ts.map +1 -0
- package/dist/services/EncryptionService.js +558 -0
- package/dist/services/EncryptionService.js.map +1 -0
- package/dist/services/GeminiAIService.d.ts +112 -0
- package/dist/services/GeminiAIService.d.ts.map +1 -0
- package/dist/services/GeminiAIService.js +389 -0
- package/dist/services/GeminiAIService.js.map +1 -0
- package/dist/services/IndexManager.d.ts +238 -0
- package/dist/services/IndexManager.d.ts.map +1 -0
- package/dist/services/IndexManager.js +691 -0
- package/dist/services/IndexManager.js.map +1 -0
- package/dist/services/MemoryIndexService.d.ts +222 -0
- package/dist/services/MemoryIndexService.d.ts.map +1 -0
- package/dist/services/MemoryIndexService.js +695 -0
- package/dist/services/MemoryIndexService.js.map +1 -0
- package/dist/services/MemoryService.d.ts +156 -0
- package/dist/services/MemoryService.d.ts.map +1 -0
- package/dist/services/MemoryService.js +273 -0
- package/dist/services/MemoryService.js.map +1 -0
- package/dist/services/QueryService.d.ts +182 -0
- package/dist/services/QueryService.d.ts.map +1 -0
- package/dist/services/QueryService.js +631 -0
- package/dist/services/QueryService.js.map +1 -0
- package/dist/services/StorageService.d.ts +523 -0
- package/dist/services/StorageService.d.ts.map +1 -0
- package/dist/services/StorageService.js +627 -0
- package/dist/services/StorageService.js.map +1 -0
- package/dist/services/TransactionService.d.ts +179 -0
- package/dist/services/TransactionService.d.ts.map +1 -0
- package/dist/services/TransactionService.js +639 -0
- package/dist/services/TransactionService.js.map +1 -0
- package/dist/services/VectorService.d.ts +122 -0
- package/dist/services/VectorService.d.ts.map +1 -0
- package/dist/services/VectorService.js +371 -0
- package/dist/services/VectorService.js.map +1 -0
- package/dist/services/ViewService.d.ts +126 -0
- package/dist/services/ViewService.d.ts.map +1 -0
- package/dist/services/ViewService.js +356 -0
- package/dist/services/ViewService.js.map +1 -0
- package/dist/services/index.d.ts +12 -0
- package/dist/services/index.d.ts.map +1 -0
- package/dist/services/index.js +11 -0
- package/dist/services/index.js.map +1 -0
- package/dist/services/storage/BlobAttributesManager.d.ts +60 -0
- package/dist/services/storage/BlobAttributesManager.d.ts.map +1 -0
- package/dist/services/storage/BlobAttributesManager.js +265 -0
- package/dist/services/storage/BlobAttributesManager.js.map +1 -0
- package/dist/services/storage/KnowledgeGraphManager.d.ts +162 -0
- package/dist/services/storage/KnowledgeGraphManager.d.ts.map +1 -0
- package/dist/services/storage/KnowledgeGraphManager.js +303 -0
- package/dist/services/storage/KnowledgeGraphManager.js.map +1 -0
- package/dist/services/storage/MemorySearchManager.d.ts +154 -0
- package/dist/services/storage/MemorySearchManager.d.ts.map +1 -0
- package/dist/services/storage/MemorySearchManager.js +260 -0
- package/dist/services/storage/MemorySearchManager.js.map +1 -0
- package/dist/services/storage/QuiltBatchManager.d.ts +185 -0
- package/dist/services/storage/QuiltBatchManager.d.ts.map +1 -0
- package/dist/services/storage/QuiltBatchManager.js +385 -0
- package/dist/services/storage/QuiltBatchManager.js.map +1 -0
- package/dist/services/storage/WalrusMetadataManager.d.ts +89 -0
- package/dist/services/storage/WalrusMetadataManager.d.ts.map +1 -0
- package/dist/services/storage/WalrusMetadataManager.js +177 -0
- package/dist/services/storage/WalrusMetadataManager.js.map +1 -0
- package/dist/services/storage/WalrusStorageManager.d.ts +113 -0
- package/dist/services/storage/WalrusStorageManager.d.ts.map +1 -0
- package/dist/services/storage/WalrusStorageManager.js +211 -0
- package/dist/services/storage/WalrusStorageManager.js.map +1 -0
- package/dist/services/storage/index.d.ts +24 -0
- package/dist/services/storage/index.d.ts.map +1 -0
- package/dist/services/storage/index.js +18 -0
- package/dist/services/storage/index.js.map +1 -0
- package/dist/transactions/index.d.ts +13 -0
- package/dist/transactions/index.d.ts.map +1 -0
- package/dist/transactions/index.js +14 -0
- package/dist/transactions/index.js.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +13 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/wallet.d.ts +12 -0
- package/dist/types/wallet.d.ts.map +1 -0
- package/dist/types/wallet.js +13 -0
- package/dist/types/wallet.js.map +1 -0
- package/dist/utils/index.d.ts +21 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +30 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/rebuildIndex.d.ts +79 -0
- package/dist/utils/rebuildIndex.d.ts.map +1 -0
- package/dist/utils/rebuildIndex.js +211 -0
- package/dist/utils/rebuildIndex.js.map +1 -0
- package/dist/utils/rebuildIndexNode.d.ts +70 -0
- package/dist/utils/rebuildIndexNode.d.ts.map +1 -0
- package/dist/utils/rebuildIndexNode.js +236 -0
- package/dist/utils/rebuildIndexNode.js.map +1 -0
- package/dist/vector/BrowserHnswIndexService.d.ts +93 -0
- package/dist/vector/BrowserHnswIndexService.d.ts.map +1 -0
- package/dist/vector/BrowserHnswIndexService.js +581 -0
- package/dist/vector/BrowserHnswIndexService.js.map +1 -0
- package/dist/vector/HnswWasmService.d.ts +97 -0
- package/dist/vector/HnswWasmService.d.ts.map +1 -0
- package/dist/vector/HnswWasmService.js +518 -0
- package/dist/vector/HnswWasmService.js.map +1 -0
- package/dist/vector/IHnswService.d.ts +179 -0
- package/dist/vector/IHnswService.d.ts.map +1 -0
- package/dist/vector/IHnswService.js +25 -0
- package/dist/vector/IHnswService.js.map +1 -0
- package/dist/vector/NodeHnswService.d.ts +80 -0
- package/dist/vector/NodeHnswService.d.ts.map +1 -0
- package/dist/vector/NodeHnswService.js +589 -0
- package/dist/vector/NodeHnswService.js.map +1 -0
- package/dist/vector/VectorManager.d.ts +142 -0
- package/dist/vector/VectorManager.d.ts.map +1 -0
- package/dist/vector/VectorManager.js +339 -0
- package/dist/vector/VectorManager.js.map +1 -0
- package/dist/vector/createHnswService.d.ts +51 -0
- package/dist/vector/createHnswService.d.ts.map +1 -0
- package/dist/vector/createHnswService.js +120 -0
- package/dist/vector/createHnswService.js.map +1 -0
- package/dist/vector/index.d.ts +24 -0
- package/dist/vector/index.d.ts.map +1 -0
- package/dist/vector/index.js +24 -0
- package/dist/vector/index.js.map +1 -0
- package/dist/view/ViewService.d.ts +136 -0
- package/dist/view/ViewService.d.ts.map +1 -0
- package/dist/view/ViewService.js +325 -0
- package/dist/view/ViewService.js.map +1 -0
- package/dist/view/index.d.ts +7 -0
- package/dist/view/index.d.ts.map +1 -0
- package/dist/view/index.js +7 -0
- package/dist/view/index.js.map +1 -0
- package/dist/wallet/ContextWalletService.d.ts +172 -0
- package/dist/wallet/ContextWalletService.d.ts.map +1 -0
- package/dist/wallet/ContextWalletService.js +510 -0
- package/dist/wallet/ContextWalletService.js.map +1 -0
- package/dist/wallet/MainWalletService.d.ts +114 -0
- package/dist/wallet/MainWalletService.d.ts.map +1 -0
- package/dist/wallet/MainWalletService.js +259 -0
- package/dist/wallet/MainWalletService.js.map +1 -0
- package/dist/wallet/index.d.ts +16 -0
- package/dist/wallet/index.d.ts.map +1 -0
- package/dist/wallet/index.js +14 -0
- package/dist/wallet/index.js.map +1 -0
- package/package.json +150 -0
- package/src/access/PermissionService.ts +636 -0
- package/src/access/index.ts +8 -0
- package/src/aggregation/AggregationService.ts +390 -0
- package/src/aggregation/index.ts +8 -0
- package/src/ai-sdk/PDWVectorStore.ts +712 -0
- package/src/ai-sdk/index.ts +65 -0
- package/src/ai-sdk/tools.ts +460 -0
- package/src/ai-sdk/types.ts +404 -0
- package/src/batch/BatchManager.ts +598 -0
- package/src/batch/BatchingService.ts +430 -0
- package/src/batch/MemoryProcessingCache.ts +493 -0
- package/src/batch/index.ts +31 -0
- package/src/browser.ts +196 -0
- package/src/client/ClientMemoryManager.ts +982 -0
- package/src/client/PersonalDataWallet.ts +346 -0
- package/src/client/SimplePDWClient.ts +1180 -0
- package/src/client/factory.ts +155 -0
- package/src/client/namespaces/AnalyticsNamespace.ts +377 -0
- package/src/client/namespaces/BatchNamespace.ts +356 -0
- package/src/client/namespaces/CacheNamespace.ts +123 -0
- package/src/client/namespaces/CapabilityNamespace.ts +217 -0
- package/src/client/namespaces/ClassifyNamespace.ts +169 -0
- package/src/client/namespaces/ContextNamespace.ts +297 -0
- package/src/client/namespaces/EmbeddingsNamespace.ts +99 -0
- package/src/client/namespaces/EncryptionNamespace.ts +221 -0
- package/src/client/namespaces/GraphNamespace.ts +468 -0
- package/src/client/namespaces/IndexNamespace.ts +283 -0
- package/src/client/namespaces/MemoryNamespace.ts +1135 -0
- package/src/client/namespaces/PermissionsNamespace.ts +254 -0
- package/src/client/namespaces/PipelineNamespace.ts +220 -0
- package/src/client/namespaces/SearchNamespace.ts +1036 -0
- package/src/client/namespaces/StorageNamespace.ts +458 -0
- package/src/client/namespaces/TxNamespace.ts +260 -0
- package/src/client/namespaces/WalletNamespace.ts +243 -0
- package/src/client/namespaces/consolidated/AINamespace.ts +449 -0
- package/src/client/namespaces/consolidated/BlockchainNamespace.ts +492 -0
- package/src/client/namespaces/consolidated/SecurityNamespace.ts +648 -0
- package/src/client/namespaces/consolidated/StorageNamespace.ts +440 -0
- package/src/client/namespaces/consolidated/index.ts +39 -0
- package/src/client/signers/KeypairSigner.ts +101 -0
- package/src/client/signers/UnifiedSigner.ts +99 -0
- package/src/client/signers/WalletAdapterSigner.ts +149 -0
- package/src/client/signers/index.ts +19 -0
- package/src/config/ConfigurationHelper.ts +413 -0
- package/src/config/defaults.ts +52 -0
- package/src/config/index.ts +9 -0
- package/src/config/validation.ts +71 -0
- package/src/core/index.ts +14 -0
- package/src/core/interfaces/IService.ts +307 -0
- package/src/core/interfaces/index.ts +8 -0
- package/src/core/types/capability.ts +297 -0
- package/src/core/types/index.ts +871 -0
- package/src/core/types/wallet.ts +271 -0
- package/src/core/types.ts +9 -0
- package/src/core/wallet.ts +223 -0
- package/src/embedding/index.ts +20 -0
- package/src/embedding/types.ts +358 -0
- package/src/errors/index.ts +603 -0
- package/src/errors/recovery.ts +462 -0
- package/src/errors/validation.ts +568 -0
- package/src/generated/pdw/capability.ts +319 -0
- package/src/generated/pdw/deps/sui/object.ts +13 -0
- package/src/generated/pdw/deps/sui/vec_map.ts +33 -0
- package/src/generated/pdw/memory.ts +1088 -0
- package/src/generated/pdw/wallet.ts +124 -0
- package/src/generated/utils/index.ts +159 -0
- package/src/graph/GraphService.ts +888 -0
- package/src/graph/KnowledgeGraphManager.ts +729 -0
- package/src/graph/index.ts +26 -0
- package/src/index.ts +458 -0
- package/src/infrastructure/index.ts +22 -0
- package/src/infrastructure/seal/EncryptionService.ts +604 -0
- package/src/infrastructure/seal/SealService.ts +616 -0
- package/src/infrastructure/seal/index.ts +9 -0
- package/src/infrastructure/sui/BlockchainManager.ts +628 -0
- package/src/infrastructure/sui/SuiService.ts +888 -0
- package/src/infrastructure/sui/index.ts +9 -0
- package/src/infrastructure/walrus/StorageManager.ts +605 -0
- package/src/infrastructure/walrus/WalrusStorageService.ts +613 -0
- package/src/infrastructure/walrus/index.ts +9 -0
- package/src/langchain/PDWEmbeddings.ts +145 -0
- package/src/langchain/PDWVectorStore.ts +456 -0
- package/src/langchain/README.md +116 -0
- package/src/langchain/createPDWRAG.ts +303 -0
- package/src/langchain/index.ts +47 -0
- package/src/permissions/ConsentRepository.ts +364 -0
- package/src/permissions/index.ts +9 -0
- package/src/pipeline/MemoryPipeline.ts +863 -0
- package/src/pipeline/PipelineManager.ts +684 -0
- package/src/pipeline/index.ts +27 -0
- package/src/retrieval/AdvancedSearchService.ts +630 -0
- package/src/retrieval/MemoryAnalyticsService.ts +712 -0
- package/src/retrieval/MemoryDecryptionPipeline.ts +825 -0
- package/src/retrieval/MemoryRetrievalService.ts +831 -0
- package/src/retrieval/index.ts +43 -0
- package/src/services/BatchService.ts +353 -0
- package/src/services/CapabilityService.ts +448 -0
- package/src/services/ClassifierService.ts +466 -0
- package/src/services/CrossContextPermissionService.ts +484 -0
- package/src/services/EmbeddingService.ts +706 -0
- package/src/services/EncryptionService.ts +712 -0
- package/src/services/GeminiAIService.ts +497 -0
- package/src/services/IndexManager.ts +1004 -0
- package/src/services/MemoryIndexService.ts +922 -0
- package/src/services/MemoryService.ts +370 -0
- package/src/services/QueryService.ts +891 -0
- package/src/services/StorageService.ts +1111 -0
- package/src/services/TransactionService.ts +791 -0
- package/src/services/VectorService.ts +462 -0
- package/src/services/ViewService.ts +485 -0
- package/src/services/index.ts +25 -0
- package/src/services/storage/BlobAttributesManager.ts +342 -0
- package/src/services/storage/KnowledgeGraphManager.ts +425 -0
- package/src/services/storage/MemorySearchManager.ts +387 -0
- package/src/services/storage/QuiltBatchManager.ts +532 -0
- package/src/services/storage/WalrusMetadataManager.ts +271 -0
- package/src/services/storage/WalrusStorageManager.ts +290 -0
- package/src/services/storage/index.ts +52 -0
- package/src/types/index.ts +13 -0
- package/src/utils/index.ts +68 -0
- package/src/utils/rebuildIndex.ts +290 -0
- package/src/utils/rebuildIndexNode.ts +341 -0
- package/src/vector/BrowserHnswIndexService.ts +758 -0
- package/src/vector/HnswWasmService.ts +679 -0
- package/src/vector/IHnswService.ts +224 -0
- package/src/vector/NodeHnswService.ts +713 -0
- package/src/vector/VectorManager.ts +479 -0
- package/src/vector/createHnswService.ts +135 -0
- package/src/vector/index.ts +57 -0
- package/src/wallet/ContextWalletService.ts +657 -0
- package/src/wallet/MainWalletService.ts +318 -0
- package/src/wallet/index.ts +17 -0
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tx Namespace - Transaction Utilities
|
|
3
|
+
*
|
|
4
|
+
* Pure delegation to TransactionService for PTB building and execution.
|
|
5
|
+
* Provides convenient methods for common blockchain operations.
|
|
6
|
+
*
|
|
7
|
+
* @module client/namespaces
|
|
8
|
+
*/
|
|
9
|
+
import type { ServiceContainer } from '../SimplePDWClient';
|
|
10
|
+
import { Transaction } from '@mysten/sui/transactions';
|
|
11
|
+
import type { TransactionResult } from '../../types';
|
|
12
|
+
/**
|
|
13
|
+
* Memory transaction options
|
|
14
|
+
*/
|
|
15
|
+
export interface MemoryTxOptions {
|
|
16
|
+
category: string;
|
|
17
|
+
vectorId: number;
|
|
18
|
+
blobId: string;
|
|
19
|
+
importance: number;
|
|
20
|
+
gasBudget?: number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Batch operation types supported by PTB
|
|
24
|
+
*/
|
|
25
|
+
export type BatchOperationType = 'createMemory' | 'updateMemory' | 'deleteMemory' | 'createCap' | 'transferCap' | 'burnCap';
|
|
26
|
+
/**
|
|
27
|
+
* Batch operation definition
|
|
28
|
+
*/
|
|
29
|
+
export interface BatchOperation {
|
|
30
|
+
type: BatchOperationType;
|
|
31
|
+
options: any;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Tx Namespace
|
|
35
|
+
*
|
|
36
|
+
* Handles transaction building and execution utilities
|
|
37
|
+
*/
|
|
38
|
+
export declare class TxNamespace {
|
|
39
|
+
private services;
|
|
40
|
+
constructor(services: ServiceContainer);
|
|
41
|
+
/**
|
|
42
|
+
* Build transaction for creating memory record
|
|
43
|
+
*
|
|
44
|
+
* Delegates to: TransactionService.buildCreateMemoryRecordLightweight()
|
|
45
|
+
*
|
|
46
|
+
* @param options - Memory creation options
|
|
47
|
+
* @returns Transaction object
|
|
48
|
+
*/
|
|
49
|
+
buildCreate(options: MemoryTxOptions): Transaction;
|
|
50
|
+
/**
|
|
51
|
+
* Build transaction for updating memory metadata
|
|
52
|
+
*
|
|
53
|
+
* Delegates to: TransactionService.buildUpdateMemoryMetadata()
|
|
54
|
+
*
|
|
55
|
+
* @param memoryId - Memory ID to update
|
|
56
|
+
* @param metadataBlobId - New metadata blob ID
|
|
57
|
+
* @returns Transaction object
|
|
58
|
+
*/
|
|
59
|
+
buildUpdate(memoryId: string, metadataBlobId: string): Transaction;
|
|
60
|
+
/**
|
|
61
|
+
* Build transaction for deleting memory record
|
|
62
|
+
*
|
|
63
|
+
* Delegates to: TransactionService.buildDeleteMemoryRecord()
|
|
64
|
+
*
|
|
65
|
+
* @param memoryId - Memory ID to delete
|
|
66
|
+
* @returns Transaction object
|
|
67
|
+
*/
|
|
68
|
+
buildDelete(memoryId: string): Transaction;
|
|
69
|
+
/**
|
|
70
|
+
* Execute a transaction
|
|
71
|
+
*
|
|
72
|
+
* Delegates to: TransactionService.executeTransaction()
|
|
73
|
+
*
|
|
74
|
+
* @param tx - Transaction to execute
|
|
75
|
+
* @returns Transaction result with digest and status
|
|
76
|
+
*/
|
|
77
|
+
execute(tx: Transaction): Promise<TransactionResult>;
|
|
78
|
+
/**
|
|
79
|
+
* Build and execute in one call
|
|
80
|
+
*
|
|
81
|
+
* Convenience method combining build + execute
|
|
82
|
+
*
|
|
83
|
+
* @param options - Memory creation options
|
|
84
|
+
* @returns Transaction result
|
|
85
|
+
*/
|
|
86
|
+
createMemory(options: MemoryTxOptions): Promise<TransactionResult>;
|
|
87
|
+
/**
|
|
88
|
+
* Build batch transaction (combine multiple operations into single PTB)
|
|
89
|
+
*
|
|
90
|
+
* Delegates to TransactionService.buildBatchTransaction() for proper PTB composition.
|
|
91
|
+
* All operations are executed atomically in a single transaction.
|
|
92
|
+
*
|
|
93
|
+
* @param operations - Array of typed operations to batch
|
|
94
|
+
* @returns Combined transaction with all move calls
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```typescript
|
|
98
|
+
* const tx = pdw.tx.buildBatch([
|
|
99
|
+
* { type: 'createMemory', options: { category: 'note', vectorId: 1, blobId: 'abc', importance: 5 } },
|
|
100
|
+
* { type: 'createMemory', options: { category: 'task', vectorId: 2, blobId: 'def', importance: 7 } },
|
|
101
|
+
* ]);
|
|
102
|
+
* const result = await pdw.tx.execute(tx);
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
buildBatch(operations: BatchOperation[]): Transaction;
|
|
106
|
+
/**
|
|
107
|
+
* Build and execute batch transaction in one call
|
|
108
|
+
*
|
|
109
|
+
* Convenience method combining buildBatch + execute
|
|
110
|
+
*
|
|
111
|
+
* @param operations - Array of typed operations to batch
|
|
112
|
+
* @param gasBudget - Optional gas budget override
|
|
113
|
+
* @returns Transaction result with digest and status
|
|
114
|
+
*
|
|
115
|
+
* @example
|
|
116
|
+
* ```typescript
|
|
117
|
+
* const result = await pdw.tx.executeBatch([
|
|
118
|
+
* { type: 'createMemory', options: { ... } },
|
|
119
|
+
* { type: 'deleteMemory', options: { memoryId: '0x123' } },
|
|
120
|
+
* ]);
|
|
121
|
+
* ```
|
|
122
|
+
*/
|
|
123
|
+
executeBatch(operations: BatchOperation[], gasBudget?: number): Promise<TransactionResult>;
|
|
124
|
+
/**
|
|
125
|
+
* Estimate gas cost for transaction
|
|
126
|
+
*
|
|
127
|
+
* Dry-runs transaction to estimate gas
|
|
128
|
+
*
|
|
129
|
+
* @param tx - Transaction to estimate
|
|
130
|
+
* @returns Estimated gas cost
|
|
131
|
+
*/
|
|
132
|
+
estimateGas(tx: Transaction): Promise<number>;
|
|
133
|
+
/**
|
|
134
|
+
* Wait for transaction confirmation
|
|
135
|
+
*
|
|
136
|
+
* Waits for transaction to be confirmed on-chain
|
|
137
|
+
*
|
|
138
|
+
* @param digest - Transaction digest
|
|
139
|
+
* @returns Transaction effects
|
|
140
|
+
*/
|
|
141
|
+
waitForConfirmation(digest: string): Promise<TransactionResult>;
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=TxNamespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TxNamespace.d.ts","sourceRoot":"","sources":["../../../src/client/namespaces/TxNamespace.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAErD;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,cAAc,GAAG,cAAc,GAAG,cAAc,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,CAAC;AAE5H;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,kBAAkB,CAAC;IACzB,OAAO,EAAE,GAAG,CAAC;CACd;AAED;;;;GAIG;AACH,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ;gBAAR,QAAQ,EAAE,gBAAgB;IAE9C;;;;;;;OAOG;IACH,WAAW,CAAC,OAAO,EAAE,eAAe,GAAG,WAAW;IAclD;;;;;;;;OAQG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,WAAW;IAYlE;;;;;;;OAOG;IACH,WAAW,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW;IAU1C;;;;;;;OAOG;IACG,OAAO,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAW1D;;;;;;;OAOG;IACG,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAKxE;;;;;;;;;;;;;;;;;OAiBG;IACH,UAAU,CAAC,UAAU,EAAE,cAAc,EAAE,GAAG,WAAW;IAQrD;;;;;;;;;;;;;;;;OAgBG;IACG,YAAY,CAAC,UAAU,EAAE,cAAc,EAAE,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAYhG;;;;;;;OAOG;IACG,WAAW,CAAC,EAAE,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC;IAuBnD;;;;;;;OAOG;IACG,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,iBAAiB,CAAC;CA2BtE"}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tx Namespace - Transaction Utilities
|
|
3
|
+
*
|
|
4
|
+
* Pure delegation to TransactionService for PTB building and execution.
|
|
5
|
+
* Provides convenient methods for common blockchain operations.
|
|
6
|
+
*
|
|
7
|
+
* @module client/namespaces
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Tx Namespace
|
|
11
|
+
*
|
|
12
|
+
* Handles transaction building and execution utilities
|
|
13
|
+
*/
|
|
14
|
+
export class TxNamespace {
|
|
15
|
+
constructor(services) {
|
|
16
|
+
this.services = services;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Build transaction for creating memory record
|
|
20
|
+
*
|
|
21
|
+
* Delegates to: TransactionService.buildCreateMemoryRecordLightweight()
|
|
22
|
+
*
|
|
23
|
+
* @param options - Memory creation options
|
|
24
|
+
* @returns Transaction object
|
|
25
|
+
*/
|
|
26
|
+
buildCreate(options) {
|
|
27
|
+
if (!this.services.tx) {
|
|
28
|
+
throw new Error('Transaction service not configured.');
|
|
29
|
+
}
|
|
30
|
+
return this.services.tx.buildCreateMemoryRecordLightweight({
|
|
31
|
+
category: options.category,
|
|
32
|
+
vectorId: options.vectorId,
|
|
33
|
+
blobId: options.blobId,
|
|
34
|
+
importance: options.importance,
|
|
35
|
+
gasBudget: options.gasBudget
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Build transaction for updating memory metadata
|
|
40
|
+
*
|
|
41
|
+
* Delegates to: TransactionService.buildUpdateMemoryMetadata()
|
|
42
|
+
*
|
|
43
|
+
* @param memoryId - Memory ID to update
|
|
44
|
+
* @param metadataBlobId - New metadata blob ID
|
|
45
|
+
* @returns Transaction object
|
|
46
|
+
*/
|
|
47
|
+
buildUpdate(memoryId, metadataBlobId) {
|
|
48
|
+
if (!this.services.tx) {
|
|
49
|
+
throw new Error('Transaction service not configured.');
|
|
50
|
+
}
|
|
51
|
+
return this.services.tx.buildUpdateMemoryMetadata({
|
|
52
|
+
memoryId,
|
|
53
|
+
metadataBlobId,
|
|
54
|
+
embeddingDimension: 3072 // Default for Gemini
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Build transaction for deleting memory record
|
|
59
|
+
*
|
|
60
|
+
* Delegates to: TransactionService.buildDeleteMemoryRecord()
|
|
61
|
+
*
|
|
62
|
+
* @param memoryId - Memory ID to delete
|
|
63
|
+
* @returns Transaction object
|
|
64
|
+
*/
|
|
65
|
+
buildDelete(memoryId) {
|
|
66
|
+
if (!this.services.tx) {
|
|
67
|
+
throw new Error('Transaction service not configured.');
|
|
68
|
+
}
|
|
69
|
+
return this.services.tx.buildDeleteMemoryRecord({
|
|
70
|
+
memoryId
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Execute a transaction
|
|
75
|
+
*
|
|
76
|
+
* Delegates to: TransactionService.executeTransaction()
|
|
77
|
+
*
|
|
78
|
+
* @param tx - Transaction to execute
|
|
79
|
+
* @returns Transaction result with digest and status
|
|
80
|
+
*/
|
|
81
|
+
async execute(tx) {
|
|
82
|
+
if (!this.services.tx) {
|
|
83
|
+
throw new Error('Transaction service not configured.');
|
|
84
|
+
}
|
|
85
|
+
return await this.services.tx.executeTransaction(tx, this.services.config.signer.getSigner());
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Build and execute in one call
|
|
89
|
+
*
|
|
90
|
+
* Convenience method combining build + execute
|
|
91
|
+
*
|
|
92
|
+
* @param options - Memory creation options
|
|
93
|
+
* @returns Transaction result
|
|
94
|
+
*/
|
|
95
|
+
async createMemory(options) {
|
|
96
|
+
const tx = this.buildCreate(options);
|
|
97
|
+
return await this.execute(tx);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Build batch transaction (combine multiple operations into single PTB)
|
|
101
|
+
*
|
|
102
|
+
* Delegates to TransactionService.buildBatchTransaction() for proper PTB composition.
|
|
103
|
+
* All operations are executed atomically in a single transaction.
|
|
104
|
+
*
|
|
105
|
+
* @param operations - Array of typed operations to batch
|
|
106
|
+
* @returns Combined transaction with all move calls
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```typescript
|
|
110
|
+
* const tx = pdw.tx.buildBatch([
|
|
111
|
+
* { type: 'createMemory', options: { category: 'note', vectorId: 1, blobId: 'abc', importance: 5 } },
|
|
112
|
+
* { type: 'createMemory', options: { category: 'task', vectorId: 2, blobId: 'def', importance: 7 } },
|
|
113
|
+
* ]);
|
|
114
|
+
* const result = await pdw.tx.execute(tx);
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
buildBatch(operations) {
|
|
118
|
+
if (!this.services.tx) {
|
|
119
|
+
throw new Error('Transaction service not configured.');
|
|
120
|
+
}
|
|
121
|
+
return this.services.tx.buildBatchTransaction(operations);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Build and execute batch transaction in one call
|
|
125
|
+
*
|
|
126
|
+
* Convenience method combining buildBatch + execute
|
|
127
|
+
*
|
|
128
|
+
* @param operations - Array of typed operations to batch
|
|
129
|
+
* @param gasBudget - Optional gas budget override
|
|
130
|
+
* @returns Transaction result with digest and status
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```typescript
|
|
134
|
+
* const result = await pdw.tx.executeBatch([
|
|
135
|
+
* { type: 'createMemory', options: { ... } },
|
|
136
|
+
* { type: 'deleteMemory', options: { memoryId: '0x123' } },
|
|
137
|
+
* ]);
|
|
138
|
+
* ```
|
|
139
|
+
*/
|
|
140
|
+
async executeBatch(operations, gasBudget) {
|
|
141
|
+
if (!this.services.tx) {
|
|
142
|
+
throw new Error('Transaction service not configured.');
|
|
143
|
+
}
|
|
144
|
+
return await this.services.tx.executeBatch(operations, this.services.config.signer.getSigner(), { gasBudget });
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Estimate gas cost for transaction
|
|
148
|
+
*
|
|
149
|
+
* Dry-runs transaction to estimate gas
|
|
150
|
+
*
|
|
151
|
+
* @param tx - Transaction to estimate
|
|
152
|
+
* @returns Estimated gas cost
|
|
153
|
+
*/
|
|
154
|
+
async estimateGas(tx) {
|
|
155
|
+
if (!this.services.tx) {
|
|
156
|
+
throw new Error('Transaction service not configured.');
|
|
157
|
+
}
|
|
158
|
+
try {
|
|
159
|
+
// Use Sui client to dry-run
|
|
160
|
+
const dryRun = await this.services.config.sui.client.dryRunTransactionBlock({
|
|
161
|
+
transactionBlock: await tx.build({ client: this.services.config.sui.client })
|
|
162
|
+
});
|
|
163
|
+
const gasUsed = dryRun.effects.gasUsed;
|
|
164
|
+
const totalGas = Number(gasUsed.computationCost) +
|
|
165
|
+
Number(gasUsed.storageCost) -
|
|
166
|
+
Number(gasUsed.storageRebate);
|
|
167
|
+
return totalGas;
|
|
168
|
+
}
|
|
169
|
+
catch (error) {
|
|
170
|
+
throw new Error(`Gas estimation failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* Wait for transaction confirmation
|
|
175
|
+
*
|
|
176
|
+
* Waits for transaction to be confirmed on-chain
|
|
177
|
+
*
|
|
178
|
+
* @param digest - Transaction digest
|
|
179
|
+
* @returns Transaction effects
|
|
180
|
+
*/
|
|
181
|
+
async waitForConfirmation(digest) {
|
|
182
|
+
if (!this.services.tx) {
|
|
183
|
+
throw new Error('Transaction service not configured.');
|
|
184
|
+
}
|
|
185
|
+
try {
|
|
186
|
+
const result = await this.services.config.sui.client.waitForTransaction({
|
|
187
|
+
digest,
|
|
188
|
+
options: {
|
|
189
|
+
showEffects: true,
|
|
190
|
+
showObjectChanges: true,
|
|
191
|
+
showEvents: true
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
return {
|
|
195
|
+
digest: result.digest,
|
|
196
|
+
status: result.effects?.status?.status === 'success' ? 'success' : 'failure',
|
|
197
|
+
effects: result.effects,
|
|
198
|
+
gasUsed: result.effects?.gasUsed?.computationCost
|
|
199
|
+
? Number(result.effects.gasUsed.computationCost)
|
|
200
|
+
: undefined
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
catch (error) {
|
|
204
|
+
throw new Error(`Wait for confirmation failed: ${error instanceof Error ? error.message : String(error)}`);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=TxNamespace.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TxNamespace.js","sourceRoot":"","sources":["../../../src/client/namespaces/TxNamespace.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AA8BH;;;;GAIG;AACH,MAAM,OAAO,WAAW;IACtB,YAAoB,QAA0B;QAA1B,aAAQ,GAAR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;gBACrB,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS;gBAC5E,OAAO,EAAE,MAAM,CAAC,OAAO;gBACvB,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,eAAe;oBAC/C,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC;oBAChD,CAAC,CAAC,SAAS;aACd,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,IAAI,KAAK,CAAC,iCAAiC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;QAC7G,CAAC;IACH,CAAC;CACF"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wallet Namespace - Simplified Wallet Operations
|
|
3
|
+
*
|
|
4
|
+
* Provides basic wallet operations without HD wallet complexity.
|
|
5
|
+
* In the new capability-based architecture, wallet operations are minimal:
|
|
6
|
+
* - Get current wallet address
|
|
7
|
+
* - Check connection status
|
|
8
|
+
* - Query owned objects
|
|
9
|
+
*
|
|
10
|
+
* @module client/namespaces
|
|
11
|
+
*/
|
|
12
|
+
import type { ServiceContainer } from '../SimplePDWClient';
|
|
13
|
+
/**
|
|
14
|
+
* Wallet info
|
|
15
|
+
*/
|
|
16
|
+
export interface WalletInfo {
|
|
17
|
+
/** Wallet address */
|
|
18
|
+
address: string;
|
|
19
|
+
/** Whether wallet is connected */
|
|
20
|
+
connected: boolean;
|
|
21
|
+
/** Network the wallet is on */
|
|
22
|
+
network: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Object info
|
|
26
|
+
*/
|
|
27
|
+
export interface OwnedObject {
|
|
28
|
+
/** Object ID */
|
|
29
|
+
id: string;
|
|
30
|
+
/** Object type */
|
|
31
|
+
type: string;
|
|
32
|
+
/** Object version */
|
|
33
|
+
version: string;
|
|
34
|
+
/** Object digest */
|
|
35
|
+
digest: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Wallet Namespace
|
|
39
|
+
*
|
|
40
|
+
* Simplified wallet operations
|
|
41
|
+
*/
|
|
42
|
+
export declare class WalletNamespace {
|
|
43
|
+
private services;
|
|
44
|
+
constructor(services: ServiceContainer);
|
|
45
|
+
/**
|
|
46
|
+
* Get current wallet address
|
|
47
|
+
*
|
|
48
|
+
* @returns Wallet address
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const address = await pdw.wallet.getAddress();
|
|
53
|
+
* console.log('Connected as:', address);
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
getAddress(): Promise<string>;
|
|
57
|
+
/**
|
|
58
|
+
* Check if wallet is connected/ready
|
|
59
|
+
*
|
|
60
|
+
* @returns Connection status
|
|
61
|
+
*/
|
|
62
|
+
isConnected(): Promise<boolean>;
|
|
63
|
+
/**
|
|
64
|
+
* Get wallet info
|
|
65
|
+
*
|
|
66
|
+
* @returns Wallet information
|
|
67
|
+
*/
|
|
68
|
+
getInfo(): Promise<WalletInfo>;
|
|
69
|
+
/**
|
|
70
|
+
* Get all owned objects of a specific type
|
|
71
|
+
*
|
|
72
|
+
* @param structType - Move struct type (e.g., "0x123::memory::Memory")
|
|
73
|
+
* @returns Array of owned objects
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* const memories = await pdw.wallet.getOwnedObjects(
|
|
78
|
+
* `${packageId}::memory::Memory`
|
|
79
|
+
* );
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
getOwnedObjects(structType: string): Promise<OwnedObject[]>;
|
|
83
|
+
/**
|
|
84
|
+
* Get all MemoryCap objects owned by user
|
|
85
|
+
*
|
|
86
|
+
* Convenience method for getting capability objects
|
|
87
|
+
*
|
|
88
|
+
* @returns Array of MemoryCap object IDs
|
|
89
|
+
*/
|
|
90
|
+
getMemoryCaps(): Promise<OwnedObject[]>;
|
|
91
|
+
/**
|
|
92
|
+
* Get all Memory objects owned by user
|
|
93
|
+
*
|
|
94
|
+
* @returns Array of Memory object IDs
|
|
95
|
+
*/
|
|
96
|
+
getMemories(): Promise<OwnedObject[]>;
|
|
97
|
+
/**
|
|
98
|
+
* Get SUI balance
|
|
99
|
+
*
|
|
100
|
+
* @returns Balance in MIST (smallest unit)
|
|
101
|
+
*/
|
|
102
|
+
getBalance(): Promise<bigint>;
|
|
103
|
+
/**
|
|
104
|
+
* Get formatted SUI balance
|
|
105
|
+
*
|
|
106
|
+
* @returns Balance in SUI (human readable)
|
|
107
|
+
*/
|
|
108
|
+
getFormattedBalance(): Promise<string>;
|
|
109
|
+
/**
|
|
110
|
+
* Sign a message with the connected wallet
|
|
111
|
+
*
|
|
112
|
+
* @param message - Message to sign (string or bytes)
|
|
113
|
+
* @returns Signature as hex string
|
|
114
|
+
*/
|
|
115
|
+
signMessage(message: string | Uint8Array): Promise<string>;
|
|
116
|
+
/**
|
|
117
|
+
* Get object by ID
|
|
118
|
+
*
|
|
119
|
+
* @param objectId - Object ID to fetch
|
|
120
|
+
* @returns Object data or null
|
|
121
|
+
*/
|
|
122
|
+
getObject(objectId: string): Promise<any | null>;
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=WalletNamespace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WalletNamespace.d.ts","sourceRoot":"","sources":["../../../src/client/namespaces/WalletNamespace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,qBAAqB;IACrB,OAAO,EAAE,MAAM,CAAC;IA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* Provides basic wallet operations without HD wallet complexity.
|
|
5
|
+
* In the new capability-based architecture, wallet operations are minimal:
|
|
6
|
+
* - Get current wallet address
|
|
7
|
+
* - Check connection status
|
|
8
|
+
* - Query owned objects
|
|
9
|
+
*
|
|
10
|
+
* @module client/namespaces
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Wallet Namespace
|
|
14
|
+
*
|
|
15
|
+
* Simplified wallet operations
|
|
16
|
+
*/
|
|
17
|
+
export class WalletNamespace {
|
|
18
|
+
constructor(services) {
|
|
19
|
+
this.services = services;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Get current wallet address
|
|
23
|
+
*
|
|
24
|
+
* @returns Wallet address
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const address = await pdw.wallet.getAddress();
|
|
29
|
+
* console.log('Connected as:', address);
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
async getAddress() {
|
|
33
|
+
return this.services.config.userAddress;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Check if wallet is connected/ready
|
|
37
|
+
*
|
|
38
|
+
* @returns Connection status
|
|
39
|
+
*/
|
|
40
|
+
async isConnected() {
|
|
41
|
+
try {
|
|
42
|
+
const address = await this.getAddress();
|
|
43
|
+
return !!address && address.startsWith('0x');
|
|
44
|
+
}
|
|
45
|
+
catch {
|
|
46
|
+
return false;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get wallet info
|
|
51
|
+
*
|
|
52
|
+
* @returns Wallet information
|
|
53
|
+
*/
|
|
54
|
+
async getInfo() {
|
|
55
|
+
return {
|
|
56
|
+
address: this.services.config.userAddress,
|
|
57
|
+
connected: await this.isConnected(),
|
|
58
|
+
network: this.services.config.sui?.network || 'testnet',
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Get all owned objects of a specific type
|
|
63
|
+
*
|
|
64
|
+
* @param structType - Move struct type (e.g., "0x123::memory::Memory")
|
|
65
|
+
* @returns Array of owned objects
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const memories = await pdw.wallet.getOwnedObjects(
|
|
70
|
+
* `${packageId}::memory::Memory`
|
|
71
|
+
* );
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
async getOwnedObjects(structType) {
|
|
75
|
+
const suiClient = this.services.config.sui?.client;
|
|
76
|
+
if (!suiClient) {
|
|
77
|
+
throw new Error('SuiClient not initialized');
|
|
78
|
+
}
|
|
79
|
+
const response = await suiClient.getOwnedObjects({
|
|
80
|
+
owner: this.services.config.userAddress,
|
|
81
|
+
filter: {
|
|
82
|
+
StructType: structType,
|
|
83
|
+
},
|
|
84
|
+
options: {
|
|
85
|
+
showContent: true,
|
|
86
|
+
showType: true,
|
|
87
|
+
},
|
|
88
|
+
});
|
|
89
|
+
return response.data.map(obj => ({
|
|
90
|
+
id: obj.data?.objectId || '',
|
|
91
|
+
type: obj.data?.type || '',
|
|
92
|
+
version: obj.data?.version || '',
|
|
93
|
+
digest: obj.data?.digest || '',
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Get all MemoryCap objects owned by user
|
|
98
|
+
*
|
|
99
|
+
* Convenience method for getting capability objects
|
|
100
|
+
*
|
|
101
|
+
* @returns Array of MemoryCap object IDs
|
|
102
|
+
*/
|
|
103
|
+
async getMemoryCaps() {
|
|
104
|
+
const packageId = this.services.config.sui?.packageId;
|
|
105
|
+
if (!packageId) {
|
|
106
|
+
throw new Error('Package ID not configured');
|
|
107
|
+
}
|
|
108
|
+
return await this.getOwnedObjects(`${packageId}::capability::MemoryCap`);
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Get all Memory objects owned by user
|
|
112
|
+
*
|
|
113
|
+
* @returns Array of Memory object IDs
|
|
114
|
+
*/
|
|
115
|
+
async getMemories() {
|
|
116
|
+
const packageId = this.services.config.sui?.packageId;
|
|
117
|
+
if (!packageId) {
|
|
118
|
+
throw new Error('Package ID not configured');
|
|
119
|
+
}
|
|
120
|
+
return await this.getOwnedObjects(`${packageId}::memory::Memory`);
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Get SUI balance
|
|
124
|
+
*
|
|
125
|
+
* @returns Balance in MIST (smallest unit)
|
|
126
|
+
*/
|
|
127
|
+
async getBalance() {
|
|
128
|
+
const suiClient = this.services.config.sui?.client;
|
|
129
|
+
if (!suiClient) {
|
|
130
|
+
throw new Error('SuiClient not initialized');
|
|
131
|
+
}
|
|
132
|
+
const balance = await suiClient.getBalance({
|
|
133
|
+
owner: this.services.config.userAddress,
|
|
134
|
+
coinType: '0x2::sui::SUI',
|
|
135
|
+
});
|
|
136
|
+
return BigInt(balance.totalBalance);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Get formatted SUI balance
|
|
140
|
+
*
|
|
141
|
+
* @returns Balance in SUI (human readable)
|
|
142
|
+
*/
|
|
143
|
+
async getFormattedBalance() {
|
|
144
|
+
const balanceMist = await this.getBalance();
|
|
145
|
+
const balanceSui = Number(balanceMist) / 1000000000; // 1 SUI = 10^9 MIST
|
|
146
|
+
return `${balanceSui.toFixed(4)} SUI`;
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Sign a message with the connected wallet
|
|
150
|
+
*
|
|
151
|
+
* @param message - Message to sign (string or bytes)
|
|
152
|
+
* @returns Signature as hex string
|
|
153
|
+
*/
|
|
154
|
+
async signMessage(message) {
|
|
155
|
+
const signer = this.services.config.signer;
|
|
156
|
+
const messageBytes = typeof message === 'string'
|
|
157
|
+
? new TextEncoder().encode(message)
|
|
158
|
+
: message;
|
|
159
|
+
const result = await signer.signPersonalMessage(messageBytes);
|
|
160
|
+
// Result may have different shapes depending on signer type
|
|
161
|
+
if (typeof result === 'string') {
|
|
162
|
+
return result;
|
|
163
|
+
}
|
|
164
|
+
if (result && typeof result === 'object' && 'signature' in result) {
|
|
165
|
+
return result.signature;
|
|
166
|
+
}
|
|
167
|
+
throw new Error('Unexpected signature format');
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Get object by ID
|
|
171
|
+
*
|
|
172
|
+
* @param objectId - Object ID to fetch
|
|
173
|
+
* @returns Object data or null
|
|
174
|
+
*/
|
|
175
|
+
async getObject(objectId) {
|
|
176
|
+
const suiClient = this.services.config.sui?.client;
|
|
177
|
+
if (!suiClient) {
|
|
178
|
+
throw new Error('SuiClient not initialized');
|
|
179
|
+
}
|
|
180
|
+
try {
|
|
181
|
+
const response = await suiClient.getObject({
|
|
182
|
+
id: objectId,
|
|
183
|
+
options: {
|
|
184
|
+
showContent: true,
|
|
185
|
+
showOwner: true,
|
|
186
|
+
showType: true,
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
return response.data || null;
|
|
190
|
+
}
|
|
191
|
+
catch (error) {
|
|
192
|
+
console.error('Error fetching object:', error);
|
|
193
|
+
return null;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=WalletNamespace.js.map
|