Skip to content

Commit

Permalink
Merge branch 'main' into zs/jsx-user-defined
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandratran committed Sep 18, 2024
2 parents b7964ab + 96cc0f7 commit 3253dc6
Show file tree
Hide file tree
Showing 11 changed files with 203 additions and 40 deletions.
28 changes: 26 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
* @MetaMask/tech-writers
# This is a codeowners file. The last matching pattern takes precedence,
# so the listed codeowners apply only if there is no later match.

# Default owner for all other files
* @MetaMask/activation

# Docusaurus configuration
docusaurus.config.js @MetaMask/activation @MetaMask/tech-writers

# Vercel configuration
vercel.json @MetaMask/activation @MetaMask/tech-writers

# Sidebar files
*-sidebar.js @MetaMask/activation @MetaMask/tech-writers

# All other Markdown files
*.md @MetaMask/tech-writers
*.mdx @MetaMask/tech-writers

# Services documentation
/services/ @MetaMask/tech-writers

# Snaps documentation
/snaps/ @MetaMask/tech-writers @MetaMask/snaps
/wallet/ @MetaMask/tech-writers @MetaMask/dev-ex

# Wallet and SDK documentation
/wallet/ @MetaMask/tech-writers @MetaMask/wallet-api-platform-engineers @MetaMask/sdk-devs
18 changes: 2 additions & 16 deletions docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const config = {

customFields: {
LD_CLIENT_ID: process.env.LD_CLIENT_ID,
SENTRY_KEY: process.env.SENTRY_KEY,
},

trailingSlash: true,
Expand Down Expand Up @@ -158,22 +159,7 @@ const config = {
]
: null,
"./src/plugins/launchdarkly",
[
"docusaurus-plugin-sentry",
{
DSN: "d3220b0812610810ddb5a911b3d97790",
configuration: {
sentry: {
init: {
replaysOnErrorSampleRate: isProd ? 1.0 : 0,
replaysSessionSampleRate: isProd ? 1.0 : 0,
sampleRate: isProd ? 0.25 : 0,
tracesSampleRate: 0,
},
},
},
},
],
"./src/plugins/sentry",
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@
"@rjsf/core": "^5.18.4",
"@rjsf/utils": "^5.18.4",
"@rjsf/validator-ajv8": "^5.18.4",
"@sentry/browser": "^8.30.0",
"clsx": "^1.2.1",
"docusaurus-plugin-segment": "^1.0.4",
"docusaurus-plugin-sentry": "^2.0.0",
"dotenv": "^16.4.5",
"js-cookie": "^3.0.5",
"launchdarkly-js-client-sdk": "^3.3.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
- `block parameter`: _[Required]_ The hexadecimal block number, or the string `latest`, `earliest`, or `pending`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block).
- `options`: A list of tracing options. Tracing options are [`trace`](../../ethereum/json-rpc-methods/trace-methods/index.md#trace) and [`stateDiff`](../../ethereum/json-rpc-methods/trace-methods/index.md#statediff). Specify both options or none.
- `trace call parameters`: _[Required]_ Array of trace call parameters.
Each trace call parameter itself is an array containing the following:
- `transaction call object`: _[Required]_ Transaction call object containing the same data as in the [`trace_call`](../../ethereum/json-rpc-methods/trace-methods/trace_call.mdx#parameters) parameter.
- `options`:_[Optional]_ An array of tracing options. Tracing options are [`trace`](../../ethereum/json-rpc-methods/trace-methods/index.md#trace) and [`stateDiff`](../../ethereum/json-rpc-methods/trace-methods/index.md#statediff). Specify both options or none.
- `block parameter`: _[Required]_ The hexadecimal block number, or the string `latest`, `earliest`, or `pending`. See the [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block). The block parameter is applied uniformly to all trace calls in the `trace call parameters` array.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import TabItem from "@theme/TabItem"
curl https://mainnet.infura.io/v3/<YOUR-API-KEY> \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "trace_callMany", "params": [[[{"from": "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "value": "0x186a0"}, ["trace"]], [{"from": "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "value": "0x186a0"}, ["trace"]]], "latest"], "latest"], "id": 1}
-d '{"jsonrpc": "2.0", "method": "trace_callMany", "params": [[[{"from": "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "value": "0x186a0"}, ["trace"]], [{"from": "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "value": "0x186a0"}, ["trace"]]], "latest"], "id": 1}
```
</TabItem>
<TabItem value="WSS">
```bash
wscat -c wss://mainnet.infura.io/ws/v3/<YOUR-API-KEY> -x '{"jsonrpc": "2.0", "method": "trace_callMany", "params": [[[{"from":"0x407d73d8a49eeb85d32cf465507dd71d507100c1","to":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "value": "0x186a0"}, ["trace"]], [{"from": "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "value": "0x186a0"}, ["trace"]]], "latest"], "latest"], "id": 1}'
wscat -c wss://mainnet.infura.io/ws/v3/<YOUR-API-KEY> -x '{"jsonrpc": "2.0", "method": "trace_callMany", "params": [[[{"from":"0x407d73d8a49eeb85d32cf465507dd71d507100c1","to":"0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "value": "0x186a0"}, ["trace"]], [{"from": "0x407d73d8a49eeb85d32cf465507dd71d507100c1", "to": "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "value": "0x186a0"}, ["trace"]]], "latest"], "id": 1}'
```
</TabItem>
Expand Down
16 changes: 11 additions & 5 deletions snaps/reference/keyring-api/account-management/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,16 @@ null

### `keyring_exportAccount`

Exports the private key of an account managed by the Snap.
A Snap might choose to not support this method.
Exports account data managed by the Snap.
This might include the public key, address, or derivation path.
The exact data exported depends on the Snap's implementation and security considerations.
A Snap might choose to not support this method or limit the data it exports.

:::warning

This method can export private keys or any other sensitive data.

:::

#### Parameters

Expand All @@ -124,9 +132,7 @@ An object containing:

#### Returns

An object containing:

- `privateKey`: `string` - The account's private key.
An object containing the account data.

#### Example

Expand Down
21 changes: 21 additions & 0 deletions src/plugins/sentry/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as path from "path";

const SentryPlugin = () => {
return {
name: "docusaurus-plugin-sentry",
getClientModules() {
return [path.resolve(__dirname, "./sentry")];
},
configureWebpack() {
return {
resolve: {
alias: {
"sentry-plugin": path.resolve(__dirname, "./sentry.ts"),
},
},
};
},
};
};

export default SentryPlugin;
16 changes: 16 additions & 0 deletions src/plugins/sentry/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "docusaurus-plugin-sentry",
"version": "1.0.0",
"description": "A Sentry plugin to initialize the Sentry SDK",
"main": "index.ts",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [
"docusaurus-plugin",
"sentry-plugin",
"sentry"
],
"author": "Vlad Lo.",
"license": "MIT"
}
28 changes: 28 additions & 0 deletions src/plugins/sentry/sentry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import ExecutionEnvironment from "@docusaurus/ExecutionEnvironment";
import siteConfig from "@generated/docusaurus.config";
import * as Sentry from "@sentry/browser";

const isProd = process.env.NODE_ENV === "production";

export default (function () {
if (!ExecutionEnvironment.canUseDOM) {
return null;
}

const { SENTRY_KEY } = siteConfig.customFields;

Sentry.init({
dsn: SENTRY_KEY as string,
replaysOnErrorSampleRate: isProd ? 1.0 : 0,
replaysSessionSampleRate: isProd ? 1.0 : 0,
sampleRate: isProd ? 0.25 : 0,
tracesSampleRate: 0,
debug: !isProd,
});

Sentry.replayIntegration({
maskAllText: false,
});

return Sentry;
})();
3 changes: 3 additions & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"paths": {
"launchdarkly": [
"./node_modules/launchdarkly-js-client-sdk/dist/ldclient.es.js"
],
"sentry-plugin": [
"./node_modules/@sentry/browser/build/npm/esm/index.js"
]
}
},
Expand Down
100 changes: 88 additions & 12 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3587,6 +3587,52 @@ __metadata:
languageName: node
linkType: hard

"@sentry-internal/browser-utils@npm:8.30.0":
version: 8.30.0
resolution: "@sentry-internal/browser-utils@npm:8.30.0"
dependencies:
"@sentry/core": 8.30.0
"@sentry/types": 8.30.0
"@sentry/utils": 8.30.0
checksum: 140af9257b9bcec09c1f8183db935265b9ca20d4e21c07051982f6419ba84cd39efb3d5016e54387df4abfd9cf0c76c3125ca8d1f624c78e2cacef411613908a
languageName: node
linkType: hard

"@sentry-internal/feedback@npm:8.30.0":
version: 8.30.0
resolution: "@sentry-internal/feedback@npm:8.30.0"
dependencies:
"@sentry/core": 8.30.0
"@sentry/types": 8.30.0
"@sentry/utils": 8.30.0
checksum: 7d64b3e7439e6cb9d9c8eb29a3eca0ab67fed1d4d05e9a6299b0ca479cca4c154a81e7245ebbd75fec5aa8cc2e05f0b49b4259b5c0f096d861bc30115edc7a76
languageName: node
linkType: hard

"@sentry-internal/replay-canvas@npm:8.30.0":
version: 8.30.0
resolution: "@sentry-internal/replay-canvas@npm:8.30.0"
dependencies:
"@sentry-internal/replay": 8.30.0
"@sentry/core": 8.30.0
"@sentry/types": 8.30.0
"@sentry/utils": 8.30.0
checksum: 7d2f26ded82c36a0dcab287a1c36dc3c3047b183a59449016ffb794f6695b3c289206df52bbf0937ed2020e831d9265e544075951ac7d4f0fa09361c9c75dab8
languageName: node
linkType: hard

"@sentry-internal/replay@npm:8.30.0":
version: 8.30.0
resolution: "@sentry-internal/replay@npm:8.30.0"
dependencies:
"@sentry-internal/browser-utils": 8.30.0
"@sentry/core": 8.30.0
"@sentry/types": 8.30.0
"@sentry/utils": 8.30.0
checksum: 1e46ba6134cd979400664ad9b5e6b22de60c64c5e5fd50a8004043956830836bff70aebd01f8469680e3968845ae36307ba562b2f0e62ecdc1cdcfb2fa8d7ad4
languageName: node
linkType: hard

"@sentry/browser@npm:6.19.7":
version: 6.19.7
resolution: "@sentry/browser@npm:6.19.7"
Expand All @@ -3599,6 +3645,21 @@ __metadata:
languageName: node
linkType: hard

"@sentry/browser@npm:^8.30.0":
version: 8.30.0
resolution: "@sentry/browser@npm:8.30.0"
dependencies:
"@sentry-internal/browser-utils": 8.30.0
"@sentry-internal/feedback": 8.30.0
"@sentry-internal/replay": 8.30.0
"@sentry-internal/replay-canvas": 8.30.0
"@sentry/core": 8.30.0
"@sentry/types": 8.30.0
"@sentry/utils": 8.30.0
checksum: 08bb5a6e63f343470b45b9f76820158812a2b178e3c956aeb7142421247f7c648a1e44e7abdeb80e9aaec0472b89df1105a0fb539672a177970ad63040d871c3
languageName: node
linkType: hard

"@sentry/core@npm:6.19.7":
version: 6.19.7
resolution: "@sentry/core@npm:6.19.7"
Expand All @@ -3612,6 +3673,16 @@ __metadata:
languageName: node
linkType: hard

"@sentry/core@npm:8.30.0":
version: 8.30.0
resolution: "@sentry/core@npm:8.30.0"
dependencies:
"@sentry/types": 8.30.0
"@sentry/utils": 8.30.0
checksum: 986b5e97b25bfc3759065b0009f56460794d6402fcdca5b0618e41b3539987ee243a7db5d69e6f55fc7062b0acbbb4858109032f0763754bdf5563d011195ae0
languageName: node
linkType: hard

"@sentry/hub@npm:6.19.7":
version: 6.19.7
resolution: "@sentry/hub@npm:6.19.7"
Expand Down Expand Up @@ -3657,6 +3728,13 @@ __metadata:
languageName: node
linkType: hard

"@sentry/types@npm:8.30.0":
version: 8.30.0
resolution: "@sentry/types@npm:8.30.0"
checksum: d96138af9692f31ff42fd6e4bdb32ea16659f212f09b4e23c8114c8eed73a1cc601595ef2bb00b8277080b552dfa8eab36abc3a5c10f06edff9785bd420d178f
languageName: node
linkType: hard

"@sentry/utils@npm:6.19.7":
version: 6.19.7
resolution: "@sentry/utils@npm:6.19.7"
Expand All @@ -3667,6 +3745,15 @@ __metadata:
languageName: node
linkType: hard

"@sentry/utils@npm:8.30.0":
version: 8.30.0
resolution: "@sentry/utils@npm:8.30.0"
dependencies:
"@sentry/types": 8.30.0
checksum: f18095f95cb33befb0292bc8ad731822f20fe1e8f684ccf634943a9cc20b3a700a6c9119ed56b5a6a9bc952e978f34cd95488d8c069c69d01c7b62776ad2588c
languageName: node
linkType: hard

"@sideway/address@npm:^4.1.5":
version: 4.1.5
resolution: "@sideway/address@npm:4.1.5"
Expand Down Expand Up @@ -8200,17 +8287,6 @@ __metadata:
languageName: node
linkType: hard

"docusaurus-plugin-sentry@npm:^2.0.0":
version: 2.0.0
resolution: "docusaurus-plugin-sentry@npm:2.0.0"
peerDependencies:
"@docusaurus/core": ">=3"
react: ">=18"
react-dom: ">=18"
checksum: c4149b7b3eb65cff1a2e0d06ed887ee642bee97a311cc638b558fee9f4496e07a9a0f93165e7562dd0d8500acc45c3d069e3500a948b53adc1025ec2d1296ab4
languageName: node
linkType: hard

"dom-converter@npm:^0.2.0":
version: 0.2.0
resolution: "dom-converter@npm:0.2.0"
Expand Down Expand Up @@ -13371,11 +13447,11 @@ __metadata:
"@rjsf/core": ^5.18.4
"@rjsf/utils": ^5.18.4
"@rjsf/validator-ajv8": ^5.18.4
"@sentry/browser": ^8.30.0
"@tsconfig/docusaurus": ^1.0.5
"@typescript-eslint/parser": ^7.12.0
clsx: ^1.2.1
docusaurus-plugin-segment: ^1.0.4
docusaurus-plugin-sentry: ^2.0.0
dotenv: ^16.4.5
eslint-plugin-react: ^7.34.2
js-cookie: ^3.0.5
Expand Down

0 comments on commit 3253dc6

Please sign in to comment.