Skip to content

Commit

Permalink
Merge branch 'wagmi-dev:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasbrugneaux authored Nov 3, 2023
2 parents 1d56623 + 339fbf1 commit 23eb6a1
Show file tree
Hide file tree
Showing 29 changed files with 222 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: ./.github/actions/install-dependencies

- name: Setup .npmrc file
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/prune-tags.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup .npmrc file
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/verify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Lint code
run: bun format && bun lint:fix

- uses: stefanzweifel/git-auto-commit-action@v4
- uses: stefanzweifel/git-auto-commit-action@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down Expand Up @@ -150,7 +150,7 @@ jobs:

- name: Set up Node
if: ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand Down
4 changes: 2 additions & 2 deletions site/docs/actions/public/estimateGas.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Accepts a [JSON-RPC Account](/docs/clients/wallet#json-rpc-accounts) or [Local A

```ts
const gasEstimate = await publicClient.estimateGas({
account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', // [!code focus)]
account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266', // [!code focus]
to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
value: parseEther('1')
})
Expand Down Expand Up @@ -194,4 +194,4 @@ const gasEstimate = await publicClient.estimateGas({

## JSON-RPC Methods

[`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas)
[`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas)
2 changes: 2 additions & 0 deletions site/docs/utilities/slice.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,8 @@ slice(
#### options.strict (optional)

- **Type:** `boolean`
- **Default:** `false`


Whether or not the end offset should be inclusive of the bounds of the data.

Expand Down
42 changes: 42 additions & 0 deletions src/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,47 @@
# viem

## 1.18.4

### Patch Changes

- [#1423](https://github.com/wagmi-dev/viem/pull/1423) [`c164bfc6`](https://github.com/wagmi-dev/viem/commit/c164bfc6b8beb4243fbe9d222bd03de2814637b2) Thanks [@CJskii](https://github.com/CJskii)! - Updated Klaytn RPC URL.

- [#1423](https://github.com/wagmi-dev/viem/pull/1423) [`c164bfc6`](https://github.com/wagmi-dev/viem/commit/c164bfc6b8beb4243fbe9d222bd03de2814637b2) Thanks [@CJskii](https://github.com/CJskii)! - Added Astar chain

- [#1435](https://github.com/wagmi-dev/viem/pull/1435) [`08e6a68f`](https://github.com/wagmi-dev/viem/commit/08e6a68f25736c6517b4f5d567a8ff9b3b59bc11) Thanks [@tmm](https://github.com/tmm)! - Fixed protected action types

- [#1432](https://github.com/wagmi-dev/viem/pull/1432) [`33631fb2`](https://github.com/wagmi-dev/viem/commit/33631fb2ac281d5804a596c6390b10403cbcfa72) Thanks [@pcdotfan](https://github.com/pcdotfan)! - Removed Scroll Sepolia WebSocket URLs.

- [#1423](https://github.com/wagmi-dev/viem/pull/1423) [`c164bfc6`](https://github.com/wagmi-dev/viem/commit/c164bfc6b8beb4243fbe9d222bd03de2814637b2) Thanks [@CJskii](https://github.com/CJskii)! - Added Tenet chain

- [#1423](https://github.com/wagmi-dev/viem/pull/1423) [`c164bfc6`](https://github.com/wagmi-dev/viem/commit/c164bfc6b8beb4243fbe9d222bd03de2814637b2) Thanks [@CJskii](https://github.com/CJskii)! - Add Kava chain

- [#1423](https://github.com/wagmi-dev/viem/pull/1423) [`c164bfc6`](https://github.com/wagmi-dev/viem/commit/c164bfc6b8beb4243fbe9d222bd03de2814637b2) Thanks [@CJskii](https://github.com/CJskii)! - Added Core Dao chain

## 1.18.3

### Patch Changes

- [#1424](https://github.com/wagmi-dev/viem/pull/1424) [`a0052303`](https://github.com/wagmi-dev/viem/commit/a0052303f4b6892fac55c2035fe5675890e4d5bf) Thanks [@filoozom](https://github.com/filoozom)! - Added WebSocket RPCs for Gnosis Chain and Chiado

- [#1431](https://github.com/wagmi-dev/viem/pull/1431) [`2244017d`](https://github.com/wagmi-dev/viem/commit/2244017d7603f2253b4faaf6c543c8c7a04f7595) Thanks [@filoozom](https://github.com/filoozom)! - Added the multicall address for Chiado

- [#1426](https://github.com/wagmi-dev/viem/pull/1426) [`c81141a5`](https://github.com/wagmi-dev/viem/commit/c81141a5402d9114856c6a706782085905dbfb13) Thanks [@mnedelchev-vn](https://github.com/mnedelchev-vn)! - Added Neon Mainnet chain.

## 1.18.2

### Patch Changes

- [#1417](https://github.com/wagmi-dev/viem/pull/1417) [`ba17c65e`](https://github.com/wagmi-dev/viem/commit/ba17c65ee5d7ab4804472784acb545805507cdfe) Thanks [@holic](https://github.com/holic)! - Fixed `concat` parameter type.

- [#1415](https://github.com/wagmi-dev/viem/pull/1415) [`5db156aa`](https://github.com/wagmi-dev/viem/commit/5db156aa8b95bc421c82e93b092b2a8bf9b62666) Thanks [@0xKheops](https://github.com/0xKheops)! - Added sorting mechanism to batch scheduler.

## 1.18.1

### Patch Changes

- [#1409](https://github.com/wagmi-dev/viem/pull/1409) [`229e2d56`](https://github.com/wagmi-dev/viem/commit/229e2d565d9d07b9208753f46668378dccf3d399) Thanks [@qbzzt](https://github.com/qbzzt)! - Fixed Holesky public RPC URL.

## 1.18.0

### Minor Changes
Expand Down
4 changes: 4 additions & 0 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ const client = createPublicClient({
const blockNumber = await client.getBlockNumber();
```

## Documentation

[Head to the documentation](https://viem.sh/docs) to read and learn more about viem.

## Community

Check out the following places for more viem-related content:
Expand Down
2 changes: 1 addition & 1 deletion src/actions/ens/getEnsAddress.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ test('offchain: aggregated', async () => {
const client = createPublicClient({
chain: mainnet,
batch: { multicall: true },
transport: http(),
transport: http(process.env.VITE_ANVIL_FORK_URL),
})

const names = await Promise.all([
Expand Down
2 changes: 1 addition & 1 deletion src/actions/public/estimateMaxPriorityFeePerGas.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ describe('mainnet smoke', () => {
expect(await estimateMaxPriorityFeePerGas(mainnetClient)).toBeDefined()
})

test('fallback', async () => {
test.skip('fallback', async () => {
const mainnetClient = createPublicClient({
chain: mainnet,
// cloudflare doesn't support eth_maxPriorityFeePerGas
Expand Down
10 changes: 3 additions & 7 deletions src/actions/wallet/writeContract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,9 @@ export type WriteContractParameters<
GetValue<
TAbi,
TFunctionName,
SendTransactionParameters<
TChain,
TAccount,
TChainOverride
> extends SendTransactionParameters
? SendTransactionParameters<TChain, TAccount, TChainOverride>['value']
: SendTransactionParameters['value']
FormattedTransactionRequest<
TChainOverride extends Chain ? TChainOverride : TChain
>['value']
> & {
/** Data to append to the end of the calldata. Useful for adding a ["domain" tag](https://opensea.notion.site/opensea/Seaport-Order-Attributions-ec2d69bf455041a5baa490941aad307f). */
dataSuffix?: Hex
Expand Down
26 changes: 26 additions & 0 deletions src/chains/definitions/astar.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { defineChain } from '../../utils/chain/defineChain.js'

export const astar = /*#__PURE__*/ defineChain({
id: 592,
name: 'Astar',
network: 'astar-mainnet',
nativeCurrency: {
name: 'Astar',
symbol: 'ASTR',
decimals: 18,
},
rpcUrls: {
public: { http: ['https://astar.api.onfinality.io/public'] },
default: { http: ['https://astar.api.onfinality.io/public'] },
},
blockExplorers: {
default: { name: 'Astar Subscan', url: 'https://astar.subscan.io' },
},
contracts: {
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
blockCreated: 761794,
},
},
testnet: false,
})
10 changes: 8 additions & 2 deletions src/chains/definitions/gnosis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,14 @@ export const gnosis = /*#__PURE__*/ defineChain({
symbol: 'xDAI',
},
rpcUrls: {
default: { http: ['https://rpc.gnosischain.com'] },
public: { http: ['https://rpc.gnosischain.com'] },
default: {
http: ['https://rpc.gnosischain.com'],
webSocket: ['wss://rpc.gnosischain.com/wss'],
},
public: {
http: ['https://rpc.gnosischain.com'],
webSocket: ['wss://rpc.gnosischain.com/wss'],
},
},
blockExplorers: {
etherscan: {
Expand Down
16 changes: 14 additions & 2 deletions src/chains/definitions/gnosisChiado.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,26 @@ export const gnosisChiado = /*#__PURE__*/ defineChain({
symbol: 'xDAI',
},
rpcUrls: {
default: { http: ['https://rpc.chiadochain.net'] },
public: { http: ['https://rpc.chiadochain.net'] },
default: {
http: ['https://rpc.chiadochain.net'],
webSocket: ['wss://rpc.chiadochain.net/wss'],
},
public: {
http: ['https://rpc.chiadochain.net'],
webSocket: ['wss://rpc.chiadochain.net/wss'],
},
},
blockExplorers: {
default: {
name: 'Blockscout',
url: 'https://blockscout.chiadochain.net',
},
},
contracts: {
multicall3: {
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
blockCreated: 4967313,
},
},
testnet: true,
})
2 changes: 1 addition & 1 deletion src/chains/definitions/holesky.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const holesky = /*#__PURE__*/ defineChain({
http: ['https://ethereum-holesky.publicnode.com'],
},
public: {
http: ['wss://ethereum-holesky.publicnode.com'],
http: ['https://ethereum-holesky.publicnode.com'],
},
},
contracts: {
Expand Down
26 changes: 26 additions & 0 deletions src/chains/definitions/kava.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import { defineChain } from '../../utils/chain/defineChain.js'

export const kava = /*#__PURE__*/ defineChain({
id: 2222,
name: 'Kava EVM',
network: 'kava-mainnet',
nativeCurrency: {
name: 'Kava',
symbol: 'KAVA',
decimals: 18,
},
rpcUrls: {
public: { http: ['https://kava-evm.publicnode.com'] },
default: { http: ['https://kava-evm.publicnode.com'] },
},
blockExplorers: {
default: { name: 'Kava EVM Explorer', url: 'https://kavascan.com' },
},
contracts: {
multicall3: {
address: '0xca11bde05977b3631167028862be2a173976ca11',
blockCreated: 3661165,
},
},
testnet: false,
})
4 changes: 2 additions & 2 deletions src/chains/definitions/klaytn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ export const klaytn = /*#__PURE__*/ defineChain({
symbol: 'KLAY',
},
rpcUrls: {
default: { http: ['https://cypress.fautor.app/archive'] },
public: { http: ['https://cypress.fautor.app/archive'] },
default: { http: ['https://klaytn.drpc.org'] },
public: { http: ['https://klaytn.drpc.org'] },
},
blockExplorers: {
etherscan: { name: 'KlaytnScope', url: 'https://scope.klaytn.com' },
Expand Down
2 changes: 1 addition & 1 deletion src/chains/definitions/neonDevnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const neonDevnet = /*#__PURE__*/ defineChain({
blockExplorers: {
default: {
name: 'Neonscan',
url: 'https://neonscan.org',
url: 'https://devnet.neonscan.org',
},
},
contracts: {
Expand Down
24 changes: 24 additions & 0 deletions src/chains/definitions/neonMainnet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { defineChain } from '../../utils/chain/defineChain.js'

export const neonMainnet = /*#__PURE__*/ defineChain({
id: 245_022_934,
network: 'neonMainnet',
name: 'Neon EVM MainNet',
nativeCurrency: { name: 'NEON', symbol: 'NEON', decimals: 18 },
rpcUrls: {
default: {
http: ['https://neon-proxy-mainnet.solana.p2p.org'],
},
public: {
http: ['https://neon-proxy-mainnet.solana.p2p.org'],
},
},
blockExplorers: {
default: {
name: 'Neonscan',
url: 'https://neonscan.org',
},
},
contracts: {},
testnet: false,
})
2 changes: 0 additions & 2 deletions src/chains/definitions/scrollSepolia.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,9 @@ export const scrollSepolia = /*#__PURE__*/ defineChain({
rpcUrls: {
default: {
http: ['https://sepolia-rpc.scroll.io'],
webSocket: ['wss://sepolia-rpc.scroll.io/ws'],
},
public: {
http: ['https://sepolia-rpc.scroll.io'],
webSocket: ['wss://sepolia-rpc.scroll.io/ws'],
},
},
blockExplorers: {
Expand Down
20 changes: 20 additions & 0 deletions src/chains/definitions/tenet.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { defineChain } from '../../utils/chain/defineChain.js'

export const tenet = /*#__PURE__*/ defineChain({
id: 1559,
name: 'Tenet',
network: 'tenet-mainnet',
nativeCurrency: {
name: 'TENET',
symbol: 'TENET',
decimals: 18,
},
rpcUrls: {
public: { http: ['https://rpc.tenet.org'] },
default: { http: ['https://rpc.tenet.org'] },
},
blockExplorers: {
default: { name: 'TenetScan Mainnet', url: 'https://tenetscan.io' },
},
testnet: false,
})
4 changes: 4 additions & 0 deletions src/chains/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ test('exports chains', () => {
"arbitrum",
"arbitrumGoerli",
"arbitrumNova",
"astar",
"arbitrumSepolia",
"astarZkatana",
"aurora",
Expand Down Expand Up @@ -68,6 +69,7 @@ test('exports chains', () => {
"haqqMainnet",
"haqqTestedge2",
"holesky",
"kava",
"klaytn",
"kroma",
"kromaSepolia",
Expand All @@ -91,6 +93,7 @@ test('exports chains', () => {
"moonbeamDev",
"moonriver",
"neonDevnet",
"neonMainnet",
"nexi",
"nexilix",
"oasys",
Expand Down Expand Up @@ -143,6 +146,7 @@ test('exports chains', () => {
"taraxaTestnet",
"telos",
"telosTestnet",
"tenet",
"thunderTestnet",
"vechain",
"wanchain",
Expand Down
Loading

0 comments on commit 23eb6a1

Please sign in to comment.