@wagmi/core 0.6.12 → 0.7.0

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.
Files changed (184) hide show
  1. package/chains/package.json +2 -2
  2. package/connectors/coinbaseWallet/package.json +2 -2
  3. package/connectors/metaMask/package.json +2 -2
  4. package/connectors/mock/package.json +2 -2
  5. package/connectors/walletConnect/package.json +2 -2
  6. package/dist/{declarations/src/connectors/base.d.ts → base-5bd9b5ed.d.ts} +8 -5
  7. package/dist/chains.d.ts +3 -0
  8. package/dist/chains.js +29 -0
  9. package/dist/chunk-2EDVJWOA.js +3496 -0
  10. package/dist/chunk-4DNFSL2K.js +376 -0
  11. package/dist/chunk-MQXBDTVK.js +29 -0
  12. package/dist/{declarations/src/connectors → connectors}/coinbaseWallet.d.ts +10 -6
  13. package/dist/connectors/coinbaseWallet.js +215 -0
  14. package/dist/{declarations/src/connectors → connectors}/metaMask.d.ts +11 -4
  15. package/dist/connectors/metaMask.js +115 -0
  16. package/dist/connectors/mock/index.d.ts +78 -0
  17. package/dist/connectors/mock/index.js +190 -0
  18. package/dist/{declarations/src/connectors → connectors}/walletConnect.d.ts +9 -5
  19. package/dist/connectors/walletConnect.js +160 -0
  20. package/dist/{declarations/src/types/contracts.d.ts → contracts-fb6a6ff0.d.ts} +122 -17
  21. package/dist/{declarations/src/types/index.d.ts → index-bacc1c49.d.ts} +83 -15
  22. package/dist/index.d.ts +1738 -0
  23. package/dist/index.js +165 -0
  24. package/dist/{declarations/src/connectors/injected.d.ts → injected-6980e5c3.d.ts} +9 -6
  25. package/dist/internal.d.ts +8 -0
  26. package/dist/internal.js +8 -0
  27. package/dist/providers/alchemy.d.ts +11 -0
  28. package/dist/providers/alchemy.js +32 -0
  29. package/dist/providers/infura.d.ts +11 -0
  30. package/dist/providers/infura.js +32 -0
  31. package/dist/providers/jsonRpc.d.ts +14 -0
  32. package/dist/providers/jsonRpc.js +44 -0
  33. package/dist/providers/public.d.ts +8 -0
  34. package/dist/providers/public.js +30 -0
  35. package/internal/package.json +2 -2
  36. package/package.json +40 -51
  37. package/providers/alchemy/package.json +2 -2
  38. package/providers/infura/package.json +2 -2
  39. package/providers/jsonRpc/package.json +2 -2
  40. package/providers/public/package.json +2 -2
  41. package/chains/dist/wagmi-core-chains.cjs.d.ts +0 -1
  42. package/chains/dist/wagmi-core-chains.cjs.dev.js +0 -26
  43. package/chains/dist/wagmi-core-chains.cjs.js +0 -7
  44. package/chains/dist/wagmi-core-chains.cjs.prod.js +0 -26
  45. package/chains/dist/wagmi-core-chains.esm.js +0 -2
  46. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.d.ts +0 -1
  47. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.dev.js +0 -274
  48. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.js +0 -7
  49. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.cjs.prod.js +0 -274
  50. package/connectors/coinbaseWallet/dist/wagmi-core-connectors-coinbaseWallet.esm.js +0 -252
  51. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.d.ts +0 -1
  52. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.dev.js +0 -153
  53. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.js +0 -7
  54. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.cjs.prod.js +0 -153
  55. package/connectors/metaMask/dist/wagmi-core-connectors-metaMask.esm.js +0 -149
  56. package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.d.ts +0 -1
  57. package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.dev.js +0 -262
  58. package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.js +0 -7
  59. package/connectors/mock/dist/wagmi-core-connectors-mock.cjs.prod.js +0 -262
  60. package/connectors/mock/dist/wagmi-core-connectors-mock.esm.js +0 -253
  61. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.d.ts +0 -1
  62. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.dev.js +0 -228
  63. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.js +0 -7
  64. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.cjs.prod.js +0 -228
  65. package/connectors/walletConnect/dist/wagmi-core-connectors-walletConnect.esm.js +0 -206
  66. package/dist/chains-73cc6c23.cjs.prod.js +0 -526
  67. package/dist/chains-8fce19d8.esm.js +0 -502
  68. package/dist/chains-fe1f4131.cjs.dev.js +0 -526
  69. package/dist/debounce-0862bf88.esm.js +0 -18
  70. package/dist/debounce-2d836dc9.cjs.prod.js +0 -20
  71. package/dist/debounce-46ac0312.cjs.dev.js +0 -20
  72. package/dist/declarations/src/actions/accounts/connect.d.ts +0 -18
  73. package/dist/declarations/src/actions/accounts/disconnect.d.ts +0 -1
  74. package/dist/declarations/src/actions/accounts/fetchBalance.d.ts +0 -19
  75. package/dist/declarations/src/actions/accounts/fetchSigner.d.ts +0 -7
  76. package/dist/declarations/src/actions/accounts/getAccount.d.ts +0 -36
  77. package/dist/declarations/src/actions/accounts/getNetwork.d.ts +0 -8
  78. package/dist/declarations/src/actions/accounts/index.d.ts +0 -12
  79. package/dist/declarations/src/actions/accounts/signMessage.d.ts +0 -7
  80. package/dist/declarations/src/actions/accounts/signTypedData.d.ts +0 -23
  81. package/dist/declarations/src/actions/accounts/switchNetwork.d.ts +0 -6
  82. package/dist/declarations/src/actions/accounts/watchAccount.d.ts +0 -12
  83. package/dist/declarations/src/actions/accounts/watchNetwork.d.ts +0 -10
  84. package/dist/declarations/src/actions/accounts/watchSigner.d.ts +0 -5
  85. package/dist/declarations/src/actions/contracts/fetchToken.d.ts +0 -21
  86. package/dist/declarations/src/actions/contracts/getContract.d.ts +0 -113
  87. package/dist/declarations/src/actions/contracts/index.d.ts +0 -11
  88. package/dist/declarations/src/actions/contracts/multicall.d.ts +0 -17
  89. package/dist/declarations/src/actions/contracts/prepareWriteContract.d.ts +0 -47
  90. package/dist/declarations/src/actions/contracts/readContract.d.ts +0 -15
  91. package/dist/declarations/src/actions/contracts/readContracts.d.ts +0 -28
  92. package/dist/declarations/src/actions/contracts/watchContractEvent.d.ts +0 -28
  93. package/dist/declarations/src/actions/contracts/watchMulticall.d.ts +0 -10
  94. package/dist/declarations/src/actions/contracts/watchReadContract.d.ts +0 -7
  95. package/dist/declarations/src/actions/contracts/watchReadContracts.d.ts +0 -10
  96. package/dist/declarations/src/actions/contracts/writeContract.d.ts +0 -72
  97. package/dist/declarations/src/actions/ens/fetchEnsAddress.d.ts +0 -9
  98. package/dist/declarations/src/actions/ens/fetchEnsAvatar.d.ts +0 -8
  99. package/dist/declarations/src/actions/ens/fetchEnsName.d.ts +0 -9
  100. package/dist/declarations/src/actions/ens/fetchEnsResolver.d.ts +0 -9
  101. package/dist/declarations/src/actions/ens/index.d.ts +0 -4
  102. package/dist/declarations/src/actions/index.d.ts +0 -6
  103. package/dist/declarations/src/actions/network-status/fetchBlockNumber.d.ts +0 -5
  104. package/dist/declarations/src/actions/network-status/fetchFeeData.d.ts +0 -16
  105. package/dist/declarations/src/actions/network-status/index.d.ts +0 -3
  106. package/dist/declarations/src/actions/network-status/watchBlockNumber.d.ts +0 -7
  107. package/dist/declarations/src/actions/providers/getProvider.d.ts +0 -7
  108. package/dist/declarations/src/actions/providers/getWebSocketProvider.d.ts +0 -7
  109. package/dist/declarations/src/actions/providers/index.d.ts +0 -4
  110. package/dist/declarations/src/actions/providers/watchProvider.d.ts +0 -4
  111. package/dist/declarations/src/actions/providers/watchWebSocketProvider.d.ts +0 -4
  112. package/dist/declarations/src/actions/transactions/fetchTransaction.d.ts +0 -21
  113. package/dist/declarations/src/actions/transactions/index.d.ts +0 -4
  114. package/dist/declarations/src/actions/transactions/prepareSendTransaction.d.ts +0 -37
  115. package/dist/declarations/src/actions/transactions/sendTransaction.d.ts +0 -48
  116. package/dist/declarations/src/actions/transactions/waitForTransaction.d.ts +0 -18
  117. package/dist/declarations/src/chains.d.ts +0 -1
  118. package/dist/declarations/src/client.d.ts +0 -91
  119. package/dist/declarations/src/connectors/index.d.ts +0 -2
  120. package/dist/declarations/src/connectors/mock/connector.d.ts +0 -34
  121. package/dist/declarations/src/connectors/mock/index.d.ts +0 -2
  122. package/dist/declarations/src/connectors/mock/provider.d.ts +0 -41
  123. package/dist/declarations/src/constants/abis.d.ts +0 -941
  124. package/dist/declarations/src/constants/blockExplorers.d.ts +0 -9
  125. package/dist/declarations/src/constants/chains.d.ts +0 -64
  126. package/dist/declarations/src/constants/index.d.ts +0 -7
  127. package/dist/declarations/src/constants/rpcs.d.ts +0 -11
  128. package/dist/declarations/src/constants/units.d.ts +0 -1
  129. package/dist/declarations/src/errors.d.ts +0 -134
  130. package/dist/declarations/src/index.d.ts +0 -14
  131. package/dist/declarations/src/internal.d.ts +0 -3
  132. package/dist/declarations/src/providers/alchemy.d.ts +0 -6
  133. package/dist/declarations/src/providers/infura.d.ts +0 -6
  134. package/dist/declarations/src/providers/jsonRpc.d.ts +0 -10
  135. package/dist/declarations/src/providers/public.d.ts +0 -4
  136. package/dist/declarations/src/storage.d.ts +0 -12
  137. package/dist/declarations/src/types/utils.d.ts +0 -103
  138. package/dist/declarations/src/utils/assertActiveChain.d.ts +0 -5
  139. package/dist/declarations/src/utils/configureChains.d.ts +0 -26
  140. package/dist/declarations/src/utils/debounce.d.ts +0 -1
  141. package/dist/declarations/src/utils/deepEqual.d.ts +0 -2
  142. package/dist/declarations/src/utils/getInjectedName.d.ts +0 -2
  143. package/dist/declarations/src/utils/index.d.ts +0 -11
  144. package/dist/declarations/src/utils/logger.d.ts +0 -1
  145. package/dist/declarations/src/utils/minimizeContractInterface.d.ts +0 -5
  146. package/dist/declarations/src/utils/normalizeChainId.d.ts +0 -1
  147. package/dist/declarations/src/utils/normalizeFunctionName.d.ts +0 -17
  148. package/dist/declarations/src/utils/parseContractResult.d.ts +0 -7
  149. package/dist/getProvider-3b1af4e6.cjs.dev.js +0 -1143
  150. package/dist/getProvider-84f303a1.cjs.prod.js +0 -1143
  151. package/dist/getProvider-97db849e.esm.js +0 -1105
  152. package/dist/rpcs-38f4faba.cjs.prod.js +0 -57
  153. package/dist/rpcs-52ea3d8d.cjs.dev.js +0 -57
  154. package/dist/rpcs-d533516e.esm.js +0 -51
  155. package/dist/wagmi-core.cjs.d.ts +0 -1
  156. package/dist/wagmi-core.cjs.dev.js +0 -2683
  157. package/dist/wagmi-core.cjs.js +0 -7
  158. package/dist/wagmi-core.cjs.prod.js +0 -2683
  159. package/dist/wagmi-core.esm.js +0 -2599
  160. package/internal/dist/wagmi-core-internal.cjs.d.ts +0 -1
  161. package/internal/dist/wagmi-core-internal.cjs.dev.js +0 -9
  162. package/internal/dist/wagmi-core-internal.cjs.js +0 -7
  163. package/internal/dist/wagmi-core-internal.cjs.prod.js +0 -9
  164. package/internal/dist/wagmi-core-internal.esm.js +0 -1
  165. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.d.ts +0 -1
  166. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.dev.js +0 -36
  167. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.js +0 -7
  168. package/providers/alchemy/dist/wagmi-core-providers-alchemy.cjs.prod.js +0 -36
  169. package/providers/alchemy/dist/wagmi-core-providers-alchemy.esm.js +0 -32
  170. package/providers/infura/dist/wagmi-core-providers-infura.cjs.d.ts +0 -1
  171. package/providers/infura/dist/wagmi-core-providers-infura.cjs.dev.js +0 -36
  172. package/providers/infura/dist/wagmi-core-providers-infura.cjs.js +0 -7
  173. package/providers/infura/dist/wagmi-core-providers-infura.cjs.prod.js +0 -36
  174. package/providers/infura/dist/wagmi-core-providers-infura.esm.js +0 -32
  175. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.d.ts +0 -1
  176. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.dev.js +0 -46
  177. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.js +0 -7
  178. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.cjs.prod.js +0 -46
  179. package/providers/jsonRpc/dist/wagmi-core-providers-jsonRpc.esm.js +0 -42
  180. package/providers/public/dist/wagmi-core-providers-public.cjs.d.ts +0 -1
  181. package/providers/public/dist/wagmi-core-providers-public.cjs.dev.js +0 -32
  182. package/providers/public/dist/wagmi-core-providers-public.cjs.js +0 -7
  183. package/providers/public/dist/wagmi-core-providers-public.cjs.prod.js +0 -32
  184. package/providers/public/dist/wagmi-core-providers-public.esm.js +0 -28
@@ -1,23 +0,0 @@
1
- import { Narrow, TypedData, TypedDataDomain, TypedDataToPrimitiveTypes } from 'abitype';
2
- export declare type SignTypedDataArgs<TTypedData = unknown> = {
3
- /** Domain or domain signature for origin or contract */
4
- domain: TypedDataDomain;
5
- /** Named list of all type definitions */
6
- types: Narrow<TTypedData>;
7
- } & (TTypedData extends TypedData ? TypedDataToPrimitiveTypes<TTypedData> extends infer TSchema ? TSchema[keyof TSchema] extends infer TValue ? {
8
- [key: string]: any;
9
- } extends TValue ? {
10
- /**
11
- * Data to sign
12
- *
13
- * Use a [const assertion](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-4.html#const-assertions) on {@link types} for type inference.
14
- */
15
- value: {
16
- [key: string]: unknown;
17
- };
18
- } : {
19
- /** Data to sign */
20
- value: TValue;
21
- } : never : never : never);
22
- export declare type SignTypedDataResult = string;
23
- export declare function signTypedData<TTypedData extends TypedData>({ domain, types, value, }: SignTypedDataArgs<TTypedData>): Promise<SignTypedDataResult>;
@@ -1,6 +0,0 @@
1
- import { Chain } from '../../types';
2
- export declare type SwitchNetworkArgs = {
3
- chainId: number;
4
- };
5
- export declare type SwitchNetworkResult = Chain;
6
- export declare function switchNetwork({ chainId, }: SwitchNetworkArgs): Promise<SwitchNetworkResult>;
@@ -1,12 +0,0 @@
1
- import { Connector } from '../../connectors';
2
- import { Provider } from '../../types';
3
- import { GetAccountResult } from './getAccount';
4
- export declare type WatchAccountCallback<TProvider extends Provider = Provider> = (data: GetAccountResult<TProvider>) => void;
5
- export declare type WatchAccountConfig = {
6
- selector?({ address, connector, status, }: {
7
- address?: string;
8
- connector?: Connector;
9
- status: GetAccountResult['status'];
10
- }): any;
11
- };
12
- export declare function watchAccount<TProvider extends Provider>(callback: WatchAccountCallback<TProvider>, { selector }?: WatchAccountConfig): () => void;
@@ -1,10 +0,0 @@
1
- import { Chain } from '../../types';
2
- import { GetNetworkResult } from './getNetwork';
3
- export declare type WatchNetworkCallback = (data: GetNetworkResult) => void;
4
- export declare type WatchNetworkConfig = {
5
- selector?({ chainId, chains }: {
6
- chainId?: number;
7
- chains?: Chain[];
8
- }): any;
9
- };
10
- export declare function watchNetwork(callback: WatchNetworkCallback, { selector }?: WatchNetworkConfig): () => void;
@@ -1,5 +0,0 @@
1
- import { Signer } from '../../types';
2
- import { FetchSignerArgs, FetchSignerResult } from './fetchSigner';
3
- export declare type WatchSignerArgs = FetchSignerArgs;
4
- export declare type WatchSignerCallback<TSigner extends Signer = Signer> = (data: FetchSignerResult<TSigner>) => void;
5
- export declare function watchSigner<TSigner extends Signer = Signer>({ chainId }: WatchSignerArgs, callback: WatchSignerCallback<TSigner>): () => void;
@@ -1,21 +0,0 @@
1
- import { Address, ResolvedConfig } from 'abitype';
2
- import { Unit } from '../../types';
3
- export declare type FetchTokenArgs = {
4
- /** Address of ERC-20 token */
5
- address: Address;
6
- /** Chain id to use for provider */
7
- chainId?: number;
8
- /** Units for formatting output */
9
- formatUnits?: Unit | number;
10
- };
11
- export declare type FetchTokenResult = {
12
- address: Address;
13
- decimals: ResolvedConfig['IntType'];
14
- name: string;
15
- symbol: string;
16
- totalSupply: {
17
- formatted: string;
18
- value: ResolvedConfig['BigIntType'];
19
- };
20
- };
21
- export declare function fetchToken({ address, chainId, formatUnits: units, }: FetchTokenArgs): Promise<FetchTokenResult>;
@@ -1,113 +0,0 @@
1
- import { Abi, AbiEvent, AbiFunction, AbiParameter, AbiParameterToPrimitiveType, AbiParametersToPrimitiveTypes, Address, ExtractAbiEvent, ExtractAbiEventNames, Narrow, ResolvedConfig } from 'abitype';
2
- import { Contract as EthersContract, Signer, ethers, providers } from 'ethers';
3
- import { AbiItemName, Event, GetOverridesForAbiStateMutability } from '../../types/contracts';
4
- import { CountOccurrences, IsUnknown, UnionToIntersection } from '../../types/utils';
5
- export declare type GetContractArgs<TAbi extends Abi | readonly unknown[] = Abi> = {
6
- /** Contract address */
7
- address: string;
8
- /** Contract ABI */
9
- abi: Narrow<TAbi>;
10
- /** Signer or provider to attach to contract */
11
- signerOrProvider?: Signer | providers.Provider;
12
- };
13
- export declare type GetContractResult<TAbi = unknown> = TAbi extends Abi ? Contract<TAbi> & EthersContract : EthersContract;
14
- export declare function getContract<TAbi extends Abi | readonly unknown[]>({ address, abi, signerOrProvider, }: GetContractArgs<TAbi>): GetContractResult<TAbi>;
15
- declare type PropertyKeys = 'address' | 'attach' | 'connect' | 'deployed' | 'interface' | 'resolvedAddress';
16
- declare type FunctionKeys = 'callStatic' | 'estimateGas' | 'functions' | 'populateTransaction';
17
- declare type EventKeys = 'emit' | 'filters' | 'listenerCount' | 'listeners' | 'off' | 'on' | 'once' | 'queryFilter' | 'removeAllListeners' | 'removeListener';
18
- declare type BaseContract<TContract extends Record<keyof Pick<EthersContract, PropertyKeys | FunctionKeys | EventKeys>, unknown>> = Omit<EthersContract, PropertyKeys | FunctionKeys | EventKeys> & TContract;
19
- declare type InterfaceKeys = 'events' | 'functions';
20
- declare type BaseInterface<Interface extends Record<keyof Pick<ethers.utils.Interface, InterfaceKeys>, unknown>> = Omit<ethers.utils.Interface, InterfaceKeys> & Interface;
21
- export declare type Contract<TAbi extends Abi, _Functions = Functions<TAbi>> = _Functions & BaseContract<{
22
- address: Address;
23
- resolvedAddress: Promise<Address>;
24
- attach(addressOrName: Address | string): Contract<TAbi>;
25
- connect(signerOrProvider: ethers.Signer | ethers.providers.Provider | string): Contract<TAbi>;
26
- deployed(): Promise<Contract<TAbi>>;
27
- interface: BaseInterface<{
28
- events: InterfaceEvents<TAbi>;
29
- functions: InterfaceFunctions<TAbi>;
30
- }>;
31
- callStatic: _Functions;
32
- estimateGas: Functions<TAbi, {
33
- ReturnType: ResolvedConfig['BigIntType'];
34
- }>;
35
- functions: Functions<TAbi, {
36
- ReturnTypeAsArray: true;
37
- }>;
38
- populateTransaction: Functions<TAbi, {
39
- ReturnType: ethers.PopulatedTransaction;
40
- }>;
41
- emit<TEventName extends ExtractAbiEventNames<TAbi> | ethers.EventFilter>(eventName: TEventName, ...args: AbiParametersToPrimitiveTypes<ExtractAbiEvent<TAbi, TEventName extends string ? TEventName : ExtractAbiEventNames<TAbi>>['inputs']> extends infer TArgs extends readonly unknown[] ? TArgs : never): boolean;
42
- filters: Filters<TAbi>;
43
- listenerCount(): number;
44
- listenerCount<TEventName extends ExtractAbiEventNames<TAbi>>(eventName: TEventName): number;
45
- listenerCount(eventFilter: ethers.EventFilter): number;
46
- listeners(): Array<(...args: any[]) => void>;
47
- listeners<TEventName extends ExtractAbiEventNames<TAbi>>(eventName: TEventName): Array<Listener<TAbi, TEventName>>;
48
- listeners(eventFilter: ethers.EventFilter): Array<Listener<TAbi, ExtractAbiEventNames<TAbi>>>;
49
- off: EventListener<TAbi>;
50
- on: EventListener<TAbi>;
51
- once: EventListener<TAbi>;
52
- queryFilter<TEventName extends ExtractAbiEventNames<TAbi>>(event: TEventName, fromBlockOrBlockhash?: string | number, toBlock?: string | number): Promise<Array<ethers.Event>>;
53
- queryFilter(eventFilter: ethers.EventFilter, fromBlockOrBlockhash?: string | number, toBlock?: string | number): Promise<Array<ethers.Event>>;
54
- removeAllListeners(eventName?: ExtractAbiEventNames<TAbi>): Contract<TAbi>;
55
- removeAllListeners(eventFilter: ethers.EventFilter): Contract<TAbi>;
56
- removeListener: EventListener<TAbi>;
57
- }>;
58
- declare type Functions<TAbi extends Abi, Options extends {
59
- ReturnType?: any;
60
- ReturnTypeAsArray?: boolean;
61
- } = {
62
- ReturnTypeAsArray: false;
63
- }> = UnionToIntersection<{
64
- [K in keyof TAbi]: TAbi[K] extends infer TAbiFunction extends AbiFunction & {
65
- type: 'function';
66
- } ? {
67
- [K in CountOccurrences<TAbi, {
68
- name: TAbiFunction['name'];
69
- }> extends 1 ? AbiItemName<TAbiFunction> : AbiItemName<TAbiFunction, true>]: (...args: [
70
- ...args: TAbiFunction['inputs'] extends infer TInputs extends readonly AbiParameter[] ? AbiParametersToPrimitiveTypes<TInputs> : never,
71
- overrides?: GetOverridesForAbiStateMutability<TAbiFunction['stateMutability']>
72
- ]) => Promise<IsUnknown<Options['ReturnType']> extends true ? AbiFunctionReturnType<TAbiFunction> extends infer TAbiFunctionReturnType ? Options['ReturnTypeAsArray'] extends true ? [TAbiFunctionReturnType] : TAbiFunctionReturnType : never : Options['ReturnType']>;
73
- } : never;
74
- }[number]>;
75
- declare type AbiFunctionReturnType<TAbiFunction extends AbiFunction & {
76
- type: 'function';
77
- }> = ({
78
- payable: ethers.ContractTransaction;
79
- nonpayable: ethers.ContractTransaction;
80
- } & {
81
- [_ in 'pure' | 'view']: TAbiFunction['outputs']['length'] extends infer TLength ? TLength extends 0 ? void : TLength extends 1 ? AbiParameterToPrimitiveType<TAbiFunction['outputs'][0]> : {
82
- [Output in TAbiFunction['outputs'][number] as Output['name'] extends '' ? never : Output['name']]: AbiParameterToPrimitiveType<Output>;
83
- } & AbiParametersToPrimitiveTypes<TAbiFunction['outputs']> : never;
84
- })[TAbiFunction['stateMutability']];
85
- declare type InterfaceFunctions<TAbi extends Abi> = UnionToIntersection<{
86
- [K in keyof TAbi]: TAbi[K] extends infer TAbiFunction extends AbiFunction & {
87
- type: 'function';
88
- } ? {
89
- [K in AbiItemName<TAbiFunction, true>]: ethers.utils.FunctionFragment;
90
- } : never;
91
- }[number]>;
92
- declare type InterfaceEvents<TAbi extends Abi> = UnionToIntersection<{
93
- [K in keyof TAbi]: TAbi[K] extends infer TAbiEvent extends AbiEvent ? {
94
- [K in AbiItemName<TAbiEvent, true>]: ethers.utils.EventFragment;
95
- } : never;
96
- }[number]>;
97
- export interface EventListener<TAbi extends Abi> {
98
- <TEventName extends ExtractAbiEventNames<TAbi>>(eventName: TEventName, listener: Listener<TAbi, TEventName>): Contract<TAbi>;
99
- (eventFilter: ethers.EventFilter, listener: Listener<TAbi, ExtractAbiEventNames<TAbi>>): Contract<TAbi>;
100
- }
101
- declare type Listener<TAbi extends Abi, TEventName extends string, TAbiEvent extends AbiEvent = ExtractAbiEvent<TAbi, TEventName>> = AbiParametersToPrimitiveTypes<TAbiEvent['inputs']> extends infer TArgs extends readonly unknown[] ? (...args: [...args: TArgs, event: Event<TAbiEvent>]) => void : never;
102
- declare type Filters<TAbi extends Abi> = UnionToIntersection<{
103
- [K in keyof TAbi]: TAbi[K] extends infer TAbiEvent extends AbiEvent ? {
104
- [K in CountOccurrences<TAbi, {
105
- name: TAbiEvent['name'];
106
- }> extends 1 ? AbiItemName<TAbiEvent> : AbiItemName<TAbiEvent, true>]: (...args: TAbiEvent['inputs'] extends infer TAbiParameters extends readonly (AbiParameter & {
107
- indexed?: boolean;
108
- })[] ? {
109
- [K in keyof TAbiParameters]: TAbiParameters[K]['indexed'] extends true ? AbiParameterToPrimitiveType<TAbiParameters[K]> | null : null;
110
- } : never) => ethers.EventFilter;
111
- } : never;
112
- }[number]>;
113
- export {};
@@ -1,11 +0,0 @@
1
- export { fetchToken, type FetchTokenArgs, type FetchTokenResult, } from './fetchToken';
2
- export { prepareWriteContract, type PrepareWriteContractConfig, type PrepareWriteContractResult, } from './prepareWriteContract';
3
- export { getContract, type GetContractArgs, type GetContractResult, } from './getContract';
4
- export { multicall, type MulticallConfig, type MulticallResult, } from './multicall';
5
- export { readContract, type ReadContractConfig, type ReadContractResult, } from './readContract';
6
- export { readContracts, type ReadContractsConfig, type ReadContractsResult, } from './readContracts';
7
- export { watchContractEvent } from './watchContractEvent';
8
- export { watchMulticall, type WatchMulticallConfig, type WatchMulticallCallback, } from './watchMulticall';
9
- export { watchReadContract, type WatchReadContractConfig, type WatchReadContractCallback, } from './watchReadContract';
10
- export { watchReadContracts, type WatchReadContractsConfig, type WatchReadContractsCallback, } from './watchReadContracts';
11
- export { writeContract, type WriteContractArgs, type WriteContractPreparedArgs, type WriteContractResult, type WriteContractUnpreparedArgs, } from './writeContract';
@@ -1,17 +0,0 @@
1
- import { Abi } from 'abitype';
2
- import { ContractsConfig, ContractsResult, GetOverridesForAbiStateMutability } from '../../types/contracts';
3
- export declare type MulticallConfig<TContracts extends unknown[]> = {
4
- /** Failures in the multicall will fail silently */
5
- allowFailure?: boolean;
6
- /** Chain id to use for provider */
7
- chainId?: number;
8
- /** Contracts to query */
9
- contracts: readonly [...ContractsConfig<TContracts>];
10
- /** Call overrides */
11
- overrides?: GetOverridesForAbiStateMutability<'pure'> | GetOverridesForAbiStateMutability<'view'>;
12
- };
13
- export declare type MulticallResult<TContracts extends unknown[]> = ContractsResult<TContracts>;
14
- export declare function multicall<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TContracts extends {
15
- abi: TAbi;
16
- functionName: TFunctionName;
17
- }[]>({ allowFailure, chainId, contracts, overrides, }: MulticallConfig<TContracts>): Promise<MulticallResult<TContracts>>;
@@ -1,47 +0,0 @@
1
- import { Abi, Address, ExtractAbiFunction } from 'abitype';
2
- import { PopulatedTransaction } from 'ethers/lib/ethers';
3
- import { Signer } from '../../types';
4
- import { DefaultOptions, GetConfig, GetOverridesForAbiStateMutability, Options } from '../../types/contracts';
5
- export declare type PrepareWriteContractConfig<TAbi = Abi, TFunctionName = string, TSigner extends Signer = Signer, TOptions extends Options = DefaultOptions> = GetConfig<{
6
- abi: TAbi;
7
- functionName: TFunctionName;
8
- /** Chain id to use for provider */
9
- chainId?: number;
10
- /** Overrides */
11
- overrides?: GetOverridesForAbiStateMutability<[
12
- TAbi,
13
- TFunctionName
14
- ] extends [
15
- infer TAbi_ extends Abi,
16
- infer TFunctionName_ extends string
17
- ] ? ExtractAbiFunction<TAbi_, TFunctionName_>['stateMutability'] : 'nonpayable' | 'payable'>;
18
- /** Custom signer */
19
- signer?: TSigner | null;
20
- }, 'nonpayable' | 'payable', TOptions>;
21
- export declare type PrepareWriteContractResult<TAbi = Abi, TFunctionName extends string = string> = {
22
- abi: TAbi extends Abi ? [ExtractAbiFunction<TAbi, TFunctionName>] : readonly unknown[];
23
- address: string;
24
- chainId?: number;
25
- functionName: TFunctionName;
26
- mode: 'prepared';
27
- request: PopulatedTransaction & {
28
- to: Address;
29
- gasLimit: NonNullable<PopulatedTransaction['gasLimit']>;
30
- };
31
- };
32
- /**
33
- * @description Prepares the parameters required for a contract write transaction.
34
- *
35
- * Returns config to be passed through to `writeContract`.
36
- *
37
- * @example
38
- * import { prepareWriteContract, writeContract } from '@wagmi/core'
39
- *
40
- * const config = await prepareWriteContract({
41
- * address: '0x...',
42
- * abi: wagmiAbi,
43
- * functionName: 'mint',
44
- * })
45
- * const result = await writeContract(config)
46
- */
47
- export declare function prepareWriteContract<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TSigner extends Signer = Signer>({ abi, address, args, chainId, functionName, overrides, signer: signer_, }: PrepareWriteContractConfig<TAbi, TFunctionName, TSigner>): Promise<PrepareWriteContractResult<TAbi, TFunctionName>>;
@@ -1,15 +0,0 @@
1
- import { Abi } from 'abitype';
2
- import { DefaultOptions, GetConfig, GetOverridesForAbiStateMutability, GetReturnType, Options } from '../../types/contracts';
3
- export declare type ReadContractConfig<TAbi = Abi, TFunctionName = string, TOptions extends Options = DefaultOptions> = GetConfig<{
4
- abi: TAbi;
5
- functionName: TFunctionName;
6
- /** Chain id to use for provider */
7
- chainId?: number;
8
- /** Call overrides */
9
- overrides?: GetOverridesForAbiStateMutability<'pure' | 'view'>;
10
- }, 'pure' | 'view', TOptions>;
11
- export declare type ReadContractResult<TAbi = Abi, TFunctionName = string> = GetReturnType<{
12
- abi: TAbi;
13
- functionName: TFunctionName;
14
- }>;
15
- export declare function readContract<TAbi extends Abi | readonly unknown[], TFunctionName extends string>({ address, args, chainId, abi, functionName, overrides, }: ReadContractConfig<TAbi, TFunctionName>): Promise<ReadContractResult<TAbi, TFunctionName>>;
@@ -1,28 +0,0 @@
1
- import { Abi } from 'abitype';
2
- import { ContractsConfig, ContractsResult, DefaultOptions, GetOverridesForAbiStateMutability, Options as Options_ } from '../../types/contracts';
3
- declare type Options = Options_ & {
4
- isContractsOptional?: boolean;
5
- };
6
- export declare type ReadContractsConfig<TContracts extends unknown[], TOptions extends Options = DefaultOptions, _Contracts = readonly [
7
- ...ContractsConfig<TContracts, {
8
- /** Chain id to use for provider */
9
- chainId?: number;
10
- }, TOptions>
11
- ]> = {
12
- /** Failures in the multicall will fail silently */
13
- allowFailure?: boolean;
14
- /** Call overrides */
15
- overrides?: GetOverridesForAbiStateMutability<'pure' | 'view'>;
16
- } & (TOptions['isContractsOptional'] extends true ? {
17
- /** Contracts to query */
18
- contracts?: _Contracts;
19
- } : {
20
- /** Contracts to query */
21
- contracts: _Contracts;
22
- });
23
- export declare type ReadContractsResult<TContracts extends unknown[]> = ContractsResult<TContracts>;
24
- export declare function readContracts<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TContracts extends {
25
- abi: TAbi;
26
- functionName: TFunctionName;
27
- }[]>({ allowFailure, contracts, overrides, }: ReadContractsConfig<TContracts>): Promise<ReadContractsResult<TContracts>>;
28
- export {};
@@ -1,28 +0,0 @@
1
- import { Abi, AbiEvent, AbiParametersToPrimitiveTypes, ExtractAbiEvent, ExtractAbiEventNames, Narrow } from 'abitype';
2
- import { Event } from '../../types/contracts';
3
- import { IsNever, NotEqual, Or } from '../../types/utils';
4
- declare type ContractEventConfig<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = string> = {
5
- /** Contract address */
6
- address: string;
7
- /** Contract ABI */
8
- abi: Narrow<TAbi>;
9
- /** Chain id to use for provider */
10
- chainId?: number;
11
- /** Event to listen for */
12
- eventName: IsNever<TEventName> extends true ? string : TEventName;
13
- /** Receive only a single event */
14
- once?: boolean;
15
- };
16
- declare type GetConfig<T> = T extends {
17
- abi: infer TAbi extends Abi;
18
- } ? ContractEventConfig<TAbi, ExtractAbiEventNames<TAbi>> : T extends {
19
- abi: infer TAbi extends readonly unknown[];
20
- eventName: infer TEventName extends string;
21
- } ? ContractEventConfig<TAbi, TEventName> : ContractEventConfig;
22
- export declare type WatchContractEventConfig<TAbi = Abi, TEventName = string> = GetConfig<{
23
- abi: TAbi;
24
- eventName: TEventName;
25
- }>;
26
- export declare type WatchContractEventCallback<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = string, TAbiEvent extends AbiEvent = TAbi extends Abi ? ExtractAbiEvent<TAbi, TEventName> : never> = AbiParametersToPrimitiveTypes<TAbiEvent['inputs']> extends infer TArgs extends readonly unknown[] ? Or<IsNever<TArgs>, NotEqual<TAbi, Abi>> extends true ? (...args: any) => void : (...args: [...args: TArgs, event: Event<TAbiEvent>]) => void : never;
27
- export declare function watchContractEvent<TAbi extends Abi | readonly unknown[], TEventName extends string>({ address, abi, chainId, eventName, once, }: WatchContractEventConfig<TAbi, TEventName>, callback: WatchContractEventCallback<TAbi, TEventName>): () => void;
28
- export {};
@@ -1,10 +0,0 @@
1
- import { Abi } from 'abitype';
2
- import { MulticallConfig, MulticallResult } from './multicall';
3
- export declare type WatchMulticallConfig<TContracts extends unknown[]> = MulticallConfig<TContracts> & {
4
- listenToBlock?: boolean;
5
- };
6
- export declare type WatchMulticallCallback<TContracts extends unknown[]> = (results: MulticallResult<TContracts>) => void;
7
- export declare function watchMulticall<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TContracts extends {
8
- abi: TAbi;
9
- functionName: TFunctionName;
10
- }[]>(config: WatchMulticallConfig<TContracts>, callback: WatchMulticallCallback<TContracts>): () => void;
@@ -1,7 +0,0 @@
1
- import { Abi, ExtractAbiFunctionNames } from 'abitype';
2
- import { ReadContractConfig, ReadContractResult } from './readContract';
3
- export declare type WatchReadContractConfig<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = ReadContractConfig<TAbi, TFunctionName> & {
4
- listenToBlock?: boolean;
5
- };
6
- export declare type WatchReadContractCallback<TAbi extends Abi | readonly unknown[], TFunctionName extends string> = (result: ReadContractResult<TAbi, TFunctionName>) => void;
7
- export declare function watchReadContract<TAbi extends Abi | readonly unknown[], TFunctionName extends TAbi extends Abi ? ExtractAbiFunctionNames<TAbi, 'view' | 'pure'> : string>(config: WatchReadContractConfig<TAbi, TFunctionName>, callback: WatchReadContractCallback<TAbi, TFunctionName>): () => void;
@@ -1,10 +0,0 @@
1
- import { Abi } from 'abitype';
2
- import { ReadContractsConfig, ReadContractsResult } from './readContracts';
3
- export declare type WatchReadContractsConfig<TContracts extends unknown[]> = ReadContractsConfig<TContracts> & {
4
- listenToBlock?: boolean;
5
- };
6
- export declare type WatchReadContractsCallback<TContracts extends unknown[]> = (results: ReadContractsResult<TContracts>) => void;
7
- export declare function watchReadContracts<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TContracts extends {
8
- abi: TAbi;
9
- functionName: TFunctionName;
10
- }[]>(config: WatchReadContractsConfig<TContracts>, callback: WatchReadContractsCallback<TContracts>): () => void;
@@ -1,72 +0,0 @@
1
- import { Abi, Address, ExtractAbiFunction } from 'abitype';
2
- import { PopulatedTransaction } from 'ethers';
3
- import { Signer } from '../../types';
4
- import { DefaultOptions, GetConfig, GetOverridesForAbiStateMutability, Options as Options_ } from '../../types/contracts';
5
- import { SendTransactionResult } from '../transactions';
6
- declare type Options = Options_ & {
7
- isRequestOptional?: boolean;
8
- };
9
- declare type Request = PopulatedTransaction & {
10
- to: Address;
11
- gasLimit: NonNullable<PopulatedTransaction['gasLimit']>;
12
- };
13
- export declare type WriteContractPreparedArgs<TOptions extends Options = DefaultOptions> = {
14
- /**
15
- * `recklesslyUnprepared`: Allow to pass through unprepared config. Note: This has
16
- * [UX pitfalls](https://wagmi.sh/docs/prepare-hooks/intro#ux-pitfalls-without-prepare-hooks),
17
- * it is highly recommended to not use this and instead prepare the request upfront
18
- * using the {@link prepareWriteContract} function.
19
- *
20
- * `prepared`: The request has been prepared with parameters required for sending a transaction
21
- * via the {@link prepareWriteContract} function
22
- * */
23
- mode: 'prepared';
24
- args?: never;
25
- overrides?: never;
26
- } & (TOptions['isRequestOptional'] extends true ? {
27
- /** The prepared request. */
28
- request?: Request;
29
- } : {
30
- /** The prepared request. */
31
- request: Request;
32
- });
33
- export declare type WriteContractUnpreparedArgs<TAbi = Abi, TFunctionName = string, TOptions extends Options = DefaultOptions> = {
34
- mode: 'recklesslyUnprepared';
35
- request?: never;
36
- } & GetConfig<{
37
- abi: TAbi;
38
- functionName: TFunctionName;
39
- /** Call overrides */
40
- overrides?: GetOverridesForAbiStateMutability<[
41
- TAbi,
42
- TFunctionName
43
- ] extends [
44
- infer TAbi_ extends Abi,
45
- infer TFunctionName_ extends string
46
- ] ? ExtractAbiFunction<TAbi_, TFunctionName_>['stateMutability'] : 'nonpayable' | 'payable'>;
47
- }, 'nonpayable' | 'payable', TOptions>;
48
- export declare type WriteContractArgs<TAbi = Abi, TFunctionName = string, TOptions extends Options = DefaultOptions> = Omit<GetConfig<{
49
- abi: TAbi;
50
- functionName: TFunctionName;
51
- /** Chain id to use for provider */
52
- chainId?: number;
53
- }, 'nonpayable' | 'payable', TOptions>, 'args'> & (WriteContractUnpreparedArgs<TAbi, TFunctionName, TOptions> | WriteContractPreparedArgs<TOptions>);
54
- export declare type WriteContractResult = SendTransactionResult;
55
- /**
56
- * @description Function to call a contract write method.
57
- *
58
- * It is recommended to pair this with the {@link prepareWriteContract} function
59
- * to avoid [UX pitfalls](https://wagmi.sh/docs/prepare-hooks/intro#ux-pitfalls-without-prepare-hooks).
60
- *
61
- * @example
62
- * import { prepareWriteContract, writeContract } from '@wagmi/core'
63
- *
64
- * const config = await prepareWriteContract({
65
- * address: '0x...',
66
- * abi: wagmiAbi,
67
- * functionName: 'mint',
68
- * })
69
- * const result = await writeContract(config)
70
- */
71
- export declare function writeContract<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TSigner extends Signer = Signer>({ address, args, chainId, abi, functionName, mode, overrides, request: request_, }: WriteContractArgs<TAbi, TFunctionName>): Promise<WriteContractResult>;
72
- export {};
@@ -1,9 +0,0 @@
1
- import { Address } from 'abitype';
2
- export declare type FetchEnsAddressArgs = {
3
- /** Chain id to use for provider */
4
- chainId?: number;
5
- /** ENS name to resolve */
6
- name: string;
7
- };
8
- export declare type FetchEnsAddressResult = Address | null;
9
- export declare function fetchEnsAddress({ chainId, name, }: FetchEnsAddressArgs): Promise<FetchEnsAddressResult>;
@@ -1,8 +0,0 @@
1
- export declare type FetchEnsAvatarArgs = {
2
- /** Address or ENS name */
3
- addressOrName: string;
4
- /** Chain id to use for provider */
5
- chainId?: number;
6
- };
7
- export declare type FetchEnsAvatarResult = string | null;
8
- export declare function fetchEnsAvatar({ addressOrName, chainId, }: FetchEnsAvatarArgs): Promise<FetchEnsAvatarResult>;
@@ -1,9 +0,0 @@
1
- import { Address } from 'abitype';
2
- export declare type FetchEnsNameArgs = {
3
- /** Address to lookup */
4
- address: Address;
5
- /** Chain id to use for provider */
6
- chainId?: number;
7
- };
8
- export declare type FetchEnsNameResult = string | null;
9
- export declare function fetchEnsName({ address, chainId, }: FetchEnsNameArgs): Promise<FetchEnsNameResult>;
@@ -1,9 +0,0 @@
1
- import { providers } from 'ethers';
2
- export declare type FetchEnsResolverArgs = {
3
- /** Chain id to use for provider */
4
- chainId?: number;
5
- /** ENS name to resolve */
6
- name: string;
7
- };
8
- export declare type FetchEnsResolverResult = providers.Resolver | null;
9
- export declare function fetchEnsResolver({ chainId, name, }: FetchEnsResolverArgs): Promise<FetchEnsResolverResult>;
@@ -1,4 +0,0 @@
1
- export { fetchEnsAddress, type FetchEnsAddressArgs, type FetchEnsAddressResult, } from './fetchEnsAddress';
2
- export { fetchEnsAvatar, type FetchEnsAvatarArgs, type FetchEnsAvatarResult, } from './fetchEnsAvatar';
3
- export { fetchEnsName, type FetchEnsNameArgs, type FetchEnsNameResult, } from './fetchEnsName';
4
- export { fetchEnsResolver, type FetchEnsResolverArgs, type FetchEnsResolverResult, } from './fetchEnsResolver';
@@ -1,6 +0,0 @@
1
- export { connect, disconnect, fetchBalance, fetchSigner, getAccount, getNetwork, signMessage, signTypedData, switchNetwork, watchAccount, watchNetwork, watchSigner, type ConnectArgs, type ConnectResult, type FetchBalanceArgs, type FetchBalanceResult, type FetchSignerArgs, type FetchSignerResult, type GetAccountResult, type GetNetworkResult, type SignMessageArgs, type SignMessageResult, type SignTypedDataArgs, type SignTypedDataResult, type SwitchNetworkArgs, type SwitchNetworkResult, type WatchAccountCallback, type WatchNetworkCallback, type WatchSignerCallback, } from './accounts';
2
- export { fetchToken, getContract, multicall, prepareWriteContract, readContract, readContracts, watchContractEvent, watchMulticall, watchReadContract, watchReadContracts, writeContract, type FetchTokenArgs, type FetchTokenResult, type GetContractArgs, type GetContractResult, type MulticallConfig, type MulticallResult, type PrepareWriteContractConfig, type PrepareWriteContractResult, type ReadContractConfig, type ReadContractResult, type ReadContractsConfig, type ReadContractsResult, type WatchMulticallConfig, type WatchMulticallCallback, type WatchReadContractConfig, type WatchReadContractCallback, type WatchReadContractsConfig, type WatchReadContractsCallback, type WriteContractArgs, type WriteContractPreparedArgs, type WriteContractResult, type WriteContractUnpreparedArgs, } from './contracts';
3
- export { fetchEnsAddress, fetchEnsAvatar, fetchEnsName, fetchEnsResolver, type FetchEnsAddressArgs, type FetchEnsAddressResult, type FetchEnsAvatarArgs, type FetchEnsAvatarResult, type FetchEnsNameArgs, type FetchEnsNameResult, type FetchEnsResolverArgs, type FetchEnsResolverResult, } from './ens';
4
- export { fetchBlockNumber, fetchFeeData, watchBlockNumber, type FetchBlockNumberArgs, type FetchBlockNumberResult, type FetchFeeDataArgs, type FetchFeeDataResult, type WatchBlockNumberArgs, type WatchBlockNumberCallback, } from './network-status';
5
- export { getProvider, getWebSocketProvider, watchProvider, watchWebSocketProvider, type GetProviderArgs, type GetProviderResult, type GetWebSocketProviderArgs, type GetWebSocketProviderResult, type WatchProviderCallback, type WatchWebSocketProviderCallback, } from './providers';
6
- export { fetchTransaction, prepareSendTransaction, sendTransaction, waitForTransaction, type FetchTransactionArgs, type FetchTransactionResult, type PrepareSendTransactionArgs, type PrepareSendTransactionResult, type SendTransactionArgs, type SendTransactionPreparedRequest, type SendTransactionResult, type SendTransactionUnpreparedRequest, type WaitForTransactionArgs, type WaitForTransactionResult, } from './transactions';
@@ -1,5 +0,0 @@
1
- export declare type FetchBlockNumberArgs = {
2
- chainId?: number;
3
- };
4
- export declare type FetchBlockNumberResult = number;
5
- export declare function fetchBlockNumber({ chainId, }?: FetchBlockNumberArgs): Promise<FetchBlockNumberResult>;
@@ -1,16 +0,0 @@
1
- import { providers } from 'ethers';
2
- import { Unit } from '../../types';
3
- export declare type FetchFeeDataArgs = {
4
- /** Units for formatting output */
5
- formatUnits?: Unit | number;
6
- /** Chain id to use for provider */
7
- chainId?: number;
8
- };
9
- export declare type FetchFeeDataResult = providers.FeeData & {
10
- formatted: {
11
- gasPrice: string | null;
12
- maxFeePerGas: string | null;
13
- maxPriorityFeePerGas: string | null;
14
- };
15
- };
16
- export declare function fetchFeeData({ chainId, formatUnits: units, }?: FetchFeeDataArgs): Promise<FetchFeeDataResult>;
@@ -1,3 +0,0 @@
1
- export { fetchBlockNumber, type FetchBlockNumberArgs, type FetchBlockNumberResult, } from './fetchBlockNumber';
2
- export { fetchFeeData, type FetchFeeDataResult, type FetchFeeDataArgs, } from './fetchFeeData';
3
- export { watchBlockNumber, type WatchBlockNumberArgs, type WatchBlockNumberCallback, } from './watchBlockNumber';
@@ -1,7 +0,0 @@
1
- import { FetchBlockNumberResult } from './fetchBlockNumber';
2
- export declare type WatchBlockNumberArgs = {
3
- chainId?: number;
4
- listen: boolean;
5
- };
6
- export declare type WatchBlockNumberCallback = (blockNumber: FetchBlockNumberResult) => void;
7
- export declare function watchBlockNumber(args: WatchBlockNumberArgs, callback: WatchBlockNumberCallback): () => void;
@@ -1,7 +0,0 @@
1
- import { Provider } from '../../types';
2
- export declare type GetProviderArgs = {
3
- /** Chain id to use for provider */
4
- chainId?: number;
5
- };
6
- export declare type GetProviderResult<TProvider extends Provider = Provider> = TProvider;
7
- export declare function getProvider<TProvider extends Provider = Provider>({ chainId, }?: GetProviderArgs): GetProviderResult<TProvider>;
@@ -1,7 +0,0 @@
1
- import { WebSocketProvider } from '../../types';
2
- export declare type GetWebSocketProviderArgs = {
3
- /** Chain id to use for provider */
4
- chainId?: number;
5
- };
6
- export declare type GetWebSocketProviderResult<TWebSocketProvider extends WebSocketProvider = WebSocketProvider> = TWebSocketProvider | undefined;
7
- export declare function getWebSocketProvider<TWebSocketProvider extends WebSocketProvider = WebSocketProvider>({ chainId, }?: GetWebSocketProviderArgs): GetWebSocketProviderResult<TWebSocketProvider>;
@@ -1,4 +0,0 @@
1
- export { getProvider, type GetProviderArgs, type GetProviderResult, } from './getProvider';
2
- export { getWebSocketProvider, type GetWebSocketProviderArgs, type GetWebSocketProviderResult, } from './getWebSocketProvider';
3
- export { watchProvider, type WatchProviderCallback } from './watchProvider';
4
- export { watchWebSocketProvider, type WatchWebSocketProviderCallback, } from './watchWebSocketProvider';
@@ -1,4 +0,0 @@
1
- import { Provider } from '../../types';
2
- import { GetProviderArgs, GetProviderResult } from './getProvider';
3
- export declare type WatchProviderCallback<TProvider extends Provider = Provider> = (provider: GetProviderResult<TProvider>) => void;
4
- export declare function watchProvider<TProvider extends Provider = Provider>(args: GetProviderArgs, callback: WatchProviderCallback<TProvider>): () => void;
@@ -1,4 +0,0 @@
1
- import { WebSocketProvider } from '../../types';
2
- import { GetWebSocketProviderArgs, GetWebSocketProviderResult } from './getWebSocketProvider';
3
- export declare type WatchWebSocketProviderCallback<TWebSocketProvider extends WebSocketProvider = WebSocketProvider> = (webSocketProvider: GetWebSocketProviderResult<TWebSocketProvider>) => void;
4
- export declare function watchWebSocketProvider<TWebSocketProvider extends WebSocketProvider = WebSocketProvider>(args: GetWebSocketProviderArgs, callback: WatchWebSocketProviderCallback<TWebSocketProvider>): () => void;
@@ -1,21 +0,0 @@
1
- import { providers } from 'ethers';
2
- import { Hash } from '../../types';
3
- export declare type FetchTransactionArgs = {
4
- /** Chain ID used to validate if the signer is connected to the target chain */
5
- chainId?: number;
6
- /** Transaction hash */
7
- hash: Hash;
8
- };
9
- export declare type FetchTransactionResult = providers.TransactionResponse;
10
- /**
11
- * @description Fetches transaction for hash
12
- *
13
- * @example
14
- * import { fetchTransaction } from '@wagmi/core'
15
- *
16
- * const transaction = await fetchTransaction({
17
- * chainId: 1,
18
- * hash: '0x...',
19
- * })
20
- */
21
- export declare function fetchTransaction({ chainId, hash, }: FetchTransactionArgs): Promise<FetchTransactionResult>;
@@ -1,4 +0,0 @@
1
- export { fetchTransaction, type FetchTransactionArgs, type FetchTransactionResult, } from './fetchTransaction';
2
- export { prepareSendTransaction, type PrepareSendTransactionArgs, type PrepareSendTransactionResult, } from './prepareSendTransaction';
3
- export { sendTransaction, type SendTransactionArgs, type SendTransactionPreparedRequest, type SendTransactionResult, type SendTransactionUnpreparedRequest, } from './sendTransaction';
4
- export { waitForTransaction, type WaitForTransactionArgs, type WaitForTransactionResult, } from './waitForTransaction';