|
1 | 1 | # op-viem
|
2 | 2 |
|
| 3 | +## 1.0.0 |
| 4 | + |
| 5 | +### Major Changes |
| 6 | + |
| 7 | +- 5099d6a: Leave alpha. |
| 8 | + |
| 9 | + - writeDepositETH and simulateDepositETH now take an `args.amount` instead of using a value arg. |
| 10 | + - getSecondsToNextL2Output throws an error if the passed latestL2BlockNumber is less than the latestBlockNumber reported by the l2OutputOracle. |
| 11 | + - writeFinalizeWithdrawalTransaction takes an `args` parameter like most other actions. |
| 12 | + |
| 13 | +### Minor Changes |
| 14 | + |
| 15 | +- 41196a9: Add simulateDepositTransaction action |
| 16 | + |
| 17 | +### Patch Changes |
| 18 | + |
| 19 | +- e7ebdda: no-op bump, fixing build |
| 20 | +- f853852: Export writeFinalizeWithdrawTransaction and fix getProveWithdrawalTransactionArgs |
| 21 | +- 86f8263: writeUnsafeDepositTransaction -> writeDepositTransaction |
| 22 | +- 836856f: Alpha release |
| 23 | +- fa49872: Update minGasLimit to be type number for consistency with ABI |
| 24 | +- 745a65a: Fix getTransactionHash to use un-decorated function for better tree shaking |
| 25 | +- 7a21a29: readFinalizedWithdrawals, txReceipt to getDeposits and getWithdrawals |
| 26 | +- 7d16f9b: Actions now receive contract addresses instead of L2 config objects for simplicty and Viem upstream compatibility. op-viem/chains now eexports addresses objects that be spread into actions to pass the required address. |
| 27 | + |
| 28 | + Previously |
| 29 | + |
| 30 | + ```ts |
| 31 | + import { publicL1Actions } from "op-viem"; |
| 32 | + import { base } from "op-viem/chains"; |
| 33 | + import { createPublicClient } from "viem"; |
| 34 | + |
| 35 | + const publicClient = createPublicClient({ |
| 36 | + account, |
| 37 | + chain: mainnet, |
| 38 | + transport: http(), |
| 39 | + }).extend(publicL1Actions); |
| 40 | + |
| 41 | + await getOutputForL2Block(publicClient, { |
| 42 | + blockNumber: 2725977n, |
| 43 | + l2Chain: base, |
| 44 | + }); |
| 45 | + ``` |
| 46 | + |
| 47 | + Now |
| 48 | + |
| 49 | + ```ts |
| 50 | + import { publicL1Actions } from "op-viem"; |
| 51 | + import { baseAddresses } from "op-viem/chains"; |
| 52 | + import { createPublicClient } from "viem"; |
| 53 | + |
| 54 | + const publicClient = createPublicClient({ |
| 55 | + account, |
| 56 | + chain: mainnet, |
| 57 | + transport: http(), |
| 58 | + }).extend(publicL1Actions); |
| 59 | + |
| 60 | + await getOutputForL2Block(publicClient, { |
| 61 | + blockNumber: 2725977n, |
| 62 | + l2OutputOracle: baseAddresses.l2OutputOracle, |
| 63 | + }); |
| 64 | + |
| 65 | + // more simply |
| 66 | + await getOutputForL2Block(publicClient, { |
| 67 | + blockNumber: 2725977n, |
| 68 | + ...baseAddresses, |
| 69 | + }); |
| 70 | + ``` |
| 71 | + |
| 72 | +- 6938582: Add readFinalizedWithdrawals to decorator and export in actions |
| 73 | +- e7ebdda: Fix chains resolution |
| 74 | +- 1cedfab: Add writeContractDeposit |
| 75 | + |
3 | 76 | ## 0.0.1-alpha.8
|
4 | 77 |
|
5 | 78 | ### Patch Changes
|
|
9 | 82 | Previously
|
10 | 83 |
|
11 | 84 | ```ts
|
12 |
| - import { publicL1Actions } from 'op-viem' |
13 |
| - import { base } from 'op-viem/chains' |
14 |
| - import { createPublicClient } from 'viem' |
| 85 | + import { publicL1Actions } from "op-viem"; |
| 86 | + import { base } from "op-viem/chains"; |
| 87 | + import { createPublicClient } from "viem"; |
15 | 88 |
|
16 | 89 | const publicClient = createPublicClient({
|
17 | 90 | account,
|
18 | 91 | chain: mainnet,
|
19 | 92 | transport: http(),
|
20 |
| - }).extend(publicL1Actions) |
| 93 | + }).extend(publicL1Actions); |
21 | 94 |
|
22 | 95 | await getOutputForL2Block(publicClient, {
|
23 | 96 | blockNumber: 2725977n,
|
24 | 97 | l2Chain: base,
|
25 |
| - }) |
| 98 | + }); |
26 | 99 | ```
|
27 | 100 |
|
28 | 101 | Now
|
29 | 102 |
|
30 | 103 | ```ts
|
31 |
| - import { publicL1Actions } from 'op-viem' |
32 |
| - import { baseAddresses } from 'op-viem/chains' |
33 |
| - import { createPublicClient } from 'viem' |
| 104 | + import { publicL1Actions } from "op-viem"; |
| 105 | + import { baseAddresses } from "op-viem/chains"; |
| 106 | + import { createPublicClient } from "viem"; |
34 | 107 |
|
35 | 108 | const publicClient = createPublicClient({
|
36 | 109 | account,
|
37 | 110 | chain: mainnet,
|
38 | 111 | transport: http(),
|
39 |
| - }).extend(publicL1Actions) |
| 112 | + }).extend(publicL1Actions); |
40 | 113 |
|
41 | 114 | await getOutputForL2Block(publicClient, {
|
42 | 115 | blockNumber: 2725977n,
|
43 | 116 | l2OutputOracle: baseAddresses.l2OutputOracle,
|
44 |
| - }) |
| 117 | + }); |
45 | 118 |
|
46 | 119 | // more simply
|
47 | 120 | await getOutputForL2Block(publicClient, {
|
48 | 121 | blockNumber: 2725977n,
|
49 | 122 | ...baseAddresses,
|
50 |
| - }) |
| 123 | + }); |
51 | 124 | ```
|
52 | 125 |
|
53 | 126 | - 1cedfab: Add writeContractDeposit
|
|
0 commit comments