From 9edbcca92abb5f0bcdbfe793fb5a684be54fa482 Mon Sep 17 00:00:00 2001 From: productshiv Date: Sat, 6 Apr 2024 18:04:31 +0530 Subject: [PATCH] Adding Optimism --- .../rpc-klaytn/klay_gettransactionbyhash.md | 109 -------------- .../rpc-klaytn/klay_gettransactionreceipt.md | 105 ------------- .../rpc-klaytn/klay_maxpriorityfeepergas.md | 16 -- .../{rpc-klaytn.md => rpc-optimism.md} | 4 +- .../debug_getbadblocks.md | 14 +- .../debug_storagerangeat.md | 20 +-- .../debug_traceblock.md | 14 +- .../debug_traceblockbyhash.md | 25 +++- .../debug_traceblockbynumber.md | 16 +- .../rpc-evm/rpc-optimism/debug_tracecall.md | 139 ++++++++++++++++++ .../debug_tracetransaction.md | 16 +- .../eth_blocknumber.md} | 35 +++-- .../{rpc-klaytn => rpc-optimism}/eth_call.md | 12 +- .../eth_chainid.md} | 29 ++-- .../eth_estimategas.md} | 38 ++--- .../eth_gasprice.md} | 24 +-- .../eth_getbalance.md} | 44 +++--- .../eth_getblockbyhash.md} | 28 ++-- .../eth_getblockbynumber.md} | 23 +-- .../eth_getblocktransactioncountbyhash.md} | 26 ++-- .../eth_getblocktransactioncountbynumber.md} | 30 ++-- .../eth_getcode.md} | 39 +++-- .../eth_getlogs.md} | 38 ++--- .../eth_getproof.md} | 31 ++-- .../eth_getstorageat.md} | 34 +++-- .../eth_gettransactionbyblockhashandindex.md} | 28 ++-- ...th_gettransactionbyblocknumberandindex.md} | 32 ++-- .../rpc-optimism/eth_gettransactionbyhash.md | 106 +++++++++++++ .../eth_gettransactioncount.md} | 36 ++--- .../rpc-optimism/eth_gettransactionreceipt.md | 119 +++++++++++++++ .../eth_getunclecountbyblockhash.md} | 26 ++-- .../eth_getunclecountbyblocknumber.md} | 26 ++-- .../rpc-optimism/eth_maxpriorityfeepergas.md | 76 ++++++++++ .../eth_sendrawtransaction.md} | 18 +-- .../txpool_content.md | 12 +- .../txpool_inspect.md | 12 +- .../txpool_status.md | 12 +- .../web3_clientversion.md | 22 +-- 38 files changed, 823 insertions(+), 611 deletions(-) delete mode 100644 v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactionbyhash.md delete mode 100644 v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactionreceipt.md delete mode 100644 v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_maxpriorityfeepergas.md rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn.md => rpc-optimism.md} (85%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn => rpc-optimism}/debug_getbadblocks.md (93%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn => rpc-optimism}/debug_storagerangeat.md (86%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn => rpc-optimism}/debug_traceblock.md (92%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn => rpc-optimism}/debug_traceblockbyhash.md (83%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn => rpc-optimism}/debug_traceblockbynumber.md (84%) create mode 100644 v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_tracecall.md rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn => rpc-optimism}/debug_tracetransaction.md (87%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_blocknumber.md => rpc-optimism/eth_blocknumber.md} (56%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn => rpc-optimism}/eth_call.md (93%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_chainid.md => rpc-optimism/eth_chainid.md} (68%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_estimategas.md => rpc-optimism/eth_estimategas.md} (65%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_gasprice.md => rpc-optimism/eth_gasprice.md} (50%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_getbalance.md => rpc-optimism/eth_getbalance.md} (64%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_getblockbyhash.md => rpc-optimism/eth_getblockbyhash.md} (86%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_getblockbynumber.md => rpc-optimism/eth_getblockbynumber.md} (92%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_getblocktransactioncountbyhash.md => rpc-optimism/eth_getblocktransactioncountbyhash.md} (62%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_getblocktransactioncountbynumber.md => rpc-optimism/eth_getblocktransactioncountbynumber.md} (60%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_getcode.md => rpc-optimism/eth_getcode.md} (61%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_getlogs.md => rpc-optimism/eth_getlogs.md} (70%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_getproof.md => rpc-optimism/eth_getproof.md} (73%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_getstorageat.md => rpc-optimism/eth_getstorageat.md} (62%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_gettransactionbyblockhashandindex.md => rpc-optimism/eth_gettransactionbyblockhashandindex.md} (85%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_gettransactionbyblocknumberandindex.md => rpc-optimism/eth_gettransactionbyblocknumberandindex.md} (86%) create mode 100644 v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactionbyhash.md rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_gettransactioncount.md => rpc-optimism/eth_gettransactioncount.md} (63%) create mode 100644 v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactionreceipt.md rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_getunclecountbyblockhash.md => rpc-optimism/eth_getunclecountbyblockhash.md} (68%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_getunclecountbyblocknumber.md => rpc-optimism/eth_getunclecountbyblocknumber.md} (67%) create mode 100644 v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_maxpriorityfeepergas.md rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn/klay_sendrawtransaction.md => rpc-optimism/eth_sendrawtransaction.md} (67%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn => rpc-optimism}/txpool_content.md (95%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn => rpc-optimism}/txpool_inspect.md (91%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn => rpc-optimism}/txpool_status.md (89%) rename v1.0/RPC Nodes/rpc-evm/{rpc-klaytn => rpc-optimism}/web3_clientversion.md (77%) diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactionbyhash.md b/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactionbyhash.md deleted file mode 100644 index d710e463..00000000 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactionbyhash.md +++ /dev/null @@ -1,109 +0,0 @@ ---- -title: "klay_gettransactionbyhash" -slug: "rpc-klaytn-klay_gettransactionbyhash" -excerpt: "Klaytn RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Klaytn RPC" - image: [] - keywords: "klaytn, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.KLAYTN}) - -const tx = await tatum.rpc.getTransactionByHash('0xa3fd3d2b01ee234899b487fb1480b7e14142dde55f07b7a079b9fdcf04733220') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -`klay_getTransactionByHash` is an JSON-RPC method that allows you to query transaction details based on its hash. This method is useful when you want to retrieve information about a specific transaction, such as its sender, receiver, value, and more. Common use cases include tracking transaction status, monitoring incoming transactions, or analyzing historical transaction data. - -### Parameters - -The `klay_getTransactionByHash` method takes one parameter: - -* **`transactionHash`**: The hash of the transaction you want to retrieve. This should be a 32-byte hash string with a `0x` prefix. - * Example: `"0x97d83656ca05890100149be18d0c2a2f94e5337e5e6a643ea78794cd418cdbc7"` - -### Return Object - -The method returns a transaction object with the following fields: - -* **`hash`**: The hash of the transaction (32 bytes). -* **`nonce`**: The number of transactions sent by the sender prior to this one (integer). -* **`blockHash`**: The hash of the block in which the transaction was included (32 bytes), or `null` if the transaction is not yet mined. -* **`blockNumber`**: The block number in which the transaction was included (integer), or `null` if the transaction is not yet mined. -* **`transactionIndex`**: The index of the transaction in the block (integer), or `null` if the transaction is not yet mined. -* **`from`**: The address of the sender (20 bytes). -* **`to`**: The address of the receiver (20 bytes), or `null` for contract creation transactions. -* **`value`**: The value transferred in the transaction, in wei. -* **`gasPrice`**: The price of gas for the transaction, in wei. -* **`maxFeePerGas`** - The maximum fee per gas set in the transaction. -* **`maxPriorityFeePerGas`** - The maximum priority gas fee set in the transaction. -* **`gas`**: The maximum amount of gas the transaction is allowed to consume. -* **`input`**: The data payload of the transaction (string), or `0x` for simple value transfers. - -### JSON-RPC Examples - -Request: - -```json -{ - "jsonrpc": "2.0", - "method": "klay_getTransactionByHash", - "params": ["0x97d83656ca05890100149be18d0c2a2f94e5337e5e6a643ea78794cd418cdbc7"], - "id": 1 -} -``` - -Response: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "blockHash": "0xb0ddfcdcc375afce9f365458c5035ca4aaf99f9fe8699522193e16a8718615b6", - "blockNumber": "0x5a9d4", - "transactionIndex": "0x0", - "hash": "0x97d83656ca05890100149be18d0c2a2f94e5337e5e6a643ea78794cd418cdbc7", - "type": "0x2", - "nonce": "0x1d8", - "from": "0x8bd5723981d3f96a6544519c4a075f5994919d3a", - "to": "0xa55d9ef16af921b70fed1421c1d298ca5a3a18f1", - "value": "0x0", - "input": "0x3798c7f2000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000003400000000000000000000000000000000000000000000000000000000065082bd900000000000000000000000000000000000000000000000000000000013ebef0000000000000000000000000000000000000000000000000000000000000000700000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000120000000000000000000000000000000000000000000000000000000000000016000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000001e0000000000000000000000000000000000000000000000000000000000000022000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000003415242000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000034254430000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000344414900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003455448000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000024f50000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000455534443000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004555344540000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000070000000000000000000000000000000000000000000000000000000031339e8d000000000000000000000000000000000000000000000000000018a759056108000000000000000000000000000000000000000000000000000000003b9aca000000000000000000000000000000000000000000000000000000017fc9b3dfb80000000000000000000000000000000000000000000000000000000054572fc0000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000000000000000000000000000000000003b9b181f", - "gas": "0x12a68", - "gasPrice": "0x5017ff700", - "maxPriorityFeePerGas": "0x59682f00", - "maxFeePerGas": "0xba43b7400", - "chainId": "0x1ca4", - "v": "0x1c", - "r": "0x75884978fae04ee04de9a2d4fefaaaa4742f4e8f4ccdaf89b01238bafb5292fd", - "s": "0x1f0e92ae5b7f2c8805ebb07900a59a04e73cda12a309021849a5d9ed151d7fd1", - "accessList": [] - } -} -``` - -\ diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactionreceipt.md b/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactionreceipt.md deleted file mode 100644 index 539c0c8e..00000000 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactionreceipt.md +++ /dev/null @@ -1,105 +0,0 @@ ---- -title: "klay_gettransactionreceipt" -slug: "rpc-klaytn-klay_gettransactionreceipt" -excerpt: "Klaytn RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Klaytn RPC" - image: [] - keywords: "klaytn, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - -### How to use it - -{% tabs %} -{% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.KLAYTN}) - -const tx = await tatum.rpc.getTransactionReceipt('0xa3fd3d2b01ee234899b487fb1480b7e14142dde55f07b7a079b9fdcf04733220') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` -{% endcode %} -{% endtab %} -{% endtabs %} - -### Overview - -`klay_getTransactionReceipt` is an JSON-RPC method that retrieves the transaction receipt of a given transaction hash. This method is particularly useful when you need to obtain detailed information about a transaction's execution, such as its status (success or failure), gas usage, and logs (events). Common use cases include checking the status of a transaction after it has been mined or inspecting the events emitted by a smart contract during a specific transaction. - -### Parameters - -This method requires a single parameter: - -* **`transactionHash`**: The hash of the transaction for which you want to obtain the receipt. - * Example: `"0x97d83656ca05890100149be18d0c2a2f94e5337e5e6a643ea78794cd418cdbc7"` - -### Return Object - -The method returns an object containing the following fields: - -* **`transactionHash`**: The hash of the transaction. -* **`transactionIndex`**: The transaction's index position in the block. -* **`blockHash`**: The hash of the block where this transaction was mined. -* **`blockNumber`**: The block number where this transaction was mined. -* **`from`**: The address of the sender. -* **`to`**: The address of the receiver. `null` when it's a contract creation transaction. -* **`cumulativeGasUsed`**: The total amount of gas used when this transaction was executed in the block. -* **`gasUsed`**: The amount of gas used by this specific transaction alone. -* **`contractAddress`**: The address of the contract created, if the transaction was a contract creation. Otherwise, `null`. -* **`logs`**: An array of log objects, which were emitted during the transaction. -* **`logsBloom`**: A 256-byte bloom filter, which is a compressed representation of the logs emitted during the transaction. -* **`status`**: The status of the transaction's execution. `"0x1"` indicates success, while `"0x0"` indicates failure. - -### JSON-RPC Examples - -Request: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "method": "klay_getTransactionReceipt", - "params": [ - "0x97d83656ca05890100149be18d0c2a2f94e5337e5e6a643ea78794cd418cdbc7" - ] -} -``` - -Response: - -```json -{ - "jsonrpc": "2.0", - "id": 1, - "result": { - "blockHash": "0xb0ddfcdcc375afce9f365458c5035ca4aaf99f9fe8699522193e16a8718615b6", - "blockNumber": "0x5a9d4", - "transactionIndex": "0x0", - "transactionHash": "0x97d83656ca05890100149be18d0c2a2f94e5337e5e6a643ea78794cd418cdbc7", - "type": "0x2", - "from": "0x8bd5723981d3f96a6544519c4a075f5994919d3a", - "to": "0xa55d9ef16af921b70fed1421c1d298ca5a3a18f1", - "effectiveGasPrice": "0x5017ff700", - "contractAddress": null, - "logs": [], - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "gasUsed": "0x12a68", - "cumulativeGasUsed": "0x12a68", - "status": "0x1" - } -} -``` - -\ diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_maxpriorityfeepergas.md b/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_maxpriorityfeepergas.md deleted file mode 100644 index d2b98808..00000000 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_maxpriorityfeepergas.md +++ /dev/null @@ -1,16 +0,0 @@ ---- -title: "klay_maxpriorityfeepergas" -slug: "rpc-klaytn-klay_maxpriorityfeepergas" -excerpt: "Klaytn RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "Klaytn RPC" - image: [] - keywords: "klaytn, rpc" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ---- -[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] - diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism.md similarity index 85% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism.md index 115cc284..0ba395b1 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism.md @@ -1,6 +1,6 @@ --- -title: "Klaytn" -slug: "rpc-klaytn" +title: "Optimism" +slug: "rpc-optimism" excerpt: "" category: 65c5e93c623cad004b45d505 hidden: false diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_getbadblocks.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_getbadblocks.md similarity index 93% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_getbadblocks.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_getbadblocks.md index 56f8cf7f..db2b5941 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_getbadblocks.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_getbadblocks.md @@ -1,13 +1,13 @@ --- title: "debug_getbadblocks" -slug: "rpc-klaytn-debug_getbadblocks" -excerpt: "Klaytn RPC" +slug: "rpc-optimism-debug_getbadblocks" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,9 +22,9 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) const result = await tatum.rpc.debugGetBadBlocks() @@ -36,7 +36,7 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -`debug_getBadBlocks` is an RPC method that provides a list of the most recent bad blocks encountered by the client on the network. This feature is valuable for developers and node operators, as it enables them to identify and address any issues or anomalies related to block validation and synchronization. +`debug_getBadBlocks` is na RPC method that provides a list of the most recent bad blocks encountered by the client on the network. This feature is valuable for developers and node operators, as it enables them to identify and address any issues or anomalies related to block validation and synchronization. By accessing `debug_getBadBlocks`, they can diagnose potential problems and take appropriate actions to ensure the network's stability and integrity. diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_storagerangeat.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_storagerangeat.md similarity index 86% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_storagerangeat.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_storagerangeat.md index bcefa785..59c2442e 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_storagerangeat.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_storagerangeat.md @@ -1,13 +1,13 @@ --- title: "debug_storagerangeat" -slug: "rpc-klaytn-debug_storagerangeat" -excerpt: "Klaytn RPC" +slug: "rpc-optimism-debug_storagerangeat" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,13 +22,13 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' -const res = await tatum.rpc.debugStorageRangeAt( - '0xcb632c914a18d838113f1e0cbf3ebc58e837c9497113c247001ecd52b212768e', - 1, '0x898f2afc07924f5a4f9612449e4c4f8eca527515', '0x0000000000000000000000000000000000000000000000000000000000000000', 1 +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) + +const result = await tatum.rpc.debugStorageRangeAt( +'0x00ccb8a97e104e09ebec66f9c58aca7d42df4fbb7cfcf1a9ff4cb7fc08814cd6', +1, '0x365a2dabcdb56f4f595c3af088b8975c26331448', '0x0000000000000000000000000000000000000000000000000000000000000000', 1 ) await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_traceblock.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_traceblock.md similarity index 92% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_traceblock.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_traceblock.md index b11708fb..1b9554fc 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_traceblock.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_traceblock.md @@ -1,13 +1,13 @@ --- title: "debug_traceblock" -slug: "rpc-klaytn-debug_traceblock" -excerpt: "Klaytn RPC" +slug: "rpc-optimism-debug_traceblock" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,11 +22,11 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -const result = await tatum.rpc.debugTraceBlock('0x80F8C7A' ,{ +const result = await tatum.rpc.debugTraceBlock('0xAD7C5E' ,{ tracer: 'callTracer', tracerConfig: { onlyTopCall: true, diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_traceblockbyhash.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_traceblockbyhash.md similarity index 83% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_traceblockbyhash.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_traceblockbyhash.md index 0d6fbeec..dd4400d5 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_traceblockbyhash.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_traceblockbyhash.md @@ -1,13 +1,13 @@ --- title: "debug_traceblockbyhash" -slug: "rpc-klaytn-debug_traceblockbyhash" -excerpt: "Klaytn RPC" +slug: "rpc-optimism-debug_traceblockbyhash" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,11 +22,20 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -const result = await tatum.rpc.debugTraceBlockByHashtatum.rpc.debugTraceBlockByHash('0xcb632c914a18d838113f1e0cbf3ebc58e837c9497113c247001ecd52b212768e') +const result = await tatum.rpc.debugTraceBlockByHash( +'0x00ccb8a97e104e09ebec66f9c58aca7d42df4fbb7cfcf1a9ff4cb7fc08814cd6', +{ + tracer: 'callTracer', + tracerConfig: { + onlyTopCall: true, + timeout: '5s', + } +} +) await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ``` @@ -36,7 +45,7 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -`debug_traceBlockByHash` is an RPC method that allows developers to trace all transactions within a block using a given tracer. This is particularly useful for analyzing the behavior of all transactions in a block, investigating potential issues, and understanding the flow of execution within smart contracts. +`debug_traceBlockByHash` is a method that allows developers to trace all transactions within a block using a given tracer. This is particularly useful for analyzing the behavior of all transactions in a block, investigating potential issues, and understanding the flow of execution within smart contracts. By using the `callTracer` tracer, developers can obtain more detailed information about the calls made during each transaction, including the input, output, and depth of the calls. diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_traceblockbynumber.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_traceblockbynumber.md similarity index 84% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_traceblockbynumber.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_traceblockbynumber.md index 4f1c10be..2519b8b9 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_traceblockbynumber.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_traceblockbynumber.md @@ -1,13 +1,13 @@ --- title: "debug_traceblockbynumber" -slug: "rpc-klaytn-debug_traceblockbynumber" -excerpt: "Klaytn RPC" +slug: "rpc-optimism-debug_traceblockbynumber" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,11 +22,11 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -const result = await tatum.rpc.debugTraceBlockByNumber('0x80F8C7A') +const result = await tatum.rpc.debugTraceBlockByNumber(109501394) await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ``` @@ -36,7 +36,7 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -`debug_traceBlockByNumber` is an RPC method that allows developers to trace all transactions within a block using a given tracer. This is particularly useful for analyzing the behavior of all transactions in a block, investigating potential issues, and understanding the flow of execution within smart contracts. +`debug_traceBlockByNumber` is a method that allows developers to trace all transactions within a block using a given tracer. This is particularly useful for analyzing the behavior of all transactions in a block, investigating potential issues, and understanding the flow of execution within smart contracts. By using the `callTracer` tracer, developers can obtain more detailed information about the calls made during each transaction, including the input, output, and depth of the calls. diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_tracecall.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_tracecall.md new file mode 100644 index 00000000..ebe17e6b --- /dev/null +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_tracecall.md @@ -0,0 +1,139 @@ +--- +title: "debug_tracecall" +slug: "rpc-optimism-debug_tracecall" +excerpt: "Optimism RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "Optimism RPC" + image: [] + keywords: "optimism, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +{% tabs %} +{% tab title="TypeScript/JavaScript" %} +{% code overflow="wrap" lineNumbers="true" %} +```typescript +// yarn add @tatumio/tatum + +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) + +const result = await tatum.rpc.debugTraceCall({ + "from": "0x365a2dabcdb56f4f595c3af088b8975c26331448", + "to": "0x365a2dabcdb56f4f595c3af088b8975c26331449", + "gas": "0x76c0", + "gasPrice": "0x9184e72a000", + "value": "0x9184e72a", + "data": "0x606060..." + }, + "0x1b4", + { + tracer: 'callTracer', + tracerConfig: { + onlyTopCall: true, + timeout: '5s', + } +} +) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +`debug_traceCall` is a method that allows you to execute a given call (message), tracing the steps of its execution. This can be helpful for developers and auditors who want to inspect and analyze the internal operations and state changes of a contract call without modifying the blockchain state. This method can assist in debugging and identifying potential issues with contract execution, as well as understanding how gas is consumed during the execution of a call. + +### Parameters + +The `debug_traceCall` method accepts the following parameters: + +* `transaction`: An object that contains the following fields: + * `from`: The address from which the call is initiated. Example: `"0xa7d9ddbe1f17865597fbd27ec712455208b6b76d"` + * `to`: The address of the contract to be called. Example: `"0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` + * `gas`: (Optional) The gas limit for the call. Example: `"0x76c0"` + * `gasPrice`: (Optional) The gas price for the call. Example: `"0x9184e72a000"` + * `value`: (Optional) The value to be transferred during the call. Example: `"0x9184e72a"` + * `data`: (Optional) The input data for the call, encoded as a hexadecimal string. Example: `"0x606060..."` +* `blockNumber`: The block number as a hexadecimal string for which the call should be traced. Example: `"0x1b4"` + +### Return Object + +The return object is an object containing the following fields: + +* `output`: The output data from the call. +* `gasUsed`: The total gas used by the call. +* `calls`: An array of objects, each representing a nested call made during the call. Each object contains: + * `from`: The address the call was made from. + * `gas`: The gas provided for the call. + * `gasUsed`: The gas used by the call. + * `to`: The address the call was made to. + * `input`: The input data for the call. + * `output`: The output data from the call. + * `type`: The type of the call (e.g., "STATICCALL"). + +{% hint style="info" %} +This method is available only on the full archive node. +{% endhint %} + +### JSON-RPC Request and Response Examples + +#### Request + +
{
+  "jsonrpc": "2.0",
+  "id": 1,
+  "method": "debug_traceCall",
+  "params": [
+    {
+      "from": "0xa7d9ddbe1f17865597fbd27ec712455208b6b76d",
+      "to": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e",
+      "gas": "0x76c0",
+      "gasPrice": "0x9184e72a000",
+      "value": "0x9184e72a",
+      "data": "0x606060..."
+    },
+    "0x1b4"
+  ]
+}
+
+ +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 2, + "result": { + "from": "0x0a6d033f6628ef715732d61e059187b7330305ff", + "gas": "0x51fba", + "gasUsed": "0x41711", + "to": "0x19e870855cb8fd8f6689743d3c28311c0d62a24c", + "input": "0xcba9bc66000000000000000000000000f62ef040fb5ea7d0828ff50bced9a7720f1387c7000000000000000000000000325e343f1de602396e256b67efd1f61c3a6b38bd00000000000000000000000000000000000000000000000000000000000000e00000000000000000000000000000000000000000000000000000000000000160000000000000000000000000000000000000000000000001158e460913d000000000000000000000000000000000000000000000000000000100a08761e1547f0000000000000000000000000a6d033f6628ef715732d61e059187b7330305ff000000000000000000000000000000000000000000000000000000000000000300000000000000000000000055d398326f99059ff775485246999027b319795500000000000000000000000053e562b9b7e5e94b81f10e96ee70ad06df3d265700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "output": "0x0000000000000000000000000000000000000000000000000102b1eda6a2682d", + "calls": [ + { + "from": "0x19e870855cb8fd8f6689743d3c28311c0d62a24c", + "gas": "0x4f638", + "gasUsed": "0x4cf", + "to": "0x55d398326f99059ff775485246999027b3197955", + "input": "0x70a082310000000000000000000000000a6d033f6628ef715732d61e059187b7330305ff", + "output": "0x00000000000000000000000000000000000000000000002ca114a674b092dd94", + "type": "STATICCALL" + } + ], + "value": "0x0", + "type": "CALL" + } +} +``` diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_tracetransaction.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_tracetransaction.md similarity index 87% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_tracetransaction.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_tracetransaction.md index b652c2d2..fd3871c7 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/debug_tracetransaction.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/debug_tracetransaction.md @@ -1,13 +1,13 @@ --- title: "debug_tracetransaction" -slug: "rpc-klaytn-debug_tracetransaction" -excerpt: "Klaytn RPC" +slug: "rpc-optimism-debug_tracetransaction" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,11 +22,11 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -const res = await tatum.rpc.debugTraceTransaction('0xa3fd3d2b01ee234899b487fb1480b7e14142dde55f07b7a079b9fdcf04733220', { +const result = await tatum.rpc.debugTraceTransaction('0x501bc07b1e3346dabe68c6c0bee7fa52ea59c829396cd621cde0b61829321e58', { tracer: 'callTracer', tracerConfig: { onlyTopCall: true, @@ -42,7 +42,7 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -`debug_traceTransaction` is an RPC method that allows developers to inspect and trace the execution of a specific transaction, providing valuable insight into the internal workings of the transaction, including the calls made between contracts, the state of the contracts, and any errors encountered during the transaction. +`debug_traceTransaction` is a method that allows developers to inspect and trace the execution of a specific transaction, providing valuable insight into the internal workings of the transaction, including the calls made between contracts, the state of the contracts, and any errors encountered during the transaction. By using the `callTracer` tracer, developers can obtain more detailed information about the calls made during the transaction, including the input, output, and the depth of the calls. This is particularly useful in debugging complex transactions, analyzing gas consumption, and understanding the flow of execution within smart contracts. diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_blocknumber.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_blocknumber.md similarity index 56% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_blocknumber.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_blocknumber.md index ed268a7a..5de6fe44 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_blocknumber.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_blocknumber.md @@ -1,13 +1,13 @@ --- -title: "klay_blocknumber" -slug: "rpc-klaytn-klay_blocknumber" -excerpt: "Klaytn RPC" +title: "eth_blocknumber" +slug: "rpc-optimism-eth_blocknumber" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,9 +22,9 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) const latestBlock = await tatum.rpc.blockNumber() @@ -36,22 +36,21 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -The `klay_blockNumber` method returns the number of the most recent block on the blockchain. This method is commonly used to track the current state of the network, monitor for new blocks, or fetch historical data. +The `eth_blockNumber` method returns the number of the most recent block on the blockchain. This method is commonly used to track the current state of the network, monitor for new blocks, or fetch historical data. -Use cases for `klay_blockNumber` include: +Use cases for `eth_blockNumber` include: * Synchronising a local copy of the blockchain with the network * Checking the status of a transaction by comparing its block number to the current block number -* Determining the current network state for smart contract interactions\ - +* Determining the current network state for smart contract interactions ### Parameters -The `klay_blockNumber` method does not require any parameters. +The `eth_blockNumber` method does not require any parameters. ### Return Object -The `klay_blockNumber` method returns a single field: +The `eth_blockNumber` method returns a single field: * **`blockNumber`**: The number of the most recent block on the blockchain. The value is returned as a hexadecimal string. @@ -61,7 +60,7 @@ The `klay_blockNumber` method returns a single field: { "id": 1, "jsonrpc": "2.0", - "method": "klay_blockNumber", + "method": "eth_blockNumber", "params": [] } ``` @@ -74,4 +73,10 @@ The `klay_blockNumber` method returns a single field: "jsonrpc": "2.0", "result": "0x4b7" // 1207 } -``` \ No newline at end of file +``` + +In this example, the most recent block number is 1207 (`0x4b7` in hexadecimal notation). + +Please note that while this document provides a comprehensive description of the `eth_blockNumber` RPC method, other methods may be needed to obtain full transaction details or perform more complex tasks. Refer to the [JSON-RPC documentation](https://community.optimism.io/docs/developers/build/json-rpc/) for more information. + +\ diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/eth_call.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_call.md similarity index 93% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/eth_call.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_call.md index dd386f08..07479cfc 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/eth_call.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_call.md @@ -1,13 +1,13 @@ --- title: "eth_call" -slug: "rpc-klaytn-eth_call" -excerpt: "Klaytn RPC" +slug: "rpc-optimism-eth_call" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,9 +22,9 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) const result = await tatum.rpc.call({ "to": "0xD31a59c85aE9D8edEFeC411D448f90841571b89c", // Replace with the ERC-20 token contract address diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_chainid.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_chainid.md similarity index 68% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_chainid.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_chainid.md index 9696ec46..c9b35782 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_chainid.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_chainid.md @@ -1,13 +1,13 @@ --- -title: "klay_chainid" -slug: "rpc-klaytn-klay_chainid" -excerpt: "Klaytn RPC" +title: "eth_chainid" +slug: "rpc-optimism-eth_chainid" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,9 +22,9 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) const id = await tatum.rpc.chainId() @@ -36,13 +36,13 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -The `klay_chainId` method is an JSON-RPC method that allows developers to retrieve the currently configured chain ID of the network they are connected to. The chain ID is a unique identifier for different networks, such as mainnet or various testnets. +The `eth_chainId` method is method that allows developers to retrieve the currently configured chain ID of the network they are connected to. The chain ID is a unique identifier for different networks, such as Mainnet or various testnets. This method is particularly useful when building applications that interact with multiple networks or need to verify the network to prevent replay attacks. By checking the chain ID, an application can ensure it is interacting with the intended network. ### Parameters -The `klay_chainId` method does not have any input parameters. +The `eth_chainId` method does not have any input parameters. ### Return Object @@ -58,7 +58,7 @@ JSON-RPC request: { "jsonrpc": "2.0", "id": 1, - "method": "klay_chainId", + "method": "eth_chainId", "params": [] } ``` @@ -67,9 +67,8 @@ JSON-RPC response: ```json { - "jsonrpc": "2.0", - "id": 1, - "result": "0xe" + "jsonrpc": "2.0", + "id": 1, + "result": "0xa" } ``` - diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_estimategas.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_estimategas.md similarity index 65% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_estimategas.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_estimategas.md index b3a092b0..55ad263f 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_estimategas.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_estimategas.md @@ -1,13 +1,13 @@ --- -title: "klay_estimategas" -slug: "rpc-klaytn-klay_estimategas" -excerpt: "Klaytn RPC" +title: "eth_estimategas" +slug: "rpc-optimism-eth_estimategas" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,18 +22,18 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) const estimate = await tatum.rpc.estimateGas({ - "from": "0x3E18a8c3348447E3e69c847FbAA07117E2f46a1b", - "to": "0x3E18a8c3348447E3e69c847FbAA07117E2f46a1b", - "value": "0xde0b6b3a7640000", - "data": "0x606060" + "from": "0x365a2dabcdb56f4f595c3af088b8975c26331448", + "to": "0x365a2dabcdb56f4f595c3af088b8975c26331449", + "value": "0xde0b6b3a7640000", + "data": "0x606060" }) - await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ``` {% endcode %} {% endtab %} @@ -41,17 +41,17 @@ const estimate = await tatum.rpc.estimateGas({ ### Overview -`klay_estimateGas` is an JSON-RPC method that estimates the amount of gas required to execute a given transaction. This method can be used to determine the gas cost before sending a transaction, allowing developers to better predict the gas fees and avoid issues like out-of-gas errors. +`eth_estimateGas` is method that estimates the amount of gas required to execute a given transaction. This method can be used to determine the gas cost before sending a transaction, allowing developers to better predict the gas fees and avoid issues like out-of-gas errors. -Use cases for `klay_estimateGas` include: +Use cases for `eth_estimateGas` include: * Estimating gas costs for contract deployments * Estimating gas costs for contract function calls -* Estimating gas costs for standard transfers +* Estimating gas costs for standard ether transfers ### Parameters -The `klay_estimateGas` method takes a single parameter, an object representing the transaction details. The fields in the transaction object include: +The `eth_estimateGas` method takes a single parameter, an object representing the transaction details. The fields in the transaction object include: * **`from`** (optional, string): The address that the transaction is sent from. * Example: `"from": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` @@ -61,7 +61,7 @@ The `klay_estimateGas` method takes a single parameter, an object representing t * Example: `"gas": "0x76c0"` * **`gasPrice`** (optional, string): The price of gas in wei. * Example: `"gasPrice": "0x9184e72a000"` -* **`value`** (optional, string): The amount of ZEN to send in the transaction, in wei. +* **`value`** (optional, string): The amount of ether to send in the transaction, in wei. * Example: `"value": "0xde0b6b3a7640000"` * **`data`** (optional, string): The data payload of the transaction, typically used for contract function calls or contract deployment. * Example: `"data": "0x606060..."` @@ -70,7 +70,7 @@ The `klay_estimateGas` method takes a single parameter, an object representing t ### Return Object -The return value of the `klay_estimateGas` method is a single field: +The return value of the `eth_estimateGas` method is a single field: * `gasEstimate` (string): The estimated gas cost for the transaction, represented as a hexadecimal string. * Example: `"0x5208"` @@ -83,7 +83,7 @@ The return value of the `klay_estimateGas` method is a single field: { "jsonrpc": "2.0", "id": 1, - "method": "klay_estimateGas", + "method": "eth_estimateGas", "params": [ { "from": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gasprice.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gasprice.md similarity index 50% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gasprice.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gasprice.md index 5957f0d3..686beba8 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gasprice.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gasprice.md @@ -1,13 +1,13 @@ --- -title: "klay_gasprice" -slug: "rpc-klaytn-klay_gasprice" -excerpt: "Klaytn RPC" +title: "eth_gasprice" +slug: "rpc-optimism-eth_gasprice" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,9 +22,9 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) const gasPrice = await tatum.rpc.gasPrice() @@ -36,15 +36,15 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -The `klay_gasPrice` method is an JSON-RPC method used to estimate the average gas price required for transactions in the network. This method provides a suggestion for the gas price to be used in a transaction to increase the likelihood of it being mined and included in a block in a reasonable amount of time. The `klay_gasPrice` method is particularly useful for developers and users who want to create and send transactions, as it helps them estimate the appropriate gas price to ensure timely processing. +The `eth_gasPrice` method is method used to estimate the average gas price required for transactions in the network. This method provides a suggestion for the gas price to be used in a transaction to increase the likelihood of it being mined and included in a block in a reasonable amount of time. The `eth_gasPrice` method is particularly useful for developers and users who want to create and send transactions, as it helps them estimate the appropriate gas price to ensure timely processing. ### Parameters -The `klay_gasPrice` method does not require any parameters. +The `eth_gasPrice` method does not require any parameters. ### Return Value -The `klay_gasPrice` method returns a single value as a hexadecimal string: +The `eth_gasPrice` method returns a single value as a hexadecimal string: * `gasPrice`: The estimated average gas price in wei. Example: `"0x4a817c800"` @@ -56,7 +56,7 @@ The `klay_gasPrice` method returns a single value as a hexadecimal string: { "id": 1, "jsonrpc": "2.0", - "method": "klay_gasPrice", + "method": "eth_gasPrice", "params": [] } ``` @@ -71,4 +71,4 @@ The `klay_gasPrice` method returns a single value as a hexadecimal string: } ``` -By using the `klay_gasPrice` method, developers and users can estimate the appropriate gas price for their transactions, improving the overall user experience and ensuring that their transactions are processed in a timely manner. +By using the `eth_gasPrice` method, developers and users can estimate the appropriate gas price for their transactions, improving the overall user experience and ensuring that their transactions are processed in a timely manner. diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getbalance.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getbalance.md similarity index 64% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getbalance.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getbalance.md index b7c63124..37978511 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getbalance.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getbalance.md @@ -1,13 +1,13 @@ --- -title: "klay_getbalance" -slug: "rpc-klaytn-klay_getbalance" -excerpt: "Klaytn RPC" +title: "eth_getbalance" +slug: "rpc-optimism-eth_getbalance" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -21,12 +21,12 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" {% code overflow="wrap" lineNumbers="true" %} ```typescript // yarn add @tatumio/tatum + +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.KLAYTN}) - -const balance = await tatum.rpc.getBalance('0x11f56be8b506f546f65662279a8641a0f490df40') +const balance = await tatum.rpc.getBalance('0x365a2dabcdb56f4f595c3af088b8975c26331448') await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ``` @@ -36,20 +36,20 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -The `klay_getBalance` method is an JSON-RPC method that allows you to retrieve the balance of a specified address. This method can be used to query the balance of any address, whether it is a contract or an externally owned account (EOA). A common use case for this method is to display the current balance of a user's account in a wallet application or a decentralized application (DApp). +The `eth_getBalance` method is method that allows you to retrieve the Ether balance of a specified address. This method can be used to query the balance of any address, whether it is a contract or an externally owned account (EOA). A common use case for this method is to display the current balance of a user's account in a wallet application or a decentralized application (DApp). ### Parameters The method requires two parameters: 1. **`address`** (required): The address of the account or contract whose balance you want to query. - * Example: `"0x99D270f4a42b296fB888f168a5985e1d9839B064"` + * Example: `"0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` 2. **`blockParameter`** (optional): The block number or block identifier to specify the point in time for which you want to query the balance. * Example: `"latest"` or `"0x1"` #### Transaction Details -For the purpose of this documentation, we'll also describe the `transactions` field of a full transaction object. The `klay_getBalance` method does not return transaction details, but we provide this information for completeness. +For the purpose of this documentation, we'll also describe the `transactions` field of a full transaction object. The `eth_getBalance` method does not return transaction details, but we provide this information for completeness. A full transaction object includes the following fields: @@ -70,7 +70,7 @@ A full transaction object includes the following fields: The method returns a single field: -* `result`: The balance of the specified address in wei, as a hexadecimal string. +* `result`: The Ether balance of the specified address in wei, as a hexadecimal string. * Example: `"0x1a2e1a"`, which corresponds to `1,726,666` wei. ### JSON-RPC Request and Response Examples @@ -81,9 +81,9 @@ The method returns a single field: { "jsonrpc": "2.0", "id": 1, - "method": "klay_getBalance", + "method": "eth_getBalance", "params": [ - "0x99D270f4a42b296fB888f168a5985e1d9839B064", + "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "latest" ] } @@ -93,14 +93,8 @@ The method returns a single field: ```json { - "jsonrpc": "2.0", - "id": 1, - "result": { - "BigNumber": { - "s": 1, - "e": 18, - "c": [10611, 3542686313455] - } - } + "jsonrpc": "2.0", + "id": 1, + "result": "0x1a2e1a" } ``` diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getblockbyhash.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getblockbyhash.md similarity index 86% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getblockbyhash.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getblockbyhash.md index d4f9a4e4..7ae0ac03 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getblockbyhash.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getblockbyhash.md @@ -1,13 +1,13 @@ --- -title: "klay_getblockbyhash" -slug: "rpc-klaytn-klay_getblockbyhash" -excerpt: "Klaytn RPC" +title: "eth_getblockbyhash" +slug: "rpc-optimism-eth_getblockbyhash" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -21,12 +21,12 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" {% code overflow="wrap" lineNumbers="true" %} ```typescript // yarn add @tatumio/tatum - -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -const block = await tatum.rpc.getBlockByHash('0xcb632c914a18d838113f1e0cbf3ebc58e837c9497113c247001ecd52b212768e', true) +const block = await tatum.rpc.getBlockByHash('0x00ccb8a97e104e09ebec66f9c58aca7d42df4fbb7cfcf1a9ff4cb7fc08814cd6', true) await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ``` @@ -36,15 +36,15 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -`klay_getBlockByHash` is an JSON-RPC method that allows developers to query a specific block in the blockchain by its block hash. This method can be used in various scenarios, such as analyzing historical transactions, validating the state of the blockchain, or monitoring the progress of mining activities. +`eth_getBlockByHash` is method that allows developers to query a specific block in the blockchain by its block hash. This method can be used in various scenarios, such as analyzing historical transactions, validating the state of the blockchain, or monitoring the progress of mining activities. ### Parameters -The `klay_getBlockByHash` method accepts two parameters: +The `eth_getBlockByHash` method accepts two parameters: 1. **`blockHash`**: The hash of the block you want to retrieve information about. * Type: `String` - * Example: `"0xb0ddfcdcc375afce9f365458c5035ca4aaf99f9fe8699522193e16a8718615b6"` + * Example: `"0x078610ca461480e4b78557f20e544084cccc4accb41f5c1b7ef792246b78c94b"` 2. **`fullTransactionDetails`**: A boolean value indicating whether to return full transaction details or just transaction hashes. * Type: `Boolean` * Example: `true` @@ -88,14 +88,14 @@ If `returnFullTransactionObjects` is `true`, the `transactions` field contains t ### JSON-RPC Request and Response Examples -Here are examples of JSON-RPC request and response for the `klay_getBlockByNumber` method: +Here are examples of JSON-RPC request and response for the `eth_getBlockByNumber` method: #### Request ```json { "jsonrpc": "2.0", - "method": "klay_getBlockByHash", + "method": "eth_getBlockByHash", "params": ["0x078610ca461480e4b78557f20e544084cccc4accb41f5c1b7ef792246b78c94b", true], "id": 1 } diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getblockbynumber.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getblockbynumber.md similarity index 92% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getblockbynumber.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getblockbynumber.md index 80bf06fe..fd7b824c 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getblockbynumber.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getblockbynumber.md @@ -1,13 +1,13 @@ --- -title: "klay_getblockbynumber" -slug: "rpc-klaytn-klay_getblockbynumber" -excerpt: "Klaytn RPC" +title: "eth_getblockbynumber" +slug: "rpc-optimism-eth_getblockbynumber" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -21,14 +21,15 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" {% code overflow="wrap" lineNumbers="true" %} ```typescript // yarn add @tatumio/tatum - -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) const block = await tatum.rpc.getBlockByNumber('latest', true) await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs + ``` {% endcode %} {% endtab %} @@ -36,7 +37,7 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -`klay_getBlockByNumber` is an JSON-RPC method that allows developers to query a specific block in the blockchain by its block number. This method can be used in various scenarios, such as analyzing historical transactions, validating the state of the blockchain, or monitoring the progress of mining activities. +`eth_getBlockByNumber` is an [JSON-RPC](https://community.optimism.io/docs/developers/build/json-rpc/) method that allows developers to query a specific block in the blockchain by its block number. This method can be used in various scenarios, such as analyzing historical transactions, validating the state of the blockchain, or monitoring the progress of mining activities. ### Parameters @@ -88,7 +89,7 @@ If `returnFullTransactionObjects` is `true`, the `transactions` field contains t ### JSON-RPC Request and Response Examples -Here are examples of JSON-RPC request and response for the `klay_getBlockByNumber` method: +Here are examples of JSON-RPC request and response for the `eth_getBlockByNumber` method: #### Request @@ -96,7 +97,7 @@ Here are examples of JSON-RPC request and response for the `klay_getBlockByNumbe { "id": 1, "jsonrpc": "2.0", - "method": "klay_getBlockByNumber", + "method": "eth_getBlockByNumber", "params": ["latest", true] } ``` diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getblocktransactioncountbyhash.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getblocktransactioncountbyhash.md similarity index 62% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getblocktransactioncountbyhash.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getblocktransactioncountbyhash.md index 1eaea517..8cf83f75 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getblocktransactioncountbyhash.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getblocktransactioncountbyhash.md @@ -1,13 +1,13 @@ --- -title: "klay_getblocktransactioncountbyhash" -slug: "rpc-klaytn-klay_getblocktransactioncountbyhash" -excerpt: "Klaytn RPC" +title: "eth_getblocktransactioncountbyhash" +slug: "rpc-optimism-eth_getblocktransactioncountbyhash" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,11 +22,11 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -const tatum = await TatumSDK.init({network: Network.KLAYTN}) - -const response = await tatum.rpc.getBlockTransactionCountByHash('0xcb632c914a18d838113f1e0cbf3ebc58e837c9497113c247001ecd52b212768e') +const response = await tatum.rpc.getBlockTransactionCountByHash('0x00ccb8a97e104e09ebec66f9c58aca7d42df4fbb7cfcf1a9ff4cb7fc08814cd6') await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ``` @@ -36,7 +36,7 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -`klay_getBlockTransactionCountByHash` is a RPC method used to fetch the number of transactions in a block by the block's hash. It is useful when you want to know the total number of transactions included in a specific block and don't want to retrieve the entire block data. This method can be used in various scenarios, such as monitoring the network activity or estimating transaction confirmation times. +`eth_getBlockTransactionCountByHash` is a method used to fetch the number of transactions in a block by the block's hash. It is useful when you want to know the total number of transactions included in a specific block and don't want to retrieve the entire block data. This method can be used in various scenarios, such as monitoring the network activity or estimating transaction confirmation times. ### Parameters @@ -46,7 +46,7 @@ This method requires a single parameter: Example of the parameter: -* `blockHash`: `"0xb0ddfcdcc375afce9f365458c5035ca4aaf99f9fe8699522193e16a8718615b6"` +* `blockHash`: `"0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238"` ### Return @@ -62,9 +62,9 @@ The method returns a single value: { "id": 1, "jsonrpc": "2.0", - "method": "klay_getBlockTransactionCountByHash", + "method": "eth_getBlockTransactionCountByHash", "params": [ - "0xb0ddfcdcc375afce9f365458c5035ca4aaf99f9fe8699522193e16a8718615b6" + "0xb903239f8543d04b5dc1ba6579132b143087c68db1b2168786408fcbce568238" ] } ``` diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getblocktransactioncountbynumber.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getblocktransactioncountbynumber.md similarity index 60% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getblocktransactioncountbynumber.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getblocktransactioncountbynumber.md index 9ceb29a6..bd0b8e0a 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getblocktransactioncountbynumber.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getblocktransactioncountbynumber.md @@ -1,13 +1,13 @@ --- -title: "klay_getblocktransactioncountbynumber" -slug: "rpc-klaytn-klay_getblocktransactioncountbynumber" -excerpt: "Klaytn RPC" +title: "eth_getblocktransactioncountbynumber" +slug: "rpc-optimism-eth_getblocktransactioncountbynumber" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,11 +22,11 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -const tatum = await TatumSDK.init({network: Network.KLAYTN}) - -const response = await tatum.rpc.getBlockTransactionCountByNumber('0x80F8C7A') +const response = await tatum.rpc.getBlockTransactionCountByNumber('0x66BD5D5') await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ``` @@ -36,18 +36,18 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -The `klay_getBlockTransactionCountByNumber` JSON-RPC method allows you to retrieve the number of transactions in a specified block. This method is particularly useful when you need to analyze the transaction activity of a specific block. You can use it to gain insights into network usage, analyze the impact of specific events on the network, or monitor transaction congestion in certain blocks. +The `eth_getBlockTransactionCountByNumber` JSON-RPC method allows you to retrieve the number of transactions in a specified block. This method is particularly useful when you need to analyze the transaction activity of a specific block. You can use it to gain insights into network usage, analyze the impact of specific events on the network, or monitor transaction congestion in certain blocks. ### Parameters 1. **`blockNumber`**: The block number for which the transaction count should be retrieved. It should be a hex-encoded value representing the block number. - * Example: 371156 + * Example: `"0x1b4"` ### Return Object The return object is a hex-encoded value representing the number of transactions in the specified block. -* Example: `"0x1"` (1 transactions) +* Example: `"0xa"` (10 transactions) ### JSON-RPC Request and Response Examples @@ -57,8 +57,8 @@ The return object is a hex-encoded value representing the number of transactions { "jsonrpc": "2.0", "id": 1, - "method": "klay_getBlockTransactionCountByNumber", - "params": [371156] + "method": "eth_getBlockTransactionCountByNumber", + "params": ["0x1b4"] } ``` @@ -68,7 +68,7 @@ The return object is a hex-encoded value representing the number of transactions { "jsonrpc": "2.0", "id": 1, - "result": "0x1" + "result": "0xa" } ``` diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getcode.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getcode.md similarity index 61% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getcode.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getcode.md index 94f13cfc..894ad43a 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getcode.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getcode.md @@ -1,13 +1,13 @@ --- -title: "klay_getcode" -slug: "rpc-klaytn-klay_getcode" -excerpt: "Klaytn RPC" +title: "eth_getcode" +slug: "rpc-optimism-eth_getcode" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -18,25 +18,22 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" {% tabs %} {% tab title="TypeScript/JavaScript" %} -{% code overflow="wrap" lineNumbers="true" %} -```typescript -// yarn add @tatumio/tatum +
// yarn add @tatumio/tatum
 
-import { TatumSDK, Klaytn, Network } from '@tatumio/tatum'
-
-const tatum = await TatumSDK.init({network: Network.KLAYTN})
-
-const code = await tatum.rpc.getCode('0x898f2afc07924f5a4f9612449e4c4f8eca527515')
+import { TatumSDK, Optimism, Network } from '@tatumio/tatum'
+  
+const tatum = await TatumSDK.init({network: Network.OPTIMISM})
 
+const code = await tatum.rpc.getCode('0xcBA5609AB435969dEF6Ab164c4C0A4165E805783')
+
 await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs
-```
-{% endcode %}
+
{% endtab %} {% endtabs %} ### Overview -The `klay_getCode` method is part of the JSON-RPC API, which allows users to interact with the blockchain. This method is specifically used to retrieve the contract code (bytecode) of an account at a specific block number. It is helpful when developers need to examine the bytecode of a deployed contract or validate that the contract code on the blockchain matches the intended code. +The `eth_getCode` method allows users to interact with the blockchain. This method is specifically used to retrieve the contract code (bytecode) of an account at a specific block number. It is helpful when developers need to examine the bytecode of a deployed contract or validate that the contract code on the blockchain matches the intended code. Use cases for this method could include: @@ -46,10 +43,10 @@ Use cases for this method could include: ### Parameters -The `klay_getCode` method accepts two parameters: +The `eth_getCode` method accepts two parameters: 1. **`address`** (string): The address of the contract whose bytecode you want to retrieve. This should be a 20-byte address, formatted as a hex string with a `0x` prefix. - * Example: `"0x6eA7d015342b7eb7344F7ebf0150234f41F524d6"` + * Example: `"0xcBA5609AB435969dEF6Ab164c4C0A4165E805783"` 2. **`block`** (string): The block number at which you want to retrieve the contract code. This can be specified as a hex string or one of the following special keywords: * `"earliest"`: The first block in the blockchain * `"latest"`: The most recent block in the blockchain @@ -58,7 +55,7 @@ The `klay_getCode` method accepts two parameters: ### Return Object -The `klay_getCode` method returns a string representing the contract bytecode. The returned value is a hex string with a `0x` prefix. +The `eth_getCode` method returns a string representing the contract bytecode. The returned value is a hex string with a `0x` prefix. * If the account has contract code, the returned string will contain the bytecode. * If the account is not a contract or does not exist, the returned string will be `0x`. @@ -71,9 +68,9 @@ The `klay_getCode` method returns a string representing the contract bytecode. T { "id": 1, "jsonrpc": "2.0", - "method": "klay_getCode", + "method": "eth_getCode", "params": [ - "0x6eA7d015342b7eb7344F7ebf0150234f41F524d6", + "0xcBA5609AB435969dEF6Ab164c4C0A4165E805783", "latest" ] } diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getlogs.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getlogs.md similarity index 70% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getlogs.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getlogs.md index 7b527b61..68203465 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getlogs.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getlogs.md @@ -1,13 +1,13 @@ --- -title: "klay_getlogs" -slug: "rpc-klaytn-klay_getlogs" -excerpt: "Klaytn RPC" +title: "eth_getlogs" +slug: "rpc-optimism-eth_getlogs" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -21,12 +21,12 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" {% code overflow="wrap" lineNumbers="true" %} ```typescript // yarn add @tatumio/tatum + +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.KLAYTN}) - -const logs = await tatum.rpc.getLogs({ address : '0x898f2afc07924f5a4f9612449e4c4f8eca527515'}) +const logs = await tatum.rpc.getLogs({ address : '0x365a2dabcdb56f4f595c3af088b8975c26331448'}) await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ``` @@ -36,20 +36,20 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -The `klay_getLogs` method is an JSON-RPC method that allows developers to query logs generated by the network, specifically event logs emitted by smart contracts. These logs are an essential part of the ecosystem as they provide a way for developers to monitor contract events and track contract state changes. +The `eth_getLogs` method is method that allows developers to query logs generated by the network, specifically event logs emitted by smart contracts. These logs are an essential part of the ecosystem as they provide a way for developers to monitor contract events and track contract state changes. -This method is particularly useful when building decentralized applications (dApps) that rely on events emitted by smart contracts, as it enables developers to retrieve logs based on specific filter criteria. By using `klay_getLogs`, developers can efficiently track and react to events happening on the blockchain. +This method is particularly useful when building decentralized applications (dApps) that rely on events emitted by smart contracts, as it enables developers to retrieve logs based on specific filter criteria. By using `eth_getLogs`, developers can efficiently track and react to events happening on the blockchain. ### Parameters -The `klay_getLogs` method takes a single input parameter: an object containing the filter criteria. The filter object can have the following fields: +The `eth_getLogs` method takes a single input parameter: an object containing the filter criteria. The filter object can have the following fields: * **`fromBlock`**: (optional) The starting block number for the search. Can be a block number or one of the following strings: `"earliest"`, `"latest"`, or `"pending"`. * Example: `"fromBlock": "0x1"` * **`toBlock`**: (optional) The ending block number for the search. Can be a block number or one of the following strings: `"earliest"`, `"latest"`, or `"pending"`. * Example: `"toBlock": "0x2"` * **`address`**: (optional) The address or list of addresses of the contracts to filter logs from. Can be a single address or an array of addresses. - * Example: `"address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` + * Example: `"address": "0x365a2dabcdb56f4f595c3af088b8975c26331448"` * **`topics`**: (optional) An array of up to four 32-byte topics. Topics are order-dependent, and each topic can be an array of topic hashes or `null`. * Example: `"topics": ["0x123..."]` * **`blockhash`**: (optional) The block hash to filter logs from. If provided, `fromBlock` and `toBlock` are ignored. @@ -59,7 +59,7 @@ In addition to the above fields, the `transactions` field in the filter object c ### Return Object -The `klay_getLogs` method returns an array of log objects. Each log object contains the following fields: +The `eth_getLogs` method returns an array of log objects. Each log object contains the following fields: * **`removed`**: A boolean indicating whether the log was removed due to a chain reorganization. * Example: `"removed": false` @@ -74,7 +74,7 @@ The `klay_getLogs` method returns an array of log objects. Each log object conta * **`blockNumber`**: The block number containing the log. * Example: `"blockNumber": "0x1"` * **`address`**: The address of the contract that emitted the log. - * Example: `"address": "0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` + * Example: `"address": "0x365a2dabcdb56f4f595c3af088b8975c26331448"` * **`data`**: The data associated with the log. * Example: `"data":"0x0000000000000000000000000000000000000000000000000000000000000020"` * **`topics`**: An array of topics (order-dependent) associated with the log. @@ -88,12 +88,12 @@ The `klay_getLogs` method returns an array of log objects. Each log object conta { "id": 1, "jsonrpc": "2.0", - "method": "klay_getLogs", + "method": "eth_getLogs", "params": [ { "fromBlock": "0x1", "toBlock": "0x2", - "address": "0x6eA7d015342b7eb7344F7ebf0150234f41F524d6", + "address": "0x365a2dabcdb56f4f595c3af088b8975c26331448", "topics": ["0x123..."] } ] @@ -122,4 +122,4 @@ The `klay_getLogs` method returns an array of log objects. Each log object conta } ``` -This documentation provides a comprehensive overview of the `klay_getLogs` JSON-RPC method, its parameters, return objects, and JSON-RPC examples. By using this method, developers can effectively query logs generated by the network and use the retrieved data to track and react to events happening on the blockchain. +This documentation provides a comprehensive overview of the `eth_getLogs` JSON-RPC method, its parameters, return objects, and JSON-RPC examples. By using this method, developers can effectively query logs generated by the network and use the retrieved data to track and react to events happening on the blockchain. diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getproof.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getproof.md similarity index 73% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getproof.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getproof.md index 87944794..793aa358 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getproof.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getproof.md @@ -1,13 +1,13 @@ --- -title: "klay_getproof" -slug: "rpc-klaytn-klay_getproof" -excerpt: "Klaytn RPC" +title: "eth_getproof" +slug: "rpc-optimism-eth_getproof" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,13 +22,13 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -const tatum = await TatumSDK.init({network: Network.KLAYTN}) - -const result = await tatum.rpc.getProof("0x898f2afc07924f5a4f9612449e4c4f8eca527515", -["0x0000000000000000000000000000000000000000000000000000000000000000"], -"latest") +const result = await tatum.rpc.getProof("0x365a2dabcdb56f4f595c3af088b8975c26331448", + ["0x0000000000000000000000000000000000000000000000000000000000000000"], + "latest") await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ``` @@ -38,13 +38,13 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -The `klay_getProof` is a JSON-RPC method that retrieves the Merkle-Patricia proof for an account, storage key-value pairs, and account transaction count. It allows developers to verify the state of an account or storage value at a specific block without needing the entire state trie. This method is particularly useful for light clients or off-chain applications that require proof of an account's state or specific storage values. +The `eth_getProof` is method that retrieves the Merkle-Patricia proof for an account, storage key-value pairs, and account transaction count. It allows developers to verify the state of an account or storage value at a specific block without needing the entire state trie. This method is particularly useful for light clients or off-chain applications that require proof of an account's state or specific storage values. ### Parameters 1. **`address`** - `Data`, 20 Bytes * The address of the account. - * Example: `"0xBB52B2B91488d60eFb6848bBadd000005A511E5C"` + * Example: `"0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` 2. **`keys`** - `Array` of `Data` * An array of storage keys for which the proof should be generated. * Example: `["0x0000000000000000000000000000000000000000000000000000000000000000"]` @@ -78,9 +78,9 @@ _Request_: { "id": 1, "jsonrpc": "2.0", - "method": "klay_getProof", + "method": "eth_getProof", "params": [ - "0xBB52B2B91488d60eFb6848bBadd000005A511E5C", + "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", [ "0x0000000000000000000000000000000000000000000000000000000000000000" ], @@ -117,4 +117,5 @@ _Response_: ] } } + ``` diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getstorageat.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getstorageat.md similarity index 62% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getstorageat.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getstorageat.md index fbec29de..c42410c0 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getstorageat.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getstorageat.md @@ -1,13 +1,13 @@ --- -title: "klay_getstorageat" -slug: "rpc-klaytn-klay_getstorageat" -excerpt: "Klaytn RPC" +title: "eth_getstorageat" +slug: "rpc-optimism-eth_getstorageat" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,11 +22,12 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -const tatum = await TatumSDK.init({network: Network.KLAYTN}) - -const response = await tatum.rpc.getStorageAt('0x898f2afc07924f5a4f9612449e4c4f8eca527515', '0x0') +const response = await +tatum.rpc.getStorageAt('0xcBA5609AB435969dEF6Ab164c4C0A4165E805783', '0x0') await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ``` @@ -36,14 +37,14 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -`klay_getStorageAt` is an JSON-RPC method that allows you to query the storage value of a contract at a given position. It can be used to inspect the internal state of a smart contract. This method is particularly useful for developers, auditors, and analysts who want to examine contract storage values for various purposes, such as debugging, verifying contract behavior, or analyzing data. +`eth_getStorageAt` is method that allows you to query the storage value of a contract at a given position. It can be used to inspect the internal state of a smart contract. This method is particularly useful for developers, auditors, and analysts who want to examine contract storage values for various purposes, such as debugging, verifying contract behavior, or analyzing data. ### Parameters -`klay_getStorageAt` accepts three parameters: +`eth_getStorageAt` accepts three parameters: 1. **`address`**: The address of the contract you want to query. - * Example: `"0x6eA7d015342b7eb7344F7ebf0150234f41F524d6"` + * Example: `"0xcBA5609AB435969dEF6Ab164c4C0A4165E805783"` 2. **`position`**: The storage position (slot) you want to query. * Example: `"0x0"` 3. **`blockParameter`**: The block number, block hash, or one of the string literals (`"earliest"`, `"latest"` or `"pending"`), representing the point in the blockchain to query the storage value. @@ -61,10 +62,11 @@ The return object is a single string value, representing the storage value at th { "id": 1, "jsonrpc": "2.0", - "method": "klay_getStorageAt", + "method": "eth_getStorageAt", "params": [ - "0x6eA7d015342b7eb7344F7ebf0150234f41F524d6", - "0x0" + "0xcBA5609AB435969dEF6Ab164c4C0A4165E805783", + "0x0", + "latest" ] } ``` @@ -75,7 +77,7 @@ The return object is a single string value, representing the storage value at th { "id": 1, "jsonrpc": "2.0", - "result": "0x0000000000000000000000000000000000000000000000000000000000000001" + "result": "0x0000000000000000000000000000000000000000000000000000000000fd6626" } ``` diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactionbyblockhashandindex.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactionbyblockhashandindex.md similarity index 85% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactionbyblockhashandindex.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactionbyblockhashandindex.md index 69f5a9bb..620bfcca 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactionbyblockhashandindex.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactionbyblockhashandindex.md @@ -1,13 +1,13 @@ --- -title: "klay_gettransactionbyblockhashandindex" -slug: "rpc-klaytn-klay_gettransactionbyblockhashandindex" -excerpt: "Klaytn RPC" +title: "eth_gettransactionbyblockhashandindex" +slug: "rpc-optimism-eth_gettransactionbyblockhashandindex" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,11 +22,11 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -const tatum = await TatumSDK.init({network: Network.KLAYTN}) - -const tx = await tatum.rpc.getTransactionByBlockHashAndIndex('0xcb632c914a18d838113f1e0cbf3ebc58e837c9497113c247001ecd52b212768e', 0) +const tx = await tatum.rpc.getTransactionByBlockHashAndIndex('0x00ccb8a97e104e09ebec66f9c58aca7d42df4fbb7cfcf1a9ff4cb7fc08814cd6', 0) await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ``` @@ -36,7 +36,7 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -`klay_getTransactionByBlockHashAndIndex` is an JSON-RPC method that allows you to fetch the transaction details based on the block hash and the index of the transaction within that block. This method can be useful when you want to retrieve transaction details for a specific transaction without knowing its transaction hash. +`eth_getTransactionByBlockHashAndIndex` is method that allows you to fetch the transaction details based on the block hash and the index of the transaction within that block. This method can be useful when you want to retrieve transaction details for a specific transaction without knowing its transaction hash. Use cases for this method may include: @@ -46,10 +46,10 @@ Use cases for this method may include: ### Parameters -The `klay_getTransactionByBlockHashAndIndex` method accepts two parameters: +The `eth_getTransactionByBlockHashAndIndex` method accepts two parameters: 1. `blockHash` (required): The hash of the block containing the transaction. - * Example: `"0xb0ddfcdcc375afce9f365458c5035ca4aaf99f9fe8699522193e16a8718615b6"` + * Example: `"0x9a9a2a0d69b4ff48f7a2a8a26d135e1dbcbd3c3be3e8a3c90de0bcb104e4c4b4"` 2. `transactionIndex` (required): The index of the transaction within the specified block. The index is a hexadecimal value. * Example: `"0x0"` @@ -77,9 +77,9 @@ Request: { "jsonrpc": "2.0", "id": 1, - "method": "klay_getTransactionByBlockHashAndIndex", + "method": "eth_getTransactionByBlockHashAndIndex", "params": [ - "0xb0ddfcdcc375afce9f365458c5035ca4aaf99f9fe8699522193e16a8718615b6", + "0x1091a5831b3556e80e53598c24e9d592e104dba0428f47f94c61523eb52d09d8", "0x0" ] } diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactionbyblocknumberandindex.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactionbyblocknumberandindex.md similarity index 86% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactionbyblocknumberandindex.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactionbyblocknumberandindex.md index b9b90da2..875d7e7f 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactionbyblocknumberandindex.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactionbyblocknumberandindex.md @@ -1,13 +1,13 @@ --- -title: "klay_gettransactionbyblocknumberandindex" -slug: "rpc-klaytn-klay_gettransactionbyblocknumberandindex" -excerpt: "Klaytn RPC" +title: "eth_gettransactionbyblocknumberandindex" +slug: "rpc-optimism-eth_gettransactionbyblocknumberandindex" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,11 +22,11 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -iimport { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -const tatum = await TatumSDK.init({network: Network.KLAYTN}) - -const tx = await tatum.rpc.getTransactionByBlockNumberAndIndex('0x80F8C7A', 0) +const tx = await tatum.rpc.getTransactionByBlockNumberAndIndex('0x66BD5D5', 0) await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ``` @@ -36,7 +36,7 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -`klay_getTransactionByBlockHashAndIndex` is an JSON-RPC method that allows you to fetch the transaction details based on the block hash and the index of the transaction within that block. This method can be useful when you want to retrieve transaction details for a specific transaction without knowing its transaction hash. +`eth_getTransactionByBlockHashAndIndex` is method that allows you to fetch the transaction details based on the block hash and the index of the transaction within that block. This method can be useful when you want to retrieve transaction details for a specific transaction without knowing its transaction hash. Use cases for this method may include: @@ -46,12 +46,12 @@ Use cases for this method may include: ### Parameters -The `klay_getTransactionByBlockHashAndIndex` method accepts two parameters: +The `eth_getTransactionByBlockHashAndIndex` method accepts two parameters: 1. `blockNumber` (required): The hash of the block containing the transaction. - * Example: 371156 + * Example: `"0x316624"` 2. `transactionIndex` (required): The index of the transaction within the specified block. The index is a hexadecimal value. - * Example: 0 + * Example: `"0x0"` ### Return Object @@ -77,10 +77,10 @@ Request: { "jsonrpc": "2.0", "id": 1, - "method": "klay_getTransactionByBlockNumberAndIndex", + "method": "eth_getTransactionByBlockNumberAndIndex", "params": [ - 371156, - 0 + "0x316624", + "0x0" ] } ``` diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactionbyhash.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactionbyhash.md new file mode 100644 index 00000000..adbf3296 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactionbyhash.md @@ -0,0 +1,106 @@ +--- +title: "eth_gettransactionbyhash" +slug: "rpc-optimism-eth_gettransactionbyhash" +excerpt: "Optimism RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "Optimism RPC" + image: [] + keywords: "optimism, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +{% tabs %} +{% tab title="TypeScript/JavaScript" %} +{% code overflow="wrap" lineNumbers="true" %} +```typescript +// yarn add @tatumio/tatum + +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) + +const tx = await tatum.rpc.getTransactionByHash('0x501bc07b1e3346dabe68c6c0bee7fa52ea59c829396cd621cde0b61829321e58') + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +`eth_getTransactionByHash` is an [JSON-RPC](https://community.optimism.io/docs/developers/build/json-rpc/) method that allows you to query transaction details based on its hash. This method is useful when you want to retrieve information about a specific transaction, such as its sender, receiver, value, and more. Common use cases include tracking transaction status, monitoring incoming transactions, or analyzing historical transaction data. + +### Parameters + +The `eth_getTransactionByHash` method takes one parameter: + +* **`transactionHash`**: The hash of the transaction you want to retrieve. This should be a 32-byte hash string with a `0x` prefix. + * Example: `"0xa536596d043c03d709aaccbc53f421963fe3537274e86444cd984404cf9ecb13"` + +### Return Object + +The method returns a transaction object with the following fields: + +* **`hash`**: The hash of the transaction (32 bytes). +* **`nonce`**: The number of transactions sent by the sender prior to this one (integer). +* **`blockHash`**: The hash of the block in which the transaction was included (32 bytes), or `null` if the transaction is not yet mined. +* **`blockNumber`**: The block number in which the transaction was included (integer), or `null` if the transaction is not yet mined. +* **`transactionIndex`**: The index of the transaction in the block (integer), or `null` if the transaction is not yet mined. +* **`from`**: The address of the sender (20 bytes). +* **`to`**: The address of the receiver (20 bytes), or `null` for contract creation transactions. +* **`value`**: The value transferred in the transaction, in wei. +* **`gasPrice`**: The price of gas for the transaction, in wei. +* **`maxFeePerGas`** - The maximum fee per gas set in the transaction. +* **`maxPriorityFeePerGas`** - The maximum priority gas fee set in the transaction. +* **`gas`**: The maximum amount of gas the transaction is allowed to consume. +* **`input`**: The data payload of the transaction (string), or `0x` for simple value transfers. + +### JSON-RPC Examples + +Request: + +```json +{ + "jsonrpc": "2.0", + "method": "eth_getTransactionByHash", + "params": ["0xa536596d043c03d709aaccbc53f421963fe3537274e86444cd984404cf9ecb13"], + "id": 1 +} +``` + +Response: + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "blockHash": "0x1091a5831b3556e80e53598c24e9d592e104dba0428f47f94c61523eb52d09d8", + "blockNumber": "0x316624", + "from": "0x53e8577c4347c365e4e0da5b57a589cb6f2ab848", + "gas": "0x3c524", + "gasPrice": "0x306dc421e", + "hash": "0xa536596d043c03d709aaccbc53f421963fe3537274e86444cd984404cf9ecb13", + "input": "0x50bb4e7f00000000000000000000000074b4551c177592a908c6ab9ce671bfe8c1b5bd40000000000000000000000000000000000000000000000000000056b990e70e000000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000006068747470733a2f2f6574682d6d61696e6e65742e672e616c6368656d792e636f6d2f76322f72646f704c505054424a31536f786b2d555179306b7464676f4b45326146637a2f6765744e4654732f3f6f776e65723d766974616c696b2e657468", + "nonce": "0xc97", + "to": "0x211500d1960bdb7ba3390347ffd8ad486b897a18", + "transactionIndex": "0x4", + "value": "0x0", + "type": "0x0", + "chainId": "0xaa36a7", + "v": "0x1546d71", + "r": "0xf89098451217613aa4abbb3f8988e75e20ae948d07bf8b26c472bc9bda50c9d9", + "s": "0x15cfb5b34bcb23730aeadc28df3b66fa9cf28103ffc8b557d76f0c1df078028e" + } +} +``` + +\ diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactioncount.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactioncount.md similarity index 63% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactioncount.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactioncount.md index 518c34a1..a83c5cb3 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_gettransactioncount.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactioncount.md @@ -1,13 +1,13 @@ --- -title: "klay_gettransactioncount" -slug: "rpc-klaytn-klay_gettransactioncount" -excerpt: "Klaytn RPC" +title: "eth_gettransactioncount" +slug: "rpc-optimism-eth_gettransactioncount" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,11 +22,11 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -const tatum = await TatumSDK.init({network: Network.KLAYTN}) - -const result = await tatum.rpc.getTransactionCount('0x11f56be8b506f546f65662279a8641a0f490df40', 'latest') +const result = await tatum.rpc.getTransactionCount('0x365a2dabcdb56f4f595c3af088b8975c26331448', 'latest') await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ``` @@ -36,7 +36,7 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -The `klay_getTransactionCount` method is an JSON-RPC method that retrieves the number of transactions sent from a given address. It is a useful method for developers who need to keep track of an account's nonce value to avoid transaction collisions or incorrect order of execution. The nonce value is essential for ensuring transaction uniqueness and preventing replay attacks. +The `eth_getTransactionCount` method is method that retrieves the number of transactions sent from a given address. It is a useful method for developers who need to keep track of an account's nonce value to avoid transaction collisions or incorrect order of execution. The nonce value is essential for ensuring transaction uniqueness and preventing replay attacks. Use cases for this method include: @@ -46,10 +46,10 @@ Use cases for this method include: ### Parameters -The `klay_getTransactionCount` method accepts two parameters: +The `eth_getTransactionCount` method accepts two parameters: 1. **`address`** - The address whose transaction count will be retrieved. - * Example: `"0xBB52B2B91488d60eFb6848bBadd000005A511E5C"` + * Example: `"0x742d35Cc6634C0532925a3b844Bc454e4438f44e"` 2. **`blockParameter`** - A string indicating the block number or block state to consider when retrieving the transaction count. * Possible values: `"earliest"`, `"latest"`, `"pending"`, or a specific block number in hexadecimal format * Example: `"latest"` @@ -69,9 +69,9 @@ _Request_: { "jsonrpc": "2.0", "id": 1, - "method": "klay_getTransactionCount", + "method": "eth_getTransactionCount", "params": [ - "0xBB52B2B91488d60eFb6848bBadd000005A511E5C", + "0x742d35Cc6634C0532925a3b844Bc454e4438f44e", "latest" ] } @@ -83,12 +83,6 @@ _Response_: { "jsonrpc": "2.0", "id": 1, - "result": { - "BigNumber": { - "s": 1, - "e": 0, - "c": [1] - } - } + "result": "0x1e" } ``` diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactionreceipt.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactionreceipt.md new file mode 100644 index 00000000..811c6b3b --- /dev/null +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_gettransactionreceipt.md @@ -0,0 +1,119 @@ +--- +title: "eth_gettransactionreceipt" +slug: "rpc-optimism-eth_gettransactionreceipt" +excerpt: "Optimism RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "Optimism RPC" + image: [] + keywords: "optimism, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +{% tabs %} +{% tab title="TypeScript/JavaScript" %} +
// yarn add @tatumio/tatum
+  
+import { TatumSDK, Optimism, Network } from '@tatumio/tatum'
+  
+const tatum = await TatumSDK.init({network: Network.OPTIMISM})
+
+const tx = await tatum.rpc.getTransactionReceipt('0x501bc07b1e3346dabe68c6c0bee7fa52ea59c829396cd621cde0b61829321e58')
+
+await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs
+
+{% endtab %} +{% endtabs %} + +### Overview + +`eth_getTransactionReceipt` is method that retrieves the transaction receipt of a given transaction hash. This method is particularly useful when you need to obtain detailed information about a transaction's execution, such as its status (success or failure), gas usage, and logs (events). Common use cases include checking the status of a transaction after it has been mined or inspecting the events emitted by a smart contract during a specific transaction. + +### Parameters + +This method requires a single parameter: + +* **`transactionHash`**: The hash of the transaction for which you want to obtain the receipt. + * Example: `"0xa536596d043c03d709aaccbc53f421963fe3537274e86444cd984404cf9ecb13"` + +### Return Object + +The method returns an object containing the following fields: + +* **`transactionHash`**: The hash of the transaction. +* **`transactionIndex`**: The transaction's index position in the block. +* **`blockHash`**: The hash of the block where this transaction was mined. +* **`blockNumber`**: The block number where this transaction was mined. +* **`from`**: The address of the sender. +* **`to`**: The address of the receiver. `null` when it's a contract creation transaction. +* **`cumulativeGasUsed`**: The total amount of gas used when this transaction was executed in the block. +* **`gasUsed`**: The amount of gas used by this specific transaction alone. +* **`contractAddress`**: The address of the contract created, if the transaction was a contract creation. Otherwise, `null`. +* **`logs`**: An array of log objects, which were emitted during the transaction. +* **`logsBloom`**: A 256-byte bloom filter, which is a compressed representation of the logs emitted during the transaction. +* **`status`**: The status of the transaction's execution. `"0x1"` indicates success, while `"0x0"` indicates failure. + +### JSON-RPC Examples + +Request: + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "method": "eth_getTransactionReceipt", + "params": [ + "0xa536596d043c03d709aaccbc53f421963fe3537274e86444cd984404cf9ecb13" + ] +} +``` + +Response: + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": { + "blockHash": "0x1091a5831b3556e80e53598c24e9d592e104dba0428f47f94c61523eb52d09d8", + "blockNumber": "0x316624", + "contractAddress": null, + "cumulativeGasUsed": "0x7ad81", + "effectiveGasPrice": "0x306dc421e", + "from": "0x53e8577c4347c365e4e0da5b57a589cb6f2ab848", + "gasUsed": "0x3c518", + "logs": [ + { + "address": "0x211500d1960bdb7ba3390347ffd8ad486b897a18", + "topics": [ + "0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x00000000000000000000000074b4551c177592a908c6ab9ce671bfe8c1b5bd40", + "0x000000000000000000000000000000000000000000000000000056b990e70e00" + ], + "data": "0x", + "blockNumber": "0x316624", + "transactionHash": "0xa536596d043c03d709aaccbc53f421963fe3537274e86444cd984404cf9ecb13", + "transactionIndex": "0x4", + "blockHash": "0x1091a5831b3556e80e53598c24e9d592e104dba0428f47f94c61523eb52d09d8", + "logIndex": "0x3", + "removed": false + } + ], + "logsBloom": "0x00000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000020000010000000000000800000000000000000000000010000040000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000100000000000000000000000000000000002000000200000000000100000000000800000000000000000000020000000000000000000000200000000000000000000000000000000000000000000", + "status": "0x1", + "to": "0x211500d1960bdb7ba3390347ffd8ad486b897a18", + "transactionHash": "0xa536596d043c03d709aaccbc53f421963fe3537274e86444cd984404cf9ecb13", + "transactionIndex": "0x4", + "type": "0x0" + } +} +``` + +\ diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getunclecountbyblockhash.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getunclecountbyblockhash.md similarity index 68% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getunclecountbyblockhash.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getunclecountbyblockhash.md index 5b446d64..140ec056 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getunclecountbyblockhash.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getunclecountbyblockhash.md @@ -1,13 +1,13 @@ --- -title: "klay_getunclecountbyblockhash" -slug: "rpc-klaytn-klay_getunclecountbyblockhash" -excerpt: "Klaytn RPC" +title: "eth_getunclecountbyblockhash" +slug: "rpc-optimism-eth_getunclecountbyblockhash" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,11 +22,11 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -const tatum = await TatumSDK.init({network: Network.KLAYTN}) - -const result = await tatum.rpc.getUncleCountByBlockHash('0xcb632c914a18d838113f1e0cbf3ebc58e837c9497113c247001ecd52b212768e') +const result = await tatum.rpc.getUncleCountByBlockHash('0x00ccb8a97e104e09ebec66f9c58aca7d42df4fbb7cfcf1a9ff4cb7fc08814cd6') await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ``` @@ -36,13 +36,13 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -The `klay_getUncleCountByBlockHash` method is an JSON-RPC method that returns the number of uncles in a specified block by its hash. This method can be useful for gathering information about the performance of the network and to analyze the security of the blockchain. +The `eth_getUncleCountByBlockHash` method is method that returns the number of uncles in a specified block by its hash. This method can be useful for gathering information about the performance of the network and to analyze the security of the blockchain. Uncles are blocks that are not included in the main blockchain but are still valid, and they contribute to the overall security and decentralization of the network. The inclusion of uncles helps prevent centralization and ensures the mining process remains competitive. ### Parameters -The `klay_getUncleCountByBlockHash` method takes one parameter: +The `eth_getUncleCountByBlockHash` method takes one parameter: * `blockHash`: The hash of the block for which you want to get the uncle count. * Example value: `"0x3a3e528dcd6e05a614c9241b0a9296db961fa6a92e05af9f6c0d7d2f6bc92f7a"` @@ -55,7 +55,7 @@ The return object for this method is a hex-encoded integer representing the numb ### JSON-RPC Request and Response Examples -Here is an example JSON-RPC request and response for the `klay_getUncleCountByBlockHash` method: +Here is an example JSON-RPC request and response for the `eth_getUncleCountByBlockHash` method: **Request:** @@ -63,7 +63,7 @@ Here is an example JSON-RPC request and response for the `klay_getUncleCountByBl { "id": 1, "jsonrpc": "2.0", - "method": "klay_getUncleCountByBlockHash", + "method": "eth_getUncleCountByBlockHash", "params": [ "0x3a3e528dcd6e05a614c9241b0a9296db961fa6a92e05af9f6c0d7d2f6bc92f7a" ] diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getunclecountbyblocknumber.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getunclecountbyblocknumber.md similarity index 67% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getunclecountbyblocknumber.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getunclecountbyblocknumber.md index 1b41a74a..c22b371b 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_getunclecountbyblocknumber.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_getunclecountbyblocknumber.md @@ -1,13 +1,13 @@ --- -title: "klay_getunclecountbyblocknumber" -slug: "rpc-klaytn-klay_getunclecountbyblocknumber" -excerpt: "Klaytn RPC" +title: "eth_getunclecountbyblocknumber" +slug: "rpc-optimism-eth_getunclecountbyblocknumber" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,11 +22,11 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) -const tatum = await TatumSDK.init({network: Network.KLAYTN}) - -const result = await tatum.rpc.getUncleCountByBlockNumber('0x80F8C7A') +const result = await tatum.rpc.getUncleCountByBlockNumber('0x66BD5D5') await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ``` @@ -36,13 +36,13 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -The `klay_getUncleCountByBlockHash` method is an JSON-RPC method that returns the number of uncles in a specified block by its hash. This method can be useful for gathering information about the performance of the network and to analyze the security of the blockchain. +The `eth_getUncleCountByBlockHash` method is method that returns the number of uncles in a specified block by its hash. This method can be useful for gathering information about the performance of the network and to analyze the security of the blockchain. Uncles are blocks that are not included in the main blockchain but are still valid, and they contribute to the overall security and decentralization of the network. The inclusion of uncles helps prevent centralization and ensures the mining process remains competitive. ### Parameters -The `klay_getUncleCountByBlockHash` method takes one parameter: +The `eth_getUncleCountByBlockHash` method takes one parameter: * `blockNumber`: The number of the block for which you want to get the uncle count. * Example value: `"0x12345"` @@ -55,7 +55,7 @@ The return object for this method is a hex-encoded integer representing the numb ### JSON-RPC Request and Response Examples -Here is an example JSON-RPC request and response for the `klay_getUncleCountByBlockNumber` method: +Here is an example JSON-RPC request and response for the `eth_getUncleCountByBlockNumber` method: **Request:** @@ -63,7 +63,7 @@ Here is an example JSON-RPC request and response for the `klay_getUncleCountByBl { "id": 1, "jsonrpc": "2.0", - "method": "klay_getUncleCountByBlockNumber", + "method": "eth_getUncleCountByBlockNumber", "params": [ "0x12345" ] diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_maxpriorityfeepergas.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_maxpriorityfeepergas.md new file mode 100644 index 00000000..0387c426 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_maxpriorityfeepergas.md @@ -0,0 +1,76 @@ +--- +title: "eth_maxpriorityfeepergas" +slug: "rpc-optimism-eth_maxpriorityfeepergas" +excerpt: "Optimism RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "Optimism RPC" + image: [] + keywords: "optimism, rpc" + robots: "index" +createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" +--- +[block:html]{"html":"
\n
Archive Method
\n

Only on the full archive nodes. Complex queries might take longer and incur additional cost

\n
"}[/block] + +### How to use it + +{% tabs %} +{% tab title="TypeScript/JavaScript" %} +{% code overflow="wrap" lineNumbers="true" %} +```typescript +// yarn add @tatumio/tatum + +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) + +const gasPrice = await tatum.rpc.maxPriorityFeePerGas() + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +The `eth_maxPriorityFeePerGas` RPC method is used to retrieve the maximum priority fee per gas set by the user for a transaction. This method can be used to determine the maximum fee that can be paid for a transaction to be included in a block quickly. + +### Use case + +This method is particularly useful when the user wants to ensure that a transaction is processed quickly, even in a congested network where transaction fees may fluctuate rapidly. By setting a high maximum priority fee per gas, the user can ensure that the transaction is processed as quickly as possible. + +### Parameters + +`None.` + +## Return Object + +* `maxPriorityFeePerGas` - The maximum priority fee per gas the user is willing to pay, in wei. + +### JSON Examples + +#### Request + +```json +{ + "jsonrpc": "2.0", + "method": "eth_maxPriorityFeePerGas", + "params": [], + "id": 1 +} +``` + +#### Response + +```json +{ + "jsonrpc": "2.0", + "id": 1, + "result": "0x3b9aca00" +} +``` + +\ diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_sendrawtransaction.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_sendrawtransaction.md similarity index 67% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_sendrawtransaction.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_sendrawtransaction.md index ae2ada5b..ffaf26d2 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/klay_sendrawtransaction.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/eth_sendrawtransaction.md @@ -1,13 +1,13 @@ --- -title: "klay_sendrawtransaction" -slug: "rpc-klaytn-klay_sendrawtransaction" -excerpt: "Klaytn RPC" +title: "eth_sendrawtransaction" +slug: "rpc-optimism-eth_sendrawtransaction" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,9 +22,9 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) const gasPrice = await tatum.rpc.sendRawTransaction('0x0000.......') @@ -36,7 +36,7 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -The `klay_sendRawTransaction` RPC method is used to send a signed and serialized transaction to the network. This method is particularly useful when you want to have full control over the signing process, e.g., when using hardware wallets, cold storage, or custom signing libraries. It can be utilized in various use cases, such as transferring, interacting with smart contracts, or deploying new contracts. +The `eth_sendRawTransaction` RPC method is used to send a signed and serialized transaction to the network. This method is particularly useful when you want to have full control over the signing process, e.g., when using hardware wallets, cold storage, or custom signing libraries. It can be utilized in various use cases, such as transferring Ether, interacting with smart contracts, or deploying new contracts. ### Parameters @@ -56,7 +56,7 @@ The method returns a single value: { "id": 1, "jsonrpc": "2.0", - "method": "klay_sendRawTransaction", + "method": "eth_sendRawTransaction", "params": [ "0xf86d8201...94a7bc" ] diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/txpool_content.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/txpool_content.md similarity index 95% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/txpool_content.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/txpool_content.md index fb05e28a..bbcea653 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/txpool_content.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/txpool_content.md @@ -1,13 +1,13 @@ --- title: "txpool_content" -slug: "rpc-klaytn-txpool_content" -excerpt: "Klaytn RPC" +slug: "rpc-optimism-txpool_content" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,9 +22,9 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) const content = await tatum.rpc.txPoolContent() diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/txpool_inspect.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/txpool_inspect.md similarity index 91% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/txpool_inspect.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/txpool_inspect.md index df94dd55..b9f0f110 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/txpool_inspect.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/txpool_inspect.md @@ -1,13 +1,13 @@ --- title: "txpool_inspect" -slug: "rpc-klaytn-txpool_inspect" -excerpt: "Klaytn RPC" +slug: "rpc-optimism-txpool_inspect" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,9 +22,9 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) const inspect = await tatum.rpc.txPoolInspect() diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/txpool_status.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/txpool_status.md similarity index 89% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/txpool_status.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/txpool_status.md index 08f15736..1f2683dd 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/txpool_status.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/txpool_status.md @@ -1,13 +1,13 @@ --- title: "txpool_status" -slug: "rpc-klaytn-txpool_status" -excerpt: "Klaytn RPC" +slug: "rpc-optimism-txpool_status" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -22,9 +22,9 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) const status = await tatum.rpc.txPoolStatus() diff --git a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/web3_clientversion.md b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/web3_clientversion.md similarity index 77% rename from v1.0/RPC Nodes/rpc-evm/rpc-klaytn/web3_clientversion.md rename to v1.0/RPC Nodes/rpc-evm/rpc-optimism/web3_clientversion.md index b9e216ee..f4c4df7e 100644 --- a/v1.0/RPC Nodes/rpc-evm/rpc-klaytn/web3_clientversion.md +++ b/v1.0/RPC Nodes/rpc-evm/rpc-optimism/web3_clientversion.md @@ -1,13 +1,13 @@ --- title: "web3_clientversion" -slug: "rpc-klaytn-web3_clientversion" -excerpt: "Klaytn RPC" +slug: "rpc-optimism-web3_clientversion" +excerpt: "Optimism RPC" category: 65c5e93c623cad004b45d505 hidden: false metadata: - description: "Klaytn RPC" + description: "Optimism RPC" image: [] - keywords: "klaytn, rpc" + keywords: "optimism, rpc" robots: "index" createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" @@ -21,9 +21,10 @@ updatedAt: "Tue Apr 02 2024 08:40:59 GMT+0000 (Coordinated Universal Time)" {% code overflow="wrap" lineNumbers="true" %} ```typescript // yarn add @tatumio/tatum -import { TatumSDK, Klaytn, Network } from '@tatumio/tatum' -const tatum = await TatumSDK.init({network: Network.KLAYTN}) +import { TatumSDK, Optimism, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.OPTIMISM}) const version = await tatum.rpc.clientVersion() @@ -35,7 +36,7 @@ await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs ### Overview -`web3_clientVersion` is a method of the JSON-RPC API that allows the client to retrieve the current version of the client software being used by the node. +`web3_clientVersion` is a method that allows the client to retrieve the current version of the client software being used by the node. This method is read-only and does not require authentication. The `web3_clientVersion` method can be used by developers to confirm the version of the client software they are using and ensure that it is compatible with their application. @@ -68,9 +69,8 @@ The `web3_clientVersion` method returns a string representing the version of the ```json { - "jsonrpc": "2.0", - "id": 67, - "result": "v0.9.0" + "jsonrpc": "2.0", + "id": 1, + "result": "Geth/v1.10.3-stable-c2d2f1a3/linux-amd64/go1.16.4" } ``` -