Skip to content

Commit

Permalink
chore: version package (#952)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and github-actions[bot] committed Jul 31, 2023
1 parent f7976fd commit ed779e9
Show file tree
Hide file tree
Showing 10 changed files with 107 additions and 118 deletions.
41 changes: 0 additions & 41 deletions .changeset/bright-jobs-boil.md

This file was deleted.

19 changes: 0 additions & 19 deletions .changeset/brown-sheep-visit.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/cool-goats-approve.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/gold-actors-hunt.md

This file was deleted.

23 changes: 0 additions & 23 deletions .changeset/nervous-impalas-cough.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/tender-stingrays-itch.md

This file was deleted.

18 changes: 0 additions & 18 deletions .changeset/wicked-bananas-cover.md

This file was deleted.

105 changes: 105 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,110 @@
# viem

## 1.5.0

### Minor Changes

- [#847](https://github.com/wagmi-dev/viem/pull/847) [`1e5d4545`](https://github.com/wagmi-dev/viem/commit/1e5d4545736282c2d8dedb38907f2433ce1c72f4) Thanks [@jxom](https://github.com/jxom)! - Narrowed `getBlock`, `watchBlocks`, `getFilterChanges`, `getFilterLogs` & `getLogs` return types for when `blockTag` or `includeTransactions` is provided.

- When `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'`.
- On the other hand, when `blockTag: 'pending'`, some properties will be nullish. Example: For `getBlock`, the `block.number` type is now `null` since `blockTag === 'pending'`.
- When `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;

```ts
// 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](https://github.com/wagmi-dev/viem/pull/847) [`1e5d4545`](https://github.com/wagmi-dev/viem/commit/1e5d4545736282c2d8dedb38907f2433ce1c72f4) Thanks [@jxom](https://github.com/jxom)! - **Type Change**: `TPending` has been added to slot 2 of the `Log` generics.

```diff
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](https://github.com/wagmi-dev/viem/pull/958) [`f7976fd0`](https://github.com/wagmi-dev/viem/commit/f7976fd0486079247a76ff3d3cecfbc2f6f2dae9) Thanks [@jxom](https://github.com/jxom)! - Added `cacheTime` as a parameter to `getBlockNumber` & `createClient`.

* [`28a82125`](https://github.com/wagmi-dev/viem/commit/28a82125f2678ed6ceb3bfaab065bfb9ffc8a367) Thanks [@jxom](https://github.com/jxom)! - Exported number constants (ie. `maxInt128`, `maxUint256`, etc).

- [#951](https://github.com/wagmi-dev/viem/pull/951) [`c75d3b60`](https://github.com/wagmi-dev/viem/commit/c75d3b60fbacaf4d3ff23460e91dc2b75baed15d) Thanks [@jxom](https://github.com/jxom)! - Added support for multiple `events` on Filters/Log Actions:

- `createEventFilter`
- `getLogs`
- `watchEvent`

Example:

```ts
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](https://github.com/wagmi-dev/viem/pull/957) [`7950df80`](https://github.com/wagmi-dev/viem/commit/7950df80c2416772861b7fc99a6d40095725b87c) Thanks [@jxom](https://github.com/jxom)! - Added `hexToSignature` & `signatureToHex`.

- [#847](https://github.com/wagmi-dev/viem/pull/847) [`1e5d4545`](https://github.com/wagmi-dev/viem/commit/1e5d4545736282c2d8dedb38907f2433ce1c72f4) Thanks [@jxom](https://github.com/jxom)! - **Type Change**: `TIncludeTransactions` & `TBlockTag` has been added to slot 1 & 2 of the `Block` generics.

```diff
type Block<
TQuantity = bigint,
+ TIncludeTransactions extends boolean = boolean,
+ TBlockTag extends BlockTag = BlockTag,
TTransaction = Transaction<
bigint,
number,
TBlockTag extends 'pending' ? true : false
>,
>
```

## 1.4.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "viem",
"description": "TypeScript Interface for Ethereum",
"version": "1.4.2",
"version": "1.5.0",
"scripts": {
"bench": "vitest bench",
"bench:ci": "CI=true vitest bench",
Expand Down
2 changes: 1 addition & 1 deletion src/errors/version.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const version = '1.4.2'
export const version = '1.5.0'

1 comment on commit ed779e9

@vercel
Copy link

@vercel vercel bot commented on ed779e9 Jul 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.