buzzup-docs/wallet/eth_chainId.mdx

23 lines
393 B
Plaintext
Raw Normal View History

2024-10-18 12:24:14 +08:00
---
title: eth_chainId
description: 获取BUZZUP当前的chainId
---
---
### 参数
- 该方法不接受任何参数
---
### 返回值
- <div>ChainId<span style={{marginLeft:10,color:'#707070'}}>hex encoded bytes</span></div>
---
### Request
```js
async function getAccounts() {
const chainId = await window.ethereum.request({ method: 'eth_chainId' });
console.log(chainId);
}
```