@macwlt/cli 0.0.1-alpha

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,543 @@
1
+ import { Hex as Hex$1, HttpTransportConfig } from 'viem';
2
+
3
+ type Result<T, E> = {
4
+ readonly ok: true;
5
+ readonly value: T;
6
+ } | {
7
+ readonly ok: false;
8
+ readonly error: E;
9
+ };
10
+ declare function ok<T, E>(value: T): Result<T, E>;
11
+ declare function err<T, E>(error: E): Result<T, E>;
12
+
13
+ type Base64Error = {
14
+ readonly kind: "empty";
15
+ } | {
16
+ readonly kind: "invalid";
17
+ readonly value: string;
18
+ };
19
+ declare function bytesToBase64(bytes: Uint8Array): string;
20
+ declare function base64ToBytes(input: string): Result<Uint8Array, Base64Error>;
21
+
22
+ interface ConfigStorage {
23
+ read(path: string): Promise<string | undefined>;
24
+ write(path: string, contents: string): Promise<void>;
25
+ }
26
+
27
+ type GlobalConfigValidationError = {
28
+ readonly kind: "invalid-config";
29
+ readonly message: string;
30
+ };
31
+
32
+ type JsonValue = null | boolean | number | string | readonly JsonValue[] | {
33
+ readonly [key: string]: JsonValue;
34
+ };
35
+ declare function parseJsonValue(input: unknown): Result<JsonValue, GlobalConfigValidationError>;
36
+
37
+ type GlobalConfigData = {
38
+ readonly [key: string]: JsonValue;
39
+ };
40
+ declare function parseGlobalConfigData(input: unknown): Result<GlobalConfigData, GlobalConfigValidationError>;
41
+
42
+ type GlobalConfigLoadOptions = {
43
+ readonly homeDirectory?: string;
44
+ readonly storage?: ConfigStorage;
45
+ };
46
+ type GlobalConfigLoadError = {
47
+ readonly kind: "read-failed";
48
+ readonly path: string;
49
+ readonly cause: unknown;
50
+ } | {
51
+ readonly kind: "invalid-json";
52
+ readonly path: string;
53
+ readonly message: string;
54
+ } | (GlobalConfigValidationError & {
55
+ readonly path: string;
56
+ });
57
+ type GlobalConfigSaveError = {
58
+ readonly kind: "write-failed";
59
+ readonly path: string;
60
+ readonly cause: unknown;
61
+ };
62
+ declare class GlobalConfig {
63
+ #private;
64
+ private constructor();
65
+ static load(options?: GlobalConfigLoadOptions): Promise<Result<GlobalConfig, GlobalConfigLoadError>>;
66
+ get path(): string;
67
+ get dirty(): boolean;
68
+ get data(): GlobalConfigData;
69
+ get(key: string): JsonValue | undefined;
70
+ set(key: string, input: unknown): Result<void, GlobalConfigValidationError>;
71
+ delete(key: string): void;
72
+ replace(input: unknown): Result<void, GlobalConfigValidationError>;
73
+ save(): Promise<Result<void, GlobalConfigSaveError>>;
74
+ }
75
+
76
+ declare function createFileIfAbsent(path: string, contents: string): Promise<"created" | "already-exists">;
77
+
78
+ declare function defaultGlobalConfigContents(): string;
79
+
80
+ type EnsureGlobalConfigOptions = {
81
+ readonly homeDirectory?: string;
82
+ readonly createFile?: typeof createFileIfAbsent;
83
+ };
84
+ type EnsureGlobalConfigError = {
85
+ readonly kind: "write-failed";
86
+ readonly path: string;
87
+ readonly cause: unknown;
88
+ };
89
+ type EnsureGlobalConfigResult = {
90
+ readonly path: string;
91
+ readonly created: boolean;
92
+ };
93
+ declare function ensureGlobalConfig(options?: EnsureGlobalConfigOptions): Promise<Result<EnsureGlobalConfigResult, EnsureGlobalConfigError>>;
94
+
95
+ type ResetGlobalConfigOptions = {
96
+ readonly homeDirectory?: string;
97
+ readonly storage?: ConfigStorage;
98
+ };
99
+ type ResetGlobalConfigError = {
100
+ readonly kind: "write-failed";
101
+ readonly path: string;
102
+ readonly cause: unknown;
103
+ };
104
+ declare function resetGlobalConfig(options?: ResetGlobalConfigOptions): Promise<Result<string, ResetGlobalConfigError>>;
105
+
106
+ declare const fileConfigStorage: ConfigStorage;
107
+
108
+ declare function globalConfigPath(homeDirectory: string): string;
109
+
110
+ type AddressType = "bitcoin" | "bitcoin-testnet" | "bitcoin-taproot" | "bitcoin-taproot-testnet" | "ethereum";
111
+ type NativeError = {
112
+ readonly kind: "load";
113
+ readonly libraryPath: string;
114
+ readonly message: string;
115
+ } | {
116
+ readonly kind: "missing-library";
117
+ readonly libraryPath: string;
118
+ } | {
119
+ readonly kind: "wallet-create";
120
+ readonly message: string;
121
+ } | {
122
+ readonly kind: "native";
123
+ readonly operation: string;
124
+ readonly code: number;
125
+ readonly message: string;
126
+ } | {
127
+ readonly kind: "oversized-output";
128
+ readonly operation: string;
129
+ readonly size: bigint;
130
+ };
131
+ type NativeClient = {
132
+ readonly libraryPath: string;
133
+ readonly close: () => void;
134
+ readonly withWallet: <T, E>(body: (wallet: NativeWallet) => Result<T, E>) => Result<T, E | NativeError>;
135
+ };
136
+ type NativeWallet = {
137
+ readonly reset: () => Result<void, NativeError>;
138
+ readonly bootstrap: () => Result<Uint8Array, NativeError>;
139
+ readonly exportPubkey: (derivationPath: string) => Result<Uint8Array, NativeError>;
140
+ readonly exportAddress: (derivationPath: string, addressType: AddressType) => Result<string, NativeError>;
141
+ readonly signEthereumTransaction: (transaction: Uint8Array) => Result<Uint8Array, NativeError>;
142
+ readonly signPsbt: (psbt: Uint8Array) => Result<Uint8Array, NativeError>;
143
+ };
144
+ declare function defaultLibraryPath(envPath: string | undefined): string;
145
+ declare function openNativeClient(libraryPath: string): Result<NativeClient, NativeError>;
146
+
147
+ declare const cliVersion = "0.1.0";
148
+ type CliResult = {
149
+ readonly exitCode: number;
150
+ readonly stdout: string;
151
+ readonly stderr: string;
152
+ };
153
+ type CommandHook = () => Result<void, string> | Promise<Result<void, string>>;
154
+ interface Command<P = unknown> {
155
+ readonly name: string;
156
+ readonly aliases?: readonly string[];
157
+ readonly needsClient?: boolean;
158
+ readonly beforeRun?: CommandHook;
159
+ describe(): string;
160
+ parse(args: readonly string[]): Result<P, string>;
161
+ run(ctx: CommandContext, parsed: P): Promise<Result<string, string>>;
162
+ }
163
+ interface CommandContext {
164
+ readonly env: NodeJS.ProcessEnv;
165
+ readonly client: NativeClient;
166
+ readonly registry: readonly Command[];
167
+ readonly configStorage: ConfigStorage;
168
+ }
169
+ type RunCliOptions = {
170
+ readonly configStorage?: ConfigStorage;
171
+ readonly createConfigFile?: typeof createFileIfAbsent;
172
+ };
173
+ declare function runCli(args: readonly string[], env?: NodeJS.ProcessEnv, registry?: readonly Command[], options?: RunCliOptions): Promise<CliResult>;
174
+ declare function helpText(registry: readonly Command[]): string;
175
+
176
+ declare const commands: readonly Command[];
177
+
178
+ type HexError = {
179
+ readonly kind: "empty";
180
+ } | {
181
+ readonly kind: "invalid";
182
+ readonly value: string;
183
+ };
184
+ declare function bytesToHex(bytes: Uint8Array): string;
185
+ declare function hexToBytes(input: string): Result<Uint8Array, HexError>;
186
+
187
+ type ParsedFlags = {
188
+ readonly json: boolean;
189
+ readonly positionals: readonly string[];
190
+ readonly options: ReadonlyMap<string, string>;
191
+ readonly switches: ReadonlySet<string>;
192
+ };
193
+ declare function parseFlags(args: readonly string[]): Result<ParsedFlags, string>;
194
+
195
+ type BytesInput = {
196
+ readonly kind: "hex";
197
+ readonly value: string;
198
+ } | {
199
+ readonly kind: "base64";
200
+ readonly value: string;
201
+ } | {
202
+ readonly kind: "file";
203
+ readonly path: string;
204
+ };
205
+ declare function parseBytesInput(options: ReadonlyMap<string, string>, allowed: readonly string[]): Result<BytesInput, string>;
206
+ declare function readInput(input: BytesInput): Promise<Result<Uint8Array, string>>;
207
+
208
+ declare function formatNativeError(error: NativeError): string;
209
+ declare function formatExecutionError(error: string | NativeError): string;
210
+
211
+ declare function formatDataOutput(bytes: Uint8Array, json: boolean, key: string): string;
212
+ type PsbtTextFormat = "base64" | "hex";
213
+ declare function formatPsbt(bytes: Uint8Array, format: PsbtTextFormat): string;
214
+
215
+ declare function runWithWallet<T>(client: NativeClient, body: (wallet: NativeWallet) => Result<T, string>): Result<T, string>;
216
+
217
+ type ConfirmationPrompt = (question: string) => Promise<boolean>;
218
+ declare function terminalConfirmationPrompt(question: string): Promise<boolean>;
219
+
220
+ declare function createConfirmationHook(prompt?: ConfirmationPrompt): CommandHook;
221
+
222
+ type ChainId = number & {
223
+ readonly __brand: "ChainId";
224
+ };
225
+ type RpcUrl = string & {
226
+ readonly __brand: "RpcUrl";
227
+ };
228
+ type EthereumConfig = {
229
+ readonly rpcUrl: RpcUrl;
230
+ readonly chainId: ChainId;
231
+ };
232
+ type EthereumConfigInput = {
233
+ readonly rpcUrl: string;
234
+ readonly chainId: number;
235
+ };
236
+ type EthereumConfigError = {
237
+ readonly kind: "invalid-rpc-url";
238
+ readonly value: string;
239
+ } | {
240
+ readonly kind: "invalid-chain-id";
241
+ readonly value: number;
242
+ };
243
+ declare function parseEthereumConfig(input: EthereumConfigInput): Result<EthereumConfig, EthereumConfigError>;
244
+
245
+ type Hex = `0x${string}`;
246
+ type EthereumAddress = `0x${string}`;
247
+ type EvmBlockTag = "earliest" | "finalized" | "latest" | "pending" | "safe";
248
+ type EvmBlock = EvmBlockTag | bigint;
249
+ type EvmCallRequest = {
250
+ readonly to: EthereumAddress;
251
+ readonly data?: Hex;
252
+ readonly from?: EthereumAddress;
253
+ readonly gas?: bigint;
254
+ readonly gasPrice?: bigint;
255
+ readonly value?: bigint;
256
+ readonly block?: EvmBlock;
257
+ };
258
+ type EvmCallResult = {
259
+ readonly data: Hex | undefined;
260
+ };
261
+ type EvmValidationError = {
262
+ readonly message: string;
263
+ };
264
+ declare function parseEvmCallRequest(input: EvmCallRequest): Result<EvmCallRequest, EvmValidationError>;
265
+ declare function parseEvmCallResult(input: unknown): Result<EvmCallResult, EvmValidationError>;
266
+
267
+ type EvmTransactionRequest = {
268
+ readonly from: EthereumAddress;
269
+ readonly to: EthereumAddress;
270
+ readonly data?: Hex;
271
+ readonly value?: bigint;
272
+ };
273
+ type TransactionHash = Hex;
274
+
275
+ interface EvmCallTransport {
276
+ call(request: EvmCallRequest): Promise<unknown>;
277
+ }
278
+ interface EvmTransport extends EvmCallTransport {
279
+ getChainId(): Promise<unknown>;
280
+ getTransactionCount(address: string): Promise<unknown>;
281
+ getBalance(address: string): Promise<unknown>;
282
+ estimateGas(request: EvmTransactionRequest): Promise<unknown>;
283
+ getGasPrice(): Promise<unknown>;
284
+ sendRawTransaction(transaction: string): Promise<unknown>;
285
+ }
286
+ type EvmCallTransportFactory = (config: EthereumConfig) => EvmCallTransport;
287
+ type EthereumClientCreationError = EthereumConfigError | {
288
+ readonly kind: "transport-creation-failed";
289
+ readonly cause: unknown;
290
+ };
291
+ type EthereumCallError = {
292
+ readonly kind: "invalid-request";
293
+ readonly message: string;
294
+ } | {
295
+ readonly kind: "transport-failed";
296
+ readonly cause: unknown;
297
+ } | {
298
+ readonly kind: "invalid-response";
299
+ readonly message: string;
300
+ };
301
+ type EthereumTransactionOperation = "get-chain-id" | "get-transaction-count" | "get-balance" | "estimate-gas" | "get-gas-price" | "send-raw-transaction";
302
+ type EthereumTransactionError = {
303
+ readonly kind: "unsupported-transport";
304
+ } | {
305
+ readonly kind: "invalid-request";
306
+ readonly message: string;
307
+ } | {
308
+ readonly kind: "transport-failed";
309
+ readonly operation: EthereumTransactionOperation;
310
+ readonly cause: unknown;
311
+ } | {
312
+ readonly kind: "invalid-response";
313
+ readonly operation: EthereumTransactionOperation;
314
+ readonly message: string;
315
+ } | {
316
+ readonly kind: "chain-mismatch";
317
+ readonly expected: number;
318
+ readonly actual: number;
319
+ };
320
+ declare class EthereumClient {
321
+ #private;
322
+ private constructor();
323
+ static create(input: EthereumConfigInput, createTransport: EvmCallTransportFactory): Result<EthereumClient, EthereumClientCreationError>;
324
+ get config(): EthereumConfig;
325
+ call(request: EvmCallRequest): Promise<Result<EvmCallResult, EthereumCallError>>;
326
+ verifyChain(): Promise<Result<void, EthereumTransactionError>>;
327
+ getTransactionCount(address: string): Promise<Result<number, EthereumTransactionError>>;
328
+ estimateGas(request: EvmTransactionRequest): Promise<Result<bigint, EthereumTransactionError>>;
329
+ getBalance(address: string): Promise<Result<bigint, EthereumTransactionError>>;
330
+ getGasPrice(): Promise<Result<bigint, EthereumTransactionError>>;
331
+ sendRawTransaction(transaction: string): Promise<Result<TransactionHash, EthereumTransactionError>>;
332
+ }
333
+
334
+ type EthereumAsset = {
335
+ readonly kind: "native-eth";
336
+ } | {
337
+ readonly kind: "erc20";
338
+ readonly tokenAddress: EthereumAddress;
339
+ };
340
+ declare function parseEthereumAsset(input: string): Result<EthereumAsset, "invalid-ethereum-asset">;
341
+
342
+ type LegacyTransaction = {
343
+ readonly type: "legacy";
344
+ readonly chainId: number;
345
+ readonly nonce: number;
346
+ readonly gas: bigint;
347
+ readonly gasPrice: bigint;
348
+ readonly to: EthereumAddress;
349
+ readonly value: bigint;
350
+ readonly data: Hex;
351
+ };
352
+
353
+ type Erc20DecimalsError = {
354
+ readonly kind: "invalid-token-decimals";
355
+ readonly message: string;
356
+ };
357
+ declare function decodeErc20Decimals(data: Hex): Result<number, Erc20DecimalsError>;
358
+
359
+ type Erc20BalanceError = {
360
+ readonly kind: "invalid-token-balance";
361
+ readonly message: string;
362
+ };
363
+ declare function decodeErc20Balance(data: Hex): Result<bigint, Erc20BalanceError>;
364
+
365
+ declare function encodeErc20BalanceOf(account: EthereumAddress): Hex$1;
366
+
367
+ declare function encodeErc20DecimalsCall(): Hex$1;
368
+
369
+ declare function encodeErc20Transfer(recipient: EthereumAddress, amount: bigint): Hex$1;
370
+
371
+ type EthereumAssetBalance = {
372
+ readonly kind: "native-eth";
373
+ readonly address: EthereumAddress;
374
+ readonly balance: string;
375
+ readonly balanceBaseUnits: bigint;
376
+ readonly decimals: 18;
377
+ } | {
378
+ readonly kind: "erc20";
379
+ readonly address: EthereumAddress;
380
+ readonly tokenAddress: EthereumAddress;
381
+ readonly balance: string;
382
+ readonly balanceBaseUnits: bigint;
383
+ readonly decimals: number;
384
+ };
385
+ type EthereumBalanceStage = "verify-chain" | "get-native-balance" | "read-token-balance" | "read-token-decimals";
386
+ type EthereumAssetBalanceError = {
387
+ readonly kind: "chain-client";
388
+ readonly stage: EthereumBalanceStage;
389
+ readonly error: EthereumCallError | EthereumTransactionError;
390
+ } | {
391
+ readonly kind: "missing-token-balance";
392
+ } | {
393
+ readonly kind: "missing-token-decimals";
394
+ } | {
395
+ readonly kind: "token-balance";
396
+ readonly error: Erc20BalanceError;
397
+ } | {
398
+ readonly kind: "token-decimals";
399
+ readonly error: Erc20DecimalsError;
400
+ };
401
+ declare function getEthereumAssetBalance(client: EthereumClient, address: EthereumAddress, asset: EthereumAsset): Promise<Result<EthereumAssetBalance, EthereumAssetBalanceError>>;
402
+
403
+ type ConfiguredErc20Asset = {
404
+ readonly symbol: string;
405
+ readonly address: EthereumAddress;
406
+ };
407
+ type ConfiguredEthereumChain = {
408
+ readonly chainId: number;
409
+ readonly name: string;
410
+ readonly rpcUrl: RpcUrl;
411
+ readonly nativeSymbol: string;
412
+ readonly assets: readonly ConfiguredErc20Asset[];
413
+ };
414
+ type EthereumPortfolioConfigError = {
415
+ readonly kind: "invalid-portfolio-config";
416
+ readonly message: string;
417
+ };
418
+ declare function parseEthereumPortfolioConfig(input: GlobalConfigData): Result<readonly ConfiguredEthereumChain[], EthereumPortfolioConfigError>;
419
+
420
+ type EthereumPortfolioAssetBalance = {
421
+ readonly status: "fulfilled";
422
+ readonly symbol: string;
423
+ readonly balance: EthereumAssetBalance;
424
+ } | {
425
+ readonly status: "failed";
426
+ readonly symbol: string;
427
+ readonly asset: EthereumAsset;
428
+ readonly error: EthereumAssetBalanceError;
429
+ };
430
+ type EthereumPortfolioChainBalances = {
431
+ readonly status: "fulfilled";
432
+ readonly chain: ConfiguredEthereumChain;
433
+ readonly assets: readonly EthereumPortfolioAssetBalance[];
434
+ } | {
435
+ readonly status: "failed";
436
+ readonly chain: ConfiguredEthereumChain;
437
+ readonly error: EthereumClientCreationError;
438
+ };
439
+ declare function getEthereumPortfolioBalances(chains: readonly ConfiguredEthereumChain[], address: EthereumAddress, createTransport: EvmCallTransportFactory): Promise<readonly EthereumPortfolioChainBalances[]>;
440
+
441
+ type TokenAmountError = {
442
+ readonly kind: "invalid-token-amount";
443
+ readonly value: string;
444
+ } | {
445
+ readonly kind: "zero-token-amount";
446
+ };
447
+ declare function parseTokenAmount(value: string, decimals: number): Result<bigint, TokenAmountError>;
448
+
449
+ type EthereumRpcResolutionError = {
450
+ readonly kind: "missing-chain-rpc";
451
+ readonly chainId: number;
452
+ } | {
453
+ readonly kind: "invalid-chain-rpc";
454
+ readonly chainId: number;
455
+ };
456
+ declare function resolveEthereumRpcUrl(config: GlobalConfigData, chainId: number): Result<RpcUrl, EthereumRpcResolutionError>;
457
+
458
+ type EthereumSignatureError = {
459
+ readonly kind: "invalid-signature-length";
460
+ readonly actual: number;
461
+ } | {
462
+ readonly kind: "invalid-signature-parity";
463
+ readonly actual: number;
464
+ };
465
+ declare function serializeSignedTransaction(transaction: LegacyTransaction, signature: Uint8Array): Result<Hex$1, EthereumSignatureError>;
466
+
467
+ type Erc20TransactionSigner = {
468
+ readonly address: EthereumAddress;
469
+ sign(transaction: Uint8Array): Result<Uint8Array, string>;
470
+ };
471
+ type SendErc20TokenInput = {
472
+ readonly tokenAddress: EthereumAddress;
473
+ readonly recipient: EthereumAddress;
474
+ readonly amount: string;
475
+ };
476
+ type SendErc20TokenResult = {
477
+ readonly transactionHash: Hex;
478
+ readonly from: EthereumAddress;
479
+ readonly amountBaseUnits: bigint;
480
+ readonly decimals: number;
481
+ };
482
+ type SendErc20Stage = "verify-chain" | "read-token-decimals" | "get-transaction-count" | "estimate-gas" | "get-gas-price" | "broadcast";
483
+ type SendErc20TokenError = {
484
+ readonly kind: "chain-client";
485
+ readonly stage: SendErc20Stage;
486
+ readonly error: EthereumCallError | EthereumTransactionError;
487
+ } | {
488
+ readonly kind: "missing-token-decimals";
489
+ } | {
490
+ readonly kind: "token-decimals";
491
+ readonly error: Erc20DecimalsError;
492
+ } | {
493
+ readonly kind: "token-amount";
494
+ readonly error: TokenAmountError;
495
+ } | {
496
+ readonly kind: "signing-failed";
497
+ readonly message: string;
498
+ } | {
499
+ readonly kind: "invalid-signature";
500
+ readonly error: EthereumSignatureError;
501
+ };
502
+ declare function sendErc20Token(client: EthereumClient, signer: Erc20TransactionSigner, input: SendErc20TokenInput): Promise<Result<SendErc20TokenResult, SendErc20TokenError>>;
503
+
504
+ type SendNativeEthInput = {
505
+ readonly recipient: EthereumAddress;
506
+ readonly amount: string;
507
+ };
508
+ type SendNativeEthResult = {
509
+ readonly transactionHash: Hex;
510
+ readonly from: EthereumAddress;
511
+ readonly amountWei: bigint;
512
+ readonly feeWei: bigint;
513
+ readonly balanceWei: bigint;
514
+ };
515
+ type SendNativeEthStage = "verify-chain" | "get-transaction-count" | "get-balance" | "estimate-gas" | "get-gas-price" | "broadcast";
516
+ type SendNativeEthError = {
517
+ readonly kind: "chain-client";
518
+ readonly stage: SendNativeEthStage;
519
+ readonly error: EthereumTransactionError;
520
+ } | {
521
+ readonly kind: "amount";
522
+ readonly error: TokenAmountError;
523
+ } | {
524
+ readonly kind: "insufficient-funds";
525
+ readonly balanceWei: bigint;
526
+ readonly requiredWei: bigint;
527
+ } | {
528
+ readonly kind: "signing-failed";
529
+ readonly message: string;
530
+ } | {
531
+ readonly kind: "invalid-signature";
532
+ readonly error: EthereumSignatureError;
533
+ };
534
+ declare function sendNativeEth(client: EthereumClient, signer: Erc20TransactionSigner, input: SendNativeEthInput): Promise<Result<SendNativeEthResult, SendNativeEthError>>;
535
+
536
+ declare function serializeUnsignedTransaction(transaction: LegacyTransaction): Hex$1;
537
+
538
+ type ViemTransportOptions = {
539
+ readonly fetchFn?: HttpTransportConfig["fetchFn"];
540
+ };
541
+ declare function createViemTransport(config: EthereumConfig, options?: ViemTransportOptions): EvmTransport;
542
+
543
+ export { type AddressType, type Base64Error, type BytesInput, type ChainId, type CliResult, type Command, type CommandContext, type CommandHook, type ConfigStorage, type ConfiguredErc20Asset, type ConfiguredEthereumChain, type ConfirmationPrompt, type EnsureGlobalConfigError, type EnsureGlobalConfigOptions, type EnsureGlobalConfigResult, type Erc20BalanceError, type Erc20DecimalsError, type Erc20TransactionSigner, type EthereumAddress, type EthereumAsset, type EthereumAssetBalance, type EthereumAssetBalanceError, type EthereumBalanceStage, type EthereumCallError, EthereumClient, type EthereumClientCreationError, type EthereumConfig, type EthereumConfigError, type EthereumConfigInput, type EthereumPortfolioAssetBalance, type EthereumPortfolioChainBalances, type EthereumPortfolioConfigError, type EthereumRpcResolutionError, type EthereumSignatureError, type EthereumTransactionError, type EthereumTransactionOperation, type EvmBlock, type EvmBlockTag, type EvmCallRequest, type EvmCallResult, type EvmCallTransport, type EvmCallTransportFactory, type EvmTransactionRequest, type EvmTransport, type EvmValidationError, GlobalConfig, type GlobalConfigData, type GlobalConfigLoadError, type GlobalConfigLoadOptions, type GlobalConfigSaveError, type GlobalConfigValidationError, type Hex, type HexError, type JsonValue, type LegacyTransaction, type NativeClient, type NativeError, type NativeWallet, type ParsedFlags, type PsbtTextFormat, type ResetGlobalConfigError, type ResetGlobalConfigOptions, type Result, type RpcUrl, type RunCliOptions, type SendErc20Stage, type SendErc20TokenError, type SendErc20TokenInput, type SendErc20TokenResult, type SendNativeEthError, type SendNativeEthInput, type SendNativeEthResult, type SendNativeEthStage, type TokenAmountError, type TransactionHash, type ViemTransportOptions, base64ToBytes, bytesToBase64, bytesToHex, cliVersion, commands, createConfirmationHook, createFileIfAbsent, createViemTransport, decodeErc20Balance, decodeErc20Decimals, defaultGlobalConfigContents, defaultLibraryPath, encodeErc20BalanceOf, encodeErc20DecimalsCall, encodeErc20Transfer, ensureGlobalConfig, err, fileConfigStorage, formatDataOutput, formatExecutionError, formatNativeError, formatPsbt, getEthereumAssetBalance, getEthereumPortfolioBalances, globalConfigPath, helpText, hexToBytes, ok, openNativeClient, parseBytesInput, parseEthereumAsset, parseEthereumConfig, parseEthereumPortfolioConfig, parseEvmCallRequest, parseEvmCallResult, parseFlags, parseGlobalConfigData, parseJsonValue, parseTokenAmount, readInput, resetGlobalConfig, resolveEthereumRpcUrl, runCli, runWithWallet, sendErc20Token, sendNativeEth, serializeSignedTransaction, serializeUnsignedTransaction, terminalConfirmationPrompt };