From fb3c30594515cc1de397f5e4dbca998a1d5e1d21 Mon Sep 17 00:00:00 2001 From: Joan E <153745173+joaniefromtheblock@users.noreply.github.com> Date: Mon, 1 Apr 2024 12:19:27 -0700 Subject: [PATCH 1/5] add examples and change link update examples add example registeronboarding add additional examples fix build error remove problematic example remove example fix error add ethrequest example Add eth_accounts add eth_get Encry Add decrypt example add eth_accounts remove broken example fix error remove broken send_transa update fix indentation remove problematic add send transactions Update indent add decrypt updatef format Update language add last example fix example update addresses add error message --- openrpc.yaml | 95 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 93 insertions(+), 2 deletions(-) diff --git a/openrpc.yaml b/openrpc.yaml index 00d40fb..3b36119 100644 --- a/openrpc.yaml +++ b/openrpc.yaml @@ -94,7 +94,7 @@ methods: chainId: '0x64' chainName: Gnosis rpcUrls: - - 'https://rpc.ankr.com/gnosis' + - 'https://rpc.gnosischain.com' iconUrls: - 'https://xdaichain.com/fake/example/url/xdai.svg' - 'https://xdaichain.com/fake/example/url/xdai.png' @@ -157,6 +157,22 @@ methods: name: PermissionsList schema: $ref: '#/components/schemas/PermissionsList' + examples: + - name: wallet_getPermissions example + params: + - name: GetPermissionsParameter + value: [] + result: + name: wallet_getPermissionsExampleResult + value: + - caveats: + - type: restrictReturnedAccounts + value: + - "0xa77392123a1085f75e62eec7dea7e0e1e5142d5f" + date: 1710965762327 + id: aLL29R1BadOf9D4MA2Yq2 + invoker: "https://docs.metamask.io" + parentCapability: eth_accounts - name: wallet_requestPermissions tags: - $ref: '#/components/tags/MetaMask' @@ -278,6 +294,16 @@ methods: description: A hex-encoded 129-byte array starting with `0x`. schema: $ref: '#/components/schemas/bytes' + examples: + - name: personal_sign example + params: + - name: options + value: + challenge: '0x506c65617365207369676e2074686973206d65737361676520746f20636f6e6669726d20796f7572206964656e746974792e' + address: '0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7' + result: + name: personal_signExampleResult + value: '0x43d7215ebe96c09a5adac69fc76dea5647286b501954ea273e417cf65e6c80e1db4891826375a7de02467a3e01caf125f64c851a8e9ee9467fd6f7e83523b2115bed8e79d527a85e28a36807d79b85fc551b5c15c1ead2e43456c31f565219203db2aed86cb3601b33ec3b410836d4be7718c6148dc9ac82ecc0a04c5edecd8914' - name: eth_signTypedData_v4 tags: - $ref: '#/components/tags/MetaMask' @@ -368,6 +394,14 @@ methods: description: '`true` if the request was successful, `false` otherwise.' schema: type: boolean + examples: + - name: wallet_registerOnboarding example + params: + - name: registerOnboardingParameter + value: [] + result: + name: wallet_registerOnboardingExampleResult + value: true - name: wallet_watchAsset tags: - $ref: '#/components/tags/MetaMask' @@ -718,6 +752,14 @@ methods: $ref: '#/components/schemas/address' errors: - $ref: '#/components/errors/UserRejected' + examples: + - name: eth_requestAccounts example + params: + - name: requestAccountsParameter + value: [] + result: + name: eth_requestAccountsExampleResult + value: '0xa77392123a1085f75e62eec7dea7e0e1e5142d5f' - name: eth_accounts tags: - $ref: '#/components/tags/MetaMask' @@ -734,6 +776,14 @@ methods: type: array items: $ref: '#/components/schemas/address' + examples: + - name: eth_accounts example + params: + - name: accountsParameter + value: [] + result: + name: eth_accountsExampleResult + value: '0xa77392123a1085f75e62eec7dea7e0e1e5142d5f' - name: eth_sendTransaction tags: - $ref: '#/components/tags/MetaMask' @@ -807,6 +857,24 @@ methods: description: The transaction hash of the sent transaction. schema: $ref: '#/components/schemas/bytes32' + errors: + - code: 4100 + message: >- + The requested account and/or method has not been authorized by the user. + examples: + - name: sendTransaction + params: + - name: transactionDetails + value: + to: '0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7' + from: '0xDeaDbeefdEAdbeefdEadbEEFdeadbeefDEADbEEF' + gas: '0x76c0' + value: '0x8ac7230489e80000' + data: '0x' + gasPrice: '0x4a817c800' + result: + name: eth_sendTransactionExampleResult + value: '0x4e306b5a5a37532e1734503f7d2427a86f2c992fbe471f5be403b9f734e667c8' - name: eth_decrypt tags: - $ref: '#/components/tags/MetaMask' @@ -832,6 +900,20 @@ methods: name: PermissionsList schema: $ref: '#/components/schemas/PermissionsList' + errors: + - code: 4100 + message: >- + The requested account and/or method has not been authorized by the user. + examples: + - name: decryptExample + params: + - name: decryptParameter + value: + - '0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7' + - '0xDeaDbeefdEAdbeefdEadbEEFdeadbeefDEADbEEF' + result: + name: eth_decryptExampleResult + value: 'Hello, Ethereum!' - name: eth_getEncryptionPublicKey tags: - $ref: '#/components/tags/MetaMask' @@ -852,6 +934,15 @@ methods: name: EncryptionKey schema: type: string + examples: + - name: eth_getEncryptionPublicKey + params: + - name: getEncryptionPublicKey + value: + - '0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7' + result: + name: eth_getEncryptionPublicKeyExampleResult + value: '0x04bfcab3b7ca7e8b3f3b62b2f7f77e9e4b68080bbf8f0f4a1c8f890864d2c7c1d3c45d8b2e3f5f1c27dfeea4c2f5733e90bfc7484e2a690aa9b8ac4559d2e6a8d7' - name: web3_clientVersion tags: - $ref: '#/components/tags/Ethereum' @@ -1001,7 +1092,7 @@ components: description: >- An array specifying one or more of the following domain separator values: 1) `name` - The user-readable name of signing - domain, i.e., the name of the dapp or the protocol. 2) `version` + domain, for example the name of the dapp or the protocol. 2) `version` - The current major version of the signing domain. 3) `chainId` - The chain ID of the network. 4) `verifyingContract` - The address of the contract that will verify the signature. 5) From 2f5dc3edd84474103c3326c40c494edf06522efb Mon Sep 17 00:00:00 2001 From: Joan E <153745173+joaniefromtheblock@users.noreply.github.com> Date: Wed, 3 Apr 2024 15:10:44 -0700 Subject: [PATCH 2/5] indent --- openrpc.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/openrpc.yaml b/openrpc.yaml index 3b36119..0b5a9c1 100644 --- a/openrpc.yaml +++ b/openrpc.yaml @@ -935,14 +935,14 @@ methods: schema: type: string examples: - - name: eth_getEncryptionPublicKey - params: - - name: getEncryptionPublicKey - value: - - '0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7' - result: - name: eth_getEncryptionPublicKeyExampleResult - value: '0x04bfcab3b7ca7e8b3f3b62b2f7f77e9e4b68080bbf8f0f4a1c8f890864d2c7c1d3c45d8b2e3f5f1c27dfeea4c2f5733e90bfc7484e2a690aa9b8ac4559d2e6a8d7' + - name: eth_getEncryptionPublicKey + params: + - name: getEncryptionPublicKey + value: + - '0x4B0897b0513FdBeEc7C469D9aF4fA6C0752aBea7' + result: + name: eth_getEncryptionPublicKeyExampleResult + value: '0x04bfcab3b7ca7e8b3f3b62b2f7f77e9e4b68080bbf8f0f4a1c8f890864d2c7c1d3c45d8b2e3f5f1c27dfeea4c2f5733e90bfc7484e2a690aa9b8ac4559d2e6a8d7' - name: web3_clientVersion tags: - $ref: '#/components/tags/Ethereum' From 03f6d6b5ef7c58c5827d6faab2c57a5815cf74d6 Mon Sep 17 00:00:00 2001 From: Joan E <153745173+joaniefromtheblock@users.noreply.github.com> Date: Mon, 8 Apr 2024 10:52:26 -0700 Subject: [PATCH 3/5] Update currency --- openrpc.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openrpc.yaml b/openrpc.yaml index 0b5a9c1..25d1009 100644 --- a/openrpc.yaml +++ b/openrpc.yaml @@ -99,8 +99,8 @@ methods: - 'https://xdaichain.com/fake/example/url/xdai.svg' - 'https://xdaichain.com/fake/example/url/xdai.png' nativeCurrency: - name: xDAI - symbol: xDAI + name: XDAI + symbol: XDAI decimals: 18 blockExplorerUrls: - 'https://blockscout.com/poa/xdai/' From 20d16ca7825d729fbc1cf2fcfe6d62989f790115 Mon Sep 17 00:00:00 2001 From: Joan E <153745173+joaniefromtheblock@users.noreply.github.com> Date: Mon, 8 Apr 2024 11:34:38 -0700 Subject: [PATCH 4/5] Update openrpc.yaml Co-authored-by: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com> --- openrpc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrpc.yaml b/openrpc.yaml index 25d1009..918ea9b 100644 --- a/openrpc.yaml +++ b/openrpc.yaml @@ -1092,7 +1092,7 @@ components: description: >- An array specifying one or more of the following domain separator values: 1) `name` - The user-readable name of signing - domain, for example the name of the dapp or the protocol. 2) `version` + domain, that is, the name of the dapp or the protocol. 2) `version` - The current major version of the signing domain. 3) `chainId` - The chain ID of the network. 4) `verifyingContract` - The address of the contract that will verify the signature. 5) From c40fea8d3ea67e5deb228ef139d15ced3e7e3e9a Mon Sep 17 00:00:00 2001 From: Alexandra Tran Carrillo <12214231+alexandratran@users.noreply.github.com> Date: Mon, 8 Apr 2024 11:37:27 -0700 Subject: [PATCH 5/5] Update openrpc.yaml --- openrpc.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openrpc.yaml b/openrpc.yaml index 918ea9b..a20224f 100644 --- a/openrpc.yaml +++ b/openrpc.yaml @@ -1091,7 +1091,7 @@ components: type: array description: >- An array specifying one or more of the following domain - separator values: 1) `name` - The user-readable name of signing + separator values: 1) `name` - The user-readable name of the signing domain, that is, the name of the dapp or the protocol. 2) `version` - The current major version of the signing domain. 3) `chainId` - The chain ID of the network. 4) `verifyingContract` - The