voltaire-effect 1.0.0 → 1.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.
@@ -0,0 +1,203 @@
1
+ export { AddressType, BrandedAddress } from '@tevm/voltaire/Address';
2
+ export { Hex as HexBrand, HexType, Sized } from '@tevm/voltaire/Hex';
3
+ export { HashType } from '@tevm/voltaire/Hash';
4
+ export { AbstractError, CryptoError, DecodingError, EncodingError, IntegerOverflowError, IntegerUnderflowError, InvalidChecksumError, InvalidFormatError, InvalidLengthError, InvalidPrivateKeyError, InvalidPublicKeyError, InvalidRangeError, InvalidSignatureError, InvalidSignerError, InvalidSizeError, InvalidTransactionTypeError, PrimitiveError, SerializationError, TransactionError, ValidationError } from '@tevm/voltaire/errors';
5
+ export { Auth, BackfillStreamOptions, Bip39, Blake2, BlockUtils, Bls12381, Bn254, ChaCha20Poly1305, EIP712, ERC1155, ERC165, ERC20, ERC6492, ERC721, Ed25519, EventStream, EventStreamError, EventStreamService, EventStreamShape, HDWallet, HMAC, JsonRpc, KZG, Keccak256, Keystore, ModExp, P256, Ripemd160, SHA256, Secp256k1, Signers, StandardsError, Stream, Unit, WatchStreamOptions, X25519, makeEventStream } from '../index.js';
6
+ import { E as EIP712Service, B as Bip39Service, a as Blake2Service, b as Bls12381Service, c as Bn254Service, C as ChaCha20Poly1305Service, d as Ed25519Service, H as HMACService, K as KeystoreService, P as P256Service, R as Ripemd160Service, S as SHA256Service, e as HDWalletService } from '../X25519Test-avt1DUgp.js';
7
+ export { i as AesGcm, f as CryptoLive, g as CryptoTest } from '../X25519Test-avt1DUgp.js';
8
+ export { i as Abi, a as AccessList, b as AccountState, c as Address, d as Authorization, e as Balance, f as Base64, g as BaseFeePerGas, h as BeaconBlockRoot, j as BinaryTree, k as Blob, l as Block, m as BlockBody, n as BlockFilter, o as BlockHash, p as BlockHeader, q as BlockNumber, r as BloomFilter, s as BuilderBid, t as Bundle, u as BundleHash, v as Bundler, w as Bytecode, x as Bytes, y as Bytes32, z as CallData, A as CallTrace, B as Chain, C as ChainHead, D as ChainId, E as CompilerVersion, F as ContractCode, G as ContractResult, H as ContractSignature, I as DecodedData, J as Denomination, K as Domain, L as DomainSeparator, M as EffectiveGasPrice, N as EncodedData, O as Ens, P as EntryPoint, Q as Epoch, R as ErrorSignature, S as EventLog, T as EventSignature, U as FeeMarket, V as FeeOracle, W as FilterId, X as ForkId, Y as ForwardRequest, Z as FunctionSignature, _ as Gas, $ as GasConstants, a0 as GasCosts, a1 as GasEstimate, a2 as GasPrice, a3 as GasRefund, a4 as GasUsed, a5 as Hardfork, a6 as Hash, a7 as Hex, a8 as InitCode, ad as Int128, aa as Int16, ae as Int256, ab as Int32, ac as Int64, a9 as Int8, af as License, ag as LogFilter, ah as LogIndex, ai as MaxFeePerGas, aj as MaxPriorityFeePerGas, ak as MemoryDump, al as MerkleTree, am as Metadata, an as MultiTokenId, ao as NetworkId, ap as NodeInfo, aq as Nonce, as as OpStep, ar as Opcode, at as PackedUserOperation, au as Paymaster, av as PeerId, aw as PeerInfo, ax as PendingTransactionFilter, ay as Permit, az as PrivateKey, aA as Proof, aB as ProtocolVersion, aC as Proxy, aD as PublicKey, aE as Receipt, aF as RelayData, aG as ReturnData, aH as RevertReason, aI as Rlp, aJ as RuntimeCode, aK as Selector, aL as Signature, aM as SignedData, aN as Siwe, aO as Slot, aP as SourceMap, aQ as Ssz, aR as State, aS as StateDiff, aT as StateProof, aU as StateRoot, aV as StealthAddress, aW as Storage, aX as StorageDiff, aY as StorageProof, aZ as StorageValue, a_ as StructLog, a$ as SyncStatus, b0 as TokenBalance, b1 as TokenId, b2 as TopicFilter, b3 as TraceConfig, b4 as TraceResult, b5 as Transaction, b6 as TransactionHash, b7 as TransactionIndex, b8 as TransactionStatus, b9 as TransactionUrl, ba as TypedData, bb as U256, bc as Uint, bh as Uint128, be as Uint16, bf as Uint32, bg as Uint64, bd as Uint8, bi as Uncle, bj as UserOperation, bk as ValidatorIndex, bl as Withdrawal, bm as WithdrawalIndex } from '../index-DxwZo3xo.js';
9
+ import { AccountService } from '../services/index.js';
10
+ export { AbiDecodeError, AbiEncodeError, AbiEncoderService, AbiEncoderShape, AbiResolution, AccessListInput, AccessListType, AccountError, AccountShape, AccountStateOverride, AddressInput, ArbitrumFormatter, ArbitrumProvider, AssetChange, BackfillBlocksError, BalanceResolver, BaseProvider, BlockExplorerApi, BlockExplorerApiConfig, BlockExplorerApiError, BlockExplorerApiService, BlockExplorerApiShape, BlockExplorerConfig, BlockExplorerConfigError, BlockExplorerDecodeError, BlockExplorerNotFoundError, BlockExplorerProxyResolutionError, BlockExplorerRateLimitError, BlockExplorerResponseError, BlockExplorerService, BlockExplorerUnexpectedError, BlockOverrides, BlockStream, BlockStreamError, BlockStreamService, BlockStreamShape, BlockTag, BlockType, BlockchainError, BlockchainHexInput, BlockchainService, BlockchainShape, BrowserProvider, BrowserTransport, CacheService, CacheShape, CallError, CallRequest, CcipError, CcipRequest, CcipService, CcipShape, ChainConfig, ChainContract, ChainService, ComposedServices, Contract, ContractAbi, ContractAbiItem, ContractBlockTag, ContractCall, ContractCallError, ContractDef, ContractError, ContractEventError, ContractFactory, ContractInstance, ContractRegistryBase, ContractRegistryConfig, ContractRegistryService, ContractRegistryShape, ContractSourceFile, ContractWriteError, ContractsConfig, ContractsService, CreateAccessListError, CreateAccessListResult, CreateBlockFilterError, CreateEventFilterError, CreatePendingTransactionFilterError, CustomTransport, CustomTransportConfig, CustomTransportFromFn, Debug, DebugService, DebugShape, DebugTraceConfig, DecodedEvent, DefaultAbiEncoder, DefaultCcip, DefaultEns, DefaultFeeEstimator, DefaultFormatter, DefaultKzg, DefaultNonceManager, DefaultRateLimiter, DefaultTransactionSerializer, DeserializeError, EIP1193Provider, ENS_REGISTRY_ADDRESS, ENS_UNIVERSAL_RESOLVER_ADDRESS, EngineApi, EngineApiService, EngineApiShape, EnsError, EnsService, EnsShape, EstimateGasError, EthBlockNumber, EthCall, EthChainId, EthEstimateGas, EthGasPrice, EthGetBalance, EthGetBlockByHash, EthGetBlockByNumber, EthGetCode, EthGetLogs, EthGetStorageAt, EthGetTransactionByHash, EthGetTransactionCount, EthGetTransactionReceipt, EventFilter, ExplorerAbiItem, ExplorerContractInstance, ExplorerSourceId, FeeEstimationError, FeeEstimatorService, FeeEstimatorShape, FeeHistoryType, FeeValues, FeeValuesEIP1559, FeeValuesLegacy, FilterChanges, ForkBlockchain, ForkBlockchainOptions, FormatError, FormatterService, FormatterShape, GenericRpcRequest, GetAbiOptions, GetAccountsError, GetBalance, GetBalanceError, GetBlobBaseFeeError, GetBlockArgs, GetBlockError, GetBlockNumberError, GetBlockReceiptsArgs, GetBlockReceiptsError, GetBlockTransactionCountArgs, GetBlockTransactionCountError, GetChainIdError, GetCodeError, GetCoinbaseError, GetContractOptions, GetEnsAddressParams, GetEnsAvatarParams, GetEnsNameParams, GetEnsResolverParams, GetEnsTextParams, GetFeeHistoryError, GetFilterChangesError, GetFilterLogsError, GetGasPriceError, GetHashrateError, GetLogsError, GetMaxPriorityFeePerGasError, GetMiningError, GetProofError, GetProtocolVersionError, GetSourcesOptions, GetStorageAtError, GetSyncingError, GetTransactionByBlockHashAndIndexError, GetTransactionByBlockNumberAndIndexError, GetTransactionConfirmationsError, GetTransactionCountError, GetTransactionError, GetTransactionReceiptError, GetUncleArgs, GetUncleCountArgs, GetUncleCountError, GetUncleError, GetWorkError, HashInput, HttpProvider, HttpProviderFetch, HttpTransport, IdGenerator, IdGeneratorLive, IdGeneratorShape, InMemoryBlockchain, InferContractRegistry, IpcProvider, JsonRpcAccount, KzgError, KzgService, KzgShape, LocalAccount, LogType, MULTICALL3_ADDRESS, MainnetFullProvider, MainnetProvider, MemoryCache, MemoryCacheOptions, MulticallCall, MulticallError, MulticallParams, MulticallResult, MulticallResults, NetVersionError, NonceError, NonceManagerService, NonceManagerShape, NoopCache, NoopCcip, NoopKzg, NoopRateLimiter, OptimismFormatter, OptimismProvider, PolygonProvider, ProofType, Provider, ProviderConfirmationsPendingError, ProviderError, ProviderNotFoundError, ProviderReceiptPendingError, ProviderResponseError, ProviderStepConfig, ProviderStreamError, ProviderTimeoutError, ProviderValidationError, ProxyInfo, RateLimitBehavior, RateLimitError, RateLimitedTransport, RateLimiterConfig, RateLimiterService, RateLimiterShape, RawProviderService, RawProviderShape, RawProviderTransport, RawRequestArguments, ReadContractError, ReadContractParams, ReceiptType, ResolvedExplorerContract, RpcBatch, RpcBatchService, RpcBatchShape, RpcRequest, RpcTransactionRequest, RpcUrlsConfig, SendRawTransactionError, SendTransactionError, SepoliaProvider, SerializeError, SignError, SignTransactionError, Signer, SignerError, SignerService, SignerShape, SimulateCallsError, SimulateCallsParams, SimulateContractError, SimulateContractParams, SimulateContractResult, SimulateV1BlockCall, SimulateV1BlockResult, SimulateV1CallResult, SimulateV1Error, SimulateV1Payload, SimulateV1Result, SimulateV2Error, SimulateV2Payload, SimulateV2Result, SimulationResult, StateOverride, StorageProofType, SubmitHashrateError, SubmitWorkError, SubscribeError, SyncingStatus, TestProvider, TestTransport, TransactionIndexInput, TransactionRequest, TransactionSerializerService, TransactionStream, TransactionStreamError, TransactionStreamService, TransactionStreamShape, TransactionType, TransportService, TransportShape, UncleBlockType, UninstallFilterError, UnsignedTransaction, UnsubscribeError, WaitForTransactionReceiptArgs, WaitForTransactionReceiptError, WaitForTransactionReceiptOptions, WatchBlocksError, WebSocketProvider, WebSocketProviderConfig, WebSocketProviderGlobal, WebSocketTransport, WithdrawalType, ZkSyncFormatter, aggregate3, arbitrum, arbitrumBlockExplorers, arbitrumConfig, arbitrumContracts, backfillBlocks, base, baseBlockExplorers, baseConfig, baseContracts, bytesToHex, cacheEnabledRef, call, createAccessList, createBlockFilter, createEventFilter, createPendingTransactionFilter, createProvider, estimateGas, formatAccessList, formatCallRequest, formatLogFilterParams, formatTransactionRequest, getAccounts, getBalance, getBlobBaseFee, getBlock, getBlockNumber, getBlockReceipts, getBlockTransactionCount, getChainId, getCode, getCoinbase, getEnsAddress, getEnsAvatar, getEnsName, getEnsResolver, getEnsText, getFeeHistory, getFilterChanges, getFilterLogs, getGasPrice, getHashrate, getLogs, getMaxPriorityFeePerGas, getMining, getProof, getProtocolVersion, getStorageAt, getSyncing, getTransaction, getTransactionByBlockHashAndIndex, getTransactionByBlockNumberAndIndex, getTransactionConfirmations, getTransactionCount, getTransactionReceipt, getUncle, getUncleCount, mainnet, mainnetBlockExplorers, mainnetConfig, mainnetContracts, makeBlockStream, makeContractRegistry, makeFeeEstimator, makeIdGenerator, makeProviderPlan, makeRateLimiter, makeResilientProviderPlan, makeRpcResolver, makeTransactionStream, multicall, netVersion, nextId, optimism, optimismBlockExplorers, optimismConfig, optimismContracts, parseHexToBigInt, polygon, polygonBlockExplorers, polygonConfig, polygonContracts, readContract, retryScheduleRef, rpcUrlsByChainId, sendRawTransaction, sendTransaction, sepolia, sepoliaBlockExplorers, sepoliaConfig, sepoliaContracts, sign, signTransaction, simulateCalls, simulateContract, simulateV1, simulateV2, subscribe, timeoutRef, toAddressHex, toHashHex, tracingRef, uninstallFilter, unsubscribe, waitForTransactionReceipt, watchBlocks, withRetrySchedule, withTimeout, withTracing, withoutCache } from '../services/index.js';
11
+ export { BackfillOptions, BlockInclude, BlockStreamEvent, BlocksEvent, WatchOptions } from '@tevm/voltaire/block';
12
+ import { K as KeccakService } from '../ProviderService-BZ5pqDrD.js';
13
+ export { P as ProviderService, a as ProviderShape, T as TransportError } from '../ProviderService-BZ5pqDrD.js';
14
+ import { K as KZGService } from '../KZGService-B7PJerOb.js';
15
+ import { S as Secp256k1Service } from '../Secp256k1Service-OxQ6hJFp.js';
16
+ import * as Layer from 'effect/Layer';
17
+ import 'effect/Cause';
18
+ import 'effect/Types';
19
+ import 'effect/Effect';
20
+ import 'effect/ParseResult';
21
+ import 'effect/Schema';
22
+ import '@tevm/voltaire';
23
+ import '@tevm/voltaire/contract';
24
+ import 'effect/Context';
25
+ import 'effect/Stream';
26
+ import 'effect/SchemaAST';
27
+ import '@tevm/voltaire/stream';
28
+ import '@tevm/voltaire/Secp256k1';
29
+ import '@tevm/voltaire/EIP712';
30
+ import '@tevm/voltaire/Signature';
31
+ import '@tevm/voltaire/Bls12381';
32
+ import '@tevm/voltaire/Ed25519';
33
+ import '@tevm/voltaire/HMAC';
34
+ import '@tevm/voltaire/Keystore';
35
+ import '@tevm/voltaire/P256';
36
+ import '@tevm/voltaire/X25519';
37
+ import '@tevm/voltaire/Siwe';
38
+ import 'effect';
39
+ import '@tevm/voltaire/Abi';
40
+ import '@tevm/voltaire/AccessList';
41
+ import '@tevm/voltaire/Bytes';
42
+ import '@tevm/voltaire/functional';
43
+ import '@tevm/voltaire/Uint';
44
+ import '@tevm/voltaire/Authorization';
45
+ import '@tevm/voltaire/Base64';
46
+ import '@tevm/voltaire/Blob';
47
+ import '@tevm/voltaire/BloomFilter';
48
+ import '@tevm/voltaire/Bytecode';
49
+ import '@tevm/voltaire/Ens';
50
+ import '@tevm/voltaire/EventLog';
51
+ import '@tevm/voltaire/GasConstants';
52
+ import '@tevm/voltaire/Hardfork';
53
+ import '@tevm/voltaire/InitCode';
54
+ import '@tevm/voltaire/LogFilter';
55
+ import '@tevm/voltaire/Opcode';
56
+ import '@tevm/voltaire/PrivateKey';
57
+ import '@tevm/voltaire/PublicKey';
58
+ import '@tevm/voltaire/Rlp';
59
+ import '@tevm/voltaire/Transaction';
60
+ import 'effect/Option';
61
+ import '@tevm/voltaire/transaction';
62
+ import 'effect/RequestResolver';
63
+ import 'effect/Request';
64
+ import '@effect/platform/FileSystem';
65
+ import '@effect/platform/HttpClient';
66
+ import '@effect/platform/Socket';
67
+ import 'effect/Duration';
68
+ import 'effect/Schedule';
69
+ import 'effect/Scope';
70
+ import 'effect/RateLimiter';
71
+ import 'effect/FiberRef';
72
+
73
+ /**
74
+ * CryptoLive with native-only HDWallet support.
75
+ */
76
+ declare const CryptoLiveNative: Layer.Layer<KeccakService | Secp256k1Service | EIP712Service | Bip39Service | Blake2Service | Bls12381Service | Bn254Service | ChaCha20Poly1305Service | Ed25519Service | HMACService | KeystoreService | KZGService | P256Service | Ripemd160Service | SHA256Service | HDWalletService, never, never>;
77
+
78
+ /**
79
+ * @fileoverview Production implementation of HDWalletService using native BIP-32/39/44.
80
+ * @module HDWallet/HDWalletLive
81
+ * @since 0.0.1
82
+ */
83
+
84
+ /**
85
+ * Production layer for HDWalletService using native BIP-32/39/44 implementation.
86
+ *
87
+ * @description
88
+ * Provides real cryptographic HD wallet operations backed by the Voltaire
89
+ * native implementation. Uses cryptographically secure random number generation
90
+ * for mnemonic generation and proper key derivation per BIP standards.
91
+ *
92
+ * @example
93
+ * ```typescript
94
+ * import { HDWalletService, generateMnemonic } from 'voltaire-effect/crypto/HDWallet'
95
+ * import { HDWalletLive } from 'voltaire-effect/native'
96
+ * import * as Effect from 'effect/Effect'
97
+ *
98
+ * const program = Effect.gen(function* () {
99
+ * const hd = yield* HDWalletService
100
+ * return yield* hd.generateMnemonic(256) // 24-word mnemonic
101
+ * }).pipe(Effect.provide(HDWalletLive))
102
+ * ```
103
+ *
104
+ * @since 0.0.1
105
+ * @see {@link HDWalletTest} for unit testing
106
+ */
107
+ declare const HDWalletLive: Layer.Layer<HDWalletService, never, never>;
108
+
109
+ /**
110
+ * @fileoverview HD Wallet mnemonic account implementation.
111
+ *
112
+ * @module fromMnemonic
113
+ * @since 0.0.1
114
+ *
115
+ * @description
116
+ * Provides a mnemonic-based account implementation that derives a private key
117
+ * from a BIP-39 mnemonic phrase using BIP-32/BIP-44 derivation paths.
118
+ *
119
+ * IMPORTANT: HDWallet requires native FFI and only works in native
120
+ * environments (Node.js/Bun with FFI support). WASM bundle not supported.
121
+ *
122
+ * @see {@link LocalAccount} - The underlying account implementation
123
+ * @see {@link AccountService} - The service interface
124
+ */
125
+
126
+ interface MnemonicAccountOptions {
127
+ readonly account?: number;
128
+ readonly index?: number;
129
+ readonly addressIndex?: number;
130
+ readonly path?: string;
131
+ readonly passphrase?: string;
132
+ }
133
+ /**
134
+ * Creates an account layer from a BIP-39 mnemonic phrase.
135
+ *
136
+ * @description
137
+ * Derives a private key from the mnemonic using BIP-44 derivation path
138
+ * `m/44'/60'/{account}'/0/{addressIndex}` (default) or a custom `path`
139
+ * and creates a LocalAccount.
140
+ *
141
+ * IMPORTANT: This function requires native FFI and only works in native
142
+ * environments (Node.js/Bun). The WASM bundle does not support HD wallet.
143
+ *
144
+ * @param mnemonic - BIP-39 mnemonic phrase (12-24 words)
145
+ * @param options - Derivation options
146
+ * @param options.account - Account index (default: 0)
147
+ * @param options.index - Address index (default: 0) (legacy alias)
148
+ * @param options.addressIndex - Address index (default: 0)
149
+ * @param options.path - Custom derivation path (overrides account/index)
150
+ * @param options.passphrase - Optional BIP-39 passphrase
151
+ * @returns Layer providing AccountService
152
+ *
153
+ * @since 0.0.1
154
+ *
155
+ * @example Basic usage
156
+ * ```typescript
157
+ * import { Effect, Layer } from 'effect'
158
+ * import { AccountService } from 'voltaire-effect'
159
+ * import { MnemonicAccount } from 'voltaire-effect/native'
160
+ * import { Secp256k1Live, KeccakLive } from 'voltaire-effect/crypto'
161
+ *
162
+ * const mnemonic = "test test test test test test test test test test test junk";
163
+ *
164
+ * const program = Effect.gen(function* () {
165
+ * const account = yield* AccountService
166
+ * console.log('Address:', account.address)
167
+ * return account
168
+ * }).pipe(
169
+ * Effect.provide(MnemonicAccount(mnemonic)),
170
+ * Effect.provide(Secp256k1Live),
171
+ * Effect.provide(KeccakLive)
172
+ * )
173
+ * ```
174
+ *
175
+ * @example Multiple accounts from same mnemonic
176
+ * ```typescript
177
+ * // First account (default: m/44'/60'/0'/0/0)
178
+ * const account0 = MnemonicAccount(mnemonic)
179
+ *
180
+ * // Second address in first account (m/44'/60'/0'/0/1)
181
+ * const account0Index1 = MnemonicAccount(mnemonic, { addressIndex: 1 })
182
+ *
183
+ * // Second account (m/44'/60'/1'/0/0)
184
+ * const account1 = MnemonicAccount(mnemonic, { account: 1 })
185
+ * ```
186
+ *
187
+ * @see {@link LocalAccount} - The underlying account implementation
188
+ * @see {@link AccountService} - The service interface
189
+ */
190
+ /**
191
+ * Error class for HD wallet derivation failures.
192
+ *
193
+ * @since 0.0.1
194
+ */
195
+ declare class HDWalletDerivationError extends Error {
196
+ readonly _tag = "HDWalletDerivationError";
197
+ constructor(message: string, options?: {
198
+ cause?: unknown;
199
+ });
200
+ }
201
+ declare const MnemonicAccount: (mnemonic: string, options?: MnemonicAccountOptions) => Layer.Layer<AccountService, Error | HDWalletDerivationError, Secp256k1Service | KeccakService>;
202
+
203
+ export { AccountService, CryptoLiveNative, HDWalletDerivationError, HDWalletLive, MnemonicAccount, type MnemonicAccountOptions };
@@ -0,0 +1,280 @@
1
+ export { i as Abi, a as AccessList, b as AccountState, c as Address, d as Authorization, e as Balance, f as Base64, g as BaseFeePerGas, h as BeaconBlockRoot, j as BinaryTree, k as Blob, l as Block, m as BlockBody, n as BlockFilter, o as BlockHash, p as BlockHeader, q as BlockNumber, r as BloomFilter, s as BuilderBid, t as Bundle, u as BundleHash, v as Bundler, w as Bytecode, x as Bytes, y as Bytes32, z as CallData, A as CallTrace, B as Chain, C as ChainHead, D as ChainId, E as CompilerVersion, F as ContractCode, G as ContractResult, H as ContractSignature, I as DecodedData, J as Denomination, K as Domain, L as DomainSeparator, M as EffectiveGasPrice, N as EncodedData, O as Ens, P as EntryPoint, Q as Epoch, R as ErrorSignature, S as EventLog, T as EventSignature, U as FeeMarket, V as FeeOracle, W as FilterId, X as ForkId, Y as ForwardRequest, Z as FunctionSignature, _ as Gas, $ as GasConstants, a0 as GasCosts, a1 as GasEstimate, a2 as GasPrice, a3 as GasRefund, a4 as GasUsed, a5 as Hardfork, a6 as Hash, a7 as Hex, a8 as InitCode, ad as Int128, aa as Int16, ae as Int256, ab as Int32, ac as Int64, a9 as Int8, af as License, ag as LogFilter, ah as LogIndex, ai as MaxFeePerGas, aj as MaxPriorityFeePerGas, ak as MemoryDump, al as MerkleTree, am as Metadata, an as MultiTokenId, ao as NetworkId, ap as NodeInfo, aq as Nonce, as as OpStep, ar as Opcode, at as PackedUserOperation, au as Paymaster, av as PeerId, aw as PeerInfo, ax as PendingTransactionFilter, ay as Permit, az as PrivateKey, aA as Proof, aB as ProtocolVersion, aC as Proxy, aD as PublicKey, aE as Receipt, aF as RelayData, aG as ReturnData, aH as RevertReason, aI as Rlp, aJ as RuntimeCode, aK as Selector, aL as Signature, aM as SignedData, aN as Siwe, aO as Slot, aP as SourceMap, aQ as Ssz, aR as State, aS as StateDiff, aT as StateProof, aU as StateRoot, aV as StealthAddress, aW as Storage, aX as StorageDiff, aY as StorageProof, aZ as StorageValue, a_ as StructLog, a$ as SyncStatus, b0 as TokenBalance, b1 as TokenId, b2 as TopicFilter, b3 as TraceConfig, b4 as TraceResult, b5 as Transaction, b6 as TransactionHash, b7 as TransactionIndex, b8 as TransactionStatus, b9 as TransactionUrl, ba as TypedData, bb as U256, bc as Uint, bh as Uint128, be as Uint16, bf as Uint32, bg as Uint64, bd as Uint8, bi as Uncle, bj as UserOperation, bk as ValidatorIndex, bl as Withdrawal, bm as WithdrawalIndex } from '../index-DxwZo3xo.js';
2
+ import * as Brand from 'effect/Brand';
3
+ import '@tevm/voltaire';
4
+ import 'effect/Schema';
5
+ import '@tevm/voltaire/Siwe';
6
+ import 'effect';
7
+ import '@tevm/voltaire/Address';
8
+ import '@tevm/voltaire/Abi';
9
+ import 'effect/Effect';
10
+ import '@tevm/voltaire/Hex';
11
+ import 'effect/Cause';
12
+ import 'effect/Types';
13
+ import '@tevm/voltaire/AccessList';
14
+ import '@tevm/voltaire/errors';
15
+ import '@tevm/voltaire/Hash';
16
+ import '@tevm/voltaire/Bytes';
17
+ import '@tevm/voltaire/functional';
18
+ import '@tevm/voltaire/Uint';
19
+ import '../ProviderService-BZ5pqDrD.js';
20
+ import 'effect/Context';
21
+ import 'effect/Layer';
22
+ import '@tevm/voltaire/Authorization';
23
+ import '@tevm/voltaire/Base64';
24
+ import '@tevm/voltaire/Blob';
25
+ import '../KZGService-B7PJerOb.js';
26
+ import '@tevm/voltaire/BloomFilter';
27
+ import '@tevm/voltaire/Bytecode';
28
+ import '@tevm/voltaire/Ens';
29
+ import '@tevm/voltaire/EventLog';
30
+ import '@tevm/voltaire/GasConstants';
31
+ import '@tevm/voltaire/Hardfork';
32
+ import '@tevm/voltaire/InitCode';
33
+ import '@tevm/voltaire/LogFilter';
34
+ import '@tevm/voltaire/Opcode';
35
+ import '@tevm/voltaire/PrivateKey';
36
+ import '@tevm/voltaire/PublicKey';
37
+ import '@tevm/voltaire/Signature';
38
+ import '@tevm/voltaire/Rlp';
39
+ import '@tevm/voltaire/Transaction';
40
+ import 'effect/Option';
41
+
42
+ /**
43
+ * @module Brand
44
+ * @description Effect Brand utilities for Ethereum primitive types.
45
+ *
46
+ * ## Why NOT use effect/Brand for existing primitives
47
+ *
48
+ * Voltaire primitives (Address, Hash, Hex, etc.) use **Uint8Array-based branded types**
49
+ * defined in @tevm/voltaire. These types use a custom brand symbol for performance:
50
+ *
51
+ * ```typescript
52
+ * // From @tevm/voltaire - AddressType is a branded Uint8Array
53
+ * type AddressType = Uint8Array & { readonly [brand]: "Address" }
54
+ * ```
55
+ *
56
+ * Effect's Brand module is designed for **primitive types** (string, number) and
57
+ * works by intersecting with `Brand.Brand<"Tag">`. This creates a conflict:
58
+ *
59
+ * 1. **Schema integration**: effect/Schema already provides `.brand()` and
60
+ * `Schema.fromBrand()` which work seamlessly with Schema validation pipelines.
61
+ * Using standalone Brand constructors would bypass Schema's parse/encode flow.
62
+ *
63
+ * 2. **Existing constructors**: @tevm/voltaire already exports constructors like
64
+ * `Address()`, `Hash()` that do proper validation and return branded types.
65
+ * Adding effect/Brand constructors would duplicate this functionality.
66
+ *
67
+ * 3. **Uint8Array base**: Effect Brand expects the base type to match exactly.
68
+ * Uint8Array-based brands require additional handling that Schema provides.
69
+ *
70
+ * ## Current approach (RECOMMENDED)
71
+ *
72
+ * Use Schema-based validation with the existing branded types:
73
+ *
74
+ * ```typescript
75
+ * import * as Address from 'voltaire-effect/primitives/Address'
76
+ * import * as S from 'effect/Schema'
77
+ *
78
+ * // Decode hex string to AddressType (branded Uint8Array)
79
+ * const addr = S.decodeSync(Address.Hex)('0x742d35Cc6634C0532925a3b844Bc9e7595f251e3')
80
+ *
81
+ * // The result is already a branded AddressType
82
+ * type Check = typeof addr // AddressType
83
+ * ```
84
+ *
85
+ * ## When effect/Brand IS useful
86
+ *
87
+ * For NEW types that are based on primitives (string, number, bigint), effect/Brand
88
+ * can be useful. Examples below show how to create new branded types.
89
+ *
90
+ * @since 0.1.0
91
+ */
92
+
93
+ /**
94
+ * A branded positive integer type.
95
+ * Use for values that must always be > 0.
96
+ *
97
+ * @example
98
+ * ```typescript
99
+ * import { PositiveInt } from 'voltaire-effect/primitives/Brand'
100
+ *
101
+ * const gasLimit = PositiveInt(21000) // ok
102
+ * const invalid = PositiveInt(-1) // throws
103
+ * ```
104
+ */
105
+ type PositiveInt = number & Brand.Brand<"PositiveInt">;
106
+ /**
107
+ * Constructor for PositiveInt.
108
+ * Throws if the value is not a positive integer.
109
+ */
110
+ declare const PositiveInt: Brand.Brand.Constructor<PositiveInt>;
111
+ /**
112
+ * A branded non-negative integer type.
113
+ * Use for values that must be >= 0 (like array indices, gas values).
114
+ *
115
+ * @example
116
+ * ```typescript
117
+ * import { NonNegativeInt } from 'voltaire-effect/primitives/Brand'
118
+ *
119
+ * const index = NonNegativeInt(0) // ok
120
+ * const invalid = NonNegativeInt(-1) // throws
121
+ * ```
122
+ */
123
+ type NonNegativeInt = number & Brand.Brand<"NonNegativeInt">;
124
+ /**
125
+ * Constructor for NonNegativeInt.
126
+ * Throws if the value is not a non-negative integer.
127
+ */
128
+ declare const NonNegativeInt: Brand.Brand.Constructor<NonNegativeInt>;
129
+ /**
130
+ * A branded Wei value (bigint).
131
+ * Represents Ethereum's smallest unit of ether.
132
+ *
133
+ * @example
134
+ * ```typescript
135
+ * import { Wei } from 'voltaire-effect/primitives/Brand'
136
+ *
137
+ * const amount = Wei(1000000000000000000n) // 1 ether in wei
138
+ * const invalid = Wei(-1n) // throws (negative wei)
139
+ * ```
140
+ */
141
+ type Wei = bigint & Brand.Brand<"Wei">;
142
+ /**
143
+ * Constructor for Wei.
144
+ * Throws if the value is negative.
145
+ */
146
+ declare const Wei: Brand.Brand.Constructor<Wei>;
147
+ /**
148
+ * A branded Gwei value (bigint).
149
+ * Represents 10^9 wei, commonly used for gas prices.
150
+ *
151
+ * @example
152
+ * ```typescript
153
+ * import { Gwei } from 'voltaire-effect/primitives/Brand'
154
+ *
155
+ * const gasPrice = Gwei(20n) // 20 gwei
156
+ * ```
157
+ */
158
+ type Gwei = bigint & Brand.Brand<"Gwei">;
159
+ /**
160
+ * Constructor for Gwei.
161
+ * Throws if the value is negative.
162
+ */
163
+ declare const Gwei: Brand.Brand.Constructor<Gwei>;
164
+ /**
165
+ * A branded block number type.
166
+ * Always a non-negative bigint.
167
+ *
168
+ * @example
169
+ * ```typescript
170
+ * import { BlockNumber } from 'voltaire-effect/primitives/Brand'
171
+ *
172
+ * const block = BlockNumber(19000000n)
173
+ * ```
174
+ */
175
+ type BlockNumber = bigint & Brand.Brand<"BlockNumber">;
176
+ /**
177
+ * Constructor for BlockNumber.
178
+ */
179
+ declare const BlockNumber: Brand.Brand.Constructor<BlockNumber>;
180
+ /**
181
+ * A branded chain ID type.
182
+ * Must be a positive bigint.
183
+ *
184
+ * @example
185
+ * ```typescript
186
+ * import { ChainId } from 'voltaire-effect/primitives/Brand'
187
+ *
188
+ * const mainnet = ChainId(1n)
189
+ * const sepolia = ChainId(11155111n)
190
+ * ```
191
+ */
192
+ type ChainId = bigint & Brand.Brand<"ChainId">;
193
+ /**
194
+ * Constructor for ChainId.
195
+ */
196
+ declare const ChainId: Brand.Brand.Constructor<ChainId>;
197
+ /**
198
+ * A branded nonce type.
199
+ * Transaction nonce, always a non-negative bigint.
200
+ *
201
+ * @example
202
+ * ```typescript
203
+ * import { Nonce } from 'voltaire-effect/primitives/Brand'
204
+ *
205
+ * const nonce = Nonce(42n)
206
+ * ```
207
+ */
208
+ type Nonce = bigint & Brand.Brand<"Nonce">;
209
+ /**
210
+ * Constructor for Nonce.
211
+ */
212
+ declare const Nonce: Brand.Brand.Constructor<Nonce>;
213
+ /**
214
+ * A nominal type for transaction hashes.
215
+ * Use when you already have a validated hex string and want type safety.
216
+ *
217
+ * @example
218
+ * ```typescript
219
+ * import { TxHashString } from 'voltaire-effect/primitives/Brand'
220
+ *
221
+ * // No validation, just type branding
222
+ * const hash = TxHashString('0x...')
223
+ * ```
224
+ */
225
+ type TxHashString = string & Brand.Brand<"TxHashString">;
226
+ /**
227
+ * Nominal constructor for TxHashString.
228
+ * Does NOT validate - use for already-validated values.
229
+ */
230
+ declare const TxHashString: Brand.Brand.Constructor<TxHashString>;
231
+ /**
232
+ * A nominal type for address strings.
233
+ * Use when you already have a validated address and want type safety.
234
+ *
235
+ * @example
236
+ * ```typescript
237
+ * import { AddressString } from 'voltaire-effect/primitives/Brand'
238
+ *
239
+ * // No validation, just type branding
240
+ * const addr = AddressString('0x742d35Cc6634C0532925a3b844Bc9e7595f251e3')
241
+ * ```
242
+ */
243
+ type AddressString = string & Brand.Brand<"AddressString">;
244
+ /**
245
+ * Nominal constructor for AddressString.
246
+ * Does NOT validate - use for already-validated values.
247
+ */
248
+ declare const AddressString: Brand.Brand.Constructor<AddressString>;
249
+ /**
250
+ * A value that is both positive and represents gas.
251
+ *
252
+ * @example
253
+ * ```typescript
254
+ * import { Gas } from 'voltaire-effect/primitives/Brand'
255
+ *
256
+ * const gas = Gas(21000n) // must be positive
257
+ * ```
258
+ */
259
+ type Gas = bigint & Brand.Brand<"Gas">;
260
+ /**
261
+ * Constructor for Gas values.
262
+ */
263
+ declare const Gas: Brand.Brand.Constructor<Gas>;
264
+
265
+ declare const index_AddressString: typeof AddressString;
266
+ declare const index_BlockNumber: typeof BlockNumber;
267
+ declare const index_Brand: typeof Brand;
268
+ declare const index_ChainId: typeof ChainId;
269
+ declare const index_Gas: typeof Gas;
270
+ declare const index_Gwei: typeof Gwei;
271
+ declare const index_NonNegativeInt: typeof NonNegativeInt;
272
+ declare const index_Nonce: typeof Nonce;
273
+ declare const index_PositiveInt: typeof PositiveInt;
274
+ declare const index_TxHashString: typeof TxHashString;
275
+ declare const index_Wei: typeof Wei;
276
+ declare namespace index {
277
+ export { index_AddressString as AddressString, index_BlockNumber as BlockNumber, index_Brand as Brand, index_ChainId as ChainId, index_Gas as Gas, index_Gwei as Gwei, index_NonNegativeInt as NonNegativeInt, index_Nonce as Nonce, index_PositiveInt as PositiveInt, index_TxHashString as TxHashString, index_Wei as Wei };
278
+ }
279
+
280
+ export { index as Brand };