Ethereum应用连接Nabox插件

安装应用

Chrome商城获取

点击下载

源码获取

从github获取最新的源代码http://github.com/naboxwallet

安装依赖: npm install

本地运行: npm run serve

打包: npm run build

将打包好的文件夹添加到Chrome拓展程序

连接插件

1.window.NaboxWallet

Nabox Wallet向页面内注入了window.NaboxWallet对象;类似于MetaMask注入的ethereum对象;可参照适配MetaMask的方式进行适配。

Nabox Wallet实现了MetaMask部分API,包括:

"eth_accounts",

"eth_requestAccounts",

"eth_sign",

"personal_sign",

"wallet_addEthereumChain",

"wallet_switchEthereumChain",

"eth_sendTransaction",

"eth_getBalance",

"eth_getCode",

"eth_call",

"eth_estimateGas",

"eth_getTransactionByHash",

"eth_blockNumber",

"eth_getTransactionReceipt",

"net_version",

"eth_chainId",

"eth_gasPrice",

以及"accountsChanged","chainChanged"事件

2.window.ethereum

在用户未安装或启用MetaMask的情况下向页面注入window.ethereum对象, 可参照适配MetaMask的方式进行适配。

最后更新于