@wagmi/core 0.7.6 → 0.7.8
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/{base-5bd9b5ed.d.ts → base-a32d0b91.d.ts} +2 -2
- package/dist/chains.d.ts +1 -1
- package/dist/{chunk-MS4CUBFJ.js → chunk-HEIMP7HQ.js} +131 -31
- package/dist/connectors/coinbaseWallet.d.ts +3 -3
- package/dist/connectors/coinbaseWallet.js +1 -1
- package/dist/connectors/metaMask.d.ts +4 -6
- package/dist/connectors/metaMask.js +36 -43
- package/dist/connectors/mock/index.d.ts +5 -5
- package/dist/connectors/mock/index.js +1 -1
- package/dist/connectors/walletConnect.d.ts +4 -4
- package/dist/connectors/walletConnect.js +13 -5
- package/dist/{contracts-3c4d70a1.d.ts → contracts-3880ee54.d.ts} +24 -24
- package/dist/{index-bacc1c49.d.ts → index-58cffc47.d.ts} +23 -23
- package/dist/index.d.ts +133 -112
- package/dist/index.js +5 -1
- package/dist/{injected-6980e5c3.d.ts → injected-82510902.d.ts} +12 -4
- package/dist/internal.d.ts +2 -2
- package/dist/internal.js +1 -1
- package/dist/providers/alchemy.d.ts +2 -2
- package/dist/providers/infura.d.ts +2 -2
- package/dist/providers/jsonRpc.d.ts +2 -2
- package/dist/providers/public.d.ts +2 -2
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { P as Provider, W as WebSocketProvider, C as Chain, U as Unit, S as Signer, H as Hash, a as ChainProviderFn, b as ProviderWithFallbackConfig } from './index-
|
|
2
|
-
export { C as Chain, a as ChainProviderFn, E as Ethereum, F as FallbackProviderConfig, H as Hash, P as Provider, b as ProviderWithFallbackConfig, S as Signer, U as Unit, W as WebSocketProvider, c as alchemyRpcUrls, d as allChains, e as chain, f as chainId, g as defaultChains, h as defaultL2Chains, i as etherscanBlockExplorers, j as infuraRpcUrls, p as publicRpcUrls, u as units } from './index-
|
|
1
|
+
import { P as Provider, W as WebSocketProvider, C as Chain, U as Unit, S as Signer, H as Hash, a as ChainProviderFn, b as ProviderWithFallbackConfig } from './index-58cffc47.js';
|
|
2
|
+
export { C as Chain, a as ChainProviderFn, E as Ethereum, F as FallbackProviderConfig, H as Hash, P as Provider, b as ProviderWithFallbackConfig, S as Signer, U as Unit, W as WebSocketProvider, c as alchemyRpcUrls, d as allChains, e as chain, f as chainId, g as defaultChains, h as defaultL2Chains, i as etherscanBlockExplorers, j as infuraRpcUrls, p as publicRpcUrls, u as units } from './index-58cffc47.js';
|
|
3
3
|
import { Mutate, StoreApi } from 'zustand/vanilla';
|
|
4
|
-
import { C as Connector, a as ConnectorData } from './base-
|
|
5
|
-
export { C as Connector, a as ConnectorData, b as ConnectorEvents } from './base-
|
|
4
|
+
import { C as Connector, a as ConnectorData } from './base-a32d0b91.js';
|
|
5
|
+
export { C as Connector, a as ConnectorData, b as ConnectorEvents } from './base-a32d0b91.js';
|
|
6
6
|
import * as abitype from 'abitype';
|
|
7
|
-
import { Address, ResolvedConfig, TypedDataDomain, Narrow, TypedData, TypedDataToPrimitiveTypes, Abi, ExtractAbiFunction, ExtractAbiEventNames, AbiParametersToPrimitiveTypes, ExtractAbiEvent, AbiFunction, AbiParameterToPrimitiveType, AbiEvent, ExtractAbiFunctionNames } from 'abitype';
|
|
7
|
+
import { Address, ResolvedConfig, TypedDataDomain, Narrow, TypedData, TypedDataToPrimitiveTypes, Abi, ExtractAbiFunction, ExtractAbiEventNames, AbiParametersToPrimitiveTypes, ExtractAbiEvent, AbiFunction, AbiParameter, AbiParameterToPrimitiveType, AbiEvent, ExtractAbiFunctionNames } from 'abitype';
|
|
8
8
|
export { Address } from 'abitype';
|
|
9
9
|
import { PopulatedTransaction, Signer as Signer$1, providers, Contract as Contract$1, ethers, ContractInterface } from 'ethers';
|
|
10
|
-
import { O as Options$2, D as DefaultOptions, G as GetConfig$1, a as GetOverridesForAbiStateMutability, U as UnionToIntersection, C as CountOccurrences, A as AbiItemName, I as IsUnknown, E as Event, b as ContractsConfig, c as ContractsResult, d as GetReturnType, e as Or, f as IsNever, N as NotEqual } from './contracts-
|
|
11
|
-
export { I as InjectedConnector, a as InjectedConnectorOptions } from './injected-
|
|
10
|
+
import { O as Options$2, D as DefaultOptions, G as GetConfig$1, a as GetOverridesForAbiStateMutability, U as UnionToIntersection, C as CountOccurrences, A as AbiItemName, I as IsUnknown, E as Event, b as ContractsConfig, c as ContractsResult, d as GetReturnType, e as Or, f as IsNever, N as NotEqual } from './contracts-3880ee54.js';
|
|
11
|
+
export { I as InjectedConnector, a as InjectedConnectorOptions } from './injected-82510902.js';
|
|
12
12
|
import 'eventemitter3';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -772,19 +772,21 @@ declare const erc4626ABI: readonly [{
|
|
|
772
772
|
readonly type: "function";
|
|
773
773
|
}];
|
|
774
774
|
|
|
775
|
-
|
|
776
|
-
|
|
775
|
+
type BaseStorage = Pick<Storage, 'getItem' | 'setItem' | 'removeItem'>;
|
|
776
|
+
type ClientStorage = {
|
|
777
777
|
getItem<T>(key: string, defaultState?: T | null): T | null;
|
|
778
778
|
setItem<T>(key: string, value: T | null): void;
|
|
779
779
|
removeItem(key: string): void;
|
|
780
780
|
};
|
|
781
781
|
declare const noopStorage: BaseStorage;
|
|
782
|
-
declare function createStorage({
|
|
783
|
-
|
|
782
|
+
declare function createStorage({ deserialize, key: prefix, serialize, storage, }: {
|
|
783
|
+
deserialize?: <T>(value: string) => T;
|
|
784
784
|
key?: string;
|
|
785
|
+
serialize?: <T>(value: T) => string;
|
|
786
|
+
storage: BaseStorage;
|
|
785
787
|
}): ClientStorage;
|
|
786
788
|
|
|
787
|
-
|
|
789
|
+
type ClientConfig<TProvider extends Provider = Provider, TWebSocketProvider extends WebSocketProvider = WebSocketProvider> = {
|
|
788
790
|
/** Enables reconnecting to last used connector on init */
|
|
789
791
|
autoConnect?: boolean;
|
|
790
792
|
/**
|
|
@@ -810,8 +812,8 @@ declare type ClientConfig<TProvider extends Provider = Provider, TWebSocketProvi
|
|
|
810
812
|
chainId?: number;
|
|
811
813
|
}) => TWebSocketProvider | undefined) | TWebSocketProvider;
|
|
812
814
|
};
|
|
813
|
-
|
|
814
|
-
|
|
815
|
+
type Data$1<TProvider extends Provider> = ConnectorData<TProvider>;
|
|
816
|
+
type State<TProvider extends Provider = Provider, TWebSocketProvider extends WebSocketProvider = WebSocketProvider> = {
|
|
815
817
|
chains?: Connector['chains'];
|
|
816
818
|
connector?: Connector;
|
|
817
819
|
connectors: Connector[];
|
|
@@ -870,14 +872,14 @@ declare class Client<TProvider extends Provider = Provider, TWebSocketProvider e
|
|
|
870
872
|
}
|
|
871
873
|
declare function createClient<TProvider extends Provider = Provider, TWebSocketProvider extends WebSocketProvider = WebSocketProvider>(config: ClientConfig<TProvider, TWebSocketProvider>): Client<TProvider, TWebSocketProvider>;
|
|
872
874
|
|
|
873
|
-
|
|
875
|
+
type ConnectArgs = {
|
|
874
876
|
/** Chain ID to connect to */
|
|
875
877
|
chainId?: number;
|
|
876
878
|
/** Connector to connect */
|
|
877
879
|
connector: Connector;
|
|
878
880
|
};
|
|
879
|
-
|
|
880
|
-
|
|
881
|
+
type Data<TProvider extends Provider = Provider> = Required<ConnectorData<TProvider>>;
|
|
882
|
+
type ConnectResult<TProvider extends Provider = Provider> = {
|
|
881
883
|
account: Data<TProvider>['account'];
|
|
882
884
|
chain: Data<TProvider>['chain'];
|
|
883
885
|
connector: Client<TProvider>['connector'];
|
|
@@ -887,7 +889,7 @@ declare function connect<TProvider extends Provider = Provider>({ chainId, conne
|
|
|
887
889
|
|
|
888
890
|
declare function disconnect(): Promise<void>;
|
|
889
891
|
|
|
890
|
-
|
|
892
|
+
type FetchBalanceArgs = {
|
|
891
893
|
/** Address of balance to check */
|
|
892
894
|
address: Address;
|
|
893
895
|
/** Chain id to use for provider */
|
|
@@ -897,7 +899,7 @@ declare type FetchBalanceArgs = {
|
|
|
897
899
|
/** ERC-20 address */
|
|
898
900
|
token?: Address;
|
|
899
901
|
};
|
|
900
|
-
|
|
902
|
+
type FetchBalanceResult = {
|
|
901
903
|
decimals: ResolvedConfig['IntType'];
|
|
902
904
|
formatted: string;
|
|
903
905
|
symbol: string;
|
|
@@ -905,14 +907,14 @@ declare type FetchBalanceResult = {
|
|
|
905
907
|
};
|
|
906
908
|
declare function fetchBalance({ address, chainId, formatUnits: unit, token, }: FetchBalanceArgs): Promise<FetchBalanceResult>;
|
|
907
909
|
|
|
908
|
-
|
|
910
|
+
type FetchSignerArgs = {
|
|
909
911
|
/** Chain ID to use for signer */
|
|
910
912
|
chainId?: number;
|
|
911
913
|
};
|
|
912
|
-
|
|
914
|
+
type FetchSignerResult<TSigner extends Signer = Signer> = TSigner | null;
|
|
913
915
|
declare function fetchSigner<TSigner extends Signer = Signer>({ chainId, }?: FetchSignerArgs): Promise<FetchSignerResult<TSigner>>;
|
|
914
916
|
|
|
915
|
-
|
|
917
|
+
type GetAccountResult<TProvider extends Provider = Provider> = {
|
|
916
918
|
address: NonNullable<Data$1<TProvider>['account']>;
|
|
917
919
|
connector: NonNullable<Client<TProvider>['connector']>;
|
|
918
920
|
isConnected: true;
|
|
@@ -947,7 +949,7 @@ declare type GetAccountResult<TProvider extends Provider = Provider> = {
|
|
|
947
949
|
};
|
|
948
950
|
declare function getAccount<TProvider extends Provider>(): GetAccountResult<TProvider>;
|
|
949
951
|
|
|
950
|
-
|
|
952
|
+
type GetNetworkResult = {
|
|
951
953
|
chain?: Chain & {
|
|
952
954
|
unsupported?: boolean;
|
|
953
955
|
};
|
|
@@ -955,14 +957,14 @@ declare type GetNetworkResult = {
|
|
|
955
957
|
};
|
|
956
958
|
declare function getNetwork(): GetNetworkResult;
|
|
957
959
|
|
|
958
|
-
|
|
960
|
+
type SignMessageArgs = {
|
|
959
961
|
/** Message to sign with wallet */
|
|
960
962
|
message: string | Uint8Array;
|
|
961
963
|
};
|
|
962
|
-
|
|
964
|
+
type SignMessageResult = ResolvedConfig['BytesType'];
|
|
963
965
|
declare function signMessage(args: SignMessageArgs): Promise<SignMessageResult>;
|
|
964
966
|
|
|
965
|
-
|
|
967
|
+
type SignTypedDataArgs<TTypedData = unknown> = {
|
|
966
968
|
/** Domain or domain signature for origin or contract */
|
|
967
969
|
domain: TypedDataDomain;
|
|
968
970
|
/** Named list of all type definitions */
|
|
@@ -982,17 +984,17 @@ declare type SignTypedDataArgs<TTypedData = unknown> = {
|
|
|
982
984
|
/** Data to sign */
|
|
983
985
|
value: TValue;
|
|
984
986
|
} : never : never : never);
|
|
985
|
-
|
|
987
|
+
type SignTypedDataResult = string;
|
|
986
988
|
declare function signTypedData<TTypedData extends TypedData>({ domain, types, value, }: SignTypedDataArgs<TTypedData>): Promise<SignTypedDataResult>;
|
|
987
989
|
|
|
988
|
-
|
|
990
|
+
type SwitchNetworkArgs = {
|
|
989
991
|
chainId: number;
|
|
990
992
|
};
|
|
991
|
-
|
|
993
|
+
type SwitchNetworkResult = Chain;
|
|
992
994
|
declare function switchNetwork({ chainId, }: SwitchNetworkArgs): Promise<SwitchNetworkResult>;
|
|
993
995
|
|
|
994
|
-
|
|
995
|
-
|
|
996
|
+
type WatchAccountCallback<TProvider extends Provider = Provider> = (data: GetAccountResult<TProvider>) => void;
|
|
997
|
+
type WatchAccountConfig = {
|
|
996
998
|
selector?({ address, connector, status, }: {
|
|
997
999
|
address?: string;
|
|
998
1000
|
connector?: Connector;
|
|
@@ -1001,8 +1003,8 @@ declare type WatchAccountConfig = {
|
|
|
1001
1003
|
};
|
|
1002
1004
|
declare function watchAccount<TProvider extends Provider>(callback: WatchAccountCallback<TProvider>, { selector }?: WatchAccountConfig): () => void;
|
|
1003
1005
|
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
+
type WatchNetworkCallback = (data: GetNetworkResult) => void;
|
|
1007
|
+
type WatchNetworkConfig = {
|
|
1006
1008
|
selector?({ chainId, chains }: {
|
|
1007
1009
|
chainId?: number;
|
|
1008
1010
|
chains?: Chain[];
|
|
@@ -1010,11 +1012,11 @@ declare type WatchNetworkConfig = {
|
|
|
1010
1012
|
};
|
|
1011
1013
|
declare function watchNetwork(callback: WatchNetworkCallback, { selector }?: WatchNetworkConfig): () => void;
|
|
1012
1014
|
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
+
type WatchSignerArgs = FetchSignerArgs;
|
|
1016
|
+
type WatchSignerCallback<TSigner extends Signer = Signer> = (data: FetchSignerResult<TSigner>) => void;
|
|
1015
1017
|
declare function watchSigner<TSigner extends Signer = Signer>({ chainId }: WatchSignerArgs, callback: WatchSignerCallback<TSigner>): () => void;
|
|
1016
1018
|
|
|
1017
|
-
|
|
1019
|
+
type FetchTokenArgs = {
|
|
1018
1020
|
/** Address of ERC-20 token */
|
|
1019
1021
|
address: Address;
|
|
1020
1022
|
/** Chain id to use for provider */
|
|
@@ -1022,7 +1024,7 @@ declare type FetchTokenArgs = {
|
|
|
1022
1024
|
/** Units for formatting output */
|
|
1023
1025
|
formatUnits?: Unit | number;
|
|
1024
1026
|
};
|
|
1025
|
-
|
|
1027
|
+
type FetchTokenResult = {
|
|
1026
1028
|
address: Address;
|
|
1027
1029
|
decimals: ResolvedConfig['IntType'];
|
|
1028
1030
|
name: string;
|
|
@@ -1034,7 +1036,7 @@ declare type FetchTokenResult = {
|
|
|
1034
1036
|
};
|
|
1035
1037
|
declare function fetchToken({ address, chainId, formatUnits: units, }: FetchTokenArgs): Promise<FetchTokenResult>;
|
|
1036
1038
|
|
|
1037
|
-
|
|
1039
|
+
type PrepareWriteContractConfig<TAbi = Abi, TFunctionName = string, TSigner extends Signer = Signer, TOptions extends Options$2 = DefaultOptions> = GetConfig$1<{
|
|
1038
1040
|
abi: TAbi;
|
|
1039
1041
|
functionName: TFunctionName;
|
|
1040
1042
|
/** Chain id to use for provider */
|
|
@@ -1050,7 +1052,7 @@ declare type PrepareWriteContractConfig<TAbi = Abi, TFunctionName = string, TSig
|
|
|
1050
1052
|
/** Custom signer */
|
|
1051
1053
|
signer?: TSigner | null;
|
|
1052
1054
|
}, 'nonpayable' | 'payable', TOptions>;
|
|
1053
|
-
|
|
1055
|
+
type PrepareWriteContractResult<TAbi = Abi, TFunctionName extends string = string> = {
|
|
1054
1056
|
abi: TAbi extends Abi ? [ExtractAbiFunction<TAbi, TFunctionName>] : TAbi;
|
|
1055
1057
|
address: string;
|
|
1056
1058
|
chainId?: number;
|
|
@@ -1078,7 +1080,7 @@ declare type PrepareWriteContractResult<TAbi = Abi, TFunctionName extends string
|
|
|
1078
1080
|
*/
|
|
1079
1081
|
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>>;
|
|
1080
1082
|
|
|
1081
|
-
|
|
1083
|
+
type GetContractArgs<TAbi extends Abi | readonly unknown[] = Abi> = {
|
|
1082
1084
|
/** Contract address */
|
|
1083
1085
|
address: string;
|
|
1084
1086
|
/** Contract ABI */
|
|
@@ -1086,15 +1088,15 @@ declare type GetContractArgs<TAbi extends Abi | readonly unknown[] = Abi> = {
|
|
|
1086
1088
|
/** Signer or provider to attach to contract */
|
|
1087
1089
|
signerOrProvider?: Signer$1 | providers.Provider;
|
|
1088
1090
|
};
|
|
1089
|
-
|
|
1091
|
+
type GetContractResult<TAbi = unknown> = TAbi extends Abi ? Contract<TAbi> & Contract$1 : Contract$1;
|
|
1090
1092
|
declare function getContract<TAbi extends Abi | readonly unknown[]>({ address, abi, signerOrProvider, }: GetContractArgs<TAbi>): GetContractResult<TAbi>;
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1093
|
+
type PropertyKeys = 'address' | 'attach' | 'connect' | 'deployed' | 'interface' | 'resolvedAddress';
|
|
1094
|
+
type FunctionKeys = 'callStatic' | 'estimateGas' | 'functions' | 'populateTransaction';
|
|
1095
|
+
type EventKeys = 'emit' | 'filters' | 'listenerCount' | 'listeners' | 'off' | 'on' | 'once' | 'queryFilter' | 'removeAllListeners' | 'removeListener';
|
|
1096
|
+
type BaseContract<TContract extends Record<keyof Pick<Contract$1, PropertyKeys | FunctionKeys | EventKeys>, unknown>> = Omit<Contract$1, PropertyKeys | FunctionKeys | EventKeys> & TContract;
|
|
1097
|
+
type InterfaceKeys = 'events' | 'functions';
|
|
1098
|
+
type BaseInterface<Interface extends Record<keyof Pick<ethers.utils.Interface, InterfaceKeys>, unknown>> = Omit<ethers.utils.Interface, InterfaceKeys> & Interface;
|
|
1099
|
+
type Contract<TAbi extends Abi, _Functions = Functions<TAbi>> = _Functions & BaseContract<{
|
|
1098
1100
|
address: Address;
|
|
1099
1101
|
resolvedAddress: Promise<Address>;
|
|
1100
1102
|
attach(addressOrName: Address | string): Contract<TAbi>;
|
|
@@ -1131,7 +1133,7 @@ declare type Contract<TAbi extends Abi, _Functions = Functions<TAbi>> = _Functio
|
|
|
1131
1133
|
removeAllListeners(eventFilter: ethers.EventFilter): Contract<TAbi>;
|
|
1132
1134
|
removeListener: EventListener<TAbi>;
|
|
1133
1135
|
}>;
|
|
1134
|
-
|
|
1136
|
+
type Functions<TAbi extends Abi, Options extends {
|
|
1135
1137
|
ReturnType?: any;
|
|
1136
1138
|
ReturnTypeAsArray?: boolean;
|
|
1137
1139
|
} = {
|
|
@@ -1148,7 +1150,7 @@ declare type Functions<TAbi extends Abi, Options extends {
|
|
|
1148
1150
|
]) => Promise<IsUnknown<Options['ReturnType']> extends true ? AbiFunctionReturnType<TAbiFunction> extends infer TAbiFunctionReturnType ? Options['ReturnTypeAsArray'] extends true ? [TAbiFunctionReturnType] : TAbiFunctionReturnType : never : Options['ReturnType']>;
|
|
1149
1151
|
} : never;
|
|
1150
1152
|
}[number]>;
|
|
1151
|
-
|
|
1153
|
+
type AbiFunctionReturnType<TAbiFunction extends AbiFunction & {
|
|
1152
1154
|
type: 'function';
|
|
1153
1155
|
}> = ({
|
|
1154
1156
|
payable: ethers.ContractTransaction;
|
|
@@ -1160,14 +1162,14 @@ declare type AbiFunctionReturnType<TAbiFunction extends AbiFunction & {
|
|
|
1160
1162
|
} ? Output['name'] extends '' ? never : Output['name'] : never]: AbiParameterToPrimitiveType<Output>;
|
|
1161
1163
|
} & AbiParametersToPrimitiveTypes<TAbiFunction['outputs']> : never;
|
|
1162
1164
|
})[TAbiFunction['stateMutability']];
|
|
1163
|
-
|
|
1165
|
+
type InterfaceFunctions<TAbi extends Abi> = UnionToIntersection<{
|
|
1164
1166
|
[K in keyof TAbi]: TAbi[K] extends infer TAbiFunction extends AbiFunction & {
|
|
1165
1167
|
type: 'function';
|
|
1166
1168
|
} ? {
|
|
1167
1169
|
[K in AbiItemName<TAbiFunction, true>]: ethers.utils.FunctionFragment;
|
|
1168
1170
|
} : never;
|
|
1169
1171
|
}[number]>;
|
|
1170
|
-
|
|
1172
|
+
type InterfaceEvents<TAbi extends Abi> = UnionToIntersection<{
|
|
1171
1173
|
[K in keyof TAbi]: TAbi[K] extends infer TAbiEvent extends AbiEvent ? {
|
|
1172
1174
|
[K in AbiItemName<TAbiEvent, true>]: ethers.utils.EventFragment;
|
|
1173
1175
|
} : never;
|
|
@@ -1176,8 +1178,8 @@ interface EventListener<TAbi extends Abi> {
|
|
|
1176
1178
|
<TEventName extends ExtractAbiEventNames<TAbi>>(eventName: TEventName, listener: Listener<TAbi, TEventName>): Contract<TAbi>;
|
|
1177
1179
|
(eventFilter: ethers.EventFilter, listener: Listener<TAbi, ExtractAbiEventNames<TAbi>>): Contract<TAbi>;
|
|
1178
1180
|
}
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
+
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;
|
|
1182
|
+
type Filters<TAbi extends Abi> = UnionToIntersection<{
|
|
1181
1183
|
[K in keyof TAbi]: TAbi[K] extends infer TAbiEvent extends AbiEvent ? {
|
|
1182
1184
|
[K in CountOccurrences<TAbi, {
|
|
1183
1185
|
name: TAbiEvent['name'];
|
|
@@ -1189,7 +1191,7 @@ declare type Filters<TAbi extends Abi> = UnionToIntersection<{
|
|
|
1189
1191
|
} : never;
|
|
1190
1192
|
}[number]>;
|
|
1191
1193
|
|
|
1192
|
-
|
|
1194
|
+
type MulticallConfig<TContracts extends unknown[]> = {
|
|
1193
1195
|
/** Failures in the multicall will fail silently */
|
|
1194
1196
|
allowFailure?: boolean;
|
|
1195
1197
|
/** Chain id to use for provider */
|
|
@@ -1199,13 +1201,13 @@ declare type MulticallConfig<TContracts extends unknown[]> = {
|
|
|
1199
1201
|
/** Call overrides */
|
|
1200
1202
|
overrides?: GetOverridesForAbiStateMutability<'pure'> | GetOverridesForAbiStateMutability<'view'>;
|
|
1201
1203
|
};
|
|
1202
|
-
|
|
1204
|
+
type MulticallResult<TContracts extends unknown[]> = ContractsResult<TContracts>;
|
|
1203
1205
|
declare function multicall<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TContracts extends {
|
|
1204
1206
|
abi: TAbi;
|
|
1205
1207
|
functionName: TFunctionName;
|
|
1206
1208
|
}[]>({ allowFailure, chainId, contracts, overrides, }: MulticallConfig<TContracts>): Promise<MulticallResult<TContracts>>;
|
|
1207
1209
|
|
|
1208
|
-
|
|
1210
|
+
type ReadContractConfig<TAbi = Abi, TFunctionName = string, TOptions extends Options$2 = DefaultOptions> = GetConfig$1<{
|
|
1209
1211
|
abi: TAbi;
|
|
1210
1212
|
functionName: TFunctionName;
|
|
1211
1213
|
/** Chain id to use for provider */
|
|
@@ -1213,16 +1215,16 @@ declare type ReadContractConfig<TAbi = Abi, TFunctionName = string, TOptions ext
|
|
|
1213
1215
|
/** Call overrides */
|
|
1214
1216
|
overrides?: GetOverridesForAbiStateMutability<'pure' | 'view'>;
|
|
1215
1217
|
}, 'pure' | 'view', TOptions>;
|
|
1216
|
-
|
|
1218
|
+
type ReadContractResult<TAbi = Abi, TFunctionName = string> = GetReturnType<{
|
|
1217
1219
|
abi: TAbi;
|
|
1218
1220
|
functionName: TFunctionName;
|
|
1219
1221
|
}>;
|
|
1220
1222
|
declare function readContract<TAbi extends Abi | readonly unknown[], TFunctionName extends string>({ address, args, chainId, abi, functionName, overrides, }: ReadContractConfig<TAbi, TFunctionName>): Promise<ReadContractResult<TAbi, TFunctionName>>;
|
|
1221
1223
|
|
|
1222
|
-
|
|
1224
|
+
type Options$1 = Options$2 & {
|
|
1223
1225
|
isContractsOptional?: boolean;
|
|
1224
1226
|
};
|
|
1225
|
-
|
|
1227
|
+
type ReadContractsConfig<TContracts extends unknown[], TOptions extends Options$1 = DefaultOptions, _Contracts = readonly [
|
|
1226
1228
|
...ContractsConfig<TContracts, {
|
|
1227
1229
|
/** Chain id to use for provider */
|
|
1228
1230
|
chainId?: number;
|
|
@@ -1239,13 +1241,13 @@ declare type ReadContractsConfig<TContracts extends unknown[], TOptions extends
|
|
|
1239
1241
|
/** Contracts to query */
|
|
1240
1242
|
contracts: _Contracts;
|
|
1241
1243
|
});
|
|
1242
|
-
|
|
1244
|
+
type ReadContractsResult<TContracts extends unknown[]> = ContractsResult<TContracts>;
|
|
1243
1245
|
declare function readContracts<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TContracts extends {
|
|
1244
1246
|
abi: TAbi;
|
|
1245
1247
|
functionName: TFunctionName;
|
|
1246
1248
|
}[]>({ allowFailure, contracts, overrides, }: ReadContractsConfig<TContracts>): Promise<ReadContractsResult<TContracts>>;
|
|
1247
1249
|
|
|
1248
|
-
|
|
1250
|
+
type ContractEventConfig<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string = string> = {
|
|
1249
1251
|
/** Contract address */
|
|
1250
1252
|
address: string;
|
|
1251
1253
|
/** Contract ABI */
|
|
@@ -1257,50 +1259,50 @@ declare type ContractEventConfig<TAbi extends Abi | readonly unknown[] = Abi, TE
|
|
|
1257
1259
|
/** Receive only a single event */
|
|
1258
1260
|
once?: boolean;
|
|
1259
1261
|
};
|
|
1260
|
-
|
|
1262
|
+
type GetConfig<T> = T extends {
|
|
1261
1263
|
abi: infer TAbi extends Abi;
|
|
1262
1264
|
} ? ContractEventConfig<TAbi, ExtractAbiEventNames<TAbi>> : T extends {
|
|
1263
1265
|
abi: infer TAbi extends readonly unknown[];
|
|
1264
1266
|
eventName: infer TEventName extends string;
|
|
1265
1267
|
} ? ContractEventConfig<TAbi, TEventName> : ContractEventConfig;
|
|
1266
|
-
|
|
1268
|
+
type WatchContractEventConfig<TAbi = Abi, TEventName = string> = GetConfig<{
|
|
1267
1269
|
abi: TAbi;
|
|
1268
1270
|
eventName: TEventName;
|
|
1269
1271
|
}>;
|
|
1270
|
-
|
|
1272
|
+
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;
|
|
1271
1273
|
declare function watchContractEvent<TAbi extends Abi | readonly unknown[], TEventName extends string>({ address, abi, chainId, eventName, once, }: WatchContractEventConfig<TAbi, TEventName>, callback: WatchContractEventCallback<TAbi, TEventName>): () => void;
|
|
1272
1274
|
|
|
1273
|
-
|
|
1275
|
+
type WatchMulticallConfig<TContracts extends unknown[]> = MulticallConfig<TContracts> & {
|
|
1274
1276
|
listenToBlock?: boolean;
|
|
1275
1277
|
};
|
|
1276
|
-
|
|
1278
|
+
type WatchMulticallCallback<TContracts extends unknown[]> = (results: MulticallResult<TContracts>) => void;
|
|
1277
1279
|
declare function watchMulticall<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TContracts extends {
|
|
1278
1280
|
abi: TAbi;
|
|
1279
1281
|
functionName: TFunctionName;
|
|
1280
1282
|
}[]>(config: WatchMulticallConfig<TContracts>, callback: WatchMulticallCallback<TContracts>): () => void;
|
|
1281
1283
|
|
|
1282
|
-
|
|
1284
|
+
type WatchReadContractConfig<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = ReadContractConfig<TAbi, TFunctionName> & {
|
|
1283
1285
|
listenToBlock?: boolean;
|
|
1284
1286
|
};
|
|
1285
|
-
|
|
1287
|
+
type WatchReadContractCallback<TAbi extends Abi | readonly unknown[], TFunctionName extends string> = (result: ReadContractResult<TAbi, TFunctionName>) => void;
|
|
1286
1288
|
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;
|
|
1287
1289
|
|
|
1288
|
-
|
|
1290
|
+
type WatchReadContractsConfig<TContracts extends unknown[]> = ReadContractsConfig<TContracts> & {
|
|
1289
1291
|
listenToBlock?: boolean;
|
|
1290
1292
|
};
|
|
1291
|
-
|
|
1293
|
+
type WatchReadContractsCallback<TContracts extends unknown[]> = (results: ReadContractsResult<TContracts>) => void;
|
|
1292
1294
|
declare function watchReadContracts<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TContracts extends {
|
|
1293
1295
|
abi: TAbi;
|
|
1294
1296
|
functionName: TFunctionName;
|
|
1295
1297
|
}[]>(config: WatchReadContractsConfig<TContracts>, callback: WatchReadContractsCallback<TContracts>): () => void;
|
|
1296
1298
|
|
|
1297
|
-
|
|
1299
|
+
type FetchTransactionArgs = {
|
|
1298
1300
|
/** Chain ID used to validate if the signer is connected to the target chain */
|
|
1299
1301
|
chainId?: number;
|
|
1300
1302
|
/** Transaction hash */
|
|
1301
1303
|
hash: Hash;
|
|
1302
1304
|
};
|
|
1303
|
-
|
|
1305
|
+
type FetchTransactionResult = providers.TransactionResponse;
|
|
1304
1306
|
/**
|
|
1305
1307
|
* @description Fetches transaction for hash
|
|
1306
1308
|
*
|
|
@@ -1314,7 +1316,7 @@ declare type FetchTransactionResult = providers.TransactionResponse;
|
|
|
1314
1316
|
*/
|
|
1315
1317
|
declare function fetchTransaction({ chainId, hash, }: FetchTransactionArgs): Promise<FetchTransactionResult>;
|
|
1316
1318
|
|
|
1317
|
-
|
|
1319
|
+
type PrepareSendTransactionArgs<TSigner extends Signer = Signer> = {
|
|
1318
1320
|
/** Chain ID used to validate if the signer is connected to the target chain */
|
|
1319
1321
|
chainId?: number;
|
|
1320
1322
|
/** Request data to prepare the transaction */
|
|
@@ -1323,7 +1325,7 @@ declare type PrepareSendTransactionArgs<TSigner extends Signer = Signer> = {
|
|
|
1323
1325
|
};
|
|
1324
1326
|
signer?: TSigner | null;
|
|
1325
1327
|
};
|
|
1326
|
-
|
|
1328
|
+
type PrepareSendTransactionResult = {
|
|
1327
1329
|
chainId?: number;
|
|
1328
1330
|
request: providers.TransactionRequest & {
|
|
1329
1331
|
to: Address;
|
|
@@ -1349,7 +1351,7 @@ declare type PrepareSendTransactionResult = {
|
|
|
1349
1351
|
*/
|
|
1350
1352
|
declare function prepareSendTransaction({ chainId, request, signer: signer_, }: PrepareSendTransactionArgs): Promise<PrepareSendTransactionResult>;
|
|
1351
1353
|
|
|
1352
|
-
|
|
1354
|
+
type SendTransactionPreparedRequest = {
|
|
1353
1355
|
/**
|
|
1354
1356
|
* `recklesslyUnprepared`: Allow to pass through an unprepared `request`. Note: This has
|
|
1355
1357
|
* [UX pitfalls](/docs/prepare-hooks/intro#ux-pitfalls-without-prepare-hooks), it is highly recommended
|
|
@@ -1365,16 +1367,16 @@ declare type SendTransactionPreparedRequest = {
|
|
|
1365
1367
|
gasLimit: NonNullable<providers.TransactionRequest['gasLimit']>;
|
|
1366
1368
|
};
|
|
1367
1369
|
};
|
|
1368
|
-
|
|
1370
|
+
type SendTransactionUnpreparedRequest = {
|
|
1369
1371
|
mode: 'recklesslyUnprepared';
|
|
1370
1372
|
/** The unprepared request for sending a transaction. */
|
|
1371
1373
|
request: providers.TransactionRequest;
|
|
1372
1374
|
};
|
|
1373
|
-
|
|
1375
|
+
type SendTransactionArgs = {
|
|
1374
1376
|
/** Chain ID used to validate if the signer is connected to the target chain */
|
|
1375
1377
|
chainId?: number;
|
|
1376
1378
|
} & (SendTransactionPreparedRequest | SendTransactionUnpreparedRequest);
|
|
1377
|
-
|
|
1379
|
+
type SendTransactionResult = {
|
|
1378
1380
|
hash: Hash;
|
|
1379
1381
|
wait: providers.TransactionResponse['wait'];
|
|
1380
1382
|
};
|
|
@@ -1382,7 +1384,7 @@ declare type SendTransactionResult = {
|
|
|
1382
1384
|
* @description Function to send a transaction.
|
|
1383
1385
|
*
|
|
1384
1386
|
* It is recommended to pair this with the `prepareSendTransaction` function to avoid
|
|
1385
|
-
* [UX pitfalls](https://wagmi.sh/
|
|
1387
|
+
* [UX pitfalls](https://wagmi.sh/react/prepare-hooks/intro#ux-pitfalls-without-prepare-hooks).
|
|
1386
1388
|
*
|
|
1387
1389
|
* @example
|
|
1388
1390
|
* import { prepareSendTransaction, sendTransaction } from '@wagmi/core'
|
|
@@ -1395,7 +1397,7 @@ declare type SendTransactionResult = {
|
|
|
1395
1397
|
*/
|
|
1396
1398
|
declare function sendTransaction({ chainId, mode, request, }: SendTransactionArgs): Promise<SendTransactionResult>;
|
|
1397
1399
|
|
|
1398
|
-
|
|
1400
|
+
type WaitForTransactionArgs = {
|
|
1399
1401
|
/** Chain id to use for provider */
|
|
1400
1402
|
chainId?: number;
|
|
1401
1403
|
/**
|
|
@@ -1409,20 +1411,20 @@ declare type WaitForTransactionArgs = {
|
|
|
1409
1411
|
/** Function resolving to transaction receipt */
|
|
1410
1412
|
wait?: providers.TransactionResponse['wait'];
|
|
1411
1413
|
};
|
|
1412
|
-
|
|
1414
|
+
type WaitForTransactionResult = providers.TransactionReceipt;
|
|
1413
1415
|
declare function waitForTransaction({ chainId, confirmations, hash, timeout, wait: wait_, }: WaitForTransactionArgs): Promise<WaitForTransactionResult>;
|
|
1414
1416
|
|
|
1415
|
-
|
|
1417
|
+
type Options = Options$2 & {
|
|
1416
1418
|
isRequestOptional?: boolean;
|
|
1417
1419
|
};
|
|
1418
|
-
|
|
1420
|
+
type Request = PopulatedTransaction & {
|
|
1419
1421
|
to: Address;
|
|
1420
1422
|
gasLimit: NonNullable<PopulatedTransaction['gasLimit']>;
|
|
1421
1423
|
};
|
|
1422
|
-
|
|
1424
|
+
type WriteContractPreparedArgs<TOptions extends Options = DefaultOptions> = {
|
|
1423
1425
|
/**
|
|
1424
1426
|
* `recklesslyUnprepared`: Allow to pass through unprepared config. Note: This has
|
|
1425
|
-
* [UX pitfalls](https://wagmi.sh/
|
|
1427
|
+
* [UX pitfalls](https://wagmi.sh/react/prepare-hooks/intro#ux-pitfalls-without-prepare-hooks),
|
|
1426
1428
|
* it is highly recommended to not use this and instead prepare the request upfront
|
|
1427
1429
|
* using the {@link prepareWriteContract} function.
|
|
1428
1430
|
*
|
|
@@ -1439,7 +1441,7 @@ declare type WriteContractPreparedArgs<TOptions extends Options = DefaultOptions
|
|
|
1439
1441
|
/** The prepared request. */
|
|
1440
1442
|
request: Request;
|
|
1441
1443
|
});
|
|
1442
|
-
|
|
1444
|
+
type WriteContractUnpreparedArgs<TAbi = Abi, TFunctionName = string, TOptions extends Options = DefaultOptions> = {
|
|
1443
1445
|
mode: 'recklesslyUnprepared';
|
|
1444
1446
|
request?: never;
|
|
1445
1447
|
} & GetConfig$1<{
|
|
@@ -1454,18 +1456,18 @@ declare type WriteContractUnpreparedArgs<TAbi = Abi, TFunctionName = string, TOp
|
|
|
1454
1456
|
infer TFunctionName_ extends string
|
|
1455
1457
|
] ? ExtractAbiFunction<TAbi_, TFunctionName_>['stateMutability'] : 'nonpayable' | 'payable'>;
|
|
1456
1458
|
}, 'nonpayable' | 'payable', TOptions>;
|
|
1457
|
-
|
|
1459
|
+
type WriteContractArgs<TAbi = Abi, TFunctionName = string, TOptions extends Options = DefaultOptions> = Omit<GetConfig$1<{
|
|
1458
1460
|
abi: TAbi;
|
|
1459
1461
|
functionName: TFunctionName;
|
|
1460
1462
|
/** Chain id to use for provider */
|
|
1461
1463
|
chainId?: number;
|
|
1462
1464
|
}, 'nonpayable' | 'payable', TOptions>, 'args'> & (WriteContractUnpreparedArgs<TAbi, TFunctionName, TOptions> | WriteContractPreparedArgs<TOptions>);
|
|
1463
|
-
|
|
1465
|
+
type WriteContractResult = SendTransactionResult;
|
|
1464
1466
|
/**
|
|
1465
1467
|
* @description Function to call a contract write method.
|
|
1466
1468
|
*
|
|
1467
1469
|
* It is recommended to pair this with the {@link prepareWriteContract} function
|
|
1468
|
-
* to avoid [UX pitfalls](https://wagmi.sh/
|
|
1470
|
+
* to avoid [UX pitfalls](https://wagmi.sh/react/prepare-hooks/intro#ux-pitfalls-without-prepare-hooks).
|
|
1469
1471
|
*
|
|
1470
1472
|
* @example
|
|
1471
1473
|
* import { prepareWriteContract, writeContract } from '@wagmi/core'
|
|
@@ -1479,55 +1481,55 @@ declare type WriteContractResult = SendTransactionResult;
|
|
|
1479
1481
|
*/
|
|
1480
1482
|
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>;
|
|
1481
1483
|
|
|
1482
|
-
|
|
1484
|
+
type FetchEnsAddressArgs = {
|
|
1483
1485
|
/** Chain id to use for provider */
|
|
1484
1486
|
chainId?: number;
|
|
1485
1487
|
/** ENS name to resolve */
|
|
1486
1488
|
name: string;
|
|
1487
1489
|
};
|
|
1488
|
-
|
|
1490
|
+
type FetchEnsAddressResult = Address | null;
|
|
1489
1491
|
declare function fetchEnsAddress({ chainId, name, }: FetchEnsAddressArgs): Promise<FetchEnsAddressResult>;
|
|
1490
1492
|
|
|
1491
|
-
|
|
1493
|
+
type FetchEnsAvatarArgs = {
|
|
1492
1494
|
/** Address or ENS name */
|
|
1493
1495
|
address: Address;
|
|
1494
1496
|
/** Chain id to use for provider */
|
|
1495
1497
|
chainId?: number;
|
|
1496
1498
|
};
|
|
1497
|
-
|
|
1499
|
+
type FetchEnsAvatarResult = string | null;
|
|
1498
1500
|
declare function fetchEnsAvatar({ address, chainId, }: FetchEnsAvatarArgs): Promise<FetchEnsAvatarResult>;
|
|
1499
1501
|
|
|
1500
|
-
|
|
1502
|
+
type FetchEnsNameArgs = {
|
|
1501
1503
|
/** Address to lookup */
|
|
1502
1504
|
address: Address;
|
|
1503
1505
|
/** Chain id to use for provider */
|
|
1504
1506
|
chainId?: number;
|
|
1505
1507
|
};
|
|
1506
|
-
|
|
1508
|
+
type FetchEnsNameResult = string | null;
|
|
1507
1509
|
declare function fetchEnsName({ address, chainId, }: FetchEnsNameArgs): Promise<FetchEnsNameResult>;
|
|
1508
1510
|
|
|
1509
|
-
|
|
1511
|
+
type FetchEnsResolverArgs = {
|
|
1510
1512
|
/** Chain id to use for provider */
|
|
1511
1513
|
chainId?: number;
|
|
1512
1514
|
/** ENS name to resolve */
|
|
1513
1515
|
name: string;
|
|
1514
1516
|
};
|
|
1515
|
-
|
|
1517
|
+
type FetchEnsResolverResult = providers.Resolver | null;
|
|
1516
1518
|
declare function fetchEnsResolver({ chainId, name, }: FetchEnsResolverArgs): Promise<FetchEnsResolverResult>;
|
|
1517
1519
|
|
|
1518
|
-
|
|
1520
|
+
type FetchBlockNumberArgs = {
|
|
1519
1521
|
chainId?: number;
|
|
1520
1522
|
};
|
|
1521
|
-
|
|
1523
|
+
type FetchBlockNumberResult = number;
|
|
1522
1524
|
declare function fetchBlockNumber({ chainId, }?: FetchBlockNumberArgs): Promise<FetchBlockNumberResult>;
|
|
1523
1525
|
|
|
1524
|
-
|
|
1526
|
+
type FetchFeeDataArgs = {
|
|
1525
1527
|
/** Units for formatting output */
|
|
1526
1528
|
formatUnits?: Unit | number;
|
|
1527
1529
|
/** Chain id to use for provider */
|
|
1528
1530
|
chainId?: number;
|
|
1529
1531
|
};
|
|
1530
|
-
|
|
1532
|
+
type FetchFeeDataResult = providers.FeeData & {
|
|
1531
1533
|
formatted: {
|
|
1532
1534
|
gasPrice: string | null;
|
|
1533
1535
|
maxFeePerGas: string | null;
|
|
@@ -1536,31 +1538,31 @@ declare type FetchFeeDataResult = providers.FeeData & {
|
|
|
1536
1538
|
};
|
|
1537
1539
|
declare function fetchFeeData({ chainId, formatUnits: units, }?: FetchFeeDataArgs): Promise<FetchFeeDataResult>;
|
|
1538
1540
|
|
|
1539
|
-
|
|
1541
|
+
type WatchBlockNumberArgs = {
|
|
1540
1542
|
chainId?: number;
|
|
1541
1543
|
listen: boolean;
|
|
1542
1544
|
};
|
|
1543
|
-
|
|
1545
|
+
type WatchBlockNumberCallback = (blockNumber: FetchBlockNumberResult) => void;
|
|
1544
1546
|
declare function watchBlockNumber(args: WatchBlockNumberArgs, callback: WatchBlockNumberCallback): () => void;
|
|
1545
1547
|
|
|
1546
|
-
|
|
1548
|
+
type GetProviderArgs = {
|
|
1547
1549
|
/** Chain id to use for provider */
|
|
1548
1550
|
chainId?: number;
|
|
1549
1551
|
};
|
|
1550
|
-
|
|
1552
|
+
type GetProviderResult<TProvider extends Provider = Provider> = TProvider;
|
|
1551
1553
|
declare function getProvider<TProvider extends Provider = Provider>({ chainId, }?: GetProviderArgs): GetProviderResult<TProvider>;
|
|
1552
1554
|
|
|
1553
|
-
|
|
1555
|
+
type GetWebSocketProviderArgs = {
|
|
1554
1556
|
/** Chain id to use for provider */
|
|
1555
1557
|
chainId?: number;
|
|
1556
1558
|
};
|
|
1557
|
-
|
|
1559
|
+
type GetWebSocketProviderResult<TWebSocketProvider extends WebSocketProvider = WebSocketProvider> = TWebSocketProvider | undefined;
|
|
1558
1560
|
declare function getWebSocketProvider<TWebSocketProvider extends WebSocketProvider = WebSocketProvider>({ chainId, }?: GetWebSocketProviderArgs): GetWebSocketProviderResult<TWebSocketProvider>;
|
|
1559
1561
|
|
|
1560
|
-
|
|
1562
|
+
type WatchProviderCallback<TProvider extends Provider = Provider> = (provider: GetProviderResult<TProvider>) => void;
|
|
1561
1563
|
declare function watchProvider<TProvider extends Provider = Provider>(args: GetProviderArgs, callback: WatchProviderCallback<TProvider>): () => void;
|
|
1562
1564
|
|
|
1563
|
-
|
|
1565
|
+
type WatchWebSocketProviderCallback<TWebSocketProvider extends WebSocketProvider = WebSocketProvider> = (webSocketProvider: GetWebSocketProviderResult<TWebSocketProvider>) => void;
|
|
1564
1566
|
declare function watchWebSocketProvider<TWebSocketProvider extends WebSocketProvider = WebSocketProvider>(args: GetWebSocketProviderArgs, callback: WatchWebSocketProviderCallback<TWebSocketProvider>): () => void;
|
|
1565
1567
|
|
|
1566
1568
|
/**
|
|
@@ -1696,7 +1698,7 @@ declare class UserRejectedRequestError extends ProviderRpcError {
|
|
|
1696
1698
|
constructor(error: unknown);
|
|
1697
1699
|
}
|
|
1698
1700
|
|
|
1699
|
-
|
|
1701
|
+
type ConfigureChainsConfig = {
|
|
1700
1702
|
pollingInterval?: number;
|
|
1701
1703
|
stallTimeout?: number;
|
|
1702
1704
|
} & ({
|
|
@@ -1724,6 +1726,8 @@ declare function configureChains<TProvider extends Provider = Provider, TWebSock
|
|
|
1724
1726
|
/** Forked from https://github.com/epoberezkin/fast-deep-equal */
|
|
1725
1727
|
declare function deepEqual(a: any, b: any): boolean;
|
|
1726
1728
|
|
|
1729
|
+
declare function deserialize(cachedString: string): any;
|
|
1730
|
+
|
|
1727
1731
|
declare function minimizeContractInterface<TAbi extends Abi | readonly unknown[]>(config: {
|
|
1728
1732
|
abi: TAbi;
|
|
1729
1733
|
functionName: TAbi extends Abi ? ExtractAbiFunctionNames<TAbi> : string;
|
|
@@ -1737,4 +1741,21 @@ declare function parseContractResult({ abi, data, functionName, }: {
|
|
|
1737
1741
|
functionName: string;
|
|
1738
1742
|
}): any;
|
|
1739
1743
|
|
|
1740
|
-
|
|
1744
|
+
type StandardReplacer = (key: string, value: any) => any;
|
|
1745
|
+
type CircularReplacer = (key: string, value: any, referenceKey: string) => any;
|
|
1746
|
+
/**
|
|
1747
|
+
* @function stringify
|
|
1748
|
+
*
|
|
1749
|
+
* @description
|
|
1750
|
+
* stringifier that handles circular values
|
|
1751
|
+
* Forked from https://github.com/planttheidea/fast-stringify
|
|
1752
|
+
*
|
|
1753
|
+
* @param value to stringify
|
|
1754
|
+
* @param [replacer] a custom replacer function for handling standard values
|
|
1755
|
+
* @param [indent] the number of spaces to indent the output by
|
|
1756
|
+
* @param [circularReplacer] a custom replacer function for handling circular values
|
|
1757
|
+
* @returns the stringified output
|
|
1758
|
+
*/
|
|
1759
|
+
declare function serialize(value: any, replacer?: StandardReplacer | null | undefined, indent?: number | null | undefined, circularReplacer?: CircularReplacer | null | undefined): string;
|
|
1760
|
+
|
|
1761
|
+
export { AddChainError, ChainDoesNotSupportMulticallError, ChainMismatchError, ChainNotConfiguredError, Client, ClientConfig, ConfigureChainsConfig, ConnectArgs, ConnectResult, ConnectorAlreadyConnectedError, ConnectorNotFoundError, ContractMethodDoesNotExistError, ContractMethodNoResultError, ContractMethodRevertedError, ContractResultDecodeError, FetchBalanceArgs, FetchBalanceResult, FetchBlockNumberArgs, FetchBlockNumberResult, FetchEnsAddressArgs, FetchEnsAddressResult, FetchEnsAvatarArgs, FetchEnsAvatarResult, FetchEnsNameArgs, FetchEnsNameResult, FetchEnsResolverArgs, FetchEnsResolverResult, FetchFeeDataArgs, FetchFeeDataResult, FetchSignerArgs, FetchSignerResult, FetchTokenArgs, FetchTokenResult, FetchTransactionArgs, FetchTransactionResult, GetAccountResult, GetContractArgs, GetContractResult, GetNetworkResult, GetProviderArgs, GetProviderResult, GetWebSocketProviderArgs, GetWebSocketProviderResult, MulticallConfig, MulticallResult, PrepareSendTransactionArgs, PrepareSendTransactionResult, PrepareWriteContractConfig, PrepareWriteContractResult, ProviderChainsNotFound, ProviderRpcError, ReadContractConfig, ReadContractResult, ReadContractsConfig, ReadContractsResult, ResourceUnavailableError, RpcError, SendTransactionArgs, SendTransactionPreparedRequest, SendTransactionResult, SendTransactionUnpreparedRequest, SignMessageArgs, SignMessageResult, SignTypedDataArgs, SignTypedDataResult, ClientStorage as Storage, SwitchChainError, SwitchChainNotSupportedError, SwitchNetworkArgs, SwitchNetworkResult, UserRejectedRequestError, WaitForTransactionArgs, WaitForTransactionResult, WatchAccountCallback, WatchBlockNumberArgs, WatchBlockNumberCallback, WatchMulticallCallback, WatchMulticallConfig, WatchNetworkCallback, WatchProviderCallback, WatchReadContractCallback, WatchReadContractConfig, WatchReadContractsCallback, WatchReadContractsConfig, WatchSignerCallback, WatchWebSocketProviderCallback, WriteContractArgs, WriteContractPreparedArgs, WriteContractResult, WriteContractUnpreparedArgs, configureChains, connect, createClient, createStorage, deepEqual, deserialize, disconnect, erc20ABI, erc4626ABI, erc721ABI, fetchBalance, fetchBlockNumber, fetchEnsAddress, fetchEnsAvatar, fetchEnsName, fetchEnsResolver, fetchFeeData, fetchSigner, fetchToken, fetchTransaction, getAccount, getContract, getNetwork, getProvider, getWebSocketProvider, minimizeContractInterface, multicall, noopStorage, normalizeChainId, parseContractResult, prepareSendTransaction, prepareWriteContract, readContract, readContracts, sendTransaction, serialize, signMessage, signTypedData, switchNetwork, waitForTransaction, watchAccount, watchBlockNumber, watchContractEvent, watchMulticall, watchNetwork, watchProvider, watchReadContract, watchReadContracts, watchSigner, watchWebSocketProvider, writeContract };
|