viem 2.8.6 → 2.8.10
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 +30 -0
- package/_cjs/chains/definitions/arbitrumSepolia.js +1 -1
- package/_cjs/chains/definitions/arbitrumSepolia.js.map +1 -1
- package/_cjs/chains/definitions/beam.js +2 -0
- package/_cjs/chains/definitions/beam.js.map +1 -1
- package/_cjs/chains/definitions/beamTestnet.js +2 -0
- package/_cjs/chains/definitions/beamTestnet.js.map +1 -1
- package/_cjs/chains/definitions/flowMainnet.js +25 -0
- package/_cjs/chains/definitions/flowMainnet.js.map +1 -0
- package/_cjs/chains/definitions/flowPreviewnet.js +25 -0
- package/_cjs/chains/definitions/flowPreviewnet.js.map +1 -0
- package/_cjs/chains/definitions/morphSepolia.js +23 -0
- package/_cjs/chains/definitions/morphSepolia.js.map +1 -0
- package/_cjs/chains/definitions/stratis.js +26 -0
- package/_cjs/chains/definitions/stratis.js.map +1 -0
- package/_cjs/chains/index.js +12 -4
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/clients/decorators/public.js +2 -0
- package/_cjs/clients/decorators/public.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/errors/version.js.map +1 -1
- package/_cjs/utils/abi/encodeAbiParameters.js +3 -0
- package/_cjs/utils/abi/encodeAbiParameters.js.map +1 -1
- package/_esm/chains/definitions/arbitrumSepolia.js +1 -1
- package/_esm/chains/definitions/arbitrumSepolia.js.map +1 -1
- package/_esm/chains/definitions/beam.js +2 -0
- package/_esm/chains/definitions/beam.js.map +1 -1
- package/_esm/chains/definitions/beamTestnet.js +2 -0
- package/_esm/chains/definitions/beamTestnet.js.map +1 -1
- package/_esm/chains/definitions/flowMainnet.js +22 -0
- package/_esm/chains/definitions/flowMainnet.js.map +1 -0
- package/_esm/chains/definitions/flowPreviewnet.js +22 -0
- package/_esm/chains/definitions/flowPreviewnet.js.map +1 -0
- package/_esm/chains/definitions/morphSepolia.js +20 -0
- package/_esm/chains/definitions/morphSepolia.js.map +1 -0
- package/_esm/chains/definitions/stratis.js +23 -0
- package/_esm/chains/definitions/stratis.js.map +1 -0
- package/_esm/chains/index.js +4 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/clients/decorators/public.js +2 -0
- package/_esm/clients/decorators/public.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/errors/version.js.map +1 -1
- package/_esm/utils/abi/encodeAbiParameters.js +3 -0
- package/_esm/utils/abi/encodeAbiParameters.js.map +1 -1
- package/_types/chains/definitions/arbitrumSepolia.d.ts +1 -1
- package/_types/chains/definitions/beam.d.ts +2 -0
- package/_types/chains/definitions/beam.d.ts.map +1 -1
- package/_types/chains/definitions/beamTestnet.d.ts +2 -0
- package/_types/chains/definitions/beamTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/flowMainnet.d.ts +35 -0
- package/_types/chains/definitions/flowMainnet.d.ts.map +1 -0
- package/_types/chains/definitions/flowPreviewnet.d.ts +35 -0
- package/_types/chains/definitions/flowPreviewnet.d.ts.map +1 -0
- package/_types/chains/definitions/morphSepolia.d.ts +36 -0
- package/_types/chains/definitions/morphSepolia.d.ts.map +1 -0
- package/_types/chains/definitions/stratis.d.ts +36 -0
- package/_types/chains/definitions/stratis.d.ts.map +1 -0
- package/_types/chains/index.d.ts +4 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/clients/decorators/public.d.ts +22 -0
- package/_types/clients/decorators/public.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/errors/version.d.ts.map +1 -1
- package/_types/utils/abi/encodeAbiParameters.d.ts.map +1 -1
- package/chains/definitions/arbitrumSepolia.ts +1 -1
- package/chains/definitions/beam.ts +2 -0
- package/chains/definitions/beamTestnet.ts +2 -0
- package/chains/definitions/flowMainnet.ts +22 -0
- package/chains/definitions/flowPreviewnet.ts +22 -0
- package/chains/definitions/morphSepolia.ts +20 -0
- package/chains/definitions/stratis.ts +23 -0
- package/chains/index.ts +4 -0
- package/clients/decorators/public.ts +26 -0
- package/errors/version.ts +1 -1
- package/package.json +1 -1
- package/utils/abi/encodeAbiParameters.ts +5 -0
@@ -12,9 +12,11 @@ export const beam = /*#__PURE__*/ defineChain({
|
|
12
12
|
rpcUrls: {
|
13
13
|
public: {
|
14
14
|
http: ['https://build.onbeam.com/rpc'],
|
15
|
+
webSocket: ['wss://build.onbeam.com/ws'],
|
15
16
|
},
|
16
17
|
default: {
|
17
18
|
http: ['https://build.onbeam.com/rpc'],
|
19
|
+
webSocket: ['wss://build.onbeam.com/ws'],
|
18
20
|
},
|
19
21
|
},
|
20
22
|
blockExplorers: {
|
@@ -12,9 +12,11 @@ export const beamTestnet = /*#__PURE__*/ defineChain({
|
|
12
12
|
rpcUrls: {
|
13
13
|
public: {
|
14
14
|
http: ['https://build.onbeam.com/rpc/testnet'],
|
15
|
+
webSocket: ['wss://build.onbeam.com/ws/testnet'],
|
15
16
|
},
|
16
17
|
default: {
|
17
18
|
http: ['https://build.onbeam.com/rpc/testnet'],
|
19
|
+
webSocket: ['wss://build.onbeam.com/ws/testnet'],
|
18
20
|
},
|
19
21
|
},
|
20
22
|
blockExplorers: {
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
|
+
|
3
|
+
export const flowMainnet = /*#__PURE__*/ defineChain({
|
4
|
+
id: 747,
|
5
|
+
name: 'FlowEVM Mainnet',
|
6
|
+
nativeCurrency: {
|
7
|
+
decimals: 18,
|
8
|
+
name: 'Flow',
|
9
|
+
symbol: 'FLOW',
|
10
|
+
},
|
11
|
+
rpcUrls: {
|
12
|
+
default: {
|
13
|
+
http: ['https://mainnet.evm.nodes.onflow.org'],
|
14
|
+
},
|
15
|
+
},
|
16
|
+
blockExplorers: {
|
17
|
+
default: {
|
18
|
+
name: 'Mainnet Explorer',
|
19
|
+
url: 'https://flowdiver.io',
|
20
|
+
},
|
21
|
+
},
|
22
|
+
})
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
|
+
|
3
|
+
export const flowPreviewnet = /*#__PURE__*/ defineChain({
|
4
|
+
id: 646,
|
5
|
+
name: 'FlowEVM Previewnet',
|
6
|
+
nativeCurrency: {
|
7
|
+
decimals: 18,
|
8
|
+
name: 'Flow',
|
9
|
+
symbol: 'FLOW',
|
10
|
+
},
|
11
|
+
rpcUrls: {
|
12
|
+
default: {
|
13
|
+
http: ['https://previewnet.evm.nodes.onflow.org'],
|
14
|
+
},
|
15
|
+
},
|
16
|
+
blockExplorers: {
|
17
|
+
default: {
|
18
|
+
name: 'Previewnet Explorer',
|
19
|
+
url: 'https://previewnet.flowdiver.io',
|
20
|
+
},
|
21
|
+
},
|
22
|
+
})
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
|
+
|
3
|
+
export const morphSepolia = /*#__PURE__*/ defineChain({
|
4
|
+
id: 2710,
|
5
|
+
name: 'Morph Sepolia',
|
6
|
+
nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 },
|
7
|
+
rpcUrls: {
|
8
|
+
default: {
|
9
|
+
http: ['https://rpc-testnet.morphl2.io'],
|
10
|
+
},
|
11
|
+
},
|
12
|
+
blockExplorers: {
|
13
|
+
default: {
|
14
|
+
name: 'Morph Testnet Explorer',
|
15
|
+
url: 'https://explorer-testnet.morphl2.io',
|
16
|
+
apiUrl: 'https://explorer-api-testnet.morphl2.io/api',
|
17
|
+
},
|
18
|
+
},
|
19
|
+
testnet: true,
|
20
|
+
})
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
|
+
|
3
|
+
export const stratis = /*#__PURE__*/ defineChain({
|
4
|
+
id: 105105,
|
5
|
+
name: 'Stratis Mainnet',
|
6
|
+
network: 'stratis',
|
7
|
+
nativeCurrency: {
|
8
|
+
name: 'Stratis',
|
9
|
+
symbol: 'STRAX',
|
10
|
+
decimals: 18,
|
11
|
+
},
|
12
|
+
rpcUrls: {
|
13
|
+
default: {
|
14
|
+
http: ['https://rpc.stratisevm.com'],
|
15
|
+
},
|
16
|
+
},
|
17
|
+
blockExplorers: {
|
18
|
+
default: {
|
19
|
+
name: 'Stratis Explorer',
|
20
|
+
url: 'https://explorer.stratisevm.com',
|
21
|
+
},
|
22
|
+
},
|
23
|
+
})
|
package/chains/index.ts
CHANGED
@@ -72,6 +72,8 @@ export { filecoinCalibration } from './definitions/filecoinCalibration.js'
|
|
72
72
|
export { filecoinHyperspace } from './definitions/filecoinHyperspace.js'
|
73
73
|
export { flare } from './definitions/flare.js'
|
74
74
|
export { flareTestnet } from './definitions/flareTestnet.js'
|
75
|
+
export { flowPreviewnet } from './definitions/flowPreviewnet.js'
|
76
|
+
export { flowMainnet } from './definitions/flowMainnet.js'
|
75
77
|
/** @deprecated Use `anvil` instead. */
|
76
78
|
export { foundry } from './definitions/foundry.js'
|
77
79
|
export { fraxtal } from './definitions/fraxtal.js'
|
@@ -131,6 +133,7 @@ export { moonbaseAlpha } from './definitions/moonbaseAlpha.js'
|
|
131
133
|
export { moonbeam } from './definitions/moonbeam.js'
|
132
134
|
export { moonbeamDev } from './definitions/moonbeamDev.js'
|
133
135
|
export { moonriver } from './definitions/moonriver.js'
|
136
|
+
export { morphSepolia } from './definitions/morphSepolia.js'
|
134
137
|
export { neonDevnet } from './definitions/neonDevnet.js'
|
135
138
|
export { neonMainnet } from './definitions/neonMainnet.js'
|
136
139
|
export { nexi } from './definitions/nexi.js'
|
@@ -194,6 +197,7 @@ export { songbirdTestnet } from './definitions/songbirdTestnet.js'
|
|
194
197
|
export { spicy } from './definitions/spicy.js'
|
195
198
|
export { shardeumSphinx } from './definitions/shardeumSphinx.js'
|
196
199
|
export { shibarium } from './definitions/shibarium.js'
|
200
|
+
export { stratis } from './definitions/stratis.js'
|
197
201
|
export { syscoin } from './definitions/syscoin.js'
|
198
202
|
export { syscoinTestnet } from './definitions/syscoinTestnet.js'
|
199
203
|
export { taraxa } from './definitions/taraxa.js'
|
@@ -73,6 +73,10 @@ import {
|
|
73
73
|
type GetBalanceReturnType,
|
74
74
|
getBalance,
|
75
75
|
} from '../../actions/public/getBalance.js'
|
76
|
+
import {
|
77
|
+
type GetBlobBaseFeeReturnType,
|
78
|
+
getBlobBaseFee,
|
79
|
+
} from '../../actions/public/getBlobBaseFee.js'
|
76
80
|
import {
|
77
81
|
type GetBlockParameters,
|
78
82
|
type GetBlockReturnType,
|
@@ -511,6 +515,27 @@ export type PublicActions<
|
|
511
515
|
* // 10000000000000000000000n (wei)
|
512
516
|
*/
|
513
517
|
getBalance: (args: GetBalanceParameters) => Promise<GetBalanceReturnType>
|
518
|
+
/**
|
519
|
+
* Returns the base fee per blob gas in wei.
|
520
|
+
*
|
521
|
+
* - Docs: https://viem.sh/docs/actions/public/getBlobBaseFee
|
522
|
+
* - JSON-RPC Methods: [`eth_blobBaseFee`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blobBaseFee)
|
523
|
+
*
|
524
|
+
* @param client - Client to use
|
525
|
+
* @returns The blob base fee (in wei). {@link GetBlobBaseFeeReturnType}
|
526
|
+
*
|
527
|
+
* @example
|
528
|
+
* import { createPublicClient, http } from 'viem'
|
529
|
+
* import { mainnet } from 'viem/chains'
|
530
|
+
* import { getBlobBaseFee } from 'viem/public'
|
531
|
+
*
|
532
|
+
* const client = createPublicClient({
|
533
|
+
* chain: mainnet,
|
534
|
+
* transport: http(),
|
535
|
+
* })
|
536
|
+
* const blobBaseFee = await client.getBlobBaseFee()
|
537
|
+
*/
|
538
|
+
getBlobBaseFee: () => Promise<GetBlobBaseFeeReturnType>
|
514
539
|
/**
|
515
540
|
* Returns information about a block at a block number, hash, or tag.
|
516
541
|
*
|
@@ -1746,6 +1771,7 @@ export function publicActions<
|
|
1746
1771
|
estimateContractGas: (args) => estimateContractGas(client, args as any),
|
1747
1772
|
estimateGas: (args) => estimateGas(client, args),
|
1748
1773
|
getBalance: (args) => getBalance(client, args),
|
1774
|
+
getBlobBaseFee: () => getBlobBaseFee(client),
|
1749
1775
|
getBlock: (args) => getBlock(client, args),
|
1750
1776
|
getBlockNumber: (args) => getBlockNumber(client, args),
|
1751
1777
|
getBlockTransactionCount: (args) => getBlockTransactionCount(client, args),
|
package/errors/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = '2.8.
|
1
|
+
export const version = '2.8.10'
|
package/package.json
CHANGED
@@ -20,6 +20,7 @@ import {
|
|
20
20
|
InvalidAddressError,
|
21
21
|
type InvalidAddressErrorType,
|
22
22
|
} from '../../errors/address.js'
|
23
|
+
import { BaseError } from '../../errors/base.js'
|
23
24
|
import type { ErrorType } from '../../errors/utils.js'
|
24
25
|
import type { Hex } from '../../types/misc.js'
|
25
26
|
import { type IsAddressErrorType, isAddress } from '../address/isAddress.js'
|
@@ -311,6 +312,10 @@ export type EncodeBoolErrorType =
|
|
311
312
|
| ErrorType
|
312
313
|
|
313
314
|
function encodeBool(value: boolean): PreparedParam {
|
315
|
+
if (typeof value !== 'boolean')
|
316
|
+
throw new BaseError(
|
317
|
+
`Invalid boolean value: "${value}" (type: ${typeof value}). Expected: \`true\` or \`false\`.`,
|
318
|
+
)
|
314
319
|
return { dynamic: false, encoded: padHex(boolToHex(value)) }
|
315
320
|
}
|
316
321
|
|