@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
package/dist/core.d.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import type { VanaConfig, VanaConfigWithStorage, RuntimeConfig, StorageRequiredMarker } from "./types";
|
|
2
|
+
import type { UnifiedRelayerResponse } from "./types/relayer";
|
|
2
3
|
import { PermissionsController } from "./controllers/permissions";
|
|
4
|
+
import { RuntimePermissionsController } from "./controllers/runtimePermissions";
|
|
5
|
+
import { AccessSettlementController } from "./controllers/accessSettlement";
|
|
3
6
|
import { DataController } from "./controllers/data";
|
|
4
7
|
import { SchemaController } from "./controllers/schemas";
|
|
5
8
|
import { ServerController } from "./controllers/server";
|
|
6
9
|
import { ProtocolController } from "./controllers/protocol";
|
|
7
|
-
import
|
|
10
|
+
import { OperationsController } from "./controllers/operations";
|
|
11
|
+
import type { PublicClient, Address, Hash, TransactionReceipt } from "viem";
|
|
8
12
|
import type { Operation, PollingOptions, TransactionResult, TransactionWaitOptions } from "./types/operations";
|
|
13
|
+
import type { IOperationStore, IRelayerStateStore } from "./types/operationStore";
|
|
14
|
+
import type { IAtomicStore } from "./types/atomicStore";
|
|
9
15
|
import type { Contract, Fn, TypedTransactionResult } from "./generated/event-types";
|
|
10
16
|
import type { VanaPlatformAdapter } from "./platform/interface";
|
|
11
17
|
/**
|
|
@@ -96,24 +102,33 @@ export declare class VanaCoreFactory {
|
|
|
96
102
|
export declare class VanaCore {
|
|
97
103
|
/** Manages gasless data access permissions and trusted server registry. */
|
|
98
104
|
readonly permissions: PermissionsController;
|
|
105
|
+
/** Manages runtime permissions for dataset monetization via Vana Runtime. */
|
|
106
|
+
readonly runtimePermissions: RuntimePermissionsController;
|
|
107
|
+
/** Manages payment settlement for runtime operations. */
|
|
108
|
+
readonly accessSettlement: AccessSettlementController;
|
|
99
109
|
/** Handles user data file operations. */
|
|
100
110
|
readonly data: DataController;
|
|
101
111
|
/** Manages data schemas and refiners. */
|
|
102
112
|
readonly schemas: SchemaController;
|
|
113
|
+
/** Manages asynchronous operation recovery and status checking. */
|
|
114
|
+
readonly operations: OperationsController;
|
|
103
115
|
/** Provides personal server setup and trusted server interactions. */
|
|
104
116
|
readonly server: ServerController;
|
|
105
117
|
/** Offers low-level access to Vana protocol smart contracts. */
|
|
106
118
|
readonly protocol: ProtocolController;
|
|
107
119
|
/** Handles environment-specific operations like encryption and file systems. */
|
|
108
120
|
protected platform: VanaPlatformAdapter;
|
|
109
|
-
private readonly
|
|
121
|
+
private readonly relayerConfig?;
|
|
122
|
+
private readonly relayerCallback?;
|
|
110
123
|
private readonly downloadRelayer?;
|
|
111
124
|
private readonly storageManager?;
|
|
112
125
|
private readonly hasRequiredStorage;
|
|
113
126
|
private readonly ipfsGateways?;
|
|
114
|
-
|
|
115
|
-
private readonly
|
|
116
|
-
private readonly
|
|
127
|
+
readonly publicClient: PublicClient;
|
|
128
|
+
private readonly walletClient?;
|
|
129
|
+
private readonly _staticUserAddress?;
|
|
130
|
+
protected readonly operationStore?: IOperationStore | IRelayerStateStore;
|
|
131
|
+
protected readonly atomicStore?: IAtomicStore;
|
|
117
132
|
/**
|
|
118
133
|
* Initializes a new VanaCore client instance with the provided configuration.
|
|
119
134
|
*
|
|
@@ -211,16 +226,17 @@ export declare class VanaCore {
|
|
|
211
226
|
*/
|
|
212
227
|
get chainName(): string;
|
|
213
228
|
/**
|
|
214
|
-
*
|
|
229
|
+
* The user's wallet address.
|
|
230
|
+
* In wallet mode, this always returns the current wallet account address.
|
|
231
|
+
* In read-only mode, this returns the static address provided during initialization.
|
|
215
232
|
*
|
|
216
|
-
* @returns A Promise that resolves to the user's Ethereum address
|
|
217
233
|
* @example
|
|
218
234
|
* ```typescript
|
|
219
|
-
* const address =
|
|
235
|
+
* const address = vana.userAddress;
|
|
220
236
|
* console.log(`User address: ${address}`); // e.g., "User address: 0x742d35..."
|
|
221
237
|
* ```
|
|
222
238
|
*/
|
|
223
|
-
|
|
239
|
+
get userAddress(): Address;
|
|
224
240
|
/**
|
|
225
241
|
* Retrieves comprehensive runtime configuration information.
|
|
226
242
|
*
|
|
@@ -377,7 +393,7 @@ export declare class VanaCore {
|
|
|
377
393
|
* });
|
|
378
394
|
* ```
|
|
379
395
|
*/
|
|
380
|
-
waitForOperation
|
|
396
|
+
waitForOperation(opOrId: Operation | string, options?: PollingOptions): Promise<Operation>;
|
|
381
397
|
/**
|
|
382
398
|
* Waits for a transaction to be confirmed and returns the receipt.
|
|
383
399
|
*
|
|
@@ -437,4 +453,47 @@ export declare class VanaCore {
|
|
|
437
453
|
* @see For understanding transaction flows, visit https://docs.vana.org/docs/transactions
|
|
438
454
|
*/
|
|
439
455
|
waitForTransactionEvents<C extends Contract, F extends Fn<C>>(transaction: TransactionResult<C, F>, options?: TransactionWaitOptions): Promise<TypedTransactionResult<C, F>>;
|
|
456
|
+
/**
|
|
457
|
+
* Enhances a unified relayer response with client-side behavior.
|
|
458
|
+
*
|
|
459
|
+
* @remarks
|
|
460
|
+
* This method wraps a relayer response in an enhanced object that provides
|
|
461
|
+
* a fluent `.wait()` method for handling asynchronous operations. The enhanced
|
|
462
|
+
* response intelligently handles both submitted transactions (via hash) and
|
|
463
|
+
* pending operations (via operationId).
|
|
464
|
+
*
|
|
465
|
+
* @param response - The unified relayer response to enhance
|
|
466
|
+
* @returns EnhancedTransactionResponse if the response can be enhanced, null otherwise
|
|
467
|
+
*
|
|
468
|
+
* @example
|
|
469
|
+
* ```typescript
|
|
470
|
+
* // Enhance a relayer response for fluent waiting
|
|
471
|
+
* const response = await handleRelayerOperation(vana, request);
|
|
472
|
+
* const enhanced = vana.enhanceRelayerResponse(response);
|
|
473
|
+
* if (enhanced) {
|
|
474
|
+
* const result = await enhanced.wait();
|
|
475
|
+
* if (result.expectedEvents?.FileAdded) {
|
|
476
|
+
* console.log('File ID:', result.expectedEvents.FileAdded.fileId);
|
|
477
|
+
* }
|
|
478
|
+
* }
|
|
479
|
+
* ```
|
|
480
|
+
*
|
|
481
|
+
* @example
|
|
482
|
+
* ```typescript
|
|
483
|
+
* // With status updates for pending operations
|
|
484
|
+
* const enhanced = vana.enhanceRelayerResponse(response);
|
|
485
|
+
* if (enhanced) {
|
|
486
|
+
* const result = await enhanced.wait({
|
|
487
|
+
* onStatusUpdate: (status) => {
|
|
488
|
+
* console.log('Operation status:', status.type);
|
|
489
|
+
* },
|
|
490
|
+
* timeout: 60000 // 1 minute timeout
|
|
491
|
+
* });
|
|
492
|
+
* }
|
|
493
|
+
* ```
|
|
494
|
+
*
|
|
495
|
+
* @category Relayer
|
|
496
|
+
* @since 0.2.0
|
|
497
|
+
*/
|
|
498
|
+
enhanceRelayerResponse(response: UnifiedRelayerResponse): Promise<any>;
|
|
440
499
|
}
|
package/dist/core.js
CHANGED
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isWalletConfig,
|
|
3
3
|
isChainConfig,
|
|
4
|
+
isReadOnlyConfig,
|
|
5
|
+
isAddressOnlyConfig,
|
|
4
6
|
isVanaChainId,
|
|
5
7
|
hasStorageConfig
|
|
6
8
|
} from "./types";
|
|
7
9
|
import { InvalidConfigurationError } from "./errors";
|
|
8
10
|
import { PermissionsController } from "./controllers/permissions";
|
|
11
|
+
import { RuntimePermissionsController } from "./controllers/runtimePermissions";
|
|
12
|
+
import { AccessSettlementController } from "./controllers/accessSettlement";
|
|
9
13
|
import { DataController } from "./controllers/data";
|
|
10
14
|
import { SchemaController } from "./controllers/schemas";
|
|
11
15
|
import { ServerController } from "./controllers/server";
|
|
12
16
|
import { ProtocolController } from "./controllers/protocol";
|
|
17
|
+
import { OperationsController } from "./controllers/operations";
|
|
13
18
|
import { StorageManager } from "./storage";
|
|
14
19
|
import { createWalletClient, createPublicClient, http } from "viem";
|
|
20
|
+
import { extractAddress } from "./utils/wallet";
|
|
15
21
|
import { chains } from "./config/chains";
|
|
16
|
-
import { getChainConfig } from "./chains";
|
|
22
|
+
import { getChainConfig, vanaMainnet } from "./chains";
|
|
17
23
|
import {
|
|
18
24
|
encryptBlobWithSignedKey,
|
|
19
25
|
decryptBlobWithSignedKey
|
|
@@ -62,24 +68,34 @@ class VanaCoreFactory {
|
|
|
62
68
|
class VanaCore {
|
|
63
69
|
/** Manages gasless data access permissions and trusted server registry. */
|
|
64
70
|
permissions;
|
|
71
|
+
/** Manages runtime permissions for dataset monetization via Vana Runtime. */
|
|
72
|
+
runtimePermissions;
|
|
73
|
+
/** Manages payment settlement for runtime operations. */
|
|
74
|
+
accessSettlement;
|
|
65
75
|
/** Handles user data file operations. */
|
|
66
76
|
data;
|
|
67
77
|
/** Manages data schemas and refiners. */
|
|
68
78
|
schemas;
|
|
79
|
+
/** Manages asynchronous operation recovery and status checking. */
|
|
80
|
+
operations;
|
|
69
81
|
/** Provides personal server setup and trusted server interactions. */
|
|
70
82
|
server;
|
|
71
83
|
/** Offers low-level access to Vana protocol smart contracts. */
|
|
72
84
|
protocol;
|
|
73
85
|
/** Handles environment-specific operations like encryption and file systems. */
|
|
74
86
|
platform;
|
|
75
|
-
|
|
87
|
+
relayerConfig;
|
|
88
|
+
relayerCallback;
|
|
76
89
|
downloadRelayer;
|
|
77
90
|
storageManager;
|
|
78
91
|
hasRequiredStorage;
|
|
79
92
|
ipfsGateways;
|
|
80
|
-
defaultPersonalServerUrl;
|
|
81
93
|
publicClient;
|
|
82
94
|
walletClient;
|
|
95
|
+
_staticUserAddress;
|
|
96
|
+
// For read-only mode
|
|
97
|
+
operationStore;
|
|
98
|
+
atomicStore;
|
|
83
99
|
/**
|
|
84
100
|
* Initializes a new VanaCore client instance with the provided configuration.
|
|
85
101
|
*
|
|
@@ -104,10 +120,33 @@ class VanaCore {
|
|
|
104
120
|
constructor(platform, config) {
|
|
105
121
|
this.platform = platform;
|
|
106
122
|
this.validateConfig(config);
|
|
107
|
-
this.
|
|
123
|
+
this.operationStore = config?.operationStore;
|
|
124
|
+
this.relayerConfig = config.relayer;
|
|
125
|
+
if (config.relayer) {
|
|
126
|
+
if (typeof config.relayer !== "string" && typeof config.relayer !== "function") {
|
|
127
|
+
throw new InvalidConfigurationError(
|
|
128
|
+
"Relayer must be either a URL string or a callback function"
|
|
129
|
+
);
|
|
130
|
+
}
|
|
131
|
+
if (typeof config.relayer === "string") {
|
|
132
|
+
const url = config.relayer;
|
|
133
|
+
this.relayerCallback = async (request) => {
|
|
134
|
+
const response = await fetch(url, {
|
|
135
|
+
method: "POST",
|
|
136
|
+
headers: { "Content-Type": "application/json" },
|
|
137
|
+
body: JSON.stringify(request)
|
|
138
|
+
});
|
|
139
|
+
if (!response.ok) {
|
|
140
|
+
throw new Error(`Relayer request failed: ${response.statusText}`);
|
|
141
|
+
}
|
|
142
|
+
return response.json();
|
|
143
|
+
};
|
|
144
|
+
} else {
|
|
145
|
+
this.relayerCallback = config.relayer;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
108
148
|
this.downloadRelayer = config.downloadRelayer;
|
|
109
149
|
this.ipfsGateways = config.ipfsGateways;
|
|
110
|
-
this.defaultPersonalServerUrl = config.defaultPersonalServerUrl;
|
|
111
150
|
this.hasRequiredStorage = hasStorageConfig(config);
|
|
112
151
|
if (config.storage?.providers) {
|
|
113
152
|
this.storageManager = new StorageManager();
|
|
@@ -121,8 +160,34 @@ class VanaCore {
|
|
|
121
160
|
}
|
|
122
161
|
}
|
|
123
162
|
let walletClient;
|
|
163
|
+
let publicClient;
|
|
164
|
+
let staticUserAddress;
|
|
165
|
+
let chainToUse;
|
|
124
166
|
if (isWalletConfig(config)) {
|
|
125
167
|
walletClient = config.walletClient;
|
|
168
|
+
chainToUse = walletClient.chain ?? vanaMainnet;
|
|
169
|
+
staticUserAddress = void 0;
|
|
170
|
+
if ("publicClient" in config && config.publicClient) {
|
|
171
|
+
publicClient = config.publicClient;
|
|
172
|
+
} else {
|
|
173
|
+
publicClient = createPublicClient({
|
|
174
|
+
chain: chainToUse,
|
|
175
|
+
transport: http()
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
} else if (isReadOnlyConfig(config)) {
|
|
179
|
+
walletClient = void 0;
|
|
180
|
+
publicClient = config.publicClient;
|
|
181
|
+
staticUserAddress = config.address;
|
|
182
|
+
chainToUse = config.publicClient.chain ?? vanaMainnet;
|
|
183
|
+
} else if (isAddressOnlyConfig(config)) {
|
|
184
|
+
walletClient = void 0;
|
|
185
|
+
staticUserAddress = config.address;
|
|
186
|
+
chainToUse = config.chain ?? vanaMainnet;
|
|
187
|
+
publicClient = createPublicClient({
|
|
188
|
+
chain: chainToUse,
|
|
189
|
+
transport: http()
|
|
190
|
+
});
|
|
126
191
|
} else if (isChainConfig(config)) {
|
|
127
192
|
if (!config.account) {
|
|
128
193
|
throw new InvalidConfigurationError(
|
|
@@ -135,30 +200,38 @@ class VanaCore {
|
|
|
135
200
|
`Unsupported chain ID: ${config.chainId}`
|
|
136
201
|
);
|
|
137
202
|
}
|
|
203
|
+
chainToUse = chain;
|
|
138
204
|
walletClient = createWalletClient({
|
|
139
205
|
chain,
|
|
140
206
|
transport: http(config.rpcUrl ?? chain.rpcUrls.default.http[0]),
|
|
141
207
|
account: config.account
|
|
142
208
|
});
|
|
209
|
+
staticUserAddress = void 0;
|
|
210
|
+
publicClient = createPublicClient({
|
|
211
|
+
chain,
|
|
212
|
+
transport: http()
|
|
213
|
+
});
|
|
143
214
|
} else {
|
|
144
215
|
throw new InvalidConfigurationError(
|
|
145
|
-
"Invalid configuration: must
|
|
216
|
+
"Invalid configuration: must provide either walletClient, publicClient + address, or address alone"
|
|
146
217
|
);
|
|
147
218
|
}
|
|
148
|
-
const publicClient = createPublicClient({
|
|
149
|
-
chain: walletClient.chain,
|
|
150
|
-
transport: http()
|
|
151
|
-
});
|
|
152
219
|
this.publicClient = publicClient;
|
|
153
220
|
this.walletClient = walletClient;
|
|
154
|
-
|
|
221
|
+
this._staticUserAddress = staticUserAddress;
|
|
222
|
+
const chainConfig = getChainConfig(chainToUse.id);
|
|
155
223
|
const subgraphUrl = config.subgraphUrl ?? chainConfig?.subgraphUrl;
|
|
224
|
+
const personalServerUrl = config.defaultPersonalServerUrl ?? chainConfig?.personalServerUrl;
|
|
225
|
+
const self = this;
|
|
156
226
|
const sharedContext = {
|
|
157
227
|
walletClient,
|
|
158
228
|
publicClient,
|
|
229
|
+
get userAddress() {
|
|
230
|
+
return self.userAddress;
|
|
231
|
+
},
|
|
159
232
|
applicationClient: walletClient,
|
|
160
233
|
// Using same wallet for now
|
|
161
|
-
|
|
234
|
+
relayer: this.relayerCallback,
|
|
162
235
|
downloadRelayer: this.downloadRelayer,
|
|
163
236
|
storageManager: this.storageManager,
|
|
164
237
|
subgraphUrl,
|
|
@@ -167,13 +240,17 @@ class VanaCore {
|
|
|
167
240
|
validateStorageRequired: this.validateStorageRequired.bind(this),
|
|
168
241
|
hasStorage: this.hasStorage.bind(this),
|
|
169
242
|
ipfsGateways: this.ipfsGateways,
|
|
170
|
-
defaultPersonalServerUrl:
|
|
243
|
+
defaultPersonalServerUrl: personalServerUrl,
|
|
171
244
|
waitForTransactionEvents: this.waitForTransactionEvents.bind(this),
|
|
172
|
-
waitForOperation: this.waitForOperation.bind(this)
|
|
245
|
+
waitForOperation: this.waitForOperation.bind(this),
|
|
246
|
+
operationStore: this.operationStore
|
|
173
247
|
};
|
|
174
248
|
this.permissions = new PermissionsController(sharedContext);
|
|
249
|
+
this.runtimePermissions = new RuntimePermissionsController(sharedContext);
|
|
250
|
+
this.accessSettlement = new AccessSettlementController(sharedContext);
|
|
175
251
|
this.data = new DataController(sharedContext);
|
|
176
252
|
this.schemas = new SchemaController(sharedContext);
|
|
253
|
+
this.operations = new OperationsController(sharedContext);
|
|
177
254
|
this.server = new ServerController(sharedContext);
|
|
178
255
|
this.protocol = new ProtocolController(sharedContext);
|
|
179
256
|
}
|
|
@@ -193,7 +270,7 @@ class VanaCore {
|
|
|
193
270
|
validateStorageRequired() {
|
|
194
271
|
if (!this.hasRequiredStorage) {
|
|
195
272
|
throw new InvalidConfigurationError(
|
|
196
|
-
"Storage configuration is required for this operation. Please configure storage providers in VanaConfig.storage, provide a
|
|
273
|
+
"Storage configuration is required for this operation. Please configure storage providers in VanaConfig.storage, provide a relayer configuration, or pass pre-stored URLs to avoid this dependency. \n\nFor better type safety, consider using VanaCoreFactory.createWithStorage() with VanaConfigWithStorage to catch this error at compile time."
|
|
197
274
|
);
|
|
198
275
|
}
|
|
199
276
|
}
|
|
@@ -242,13 +319,6 @@ class VanaCore {
|
|
|
242
319
|
if (!config) {
|
|
243
320
|
throw new InvalidConfigurationError("Configuration object is required");
|
|
244
321
|
}
|
|
245
|
-
if (config.relayerCallbacks !== void 0) {
|
|
246
|
-
if (typeof config.relayerCallbacks !== "object") {
|
|
247
|
-
throw new InvalidConfigurationError(
|
|
248
|
-
"relayerCallbacks must be an object"
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
322
|
if (config.storage?.providers) {
|
|
253
323
|
if (typeof config.storage.providers !== "object") {
|
|
254
324
|
throw new InvalidConfigurationError(
|
|
@@ -315,9 +385,26 @@ class VanaCore {
|
|
|
315
385
|
);
|
|
316
386
|
}
|
|
317
387
|
}
|
|
388
|
+
} else if (isReadOnlyConfig(config)) {
|
|
389
|
+
if (!config.publicClient) {
|
|
390
|
+
throw new InvalidConfigurationError(
|
|
391
|
+
"publicClient is required for read-only configuration"
|
|
392
|
+
);
|
|
393
|
+
}
|
|
394
|
+
if (!config.address) {
|
|
395
|
+
throw new InvalidConfigurationError(
|
|
396
|
+
"address is required for read-only configuration"
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
} else if (isAddressOnlyConfig(config)) {
|
|
400
|
+
if (!config.address) {
|
|
401
|
+
throw new InvalidConfigurationError(
|
|
402
|
+
"address is required for address-only configuration"
|
|
403
|
+
);
|
|
404
|
+
}
|
|
318
405
|
} else {
|
|
319
406
|
throw new InvalidConfigurationError(
|
|
320
|
-
"
|
|
407
|
+
"Invalid configuration: must provide either walletClient, publicClient + address, or address alone"
|
|
321
408
|
);
|
|
322
409
|
}
|
|
323
410
|
}
|
|
@@ -348,27 +435,24 @@ class VanaCore {
|
|
|
348
435
|
return this.protocol.getChainName();
|
|
349
436
|
}
|
|
350
437
|
/**
|
|
351
|
-
*
|
|
438
|
+
* The user's wallet address.
|
|
439
|
+
* In wallet mode, this always returns the current wallet account address.
|
|
440
|
+
* In read-only mode, this returns the static address provided during initialization.
|
|
352
441
|
*
|
|
353
|
-
* @returns A Promise that resolves to the user's Ethereum address
|
|
354
442
|
* @example
|
|
355
443
|
* ```typescript
|
|
356
|
-
* const address =
|
|
444
|
+
* const address = vana.userAddress;
|
|
357
445
|
* console.log(`User address: ${address}`); // e.g., "User address: 0x742d35..."
|
|
358
446
|
* ```
|
|
359
447
|
*/
|
|
360
|
-
|
|
361
|
-
if (
|
|
362
|
-
|
|
363
|
-
}
|
|
364
|
-
const { account } = this.walletClient;
|
|
365
|
-
if (typeof account === "string") {
|
|
366
|
-
return account;
|
|
448
|
+
get userAddress() {
|
|
449
|
+
if (this.walletClient?.account) {
|
|
450
|
+
return extractAddress(this.walletClient.account);
|
|
367
451
|
}
|
|
368
|
-
if (
|
|
369
|
-
return
|
|
452
|
+
if (this._staticUserAddress) {
|
|
453
|
+
return this._staticUserAddress;
|
|
370
454
|
}
|
|
371
|
-
throw new Error("
|
|
455
|
+
throw new Error("No user address available");
|
|
372
456
|
}
|
|
373
457
|
/**
|
|
374
458
|
* Retrieves comprehensive runtime configuration information.
|
|
@@ -385,7 +469,7 @@ class VanaCore {
|
|
|
385
469
|
return {
|
|
386
470
|
chainId: this.chainId,
|
|
387
471
|
chainName: this.chainName,
|
|
388
|
-
|
|
472
|
+
relayerConfig: this.relayerConfig,
|
|
389
473
|
storageProviders: this.storageManager?.getStorageProviders() ?? [],
|
|
390
474
|
defaultStorageProvider: this.storageManager?.getDefaultStorageProvider()
|
|
391
475
|
};
|
|
@@ -622,6 +706,52 @@ class VanaCore {
|
|
|
622
706
|
const result = parseTransaction(transaction, receipt);
|
|
623
707
|
return result;
|
|
624
708
|
}
|
|
709
|
+
/**
|
|
710
|
+
* Enhances a unified relayer response with client-side behavior.
|
|
711
|
+
*
|
|
712
|
+
* @remarks
|
|
713
|
+
* This method wraps a relayer response in an enhanced object that provides
|
|
714
|
+
* a fluent `.wait()` method for handling asynchronous operations. The enhanced
|
|
715
|
+
* response intelligently handles both submitted transactions (via hash) and
|
|
716
|
+
* pending operations (via operationId).
|
|
717
|
+
*
|
|
718
|
+
* @param response - The unified relayer response to enhance
|
|
719
|
+
* @returns EnhancedTransactionResponse if the response can be enhanced, null otherwise
|
|
720
|
+
*
|
|
721
|
+
* @example
|
|
722
|
+
* ```typescript
|
|
723
|
+
* // Enhance a relayer response for fluent waiting
|
|
724
|
+
* const response = await handleRelayerOperation(vana, request);
|
|
725
|
+
* const enhanced = vana.enhanceRelayerResponse(response);
|
|
726
|
+
* if (enhanced) {
|
|
727
|
+
* const result = await enhanced.wait();
|
|
728
|
+
* if (result.expectedEvents?.FileAdded) {
|
|
729
|
+
* console.log('File ID:', result.expectedEvents.FileAdded.fileId);
|
|
730
|
+
* }
|
|
731
|
+
* }
|
|
732
|
+
* ```
|
|
733
|
+
*
|
|
734
|
+
* @example
|
|
735
|
+
* ```typescript
|
|
736
|
+
* // With status updates for pending operations
|
|
737
|
+
* const enhanced = vana.enhanceRelayerResponse(response);
|
|
738
|
+
* if (enhanced) {
|
|
739
|
+
* const result = await enhanced.wait({
|
|
740
|
+
* onStatusUpdate: (status) => {
|
|
741
|
+
* console.log('Operation status:', status.type);
|
|
742
|
+
* },
|
|
743
|
+
* timeout: 60000 // 1 minute timeout
|
|
744
|
+
* });
|
|
745
|
+
* }
|
|
746
|
+
* ```
|
|
747
|
+
*
|
|
748
|
+
* @category Relayer
|
|
749
|
+
* @since 0.2.0
|
|
750
|
+
*/
|
|
751
|
+
async enhanceRelayerResponse(response) {
|
|
752
|
+
const { enhanceResponse } = await import("./client/enhancedResponse");
|
|
753
|
+
return enhanceResponse(response, this);
|
|
754
|
+
}
|
|
625
755
|
}
|
|
626
756
|
export {
|
|
627
757
|
VanaCore,
|