viem 0.0.1-alpha.26 → 0.0.1-alpha.28
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/chain-4d46a747.d.ts +543 -0
- package/dist/{chain-b0cfb141.d.ts → chain-c7c44165.d.ts} +1 -1
- package/dist/chains.d.ts +5 -3
- package/dist/chains.js +46 -46
- package/dist/chains.mjs +1 -1
- package/dist/chunk-67DKKHAV.js +210 -0
- package/dist/chunk-67DKKHAV.js.map +1 -0
- package/dist/{chunk-LINNE4N4.js → chunk-7GQB4KE5.js} +219 -157
- package/dist/chunk-7GQB4KE5.js.map +1 -0
- package/dist/chunk-FPEKYEVU.js +265 -0
- package/dist/chunk-FPEKYEVU.js.map +1 -0
- package/dist/chunk-GRILGOX5.mjs +210 -0
- package/dist/chunk-GRILGOX5.mjs.map +1 -0
- package/dist/{chunk-YTG4YXMB.js → chunk-JJ4FDDDW.js} +16 -16
- package/dist/chunk-JJ4FDDDW.js.map +1 -0
- package/dist/chunk-NKO23GXR.mjs +265 -0
- package/dist/chunk-NKO23GXR.mjs.map +1 -0
- package/dist/{chunk-DSQO3E4F.js → chunk-NYWN5V47.js} +219 -59
- package/dist/chunk-NYWN5V47.js.map +1 -0
- package/dist/{chunk-BSAB6UH4.mjs → chunk-PVBEFQET.mjs} +7 -7
- package/dist/chunk-PVBEFQET.mjs.map +1 -0
- package/dist/{chunk-QSIX64VZ.mjs → chunk-RCJJFKTU.mjs} +164 -102
- package/dist/chunk-RCJJFKTU.mjs.map +1 -0
- package/dist/{chunk-PRG3BBPZ.mjs → chunk-TDOKFOQ5.mjs} +223 -63
- package/dist/chunk-TDOKFOQ5.mjs.map +1 -0
- package/dist/contract.d.ts +12 -128
- package/dist/contract.js +6 -4
- package/dist/contract.mjs +5 -3
- package/dist/{createClient-6689596e.d.ts → createClient-5d5c14d6.d.ts} +5 -3
- package/dist/createPublicClient-2b4afeac.d.ts +629 -0
- package/dist/{eip1193-617a05ae.d.ts → eip1193-f09a55af.d.ts} +2 -2
- package/dist/ens.d.ts +10 -68
- package/dist/ens.js +5 -199
- package/dist/ens.js.map +1 -1
- package/dist/ens.mjs +7 -201
- package/dist/ens.mjs.map +1 -1
- package/dist/formatAbiItem-d231fef2.d.ts +14 -0
- package/dist/{getAbiItem-d2e8bd76.d.ts → getAbiItem-0e085959.d.ts} +15 -15
- package/dist/index.d.ts +21 -12
- package/dist/index.js +368 -26
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +358 -16
- package/dist/index.mjs.map +1 -1
- package/dist/namehash-88f4639d.d.ts +22 -0
- package/dist/parseGwei-07adffee.d.ts +344 -0
- package/dist/public.d.ts +11 -334
- package/dist/public.js +5 -3
- package/dist/public.mjs +4 -2
- package/dist/test-b9208949.d.ts +213 -0
- package/dist/test.d.ts +8 -149
- package/dist/test.js +20 -222
- package/dist/test.js.map +1 -1
- package/dist/test.mjs +30 -232
- package/dist/test.mjs.map +1 -1
- package/dist/{transactionReceipt-44dbf122.d.ts → transactionReceipt-84fc92e1.d.ts} +1 -1
- package/dist/{transactionRequest-f437b4ba.d.ts → transactionRequest-44c539b4.d.ts} +1 -1
- package/dist/utils/index.d.ts +12 -238
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.mjs +13 -13
- package/dist/wallet-9b1c6905.d.ts +104 -0
- package/dist/wallet.d.ts +7 -41
- package/dist/wallet.js +3 -3
- package/dist/wallet.mjs +2 -2
- package/dist/window.d.ts +4 -2
- package/package.json +1 -2
- package/dist/call-3476b8ee.d.ts +0 -22
- package/dist/chain-42de87e5.d.ts +0 -359
- package/dist/chunk-BSAB6UH4.mjs.map +0 -1
- package/dist/chunk-DSQO3E4F.js.map +0 -1
- package/dist/chunk-LINNE4N4.js.map +0 -1
- package/dist/chunk-PRG3BBPZ.mjs.map +0 -1
- package/dist/chunk-QSIX64VZ.mjs.map +0 -1
- package/dist/chunk-YTG4YXMB.js.map +0 -1
- package/dist/contract-9dd2f98b.d.ts +0 -166
- package/dist/createPublicClient-fd558574.d.ts +0 -19
- package/dist/createTestClient-bc1d9028.d.ts +0 -34
- package/dist/createWalletClient-4df88244.d.ts +0 -30
- package/dist/decodeErrorResult-ac835649.d.ts +0 -16
- package/dist/readContract-c460f23a.d.ts +0 -10
- package/dist/rpc-8c10fc98.d.ts +0 -119
- package/dist/sendTransaction-7ce442c0.d.ts +0 -12
- package/dist/watchEvent-569c9976.d.ts +0 -41
package/dist/rpc-8c10fc98.d.ts
DELETED
@@ -1,119 +0,0 @@
|
|
1
|
-
import { Abi } from 'abitype';
|
2
|
-
import { A as Address, H as Hex } from './chain-42de87e5.js';
|
3
|
-
import { D as DecodeErrorResultResponse } from './decodeErrorResult-ac835649.js';
|
4
|
-
import WebSocket from 'isomorphic-ws';
|
5
|
-
|
6
|
-
type BaseErrorArgs = {
|
7
|
-
docsPath?: string;
|
8
|
-
metaMessages?: string[];
|
9
|
-
} & ({
|
10
|
-
cause?: never;
|
11
|
-
details?: string;
|
12
|
-
} | {
|
13
|
-
cause: BaseError | Error;
|
14
|
-
details?: never;
|
15
|
-
});
|
16
|
-
declare class BaseError extends Error {
|
17
|
-
details: string;
|
18
|
-
docsPath?: string;
|
19
|
-
metaMessages?: string[];
|
20
|
-
shortMessage: string;
|
21
|
-
name: string;
|
22
|
-
constructor(shortMessage: string, args?: BaseErrorArgs);
|
23
|
-
}
|
24
|
-
|
25
|
-
declare class ContractFunctionExecutionError extends BaseError {
|
26
|
-
abi: Abi;
|
27
|
-
args?: unknown[];
|
28
|
-
cause: BaseError;
|
29
|
-
contractAddress?: Address;
|
30
|
-
formattedArgs?: string;
|
31
|
-
functionName: string;
|
32
|
-
sender?: Address;
|
33
|
-
name: string;
|
34
|
-
constructor(cause: BaseError, { abi, args, contractAddress, docsPath, functionName, sender, }: {
|
35
|
-
abi: Abi;
|
36
|
-
args?: any;
|
37
|
-
contractAddress?: Address;
|
38
|
-
docsPath?: string;
|
39
|
-
functionName: string;
|
40
|
-
sender?: Address;
|
41
|
-
});
|
42
|
-
}
|
43
|
-
declare class ContractFunctionRevertedError extends BaseError {
|
44
|
-
name: string;
|
45
|
-
data?: DecodeErrorResultResponse;
|
46
|
-
reason?: string;
|
47
|
-
constructor({ abi, data, functionName, message, }: {
|
48
|
-
abi: Abi;
|
49
|
-
data?: Hex;
|
50
|
-
functionName: string;
|
51
|
-
message?: string;
|
52
|
-
});
|
53
|
-
}
|
54
|
-
declare class ContractFunctionZeroDataError extends BaseError {
|
55
|
-
name: string;
|
56
|
-
constructor({ functionName }: {
|
57
|
-
functionName: string;
|
58
|
-
});
|
59
|
-
}
|
60
|
-
|
61
|
-
type SuccessResult<T> = {
|
62
|
-
method?: never;
|
63
|
-
result: T;
|
64
|
-
error?: never;
|
65
|
-
};
|
66
|
-
type ErrorResult<T> = {
|
67
|
-
method?: never;
|
68
|
-
result?: never;
|
69
|
-
error: T;
|
70
|
-
};
|
71
|
-
type Subscription<TResult, TError> = {
|
72
|
-
method: 'eth_subscription';
|
73
|
-
error?: never;
|
74
|
-
result?: never;
|
75
|
-
params: {
|
76
|
-
subscription: string;
|
77
|
-
} & ({
|
78
|
-
result: TResult;
|
79
|
-
error?: never;
|
80
|
-
} | {
|
81
|
-
result?: never;
|
82
|
-
error: TError;
|
83
|
-
});
|
84
|
-
};
|
85
|
-
type RpcRequest = {
|
86
|
-
method: string;
|
87
|
-
params?: any[];
|
88
|
-
};
|
89
|
-
type RpcResponse<TResult = any, TError = any> = {
|
90
|
-
jsonrpc: `${number}`;
|
91
|
-
id: number;
|
92
|
-
} & (SuccessResult<TResult> | ErrorResult<TError> | Subscription<TResult, TError>);
|
93
|
-
declare function http(url: string, { body, timeout, }: {
|
94
|
-
body: RpcRequest;
|
95
|
-
timeout?: number;
|
96
|
-
}): Promise<RpcResponse<any, any>>;
|
97
|
-
type Id = string | number;
|
98
|
-
type CallbackFn = (message: any) => void;
|
99
|
-
type CallbackMap = Map<Id, CallbackFn>;
|
100
|
-
type Socket = WebSocket & {
|
101
|
-
requests: CallbackMap;
|
102
|
-
subscriptions: CallbackMap;
|
103
|
-
};
|
104
|
-
declare function webSocket(socket: Socket, { body, onData, onError, }: {
|
105
|
-
body: RpcRequest;
|
106
|
-
onData?: (message: RpcResponse) => void;
|
107
|
-
onError?: (message: RpcResponse['error']) => void;
|
108
|
-
}): Socket;
|
109
|
-
declare function webSocketAsync(socket: Socket, { body, timeout, }: {
|
110
|
-
body: RpcRequest;
|
111
|
-
timeout?: number;
|
112
|
-
}): Promise<RpcResponse<any, any>>;
|
113
|
-
declare const rpc: {
|
114
|
-
http: typeof http;
|
115
|
-
webSocket: typeof webSocket;
|
116
|
-
webSocketAsync: typeof webSocketAsync;
|
117
|
-
};
|
118
|
-
|
119
|
-
export { BaseError as B, ContractFunctionExecutionError as C, RpcResponse as R, ContractFunctionRevertedError as a, ContractFunctionZeroDataError as b, rpc as r };
|
@@ -1,12 +0,0 @@
|
|
1
|
-
import { M as Formatter, O as MergeIntersectionProperties, S as Formatted, s as TransactionRequest, C as Chain, a as Hash } from './chain-42de87e5.js';
|
2
|
-
import { W as WalletClient } from './createWalletClient-4df88244.js';
|
3
|
-
import { T as TransactionRequestFormatter } from './transactionRequest-f437b4ba.js';
|
4
|
-
|
5
|
-
type FormattedTransactionRequest<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Formatted<TFormatter, TransactionRequest, true>, TransactionRequest>;
|
6
|
-
type SendTransactionArgs<TChain extends Chain = Chain> = FormattedTransactionRequest<TransactionRequestFormatter<TChain>> & {
|
7
|
-
chain?: TChain;
|
8
|
-
};
|
9
|
-
type SendTransactionResponse = Hash;
|
10
|
-
declare function sendTransaction<TChain extends Chain>(client: WalletClient, { chain, from, accessList, data, gas, gasPrice, maxFeePerGas, maxPriorityFeePerGas, nonce, to, value, ...rest }: SendTransactionArgs<TChain>): Promise<SendTransactionResponse>;
|
11
|
-
|
12
|
-
export { FormattedTransactionRequest as F, SendTransactionArgs as S, SendTransactionResponse as a, sendTransaction as s };
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import { A as Address, b as BlockTag, H as Hex, L as Log } from './chain-42de87e5.js';
|
2
|
-
import { P as PublicClient } from './createPublicClient-fd558574.js';
|
3
|
-
import { j as EventDefinition, k as ExtractArgsFromEventDefinition } from './contract-9dd2f98b.js';
|
4
|
-
|
5
|
-
type EventFilterArgs<TEventDefinition extends EventDefinition> = ExtractArgsFromEventDefinition<TEventDefinition>;
|
6
|
-
|
7
|
-
type GetBytecodeArgs = {
|
8
|
-
address: Address;
|
9
|
-
} & ({
|
10
|
-
blockNumber?: never;
|
11
|
-
blockTag?: BlockTag;
|
12
|
-
} | {
|
13
|
-
blockNumber?: bigint;
|
14
|
-
blockTag?: never;
|
15
|
-
});
|
16
|
-
type GetBytecodeResponse = Hex | undefined;
|
17
|
-
declare function getBytecode(client: PublicClient, { address, blockNumber, blockTag }: GetBytecodeArgs): Promise<GetBytecodeResponse>;
|
18
|
-
|
19
|
-
type OnLogsResponse = Log[];
|
20
|
-
type OnLogs = (logs: OnLogsResponse) => void;
|
21
|
-
type WatchEventArgs<TEventDefinition extends EventDefinition> = {
|
22
|
-
/** The address of the contract. */
|
23
|
-
address?: Address | Address[];
|
24
|
-
/** Whether or not the event logs should be batched on each invocation. */
|
25
|
-
batch?: boolean;
|
26
|
-
/** The callback to call when an error occurred when trying to get for a new block. */
|
27
|
-
onError?: (error: Error) => void;
|
28
|
-
/** The callback to call when new event logs are received. */
|
29
|
-
onLogs: OnLogs;
|
30
|
-
/** Polling frequency (in ms). Defaults to Client's pollingInterval config. */
|
31
|
-
pollingInterval?: number;
|
32
|
-
} & ({
|
33
|
-
event: TEventDefinition;
|
34
|
-
args?: EventFilterArgs<TEventDefinition>;
|
35
|
-
} | {
|
36
|
-
event?: never;
|
37
|
-
args?: never;
|
38
|
-
});
|
39
|
-
declare function watchEvent<TEventDefinition extends EventDefinition>(client: PublicClient, { address, args, batch, event, onError, onLogs, pollingInterval, }: WatchEventArgs<TEventDefinition>): () => void;
|
40
|
-
|
41
|
-
export { EventFilterArgs as E, GetBytecodeArgs as G, OnLogs as O, GetBytecodeResponse as a, OnLogsResponse as b, getBytecode as g, watchEvent as w };
|