@opendatalabs/vana-sdk 0.1.0-alpha.d7fc764 → 0.1.0-alpha.dba79a3
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/dist/__tests__/waitForTransactionEvents.test.d.ts +1 -0
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.ts +36 -2
- 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 +9 -11
- 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 +34 -2
- package/dist/chains/index.js.map +1 -1
- package/dist/chains.browser.d.ts +8 -2
- package/dist/chains.d.ts +8 -2
- package/dist/chains.node.d.ts +8 -2
- package/dist/config/addresses.d.ts +8 -24
- package/dist/config/chains.cjs.map +1 -1
- package/dist/config/chains.d.ts +108 -13
- package/dist/config/chains.js.map +1 -1
- 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/config/features.d.ts +1 -3
- package/dist/config/tests/addresses.test.d.ts +1 -0
- package/dist/contracts/contractController.cjs +3 -3
- package/dist/contracts/contractController.cjs.map +1 -1
- package/dist/contracts/contractController.d.ts +77 -38
- package/dist/contracts/contractController.js +4 -7
- package/dist/contracts/contractController.js.map +1 -1
- package/dist/contracts/tests/contractController.test.d.ts +1 -0
- 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/__tests__/schemas-edge-cases.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-error-handling.test.d.ts +1 -0
- package/dist/controllers/data.cjs +827 -439
- package/dist/controllers/data.cjs.map +1 -1
- package/dist/controllers/data.d.ts +373 -254
- package/dist/controllers/data.js +840 -442
- 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 +929 -483
- package/dist/controllers/permissions.cjs.map +1 -1
- package/dist/controllers/permissions.d.ts +1318 -25
- package/dist/controllers/permissions.js +929 -483
- package/dist/controllers/permissions.js.map +1 -1
- package/dist/controllers/protocol.cjs +15 -11
- package/dist/controllers/protocol.cjs.map +1 -1
- package/dist/controllers/protocol.d.ts +34 -63
- package/dist/controllers/protocol.js +15 -14
- package/dist/controllers/protocol.js.map +1 -1
- package/dist/controllers/schemas.cjs +100 -75
- package/dist/controllers/schemas.cjs.map +1 -1
- package/dist/controllers/schemas.d.ts +56 -74
- package/dist/controllers/schemas.js +100 -75
- package/dist/controllers/schemas.js.map +1 -1
- package/dist/controllers/server-additional.test.d.ts +1 -0
- package/dist/controllers/server.cjs +32 -25
- package/dist/controllers/server.cjs.map +1 -1
- package/dist/controllers/server.d.ts +53 -71
- package/dist/controllers/server.js +32 -25
- 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 +68 -15
- package/dist/core/apiClient.cjs.map +1 -1
- package/dist/core/apiClient.d.ts +137 -16
- package/dist/core/apiClient.js +72 -22
- package/dist/core/apiClient.js.map +1 -1
- package/dist/core/client.cjs +7 -7
- package/dist/core/client.cjs.map +1 -1
- package/dist/core/client.d.ts +6 -9
- package/dist/core/client.js +7 -7
- package/dist/core/client.js.map +1 -1
- package/dist/core/core.test.d.ts +1 -0
- package/dist/core/generics.cjs +41 -12
- package/dist/core/generics.cjs.map +1 -1
- package/dist/core/generics.d.ts +104 -19
- package/dist/core/generics.js +52 -32
- 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/tests/apiClient.test.d.ts +1 -0
- package/dist/core/tests/client.test.d.ts +1 -0
- package/dist/core/tests/generics.test.d.ts +1 -0
- package/dist/core.cjs +152 -61
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.ts +50 -67
- package/dist/core.js +164 -86
- package/dist/core.js.map +1 -1
- package/dist/crypto/ecies/__tests__/base.test.d.ts +4 -0
- package/dist/crypto/ecies/__tests__/compatibility.test.d.ts +8 -0
- package/dist/crypto/ecies/__tests__/constants.test.d.ts +4 -0
- package/dist/crypto/ecies/__tests__/native-parity.test.d.ts +7 -0
- package/dist/crypto/ecies/__tests__/normalization.test.d.ts +1 -0
- package/dist/crypto/ecies/__tests__/test-vectors.d.ts +2 -4
- package/dist/crypto/ecies/base.cjs +20 -6
- package/dist/crypto/ecies/base.cjs.map +1 -1
- package/dist/crypto/ecies/base.d.ts +2 -5
- package/dist/crypto/ecies/base.js +28 -18
- package/dist/crypto/ecies/base.js.map +1 -1
- package/dist/crypto/ecies/browser.cjs +2 -1
- package/dist/crypto/ecies/browser.cjs.map +1 -1
- package/dist/crypto/ecies/browser.d.ts +2 -7
- package/dist/crypto/ecies/browser.js +2 -1
- package/dist/crypto/ecies/browser.js.map +1 -1
- package/dist/crypto/ecies/constants.d.ts +7 -9
- package/dist/crypto/ecies/index.d.ts +8 -1
- package/dist/crypto/ecies/interface.cjs +4 -5
- package/dist/crypto/ecies/interface.cjs.map +1 -1
- package/dist/crypto/ecies/interface.d.ts +9 -11
- package/dist/crypto/ecies/interface.js +4 -5
- package/dist/crypto/ecies/interface.js.map +1 -1
- package/dist/crypto/ecies/node.cjs +3 -2
- package/dist/crypto/ecies/node.cjs.map +1 -1
- package/dist/crypto/ecies/node.d.ts +2 -7
- package/dist/crypto/ecies/node.js +11 -16
- package/dist/crypto/ecies/node.js.map +1 -1
- package/dist/crypto/ecies/test-vectors/eccrypto-vectors.json +72 -0
- package/dist/crypto/ecies/utils.cjs +2 -41
- package/dist/crypto/ecies/utils.cjs.map +1 -1
- package/dist/crypto/ecies/utils.d.ts +3 -40
- package/dist/crypto/ecies/utils.js +1 -35
- package/dist/crypto/ecies/utils.js.map +1 -1
- package/dist/crypto/services/WalletKeyEncryptionService.cjs +2 -2
- package/dist/crypto/services/WalletKeyEncryptionService.cjs.map +1 -1
- package/dist/crypto/services/WalletKeyEncryptionService.d.ts +3 -7
- package/dist/crypto/services/WalletKeyEncryptionService.js +5 -9
- package/dist/crypto/services/WalletKeyEncryptionService.js.map +1 -1
- package/dist/crypto/services/WalletKeyEncryptionService.test.d.ts +1 -0
- package/dist/diagnostics.d.ts +1 -3
- package/dist/diagnostics.test.d.ts +1 -0
- package/dist/errors.cjs +45 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.d.ts +117 -15
- package/dist/errors.js +46 -6
- package/dist/errors.js.map +1 -1
- package/dist/generated/abi/ComputeEngineImplementation.d.ts +2 -3
- package/dist/generated/abi/ComputeInstructionRegistryImplementation.d.ts +2 -3
- package/dist/generated/abi/DATFactoryImplementation.d.ts +2 -3
- package/dist/generated/abi/DATImplementation.d.ts +2 -3
- package/dist/generated/abi/DATPausableImplementation.d.ts +2 -3
- package/dist/generated/abi/DATVotesImplementation.d.ts +2 -3
- package/dist/generated/abi/DLPPerformanceImplementation.d.ts +2 -3
- package/dist/generated/abi/DLPRegistryImplementation.d.ts +2 -3
- package/dist/generated/abi/DLPRegistryTreasuryImplementation.d.ts +2 -3
- package/dist/generated/abi/DLPRewardDeployerImplementation.d.ts +2 -3
- package/dist/generated/abi/DLPRewardDeployerTreasuryImplementation.d.ts +2 -3
- package/dist/generated/abi/DLPRewardSwapImplementation.d.ts +2 -3
- package/dist/generated/abi/DLPRootImplementation.d.ts +1 -3
- package/dist/generated/abi/DLPTreasuryImplementation.d.ts +2 -3
- package/dist/generated/abi/DataLiquidityPoolImplementation.d.ts +1 -3
- package/dist/generated/abi/DataPortabilityGranteesImplementation.d.ts +2 -3
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.d.ts +2 -3
- package/dist/generated/abi/DataPortabilityServersImplementation.d.ts +2 -3
- package/dist/generated/abi/DataRefinerRegistryImplementation.d.ts +2 -3
- package/dist/generated/abi/DataRegistryImplementation.cjs +13 -0
- package/dist/generated/abi/DataRegistryImplementation.cjs.map +1 -1
- package/dist/generated/abi/DataRegistryImplementation.d.ts +12 -3
- package/dist/generated/abi/DataRegistryImplementation.js +13 -0
- package/dist/generated/abi/DataRegistryImplementation.js.map +1 -1
- package/dist/generated/abi/QueryEngineImplementation.d.ts +2 -3
- package/dist/generated/abi/SwapHelperImplementation.d.ts +2 -3
- package/dist/generated/abi/TeePoolDedicatedGpuImplementation.d.ts +2 -3
- package/dist/generated/abi/TeePoolDedicatedStandardImplementation.d.ts +2 -3
- package/dist/generated/abi/TeePoolEphemeralStandardImplementation.d.ts +2 -3
- package/dist/generated/abi/TeePoolImplementation.d.ts +2 -3
- package/dist/generated/abi/TeePoolPersistentGpuImplementation.d.ts +2 -3
- package/dist/generated/abi/TeePoolPersistentStandardImplementation.d.ts +2 -3
- package/dist/generated/abi/TeePoolPhalaImplementation.d.ts +2 -3
- package/dist/generated/abi/VanaEpochImplementation.d.ts +2 -3
- package/dist/generated/abi/VanaPoolEntityImplementation.d.ts +2 -3
- package/dist/generated/abi/VanaPoolStakingImplementation.d.ts +2 -3
- package/dist/generated/abi/VanaPoolTreasuryImplementation.d.ts +2 -3
- package/dist/generated/abi/index.cjs +42 -0
- package/dist/generated/abi/index.cjs.map +1 -1
- package/dist/generated/abi/index.d.ts +47 -18
- package/dist/generated/abi/index.js +21 -0
- package/dist/generated/abi/index.js.map +1 -1
- package/dist/generated/event-types.cjs +17 -0
- package/dist/generated/event-types.cjs.map +1 -0
- package/dist/generated/event-types.d.ts +854 -0
- package/dist/generated/event-types.js +1 -0
- package/dist/generated/event-types.js.map +1 -0
- package/dist/generated/eventRegistry.cjs +3351 -0
- package/dist/generated/eventRegistry.cjs.map +1 -0
- package/dist/generated/eventRegistry.d.ts +14 -0
- package/dist/generated/eventRegistry.js +3326 -0
- package/dist/generated/eventRegistry.js.map +1 -0
- package/dist/generated/server/server-exports.d.ts +19 -21
- package/dist/generated/server/server.cjs.map +1 -1
- package/dist/generated/server/server.d.ts +113 -87
- package/dist/generated/subgraph.cjs +797 -32
- package/dist/generated/subgraph.cjs.map +1 -1
- package/dist/generated/subgraph.d.ts +464 -332
- package/dist/generated/subgraph.js +792 -32
- package/dist/generated/subgraph.js.map +1 -1
- package/dist/index.browser.d.ts +49 -73
- package/dist/index.browser.js +14 -0
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/index.node.cjs +31 -3
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.d.ts +223 -64
- package/dist/index.node.js +28 -2
- 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 +42 -2
- package/dist/node.js.map +1 -1
- package/dist/platform/browser-only.d.ts +5 -8
- package/dist/platform/browser-only.test.d.ts +1 -0
- package/dist/platform/browser-safe.d.ts +6 -9
- package/dist/platform/browser-safe.test.d.ts +1 -0
- package/dist/platform/browser.cjs +167 -8
- package/dist/platform/browser.cjs.map +1 -1
- package/dist/platform/browser.d.ts +235 -18
- package/dist/platform/browser.js +179 -29
- package/dist/platform/browser.js.map +1 -1
- package/dist/platform/browser.test.d.ts +1 -0
- package/dist/platform/index.d.ts +11 -5
- package/dist/platform/interface.cjs.map +1 -1
- package/dist/platform/interface.d.ts +289 -98
- package/dist/platform/node.cjs +163 -2
- package/dist/platform/node.cjs.map +1 -1
- package/dist/platform/node.d.ts +72 -13
- package/dist/platform/node.js +175 -21
- package/dist/platform/node.js.map +1 -1
- package/dist/platform/ports/openpgp-port.cjs +74 -0
- package/dist/platform/ports/openpgp-port.cjs.map +1 -0
- package/dist/platform/ports/openpgp-port.d.ts +13 -0
- package/dist/platform/ports/openpgp-port.js +59 -0
- package/dist/platform/ports/openpgp-port.js.map +1 -0
- package/dist/platform/ports/pgp-port.cjs +17 -0
- package/dist/platform/ports/pgp-port.cjs.map +1 -0
- package/dist/platform/ports/pgp-port.d.ts +35 -0
- package/dist/platform/ports/pgp-port.js +1 -0
- package/dist/platform/ports/pgp-port.js.map +1 -0
- package/dist/platform/shared/error-utils.d.ts +2 -4
- package/dist/platform/shared/pgp-utils.cjs +2 -2
- package/dist/platform/shared/pgp-utils.cjs.map +1 -1
- package/dist/platform/shared/pgp-utils.d.ts +3 -5
- package/dist/platform/shared/pgp-utils.js +2 -2
- package/dist/platform/shared/pgp-utils.js.map +1 -1
- package/dist/platform/shared/stream-utils.d.ts +1 -3
- package/dist/platform/utils.d.ts +6 -10
- package/dist/platform/utils.test.d.ts +1 -0
- package/dist/platform.browser.d.ts +9 -4
- package/dist/platform.d.ts +11 -5
- package/dist/platform.node.d.ts +10 -5
- package/dist/schemas/dataSchema.schema.json +53 -0
- package/dist/schemas/grantFile.schema.json +43 -0
- package/dist/server/relayerHandler.cjs +420 -0
- package/dist/server/relayerHandler.cjs.map +1 -0
- package/dist/server/relayerHandler.d.ts +69 -0
- package/dist/server/relayerHandler.js +396 -0
- package/dist/server/relayerHandler.js.map +1 -0
- package/dist/storage/index.d.ts +56 -10
- package/dist/storage/manager.cjs +114 -31
- package/dist/storage/manager.cjs.map +1 -1
- package/dist/storage/manager.d.ts +121 -30
- package/dist/storage/manager.js +113 -37
- package/dist/storage/manager.js.map +1 -1
- package/dist/storage/providers/callback-storage.cjs +89 -18
- package/dist/storage/providers/callback-storage.cjs.map +1 -1
- package/dist/storage/providers/callback-storage.d.ts +111 -28
- package/dist/storage/providers/callback-storage.js +89 -18
- package/dist/storage/providers/callback-storage.js.map +1 -1
- package/dist/storage/providers/google-drive.cjs +2 -2
- package/dist/storage/providers/google-drive.cjs.map +1 -1
- package/dist/storage/providers/google-drive.d.ts +3 -7
- package/dist/storage/providers/google-drive.js +4 -7
- package/dist/storage/providers/google-drive.js.map +1 -1
- package/dist/storage/providers/google-drive.test.d.ts +1 -0
- package/dist/storage/providers/ipfs.cjs +5 -5
- package/dist/storage/providers/ipfs.cjs.map +1 -1
- package/dist/storage/providers/ipfs.d.ts +3 -6
- package/dist/storage/providers/ipfs.js +7 -10
- package/dist/storage/providers/ipfs.js.map +1 -1
- package/dist/storage/providers/pinata.cjs +6 -6
- package/dist/storage/providers/pinata.cjs.map +1 -1
- package/dist/storage/providers/pinata.d.ts +17 -22
- package/dist/storage/providers/pinata.js +8 -11
- package/dist/storage/providers/pinata.js.map +1 -1
- package/dist/storage/tests/callbackStorage.test.d.ts +1 -0
- package/dist/storage/tests/googleDriveStorage.test.d.ts +1 -0
- package/dist/storage/tests/ipfsStorage.test.d.ts +1 -0
- package/dist/storage/tests/pinataStorage.test.d.ts +1 -0
- package/dist/storage/tests/storageManager.test.d.ts +1 -0
- package/dist/tests/abi.test.d.ts +1 -0
- package/dist/tests/chains-definitions.test.d.ts +1 -0
- package/dist/tests/core-encryption.test.d.ts +1 -0
- package/dist/tests/core-extended.test.d.ts +1 -0
- package/dist/tests/core-generics-coverage.test.d.ts +1 -0
- package/dist/tests/coverage-boost.test.d.ts +1 -0
- package/dist/tests/crypto-cross-platform-compatibility.test.d.ts +1 -0
- package/dist/tests/data-addfile-permissions-schema.test.d.ts +1 -0
- package/dist/tests/data-additional-methods.test.d.ts +1 -0
- package/dist/tests/data-controller-edge-cases.test.d.ts +1 -0
- package/dist/tests/data-ipfs-gateways.test.d.ts +1 -0
- package/dist/tests/data-relayer.test.d.ts +1 -0
- package/dist/tests/data-schema-validation.test.d.ts +1 -0
- package/dist/tests/data-simple-methods.test.d.ts +1 -0
- package/dist/tests/data.test.d.ts +1 -0
- package/dist/tests/demo-integration.test.d.ts +1 -0
- package/dist/tests/demo-trusted-server-integration.test.d.ts +1 -0
- package/dist/tests/download-relayer.test.d.ts +1 -0
- package/dist/tests/dual-mode-permissions.test.d.ts +1 -0
- package/dist/tests/dual-mode-trusted-servers.test.d.ts +1 -0
- package/dist/tests/encryption-correct-implementation.test.d.ts +1 -0
- package/dist/tests/encryption-coverage.test.d.ts +1 -0
- package/dist/tests/encryption-edge-cases.test.d.ts +1 -0
- package/dist/tests/encryption-utils-updated.test.d.ts +1 -0
- package/dist/tests/errors-coverage.test.d.ts +1 -0
- package/dist/tests/errors.test.d.ts +1 -0
- package/dist/tests/factories/mockFactory.d.ts +316 -0
- package/dist/tests/fakes/FakeStorageManager.d.ts +200 -0
- package/dist/tests/fakes/FakeStorageManager.test.d.ts +1 -0
- package/dist/tests/fakes/FakeWaitForTransactionEvents.d.ts +170 -0
- package/dist/tests/fakes/FakeWaitForTransactionEvents.test.d.ts +1 -0
- package/dist/tests/fakes/fake-pgp-port.d.ts +13 -0
- package/dist/tests/grantValidation-edge-cases.test.d.ts +1 -0
- package/dist/tests/grantValidation-unreachable-branch.test.d.ts +1 -0
- package/dist/tests/helper-methods.test.d.ts +1 -0
- package/dist/tests/helpers/platformTestHelpers.d.ts +106 -0
- package/dist/tests/helpers/typedMocks.d.ts +64 -0
- package/dist/tests/index-browser.test.d.ts +1 -0
- package/dist/tests/index-node.test.d.ts +1 -0
- package/dist/tests/index.test.d.ts +1 -0
- package/dist/tests/mocks/platformAdapter.d.ts +12 -0
- package/dist/tests/new-permissions-methods.test.d.ts +1 -0
- package/dist/tests/no-buffer-browser.test.d.ts +1 -0
- package/dist/tests/permissions-grantee.test.d.ts +1 -0
- package/dist/tests/permissions-revoke-relayer.test.d.ts +1 -0
- package/dist/tests/permissions-schema-validation.test.d.ts +1 -0
- package/dist/tests/permissions-server-files.test.d.ts +1 -0
- package/dist/tests/permissions-transaction-options.test.d.ts +1 -0
- package/dist/tests/permissions-trust-servers.test.d.ts +1 -0
- package/dist/tests/permissions.test.d.ts +1 -0
- package/dist/tests/personal.test.d.ts +1 -0
- package/dist/tests/platform-browser.test.d.ts +1 -0
- package/dist/tests/platform-crypto-expanded.test.d.ts +1 -0
- package/dist/tests/platform-crypto.test.d.ts +1 -0
- package/dist/tests/platform-index.test.d.ts +1 -0
- package/dist/tests/platform-node.test.d.ts +1 -0
- package/dist/tests/platform-shared-utils.test.d.ts +1 -0
- package/dist/tests/platform-updated.test.d.ts +1 -0
- package/dist/tests/protocol-additional-methods.test.d.ts +1 -0
- package/dist/tests/protocol.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/schemas.test.d.ts +1 -0
- package/dist/tests/server-relayer-handler.test.d.ts +1 -0
- package/dist/tests/setup.d.ts +7 -0
- package/dist/tests/signatureFormatter.test.d.ts +1 -0
- package/dist/tests/trusted-server-queries.test.d.ts +1 -0
- package/dist/tests/typedDataConverter.test.d.ts +1 -0
- package/dist/tests/types-contracts.test.d.ts +1 -0
- package/dist/tests/types-data.test.d.ts +1 -0
- package/dist/tests/types-external-apis.test.d.ts +1 -0
- package/dist/tests/types-generics.test.d.ts +1 -0
- package/dist/tests/types-permissions.test.d.ts +1 -0
- package/dist/tests/types-upload-params.test.d.ts +1 -0
- package/dist/tests/types.test.d.ts +1 -0
- package/dist/tests/utils-formatters.test.d.ts +1 -0
- package/dist/tests/utils-grantFiles-edge-cases.test.d.ts +1 -0
- package/dist/tests/utils-grantFiles-validation.test.d.ts +1 -0
- package/dist/tests/utils-grantFiles.test.d.ts +1 -0
- package/dist/tests/utils-grantValidation-consolidated.test.d.ts +1 -0
- package/dist/tests/utils-grants.test.d.ts +1 -0
- package/dist/tests/utils-ipfs-additional.test.d.ts +1 -0
- package/dist/tests/utils-ipfs.test.d.ts +4 -0
- package/dist/tests/utils-schemaValidation.test.d.ts +1 -0
- package/dist/tests/vana.test.d.ts +1 -0
- package/dist/tests/wallet-crypto-compatibility.test.d.ts +1 -0
- package/dist/{chains.browser.cjs → types/atomicStore.cjs} +9 -15
- 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 +17 -0
- package/dist/types/blockchain.cjs.map +1 -0
- package/dist/types/blockchain.d.ts +85 -0
- package/dist/types/blockchain.js +1 -0
- package/dist/types/blockchain.js.map +1 -0
- package/dist/types/chains-additional.test.d.ts +1 -0
- package/dist/types/chains.cjs.map +1 -1
- package/dist/types/chains.d.ts +80 -16
- 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 +236 -242
- 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 +79 -18
- package/dist/types/controller-context.cjs +17 -0
- package/dist/types/controller-context.cjs.map +1 -0
- package/dist/types/controller-context.d.ts +68 -0
- package/dist/types/controller-context.js +1 -0
- package/dist/types/controller-context.js.map +1 -0
- package/dist/types/data.cjs.map +1 -1
- package/dist/types/data.d.ts +118 -49
- package/dist/types/external-apis.d.ts +10 -12
- package/dist/types/generics.cjs.map +1 -1
- package/dist/types/generics.d.ts +116 -48
- package/dist/types/index.cjs +5 -4
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.ts +48 -34
- package/dist/types/index.js +9 -2
- 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 +2 -2
- package/dist/types/operations.cjs.map +1 -1
- package/dist/types/operations.d.ts +164 -42
- package/dist/types/operations.js +2 -2
- 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 +72 -78
- package/dist/types/personal.cjs.map +1 -1
- package/dist/types/personal.d.ts +137 -22
- package/dist/types/relayer.cjs.map +1 -1
- package/dist/types/relayer.d.ts +293 -50
- package/dist/types/storage.cjs.map +1 -1
- package/dist/types/storage.d.ts +15 -29
- package/dist/types/storage.js +2 -5
- package/dist/types/storage.js.map +1 -1
- package/dist/types/transactionResults.cjs.map +1 -1
- package/dist/types/transactionResults.d.ts +193 -25
- package/dist/types/utils.cjs.map +1 -1
- package/dist/types/utils.d.ts +20 -68
- package/dist/types.d.ts +4 -40
- package/dist/utils/__tests__/parseTransaction.test.d.ts +1 -0
- package/dist/utils/__tests__/pojo-serialization.test.d.ts +1 -0
- package/dist/utils/__tests__/signatureCache.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/__tests__/transaction-edge-cases.test.d.ts +1 -0
- package/dist/utils/__tests__/transactionHelpers.test.d.ts +1 -0
- package/dist/utils/__tests__/urlResolver.test.d.ts +4 -0
- package/dist/utils/blockchain/registry.cjs +2 -2
- package/dist/utils/blockchain/registry.cjs.map +1 -1
- package/dist/utils/blockchain/registry.d.ts +6 -8
- package/dist/utils/blockchain/registry.js +2 -2
- package/dist/utils/blockchain/registry.js.map +1 -1
- package/dist/utils/blockchain/registry.test.d.ts +1 -0
- 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/crypto-utils.cjs +0 -12
- package/dist/utils/crypto-utils.cjs.map +1 -1
- package/dist/utils/crypto-utils.d.ts +9 -27
- package/dist/utils/crypto-utils.js +0 -11
- package/dist/utils/crypto-utils.js.map +1 -1
- package/dist/utils/crypto-utils.test.d.ts +1 -0
- package/dist/utils/download.cjs +3 -3
- package/dist/utils/download.cjs.map +1 -1
- package/dist/utils/download.d.ts +13 -14
- package/dist/utils/download.js +2 -2
- package/dist/utils/download.js.map +1 -1
- package/dist/utils/encoding.cjs +1 -1
- package/dist/utils/encoding.cjs.map +1 -1
- package/dist/utils/encoding.d.ts +4 -6
- package/dist/utils/encoding.js +1 -1
- package/dist/utils/encoding.js.map +1 -1
- package/dist/utils/encoding.test.d.ts +1 -0
- package/dist/utils/encryption.cjs +16 -10
- package/dist/utils/encryption.cjs.map +1 -1
- package/dist/utils/encryption.d.ts +13 -17
- package/dist/utils/encryption.js +16 -10
- package/dist/utils/encryption.js.map +1 -1
- package/dist/utils/formatters.cjs +4 -2
- package/dist/utils/formatters.cjs.map +1 -1
- package/dist/utils/formatters.d.ts +4 -6
- package/dist/utils/formatters.js +4 -2
- package/dist/utils/formatters.js.map +1 -1
- package/dist/utils/grantFiles.cjs +7 -4
- package/dist/utils/grantFiles.cjs.map +1 -1
- package/dist/utils/grantFiles.d.ts +16 -30
- package/dist/utils/grantFiles.js +7 -4
- package/dist/utils/grantFiles.js.map +1 -1
- package/dist/utils/grantValidation.cjs +1 -1
- package/dist/utils/grantValidation.cjs.map +1 -1
- package/dist/utils/grantValidation.d.ts +109 -33
- package/dist/utils/grantValidation.js +1 -1
- package/dist/utils/grantValidation.js.map +1 -1
- package/dist/utils/grants.cjs +1 -1
- package/dist/utils/grants.cjs.map +1 -1
- package/dist/utils/grants.d.ts +101 -23
- package/dist/utils/grants.js +1 -1
- 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 +8 -10
- package/dist/utils/ipfs.js +2 -4
- package/dist/utils/ipfs.js.map +1 -1
- package/dist/utils/lazy-import.cjs +4 -6
- package/dist/utils/lazy-import.cjs.map +1 -1
- package/dist/utils/lazy-import.d.ts +33 -10
- package/dist/utils/lazy-import.js +4 -6
- package/dist/utils/lazy-import.js.map +1 -1
- package/dist/utils/multicall.cjs +4 -2
- package/dist/utils/multicall.cjs.map +1 -1
- package/dist/utils/multicall.d.ts +5 -8
- package/dist/utils/multicall.js +4 -2
- package/dist/utils/multicall.js.map +1 -1
- package/dist/utils/parseTransactionPojo.cjs +87 -0
- package/dist/utils/parseTransactionPojo.cjs.map +1 -0
- package/dist/utils/parseTransactionPojo.d.ts +31 -0
- package/dist/utils/parseTransactionPojo.js +63 -0
- package/dist/utils/parseTransactionPojo.js.map +1 -0
- package/dist/utils/schemaValidation.cjs +5 -5
- package/dist/utils/schemaValidation.cjs.map +1 -1
- package/dist/utils/schemaValidation.d.ts +8 -12
- package/dist/utils/schemaValidation.js +7 -10
- package/dist/utils/schemaValidation.js.map +1 -1
- package/dist/utils/signatureCache.cjs +9 -4
- package/dist/utils/signatureCache.cjs.map +1 -1
- package/dist/utils/signatureCache.d.ts +53 -15
- package/dist/utils/signatureCache.js +12 -10
- package/dist/utils/signatureCache.js.map +1 -1
- package/dist/utils/signatureFormatter.cjs +6 -9
- package/dist/utils/signatureFormatter.cjs.map +1 -1
- package/dist/utils/signatureFormatter.d.ts +2 -5
- package/dist/utils/signatureFormatter.js +6 -9
- package/dist/utils/signatureFormatter.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/tests/multicall.test.d.ts +1 -0
- package/dist/utils/transactionHelpers.cjs +54 -0
- package/dist/utils/transactionHelpers.cjs.map +1 -0
- package/dist/utils/transactionHelpers.d.ts +80 -0
- package/dist/utils/transactionHelpers.js +29 -0
- package/dist/utils/transactionHelpers.js.map +1 -0
- package/dist/utils/typeGuards.cjs +109 -0
- package/dist/utils/typeGuards.cjs.map +1 -0
- package/dist/utils/typeGuards.d.ts +138 -0
- package/dist/utils/typeGuards.js +74 -0
- package/dist/utils/typeGuards.js.map +1 -0
- package/dist/utils/typedDataConverter.cjs.map +1 -1
- package/dist/utils/typedDataConverter.d.ts +42 -9
- package/dist/utils/typedDataConverter.js.map +1 -1
- package/dist/utils/urlResolver.cjs +8 -1
- package/dist/utils/urlResolver.cjs.map +1 -1
- package/dist/utils/urlResolver.d.ts +24 -8
- package/dist/utils/urlResolver.js +9 -2
- 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/dist/utils/withEvents.cjs +44 -0
- package/dist/utils/withEvents.cjs.map +1 -0
- package/dist/utils/withEvents.d.ts +56 -0
- package/dist/utils/withEvents.js +18 -0
- package/dist/utils/withEvents.js.map +1 -0
- package/package.json +25 -13
- package/dist/browser.d.cts +0 -2
- package/dist/chains/definitions.d.cts +0 -53
- package/dist/chains/index.d.cts +0 -2
- package/dist/chains.browser.cjs.map +0 -1
- package/dist/chains.browser.d.cts +0 -2
- package/dist/chains.d.cts +0 -2
- package/dist/chains.node.d.cts +0 -2
- package/dist/config/addresses.d.cts +0 -380
- package/dist/config/chains.d.cts +0 -85
- package/dist/config/eventMappings.cjs +0 -114
- package/dist/config/eventMappings.cjs.map +0 -1
- package/dist/config/eventMappings.d.cts +0 -108
- package/dist/config/eventMappings.d.ts +0 -108
- package/dist/config/eventMappings.js +0 -90
- package/dist/config/eventMappings.js.map +0 -1
- package/dist/config/features.d.cts +0 -64
- package/dist/contracts/contractController.d.cts +0 -96
- package/dist/controllers/data.d.cts +0 -941
- package/dist/controllers/permissions.d.cts +0 -25
- package/dist/controllers/protocol.d.cts +0 -167
- package/dist/controllers/schemas.d.cts +0 -272
- package/dist/controllers/server.d.cts +0 -243
- package/dist/core/apiClient.d.cts +0 -165
- package/dist/core/client.d.cts +0 -92
- package/dist/core/generics.d.cts +0 -120
- package/dist/core.d.cts +0 -466
- package/dist/crypto/ecies/__tests__/test-vectors.d.cts +0 -40
- package/dist/crypto/ecies/base.d.cts +0 -143
- package/dist/crypto/ecies/browser.d.cts +0 -48
- package/dist/crypto/ecies/constants.d.cts +0 -122
- package/dist/crypto/ecies/index.d.cts +0 -1
- package/dist/crypto/ecies/interface.d.cts +0 -176
- package/dist/crypto/ecies/node.d.cts +0 -50
- package/dist/crypto/ecies/utils.d.cts +0 -67
- package/dist/crypto/services/WalletKeyEncryptionService.d.cts +0 -92
- package/dist/diagnostics.d.cts +0 -26
- package/dist/errors.d.cts +0 -350
- package/dist/generated/abi/ComputeEngineImplementation.d.cts +0 -996
- package/dist/generated/abi/ComputeInstructionRegistryImplementation.d.cts +0 -545
- package/dist/generated/abi/DATFactoryImplementation.d.cts +0 -661
- package/dist/generated/abi/DATImplementation.d.cts +0 -693
- package/dist/generated/abi/DATPausableImplementation.d.cts +0 -1145
- package/dist/generated/abi/DATVotesImplementation.d.cts +0 -1095
- package/dist/generated/abi/DLPPerformanceImplementation.d.cts +0 -883
- package/dist/generated/abi/DLPRegistryImplementation.d.cts +0 -1123
- package/dist/generated/abi/DLPRegistryTreasuryImplementation.d.cts +0 -452
- package/dist/generated/abi/DLPRewardDeployerImplementation.d.cts +0 -714
- package/dist/generated/abi/DLPRewardDeployerTreasuryImplementation.d.cts +0 -452
- package/dist/generated/abi/DLPRewardSwapImplementation.d.cts +0 -706
- package/dist/generated/abi/DLPRootImplementation.d.cts +0 -1248
- package/dist/generated/abi/DLPTreasuryImplementation.d.cts +0 -452
- package/dist/generated/abi/DataLiquidityPoolImplementation.d.cts +0 -737
- package/dist/generated/abi/DataPortabilityGranteesImplementation.d.cts +0 -661
- package/dist/generated/abi/DataPortabilityPermissionsImplementation.d.cts +0 -989
- package/dist/generated/abi/DataPortabilityServersImplementation.d.cts +0 -1086
- package/dist/generated/abi/DataRefinerRegistryImplementation.d.cts +0 -737
- package/dist/generated/abi/DataRegistryImplementation.d.cts +0 -1004
- package/dist/generated/abi/QueryEngineImplementation.d.cts +0 -1001
- package/dist/generated/abi/SwapHelperImplementation.d.cts +0 -764
- package/dist/generated/abi/TeePoolDedicatedGpuImplementation.d.cts +0 -701
- package/dist/generated/abi/TeePoolDedicatedStandardImplementation.d.cts +0 -701
- package/dist/generated/abi/TeePoolEphemeralStandardImplementation.d.cts +0 -701
- package/dist/generated/abi/TeePoolImplementation.d.cts +0 -993
- package/dist/generated/abi/TeePoolPersistentGpuImplementation.d.cts +0 -701
- package/dist/generated/abi/TeePoolPersistentStandardImplementation.d.cts +0 -701
- package/dist/generated/abi/TeePoolPhalaImplementation.d.cts +0 -993
- package/dist/generated/abi/VanaEpochImplementation.d.cts +0 -900
- package/dist/generated/abi/VanaPoolEntityImplementation.d.cts +0 -934
- package/dist/generated/abi/VanaPoolStakingImplementation.d.cts +0 -693
- package/dist/generated/abi/VanaPoolTreasuryImplementation.d.cts +0 -394
- package/dist/generated/abi/index.d.cts +0 -26516
- package/dist/generated/server/server-exports.d.cts +0 -21
- package/dist/generated/server/server.d.cts +0 -512
- package/dist/generated/subgraph.d.cts +0 -5981
- package/dist/index.browser.cjs +0 -151
- package/dist/index.browser.cjs.map +0 -1
- package/dist/index.browser.d.cts +0 -177
- package/dist/index.d.cts +0 -2
- package/dist/index.node.d.cts +0 -64
- package/dist/node.d.cts +0 -2
- package/dist/permissions-DNKPu_G0.d.cts +0 -1666
- package/dist/permissions-eo8YeLGf.d.ts +0 -1666
- package/dist/platform/browser-only.d.cts +0 -25
- package/dist/platform/browser-safe.d.cts +0 -32
- package/dist/platform/browser.d.cts +0 -74
- package/dist/platform/index.d.cts +0 -5
- package/dist/platform/interface.d.cts +0 -218
- package/dist/platform/node.d.cts +0 -27
- package/dist/platform/shared/error-utils.d.cts +0 -25
- package/dist/platform/shared/pgp-utils.d.cts +0 -61
- package/dist/platform/shared/stream-utils.d.cts +0 -16
- package/dist/platform/utils.d.cts +0 -53
- package/dist/platform.browser.cjs +0 -41
- package/dist/platform.browser.cjs.map +0 -1
- package/dist/platform.browser.d.cts +0 -4
- package/dist/platform.d.cts +0 -5
- package/dist/platform.node.d.cts +0 -5
- package/dist/server/handler.cjs +0 -101
- package/dist/server/handler.cjs.map +0 -1
- package/dist/server/handler.d.cts +0 -282
- package/dist/server/handler.d.ts +0 -282
- package/dist/server/handler.js +0 -77
- package/dist/server/handler.js.map +0 -1
- package/dist/storage/index.d.cts +0 -10
- package/dist/storage/manager.d.cts +0 -150
- package/dist/storage/providers/callback-storage.d.cts +0 -100
- package/dist/storage/providers/google-drive.d.cts +0 -156
- package/dist/storage/providers/ipfs.d.cts +0 -163
- package/dist/storage/providers/pinata.d.cts +0 -173
- package/dist/types/chains.d.cts +0 -34
- package/dist/types/config.d.cts +0 -726
- package/dist/types/contracts.d.cts +0 -68
- package/dist/types/data.d.cts +0 -694
- package/dist/types/eccrypto-js.d.d.cts +0 -13
- package/dist/types/eccrypto-js.d.d.ts +0 -13
- package/dist/types/external-apis.d.cts +0 -186
- package/dist/types/generics.d.cts +0 -450
- package/dist/types/index.d.cts +0 -34
- package/dist/types/operations.d.cts +0 -108
- package/dist/types/permissions.d.cts +0 -957
- package/dist/types/personal.d.cts +0 -40
- package/dist/types/relayer.d.cts +0 -284
- package/dist/types/storage.d.cts +0 -131
- package/dist/types/transactionResults.d.cts +0 -25
- package/dist/types/utils.d.cts +0 -819
- package/dist/types.d.cts +0 -66
- package/dist/utils/blockchain/registry.d.cts +0 -34
- package/dist/utils/crypto-utils.d.cts +0 -118
- package/dist/utils/download.d.cts +0 -41
- package/dist/utils/encoding.d.cts +0 -54
- package/dist/utils/encryption.d.cts +0 -275
- package/dist/utils/eventParsing.cjs +0 -111
- package/dist/utils/eventParsing.cjs.map +0 -1
- package/dist/utils/eventParsing.d.cts +0 -60
- package/dist/utils/eventParsing.d.ts +0 -60
- package/dist/utils/eventParsing.js +0 -86
- package/dist/utils/eventParsing.js.map +0 -1
- package/dist/utils/formatters.d.cts +0 -120
- package/dist/utils/grantFiles.d.cts +0 -186
- package/dist/utils/grantValidation.d.cts +0 -150
- package/dist/utils/grants.d.cts +0 -70
- package/dist/utils/ipfs.d.cts +0 -90
- package/dist/utils/lazy-import.d.cts +0 -20
- package/dist/utils/multicall.d.cts +0 -129
- package/dist/utils/schemaValidation.d.cts +0 -172
- package/dist/utils/signatureCache.d.cts +0 -134
- package/dist/utils/signatureFormatter.d.cts +0 -39
- package/dist/utils/transactionParsing.cjs +0 -84
- package/dist/utils/transactionParsing.cjs.map +0 -1
- package/dist/utils/transactionParsing.d.cts +0 -25
- package/dist/utils/transactionParsing.d.ts +0 -25
- package/dist/utils/transactionParsing.js +0 -62
- package/dist/utils/transactionParsing.js.map +0 -1
- package/dist/utils/typedDataConverter.d.cts +0 -13
- package/dist/utils/urlResolver.d.cts +0 -40
package/dist/types/relayer.d.ts
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
|
-
import { Hash } from 'viem';
|
|
2
|
-
import { GrantFile, PermissionGrantTypedData } from './permissions.js';
|
|
3
|
-
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
2
|
+
* Defines types for gasless transaction relayers and server operations.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* This module provides comprehensive type definitions for interacting with
|
|
6
|
+
* relayer services that enable gasless transactions and auxiliary operations.
|
|
7
|
+
* It includes both legacy v1 types and the simplified v2 unified interface.
|
|
8
|
+
*
|
|
9
|
+
* @category Types
|
|
10
|
+
* @module types/relayer
|
|
11
|
+
*/
|
|
12
|
+
import type { Hash, Address, TransactionReceipt } from "viem";
|
|
13
|
+
import type { GrantFile, PermissionGrantTypedData, GenericTypedData } from "./permissions";
|
|
14
|
+
/**
|
|
15
|
+
* Represents the response from storing grant files via relayer.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* Contains storage location, metadata, and error information for
|
|
19
|
+
* grant file upload operations.
|
|
6
20
|
*
|
|
7
21
|
* @category Advanced
|
|
8
22
|
*/
|
|
9
|
-
interface RelayerStorageResponse {
|
|
23
|
+
export interface RelayerStorageResponse {
|
|
10
24
|
/** The IPFS URL where the grant file is stored */
|
|
11
25
|
grantUrl: string;
|
|
12
26
|
/** Success status */
|
|
@@ -24,11 +38,15 @@ interface RelayerStorageResponse {
|
|
|
24
38
|
};
|
|
25
39
|
}
|
|
26
40
|
/**
|
|
27
|
-
*
|
|
41
|
+
* Represents the response from submitting transactions via relayer.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* Contains transaction hash, status, and metadata for gasless
|
|
45
|
+
* transaction submissions.
|
|
28
46
|
*
|
|
29
47
|
* @category Advanced
|
|
30
48
|
*/
|
|
31
|
-
interface RelayerTransactionResponse {
|
|
49
|
+
export interface RelayerTransactionResponse {
|
|
32
50
|
/** The transaction hash of the submitted transaction */
|
|
33
51
|
transactionHash: Hash;
|
|
34
52
|
/** Success status */
|
|
@@ -48,11 +66,15 @@ interface RelayerTransactionResponse {
|
|
|
48
66
|
};
|
|
49
67
|
}
|
|
50
68
|
/**
|
|
51
|
-
*
|
|
69
|
+
* Specifies parameters for storing grant files via relayer.
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* Includes the grant file and optional storage configuration
|
|
73
|
+
* such as encryption and pinning duration.
|
|
52
74
|
*
|
|
53
75
|
* @category Advanced
|
|
54
76
|
*/
|
|
55
|
-
interface RelayerStoreParams {
|
|
77
|
+
export interface RelayerStoreParams {
|
|
56
78
|
/** The grant file to store */
|
|
57
79
|
grantFile: GrantFile;
|
|
58
80
|
/** Optional storage options */
|
|
@@ -66,11 +88,15 @@ interface RelayerStoreParams {
|
|
|
66
88
|
};
|
|
67
89
|
}
|
|
68
90
|
/**
|
|
69
|
-
*
|
|
91
|
+
* Specifies parameters for submitting gasless transactions.
|
|
92
|
+
*
|
|
93
|
+
* @remarks
|
|
94
|
+
* Contains signed typed data and transaction configuration options
|
|
95
|
+
* for relayer submission.
|
|
70
96
|
*
|
|
71
97
|
* @category Advanced
|
|
72
98
|
*/
|
|
73
|
-
interface RelayerSubmitParams {
|
|
99
|
+
export interface RelayerSubmitParams {
|
|
74
100
|
/** The signed typed data */
|
|
75
101
|
typedData: PermissionGrantTypedData;
|
|
76
102
|
/** The signature */
|
|
@@ -86,11 +112,15 @@ interface RelayerSubmitParams {
|
|
|
86
112
|
};
|
|
87
113
|
}
|
|
88
114
|
/**
|
|
89
|
-
*
|
|
115
|
+
* Represents the current status and capabilities of a relayer service.
|
|
116
|
+
*
|
|
117
|
+
* @remarks
|
|
118
|
+
* Provides information about supported chains, rate limits, and
|
|
119
|
+
* current operational status for monitoring and decision-making.
|
|
90
120
|
*
|
|
91
121
|
* @category Advanced
|
|
92
122
|
*/
|
|
93
|
-
interface RelayerStatus {
|
|
123
|
+
export interface RelayerStatus {
|
|
94
124
|
/** Whether the relayer is online */
|
|
95
125
|
online: boolean;
|
|
96
126
|
/** Service version */
|
|
@@ -119,33 +149,15 @@ interface RelayerStatus {
|
|
|
119
149
|
};
|
|
120
150
|
}
|
|
121
151
|
/**
|
|
122
|
-
*
|
|
152
|
+
* Configures behavior for relayer requests.
|
|
123
153
|
*
|
|
124
|
-
* @
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
/** Relayer service URL */
|
|
128
|
-
url: string;
|
|
129
|
-
/** API key for authentication */
|
|
130
|
-
apiKey?: string;
|
|
131
|
-
/** Timeout for requests in milliseconds */
|
|
132
|
-
timeout?: number;
|
|
133
|
-
/** Retry configuration */
|
|
134
|
-
retry?: {
|
|
135
|
-
/** Number of retry attempts */
|
|
136
|
-
attempts: number;
|
|
137
|
-
/** Delay between retries in milliseconds */
|
|
138
|
-
delay: number;
|
|
139
|
-
};
|
|
140
|
-
/** Whether to use HTTPS */
|
|
141
|
-
useHttps?: boolean;
|
|
142
|
-
}
|
|
143
|
-
/**
|
|
144
|
-
* Relayer request options
|
|
154
|
+
* @remarks
|
|
155
|
+
* Controls timeout, retry logic, headers, and priority for
|
|
156
|
+
* relayer operation requests.
|
|
145
157
|
*
|
|
146
158
|
* @category Advanced
|
|
147
159
|
*/
|
|
148
|
-
interface RelayerRequestOptions {
|
|
160
|
+
export interface RelayerRequestOptions {
|
|
149
161
|
/** Request timeout in milliseconds */
|
|
150
162
|
timeout?: number;
|
|
151
163
|
/** Whether to retry on failure */
|
|
@@ -156,11 +168,15 @@ interface RelayerRequestOptions {
|
|
|
156
168
|
priority?: "low" | "medium" | "high";
|
|
157
169
|
}
|
|
158
170
|
/**
|
|
159
|
-
*
|
|
171
|
+
* Represents an error response from the relayer service.
|
|
172
|
+
*
|
|
173
|
+
* @remarks
|
|
174
|
+
* Provides structured error information including codes, messages,
|
|
175
|
+
* and debugging details for error handling and recovery.
|
|
160
176
|
*
|
|
161
177
|
* @category Advanced
|
|
162
178
|
*/
|
|
163
|
-
interface RelayerErrorResponse {
|
|
179
|
+
export interface RelayerErrorResponse {
|
|
164
180
|
/** Error code */
|
|
165
181
|
code: string;
|
|
166
182
|
/** Error message */
|
|
@@ -173,11 +189,15 @@ interface RelayerErrorResponse {
|
|
|
173
189
|
timestamp: number;
|
|
174
190
|
}
|
|
175
191
|
/**
|
|
176
|
-
*
|
|
192
|
+
* Provides information about the relayer's processing queue.
|
|
193
|
+
*
|
|
194
|
+
* @remarks
|
|
195
|
+
* Includes queue size, position, estimated processing time, and
|
|
196
|
+
* performance statistics for queue monitoring.
|
|
177
197
|
*
|
|
178
198
|
* @category Advanced
|
|
179
199
|
*/
|
|
180
|
-
interface RelayerQueueInfo {
|
|
200
|
+
export interface RelayerQueueInfo {
|
|
181
201
|
/** Current queue size */
|
|
182
202
|
size: number;
|
|
183
203
|
/** Estimated processing time in seconds */
|
|
@@ -195,11 +215,15 @@ interface RelayerQueueInfo {
|
|
|
195
215
|
};
|
|
196
216
|
}
|
|
197
217
|
/**
|
|
198
|
-
*
|
|
218
|
+
* Tracks the status of a transaction submitted via relayer.
|
|
219
|
+
*
|
|
220
|
+
* @remarks
|
|
221
|
+
* Provides detailed tracking information including confirmation status,
|
|
222
|
+
* gas usage, and historical status checks.
|
|
199
223
|
*
|
|
200
224
|
* @category Advanced
|
|
201
225
|
*/
|
|
202
|
-
interface RelayerTransactionStatus {
|
|
226
|
+
export interface RelayerTransactionStatus {
|
|
203
227
|
/** Transaction hash */
|
|
204
228
|
transactionHash: Hash;
|
|
205
229
|
/** Current status */
|
|
@@ -221,11 +245,15 @@ interface RelayerTransactionStatus {
|
|
|
221
245
|
}>;
|
|
222
246
|
}
|
|
223
247
|
/**
|
|
224
|
-
*
|
|
248
|
+
* Provides performance metrics for the relayer service.
|
|
249
|
+
*
|
|
250
|
+
* @remarks
|
|
251
|
+
* Includes transaction statistics, success rates, processing times,
|
|
252
|
+
* and uptime information for monitoring and optimization.
|
|
225
253
|
*
|
|
226
254
|
* @category Advanced
|
|
227
255
|
*/
|
|
228
|
-
interface RelayerMetrics {
|
|
256
|
+
export interface RelayerMetrics {
|
|
229
257
|
/** Total transactions processed */
|
|
230
258
|
totalTransactions: number;
|
|
231
259
|
/** Successful transactions */
|
|
@@ -249,11 +277,15 @@ interface RelayerMetrics {
|
|
|
249
277
|
};
|
|
250
278
|
}
|
|
251
279
|
/**
|
|
252
|
-
*
|
|
280
|
+
* Configures webhook notifications for relayer events.
|
|
281
|
+
*
|
|
282
|
+
* @remarks
|
|
283
|
+
* Enables asynchronous notifications for transaction confirmations,
|
|
284
|
+
* failures, and storage completions.
|
|
253
285
|
*
|
|
254
286
|
* @category Advanced
|
|
255
287
|
*/
|
|
256
|
-
interface RelayerWebhookConfig {
|
|
288
|
+
export interface RelayerWebhookConfig {
|
|
257
289
|
/** Webhook URL */
|
|
258
290
|
url: string;
|
|
259
291
|
/** Events to subscribe to */
|
|
@@ -264,11 +296,15 @@ interface RelayerWebhookConfig {
|
|
|
264
296
|
active: boolean;
|
|
265
297
|
}
|
|
266
298
|
/**
|
|
267
|
-
*
|
|
299
|
+
* Represents a webhook event payload from the relayer.
|
|
300
|
+
*
|
|
301
|
+
* @remarks
|
|
302
|
+
* Contains event data, timestamp, and signature for verification
|
|
303
|
+
* of webhook authenticity.
|
|
268
304
|
*
|
|
269
305
|
* @category Advanced
|
|
270
306
|
*/
|
|
271
|
-
interface RelayerWebhookPayload {
|
|
307
|
+
export interface RelayerWebhookPayload {
|
|
272
308
|
/** Event type */
|
|
273
309
|
event: string;
|
|
274
310
|
/** Event data */
|
|
@@ -280,5 +316,212 @@ interface RelayerWebhookPayload {
|
|
|
280
316
|
/** Signature for verification */
|
|
281
317
|
signature: string;
|
|
282
318
|
}
|
|
283
|
-
|
|
284
|
-
|
|
319
|
+
/**
|
|
320
|
+
* Handles both EIP-712 signed operations and direct server operations through a single interface.
|
|
321
|
+
*
|
|
322
|
+
* @remarks
|
|
323
|
+
* This discriminated union provides type safety through TypeScript's narrowing.
|
|
324
|
+
* The `type` field determines which operation variant is being used.
|
|
325
|
+
* Signed operations require blockchain transactions, while direct operations
|
|
326
|
+
* handle auxiliary tasks like file storage.
|
|
327
|
+
*
|
|
328
|
+
* @category Relayer
|
|
329
|
+
* @see {@link https://docs.vana.org/docs/gasless-transactions | Gasless Transactions Guide}
|
|
330
|
+
*/
|
|
331
|
+
export type UnifiedRelayerRequest = SignedRelayerRequest | DirectRelayerRequest | {
|
|
332
|
+
type: "status_check";
|
|
333
|
+
operationId: string;
|
|
334
|
+
};
|
|
335
|
+
/**
|
|
336
|
+
* Represents an EIP-712 signed operation for gasless transaction submission.
|
|
337
|
+
*
|
|
338
|
+
* @remarks
|
|
339
|
+
* Signed requests contain typed data and signatures that are verified
|
|
340
|
+
* on-chain by smart contracts. The relayer pays gas fees on behalf of users.
|
|
341
|
+
*
|
|
342
|
+
* @category Relayer
|
|
343
|
+
*/
|
|
344
|
+
export interface SignedRelayerRequest {
|
|
345
|
+
/** Discriminator field identifying this as a signed operation */
|
|
346
|
+
type: "signed";
|
|
347
|
+
/** Operation identifier for routing (e.g., 'submitAddPermission') */
|
|
348
|
+
operation: SignedOperationType;
|
|
349
|
+
/** EIP-712 typed data structure for the operation */
|
|
350
|
+
typedData: GenericTypedData;
|
|
351
|
+
/** User's signature of the typed data */
|
|
352
|
+
signature: Hash;
|
|
353
|
+
/** Optional address for additional signer verification */
|
|
354
|
+
expectedUserAddress?: Address;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Enumerates supported EIP-712 signed operation types.
|
|
358
|
+
*
|
|
359
|
+
* @remarks
|
|
360
|
+
* Each operation type corresponds to a specific smart contract
|
|
361
|
+
* function that accepts gasless transactions.
|
|
362
|
+
*
|
|
363
|
+
* @category Relayer
|
|
364
|
+
*/
|
|
365
|
+
export type SignedOperationType = "submitAddPermission" | "submitPermissionRevoke" | "submitTrustServer" | "submitAddAndTrustServer" | "submitUntrustServer" | "submitAddServerFilesAndPermissions";
|
|
366
|
+
/**
|
|
367
|
+
* Represents direct server operations that don't require blockchain signatures.
|
|
368
|
+
*
|
|
369
|
+
* @remarks
|
|
370
|
+
* Direct requests handle auxiliary operations like file uploads and grant storage.
|
|
371
|
+
* These operations may still result in blockchain transactions but don't require
|
|
372
|
+
* user signatures for gasless submission.
|
|
373
|
+
*
|
|
374
|
+
* @category Relayer
|
|
375
|
+
*/
|
|
376
|
+
export type DirectRelayerRequest = {
|
|
377
|
+
type: "direct";
|
|
378
|
+
operation: "submitFileAddition";
|
|
379
|
+
params: {
|
|
380
|
+
url: string;
|
|
381
|
+
userAddress: Address;
|
|
382
|
+
};
|
|
383
|
+
} | {
|
|
384
|
+
type: "direct";
|
|
385
|
+
operation: "submitFileAdditionWithPermissions";
|
|
386
|
+
params: {
|
|
387
|
+
url: string;
|
|
388
|
+
userAddress: Address;
|
|
389
|
+
permissions: Array<{
|
|
390
|
+
account: Address;
|
|
391
|
+
key: string;
|
|
392
|
+
}>;
|
|
393
|
+
};
|
|
394
|
+
} | {
|
|
395
|
+
type: "direct";
|
|
396
|
+
operation: "submitFileAdditionComplete";
|
|
397
|
+
params: {
|
|
398
|
+
url: string;
|
|
399
|
+
userAddress: Address;
|
|
400
|
+
permissions: Array<{
|
|
401
|
+
account: Address;
|
|
402
|
+
key: string;
|
|
403
|
+
}>;
|
|
404
|
+
schemaId: number;
|
|
405
|
+
ownerAddress?: Address;
|
|
406
|
+
};
|
|
407
|
+
} | {
|
|
408
|
+
type: "direct";
|
|
409
|
+
operation: "storeGrantFile";
|
|
410
|
+
params: GrantFile;
|
|
411
|
+
} | {
|
|
412
|
+
type: "direct";
|
|
413
|
+
operation: "submitRegisterGrantee";
|
|
414
|
+
params: {
|
|
415
|
+
owner: Address;
|
|
416
|
+
granteeAddress: Address;
|
|
417
|
+
publicKey: string;
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
/**
|
|
421
|
+
* Provides type-safe responses for all relayer operations.
|
|
422
|
+
*
|
|
423
|
+
* @remarks
|
|
424
|
+
* The discriminated union ensures proper error handling and result typing.
|
|
425
|
+
* Check the `type` field to determine success or failure before accessing results.
|
|
426
|
+
* The new async pattern returns pending operations with operationIds for polling.
|
|
427
|
+
*
|
|
428
|
+
* @category Relayer
|
|
429
|
+
*/
|
|
430
|
+
export type UnifiedRelayerResponse = {
|
|
431
|
+
type: "pending";
|
|
432
|
+
operationId: string;
|
|
433
|
+
} | {
|
|
434
|
+
type: "submitted";
|
|
435
|
+
hash: Hash;
|
|
436
|
+
} | {
|
|
437
|
+
type: "confirmed";
|
|
438
|
+
hash: Hash;
|
|
439
|
+
receipt?: TransactionReceipt;
|
|
440
|
+
} | {
|
|
441
|
+
type: "signed";
|
|
442
|
+
hash: Hash;
|
|
443
|
+
} | {
|
|
444
|
+
/** Non-transactional operations that complete immediately (e.g., IPFS uploads, file info) */
|
|
445
|
+
type: "direct";
|
|
446
|
+
/** The result data from the operation, structure depends on the specific operation */
|
|
447
|
+
result: unknown;
|
|
448
|
+
} | {
|
|
449
|
+
type: "error";
|
|
450
|
+
error: string;
|
|
451
|
+
};
|
|
452
|
+
/**
|
|
453
|
+
* Simplified relayer configuration.
|
|
454
|
+
* Can be a URL string for convenience, or a callback for full control.
|
|
455
|
+
*
|
|
456
|
+
* @category Configuration
|
|
457
|
+
* @example
|
|
458
|
+
* ```typescript
|
|
459
|
+
* // Option 1: Simple URL (SDK handles the transport)
|
|
460
|
+
* const vana = Vana({
|
|
461
|
+
* walletClient,
|
|
462
|
+
* relayer: '/api/relay'
|
|
463
|
+
* });
|
|
464
|
+
*
|
|
465
|
+
* // Option 2: Full control with callback
|
|
466
|
+
* const vana = Vana({
|
|
467
|
+
* walletClient,
|
|
468
|
+
* relayer: async (request) => {
|
|
469
|
+
* const response = await fetch('/api/relay', {
|
|
470
|
+
* method: 'POST',
|
|
471
|
+
* body: JSON.stringify(request)
|
|
472
|
+
* });
|
|
473
|
+
* return response.json();
|
|
474
|
+
* }
|
|
475
|
+
* });
|
|
476
|
+
* ```
|
|
477
|
+
*/
|
|
478
|
+
export type RelayerConfig = string | ((request: UnifiedRelayerRequest) => Promise<UnifiedRelayerResponse>);
|
|
479
|
+
/**
|
|
480
|
+
* Simplified relayer callbacks interface (v2).
|
|
481
|
+
* A single callback handles all relayer operations.
|
|
482
|
+
*
|
|
483
|
+
* @category Configuration
|
|
484
|
+
* @example
|
|
485
|
+
* ```typescript
|
|
486
|
+
* const relayerCallbacks: RelayerCallbacksV2 = {
|
|
487
|
+
* submit: async (request) => {
|
|
488
|
+
* // Send to your server endpoint
|
|
489
|
+
* const response = await fetch('/api/relay', {
|
|
490
|
+
* method: 'POST',
|
|
491
|
+
* headers: { 'Content-Type': 'application/json' },
|
|
492
|
+
* body: JSON.stringify(request)
|
|
493
|
+
* });
|
|
494
|
+
* return response.json();
|
|
495
|
+
* }
|
|
496
|
+
* };
|
|
497
|
+
* ```
|
|
498
|
+
*/
|
|
499
|
+
export interface RelayerCallbacksV2 {
|
|
500
|
+
/**
|
|
501
|
+
* Submits any relayer operation to the server.
|
|
502
|
+
*
|
|
503
|
+
* @remarks
|
|
504
|
+
* This single callback handles all operations:
|
|
505
|
+
* - EIP-712 signed operations (permissions, server trust, etc.)
|
|
506
|
+
* - Direct operations (file additions, grant storage)
|
|
507
|
+
*
|
|
508
|
+
* On your server, pass the entire request object to the SDK's
|
|
509
|
+
* `handleRelayerOperation` helper function.
|
|
510
|
+
*
|
|
511
|
+
* @param request - The unified request object.
|
|
512
|
+
* Check `type` field to determine operation variant.
|
|
513
|
+
* @returns Promise resolving to operation-specific response
|
|
514
|
+
*
|
|
515
|
+
* @example
|
|
516
|
+
* ```typescript
|
|
517
|
+
* async submit(request) {
|
|
518
|
+
* const response = await fetch('/api/relay', {
|
|
519
|
+
* method: 'POST',
|
|
520
|
+
* body: JSON.stringify(request)
|
|
521
|
+
* });
|
|
522
|
+
* return response.json();
|
|
523
|
+
* }
|
|
524
|
+
* ```
|
|
525
|
+
*/
|
|
526
|
+
submit: (request: UnifiedRelayerRequest) => Promise<UnifiedRelayerResponse>;
|
|
527
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/storage.ts"],"sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"sources":["../../src/types/storage.ts"],"sourcesContent":["/**\n * Defines interface for storage provider implementations.\n *\n * @remarks\n * Abstracts storage backends (IPFS, Google Drive, Pinata) behind\n * common interface for encrypted file operations.\n *\n * @category Storage\n * @example\n * ```typescript\n * class MyStorage implements StorageProvider {\n * async upload(file: Blob): Promise<StorageUploadResult> {\n * const url = await uploadToService(file);\n * return { url, size: file.size, contentType: file.type };\n * }\n *\n * async download(url: string): Promise<Blob> {\n * return fetch(url).then(r => r.blob());\n * }\n * }\n * ```\n */\nexport interface StorageProvider {\n /**\n * Upload a file to the storage provider\n *\n * @param file - The file to upload\n * @param filename - Optional custom filename\n * @returns Promise with storage URL and metadata\n */\n upload(file: Blob, filename?: string): Promise<StorageUploadResult>;\n\n /**\n * Download a file from the storage provider\n *\n * @param url - The storage URL\n * @returns Promise with file blob\n */\n download(url: string): Promise<Blob>;\n\n /**\n * List files from the storage provider\n *\n * @param options - Optional filtering and pagination\n * @returns Promise with file list\n */\n list(options?: StorageListOptions): Promise<StorageFile[]>;\n\n /**\n * Delete a file from the storage provider\n *\n * @param url - The storage URL\n * @returns Promise with success status\n */\n delete(url: string): Promise<boolean>;\n\n /**\n * Get provider-specific configuration\n *\n * @returns Provider configuration object\n */\n getConfig(): StorageProviderConfig;\n}\n\nexport interface StorageUploadResult {\n /** Public URL to access the file */\n url: string;\n /** File size in bytes */\n size: number;\n /** Content type/MIME type */\n contentType: string;\n /** Provider-specific metadata */\n metadata?: Record<string, unknown>;\n}\n\nexport interface StorageFile {\n /** File identifier */\n id: string;\n /** File name */\n name: string;\n /** Public URL to access the file */\n url: string;\n /** File size in bytes */\n size: number;\n /** Content type/MIME type */\n contentType: string;\n /** Upload timestamp */\n createdAt: Date;\n /** Provider-specific metadata */\n metadata?: Record<string, unknown>;\n}\n\nexport interface StorageListOptions {\n /** Maximum number of files to return */\n limit?: number;\n /** Pagination cursor/offset */\n offset?: string | number;\n /** Filter by file name pattern */\n namePattern?: string;\n /** Filter by content type */\n contentType?: string;\n}\n\nexport interface StorageProviderConfig {\n /** Provider name */\n name: string;\n /** Provider type */\n type: string;\n /** Whether authentication is required */\n requiresAuth: boolean;\n /** Supported features */\n features: {\n upload: boolean;\n download: boolean;\n list: boolean;\n delete: boolean;\n };\n}\n\nexport class StorageError extends Error {\n public readonly code: string;\n public readonly provider: string;\n // The 'cause' property is now inherited from the base Error class\n\n constructor(\n message: string,\n code: string,\n provider: string,\n options?: { cause?: Error },\n ) {\n // Pass the options object with 'cause' to the super constructor\n super(message, options);\n this.name = \"StorageError\";\n this.code = code;\n this.provider = provider;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAuHO,MAAM,qBAAqB,MAAM;AAAA,EACtB;AAAA,EACA;AAAA;AAAA,EAGhB,YACE,SACA,MACA,UACA,SACA;AAEA,UAAM,SAAS,OAAO;AACtB,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,WAAW;AAAA,EAClB;AACF;","names":[]}
|
package/dist/types/storage.d.ts
CHANGED
|
@@ -1,38 +1,26 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Defines interface for storage provider implementations.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Abstracts storage backends (IPFS, Google Drive, Pinata) behind
|
|
6
|
+
* common interface for encrypted file operations.
|
|
7
7
|
*
|
|
8
8
|
* @category Storage
|
|
9
9
|
* @example
|
|
10
10
|
* ```typescript
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* return { url: 'https://my-storage.com/file.dat', size: file.size };
|
|
11
|
+
* class MyStorage implements StorageProvider {
|
|
12
|
+
* async upload(file: Blob): Promise<StorageUploadResult> {
|
|
13
|
+
* const url = await uploadToService(file);
|
|
14
|
+
* return { url, size: file.size, contentType: file.type };
|
|
16
15
|
* }
|
|
17
16
|
*
|
|
18
17
|
* async download(url: string): Promise<Blob> {
|
|
19
|
-
*
|
|
20
|
-
* const response = await fetch(url);
|
|
21
|
-
* return response.blob();
|
|
22
|
-
* }
|
|
23
|
-
*
|
|
24
|
-
* async list(options?: StorageListOptions): Promise<StorageFile[]> {
|
|
25
|
-
* // Return list of files
|
|
26
|
-
* return [];
|
|
27
|
-
* }
|
|
28
|
-
*
|
|
29
|
-
* async delete(url: string): Promise<void> {
|
|
30
|
-
* // Delete file implementation
|
|
18
|
+
* return fetch(url).then(r => r.blob());
|
|
31
19
|
* }
|
|
32
20
|
* }
|
|
33
21
|
* ```
|
|
34
22
|
*/
|
|
35
|
-
interface StorageProvider {
|
|
23
|
+
export interface StorageProvider {
|
|
36
24
|
/**
|
|
37
25
|
* Upload a file to the storage provider
|
|
38
26
|
*
|
|
@@ -69,7 +57,7 @@ interface StorageProvider {
|
|
|
69
57
|
*/
|
|
70
58
|
getConfig(): StorageProviderConfig;
|
|
71
59
|
}
|
|
72
|
-
interface StorageUploadResult {
|
|
60
|
+
export interface StorageUploadResult {
|
|
73
61
|
/** Public URL to access the file */
|
|
74
62
|
url: string;
|
|
75
63
|
/** File size in bytes */
|
|
@@ -79,7 +67,7 @@ interface StorageUploadResult {
|
|
|
79
67
|
/** Provider-specific metadata */
|
|
80
68
|
metadata?: Record<string, unknown>;
|
|
81
69
|
}
|
|
82
|
-
interface StorageFile {
|
|
70
|
+
export interface StorageFile {
|
|
83
71
|
/** File identifier */
|
|
84
72
|
id: string;
|
|
85
73
|
/** File name */
|
|
@@ -95,7 +83,7 @@ interface StorageFile {
|
|
|
95
83
|
/** Provider-specific metadata */
|
|
96
84
|
metadata?: Record<string, unknown>;
|
|
97
85
|
}
|
|
98
|
-
interface StorageListOptions {
|
|
86
|
+
export interface StorageListOptions {
|
|
99
87
|
/** Maximum number of files to return */
|
|
100
88
|
limit?: number;
|
|
101
89
|
/** Pagination cursor/offset */
|
|
@@ -105,7 +93,7 @@ interface StorageListOptions {
|
|
|
105
93
|
/** Filter by content type */
|
|
106
94
|
contentType?: string;
|
|
107
95
|
}
|
|
108
|
-
interface StorageProviderConfig {
|
|
96
|
+
export interface StorageProviderConfig {
|
|
109
97
|
/** Provider name */
|
|
110
98
|
name: string;
|
|
111
99
|
/** Provider type */
|
|
@@ -120,12 +108,10 @@ interface StorageProviderConfig {
|
|
|
120
108
|
delete: boolean;
|
|
121
109
|
};
|
|
122
110
|
}
|
|
123
|
-
declare class StorageError extends Error {
|
|
111
|
+
export declare class StorageError extends Error {
|
|
124
112
|
readonly code: string;
|
|
125
113
|
readonly provider: string;
|
|
126
114
|
constructor(message: string, code: string, provider: string, options?: {
|
|
127
115
|
cause?: Error;
|
|
128
116
|
});
|
|
129
117
|
}
|
|
130
|
-
|
|
131
|
-
export { StorageError, type StorageFile, type StorageListOptions, type StorageProvider, type StorageProviderConfig, type StorageUploadResult };
|
package/dist/types/storage.js
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
1
|
class StorageError extends Error {
|
|
2
|
+
code;
|
|
3
|
+
provider;
|
|
5
4
|
// The 'cause' property is now inherited from the base Error class
|
|
6
5
|
constructor(message, code, provider, options) {
|
|
7
6
|
super(message, options);
|
|
8
|
-
__publicField(this, "code");
|
|
9
|
-
__publicField(this, "provider");
|
|
10
7
|
this.name = "StorageError";
|
|
11
8
|
this.code = code;
|
|
12
9
|
this.provider = provider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/storage.ts"],"sourcesContent":["/**\n *
|
|
1
|
+
{"version":3,"sources":["../../src/types/storage.ts"],"sourcesContent":["/**\n * Defines interface for storage provider implementations.\n *\n * @remarks\n * Abstracts storage backends (IPFS, Google Drive, Pinata) behind\n * common interface for encrypted file operations.\n *\n * @category Storage\n * @example\n * ```typescript\n * class MyStorage implements StorageProvider {\n * async upload(file: Blob): Promise<StorageUploadResult> {\n * const url = await uploadToService(file);\n * return { url, size: file.size, contentType: file.type };\n * }\n *\n * async download(url: string): Promise<Blob> {\n * return fetch(url).then(r => r.blob());\n * }\n * }\n * ```\n */\nexport interface StorageProvider {\n /**\n * Upload a file to the storage provider\n *\n * @param file - The file to upload\n * @param filename - Optional custom filename\n * @returns Promise with storage URL and metadata\n */\n upload(file: Blob, filename?: string): Promise<StorageUploadResult>;\n\n /**\n * Download a file from the storage provider\n *\n * @param url - The storage URL\n * @returns Promise with file blob\n */\n download(url: string): Promise<Blob>;\n\n /**\n * List files from the storage provider\n *\n * @param options - Optional filtering and pagination\n * @returns Promise with file list\n */\n list(options?: StorageListOptions): Promise<StorageFile[]>;\n\n /**\n * Delete a file from the storage provider\n *\n * @param url - The storage URL\n * @returns Promise with success status\n */\n delete(url: string): Promise<boolean>;\n\n /**\n * Get provider-specific configuration\n *\n * @returns Provider configuration object\n */\n getConfig(): StorageProviderConfig;\n}\n\nexport interface StorageUploadResult {\n /** Public URL to access the file */\n url: string;\n /** File size in bytes */\n size: number;\n /** Content type/MIME type */\n contentType: string;\n /** Provider-specific metadata */\n metadata?: Record<string, unknown>;\n}\n\nexport interface StorageFile {\n /** File identifier */\n id: string;\n /** File name */\n name: string;\n /** Public URL to access the file */\n url: string;\n /** File size in bytes */\n size: number;\n /** Content type/MIME type */\n contentType: string;\n /** Upload timestamp */\n createdAt: Date;\n /** Provider-specific metadata */\n metadata?: Record<string, unknown>;\n}\n\nexport interface StorageListOptions {\n /** Maximum number of files to return */\n limit?: number;\n /** Pagination cursor/offset */\n offset?: string | number;\n /** Filter by file name pattern */\n namePattern?: string;\n /** Filter by content type */\n contentType?: string;\n}\n\nexport interface StorageProviderConfig {\n /** Provider name */\n name: string;\n /** Provider type */\n type: string;\n /** Whether authentication is required */\n requiresAuth: boolean;\n /** Supported features */\n features: {\n upload: boolean;\n download: boolean;\n list: boolean;\n delete: boolean;\n };\n}\n\nexport class StorageError extends Error {\n public readonly code: string;\n public readonly provider: string;\n // The 'cause' property is now inherited from the base Error class\n\n constructor(\n message: string,\n code: string,\n provider: string,\n options?: { cause?: Error },\n ) {\n // Pass the options object with 'cause' to the super constructor\n super(message, options);\n this.name = \"StorageError\";\n this.code = code;\n this.provider = provider;\n }\n}\n"],"mappings":"AAuHO,MAAM,qBAAqB,MAAM;AAAA,EACtB;AAAA,EACA;AAAA;AAAA,EAGhB,YACE,SACA,MACA,UACA,SACA;AAEA,UAAM,SAAS,OAAO;AACtB,SAAK,OAAO;AACZ,SAAK,OAAO;AACZ,SAAK,WAAW;AAAA,EAClB;AACF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/transactionResults.ts"],"sourcesContent":["import type { Address } from \"viem\";\
|
|
1
|
+
{"version":3,"sources":["../../src/types/transactionResults.ts"],"sourcesContent":["import type { Address } from \"viem\";\n// BaseTransactionResult will be replaced once migration is complete\ninterface BaseTransactionResult {\n transactionHash: `0x${string}`;\n blockNumber: bigint;\n gasUsed: bigint;\n}\n\n/**\n * Transaction result types for all SDK operations.\n * These interfaces define the structure of data returned by enhanced\n * transaction methods that parse blockchain events automatically.\n */\n\n// =============================================================================\n// PERMISSION OPERATIONS\n// =============================================================================\n\n/**\n * Result of a successful permission grant operation.\n * Contains data from the PermissionAdded blockchain event.\n */\nexport interface PermissionGrantResult extends BaseTransactionResult {\n /** Unique permission ID for this grant */\n permissionId: bigint;\n /** Address of the user who granted the permission */\n user: Address;\n /** URL where the grant file is stored (IPFS/CDN) */\n grant: string;\n /** Array of file IDs covered by this permission */\n fileIds: readonly bigint[];\n}\n\n/**\n * Result of a successful permission revocation operation.\n * Contains data from the PermissionRevoked blockchain event.\n */\nexport interface PermissionRevokeResult extends BaseTransactionResult {\n /** ID of the permission that was revoked */\n permissionId: bigint;\n}\n\n/**\n * Result of a successful server trust operation.\n * Contains data from the ServerTrusted blockchain event.\n */\nexport interface ServerTrustResult extends BaseTransactionResult {\n /** Address of the user who trusted the server (from event) */\n user: Address;\n /** Numeric ID of the trusted server (from event) */\n serverId: bigint;\n /** Address of the trusted server (from params/derived) */\n serverAddress?: Address;\n /** URL of the trusted server (from params/provided) */\n serverUrl?: string;\n}\n\n/**\n * Result of a successful server untrust operation.\n * Contains data from the ServerUntrusted blockchain event.\n */\nexport interface ServerUntrustResult extends BaseTransactionResult {\n /** Address of the user who untrusted the server */\n user: Address;\n /** Address/ID of the untrusted server */\n serverId: Address;\n}\n\n/**\n * Result of a successful server registration operation.\n * Contains data from the ServerRegistered blockchain event.\n */\nexport interface ServerRegisterResult extends BaseTransactionResult {\n /** Unique server ID assigned by the registry */\n serverId: bigint;\n /** URL of the registered server */\n url: string;\n /** Owner address of the server */\n owner: Address;\n}\n\n/**\n * Result of a successful server update operation.\n * Contains data from the ServerUpdated blockchain event.\n */\nexport interface ServerUpdateResult extends BaseTransactionResult {\n /** ID of the server that was updated */\n serverId: bigint;\n /** New URL of the server */\n url: string;\n}\n\n/**\n * Result of a successful grantee registration operation.\n * Contains data from the GranteeRegistered blockchain event.\n */\nexport interface GranteeRegisterResult extends BaseTransactionResult {\n /** Unique grantee ID assigned by the registry */\n granteeId: bigint;\n /** Address of the registered grantee */\n granteeAddress: Address;\n /** Display name of the grantee */\n name: string;\n}\n\n// =============================================================================\n// DATA REGISTRY OPERATIONS\n// =============================================================================\n\n/**\n * Result of a successful file addition operation.\n * Contains data from the FileAddedV2 blockchain event.\n */\nexport interface FileAddedResult extends BaseTransactionResult {\n /** Unique file ID assigned by the registry */\n fileId: bigint;\n /** Address of the file owner */\n ownerAddress: Address;\n /** URL where the file is stored */\n url: string;\n /** Schema ID associated with the file (0 for no schema) */\n schemaId: bigint;\n}\n\n/**\n * Result of a successful schema addition operation.\n * Contains data from the SchemaAdded blockchain event.\n */\nexport interface SchemaAddedResult extends BaseTransactionResult {\n /** Unique schema ID assigned by the registry */\n schemaId: bigint;\n /** Human-readable name of the schema */\n name: string;\n /** Schema dialect (e.g., \"jsonschema\") */\n dialect: string;\n /** URL where the schema definition is stored */\n definitionUrl: string;\n}\n\n/**\n * Result of a successful refiner addition operation.\n * Contains data from the RefinerAdded blockchain event.\n */\nexport interface RefinerAddedResult extends BaseTransactionResult {\n /** Unique refiner ID assigned by the registry */\n refinerId: bigint;\n /** DLP ID this refiner belongs to */\n dlpId: bigint;\n /** Human-readable name of the refiner */\n name: string;\n /** Schema ID this refiner uses */\n schemaId: bigint;\n /** URL where the schema definition is stored */\n schemaDefinitionUrl: string;\n /** URL with refiner processing instructions */\n refinementInstructionUrl: string;\n}\n\n/**\n * Result of a successful schema ID update operation.\n * Contains data from the RefinerSchemaUpdated blockchain event.\n */\nexport interface SchemaUpdateResult extends BaseTransactionResult {\n /** ID of the refiner that was updated */\n refinerId: bigint;\n /** New schema ID */\n schemaId: bigint;\n /** URL of the new schema definition */\n schemaDefinitionUrl: string;\n}\n\n/**\n * Result of a successful file permission addition operation.\n * Contains data from the FilePermissionAdded blockchain event.\n */\nexport interface FilePermissionResult extends BaseTransactionResult {\n /** File ID the permission was added to */\n fileId: bigint;\n /** Account that was granted permission */\n account: Address;\n /** Encrypted key for file access */\n encryptedKey: string;\n}\n\n// =============================================================================\n// UNION TYPES FOR GENERIC OPERATIONS\n// =============================================================================\n\n/**\n * Union type of all possible transaction result types.\n * Useful for generic functions that handle multiple operation types.\n */\nexport type AnyTransactionResult =\n | PermissionGrantResult\n | PermissionRevokeResult\n | ServerTrustResult\n | ServerUntrustResult\n | ServerRegisterResult\n | ServerUpdateResult\n | GranteeRegisterResult\n | FileAddedResult\n | SchemaAddedResult\n | RefinerAddedResult\n | SchemaUpdateResult\n | FilePermissionResult;\n\n// =============================================================================\n// TYPE UTILITIES\n// =============================================================================\n\n/**\n * Maps transaction operation names to their result types.\n * Used for type inference in generic transaction parsing functions.\n */\nexport interface TransactionResultMap {\n grant: PermissionGrantResult;\n revoke: PermissionRevokeResult;\n revokePermission: PermissionRevokeResult;\n addServerFilesAndPermissions: PermissionGrantResult;\n trustServer: ServerTrustResult;\n untrustServer: ServerUntrustResult;\n registerServer: ServerRegisterResult;\n updateServer: ServerUpdateResult;\n addAndTrustServer: ServerTrustResult;\n registerGrantee: GranteeRegisterResult;\n addFile: FileAddedResult;\n addFileWithPermissionsAndSchema: FileAddedResult;\n addFileWithSchema: FileAddedResult;\n addFileWithPermissions: FileAddedResult;\n addRefinement: RefinerAddedResult;\n addRefiner: RefinerAddedResult;\n updateSchemaId: SchemaUpdateResult;\n addSchema: SchemaAddedResult;\n updateRefinement: SchemaUpdateResult;\n addFilePermission: FilePermissionResult;\n}\n"],"mappings":";;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|