@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/types/config.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type { WalletClient,
|
|
1
|
+
import type { WalletClient, PublicClient, Account, Address, Chain } from "viem";
|
|
2
2
|
import type { VanaChainId, VanaChain } from "./chains";
|
|
3
3
|
import type { StorageProvider, StorageUploadResult, StorageListOptions } from "./storage";
|
|
4
|
-
import type {
|
|
4
|
+
import type { RelayerConfig } from "./relayer";
|
|
5
|
+
import type { IOperationStore, IRelayerStateStore } from "./operationStore";
|
|
5
6
|
/**
|
|
6
7
|
* Marker interface to indicate that a Vana instance has storage configured.
|
|
7
8
|
* Used for compile-time type safety to ensure storage-dependent methods
|
|
@@ -13,10 +14,12 @@ export interface StorageRequiredMarker {
|
|
|
13
14
|
readonly __storageRequired: true;
|
|
14
15
|
}
|
|
15
16
|
/**
|
|
16
|
-
*
|
|
17
|
+
* Configures storage providers for SDK file operations.
|
|
17
18
|
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* Supports multiple backends with automatic fallback.
|
|
21
|
+
* IPFS for decentralization, Pinata for reliability,
|
|
22
|
+
* Google Drive for development, custom for flexibility.
|
|
20
23
|
*
|
|
21
24
|
* **Provider Selection:**
|
|
22
25
|
* - IPFS: Decentralized, permanent storage ideal for production
|
|
@@ -30,7 +33,7 @@ export interface StorageRequiredMarker {
|
|
|
30
33
|
* const storage: StorageConfig = {
|
|
31
34
|
* providers: {
|
|
32
35
|
* ipfs: new IPFSStorage({ gateway: 'https://gateway.pinata.cloud' }),
|
|
33
|
-
* pinata: new PinataStorage({ apiKey: '
|
|
36
|
+
* pinata: new PinataStorage({ apiKey: 'key', secretKey: 'secret' })
|
|
34
37
|
* },
|
|
35
38
|
* defaultProvider: 'ipfs'
|
|
36
39
|
* };
|
|
@@ -128,183 +131,6 @@ export interface DownloadRelayerCallbacks {
|
|
|
128
131
|
*/
|
|
129
132
|
proxyDownload: (url: string) => Promise<Blob>;
|
|
130
133
|
}
|
|
131
|
-
/**
|
|
132
|
-
* Relayer callback functions for handling gasless transactions.
|
|
133
|
-
*
|
|
134
|
-
* Instead of hardcoding HTTP/REST API calls, users can provide custom callback
|
|
135
|
-
* functions to handle transaction relay in any way they choose (HTTP, WebSocket,
|
|
136
|
-
* direct blockchain submission, etc.).
|
|
137
|
-
*
|
|
138
|
-
* @category Configuration
|
|
139
|
-
* @example
|
|
140
|
-
* ```typescript
|
|
141
|
-
* const relayerCallbacks: RelayerCallbacks = {
|
|
142
|
-
* async submitPermissionGrant(typedData, signature) {
|
|
143
|
-
* // Custom implementation - could be HTTP, WebSocket, etc.
|
|
144
|
-
* const response = await fetch('https://my-relayer.com/api/grant', {
|
|
145
|
-
* method: 'POST',
|
|
146
|
-
* headers: { 'Content-Type': 'application/json' },
|
|
147
|
-
* body: JSON.stringify({ typedData, signature })
|
|
148
|
-
* });
|
|
149
|
-
* const result = await response.json();
|
|
150
|
-
* return result.transactionHash;
|
|
151
|
-
* },
|
|
152
|
-
*
|
|
153
|
-
* async submitFileAddition(url, userAddress) {
|
|
154
|
-
* // Custom relay implementation
|
|
155
|
-
* return await myCustomRelayer.addFile(url, userAddress);
|
|
156
|
-
* }
|
|
157
|
-
* };
|
|
158
|
-
* ```
|
|
159
|
-
*/
|
|
160
|
-
export interface RelayerCallbacks {
|
|
161
|
-
/**
|
|
162
|
-
* Submit a signed permission grant transaction for relay
|
|
163
|
-
*
|
|
164
|
-
* @param typedData - The EIP-712 typed data that was signed
|
|
165
|
-
* @param signature - The user's signature
|
|
166
|
-
* @returns Promise resolving to the transaction hash
|
|
167
|
-
*/
|
|
168
|
-
submitPermissionGrant?: (typedData: PermissionGrantTypedData, signature: Hash) => Promise<Hash>;
|
|
169
|
-
/**
|
|
170
|
-
* Submit a signed permission revocation transaction for relay
|
|
171
|
-
*
|
|
172
|
-
* @param typedData - The EIP-712 typed data that was signed
|
|
173
|
-
* @param signature - The user's signature
|
|
174
|
-
* @returns Promise resolving to the transaction hash
|
|
175
|
-
*/
|
|
176
|
-
submitPermissionRevoke?: (typedData: GenericTypedData, signature: Hash) => Promise<Hash>;
|
|
177
|
-
/**
|
|
178
|
-
* Submit a signed trust server transaction for relay
|
|
179
|
-
*
|
|
180
|
-
* @param typedData - The EIP-712 typed data that was signed
|
|
181
|
-
* @param signature - The user's signature
|
|
182
|
-
* @returns Promise resolving to the transaction hash
|
|
183
|
-
*/
|
|
184
|
-
submitTrustServer?: (typedData: TrustServerTypedData, signature: Hash) => Promise<Hash>;
|
|
185
|
-
/**
|
|
186
|
-
* Submit a signed untrust server transaction for relay
|
|
187
|
-
*
|
|
188
|
-
* @param typedData - The EIP-712 typed data that was signed
|
|
189
|
-
* @param signature - The user's signature
|
|
190
|
-
* @returns Promise resolving to the transaction hash
|
|
191
|
-
*/
|
|
192
|
-
submitUntrustServer?: (typedData: UntrustServerTypedData, signature: Hash) => Promise<Hash>;
|
|
193
|
-
/**
|
|
194
|
-
* Submit a signed add and trust server transaction for relay
|
|
195
|
-
*
|
|
196
|
-
* @param typedData - The EIP-712 typed data that was signed
|
|
197
|
-
* @param signature - The user's signature
|
|
198
|
-
* @returns Promise resolving to the transaction hash
|
|
199
|
-
*/
|
|
200
|
-
submitAddAndTrustServer?: (typedData: AddAndTrustServerTypedData, signature: Hash) => Promise<Hash>;
|
|
201
|
-
/**
|
|
202
|
-
* Submit a signed permission addition transaction for relay
|
|
203
|
-
*
|
|
204
|
-
* @param typedData - The EIP-712 typed data that was signed
|
|
205
|
-
* @param signature - The user's signature
|
|
206
|
-
* @returns Promise resolving to the transaction hash
|
|
207
|
-
*/
|
|
208
|
-
submitAddPermission?: (typedData: GenericTypedData, signature: Hash) => Promise<Hash>;
|
|
209
|
-
/**
|
|
210
|
-
* Submit a signed server files and permissions transaction for relay
|
|
211
|
-
*
|
|
212
|
-
* @param typedData - The EIP-712 typed data that was signed
|
|
213
|
-
* @param signature - The user's signature
|
|
214
|
-
* @returns Promise resolving to the transaction hash
|
|
215
|
-
*/
|
|
216
|
-
submitAddServerFilesAndPermissions?: (typedData: ServerFilesAndPermissionTypedData, signature: Hash) => Promise<Hash>;
|
|
217
|
-
/**
|
|
218
|
-
* Submit a file addition for relay
|
|
219
|
-
*
|
|
220
|
-
* @deprecated Since v2.0.0 - Use submitFileAdditionComplete() instead for full support.
|
|
221
|
-
* Will be removed in v3.0.0.
|
|
222
|
-
*
|
|
223
|
-
* Migration guide:
|
|
224
|
-
* ```typescript
|
|
225
|
-
* // Old:
|
|
226
|
-
* await submitFileAddition(url, userAddress);
|
|
227
|
-
*
|
|
228
|
-
* // New:
|
|
229
|
-
* await submitFileAdditionComplete({
|
|
230
|
-
* url,
|
|
231
|
-
* userAddress,
|
|
232
|
-
* permissions: [] // Optional
|
|
233
|
-
* });
|
|
234
|
-
* ```
|
|
235
|
-
* @param url - The file URL to register
|
|
236
|
-
* @param userAddress - The user's address
|
|
237
|
-
* @returns Promise resolving to object with fileId and transactionHash
|
|
238
|
-
*/
|
|
239
|
-
submitFileAddition?: (url: string, userAddress: string) => Promise<{
|
|
240
|
-
fileId: number;
|
|
241
|
-
transactionHash: Hash;
|
|
242
|
-
}>;
|
|
243
|
-
/**
|
|
244
|
-
* Submit a file addition with permissions for relay
|
|
245
|
-
*
|
|
246
|
-
* @deprecated Since v2.0.0 - Use submitFileAdditionComplete() instead for full support.
|
|
247
|
-
* Will be removed in v3.0.0.
|
|
248
|
-
*
|
|
249
|
-
* Migration guide:
|
|
250
|
-
* ```typescript
|
|
251
|
-
* // Old:
|
|
252
|
-
* await submitFileAdditionWithPermissions(url, userAddress, permissions);
|
|
253
|
-
*
|
|
254
|
-
* // New:
|
|
255
|
-
* await submitFileAdditionComplete({
|
|
256
|
-
* url,
|
|
257
|
-
* userAddress,
|
|
258
|
-
* permissions
|
|
259
|
-
* });
|
|
260
|
-
* ```
|
|
261
|
-
* @param url - The file URL to register
|
|
262
|
-
* @param userAddress - The user's address
|
|
263
|
-
* @param permissions - Array of encrypted permissions
|
|
264
|
-
* @returns Promise resolving to object with fileId and transactionHash
|
|
265
|
-
*/
|
|
266
|
-
submitFileAdditionWithPermissions?: (url: string, userAddress: string, permissions: Array<{
|
|
267
|
-
account: string;
|
|
268
|
-
key: string;
|
|
269
|
-
}>) => Promise<{
|
|
270
|
-
fileId: number;
|
|
271
|
-
transactionHash: Hash;
|
|
272
|
-
}>;
|
|
273
|
-
/**
|
|
274
|
-
* Submit a comprehensive file addition with optional schema and permissions for relay
|
|
275
|
-
*
|
|
276
|
-
* This is the preferred callback that supports all file addition scenarios.
|
|
277
|
-
* It can handle files with schemas, permissions, or both.
|
|
278
|
-
*
|
|
279
|
-
* @param params - Complete parameters for file addition
|
|
280
|
-
* @param params.url - The file URL to register
|
|
281
|
-
* @param params.userAddress - The user's address (defaults to connected wallet if not specified)
|
|
282
|
-
* @param params.permissions - Array of encrypted permissions (empty array if none)
|
|
283
|
-
* @param params.schemaId - Schema ID for validation (0 if none)
|
|
284
|
-
* @param params.ownerAddress - Optional owner address (defaults to userAddress if not specified)
|
|
285
|
-
* @returns Promise resolving to object with fileId and transactionHash
|
|
286
|
-
*/
|
|
287
|
-
submitFileAdditionComplete?: (params: {
|
|
288
|
-
url: string;
|
|
289
|
-
userAddress: Address;
|
|
290
|
-
permissions: Array<{
|
|
291
|
-
account: Address;
|
|
292
|
-
key: string;
|
|
293
|
-
}>;
|
|
294
|
-
schemaId: number;
|
|
295
|
-
ownerAddress?: Address;
|
|
296
|
-
}) => Promise<{
|
|
297
|
-
fileId: number;
|
|
298
|
-
transactionHash: Hash;
|
|
299
|
-
}>;
|
|
300
|
-
/**
|
|
301
|
-
* Store a grant file for relay (e.g., upload to IPFS)
|
|
302
|
-
*
|
|
303
|
-
* @param grantData - The grant file data
|
|
304
|
-
* @returns Promise resolving to the storage URL
|
|
305
|
-
*/
|
|
306
|
-
storeGrantFile?: (grantData: GrantFile) => Promise<string>;
|
|
307
|
-
}
|
|
308
134
|
/**
|
|
309
135
|
* Storage callback functions for flexible storage operations.
|
|
310
136
|
*
|
|
@@ -427,10 +253,25 @@ export interface StorageListResult {
|
|
|
427
253
|
*/
|
|
428
254
|
export interface BaseConfig {
|
|
429
255
|
/**
|
|
430
|
-
* Optional relayer
|
|
431
|
-
*
|
|
256
|
+
* Optional relayer configuration for handling gasless transactions.
|
|
257
|
+
* Can be a URL string for convenience, or a callback for full control.
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```typescript
|
|
261
|
+
* // Simple URL (SDK handles transport)
|
|
262
|
+
* relayer: '/api/relay'
|
|
263
|
+
*
|
|
264
|
+
* // Full control with callback
|
|
265
|
+
* relayer: async (request) => {
|
|
266
|
+
* const response = await fetch('/api/relay', {
|
|
267
|
+
* method: 'POST',
|
|
268
|
+
* body: JSON.stringify(request)
|
|
269
|
+
* });
|
|
270
|
+
* return response.json();
|
|
271
|
+
* }
|
|
272
|
+
* ```
|
|
432
273
|
*/
|
|
433
|
-
|
|
274
|
+
relayer?: RelayerConfig;
|
|
434
275
|
/**
|
|
435
276
|
* Optional download relayer for proxying CORS-restricted downloads.
|
|
436
277
|
* Provides a proxy mechanism for files stored on servers with CORS restrictions.
|
|
@@ -465,6 +306,21 @@ export interface BaseConfig {
|
|
|
465
306
|
* @example 'https://my-personal-server.example.com'
|
|
466
307
|
*/
|
|
467
308
|
defaultPersonalServerUrl?: string;
|
|
309
|
+
/**
|
|
310
|
+
* Optional operation store for tracking async relayed transactions.
|
|
311
|
+
* When provided with a relayer, enables resilient transaction management
|
|
312
|
+
* with polling support for pending operations.
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* ```typescript
|
|
316
|
+
* const vana = createVana({
|
|
317
|
+
* walletClient,
|
|
318
|
+
* relayer: '/api/relay',
|
|
319
|
+
* operationStore: myOperationStore
|
|
320
|
+
* });
|
|
321
|
+
* ```
|
|
322
|
+
*/
|
|
323
|
+
operationStore?: IOperationStore | IRelayerStateStore;
|
|
468
324
|
}
|
|
469
325
|
/**
|
|
470
326
|
* Base configuration interface that requires storage for storage-dependent operations
|
|
@@ -473,10 +329,25 @@ export interface BaseConfig {
|
|
|
473
329
|
*/
|
|
474
330
|
export interface BaseConfigWithStorage {
|
|
475
331
|
/**
|
|
476
|
-
* Optional relayer
|
|
477
|
-
*
|
|
332
|
+
* Optional relayer configuration for handling gasless transactions.
|
|
333
|
+
* Can be a URL string for convenience, or a callback for full control.
|
|
334
|
+
*
|
|
335
|
+
* @example
|
|
336
|
+
* ```typescript
|
|
337
|
+
* // Simple URL (SDK handles transport)
|
|
338
|
+
* relayer: '/api/relay'
|
|
339
|
+
*
|
|
340
|
+
* // Full control with callback
|
|
341
|
+
* relayer: async (request) => {
|
|
342
|
+
* const response = await fetch('/api/relay', {
|
|
343
|
+
* method: 'POST',
|
|
344
|
+
* body: JSON.stringify(request)
|
|
345
|
+
* });
|
|
346
|
+
* return response.json();
|
|
347
|
+
* }
|
|
348
|
+
* ```
|
|
478
349
|
*/
|
|
479
|
-
|
|
350
|
+
relayer?: RelayerConfig;
|
|
480
351
|
/**
|
|
481
352
|
* Optional download relayer for proxying CORS-restricted downloads.
|
|
482
353
|
* Provides a proxy mechanism for files stored on servers with CORS restrictions.
|
|
@@ -505,6 +376,12 @@ export interface BaseConfigWithStorage {
|
|
|
505
376
|
* @example 'https://my-personal-server.example.com'
|
|
506
377
|
*/
|
|
507
378
|
defaultPersonalServerUrl?: string;
|
|
379
|
+
/**
|
|
380
|
+
* Optional operation store for tracking async relayed transactions.
|
|
381
|
+
* When provided with a relayer, enables resilient transaction management
|
|
382
|
+
* with polling support for pending operations.
|
|
383
|
+
*/
|
|
384
|
+
operationStore?: IOperationStore | IRelayerStateStore;
|
|
508
385
|
}
|
|
509
386
|
/**
|
|
510
387
|
* Configuration with wallet client
|
|
@@ -566,56 +443,125 @@ export interface ChainConfigWithStorage extends BaseConfigWithStorage {
|
|
|
566
443
|
/** Optional account for signing transactions */
|
|
567
444
|
account?: Account;
|
|
568
445
|
}
|
|
446
|
+
/**
|
|
447
|
+
* Configuration with wallet client and optional public client
|
|
448
|
+
*
|
|
449
|
+
* @category Configuration
|
|
450
|
+
*/
|
|
451
|
+
export interface VanaConfigWithWallet extends BaseConfig {
|
|
452
|
+
/** The viem WalletClient instance used for signing transactions */
|
|
453
|
+
walletClient: WalletClient;
|
|
454
|
+
/** Optional PublicClient for read operations (derived from wallet if not provided) */
|
|
455
|
+
publicClient?: PublicClient;
|
|
456
|
+
}
|
|
457
|
+
/**
|
|
458
|
+
* Configuration for read-only operations with public client and address
|
|
459
|
+
*
|
|
460
|
+
* @category Configuration
|
|
461
|
+
*/
|
|
462
|
+
export interface VanaConfigReadOnly extends BaseConfig {
|
|
463
|
+
/** The viem PublicClient instance for read operations */
|
|
464
|
+
publicClient: PublicClient;
|
|
465
|
+
/** The user's address for read operations */
|
|
466
|
+
address: Address;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Configuration for minimal read-only operations with just an address
|
|
470
|
+
*
|
|
471
|
+
* @category Configuration
|
|
472
|
+
*/
|
|
473
|
+
export interface VanaConfigAddressOnly extends BaseConfig {
|
|
474
|
+
/** The user's address for read operations */
|
|
475
|
+
address: Address;
|
|
476
|
+
/** Optional chain configuration (will use default if not provided) */
|
|
477
|
+
chain?: Chain;
|
|
478
|
+
}
|
|
479
|
+
/**
|
|
480
|
+
* Configuration with wallet client and optional public client that requires storage
|
|
481
|
+
*
|
|
482
|
+
* @category Configuration
|
|
483
|
+
*/
|
|
484
|
+
export interface VanaConfigWithWalletWithStorage extends BaseConfigWithStorage {
|
|
485
|
+
/** The viem WalletClient instance used for signing transactions */
|
|
486
|
+
walletClient: WalletClient;
|
|
487
|
+
/** Optional PublicClient for read operations (derived from wallet if not provided) */
|
|
488
|
+
publicClient?: PublicClient;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Configuration for read-only operations with public client and address that requires storage
|
|
492
|
+
*
|
|
493
|
+
* @category Configuration
|
|
494
|
+
*/
|
|
495
|
+
export interface VanaConfigReadOnlyWithStorage extends BaseConfigWithStorage {
|
|
496
|
+
/** The viem PublicClient instance for read operations */
|
|
497
|
+
publicClient: PublicClient;
|
|
498
|
+
/** The user's address for read operations */
|
|
499
|
+
address: Address;
|
|
500
|
+
}
|
|
501
|
+
/**
|
|
502
|
+
* Configuration for minimal read-only operations with just an address that requires storage
|
|
503
|
+
*
|
|
504
|
+
* @category Configuration
|
|
505
|
+
*/
|
|
506
|
+
export interface VanaConfigAddressOnlyWithStorage extends BaseConfigWithStorage {
|
|
507
|
+
/** The user's address for read operations */
|
|
508
|
+
address: Address;
|
|
509
|
+
/** Optional chain configuration (will use default if not provided) */
|
|
510
|
+
chain?: Chain;
|
|
511
|
+
}
|
|
569
512
|
/**
|
|
570
513
|
* Main configuration interface for initializing the Vana SDK.
|
|
571
514
|
*
|
|
572
|
-
*
|
|
573
|
-
*
|
|
574
|
-
*
|
|
515
|
+
* The SDK supports three initialization modes:
|
|
516
|
+
* 1. Full mode with wallet client for signing transactions
|
|
517
|
+
* 2. Read-only mode with public client and address for read operations
|
|
518
|
+
* 3. Minimal mode with just an address and optional chain
|
|
575
519
|
*
|
|
576
520
|
* @category Configuration
|
|
577
521
|
* @example
|
|
578
522
|
* ```typescript
|
|
579
|
-
* //
|
|
580
|
-
* const
|
|
523
|
+
* // Mode 1: Full configuration with wallet client
|
|
524
|
+
* const configWithWallet: VanaConfig = {
|
|
581
525
|
* walletClient: createWalletClient({
|
|
582
526
|
* account: privateKeyToAccount('0x...'),
|
|
583
527
|
* chain: moksha,
|
|
584
528
|
* transport: http()
|
|
585
529
|
* }),
|
|
586
|
-
*
|
|
587
|
-
*
|
|
588
|
-
*
|
|
589
|
-
*
|
|
590
|
-
* }
|
|
591
|
-
* }
|
|
530
|
+
* publicClient: createPublicClient({
|
|
531
|
+
* chain: moksha,
|
|
532
|
+
* transport: http()
|
|
533
|
+
* })
|
|
592
534
|
* };
|
|
593
535
|
*
|
|
594
|
-
* //
|
|
595
|
-
* const
|
|
596
|
-
*
|
|
597
|
-
*
|
|
598
|
-
*
|
|
599
|
-
*
|
|
600
|
-
*
|
|
601
|
-
*
|
|
602
|
-
*
|
|
603
|
-
*
|
|
536
|
+
* // Mode 2: Read-only with public client and address
|
|
537
|
+
* const configReadOnly: VanaConfig = {
|
|
538
|
+
* publicClient: createPublicClient({
|
|
539
|
+
* chain: moksha,
|
|
540
|
+
* transport: http()
|
|
541
|
+
* }),
|
|
542
|
+
* address: '0x1234...'
|
|
543
|
+
* };
|
|
544
|
+
*
|
|
545
|
+
* // Mode 3: Minimal with just address
|
|
546
|
+
* const configMinimal: VanaConfig = {
|
|
547
|
+
* address: '0x1234...',
|
|
548
|
+
* chain: moksha // optional
|
|
604
549
|
* };
|
|
605
550
|
* ```
|
|
606
551
|
*/
|
|
607
|
-
export type VanaConfig = WalletConfig | ChainConfig;
|
|
552
|
+
export type VanaConfig = VanaConfigWithWallet | VanaConfigReadOnly | VanaConfigAddressOnly | WalletConfig | ChainConfig;
|
|
608
553
|
/**
|
|
609
554
|
* Configuration interface for Vana SDK that requires storage providers.
|
|
610
555
|
*
|
|
611
556
|
* Use this type when you need to ensure storage is configured for operations
|
|
612
557
|
* like file uploads, permission grants without pre-stored URLs, or schema creation.
|
|
558
|
+
* Supports all three initialization modes with required storage.
|
|
613
559
|
*
|
|
614
560
|
* @category Configuration
|
|
615
561
|
* @example
|
|
616
562
|
* ```typescript
|
|
617
|
-
* //
|
|
618
|
-
* const
|
|
563
|
+
* // Full configuration with wallet client and storage
|
|
564
|
+
* const configWithWallet: VanaConfigWithStorage = {
|
|
619
565
|
* walletClient: createWalletClient({
|
|
620
566
|
* account: privateKeyToAccount('0x...'),
|
|
621
567
|
* chain: moksha,
|
|
@@ -628,9 +574,24 @@ export type VanaConfig = WalletConfig | ChainConfig;
|
|
|
628
574
|
* defaultProvider: 'ipfs'
|
|
629
575
|
* }
|
|
630
576
|
* };
|
|
577
|
+
*
|
|
578
|
+
* // Read-only configuration with storage
|
|
579
|
+
* const configReadOnly: VanaConfigWithStorage = {
|
|
580
|
+
* publicClient: createPublicClient({
|
|
581
|
+
* chain: moksha,
|
|
582
|
+
* transport: http()
|
|
583
|
+
* }),
|
|
584
|
+
* address: '0x1234...',
|
|
585
|
+
* storage: {
|
|
586
|
+
* providers: {
|
|
587
|
+
* ipfs: new IPFSStorage({ gateway: 'https://gateway.pinata.cloud' })
|
|
588
|
+
* },
|
|
589
|
+
* defaultProvider: 'ipfs'
|
|
590
|
+
* }
|
|
591
|
+
* };
|
|
631
592
|
* ```
|
|
632
593
|
*/
|
|
633
|
-
export type VanaConfigWithStorage = WalletConfigWithStorage | ChainConfigWithStorage;
|
|
594
|
+
export type VanaConfigWithStorage = VanaConfigWithWalletWithStorage | VanaConfigReadOnlyWithStorage | VanaConfigAddressOnlyWithStorage | WalletConfigWithStorage | ChainConfigWithStorage;
|
|
634
595
|
/**
|
|
635
596
|
* Runtime configuration information
|
|
636
597
|
*
|
|
@@ -645,24 +606,50 @@ export interface RuntimeConfig {
|
|
|
645
606
|
storageProviders: string[];
|
|
646
607
|
/** Default storage provider */
|
|
647
608
|
defaultStorageProvider?: string;
|
|
648
|
-
/** Current relayer
|
|
649
|
-
|
|
609
|
+
/** Current relayer configuration */
|
|
610
|
+
relayerConfig?: RelayerConfig;
|
|
650
611
|
}
|
|
651
612
|
/**
|
|
652
|
-
* Validates whether a configuration object
|
|
613
|
+
* Validates whether a configuration object has a wallet client (any wallet-based config).
|
|
653
614
|
*
|
|
654
615
|
* @param config - The configuration object to check
|
|
655
|
-
* @returns True if the config
|
|
616
|
+
* @returns True if the config contains a walletClient
|
|
656
617
|
* @example
|
|
657
618
|
* ```typescript
|
|
658
619
|
* if (isWalletConfig(config)) {
|
|
659
620
|
* console.log('Using wallet client:', config.walletClient.account?.address);
|
|
660
621
|
* } else {
|
|
661
|
-
* console.log('
|
|
622
|
+
* console.log('Read-only or chain config');
|
|
623
|
+
* }
|
|
624
|
+
* ```
|
|
625
|
+
*/
|
|
626
|
+
export declare function isWalletConfig(config: VanaConfig): config is VanaConfigWithWallet | WalletConfig;
|
|
627
|
+
/**
|
|
628
|
+
* Validates whether a configuration object is a read-only config with public client.
|
|
629
|
+
*
|
|
630
|
+
* @param config - The configuration object to check
|
|
631
|
+
* @returns True if the config has publicClient and address but no walletClient
|
|
632
|
+
* @example
|
|
633
|
+
* ```typescript
|
|
634
|
+
* if (isReadOnlyConfig(config)) {
|
|
635
|
+
* console.log('Read-only mode with address:', config.address);
|
|
662
636
|
* }
|
|
663
637
|
* ```
|
|
664
638
|
*/
|
|
665
|
-
export declare function
|
|
639
|
+
export declare function isReadOnlyConfig(config: VanaConfig): config is VanaConfigReadOnly;
|
|
640
|
+
/**
|
|
641
|
+
* Validates whether a configuration object is an address-only config.
|
|
642
|
+
*
|
|
643
|
+
* @param config - The configuration object to check
|
|
644
|
+
* @returns True if the config has only address (and optionally chain) but no clients
|
|
645
|
+
* @example
|
|
646
|
+
* ```typescript
|
|
647
|
+
* if (isAddressOnlyConfig(config)) {
|
|
648
|
+
* console.log('Address-only mode:', config.address);
|
|
649
|
+
* }
|
|
650
|
+
* ```
|
|
651
|
+
*/
|
|
652
|
+
export declare function isAddressOnlyConfig(config: VanaConfig): config is VanaConfigAddressOnly;
|
|
666
653
|
/**
|
|
667
654
|
* Validates whether a configuration object is a ChainConfig.
|
|
668
655
|
*
|
|
@@ -721,3 +708,13 @@ export interface ConfigValidationResult {
|
|
|
721
708
|
/** List of validation warnings */
|
|
722
709
|
warnings: string[];
|
|
723
710
|
}
|
|
711
|
+
/**
|
|
712
|
+
* Marker interface to enforce the presence of operationStore at compile time.
|
|
713
|
+
* This interface is used to ensure that certain operations requiring a relayer
|
|
714
|
+
* can only be called when the SDK has been properly configured with an operation store.
|
|
715
|
+
*
|
|
716
|
+
* @category Configuration
|
|
717
|
+
*/
|
|
718
|
+
export interface RelayerRequiredMarker {
|
|
719
|
+
readonly __relayerConfigured: true;
|
|
720
|
+
}
|
package/dist/types/config.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
function isWalletConfig(config) {
|
|
2
2
|
return "walletClient" in config;
|
|
3
3
|
}
|
|
4
|
+
function isReadOnlyConfig(config) {
|
|
5
|
+
return "publicClient" in config && "address" in config && !("walletClient" in config);
|
|
6
|
+
}
|
|
7
|
+
function isAddressOnlyConfig(config) {
|
|
8
|
+
return "address" in config && !("publicClient" in config) && !("walletClient" in config) && !("chainId" in config);
|
|
9
|
+
}
|
|
4
10
|
function isChainConfig(config) {
|
|
5
11
|
return "chainId" in config && !("walletClient" in config);
|
|
6
12
|
}
|
|
@@ -9,7 +15,9 @@ function hasStorageConfig(config) {
|
|
|
9
15
|
}
|
|
10
16
|
export {
|
|
11
17
|
hasStorageConfig,
|
|
18
|
+
isAddressOnlyConfig,
|
|
12
19
|
isChainConfig,
|
|
20
|
+
isReadOnlyConfig,
|
|
13
21
|
isWalletConfig
|
|
14
22
|
};
|
|
15
23
|
//# sourceMappingURL=config.js.map
|