@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,43 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var typedDataConverter_exports = {};
|
|
20
|
-
__export(typedDataConverter_exports, {
|
|
21
|
-
toViemTypedDataDefinition: () => toViemTypedDataDefinition
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(typedDataConverter_exports);
|
|
24
|
-
function toViemTypedDataDefinition(typedData) {
|
|
25
|
-
const viemTypes = {};
|
|
26
|
-
for (const [typeName, typeArray] of Object.entries(typedData.types)) {
|
|
27
|
-
viemTypes[typeName] = typeArray.map((field) => ({
|
|
28
|
-
name: field.name,
|
|
29
|
-
type: field.type
|
|
30
|
-
}));
|
|
31
|
-
}
|
|
32
|
-
return {
|
|
33
|
-
domain: typedData.domain,
|
|
34
|
-
types: viemTypes,
|
|
35
|
-
primaryType: typedData.primaryType,
|
|
36
|
-
message: typedData.message
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
-
0 && (module.exports = {
|
|
41
|
-
toViemTypedDataDefinition
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=typedDataConverter.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/typedDataConverter.ts"],"sourcesContent":["/**\n * Provides type-safe conversion between Vana and viem typed data formats.\n *\n * @remarks\n * This module bridges the gap between Vana's generic typed data structure\n * and viem's strict TypedDataDefinition format, ensuring compatibility\n * for EIP-712 signature operations.\n *\n * @category Utilities\n * @module typedDataConverter\n */\n\nimport type { TypedDataDefinition } from \"viem\";\nimport type { GenericTypedData } from \"../types/permissions\";\n\n/**\n * Converts a GenericTypedData object to a viem-compatible TypedDataDefinition.\n *\n * @remarks\n * Transforms Vana's flexible typed data format into viem's strict format\n * with readonly arrays. This ensures type safety when passing typed data\n * to viem's `signTypedData` method for EIP-712 signatures.\n *\n * @param typedData - The typed data object to convert.\n * Obtain from permission operations or server responses.\n * @returns A properly typed TypedDataDefinition for use with viem\n *\n * @example\n * ```typescript\n * const vanTypedData: GenericTypedData = {\n * domain: { name: 'Vana', version: '1', chainId: 14800 },\n * types: {\n * Permission: [\n * { name: 'grantee', type: 'address' },\n * { name: 'operation', type: 'string' }\n * ]\n * },\n * primaryType: 'Permission',\n * message: { grantee: '0x...', operation: 'read' }\n * };\n *\n * const viemTypedData = toViemTypedDataDefinition(vanaTypedData);\n * const signature = await walletClient.signTypedData(viemTypedData);\n * ```\n *\n * @category Utilities\n */\nexport function toViemTypedDataDefinition(\n typedData: GenericTypedData,\n): TypedDataDefinition {\n // Transform the types to match viem's expected format with readonly arrays\n const viemTypes: Record<string, readonly { name: string; type: string }[]> =\n {};\n\n for (const [typeName, typeArray] of Object.entries(typedData.types)) {\n // Create a new readonly array for each type\n viemTypes[typeName] = typeArray.map((field) => ({\n name: field.name,\n type: field.type,\n })) as readonly { name: string; type: string }[];\n }\n\n return {\n domain: typedData.domain,\n types: viemTypes as TypedDataDefinition[\"types\"],\n primaryType: typedData.primaryType,\n message: typedData.message,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AA+CO,SAAS,0BACd,WACqB;AAErB,QAAM,YACJ,CAAC;AAEH,aAAW,CAAC,UAAU,SAAS,KAAK,OAAO,QAAQ,UAAU,KAAK,GAAG;AAEnE,cAAU,QAAQ,IAAI,UAAU,IAAI,CAAC,WAAW;AAAA,MAC9C,MAAM,MAAM;AAAA,MACZ,MAAM,MAAM;AAAA,IACd,EAAE;AAAA,EACJ;AAEA,SAAO;AAAA,IACL,QAAQ,UAAU;AAAA,IAClB,OAAO;AAAA,IACP,aAAa,UAAU;AAAA,IACvB,SAAS,UAAU;AAAA,EACrB;AACF;","names":[]}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provides type-safe conversion between Vana and viem typed data formats.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* This module bridges the gap between Vana's generic typed data structure
|
|
6
|
-
* and viem's strict TypedDataDefinition format, ensuring compatibility
|
|
7
|
-
* for EIP-712 signature operations.
|
|
8
|
-
*
|
|
9
|
-
* @category Utilities
|
|
10
|
-
* @module typedDataConverter
|
|
11
|
-
*/
|
|
12
|
-
import type { TypedDataDefinition } from "viem";
|
|
13
|
-
import type { GenericTypedData } from "../types/permissions";
|
|
14
|
-
/**
|
|
15
|
-
* Converts a GenericTypedData object to a viem-compatible TypedDataDefinition.
|
|
16
|
-
*
|
|
17
|
-
* @remarks
|
|
18
|
-
* Transforms Vana's flexible typed data format into viem's strict format
|
|
19
|
-
* with readonly arrays. This ensures type safety when passing typed data
|
|
20
|
-
* to viem's `signTypedData` method for EIP-712 signatures.
|
|
21
|
-
*
|
|
22
|
-
* @param typedData - The typed data object to convert.
|
|
23
|
-
* Obtain from permission operations or server responses.
|
|
24
|
-
* @returns A properly typed TypedDataDefinition for use with viem
|
|
25
|
-
*
|
|
26
|
-
* @example
|
|
27
|
-
* ```typescript
|
|
28
|
-
* const vanTypedData: GenericTypedData = {
|
|
29
|
-
* domain: { name: 'Vana', version: '1', chainId: 14800 },
|
|
30
|
-
* types: {
|
|
31
|
-
* Permission: [
|
|
32
|
-
* { name: 'grantee', type: 'address' },
|
|
33
|
-
* { name: 'operation', type: 'string' }
|
|
34
|
-
* ]
|
|
35
|
-
* },
|
|
36
|
-
* primaryType: 'Permission',
|
|
37
|
-
* message: { grantee: '0x...', operation: 'read' }
|
|
38
|
-
* };
|
|
39
|
-
*
|
|
40
|
-
* const viemTypedData = toViemTypedDataDefinition(vanaTypedData);
|
|
41
|
-
* const signature = await walletClient.signTypedData(viemTypedData);
|
|
42
|
-
* ```
|
|
43
|
-
*
|
|
44
|
-
* @category Utilities
|
|
45
|
-
*/
|
|
46
|
-
export declare function toViemTypedDataDefinition(typedData: GenericTypedData): TypedDataDefinition;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
function toViemTypedDataDefinition(typedData) {
|
|
2
|
-
const viemTypes = {};
|
|
3
|
-
for (const [typeName, typeArray] of Object.entries(typedData.types)) {
|
|
4
|
-
viemTypes[typeName] = typeArray.map((field) => ({
|
|
5
|
-
name: field.name,
|
|
6
|
-
type: field.type
|
|
7
|
-
}));
|
|
8
|
-
}
|
|
9
|
-
return {
|
|
10
|
-
domain: typedData.domain,
|
|
11
|
-
types: viemTypes,
|
|
12
|
-
primaryType: typedData.primaryType,
|
|
13
|
-
message: typedData.message
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
export {
|
|
17
|
-
toViemTypedDataDefinition
|
|
18
|
-
};
|
|
19
|
-
//# sourceMappingURL=typedDataConverter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/typedDataConverter.ts"],"sourcesContent":["/**\n * Provides type-safe conversion between Vana and viem typed data formats.\n *\n * @remarks\n * This module bridges the gap between Vana's generic typed data structure\n * and viem's strict TypedDataDefinition format, ensuring compatibility\n * for EIP-712 signature operations.\n *\n * @category Utilities\n * @module typedDataConverter\n */\n\nimport type { TypedDataDefinition } from \"viem\";\nimport type { GenericTypedData } from \"../types/permissions\";\n\n/**\n * Converts a GenericTypedData object to a viem-compatible TypedDataDefinition.\n *\n * @remarks\n * Transforms Vana's flexible typed data format into viem's strict format\n * with readonly arrays. This ensures type safety when passing typed data\n * to viem's `signTypedData` method for EIP-712 signatures.\n *\n * @param typedData - The typed data object to convert.\n * Obtain from permission operations or server responses.\n * @returns A properly typed TypedDataDefinition for use with viem\n *\n * @example\n * ```typescript\n * const vanTypedData: GenericTypedData = {\n * domain: { name: 'Vana', version: '1', chainId: 14800 },\n * types: {\n * Permission: [\n * { name: 'grantee', type: 'address' },\n * { name: 'operation', type: 'string' }\n * ]\n * },\n * primaryType: 'Permission',\n * message: { grantee: '0x...', operation: 'read' }\n * };\n *\n * const viemTypedData = toViemTypedDataDefinition(vanaTypedData);\n * const signature = await walletClient.signTypedData(viemTypedData);\n * ```\n *\n * @category Utilities\n */\nexport function toViemTypedDataDefinition(\n typedData: GenericTypedData,\n): TypedDataDefinition {\n // Transform the types to match viem's expected format with readonly arrays\n const viemTypes: Record<string, readonly { name: string; type: string }[]> =\n {};\n\n for (const [typeName, typeArray] of Object.entries(typedData.types)) {\n // Create a new readonly array for each type\n viemTypes[typeName] = typeArray.map((field) => ({\n name: field.name,\n type: field.type,\n })) as readonly { name: string; type: string }[];\n }\n\n return {\n domain: typedData.domain,\n types: viemTypes as TypedDataDefinition[\"types\"],\n primaryType: typedData.primaryType,\n message: typedData.message,\n };\n}\n"],"mappings":"AA+CO,SAAS,0BACd,WACqB;AAErB,QAAM,YACJ,CAAC;AAEH,aAAW,CAAC,UAAU,SAAS,KAAK,OAAO,QAAQ,UAAU,KAAK,GAAG;AAEnE,cAAU,QAAQ,IAAI,UAAU,IAAI,CAAC,WAAW;AAAA,MAC9C,MAAM,MAAM;AAAA,MACZ,MAAM,MAAM;AAAA,IACd,EAAE;AAAA,EACJ;AAEA,SAAO;AAAA,IACL,QAAQ,UAAU;AAAA,IAClB,OAAO;AAAA,IACP,aAAa,UAAU;AAAA,IACvB,SAAS,UAAU;AAAA,EACrB;AACF;","names":[]}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var urlResolver_exports = {};
|
|
20
|
-
__export(urlResolver_exports, {
|
|
21
|
-
UrlResolutionError: () => UrlResolutionError,
|
|
22
|
-
fetchFromUrl: () => fetchFromUrl
|
|
23
|
-
});
|
|
24
|
-
module.exports = __toCommonJS(urlResolver_exports);
|
|
25
|
-
var import_download = require("./download");
|
|
26
|
-
class UrlResolutionError extends Error {
|
|
27
|
-
/**
|
|
28
|
-
* Creates a new URL resolution error.
|
|
29
|
-
*
|
|
30
|
-
* @param message - Description of what went wrong
|
|
31
|
-
* @param url - The URL that failed to resolve
|
|
32
|
-
* @param cause - The underlying error that caused the failure
|
|
33
|
-
*/
|
|
34
|
-
constructor(message, url, cause) {
|
|
35
|
-
super(message);
|
|
36
|
-
this.url = url;
|
|
37
|
-
this.cause = cause;
|
|
38
|
-
this.name = "UrlResolutionError";
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
async function fetchFromUrl(url, downloadRelayer) {
|
|
42
|
-
try {
|
|
43
|
-
const response = await (0, import_download.universalFetch)(url, downloadRelayer);
|
|
44
|
-
if (!response.ok) {
|
|
45
|
-
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
46
|
-
}
|
|
47
|
-
const data = await response.json();
|
|
48
|
-
return data;
|
|
49
|
-
} catch (error) {
|
|
50
|
-
throw new UrlResolutionError(
|
|
51
|
-
`Failed to fetch from ${url}: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
52
|
-
url,
|
|
53
|
-
error instanceof Error ? error : void 0
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
-
0 && (module.exports = {
|
|
59
|
-
UrlResolutionError,
|
|
60
|
-
fetchFromUrl
|
|
61
|
-
});
|
|
62
|
-
//# sourceMappingURL=urlResolver.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/urlResolver.ts"],"sourcesContent":["/**\n * Provides universal URL resolution across multiple protocols.\n *\n * @remarks\n * This module enables fetching data from various protocols including IPFS,\n * HTTP/HTTPS, and Arweave through a unified interface. It handles protocol\n * conversion, gateway selection, and fallback strategies automatically.\n *\n * @category Utilities\n * @module utils/urlResolver\n */\n\nimport { universalFetch } from \"./download\";\n\n/**\n * Indicates that URL resolution or data fetching failed.\n *\n * @remarks\n * This error provides context about which URL failed and why,\n * making it easier to debug issues with external resources.\n *\n * @category Errors\n */\nexport class UrlResolutionError extends Error {\n /**\n * Creates a new URL resolution error.\n *\n * @param message - Description of what went wrong\n * @param url - The URL that failed to resolve\n * @param cause - The underlying error that caused the failure\n */\n constructor(\n message: string,\n public readonly url: string,\n public override readonly cause?: Error,\n ) {\n super(message);\n this.name = \"UrlResolutionError\";\n }\n}\n\n/**\n * Fetches and parses JSON data from any supported URL protocol\n *\n * @param url - The URL to fetch from (supports ipfs://, https://, http://, ar://)\n * @param downloadRelayer - Optional download relayer for CORS bypass\n * @param downloadRelayer.proxyDownload - Function to proxy downloads through application server\n * @returns Promise resolving to the parsed JSON data\n * @throws {UrlResolutionError} When the URL cannot be resolved or parsed\n *\n * @example\n * ```typescript\n * // Fetch from IPFS\n * const data = await fetchFromUrl(\"ipfs://QmXxx...\");\n *\n * // Fetch from HTTPS\n * const data = await fetchFromUrl(\"https://example.com/data.json\");\n *\n * // Handles protocol conversion internally\n * const schema = await fetchFromUrl(schemaDefinitionUrl);\n * ```\n */\nexport async function fetchFromUrl(\n url: string,\n downloadRelayer?: { proxyDownload: (url: string) => Promise<Blob> },\n): Promise<unknown> {\n try {\n // Use unified download utility with automatic fallbacks\n const response = await universalFetch(url, downloadRelayer);\n\n if (!response.ok) {\n throw new Error(`HTTP ${response.status}: ${response.statusText}`);\n }\n\n // Parse JSON response\n const data = await response.json();\n return data;\n } catch (error) {\n throw new UrlResolutionError(\n `Failed to fetch from ${url}: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n url,\n error instanceof Error ? error : undefined,\n );\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,sBAA+B;AAWxB,MAAM,2BAA2B,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ5C,YACE,SACgB,KACS,OACzB;AACA,UAAM,OAAO;AAHG;AACS;AAGzB,SAAK,OAAO;AAAA,EACd;AACF;AAuBA,eAAsB,aACpB,KACA,iBACkB;AAClB,MAAI;AAEF,UAAM,WAAW,UAAM,gCAAe,KAAK,eAAe;AAE1D,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI,MAAM,QAAQ,SAAS,MAAM,KAAK,SAAS,UAAU,EAAE;AAAA,IACnE;AAGA,UAAM,OAAO,MAAM,SAAS,KAAK;AACjC,WAAO;AAAA,EACT,SAAS,OAAO;AACd,UAAM,IAAI;AAAA,MACR,wBAAwB,GAAG,KAAK,iBAAiB,QAAQ,MAAM,UAAU,eAAe;AAAA,MACxF;AAAA,MACA,iBAAiB,QAAQ,QAAQ;AAAA,IACnC;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provides universal URL resolution across multiple protocols.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* This module enables fetching data from various protocols including IPFS,
|
|
6
|
-
* HTTP/HTTPS, and Arweave through a unified interface. It handles protocol
|
|
7
|
-
* conversion, gateway selection, and fallback strategies automatically.
|
|
8
|
-
*
|
|
9
|
-
* @category Utilities
|
|
10
|
-
* @module utils/urlResolver
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Indicates that URL resolution or data fetching failed.
|
|
14
|
-
*
|
|
15
|
-
* @remarks
|
|
16
|
-
* This error provides context about which URL failed and why,
|
|
17
|
-
* making it easier to debug issues with external resources.
|
|
18
|
-
*
|
|
19
|
-
* @category Errors
|
|
20
|
-
*/
|
|
21
|
-
export declare class UrlResolutionError extends Error {
|
|
22
|
-
readonly url: string;
|
|
23
|
-
readonly cause?: Error | undefined;
|
|
24
|
-
/**
|
|
25
|
-
* Creates a new URL resolution error.
|
|
26
|
-
*
|
|
27
|
-
* @param message - Description of what went wrong
|
|
28
|
-
* @param url - The URL that failed to resolve
|
|
29
|
-
* @param cause - The underlying error that caused the failure
|
|
30
|
-
*/
|
|
31
|
-
constructor(message: string, url: string, cause?: Error | undefined);
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Fetches and parses JSON data from any supported URL protocol
|
|
35
|
-
*
|
|
36
|
-
* @param url - The URL to fetch from (supports ipfs://, https://, http://, ar://)
|
|
37
|
-
* @param downloadRelayer - Optional download relayer for CORS bypass
|
|
38
|
-
* @param downloadRelayer.proxyDownload - Function to proxy downloads through application server
|
|
39
|
-
* @returns Promise resolving to the parsed JSON data
|
|
40
|
-
* @throws {UrlResolutionError} When the URL cannot be resolved or parsed
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```typescript
|
|
44
|
-
* // Fetch from IPFS
|
|
45
|
-
* const data = await fetchFromUrl("ipfs://QmXxx...");
|
|
46
|
-
*
|
|
47
|
-
* // Fetch from HTTPS
|
|
48
|
-
* const data = await fetchFromUrl("https://example.com/data.json");
|
|
49
|
-
*
|
|
50
|
-
* // Handles protocol conversion internally
|
|
51
|
-
* const schema = await fetchFromUrl(schemaDefinitionUrl);
|
|
52
|
-
* ```
|
|
53
|
-
*/
|
|
54
|
-
export declare function fetchFromUrl(url: string, downloadRelayer?: {
|
|
55
|
-
proxyDownload: (url: string) => Promise<Blob>;
|
|
56
|
-
}): Promise<unknown>;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { universalFetch } from "./download";
|
|
2
|
-
class UrlResolutionError extends Error {
|
|
3
|
-
/**
|
|
4
|
-
* Creates a new URL resolution error.
|
|
5
|
-
*
|
|
6
|
-
* @param message - Description of what went wrong
|
|
7
|
-
* @param url - The URL that failed to resolve
|
|
8
|
-
* @param cause - The underlying error that caused the failure
|
|
9
|
-
*/
|
|
10
|
-
constructor(message, url, cause) {
|
|
11
|
-
super(message);
|
|
12
|
-
this.url = url;
|
|
13
|
-
this.cause = cause;
|
|
14
|
-
this.name = "UrlResolutionError";
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
async function fetchFromUrl(url, downloadRelayer) {
|
|
18
|
-
try {
|
|
19
|
-
const response = await universalFetch(url, downloadRelayer);
|
|
20
|
-
if (!response.ok) {
|
|
21
|
-
throw new Error(`HTTP ${response.status}: ${response.statusText}`);
|
|
22
|
-
}
|
|
23
|
-
const data = await response.json();
|
|
24
|
-
return data;
|
|
25
|
-
} catch (error) {
|
|
26
|
-
throw new UrlResolutionError(
|
|
27
|
-
`Failed to fetch from ${url}: ${error instanceof Error ? error.message : "Unknown error"}`,
|
|
28
|
-
url,
|
|
29
|
-
error instanceof Error ? error : void 0
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
export {
|
|
34
|
-
UrlResolutionError,
|
|
35
|
-
fetchFromUrl
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=urlResolver.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/urlResolver.ts"],"sourcesContent":["/**\n * Provides universal URL resolution across multiple protocols.\n *\n * @remarks\n * This module enables fetching data from various protocols including IPFS,\n * HTTP/HTTPS, and Arweave through a unified interface. It handles protocol\n * conversion, gateway selection, and fallback strategies automatically.\n *\n * @category Utilities\n * @module utils/urlResolver\n */\n\nimport { universalFetch } from \"./download\";\n\n/**\n * Indicates that URL resolution or data fetching failed.\n *\n * @remarks\n * This error provides context about which URL failed and why,\n * making it easier to debug issues with external resources.\n *\n * @category Errors\n */\nexport class UrlResolutionError extends Error {\n /**\n * Creates a new URL resolution error.\n *\n * @param message - Description of what went wrong\n * @param url - The URL that failed to resolve\n * @param cause - The underlying error that caused the failure\n */\n constructor(\n message: string,\n public readonly url: string,\n public override readonly cause?: Error,\n ) {\n super(message);\n this.name = \"UrlResolutionError\";\n }\n}\n\n/**\n * Fetches and parses JSON data from any supported URL protocol\n *\n * @param url - The URL to fetch from (supports ipfs://, https://, http://, ar://)\n * @param downloadRelayer - Optional download relayer for CORS bypass\n * @param downloadRelayer.proxyDownload - Function to proxy downloads through application server\n * @returns Promise resolving to the parsed JSON data\n * @throws {UrlResolutionError} When the URL cannot be resolved or parsed\n *\n * @example\n * ```typescript\n * // Fetch from IPFS\n * const data = await fetchFromUrl(\"ipfs://QmXxx...\");\n *\n * // Fetch from HTTPS\n * const data = await fetchFromUrl(\"https://example.com/data.json\");\n *\n * // Handles protocol conversion internally\n * const schema = await fetchFromUrl(schemaDefinitionUrl);\n * ```\n */\nexport async function fetchFromUrl(\n url: string,\n downloadRelayer?: { proxyDownload: (url: string) => Promise<Blob> },\n): Promise<unknown> {\n try {\n // Use unified download utility with automatic fallbacks\n const response = await universalFetch(url, downloadRelayer);\n\n if (!response.ok) {\n throw new Error(`HTTP ${response.status}: ${response.statusText}`);\n }\n\n // Parse JSON response\n const data = await response.json();\n return data;\n } catch (error) {\n throw new UrlResolutionError(\n `Failed to fetch from ${url}: ${error instanceof Error ? error.message : \"Unknown error\"}`,\n url,\n error instanceof Error ? error : undefined,\n );\n }\n}\n"],"mappings":"AAYA,SAAS,sBAAsB;AAWxB,MAAM,2BAA2B,MAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ5C,YACE,SACgB,KACS,OACzB;AACA,UAAM,OAAO;AAHG;AACS;AAGzB,SAAK,OAAO;AAAA,EACd;AACF;AAuBA,eAAsB,aACpB,KACA,iBACkB;AAClB,MAAI;AAEF,UAAM,WAAW,MAAM,eAAe,KAAK,eAAe;AAE1D,QAAI,CAAC,SAAS,IAAI;AAChB,YAAM,IAAI,MAAM,QAAQ,SAAS,MAAM,KAAK,SAAS,UAAU,EAAE;AAAA,IACnE;AAGA,UAAM,OAAO,MAAM,SAAS,KAAK;AACjC,WAAO;AAAA,EACT,SAAS,OAAO;AACd,UAAM,IAAI;AAAA,MACR,wBAAwB,GAAG,KAAK,iBAAiB,QAAQ,MAAM,UAAU,eAAe;AAAA,MACxF;AAAA,MACA,iBAAiB,QAAQ,QAAQ;AAAA,IACnC;AAAA,EACF;AACF;","names":[]}
|
package/dist/utils/wallet.cjs
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var wallet_exports = {};
|
|
20
|
-
__export(wallet_exports, {
|
|
21
|
-
extractAddress: () => extractAddress,
|
|
22
|
-
extractAddressSafe: () => extractAddressSafe,
|
|
23
|
-
hasAddress: () => hasAddress
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(wallet_exports);
|
|
26
|
-
function extractAddress(account) {
|
|
27
|
-
if (!account) {
|
|
28
|
-
throw new Error("No account provided");
|
|
29
|
-
}
|
|
30
|
-
if (typeof account === "string") {
|
|
31
|
-
return account;
|
|
32
|
-
}
|
|
33
|
-
if (typeof account === "object" && "address" in account && account.address) {
|
|
34
|
-
return account.address;
|
|
35
|
-
}
|
|
36
|
-
throw new Error("Unable to determine wallet address from account");
|
|
37
|
-
}
|
|
38
|
-
function extractAddressSafe(account) {
|
|
39
|
-
try {
|
|
40
|
-
return extractAddress(account);
|
|
41
|
-
} catch {
|
|
42
|
-
return void 0;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
function hasAddress(account) {
|
|
46
|
-
if (!account) return false;
|
|
47
|
-
if (typeof account === "string") {
|
|
48
|
-
return /^0x[a-fA-F0-9]{40}$/.test(account);
|
|
49
|
-
}
|
|
50
|
-
if (typeof account === "object" && "address" in account) {
|
|
51
|
-
const accountWithAddress = account;
|
|
52
|
-
const addr = accountWithAddress.address;
|
|
53
|
-
return typeof addr === "string" && /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
54
|
-
}
|
|
55
|
-
return false;
|
|
56
|
-
}
|
|
57
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
58
|
-
0 && (module.exports = {
|
|
59
|
-
extractAddress,
|
|
60
|
-
extractAddressSafe,
|
|
61
|
-
hasAddress
|
|
62
|
-
});
|
|
63
|
-
//# sourceMappingURL=wallet.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/wallet.ts"],"sourcesContent":["import type { Account, Address } from \"viem\";\n\n/**\n * Extracts an Ethereum address from various account formats.\n *\n * @remarks\n * Handles viem's polymorphic Account type which can be a string address,\n * an object with an address property, or a LocalAccount. This utility\n * provides consistent address extraction across the SDK, eliminating\n * duplicate logic and potential inconsistencies.\n *\n * @param account - The account to extract address from.\n * Can be a hex string address, Account object, or LocalAccount.\n * @returns The extracted Ethereum address as a `0x`-prefixed string\n *\n * @throws {Error} When account is undefined or null.\n * Provide a valid account from wallet connection.\n * @throws {Error} When address cannot be determined from account structure.\n * Ensure account has a valid address property.\n *\n * @example\n * ```typescript\n * // String address\n * const addr1 = extractAddress('0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb');\n *\n * // Account object\n * const addr2 = extractAddress({ address: '0x742d...' });\n *\n * // LocalAccount from viem\n * const account = privateKeyToAccount('0x...');\n * const addr3 = extractAddress(account);\n * ```\n *\n * @category Utilities\n */\nexport function extractAddress(\n account: Account | Address | undefined | null,\n): Address {\n if (!account) {\n throw new Error(\"No account provided\");\n }\n\n // Handle string address directly\n if (typeof account === \"string\") {\n return account as Address;\n }\n\n // Handle object with address property\n if (typeof account === \"object\" && \"address\" in account && account.address) {\n return account.address;\n }\n\n throw new Error(\"Unable to determine wallet address from account\");\n}\n\n/**\n * Safely extracts an address without throwing errors.\n *\n * @remarks\n * Non-throwing version of `extractAddress` for optional address resolution.\n * Use when address extraction failure is acceptable and should be handled\n * gracefully without exception handling.\n *\n * @param account - The account to extract address from.\n * Can be a hex string address, Account object, LocalAccount, or nullish.\n * @returns The extracted Ethereum address or `undefined` if extraction fails\n *\n * @example\n * ```typescript\n * const address = extractAddressSafe(potentialAccount);\n *\n * if (address) {\n * console.log(`Using address: ${address}`);\n * } else {\n * console.log('No valid address available');\n * }\n *\n * // Useful in optional chaining\n * const userAddress = extractAddressSafe(user?.wallet) ?? DEFAULT_ADDRESS;\n * ```\n *\n * @category Utilities\n */\nexport function extractAddressSafe(\n account: Account | Address | undefined | null,\n): Address | undefined {\n try {\n return extractAddress(account);\n } catch {\n return undefined;\n }\n}\n\n/**\n * Validates whether a value contains a valid Ethereum address.\n *\n * @remarks\n * Type guard that performs runtime validation of Ethereum address format.\n * Checks for proper `0x` prefix and 40 hexadecimal characters. Works with\n * string addresses, Account objects, and LocalAccount instances.\n *\n * @param account - The value to validate for address presence\n * @returns `true` if account contains a valid Ethereum address, `false` otherwise\n *\n * @example\n * ```typescript\n * const maybeAccount: unknown = getUserInput();\n *\n * if (hasAddress(maybeAccount)) {\n * // TypeScript knows maybeAccount is Account | Address\n * const address = extractAddress(maybeAccount);\n * await vana.data.getUserFiles({ owner: address });\n * } else {\n * console.error('Invalid address format');\n * }\n *\n * // Filter valid addresses from mixed array\n * const addresses = mixedArray.filter(hasAddress).map(extractAddress);\n * ```\n *\n * @category Utilities\n */\nexport function hasAddress(account: unknown): account is Account | Address {\n if (!account) return false;\n\n if (typeof account === \"string\") {\n // Basic check for Ethereum address format\n return /^0x[a-fA-F0-9]{40}$/.test(account);\n }\n\n if (typeof account === \"object\" && \"address\" in account) {\n const accountWithAddress = account as { address: unknown };\n const addr = accountWithAddress.address;\n return typeof addr === \"string\" && /^0x[a-fA-F0-9]{40}$/.test(addr);\n }\n\n return false;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAmCO,SAAS,eACd,SACS;AACT,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAGA,MAAI,OAAO,YAAY,UAAU;AAC/B,WAAO;AAAA,EACT;AAGA,MAAI,OAAO,YAAY,YAAY,aAAa,WAAW,QAAQ,SAAS;AAC1E,WAAO,QAAQ;AAAA,EACjB;AAEA,QAAM,IAAI,MAAM,iDAAiD;AACnE;AA8BO,SAAS,mBACd,SACqB;AACrB,MAAI;AACF,WAAO,eAAe,OAAO;AAAA,EAC/B,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AA+BO,SAAS,WAAW,SAAgD;AACzE,MAAI,CAAC,QAAS,QAAO;AAErB,MAAI,OAAO,YAAY,UAAU;AAE/B,WAAO,sBAAsB,KAAK,OAAO;AAAA,EAC3C;AAEA,MAAI,OAAO,YAAY,YAAY,aAAa,SAAS;AACvD,UAAM,qBAAqB;AAC3B,UAAM,OAAO,mBAAmB;AAChC,WAAO,OAAO,SAAS,YAAY,sBAAsB,KAAK,IAAI;AAAA,EACpE;AAEA,SAAO;AACT;","names":[]}
|
package/dist/utils/wallet.d.ts
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import type { Account, Address } from "viem";
|
|
2
|
-
/**
|
|
3
|
-
* Extracts an Ethereum address from various account formats.
|
|
4
|
-
*
|
|
5
|
-
* @remarks
|
|
6
|
-
* Handles viem's polymorphic Account type which can be a string address,
|
|
7
|
-
* an object with an address property, or a LocalAccount. This utility
|
|
8
|
-
* provides consistent address extraction across the SDK, eliminating
|
|
9
|
-
* duplicate logic and potential inconsistencies.
|
|
10
|
-
*
|
|
11
|
-
* @param account - The account to extract address from.
|
|
12
|
-
* Can be a hex string address, Account object, or LocalAccount.
|
|
13
|
-
* @returns The extracted Ethereum address as a `0x`-prefixed string
|
|
14
|
-
*
|
|
15
|
-
* @throws {Error} When account is undefined or null.
|
|
16
|
-
* Provide a valid account from wallet connection.
|
|
17
|
-
* @throws {Error} When address cannot be determined from account structure.
|
|
18
|
-
* Ensure account has a valid address property.
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```typescript
|
|
22
|
-
* // String address
|
|
23
|
-
* const addr1 = extractAddress('0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb');
|
|
24
|
-
*
|
|
25
|
-
* // Account object
|
|
26
|
-
* const addr2 = extractAddress({ address: '0x742d...' });
|
|
27
|
-
*
|
|
28
|
-
* // LocalAccount from viem
|
|
29
|
-
* const account = privateKeyToAccount('0x...');
|
|
30
|
-
* const addr3 = extractAddress(account);
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
|
-
* @category Utilities
|
|
34
|
-
*/
|
|
35
|
-
export declare function extractAddress(account: Account | Address | undefined | null): Address;
|
|
36
|
-
/**
|
|
37
|
-
* Safely extracts an address without throwing errors.
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* Non-throwing version of `extractAddress` for optional address resolution.
|
|
41
|
-
* Use when address extraction failure is acceptable and should be handled
|
|
42
|
-
* gracefully without exception handling.
|
|
43
|
-
*
|
|
44
|
-
* @param account - The account to extract address from.
|
|
45
|
-
* Can be a hex string address, Account object, LocalAccount, or nullish.
|
|
46
|
-
* @returns The extracted Ethereum address or `undefined` if extraction fails
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```typescript
|
|
50
|
-
* const address = extractAddressSafe(potentialAccount);
|
|
51
|
-
*
|
|
52
|
-
* if (address) {
|
|
53
|
-
* console.log(`Using address: ${address}`);
|
|
54
|
-
* } else {
|
|
55
|
-
* console.log('No valid address available');
|
|
56
|
-
* }
|
|
57
|
-
*
|
|
58
|
-
* // Useful in optional chaining
|
|
59
|
-
* const userAddress = extractAddressSafe(user?.wallet) ?? DEFAULT_ADDRESS;
|
|
60
|
-
* ```
|
|
61
|
-
*
|
|
62
|
-
* @category Utilities
|
|
63
|
-
*/
|
|
64
|
-
export declare function extractAddressSafe(account: Account | Address | undefined | null): Address | undefined;
|
|
65
|
-
/**
|
|
66
|
-
* Validates whether a value contains a valid Ethereum address.
|
|
67
|
-
*
|
|
68
|
-
* @remarks
|
|
69
|
-
* Type guard that performs runtime validation of Ethereum address format.
|
|
70
|
-
* Checks for proper `0x` prefix and 40 hexadecimal characters. Works with
|
|
71
|
-
* string addresses, Account objects, and LocalAccount instances.
|
|
72
|
-
*
|
|
73
|
-
* @param account - The value to validate for address presence
|
|
74
|
-
* @returns `true` if account contains a valid Ethereum address, `false` otherwise
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* ```typescript
|
|
78
|
-
* const maybeAccount: unknown = getUserInput();
|
|
79
|
-
*
|
|
80
|
-
* if (hasAddress(maybeAccount)) {
|
|
81
|
-
* // TypeScript knows maybeAccount is Account | Address
|
|
82
|
-
* const address = extractAddress(maybeAccount);
|
|
83
|
-
* await vana.data.getUserFiles({ owner: address });
|
|
84
|
-
* } else {
|
|
85
|
-
* console.error('Invalid address format');
|
|
86
|
-
* }
|
|
87
|
-
*
|
|
88
|
-
* // Filter valid addresses from mixed array
|
|
89
|
-
* const addresses = mixedArray.filter(hasAddress).map(extractAddress);
|
|
90
|
-
* ```
|
|
91
|
-
*
|
|
92
|
-
* @category Utilities
|
|
93
|
-
*/
|
|
94
|
-
export declare function hasAddress(account: unknown): account is Account | Address;
|
package/dist/utils/wallet.js
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
function extractAddress(account) {
|
|
2
|
-
if (!account) {
|
|
3
|
-
throw new Error("No account provided");
|
|
4
|
-
}
|
|
5
|
-
if (typeof account === "string") {
|
|
6
|
-
return account;
|
|
7
|
-
}
|
|
8
|
-
if (typeof account === "object" && "address" in account && account.address) {
|
|
9
|
-
return account.address;
|
|
10
|
-
}
|
|
11
|
-
throw new Error("Unable to determine wallet address from account");
|
|
12
|
-
}
|
|
13
|
-
function extractAddressSafe(account) {
|
|
14
|
-
try {
|
|
15
|
-
return extractAddress(account);
|
|
16
|
-
} catch {
|
|
17
|
-
return void 0;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
function hasAddress(account) {
|
|
21
|
-
if (!account) return false;
|
|
22
|
-
if (typeof account === "string") {
|
|
23
|
-
return /^0x[a-fA-F0-9]{40}$/.test(account);
|
|
24
|
-
}
|
|
25
|
-
if (typeof account === "object" && "address" in account) {
|
|
26
|
-
const accountWithAddress = account;
|
|
27
|
-
const addr = accountWithAddress.address;
|
|
28
|
-
return typeof addr === "string" && /^0x[a-fA-F0-9]{40}$/.test(addr);
|
|
29
|
-
}
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
export {
|
|
33
|
-
extractAddress,
|
|
34
|
-
extractAddressSafe,
|
|
35
|
-
hasAddress
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=wallet.js.map
|
package/dist/utils/wallet.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/wallet.ts"],"sourcesContent":["import type { Account, Address } from \"viem\";\n\n/**\n * Extracts an Ethereum address from various account formats.\n *\n * @remarks\n * Handles viem's polymorphic Account type which can be a string address,\n * an object with an address property, or a LocalAccount. This utility\n * provides consistent address extraction across the SDK, eliminating\n * duplicate logic and potential inconsistencies.\n *\n * @param account - The account to extract address from.\n * Can be a hex string address, Account object, or LocalAccount.\n * @returns The extracted Ethereum address as a `0x`-prefixed string\n *\n * @throws {Error} When account is undefined or null.\n * Provide a valid account from wallet connection.\n * @throws {Error} When address cannot be determined from account structure.\n * Ensure account has a valid address property.\n *\n * @example\n * ```typescript\n * // String address\n * const addr1 = extractAddress('0x742d35Cc6634C0532925a3b844Bc9e7595f0b0Bb');\n *\n * // Account object\n * const addr2 = extractAddress({ address: '0x742d...' });\n *\n * // LocalAccount from viem\n * const account = privateKeyToAccount('0x...');\n * const addr3 = extractAddress(account);\n * ```\n *\n * @category Utilities\n */\nexport function extractAddress(\n account: Account | Address | undefined | null,\n): Address {\n if (!account) {\n throw new Error(\"No account provided\");\n }\n\n // Handle string address directly\n if (typeof account === \"string\") {\n return account as Address;\n }\n\n // Handle object with address property\n if (typeof account === \"object\" && \"address\" in account && account.address) {\n return account.address;\n }\n\n throw new Error(\"Unable to determine wallet address from account\");\n}\n\n/**\n * Safely extracts an address without throwing errors.\n *\n * @remarks\n * Non-throwing version of `extractAddress` for optional address resolution.\n * Use when address extraction failure is acceptable and should be handled\n * gracefully without exception handling.\n *\n * @param account - The account to extract address from.\n * Can be a hex string address, Account object, LocalAccount, or nullish.\n * @returns The extracted Ethereum address or `undefined` if extraction fails\n *\n * @example\n * ```typescript\n * const address = extractAddressSafe(potentialAccount);\n *\n * if (address) {\n * console.log(`Using address: ${address}`);\n * } else {\n * console.log('No valid address available');\n * }\n *\n * // Useful in optional chaining\n * const userAddress = extractAddressSafe(user?.wallet) ?? DEFAULT_ADDRESS;\n * ```\n *\n * @category Utilities\n */\nexport function extractAddressSafe(\n account: Account | Address | undefined | null,\n): Address | undefined {\n try {\n return extractAddress(account);\n } catch {\n return undefined;\n }\n}\n\n/**\n * Validates whether a value contains a valid Ethereum address.\n *\n * @remarks\n * Type guard that performs runtime validation of Ethereum address format.\n * Checks for proper `0x` prefix and 40 hexadecimal characters. Works with\n * string addresses, Account objects, and LocalAccount instances.\n *\n * @param account - The value to validate for address presence\n * @returns `true` if account contains a valid Ethereum address, `false` otherwise\n *\n * @example\n * ```typescript\n * const maybeAccount: unknown = getUserInput();\n *\n * if (hasAddress(maybeAccount)) {\n * // TypeScript knows maybeAccount is Account | Address\n * const address = extractAddress(maybeAccount);\n * await vana.data.getUserFiles({ owner: address });\n * } else {\n * console.error('Invalid address format');\n * }\n *\n * // Filter valid addresses from mixed array\n * const addresses = mixedArray.filter(hasAddress).map(extractAddress);\n * ```\n *\n * @category Utilities\n */\nexport function hasAddress(account: unknown): account is Account | Address {\n if (!account) return false;\n\n if (typeof account === \"string\") {\n // Basic check for Ethereum address format\n return /^0x[a-fA-F0-9]{40}$/.test(account);\n }\n\n if (typeof account === \"object\" && \"address\" in account) {\n const accountWithAddress = account as { address: unknown };\n const addr = accountWithAddress.address;\n return typeof addr === \"string\" && /^0x[a-fA-F0-9]{40}$/.test(addr);\n }\n\n return false;\n}\n"],"mappings":"AAmCO,SAAS,eACd,SACS;AACT,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI,MAAM,qBAAqB;AAAA,EACvC;AAGA,MAAI,OAAO,YAAY,UAAU;AAC/B,WAAO;AAAA,EACT;AAGA,MAAI,OAAO,YAAY,YAAY,aAAa,WAAW,QAAQ,SAAS;AAC1E,WAAO,QAAQ;AAAA,EACjB;AAEA,QAAM,IAAI,MAAM,iDAAiD;AACnE;AA8BO,SAAS,mBACd,SACqB;AACrB,MAAI;AACF,WAAO,eAAe,OAAO;AAAA,EAC/B,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AA+BO,SAAS,WAAW,SAAgD;AACzE,MAAI,CAAC,QAAS,QAAO;AAErB,MAAI,OAAO,YAAY,UAAU;AAE/B,WAAO,sBAAsB,KAAK,OAAO;AAAA,EAC3C;AAEA,MAAI,OAAO,YAAY,YAAY,aAAa,SAAS;AACvD,UAAM,qBAAqB;AAC3B,UAAM,OAAO,mBAAmB;AAChC,WAAO,OAAO,SAAS,YAAY,sBAAsB,KAAK,IAAI;AAAA,EACpE;AAEA,SAAO;AACT;","names":[]}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var withEvents_exports = {};
|
|
20
|
-
__export(withEvents_exports, {
|
|
21
|
-
txForRelayed: () => txForRelayed,
|
|
22
|
-
txWithEvents: () => txWithEvents,
|
|
23
|
-
withEvents: () => withEvents
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(withEvents_exports);
|
|
26
|
-
var import_transactionHelpers = require("./transactionHelpers");
|
|
27
|
-
async function withEvents(waitFor, tx2, select) {
|
|
28
|
-
const result = await waitFor(tx2);
|
|
29
|
-
return select(result);
|
|
30
|
-
}
|
|
31
|
-
async function txWithEvents(waitFor, input, select) {
|
|
32
|
-
const txResult = (0, import_transactionHelpers.tx)(input);
|
|
33
|
-
return withEvents(waitFor, txResult, select);
|
|
34
|
-
}
|
|
35
|
-
function txForRelayed(input) {
|
|
36
|
-
return (0, import_transactionHelpers.tx)(input);
|
|
37
|
-
}
|
|
38
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
39
|
-
0 && (module.exports = {
|
|
40
|
-
txForRelayed,
|
|
41
|
-
txWithEvents,
|
|
42
|
-
withEvents
|
|
43
|
-
});
|
|
44
|
-
//# sourceMappingURL=withEvents.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/withEvents.ts"],"sourcesContent":["/**\n * Internal helper for controllers to wait for transaction events and extract data.\n * This keeps the POJO system internal while providing simple return values to developers.\n *\n * @internal\n */\n\nimport type {\n Contract,\n Fn,\n TypedTransactionResult,\n} from \"../generated/event-types\";\nimport type { TransactionResult } from \"../types/operations\";\nimport { tx } from \"./transactionHelpers\";\n\n/**\n * Waits for transaction events and transforms them into domain-specific results.\n *\n * @internal\n * @param waitFor - The waitForTransactionEvents function from context\n * @param tx - The transaction result POJO\n * @param select - Function to extract domain data from typed events\n * @returns The domain-specific result\n */\nexport async function withEvents<C extends Contract, F extends Fn<C>, Out>(\n waitFor: (\n tx: TransactionResult<C, F>,\n ) => Promise<TypedTransactionResult<C, F>>,\n tx: TransactionResult<C, F>,\n select: (result: TypedTransactionResult<C, F>) => Out,\n): Promise<Out> {\n const result = await waitFor(tx);\n return select(result);\n}\n\n/**\n * Creates a transaction result POJO and immediately waits for events.\n * Convenience wrapper that combines tx() + withEvents() for cleaner controller code.\n *\n * @internal\n * @param waitFor - The waitForTransactionEvents function from context\n * @param input - Transaction details (hash, from, contract, fn)\n * @param input.hash - Transaction hash\n * @param input.from - Transaction sender address\n * @param input.contract - Contract name\n * @param input.fn - Function name\n * @param select - Function to extract domain data from typed events\n * @returns The domain-specific result\n */\nexport async function txWithEvents<C extends Contract, F extends Fn<C>, Out>(\n waitFor: (\n tx: TransactionResult<C, F>,\n ) => Promise<TypedTransactionResult<C, F>>,\n input: {\n hash: `0x${string}`;\n from: `0x${string}`;\n contract: C;\n fn: F;\n },\n select: (result: TypedTransactionResult<C, F>) => Out,\n): Promise<Out> {\n const txResult = tx(input);\n return withEvents(waitFor, txResult, select);\n}\n\n/**\n * Helper for methods that submit transactions via relayer.\n * Returns the TransactionResult POJO for two-step processing.\n *\n * @internal\n * @param input - Transaction details\n * @param input.hash - Transaction hash\n * @param input.from - Transaction sender address\n * @param input.contract - Contract name\n * @param input.fn - Function name\n * @returns TransactionResult POJO for external waiting\n */\nexport function txForRelayed<C extends Contract, F extends Fn<C>>(input: {\n hash: `0x${string}`;\n from: `0x${string}`;\n contract: C;\n fn: F;\n}): TransactionResult<C, F> {\n return tx(input);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,gCAAmB;AAWnB,eAAsB,WACpB,SAGAA,KACA,QACc;AACd,QAAM,SAAS,MAAM,QAAQA,GAAE;AAC/B,SAAO,OAAO,MAAM;AACtB;AAgBA,eAAsB,aACpB,SAGA,OAMA,QACc;AACd,QAAM,eAAW,8BAAG,KAAK;AACzB,SAAO,WAAW,SAAS,UAAU,MAAM;AAC7C;AAcO,SAAS,aAAkD,OAKtC;AAC1B,aAAO,8BAAG,KAAK;AACjB;","names":["tx"]}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Internal helper for controllers to wait for transaction events and extract data.
|
|
3
|
-
* This keeps the POJO system internal while providing simple return values to developers.
|
|
4
|
-
*
|
|
5
|
-
* @internal
|
|
6
|
-
*/
|
|
7
|
-
import type { Contract, Fn, TypedTransactionResult } from "../generated/event-types";
|
|
8
|
-
import type { TransactionResult } from "../types/operations";
|
|
9
|
-
/**
|
|
10
|
-
* Waits for transaction events and transforms them into domain-specific results.
|
|
11
|
-
*
|
|
12
|
-
* @internal
|
|
13
|
-
* @param waitFor - The waitForTransactionEvents function from context
|
|
14
|
-
* @param tx - The transaction result POJO
|
|
15
|
-
* @param select - Function to extract domain data from typed events
|
|
16
|
-
* @returns The domain-specific result
|
|
17
|
-
*/
|
|
18
|
-
export declare function withEvents<C extends Contract, F extends Fn<C>, Out>(waitFor: (tx: TransactionResult<C, F>) => Promise<TypedTransactionResult<C, F>>, tx: TransactionResult<C, F>, select: (result: TypedTransactionResult<C, F>) => Out): Promise<Out>;
|
|
19
|
-
/**
|
|
20
|
-
* Creates a transaction result POJO and immediately waits for events.
|
|
21
|
-
* Convenience wrapper that combines tx() + withEvents() for cleaner controller code.
|
|
22
|
-
*
|
|
23
|
-
* @internal
|
|
24
|
-
* @param waitFor - The waitForTransactionEvents function from context
|
|
25
|
-
* @param input - Transaction details (hash, from, contract, fn)
|
|
26
|
-
* @param input.hash - Transaction hash
|
|
27
|
-
* @param input.from - Transaction sender address
|
|
28
|
-
* @param input.contract - Contract name
|
|
29
|
-
* @param input.fn - Function name
|
|
30
|
-
* @param select - Function to extract domain data from typed events
|
|
31
|
-
* @returns The domain-specific result
|
|
32
|
-
*/
|
|
33
|
-
export declare function txWithEvents<C extends Contract, F extends Fn<C>, Out>(waitFor: (tx: TransactionResult<C, F>) => Promise<TypedTransactionResult<C, F>>, input: {
|
|
34
|
-
hash: `0x${string}`;
|
|
35
|
-
from: `0x${string}`;
|
|
36
|
-
contract: C;
|
|
37
|
-
fn: F;
|
|
38
|
-
}, select: (result: TypedTransactionResult<C, F>) => Out): Promise<Out>;
|
|
39
|
-
/**
|
|
40
|
-
* Helper for methods that submit transactions via relayer.
|
|
41
|
-
* Returns the TransactionResult POJO for two-step processing.
|
|
42
|
-
*
|
|
43
|
-
* @internal
|
|
44
|
-
* @param input - Transaction details
|
|
45
|
-
* @param input.hash - Transaction hash
|
|
46
|
-
* @param input.from - Transaction sender address
|
|
47
|
-
* @param input.contract - Contract name
|
|
48
|
-
* @param input.fn - Function name
|
|
49
|
-
* @returns TransactionResult POJO for external waiting
|
|
50
|
-
*/
|
|
51
|
-
export declare function txForRelayed<C extends Contract, F extends Fn<C>>(input: {
|
|
52
|
-
hash: `0x${string}`;
|
|
53
|
-
from: `0x${string}`;
|
|
54
|
-
contract: C;
|
|
55
|
-
fn: F;
|
|
56
|
-
}): TransactionResult<C, F>;
|
package/dist/utils/withEvents.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { tx } from "./transactionHelpers";
|
|
2
|
-
async function withEvents(waitFor, tx2, select) {
|
|
3
|
-
const result = await waitFor(tx2);
|
|
4
|
-
return select(result);
|
|
5
|
-
}
|
|
6
|
-
async function txWithEvents(waitFor, input, select) {
|
|
7
|
-
const txResult = tx(input);
|
|
8
|
-
return withEvents(waitFor, txResult, select);
|
|
9
|
-
}
|
|
10
|
-
function txForRelayed(input) {
|
|
11
|
-
return tx(input);
|
|
12
|
-
}
|
|
13
|
-
export {
|
|
14
|
-
txForRelayed,
|
|
15
|
-
txWithEvents,
|
|
16
|
-
withEvents
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=withEvents.js.map
|