viem 2.0.0-rc.2 → 2.0.0-rc.3
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/CHANGELOG.md +18 -0
- package/_cjs/accounts/generateMnemonic.js +2 -2
- package/_cjs/accounts/generateMnemonic.js.map +1 -1
- package/_cjs/chains/definitions/arbitrumSepolia.js +2 -4
- package/_cjs/chains/definitions/arbitrumSepolia.js.map +1 -1
- package/_cjs/chains/definitions/bitTorrent.js +19 -0
- package/_cjs/chains/definitions/bitTorrent.js.map +1 -0
- package/_cjs/chains/definitions/bitTorrentTestnet.js +20 -0
- package/_cjs/chains/definitions/bitTorrentTestnet.js.map +1 -0
- package/_cjs/chains/definitions/jbc.js +32 -0
- package/_cjs/chains/definitions/jbc.js.map +1 -0
- package/_cjs/chains/definitions/wemix.js +19 -0
- package/_cjs/chains/definitions/wemix.js.map +1 -0
- package/_cjs/chains/definitions/wemixTestnet.js +20 -0
- package/_cjs/chains/definitions/wemixTestnet.js.map +1 -0
- package/_cjs/chains/index.js +14 -4
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/chains/opStack/abis.js.map +1 -1
- package/_cjs/chains/opStack/contracts.js.map +1 -1
- package/_cjs/chains/opStack/decorators/publicL1.js.map +1 -1
- package/_cjs/chains/opStack/decorators/publicL2.js.map +1 -1
- package/_cjs/chains/opStack/decorators/walletL1.js.map +1 -1
- package/_cjs/chains/opStack/decorators/walletL2.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_esm/accounts/generateMnemonic.js +3 -2
- package/_esm/accounts/generateMnemonic.js.map +1 -1
- package/_esm/chains/definitions/arbitrumSepolia.js +2 -4
- package/_esm/chains/definitions/arbitrumSepolia.js.map +1 -1
- package/_esm/chains/definitions/bitTorrent.js +16 -0
- package/_esm/chains/definitions/bitTorrent.js.map +1 -0
- package/_esm/chains/definitions/bitTorrentTestnet.js +17 -0
- package/_esm/chains/definitions/bitTorrentTestnet.js.map +1 -0
- package/_esm/chains/definitions/jbc.js +29 -0
- package/_esm/chains/definitions/jbc.js.map +1 -0
- package/_esm/chains/definitions/wemix.js +16 -0
- package/_esm/chains/definitions/wemix.js.map +1 -0
- package/_esm/chains/definitions/wemixTestnet.js +17 -0
- package/_esm/chains/definitions/wemixTestnet.js.map +1 -0
- package/_esm/chains/index.js +5 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/chains/opStack/abis.js +4 -0
- package/_esm/chains/opStack/abis.js.map +1 -1
- package/_esm/chains/opStack/contracts.js +4 -0
- package/_esm/chains/opStack/contracts.js.map +1 -1
- package/_esm/chains/opStack/decorators/publicL1.js +15 -0
- package/_esm/chains/opStack/decorators/publicL1.js.map +1 -1
- package/_esm/chains/opStack/decorators/publicL2.js +15 -0
- package/_esm/chains/opStack/decorators/publicL2.js.map +1 -1
- package/_esm/chains/opStack/decorators/walletL1.js +17 -0
- package/_esm/chains/opStack/decorators/walletL1.js.map +1 -1
- package/_esm/chains/opStack/decorators/walletL2.js +17 -0
- package/_esm/chains/opStack/decorators/walletL2.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_types/accounts/generateMnemonic.d.ts +2 -1
- package/_types/accounts/generateMnemonic.d.ts.map +1 -1
- package/_types/actions/public/simulateContract.d.ts +2 -2
- package/_types/actions/public/simulateContract.d.ts.map +1 -1
- package/_types/chains/definitions/arbitrumSepolia.d.ts +6 -2
- package/_types/chains/definitions/arbitrumSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/bitTorrent.d.ts +42 -0
- package/_types/chains/definitions/bitTorrent.d.ts.map +1 -0
- package/_types/chains/definitions/bitTorrentTestnet.d.ts +42 -0
- package/_types/chains/definitions/bitTorrentTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/jbc.d.ts +36 -0
- package/_types/chains/definitions/jbc.d.ts.map +1 -0
- package/_types/chains/definitions/wemix.d.ts +42 -0
- package/_types/chains/definitions/wemix.d.ts.map +1 -0
- package/_types/chains/definitions/wemixTestnet.d.ts +42 -0
- package/_types/chains/definitions/wemixTestnet.d.ts.map +1 -0
- package/_types/chains/index.d.ts +5 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/chains/opStack/abis.d.ts +4 -0
- package/_types/chains/opStack/abis.d.ts.map +1 -1
- package/_types/chains/opStack/contracts.d.ts +4 -0
- package/_types/chains/opStack/contracts.d.ts.map +1 -1
- package/_types/chains/opStack/decorators/publicL1.d.ts +15 -0
- package/_types/chains/opStack/decorators/publicL1.d.ts.map +1 -1
- package/_types/chains/opStack/decorators/publicL2.d.ts +15 -0
- package/_types/chains/opStack/decorators/publicL2.d.ts.map +1 -1
- package/_types/chains/opStack/decorators/walletL1.d.ts +17 -0
- package/_types/chains/opStack/decorators/walletL1.d.ts.map +1 -1
- package/_types/chains/opStack/decorators/walletL2.d.ts +17 -0
- package/_types/chains/opStack/decorators/walletL2.d.ts.map +1 -1
- package/_types/chains/opStack/types/contract.d.ts +8 -7
- package/_types/chains/opStack/types/contract.d.ts.map +1 -1
- package/_types/clients/decorators/wallet.d.ts +2 -2
- package/_types/clients/decorators/wallet.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/accounts/generateMnemonic.ts +6 -2
- package/actions/public/simulateContract.ts +2 -2
- package/chains/definitions/arbitrumSepolia.ts +2 -4
- package/chains/definitions/bitTorrent.ts +16 -0
- package/chains/definitions/bitTorrentTestnet.ts +17 -0
- package/chains/definitions/jbc.ts +29 -0
- package/chains/definitions/wemix.ts +16 -0
- package/chains/definitions/wemixTestnet.ts +17 -0
- package/chains/index.ts +5 -0
- package/chains/opStack/abis.ts +4 -0
- package/chains/opStack/contracts.ts +4 -0
- package/chains/opStack/decorators/publicL1.ts +15 -0
- package/chains/opStack/decorators/publicL2.ts +15 -0
- package/chains/opStack/decorators/walletL1.ts +17 -0
- package/chains/opStack/decorators/walletL2.ts +17 -0
- package/chains/opStack/types/contract.ts +15 -6
- package/clients/decorators/wallet.ts +2 -2
- package/errors/version.ts +1 -1
- package/package.json +1 -1
@@ -69,6 +69,23 @@ export type WalletActionsL2<
|
|
69
69
|
) => Promise<InitiateWithdrawalReturnType>
|
70
70
|
}
|
71
71
|
|
72
|
+
/**
|
73
|
+
* A suite of Wallet Actions for suited for development with Layer 2 (OP Stack) chains.
|
74
|
+
*
|
75
|
+
* - Docs: https://viem.sh/op-stack/client.html
|
76
|
+
*
|
77
|
+
* @example
|
78
|
+
* import { createPublicClient, createWalletClient, http } from 'viem'
|
79
|
+
* import { mainnet } from 'viem/chains'
|
80
|
+
* import { walletActionsL1 } from 'viem/op-stack'
|
81
|
+
*
|
82
|
+
* const walletClient = createWalletClient({
|
83
|
+
* chain: mainnet,
|
84
|
+
* transport: http(),
|
85
|
+
* }).extend(walletActionsL1())
|
86
|
+
*
|
87
|
+
* const hash = await walletClient.depositTransaction({...})
|
88
|
+
*/
|
72
89
|
export function walletActionsL2() {
|
73
90
|
return <
|
74
91
|
TTransport extends Transport,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { Address } from 'abitype'
|
2
2
|
|
3
3
|
import type { Chain } from '../../../types/chain.js'
|
4
|
+
import type { Prettify } from '../../../types/utils.js'
|
4
5
|
import type { TargetChain } from './chain.js'
|
5
6
|
|
6
7
|
export type GetContractAddressParameter<
|
@@ -8,10 +9,18 @@ export type GetContractAddressParameter<
|
|
8
9
|
contractName extends string,
|
9
10
|
> =
|
10
11
|
| (chain extends Chain
|
11
|
-
?
|
12
|
-
|
13
|
-
|
12
|
+
? Prettify<
|
13
|
+
{
|
14
|
+
targetChain: Prettify<TargetChain<chain, contractName>>
|
15
|
+
} & {
|
16
|
+
[_ in `${contractName}Address`]?: undefined
|
17
|
+
}
|
18
|
+
>
|
14
19
|
: never)
|
15
|
-
|
|
16
|
-
|
17
|
-
|
20
|
+
| Prettify<
|
21
|
+
{
|
22
|
+
targetChain?: undefined
|
23
|
+
} & {
|
24
|
+
[_ in `${contractName}Address`]: Address
|
25
|
+
}
|
26
|
+
>
|
@@ -370,7 +370,7 @@ export type WalletActions<
|
|
370
370
|
* value: 1000000000000000000n,
|
371
371
|
* })
|
372
372
|
*/
|
373
|
-
sendTransaction: <TChainOverride extends Chain | undefined>(
|
373
|
+
sendTransaction: <TChainOverride extends Chain | undefined = undefined>(
|
374
374
|
args: SendTransactionParameters<TChain, TAccount, TChainOverride>,
|
375
375
|
) => Promise<SendTransactionReturnType>
|
376
376
|
/**
|
@@ -664,7 +664,7 @@ export type WalletActions<
|
|
664
664
|
const abi extends Abi | readonly unknown[],
|
665
665
|
functionName extends ContractFunctionName<abi, 'payable' | 'nonpayable'>,
|
666
666
|
args extends ContractFunctionArgs<abi, 'pure' | 'view', functionName>,
|
667
|
-
TChainOverride extends Chain | undefined,
|
667
|
+
TChainOverride extends Chain | undefined = undefined,
|
668
668
|
>(
|
669
669
|
args: WriteContractParameters<
|
670
670
|
abi,
|
package/errors/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = '2.0.0-rc.
|
1
|
+
export const version = '2.0.0-rc.3'
|