viem 0.2.0-0-2-0.20230329T025357 → 0.2.0-0-2-0.20230330T023229
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/abi.d.ts +3 -3
- package/dist/abi.js +2 -2
- package/dist/abi.mjs +1 -1
- package/dist/accounts/index.d.ts +5 -14
- package/dist/accounts/index.js +20 -30
- package/dist/accounts/index.js.map +1 -1
- package/dist/accounts/index.mjs +14 -24
- package/dist/accounts/index.mjs.map +1 -1
- package/dist/{chain-5b28fc53.d.ts → chain-9da1e6b6.d.ts} +132 -120
- package/dist/{chain-e9b996ff.d.ts → chain-b53ed5d9.d.ts} +1 -1
- package/dist/chains.d.ts +867 -99
- package/dist/chains.js +115 -63
- package/dist/chains.js.map +1 -1
- package/dist/chains.mjs +58 -6
- package/dist/chains.mjs.map +1 -1
- package/dist/{chunk-564BCC7H.js → chunk-2ESQNALV.js} +18 -16
- package/dist/chunk-2ESQNALV.js.map +1 -0
- package/dist/{chunk-CXE4XSMF.js → chunk-ASAFFZMD.js} +19 -19
- package/dist/{chunk-UCZWRYV5.mjs → chunk-B7WOV4RY.mjs} +18 -16
- package/dist/chunk-B7WOV4RY.mjs.map +1 -0
- package/dist/{chunk-D3ALNUWN.js → chunk-GNHXOZCH.js} +6 -6
- package/dist/{chunk-BJ5KRDTG.mjs → chunk-RFOQRRYW.mjs} +2 -2
- package/dist/{chunk-7QEOFHC7.mjs → chunk-S4GWZ3LJ.mjs} +2 -2
- package/dist/contract.d.ts +8 -8
- package/dist/contract.js +2 -2
- package/dist/contract.mjs +1 -1
- package/dist/{createClient-e52de308.d.ts → createTransport-e031366b.d.ts} +36 -34
- package/dist/{eip1193-9080db42.d.ts → eip1193-e79469af.d.ts} +1 -1
- package/dist/{encodeFunctionResult-47ad60ed.d.ts → encodeFunctionResult-d206ceb9.d.ts} +15 -15
- package/dist/{encodePacked-35c796fb.d.ts → encodePacked-b36ce88a.d.ts} +1 -1
- package/dist/ens.d.ts +5 -5
- package/dist/ens.js +3 -3
- package/dist/ens.mjs +2 -2
- package/dist/ethers.d.ts +2 -2
- package/dist/ethers.js +4 -4
- package/dist/ethers.mjs +2 -2
- package/dist/{formatAbiItem-d9e801dd.d.ts → formatAbiItem-a7a3fb0f.d.ts} +1 -1
- package/dist/{getAbiItem-1d94ae0e.d.ts → getAbiItem-5e8b01de.d.ts} +3 -3
- package/dist/index.d.ts +49 -15
- package/dist/index.js +214 -138
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +123 -47
- package/dist/index.mjs.map +1 -1
- package/dist/{parseGwei-f14525ab.d.ts → parseGwei-7678c2fa.d.ts} +5 -5
- package/dist/public.d.ts +5 -5
- package/dist/public.js +2 -2
- package/dist/public.mjs +1 -1
- package/dist/publicKeyToAddress-87b9856c.d.ts +16 -0
- package/dist/{test-f3d06763.d.ts → test-68dbda5b.d.ts} +3 -3
- package/dist/test.d.ts +5 -5
- package/dist/test.js +2 -2
- package/dist/test.mjs +1 -1
- package/dist/{typedData-42b43450.d.ts → typedData-8b24374d.d.ts} +1 -1
- package/dist/utils/index.d.ts +15 -15
- package/dist/utils/index.js +4 -2
- package/dist/utils/index.mjs +3 -1
- package/dist/wallet.d.ts +5 -5
- package/dist/wallet.js +2 -2
- package/dist/wallet.mjs +1 -1
- package/dist/{watchPendingTransactions-468f53f2.d.ts → watchPendingTransactions-53449c4e.d.ts} +34 -31
- package/dist/window.d.ts +2 -2
- package/package.json +3 -3
- package/dist/chunk-564BCC7H.js.map +0 -1
- package/dist/chunk-UCZWRYV5.mjs.map +0 -1
- package/dist/parseAccount-4209fa24.d.ts +0 -6
- /package/dist/{chunk-CXE4XSMF.js.map → chunk-ASAFFZMD.js.map} +0 -0
- /package/dist/{chunk-D3ALNUWN.js.map → chunk-GNHXOZCH.js.map} +0 -0
- /package/dist/{chunk-BJ5KRDTG.mjs.map → chunk-RFOQRRYW.mjs.map} +0 -0
- /package/dist/{chunk-7QEOFHC7.mjs.map → chunk-S4GWZ3LJ.mjs.map} +0 -0
package/dist/wallet.mjs
CHANGED
package/dist/{watchPendingTransactions-468f53f2.d.ts → watchPendingTransactions-53449c4e.d.ts}
RENAMED
@@ -1,8 +1,8 @@
|
|
1
|
-
import { a as Transport, b as ClientConfig, C as Client } from './
|
2
|
-
import { C as Chain, a4 as ExtractFormatter, ab as Formatters, ac as Formatter, a5 as Formatted, c as Block, R as RpcBlock, T as Transaction,
|
3
|
-
import { W as WalletPermission, a as WatchAssetParams, R as Requests, P as PublicRequests } from './eip1193-
|
1
|
+
import { a as Transport, b as ClientConfig, C as Client } from './createTransport-e031366b.js';
|
2
|
+
import { C as Chain, a4 as ExtractFormatter, ab as Formatters, ac as Formatter, a5 as Formatted, c as Block, R as RpcBlock, T as Transaction, N as TransactionReceipt, y as RpcTransactionReceipt, a2 as TransactionType, z as RpcTransactionRequest, O as TransactionRequest, H as Hex, ad as GetChain, G as GetConstructorArgs, ae as MergeIntersectionProperties, a as Hash, af as GetValue, g as ContractFunctionConfig, ag as IsUndefined, ah as MaybeExtractEventArgsFromAbi, h as ContractFunctionResult, ai as Prettify, f as BlockTag, aj as MaybeAbiEventName, e as BlockNumber, p as InferEventName, F as FeeHistory, L as Log, a6 as FormattedTransaction, a7 as TransactionFormatter, m as GetEventArgs } from './chain-9da1e6b6.js';
|
3
|
+
import { W as WalletPermission, a as WatchAssetParams, R as Requests, P as PublicRequests } from './eip1193-e79469af.js';
|
4
4
|
import { Abi, Narrow, Address, TypedData, AbiEvent, ExtractAbiEvent } from 'abitype';
|
5
|
-
import { A as Account, T as TypedDataDefinition, J as JsonRpcAccount } from './typedData-
|
5
|
+
import { A as Account, T as TypedDataDefinition, J as JsonRpcAccount } from './typedData-8b24374d.js';
|
6
6
|
|
7
7
|
type BlockFormatter<TChain extends Chain | undefined = Chain> = TChain extends Chain ? ExtractFormatter<TChain, 'block', NonNullable<Formatters['block']>> : Formatters['block'];
|
8
8
|
type FormattedBlock<TFormatter extends Formatter | undefined = Formatter> = Formatted<TFormatter, Block>;
|
@@ -47,7 +47,7 @@ declare function addChain<TChain extends Chain | undefined, TAccount extends Acc
|
|
47
47
|
type DeployContractParameters<TAbi extends Abi | readonly unknown[] = Abi, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined, TChainOverride extends Chain | undefined = undefined> = Omit<SendTransactionParameters<TChain, TAccount, TChainOverride>, 'accessList' | 'chain' | 'to' | 'data' | 'value'> & {
|
48
48
|
abi: Narrow<TAbi>;
|
49
49
|
bytecode: Hex;
|
50
|
-
} & GetChain<TChain, TChainOverride> &
|
50
|
+
} & GetChain<TChain, TChainOverride> & GetConstructorArgs<TAbi>;
|
51
51
|
type DeployContractReturnType = SendTransactionReturnType;
|
52
52
|
declare function deployContract<TAbi extends Abi | readonly unknown[], TChain extends Chain | undefined, TAccount extends Account | undefined, TChainOverride extends Chain | undefined>(walletClient: WalletClient<Transport, TChain, TAccount>, { abi, args, bytecode, ...request }: DeployContractParameters<TAbi, TChain, TAccount, TChainOverride>): Promise<DeployContractReturnType>;
|
53
53
|
|
@@ -101,7 +101,7 @@ declare function watchAsset<TChain extends Chain | undefined, TAccount extends A
|
|
101
101
|
|
102
102
|
type WriteContractParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TChain extends Chain | undefined = Chain, TAccount extends Account | undefined = undefined, TChainOverride extends Chain | undefined = undefined> = Omit<SendTransactionParameters<TChain, TAccount, TChainOverride>, 'chain' | 'to' | 'data' | 'value'> & {
|
103
103
|
value?: GetValue<TAbi, TFunctionName, SendTransactionParameters<TChain>['value']>;
|
104
|
-
} & GetChain<TChain, TChainOverride> &
|
104
|
+
} & GetChain<TChain, TChainOverride> & ContractFunctionConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'>;
|
105
105
|
type WriteContractReturnType = SendTransactionReturnType;
|
106
106
|
declare function writeContract<TChain extends Chain | undefined, TAccount extends Account | undefined, TAbi extends Abi | readonly unknown[], TFunctionName extends string, TChainOverride extends Chain | undefined = undefined>(client: WalletClient<Transport, TChain, TAccount>, { abi, address, args, functionName, ...request }: WriteContractParameters<TAbi, TFunctionName, TChain, TAccount, TChainOverride>): Promise<WriteContractReturnType>;
|
107
107
|
|
@@ -139,9 +139,9 @@ type Contract<TAbi extends Abi | readonly unknown[] = Abi | readonly unknown[],
|
|
139
139
|
abi: TAbi;
|
140
140
|
functionName: TFunctionName;
|
141
141
|
};
|
142
|
-
type MulticallContracts<TContracts extends Contract[], TProperties extends Record<string, any> = object, Result extends any[] = [], Depth extends
|
142
|
+
type MulticallContracts<TContracts extends Contract[], TProperties extends Record<string, any> = object, Result extends any[] = [], Depth extends readonly number[] = []> = Depth['length'] extends MAXIMUM_DEPTH ? (ContractFunctionConfig & TProperties)[] : TContracts extends [] ? [] : TContracts extends [infer Head extends Contract] ? [
|
143
143
|
...Result,
|
144
|
-
|
144
|
+
ContractFunctionConfig<Head['abi'], Head['functionName']> & TProperties
|
145
145
|
] : TContracts extends [
|
146
146
|
infer Head extends Contract,
|
147
147
|
...infer Tail extends Contract[]
|
@@ -149,12 +149,12 @@ type MulticallContracts<TContracts extends Contract[], TProperties extends Recor
|
|
149
149
|
...Tail
|
150
150
|
], TProperties, [
|
151
151
|
...Result,
|
152
|
-
|
152
|
+
ContractFunctionConfig<Head['abi'], Head['functionName']> & TProperties
|
153
153
|
], [
|
154
154
|
...Depth,
|
155
155
|
1
|
156
|
-
]> : unknown[] extends TContracts ? TContracts : TContracts extends
|
157
|
-
type MulticallResult<Result, TAllowFailure extends boolean = true> = TAllowFailure extends true ?
|
156
|
+
]> : unknown[] extends TContracts ? TContracts : TContracts extends ContractFunctionConfig<infer TAbi, infer TFunctionName>[] ? (ContractFunctionConfig<TAbi, TFunctionName> & TProperties)[] : (ContractFunctionConfig & TProperties)[];
|
157
|
+
type MulticallResult<Result, TAllowFailure extends boolean = true> = TAllowFailure extends true ? {
|
158
158
|
error?: undefined;
|
159
159
|
result: Result;
|
160
160
|
status: 'success';
|
@@ -162,19 +162,22 @@ type MulticallResult<Result, TAllowFailure extends boolean = true> = TAllowFailu
|
|
162
162
|
error: Error;
|
163
163
|
result?: undefined;
|
164
164
|
status: 'error';
|
165
|
-
}
|
166
|
-
type MulticallResults<TContracts extends Contract[], TAllowFailure extends boolean = true, Result extends any[] = [], Depth extends
|
165
|
+
} : Result;
|
166
|
+
type MulticallResults<TContracts extends Contract[], TAllowFailure extends boolean = true, Result extends any[] = [], Depth extends readonly number[] = []> = Depth['length'] extends MAXIMUM_DEPTH ? MulticallResult<ContractFunctionResult, TAllowFailure>[] : TContracts extends [] ? [] : TContracts extends [infer Head extends Contract] ? [
|
167
|
+
...Result,
|
168
|
+
MulticallResult<ContractFunctionResult<Head['abi'], Head['functionName']>, TAllowFailure>
|
169
|
+
] : TContracts extends [
|
167
170
|
infer Head extends Contract,
|
168
171
|
...infer Tail extends Contract[]
|
169
172
|
] ? MulticallResults<[
|
170
173
|
...Tail
|
171
174
|
], TAllowFailure, [
|
172
175
|
...Result,
|
173
|
-
MulticallResult<
|
176
|
+
MulticallResult<ContractFunctionResult<Head['abi'], Head['functionName']>, TAllowFailure>
|
174
177
|
], [
|
175
178
|
...Depth,
|
176
179
|
1
|
177
|
-
]> : TContracts extends
|
180
|
+
]> : TContracts extends ContractFunctionConfig<infer TAbi, infer TFunctionName>[] ? MulticallResult<ContractFunctionResult<TAbi, TFunctionName>, TAllowFailure>[] : MulticallResult<ContractFunctionResult, TAllowFailure>[];
|
178
181
|
|
179
182
|
type GetTransportConfig<TTransport extends Transport> = ReturnType<TTransport>['config'];
|
180
183
|
|
@@ -239,7 +242,7 @@ type PublicActions<TTransport extends Transport = Transport, TChain extends Chai
|
|
239
242
|
getTransactionConfirmations: (args: GetTransactionConfirmationsParameters<TChain>) => Promise<GetTransactionConfirmationsReturnType>;
|
240
243
|
getTransactionCount: (args: GetTransactionCountParameters) => Promise<GetTransactionCountReturnType>;
|
241
244
|
getTransactionReceipt: (args: GetTransactionReceiptParameters) => Promise<GetTransactionReceiptReturnType<TChain>>;
|
242
|
-
multicall: <TContracts extends
|
245
|
+
multicall: <TContracts extends ContractFunctionConfig[], TAllowFailure extends boolean = true>(args: MulticallParameters<TContracts, TAllowFailure>) => Promise<MulticallReturnType<TContracts, TAllowFailure>>;
|
243
246
|
readContract: <TAbi extends Abi | readonly unknown[], TFunctionName extends string>(args: ReadContractParameters<TAbi, TFunctionName>) => Promise<ReadContractReturnType<TAbi, TFunctionName>>;
|
244
247
|
simulateContract: <TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any, TChainOverride extends Chain | undefined = undefined>(args: SimulateContractParameters<TAbi, TFunctionName, TChain, TChainOverride>) => Promise<SimulateContractReturnType<TAbi, TFunctionName, TChain, TChainOverride>>;
|
245
248
|
uninstallFilter: (args: UninstallFilterParameters) => Promise<UninstallFilterReturnType>;
|
@@ -308,14 +311,14 @@ declare function call<TChain extends Chain | undefined>(client: PublicClient<Tra
|
|
308
311
|
|
309
312
|
type SimulateContractParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any, TChain extends Chain | undefined = Chain | undefined, TChainOverride extends Chain | undefined = undefined> = Omit<CallParameters<TChainOverride extends Chain ? TChainOverride : TChain>, 'to' | 'data' | 'value'> & {
|
310
313
|
chain?: TChainOverride;
|
311
|
-
} &
|
314
|
+
} & ContractFunctionConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'> & {
|
312
315
|
value?: GetValue<TAbi, TFunctionName, CallParameters<TChain>['value']>;
|
313
316
|
};
|
314
317
|
type SimulateContractReturnType<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TChain extends Chain | undefined = Chain | undefined, TChainOverride extends Chain | undefined = undefined> = {
|
315
|
-
result:
|
318
|
+
result: ContractFunctionResult<TAbi, TFunctionName>;
|
316
319
|
request: Omit<WriteContractParameters<TAbi, TFunctionName, TChain, undefined, TChainOverride>, 'chain'> & {
|
317
320
|
chain: TChainOverride;
|
318
|
-
} &
|
321
|
+
} & ContractFunctionConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'>;
|
319
322
|
};
|
320
323
|
declare function simulateContract<TChain extends Chain | undefined, TAbi extends Abi | readonly unknown[], TFunctionName extends string, TChainOverride extends Chain | undefined>(client: PublicClient<Transport, TChain>, { abi, address, args, functionName, ...callRequest }: SimulateContractParameters<TAbi, TFunctionName, TChain, TChainOverride>): Promise<SimulateContractReturnType<TAbi, TFunctionName, TChain, TChainOverride>>;
|
321
324
|
|
@@ -331,10 +334,10 @@ type CreateEventFilterParameters<TAbiEvent extends AbiEvent | undefined = undefi
|
|
331
334
|
toBlock?: BlockNumber | BlockTag;
|
332
335
|
} & (MaybeExtractEventArgsFromAbi<TAbi, TEventName> extends infer TEventFilterArgs ? {
|
333
336
|
args: TEventFilterArgs | (TArgs extends TEventFilterArgs ? TArgs : never);
|
334
|
-
event: TAbiEvent
|
337
|
+
event: Narrow<TAbiEvent>;
|
335
338
|
} | {
|
336
339
|
args?: never;
|
337
|
-
event?: TAbiEvent
|
340
|
+
event?: Narrow<TAbiEvent>;
|
338
341
|
} | {
|
339
342
|
args?: never;
|
340
343
|
event?: never;
|
@@ -342,13 +345,13 @@ type CreateEventFilterParameters<TAbiEvent extends AbiEvent | undefined = undefi
|
|
342
345
|
args?: never;
|
343
346
|
event?: never;
|
344
347
|
});
|
345
|
-
type CreateEventFilterReturnType<TAbiEvent extends AbiEvent | undefined = undefined, TAbi extends Abi | readonly unknown[] = [TAbiEvent], TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined = undefined> = Filter<'event', TAbi, TEventName, TArgs
|
348
|
+
type CreateEventFilterReturnType<TAbiEvent extends AbiEvent | undefined = undefined, TAbi extends Abi | readonly unknown[] = [TAbiEvent], TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined = undefined> = Prettify<Filter<'event', TAbi, TEventName, TArgs>>;
|
346
349
|
declare function createEventFilter<TChain extends Chain | undefined, TAbiEvent extends AbiEvent | undefined, _Abi extends Abi | readonly unknown[] = [TAbiEvent], _EventName extends string | undefined = MaybeAbiEventName<TAbiEvent>, _Args extends MaybeExtractEventArgsFromAbi<_Abi, _EventName> | undefined = undefined>(client: PublicClient<Transport, TChain>, { address, args, event, fromBlock, toBlock, }?: CreateEventFilterParameters<TAbiEvent, _Abi, _EventName, _Args>): Promise<CreateEventFilterReturnType<TAbiEvent, _Abi, _EventName, _Args>>;
|
347
350
|
|
348
351
|
type CreateContractEventFilterParameters<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string | undefined = undefined, TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined = undefined> = {
|
349
352
|
address?: Address | Address[];
|
350
353
|
abi: Narrow<TAbi>;
|
351
|
-
eventName?:
|
354
|
+
eventName?: InferEventName<TAbi, TEventName>;
|
352
355
|
fromBlock?: BlockNumber | BlockTag;
|
353
356
|
toBlock?: BlockNumber | BlockTag;
|
354
357
|
} & (undefined extends TEventName ? {
|
@@ -377,7 +380,7 @@ type EstimateGasReturnType = bigint;
|
|
377
380
|
*/
|
378
381
|
declare function estimateGas<TChain extends Chain | undefined, TAccount extends Account | undefined = undefined>(client: PublicClient<Transport, TChain> | WalletClient<Transport, TChain, TAccount>, args: EstimateGasParameters<TChain, TAccount>): Promise<EstimateGasReturnType>;
|
379
382
|
|
380
|
-
type EstimateContractGasParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TChain extends Chain | undefined = Chain | undefined> = Omit<EstimateGasParameters<TChain>, 'data' | 'to' | 'value'> &
|
383
|
+
type EstimateContractGasParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TChain extends Chain | undefined = Chain | undefined> = Omit<EstimateGasParameters<TChain>, 'data' | 'to' | 'value'> & ContractFunctionConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'> & {
|
381
384
|
value?: GetValue<TAbi, TFunctionName, EstimateGasParameters<TChain>['value']>;
|
382
385
|
};
|
383
386
|
type EstimateContractGasReturnType = bigint;
|
@@ -642,16 +645,16 @@ type GetTransactionReceiptParameters = {
|
|
642
645
|
type GetTransactionReceiptReturnType<TChain extends Chain | undefined = Chain | undefined> = FormattedTransactionReceipt<TransactionReceiptFormatter<TChain>>;
|
643
646
|
declare function getTransactionReceipt<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { hash }: GetTransactionReceiptParameters): Promise<Formatted<TransactionReceiptFormatter<TChain>, TransactionReceipt<bigint, number, "success" | "reverted", TransactionType>, false, false>>;
|
644
647
|
|
645
|
-
type MulticallParameters<TContracts extends
|
648
|
+
type MulticallParameters<TContracts extends ContractFunctionConfig[] = ContractFunctionConfig[], TAllowFailure extends boolean = true> = Pick<CallParameters, 'blockNumber' | 'blockTag'> & {
|
646
649
|
allowFailure?: TAllowFailure;
|
647
650
|
contracts: Narrow<readonly [...MulticallContracts<TContracts>]>;
|
648
651
|
multicallAddress?: Address;
|
649
652
|
};
|
650
|
-
type MulticallReturnType<TContracts extends
|
651
|
-
declare function multicall<TChain extends Chain | undefined, TContracts extends
|
653
|
+
type MulticallReturnType<TContracts extends ContractFunctionConfig[] = ContractFunctionConfig[], TAllowFailure extends boolean = true> = MulticallResults<TContracts, TAllowFailure>;
|
654
|
+
declare function multicall<TChain extends Chain | undefined, TContracts extends ContractFunctionConfig[], TAllowFailure extends boolean = true>(client: PublicClient<Transport, TChain>, args: MulticallParameters<TContracts, TAllowFailure>): Promise<MulticallReturnType<TContracts, TAllowFailure>>;
|
652
655
|
|
653
|
-
type ReadContractParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = Pick<CallParameters, 'blockNumber' | 'blockTag'> &
|
654
|
-
type ReadContractReturnType<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> =
|
656
|
+
type ReadContractParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = Pick<CallParameters, 'blockNumber' | 'blockTag'> & ContractFunctionConfig<TAbi, TFunctionName, 'view' | 'pure'>;
|
657
|
+
type ReadContractReturnType<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = ContractFunctionResult<TAbi, TFunctionName>;
|
655
658
|
declare function readContract<TChain extends Chain | undefined, TAbi extends Abi | readonly unknown[], TFunctionName extends string>(client: PublicClient<Transport, TChain>, { abi, address, args, functionName, ...callRequest }: ReadContractParameters<TAbi, TFunctionName>): Promise<ReadContractReturnType<TAbi, TFunctionName>>;
|
656
659
|
|
657
660
|
type UninstallFilterParameters = {
|
@@ -756,11 +759,11 @@ type WatchContractEventParameters<TAbi extends Abi | readonly unknown[] = readon
|
|
756
759
|
address?: Address | Address[];
|
757
760
|
/** Contract ABI. */
|
758
761
|
abi: Narrow<TAbi>;
|
759
|
-
args?:
|
762
|
+
args?: GetEventArgs<TAbi, TEventName>;
|
760
763
|
/** Whether or not the event logs should be batched on each invocation. */
|
761
764
|
batch?: boolean;
|
762
765
|
/** Contract event. */
|
763
|
-
eventName?:
|
766
|
+
eventName?: InferEventName<TAbi, TEventName>;
|
764
767
|
/** The callback to call when an error occurred when trying to get for a new block. */
|
765
768
|
onError?: (error: Error) => void;
|
766
769
|
/** The callback to call when new event logs are received. */
|
package/dist/window.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import { R as Requests, E as Events } from './eip1193-
|
1
|
+
import { R as Requests, E as Events } from './eip1193-e79469af.js';
|
2
2
|
import 'abitype';
|
3
|
-
import './chain-
|
3
|
+
import './chain-9da1e6b6.js';
|
4
4
|
import '@wagmi/chains';
|
5
5
|
|
6
6
|
type WindowProvider = Requests & Events;
|
package/package.json
CHANGED
@@ -3,16 +3,16 @@
|
|
3
3
|
"description": "TypeScript Interface for Ethereum",
|
4
4
|
"dependencies": {
|
5
5
|
"@noble/hashes": "^1.1.2",
|
6
|
-
"@noble/
|
6
|
+
"@noble/curves": "^0.9.0",
|
7
7
|
"@scure/bip32": "^1.2.0",
|
8
8
|
"@scure/bip39": "^1.1.1",
|
9
|
-
"@wagmi/chains": "~0.2.
|
9
|
+
"@wagmi/chains": "~0.2.15",
|
10
10
|
"abitype": "~0.7.1",
|
11
11
|
"idna-uts46-hx": "^4.1.2",
|
12
12
|
"isomorphic-ws": "^5.0.0",
|
13
13
|
"ws": "^8.12.0"
|
14
14
|
},
|
15
|
-
"version": "0.2.0-0-2-0.
|
15
|
+
"version": "0.2.0-0-2-0.20230330T023229",
|
16
16
|
"files": [
|
17
17
|
"/abi",
|
18
18
|
"/accounts",
|