voltaire-effect 0.2.24 → 0.2.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ProviderService-BZ5pqDrD.d.ts +319 -0
- package/dist/{X25519Test-C8Cicdd_.d.ts → X25519Test-D5Q-5fL9.d.ts} +2 -4
- package/dist/crypto/index.d.ts +4 -6
- package/dist/crypto/index.js +227 -201
- package/dist/{index-DsFjN_a3.d.ts → index-BCOuszKZ.d.ts} +1 -1
- package/dist/index.d.ts +97 -44
- package/dist/index.js +5767 -5473
- package/dist/native/index.d.ts +15 -15
- package/dist/native/index.js +6948 -6654
- package/dist/primitives/index.d.ts +3 -5
- package/dist/primitives/index.js +91 -139
- package/dist/services/index.d.ts +9054 -30
- package/dist/services/index.js +1592 -1331
- package/package.json +2 -2
- package/src/crypto/ERC6492/ERC6492.test.ts +32 -14
- package/src/crypto/ERC6492/verifySignature.ts +4 -5
- package/src/crypto/Keccak256/Keccak256.test.ts +42 -1
- package/src/crypto/Keccak256/hashSync.ts +53 -0
- package/src/crypto/Keccak256/index.ts +1 -0
- package/src/index.ts +5 -0
- package/src/primitives/ContractSignature/ContractSignature.test.ts +1 -13
- package/src/primitives/ContractSignature/verifySignature.ts +88 -62
- package/src/primitives/Hex/Hex.test.ts +63 -0
- package/src/primitives/Transaction/Transaction.test.ts +309 -0
- package/src/services/Contract/Contract.test.ts +46 -41
- package/src/services/Contract/Contract.ts +25 -29
- package/src/services/Contract/ContractTypes.ts +6 -3
- package/src/services/Contract/estimateGas.test.ts +21 -9
- package/src/services/Contract/estimateGas.ts +21 -23
- package/src/services/Debug/Debug.ts +1 -1
- package/src/services/Debug/DebugService.ts +1 -1
- package/src/services/FeeEstimator/DefaultFeeEstimator.ts +10 -6
- package/src/services/FeeEstimator/FeeEstimator.test.ts +68 -62
- package/src/services/Multicall/BalanceResolver.ts +1 -1
- package/src/services/Multicall/GetBalance.ts +1 -1
- package/src/services/Multicall/Multicall.ts +1 -1
- package/src/services/NonceManager/DefaultNonceManager.ts +4 -7
- package/src/services/NonceManager/NonceManager.test.ts +20 -33
- package/src/services/Provider/Provider.test.ts +155 -349
- package/src/services/Provider/Provider.ts +14 -1180
- package/src/services/Provider/ProviderService.ts +14 -1199
- package/src/services/Provider/actions/multicall.test.ts +29 -39
- package/src/services/Provider/actions/multicall.ts +2 -2
- package/src/services/Provider/actions/readContract.test.ts +45 -50
- package/src/services/Provider/actions/readContract.ts +2 -6
- package/src/services/Provider/actions/simulateContract.test.ts +55 -232
- package/src/services/Provider/actions/simulateContract.ts +2 -3
- package/src/services/Provider/ens/getEnsAddress.ts +11 -14
- package/src/services/Provider/ens/getEnsName.ts +15 -18
- package/src/services/Provider/ens/getEnsResolver.ts +11 -14
- package/src/services/Provider/ens/getEnsText.ts +15 -18
- package/src/services/Provider/functions/backfillBlocks.ts +97 -0
- package/src/services/Provider/functions/call.ts +45 -0
- package/src/services/Provider/functions/createAccessList.ts +61 -0
- package/src/services/Provider/functions/createBlockFilter.ts +41 -0
- package/src/services/Provider/functions/createEventFilter.ts +43 -0
- package/src/services/Provider/functions/createPendingTransactionFilter.ts +41 -0
- package/src/services/Provider/functions/estimateGas.ts +52 -0
- package/src/services/Provider/functions/getAccounts.ts +40 -0
- package/src/services/Provider/functions/getBalance.ts +50 -0
- package/src/services/Provider/functions/getBlobBaseFee.ts +46 -0
- package/src/services/Provider/functions/getBlock.ts +95 -0
- package/src/services/Provider/functions/getBlockNumber.ts +51 -0
- package/src/services/Provider/functions/getBlockReceipts.ts +78 -0
- package/src/services/Provider/functions/getBlockTransactionCount.ts +86 -0
- package/src/services/Provider/functions/getChainId.ts +46 -0
- package/src/services/Provider/functions/getCode.ts +43 -0
- package/src/services/Provider/functions/getCoinbase.ts +40 -0
- package/src/services/Provider/functions/getFeeHistory.ts +85 -0
- package/src/services/Provider/functions/getFilterChanges.ts +42 -0
- package/src/services/Provider/functions/getFilterLogs.ts +44 -0
- package/src/services/Provider/functions/getGasPrice.ts +46 -0
- package/src/services/Provider/functions/getHashrate.ts +46 -0
- package/src/services/Provider/functions/getLogs.ts +45 -0
- package/src/services/Provider/functions/getMaxPriorityFeePerGas.ts +46 -0
- package/src/services/Provider/functions/getMining.ts +40 -0
- package/src/services/Provider/functions/getProof.ts +52 -0
- package/src/services/Provider/functions/getProtocolVersion.ts +40 -0
- package/src/services/Provider/functions/getStorageAt.ts +52 -0
- package/src/services/Provider/functions/getSyncing.ts +56 -0
- package/src/services/Provider/functions/getTransaction.ts +57 -0
- package/src/services/Provider/functions/getTransactionByBlockHashAndIndex.ts +73 -0
- package/src/services/Provider/functions/getTransactionByBlockNumberAndIndex.ts +86 -0
- package/src/services/Provider/functions/getTransactionConfirmations.ts +70 -0
- package/src/services/Provider/functions/getTransactionCount.ts +50 -0
- package/src/services/Provider/functions/getTransactionReceipt.ts +57 -0
- package/src/services/Provider/functions/getUncle.ts +97 -0
- package/src/services/Provider/functions/getUncleCount.ts +86 -0
- package/src/services/Provider/functions/index.ts +73 -0
- package/src/services/Provider/functions/netVersion.ts +40 -0
- package/src/services/Provider/functions/sendRawTransaction.ts +40 -0
- package/src/services/Provider/functions/sendTransaction.ts +48 -0
- package/src/services/Provider/functions/sign.ts +50 -0
- package/src/services/Provider/functions/signTransaction.ts +52 -0
- package/src/services/Provider/functions/simulateV1.ts +95 -0
- package/src/services/Provider/functions/simulateV2.ts +51 -0
- package/src/services/Provider/functions/subscribe.ts +49 -0
- package/src/services/Provider/functions/uninstallFilter.ts +40 -0
- package/src/services/Provider/functions/unsubscribe.ts +41 -0
- package/src/services/Provider/functions/waitForTransactionReceipt.ts +168 -0
- package/src/services/Provider/functions/watchBlocks.ts +98 -0
- package/src/services/Provider/index.ts +29 -178
- package/src/services/Provider/types.ts +780 -0
- package/src/services/Provider/utils.ts +204 -0
- package/src/services/RawProvider/ForkProviderTransport.ts +2 -3
- package/src/services/RawProvider/HttpProviderTransport.ts +3 -3
- package/src/services/RawProvider/InMemoryProviderTransport.ts +3 -3
- package/src/services/RawProvider/WebSocketProviderTransport.ts +3 -3
- package/src/services/Signer/Signer.test.ts +211 -187
- package/src/services/Signer/Signer.ts +26 -16
- package/src/services/Signer/actions/deployContract.test.ts +125 -105
- package/src/services/Signer/actions/deployContract.ts +3 -2
- package/src/services/Signer/actions/prepareAuthorization.test.ts +47 -48
- package/src/services/Signer/actions/prepareAuthorization.ts +3 -3
- package/src/services/Signer/actions/signAuthorization.test.ts +39 -45
- package/src/services/Signer/actions/signAuthorization.ts +3 -3
- package/src/services/Signer/actions/writeContract.test.ts +41 -57
- package/src/services/Transport/FallbackTransport.ts +3 -3
- package/src/services/Transport/HttpTransport.ts +3 -3
- package/src/services/Transport/config.ts +7 -7
- package/src/services/Transport/index.ts +3 -4
- package/src/services/errors.test.ts +3 -8
- package/src/services/index.ts +8 -90
- package/src/services/presets/index.ts +9 -10
- package/src/services/presets/presets.test.ts +14 -29
- package/src/standards/ERC165.test.ts +19 -20
- package/src/standards/ERC165.ts +9 -11
- package/src/type-exports.test.ts +37 -0
- package/dist/AccountService-BetXokad.d.ts +0 -1717
- package/dist/RpcResolver-BpvqybjD.d.ts +0 -6439
- package/src/services/Provider/Account.ts +0 -33
- package/src/services/Provider/AccountService.ts +0 -84
- package/src/services/Provider/Blocks.ts +0 -32
- package/src/services/Provider/BlocksService.ts +0 -73
- package/src/services/Provider/Events.ts +0 -33
- package/src/services/Provider/EventsService.ts +0 -71
- package/src/services/Provider/Network.ts +0 -41
- package/src/services/Provider/NetworkService.ts +0 -114
- package/src/services/Provider/Simulation.ts +0 -34
- package/src/services/Provider/SimulationService.ts +0 -161
- package/src/services/Provider/Streaming.ts +0 -30
- package/src/services/Provider/StreamingService.ts +0 -58
- package/src/services/Provider/Transaction.ts +0 -39
- package/src/services/Provider/TransactionService.ts +0 -83
- package/src/services/Provider/filters.ts +0 -91
- package/src/services/Provider/getBlobBaseFee.ts +0 -170
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { Keccak256Hash } from '@tevm/voltaire';
|
|
2
|
+
import * as Context from 'effect/Context';
|
|
3
|
+
import * as Effect from 'effect/Effect';
|
|
4
|
+
import * as Layer from 'effect/Layer';
|
|
5
|
+
import * as effect_Cause from 'effect/Cause';
|
|
6
|
+
import * as effect_Types from 'effect/Types';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* @fileoverview Keccak-256 service definition and layer implementations for Effect.
|
|
10
|
+
*
|
|
11
|
+
* @description
|
|
12
|
+
* Provides the KeccakService Effect Tag and both production (KeccakLive) and
|
|
13
|
+
* test (KeccakTest) layer implementations. The service pattern enables
|
|
14
|
+
* dependency injection for testability and flexibility.
|
|
15
|
+
*
|
|
16
|
+
* @module Keccak256/KeccakService
|
|
17
|
+
* @since 0.0.1
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Shape interface for the Keccak-256 hashing service.
|
|
22
|
+
*
|
|
23
|
+
* @description
|
|
24
|
+
* Defines the contract for Keccak-256 hash implementations.
|
|
25
|
+
* Used as the service shape for {@link KeccakService}.
|
|
26
|
+
*
|
|
27
|
+
* @since 0.0.1
|
|
28
|
+
*/
|
|
29
|
+
interface KeccakServiceShape {
|
|
30
|
+
/**
|
|
31
|
+
* Computes the Keccak-256 hash of input data.
|
|
32
|
+
*
|
|
33
|
+
* @param {Uint8Array} data - The input bytes to hash (any length)
|
|
34
|
+
* @returns {Effect.Effect<Keccak256Hash>} Effect containing the 32-byte hash
|
|
35
|
+
*/
|
|
36
|
+
readonly hash: (data: Uint8Array) => Effect.Effect<Keccak256Hash>;
|
|
37
|
+
}
|
|
38
|
+
declare const KeccakService_base: Context.TagClass<KeccakService, "KeccakService", KeccakServiceShape>;
|
|
39
|
+
/**
|
|
40
|
+
* Keccak-256 hashing service for Effect-based applications.
|
|
41
|
+
*
|
|
42
|
+
* @description
|
|
43
|
+
* An Effect Context.Tag that provides the standard Ethereum hashing algorithm
|
|
44
|
+
* used for addresses, signatures, state roots, and more. The service pattern
|
|
45
|
+
* enables swapping implementations for testing or alternative backends.
|
|
46
|
+
*
|
|
47
|
+
* The service exposes a single `hash` method that takes arbitrary bytes and
|
|
48
|
+
* produces a 32-byte Keccak-256 hash.
|
|
49
|
+
*
|
|
50
|
+
* @example Basic usage with Effect.gen
|
|
51
|
+
* ```typescript
|
|
52
|
+
* import { KeccakService, KeccakLive } from 'voltaire-effect/crypto/Keccak256'
|
|
53
|
+
* import * as Effect from 'effect/Effect'
|
|
54
|
+
*
|
|
55
|
+
* const program = Effect.gen(function* () {
|
|
56
|
+
* const keccak = yield* KeccakService
|
|
57
|
+
* return yield* keccak.hash(new Uint8Array([1, 2, 3]))
|
|
58
|
+
* }).pipe(Effect.provide(KeccakLive))
|
|
59
|
+
*
|
|
60
|
+
* const hash = await Effect.runPromise(program)
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example Chaining multiple hashes
|
|
64
|
+
* ```typescript
|
|
65
|
+
* import { KeccakService, KeccakLive } from 'voltaire-effect/crypto/Keccak256'
|
|
66
|
+
* import * as Effect from 'effect/Effect'
|
|
67
|
+
*
|
|
68
|
+
* const doubleHash = Effect.gen(function* () {
|
|
69
|
+
* const keccak = yield* KeccakService
|
|
70
|
+
* const first = yield* keccak.hash(new Uint8Array([1, 2, 3]))
|
|
71
|
+
* return yield* keccak.hash(first)
|
|
72
|
+
* }).pipe(Effect.provide(KeccakLive))
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @example Composing with other services
|
|
76
|
+
* ```typescript
|
|
77
|
+
* import { KeccakService, KeccakLive } from 'voltaire-effect/crypto/Keccak256'
|
|
78
|
+
* import { Secp256k1Service, Secp256k1Live } from 'voltaire-effect/crypto/Secp256k1'
|
|
79
|
+
* import * as Effect from 'effect/Effect'
|
|
80
|
+
* import * as Layer from 'effect/Layer'
|
|
81
|
+
*
|
|
82
|
+
* const program = Effect.gen(function* () {
|
|
83
|
+
* const keccak = yield* KeccakService
|
|
84
|
+
* const secp = yield* Secp256k1Service
|
|
85
|
+
* const msgHash = yield* keccak.hash(message)
|
|
86
|
+
* return yield* secp.sign(msgHash, privateKey)
|
|
87
|
+
* }).pipe(Effect.provide(Layer.merge(KeccakLive, Secp256k1Live)))
|
|
88
|
+
* ```
|
|
89
|
+
*
|
|
90
|
+
* @see {@link KeccakLive} - Production implementation
|
|
91
|
+
* @see {@link KeccakTest} - Test implementation
|
|
92
|
+
* @see {@link hash} - Standalone hash function
|
|
93
|
+
* @since 0.0.1
|
|
94
|
+
*/
|
|
95
|
+
declare class KeccakService extends KeccakService_base {
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Production layer for KeccakService using native Keccak-256 implementation.
|
|
99
|
+
*
|
|
100
|
+
* @description
|
|
101
|
+
* Provides the real Keccak-256 hash implementation from the voltaire library.
|
|
102
|
+
* Use this layer in production applications for cryptographically secure hashing.
|
|
103
|
+
*
|
|
104
|
+
* The underlying implementation uses optimized native code (Zig/Rust) for
|
|
105
|
+
* high-performance hashing.
|
|
106
|
+
*
|
|
107
|
+
* @example Providing the live layer
|
|
108
|
+
* ```typescript
|
|
109
|
+
* import { KeccakService, KeccakLive } from 'voltaire-effect/crypto/Keccak256'
|
|
110
|
+
* import * as Effect from 'effect/Effect'
|
|
111
|
+
*
|
|
112
|
+
* const program = Effect.gen(function* () {
|
|
113
|
+
* const keccak = yield* KeccakService
|
|
114
|
+
* return yield* keccak.hash(new Uint8Array([0xde, 0xad, 0xbe, 0xef]))
|
|
115
|
+
* })
|
|
116
|
+
*
|
|
117
|
+
* const result = await Effect.runPromise(program.pipe(Effect.provide(KeccakLive)))
|
|
118
|
+
* ```
|
|
119
|
+
*
|
|
120
|
+
* @example Merging with other layers
|
|
121
|
+
* ```typescript
|
|
122
|
+
* import { KeccakLive } from 'voltaire-effect/crypto/Keccak256'
|
|
123
|
+
* import { SHA256Live } from 'voltaire-effect/crypto/SHA256'
|
|
124
|
+
* import * as Layer from 'effect/Layer'
|
|
125
|
+
*
|
|
126
|
+
* const CryptoLive = Layer.merge(KeccakLive, SHA256Live)
|
|
127
|
+
* ```
|
|
128
|
+
*
|
|
129
|
+
* @see {@link KeccakService} - The service tag
|
|
130
|
+
* @see {@link KeccakTest} - Test implementation for unit tests
|
|
131
|
+
* @since 0.0.1
|
|
132
|
+
*/
|
|
133
|
+
declare const KeccakLive: Layer.Layer<KeccakService, never, never>;
|
|
134
|
+
/**
|
|
135
|
+
* Test layer for KeccakService returning deterministic zero-filled hashes.
|
|
136
|
+
*
|
|
137
|
+
* @description
|
|
138
|
+
* Provides a mock Keccak-256 implementation that always returns a 32-byte
|
|
139
|
+
* array filled with zeros. Use for unit testing without cryptographic overhead
|
|
140
|
+
* when the actual hash value doesn't matter for the test.
|
|
141
|
+
*
|
|
142
|
+
* This layer is useful for:
|
|
143
|
+
* - Unit tests that need deterministic output
|
|
144
|
+
* - Performance tests that want to isolate non-crypto logic
|
|
145
|
+
* - Tests where the hash value is not validated
|
|
146
|
+
*
|
|
147
|
+
* @example Using in tests
|
|
148
|
+
* ```typescript
|
|
149
|
+
* import { KeccakService, KeccakTest } from 'voltaire-effect/crypto/Keccak256'
|
|
150
|
+
* import * as Effect from 'effect/Effect'
|
|
151
|
+
* import { describe, it, expect } from 'vitest'
|
|
152
|
+
*
|
|
153
|
+
* describe('MyService', () => {
|
|
154
|
+
* it('should hash data', async () => {
|
|
155
|
+
* const program = Effect.gen(function* () {
|
|
156
|
+
* const keccak = yield* KeccakService
|
|
157
|
+
* return yield* keccak.hash(new Uint8Array([1, 2, 3]))
|
|
158
|
+
* })
|
|
159
|
+
*
|
|
160
|
+
* const result = await Effect.runPromise(program.pipe(Effect.provide(KeccakTest)))
|
|
161
|
+
* expect(result).toEqual(new Uint8Array(32)) // All zeros
|
|
162
|
+
* })
|
|
163
|
+
* })
|
|
164
|
+
* ```
|
|
165
|
+
*
|
|
166
|
+
* @see {@link KeccakService} - The service tag
|
|
167
|
+
* @see {@link KeccakLive} - Production implementation
|
|
168
|
+
* @since 0.0.1
|
|
169
|
+
*/
|
|
170
|
+
declare const KeccakTest: Layer.Layer<KeccakService, never, never>;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* @fileoverview Transport error class for JSON-RPC communication failures.
|
|
174
|
+
*
|
|
175
|
+
* @module TransportError
|
|
176
|
+
* @since 0.0.1
|
|
177
|
+
*
|
|
178
|
+
* @description
|
|
179
|
+
* Defines the error type used by all transport implementations when JSON-RPC
|
|
180
|
+
* communication fails. The error includes the JSON-RPC error code, message,
|
|
181
|
+
* and optional additional data for debugging.
|
|
182
|
+
*
|
|
183
|
+
* Common JSON-RPC error codes:
|
|
184
|
+
* - -32700: Parse error
|
|
185
|
+
* - -32600: Invalid request
|
|
186
|
+
* - -32601: Method not found
|
|
187
|
+
* - -32602: Invalid params
|
|
188
|
+
* - -32603: Internal error
|
|
189
|
+
* - -32000 to -32099: Server errors (implementation-defined)
|
|
190
|
+
*
|
|
191
|
+
* @see {@link TransportService} - The service that uses this error type
|
|
192
|
+
*/
|
|
193
|
+
declare const TransportError_base: new <A extends Record<string, any> = {}>(args: effect_Types.Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => effect_Cause.YieldableError & {
|
|
194
|
+
readonly _tag: "TransportError";
|
|
195
|
+
} & Readonly<A>;
|
|
196
|
+
/**
|
|
197
|
+
* Error thrown when a transport operation fails.
|
|
198
|
+
*
|
|
199
|
+
* @description
|
|
200
|
+
* Contains JSON-RPC error code and optional data for debugging.
|
|
201
|
+
* This error is thrown by all transport implementations (HttpTransport,
|
|
202
|
+
* WebSocketTransport, BrowserTransport) when a JSON-RPC request fails.
|
|
203
|
+
*
|
|
204
|
+
* The error includes:
|
|
205
|
+
* - `code`: Standard JSON-RPC error code
|
|
206
|
+
* - `message`: Human-readable error description
|
|
207
|
+
* - `data`: Optional additional error data from the provider
|
|
208
|
+
*
|
|
209
|
+
* @since 0.0.1
|
|
210
|
+
*
|
|
211
|
+
* @example Creating a transport error
|
|
212
|
+
* ```typescript
|
|
213
|
+
* const error = new TransportError({
|
|
214
|
+
* code: -32603,
|
|
215
|
+
* message: 'Internal error',
|
|
216
|
+
* data: { details: 'Connection refused' }
|
|
217
|
+
* })
|
|
218
|
+
*
|
|
219
|
+
* console.log(error.code) // -32603
|
|
220
|
+
* console.log(error.message) // 'Internal error'
|
|
221
|
+
* console.log(error.data) // { details: 'Connection refused' }
|
|
222
|
+
* ```
|
|
223
|
+
*
|
|
224
|
+
* @example Handling transport errors in Effect
|
|
225
|
+
* ```typescript
|
|
226
|
+
* import { Effect } from 'effect'
|
|
227
|
+
* import { TransportService, TransportError, HttpTransport } from 'voltaire-effect'
|
|
228
|
+
*
|
|
229
|
+
* const program = Effect.gen(function* () {
|
|
230
|
+
* const transport = yield* TransportService
|
|
231
|
+
* return yield* transport.request<string>('eth_blockNumber')
|
|
232
|
+
* }).pipe(
|
|
233
|
+
* Effect.catchTag('TransportError', (error) => {
|
|
234
|
+
* if (error.code === -32601) {
|
|
235
|
+
* console.log('Method not supported by this node')
|
|
236
|
+
* }
|
|
237
|
+
* return Effect.fail(error)
|
|
238
|
+
* }),
|
|
239
|
+
* Effect.provide(HttpTransport('https://mainnet.infura.io/v3/YOUR_KEY'))
|
|
240
|
+
* )
|
|
241
|
+
* ```
|
|
242
|
+
*
|
|
243
|
+
* @see {@link TransportService} - The service that produces this error
|
|
244
|
+
*/
|
|
245
|
+
declare class TransportError extends TransportError_base<{
|
|
246
|
+
/**
|
|
247
|
+
* The original input that caused the error.
|
|
248
|
+
*/
|
|
249
|
+
readonly input: {
|
|
250
|
+
code: number;
|
|
251
|
+
message: string;
|
|
252
|
+
data?: unknown;
|
|
253
|
+
};
|
|
254
|
+
/**
|
|
255
|
+
* JSON-RPC error code.
|
|
256
|
+
*/
|
|
257
|
+
readonly code: number;
|
|
258
|
+
/**
|
|
259
|
+
* Human-readable error message.
|
|
260
|
+
*/
|
|
261
|
+
readonly message: string;
|
|
262
|
+
/**
|
|
263
|
+
* Additional error data from the JSON-RPC response.
|
|
264
|
+
*
|
|
265
|
+
* @description
|
|
266
|
+
* May contain provider-specific error details such as revert reasons,
|
|
267
|
+
* stack traces, or other debugging information.
|
|
268
|
+
*/
|
|
269
|
+
readonly data?: unknown;
|
|
270
|
+
/**
|
|
271
|
+
* Optional underlying cause.
|
|
272
|
+
*/
|
|
273
|
+
readonly cause?: unknown;
|
|
274
|
+
/**
|
|
275
|
+
* Optional context for debugging.
|
|
276
|
+
*/
|
|
277
|
+
readonly context?: Record<string, unknown>;
|
|
278
|
+
}> {
|
|
279
|
+
/**
|
|
280
|
+
* Creates a new TransportError.
|
|
281
|
+
*
|
|
282
|
+
* @param input - JSON-RPC error response containing code, message, and optional data
|
|
283
|
+
* @param message - Optional override for the error message
|
|
284
|
+
* @param options - Optional error options
|
|
285
|
+
* @param options.cause - Underlying error that caused this failure
|
|
286
|
+
*/
|
|
287
|
+
constructor(input: {
|
|
288
|
+
code: number;
|
|
289
|
+
message: string;
|
|
290
|
+
data?: unknown;
|
|
291
|
+
}, message?: string, options?: {
|
|
292
|
+
cause?: unknown;
|
|
293
|
+
context?: Record<string, unknown>;
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* @fileoverview Minimal Provider service for blockchain JSON-RPC operations.
|
|
299
|
+
*
|
|
300
|
+
* @module ProviderService
|
|
301
|
+
* @since 0.0.1
|
|
302
|
+
*/
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Minimal provider shape - only the request method.
|
|
306
|
+
* All operations are exposed as free functions that use this internally.
|
|
307
|
+
*/
|
|
308
|
+
type ProviderShape = {
|
|
309
|
+
readonly request: <T>(method: string, params?: unknown[]) => Effect.Effect<T, TransportError>;
|
|
310
|
+
};
|
|
311
|
+
declare const ProviderService_base: Context.TagClass<ProviderService, "ProviderService", ProviderShape>;
|
|
312
|
+
/**
|
|
313
|
+
* Provider service for blockchain JSON-RPC operations.
|
|
314
|
+
* Use free functions (getBalance, getBlock, call, etc.) for operations.
|
|
315
|
+
*/
|
|
316
|
+
declare class ProviderService extends ProviderService_base {
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
export { KeccakService as K, ProviderService as P, TransportError as T, type ProviderShape as a, KeccakLive as b, KeccakTest as c, type KeccakServiceShape as d };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _tevm_voltaire from '@tevm/voltaire';
|
|
2
2
|
import { Keccak256Hash, Blake2Hash, SHA256Hash, Ripemd160Hash, KzgBlobType, KzgCommitmentType, KzgProofType } from '@tevm/voltaire';
|
|
3
3
|
import * as Effect from 'effect/Effect';
|
|
4
|
-
import {
|
|
4
|
+
import { K as KeccakService, P as ProviderService } from './ProviderService-BZ5pqDrD.js';
|
|
5
5
|
import { HashType } from '@tevm/voltaire/Hash';
|
|
6
6
|
import { Secp256k1SignatureType, Secp256k1PublicKeyType } from '@tevm/voltaire/Secp256k1';
|
|
7
7
|
import { c as InvalidSignatureError, b as InvalidRecoveryIdError, d as Secp256k1Error, S as Secp256k1Service, g as SignOptions, I as InvalidPrivateKeyError, a as InvalidPublicKeyError } from './Secp256k1Service-OxQ6hJFp.js';
|
|
@@ -3879,7 +3879,6 @@ declare const unwrapSignature: (signature: HexType | `0x${string}`) => Effect.Ef
|
|
|
3879
3879
|
* @param params.address - Expected signer address
|
|
3880
3880
|
* @param params.message - 32-byte message hash
|
|
3881
3881
|
* @param params.signature - Signature bytes (may be ERC-6492 wrapped)
|
|
3882
|
-
* @param params.provider - Provider service used for eth_call
|
|
3883
3882
|
* @returns Effect containing true if signature is valid
|
|
3884
3883
|
*
|
|
3885
3884
|
* @since 0.2.14
|
|
@@ -3888,8 +3887,7 @@ declare const verifySignature: (params: {
|
|
|
3888
3887
|
address: AddressType | `0x${string}`;
|
|
3889
3888
|
message: HexType | `0x${string}`;
|
|
3890
3889
|
signature: HexType | `0x${string}`;
|
|
3891
|
-
|
|
3892
|
-
}) => Effect.Effect<boolean, VerifyError>;
|
|
3890
|
+
}) => Effect.Effect<boolean, VerifyError, ProviderService>;
|
|
3893
3891
|
|
|
3894
3892
|
/**
|
|
3895
3893
|
* @fileoverview Wrap signatures for ERC-6492 counterfactual validation.
|
package/dist/crypto/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { h as SignatureInput, j as RecoverError, A as AddressDerivationError, V as VerifyError, E as EIP712Service } from '../X25519Test-
|
|
2
|
-
export { k as AesGcmLive, l as AesGcmService, m as AesGcmServiceShape, n as AesGcmTest, s as Bip39Live, B as Bip39Service, t as Bip39ServiceShape, u as Bip39Test, D as Blake2Live, a as Blake2Service, F as Blake2Test, J as Bls12381Live, b as Bls12381Service, L as Bls12381ServiceShape, O as Bn254Error, Q as Bn254Live, c as Bn254Service, T as Bn254ServiceShape, U as Bn254Test, a1 as ChaCha20Poly1305Live, C as ChaCha20Poly1305Service, a2 as ChaCha20Poly1305ServiceShape, a3 as ChaCha20Poly1305Test, f as CryptoLive, g as CryptoTest, ae as EIP712Live, af as EIP712ServiceShape, ag as EIP712Test, a8 as Ed25519Live, d as Ed25519Service, a9 as Ed25519ServiceShape, aa as Ed25519Test, ax as HDNode, ay as HDPath, az as HDWalletError, e as HDWalletService, aA as HDWalletServiceShape, aB as HDWalletTest, aI as HMACLive, H as HMACService, aJ as HMACServiceShape, aK as HMACTest, aw as HardenedDerivationError, aC as InvalidKeyError, aD as InvalidPathError, aE as InvalidSeedError, aO as KeystoreDecryptError, aR as KeystoreLive, K as KeystoreService, aS as KeystoreServiceShape, aT as KeystoreTest, aZ as ModExpLive, a_ as ModExpService, a$ as ModExpServiceShape, b0 as ModExpTest, b3 as P256Live, P as P256Service, b4 as P256ServiceShape, b8 as Ripemd160Live, R as Ripemd160Service, b9 as Ripemd160Test, bb as SHA256Live, S as SHA256Service, bc as SHA256Test, bn as Secp256k1Live, bo as Secp256k1Test, be as SignatureError, bi as X25519Live, bj as X25519Service, bk as X25519ServiceShape, bl as X25519Test, o as aesGcmDecrypt, p as aesGcmEncrypt, q as aesGcmGenerateKey, r as aesGcmGenerateNonce, v as bip39GenerateMnemonic, x as bip39MnemonicToSeed, G as blake2Hash, aV as blobToKzgCommitment, I as bls12381Aggregate, M as bls12381Sign, N as bls12381Verify, a4 as chaCha20Poly1305Decrypt, a5 as chaCha20Poly1305Encrypt, a6 as chaCha20Poly1305GenerateKey, a7 as chaCha20Poly1305GenerateNonce, aW as computeBlobKzgProof, ab as ed25519GetPublicKey, ac as ed25519Sign, ad as ed25519Verify, ak as eip712RecoverAddress, an as erc6492UnwrapSignature, ao as erc6492VerifySignature, ap as erc6492WrapSignature, ar as fromMnemonic, as as fromSeed, W as g1Add, X as g1Generator, Y as g1Mul, Z as g2Add, _ as g2Generator, $ as g2Mul, at as generateMnemonic, w as getWordCount, ah as hashDomain, ai as hashStruct, aj as hashTypedData, aq as hdwalletDerive, au as hdwalletGetPrivateKey, av as hdwalletGetPublicKey, aG as hdwalletWithPrivateKey, aH as hdwalletWithSeed, aL as hmacSha256, aM as hmacSha512, aN as keccakHash, aP as keystoreDecrypt, aQ as keystoreEncrypt, aU as keystoreWithDecryptedKey, aF as mnemonicToSeed, y as mnemonicToSeedSync, b1 as modexp, b2 as modexpBytes, aY as modexpCalculateGas, b5 as p256Sign, b6 as p256Verify, a0 as pairingCheck, bm as recover, bd as recoverAddress, b7 as ripemd160Hash, ba as sha256Hash, bp as sign, al as signTypedData, aj as signatureHashTypedData, z as validateMnemonic, bq as verify, aX as verifyBlobKzgProof, am as verifyTypedData, bf as x25519ComputeSecret, bg as x25519GenerateKeyPair, bh as x25519GetPublicKey } from '../X25519Test-
|
|
3
|
-
import {
|
|
4
|
-
export {
|
|
1
|
+
import { h as SignatureInput, j as RecoverError, A as AddressDerivationError, V as VerifyError, E as EIP712Service } from '../X25519Test-D5Q-5fL9.js';
|
|
2
|
+
export { k as AesGcmLive, l as AesGcmService, m as AesGcmServiceShape, n as AesGcmTest, s as Bip39Live, B as Bip39Service, t as Bip39ServiceShape, u as Bip39Test, D as Blake2Live, a as Blake2Service, F as Blake2Test, J as Bls12381Live, b as Bls12381Service, L as Bls12381ServiceShape, O as Bn254Error, Q as Bn254Live, c as Bn254Service, T as Bn254ServiceShape, U as Bn254Test, a1 as ChaCha20Poly1305Live, C as ChaCha20Poly1305Service, a2 as ChaCha20Poly1305ServiceShape, a3 as ChaCha20Poly1305Test, f as CryptoLive, g as CryptoTest, ae as EIP712Live, af as EIP712ServiceShape, ag as EIP712Test, a8 as Ed25519Live, d as Ed25519Service, a9 as Ed25519ServiceShape, aa as Ed25519Test, ax as HDNode, ay as HDPath, az as HDWalletError, e as HDWalletService, aA as HDWalletServiceShape, aB as HDWalletTest, aI as HMACLive, H as HMACService, aJ as HMACServiceShape, aK as HMACTest, aw as HardenedDerivationError, aC as InvalidKeyError, aD as InvalidPathError, aE as InvalidSeedError, aO as KeystoreDecryptError, aR as KeystoreLive, K as KeystoreService, aS as KeystoreServiceShape, aT as KeystoreTest, aZ as ModExpLive, a_ as ModExpService, a$ as ModExpServiceShape, b0 as ModExpTest, b3 as P256Live, P as P256Service, b4 as P256ServiceShape, b8 as Ripemd160Live, R as Ripemd160Service, b9 as Ripemd160Test, bb as SHA256Live, S as SHA256Service, bc as SHA256Test, bn as Secp256k1Live, bo as Secp256k1Test, be as SignatureError, bi as X25519Live, bj as X25519Service, bk as X25519ServiceShape, bl as X25519Test, o as aesGcmDecrypt, p as aesGcmEncrypt, q as aesGcmGenerateKey, r as aesGcmGenerateNonce, v as bip39GenerateMnemonic, x as bip39MnemonicToSeed, G as blake2Hash, aV as blobToKzgCommitment, I as bls12381Aggregate, M as bls12381Sign, N as bls12381Verify, a4 as chaCha20Poly1305Decrypt, a5 as chaCha20Poly1305Encrypt, a6 as chaCha20Poly1305GenerateKey, a7 as chaCha20Poly1305GenerateNonce, aW as computeBlobKzgProof, ab as ed25519GetPublicKey, ac as ed25519Sign, ad as ed25519Verify, ak as eip712RecoverAddress, an as erc6492UnwrapSignature, ao as erc6492VerifySignature, ap as erc6492WrapSignature, ar as fromMnemonic, as as fromSeed, W as g1Add, X as g1Generator, Y as g1Mul, Z as g2Add, _ as g2Generator, $ as g2Mul, at as generateMnemonic, w as getWordCount, ah as hashDomain, ai as hashStruct, aj as hashTypedData, aq as hdwalletDerive, au as hdwalletGetPrivateKey, av as hdwalletGetPublicKey, aG as hdwalletWithPrivateKey, aH as hdwalletWithSeed, aL as hmacSha256, aM as hmacSha512, aN as keccakHash, aP as keystoreDecrypt, aQ as keystoreEncrypt, aU as keystoreWithDecryptedKey, aF as mnemonicToSeed, y as mnemonicToSeedSync, b1 as modexp, b2 as modexpBytes, aY as modexpCalculateGas, b5 as p256Sign, b6 as p256Verify, a0 as pairingCheck, bm as recover, bd as recoverAddress, b7 as ripemd160Hash, ba as sha256Hash, bp as sign, al as signTypedData, aj as signatureHashTypedData, z as validateMnemonic, bq as verify, aX as verifyBlobKzgProof, am as verifyTypedData, bf as x25519ComputeSecret, bg as x25519GenerateKeyPair, bh as x25519GetPublicKey } from '../X25519Test-D5Q-5fL9.js';
|
|
3
|
+
import { K as KeccakService } from '../ProviderService-BZ5pqDrD.js';
|
|
4
|
+
export { b as KeccakLive, c as KeccakTest } from '../ProviderService-BZ5pqDrD.js';
|
|
5
5
|
import { Keccak256Hash } from '@tevm/voltaire';
|
|
6
6
|
import * as Effect from 'effect/Effect';
|
|
7
7
|
export { a as KZGError, b as KZGLive, K as KZGService, c as KZGServiceShape, d as KZGTest } from '../KZGService-B7PJerOb.js';
|
|
@@ -23,8 +23,6 @@ import '@tevm/voltaire/HMAC';
|
|
|
23
23
|
import '@tevm/voltaire/Keystore';
|
|
24
24
|
import '@tevm/voltaire/P256';
|
|
25
25
|
import '@tevm/voltaire/X25519';
|
|
26
|
-
import '@tevm/voltaire/block';
|
|
27
|
-
import 'effect/Stream';
|
|
28
26
|
|
|
29
27
|
/**
|
|
30
28
|
* @fileoverview Constant-time comparison utility for cryptographic operations.
|