Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/MetaMask/metamask-docs in…
Browse files Browse the repository at this point in the history
…to BboyAkers-live-coding
  • Loading branch information
BboyAkers committed Mar 11, 2020
2 parents 36d29e6 + cb36b92 commit 352ccfd
Show file tree
Hide file tree
Showing 18 changed files with 47 additions and 807 deletions.
27 changes: 0 additions & 27 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,13 @@ const { fs, path } = require('@vuepress/shared-utils')

module.exports = ctx => ({
dest: 'docs/dist',
base: '/metamask-docs/',

locales: {
'/': {
lang: 'en-US',
title: 'MetaMask Docs',
description: 'Welcome'
}
// '/zh/': {
// lang: 'zh-CN',
// title: 'MetaMask Developer Documentation',
// description: 'Vue 驱动的静态网站生成器'
// }
},
head: [
['link', { rel: 'icon', href: `/metamask-fox.svg` }],
Expand All @@ -32,11 +26,6 @@ module.exports = ctx => ({
repo: 'MetaMask/metamask-docs',
editLinks: true,
docsDir: 'packages/docs/dist',
// #697 Provided by the official algolia team.
// algolia: ctx.isProd ? ({
// apiKey: '3a539aab83105f01761a137c61004d85',
// indexName: 'vuepress'
// }) : null,
locales: {
'/': {
label: 'English',
Expand All @@ -48,17 +37,6 @@ module.exports = ctx => ({
'/guide/': getGuideSidebar('Guide', 'API Reference','Best Practices'),
}
}
// '/zh/': {
// label: '简体中文',
// selectText: '选择语言',
// editLinkText: '在 GitHub 上编辑此页',
// lastUpdated: '上次更新',
// nav: require('./nav/zh'),
// sidebar: {
// '/zh/api/': getApiSidebar(),
// '/zh/guide/': getGuideSidebar('指南', '深入','深入'),
// }
// }
}
},
plugins: [
Expand All @@ -84,7 +62,6 @@ module.exports = ctx => ({
],
extraWatchFiles: [
'.vuepress/nav/en.js',
// '.vuepress/nav/zh.js',
]
})

Expand Down Expand Up @@ -124,7 +101,3 @@ function getGuideSidebar (groupA, groupB, groupC) {
]
}

const officalPlugins = fs
.readdirSync(path.resolve(__dirname, '../plugin/official'))
.map(filename => 'official/' + filename.slice(0, -3))
.sort()
70 changes: 0 additions & 70 deletions docs/.vuepress/nav/zh.js

This file was deleted.

Binary file removed docs/.vuepress/public/architecture.png
Binary file not shown.
Binary file removed docs/.vuepress/public/hero.png
Binary file not shown.
Binary file removed docs/.vuepress/public/line-numbers-desktop.png
Binary file not shown.
Binary file removed docs/.vuepress/public/line-numbers-mobile.gif
Binary file not shown.
Binary file removed docs/.vuepress/public/logo.png
Binary file not shown.
47 changes: 47 additions & 0 deletions docs/guide/experimental-apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,50 @@ This method returns a `Promise` that resolves to a `Boolean` indicating if the c
### `ethereum._metamask.isUnlocked: () => Promise<boolean>`

This method returns a `Promise` that resolves to a `Boolean` indicating if MetaMask is unlocked by the user. This is useful for knowing if MetaMask is unlocked in order to provide meaningful instructions to the user during onboarding. Note that this does not indicate if a user has approved account exposure.

## `eth_` RPC methods

### eth_getEncryptionPublicKey

This method is used for getting a public key that based on the `nacl` [library](https://github.com/dchest/tweetnacl-js). With such a key, you can encrypt a message.

```javascript
ethereum.sendAsync({
jsonrpc: '2.0',
method: 'eth_getEncryptionPublicKey',
params: [accounts[0]],
from: accounts[0],
}, function(error, encryptionpublickey) {
if (!error) {
window.encryptionpublickey = encryptionpublickey.result;
} else {
console.log(error);
}
})
```

An example of how to encrypt a message via [sigUtil](https://github.com/MetaMask/eth-sig-util)

```javascript
const encryptedMessage = web3.toHex(JSON.stringify(sigUtil.encrypt(window.encryptionpublickey, {'data': 'Hello world!'}, 'x25519-xsalsa20-poly1305')));
```

### eth_decrypt

This method is used to decrypt a message that was encrypted using the public key based on the `nacl` [library](https://github.com/dchest/tweetnacl-js).

```javascript
web3.currentProvider.sendAsync({
jsonrpc: '2.0',
method: 'eth_decrypt',
params: [encryptedMessage, accounts[0]],
from: accounts[0],
}, function(error, message) {
console.log(error, message);
if (!error) {
console.log(message.result); // Hello world!
} else {
console.log(error.message);
}
});
```
14 changes: 0 additions & 14 deletions docs/plugin/README.md

This file was deleted.

47 changes: 0 additions & 47 deletions docs/plugin/official/plugin-active-header-links.md

This file was deleted.

23 changes: 0 additions & 23 deletions docs/plugin/official/plugin-back-to-top.md

This file was deleted.

43 changes: 0 additions & 43 deletions docs/plugin/official/plugin-google-analytics.md

This file was deleted.

57 changes: 0 additions & 57 deletions docs/plugin/official/plugin-last-updated.md

This file was deleted.

Loading

0 comments on commit 352ccfd

Please sign in to comment.