The UI-即上图左下角metamask-ui部分,即其图形化界面 The MetaMask UI is essentially just a website that can be configured by passing it the API and state subscriptions from above. Anyone could make a UI that consumes these, effectively reskinning MetaMask. MetaMask UI…
The most confusing part about porting MetaMask to a new platform is the way we provide the Web3 API over a series of streams between contexts. Once you understand how we create the InpageProvider in the inpage.js script, you will be able to understan…
()MetaMask Browser Extension https://github.com/MetaMask/metamask-extension 这就是整个metamask的源码所在之处,好好看看 https://metamask.github.io/metamask-extension/这是源码的类.对象等的详细解释 1)了解整个代码的学习流程,看:https://github.com/MetaMask/metamask-extension/blob/develop/docs/porti…
这个就是浏览器后台所进行操作的地方了,它就是页面也区块链进行交互的中间部分. metamask-background描述了为web扩展单例的文件app/scripts/background.js.该上下文实例化了一个MetaMask控制器的实例,该实例表示用户的帐户.到区块链的连接以及与新Dapps的交互. Since background.js is essentially the Extension setup file, we can see it doing all the things…
When a new site is visited, the WebExtension creates a new ContentScript in that page's context, which can be seen at app/scripts/contentscript.js. This script represents a per-page setup process, which creates the per-page web3api, connects it to th…
()metamask-extension/app/scripts/controllers/transactions Transaction Controller is an aggregate of sub-controllers and trackers exposed to the MetaMask controller. 交易控制器是暴露于metamask控制器的子控制器和跟踪器的集合 txStateManager responsible for the state of a transa…
The MetaMask Controller——The central metamask controller. Aggregates other controllers and exports an api. The core functionality of MetaMask all lives in what we call The MetaMask Controller. Our goal for this file is for it to eventually be its own…
https://github.com/MetaMask/metamask-extension/tree/master/app/scripts/controllers/network metamask-extension/app/scripts/controllers/network/network.js const assert = require('assert') const EventEmitter = require('events') const createMetamaskProvi…
以查询历史记录为例: 1.在上层history.js中通过chrome.send()来向底层发送事件请求和相关参数,其中'queryHistory'为信号名称,[this.searchText_, this.offset_, this.rangeInDays_, endTime, maxResults]为向底层传递的参数: chrome.send('queryHistory',[this.searchText_, this.offset_, this.rangeInDays_, endTime,…
1. process 这个process是什么?为何都没有引入就可以使用了呢? process 对象是一个 global (全局变量),提供有关信息,控制当前 Node.js 进程.作为一个对象,它对于 Node.js 应用程序始终是可用的,故无需使用 require(); 那procee.env呢?是啥? process.env属性返回一个包含用户环境信息的对象 2. builds 编译的对象的配置,蓝色框 框起来的是对此对象的注释,这个的解释就是只运行时(CommonJS). 使用bundl…