@opendatalabs/vana-sdk 0.1.0-alpha.d6bebb0 → 0.1.0-alpha.d7fc764
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 +98 -36
- package/dist/browser.cjs +29 -0
- package/dist/browser.cjs.map +1 -0
- package/dist/browser.d.cts +2 -0
- package/dist/browser.d.ts +2 -0
- package/dist/browser.js +5 -0
- package/dist/browser.js.map +1 -0
- package/dist/chains/definitions.cjs +92 -0
- package/dist/chains/definitions.cjs.map +1 -0
- package/dist/chains/definitions.d.cts +53 -0
- package/dist/chains/definitions.d.ts +53 -0
- package/dist/chains/definitions.js +64 -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.cts +2 -0
- package/dist/chains/index.d.ts +2 -0
- package/dist/chains/index.js +15 -0
- package/dist/chains/index.js.map +1 -0
- package/dist/chains.browser.cjs +6 -65
- package/dist/chains.browser.cjs.map +1 -1
- package/dist/chains.browser.d.cts +2 -53
- package/dist/chains.browser.d.ts +2 -53
- 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.cts +1 -1
- package/dist/chains.d.ts +1 -1
- 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.cts +1 -1
- package/dist/chains.node.d.ts +1 -1
- package/dist/chains.node.js +7 -57
- package/dist/chains.node.js.map +1 -1
- package/dist/config/addresses.cjs +325 -0
- package/dist/config/addresses.cjs.map +1 -0
- package/dist/config/addresses.d.cts +380 -0
- package/dist/config/addresses.d.ts +380 -0
- package/dist/config/addresses.js +295 -0
- package/dist/config/addresses.js.map +1 -0
- package/dist/config/chains.cjs +93 -0
- package/dist/config/chains.cjs.map +1 -0
- package/dist/config/chains.d.cts +85 -0
- package/dist/config/chains.d.ts +85 -0
- package/dist/config/chains.js +67 -0
- package/dist/config/chains.js.map +1 -0
- package/dist/config/eventMappings.cjs +114 -0
- package/dist/config/eventMappings.cjs.map +1 -0
- package/dist/config/eventMappings.d.cts +108 -0
- package/dist/config/eventMappings.d.ts +108 -0
- package/dist/config/eventMappings.js +90 -0
- package/dist/config/eventMappings.js.map +1 -0
- package/dist/config/features.cjs +52 -0
- package/dist/config/features.cjs.map +1 -0
- package/dist/config/features.d.cts +64 -0
- package/dist/config/features.d.ts +64 -0
- package/dist/config/features.js +28 -0
- package/dist/config/features.js.map +1 -0
- package/dist/contracts/contractController.cjs +126 -0
- package/dist/contracts/contractController.cjs.map +1 -0
- package/dist/contracts/contractController.d.cts +96 -0
- package/dist/contracts/contractController.d.ts +96 -0
- package/dist/contracts/contractController.js +103 -0
- package/dist/contracts/contractController.js.map +1 -0
- package/dist/controllers/data.cjs +2239 -0
- package/dist/controllers/data.cjs.map +1 -0
- package/dist/controllers/data.d.cts +941 -0
- package/dist/controllers/data.d.ts +941 -0
- package/dist/controllers/data.js +2222 -0
- package/dist/controllers/data.js.map +1 -0
- package/dist/controllers/permissions.cjs +3726 -0
- package/dist/controllers/permissions.cjs.map +1 -0
- package/dist/controllers/permissions.d.cts +25 -0
- package/dist/controllers/permissions.d.ts +25 -0
- package/dist/controllers/permissions.js +3702 -0
- package/dist/controllers/permissions.js.map +1 -0
- package/dist/controllers/protocol.cjs +179 -0
- package/dist/controllers/protocol.cjs.map +1 -0
- package/dist/controllers/protocol.d.cts +167 -0
- package/dist/controllers/protocol.d.ts +167 -0
- package/dist/controllers/protocol.js +162 -0
- package/dist/controllers/protocol.js.map +1 -0
- package/dist/controllers/schemas.cjs +584 -0
- package/dist/controllers/schemas.cjs.map +1 -0
- package/dist/controllers/schemas.d.cts +272 -0
- package/dist/controllers/schemas.d.ts +272 -0
- package/dist/controllers/schemas.js +560 -0
- package/dist/controllers/schemas.js.map +1 -0
- package/dist/controllers/server.cjs +427 -0
- package/dist/controllers/server.cjs.map +1 -0
- package/dist/controllers/server.d.cts +243 -0
- package/dist/controllers/server.d.ts +243 -0
- package/dist/controllers/server.js +408 -0
- package/dist/controllers/server.js.map +1 -0
- package/dist/core/apiClient.cjs +325 -0
- package/dist/core/apiClient.cjs.map +1 -0
- package/dist/core/apiClient.d.cts +165 -0
- package/dist/core/apiClient.d.ts +165 -0
- package/dist/core/apiClient.js +309 -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.cts +92 -0
- package/dist/core/client.d.ts +92 -0
- package/dist/core/client.js +47 -0
- package/dist/core/client.js.map +1 -0
- package/dist/core/generics.cjs +388 -0
- package/dist/core/generics.cjs.map +1 -0
- package/dist/core/generics.d.cts +120 -0
- package/dist/core/generics.d.ts +120 -0
- package/dist/core/generics.js +366 -0
- package/dist/core/generics.js.map +1 -0
- package/dist/core.cjs +640 -0
- package/dist/core.cjs.map +1 -0
- package/dist/core.d.cts +466 -0
- package/dist/core.d.ts +466 -0
- package/dist/core.js +628 -0
- package/dist/core.js.map +1 -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.cts +40 -0
- package/dist/crypto/ecies/__tests__/test-vectors.d.ts +40 -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/base.cjs +231 -0
- package/dist/crypto/ecies/base.cjs.map +1 -0
- package/dist/crypto/ecies/base.d.cts +143 -0
- package/dist/crypto/ecies/base.d.ts +143 -0
- package/dist/crypto/ecies/base.js +211 -0
- package/dist/crypto/ecies/base.js.map +1 -0
- package/dist/crypto/ecies/browser.cjs +164 -0
- package/dist/crypto/ecies/browser.cjs.map +1 -0
- package/dist/crypto/ecies/browser.d.cts +48 -0
- package/dist/crypto/ecies/browser.d.ts +48 -0
- package/dist/crypto/ecies/browser.js +130 -0
- package/dist/crypto/ecies/browser.js.map +1 -0
- package/dist/crypto/ecies/constants.cjs +131 -0
- package/dist/crypto/ecies/constants.cjs.map +1 -0
- package/dist/crypto/ecies/constants.d.cts +122 -0
- package/dist/crypto/ecies/constants.d.ts +122 -0
- package/dist/crypto/ecies/constants.js +101 -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.cts +1 -0
- package/dist/crypto/ecies/index.d.ts +1 -0
- package/dist/crypto/ecies/index.js +13 -0
- package/dist/crypto/ecies/index.js.map +1 -0
- package/dist/crypto/ecies/interface.cjs +88 -0
- package/dist/crypto/ecies/interface.cjs.map +1 -0
- package/dist/crypto/ecies/interface.d.cts +176 -0
- package/dist/crypto/ecies/interface.d.ts +176 -0
- package/dist/crypto/ecies/interface.js +61 -0
- package/dist/crypto/ecies/interface.js.map +1 -0
- package/dist/crypto/ecies/node.cjs +166 -0
- package/dist/crypto/ecies/node.cjs.map +1 -0
- package/dist/crypto/ecies/node.d.cts +50 -0
- package/dist/crypto/ecies/node.d.ts +50 -0
- package/dist/crypto/ecies/node.js +144 -0
- package/dist/crypto/ecies/node.js.map +1 -0
- package/dist/crypto/ecies/utils.cjs +91 -0
- package/dist/crypto/ecies/utils.cjs.map +1 -0
- package/dist/crypto/ecies/utils.d.cts +67 -0
- package/dist/crypto/ecies/utils.d.ts +67 -0
- package/dist/crypto/ecies/utils.js +60 -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.cts +92 -0
- package/dist/crypto/services/WalletKeyEncryptionService.d.ts +92 -0
- package/dist/crypto/services/WalletKeyEncryptionService.js +112 -0
- package/dist/crypto/services/WalletKeyEncryptionService.js.map +1 -0
- package/dist/diagnostics.cjs +37 -0
- package/dist/diagnostics.cjs.map +1 -0
- package/dist/diagnostics.d.cts +26 -0
- package/dist/diagnostics.d.ts +26 -0
- package/dist/diagnostics.js +13 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/errors.cjs +141 -0
- package/dist/errors.cjs.map +1 -0
- package/dist/errors.d.cts +350 -0
- package/dist/errors.d.ts +350 -0
- package/dist/errors.js +108 -0
- package/dist/errors.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.cts +996 -0
- package/dist/generated/abi/ComputeEngineImplementation.d.ts +996 -0
- package/dist/generated/abi/ComputeEngineImplementation.js +1289 -0
- package/dist/generated/abi/ComputeEngineImplementation.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.cts +545 -0
- package/dist/generated/abi/ComputeInstructionRegistryImplementation.d.ts +545 -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.cts +661 -0
- package/dist/generated/abi/DATFactoryImplementation.d.ts +661 -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.cts +693 -0
- package/dist/generated/abi/DATImplementation.d.ts +693 -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.cts +1145 -0
- package/dist/generated/abi/DATPausableImplementation.d.ts +1145 -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.cts +1095 -0
- package/dist/generated/abi/DATVotesImplementation.d.ts +1095 -0
- package/dist/generated/abi/DATVotesImplementation.js +1436 -0
- package/dist/generated/abi/DATVotesImplementation.js.map +1 -0
- package/dist/generated/abi/DLPPerformanceImplementation.cjs +1160 -0
- package/dist/generated/abi/DLPPerformanceImplementation.cjs.map +1 -0
- package/dist/generated/abi/DLPPerformanceImplementation.d.cts +883 -0
- package/dist/generated/abi/DLPPerformanceImplementation.d.ts +883 -0
- package/dist/generated/abi/DLPPerformanceImplementation.js +1136 -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.cts +1123 -0
- package/dist/generated/abi/DLPRegistryImplementation.d.ts +1123 -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.cts +452 -0
- package/dist/generated/abi/DLPRegistryTreasuryImplementation.d.ts +452 -0
- package/dist/generated/abi/DLPRegistryTreasuryImplementation.js +588 -0
- package/dist/generated/abi/DLPRegistryTreasuryImplementation.js.map +1 -0
- package/dist/generated/abi/DLPRewardDeployerImplementation.cjs +948 -0
- package/dist/generated/abi/DLPRewardDeployerImplementation.cjs.map +1 -0
- package/dist/generated/abi/DLPRewardDeployerImplementation.d.cts +714 -0
- package/dist/generated/abi/DLPRewardDeployerImplementation.d.ts +714 -0
- package/dist/generated/abi/DLPRewardDeployerImplementation.js +924 -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.cts +452 -0
- package/dist/generated/abi/DLPRewardDeployerTreasuryImplementation.d.ts +452 -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.cts +706 -0
- package/dist/generated/abi/DLPRewardSwapImplementation.d.ts +706 -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.cts +1248 -0
- package/dist/generated/abi/DLPRootImplementation.d.ts +1248 -0
- package/dist/generated/abi/DLPRootImplementation.js +1620 -0
- package/dist/generated/abi/DLPRootImplementation.js.map +1 -0
- package/dist/generated/abi/DLPTreasuryImplementation.cjs +612 -0
- package/dist/generated/abi/DLPTreasuryImplementation.cjs.map +1 -0
- package/dist/generated/abi/DLPTreasuryImplementation.d.cts +452 -0
- package/dist/generated/abi/DLPTreasuryImplementation.d.ts +452 -0
- package/dist/generated/abi/DLPTreasuryImplementation.js +588 -0
- package/dist/generated/abi/DLPTreasuryImplementation.js.map +1 -0
- package/dist/generated/abi/DataLiquidityPoolImplementation.cjs +985 -0
- package/dist/generated/abi/DataLiquidityPoolImplementation.cjs.map +1 -0
- package/dist/generated/abi/DataLiquidityPoolImplementation.d.cts +737 -0
- package/dist/generated/abi/DataLiquidityPoolImplementation.d.ts +737 -0
- package/dist/generated/abi/DataLiquidityPoolImplementation.js +961 -0
- package/dist/generated/abi/DataLiquidityPoolImplementation.js.map +1 -0
- package/dist/generated/abi/DataPortabilityGranteesImplementation.cjs +888 -0
- package/dist/generated/abi/DataPortabilityGranteesImplementation.cjs.map +1 -0
- package/dist/generated/abi/DataPortabilityGranteesImplementation.d.cts +661 -0
- package/dist/generated/abi/DataPortabilityGranteesImplementation.d.ts +661 -0
- package/dist/generated/abi/DataPortabilityGranteesImplementation.js +864 -0
- package/dist/generated/abi/DataPortabilityGranteesImplementation.js.map +1 -0
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.cjs +1317 -0
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.cjs.map +1 -0
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.d.cts +989 -0
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.d.ts +989 -0
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.js +1293 -0
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.js.map +1 -0
- package/dist/generated/abi/DataPortabilityServersImplementation.cjs +1438 -0
- package/dist/generated/abi/DataPortabilityServersImplementation.cjs.map +1 -0
- package/dist/generated/abi/DataPortabilityServersImplementation.d.cts +1086 -0
- package/dist/generated/abi/DataPortabilityServersImplementation.d.ts +1086 -0
- package/dist/generated/abi/DataPortabilityServersImplementation.js +1414 -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.cts +737 -0
- package/dist/generated/abi/DataRefinerRegistryImplementation.d.ts +737 -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.cts +1004 -0
- package/dist/generated/abi/DataRegistryImplementation.d.ts +1004 -0
- package/dist/generated/abi/DataRegistryImplementation.js +1304 -0
- package/dist/generated/abi/DataRegistryImplementation.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.cts +1001 -0
- package/dist/generated/abi/QueryEngineImplementation.d.ts +1001 -0
- package/dist/generated/abi/QueryEngineImplementation.js +1295 -0
- package/dist/generated/abi/QueryEngineImplementation.js.map +1 -0
- package/dist/generated/abi/SwapHelperImplementation.cjs +1019 -0
- package/dist/generated/abi/SwapHelperImplementation.cjs.map +1 -0
- package/dist/generated/abi/SwapHelperImplementation.d.cts +764 -0
- package/dist/generated/abi/SwapHelperImplementation.d.ts +764 -0
- package/dist/generated/abi/SwapHelperImplementation.js +995 -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.cts +701 -0
- package/dist/generated/abi/TeePoolDedicatedGpuImplementation.d.ts +701 -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.cts +701 -0
- package/dist/generated/abi/TeePoolDedicatedStandardImplementation.d.ts +701 -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.cts +701 -0
- package/dist/generated/abi/TeePoolEphemeralStandardImplementation.d.ts +701 -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.cts +993 -0
- package/dist/generated/abi/TeePoolImplementation.d.ts +993 -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.cts +701 -0
- package/dist/generated/abi/TeePoolPersistentGpuImplementation.d.ts +701 -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.cts +701 -0
- package/dist/generated/abi/TeePoolPersistentStandardImplementation.d.ts +701 -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.cts +993 -0
- package/dist/generated/abi/TeePoolPhalaImplementation.d.ts +993 -0
- package/dist/generated/abi/TeePoolPhalaImplementation.js +1289 -0
- package/dist/generated/abi/TeePoolPhalaImplementation.js.map +1 -0
- package/dist/generated/abi/VanaEpochImplementation.cjs +1188 -0
- package/dist/generated/abi/VanaEpochImplementation.cjs.map +1 -0
- package/dist/generated/abi/VanaEpochImplementation.d.cts +900 -0
- package/dist/generated/abi/VanaEpochImplementation.d.ts +900 -0
- package/dist/generated/abi/VanaEpochImplementation.js +1164 -0
- package/dist/generated/abi/VanaEpochImplementation.js.map +1 -0
- package/dist/generated/abi/VanaPoolEntityImplementation.cjs +1234 -0
- package/dist/generated/abi/VanaPoolEntityImplementation.cjs.map +1 -0
- package/dist/generated/abi/VanaPoolEntityImplementation.d.cts +934 -0
- package/dist/generated/abi/VanaPoolEntityImplementation.d.ts +934 -0
- package/dist/generated/abi/VanaPoolEntityImplementation.js +1210 -0
- package/dist/generated/abi/VanaPoolEntityImplementation.js.map +1 -0
- package/dist/generated/abi/VanaPoolStakingImplementation.cjs +921 -0
- package/dist/generated/abi/VanaPoolStakingImplementation.cjs.map +1 -0
- package/dist/generated/abi/VanaPoolStakingImplementation.d.cts +693 -0
- package/dist/generated/abi/VanaPoolStakingImplementation.d.ts +693 -0
- package/dist/generated/abi/VanaPoolStakingImplementation.js +897 -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.cts +394 -0
- package/dist/generated/abi/VanaPoolTreasuryImplementation.d.ts +394 -0
- package/dist/generated/abi/VanaPoolTreasuryImplementation.js +514 -0
- package/dist/generated/abi/VanaPoolTreasuryImplementation.js.map +1 -0
- package/dist/generated/abi/index.cjs +135 -0
- package/dist/generated/abi/index.cjs.map +1 -0
- package/dist/generated/abi/index.d.cts +26516 -0
- package/dist/generated/abi/index.d.ts +26516 -0
- package/dist/generated/abi/index.js +99 -0
- package/dist/generated/abi/index.js.map +1 -0
- package/dist/generated/server/server-exports.cjs +23 -0
- package/dist/generated/server/server-exports.cjs.map +1 -0
- package/dist/generated/server/server-exports.d.cts +21 -0
- package/dist/generated/server/server-exports.d.ts +21 -0
- package/dist/generated/server/server-exports.js +2 -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.cts +512 -0
- package/dist/generated/server/server.d.ts +512 -0
- package/dist/generated/server/server.js +1 -0
- package/dist/generated/server/server.js.map +1 -0
- package/dist/generated/subgraph.cjs +675 -0
- package/dist/generated/subgraph.cjs.map +1 -0
- package/dist/generated/subgraph.d.cts +5981 -0
- package/dist/generated/subgraph.d.ts +5981 -0
- package/dist/generated/subgraph.js +644 -0
- package/dist/generated/subgraph.js.map +1 -0
- package/dist/index.browser.cjs +151 -0
- package/dist/index.browser.cjs.map +1 -0
- package/dist/index.browser.d.cts +177 -0
- package/dist/index.browser.d.ts +67 -33072
- package/dist/index.browser.js +64 -41112
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +3 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/index.node.cjs +87 -41558
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.cts +63 -33314
- package/dist/index.node.d.ts +63 -33314
- package/dist/index.node.js +68 -41448
- package/dist/index.node.js.map +1 -1
- package/dist/node.cjs +29 -0
- package/dist/node.cjs.map +1 -0
- package/dist/node.d.cts +2 -0
- package/dist/node.d.ts +2 -0
- package/dist/node.js +5 -0
- package/dist/node.js.map +1 -0
- package/dist/permissions-DNKPu_G0.d.cts +1666 -0
- package/dist/permissions-eo8YeLGf.d.ts +1666 -0
- package/dist/platform/browser-only.cjs +37 -0
- package/dist/platform/browser-only.cjs.map +1 -0
- package/dist/platform/browser-only.d.cts +25 -0
- package/dist/platform/browser-only.d.ts +25 -0
- package/dist/platform/browser-only.js +12 -0
- package/dist/platform/browser-only.js.map +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.cts +32 -0
- package/dist/platform/browser-safe.d.ts +32 -0
- package/dist/platform/browser-safe.js +31 -0
- package/dist/platform/browser-safe.js.map +1 -0
- package/dist/platform/browser.cjs +329 -0
- package/dist/platform/browser.cjs.map +1 -0
- package/dist/platform/browser.d.cts +74 -0
- package/dist/platform/browser.d.ts +74 -0
- package/dist/platform/browser.js +304 -0
- package/dist/platform/browser.js.map +1 -0
- package/dist/platform/index.cjs +50 -0
- package/dist/platform/index.cjs.map +1 -0
- package/dist/platform/index.d.cts +5 -0
- package/dist/platform/index.d.ts +5 -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.cts +218 -0
- package/dist/platform/interface.d.ts +218 -0
- package/dist/platform/interface.js +1 -0
- package/dist/platform/interface.js.map +1 -0
- package/dist/platform/node.cjs +351 -0
- package/dist/platform/node.cjs.map +1 -0
- package/dist/platform/node.d.cts +27 -0
- package/dist/platform/node.d.ts +27 -0
- package/dist/platform/node.js +327 -0
- package/dist/platform/node.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.cts +25 -0
- package/dist/platform/shared/error-utils.d.ts +25 -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.cts +61 -0
- package/dist/platform/shared/pgp-utils.d.ts +61 -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.cts +16 -0
- package/dist/platform/shared/stream-utils.d.ts +16 -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.cts +53 -0
- package/dist/platform/utils.d.ts +53 -0
- package/dist/platform/utils.js +76 -0
- package/dist/platform/utils.js.map +1 -0
- package/dist/platform.browser.cjs +41 -0
- package/dist/platform.browser.cjs.map +1 -0
- package/dist/platform.browser.d.cts +4 -0
- package/dist/platform.browser.d.ts +4 -259
- package/dist/platform.browser.js +10 -309
- package/dist/platform.browser.js.map +1 -1
- package/dist/platform.cjs +14 -623
- package/dist/platform.cjs.map +1 -1
- package/dist/platform.d.cts +5 -1
- package/dist/platform.d.ts +5 -1
- package/dist/platform.js +14 -609
- package/dist/platform.js.map +1 -1
- package/dist/platform.node.cjs +14 -623
- package/dist/platform.node.cjs.map +1 -1
- package/dist/platform.node.d.cts +5 -299
- package/dist/platform.node.d.ts +5 -299
- package/dist/platform.node.js +14 -609
- package/dist/platform.node.js.map +1 -1
- package/dist/server/handler.cjs +101 -0
- package/dist/server/handler.cjs.map +1 -0
- package/dist/server/handler.d.cts +282 -0
- package/dist/server/handler.d.ts +282 -0
- package/dist/server/handler.js +77 -0
- package/dist/server/handler.js.map +1 -0
- package/dist/storage/index.cjs +44 -0
- package/dist/storage/index.cjs.map +1 -0
- package/dist/storage/index.d.cts +10 -0
- package/dist/storage/index.d.ts +10 -0
- package/dist/storage/index.js +15 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/manager.cjs +189 -0
- package/dist/storage/manager.cjs.map +1 -0
- package/dist/storage/manager.d.cts +150 -0
- package/dist/storage/manager.d.ts +150 -0
- package/dist/storage/manager.js +172 -0
- package/dist/storage/manager.js.map +1 -0
- package/dist/storage/providers/callback-storage.cjs +177 -0
- package/dist/storage/providers/callback-storage.cjs.map +1 -0
- package/dist/storage/providers/callback-storage.d.cts +100 -0
- package/dist/storage/providers/callback-storage.d.ts +100 -0
- package/dist/storage/providers/callback-storage.js +155 -0
- package/dist/storage/providers/callback-storage.js.map +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.cts +156 -0
- package/dist/storage/providers/google-drive.d.ts +156 -0
- package/dist/storage/providers/google-drive.js +497 -0
- package/dist/storage/providers/google-drive.js.map +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.cts +163 -0
- package/dist/storage/providers/ipfs.d.ts +163 -0
- package/dist/storage/providers/ipfs.js +264 -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.cts +173 -0
- package/dist/storage/providers/pinata.d.ts +173 -0
- package/dist/storage/providers/pinata.js +320 -0
- package/dist/storage/providers/pinata.js.map +1 -0
- package/dist/types/chains.cjs +36 -0
- package/dist/types/chains.cjs.map +1 -0
- package/dist/types/chains.d.cts +34 -0
- package/dist/types/chains.d.ts +34 -0
- package/dist/types/chains.js +11 -0
- package/dist/types/chains.js.map +1 -0
- package/dist/types/config.cjs +41 -0
- package/dist/types/config.cjs.map +1 -0
- package/dist/types/config.d.cts +726 -0
- package/dist/types/config.d.ts +726 -0
- package/dist/types/config.js +15 -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.cts +68 -0
- package/dist/types/contracts.d.ts +68 -0
- package/dist/types/contracts.js +1 -0
- package/dist/types/contracts.js.map +1 -0
- package/dist/types/data.cjs +17 -0
- package/dist/types/data.cjs.map +1 -0
- package/dist/types/data.d.cts +694 -0
- package/dist/types/data.d.ts +694 -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.d.cts +13 -0
- package/dist/types/eccrypto-js.d.d.ts +13 -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.cts +186 -0
- package/dist/types/external-apis.d.ts +186 -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.cts +450 -0
- package/dist/types/generics.d.ts +450 -0
- package/dist/types/generics.js +1 -0
- package/dist/types/generics.js.map +1 -0
- package/dist/types/index.cjs +64 -0
- package/dist/types/index.cjs.map +1 -0
- package/dist/types/index.d.cts +34 -0
- package/dist/types/index.d.ts +34 -0
- package/dist/types/index.js +35 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/operations.cjs +65 -0
- package/dist/types/operations.cjs.map +1 -0
- package/dist/types/operations.d.cts +108 -0
- package/dist/types/operations.d.ts +108 -0
- package/dist/types/operations.js +37 -0
- package/dist/types/operations.js.map +1 -0
- package/dist/types/permissions.cjs +17 -0
- package/dist/types/permissions.cjs.map +1 -0
- package/dist/types/permissions.d.cts +957 -0
- package/dist/types/permissions.d.ts +957 -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.cts +40 -0
- package/dist/types/personal.d.ts +40 -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.cts +284 -0
- package/dist/types/relayer.d.ts +284 -0
- package/dist/types/relayer.js +1 -0
- package/dist/types/relayer.js.map +1 -0
- package/dist/types/storage.cjs +39 -0
- package/dist/types/storage.cjs.map +1 -0
- package/dist/types/storage.d.cts +131 -0
- package/dist/types/storage.d.ts +131 -0
- package/dist/types/storage.js +18 -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.cts +25 -0
- package/dist/types/transactionResults.d.ts +25 -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.cts +819 -0
- package/dist/types/utils.d.ts +819 -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.cts +66 -0
- package/dist/types.d.ts +66 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/blockchain/registry.cjs +81 -0
- package/dist/utils/blockchain/registry.cjs.map +1 -0
- package/dist/utils/blockchain/registry.d.cts +34 -0
- package/dist/utils/blockchain/registry.d.ts +34 -0
- package/dist/utils/blockchain/registry.js +56 -0
- package/dist/utils/blockchain/registry.js.map +1 -0
- package/dist/utils/crypto-utils.cjs +120 -0
- package/dist/utils/crypto-utils.cjs.map +1 -0
- package/dist/utils/crypto-utils.d.cts +118 -0
- package/dist/utils/crypto-utils.d.ts +118 -0
- package/dist/utils/crypto-utils.js +87 -0
- package/dist/utils/crypto-utils.js.map +1 -0
- package/dist/utils/download.cjs +69 -0
- package/dist/utils/download.cjs.map +1 -0
- package/dist/utils/download.d.cts +41 -0
- package/dist/utils/download.d.ts +41 -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.cts +54 -0
- package/dist/utils/encoding.d.ts +54 -0
- package/dist/utils/encoding.js +39 -0
- package/dist/utils/encoding.js.map +1 -0
- package/dist/utils/encryption.cjs +170 -0
- package/dist/utils/encryption.cjs.map +1 -0
- package/dist/utils/encryption.d.cts +275 -0
- package/dist/utils/encryption.d.ts +275 -0
- package/dist/utils/encryption.js +136 -0
- package/dist/utils/encryption.js.map +1 -0
- package/dist/utils/eventParsing.cjs +111 -0
- package/dist/utils/eventParsing.cjs.map +1 -0
- package/dist/utils/eventParsing.d.cts +60 -0
- package/dist/utils/eventParsing.d.ts +60 -0
- package/dist/utils/eventParsing.js +86 -0
- package/dist/utils/eventParsing.js.map +1 -0
- package/dist/utils/formatters.cjs +53 -0
- package/dist/utils/formatters.cjs.map +1 -0
- package/dist/utils/formatters.d.cts +120 -0
- package/dist/utils/formatters.d.ts +120 -0
- package/dist/utils/formatters.js +26 -0
- package/dist/utils/formatters.js.map +1 -0
- package/dist/utils/grantFiles.cjs +175 -0
- package/dist/utils/grantFiles.cjs.map +1 -0
- package/dist/utils/grantFiles.d.cts +186 -0
- package/dist/utils/grantFiles.d.ts +186 -0
- package/dist/utils/grantFiles.js +137 -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.cts +150 -0
- package/dist/utils/grantValidation.d.ts +150 -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.cts +70 -0
- package/dist/utils/grants.d.ts +70 -0
- package/dist/utils/grants.js +82 -0
- package/dist/utils/grants.js.map +1 -0
- package/dist/utils/ipfs.cjs +130 -0
- package/dist/utils/ipfs.cjs.map +1 -0
- package/dist/utils/ipfs.d.cts +90 -0
- package/dist/utils/ipfs.d.ts +90 -0
- package/dist/utils/ipfs.js +99 -0
- package/dist/utils/ipfs.js.map +1 -0
- package/dist/utils/lazy-import.cjs +40 -0
- package/dist/utils/lazy-import.cjs.map +1 -0
- package/dist/utils/lazy-import.d.cts +20 -0
- package/dist/utils/lazy-import.d.ts +20 -0
- package/dist/utils/lazy-import.js +16 -0
- package/dist/utils/lazy-import.js.map +1 -0
- package/dist/utils/multicall.cjs +231 -0
- package/dist/utils/multicall.cjs.map +1 -0
- package/dist/utils/multicall.d.cts +129 -0
- package/dist/utils/multicall.d.ts +129 -0
- package/dist/utils/multicall.js +206 -0
- package/dist/utils/multicall.js.map +1 -0
- package/dist/utils/schemaValidation.cjs +258 -0
- package/dist/utils/schemaValidation.cjs.map +1 -0
- package/dist/utils/schemaValidation.d.cts +172 -0
- package/dist/utils/schemaValidation.d.ts +172 -0
- package/dist/utils/schemaValidation.js +222 -0
- package/dist/utils/schemaValidation.js.map +1 -0
- package/dist/utils/signatureCache.cjs +187 -0
- package/dist/utils/signatureCache.cjs.map +1 -0
- package/dist/utils/signatureCache.d.cts +134 -0
- package/dist/utils/signatureCache.d.ts +134 -0
- package/dist/utils/signatureCache.js +165 -0
- package/dist/utils/signatureCache.js.map +1 -0
- package/dist/utils/signatureFormatter.cjs +45 -0
- package/dist/utils/signatureFormatter.cjs.map +1 -0
- package/dist/utils/signatureFormatter.d.cts +39 -0
- package/dist/utils/signatureFormatter.d.ts +39 -0
- package/dist/utils/signatureFormatter.js +21 -0
- package/dist/utils/signatureFormatter.js.map +1 -0
- package/dist/utils/transactionParsing.cjs +84 -0
- package/dist/utils/transactionParsing.cjs.map +1 -0
- package/dist/utils/transactionParsing.d.cts +25 -0
- package/dist/utils/transactionParsing.d.ts +25 -0
- package/dist/utils/transactionParsing.js +62 -0
- package/dist/utils/transactionParsing.js.map +1 -0
- package/dist/utils/typedDataConverter.cjs +43 -0
- package/dist/utils/typedDataConverter.cjs.map +1 -0
- package/dist/utils/typedDataConverter.d.cts +13 -0
- package/dist/utils/typedDataConverter.d.ts +13 -0
- package/dist/utils/typedDataConverter.js +19 -0
- package/dist/utils/typedDataConverter.js.map +1 -0
- package/dist/utils/urlResolver.cjs +55 -0
- package/dist/utils/urlResolver.cjs.map +1 -0
- package/dist/utils/urlResolver.d.cts +40 -0
- package/dist/utils/urlResolver.d.ts +40 -0
- package/dist/utils/urlResolver.js +30 -0
- package/dist/utils/urlResolver.js.map +1 -0
- package/package.json +54 -27
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { StorageProvider, StorageUploadResult, StorageListOptions, StorageFile, StorageProviderConfig } from '../../types/storage.cjs';
|
|
2
|
+
|
|
3
|
+
interface PinataConfig {
|
|
4
|
+
/** Pinata JWT token for authentication */
|
|
5
|
+
jwt: string;
|
|
6
|
+
/** Optional custom gateway URL (defaults to https://gateway.pinata.cloud) */
|
|
7
|
+
gatewayUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
interface PinataListQuery {
|
|
10
|
+
/** Maximum number of results to return */
|
|
11
|
+
limit?: number;
|
|
12
|
+
/** Offset for pagination */
|
|
13
|
+
offset?: number;
|
|
14
|
+
/** Filter by name pattern */
|
|
15
|
+
namePattern?: string;
|
|
16
|
+
}
|
|
17
|
+
interface PinataFile {
|
|
18
|
+
/** Pin identifier */
|
|
19
|
+
id: string;
|
|
20
|
+
/** File name */
|
|
21
|
+
name: string;
|
|
22
|
+
/** IPFS CID */
|
|
23
|
+
cid: string;
|
|
24
|
+
/** File size in bytes */
|
|
25
|
+
size: number;
|
|
26
|
+
/** Creation timestamp */
|
|
27
|
+
createdAt: Date;
|
|
28
|
+
/** Optional metadata */
|
|
29
|
+
metadata?: object;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Provides managed IPFS storage with full-featured API via Pinata
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* This provider uses Pinata's enhanced IPFS service, which extends standard IPFS
|
|
36
|
+
* with additional features like file listing, deletion (unpinning), and rich metadata.
|
|
37
|
+
* It's the "it just works" solution for developers who want full CRUD operations
|
|
38
|
+
* on IPFS without managing infrastructure.
|
|
39
|
+
*
|
|
40
|
+
* @category Storage
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* const pinataStorage = new PinataStorage({
|
|
45
|
+
* jwt: "your-pinata-jwt-token"
|
|
46
|
+
* });
|
|
47
|
+
*
|
|
48
|
+
* // Upload with metadata
|
|
49
|
+
* const cid = await pinataStorage.upload(fileBlob, {
|
|
50
|
+
* name: "user-avatar.png",
|
|
51
|
+
* metadata: { userId: "123", category: "avatar" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* // List files with query
|
|
55
|
+
* const files = await pinataStorage.list({ limit: 10 });
|
|
56
|
+
*
|
|
57
|
+
* // Delete file
|
|
58
|
+
* await pinataStorage.delete(cid);
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
declare class PinataStorage implements StorageProvider {
|
|
62
|
+
private config;
|
|
63
|
+
private readonly apiUrl;
|
|
64
|
+
private readonly gatewayUrl;
|
|
65
|
+
constructor(config: PinataConfig);
|
|
66
|
+
/**
|
|
67
|
+
* Uploads a file to IPFS via Pinata and returns the CID
|
|
68
|
+
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* This method uploads the file to Pinata's IPFS service with enhanced metadata support.
|
|
71
|
+
* The file is pinned to ensure availability and can include custom metadata for
|
|
72
|
+
* organization and querying. The metadata is stored alongside the file for later retrieval.
|
|
73
|
+
*
|
|
74
|
+
* @param file - The file to upload to IPFS
|
|
75
|
+
* @param filename - Optional custom filename
|
|
76
|
+
* @returns Promise that resolves to the IPFS CID (content identifier)
|
|
77
|
+
* @throws {StorageError} When the upload fails or no CID is returned
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const cid = await pinataStorage.upload(fileBlob, {
|
|
82
|
+
* name: "user-document.pdf",
|
|
83
|
+
* metadata: {
|
|
84
|
+
* userId: "user-123",
|
|
85
|
+
* category: "documents",
|
|
86
|
+
* uploadDate: new Date().toISOString()
|
|
87
|
+
* }
|
|
88
|
+
* });
|
|
89
|
+
* console.log("File pinned to IPFS:", cid);
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
upload(file: Blob, filename?: string): Promise<StorageUploadResult>;
|
|
93
|
+
download(cid: string): Promise<Blob>;
|
|
94
|
+
/**
|
|
95
|
+
* Lists files uploaded to Pinata with optional filtering
|
|
96
|
+
*
|
|
97
|
+
* @remarks
|
|
98
|
+
* This method retrieves a list of files that have been uploaded to Pinata,
|
|
99
|
+
* filtered to only include files uploaded by the Vana SDK. You can further
|
|
100
|
+
* filter results by name pattern, limit results, or paginate through them.
|
|
101
|
+
*
|
|
102
|
+
* @param options - Optional query parameters for filtering and pagination
|
|
103
|
+
* @param options.limit - Maximum number of results to return (default: 10)
|
|
104
|
+
* @param options.offset - Number of results to skip for pagination
|
|
105
|
+
* @param options.namePattern - Filter files by name pattern
|
|
106
|
+
* @returns Promise that resolves to an array of PinataFile objects
|
|
107
|
+
* @throws {StorageError} When the list operation fails
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* // List all files
|
|
112
|
+
* const allFiles = await pinataStorage.list();
|
|
113
|
+
*
|
|
114
|
+
* // List with pagination and filtering
|
|
115
|
+
* const filteredFiles = await pinataStorage.list({
|
|
116
|
+
* limit: 20,
|
|
117
|
+
* offset: 10,
|
|
118
|
+
* namePattern: "document"
|
|
119
|
+
* });
|
|
120
|
+
*
|
|
121
|
+
* filteredFiles.forEach(file => {
|
|
122
|
+
* console.log(`${file.name} (${file.size} bytes): ${file.cid}`);
|
|
123
|
+
* });
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
list(options?: StorageListOptions): Promise<StorageFile[]>;
|
|
127
|
+
/**
|
|
128
|
+
* Deletes a file from Pinata by unpinning it from IPFS
|
|
129
|
+
*
|
|
130
|
+
* @remarks
|
|
131
|
+
* This method removes the file from your Pinata account by unpinning it,
|
|
132
|
+
* which means it will no longer be guaranteed to be available on the IPFS network.
|
|
133
|
+
* Note that if the file is pinned elsewhere or cached by other nodes, it may still
|
|
134
|
+
* be accessible for some time.
|
|
135
|
+
*
|
|
136
|
+
* @param url - The IPFS URL or content identifier of the file to delete
|
|
137
|
+
* @returns Promise that resolves when the file is successfully unpinned
|
|
138
|
+
* @throws {StorageError} When the deletion fails or CID format is invalid
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```typescript
|
|
142
|
+
* // Delete a file by CID
|
|
143
|
+
* await pinataStorage.delete("QmTzQ1JRkWErjk39mryYw2WVrgBMe2B36gRq8GCL8qCACj");
|
|
144
|
+
* console.log("File unpinned from Pinata");
|
|
145
|
+
*
|
|
146
|
+
* // Delete after listing
|
|
147
|
+
* const files = await pinataStorage.list();
|
|
148
|
+
* for (const file of files) {
|
|
149
|
+
* if (file.name.includes("temp")) {
|
|
150
|
+
* await pinataStorage.delete(file.cid);
|
|
151
|
+
* }
|
|
152
|
+
* }
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
delete(url: string): Promise<boolean>;
|
|
156
|
+
getConfig(): StorageProviderConfig;
|
|
157
|
+
/**
|
|
158
|
+
* Extract CID from URL or return as-is
|
|
159
|
+
*
|
|
160
|
+
* @param url - URL or CID string
|
|
161
|
+
* @returns CID string
|
|
162
|
+
*/
|
|
163
|
+
private extractCidFromUrl;
|
|
164
|
+
/**
|
|
165
|
+
* Basic CID validation
|
|
166
|
+
*
|
|
167
|
+
* @param cid - Content identifier to validate
|
|
168
|
+
* @returns True if CID appears valid
|
|
169
|
+
*/
|
|
170
|
+
private isValidCID;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export { type PinataConfig, type PinataFile, type PinataListQuery, PinataStorage };
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { StorageProvider, StorageUploadResult, StorageListOptions, StorageFile, StorageProviderConfig } from '../../types/storage.js';
|
|
2
|
+
|
|
3
|
+
interface PinataConfig {
|
|
4
|
+
/** Pinata JWT token for authentication */
|
|
5
|
+
jwt: string;
|
|
6
|
+
/** Optional custom gateway URL (defaults to https://gateway.pinata.cloud) */
|
|
7
|
+
gatewayUrl?: string;
|
|
8
|
+
}
|
|
9
|
+
interface PinataListQuery {
|
|
10
|
+
/** Maximum number of results to return */
|
|
11
|
+
limit?: number;
|
|
12
|
+
/** Offset for pagination */
|
|
13
|
+
offset?: number;
|
|
14
|
+
/** Filter by name pattern */
|
|
15
|
+
namePattern?: string;
|
|
16
|
+
}
|
|
17
|
+
interface PinataFile {
|
|
18
|
+
/** Pin identifier */
|
|
19
|
+
id: string;
|
|
20
|
+
/** File name */
|
|
21
|
+
name: string;
|
|
22
|
+
/** IPFS CID */
|
|
23
|
+
cid: string;
|
|
24
|
+
/** File size in bytes */
|
|
25
|
+
size: number;
|
|
26
|
+
/** Creation timestamp */
|
|
27
|
+
createdAt: Date;
|
|
28
|
+
/** Optional metadata */
|
|
29
|
+
metadata?: object;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Provides managed IPFS storage with full-featured API via Pinata
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* This provider uses Pinata's enhanced IPFS service, which extends standard IPFS
|
|
36
|
+
* with additional features like file listing, deletion (unpinning), and rich metadata.
|
|
37
|
+
* It's the "it just works" solution for developers who want full CRUD operations
|
|
38
|
+
* on IPFS without managing infrastructure.
|
|
39
|
+
*
|
|
40
|
+
* @category Storage
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* const pinataStorage = new PinataStorage({
|
|
45
|
+
* jwt: "your-pinata-jwt-token"
|
|
46
|
+
* });
|
|
47
|
+
*
|
|
48
|
+
* // Upload with metadata
|
|
49
|
+
* const cid = await pinataStorage.upload(fileBlob, {
|
|
50
|
+
* name: "user-avatar.png",
|
|
51
|
+
* metadata: { userId: "123", category: "avatar" }
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* // List files with query
|
|
55
|
+
* const files = await pinataStorage.list({ limit: 10 });
|
|
56
|
+
*
|
|
57
|
+
* // Delete file
|
|
58
|
+
* await pinataStorage.delete(cid);
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
declare class PinataStorage implements StorageProvider {
|
|
62
|
+
private config;
|
|
63
|
+
private readonly apiUrl;
|
|
64
|
+
private readonly gatewayUrl;
|
|
65
|
+
constructor(config: PinataConfig);
|
|
66
|
+
/**
|
|
67
|
+
* Uploads a file to IPFS via Pinata and returns the CID
|
|
68
|
+
*
|
|
69
|
+
* @remarks
|
|
70
|
+
* This method uploads the file to Pinata's IPFS service with enhanced metadata support.
|
|
71
|
+
* The file is pinned to ensure availability and can include custom metadata for
|
|
72
|
+
* organization and querying. The metadata is stored alongside the file for later retrieval.
|
|
73
|
+
*
|
|
74
|
+
* @param file - The file to upload to IPFS
|
|
75
|
+
* @param filename - Optional custom filename
|
|
76
|
+
* @returns Promise that resolves to the IPFS CID (content identifier)
|
|
77
|
+
* @throws {StorageError} When the upload fails or no CID is returned
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const cid = await pinataStorage.upload(fileBlob, {
|
|
82
|
+
* name: "user-document.pdf",
|
|
83
|
+
* metadata: {
|
|
84
|
+
* userId: "user-123",
|
|
85
|
+
* category: "documents",
|
|
86
|
+
* uploadDate: new Date().toISOString()
|
|
87
|
+
* }
|
|
88
|
+
* });
|
|
89
|
+
* console.log("File pinned to IPFS:", cid);
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
upload(file: Blob, filename?: string): Promise<StorageUploadResult>;
|
|
93
|
+
download(cid: string): Promise<Blob>;
|
|
94
|
+
/**
|
|
95
|
+
* Lists files uploaded to Pinata with optional filtering
|
|
96
|
+
*
|
|
97
|
+
* @remarks
|
|
98
|
+
* This method retrieves a list of files that have been uploaded to Pinata,
|
|
99
|
+
* filtered to only include files uploaded by the Vana SDK. You can further
|
|
100
|
+
* filter results by name pattern, limit results, or paginate through them.
|
|
101
|
+
*
|
|
102
|
+
* @param options - Optional query parameters for filtering and pagination
|
|
103
|
+
* @param options.limit - Maximum number of results to return (default: 10)
|
|
104
|
+
* @param options.offset - Number of results to skip for pagination
|
|
105
|
+
* @param options.namePattern - Filter files by name pattern
|
|
106
|
+
* @returns Promise that resolves to an array of PinataFile objects
|
|
107
|
+
* @throws {StorageError} When the list operation fails
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* // List all files
|
|
112
|
+
* const allFiles = await pinataStorage.list();
|
|
113
|
+
*
|
|
114
|
+
* // List with pagination and filtering
|
|
115
|
+
* const filteredFiles = await pinataStorage.list({
|
|
116
|
+
* limit: 20,
|
|
117
|
+
* offset: 10,
|
|
118
|
+
* namePattern: "document"
|
|
119
|
+
* });
|
|
120
|
+
*
|
|
121
|
+
* filteredFiles.forEach(file => {
|
|
122
|
+
* console.log(`${file.name} (${file.size} bytes): ${file.cid}`);
|
|
123
|
+
* });
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
list(options?: StorageListOptions): Promise<StorageFile[]>;
|
|
127
|
+
/**
|
|
128
|
+
* Deletes a file from Pinata by unpinning it from IPFS
|
|
129
|
+
*
|
|
130
|
+
* @remarks
|
|
131
|
+
* This method removes the file from your Pinata account by unpinning it,
|
|
132
|
+
* which means it will no longer be guaranteed to be available on the IPFS network.
|
|
133
|
+
* Note that if the file is pinned elsewhere or cached by other nodes, it may still
|
|
134
|
+
* be accessible for some time.
|
|
135
|
+
*
|
|
136
|
+
* @param url - The IPFS URL or content identifier of the file to delete
|
|
137
|
+
* @returns Promise that resolves when the file is successfully unpinned
|
|
138
|
+
* @throws {StorageError} When the deletion fails or CID format is invalid
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```typescript
|
|
142
|
+
* // Delete a file by CID
|
|
143
|
+
* await pinataStorage.delete("QmTzQ1JRkWErjk39mryYw2WVrgBMe2B36gRq8GCL8qCACj");
|
|
144
|
+
* console.log("File unpinned from Pinata");
|
|
145
|
+
*
|
|
146
|
+
* // Delete after listing
|
|
147
|
+
* const files = await pinataStorage.list();
|
|
148
|
+
* for (const file of files) {
|
|
149
|
+
* if (file.name.includes("temp")) {
|
|
150
|
+
* await pinataStorage.delete(file.cid);
|
|
151
|
+
* }
|
|
152
|
+
* }
|
|
153
|
+
* ```
|
|
154
|
+
*/
|
|
155
|
+
delete(url: string): Promise<boolean>;
|
|
156
|
+
getConfig(): StorageProviderConfig;
|
|
157
|
+
/**
|
|
158
|
+
* Extract CID from URL or return as-is
|
|
159
|
+
*
|
|
160
|
+
* @param url - URL or CID string
|
|
161
|
+
* @returns CID string
|
|
162
|
+
*/
|
|
163
|
+
private extractCidFromUrl;
|
|
164
|
+
/**
|
|
165
|
+
* Basic CID validation
|
|
166
|
+
*
|
|
167
|
+
* @param cid - Content identifier to validate
|
|
168
|
+
* @returns True if CID appears valid
|
|
169
|
+
*/
|
|
170
|
+
private isValidCID;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export { type PinataConfig, type PinataFile, type PinataListQuery, PinataStorage };
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
+
import {
|
|
5
|
+
StorageError
|
|
6
|
+
} from "../index";
|
|
7
|
+
class PinataStorage {
|
|
8
|
+
constructor(config) {
|
|
9
|
+
this.config = config;
|
|
10
|
+
__publicField(this, "apiUrl", "https://api.pinata.cloud");
|
|
11
|
+
__publicField(this, "gatewayUrl");
|
|
12
|
+
this.gatewayUrl = config.gatewayUrl || "https://gateway.pinata.cloud";
|
|
13
|
+
if (!config.jwt) {
|
|
14
|
+
throw new StorageError(
|
|
15
|
+
"Pinata JWT token is required",
|
|
16
|
+
"MISSING_JWT",
|
|
17
|
+
"pinata"
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Uploads a file to IPFS via Pinata and returns the CID
|
|
23
|
+
*
|
|
24
|
+
* @remarks
|
|
25
|
+
* This method uploads the file to Pinata's IPFS service with enhanced metadata support.
|
|
26
|
+
* The file is pinned to ensure availability and can include custom metadata for
|
|
27
|
+
* organization and querying. The metadata is stored alongside the file for later retrieval.
|
|
28
|
+
*
|
|
29
|
+
* @param file - The file to upload to IPFS
|
|
30
|
+
* @param filename - Optional custom filename
|
|
31
|
+
* @returns Promise that resolves to the IPFS CID (content identifier)
|
|
32
|
+
* @throws {StorageError} When the upload fails or no CID is returned
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* const cid = await pinataStorage.upload(fileBlob, {
|
|
37
|
+
* name: "user-document.pdf",
|
|
38
|
+
* metadata: {
|
|
39
|
+
* userId: "user-123",
|
|
40
|
+
* category: "documents",
|
|
41
|
+
* uploadDate: new Date().toISOString()
|
|
42
|
+
* }
|
|
43
|
+
* });
|
|
44
|
+
* console.log("File pinned to IPFS:", cid);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
async upload(file, filename) {
|
|
48
|
+
try {
|
|
49
|
+
const fileName = filename || `vana-file-${Date.now()}.dat`;
|
|
50
|
+
const formData = new FormData();
|
|
51
|
+
formData.append("file", file, fileName);
|
|
52
|
+
const metadata = {
|
|
53
|
+
name: fileName,
|
|
54
|
+
keyvalues: {
|
|
55
|
+
uploadedBy: "vana-sdk",
|
|
56
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
formData.append("pinataMetadata", JSON.stringify(metadata));
|
|
60
|
+
const response = await fetch(`${this.apiUrl}/pinning/pinFileToIPFS`, {
|
|
61
|
+
method: "POST",
|
|
62
|
+
headers: {
|
|
63
|
+
Authorization: `Bearer ${this.config.jwt}`
|
|
64
|
+
},
|
|
65
|
+
body: formData
|
|
66
|
+
});
|
|
67
|
+
if (!response.ok) {
|
|
68
|
+
const errorText = await response.text();
|
|
69
|
+
throw new StorageError(
|
|
70
|
+
`Pinata upload failed: ${errorText}`,
|
|
71
|
+
"UPLOAD_FAILED",
|
|
72
|
+
"pinata"
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
const result = await response.json();
|
|
76
|
+
const ipfsHash = result.IpfsHash;
|
|
77
|
+
if (!ipfsHash) {
|
|
78
|
+
throw new StorageError(
|
|
79
|
+
"Pinata upload succeeded but no IPFS hash returned",
|
|
80
|
+
"NO_HASH_RETURNED",
|
|
81
|
+
"pinata"
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
return {
|
|
85
|
+
url: `ipfs://${ipfsHash}`,
|
|
86
|
+
size: file.size,
|
|
87
|
+
contentType: file.type || "application/octet-stream"
|
|
88
|
+
};
|
|
89
|
+
} catch (error) {
|
|
90
|
+
if (error instanceof StorageError) {
|
|
91
|
+
throw error;
|
|
92
|
+
}
|
|
93
|
+
throw new StorageError(
|
|
94
|
+
`Pinata upload error: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
95
|
+
"UPLOAD_ERROR",
|
|
96
|
+
"pinata"
|
|
97
|
+
);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
async download(cid) {
|
|
101
|
+
try {
|
|
102
|
+
if (!this.isValidCID(cid)) {
|
|
103
|
+
throw new StorageError(
|
|
104
|
+
"Invalid IPFS CID format",
|
|
105
|
+
"INVALID_CID",
|
|
106
|
+
"pinata"
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
const downloadUrl = `${this.gatewayUrl}/ipfs/${cid}`;
|
|
110
|
+
const response = await fetch(downloadUrl);
|
|
111
|
+
if (!response.ok) {
|
|
112
|
+
throw new StorageError(
|
|
113
|
+
`Failed to download from IPFS: ${response.statusText}`,
|
|
114
|
+
"DOWNLOAD_FAILED",
|
|
115
|
+
"pinata"
|
|
116
|
+
);
|
|
117
|
+
}
|
|
118
|
+
return await response.blob();
|
|
119
|
+
} catch (error) {
|
|
120
|
+
if (error instanceof StorageError) {
|
|
121
|
+
throw error;
|
|
122
|
+
}
|
|
123
|
+
throw new StorageError(
|
|
124
|
+
`Pinata download error: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
125
|
+
"DOWNLOAD_ERROR",
|
|
126
|
+
"pinata"
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Lists files uploaded to Pinata with optional filtering
|
|
132
|
+
*
|
|
133
|
+
* @remarks
|
|
134
|
+
* This method retrieves a list of files that have been uploaded to Pinata,
|
|
135
|
+
* filtered to only include files uploaded by the Vana SDK. You can further
|
|
136
|
+
* filter results by name pattern, limit results, or paginate through them.
|
|
137
|
+
*
|
|
138
|
+
* @param options - Optional query parameters for filtering and pagination
|
|
139
|
+
* @param options.limit - Maximum number of results to return (default: 10)
|
|
140
|
+
* @param options.offset - Number of results to skip for pagination
|
|
141
|
+
* @param options.namePattern - Filter files by name pattern
|
|
142
|
+
* @returns Promise that resolves to an array of PinataFile objects
|
|
143
|
+
* @throws {StorageError} When the list operation fails
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```typescript
|
|
147
|
+
* // List all files
|
|
148
|
+
* const allFiles = await pinataStorage.list();
|
|
149
|
+
*
|
|
150
|
+
* // List with pagination and filtering
|
|
151
|
+
* const filteredFiles = await pinataStorage.list({
|
|
152
|
+
* limit: 20,
|
|
153
|
+
* offset: 10,
|
|
154
|
+
* namePattern: "document"
|
|
155
|
+
* });
|
|
156
|
+
*
|
|
157
|
+
* filteredFiles.forEach(file => {
|
|
158
|
+
* console.log(`${file.name} (${file.size} bytes): ${file.cid}`);
|
|
159
|
+
* });
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
async list(options) {
|
|
163
|
+
try {
|
|
164
|
+
const params = new URLSearchParams({
|
|
165
|
+
status: "pinned",
|
|
166
|
+
pageLimit: (options?.limit || 10).toString(),
|
|
167
|
+
metadata: JSON.stringify({
|
|
168
|
+
keyvalues: {
|
|
169
|
+
uploadedBy: "vana-sdk"
|
|
170
|
+
}
|
|
171
|
+
})
|
|
172
|
+
});
|
|
173
|
+
if (options?.offset) {
|
|
174
|
+
params.set("pageOffset", options.offset.toString());
|
|
175
|
+
}
|
|
176
|
+
if (options?.namePattern) {
|
|
177
|
+
params.set("metadata[name]", options.namePattern);
|
|
178
|
+
}
|
|
179
|
+
const response = await fetch(`${this.apiUrl}/data/pinList?${params}`, {
|
|
180
|
+
headers: {
|
|
181
|
+
Authorization: `Bearer ${this.config.jwt}`
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
if (!response.ok) {
|
|
185
|
+
const errorText = await response.text();
|
|
186
|
+
throw new StorageError(
|
|
187
|
+
`Failed to list Pinata files: ${errorText}`,
|
|
188
|
+
"LIST_FAILED",
|
|
189
|
+
"pinata"
|
|
190
|
+
);
|
|
191
|
+
}
|
|
192
|
+
const result = await response.json();
|
|
193
|
+
return result.rows.map((pin) => ({
|
|
194
|
+
id: pin.id,
|
|
195
|
+
name: pin.metadata?.name || "Unnamed",
|
|
196
|
+
url: `ipfs://${pin.ipfs_pin_hash}`,
|
|
197
|
+
size: parseInt(String(pin.size), 10) || 0,
|
|
198
|
+
contentType: "application/octet-stream",
|
|
199
|
+
// Pinata doesn't store content type
|
|
200
|
+
createdAt: new Date(pin.date_pinned),
|
|
201
|
+
metadata: pin.metadata?.keyvalues || {}
|
|
202
|
+
}));
|
|
203
|
+
} catch (error) {
|
|
204
|
+
if (error instanceof StorageError) {
|
|
205
|
+
throw error;
|
|
206
|
+
}
|
|
207
|
+
throw new StorageError(
|
|
208
|
+
`Pinata list error: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
209
|
+
"LIST_ERROR",
|
|
210
|
+
"pinata"
|
|
211
|
+
);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Deletes a file from Pinata by unpinning it from IPFS
|
|
216
|
+
*
|
|
217
|
+
* @remarks
|
|
218
|
+
* This method removes the file from your Pinata account by unpinning it,
|
|
219
|
+
* which means it will no longer be guaranteed to be available on the IPFS network.
|
|
220
|
+
* Note that if the file is pinned elsewhere or cached by other nodes, it may still
|
|
221
|
+
* be accessible for some time.
|
|
222
|
+
*
|
|
223
|
+
* @param url - The IPFS URL or content identifier of the file to delete
|
|
224
|
+
* @returns Promise that resolves when the file is successfully unpinned
|
|
225
|
+
* @throws {StorageError} When the deletion fails or CID format is invalid
|
|
226
|
+
*
|
|
227
|
+
* @example
|
|
228
|
+
* ```typescript
|
|
229
|
+
* // Delete a file by CID
|
|
230
|
+
* await pinataStorage.delete("QmTzQ1JRkWErjk39mryYw2WVrgBMe2B36gRq8GCL8qCACj");
|
|
231
|
+
* console.log("File unpinned from Pinata");
|
|
232
|
+
*
|
|
233
|
+
* // Delete after listing
|
|
234
|
+
* const files = await pinataStorage.list();
|
|
235
|
+
* for (const file of files) {
|
|
236
|
+
* if (file.name.includes("temp")) {
|
|
237
|
+
* await pinataStorage.delete(file.cid);
|
|
238
|
+
* }
|
|
239
|
+
* }
|
|
240
|
+
* ```
|
|
241
|
+
*/
|
|
242
|
+
async delete(url) {
|
|
243
|
+
try {
|
|
244
|
+
const cid = this.extractCidFromUrl(url);
|
|
245
|
+
if (!this.isValidCID(cid)) {
|
|
246
|
+
throw new StorageError(
|
|
247
|
+
"Invalid IPFS CID format",
|
|
248
|
+
"INVALID_CID",
|
|
249
|
+
"pinata"
|
|
250
|
+
);
|
|
251
|
+
}
|
|
252
|
+
const response = await fetch(`${this.apiUrl}/pinning/unpin/${cid}`, {
|
|
253
|
+
method: "DELETE",
|
|
254
|
+
headers: {
|
|
255
|
+
Authorization: `Bearer ${this.config.jwt}`
|
|
256
|
+
}
|
|
257
|
+
});
|
|
258
|
+
if (!response.ok) {
|
|
259
|
+
const errorText = await response.text();
|
|
260
|
+
throw new StorageError(
|
|
261
|
+
`Failed to delete from Pinata: ${errorText}`,
|
|
262
|
+
"DELETE_FAILED",
|
|
263
|
+
"pinata"
|
|
264
|
+
);
|
|
265
|
+
}
|
|
266
|
+
return true;
|
|
267
|
+
} catch (error) {
|
|
268
|
+
if (error instanceof StorageError) {
|
|
269
|
+
throw error;
|
|
270
|
+
}
|
|
271
|
+
throw new StorageError(
|
|
272
|
+
`Pinata delete error: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
273
|
+
"DELETE_ERROR",
|
|
274
|
+
"pinata"
|
|
275
|
+
);
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
getConfig() {
|
|
279
|
+
return {
|
|
280
|
+
name: "Pinata IPFS",
|
|
281
|
+
type: "pinata",
|
|
282
|
+
requiresAuth: true,
|
|
283
|
+
features: {
|
|
284
|
+
upload: true,
|
|
285
|
+
download: true,
|
|
286
|
+
list: true,
|
|
287
|
+
delete: true
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Extract CID from URL or return as-is
|
|
293
|
+
*
|
|
294
|
+
* @param url - URL or CID string
|
|
295
|
+
* @returns CID string
|
|
296
|
+
*/
|
|
297
|
+
extractCidFromUrl(url) {
|
|
298
|
+
if (!url.includes("/")) {
|
|
299
|
+
return url;
|
|
300
|
+
}
|
|
301
|
+
const cidMatch = url.match(/\/ipfs\/([a-zA-Z0-9]+)/);
|
|
302
|
+
if (cidMatch) {
|
|
303
|
+
return cidMatch[1];
|
|
304
|
+
}
|
|
305
|
+
return url;
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Basic CID validation
|
|
309
|
+
*
|
|
310
|
+
* @param cid - Content identifier to validate
|
|
311
|
+
* @returns True if CID appears valid
|
|
312
|
+
*/
|
|
313
|
+
isValidCID(cid) {
|
|
314
|
+
return /^[a-zA-Z0-9]{10,}$/.test(cid) && (cid.startsWith("Qm") || cid.startsWith("ba") || cid.includes("Test"));
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
export {
|
|
318
|
+
PinataStorage
|
|
319
|
+
};
|
|
320
|
+
//# sourceMappingURL=pinata.js.map
|