Skip to content

Commit

Permalink
Merge pull request #132 from brave/chore-upgrade-docs
Browse files Browse the repository at this point in the history
Chore upgrade docs
  • Loading branch information
josheleonard authored Dec 4, 2023
2 parents 83813ac + 99fe5bd commit 2e28385
Show file tree
Hide file tree
Showing 12 changed files with 4,504 additions and 27,066 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@ jobs:
- name: Checkout
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0

- name: Setup Node.js 16.x
- name: Setup Node.js 18.x
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version: 16.x
node-version: 18.x
cache: yarn

- name: Install dependencies
run: yarn install --frozen-lockfile
run: yarn install

- name: Audit dependencies
run: yarn audit

- name: Build website
run: yarn build
Expand Down
4 changes: 4 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"prettier.singleQuote": true,
"prettier.jsxSingleQuote": true
}
Binary file added .yarn/install-state.gz
Binary file not shown.
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
37 changes: 4 additions & 33 deletions docs/ethereum/custom-chains.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,9 @@
sidebar_position: 3
---

# Custom chains
import AddChain from '../../src/components/AddChain'

export const Add = ({children, chainId, decimals, symbol, chainName, rpcUrl, blockExplorerUrl}) => (
<span
style={{
backgroundColor: '#737ADE',
borderRadius: '20px',
color: '#fff',
padding: '10px 20px',
cursor: 'pointer',
}}
onClick={() => {
const params = [{
chainId,
chainName,
nativeCurrency: {
name,
symbol,
decimals
},
rpcUrls: [rpcUrl],
iconUrls: [],
blockExplorerUrls: [ blockExplorerUrl ]
}]
window.ethereum.request({
method: 'wallet_addEthereumChain',
params
})
}}>
Add
</span>
);
# Custom chains

You can add custom networks by navigating to `brave://settings/wallet/networks`
and clicking on the "Add" button. You can enter the network details manually or
Expand All @@ -52,5 +23,5 @@ found below:

| Chain ID | Name | Native currency | Decimals | Add |
| ----------- | -------------------- | --------------- | -------- | ------ |
| 0xa4b1 | Arbitrum One | AETH | 18 | <Add decimals={18} chainId='0xa4b1' symbol='AETH' chainName='Arbitrum One' rpcUrl='https://arb1.arbitrum.io/rpc' blockExplorerUrl='https://arbiscan.io' />
| 0x2105 | Base | ETH | 18 | <Add decimals={18} chainId='0x2105' symbol='ETH' chainName='Base' rpcUrl='https://mainnet.base.org' blockExplorerUrl='https://basescan.org' />
| 0xa4b1 | Arbitrum One | AETH | 18 | <AddChain decimals={18} chainId='0xa4b1' symbol='AETH' chainName='Arbitrum One' rpcUrl='https://arb1.arbitrum.io/rpc' blockExplorerUrl='https://arbiscan.io' />
| 0x2105 | Base | ETH | 18 | <AddChain decimals={18} chainId='0x2105' symbol='ETH' chainName='Base' rpcUrl='https://mainnet.base.org' blockExplorerUrl='https://basescan.org' />
2 changes: 1 addition & 1 deletion docs/provider-availability.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ In addition:

1. If the iframe is third party to the top-level origin, it will be blocked UNLESS the iframe has the `allow="{solana/ethereum}"` attribute (where “solana" and “ethereum" values control the corresponding API permissions).
2. If the iframe is first party to the top-level origin AND the `sandbox` attribute is set on the iframe, it will be blocked UNLESS `sandbox="allow-same-origin"` is set. Note "allow-same-origin"` does nothing if the iframe is third-party.
3. For security-conscious users, we add a setting to block window.{ethereum,solana} in ALL iframes, regardless of origin or attributes. This matches the default behavior on iOS.
3. For security-conscious users, we add a setting to block both `window.ethereum` and `window.solana` in ALL iframes, regardless of origin or attributes. This matches the default behavior on iOS.

### iOS
Currently on iOS, `window.ethereum` and `window.braveSolana` are both undefined in all iframes.
Expand Down
2 changes: 1 addition & 1 deletion docs/solana/provider-api/properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
sidebar_position: 3
---

#Properties
# Properties

## Compatibility
`window.solana` is an alias of `window.braveSolana` which should be used mainly.
Expand Down
25 changes: 15 additions & 10 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion

const lightCodeTheme = require('prism-react-renderer/themes/github');
const darkCodeTheme = require('prism-react-renderer/themes/dracula');

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'Brave Wallet',
Expand Down Expand Up @@ -52,9 +49,21 @@ const config = {
label: 'Intro',
},
*/
{to: 'https://brave.com/download', label: 'Download', position: 'left'},
{to: 'https://twitter.com/brave', label: 'Twitter', position: 'left'},
{to: 'https://github.com/brave/brave-browser', label: 'Github', position: 'left'},
{
to: 'https://brave.com/download',
label: 'Download',
position: 'left',
},
{
to: 'https://twitter.com/brave',
label: 'Twitter',
position: 'left',
},
{
to: 'https://github.com/brave/brave-browser',
label: 'Github',
position: 'left',
},
{
href: 'https://github.com/brave/brave-wallet-docs',
label: 'Docs GitHub',
Expand Down Expand Up @@ -99,10 +108,6 @@ const config = {
],
copyright: `Copyright © ${new Date().getFullYear()} Brave Software, Inc.`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
}),
};

Expand Down
Loading

0 comments on commit 2e28385

Please sign in to comment.