viem 0.0.1-alpha.33 → 0.0.1-alpha.35
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/LICENSE +1 -1
- package/abi/package.json +4 -0
- package/dist/abi.d.ts +5 -0
- package/dist/abi.js +11 -0
- package/dist/abi.js.map +1 -0
- package/dist/abi.mjs +11 -0
- package/dist/abi.mjs.map +1 -0
- package/dist/{chain-ce6e149c.d.ts → chain-145cfaf3.d.ts} +1 -1
- package/dist/{chain-4a0d4164.d.ts → chain-7b7ac245.d.ts} +2 -2
- package/dist/chains.d.ts +3 -3
- package/dist/chains.js +46 -46
- package/dist/chains.mjs +1 -1
- package/dist/{chunk-DHSIBSJL.js → chunk-3FT7UKPT.js} +75 -75
- package/dist/chunk-3FT7UKPT.js.map +1 -0
- package/dist/{chunk-BUCF6SRR.js → chunk-57YM6E7I.js} +22 -22
- package/dist/{chunk-KMBDF3HQ.mjs → chunk-5NDMORWZ.mjs} +3 -3
- package/dist/{chunk-3CEIPU6M.js → chunk-A665BF7O.js} +24 -16
- package/dist/chunk-A665BF7O.js.map +1 -0
- package/dist/{chunk-R7MSY2BH.js → chunk-HQCSH22G.js} +128 -83
- package/dist/chunk-HQCSH22G.js.map +1 -0
- package/dist/{chunk-JB4TWW3U.mjs → chunk-PBW4YL37.mjs} +89 -44
- package/dist/chunk-PBW4YL37.mjs.map +1 -0
- package/dist/{chunk-VEAHSGOL.mjs → chunk-PH5LCMME.mjs} +10 -2
- package/dist/chunk-PH5LCMME.mjs.map +1 -0
- package/dist/{chunk-RNGEVZVH.js → chunk-TJK6AFBM.js} +14 -14
- package/dist/{chunk-RNGEVZVH.js.map → chunk-TJK6AFBM.js.map} +1 -1
- package/dist/{chunk-HN7IYO7U.mjs → chunk-WQDVW7EJ.mjs} +2 -2
- package/dist/chunk-WQDVW7EJ.mjs.map +1 -0
- package/dist/{chunk-DYALOQ44.mjs → chunk-YEVW7GK5.mjs} +2 -2
- package/dist/{chunk-DYALOQ44.mjs.map → chunk-YEVW7GK5.mjs.map} +1 -1
- package/dist/contract.d.ts +7 -8
- package/dist/contract.js +4 -4
- package/dist/contract.mjs +10 -10
- package/dist/{createClient-8a8b4bf4.d.ts → createClient-7c715e2c.d.ts} +2 -2
- package/dist/{createPublicClient-b5afe6b8.d.ts → createPublicClient-4d24afb2.d.ts} +122 -9
- package/dist/{eip1193-8c021438.d.ts → eip1193-d538ae6d.d.ts} +11 -1
- package/dist/{getAbiItem-d7aa40b1.d.ts → encodeFunctionResult-f59f4cfe.d.ts} +3 -25
- package/dist/ens.d.ts +4 -5
- package/dist/ens.js +4 -4
- package/dist/ens.mjs +3 -3
- package/dist/{formatAbiItem-6e00e5e6.d.ts → formatAbiItem-89d97367.d.ts} +1 -1
- package/dist/getAbiItem-c9cbc8b8.d.ts +22 -0
- package/dist/index.d.ts +12 -13
- package/dist/index.js +91 -90
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +24 -23
- package/dist/index.mjs.map +1 -1
- package/dist/{parseGwei-ce3a9dfa.d.ts → parseGwei-ad6d1914.d.ts} +5 -6
- package/dist/public.d.ts +5 -6
- package/dist/public.js +3 -3
- package/dist/public.mjs +2 -2
- package/dist/{test-5d5828c9.d.ts → test-8646fb50.d.ts} +9 -9
- package/dist/test.d.ts +5 -5
- package/dist/test.js +3 -3
- package/dist/test.mjs +2 -2
- package/dist/utils/index.d.ts +12 -14
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.mjs +5 -5
- package/dist/wallet.d.ts +5 -5
- package/dist/wallet.js +4 -3
- package/dist/wallet.mjs +3 -2
- package/dist/window.d.ts +2 -2
- package/package.json +8 -2
- package/dist/chunk-3CEIPU6M.js.map +0 -1
- package/dist/chunk-DHSIBSJL.js.map +0 -1
- package/dist/chunk-HN7IYO7U.mjs.map +0 -1
- package/dist/chunk-JB4TWW3U.mjs.map +0 -1
- package/dist/chunk-R7MSY2BH.js.map +0 -1
- package/dist/chunk-VEAHSGOL.mjs.map +0 -1
- package/dist/wallet-5ab86528.d.ts +0 -115
- /package/dist/{chunk-BUCF6SRR.js.map → chunk-57YM6E7I.js.map} +0 -0
- /package/dist/{chunk-KMBDF3HQ.mjs.map → chunk-5NDMORWZ.mjs.map} +0 -0
@@ -1,115 +0,0 @@
|
|
1
|
-
import { Abi, Narrow, Address } from 'abitype';
|
2
|
-
import { C as Chain, J as ExtractFormatter, S as Formatters, V as Formatter, K as Formatted, s as RpcTransactionRequest, u as TransactionRequest, H as Hex, a4 as ExtractConstructorArgsFromAbi, X as MergeIntersectionProperties, a as Hash, A as Address$1, B as ByteArray, Y as GetValue, h as ContractConfig } from './chain-4a0d4164.js';
|
3
|
-
import { W as WalletPermission, a as WatchAssetParams, S as SignableRequests, b as WalletRequests } from './eip1193-8c021438.js';
|
4
|
-
import { a as Transport, b as ClientConfig, C as Client } from './createClient-8a8b4bf4.js';
|
5
|
-
|
6
|
-
type TransactionRequestFormatter<TChain extends Chain = Chain> = ExtractFormatter<TChain, 'transactionRequest', NonNullable<Formatters['transactionRequest']>>;
|
7
|
-
type FormattedTransactionRequest$1<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, RpcTransactionRequest>;
|
8
|
-
declare function formatTransactionRequest(transactionRequest: Partial<TransactionRequest>): RpcTransactionRequest;
|
9
|
-
declare const defineTransactionRequest: <TFormat extends Formatter<Partial<TransactionRequest<bigint, number>>, Partial<RpcTransactionRequest> & {
|
10
|
-
[key: string]: unknown;
|
11
|
-
}>, TExclude extends ("gasPrice" | "maxFeePerGas" | "maxPriorityFeePerGas" | "data" | "from" | "gas" | "nonce" | "to" | "value" | "accessList")[] = []>({ exclude, format: formatOverride, }: {
|
12
|
-
exclude?: TExclude | undefined;
|
13
|
-
format?: TFormat | undefined;
|
14
|
-
}) => (data: Partial<TransactionRequest<bigint, number>> & {
|
15
|
-
[key: string]: unknown;
|
16
|
-
}) => RpcTransactionRequest & ReturnType<TFormat> & { [K in TExclude[number]]: never; };
|
17
|
-
|
18
|
-
type AddChainArgs = {
|
19
|
-
chain: Chain;
|
20
|
-
};
|
21
|
-
declare function addChain(client: WalletClient, { chain }: AddChainArgs): Promise<void>;
|
22
|
-
|
23
|
-
type DeployContractArgs<TChain extends Chain = Chain, TAbi extends Abi | readonly unknown[] = Abi> = Omit<SendTransactionArgs<TChain>, 'accessList' | 'to' | 'data' | 'value'> & {
|
24
|
-
abi: Narrow<TAbi>;
|
25
|
-
bytecode: Hex;
|
26
|
-
} & ExtractConstructorArgsFromAbi<TAbi>;
|
27
|
-
type DeployContractResponse = SendTransactionResponse;
|
28
|
-
declare function deployContract<TChain extends Chain, TAbi extends Abi | readonly unknown[]>(walletClient: WalletClient, { abi, args, bytecode, ...request }: DeployContractArgs<TChain, TAbi>): Promise<DeployContractResponse>;
|
29
|
-
|
30
|
-
type GetAccountsResponse = Address[];
|
31
|
-
declare function getAccounts(client: WalletClient): Promise<GetAccountsResponse>;
|
32
|
-
|
33
|
-
type GetPermissionsResponse = WalletPermission[];
|
34
|
-
declare function getPermissions(client: WalletClient): Promise<WalletPermission[]>;
|
35
|
-
|
36
|
-
type RequestAccountsResponse = Address[];
|
37
|
-
declare function requestAccounts(client: WalletClient): Promise<RequestAccountsResponse>;
|
38
|
-
|
39
|
-
type RequestPermissionsArgs = {
|
40
|
-
eth_accounts: Record<string, any>;
|
41
|
-
} & {
|
42
|
-
[key: string]: Record<string, any>;
|
43
|
-
};
|
44
|
-
type RequestPermissionsResponse = WalletPermission[];
|
45
|
-
declare function requestPermissions(client: WalletClient, permissions: RequestPermissionsArgs): Promise<WalletPermission[]>;
|
46
|
-
|
47
|
-
type FormattedTransactionRequest<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Formatted<TFormatter, TransactionRequest, true>, TransactionRequest>;
|
48
|
-
type SendTransactionArgs<TChain extends Chain = Chain> = FormattedTransactionRequest<TransactionRequestFormatter<TChain>> & {
|
49
|
-
chain?: TChain;
|
50
|
-
};
|
51
|
-
type SendTransactionResponse = Hash;
|
52
|
-
declare function sendTransaction<TChain extends Chain>(client: WalletClient, args: SendTransactionArgs<TChain>): Promise<SendTransactionResponse>;
|
53
|
-
|
54
|
-
type SignMessageArgs = {
|
55
|
-
from: Address$1;
|
56
|
-
data: Hex | ByteArray;
|
57
|
-
};
|
58
|
-
type SignMessageResponse = Hex;
|
59
|
-
declare function signMessage(client: WalletClient, { from, data: data_ }: SignMessageArgs): Promise<SignMessageResponse>;
|
60
|
-
|
61
|
-
type SwitchChainArgs = {
|
62
|
-
id: Chain['id'];
|
63
|
-
};
|
64
|
-
declare function switchChain(client: WalletClient, { id }: SwitchChainArgs): Promise<void>;
|
65
|
-
|
66
|
-
type WatchAssetArgs = WatchAssetParams;
|
67
|
-
type WatchAssetResponse = boolean;
|
68
|
-
declare function watchAsset(client: WalletClient, params: WatchAssetParams): Promise<WatchAssetResponse>;
|
69
|
-
|
70
|
-
type WriteContractArgs<TChain extends Chain = Chain, TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = Omit<SendTransactionArgs<TChain>, 'to' | 'data' | 'value'> & {
|
71
|
-
value?: GetValue<TAbi, TFunctionName, SendTransactionArgs<TChain>['value']>;
|
72
|
-
} & ContractConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'>;
|
73
|
-
type WriteContractResponse = SendTransactionResponse;
|
74
|
-
declare function writeContract<TChain extends Chain, TAbi extends Abi | readonly unknown[], TFunctionName extends string>(client: WalletClient, { abi, address, args, functionName, ...request }: WriteContractArgs<TChain, TAbi, TFunctionName>): Promise<WriteContractResponse>;
|
75
|
-
|
76
|
-
type WalletClientConfig<TTransport extends Transport = Transport, TChain extends Chain = Chain> = {
|
77
|
-
chain?: ClientConfig<TTransport, TChain>['chain'];
|
78
|
-
/** The key of the Wallet Client. */
|
79
|
-
key?: ClientConfig['key'];
|
80
|
-
/** The name of the Wallet Client. */
|
81
|
-
name?: ClientConfig['name'];
|
82
|
-
/** Frequency (in ms) for polling enabled actions & events. Defaults to 4_000 milliseconds. */
|
83
|
-
pollingInterval?: ClientConfig['pollingInterval'];
|
84
|
-
transport: ClientConfig<TTransport, TChain>['transport'];
|
85
|
-
};
|
86
|
-
type WalletClient<TTransport extends Transport = Transport, TChain extends Chain = Chain, TIncludeActions extends boolean = true> = Client<TTransport, TChain, SignableRequests & WalletRequests> & (TIncludeActions extends true ? WalletActions<TChain> : {});
|
87
|
-
/**
|
88
|
-
* @description Creates a wallet client with a given transport.
|
89
|
-
*
|
90
|
-
* - Only has access to "wallet" & "signable" EIP-1474 RPC methods
|
91
|
-
* (ie. `eth_sendTransaction`, `eth_requestAccounts`, etc).
|
92
|
-
*
|
93
|
-
* @example
|
94
|
-
* import { createWalletClient, custom } from 'viem'
|
95
|
-
* const client = createWalletClient(
|
96
|
-
* custom(window.ethereum)
|
97
|
-
* )
|
98
|
-
*/
|
99
|
-
declare function createWalletClient<TTransport extends Transport, TChain extends Chain>({ transport, key, name, pollingInterval, }: WalletClientConfig<TTransport, TChain>): WalletClient<TTransport, TChain, true>;
|
100
|
-
|
101
|
-
type WalletActions<TChain extends Chain = Chain> = {
|
102
|
-
addChain: (args: AddChainArgs) => Promise<void>;
|
103
|
-
deployContract: <TAbi extends Abi | readonly unknown[]>(args: DeployContractArgs<TChain, TAbi>) => Promise<DeployContractResponse>;
|
104
|
-
getAccounts: () => Promise<GetAccountsResponse>;
|
105
|
-
getPermissions: () => Promise<GetPermissionsResponse>;
|
106
|
-
requestAccounts: () => Promise<RequestAccountsResponse>;
|
107
|
-
requestPermissions: (args: RequestPermissionsArgs) => Promise<RequestPermissionsResponse>;
|
108
|
-
sendTransaction: (args: SendTransactionArgs<TChain>) => Promise<SendTransactionResponse>;
|
109
|
-
signMessage: (args: SignMessageArgs) => Promise<SignMessageResponse>;
|
110
|
-
switchChain: (args: SwitchChainArgs) => Promise<void>;
|
111
|
-
watchAsset: (args: WatchAssetArgs) => Promise<WatchAssetResponse>;
|
112
|
-
writeContract: <TAbi extends Abi | readonly unknown[], TFunctionName extends string>(args: WriteContractArgs<TChain, TAbi, TFunctionName>) => Promise<WriteContractResponse>;
|
113
|
-
};
|
114
|
-
|
115
|
-
export { AddChainArgs as A, WatchAssetResponse as B, DeployContractArgs as D, FormattedTransactionRequest$1 as F, GetPermissionsResponse as G, RequestAccountsResponse as R, SendTransactionArgs as S, TransactionRequestFormatter as T, WalletClient as W, WalletClientConfig as a, WriteContractArgs as b, createWalletClient as c, defineTransactionRequest as d, DeployContractResponse as e, formatTransactionRequest as f, WriteContractResponse as g, deployContract as h, addChain as i, getAccounts as j, getPermissions as k, requestPermissions as l, signMessage as m, switchChain as n, watchAsset as o, FormattedTransactionRequest as p, GetAccountsResponse as q, requestAccounts as r, sendTransaction as s, RequestPermissionsResponse as t, SendTransactionResponse as u, SignMessageArgs as v, writeContract as w, SignMessageResponse as x, SwitchChainArgs as y, WatchAssetArgs as z };
|
File without changes
|
File without changes
|