@opendatalabs/vana-sdk 0.1.0-alpha.eebb656 → 0.1.0-alpha.ef15099
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -351
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.ts +33 -1
- package/dist/browser.js.map +1 -1
- package/dist/chains/definitions.cjs +9 -6
- package/dist/chains/definitions.cjs.map +1 -1
- package/dist/chains/definitions.d.ts +2 -0
- package/dist/chains/definitions.js +9 -6
- package/dist/chains/definitions.js.map +1 -1
- package/dist/chains/index.cjs.map +1 -1
- package/dist/chains/index.d.ts +30 -1
- package/dist/chains/index.js.map +1 -1
- package/dist/client/enhancedResponse.cjs +164 -0
- package/dist/client/enhancedResponse.cjs.map +1 -0
- package/dist/client/enhancedResponse.d.ts +120 -0
- package/dist/client/enhancedResponse.js +138 -0
- package/dist/client/enhancedResponse.js.map +1 -0
- package/dist/config/chains.cjs.map +1 -1
- package/dist/config/chains.d.ts +99 -0
- package/dist/config/chains.js.map +1 -1
- package/dist/config/contracts.config.cjs +400 -0
- package/dist/config/contracts.config.cjs.map +1 -0
- package/dist/config/contracts.config.d.ts +84 -0
- package/dist/config/contracts.config.js +375 -0
- package/dist/config/contracts.config.js.map +1 -0
- package/dist/config/default-services.cjs +60 -0
- package/dist/config/default-services.cjs.map +1 -0
- package/dist/config/default-services.d.ts +46 -0
- package/dist/config/default-services.js +33 -0
- package/dist/config/default-services.js.map +1 -0
- package/dist/config/default-services.test.d.ts +1 -0
- package/dist/contracts/contractController.cjs +1 -1
- package/dist/contracts/contractController.cjs.map +1 -1
- package/dist/contracts/contractController.d.ts +66 -10
- package/dist/contracts/contractController.js +1 -1
- package/dist/contracts/contractController.js.map +1 -1
- package/dist/controllers/__tests__/data-consistency-integration.test.d.ts +7 -0
- package/dist/controllers/__tests__/operations.processQueue.test.d.ts +1 -0
- package/dist/controllers/accessSettlement.cjs +289 -0
- package/dist/controllers/accessSettlement.cjs.map +1 -0
- package/dist/controllers/accessSettlement.d.ts +157 -0
- package/dist/controllers/accessSettlement.js +265 -0
- package/dist/controllers/accessSettlement.js.map +1 -0
- package/dist/controllers/accessSettlement.test.d.ts +1 -0
- package/dist/controllers/base.cjs +116 -0
- package/dist/controllers/base.cjs.map +1 -0
- package/dist/controllers/base.d.ts +94 -0
- package/dist/controllers/base.js +92 -0
- package/dist/controllers/base.js.map +1 -0
- package/dist/controllers/data.cjs +634 -352
- package/dist/controllers/data.cjs.map +1 -1
- package/dist/controllers/data.d.ts +348 -213
- package/dist/controllers/data.js +647 -355
- package/dist/controllers/data.js.map +1 -1
- package/dist/controllers/operations.cjs +430 -0
- package/dist/controllers/operations.cjs.map +1 -0
- package/dist/controllers/operations.d.ts +229 -0
- package/dist/controllers/operations.js +406 -0
- package/dist/controllers/operations.js.map +1 -0
- package/dist/controllers/permissions.cjs +943 -443
- package/dist/controllers/permissions.cjs.map +1 -1
- package/dist/controllers/permissions.d.ts +201 -120
- package/dist/controllers/permissions.js +943 -443
- package/dist/controllers/permissions.js.map +1 -1
- package/dist/controllers/protocol.cjs +14 -10
- package/dist/controllers/protocol.cjs.map +1 -1
- package/dist/controllers/protocol.d.ts +30 -31
- package/dist/controllers/protocol.js +14 -10
- package/dist/controllers/protocol.js.map +1 -1
- package/dist/controllers/runtimePermissions.cjs +272 -0
- package/dist/controllers/runtimePermissions.cjs.map +1 -0
- package/dist/controllers/runtimePermissions.d.ts +152 -0
- package/dist/controllers/runtimePermissions.js +251 -0
- package/dist/controllers/runtimePermissions.js.map +1 -0
- package/dist/controllers/runtimePermissions.test.d.ts +1 -0
- package/dist/controllers/schemas.cjs +113 -43
- package/dist/controllers/schemas.cjs.map +1 -1
- package/dist/controllers/schemas.d.ts +90 -43
- package/dist/controllers/schemas.js +113 -43
- package/dist/controllers/schemas.js.map +1 -1
- package/dist/controllers/server.cjs +276 -60
- package/dist/controllers/server.cjs.map +1 -1
- package/dist/controllers/server.d.ts +159 -54
- package/dist/controllers/server.js +276 -60
- package/dist/controllers/server.js.map +1 -1
- package/dist/core/__tests__/health.test.d.ts +1 -0
- package/dist/core/__tests__/inMemoryNonceManager.test.d.ts +1 -0
- package/dist/core/__tests__/nonceManager.test.d.ts +1 -0
- package/dist/core/__tests__/pollingManager.test.d.ts +4 -0
- package/dist/core/apiClient.cjs +53 -3
- package/dist/core/apiClient.cjs.map +1 -1
- package/dist/core/apiClient.d.ts +132 -7
- package/dist/core/apiClient.js +53 -3
- package/dist/core/apiClient.js.map +1 -1
- package/dist/core/generics.cjs +30 -3
- package/dist/core/generics.cjs.map +1 -1
- package/dist/core/generics.d.ts +95 -6
- package/dist/core/generics.js +30 -3
- package/dist/core/generics.js.map +1 -1
- package/dist/core/health.cjs +289 -0
- package/dist/core/health.cjs.map +1 -0
- package/dist/core/health.d.ts +143 -0
- package/dist/core/health.js +265 -0
- package/dist/core/health.js.map +1 -0
- package/dist/core/inMemoryNonceManager.cjs +138 -0
- package/dist/core/inMemoryNonceManager.cjs.map +1 -0
- package/dist/core/inMemoryNonceManager.d.ts +69 -0
- package/dist/core/inMemoryNonceManager.js +114 -0
- package/dist/core/inMemoryNonceManager.js.map +1 -0
- package/dist/core/nonceManager.cjs +304 -0
- package/dist/core/nonceManager.cjs.map +1 -0
- package/dist/core/nonceManager.d.ts +116 -0
- package/dist/core/nonceManager.js +280 -0
- package/dist/core/nonceManager.js.map +1 -0
- package/dist/core/pollingManager.cjs +292 -0
- package/dist/core/pollingManager.cjs.map +1 -0
- package/dist/core/pollingManager.d.ts +120 -0
- package/dist/core/pollingManager.js +268 -0
- package/dist/core/pollingManager.js.map +1 -0
- package/dist/core.cjs +164 -36
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.ts +69 -10
- package/dist/core.js +167 -37
- package/dist/core.js.map +1 -1
- package/dist/crypto/ecies/__tests__/constants.test.d.ts +1 -1
- package/dist/crypto/ecies/__tests__/interface.test.d.ts +1 -0
- package/dist/crypto/ecies/__tests__/serialization.test.d.ts +8 -0
- package/dist/crypto/ecies/__tests__/utils.test.d.ts +1 -0
- package/dist/crypto/ecies/base.cjs +59 -23
- package/dist/crypto/ecies/base.cjs.map +1 -1
- package/dist/crypto/ecies/base.js +59 -23
- package/dist/crypto/ecies/base.js.map +1 -1
- package/dist/crypto/ecies/constants.cjs +2 -10
- package/dist/crypto/ecies/constants.cjs.map +1 -1
- package/dist/crypto/ecies/constants.d.ts +0 -9
- package/dist/crypto/ecies/constants.js +1 -8
- package/dist/crypto/ecies/constants.js.map +1 -1
- package/dist/crypto/ecies/interface.cjs +19 -2
- package/dist/crypto/ecies/interface.cjs.map +1 -1
- package/dist/crypto/ecies/interface.js +19 -2
- package/dist/crypto/ecies/interface.js.map +1 -1
- package/dist/errors.cjs +45 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +104 -0
- package/dist/errors.js +43 -0
- package/dist/errors.js.map +1 -1
- package/dist/generated/abi/AccessSettlementImplementation.cjs +635 -0
- package/dist/generated/abi/AccessSettlementImplementation.cjs.map +1 -0
- package/dist/generated/abi/AccessSettlementImplementation.d.ts +468 -0
- package/dist/generated/abi/AccessSettlementImplementation.js +611 -0
- package/dist/generated/abi/AccessSettlementImplementation.js.map +1 -0
- package/dist/generated/abi/AttestationPolicyImplementation.cjs +614 -0
- package/dist/generated/abi/AttestationPolicyImplementation.cjs.map +1 -0
- package/dist/generated/abi/AttestationPolicyImplementation.d.ts +449 -0
- package/dist/generated/abi/AttestationPolicyImplementation.js +590 -0
- package/dist/generated/abi/AttestationPolicyImplementation.js.map +1 -0
- package/dist/generated/abi/ComputeEngineImplementation.cjs.map +1 -1
- package/dist/generated/abi/ComputeEngineImplementation.js.map +1 -1
- package/dist/generated/abi/{DLPTreasuryImplementation.cjs → ComputeEngineTreasuryImplementation.cjs} +16 -92
- package/dist/generated/abi/ComputeEngineTreasuryImplementation.cjs.map +1 -0
- package/dist/generated/abi/{DLPTreasuryImplementation.d.ts → ComputeEngineTreasuryImplementation.d.ts} +9 -67
- package/dist/generated/abi/{DLPTreasuryImplementation.js → ComputeEngineTreasuryImplementation.js} +12 -88
- package/dist/generated/abi/ComputeEngineTreasuryImplementation.js.map +1 -0
- package/dist/generated/abi/ComputeInstructionRegistryImplementation.cjs.map +1 -1
- package/dist/generated/abi/ComputeInstructionRegistryImplementation.js.map +1 -1
- package/dist/generated/abi/DATFactoryImplementation.cjs.map +1 -1
- package/dist/generated/abi/DATFactoryImplementation.js.map +1 -1
- package/dist/generated/abi/DATImplementation.cjs.map +1 -1
- package/dist/generated/abi/DATImplementation.js.map +1 -1
- package/dist/generated/abi/DATPausableImplementation.cjs.map +1 -1
- package/dist/generated/abi/DATPausableImplementation.js.map +1 -1
- package/dist/generated/abi/DATVotesImplementation.cjs.map +1 -1
- package/dist/generated/abi/DATVotesImplementation.js.map +1 -1
- package/dist/generated/abi/DLPPerformanceImplementation.cjs +42 -0
- package/dist/generated/abi/DLPPerformanceImplementation.cjs.map +1 -1
- package/dist/generated/abi/DLPPerformanceImplementation.d.ts +32 -0
- package/dist/generated/abi/DLPPerformanceImplementation.js +42 -0
- package/dist/generated/abi/DLPPerformanceImplementation.js.map +1 -1
- package/dist/generated/abi/DLPRegistryImplementation.cjs +5 -5
- package/dist/generated/abi/DLPRegistryImplementation.cjs.map +1 -1
- package/dist/generated/abi/DLPRegistryImplementation.d.ts +4 -4
- package/dist/generated/abi/DLPRegistryImplementation.js +5 -5
- package/dist/generated/abi/DLPRegistryImplementation.js.map +1 -1
- package/dist/generated/abi/DLPRegistryTreasuryImplementation.cjs.map +1 -1
- package/dist/generated/abi/DLPRegistryTreasuryImplementation.js.map +1 -1
- package/dist/generated/abi/DLPRewardDeployerImplementation.cjs +166 -2
- package/dist/generated/abi/DLPRewardDeployerImplementation.cjs.map +1 -1
- package/dist/generated/abi/DLPRewardDeployerImplementation.d.ts +129 -2
- package/dist/generated/abi/DLPRewardDeployerImplementation.js +166 -2
- package/dist/generated/abi/DLPRewardDeployerImplementation.js.map +1 -1
- package/dist/generated/abi/DLPRewardSwapImplementation.cjs.map +1 -1
- package/dist/generated/abi/DLPRewardSwapImplementation.js.map +1 -1
- package/dist/generated/abi/DataLiquidityPoolImplementation.cjs +282 -100
- package/dist/generated/abi/DataLiquidityPoolImplementation.cjs.map +1 -1
- package/dist/generated/abi/DataLiquidityPoolImplementation.d.ts +218 -79
- package/dist/generated/abi/DataLiquidityPoolImplementation.js +281 -99
- package/dist/generated/abi/DataLiquidityPoolImplementation.js.map +1 -1
- package/dist/generated/abi/DataPortabilityGranteesImplementation.cjs +167 -19
- package/dist/generated/abi/DataPortabilityGranteesImplementation.cjs.map +1 -1
- package/dist/generated/abi/DataPortabilityGranteesImplementation.d.ts +127 -14
- package/dist/generated/abi/DataPortabilityGranteesImplementation.js +167 -19
- package/dist/generated/abi/DataPortabilityGranteesImplementation.js.map +1 -1
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.cjs +0 -19
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.cjs.map +1 -1
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.d.ts +0 -14
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.js +0 -19
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.js.map +1 -1
- package/dist/generated/abi/DataPortabilityServersImplementation.cjs +0 -19
- package/dist/generated/abi/DataPortabilityServersImplementation.cjs.map +1 -1
- package/dist/generated/abi/DataPortabilityServersImplementation.d.ts +0 -14
- package/dist/generated/abi/DataPortabilityServersImplementation.js +0 -19
- package/dist/generated/abi/DataPortabilityServersImplementation.js.map +1 -1
- package/dist/generated/abi/DataRefinerRegistryImplementation.cjs.map +1 -1
- package/dist/generated/abi/DataRefinerRegistryImplementation.js.map +1 -1
- package/dist/generated/abi/DataRegistryImplementation.cjs +0 -13
- package/dist/generated/abi/DataRegistryImplementation.cjs.map +1 -1
- package/dist/generated/abi/DataRegistryImplementation.d.ts +0 -10
- package/dist/generated/abi/DataRegistryImplementation.js +0 -13
- package/dist/generated/abi/DataRegistryImplementation.js.map +1 -1
- package/dist/generated/abi/DatasetRegistryImplementation.cjs +751 -0
- package/dist/generated/abi/DatasetRegistryImplementation.cjs.map +1 -0
- package/dist/generated/abi/DatasetRegistryImplementation.d.ts +557 -0
- package/dist/generated/abi/DatasetRegistryImplementation.js +727 -0
- package/dist/generated/abi/DatasetRegistryImplementation.js.map +1 -0
- package/dist/generated/abi/ProtocolConfigImplementation.cjs +578 -0
- package/dist/generated/abi/ProtocolConfigImplementation.cjs.map +1 -0
- package/dist/generated/abi/ProtocolConfigImplementation.d.ts +423 -0
- package/dist/generated/abi/ProtocolConfigImplementation.js +554 -0
- package/dist/generated/abi/ProtocolConfigImplementation.js.map +1 -0
- package/dist/generated/abi/QueryEngineImplementation.cjs.map +1 -1
- package/dist/generated/abi/QueryEngineImplementation.js.map +1 -1
- package/dist/generated/abi/SwapHelperImplementation.cjs +0 -43
- package/dist/generated/abi/SwapHelperImplementation.cjs.map +1 -1
- package/dist/generated/abi/SwapHelperImplementation.d.ts +0 -35
- package/dist/generated/abi/SwapHelperImplementation.js +0 -43
- package/dist/generated/abi/SwapHelperImplementation.js.map +1 -1
- package/dist/generated/abi/TeePoolDedicatedGpuImplementation.cjs.map +1 -1
- package/dist/generated/abi/TeePoolDedicatedGpuImplementation.js.map +1 -1
- package/dist/generated/abi/TeePoolDedicatedStandardImplementation.cjs.map +1 -1
- package/dist/generated/abi/TeePoolDedicatedStandardImplementation.js.map +1 -1
- package/dist/generated/abi/TeePoolEphemeralStandardImplementation.cjs.map +1 -1
- package/dist/generated/abi/TeePoolEphemeralStandardImplementation.js.map +1 -1
- package/dist/generated/abi/TeePoolPersistentGpuImplementation.cjs.map +1 -1
- package/dist/generated/abi/TeePoolPersistentGpuImplementation.js.map +1 -1
- package/dist/generated/abi/TeePoolPersistentStandardImplementation.cjs.map +1 -1
- package/dist/generated/abi/TeePoolPersistentStandardImplementation.js.map +1 -1
- package/dist/generated/abi/TeePoolPhalaImplementation.cjs.map +1 -1
- package/dist/generated/abi/TeePoolPhalaImplementation.js.map +1 -1
- package/dist/generated/abi/UniswapV3NonfungiblePositionManagerImplementation.cjs +1251 -0
- package/dist/generated/abi/UniswapV3NonfungiblePositionManagerImplementation.cjs.map +1 -0
- package/dist/generated/abi/UniswapV3NonfungiblePositionManagerImplementation.d.ts +948 -0
- package/dist/generated/abi/UniswapV3NonfungiblePositionManagerImplementation.js +1227 -0
- package/dist/generated/abi/UniswapV3NonfungiblePositionManagerImplementation.js.map +1 -0
- package/dist/generated/abi/UniswapV3QuoterV2Implementation.cjs +297 -0
- package/dist/generated/abi/UniswapV3QuoterV2Implementation.cjs.map +1 -0
- package/dist/generated/abi/UniswapV3QuoterV2Implementation.d.ts +206 -0
- package/dist/generated/abi/UniswapV3QuoterV2Implementation.js +273 -0
- package/dist/generated/abi/UniswapV3QuoterV2Implementation.js.map +1 -0
- package/dist/generated/abi/VanaEpochImplementation.cjs +195 -0
- package/dist/generated/abi/VanaEpochImplementation.cjs.map +1 -1
- package/dist/generated/abi/VanaEpochImplementation.d.ts +151 -0
- package/dist/generated/abi/VanaEpochImplementation.js +195 -0
- package/dist/generated/abi/VanaEpochImplementation.js.map +1 -1
- package/dist/generated/abi/VanaPoolEntityImplementation.cjs +22 -65
- package/dist/generated/abi/VanaPoolEntityImplementation.cjs.map +1 -1
- package/dist/generated/abi/VanaPoolEntityImplementation.d.ts +17 -51
- package/dist/generated/abi/VanaPoolEntityImplementation.js +22 -65
- package/dist/generated/abi/VanaPoolEntityImplementation.js.map +1 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.cjs +113 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.cjs.map +1 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.d.ts +85 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.js +113 -1
- package/dist/generated/abi/VanaPoolStakingImplementation.js.map +1 -1
- package/dist/generated/abi/VanaPoolTreasuryImplementation.cjs.map +1 -1
- package/dist/generated/abi/VanaPoolTreasuryImplementation.js.map +1 -1
- package/dist/generated/abi/VanaRuntimePermissionsImplementation.cjs +759 -0
- package/dist/generated/abi/VanaRuntimePermissionsImplementation.cjs.map +1 -0
- package/dist/generated/abi/VanaRuntimePermissionsImplementation.d.ts +563 -0
- package/dist/generated/abi/VanaRuntimePermissionsImplementation.js +735 -0
- package/dist/generated/abi/VanaRuntimePermissionsImplementation.js.map +1 -0
- package/dist/generated/abi/VanaRuntimeServersImplementation.cjs +820 -0
- package/dist/generated/abi/VanaRuntimeServersImplementation.cjs.map +1 -0
- package/dist/generated/abi/VanaRuntimeServersImplementation.d.ts +609 -0
- package/dist/generated/abi/VanaRuntimeServersImplementation.js +796 -0
- package/dist/generated/abi/VanaRuntimeServersImplementation.js.map +1 -0
- package/dist/generated/abi/VanaTreasuryImplementation.cjs +536 -0
- package/dist/generated/abi/VanaTreasuryImplementation.cjs.map +1 -0
- package/dist/generated/abi/VanaTreasuryImplementation.d.ts +393 -0
- package/dist/generated/abi/VanaTreasuryImplementation.js +512 -0
- package/dist/generated/abi/VanaTreasuryImplementation.js.map +1 -0
- package/dist/generated/abi/WVANAImplementation.cjs +339 -0
- package/dist/generated/abi/WVANAImplementation.cjs.map +1 -0
- package/dist/generated/abi/WVANAImplementation.d.ts +244 -0
- package/dist/generated/abi/WVANAImplementation.js +315 -0
- package/dist/generated/abi/WVANAImplementation.js.map +1 -0
- package/dist/generated/abi/index.cjs +79 -47
- package/dist/generated/abi/index.cjs.map +1 -1
- package/dist/generated/abi/index.d.ts +15783 -10449
- package/dist/generated/abi/index.js +65 -43
- package/dist/generated/abi/index.js.map +1 -1
- package/dist/{config → generated}/addresses.cjs +174 -75
- package/dist/generated/addresses.cjs.map +1 -0
- package/dist/{config → generated}/addresses.d.ts +174 -165
- package/dist/{config → generated}/addresses.js +174 -75
- package/dist/generated/addresses.js.map +1 -0
- package/dist/generated/event-types.cjs.map +1 -1
- package/dist/generated/event-types.d.ts +482 -399
- package/dist/generated/eventRegistry.cjs +2601 -724
- package/dist/generated/eventRegistry.cjs.map +1 -1
- package/dist/generated/eventRegistry.d.ts +2 -2
- package/dist/generated/eventRegistry.js +2601 -724
- package/dist/generated/eventRegistry.js.map +1 -1
- package/dist/generated/server/server-exports.cjs +22 -0
- package/dist/generated/server/server-exports.cjs.map +1 -1
- package/dist/generated/server/server-exports.d.ts +31 -11
- package/dist/generated/server/server-exports.js +17 -0
- package/dist/generated/server/server-exports.js.map +1 -1
- package/dist/generated/server/server.cjs.map +1 -1
- package/dist/generated/server/server.d.ts +771 -402
- package/dist/generated/subgraph.cjs +797 -32
- package/dist/generated/subgraph.cjs.map +1 -1
- package/dist/generated/subgraph.d.ts +135 -0
- package/dist/generated/subgraph.js +792 -32
- package/dist/generated/subgraph.js.map +1 -1
- package/dist/index.browser.d.ts +6 -1
- package/dist/index.browser.js +26 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/index.node.cjs +47 -4
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +60 -14
- package/dist/index.node.js +42 -3
- package/dist/index.node.js.map +1 -1
- package/dist/lib/__tests__/redisAtomicStore.test.d.ts +1 -0
- package/dist/lib/redisAtomicStore.cjs +201 -0
- package/dist/lib/redisAtomicStore.cjs.map +1 -0
- package/dist/lib/redisAtomicStore.d.ts +120 -0
- package/dist/lib/redisAtomicStore.js +177 -0
- package/dist/lib/redisAtomicStore.js.map +1 -0
- package/dist/node.cjs.map +1 -1
- package/dist/node.d.ts +39 -1
- package/dist/node.js.map +1 -1
- package/dist/platform/browser.cjs +160 -2
- package/dist/platform/browser.cjs.map +1 -1
- package/dist/platform/browser.d.ts +232 -12
- package/dist/platform/browser.js +160 -2
- package/dist/platform/browser.js.map +1 -1
- package/dist/platform/interface.cjs.map +1 -1
- package/dist/platform/interface.d.ts +283 -90
- package/dist/platform/node.cjs +163 -2
- package/dist/platform/node.cjs.map +1 -1
- package/dist/platform/node.d.ts +69 -6
- package/dist/platform/node.js +163 -2
- package/dist/platform/node.js.map +1 -1
- package/dist/server/relayerHandler.cjs +452 -0
- package/dist/server/relayerHandler.cjs.map +1 -0
- package/dist/server/relayerHandler.d.ts +69 -0
- package/dist/server/relayerHandler.js +428 -0
- package/dist/server/relayerHandler.js.map +1 -0
- package/dist/storage/index.cjs +3 -0
- package/dist/storage/index.cjs.map +1 -1
- package/dist/storage/index.d.ts +1 -0
- package/dist/storage/index.js +2 -0
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/manager.cjs +108 -25
- package/dist/storage/manager.cjs.map +1 -1
- package/dist/storage/manager.d.ts +119 -25
- package/dist/storage/manager.js +108 -25
- package/dist/storage/manager.js.map +1 -1
- package/dist/storage/providers/callback-storage.cjs +86 -15
- package/dist/storage/providers/callback-storage.cjs.map +1 -1
- package/dist/storage/providers/callback-storage.d.ts +109 -20
- package/dist/storage/providers/callback-storage.js +86 -15
- package/dist/storage/providers/callback-storage.js.map +1 -1
- package/dist/storage/providers/dropbox.cjs +237 -0
- package/dist/storage/providers/dropbox.cjs.map +1 -0
- package/dist/storage/providers/dropbox.d.ts +39 -0
- package/dist/storage/providers/dropbox.js +215 -0
- package/dist/storage/providers/dropbox.js.map +1 -0
- package/dist/storage/providers/dropbox.test.d.ts +1 -0
- package/dist/storage/providers/pinata.cjs.map +1 -1
- package/dist/storage/providers/pinata.d.ts +12 -14
- package/dist/storage/providers/pinata.js.map +1 -1
- package/dist/tests/data-upload-owner-validation.test.d.ts +1 -0
- package/dist/tests/factories/mockFactory.d.ts +6 -6
- package/dist/tests/fakes/FakeWaitForTransactionEvents.d.ts +2 -2
- package/dist/tests/permissions-revoke-relayer.test.d.ts +1 -0
- package/dist/tests/permissions-transaction-options.test.d.ts +1 -0
- package/dist/tests/read-only-mode.test.d.ts +1 -0
- package/dist/tests/relayer-integration.test.d.ts +1 -0
- package/dist/tests/relayer-unified.test.d.ts +1 -0
- package/dist/tests/server-relayer-handler.test.d.ts +1 -0
- package/dist/types/accessSettlement.cjs +17 -0
- package/dist/types/accessSettlement.cjs.map +1 -0
- package/dist/types/accessSettlement.d.ts +66 -0
- package/dist/types/accessSettlement.js +1 -0
- package/dist/types/accessSettlement.js.map +1 -0
- package/dist/types/atomicStore.cjs +31 -0
- package/dist/types/atomicStore.cjs.map +1 -0
- package/dist/types/atomicStore.d.ts +236 -0
- package/dist/types/atomicStore.js +7 -0
- package/dist/types/atomicStore.js.map +1 -0
- package/dist/types/blockchain.cjs.map +1 -1
- package/dist/types/blockchain.d.ts +39 -11
- package/dist/types/chains.cjs.map +1 -1
- package/dist/types/chains.d.ts +74 -7
- package/dist/types/chains.js.map +1 -1
- package/dist/types/config.cjs +10 -0
- package/dist/types/config.cjs.map +1 -1
- package/dist/types/config.d.ts +217 -220
- package/dist/types/config.js +8 -0
- package/dist/types/config.js.map +1 -1
- package/dist/types/contracts.cjs.map +1 -1
- package/dist/types/contracts.d.ts +71 -7
- package/dist/types/controller-context.cjs.map +1 -1
- package/dist/types/controller-context.d.ts +12 -6
- package/dist/types/data.cjs.map +1 -1
- package/dist/types/data.d.ts +82 -10
- package/dist/types/generics.cjs.map +1 -1
- package/dist/types/generics.d.ts +81 -10
- package/dist/types/index.cjs +4 -0
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.ts +36 -6
- package/dist/types/index.js +9 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types/operationStore.cjs +17 -0
- package/dist/types/operationStore.cjs.map +1 -0
- package/dist/types/operationStore.d.ts +171 -0
- package/dist/types/operationStore.js +1 -0
- package/dist/types/operationStore.js.map +1 -0
- package/dist/types/operations.cjs +3 -15
- package/dist/types/operations.cjs.map +1 -1
- package/dist/types/operations.d.ts +131 -39
- package/dist/types/operations.js +2 -13
- package/dist/types/operations.js.map +1 -1
- package/dist/types/options.cjs +17 -0
- package/dist/types/options.cjs.map +1 -0
- package/dist/types/options.d.ts +308 -0
- package/dist/types/options.js +1 -0
- package/dist/types/options.js.map +1 -0
- package/dist/types/permissions.cjs.map +1 -1
- package/dist/types/permissions.d.ts +19 -20
- package/dist/types/personal.cjs.map +1 -1
- package/dist/types/personal.d.ts +150 -14
- package/dist/types/relayer.cjs.map +1 -1
- package/dist/types/relayer.d.ts +307 -35
- package/dist/types/runtimePermissions.cjs +17 -0
- package/dist/types/runtimePermissions.cjs.map +1 -0
- package/dist/types/runtimePermissions.d.ts +122 -0
- package/dist/types/runtimePermissions.js +1 -0
- package/dist/types/runtimePermissions.js.map +1 -0
- package/dist/types/storage.cjs.map +1 -1
- package/dist/types/storage.d.ts +9 -21
- package/dist/types/storage.js.map +1 -1
- package/dist/types/utils.cjs.map +1 -1
- package/dist/types/utils.d.ts +0 -45
- package/dist/utils/__tests__/chainQuery.test.d.ts +1 -0
- package/dist/utils/__tests__/subgraphConsistency.test.d.ts +4 -0
- package/dist/utils/__tests__/subgraphPagination.test.d.ts +4 -0
- package/dist/utils/blockchain/registry.cjs +3 -3
- package/dist/utils/blockchain/registry.cjs.map +1 -1
- package/dist/utils/blockchain/registry.d.ts +1 -1
- package/dist/utils/blockchain/registry.js +3 -3
- package/dist/utils/blockchain/registry.js.map +1 -1
- package/dist/utils/chainQuery.cjs +107 -0
- package/dist/utils/chainQuery.cjs.map +1 -0
- package/dist/utils/chainQuery.d.ts +31 -0
- package/dist/utils/chainQuery.js +82 -0
- package/dist/utils/chainQuery.js.map +1 -0
- package/dist/utils/grantFiles.cjs +4 -1
- package/dist/utils/grantFiles.cjs.map +1 -1
- package/dist/utils/grantFiles.d.ts +10 -20
- package/dist/utils/grantFiles.js +4 -1
- package/dist/utils/grantFiles.js.map +1 -1
- package/dist/utils/grantValidation.cjs.map +1 -1
- package/dist/utils/grantValidation.d.ts +95 -16
- package/dist/utils/grantValidation.js.map +1 -1
- package/dist/utils/grants.cjs.map +1 -1
- package/dist/utils/grants.d.ts +93 -12
- package/dist/utils/grants.js.map +1 -1
- package/dist/utils/ipfs.cjs +2 -4
- package/dist/utils/ipfs.cjs.map +1 -1
- package/dist/utils/ipfs.d.ts +1 -1
- package/dist/utils/ipfs.js +2 -4
- package/dist/utils/ipfs.js.map +1 -1
- package/dist/utils/lazy-import.cjs.map +1 -1
- package/dist/utils/lazy-import.d.ts +32 -7
- package/dist/utils/lazy-import.js.map +1 -1
- package/dist/utils/multicall.cjs +1 -1
- package/dist/utils/multicall.cjs.map +1 -1
- package/dist/utils/multicall.js +1 -1
- package/dist/utils/multicall.js.map +1 -1
- package/dist/utils/runtimeGrantFiles.cjs +84 -0
- package/dist/utils/runtimeGrantFiles.cjs.map +1 -0
- package/dist/utils/runtimeGrantFiles.d.ts +66 -0
- package/dist/utils/runtimeGrantFiles.js +58 -0
- package/dist/utils/runtimeGrantFiles.js.map +1 -0
- package/dist/utils/signatureCache.cjs +8 -2
- package/dist/utils/signatureCache.cjs.map +1 -1
- package/dist/utils/signatureCache.d.ts +49 -8
- package/dist/utils/signatureCache.js +8 -2
- package/dist/utils/signatureCache.js.map +1 -1
- package/dist/utils/subgraphConsistency.cjs +184 -0
- package/dist/utils/subgraphConsistency.cjs.map +1 -0
- package/dist/utils/subgraphConsistency.d.ts +65 -0
- package/dist/utils/subgraphConsistency.js +155 -0
- package/dist/utils/subgraphConsistency.js.map +1 -0
- package/dist/utils/subgraphMetaCache.cjs +101 -0
- package/dist/utils/subgraphMetaCache.cjs.map +1 -0
- package/dist/utils/subgraphMetaCache.d.ts +56 -0
- package/dist/utils/subgraphMetaCache.js +76 -0
- package/dist/utils/subgraphMetaCache.js.map +1 -0
- package/dist/utils/subgraphPagination.cjs +104 -0
- package/dist/utils/subgraphPagination.cjs.map +1 -0
- package/dist/utils/subgraphPagination.d.ts +78 -0
- package/dist/utils/subgraphPagination.js +78 -0
- package/dist/utils/subgraphPagination.js.map +1 -0
- package/dist/utils/transactionHelpers.cjs.map +1 -1
- package/dist/utils/transactionHelpers.d.ts +12 -12
- package/dist/utils/transactionHelpers.js.map +1 -1
- package/dist/utils/typedDataConverter.cjs.map +1 -1
- package/dist/utils/typedDataConverter.d.ts +39 -3
- package/dist/utils/typedDataConverter.js.map +1 -1
- package/dist/utils/urlResolver.cjs +7 -0
- package/dist/utils/urlResolver.cjs.map +1 -1
- package/dist/utils/urlResolver.d.ts +22 -4
- package/dist/utils/urlResolver.js +7 -0
- package/dist/utils/urlResolver.js.map +1 -1
- package/dist/utils/wallet.cjs +63 -0
- package/dist/utils/wallet.cjs.map +1 -0
- package/dist/utils/wallet.d.ts +94 -0
- package/dist/utils/wallet.js +37 -0
- package/dist/utils/wallet.js.map +1 -0
- package/package.json +7 -2
- package/dist/config/addresses.cjs.map +0 -1
- package/dist/config/addresses.js.map +0 -1
- package/dist/generated/abi/DLPTreasuryImplementation.cjs.map +0 -1
- package/dist/generated/abi/DLPTreasuryImplementation.js.map +0 -1
- package/dist/server/handler.cjs +0 -101
- package/dist/server/handler.cjs.map +0 -1
- package/dist/server/handler.d.ts +0 -87
- package/dist/server/handler.js +0 -77
- package/dist/server/handler.js.map +0 -1
- /package/dist/{tests/server-handler.test.d.ts → client/__tests__/enhancedResponse.test.d.ts} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/generics.ts"],"sourcesContent":["import type { Address, Hash } from \"viem\";\n\n/**\n * Generic request pattern for all SDK operations\n *\n * @category Reference\n */\nexport interface GenericRequest<TParams = unknown, TOptions = unknown> {\n /** Request parameters */\n params: TParams;\n /** Additional request options */\n options?: TOptions;\n}\n\n/**\n * Generic response pattern for all SDK operations\n *\n * @category Reference\n */\nexport interface GenericResponse<TData = unknown, TMeta = unknown> {\n /** Response data */\n data: TData;\n /** Response metadata */\n meta?: TMeta;\n /** Success status */\n success: boolean;\n /** Error information if not successful */\n error?: {\n code: string;\n message: string;\n details?: unknown;\n };\n}\n\n/**\n * Generic async operation result\n *\n * @category Reference\n */\nexport interface AsyncResult<T> {\n /** Operation result */\n result: T;\n /** Transaction hash if applicable */\n transactionHash?: Hash;\n /** Block number if applicable */\n blockNumber?: bigint;\n /** Gas used if applicable */\n gasUsed?: bigint;\n}\n\n/**\n * Generic contract interaction parameters\n *\n * @category Reference\n */\nexport interface ContractCall<\n TArgs extends readonly unknown[] = readonly unknown[],\n> {\n /** Contract method name */\n method: string;\n /** Method arguments */\n args: TArgs;\n /** Call options */\n options?: {\n /** Gas limit */\n gasLimit?: bigint;\n /** Gas price */\n gasPrice?: bigint;\n /** Value to send */\n value?: bigint;\n };\n}\n\n/**\n * Generic contract event filter\n *\n * @category Reference\n */\nexport interface EventFilter<TEventArgs = unknown> {\n /** Event name */\n event: string;\n /** Event arguments filter */\n args?: TEventArgs;\n /** From block */\n fromBlock?: bigint;\n /** To block */\n toBlock?: bigint;\n /** Address filter */\n address?: Address | Address[];\n}\n\n/**\n * Generic event log\n *\n * @category Reference\n */\nexport interface EventLog<TArgs = unknown> {\n /** Event name */\n event: string;\n /** Event arguments */\n args: TArgs;\n /** Block number */\n blockNumber: bigint;\n /** Transaction hash */\n transactionHash: Hash;\n /** Log index */\n logIndex: number;\n /** Transaction index */\n transactionIndex: number;\n /** Contract address */\n address: Address;\n}\n\n/**\n * Generic controller context for dependency injection\n *\n * @category Reference\n */\nexport interface ControllerContext<TClient = unknown, TConfig = unknown> {\n /** Client instance */\n client: TClient;\n /** Configuration */\n config?: TConfig;\n /** Additional context */\n [key: string]: unknown;\n}\n\n/**\n * Generic controller interface\n *\n * @category Reference\n */\nexport interface Controller<TContext = unknown> {\n /** Controller context */\n readonly context: TContext;\n}\n\n/**\n * Generic storage provider interface\n *\n * @category Reference\n */\nexport interface StorageProvider<TConfig = unknown, TOptions = unknown> {\n /** Provider name */\n readonly name: string;\n /** Provider configuration */\n readonly config: TConfig;\n\n /** Upload data */\n upload(\n data: Uint8Array,\n options?: TOptions,\n ): Promise<{\n url: string;\n size: number;\n checksum?: string;\n }>;\n\n /** Download data */\n download(\n url: string,\n options?: TOptions,\n ): Promise<{\n data: Uint8Array;\n size: number;\n checksum?: string;\n }>;\n\n /** Delete data */\n delete?(url: string, options?: TOptions): Promise<boolean>;\n\n /** Check if data exists */\n exists?(url: string, options?: TOptions): Promise<boolean>;\n}\n\n/**\n * Generic cache interface\n *\n * @category Reference\n */\nexport interface Cache<TKey = string, TValue = unknown> {\n /** Get value from cache */\n get(key: TKey): Promise<TValue | undefined>;\n\n /** Set value in cache */\n set(key: TKey, value: TValue, ttl?: number): Promise<void>;\n\n /** Delete value from cache */\n delete(key: TKey): Promise<boolean>;\n\n /** Clear all cache */\n clear(): Promise<void>;\n\n /** Check if key exists */\n has(key: TKey): Promise<boolean>;\n}\n\n/**\n * Generic retry configuration\n *\n * @category Reference\n */\nexport interface RetryConfig<TError = Error> {\n /** Maximum retry attempts */\n maxAttempts: number;\n /** Base delay in milliseconds */\n baseDelay: number;\n /** Backoff multiplier */\n backoffMultiplier?: number;\n /** Maximum delay */\n maxDelay?: number;\n /** Jitter factor */\n jitter?: number;\n /** Retry condition */\n shouldRetry?: (error: TError, attempt: number) => boolean;\n}\n\n/**\n * Generic rate limiter configuration\n *\n * @category Reference\n */\nexport interface RateLimiterConfig {\n /** Requests per time window */\n requestsPerWindow: number;\n /** Time window in milliseconds */\n windowMs: number;\n /** Burst allowance */\n burstLimit?: number;\n}\n\n/**\n * Generic middleware interface\n *\n * @category Reference\n */\nexport interface Middleware<TRequest = unknown, TResponse = unknown> {\n /** Middleware name */\n readonly name: string;\n\n /** Process request */\n request?(req: TRequest): Promise<TRequest>;\n\n /** Process response */\n response?(res: TResponse): Promise<TResponse>;\n\n /** Handle errors */\n error?(error: Error, req: TRequest): Promise<TResponse | void>;\n}\n\n/**\n * Generic plugin interface\n *\n * @category Reference\n */\nexport interface Plugin<TConfig = unknown> {\n /** Plugin name */\n readonly name: string;\n /** Plugin version */\n readonly version: string;\n /** Plugin configuration */\n readonly config: TConfig;\n\n /** Initialize plugin */\n init?(): Promise<void>;\n\n /** Cleanup plugin */\n cleanup?(): Promise<void>;\n}\n\n/**\n * Generic factory interface\n *\n * @category Reference\n */\nexport interface Factory<T, TParams = unknown> {\n /** Create instance */\n create(params: TParams): T;\n\n /** Create multiple instances */\n createMany?(params: TParams[]): T[];\n\n /** Validate parameters */\n validate?(params: TParams): boolean;\n}\n\n/**\n * Generic repository interface for data access\n *\n * @category Reference\n */\nexport interface Repository<TEntity, TKey = string | number> {\n /** Find by ID */\n findById(id: TKey): Promise<TEntity | undefined>;\n\n /** Find all entities */\n findAll(options?: {\n limit?: number;\n offset?: number;\n filter?: Partial<TEntity>;\n sort?: Array<{ field: keyof TEntity; direction: \"asc\" | \"desc\" }>;\n }): Promise<{\n entities: TEntity[];\n total: number;\n hasMore: boolean;\n }>;\n\n /** Create entity */\n create(entity: Omit<TEntity, \"id\">): Promise<TEntity>;\n\n /** Update entity */\n update(id: TKey, updates: Partial<TEntity>): Promise<TEntity>;\n\n /** Delete entity */\n delete(id: TKey): Promise<boolean>;\n\n /** Check if entity exists */\n exists(id: TKey): Promise<boolean>;\n}\n\n/**\n * Generic validator interface\n *\n * @category Reference\n */\nexport interface Validator<T> {\n /** Validate value */\n validate(value: unknown): value is T;\n\n /** Get validation errors */\n getErrors?(value: unknown): string[];\n\n /** Get validation schema */\n getSchema?(): unknown;\n}\n\n/**\n * Generic transformer interface\n *\n * @category Reference\n */\nexport interface Transformer<TInput, TOutput> {\n /** Transform input to output */\n transform(input: TInput): TOutput | Promise<TOutput>;\n\n /** Reverse transform output to input */\n reverse?(output: TOutput): TInput | Promise<TInput>;\n}\n\n/**\n * Generic service interface\n *\n * @category Reference\n */\nexport interface Service<TConfig = unknown> {\n /** Service name */\n readonly name: string;\n /** Service configuration */\n readonly config: TConfig;\n /** Service status */\n readonly status:\n | \"idle\"\n | \"starting\"\n | \"running\"\n | \"stopping\"\n | \"stopped\"\n | \"error\";\n\n /** Start service */\n start(): Promise<void>;\n\n /** Stop service */\n stop(): Promise<void>;\n\n /** Restart service */\n restart?(): Promise<void>;\n\n /** Get health status */\n getHealth?(): Promise<{\n healthy: boolean;\n details?: Record<string, unknown>;\n }>;\n}\n\n/**\n * Generic observer pattern\n *\n * @category Reference\n */\nexport interface Observer<TEvent = unknown> {\n /** Handle event */\n notify(event: TEvent): void | Promise<void>;\n}\n\n/**\n * Generic observable pattern\n *\n * @category Reference\n */\nexport interface Observable<TEvent = unknown> {\n /** Subscribe to events */\n subscribe(observer: Observer<TEvent>): () => void;\n\n /** Unsubscribe from events */\n unsubscribe(observer: Observer<TEvent>): void;\n\n /** Emit event */\n emit(event: TEvent): void;\n}\n\n/**\n * Generic state machine interface\n *\n * @category Reference\n */\nexport interface StateMachine<TState, TEvent> {\n /** Current state */\n readonly currentState: TState;\n\n /** Transition to new state */\n transition(event: TEvent): TState;\n\n /** Check if transition is valid */\n canTransition(event: TEvent): boolean;\n\n /** Get available transitions */\n getAvailableTransitions(): TEvent[];\n}\n\n/**\n * Helper type to make properties optional conditionally\n *\n * @category Reference\n */\nexport type ConditionalOptional<\n T,\n K extends keyof T,\n Condition extends boolean,\n> = Condition extends true ? Omit<T, K> & Partial<Pick<T, K>> : T;\n\n/**\n * Helper type to extract promise result type\n *\n * @category Reference\n */\nexport type PromiseResult<T> = T extends Promise<infer U> ? U : T;\n\n/**\n * Helper type to create a union of all possible keys\n *\n * @category Reference\n */\nexport type AllKeys<T> = T extends unknown ? keyof T : never;\n\n/**\n * Helper type to create a deep partial type\n *\n * @category Reference\n */\nexport type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n};\n\n/**\n * Helper type to create a deep readonly type\n *\n * @category Reference\n */\nexport type DeepReadonly<T> = {\n readonly [P in keyof T]: T[P] extends object ? DeepReadonly<T[P]> : T[P];\n};\n\n/**\n * Helper type to create a required type with specific keys\n *\n * @category Reference\n */\nexport type RequireKeys<T, K extends keyof T> = Required<Pick<T, K>> &\n Omit<T, K>;\n\n/**\n * Helper type to create an optional type with specific keys\n *\n * @category Reference\n */\nexport type OptionalKeys<T, K extends keyof T> = Partial<Pick<T, K>> &\n Omit<T, K>;\n\n/**\n * Helper type to exclude null and undefined\n *\n * @category Reference\n */\nexport type NonNullable<T> = T extends null | undefined ? never : T;\n\n/**\n * Helper type to create a type with only specific keys\n *\n * @category Reference\n */\nexport type PickByType<T, U> = {\n [K in keyof T as T[K] extends U ? K : never]: T[K];\n};\n\n/**\n * Helper type to omit keys by type\n *\n * @category Reference\n */\nexport type OmitByType<T, U> = {\n [K in keyof T as T[K] extends U ? never : K]: T[K];\n};\n\n/**\n * Helper type for branded types\n *\n * @category Reference\n */\nexport type Brand<T, B> = T & { readonly __brand: B };\n\n/**\n * Helper type for nominal types\n *\n * @category Reference\n */\nexport type Nominal<T, N extends string> = T & { readonly __nominal: N };\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/types/generics.ts"],"sourcesContent":["/**\n * Defines generic types and interfaces for SDK infrastructure.\n *\n * @remarks\n * This module provides reusable type definitions and interfaces that form\n * the foundation of the SDK's architecture. It includes patterns for requests,\n * responses, caching, middleware, repositories, and other common software\n * engineering abstractions.\n *\n * @category Types\n * @module types/generics\n */\n\nimport type { Address, Hash } from \"viem\";\n\n/**\n * Represents a standardized request structure for SDK operations.\n *\n * @remarks\n * Provides consistent request handling across all SDK methods with\n * typed parameters and optional configuration.\n *\n * @typeParam TParams - Type of request parameters\n * @typeParam TOptions - Type of optional configuration\n *\n * @category Reference\n */\nexport interface GenericRequest<TParams = unknown, TOptions = unknown> {\n /** Request parameters */\n params: TParams;\n /** Additional request options */\n options?: TOptions;\n}\n\n/**\n * Represents a standardized response structure for SDK operations.\n *\n * @remarks\n * Provides consistent response handling with success/error states\n * and optional metadata for additional context.\n *\n * @typeParam TData - Type of response data\n * @typeParam TMeta - Type of response metadata\n *\n * @category Reference\n */\nexport interface GenericResponse<TData = unknown, TMeta = unknown> {\n /** Response data */\n data: TData;\n /** Response metadata */\n meta?: TMeta;\n /** Success status */\n success: boolean;\n /** Error information if not successful */\n error?: {\n code: string;\n message: string;\n details?: unknown;\n };\n}\n\n/**\n * Represents the result of an asynchronous blockchain operation.\n *\n * @remarks\n * Includes transaction details when the operation involves\n * blockchain state changes.\n *\n * @typeParam T - Type of the operation result\n *\n * @category Reference\n */\nexport interface AsyncResult<T> {\n /** Operation result */\n result: T;\n /** Transaction hash if applicable */\n transactionHash?: Hash;\n /** Block number if applicable */\n blockNumber?: bigint;\n /** Gas used if applicable */\n gasUsed?: bigint;\n}\n\n/**\n * Generic contract interaction parameters\n *\n * @category Reference\n */\nexport interface ContractCall<\n TArgs extends readonly unknown[] = readonly unknown[],\n> {\n /** Contract method name */\n method: string;\n /** Method arguments */\n args: TArgs;\n /** Call options */\n options?: {\n /** Gas limit */\n gas?: bigint;\n /** Gas price */\n gasPrice?: bigint;\n /** Value to send */\n value?: bigint;\n };\n}\n\n/**\n * Generic contract event filter\n *\n * @category Reference\n */\nexport interface EventFilter<TEventArgs = unknown> {\n /** Event name */\n event: string;\n /** Event arguments filter */\n args?: TEventArgs;\n /** From block */\n fromBlock?: bigint;\n /** To block */\n toBlock?: bigint;\n /** Address filter */\n address?: Address | Address[];\n}\n\n/**\n * Generic event log\n *\n * @category Reference\n */\nexport interface EventLog<TArgs = unknown> {\n /** Event name */\n event: string;\n /** Event arguments */\n args: TArgs;\n /** Block number */\n blockNumber: bigint;\n /** Transaction hash */\n transactionHash: Hash;\n /** Log index */\n logIndex: number;\n /** Transaction index */\n transactionIndex: number;\n /** Contract address */\n address: Address;\n}\n\n/**\n * Generic controller context for dependency injection\n *\n * @category Reference\n */\nexport interface ControllerContext<TClient = unknown, TConfig = unknown> {\n /** Client instance */\n client: TClient;\n /** Configuration */\n config?: TConfig;\n /** Additional context */\n [key: string]: unknown;\n}\n\n/**\n * Generic controller interface\n *\n * @category Reference\n */\nexport interface Controller<TContext = unknown> {\n /** Controller context */\n readonly context: TContext;\n}\n\n/**\n * Generic storage provider interface\n *\n * @category Reference\n */\nexport interface StorageProvider<TConfig = unknown, TOptions = unknown> {\n /** Provider name */\n readonly name: string;\n /** Provider configuration */\n readonly config: TConfig;\n\n /** Upload data */\n upload(\n data: Uint8Array,\n options?: TOptions,\n ): Promise<{\n url: string;\n size: number;\n checksum?: string;\n }>;\n\n /** Download data */\n download(\n url: string,\n options?: TOptions,\n ): Promise<{\n data: Uint8Array;\n size: number;\n checksum?: string;\n }>;\n\n /** Delete data */\n delete?(url: string, options?: TOptions): Promise<boolean>;\n\n /** Check if data exists */\n exists?(url: string, options?: TOptions): Promise<boolean>;\n}\n\n/**\n * Defines a generic caching interface with TTL support.\n *\n * @remarks\n * Provides standard cache operations for performance optimization\n * and reducing redundant computations or network requests.\n *\n * @typeParam TKey - Type of cache keys\n * @typeParam TValue - Type of cached values\n *\n * @category Reference\n */\nexport interface Cache<TKey = string, TValue = unknown> {\n /** Get value from cache */\n get(key: TKey): Promise<TValue | undefined>;\n\n /** Set value in cache */\n set(key: TKey, value: TValue, ttl?: number): Promise<void>;\n\n /** Delete value from cache */\n delete(key: TKey): Promise<boolean>;\n\n /** Clear all cache */\n clear(): Promise<void>;\n\n /** Check if key exists */\n has(key: TKey): Promise<boolean>;\n}\n\n/**\n * Configures retry behavior for resilient operations.\n *\n * @remarks\n * Supports exponential backoff, jitter, and custom retry conditions\n * for handling transient failures gracefully.\n *\n * @typeParam TError - Type of errors to handle\n *\n * @category Reference\n */\nexport interface RetryConfig<TError = Error> {\n /** Maximum retry attempts */\n maxAttempts: number;\n /** Base delay in milliseconds */\n baseDelay: number;\n /** Backoff multiplier */\n backoffMultiplier?: number;\n /** Maximum delay */\n maxDelay?: number;\n /** Jitter factor */\n jitter?: number;\n /** Retry condition */\n shouldRetry?: (error: TError, attempt: number) => boolean;\n}\n\n/**\n * Generic rate limiter configuration\n *\n * @category Reference\n */\nexport interface RateLimiterConfig {\n /** Requests per time window */\n requestsPerWindow: number;\n /** Time window in milliseconds */\n windowMs: number;\n /** Burst allowance */\n burstLimit?: number;\n}\n\n/**\n * Defines middleware for request/response processing pipelines.\n *\n * @remarks\n * Middleware can transform requests, responses, and handle errors\n * in a composable chain of responsibility pattern.\n *\n * @typeParam TRequest - Type of requests to process\n * @typeParam TResponse - Type of responses to process\n *\n * @category Reference\n */\nexport interface Middleware<TRequest = unknown, TResponse = unknown> {\n /** Middleware name */\n readonly name: string;\n\n /** Process request */\n request?(req: TRequest): Promise<TRequest>;\n\n /** Process response */\n response?(res: TResponse): Promise<TResponse>;\n\n /** Handle errors */\n error?(error: Error, req: TRequest): Promise<TResponse | void>;\n}\n\n/**\n * Generic plugin interface\n *\n * @category Reference\n */\nexport interface Plugin<TConfig = unknown> {\n /** Plugin name */\n readonly name: string;\n /** Plugin version */\n readonly version: string;\n /** Plugin configuration */\n readonly config: TConfig;\n\n /** Initialize plugin */\n init?(): Promise<void>;\n\n /** Cleanup plugin */\n cleanup?(): Promise<void>;\n}\n\n/**\n * Generic factory interface\n *\n * @category Reference\n */\nexport interface Factory<T, TParams = unknown> {\n /** Create instance */\n create(params: TParams): T;\n\n /** Create multiple instances */\n createMany?(params: TParams[]): T[];\n\n /** Validate parameters */\n validate?(params: TParams): boolean;\n}\n\n/**\n * Defines a repository pattern for data access abstraction.\n *\n * @remarks\n * Provides CRUD operations with filtering, sorting, and pagination\n * for consistent data access across different storage backends.\n *\n * @typeParam TEntity - Type of entities managed by the repository\n * @typeParam TKey - Type of entity identifiers\n *\n * @category Reference\n */\nexport interface Repository<TEntity, TKey = string | number> {\n /** Find by ID */\n findById(id: TKey): Promise<TEntity | undefined>;\n\n /** Find all entities */\n findAll(options?: {\n limit?: number;\n offset?: number;\n filter?: Partial<TEntity>;\n sort?: Array<{ field: keyof TEntity; direction: \"asc\" | \"desc\" }>;\n }): Promise<{\n entities: TEntity[];\n total: number;\n hasMore: boolean;\n }>;\n\n /** Create entity */\n create(entity: Omit<TEntity, \"id\">): Promise<TEntity>;\n\n /** Update entity */\n update(id: TKey, updates: Partial<TEntity>): Promise<TEntity>;\n\n /** Delete entity */\n delete(id: TKey): Promise<boolean>;\n\n /** Check if entity exists */\n exists(id: TKey): Promise<boolean>;\n}\n\n/**\n * Generic validator interface\n *\n * @category Reference\n */\nexport interface Validator<T> {\n /** Validate value */\n validate(value: unknown): value is T;\n\n /** Get validation errors */\n getErrors?(value: unknown): string[];\n\n /** Get validation schema */\n getSchema?(): unknown;\n}\n\n/**\n * Generic transformer interface\n *\n * @category Reference\n */\nexport interface Transformer<TInput, TOutput> {\n /** Transform input to output */\n transform(input: TInput): TOutput | Promise<TOutput>;\n\n /** Reverse transform output to input */\n reverse?(output: TOutput): TInput | Promise<TInput>;\n}\n\n/**\n * Generic service interface\n *\n * @category Reference\n */\nexport interface Service<TConfig = unknown> {\n /** Service name */\n readonly name: string;\n /** Service configuration */\n readonly config: TConfig;\n /** Service status */\n readonly status:\n | \"idle\"\n | \"starting\"\n | \"running\"\n | \"stopping\"\n | \"stopped\"\n | \"error\";\n\n /** Start service */\n start(): Promise<void>;\n\n /** Stop service */\n stop(): Promise<void>;\n\n /** Restart service */\n restart?(): Promise<void>;\n\n /** Get health status */\n getHealth?(): Promise<{\n healthy: boolean;\n details?: Record<string, unknown>;\n }>;\n}\n\n/**\n * Implements the observer in the observer pattern.\n *\n * @remarks\n * Receives notifications about events from observable subjects\n * for decoupled event handling.\n *\n * @typeParam TEvent - Type of events to observe\n *\n * @category Reference\n */\nexport interface Observer<TEvent = unknown> {\n /** Handle event */\n notify(event: TEvent): void | Promise<void>;\n}\n\n/**\n * Implements the subject in the observer pattern.\n *\n * @remarks\n * Manages observers and emits events to all subscribed observers\n * for event-driven architectures.\n *\n * @typeParam TEvent - Type of events to emit\n *\n * @category Reference\n */\nexport interface Observable<TEvent = unknown> {\n /** Subscribe to events */\n subscribe(observer: Observer<TEvent>): () => void;\n\n /** Unsubscribe from events */\n unsubscribe(observer: Observer<TEvent>): void;\n\n /** Emit event */\n emit(event: TEvent): void;\n}\n\n/**\n * Generic state machine interface\n *\n * @category Reference\n */\nexport interface StateMachine<TState, TEvent> {\n /** Current state */\n readonly currentState: TState;\n\n /** Transition to new state */\n transition(event: TEvent): TState;\n\n /** Check if transition is valid */\n canTransition(event: TEvent): boolean;\n\n /** Get available transitions */\n getAvailableTransitions(): TEvent[];\n}\n\n/**\n * Helper type to make properties optional conditionally\n *\n * @category Reference\n */\nexport type ConditionalOptional<\n T,\n K extends keyof T,\n Condition extends boolean,\n> = Condition extends true ? Omit<T, K> & Partial<Pick<T, K>> : T;\n\n/**\n * Helper type to extract promise result type\n *\n * @category Reference\n */\nexport type PromiseResult<T> = T extends Promise<infer U> ? U : T;\n\n/**\n * Helper type to create a union of all possible keys\n *\n * @category Reference\n */\nexport type AllKeys<T> = T extends unknown ? keyof T : never;\n\n/**\n * Helper type to create a deep partial type\n *\n * @category Reference\n */\nexport type DeepPartial<T> = {\n [P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];\n};\n\n/**\n * Helper type to create a deep readonly type\n *\n * @category Reference\n */\nexport type DeepReadonly<T> = {\n readonly [P in keyof T]: T[P] extends object ? DeepReadonly<T[P]> : T[P];\n};\n\n/**\n * Helper type to create a required type with specific keys\n *\n * @category Reference\n */\nexport type RequireKeys<T, K extends keyof T> = Required<Pick<T, K>> &\n Omit<T, K>;\n\n/**\n * Helper type to create an optional type with specific keys\n *\n * @category Reference\n */\nexport type OptionalKeys<T, K extends keyof T> = Partial<Pick<T, K>> &\n Omit<T, K>;\n\n/**\n * Helper type to exclude null and undefined\n *\n * @category Reference\n */\nexport type NonNullable<T> = T extends null | undefined ? never : T;\n\n/**\n * Helper type to create a type with only specific keys\n *\n * @category Reference\n */\nexport type PickByType<T, U> = {\n [K in keyof T as T[K] extends U ? K : never]: T[K];\n};\n\n/**\n * Helper type to omit keys by type\n *\n * @category Reference\n */\nexport type OmitByType<T, U> = {\n [K in keyof T as T[K] extends U ? never : K]: T[K];\n};\n\n/**\n * Helper type for branded types\n *\n * @category Reference\n */\nexport type Brand<T, B> = T & { readonly __brand: B };\n\n/**\n * Helper type for nominal types\n *\n * @category Reference\n */\nexport type Nominal<T, N extends string> = T & { readonly __nominal: N };\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/dist/types/generics.d.ts
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Defines generic types and interfaces for SDK infrastructure.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This module provides reusable type definitions and interfaces that form
|
|
6
|
+
* the foundation of the SDK's architecture. It includes patterns for requests,
|
|
7
|
+
* responses, caching, middleware, repositories, and other common software
|
|
8
|
+
* engineering abstractions.
|
|
9
|
+
*
|
|
10
|
+
* @category Types
|
|
11
|
+
* @module types/generics
|
|
12
|
+
*/
|
|
1
13
|
import type { Address, Hash } from "viem";
|
|
2
14
|
/**
|
|
3
|
-
*
|
|
15
|
+
* Represents a standardized request structure for SDK operations.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Provides consistent request handling across all SDK methods with
|
|
19
|
+
* typed parameters and optional configuration.
|
|
20
|
+
*
|
|
21
|
+
* @typeParam TParams - Type of request parameters
|
|
22
|
+
* @typeParam TOptions - Type of optional configuration
|
|
4
23
|
*
|
|
5
24
|
* @category Reference
|
|
6
25
|
*/
|
|
@@ -11,7 +30,14 @@ export interface GenericRequest<TParams = unknown, TOptions = unknown> {
|
|
|
11
30
|
options?: TOptions;
|
|
12
31
|
}
|
|
13
32
|
/**
|
|
14
|
-
*
|
|
33
|
+
* Represents a standardized response structure for SDK operations.
|
|
34
|
+
*
|
|
35
|
+
* @remarks
|
|
36
|
+
* Provides consistent response handling with success/error states
|
|
37
|
+
* and optional metadata for additional context.
|
|
38
|
+
*
|
|
39
|
+
* @typeParam TData - Type of response data
|
|
40
|
+
* @typeParam TMeta - Type of response metadata
|
|
15
41
|
*
|
|
16
42
|
* @category Reference
|
|
17
43
|
*/
|
|
@@ -30,7 +56,13 @@ export interface GenericResponse<TData = unknown, TMeta = unknown> {
|
|
|
30
56
|
};
|
|
31
57
|
}
|
|
32
58
|
/**
|
|
33
|
-
*
|
|
59
|
+
* Represents the result of an asynchronous blockchain operation.
|
|
60
|
+
*
|
|
61
|
+
* @remarks
|
|
62
|
+
* Includes transaction details when the operation involves
|
|
63
|
+
* blockchain state changes.
|
|
64
|
+
*
|
|
65
|
+
* @typeParam T - Type of the operation result
|
|
34
66
|
*
|
|
35
67
|
* @category Reference
|
|
36
68
|
*/
|
|
@@ -57,7 +89,7 @@ export interface ContractCall<TArgs extends readonly unknown[] = readonly unknow
|
|
|
57
89
|
/** Call options */
|
|
58
90
|
options?: {
|
|
59
91
|
/** Gas limit */
|
|
60
|
-
|
|
92
|
+
gas?: bigint;
|
|
61
93
|
/** Gas price */
|
|
62
94
|
gasPrice?: bigint;
|
|
63
95
|
/** Value to send */
|
|
@@ -152,7 +184,14 @@ export interface StorageProvider<TConfig = unknown, TOptions = unknown> {
|
|
|
152
184
|
exists?(url: string, options?: TOptions): Promise<boolean>;
|
|
153
185
|
}
|
|
154
186
|
/**
|
|
155
|
-
*
|
|
187
|
+
* Defines a generic caching interface with TTL support.
|
|
188
|
+
*
|
|
189
|
+
* @remarks
|
|
190
|
+
* Provides standard cache operations for performance optimization
|
|
191
|
+
* and reducing redundant computations or network requests.
|
|
192
|
+
*
|
|
193
|
+
* @typeParam TKey - Type of cache keys
|
|
194
|
+
* @typeParam TValue - Type of cached values
|
|
156
195
|
*
|
|
157
196
|
* @category Reference
|
|
158
197
|
*/
|
|
@@ -169,7 +208,13 @@ export interface Cache<TKey = string, TValue = unknown> {
|
|
|
169
208
|
has(key: TKey): Promise<boolean>;
|
|
170
209
|
}
|
|
171
210
|
/**
|
|
172
|
-
*
|
|
211
|
+
* Configures retry behavior for resilient operations.
|
|
212
|
+
*
|
|
213
|
+
* @remarks
|
|
214
|
+
* Supports exponential backoff, jitter, and custom retry conditions
|
|
215
|
+
* for handling transient failures gracefully.
|
|
216
|
+
*
|
|
217
|
+
* @typeParam TError - Type of errors to handle
|
|
173
218
|
*
|
|
174
219
|
* @category Reference
|
|
175
220
|
*/
|
|
@@ -201,7 +246,14 @@ export interface RateLimiterConfig {
|
|
|
201
246
|
burstLimit?: number;
|
|
202
247
|
}
|
|
203
248
|
/**
|
|
204
|
-
*
|
|
249
|
+
* Defines middleware for request/response processing pipelines.
|
|
250
|
+
*
|
|
251
|
+
* @remarks
|
|
252
|
+
* Middleware can transform requests, responses, and handle errors
|
|
253
|
+
* in a composable chain of responsibility pattern.
|
|
254
|
+
*
|
|
255
|
+
* @typeParam TRequest - Type of requests to process
|
|
256
|
+
* @typeParam TResponse - Type of responses to process
|
|
205
257
|
*
|
|
206
258
|
* @category Reference
|
|
207
259
|
*/
|
|
@@ -246,7 +298,14 @@ export interface Factory<T, TParams = unknown> {
|
|
|
246
298
|
validate?(params: TParams): boolean;
|
|
247
299
|
}
|
|
248
300
|
/**
|
|
249
|
-
*
|
|
301
|
+
* Defines a repository pattern for data access abstraction.
|
|
302
|
+
*
|
|
303
|
+
* @remarks
|
|
304
|
+
* Provides CRUD operations with filtering, sorting, and pagination
|
|
305
|
+
* for consistent data access across different storage backends.
|
|
306
|
+
*
|
|
307
|
+
* @typeParam TEntity - Type of entities managed by the repository
|
|
308
|
+
* @typeParam TKey - Type of entity identifiers
|
|
250
309
|
*
|
|
251
310
|
* @category Reference
|
|
252
311
|
*/
|
|
@@ -325,7 +384,13 @@ export interface Service<TConfig = unknown> {
|
|
|
325
384
|
}>;
|
|
326
385
|
}
|
|
327
386
|
/**
|
|
328
|
-
*
|
|
387
|
+
* Implements the observer in the observer pattern.
|
|
388
|
+
*
|
|
389
|
+
* @remarks
|
|
390
|
+
* Receives notifications about events from observable subjects
|
|
391
|
+
* for decoupled event handling.
|
|
392
|
+
*
|
|
393
|
+
* @typeParam TEvent - Type of events to observe
|
|
329
394
|
*
|
|
330
395
|
* @category Reference
|
|
331
396
|
*/
|
|
@@ -334,7 +399,13 @@ export interface Observer<TEvent = unknown> {
|
|
|
334
399
|
notify(event: TEvent): void | Promise<void>;
|
|
335
400
|
}
|
|
336
401
|
/**
|
|
337
|
-
*
|
|
402
|
+
* Implements the subject in the observer pattern.
|
|
403
|
+
*
|
|
404
|
+
* @remarks
|
|
405
|
+
* Manages observers and emits events to all subscribed observers
|
|
406
|
+
* for event-driven architectures.
|
|
407
|
+
*
|
|
408
|
+
* @typeParam TEvent - Type of events to emit
|
|
338
409
|
*
|
|
339
410
|
* @category Reference
|
|
340
411
|
*/
|
package/dist/types/index.cjs
CHANGED
|
@@ -24,7 +24,9 @@ __export(types_exports, {
|
|
|
24
24
|
fetchAndValidateSchema: () => import_schemaValidation.fetchAndValidateSchema,
|
|
25
25
|
hasStorageConfig: () => import_config.hasStorageConfig,
|
|
26
26
|
isAPIResponse: () => import_external_apis.isAPIResponse,
|
|
27
|
+
isAddressOnlyConfig: () => import_config.isAddressOnlyConfig,
|
|
27
28
|
isChainConfig: () => import_config.isChainConfig,
|
|
29
|
+
isReadOnlyConfig: () => import_config.isReadOnlyConfig,
|
|
28
30
|
isReplicateAPIResponse: () => import_external_apis.isReplicateAPIResponse,
|
|
29
31
|
isVanaChain: () => import_chains.isVanaChain,
|
|
30
32
|
isVanaChainId: () => import_chains.isVanaChainId,
|
|
@@ -48,7 +50,9 @@ var import_external_apis = require("./external-apis");
|
|
|
48
50
|
fetchAndValidateSchema,
|
|
49
51
|
hasStorageConfig,
|
|
50
52
|
isAPIResponse,
|
|
53
|
+
isAddressOnlyConfig,
|
|
51
54
|
isChainConfig,
|
|
55
|
+
isReadOnlyConfig,
|
|
52
56
|
isReplicateAPIResponse,
|
|
53
57
|
isVanaChain,
|
|
54
58
|
isVanaChainId,
|
package/dist/types/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["// Configuration types\nexport type {\n BaseConfig,\n BaseConfigWithStorage,\n WalletConfig,\n WalletConfigWithStorage,\n ChainConfig,\n ChainConfigWithStorage,\n VanaConfig,\n VanaConfigWithStorage,\n RuntimeConfig,\n StorageConfig,\n ConfigValidationOptions,\n ConfigValidationResult,\n
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["/**\n * Centralized type exports for the Vana SDK.\n *\n * @remarks\n * This module re-exports all public types from their respective modules,\n * providing a single import point for SDK consumers. Types are organized\n * by category for easy discovery and usage.\n *\n * **Import Strategy:**\n * - Import types from this module for application code\n * - Import from specific modules only for advanced use cases\n * - Avoid importing from internal paths\n *\n * @example\n * ```typescript\n * // Recommended: Import from types module\n * import type { VanaConfig, UserFile, GrantPermissionParams } from '@opendatalabs/vana-sdk';\n *\n * // Alternative: Import from specific category\n * import type { StorageProvider } from '@opendatalabs/vana-sdk';\n * ```\n *\n * @category Types\n * @module types\n */\n\n// Configuration types\nexport type {\n BaseConfig,\n BaseConfigWithStorage,\n WalletConfig,\n WalletConfigWithStorage,\n ChainConfig,\n ChainConfigWithStorage,\n VanaConfig,\n VanaConfigWithStorage,\n VanaConfigWithWallet,\n VanaConfigReadOnly,\n VanaConfigAddressOnly,\n VanaConfigWithWalletWithStorage,\n VanaConfigReadOnlyWithStorage,\n VanaConfigAddressOnlyWithStorage,\n RuntimeConfig,\n StorageConfig,\n ConfigValidationOptions,\n ConfigValidationResult,\n DownloadRelayerCallbacks,\n StorageRequiredMarker,\n RelayerRequiredMarker,\n} from \"./config\";\n\nexport {\n isWalletConfig,\n isChainConfig,\n isReadOnlyConfig,\n isAddressOnlyConfig,\n hasStorageConfig,\n} from \"./config\";\n\n// Chain types\nexport type { VanaChainId, VanaChain } from \"./chains\";\n\nexport { isVanaChainId, isVanaChain } from \"./chains\";\n\n// Contract types\nexport type {\n VanaContractName,\n ContractInfo,\n ContractDeployment,\n VanaContractInstance,\n ContractAddresses,\n ContractMethodParams,\n ContractMethodReturnType,\n} from \"./contracts\";\n\n// Note: VanaContract and ContractAbis are exported directly from src/index.ts\n// to avoid circular dependencies. Do not re-export them here.\n\n// Storage types\nexport type {\n StorageProvider,\n StorageUploadResult,\n StorageFile,\n StorageListOptions,\n StorageProviderConfig,\n} from \"./storage\";\n\nexport { StorageError } from \"./storage\";\n\n// Data types\nexport type {\n UserFile,\n FileMetadata,\n UploadParams,\n FilePermissionParams,\n LegacyPermissionParams,\n EncryptedUploadParams,\n UnencryptedUploadParams,\n UploadResult,\n UploadFileParams,\n UploadFileResult,\n UploadEncryptedFileResult,\n EncryptionInfo,\n GetUserFilesParams,\n GetFileParams,\n EncryptFileOptions,\n EncryptFileResult,\n DecryptFileOptions,\n UploadFileWithPermissionsParams,\n AddFilePermissionParams,\n DecryptFileWithPermissionOptions,\n DownloadFileParams,\n DownloadFileResult,\n DeleteFileParams,\n DeleteFileResult,\n FileAccessPermissions,\n FileSharingConfig,\n BatchUploadParams,\n BatchUploadResult,\n SchemaMetadata,\n CompleteSchema,\n Schema,\n Refiner,\n AddSchemaParams,\n AddSchemaResult,\n AddRefinerParams,\n AddRefinerResult,\n UpdateSchemaIdParams,\n UpdateSchemaIdResult,\n TrustedServer,\n GetUserTrustedServersParams,\n} from \"./data\";\n\n// Schema types\nexport type {\n CreateSchemaParams,\n CreateSchemaResult,\n} from \"../controllers/schemas\";\n\n// Schema validation types\nexport type { DataSchema } from \"../utils/schemaValidation\";\nexport {\n SchemaValidationError,\n SchemaValidator,\n validateDataSchemaAgainstMetaSchema,\n validateDataAgainstSchema,\n fetchAndValidateSchema,\n} from \"../utils/schemaValidation\";\n\n// Permission types\nexport type {\n OnChainPermissionGrant,\n GetUserPermissionsOptions,\n GrantPermissionParams,\n RevokePermissionParams,\n CheckPermissionParams,\n PermissionCheckResult,\n PermissionGrantDomain,\n PermissionGrantMessage,\n PermissionInputMessage,\n SimplifiedPermissionMessage,\n GrantFile,\n PermissionGrantTypedData,\n RevokePermissionTypedData,\n GenericTypedData,\n TypedDataPrimaryType,\n SpecificTypedData,\n PermissionOperation,\n PermissionStatus,\n QueryPermissionsParams,\n PermissionQueryResult,\n PermissionAnalytics,\n PermissionEvent,\n GrantedPermission,\n Server,\n AddAndTrustServerParams,\n TrustServerParams,\n UntrustServerParams,\n AddAndTrustServerInput,\n TrustServerInput,\n UntrustServerInput,\n AddAndTrustServerTypedData,\n TrustServerTypedData,\n UntrustServerTypedData,\n PermissionInfo,\n RevokePermissionInput,\n TrustedServerInfo,\n PaginatedTrustedServers,\n TrustedServerQueryOptions,\n BatchServerInfoResult,\n ServerTrustStatus,\n ServerInfo,\n Grantee,\n GranteeInfo,\n RegisterGranteeParams,\n RegisterGranteeInput,\n RegisterGranteeTypedData,\n GranteeQueryOptions,\n PaginatedGrantees,\n ServerFilesAndPermissionParams,\n ServerFilesAndPermissionTypedData,\n Permission,\n} from \"./permissions\";\n\n// Runtime Permissions types\nexport type {\n RuntimePermissionParams,\n RuntimeGrantFile,\n RuntimePermission,\n RuntimePermissionResult,\n} from \"./runtimePermissions\";\n\n// Access Settlement types\nexport type {\n OperationInvoice,\n PaymentSettlementResult,\n SettleWithNativeParams,\n SettleWithTokenParams,\n} from \"./accessSettlement\";\n\n// Personal server types\nexport type {\n PostRequestParams,\n CreateOperationParams,\n DownloadArtifactParams,\n InitPersonalServerParams,\n PersonalServerIdentity,\n} from \"./personal\";\n\n// Operations types\nexport type {\n Operation,\n Artifact,\n PollingOptions,\n TransactionResult,\n TransactionReceipt as OperationTransactionReceipt,\n TransactionWaitOptions,\n} from \"./operations\";\n\n// Server API types (auto-generated via fetch-server-types.ts)\nexport type * from \"../generated/server/server-exports\";\n\n// External API types\nexport type {\n ReplicateAPIResponse,\n ReplicateStatus,\n PinataUploadResponse,\n PinataPin,\n PinataListResponse,\n APIResponse,\n} from \"./external-apis\";\n\nexport {\n isReplicateAPIResponse,\n isAPIResponse,\n safeParseJSON,\n parseReplicateOutput,\n} from \"./external-apis\";\n\n// Relayer types\nexport type {\n RelayerStorageResponse,\n RelayerTransactionResponse,\n RelayerStoreParams,\n RelayerSubmitParams,\n RelayerStatus,\n RelayerConfig,\n UnifiedRelayerRequest,\n UnifiedRelayerResponse,\n SignedRelayerRequest,\n DirectRelayerRequest,\n RelayerRequestOptions,\n RelayerErrorResponse,\n RelayerQueueInfo,\n RelayerTransactionStatus,\n RelayerMetrics,\n RelayerWebhookConfig,\n RelayerWebhookPayload,\n} from \"./relayer\";\n\n// Utility types\nexport type {\n PartialExcept,\n RequiredExcept,\n Awaited,\n MaybePromise,\n MaybeArray,\n PaginationParams,\n PaginationResult,\n BlockRange,\n ApiResponse,\n CacheConfig,\n ValidationResult,\n StatusInfo,\n RateLimitInfo,\n UploadProgress,\n NetworkInfo,\n GasEstimate,\n TimeRange,\n} from \"./utils\";\n\n// Operation store types\nexport type {\n IOperationStore,\n StoredOperation,\n IRelayerStateStore,\n OperationState,\n} from \"./operationStore\";\n\n// Options types\nexport type {\n ConsistencyOptions,\n DataSource,\n PaginationOptions,\n ListOptions,\n WriteOptions,\n LegacyTransactionOptions,\n} from \"./options\";\n\n// Generic types for extensibility\nexport type {\n GenericRequest,\n GenericResponse,\n AsyncResult,\n ContractCall,\n EventFilter,\n EventLog,\n ControllerContext,\n Controller,\n Cache,\n RetryConfig,\n RateLimiterConfig,\n Middleware,\n Plugin,\n Factory,\n Repository,\n Validator,\n Transformer,\n Service,\n Observer,\n Observable,\n StateMachine,\n ConditionalOptional,\n PromiseResult,\n AllKeys,\n DeepPartial,\n DeepReadonly,\n RequireKeys,\n OptionalKeys,\n NonNullable,\n PickByType,\n OmitByType,\n Brand,\n Nominal,\n} from \"./generics\";\n\n// Re-export viem types that are commonly used\nexport type {\n Address,\n Hash,\n Abi,\n Chain,\n WalletClient,\n PublicClient,\n Account,\n GetContractReturnType,\n} from \"viem\";\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmDA,oBAMO;AAKP,oBAA2C;AAyB3C,qBAA6B;AAsD7B,8BAMO;AAyGP,2BAKO;","names":[]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,20 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Centralized type exports for the Vana SDK.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This module re-exports all public types from their respective modules,
|
|
6
|
+
* providing a single import point for SDK consumers. Types are organized
|
|
7
|
+
* by category for easy discovery and usage.
|
|
8
|
+
*
|
|
9
|
+
* **Import Strategy:**
|
|
10
|
+
* - Import types from this module for application code
|
|
11
|
+
* - Import from specific modules only for advanced use cases
|
|
12
|
+
* - Avoid importing from internal paths
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```typescript
|
|
16
|
+
* // Recommended: Import from types module
|
|
17
|
+
* import type { VanaConfig, UserFile, GrantPermissionParams } from '@opendatalabs/vana-sdk';
|
|
18
|
+
*
|
|
19
|
+
* // Alternative: Import from specific category
|
|
20
|
+
* import type { StorageProvider } from '@opendatalabs/vana-sdk';
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @category Types
|
|
24
|
+
* @module types
|
|
25
|
+
*/
|
|
26
|
+
export type { BaseConfig, BaseConfigWithStorage, WalletConfig, WalletConfigWithStorage, ChainConfig, ChainConfigWithStorage, VanaConfig, VanaConfigWithStorage, VanaConfigWithWallet, VanaConfigReadOnly, VanaConfigAddressOnly, VanaConfigWithWalletWithStorage, VanaConfigReadOnlyWithStorage, VanaConfigAddressOnlyWithStorage, RuntimeConfig, StorageConfig, ConfigValidationOptions, ConfigValidationResult, DownloadRelayerCallbacks, StorageRequiredMarker, RelayerRequiredMarker, } from "./config";
|
|
27
|
+
export { isWalletConfig, isChainConfig, isReadOnlyConfig, isAddressOnlyConfig, hasStorageConfig, } from "./config";
|
|
3
28
|
export type { VanaChainId, VanaChain } from "./chains";
|
|
4
29
|
export { isVanaChainId, isVanaChain } from "./chains";
|
|
5
30
|
export type { VanaContractName, ContractInfo, ContractDeployment, VanaContractInstance, ContractAddresses, ContractMethodParams, ContractMethodReturnType, } from "./contracts";
|
|
6
31
|
export type { StorageProvider, StorageUploadResult, StorageFile, StorageListOptions, StorageProviderConfig, } from "./storage";
|
|
7
32
|
export { StorageError } from "./storage";
|
|
8
|
-
export type { UserFile, FileMetadata, UploadParams, FilePermissionParams, LegacyPermissionParams, EncryptedUploadParams, UnencryptedUploadParams, UploadResult, UploadFileParams, UploadFileResult, UploadEncryptedFileResult, EncryptionInfo, GetUserFilesParams, GetFileParams, DownloadFileParams, DownloadFileResult, DeleteFileParams, DeleteFileResult, FileAccessPermissions, FileSharingConfig, BatchUploadParams, BatchUploadResult, SchemaMetadata, CompleteSchema, Schema, Refiner, AddSchemaParams, AddSchemaResult, AddRefinerParams, AddRefinerResult, UpdateSchemaIdParams, UpdateSchemaIdResult, TrustedServer, GetUserTrustedServersParams, } from "./data";
|
|
33
|
+
export type { UserFile, FileMetadata, UploadParams, FilePermissionParams, LegacyPermissionParams, EncryptedUploadParams, UnencryptedUploadParams, UploadResult, UploadFileParams, UploadFileResult, UploadEncryptedFileResult, EncryptionInfo, GetUserFilesParams, GetFileParams, EncryptFileOptions, EncryptFileResult, DecryptFileOptions, UploadFileWithPermissionsParams, AddFilePermissionParams, DecryptFileWithPermissionOptions, DownloadFileParams, DownloadFileResult, DeleteFileParams, DeleteFileResult, FileAccessPermissions, FileSharingConfig, BatchUploadParams, BatchUploadResult, SchemaMetadata, CompleteSchema, Schema, Refiner, AddSchemaParams, AddSchemaResult, AddRefinerParams, AddRefinerResult, UpdateSchemaIdParams, UpdateSchemaIdResult, TrustedServer, GetUserTrustedServersParams, } from "./data";
|
|
9
34
|
export type { CreateSchemaParams, CreateSchemaResult, } from "../controllers/schemas";
|
|
10
35
|
export type { DataSchema } from "../utils/schemaValidation";
|
|
11
36
|
export { SchemaValidationError, SchemaValidator, validateDataSchemaAgainstMetaSchema, validateDataAgainstSchema, fetchAndValidateSchema, } from "../utils/schemaValidation";
|
|
12
37
|
export type { OnChainPermissionGrant, GetUserPermissionsOptions, GrantPermissionParams, RevokePermissionParams, CheckPermissionParams, PermissionCheckResult, PermissionGrantDomain, PermissionGrantMessage, PermissionInputMessage, SimplifiedPermissionMessage, GrantFile, PermissionGrantTypedData, RevokePermissionTypedData, GenericTypedData, TypedDataPrimaryType, SpecificTypedData, PermissionOperation, PermissionStatus, QueryPermissionsParams, PermissionQueryResult, PermissionAnalytics, PermissionEvent, GrantedPermission, Server, AddAndTrustServerParams, TrustServerParams, UntrustServerParams, AddAndTrustServerInput, TrustServerInput, UntrustServerInput, AddAndTrustServerTypedData, TrustServerTypedData, UntrustServerTypedData, PermissionInfo, RevokePermissionInput, TrustedServerInfo, PaginatedTrustedServers, TrustedServerQueryOptions, BatchServerInfoResult, ServerTrustStatus, ServerInfo, Grantee, GranteeInfo, RegisterGranteeParams, RegisterGranteeInput, RegisterGranteeTypedData, GranteeQueryOptions, PaginatedGrantees, ServerFilesAndPermissionParams, ServerFilesAndPermissionTypedData, Permission, } from "./permissions";
|
|
13
|
-
export type {
|
|
38
|
+
export type { RuntimePermissionParams, RuntimeGrantFile, RuntimePermission, RuntimePermissionResult, } from "./runtimePermissions";
|
|
39
|
+
export type { OperationInvoice, PaymentSettlementResult, SettleWithNativeParams, SettleWithTokenParams, } from "./accessSettlement";
|
|
40
|
+
export type { PostRequestParams, CreateOperationParams, DownloadArtifactParams, InitPersonalServerParams, PersonalServerIdentity, } from "./personal";
|
|
41
|
+
export type { Operation, Artifact, PollingOptions, TransactionResult, TransactionReceipt as OperationTransactionReceipt, TransactionWaitOptions, } from "./operations";
|
|
14
42
|
export type * from "../generated/server/server-exports";
|
|
15
43
|
export type { ReplicateAPIResponse, ReplicateStatus, PinataUploadResponse, PinataPin, PinataListResponse, APIResponse, } from "./external-apis";
|
|
16
44
|
export { isReplicateAPIResponse, isAPIResponse, safeParseJSON, parseReplicateOutput, } from "./external-apis";
|
|
17
|
-
export type { RelayerStorageResponse, RelayerTransactionResponse, RelayerStoreParams, RelayerSubmitParams, RelayerStatus, RelayerConfig, RelayerRequestOptions, RelayerErrorResponse, RelayerQueueInfo, RelayerTransactionStatus, RelayerMetrics, RelayerWebhookConfig, RelayerWebhookPayload, } from "./relayer";
|
|
18
|
-
export type { PartialExcept, RequiredExcept, Awaited, MaybePromise, MaybeArray, PaginationParams, PaginationResult, BlockRange,
|
|
45
|
+
export type { RelayerStorageResponse, RelayerTransactionResponse, RelayerStoreParams, RelayerSubmitParams, RelayerStatus, RelayerConfig, UnifiedRelayerRequest, UnifiedRelayerResponse, SignedRelayerRequest, DirectRelayerRequest, RelayerRequestOptions, RelayerErrorResponse, RelayerQueueInfo, RelayerTransactionStatus, RelayerMetrics, RelayerWebhookConfig, RelayerWebhookPayload, } from "./relayer";
|
|
46
|
+
export type { PartialExcept, RequiredExcept, Awaited, MaybePromise, MaybeArray, PaginationParams, PaginationResult, BlockRange, ApiResponse, CacheConfig, ValidationResult, StatusInfo, RateLimitInfo, UploadProgress, NetworkInfo, GasEstimate, TimeRange, } from "./utils";
|
|
47
|
+
export type { IOperationStore, StoredOperation, IRelayerStateStore, OperationState, } from "./operationStore";
|
|
48
|
+
export type { ConsistencyOptions, DataSource, PaginationOptions, ListOptions, WriteOptions, LegacyTransactionOptions, } from "./options";
|
|
19
49
|
export type { GenericRequest, GenericResponse, AsyncResult, ContractCall, EventFilter, EventLog, ControllerContext, Controller, Cache, RetryConfig, RateLimiterConfig, Middleware, Plugin, Factory, Repository, Validator, Transformer, Service, Observer, Observable, StateMachine, ConditionalOptional, PromiseResult, AllKeys, DeepPartial, DeepReadonly, RequireKeys, OptionalKeys, NonNullable, PickByType, OmitByType, Brand, Nominal, } from "./generics";
|
|
20
50
|
export type { Address, Hash, Abi, Chain, WalletClient, PublicClient, Account, GetContractReturnType, } from "viem";
|
package/dist/types/index.js
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
isWalletConfig,
|
|
3
|
+
isChainConfig,
|
|
4
|
+
isReadOnlyConfig,
|
|
5
|
+
isAddressOnlyConfig,
|
|
6
|
+
hasStorageConfig
|
|
7
|
+
} from "./config";
|
|
2
8
|
import { isVanaChainId, isVanaChain } from "./chains";
|
|
3
9
|
import { StorageError } from "./storage";
|
|
4
10
|
import {
|
|
@@ -21,7 +27,9 @@ export {
|
|
|
21
27
|
fetchAndValidateSchema,
|
|
22
28
|
hasStorageConfig,
|
|
23
29
|
isAPIResponse,
|
|
30
|
+
isAddressOnlyConfig,
|
|
24
31
|
isChainConfig,
|
|
32
|
+
isReadOnlyConfig,
|
|
25
33
|
isReplicateAPIResponse,
|
|
26
34
|
isVanaChain,
|
|
27
35
|
isVanaChainId,
|
package/dist/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["// Configuration types\nexport type {\n BaseConfig,\n BaseConfigWithStorage,\n WalletConfig,\n WalletConfigWithStorage,\n ChainConfig,\n ChainConfigWithStorage,\n VanaConfig,\n VanaConfigWithStorage,\n RuntimeConfig,\n StorageConfig,\n ConfigValidationOptions,\n ConfigValidationResult,\n
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts"],"sourcesContent":["/**\n * Centralized type exports for the Vana SDK.\n *\n * @remarks\n * This module re-exports all public types from their respective modules,\n * providing a single import point for SDK consumers. Types are organized\n * by category for easy discovery and usage.\n *\n * **Import Strategy:**\n * - Import types from this module for application code\n * - Import from specific modules only for advanced use cases\n * - Avoid importing from internal paths\n *\n * @example\n * ```typescript\n * // Recommended: Import from types module\n * import type { VanaConfig, UserFile, GrantPermissionParams } from '@opendatalabs/vana-sdk';\n *\n * // Alternative: Import from specific category\n * import type { StorageProvider } from '@opendatalabs/vana-sdk';\n * ```\n *\n * @category Types\n * @module types\n */\n\n// Configuration types\nexport type {\n BaseConfig,\n BaseConfigWithStorage,\n WalletConfig,\n WalletConfigWithStorage,\n ChainConfig,\n ChainConfigWithStorage,\n VanaConfig,\n VanaConfigWithStorage,\n VanaConfigWithWallet,\n VanaConfigReadOnly,\n VanaConfigAddressOnly,\n VanaConfigWithWalletWithStorage,\n VanaConfigReadOnlyWithStorage,\n VanaConfigAddressOnlyWithStorage,\n RuntimeConfig,\n StorageConfig,\n ConfigValidationOptions,\n ConfigValidationResult,\n DownloadRelayerCallbacks,\n StorageRequiredMarker,\n RelayerRequiredMarker,\n} from \"./config\";\n\nexport {\n isWalletConfig,\n isChainConfig,\n isReadOnlyConfig,\n isAddressOnlyConfig,\n hasStorageConfig,\n} from \"./config\";\n\n// Chain types\nexport type { VanaChainId, VanaChain } from \"./chains\";\n\nexport { isVanaChainId, isVanaChain } from \"./chains\";\n\n// Contract types\nexport type {\n VanaContractName,\n ContractInfo,\n ContractDeployment,\n VanaContractInstance,\n ContractAddresses,\n ContractMethodParams,\n ContractMethodReturnType,\n} from \"./contracts\";\n\n// Note: VanaContract and ContractAbis are exported directly from src/index.ts\n// to avoid circular dependencies. Do not re-export them here.\n\n// Storage types\nexport type {\n StorageProvider,\n StorageUploadResult,\n StorageFile,\n StorageListOptions,\n StorageProviderConfig,\n} from \"./storage\";\n\nexport { StorageError } from \"./storage\";\n\n// Data types\nexport type {\n UserFile,\n FileMetadata,\n UploadParams,\n FilePermissionParams,\n LegacyPermissionParams,\n EncryptedUploadParams,\n UnencryptedUploadParams,\n UploadResult,\n UploadFileParams,\n UploadFileResult,\n UploadEncryptedFileResult,\n EncryptionInfo,\n GetUserFilesParams,\n GetFileParams,\n EncryptFileOptions,\n EncryptFileResult,\n DecryptFileOptions,\n UploadFileWithPermissionsParams,\n AddFilePermissionParams,\n DecryptFileWithPermissionOptions,\n DownloadFileParams,\n DownloadFileResult,\n DeleteFileParams,\n DeleteFileResult,\n FileAccessPermissions,\n FileSharingConfig,\n BatchUploadParams,\n BatchUploadResult,\n SchemaMetadata,\n CompleteSchema,\n Schema,\n Refiner,\n AddSchemaParams,\n AddSchemaResult,\n AddRefinerParams,\n AddRefinerResult,\n UpdateSchemaIdParams,\n UpdateSchemaIdResult,\n TrustedServer,\n GetUserTrustedServersParams,\n} from \"./data\";\n\n// Schema types\nexport type {\n CreateSchemaParams,\n CreateSchemaResult,\n} from \"../controllers/schemas\";\n\n// Schema validation types\nexport type { DataSchema } from \"../utils/schemaValidation\";\nexport {\n SchemaValidationError,\n SchemaValidator,\n validateDataSchemaAgainstMetaSchema,\n validateDataAgainstSchema,\n fetchAndValidateSchema,\n} from \"../utils/schemaValidation\";\n\n// Permission types\nexport type {\n OnChainPermissionGrant,\n GetUserPermissionsOptions,\n GrantPermissionParams,\n RevokePermissionParams,\n CheckPermissionParams,\n PermissionCheckResult,\n PermissionGrantDomain,\n PermissionGrantMessage,\n PermissionInputMessage,\n SimplifiedPermissionMessage,\n GrantFile,\n PermissionGrantTypedData,\n RevokePermissionTypedData,\n GenericTypedData,\n TypedDataPrimaryType,\n SpecificTypedData,\n PermissionOperation,\n PermissionStatus,\n QueryPermissionsParams,\n PermissionQueryResult,\n PermissionAnalytics,\n PermissionEvent,\n GrantedPermission,\n Server,\n AddAndTrustServerParams,\n TrustServerParams,\n UntrustServerParams,\n AddAndTrustServerInput,\n TrustServerInput,\n UntrustServerInput,\n AddAndTrustServerTypedData,\n TrustServerTypedData,\n UntrustServerTypedData,\n PermissionInfo,\n RevokePermissionInput,\n TrustedServerInfo,\n PaginatedTrustedServers,\n TrustedServerQueryOptions,\n BatchServerInfoResult,\n ServerTrustStatus,\n ServerInfo,\n Grantee,\n GranteeInfo,\n RegisterGranteeParams,\n RegisterGranteeInput,\n RegisterGranteeTypedData,\n GranteeQueryOptions,\n PaginatedGrantees,\n ServerFilesAndPermissionParams,\n ServerFilesAndPermissionTypedData,\n Permission,\n} from \"./permissions\";\n\n// Runtime Permissions types\nexport type {\n RuntimePermissionParams,\n RuntimeGrantFile,\n RuntimePermission,\n RuntimePermissionResult,\n} from \"./runtimePermissions\";\n\n// Access Settlement types\nexport type {\n OperationInvoice,\n PaymentSettlementResult,\n SettleWithNativeParams,\n SettleWithTokenParams,\n} from \"./accessSettlement\";\n\n// Personal server types\nexport type {\n PostRequestParams,\n CreateOperationParams,\n DownloadArtifactParams,\n InitPersonalServerParams,\n PersonalServerIdentity,\n} from \"./personal\";\n\n// Operations types\nexport type {\n Operation,\n Artifact,\n PollingOptions,\n TransactionResult,\n TransactionReceipt as OperationTransactionReceipt,\n TransactionWaitOptions,\n} from \"./operations\";\n\n// Server API types (auto-generated via fetch-server-types.ts)\nexport type * from \"../generated/server/server-exports\";\n\n// External API types\nexport type {\n ReplicateAPIResponse,\n ReplicateStatus,\n PinataUploadResponse,\n PinataPin,\n PinataListResponse,\n APIResponse,\n} from \"./external-apis\";\n\nexport {\n isReplicateAPIResponse,\n isAPIResponse,\n safeParseJSON,\n parseReplicateOutput,\n} from \"./external-apis\";\n\n// Relayer types\nexport type {\n RelayerStorageResponse,\n RelayerTransactionResponse,\n RelayerStoreParams,\n RelayerSubmitParams,\n RelayerStatus,\n RelayerConfig,\n UnifiedRelayerRequest,\n UnifiedRelayerResponse,\n SignedRelayerRequest,\n DirectRelayerRequest,\n RelayerRequestOptions,\n RelayerErrorResponse,\n RelayerQueueInfo,\n RelayerTransactionStatus,\n RelayerMetrics,\n RelayerWebhookConfig,\n RelayerWebhookPayload,\n} from \"./relayer\";\n\n// Utility types\nexport type {\n PartialExcept,\n RequiredExcept,\n Awaited,\n MaybePromise,\n MaybeArray,\n PaginationParams,\n PaginationResult,\n BlockRange,\n ApiResponse,\n CacheConfig,\n ValidationResult,\n StatusInfo,\n RateLimitInfo,\n UploadProgress,\n NetworkInfo,\n GasEstimate,\n TimeRange,\n} from \"./utils\";\n\n// Operation store types\nexport type {\n IOperationStore,\n StoredOperation,\n IRelayerStateStore,\n OperationState,\n} from \"./operationStore\";\n\n// Options types\nexport type {\n ConsistencyOptions,\n DataSource,\n PaginationOptions,\n ListOptions,\n WriteOptions,\n LegacyTransactionOptions,\n} from \"./options\";\n\n// Generic types for extensibility\nexport type {\n GenericRequest,\n GenericResponse,\n AsyncResult,\n ContractCall,\n EventFilter,\n EventLog,\n ControllerContext,\n Controller,\n Cache,\n RetryConfig,\n RateLimiterConfig,\n Middleware,\n Plugin,\n Factory,\n Repository,\n Validator,\n Transformer,\n Service,\n Observer,\n Observable,\n StateMachine,\n ConditionalOptional,\n PromiseResult,\n AllKeys,\n DeepPartial,\n DeepReadonly,\n RequireKeys,\n OptionalKeys,\n NonNullable,\n PickByType,\n OmitByType,\n Brand,\n Nominal,\n} from \"./generics\";\n\n// Re-export viem types that are commonly used\nexport type {\n Address,\n Hash,\n Abi,\n Chain,\n WalletClient,\n PublicClient,\n Account,\n GetContractReturnType,\n} from \"viem\";\n"],"mappings":"AAmDA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAKP,SAAS,eAAe,mBAAmB;AAyB3C,SAAS,oBAAoB;AAsD7B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAyGP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
var operationStore_exports = {};
|
|
16
|
+
module.exports = __toCommonJS(operationStore_exports);
|
|
17
|
+
//# sourceMappingURL=operationStore.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/types/operationStore.ts"],"sourcesContent":["/**\n * Operation storage interfaces for queuing and managing asynchronous operations.\n *\n * @module\n */\n\nimport type { Hash, TransactionReceipt } from \"viem\";\nimport type { UnifiedRelayerRequest } from \"./relayer\";\n\n/**\n * The state of an asynchronous, relayed operation.\n *\n * @remarks\n * This is the data the application backend is responsible for persisting.\n * It serves as a complete recovery log for a given operation.\n *\n * @category Operations\n */\nexport interface OperationState {\n status: \"pending\" | \"confirmed\" | \"failed\";\n transactionHash: Hash;\n originalRequest: UnifiedRelayerRequest;\n nonce?: number;\n retryCount: number;\n lastAttemptedGas: { maxFeePerGas?: string; maxPriorityFeePerGas?: string };\n submittedAt: number; // Unix timestamp (ms)\n finalReceipt?: TransactionReceipt;\n error?: string;\n}\n\n/**\n * Simple storage interface for operation state tracking.\n *\n * @remarks\n * This interface is used by the relayer handler to track operation state\n * in a stateful mode. Implementations can use any backend storage system.\n *\n * @category Operations\n */\nexport interface IRelayerStateStore {\n /**\n * Gets the state of an operation.\n *\n * @param operationId - The operation ID\n * @returns The operation state or null if not found\n */\n get(operationId: string): Promise<OperationState | null>;\n\n /**\n * Sets the state of an operation.\n *\n * @param operationId - The operation ID\n * @param state - The operation state to store\n */\n set(operationId: string, state: OperationState): Promise<void>;\n}\n\n/**\n * Represents a stored operation in the queue.\n */\nexport interface StoredOperation {\n /** Unique identifier for the operation */\n id: string;\n /** Current status of the operation */\n status: \"queued\" | \"processing\" | \"submitted\" | \"completed\" | \"failed\";\n /** Serialized transaction or operation data */\n data: string;\n /** Number of retry attempts */\n retryCount?: number;\n /** Timestamp when the operation was created */\n createdAt?: number;\n /** Additional metadata */\n metadata?: any;\n}\n\n/**\n * Interface for operation storage backends.\n *\n * @remarks\n * Implementations of this interface provide persistent storage for queued\n * operations in a distributed relayer system. This allows operations to\n * be processed asynchronously and recovered after failures.\n *\n * Common implementations include:\n * - PostgreSQL for production environments\n * - MongoDB for document-based storage\n * - DynamoDB for serverless deployments\n * - In-memory storage for testing\n *\n * @example\n * ```typescript\n * class PostgresOperationStore implements IOperationStore {\n * async storeOperation(operation) {\n * await this.db.query(\n * 'INSERT INTO operations (id, status, data) VALUES ($1, $2, $3)',\n * [operation.id, 'queued', operation.data]\n * );\n * }\n *\n * async getQueuedOperations(options) {\n * const result = await this.db.query(\n * 'SELECT * FROM operations WHERE status = $1 LIMIT $2',\n * ['queued', options.limit || 100]\n * );\n * return result.rows;\n * }\n * }\n * ```\n *\n * @category Storage\n */\nexport interface IOperationStore {\n /**\n * Stores a new operation in the queue.\n *\n * @param operation - The operation to store\n * @returns Promise that resolves when the operation is stored\n */\n storeOperation(operation: {\n id: string;\n data: any;\n metadata?: any;\n }): Promise<void>;\n\n /**\n * Retrieves queued operations for processing.\n *\n * @param options - Query options\n * @returns Promise resolving to an array of queued operations\n */\n getQueuedOperations(options?: { limit?: number }): Promise<StoredOperation[]>;\n\n /**\n * Updates the status of an operation.\n *\n * @param operationId - The ID of the operation to update\n * @param status - The new status\n * @param metadata - Optional metadata to store with the update\n * @returns Promise that resolves when the status is updated\n */\n updateStatus(\n operationId: string,\n status: string,\n metadata?: any,\n ): Promise<void>;\n\n /**\n * Gets operations currently being processed.\n *\n * @param options - Query options\n * @returns Promise resolving to an array of processing operations\n */\n getProcessingOperations?(options?: {\n limit?: number;\n }): Promise<StoredOperation[]>;\n\n /**\n * Gets failed operations.\n *\n * @param options - Query options\n * @returns Promise resolving to an array of failed operations\n */\n getFailedOperations?(options?: {\n limit?: number;\n }): Promise<StoredOperation[]>;\n\n /**\n * Gets the status of a specific operation.\n *\n * @param operationId - The ID of the operation to check\n * @returns Promise resolving to the operation or null if not found\n */\n getOperation?(operationId: string): Promise<StoredOperation | null>;\n\n /**\n * Deletes an operation from storage.\n *\n * @param operationId - The ID of the operation to delete\n * @returns Promise that resolves when the operation is deleted\n */\n deleteOperation?(operationId: string): Promise<void>;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Operation storage interfaces for queuing and managing asynchronous operations.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import type { Hash, TransactionReceipt } from "viem";
|
|
7
|
+
import type { UnifiedRelayerRequest } from "./relayer";
|
|
8
|
+
/**
|
|
9
|
+
* The state of an asynchronous, relayed operation.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* This is the data the application backend is responsible for persisting.
|
|
13
|
+
* It serves as a complete recovery log for a given operation.
|
|
14
|
+
*
|
|
15
|
+
* @category Operations
|
|
16
|
+
*/
|
|
17
|
+
export interface OperationState {
|
|
18
|
+
status: "pending" | "confirmed" | "failed";
|
|
19
|
+
transactionHash: Hash;
|
|
20
|
+
originalRequest: UnifiedRelayerRequest;
|
|
21
|
+
nonce?: number;
|
|
22
|
+
retryCount: number;
|
|
23
|
+
lastAttemptedGas: {
|
|
24
|
+
maxFeePerGas?: string;
|
|
25
|
+
maxPriorityFeePerGas?: string;
|
|
26
|
+
};
|
|
27
|
+
submittedAt: number;
|
|
28
|
+
finalReceipt?: TransactionReceipt;
|
|
29
|
+
error?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Simple storage interface for operation state tracking.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* This interface is used by the relayer handler to track operation state
|
|
36
|
+
* in a stateful mode. Implementations can use any backend storage system.
|
|
37
|
+
*
|
|
38
|
+
* @category Operations
|
|
39
|
+
*/
|
|
40
|
+
export interface IRelayerStateStore {
|
|
41
|
+
/**
|
|
42
|
+
* Gets the state of an operation.
|
|
43
|
+
*
|
|
44
|
+
* @param operationId - The operation ID
|
|
45
|
+
* @returns The operation state or null if not found
|
|
46
|
+
*/
|
|
47
|
+
get(operationId: string): Promise<OperationState | null>;
|
|
48
|
+
/**
|
|
49
|
+
* Sets the state of an operation.
|
|
50
|
+
*
|
|
51
|
+
* @param operationId - The operation ID
|
|
52
|
+
* @param state - The operation state to store
|
|
53
|
+
*/
|
|
54
|
+
set(operationId: string, state: OperationState): Promise<void>;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Represents a stored operation in the queue.
|
|
58
|
+
*/
|
|
59
|
+
export interface StoredOperation {
|
|
60
|
+
/** Unique identifier for the operation */
|
|
61
|
+
id: string;
|
|
62
|
+
/** Current status of the operation */
|
|
63
|
+
status: "queued" | "processing" | "submitted" | "completed" | "failed";
|
|
64
|
+
/** Serialized transaction or operation data */
|
|
65
|
+
data: string;
|
|
66
|
+
/** Number of retry attempts */
|
|
67
|
+
retryCount?: number;
|
|
68
|
+
/** Timestamp when the operation was created */
|
|
69
|
+
createdAt?: number;
|
|
70
|
+
/** Additional metadata */
|
|
71
|
+
metadata?: any;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Interface for operation storage backends.
|
|
75
|
+
*
|
|
76
|
+
* @remarks
|
|
77
|
+
* Implementations of this interface provide persistent storage for queued
|
|
78
|
+
* operations in a distributed relayer system. This allows operations to
|
|
79
|
+
* be processed asynchronously and recovered after failures.
|
|
80
|
+
*
|
|
81
|
+
* Common implementations include:
|
|
82
|
+
* - PostgreSQL for production environments
|
|
83
|
+
* - MongoDB for document-based storage
|
|
84
|
+
* - DynamoDB for serverless deployments
|
|
85
|
+
* - In-memory storage for testing
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```typescript
|
|
89
|
+
* class PostgresOperationStore implements IOperationStore {
|
|
90
|
+
* async storeOperation(operation) {
|
|
91
|
+
* await this.db.query(
|
|
92
|
+
* 'INSERT INTO operations (id, status, data) VALUES ($1, $2, $3)',
|
|
93
|
+
* [operation.id, 'queued', operation.data]
|
|
94
|
+
* );
|
|
95
|
+
* }
|
|
96
|
+
*
|
|
97
|
+
* async getQueuedOperations(options) {
|
|
98
|
+
* const result = await this.db.query(
|
|
99
|
+
* 'SELECT * FROM operations WHERE status = $1 LIMIT $2',
|
|
100
|
+
* ['queued', options.limit || 100]
|
|
101
|
+
* );
|
|
102
|
+
* return result.rows;
|
|
103
|
+
* }
|
|
104
|
+
* }
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* @category Storage
|
|
108
|
+
*/
|
|
109
|
+
export interface IOperationStore {
|
|
110
|
+
/**
|
|
111
|
+
* Stores a new operation in the queue.
|
|
112
|
+
*
|
|
113
|
+
* @param operation - The operation to store
|
|
114
|
+
* @returns Promise that resolves when the operation is stored
|
|
115
|
+
*/
|
|
116
|
+
storeOperation(operation: {
|
|
117
|
+
id: string;
|
|
118
|
+
data: any;
|
|
119
|
+
metadata?: any;
|
|
120
|
+
}): Promise<void>;
|
|
121
|
+
/**
|
|
122
|
+
* Retrieves queued operations for processing.
|
|
123
|
+
*
|
|
124
|
+
* @param options - Query options
|
|
125
|
+
* @returns Promise resolving to an array of queued operations
|
|
126
|
+
*/
|
|
127
|
+
getQueuedOperations(options?: {
|
|
128
|
+
limit?: number;
|
|
129
|
+
}): Promise<StoredOperation[]>;
|
|
130
|
+
/**
|
|
131
|
+
* Updates the status of an operation.
|
|
132
|
+
*
|
|
133
|
+
* @param operationId - The ID of the operation to update
|
|
134
|
+
* @param status - The new status
|
|
135
|
+
* @param metadata - Optional metadata to store with the update
|
|
136
|
+
* @returns Promise that resolves when the status is updated
|
|
137
|
+
*/
|
|
138
|
+
updateStatus(operationId: string, status: string, metadata?: any): Promise<void>;
|
|
139
|
+
/**
|
|
140
|
+
* Gets operations currently being processed.
|
|
141
|
+
*
|
|
142
|
+
* @param options - Query options
|
|
143
|
+
* @returns Promise resolving to an array of processing operations
|
|
144
|
+
*/
|
|
145
|
+
getProcessingOperations?(options?: {
|
|
146
|
+
limit?: number;
|
|
147
|
+
}): Promise<StoredOperation[]>;
|
|
148
|
+
/**
|
|
149
|
+
* Gets failed operations.
|
|
150
|
+
*
|
|
151
|
+
* @param options - Query options
|
|
152
|
+
* @returns Promise resolving to an array of failed operations
|
|
153
|
+
*/
|
|
154
|
+
getFailedOperations?(options?: {
|
|
155
|
+
limit?: number;
|
|
156
|
+
}): Promise<StoredOperation[]>;
|
|
157
|
+
/**
|
|
158
|
+
* Gets the status of a specific operation.
|
|
159
|
+
*
|
|
160
|
+
* @param operationId - The ID of the operation to check
|
|
161
|
+
* @returns Promise resolving to the operation or null if not found
|
|
162
|
+
*/
|
|
163
|
+
getOperation?(operationId: string): Promise<StoredOperation | null>;
|
|
164
|
+
/**
|
|
165
|
+
* Deletes an operation from storage.
|
|
166
|
+
*
|
|
167
|
+
* @param operationId - The ID of the operation to delete
|
|
168
|
+
* @returns Promise that resolves when the operation is deleted
|
|
169
|
+
*/
|
|
170
|
+
deleteOperation?(operationId: string): Promise<void>;
|
|
171
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=operationStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|