@opendatalabs/vana-sdk 2.3.0 → 3.0.1
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 +76 -92
- package/dist/auth/errors.cjs +54 -0
- package/dist/auth/errors.cjs.map +1 -0
- package/dist/auth/errors.d.ts +26 -0
- package/dist/auth/errors.js +28 -0
- package/dist/auth/errors.js.map +1 -0
- package/dist/auth/pkce.cjs +100 -0
- package/dist/auth/pkce.cjs.map +1 -0
- package/dist/auth/pkce.d.ts +55 -0
- package/dist/auth/pkce.js +71 -0
- package/dist/auth/pkce.js.map +1 -0
- package/dist/auth/token-store.cjs +59 -0
- package/dist/auth/token-store.cjs.map +1 -0
- package/dist/auth/token-store.d.ts +61 -0
- package/dist/auth/token-store.js +35 -0
- package/dist/auth/token-store.js.map +1 -0
- package/dist/auth/web3-signed-builder.cjs +70 -0
- package/dist/auth/web3-signed-builder.cjs.map +1 -0
- package/dist/auth/web3-signed-builder.d.ts +47 -0
- package/dist/auth/web3-signed-builder.js +45 -0
- package/dist/auth/web3-signed-builder.js.map +1 -0
- package/dist/auth/web3-signed.cjs +150 -0
- package/dist/auth/web3-signed.cjs.map +1 -0
- package/dist/auth/web3-signed.d.ts +59 -0
- package/dist/auth/web3-signed.js +129 -0
- package/dist/auth/web3-signed.js.map +1 -0
- package/dist/chains/definitions.cjs +2 -6
- package/dist/chains/definitions.cjs.map +1 -1
- package/dist/chains/definitions.d.ts +1 -7
- package/dist/chains/definitions.js +2 -6
- package/dist/chains/definitions.js.map +1 -1
- package/dist/config/chains.d.ts +18 -0
- package/dist/config/contracts.config.cjs +7 -95
- package/dist/config/contracts.config.cjs.map +1 -1
- package/dist/config/contracts.config.d.ts +0 -54
- package/dist/config/contracts.config.js +6 -93
- package/dist/config/contracts.config.js.map +1 -1
- package/dist/config/default-services.cjs +0 -10
- package/dist/config/default-services.cjs.map +1 -1
- package/dist/config/default-services.d.ts +1 -20
- package/dist/config/default-services.js +0 -9
- package/dist/config/default-services.js.map +1 -1
- package/dist/crypto/ecies/interface.cjs +2 -0
- package/dist/crypto/ecies/interface.cjs.map +1 -1
- package/dist/crypto/ecies/interface.js +2 -0
- package/dist/crypto/ecies/interface.js.map +1 -1
- package/dist/crypto/envelope/openpgp.cjs +59 -0
- package/dist/crypto/envelope/openpgp.cjs.map +1 -0
- package/dist/crypto/envelope/openpgp.d.ts +28 -0
- package/dist/crypto/envelope/openpgp.js +24 -0
- package/dist/crypto/envelope/openpgp.js.map +1 -0
- package/dist/crypto/keys/derive.cjs +65 -0
- package/dist/crypto/keys/derive.cjs.map +1 -0
- package/dist/crypto/keys/derive.d.ts +45 -0
- package/dist/crypto/keys/derive.js +38 -0
- package/dist/crypto/keys/derive.js.map +1 -0
- package/dist/errors.cjs +10 -0
- package/dist/errors.cjs.map +1 -1
- package/dist/errors.js +10 -0
- package/dist/errors.js.map +1 -1
- package/dist/generated/abi/index.cjs +2 -37
- package/dist/generated/abi/index.cjs.map +1 -1
- package/dist/generated/abi/index.d.ts +2683 -9296
- package/dist/generated/abi/index.js +2 -29
- package/dist/generated/abi/index.js.map +1 -1
- package/dist/generated/addresses.cjs +5 -107
- package/dist/generated/addresses.cjs.map +1 -1
- package/dist/generated/addresses.d.ts +5 -99
- package/dist/generated/addresses.js +5 -105
- package/dist/generated/addresses.js.map +1 -1
- package/dist/index.browser.d.ts +24 -140
- package/dist/index.browser.js +32258 -114
- package/dist/index.browser.js.map +7 -1
- package/dist/index.node.cjs +32980 -160
- package/dist/index.node.cjs.map +7 -1
- package/dist/index.node.d.ts +23 -210
- package/dist/index.node.js +32884 -133
- package/dist/index.node.js.map +7 -1
- package/dist/protocol/data-file.cjs +56 -0
- package/dist/protocol/data-file.cjs.map +1 -0
- package/dist/protocol/data-file.d.ts +20 -0
- package/dist/protocol/data-file.js +30 -0
- package/dist/protocol/data-file.js.map +1 -0
- package/dist/protocol/eip712.cjs +123 -0
- package/dist/protocol/eip712.cjs.map +1 -0
- package/dist/protocol/eip712.d.ts +117 -0
- package/dist/protocol/eip712.js +90 -0
- package/dist/protocol/eip712.js.map +1 -0
- package/dist/protocol/gateway.cjs +226 -0
- package/dist/protocol/gateway.cjs.map +1 -0
- package/dist/protocol/gateway.d.ts +120 -0
- package/dist/protocol/gateway.js +202 -0
- package/dist/protocol/gateway.js.map +1 -0
- package/dist/protocol/grants.cjs +146 -0
- package/dist/protocol/grants.cjs.map +1 -0
- package/dist/protocol/grants.d.ts +31 -0
- package/dist/protocol/grants.js +123 -0
- package/dist/protocol/grants.js.map +1 -0
- package/dist/protocol/scopes.cjs +78 -0
- package/dist/protocol/scopes.cjs.map +1 -0
- package/dist/protocol/scopes.d.ts +13 -0
- package/dist/protocol/scopes.js +50 -0
- package/dist/protocol/scopes.js.map +1 -0
- package/dist/{types/atomicStore.cjs → storage/default.cjs} +9 -8
- package/dist/storage/default.cjs.map +1 -0
- package/dist/storage/default.d.ts +4 -0
- package/dist/storage/default.js +8 -0
- package/dist/storage/default.js.map +1 -0
- package/dist/storage/index.cjs +11 -2
- package/dist/storage/index.cjs.map +1 -1
- package/dist/storage/index.d.ts +9 -0
- package/dist/storage/index.js +7 -1
- package/dist/storage/index.js.map +1 -1
- package/dist/storage/providers/callback-storage.cjs +1 -0
- package/dist/storage/providers/callback-storage.cjs.map +1 -1
- package/dist/storage/providers/callback-storage.js +1 -0
- package/dist/storage/providers/callback-storage.js.map +1 -1
- package/dist/storage/providers/dropbox.cjs +1 -0
- package/dist/storage/providers/dropbox.cjs.map +1 -1
- package/dist/storage/providers/dropbox.js +1 -0
- package/dist/storage/providers/dropbox.js.map +1 -1
- package/dist/storage/providers/google-drive.cjs +1 -0
- package/dist/storage/providers/google-drive.cjs.map +1 -1
- package/dist/storage/providers/google-drive.js +1 -0
- package/dist/storage/providers/google-drive.js.map +1 -1
- package/dist/storage/providers/ipfs.cjs +1 -0
- package/dist/storage/providers/ipfs.cjs.map +1 -1
- package/dist/storage/providers/ipfs.js +1 -0
- package/dist/storage/providers/ipfs.js.map +1 -1
- package/dist/storage/providers/pinata.cjs +1 -0
- package/dist/storage/providers/pinata.cjs.map +1 -1
- package/dist/storage/providers/pinata.js +1 -0
- package/dist/storage/providers/pinata.js.map +1 -1
- package/dist/storage/providers/r2.cjs +376 -0
- package/dist/storage/providers/r2.cjs.map +1 -0
- package/dist/storage/providers/r2.d.ts +91 -0
- package/dist/storage/providers/r2.js +354 -0
- package/dist/storage/providers/r2.js.map +1 -0
- package/dist/storage/providers/vana-storage.cjs +251 -0
- package/dist/storage/providers/vana-storage.cjs.map +1 -0
- package/dist/storage/providers/vana-storage.d.ts +100 -0
- package/dist/storage/providers/vana-storage.js +231 -0
- package/dist/storage/providers/vana-storage.js.map +1 -0
- package/dist/types/config.cjs +0 -34
- package/dist/types/config.cjs.map +1 -1
- package/dist/types/config.d.ts +1 -607
- package/dist/types/config.js +0 -22
- package/dist/types/config.js.map +1 -1
- package/dist/types/contracts.cjs.map +1 -1
- package/dist/types/contracts.d.ts +1 -1
- package/dist/types/index.cjs +2 -33
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.ts +2 -33
- package/dist/types/index.js +1 -35
- package/dist/types/index.js.map +1 -1
- package/dist/types/ps-errors.cjs +91 -0
- package/dist/types/ps-errors.cjs.map +1 -0
- package/dist/types/ps-errors.d.ts +26 -0
- package/dist/types/ps-errors.js +66 -0
- package/dist/types/ps-errors.js.map +1 -0
- package/dist/types.cjs.map +1 -1
- package/dist/types.d.ts +0 -29
- package/dist/types.js.map +1 -1
- package/package.json +7 -25
- package/dist/client/enhancedResponse.cjs +0 -164
- package/dist/client/enhancedResponse.cjs.map +0 -1
- package/dist/client/enhancedResponse.d.ts +0 -120
- package/dist/client/enhancedResponse.js +0 -138
- package/dist/client/enhancedResponse.js.map +0 -1
- package/dist/controllers/__tests__/data-consistency-integration.test.d.ts +0 -7
- package/dist/controllers/base.cjs +0 -116
- package/dist/controllers/base.cjs.map +0 -1
- package/dist/controllers/base.d.ts +0 -94
- package/dist/controllers/base.js +0 -92
- package/dist/controllers/base.js.map +0 -1
- package/dist/controllers/data.cjs +0 -2633
- package/dist/controllers/data.cjs.map +0 -1
- package/dist/controllers/data.d.ts +0 -1067
- package/dist/controllers/data.js +0 -2626
- package/dist/controllers/data.js.map +0 -1
- package/dist/controllers/operations.cjs +0 -430
- package/dist/controllers/operations.cjs.map +0 -1
- package/dist/controllers/operations.d.ts +0 -229
- package/dist/controllers/operations.js +0 -406
- package/dist/controllers/operations.js.map +0 -1
- package/dist/controllers/permissions.cjs +0 -4368
- package/dist/controllers/permissions.cjs.map +0 -1
- package/dist/controllers/permissions.d.ts +0 -1411
- package/dist/controllers/permissions.js +0 -4344
- package/dist/controllers/permissions.js.map +0 -1
- package/dist/controllers/protocol.cjs +0 -183
- package/dist/controllers/protocol.cjs.map +0 -1
- package/dist/controllers/protocol.d.ts +0 -138
- package/dist/controllers/protocol.js +0 -163
- package/dist/controllers/protocol.js.map +0 -1
- package/dist/controllers/schemas.cjs +0 -678
- package/dist/controllers/schemas.cjs.map +0 -1
- package/dist/controllers/schemas.d.ts +0 -293
- package/dist/controllers/schemas.js +0 -654
- package/dist/controllers/schemas.js.map +0 -1
- package/dist/controllers/server.cjs +0 -643
- package/dist/controllers/server.cjs.map +0 -1
- package/dist/controllers/server.d.ts +0 -322
- package/dist/controllers/server.js +0 -624
- package/dist/controllers/server.js.map +0 -1
- package/dist/controllers/staking.cjs +0 -626
- package/dist/controllers/staking.cjs.map +0 -1
- package/dist/controllers/staking.d.ts +0 -457
- package/dist/controllers/staking.js +0 -602
- package/dist/controllers/staking.js.map +0 -1
- package/dist/core/__tests__/pollingManager.test.d.ts +0 -4
- package/dist/core/apiClient.cjs +0 -378
- package/dist/core/apiClient.cjs.map +0 -1
- package/dist/core/apiClient.d.ts +0 -286
- package/dist/core/apiClient.js +0 -359
- package/dist/core/apiClient.js.map +0 -1
- package/dist/core/generics.cjs +0 -417
- package/dist/core/generics.cjs.map +0 -1
- package/dist/core/generics.d.ts +0 -205
- package/dist/core/generics.js +0 -386
- package/dist/core/generics.js.map +0 -1
- package/dist/core/health.cjs +0 -289
- package/dist/core/health.cjs.map +0 -1
- package/dist/core/health.d.ts +0 -143
- package/dist/core/health.js +0 -265
- package/dist/core/health.js.map +0 -1
- package/dist/core/inMemoryNonceManager.cjs +0 -138
- package/dist/core/inMemoryNonceManager.cjs.map +0 -1
- package/dist/core/inMemoryNonceManager.d.ts +0 -69
- package/dist/core/inMemoryNonceManager.js +0 -114
- package/dist/core/inMemoryNonceManager.js.map +0 -1
- package/dist/core/nonceManager.cjs +0 -304
- package/dist/core/nonceManager.cjs.map +0 -1
- package/dist/core/nonceManager.d.ts +0 -116
- package/dist/core/nonceManager.js +0 -280
- package/dist/core/nonceManager.js.map +0 -1
- package/dist/core/pollingManager.cjs +0 -292
- package/dist/core/pollingManager.cjs.map +0 -1
- package/dist/core/pollingManager.d.ts +0 -120
- package/dist/core/pollingManager.js +0 -268
- package/dist/core/pollingManager.js.map +0 -1
- package/dist/core.cjs +0 -781
- package/dist/core.cjs.map +0 -1
- package/dist/core.d.ts +0 -496
- package/dist/core.js +0 -756
- package/dist/core.js.map +0 -1
- package/dist/diagnostics.cjs +0 -37
- package/dist/diagnostics.cjs.map +0 -1
- package/dist/diagnostics.d.ts +0 -24
- package/dist/diagnostics.js +0 -13
- package/dist/diagnostics.js.map +0 -1
- package/dist/generated/abi/DLPPerformanceImplementation.cjs +0 -1202
- package/dist/generated/abi/DLPPerformanceImplementation.cjs.map +0 -1
- package/dist/generated/abi/DLPPerformanceImplementation.d.ts +0 -914
- package/dist/generated/abi/DLPPerformanceImplementation.js +0 -1178
- package/dist/generated/abi/DLPPerformanceImplementation.js.map +0 -1
- package/dist/generated/abi/DLPRewardDeployerImplementation.cjs +0 -1112
- package/dist/generated/abi/DLPRewardDeployerImplementation.cjs.map +0 -1
- package/dist/generated/abi/DLPRewardDeployerImplementation.d.ts +0 -840
- package/dist/generated/abi/DLPRewardDeployerImplementation.js +0 -1088
- package/dist/generated/abi/DLPRewardDeployerImplementation.js.map +0 -1
- package/dist/generated/abi/DLPRewardDeployerTreasuryImplementation.cjs +0 -612
- package/dist/generated/abi/DLPRewardDeployerTreasuryImplementation.cjs.map +0 -1
- package/dist/generated/abi/DLPRewardDeployerTreasuryImplementation.d.ts +0 -451
- package/dist/generated/abi/DLPRewardDeployerTreasuryImplementation.js +0 -588
- package/dist/generated/abi/DLPRewardDeployerTreasuryImplementation.js.map +0 -1
- package/dist/generated/abi/DLPRewardSwapImplementation.cjs +0 -939
- package/dist/generated/abi/DLPRewardSwapImplementation.cjs.map +0 -1
- package/dist/generated/abi/DLPRewardSwapImplementation.d.ts +0 -705
- package/dist/generated/abi/DLPRewardSwapImplementation.js +0 -915
- package/dist/generated/abi/DLPRewardSwapImplementation.js.map +0 -1
- package/dist/generated/abi/DLPRootImplementation.cjs +0 -1644
- package/dist/generated/abi/DLPRootImplementation.cjs.map +0 -1
- package/dist/generated/abi/DLPRootImplementation.d.ts +0 -1246
- package/dist/generated/abi/DLPRootImplementation.js +0 -1620
- package/dist/generated/abi/DLPRootImplementation.js.map +0 -1
- package/dist/generated/abi/DataLiquidityPoolImplementation.cjs +0 -985
- package/dist/generated/abi/DataLiquidityPoolImplementation.cjs.map +0 -1
- package/dist/generated/abi/DataLiquidityPoolImplementation.d.ts +0 -735
- package/dist/generated/abi/DataLiquidityPoolImplementation.js +0 -961
- package/dist/generated/abi/DataLiquidityPoolImplementation.js.map +0 -1
- package/dist/generated/abi/SwapHelperImplementation.cjs +0 -976
- package/dist/generated/abi/SwapHelperImplementation.cjs.map +0 -1
- package/dist/generated/abi/SwapHelperImplementation.d.ts +0 -728
- package/dist/generated/abi/SwapHelperImplementation.js +0 -952
- package/dist/generated/abi/SwapHelperImplementation.js.map +0 -1
- package/dist/generated/abi/TeePoolImplementation.cjs +0 -1313
- package/dist/generated/abi/TeePoolImplementation.cjs.map +0 -1
- package/dist/generated/abi/TeePoolImplementation.d.ts +0 -992
- package/dist/generated/abi/TeePoolImplementation.js +0 -1289
- package/dist/generated/abi/TeePoolImplementation.js.map +0 -1
- package/dist/generated/event-types.cjs +0 -17
- package/dist/generated/event-types.cjs.map +0 -1
- package/dist/generated/event-types.d.ts +0 -816
- package/dist/generated/event-types.js +0 -1
- package/dist/generated/event-types.js.map +0 -1
- package/dist/generated/eventRegistry.cjs +0 -4512
- package/dist/generated/eventRegistry.cjs.map +0 -1
- package/dist/generated/eventRegistry.d.ts +0 -14
- package/dist/generated/eventRegistry.js +0 -4487
- package/dist/generated/eventRegistry.js.map +0 -1
- package/dist/generated/server/server-exports.cjs +0 -45
- package/dist/generated/server/server-exports.cjs.map +0 -1
- package/dist/generated/server/server-exports.d.ts +0 -36
- package/dist/generated/server/server-exports.js +0 -19
- package/dist/generated/server/server-exports.js.map +0 -1
- package/dist/generated/server/server.cjs +0 -17
- package/dist/generated/server/server.cjs.map +0 -1
- package/dist/generated/server/server.d.ts +0 -907
- package/dist/generated/server/server.js +0 -1
- package/dist/generated/server/server.js.map +0 -1
- package/dist/generated/subgraph.cjs +0 -1440
- package/dist/generated/subgraph.cjs.map +0 -1
- package/dist/generated/subgraph.d.ts +0 -6113
- package/dist/generated/subgraph.js +0 -1404
- package/dist/generated/subgraph.js.map +0 -1
- package/dist/lib/__tests__/redisAtomicStore.test.d.ts +0 -1
- package/dist/lib/redisAtomicStore.cjs +0 -201
- package/dist/lib/redisAtomicStore.cjs.map +0 -1
- package/dist/lib/redisAtomicStore.d.ts +0 -120
- package/dist/lib/redisAtomicStore.js +0 -177
- package/dist/lib/redisAtomicStore.js.map +0 -1
- package/dist/server/relayerHandler.cjs +0 -452
- package/dist/server/relayerHandler.cjs.map +0 -1
- package/dist/server/relayerHandler.d.ts +0 -69
- package/dist/server/relayerHandler.js +0 -428
- package/dist/server/relayerHandler.js.map +0 -1
- package/dist/tests/abi.test.d.ts +0 -1
- package/dist/tests/chains-definitions.test.d.ts +0 -1
- package/dist/tests/core-encryption.test.d.ts +0 -1
- package/dist/tests/core-extended.test.d.ts +0 -1
- package/dist/tests/core-generics-coverage.test.d.ts +0 -1
- package/dist/tests/coverage-boost.test.d.ts +0 -1
- package/dist/tests/crypto-cross-platform-compatibility.test.d.ts +0 -1
- package/dist/tests/data-addfile-permissions-schema.test.d.ts +0 -1
- package/dist/tests/data-additional-methods.test.d.ts +0 -1
- package/dist/tests/data-controller-edge-cases.test.d.ts +0 -1
- package/dist/tests/data-ipfs-gateways.test.d.ts +0 -1
- package/dist/tests/data-relayer.test.d.ts +0 -1
- package/dist/tests/data-schema-validation.test.d.ts +0 -1
- package/dist/tests/data-simple-methods.test.d.ts +0 -1
- package/dist/tests/data-upload-owner-validation.test.d.ts +0 -1
- package/dist/tests/data.test.d.ts +0 -1
- package/dist/tests/demo-integration.test.d.ts +0 -1
- package/dist/tests/demo-trusted-server-integration.test.d.ts +0 -1
- package/dist/tests/download-relayer.test.d.ts +0 -1
- package/dist/tests/dual-mode-permissions.test.d.ts +0 -1
- package/dist/tests/dual-mode-trusted-servers.test.d.ts +0 -1
- package/dist/tests/encryption-correct-implementation.test.d.ts +0 -1
- package/dist/tests/encryption-coverage.test.d.ts +0 -1
- package/dist/tests/encryption-edge-cases.test.d.ts +0 -1
- package/dist/tests/encryption-utils-updated.test.d.ts +0 -1
- package/dist/tests/errors-coverage.test.d.ts +0 -1
- package/dist/tests/factories/mockFactory.d.ts +0 -316
- package/dist/tests/fakes/FakeStorageManager.d.ts +0 -200
- package/dist/tests/fakes/FakeStorageManager.test.d.ts +0 -1
- package/dist/tests/fakes/FakeWaitForTransactionEvents.d.ts +0 -170
- package/dist/tests/fakes/FakeWaitForTransactionEvents.test.d.ts +0 -1
- package/dist/tests/fakes/fake-pgp-port.d.ts +0 -13
- package/dist/tests/grantValidation-edge-cases.test.d.ts +0 -1
- package/dist/tests/grantValidation-unreachable-branch.test.d.ts +0 -1
- package/dist/tests/helper-methods.test.d.ts +0 -1
- package/dist/tests/helpers/typedMocks.d.ts +0 -64
- package/dist/tests/index-browser.test.d.ts +0 -1
- package/dist/tests/index-node.test.d.ts +0 -1
- package/dist/tests/index.test.d.ts +0 -1
- package/dist/tests/mocks/platformAdapter.d.ts +0 -12
- package/dist/tests/new-permissions-methods.test.d.ts +0 -1
- package/dist/tests/no-buffer-browser.test.d.ts +0 -1
- package/dist/tests/permissions-grantee.test.d.ts +0 -1
- package/dist/tests/permissions-revoke-relayer.test.d.ts +0 -1
- package/dist/tests/permissions-schema-validation.test.d.ts +0 -1
- package/dist/tests/permissions-server-files.test.d.ts +0 -1
- package/dist/tests/permissions-transaction-options.test.d.ts +0 -1
- package/dist/tests/permissions-trust-servers.test.d.ts +0 -1
- package/dist/tests/permissions.test.d.ts +0 -1
- package/dist/tests/personal.test.d.ts +0 -1
- package/dist/tests/platform-browser.test.d.ts +0 -1
- package/dist/tests/platform-crypto-expanded.test.d.ts +0 -1
- package/dist/tests/platform-crypto.test.d.ts +0 -1
- package/dist/tests/platform-index.test.d.ts +0 -1
- package/dist/tests/platform-node.test.d.ts +0 -1
- package/dist/tests/platform-shared-utils.test.d.ts +0 -1
- package/dist/tests/platform-updated.test.d.ts +0 -1
- package/dist/tests/protocol-additional-methods.test.d.ts +0 -1
- package/dist/tests/protocol.test.d.ts +0 -1
- package/dist/tests/read-only-mode.test.d.ts +0 -1
- package/dist/tests/relayer-integration.test.d.ts +0 -1
- package/dist/tests/relayer-unified.test.d.ts +0 -1
- package/dist/tests/schemas.test.d.ts +0 -1
- package/dist/tests/server-relayer-handler.test.d.ts +0 -1
- package/dist/tests/signatureFormatter.test.d.ts +0 -1
- package/dist/tests/staking.test.d.ts +0 -1
- package/dist/tests/trusted-server-queries.test.d.ts +0 -1
- package/dist/tests/typedDataConverter.test.d.ts +0 -1
- package/dist/tests/types-contracts.test.d.ts +0 -1
- package/dist/tests/types-data.test.d.ts +0 -1
- package/dist/tests/types-external-apis.test.d.ts +0 -1
- package/dist/tests/types-generics.test.d.ts +0 -1
- package/dist/tests/types-permissions.test.d.ts +0 -1
- package/dist/tests/types-upload-params.test.d.ts +0 -1
- package/dist/tests/types.test.d.ts +0 -1
- package/dist/tests/utils-formatters.test.d.ts +0 -1
- package/dist/tests/utils-grantFiles-edge-cases.test.d.ts +0 -1
- package/dist/tests/utils-grantFiles-validation.test.d.ts +0 -1
- package/dist/tests/utils-grantFiles.test.d.ts +0 -1
- package/dist/tests/utils-grantValidation-consolidated.test.d.ts +0 -1
- package/dist/tests/utils-grants.test.d.ts +0 -1
- package/dist/tests/utils-ipfs-additional.test.d.ts +0 -1
- package/dist/tests/utils-ipfs.test.d.ts +0 -4
- package/dist/tests/utils-schemaValidation.test.d.ts +0 -1
- package/dist/tests/vana.test.d.ts +0 -1
- package/dist/tests/wallet-crypto-compatibility.test.d.ts +0 -1
- package/dist/types/atomicStore.cjs.map +0 -1
- package/dist/types/atomicStore.d.ts +0 -236
- package/dist/types/atomicStore.js +0 -7
- package/dist/types/atomicStore.js.map +0 -1
- package/dist/types/blockchain.cjs +0 -17
- package/dist/types/blockchain.cjs.map +0 -1
- package/dist/types/blockchain.d.ts +0 -85
- package/dist/types/blockchain.js +0 -1
- package/dist/types/blockchain.js.map +0 -1
- package/dist/types/controller-context.cjs +0 -17
- package/dist/types/controller-context.cjs.map +0 -1
- package/dist/types/controller-context.d.ts +0 -68
- package/dist/types/controller-context.js +0 -1
- package/dist/types/controller-context.js.map +0 -1
- package/dist/types/data.cjs +0 -17
- package/dist/types/data.cjs.map +0 -1
- package/dist/types/data.d.ts +0 -763
- package/dist/types/data.js +0 -1
- package/dist/types/data.js.map +0 -1
- package/dist/types/external-apis.cjs +0 -61
- package/dist/types/external-apis.cjs.map +0 -1
- package/dist/types/external-apis.d.ts +0 -184
- package/dist/types/external-apis.js +0 -34
- package/dist/types/external-apis.js.map +0 -1
- package/dist/types/generics.cjs +0 -17
- package/dist/types/generics.cjs.map +0 -1
- package/dist/types/generics.d.ts +0 -518
- package/dist/types/generics.js +0 -1
- package/dist/types/generics.js.map +0 -1
- package/dist/types/operationStore.cjs +0 -17
- package/dist/types/operationStore.cjs.map +0 -1
- package/dist/types/operationStore.d.ts +0 -171
- package/dist/types/operationStore.js +0 -1
- package/dist/types/operationStore.js.map +0 -1
- package/dist/types/operations.cjs +0 -53
- package/dist/types/operations.cjs.map +0 -1
- package/dist/types/operations.d.ts +0 -204
- package/dist/types/operations.js +0 -26
- package/dist/types/operations.js.map +0 -1
- package/dist/types/options.cjs +0 -17
- package/dist/types/options.cjs.map +0 -1
- package/dist/types/options.d.ts +0 -308
- package/dist/types/options.js +0 -1
- package/dist/types/options.js.map +0 -1
- package/dist/types/permissions.cjs +0 -17
- package/dist/types/permissions.cjs.map +0 -1
- package/dist/types/permissions.d.ts +0 -955
- package/dist/types/permissions.js +0 -1
- package/dist/types/permissions.js.map +0 -1
- package/dist/types/personal.cjs +0 -17
- package/dist/types/personal.cjs.map +0 -1
- package/dist/types/personal.d.ts +0 -174
- package/dist/types/personal.js +0 -1
- package/dist/types/personal.js.map +0 -1
- package/dist/types/relayer.cjs +0 -17
- package/dist/types/relayer.cjs.map +0 -1
- package/dist/types/relayer.d.ts +0 -552
- package/dist/types/relayer.js +0 -1
- package/dist/types/relayer.js.map +0 -1
- package/dist/types/transactionResults.cjs +0 -17
- package/dist/types/transactionResults.cjs.map +0 -1
- package/dist/types/transactionResults.d.ts +0 -193
- package/dist/types/transactionResults.js +0 -1
- package/dist/types/transactionResults.js.map +0 -1
- package/dist/types/utils.cjs +0 -17
- package/dist/types/utils.cjs.map +0 -1
- package/dist/types/utils.d.ts +0 -771
- package/dist/types/utils.js +0 -1
- package/dist/types/utils.js.map +0 -1
- package/dist/utils/__tests__/chainQuery.test.d.ts +0 -1
- package/dist/utils/__tests__/parseTransaction.test.d.ts +0 -1
- package/dist/utils/__tests__/pojo-serialization.test.d.ts +0 -1
- package/dist/utils/__tests__/signatureCache.test.d.ts +0 -1
- package/dist/utils/__tests__/subgraphConsistency.test.d.ts +0 -4
- package/dist/utils/__tests__/subgraphPagination.test.d.ts +0 -4
- package/dist/utils/__tests__/transaction-edge-cases.test.d.ts +0 -1
- package/dist/utils/__tests__/transactionHelpers.test.d.ts +0 -1
- package/dist/utils/__tests__/urlResolver.test.d.ts +0 -4
- package/dist/utils/blockchain/registry.cjs +0 -81
- package/dist/utils/blockchain/registry.cjs.map +0 -1
- package/dist/utils/blockchain/registry.d.ts +0 -32
- package/dist/utils/blockchain/registry.js +0 -56
- package/dist/utils/blockchain/registry.js.map +0 -1
- package/dist/utils/blockchain/registry.test.d.ts +0 -1
- package/dist/utils/chainQuery.cjs +0 -107
- package/dist/utils/chainQuery.cjs.map +0 -1
- package/dist/utils/chainQuery.d.ts +0 -31
- package/dist/utils/chainQuery.js +0 -82
- package/dist/utils/chainQuery.js.map +0 -1
- package/dist/utils/download.cjs +0 -69
- package/dist/utils/download.cjs.map +0 -1
- package/dist/utils/download.d.ts +0 -40
- package/dist/utils/download.js +0 -45
- package/dist/utils/download.js.map +0 -1
- package/dist/utils/encryption.cjs +0 -176
- package/dist/utils/encryption.cjs.map +0 -1
- package/dist/utils/encryption.d.ts +0 -271
- package/dist/utils/encryption.js +0 -142
- package/dist/utils/encryption.js.map +0 -1
- package/dist/utils/formatters.cjs +0 -55
- package/dist/utils/formatters.cjs.map +0 -1
- package/dist/utils/formatters.d.ts +0 -118
- package/dist/utils/formatters.js +0 -28
- package/dist/utils/formatters.js.map +0 -1
- package/dist/utils/grantFiles.cjs +0 -181
- package/dist/utils/grantFiles.cjs.map +0 -1
- package/dist/utils/grantFiles.d.ts +0 -172
- package/dist/utils/grantFiles.js +0 -143
- package/dist/utils/grantFiles.js.map +0 -1
- package/dist/utils/grantValidation.cjs +0 -243
- package/dist/utils/grantValidation.cjs.map +0 -1
- package/dist/utils/grantValidation.d.ts +0 -226
- package/dist/utils/grantValidation.js +0 -201
- package/dist/utils/grantValidation.js.map +0 -1
- package/dist/utils/grants.cjs +0 -108
- package/dist/utils/grants.cjs.map +0 -1
- package/dist/utils/grants.d.ts +0 -148
- package/dist/utils/grants.js +0 -82
- package/dist/utils/grants.js.map +0 -1
- package/dist/utils/ipfs.cjs +0 -128
- package/dist/utils/ipfs.cjs.map +0 -1
- package/dist/utils/ipfs.d.ts +0 -88
- package/dist/utils/ipfs.js +0 -97
- package/dist/utils/ipfs.js.map +0 -1
- package/dist/utils/multicall.cjs +0 -233
- package/dist/utils/multicall.cjs.map +0 -1
- package/dist/utils/multicall.d.ts +0 -126
- package/dist/utils/multicall.js +0 -208
- package/dist/utils/multicall.js.map +0 -1
- package/dist/utils/parseTransactionPojo.cjs +0 -87
- package/dist/utils/parseTransactionPojo.cjs.map +0 -1
- package/dist/utils/parseTransactionPojo.d.ts +0 -31
- package/dist/utils/parseTransactionPojo.js +0 -63
- package/dist/utils/parseTransactionPojo.js.map +0 -1
- package/dist/utils/schemaValidation.cjs +0 -258
- package/dist/utils/schemaValidation.cjs.map +0 -1
- package/dist/utils/schemaValidation.d.ts +0 -168
- package/dist/utils/schemaValidation.js +0 -219
- package/dist/utils/schemaValidation.js.map +0 -1
- package/dist/utils/signatureCache.cjs +0 -192
- package/dist/utils/signatureCache.cjs.map +0 -1
- package/dist/utils/signatureCache.d.ts +0 -172
- package/dist/utils/signatureCache.js +0 -167
- package/dist/utils/signatureCache.js.map +0 -1
- package/dist/utils/signatureFormatter.cjs +0 -42
- package/dist/utils/signatureFormatter.cjs.map +0 -1
- package/dist/utils/signatureFormatter.d.ts +0 -36
- package/dist/utils/signatureFormatter.js +0 -18
- package/dist/utils/signatureFormatter.js.map +0 -1
- package/dist/utils/subgraphConsistency.cjs +0 -184
- package/dist/utils/subgraphConsistency.cjs.map +0 -1
- package/dist/utils/subgraphConsistency.d.ts +0 -65
- package/dist/utils/subgraphConsistency.js +0 -155
- package/dist/utils/subgraphConsistency.js.map +0 -1
- package/dist/utils/subgraphMetaCache.cjs +0 -101
- package/dist/utils/subgraphMetaCache.cjs.map +0 -1
- package/dist/utils/subgraphMetaCache.d.ts +0 -56
- package/dist/utils/subgraphMetaCache.js +0 -76
- package/dist/utils/subgraphMetaCache.js.map +0 -1
- package/dist/utils/subgraphPagination.cjs +0 -104
- package/dist/utils/subgraphPagination.cjs.map +0 -1
- package/dist/utils/subgraphPagination.d.ts +0 -78
- package/dist/utils/subgraphPagination.js +0 -78
- package/dist/utils/subgraphPagination.js.map +0 -1
- package/dist/utils/tests/multicall.test.d.ts +0 -1
- package/dist/utils/transactionHelpers.cjs +0 -54
- package/dist/utils/transactionHelpers.cjs.map +0 -1
- package/dist/utils/transactionHelpers.d.ts +0 -80
- package/dist/utils/transactionHelpers.js +0 -29
- package/dist/utils/transactionHelpers.js.map +0 -1
- package/dist/utils/typeGuards.cjs +0 -109
- package/dist/utils/typeGuards.cjs.map +0 -1
- package/dist/utils/typeGuards.d.ts +0 -138
- package/dist/utils/typeGuards.js +0 -74
- package/dist/utils/typeGuards.js.map +0 -1
- package/dist/utils/typedDataConverter.cjs +0 -43
- package/dist/utils/typedDataConverter.cjs.map +0 -1
- package/dist/utils/typedDataConverter.d.ts +0 -46
- package/dist/utils/typedDataConverter.js +0 -19
- package/dist/utils/typedDataConverter.js.map +0 -1
- package/dist/utils/urlResolver.cjs +0 -62
- package/dist/utils/urlResolver.cjs.map +0 -1
- package/dist/utils/urlResolver.d.ts +0 -56
- package/dist/utils/urlResolver.js +0 -37
- package/dist/utils/urlResolver.js.map +0 -1
- package/dist/utils/wallet.cjs +0 -63
- package/dist/utils/wallet.cjs.map +0 -1
- package/dist/utils/wallet.d.ts +0 -94
- package/dist/utils/wallet.js +0 -37
- package/dist/utils/wallet.js.map +0 -1
- package/dist/utils/withEvents.cjs +0 -44
- package/dist/utils/withEvents.cjs.map +0 -1
- package/dist/utils/withEvents.d.ts +0 -56
- package/dist/utils/withEvents.js +0 -18
- package/dist/utils/withEvents.js.map +0 -1
- /package/dist/{__tests__/waitForTransactionEvents.test.d.ts → auth/pkce.test.d.ts} +0 -0
- /package/dist/{client/__tests__/enhancedResponse.test.d.ts → auth/token-store.test.d.ts} +0 -0
- /package/dist/{controllers/__tests__/operations.processQueue.test.d.ts → auth/web3-signed.test.d.ts} +0 -0
- /package/dist/{controllers/__tests__/schemas-edge-cases.test.d.ts → crypto/envelope/openpgp.test.d.ts} +0 -0
- /package/dist/{controllers/data-error-handling.test.d.ts → crypto/keys/derive.test.d.ts} +0 -0
- /package/dist/{tests/errors.test.d.ts → errors.test.d.ts} +0 -0
- /package/dist/{controllers/server-additional.test.d.ts → protocol/data-file.test.d.ts} +0 -0
- /package/dist/{core/__tests__/health.test.d.ts → protocol/eip712.test.d.ts} +0 -0
- /package/dist/{core/__tests__/inMemoryNonceManager.test.d.ts → protocol/gateway.test.d.ts} +0 -0
- /package/dist/{core/__tests__/nonceManager.test.d.ts → protocol/grants.test.d.ts} +0 -0
- /package/dist/{core/core.test.d.ts → protocol/scopes.test.d.ts} +0 -0
- /package/dist/{core/tests/apiClient.test.d.ts → storage/tests/defaultStorage.test.d.ts} +0 -0
- /package/dist/{core/tests/client.test.d.ts → storage/tests/r2Storage.test.d.ts} +0 -0
- /package/dist/{core/tests/generics.test.d.ts → storage/tests/vanaStorage.test.d.ts} +0 -0
- /package/dist/{diagnostics.test.d.ts → types/ps-errors.test.d.ts} +0 -0
|
@@ -1,316 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provides type-safe mock factories for testing Vana SDK components.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* This module contains factory functions that create properly typed mock objects
|
|
6
|
-
* for testing. These factories eliminate the need for `as any` assertions in tests
|
|
7
|
-
* by providing complete implementations with sensible defaults.
|
|
8
|
-
*
|
|
9
|
-
* ## Usage Patterns
|
|
10
|
-
*
|
|
11
|
-
* ### Basic Usage
|
|
12
|
-
* ```typescript
|
|
13
|
-
* const context = createMockControllerContext();
|
|
14
|
-
* const controller = new MyController(context);
|
|
15
|
-
* ```
|
|
16
|
-
*
|
|
17
|
-
* ### Direct Transaction Testing (No Relayer/Storage)
|
|
18
|
-
* ```typescript
|
|
19
|
-
* const context = createMockControllerContextForDirectTransaction();
|
|
20
|
-
* ```
|
|
21
|
-
*
|
|
22
|
-
* ### With Relayer Callbacks
|
|
23
|
-
* ```typescript
|
|
24
|
-
* const context = createMockControllerContextWithRelayer();
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* ### Accessing Mock Methods
|
|
28
|
-
* When you need to access mock methods like `mockImplementation`, wrap with `vi.mocked()`:
|
|
29
|
-
* ```typescript
|
|
30
|
-
* vi.mocked(context.walletClient.signTypedData).mockImplementation(...);
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* @category Testing
|
|
34
|
-
* @module mockFactory
|
|
35
|
-
* @internal
|
|
36
|
-
*/
|
|
37
|
-
import { vi } from "vitest";
|
|
38
|
-
import type { WalletClient, PublicClient, Account, Chain, Hash, Address } from "../../types";
|
|
39
|
-
import type { ControllerContext } from "../../types/controller-context";
|
|
40
|
-
import type { VanaPlatformAdapter } from "../../platform/interface";
|
|
41
|
-
import type { StorageManager } from "../../storage/manager";
|
|
42
|
-
/**
|
|
43
|
-
* Represents a deeply partial version of type T.
|
|
44
|
-
*
|
|
45
|
-
* @remarks
|
|
46
|
-
* This utility type allows for partial overrides at any depth of an object structure,
|
|
47
|
-
* making it easy to specify only the properties you want to customize in mocks.
|
|
48
|
-
*/
|
|
49
|
-
export type DeepPartial<T> = {
|
|
50
|
-
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
|
|
51
|
-
};
|
|
52
|
-
/**
|
|
53
|
-
* Creates a mock Viem account for testing.
|
|
54
|
-
*
|
|
55
|
-
* @param overrides - Optional account properties to override the defaults
|
|
56
|
-
* @returns A complete Account object with mock implementations
|
|
57
|
-
*
|
|
58
|
-
* @example
|
|
59
|
-
* ```typescript
|
|
60
|
-
* const account = createMockAccount({
|
|
61
|
-
* address: "0xCustomAddress"
|
|
62
|
-
* });
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
export declare function createMockAccount(overrides?: Partial<Account>): Account;
|
|
66
|
-
/**
|
|
67
|
-
* Creates a mock blockchain chain configuration.
|
|
68
|
-
*
|
|
69
|
-
* @param overrides - Optional chain properties to override the defaults
|
|
70
|
-
* @returns A complete Chain object configured for Moksha Testnet by default
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* ```typescript
|
|
74
|
-
* const chain = createMockChain({
|
|
75
|
-
* id: 1480,
|
|
76
|
-
* name: "Vana Mainnet"
|
|
77
|
-
* });
|
|
78
|
-
* ```
|
|
79
|
-
*/
|
|
80
|
-
export declare function createMockChain(overrides?: Partial<Chain>): Chain;
|
|
81
|
-
/**
|
|
82
|
-
* Creates a fully mocked Viem WalletClient for testing.
|
|
83
|
-
*
|
|
84
|
-
* @param overrides - Optional nested properties to override the defaults
|
|
85
|
-
* @returns A complete WalletClient with all methods mocked
|
|
86
|
-
*
|
|
87
|
-
* @remarks
|
|
88
|
-
* This factory creates a WalletClient with all required methods stubbed.
|
|
89
|
-
* The client is configured with a local test account and Moksha Testnet by default.
|
|
90
|
-
* All async methods return sensible default values.
|
|
91
|
-
*
|
|
92
|
-
* @example
|
|
93
|
-
* ```typescript
|
|
94
|
-
* const wallet = createTypedMockWalletClient({
|
|
95
|
-
* account: { address: "0xCustom" },
|
|
96
|
-
* chain: { id: 1480 }
|
|
97
|
-
* });
|
|
98
|
-
* ```
|
|
99
|
-
*/
|
|
100
|
-
export declare function createTypedMockWalletClient(overrides?: DeepPartial<WalletClient>): WalletClient;
|
|
101
|
-
/**
|
|
102
|
-
* Creates a fully mocked Viem PublicClient for testing.
|
|
103
|
-
*
|
|
104
|
-
* @param overrides - Optional nested properties to override the defaults
|
|
105
|
-
* @returns A complete PublicClient with all methods mocked
|
|
106
|
-
*
|
|
107
|
-
* @remarks
|
|
108
|
-
* This factory creates a PublicClient with all required RPC methods stubbed.
|
|
109
|
-
* The client returns sensible default values for blockchain queries.
|
|
110
|
-
* Transaction receipts are configured to return success by default.
|
|
111
|
-
*
|
|
112
|
-
* @example
|
|
113
|
-
* ```typescript
|
|
114
|
-
* const client = createTypedMockPublicClient({
|
|
115
|
-
* chain: { id: 1480 }
|
|
116
|
-
* });
|
|
117
|
-
* ```
|
|
118
|
-
*/
|
|
119
|
-
export declare function createTypedMockPublicClient(overrides?: DeepPartial<PublicClient>): PublicClient;
|
|
120
|
-
/**
|
|
121
|
-
* Creates a mock StorageManager using the FakeStorageManager implementation.
|
|
122
|
-
*
|
|
123
|
-
* @param overrides - Optional properties to override on the fake instance
|
|
124
|
-
* @returns A complete StorageManager implementation for testing
|
|
125
|
-
*
|
|
126
|
-
* @remarks
|
|
127
|
-
* This factory uses the FakeStorageManager class instead of complex mocking,
|
|
128
|
-
* providing a simpler and more maintainable testing approach.
|
|
129
|
-
* The fake maintains in-memory state and tracks method calls.
|
|
130
|
-
*
|
|
131
|
-
* @example
|
|
132
|
-
* ```typescript
|
|
133
|
-
* const storage = createTypedMockStorageManager();
|
|
134
|
-
* const result = await storage.upload(blob, "test.txt");
|
|
135
|
-
* ```
|
|
136
|
-
*/
|
|
137
|
-
export declare function createTypedMockStorageManager(overrides?: Partial<StorageManager>): StorageManager;
|
|
138
|
-
/**
|
|
139
|
-
* Creates a complete mock ControllerContext for testing controllers.
|
|
140
|
-
*
|
|
141
|
-
* @param overrides - Optional nested properties to override the defaults
|
|
142
|
-
* @returns A ControllerContext with guaranteed waitForTransactionEvents method
|
|
143
|
-
*
|
|
144
|
-
* @remarks
|
|
145
|
-
* This factory creates a complete context object with all required dependencies:
|
|
146
|
-
* - WalletClient and PublicClient for blockchain interactions
|
|
147
|
-
* - StorageManager for file operations
|
|
148
|
-
* - Platform adapter for encryption
|
|
149
|
-
* - waitForTransactionEvents using FakeWaitForTransactionEvents
|
|
150
|
-
*
|
|
151
|
-
* The returned context guarantees that waitForTransactionEvents is always present,
|
|
152
|
-
* eliminating the need for conditional checks in tests.
|
|
153
|
-
*
|
|
154
|
-
* @example
|
|
155
|
-
* ```typescript
|
|
156
|
-
* const context = createMockControllerContext({
|
|
157
|
-
* walletClient: { account: { address: "0xCustom" } }
|
|
158
|
-
* });
|
|
159
|
-
* const controller = new DataController(context);
|
|
160
|
-
* ```
|
|
161
|
-
*/
|
|
162
|
-
export declare function createMockControllerContext(overrides?: DeepPartial<ControllerContext>): ControllerContext & Required<Pick<ControllerContext, "waitForTransactionEvents">>;
|
|
163
|
-
/**
|
|
164
|
-
* Creates a mock VanaPlatformAdapter for testing.
|
|
165
|
-
*
|
|
166
|
-
* @param overrides - Optional properties to override the default mock adapter
|
|
167
|
-
* @returns A complete VanaPlatformAdapter with encryption and key management methods
|
|
168
|
-
*
|
|
169
|
-
* @example
|
|
170
|
-
* ```typescript
|
|
171
|
-
* const platform = createMockPlatform({
|
|
172
|
-
* generateKeyPair: vi.fn().mockResolvedValue({ publicKey: "test", privateKey: "test" })
|
|
173
|
-
* });
|
|
174
|
-
* ```
|
|
175
|
-
*/
|
|
176
|
-
export declare function createMockPlatform(overrides?: Partial<VanaPlatformAdapter>): VanaPlatformAdapter;
|
|
177
|
-
/**
|
|
178
|
-
* Creates a typed mock function compatible with vitest.
|
|
179
|
-
*
|
|
180
|
-
* @returns A vi.fn() mock with proper typing
|
|
181
|
-
*
|
|
182
|
-
* @example
|
|
183
|
-
* ```typescript
|
|
184
|
-
* const mockCallback = createMockFn<(value: string) => void>();
|
|
185
|
-
* mockCallback.mockImplementation((value) => console.log(value));
|
|
186
|
-
* ```
|
|
187
|
-
*/
|
|
188
|
-
export declare function createMockFn<T extends (...args: unknown[]) => unknown>(): ReturnType<typeof vi.fn<T>>;
|
|
189
|
-
/**
|
|
190
|
-
* Safely casts a partial mock to the full type.
|
|
191
|
-
*
|
|
192
|
-
* @param value - Partial object to cast to full type
|
|
193
|
-
* @returns The value cast to type T
|
|
194
|
-
*
|
|
195
|
-
* @remarks
|
|
196
|
-
* Use this as a last resort when the mock factory doesn't cover all properties.
|
|
197
|
-
* This is a type assertion helper that should be used sparingly.
|
|
198
|
-
*
|
|
199
|
-
* @example
|
|
200
|
-
* ```typescript
|
|
201
|
-
* const partialMock = { someProperty: 'value' };
|
|
202
|
-
* const fullMock = safeCast<CompleteType>(partialMock);
|
|
203
|
-
* ```
|
|
204
|
-
*/
|
|
205
|
-
export declare function safeCast<T>(value: DeepPartial<T>): T;
|
|
206
|
-
/**
|
|
207
|
-
* Creates a mock viem Log object for testing.
|
|
208
|
-
*
|
|
209
|
-
* @param eventName - The name of the event
|
|
210
|
-
* @param args - The event arguments
|
|
211
|
-
* @returns A complete Log object with all required properties
|
|
212
|
-
*
|
|
213
|
-
* @remarks
|
|
214
|
-
* This factory creates a complete viem Log object with all required blockchain
|
|
215
|
-
* metadata. Use this when mocking parseEventLogs return values.
|
|
216
|
-
*
|
|
217
|
-
* @example
|
|
218
|
-
* ```typescript
|
|
219
|
-
* const mockLog = createMockLog("PermissionGranted", {
|
|
220
|
-
* permissionId: 123n,
|
|
221
|
-
* user: "0xUserAddress",
|
|
222
|
-
* grant: "grant-data"
|
|
223
|
-
* });
|
|
224
|
-
* ```
|
|
225
|
-
*/
|
|
226
|
-
export declare function createMockLog(eventName: string, args: Record<string, unknown>): {
|
|
227
|
-
eventName: string;
|
|
228
|
-
args: Record<string, unknown>;
|
|
229
|
-
address: Address;
|
|
230
|
-
blockHash: Hash;
|
|
231
|
-
blockNumber: bigint;
|
|
232
|
-
data: Hash;
|
|
233
|
-
logIndex: number;
|
|
234
|
-
removed: boolean;
|
|
235
|
-
transactionHash: Hash;
|
|
236
|
-
transactionIndex: number;
|
|
237
|
-
topics: readonly Hash[];
|
|
238
|
-
};
|
|
239
|
-
/**
|
|
240
|
-
* Creates a type-safe mock that only requires specified properties.
|
|
241
|
-
*
|
|
242
|
-
* @param partial - Partial object with only the properties you need
|
|
243
|
-
* @returns The partial object cast to the full type T
|
|
244
|
-
*
|
|
245
|
-
* @remarks
|
|
246
|
-
* This is useful for mocking interfaces where you only care about certain methods.
|
|
247
|
-
* The unspecified properties will be undefined at runtime.
|
|
248
|
-
*
|
|
249
|
-
* @example
|
|
250
|
-
* ```typescript
|
|
251
|
-
* const mock = createPartialMock<MyInterface>({
|
|
252
|
-
* methodICareAbout: vi.fn().mockReturnValue('result'),
|
|
253
|
-
* });
|
|
254
|
-
* ```
|
|
255
|
-
*/
|
|
256
|
-
export declare function createPartialMock<T>(partial: Partial<T>): T;
|
|
257
|
-
/**
|
|
258
|
-
* Creates a mock ControllerContext specifically configured for direct transaction testing.
|
|
259
|
-
*
|
|
260
|
-
* @param overrides - Optional nested properties to override the defaults
|
|
261
|
-
* @returns A ControllerContext with no relayer callbacks or storage manager
|
|
262
|
-
*
|
|
263
|
-
* @remarks
|
|
264
|
-
* This factory variant is optimized for testing direct blockchain transactions
|
|
265
|
-
* without gasless relayer support. It sets both `relayer` and
|
|
266
|
-
* `storageManager` to `undefined`, forcing the controller to use direct transactions.
|
|
267
|
-
*
|
|
268
|
-
* @example
|
|
269
|
-
* ```typescript
|
|
270
|
-
* const context = createMockControllerContextForDirectTransaction();
|
|
271
|
-
* const controller = new PermissionsController(context);
|
|
272
|
-
* // Test will throw "No storage available" error as expected
|
|
273
|
-
* await expect(controller.grant(params)).rejects.toThrow("No storage available");
|
|
274
|
-
* ```
|
|
275
|
-
*/
|
|
276
|
-
export declare function createMockControllerContextForDirectTransaction(overrides?: DeepPartial<ControllerContext>): ControllerContext & Required<Pick<ControllerContext, "waitForTransactionEvents">>;
|
|
277
|
-
/**
|
|
278
|
-
* Creates a mock ControllerContext with relayer callbacks configured.
|
|
279
|
-
*
|
|
280
|
-
* @param overrides - Optional nested properties to override the defaults
|
|
281
|
-
* @returns A ControllerContext with default relayer callbacks for gasless transactions
|
|
282
|
-
*
|
|
283
|
-
* @remarks
|
|
284
|
-
* This factory variant provides sensible defaults for testing gasless transactions
|
|
285
|
-
* with relayer support. It includes mock implementations for `storeGrantFile` and
|
|
286
|
-
* `submitPermissionGrant` that return successful responses.
|
|
287
|
-
*
|
|
288
|
-
* @example
|
|
289
|
-
* ```typescript
|
|
290
|
-
* const context = createMockControllerContextWithRelayer();
|
|
291
|
-
* const controller = new PermissionsController(context);
|
|
292
|
-
* const result = await controller.grant(params);
|
|
293
|
-
* expect(context.relayer?.storeGrantFile).toHaveBeenCalled();
|
|
294
|
-
* ```
|
|
295
|
-
*/
|
|
296
|
-
export declare function createMockControllerContextWithRelayer(overrides?: DeepPartial<ControllerContext>): ControllerContext & Required<Pick<ControllerContext, "waitForTransactionEvents">>;
|
|
297
|
-
/**
|
|
298
|
-
* Helper to properly type a mocked client for TypeScript.
|
|
299
|
-
*
|
|
300
|
-
* @param client - The client to type as mocked
|
|
301
|
-
* @returns The client typed with vitest mock methods
|
|
302
|
-
*
|
|
303
|
-
* @remarks
|
|
304
|
-
* Use this when you need TypeScript to recognize mock methods on factory-created clients.
|
|
305
|
-
* This is a convenience wrapper around `vi.mocked()`.
|
|
306
|
-
*
|
|
307
|
-
* @example
|
|
308
|
-
* ```typescript
|
|
309
|
-
* const context = createMockControllerContext();
|
|
310
|
-
* const mockedWallet = asMocked(context.walletClient);
|
|
311
|
-
* mockedWallet.signTypedData.mockImplementation((data) => {
|
|
312
|
-
* // Custom implementation
|
|
313
|
-
* });
|
|
314
|
-
* ```
|
|
315
|
-
*/
|
|
316
|
-
export declare function asMocked<T>(client: T): ReturnType<typeof vi.mocked<T>>;
|
|
@@ -1,200 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provides a controllable fake implementation of StorageManager for testing.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* This test fake replaces complex storage mocking with a simple, in-memory implementation
|
|
6
|
-
* that allows tests to configure upload/download behavior without external dependencies.
|
|
7
|
-
* Use this when testing controllers that depend on StorageManager functionality.
|
|
8
|
-
*
|
|
9
|
-
* The fake maintains in-memory maps for uploads and downloads, tracks call counts,
|
|
10
|
-
* and supports multiple storage providers for comprehensive testing scenarios.
|
|
11
|
-
*
|
|
12
|
-
* @category Testing
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
import type { StorageProvider, StorageUploadResult, StorageFile, StorageListOptions } from "../../types/storage";
|
|
16
|
-
export declare class FakeStorageManager {
|
|
17
|
-
private uploads;
|
|
18
|
-
private downloads;
|
|
19
|
-
private storageProviders;
|
|
20
|
-
private defaultProvider;
|
|
21
|
-
private uploadCallCount;
|
|
22
|
-
private downloadCallCount;
|
|
23
|
-
constructor();
|
|
24
|
-
/**
|
|
25
|
-
* Creates a fake storage provider with basic functionality.
|
|
26
|
-
*
|
|
27
|
-
* @param name - The name identifier for this provider
|
|
28
|
-
* @returns A StorageProvider implementation for testing
|
|
29
|
-
*/
|
|
30
|
-
private createFakeProvider;
|
|
31
|
-
/**
|
|
32
|
-
* Simulates uploading a file to storage.
|
|
33
|
-
*
|
|
34
|
-
* @param data - The Blob data to upload
|
|
35
|
-
* @param filename - Optional filename for the upload
|
|
36
|
-
* @param providerName - Optional storage provider to use (defaults to defaultProvider)
|
|
37
|
-
* @returns A promise resolving to the upload result with URL and metadata
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* ```typescript
|
|
41
|
-
* const fake = new FakeStorageManager();
|
|
42
|
-
* const blob = new Blob(["test data"], { type: "text/plain" });
|
|
43
|
-
* const result = await fake.upload(blob, "test.txt");
|
|
44
|
-
* console.log(result.url); // "https://ipfs.io/ipfs/QmTest1"
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
|
-
upload(data: Blob, _filename?: string, providerName?: string): Promise<StorageUploadResult>;
|
|
48
|
-
/**
|
|
49
|
-
* Simulates downloading a file from storage.
|
|
50
|
-
*
|
|
51
|
-
* @param url - The URL to download from
|
|
52
|
-
* @returns A promise resolving to the Blob content
|
|
53
|
-
*
|
|
54
|
-
* @example
|
|
55
|
-
* ```typescript
|
|
56
|
-
* const fake = new FakeStorageManager();
|
|
57
|
-
* const content = new Blob(["hello world"]);
|
|
58
|
-
* fake.setDownloadResult("https://test.url", content);
|
|
59
|
-
* const downloaded = await fake.download("https://test.url");
|
|
60
|
-
* ```
|
|
61
|
-
*/
|
|
62
|
-
download(url: string): Promise<Blob>;
|
|
63
|
-
/**
|
|
64
|
-
* Lists files in storage, optionally filtered by prefix.
|
|
65
|
-
*
|
|
66
|
-
* @param options - Optional filtering and pagination options
|
|
67
|
-
* @param _providerName - Optional provider name (unused in fake implementation)
|
|
68
|
-
* @returns A promise resolving to an array of file objects
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```typescript
|
|
72
|
-
* const fake = new FakeStorageManager();
|
|
73
|
-
* await fake.upload(new Blob(["data"]), "file1.txt");
|
|
74
|
-
* await fake.upload(new Blob(["data"]), "file2.txt");
|
|
75
|
-
* const files = await fake.list();
|
|
76
|
-
* // Returns ["https://ipfs.io/ipfs/QmTest1", "https://ipfs.io/ipfs/QmTest2"]
|
|
77
|
-
* ```
|
|
78
|
-
*/
|
|
79
|
-
list(options?: StorageListOptions, _providerName?: string): Promise<StorageFile[]>;
|
|
80
|
-
/**
|
|
81
|
-
* Simulates deleting a file from storage.
|
|
82
|
-
*
|
|
83
|
-
* @param url - The URL of the file to delete
|
|
84
|
-
* @returns A promise resolving to true if deleted, false if not found
|
|
85
|
-
*/
|
|
86
|
-
delete(url: string): Promise<boolean>;
|
|
87
|
-
/**
|
|
88
|
-
* Registers a custom storage provider.
|
|
89
|
-
*
|
|
90
|
-
* @param name - The unique name for this provider
|
|
91
|
-
* @param provider - The StorageProvider implementation
|
|
92
|
-
*
|
|
93
|
-
* @example
|
|
94
|
-
* ```typescript
|
|
95
|
-
* const fake = new FakeStorageManager();
|
|
96
|
-
* const customProvider: StorageProvider = {
|
|
97
|
-
* upload: async (data) => ({ url: "https://custom.com/file" }),
|
|
98
|
-
* download: async (url) => new Blob(["custom"]),
|
|
99
|
-
* list: async () => [],
|
|
100
|
-
* delete: async () => true,
|
|
101
|
-
* getConfig: () => ({})
|
|
102
|
-
* };
|
|
103
|
-
* fake.register("custom", customProvider);
|
|
104
|
-
* ```
|
|
105
|
-
*/
|
|
106
|
-
register(name: string, provider: StorageProvider): void;
|
|
107
|
-
/**
|
|
108
|
-
* Retrieves a registered storage provider by name.
|
|
109
|
-
*
|
|
110
|
-
* @param name - The name of the provider to retrieve
|
|
111
|
-
* @returns The StorageProvider if found, undefined otherwise
|
|
112
|
-
*/
|
|
113
|
-
getProvider(name?: string): StorageProvider;
|
|
114
|
-
/**
|
|
115
|
-
* Sets the default storage provider to use.
|
|
116
|
-
*
|
|
117
|
-
* @param name - The name of a registered provider
|
|
118
|
-
* @throws Error if the provider name is not registered
|
|
119
|
-
*/
|
|
120
|
-
setDefaultProvider(name: string): void;
|
|
121
|
-
/**
|
|
122
|
-
* Lists all registered storage provider names.
|
|
123
|
-
*
|
|
124
|
-
* @returns Array of provider name strings
|
|
125
|
-
*/
|
|
126
|
-
listProviders(): string[];
|
|
127
|
-
/**
|
|
128
|
-
* Gets the name of the current default storage provider.
|
|
129
|
-
*
|
|
130
|
-
* @returns The default provider name
|
|
131
|
-
*/
|
|
132
|
-
getDefaultProvider(): string;
|
|
133
|
-
/**
|
|
134
|
-
* Gets all registered storage provider names (alias for listProviders).
|
|
135
|
-
*
|
|
136
|
-
* @returns Array of provider name strings
|
|
137
|
-
*/
|
|
138
|
-
getStorageProviders(): string[];
|
|
139
|
-
/**
|
|
140
|
-
* Gets the name of the default storage provider (alias for getDefaultProvider).
|
|
141
|
-
*
|
|
142
|
-
* @returns The default provider name
|
|
143
|
-
*/
|
|
144
|
-
getDefaultStorageProvider(): string;
|
|
145
|
-
/**
|
|
146
|
-
* Configures a specific upload result for testing.
|
|
147
|
-
*
|
|
148
|
-
* @param url - The URL to configure
|
|
149
|
-
* @param result - The upload result to return for this URL
|
|
150
|
-
*
|
|
151
|
-
* @example
|
|
152
|
-
* ```typescript
|
|
153
|
-
* const fake = new FakeStorageManager();
|
|
154
|
-
* fake.setUploadResult("https://test.url", {
|
|
155
|
-
* url: "https://test.url",
|
|
156
|
-
* size: 1024,
|
|
157
|
-
* contentType: "application/json"
|
|
158
|
-
* });
|
|
159
|
-
* ```
|
|
160
|
-
*/
|
|
161
|
-
setUploadResult(url: string, result: StorageUploadResult): void;
|
|
162
|
-
/**
|
|
163
|
-
* Configures specific download content for a URL.
|
|
164
|
-
*
|
|
165
|
-
* @param url - The URL to configure
|
|
166
|
-
* @param content - The Blob content to return when this URL is downloaded
|
|
167
|
-
*
|
|
168
|
-
* @example
|
|
169
|
-
* ```typescript
|
|
170
|
-
* const fake = new FakeStorageManager();
|
|
171
|
-
* const testContent = new Blob(["test data"], { type: "text/plain" });
|
|
172
|
-
* fake.setDownloadResult("https://test.url", testContent);
|
|
173
|
-
* ```
|
|
174
|
-
*/
|
|
175
|
-
setDownloadResult(url: string, content: Blob): void;
|
|
176
|
-
/**
|
|
177
|
-
* Gets the number of times upload() has been called.
|
|
178
|
-
*
|
|
179
|
-
* @returns The upload call count
|
|
180
|
-
*/
|
|
181
|
-
getUploadCallCount(): number;
|
|
182
|
-
/**
|
|
183
|
-
* Gets the number of times download() has been called.
|
|
184
|
-
*
|
|
185
|
-
* @returns The download call count
|
|
186
|
-
*/
|
|
187
|
-
getDownloadCallCount(): number;
|
|
188
|
-
/**
|
|
189
|
-
* Resets all state, clearing uploads, downloads, and counters.
|
|
190
|
-
*
|
|
191
|
-
* @example
|
|
192
|
-
* ```typescript
|
|
193
|
-
* const fake = new FakeStorageManager();
|
|
194
|
-
* await fake.upload(new Blob(["data"]), "file.txt");
|
|
195
|
-
* fake.reset();
|
|
196
|
-
* const files = await fake.list(); // Returns []
|
|
197
|
-
* ```
|
|
198
|
-
*/
|
|
199
|
-
reset(): void;
|
|
200
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,170 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provides a controllable fake implementation of transaction event waiting for testing.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* This test fake replaces complex mocking with a simple, predictable implementation
|
|
6
|
-
* that allows tests to configure specific responses for transaction hashes.
|
|
7
|
-
* Use this when testing controllers that depend on waitForTransactionEvents functionality.
|
|
8
|
-
*
|
|
9
|
-
* The fake maintains separate maps for responses and errors, allowing tests to
|
|
10
|
-
* simulate both successful and failing transaction scenarios.
|
|
11
|
-
*
|
|
12
|
-
* @category Testing
|
|
13
|
-
* @internal
|
|
14
|
-
*/
|
|
15
|
-
import type { Hash, Address } from "viem";
|
|
16
|
-
/**
|
|
17
|
-
* Minimal TransactionResult interface to avoid circular dependencies.
|
|
18
|
-
* Mirrors the actual TransactionResult from types/operations.
|
|
19
|
-
*/
|
|
20
|
-
interface TransactionResultLike {
|
|
21
|
-
hash: Hash;
|
|
22
|
-
from?: Address;
|
|
23
|
-
contract?: string;
|
|
24
|
-
fn?: string;
|
|
25
|
-
}
|
|
26
|
-
/**
|
|
27
|
-
* Represents the result of waiting for transaction events.
|
|
28
|
-
*/
|
|
29
|
-
export interface TransactionEventResult {
|
|
30
|
-
/** The transaction hash that was monitored */
|
|
31
|
-
hash: Hash;
|
|
32
|
-
/** The address that initiated the transaction */
|
|
33
|
-
from: Address;
|
|
34
|
-
/** The name of the contract that was called */
|
|
35
|
-
contract: string;
|
|
36
|
-
/** The function name that was invoked */
|
|
37
|
-
fn: string;
|
|
38
|
-
/** Map of expected events that were emitted, keyed by event name */
|
|
39
|
-
expectedEvents: Record<string, unknown>;
|
|
40
|
-
/** Array of all events emitted by the transaction */
|
|
41
|
-
allEvents: unknown[];
|
|
42
|
-
/** Whether all expected events were found in the transaction */
|
|
43
|
-
hasExpectedEvents: boolean;
|
|
44
|
-
}
|
|
45
|
-
export declare class FakeWaitForTransactionEvents {
|
|
46
|
-
private responses;
|
|
47
|
-
private errors;
|
|
48
|
-
private defaultResponse;
|
|
49
|
-
/**
|
|
50
|
-
* Configures a specific response for a given transaction hash.
|
|
51
|
-
*
|
|
52
|
-
* @param hash - The transaction hash to configure a response for
|
|
53
|
-
* @param response - The response object to return when this hash is queried
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```typescript
|
|
57
|
-
* const fake = new FakeWaitForTransactionEvents();
|
|
58
|
-
* fake.setResponse("0xabc123", {
|
|
59
|
-
* hash: "0xabc123" as Hash,
|
|
60
|
-
* from: "0xuser",
|
|
61
|
-
* contract: "DataRegistry",
|
|
62
|
-
* fn: "addFile",
|
|
63
|
-
* expectedEvents: { FileAdded: { fileId: 1n } },
|
|
64
|
-
* allEvents: [],
|
|
65
|
-
* hasExpectedEvents: true
|
|
66
|
-
* });
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
setResponse(hash: string, response: TransactionEventResult): void;
|
|
70
|
-
/**
|
|
71
|
-
* Configures an error to be thrown for a specific transaction hash.
|
|
72
|
-
*
|
|
73
|
-
* @param hash - The transaction hash that should trigger an error
|
|
74
|
-
* @param error - The error to throw when this hash is queried
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* ```typescript
|
|
78
|
-
* const fake = new FakeWaitForTransactionEvents();
|
|
79
|
-
* fake.setError("0xfailed", new Error("Transaction timeout"));
|
|
80
|
-
* ```
|
|
81
|
-
*/
|
|
82
|
-
setError(hash: string, error: Error): void;
|
|
83
|
-
/**
|
|
84
|
-
* Sets the default response returned for any unconfigured transaction hash.
|
|
85
|
-
*
|
|
86
|
-
* @param response - The default response object to use
|
|
87
|
-
*
|
|
88
|
-
* @example
|
|
89
|
-
* ```typescript
|
|
90
|
-
* const fake = new FakeWaitForTransactionEvents();
|
|
91
|
-
* fake.setDefaultResponse({
|
|
92
|
-
* hash: "0xdefault" as Hash,
|
|
93
|
-
* from: "0xdefault",
|
|
94
|
-
* contract: "TestContract",
|
|
95
|
-
* fn: "testFunction",
|
|
96
|
-
* expectedEvents: {},
|
|
97
|
-
* allEvents: [],
|
|
98
|
-
* hasExpectedEvents: false
|
|
99
|
-
* });
|
|
100
|
-
* ```
|
|
101
|
-
*/
|
|
102
|
-
setDefaultResponse(response: TransactionEventResult): void;
|
|
103
|
-
/**
|
|
104
|
-
* Simulates waiting for transaction events, returning configured responses or throwing configured errors.
|
|
105
|
-
*
|
|
106
|
-
* @param txOrHash - A TransactionResult-like object or raw transaction hash string
|
|
107
|
-
* @returns A promise that resolves with the configured response for this hash
|
|
108
|
-
* @throws The configured error for this hash, if one was set
|
|
109
|
-
*/
|
|
110
|
-
wait(txOrHash: TransactionResultLike | Hash | string): Promise<TransactionEventResult>;
|
|
111
|
-
/**
|
|
112
|
-
* Clears all configured responses and errors, resetting the fake to its initial state.
|
|
113
|
-
*/
|
|
114
|
-
reset(): void;
|
|
115
|
-
/**
|
|
116
|
-
* Gets all transaction hashes that have configured responses.
|
|
117
|
-
*
|
|
118
|
-
* @returns Array of transaction hash strings
|
|
119
|
-
*/
|
|
120
|
-
getConfiguredHashes(): string[];
|
|
121
|
-
/**
|
|
122
|
-
* Creates a function that can be used as a mock implementation in vitest.
|
|
123
|
-
*
|
|
124
|
-
* @returns A function compatible with vi.fn().mockImplementation()
|
|
125
|
-
*
|
|
126
|
-
* @example
|
|
127
|
-
* ```typescript
|
|
128
|
-
* const fake = new FakeWaitForTransactionEvents();
|
|
129
|
-
* const mockWaitForTransactionEvents = vi.fn()
|
|
130
|
-
* .mockImplementation(fake.asMockFunction());
|
|
131
|
-
* ```
|
|
132
|
-
*/
|
|
133
|
-
asMockFunction(): (txOrHash: TransactionResultLike | Hash | string) => Promise<TransactionEventResult>;
|
|
134
|
-
/**
|
|
135
|
-
* Creates a pre-configured response object for a successful SchemaAdded event.
|
|
136
|
-
*
|
|
137
|
-
* @param schemaId - The ID of the schema that was added
|
|
138
|
-
* @param name - The name of the schema
|
|
139
|
-
* @param dialect - The dialect/format of the schema (e.g., "json", "jsonschema")
|
|
140
|
-
* @param definitionUrl - The URL where the schema definition is stored
|
|
141
|
-
* @param hash - The transaction hash (defaults to "0xtxhash")
|
|
142
|
-
* @returns A complete TransactionEventResult object for a SchemaAdded event
|
|
143
|
-
*
|
|
144
|
-
* @example
|
|
145
|
-
* ```typescript
|
|
146
|
-
* const response = FakeWaitForTransactionEvents.createSchemaAddedResponse(
|
|
147
|
-
* 123n,
|
|
148
|
-
* "UserProfile",
|
|
149
|
-
* "jsonschema",
|
|
150
|
-
* "https://ipfs.io/ipfs/QmHash"
|
|
151
|
-
* );
|
|
152
|
-
* fake.setResponse("0xtxhash", response);
|
|
153
|
-
* ```
|
|
154
|
-
*/
|
|
155
|
-
static createSchemaAddedResponse(schemaId: bigint, name: string, dialect: string, definitionUrl: string, hash?: Hash): TransactionEventResult;
|
|
156
|
-
/**
|
|
157
|
-
* Creates a response object representing a transaction with no expected events.
|
|
158
|
-
*
|
|
159
|
-
* @param hash - The transaction hash (defaults to "0xtxhash")
|
|
160
|
-
* @returns A TransactionEventResult with hasExpectedEvents set to false
|
|
161
|
-
*
|
|
162
|
-
* @example
|
|
163
|
-
* ```typescript
|
|
164
|
-
* const emptyResponse = FakeWaitForTransactionEvents.createEmptyResponse();
|
|
165
|
-
* fake.setResponse("0xempty", emptyResponse);
|
|
166
|
-
* ```
|
|
167
|
-
*/
|
|
168
|
-
static createEmptyResponse(hash?: Hash): TransactionEventResult;
|
|
169
|
-
}
|
|
170
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|