Bot releases are visible (Hide)
Published by github-actions[bot] about 1 year ago
Published by github-actions[bot] about 1 year ago
#847 1e5d4545
Thanks @jxom! - Narrowed getBlock
, watchBlocks
, getFilterChanges
, getFilterLogs
& getLogs
return types for when blockTag
or includeTransactions
is provided.
blockTag !== 'pending'
, the return type will now include some non-nullish properties if it were dependent on pending blocks. Example: For getBlock
, the block.number
type is now non-nullish since blockTag !== 'pending'
.blockTag: 'pending'
, some properties will be nullish. Example: For getBlock
, the block.number
type is now null
since blockTag === 'pending'
.includeTransactions
is provided, the return type of will narrow the transactions
property type. Example: block.transactions
will be Transaction[]
when includeTransactions: true
instead of Hash[] | Transaction[]
.TLDR;
// Before
const block = publicClient.getBlock({ includeTransactions: true });
block.transactions;
// ^? Hash[] | Transaction[]
block.transactions[0].blockNumber;
// ^? bigint | null
// After
const block = publicClient.getBlock({ includeTransactions: true });
block.transactions;
// ^? Transaction[]
block.transactions[0].blockNumber;
// ^? bigint
// Before
const block = publicClient.getBlock({
blockTag: "pending",
includeTransactions: true
});
block.number;
// ^? number | null
block.transactions[0].blockNumber;
// ^? bigint | null
// After
const block = publicClient.getBlock({
blockTag: "pending",
includeTransactions: true
});
block.number;
// ^? null
block.transactions[0].blockNumber;
// ^? null
#847 1e5d4545
Thanks @jxom! - Type Change: TPending
has been added to slot 2 of the Log
generics.
type Log<
TQuantity = bigint,
TIndex = number,
+ TPending extends boolean = boolean,
TAbiEvent extends AbiEvent | undefined = undefined,
TStrict extends boolean | undefined = undefined,
TAbi extends Abi | readonly unknown[] = [TAbiEvent],
TEventName extends string | undefined = TAbiEvent extends AbiEvent
? TAbiEvent['name']
: undefined,
>
#958 f7976fd0
Thanks @jxom! - Added cacheTime
as a parameter to getBlockNumber
& createClient
.
28a82125
Thanks @jxom! - Exported number constants (ie. maxInt128
, maxUint256
, etc).
#951 c75d3b60
Thanks @jxom! - Added support for multiple events
on Filters/Log Actions:
createEventFilter
getLogs
watchEvent
Example:
import { parseAbi } from "viem";
import { publicClient } from "./client";
const logs = publicClient.getLogs({
events: parseAbi([
"event Approval(address indexed owner, address indexed sender, uint256 value)",
"event Transfer(address indexed from, address indexed to, uint256 value)"
])
});
#957 7950df80
Thanks @jxom! - Added hexToSignature
& signatureToHex
.
#847 1e5d4545
Thanks @jxom! - Type Change: TIncludeTransactions
& TBlockTag
has been added to slot 1 & 2 of the Block
generics.
type Block<
TQuantity = bigint,
+ TIncludeTransactions extends boolean = boolean,
+ TBlockTag extends BlockTag = BlockTag,
TTransaction = Transaction<
bigint,
number,
TBlockTag extends 'pending' ? true : false
>,
>
Published by github-actions[bot] about 1 year ago
#941 12c685a1
Thanks @jxom! - Capture error signatures that do not exist on the ABI in ContractFunctionRevertedError
.
#942 e26e356c
Thanks @alexfertel! - Deprecated OnLogParameter
& OnLogFn
in favor of WatchEventOnLogParameter
& WatchEventOnLogFn
types.
Added WatchContractEventOnLogParameter
& WatchContractEventOnLogFn
types.
Published by github-actions[bot] over 1 year ago
789592dc
Thanks @jxom! - Fixed an issue where calling encodePacked
with an empty bytes[]
array would return an Uint8Array
instead of Hex
value.
#922 71c9c933
Thanks @mikemcdonald! - Fixed an issue where parseUnits
would throw Cannot convert to a BigInt
for large numbers with a fraction component.
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
319cdb61
Thanks @Raiden1411! - Updated abitype
to 0.9.3Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
a955007e
Thanks @johngrantuk! - Allow using EIP-1559 transactions on chains with 0 base fee.Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago
Published by github-actions[bot] over 1 year ago