当前位置:网站首页>The metamask method is used to obtain account information
The metamask method is used to obtain account information
2022-07-02 20:23:00 【JackieDYH】
MetaMask file
Get account information
async function getAccount() {
// Authorize access to accounts
const accounts = await ethereum.request({ method: 'eth_requestAccounts' });
const myAccount = accounts[0];
console.log(myAccount,1);
// Returns the balance of the account at the specified address
const balance = await ethereum.request({ method: 'eth_getBalance',params:[myAccount,"latest"],"id":1});
console.log(balance,2);
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.


边栏推荐
- 【JS】获取hash模式下URL的搜索参数
- 浏览器缓存机制概述
- [cloud native topic -49]:kubesphere cloud Governance - operation - step by step deployment of microservice based business applications - basic processes and steps
- 【Hot100】21. 合并两个有序链表
- AcWing 1126. Minimum cost solution (shortest path Dijkstra)
- 什么叫在线开户?现在网上开户安全么?
- GCC: Graph Contrastive Coding for Graph Neural NetworkPre-Training
- Share several map bed websites for everyone to share pictures
- 在消费互联网时代,诞生了为数不多的头部平台的话
- AcWing 340. Solution to communication line problem (binary + double ended queue BFS for the shortest circuit)
猜你喜欢

upload-labs

An analysis of the past and present life of the meta universe

Jetson XAVIER NX上ResUnet-TensorRT8.2速度與顯存記錄錶(後續不斷補充)

Why do I have a passion for process?

Implementation of online shopping mall system based on SSM

Py's interpret: a detailed introduction to interpret, installation, and case application
In depth understanding of modern web browsers (I)

RPD出品:Superpower Squad 保姆级攻略

JASMINER X4 1U deep disassembly reveals the secret behind high efficiency and power saving

RPD product: super power squad nanny strategy
随机推荐
接口测试到底怎么做?看完这篇文章就能清晰明了
【JS】获取hash模式下URL的搜索参数
Cron expression (seven subexpressions)
Is it safe to open an account for online stock speculation? I'm a novice, please guide me
Common problems and description of kt148a voice chip IC development
Second hand housing data analysis and prediction system
AcWing 1127. Sweet butter solution (shortest path SPFA)
What is online account opening? Is it safe to open an account online now?
After 65 days of closure and control of the epidemic, my home office experience sharing | community essay solicitation
For (Auto A: b) and for (Auto & A: b) usage
【Kubernetes系列】kubeadm reset初始化前后空间、内存使用情况对比
[Chongqing Guangdong education] reference materials for labor education of college students in Nanjing University
Shardingsphere jdbc5.1.2 about select last_ INSERT_ ID () I found that there was still a routing problem
自動生成VGG圖像注釋文件
Review of the latest 2022 research on "deep learning methods for industrial defect detection"
Istio deployment: quickly start microservices,
[JS] get the search parameters of URL in hash mode
【Hot100】22. bracket-generating
B端电商-订单逆向流程
Summary of interview experience, escort your offer, full of knowledge points