From e55d9eaa002c1cc2e38ac65f4bae5dac9e1b8ee4 Mon Sep 17 00:00:00 2001 From: productshiv Date: Sat, 6 Apr 2024 12:52:07 +0530 Subject: [PATCH] Adding BCH --- v1.0/RPC Nodes/others/rpc-xrp.md | 9 - .../others/rpc-xrp/account_channels.md | 120 --------- .../others/rpc-xrp/account_currencies.md | 89 ------- v1.0/RPC Nodes/others/rpc-xrp/account_info.md | 148 ----------- .../RPC Nodes/others/rpc-xrp/account_lines.md | 130 ---------- v1.0/RPC Nodes/others/rpc-xrp/account_nfts.md | 102 -------- .../others/rpc-xrp/account_objects.md | 177 ------------- .../others/rpc-xrp/account_offers.md | 122 --------- v1.0/RPC Nodes/others/rpc-xrp/account_tx.md | 236 ----------------- v1.0/RPC Nodes/others/rpc-xrp/book_offers.md | 93 ------- .../others/rpc-xrp/channel_authorize.md | 87 ------- .../others/rpc-xrp/channel_verify.md | 84 ------ .../others/rpc-xrp/deposit_authorized.md | 85 ------ v1.0/RPC Nodes/others/rpc-xrp/fee.md | 99 ------- v1.0/RPC Nodes/others/rpc-xrp/ledger.md | 143 ----------- .../RPC Nodes/others/rpc-xrp/ledger_closed.md | 75 ------ v1.0/RPC Nodes/others/rpc-xrp/ledger_data.md | 119 --------- v1.0/RPC Nodes/others/rpc-xrp/ledger_entry.md | 95 ------- v1.0/RPC Nodes/others/rpc-xrp/manifest.md | 85 ------ .../others/rpc-xrp/nft_buy_offers.md | 86 ------- .../others/rpc-xrp/nft_sell_offers.md | 86 ------- .../others/rpc-xrp/noripple_check.md | 120 --------- v1.0/RPC Nodes/others/rpc-xrp/ping.md | 70 ----- v1.0/RPC Nodes/others/rpc-xrp/random.md | 70 ----- .../others/rpc-xrp/ripple_path_find.md | 151 ----------- v1.0/RPC Nodes/others/rpc-xrp/server_info.md | 172 ------------- v1.0/RPC Nodes/others/rpc-xrp/server_state.md | 172 ------------- v1.0/RPC Nodes/others/rpc-xrp/submit.md | 159 ------------ .../others/rpc-xrp/submit_multisigned.md | 117 --------- .../others/rpc-xrp/transaction_entry.md | 92 ------- v1.0/RPC Nodes/others/rpc-xrp/tx.md | 199 -------------- v1.0/RPC Nodes/rpc-utxo/rpc-bch.md | 9 + .../rpc-utxo/rpc-bch/createrawtransaction.md | 101 ++++++++ .../rpc-utxo/rpc-bch/decoderawtransaction.md | 132 ++++++++++ .../rpc-utxo/rpc-bch/decodescript.md | 87 +++++++ .../RPC Nodes/rpc-utxo/rpc-bch/estimatefee.md | 52 ++++ .../rpc-utxo/rpc-bch/estimatesmartfee.md | 87 +++++++ .../rpc-utxo/rpc-bch/getbestblockhash.md | 75 ++++++ v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblock.md | 128 +++++++++ .../rpc-utxo/rpc-bch/getblockchaininfo.md | 105 ++++++++ .../rpc-utxo/rpc-bch/getblockcount.md | 75 ++++++ .../rpc-utxo/rpc-bch/getblockhash.md | 78 ++++++ .../rpc-utxo/rpc-bch/getblockheader.md | 115 +++++++++ .../rpc-utxo/rpc-bch/getblockstats.md | 147 +++++++++++ .../rpc-utxo/rpc-bch/getchaintips.md | 243 ++++++++++++++++++ .../rpc-utxo/rpc-bch/getdifficulty.md | 75 ++++++ .../rpc-utxo/rpc-bch/getmempoolancestors.md | 85 ++++++ .../rpc-utxo/rpc-bch/getmempooldescendants.md | 85 ++++++ .../rpc-utxo/rpc-bch/getmempoolentry.md | 114 ++++++++ .../rpc-utxo/rpc-bch/getmempoolinfo.md | 96 +++++++ .../rpc-utxo/rpc-bch/getrawmempool.md | 123 +++++++++ .../rpc-utxo/rpc-bch/getrawtransaction.md | 178 +++++++++++++ v1.0/RPC Nodes/rpc-utxo/rpc-bch/gettxout.md | 108 ++++++++ .../rpc-utxo/rpc-bch/gettxoutproof.md | 82 ++++++ .../rpc-utxo/rpc-bch/sendrawtransaction.md | 81 ++++++ .../rpc-utxo/rpc-bch/validateaddress.md | 98 +++++++ .../rpc-utxo/rpc-bch/verifymessage.md | 86 +++++++ .../rpc-utxo/rpc-bch/verifytxoutproof.md | 80 ++++++ 58 files changed, 2725 insertions(+), 3592 deletions(-) delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/account_channels.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/account_currencies.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/account_info.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/account_lines.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/account_nfts.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/account_objects.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/account_offers.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/account_tx.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/book_offers.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/channel_authorize.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/channel_verify.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/deposit_authorized.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/fee.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/ledger.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/ledger_closed.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/ledger_data.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/ledger_entry.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/manifest.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/nft_buy_offers.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/nft_sell_offers.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/noripple_check.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/ping.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/random.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/ripple_path_find.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/server_info.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/server_state.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/submit.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/submit_multisigned.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/transaction_entry.md delete mode 100644 v1.0/RPC Nodes/others/rpc-xrp/tx.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/createrawtransaction.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/decoderawtransaction.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/decodescript.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/estimatefee.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/estimatesmartfee.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/getbestblockhash.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblock.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockchaininfo.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockcount.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockhash.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockheader.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockstats.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/getchaintips.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/getdifficulty.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempoolancestors.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempooldescendants.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempoolentry.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempoolinfo.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/getrawmempool.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/getrawtransaction.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/gettxout.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/gettxoutproof.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/sendrawtransaction.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/validateaddress.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/verifymessage.md create mode 100644 v1.0/RPC Nodes/rpc-utxo/rpc-bch/verifytxoutproof.md diff --git a/v1.0/RPC Nodes/others/rpc-xrp.md b/v1.0/RPC Nodes/others/rpc-xrp.md deleted file mode 100644 index a7bb7a48..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -title: "XRP" -slug: "rpc-xrp" -excerpt: "" -category: 65c5e93c623cad004b45d505 -hidden: false -createdAt: "Wed Mar 06 2024 10:35:18 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Wed Mar 06 2024 13:09:53 GMT+0000 (Coordinated Universal Time)" ---- diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_channels.md b/v1.0/RPC Nodes/others/rpc-xrp/account_channels.md deleted file mode 100644 index adc6b115..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/account_channels.md +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: "account_channels" -slug: "rpc-xrp-account_channels" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.accountChannels('rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn', { - destinationAccount: 'ra5nK24KXen9AHvsdFTKHSANinZseWnPcX', - ledgerIndex: 'validated', -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `account_channels` RPC method allows you to retrieve information about an account's Payment Channels on the XRP Ledger. This includes only channels where the specified account is the source (or owner) of the channel, not the destination. The information returned is relative to a particular version of the ledger. - -Use cases for `account_channels` include: - -* Tracking the status of open Payment Channels -* Auditing total outbound XRP from an account via Payment Channels -* Monitoring Payment Channel balances to determine if they need to be topped up - -{% embed url="https://codepen.io/tatum-devrel/pen/dyQLjEX" %} - -### Parameters - -The `account_channels` RPC method includes the following parameters: - -* `account`: The unique identifier of an account, typically the account's Address. The request returns channels where this account is the channel's owner/source. -* `destination_account` (Optional): The unique identifier of an account, typically the account's Address. If provided, filter results to payment channels whose destination is this account. -* `ledger_hash` (Optional): A 20-byte hex string for the ledger version to use. -* `ledger_index` (Optional): The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. -* `limit` (Optional): Limit the number of transactions to retrieve. Cannot be less than 10 or more than 400. The default is 200. -* `marker` (Optional): Value from a previous paginated response. Resume retrieving data where that response left off. - -### Return Object - -The response to the `account_channels` RPC call includes an array of Channel Objects, each containing the following fields: - -* `account` (String): The address of the source/owner of the payment channels. This corresponds to the account field of the request. -* `channels` (Array of Channel Objects): Payment channels owned by this account. Each Channel Object includes: - * `account` (String): The owner of the channel, as an Address. - * `amount` (String): The total amount of XRP, in drops allocated to this channel. - * `balance` (String): The total amount of XRP, in drops, paid out from this channel, as of the ledger version used. - * `channel_id` (String): A unique ID for this channel, as a 64-character hexadecimal string. This is also the ID of the channel object in the ledger's state data. - * `destination_account` (String): The destination account of the channel, as an Address. Only this account can receive the XRP in the channel while it is open. - * `settle_delay` (Unsigned Integer): The number of seconds the payment channel must stay open after the owner of the channel requests to close it. - * `public_key` (String): May be omitted. The public key for the payment channel in the XRP Ledger's base58 format. - * `public_key_hex` (String): May be omitted. The public key for the payment channel in hexadecimal format. - * `expiration` (Unsigned Integer): May be omitted. Time, in seconds since the Ripple Epoch, when this channel is set to expire. - * `cancel_after` (Unsigned Integer): May be omitted. Time, in seconds since the Ripple Epoch, of this channel's immutable expiration. - * `source_tag` (Unsigned Integer): May be omitted. A 32-bit unsigned integer to use as a source tag for payments through this payment channel. - * `destination_tag` (Unsigned Integer): May be omitted. A 32-bit unsigned integer to use as a destination tag for payments through this channel. -* `ledger_hash` (String): May be omitted. The identifying hash of the ledger version used to generate this response. -* `ledger_index` (Number): The ledger index of the ledger version used to generate this response. -* `validated` (Boolean): May be omitted. If true, this data comes from a validated ledger version. -* `limit` (Number): May be omitted. The limit to how many channel objects were actually returned by this request. -* `marker` (Marker): May be omitted. Server-defined value for pagination. Pass this to the next call to resume getting results where this call left off. - -### JSON-RPC Request Example - -```json -{ - "method": "account_channels", - "params": [{ - "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", - "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", - "ledger_index": "validated" - }] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", - "channels": [ - { - "account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", - "amount": "1000", - "balance": "0", - "channel_id": "C7F634794B79DB40E87179A9D1BF05D05797AE7E92DF8E93FD6656E8C4BE3AE7", - "destination_account": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", - "public_key": "aBR7mdD75Ycs8DRhMgQ4EMUEmBArF8SEh1hfjrT2V9DQTLNbJVqw", - "public_key_hex": "03CFD18E689434F032A4E84C63E2A3A6472D684EAF4FD52CA67742F3E24BAE81B2", - "settle_delay": 60 - } - ], - "ledger_hash": "27F530E5C93ED5C13994812787C1ED073C822BAEC7597964608F2C049C2ACD2D", - "ledger_index": 71766343, - "status": "success", - "validated": true - } -} -``` - -Please note, the response may contain an array of channel objects if there are multiple channels associated with the provided account. diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_currencies.md b/v1.0/RPC Nodes/others/rpc-xrp/account_currencies.md deleted file mode 100644 index 301a4b07..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/account_currencies.md +++ /dev/null @@ -1,89 +0,0 @@ ---- -title: "account_currencies" -slug: "rpc-xrp-account_currencies" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.accountCurrencies('r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', { - ledgerIndex: 'validated', - strict: true -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `accountCurrencies` method retrieves a list of currencies that an account can send or receive, based on its trust lines. This isn't a thoroughly confirmed list but can be used to populate user interfaces. - -{% embed url="https://codepen.io/tatum-devrel/pen/gOQyjNx" %} - -### Parameters - -The method accepts two parameters: - -* `account` (**required**): A unique identifier for the account, most commonly the account's Address. -* `options` (**optional**): An object with the following properties: - * `ledgerHash`: A 20-byte hex string for the ledger version to use. - * `ledgerIndex`: The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. - * `strict`: If true, then the `account` field only accepts a public key or XRP Ledger address. Otherwise, `account` can be a secret or passphrase (not recommended). The default is false. - -### Return Object - -The `accountCurrencies` method returns an object with following fields: - -* `ledger_hash` (String - Hash): May be omitted. The identifying hash of the ledger version used to retrieve this data, as hex. -* `ledger_index` (Integer - Ledger Index): The ledger index of the ledger version used to retrieve this data. -* `receive_currencies` (Array of Strings): Array of Currency Codes for currencies that this account can receive. -* `send_currencies` (Array of Strings): Array of Currency Codes for currencies that this account can send. -* `validated` (Boolean): If true, this data comes from a validated ledger.\ - - -### JSON-RPC Request Example - -Here's an example of how the JSON-RPC request might look like: - -```json -{ - "command": "account_currencies", - "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "strict": true, - "ledger_index": "validated" -} -``` - -### JSON-RPC Response Example - -Here's an example of how the JSON-RPC response might look like: - -```json -{ - "result": { - "ledger_index": 11775844, - "receive_currencies": ["BTC", "CNY", "DYM", "EUR", "JOE", "MXN", "USD", "015841551A748AD2C1F76FF6ECB0CCCD00000000"], - "send_currencies": ["ASP", "BTC", "CHF", "CNY", "DYM", "EUR", "JOE", "JPY", "MXN", "USD"], - "validated": true - }, - "status": "success", - "type": "response" -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_info.md b/v1.0/RPC Nodes/others/rpc-xrp/account_info.md deleted file mode 100644 index a115ec6d..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/account_info.md +++ /dev/null @@ -1,148 +0,0 @@ ---- -title: "account_info" -slug: "rpc-xrp-account_info" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.accountInfo('rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn', { - ledgerIndex: 'current', - strict: true, - queue: true, - signerLists: true -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `accountInfo` method retrieves information about an account, its activity, and its XRP balance. All information retrieved is relative to a particular version of the ledger. - -{% embed url="https://codepen.io/tatum-devrel/pen/RwqOYKL" %} - -### Parameters - -The method accepts two parameters: - -* `account` (**required**): A unique identifier for the account, most commonly the account's Address. -* `options` (**optional**): An object with the following properties: - * `ledgerHash`: A 20-byte hex string for the ledger version to use. - * `ledgerIndex`: The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. - * `queue`: If true, also returns stats about queued transactions associated with this account. Can only be used when querying for the data from the current open ledger. - * `signerLists`: If true, also returns any SignerList objects associated with this account. - * `strict`: If true, then the `account` field only accepts a public key or XRP Ledger address. Otherwise, `account` can be a secret or passphrase (not recommended). The default is false. - -### Return Object - -The `accountInfo` method returns object with following fields: - -* `account_data`: This is an object that contains the AccountRoot ledger object with this account's information, as stored in the ledger. -* `signer_lists`: This is an array of SignerList ledger objects associated with this account for Multi-Signing. This field is omitted unless the request specified signer\_lists and at least one SignerList is associated with the account. Since an account can own at most one SignerList, this array must have exactly one member if it is present. -* `ledger_current_index`: This is the ledger index of the current in-progress ledger, which was used when retrieving this information. This is omitted if ledger\_index is provided instead. -* `ledger_index`: This is the ledger index of the ledger version used when retrieving this information. The information does not contain any changes from ledger versions newer than this one. This is omitted if ledger\_current\_index is provided instead. -* `queue_data`: This is an object that contains information about queued transactions sent by this account. This information describes the state of the local rippled server, which may be different from other servers in the peer-to-peer XRP Ledger network. Some fields may be omitted because the values are calculated "lazily" by the queuing mechanism. This is omitted unless queue specified as true and querying the current open ledger. -* `validated`: This is a boolean value that is true if this data is from a validated ledger version. If omitted or set to false, this data is not final. - -The `queue_data` parameter, if present, contains the following fields: - -* `txn_count`: The number of queued transactions from this address. -* `auth_change_queued`: Whether a transaction in the queue changes this address's ways of authorizing transactions. If true, this address can queue no further transactions until that transaction has been executed or dropped from the queue. -* `lowest_sequence`: The lowest Sequence Number among transactions queued by this address. -* `highest_sequence`: The highest Sequence Number among transactions queued by this address. -* `max_spend_drops_total`: The integer amount of drops of XRP that could be debited from this address if every transaction in the queue consumes the maximum amount of XRP possible. -* `transactions`: An array containing information about each queued transaction from this address. Each object in the `transactions` array, if present, may contain any or all of the following fields: - * `auth_change`: Whether this transaction changes this address's ways of authorizing transactions. - * `fee`: The Transaction Cost of this transaction, in drops of XRP. - * `fee_level`: The transaction cost of this transaction, relative to the minimum cost for this type of transaction, in fee levels. - * `max_spend_drops`: The maximum amount of XRP, in drops, this transaction could send or destroy. - * `seq`: The Sequence Number of this transaction. - -\ - - -### JSON-RPC Request Example - -Here's an example of how the JSON-RPC request might look like: - -```json -{ - "id": 2, - "command": "account_info", - "account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn", - "strict": true, - "ledger_index": "current", - "queue": true -} -``` - -### JSON-RPC Response Example - -Here's an example of how the JSON-RPC response might look like: - -```json -{ - "id": 5, - "status": "success", - "type": "response", - "result": { - "account_data": { - "Account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn", - "Balance": "999999999960", - "Flags": 8388608, - "LedgerEntryType": "AccountRoot", - "OwnerCount": 0, - "PreviousTxnID": "4294BEBE5B569A18C0A2702387C9B1E7146DC3A5850C1E87204951C6FDAA4C42", - "PreviousTxnLgrSeq": 3, - "Sequence": 6, - "index": "92FA6A9FC8EA6018D5D16532D7795C91BFB0831355BDFDA177E86C8BF997985F" - }, - "ledger_current_index": 4, - "queue_data": { - "auth_change_queued": true, - "highest_sequence": 10, - "lowest_sequence": 6, - "max_spend_drops_total": "500", - "transactions": [ - { - "auth_change": false, - "fee": "100", - "fee_level": "2560", - "max_spend_drops": "100", - "seq": 6 - }, - ... (trimmed for length) ... - { - "LastLedgerSequence": 10, - "auth_change": true, - "fee": "100", - "fee_level": "2560", - "max_spend_drops": "100", - "seq": 10 - } - ], - "txn_count": 5 - }, - "status": "success", - "validated": false - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_lines.md b/v1.0/RPC Nodes/others/rpc-xrp/account_lines.md deleted file mode 100644 index b0ed73ea..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/account_lines.md +++ /dev/null @@ -1,130 +0,0 @@ ---- -title: "account_lines" -slug: "rpc-xrp-account_lines" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.accountLines('r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', { - ledgerIndex: 'validated', - peer: 'r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z', - limit: 10, - marker: 'example_marker', -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `account_lines` method returns information about an account's trust lines, which contain balances in all non-XRP currencies and assets. All information retrieved is relative to a particular version of the ledger. - -{% embed url="https://codepen.io/tatum-devrel/pen/abQxawN" %} - -### Parameters - -* `account`: (String) A unique identifier for the account, most commonly the account's Address. -* `options`: (AccountLinesOptions) An object with optional parameters: - * `ledgerHash`: (Optional, String) A 20-byte hex string for the ledger version to use. - * `ledgerIndex`: (Optional, LedgerIndex) The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. Can be 'validated', 'closed', 'current', or a number. - * `peer`: (Optional, String) The Address of a second account. If provided, show only lines of trust connecting the two accounts. - * `limit`: (Optional, Number) Limit the number of results to retrieve. - * `marker`: (Optional, unknown) Value from a previous paginated response. Resume retrieving data where that response left off. - -### Return Object - -The response object has the following properties: - -* `account`: (String) Unique Address of the account this request corresponds to. This is the "perspective account" for the purpose of the trust lines. -* `lines`: (Array) Array of trust line objects, as described below. If the number of trust lines is large, only returns up to the limit at a time. -* `ledger_current_index`: (Optional, Integer) The ledger index of the current open ledger, which was used when retrieving this information. -* `ledger_index`: (Optional, Integer) The ledger index of the ledger version that was used when retrieving this data. -* `ledger_hash`: (Optional, String) The identifying hash of the ledger version that was used when retrieving this data. -* `marker`: (Optional, Marker) Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. - -Each trust line object has some combination of the following fields: - -* `account`: (String) The unique Address of the counterparty to this trust line. -* `balance`: (String) Representation of the numeric balance currently held against this line. A positive balance means that the perspective account holds value; a negative balance means that the perspective account owes value. -* `currency`: (String) A Currency Code identifying what currency this trust line can hold. -* `limit`: (String) The maximum amount of the given currency that this account is willing to owe the peer account. -* `limit_peer`: (String) The maximum amount of currency that the counterparty account is willing to owe the perspective account. -* `quality_in`: (Unsigned Integer) Rate at which the account values incoming balances on this trust line, as a ratio of this value per 1 billion units. -* `quality_out`: (Unsigned Integer) Rate at which the account values outgoing balances on - -this trust line, as a ratio of this value per 1 billion units. - -* `no_ripple`: (Optional, Boolean) If true, this account has enabled the No Ripple flag for this trust line. -* `no_ripple_peer`: (Optional, Boolean) If true, the peer account has enabled the No Ripple flag for this trust line. -* `authorized`: (Optional, Boolean) If true, this account has authorized this trust line. -* `peer_authorized`: (Optional, Boolean) If true, the peer account has authorized this trust line. -* `freeze`: (Optional, Boolean) If true, this account has frozen this trust line. -* `freeze_peer`: (Optional, Boolean) If true, the peer account has frozen this trust line. - -### JSON-RPC Request Example - -```json -{ - "id": 1, - "command": "account_lines", - "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "ledger_index": "validated", - "peer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", - "limit": 10, - "marker": "example_marker" -} -``` - -### JSON-RPC Response Example - -```json -{ - "id": 1, - "status": "success", - "type": "response", - "result": { - "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "lines": [ - { - "account": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", - "balance": "0", - "currency": "ASP", - "limit": "0", - "limit_peer": "10", - "quality_in": 0, - "quality_out": 0 - }, - { - "account": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", - "balance": "0", - "currency": "XAU", - "limit": "0", - "limit_peer": "0", - "no_ripple": true, - "no_ripple_peer": true, - "quality_in": 0, - "quality_out": 0 - } - ], - "ledger_index": 1000000 - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_nfts.md b/v1.0/RPC Nodes/others/rpc-xrp/account_nfts.md deleted file mode 100644 index 32927d24..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/account_nfts.md +++ /dev/null @@ -1,102 +0,0 @@ ---- -title: "account_nfts" -slug: "rpc-xrp-account_nfts" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.accountNfts('rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx', { - ledger_index: 'validated', - limit: 100 -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `accountNfts` method returns a list of Non-Fungible Tokens (NFTs) objects for a specific account. This method is useful when you want to retrieve all the NFTs owned by a particular account. The method is available due to the NonFungibleTokensV1\_1 amendment. - -{% embed url="https://codepen.io/tatum-devrel/pen/NWEmLae" %} - -### Parameters - -#### Main Parameters - -* `account`: A unique identifier for the account, most commonly the account's Address. - -#### Optional Parameters (part of `options?: Ledger & Pagination` object) - -* `ledger_hash`: A 20-byte hex string for the ledger version to use. -* `ledger_index`: The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. -* `limit`: Limit the number of token pages to retrieve. Each page can contain up to 32 NFTs. The limit value cannot be lower than 20 or more than 400. The default is 100. -* `marker`: Value from a previous paginated response. Resume retrieving data where that response left off. - -### Return Object - -The returned object will be a successful result containing the account's address and an array of NFT objects. - -Here are the fields in the response: - -* `Flags`: This is a number that represents a bit-map of boolean flags enabled for this NFToken. This can provide additional information about the token, such as whether it's transferable, mintable, etc. The specific flags and their meanings can vary based on the implementation. -* `Issuer`: This is a string that represents the address of the account that issued this NFToken. It's the unique identifier of the account that created and originally owned this token. -* `NFTokenID`: This is a string that represents the unique identifier of this NFToken, in hexadecimal. This is typically a unique identifier that differentiates this token from all others on the ledger. -* `NFTokenTaxon`: This is a number that represents the unscrambled version of this token's taxon. Several tokens with the same taxon might represent instances of a limited series. This can be used to group similar tokens together. -* `URI`: This is a string that represents the URI data associated with this NFToken, in hexadecimal. This often points to a resource that has more information about the token, such as an image, audio file, or a webpage. -* `nft_serial`: This is a number that represents the token sequence number of this NFToken, which is unique for its issuer. This can be used to determine the order in which the tokens were created. - -### JSON-RPC Request Example - -```json -{ - "method": "account_nfts", - "params": [ - { - "account": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx", - "ledger_index": "validated", - "limit": 100 - } - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "account": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx", - "account_nfts": [ - { - "Flags": 1, - "Issuer": "rGJUF4PvVkMNxG6Bg6AKg3avhrtQyAffcm", - "NFTokenID": "00010000A7CAD27B688D14BA1A9FA5366554D6ADCF9CE0875B974D9F00000004", - "NFTokenTaxon": 0, - "URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469", - "nft_serial": 4 - }, - // More NFTs... - ], - "status": "success", - "validated": true - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_objects.md b/v1.0/RPC Nodes/others/rpc-xrp/account_objects.md deleted file mode 100644 index a66e43b1..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/account_objects.md +++ /dev/null @@ -1,177 +0,0 @@ ---- -title: "account_objects" -slug: "rpc-xrp-account_objects" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.accountObjects('r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', { - ledger_index: 'validated', - type: 'state', - deletion_blockers_only: false, - limit: 10 -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `accountObjects` method returns the raw ledger format for all objects owned by an account. This includes Offer objects for orders that are currently live, unfunded, or expired but not yet removed, RippleState objects for trust lines where this account's side is not in the default state, the account's SignerList, if the account has multi-signing enabled, Escrow objects for held payments that have not yet been executed or canceled, PayChannel objects for open payment channels, Check objects for pending Checks, DepositPreauth objects for deposit preauthorizations, Ticket objects for Tickets, and NFTokenPage objects for collections of NFTs. - -{% embed url="https://codepen.io/tatum-devrel/pen/bGQJxYQ" %} - -### Parameters - -#### Main Parameters - -* `account`: A unique identifier for the account, most commonly the account's Address. - -#### Optional Parameters (part of `options?: AccountObjectsOptions` object) - -* `deletion_blockers_only`: If true, the response only includes objects that would block this account from being deleted. The default is false. -* `ledger_hash`: A 20-byte hex string for the ledger version to use. -* `ledger_index`: The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. -* `limit`: The maximum number of objects to include in the results. Must be within the inclusive range 10 to 400 on non-admin connections. The default is 200. -* `marker`: Value from a previous paginated response. Resume retrieving data where that response left off. -* `type`: Filter results by a ledger entry type. The valid types are: check, deposit\_preauth, escrow, nft\_offer, offer, payment\_channel, signer\_list, state (trust line), and ticket. - -### Return Object - -The returned object will be a successful result containing the account's address and an array of objects owned by this account. - -Here are the fields in the response: - -* `account`: This is a string that represents the unique address of the account that this request corresponds to. -* `account_objects`: This is an array of objects owned by the account. Each object is in its raw ledger format. The specific fields in each object can vary depending on the type of the object. Common ledger object types include Offer, RippleState, AccountRoot, and others. -* `ledger_hash`: This is a string that may be omitted. It represents the identifying hash of the ledger that was used to generate this response. -* `ledger_index`: This is a number that may be omitted. It represents the ledger index of the ledger version that was used to generate this response. -* `ledger_current_index`: This is a number that may be omitted. It represents the ledger index of the current in-progress ledger version, which was used to generate this response. -* `limit`: This is a number that may be omitted. It represents the limit that was used in this request, if any. -* `marker`: This is a server-defined value indicating the response is paginated. You can pass this to the next call to resume where this call left off. It is omitted when there are no additional pages after this one. -* `validated`: This is a boolean. If included and set to true, the information in this response comes from a validated ledger version. Otherwise, the information is subject to change. - -### JSON-RPC Request Example - -```json -{ - "method": "account_objects", - "params": [ - { - "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "ledger_index": "validated", - "type": "state", - "deletion_blockers_only": false, - "limit": 10 - } - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "account_objects": [ - { - "Balance": { - "currency": "ASP", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "0" - }, - "Flags": 65536, - "HighLimit": { - "currency": "ASP", - "issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "value": "0" - }, - "HighNode": "0000000000000000", - "LedgerEntryType": "RippleState", - "LowLimit": { - "currency": "ASP", - "issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", - "value": "10" - }, - "LowNode": "0000000000000000", - "PreviousTxnID": "BF7555B0F018E3C5E2A3FF9437A1A5092F32903BE246202F988181B9CED0D862", - "PreviousTxnLgrSeq": 1438879, - "index": "2243B0B630EA6F7330B654EFA53E27A7609D9484E535AB11B7F946DF3D247CE9" - }, - { - "Balance": { - "currency": "XAU", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "0" - }, - "Flags": 3342336, - "HighLimit": { - "currency": "XAU", - "issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "value": "0" - }, - "HighNode": "0000000000000000", - "LedgerEntryType": "RippleState", - "LowLimit": { - "currency": "XAU", - "issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", - "value": "0" - }, - "LowNode": "0000000000000000", - "PreviousTxnID": "79B26D7D34B950AC2C2F91A299A6888FABB376DD76CFF79D56E805BF439F6942", - "PreviousTxnLgrSeq": 5982530, - "index": "9ED4406351B7A511A012A9B5E7FE4059FA2F7650621379C0013492C315E25B97" - }, - { - "Balance": { - "currency": "USD", - "issuer": "rrrrrrrrrrrrrrrrrrrrBZbvji", - "value": "0" - }, - "Flags": 1114112, - "HighLimit": { - "currency": "USD", - "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", - "value": "0" - }, - "HighNode": "0000000000000000", - "LedgerEntryType": "RippleState", - "LowLimit": { - "currency": "USD", - "issuer": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "value": "5" - }, - "LowNode": "0000000000000000", - "PreviousTxnID": "6FE8C824364FB1195BCFEDCB368DFEE3980F7F78D3BF4DC4174BB4C86CF8C5CE", - "PreviousTxnLgrSeq": 10555014, - "index": "2DECFAC23B77D5AEA6116C15F5C6D4669EBAEE9E7EE050A40FE2B1E47B6A9419" - } - ], - "ledger_hash": "4C99E5F63C0D0B1C2283B4F5DCE2239F80CE92E8B1A6AED1E110C198FC96E659", - "ledger_index": 14380380, - "limit": 10, - "marker": "F60ADF645E78B69857D2E4AEC8B7742FEABC8431BD8611D099B428C3E816DF93,94A9F05FEF9A153229E2E997E64919FD75AAE2028C8153E8EBDB4440BD3ECBB5", - "status": "success", - "validated": true - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_offers.md b/v1.0/RPC Nodes/others/rpc-xrp/account_offers.md deleted file mode 100644 index e753f829..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/account_offers.md +++ /dev/null @@ -1,122 +0,0 @@ ---- -title: "account_offers" -slug: "rpc-xrp-account_offers" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -// Initialize the SDK for the XRP network -const tatum = await TatumSDK.init({network: Network.XRP}) - -// Use the account_offers method -const res = await tatum.rpc.accountOffers('rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM', { - ledgerIndex: 'validated', -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `account_offers` method retrieves a list of offers made by a given account that are outstanding as of a particular ledger version. It is typically used for monitoring the open offers that a particular account has made on the XRP Ledger's decentralised exchange. - -{% embed url="https://codepen.io/tatum-devrel/pen/mdQgGpx" %} - -### Parameters - -The `account_offers` method accepts the following parameters: - -* `account`: A unique identifier for the account, most commonly the account's Address. -* `ledger_hash` (Optional): A 20-byte hex string identifying the ledger version to use. -* `ledger_index` (Optional): The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. -* `limit` (Optional): Limit the number of Offers to retrieve. The server may return fewer than this number of results. Must be within the inclusive range 10 to 400. The default is 200. -* `marker` (Optional): Value from a previous paginated response. Resume retrieving data where that response left off. -* `strict` (Optional): If true, then the account field only accepts a public key or XRP Ledger address. Otherwise, account can be a secret or passphrase (not recommended). The default is false. - -### Return Object - -The response follows the standard format, with a successful result containing the following fields: - -* `account`: Unique Address identifying the account that made the offers -* `offers`: Array of objects, where each object represents an offer made by this account that is outstanding as of the requested ledger version. -* `ledger_current_index` (Optional): The ledger index of the current in-progress ledger version, which was used when retrieving this data. -* `ledger_index` (Optional): The ledger index of the ledger version that was used when retrieving this data, as requested. -* `ledger_hash` (Optional): The identifying hash of the ledger version that was used when retrieving this data. -* `marker` (Optional): Server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. - -### JSON-RPC Request Example - -```json -{ - "method": "account_offers", - "params": [ - { - "account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM" - } - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "account": "rpP2JgiMyTF5jR5hLG3xHCPi1knBb1v9cM", - "ledger_current_index": 18539596, - "offers": [{ - "flags": 0, - "quality": "0.000000007599140009999998", - "seq": 6578020, - "taker_gets": "29740867287", - "taker_pays": { - "currency": "USD", - "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", - "value": "226.0050145327418" - } - }, { - "flags": 0, - "quality": "7989247009094510e-27", - "seq": 6572128, - "taker_gets": "2361918758", - "taker_pays": { - "currency": "XAU", - "issuer": "rrh7rf1gV2pXAoqA8oYbpHd8TKv5ZQeo67", - "value": "0.01886995237307572" - } - }, { - "flags": 0, - "quality": "0.00000004059594001318974", - "seq": 6576905, - "taker_gets": "3892952574", - "taker_pays": { - "currency": "CNY", - "issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y", - "value": "158.0380691682966" - } - }, - - ... - - ], - "status": "success", - "validated": false - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/account_tx.md b/v1.0/RPC Nodes/others/rpc-xrp/account_tx.md deleted file mode 100644 index 2abd58c4..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/account_tx.md +++ /dev/null @@ -1,236 +0,0 @@ ---- -title: "account_tx" -slug: "rpc-xrp-account_tx" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.accountTx('rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w', { - ledgerIndexMin: -1, - ledgerIndexMax: -1, - binary: false, - forward: false, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `account_tx` method is a part of the XRP Ledger's RPC API, allowing you to retrieve a list of transactions that involve a specified account. This method is useful when you need to track and analyze transactions related to a particular account, which can be necessary for various operations such as auditing, debugging or just for general monitoring purposes. - -{% embed url="https://codepen.io/tatum-devrel/pen/abQxaqm" %} - -### Parameters - -The `accountTx` method accepts the following parameters: - -* `account`: A unique identifier for the account, most commonly the account's address. -* `ledgerIndexMin`: (Optional) Use to specify the earliest ledger to include transactions from. A value of -1 instructs the server to use the earliest validated ledger version available. -* `ledgerIndexMax`: (Optional) Use to specify the most recent ledger to include transactions from. A value of -1 instructs the server to use the most recent validated ledger version available. -* `binary`: (Optional) Defaults to false. If set to true, returns transactions as hex strings instead of JSON. -* `forward`: (Optional) Defaults to false. If set to true, returns values indexed with the oldest ledger first. Otherwise, the results are indexed with the newest ledger first. - -### Return Object - -The response object includes the following fields: - -* `account`: Unique Address identifying the related account. -* `ledger_index_min`: The ledger index of the earliest ledger actually searched for transactions. -* `ledger_index_max`: The ledger index of the most recent ledger actually searched for transactions. -* `limit`: The limit value used in the request. -* `marker`: Server-defined value indicating the response is paginated. -* `transactions`: Array of transactions matching the request's criteria. -* `validated`: If included and set to true, the information in this response comes from a validated ledger version. - -Each transaction object includes the following fields: - -* `ledger_index`: The ledger index of the ledger version that included this transaction. -* `meta`: If binary is True, then this is a hex string of the transaction metadata. Otherwise, the transaction metadata is included in JSON format. -* `tx`: (JSON mode only) JSON object defining the transaction. -* `validated`: Whether or not the transaction is included in a validated ledger. - -### JSON-RPC Request Example - -```json -{ - "method": "account_tx", - "params": [ - { - "account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w", - "binary": false, - "forward": false, - "ledger_index_max": -1, - "ledger_index_min": -1, - "limit": 2 - } - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w", - "ledger_index_max": 57112019, - "ledger_index_min": 56248229, - "limit": 2, - "marker": { - "ledger": 57112007, - "seq": 13 - }, - "status": "success", - "transactions": [ - { - "meta": { - "AffectedNodes": [ - { - "ModifiedNode": { - "FinalFields": { - "Account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w", - "Balance": "3732290013101", - "Flags": 131072, - "OwnerCount": 0, - "Sequence": 702820 - }, - "LedgerEntryType": "AccountRoot", - "LedgerIndex": "140FA03FE8C39540CA8189BC7A7956795C712BC0A542C6409C041150703C8574", - "PreviousFields": { - "Balance": "3732745656171", - "Sequence": 702819 - }, - "PreviousTxnID": "7C031FD5B710E3C048EEF31254089BEEC505900BCC9A842257A0319453333998", - "PreviousTxnLgrSeq": 57112010 - } - }, - { - "ModifiedNode": { - "FinalFields": { - "Account": "raLPjTYeGezfdb6crXZzcC8RkLBEwbBHJ5", - "Balance": "4231510602153", - "Flags": 0, - "OwnerCount": 0, - "Sequence": 96486 - }, - "LedgerEntryType": "AccountRoot", - "LedgerIndex": "39DC5D448DECEFC3CD20818788E3DA891CA943935E8D7B12FCB5B5871FCB1638", - "PreviousFields": { - "Balance": "4231054959123" - }, - "PreviousTxnID": "33D2014C832610293730028CA37857AC183BFCE3E42B9979C491FB8B82B3E9DC", - "PreviousTxnLgrSeq": 57112004 - } - } - ], - "TransactionIndex": 12, - "TransactionResult": "tesSUCCESS", - "delivered_amount": "455643030" - }, - "tx": { - "Account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w", - "Amount": "455643030", - "Destination": "raLPjTYeGezfdb6crXZzcC8RkLBEwbBHJ5", - "DestinationTag": 18240312, - "Fee": "40", - "Flags": 2147483648, - "LastLedgerSequence": 57112037, - "Sequence": 702819, - "SigningPubKey": "020A46D8D02AC780C59853ACA309EAA92E7D8E02DD72A0B6AC315A7D18A6C3276A", - "TransactionType": "Payment", - "TxnSignature": "30450221008602B2E390C0C7B65182C6DBC86292052C1961B2BEFB79C2C8431722C0ADB911022024B74DCF910A4C8C95572CF662EB7F5FF67E1AC4D7B9B7BFE2A8EE851EC16576", - "date": 649200322, - "hash": "08EF5BDA2825D7A28099219621CDBECCDECB828FEA202DEB6C7ACD5222D36C2C", - "inLedger": 57112015, - "ledger_index": 57112015 - }, - "validated": true - }, - { - "meta": { - "AffectedNodes": [ - { - "ModifiedNode": { - "FinalFields": { - "Account": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w", - "Balance": "3732745656171", - "Flags": 131072, - "OwnerCount": 0, - "Sequence": 702819 - }, - "LedgerEntryType": "AccountRoot", - "LedgerIndex": "140FA03FE8C39540CA8189BC7A7956795C712BC0A542C6409C041150703C8574", - "PreviousFields": { - "Balance": "3732246155784" - }, - "PreviousTxnID": "CCBCCB528F602007C937C496F0828C118E073DF180084CCD3646EC1E414844E4", - "PreviousTxnLgrSeq": 57112007 - } - }, - { - "ModifiedNode": { - "FinalFields": { - "Account": "rw2ciyaNshpHe7bCHo4bRWq6pqqynnWKQg", - "Balance": "236476361", - "Flags": 131072, - "OwnerCount": 0, - "Sequence": 466335 - }, - "LedgerEntryType": "AccountRoot", - "LedgerIndex": "CC20FEBEA6D2AF969EC46F2BD92684D9FBABC3F238E841B5E056FE4EBF4379A9", - "PreviousFields": { - "Balance": "735976788", - "Sequence": 466334 - }, - "PreviousTxnID": "C528B32DD588EFAE2FE833E8AA92E6AE2DF2C8DB3DB8C6C4F334AD37B253D72A", - "PreviousTxnLgrSeq": 57112010 - } - } - ], - "TransactionIndex": 33, - "TransactionResult": "tesSUCCESS", - "delivered_amount": "499500387" - }, - "tx": { - "Account": "rw2ciyaNshpHe7bCHo4bRWq6pqqynnWKQg", - "Amount": "499500387", - "Destination": "rLNaPoKeeBjZe2qs6x52yVPZpZ8td4dc6w", - "DestinationTag": 1, - "Fee": "40", - "Flags": 2147483648, - "LastLedgerSequence": 57112032, - "Sequence": 466334, - "SigningPubKey": "0381575032E254BF4D699C3D8D6EFDB63B3A71F97475C6F6885BC7DAEEE55D9A01", - "TransactionType": "Payment", - "TxnSignature": "3045022100C7EA1701FE48C75508EEBADBC9864CD3FFEDCEB48AB99AEA960BFA360AE163ED0220453C9577502924C9E1A9A450D4B950A44016813BC70E1F16A65A402528D730B7", - "date": 649200302, - "hash": "7C031FD5B710E3C048EEF31254089BEEC505900BCC9A842257A0319453333998", - "inLedger": 57112010, - "ledger_index": 57112010 - }, - "validated": true - } - ], - "validated": true - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/book_offers.md b/v1.0/RPC Nodes/others/rpc-xrp/book_offers.md deleted file mode 100644 index 4f2ee07a..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/book_offers.md +++ /dev/null @@ -1,93 +0,0 @@ ---- -title: "book_offers" -slug: "rpc-xrp-book_offers" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -
// yarn add @tatumio/tatum
-
-import { TatumSDK, Xrp, Network } from '@tatumio/tatum'
-
-const tatum = await TatumSDK.init({network: Network.XRP})
-
-const takerGets = { currency: 'XRP' }
-const takerPays = { currency: 'USD', issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B' }
-
-const res = await tatum.rpc.bookOffers(takerGets, takerPays, { taker: 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', limit: 10 })
-
-await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs
-
- -### Overview - -The `book_offers` method is used to fetch a list of offers between two different currencies on the XRP Ledger. This method is crucial for trading and asset management applications as it provides an in-depth view of the market depth for a specific trading pair. - -{% embed url="https://codepen.io/tatum-devrel/pen/NWEmELX" %} - -### Parameters - -* `takerGets` (Object): The asset the account taking the offer would receive, as a currency without an amount. -* `takerPays` (Object): The asset the account taking the offer would pay, as a currency without an amount. -* `options` (BookOffersOptions): Optional parameters which includes ledger details, pagination, and the taker address. - -### Return Object - -The `book_offers` method returns an object that provides information about a list of offers in the order book. The object contains the following fields: - -* `ledger_current_index`: (Omitted if `ledger_index` is provided) A ledger index that represents the ledger index of the current in-progress ledger version, which was used to retrieve this information. -* `ledger_index`: (Omitted if `ledger_current_index` is provided) A ledger index that represents the ledger index of the ledger version that was used when retrieving this data, as requested. -* `ledger_hash`: (May be omitted) A hash that represents the identifying hash of the ledger version that was used when retrieving this data, as requested. -* `offers`: An array of offer objects, each of which has the fields of an Offer object. - -Each offer object in the `offers` array can include the following fields: - -* `owner_funds`: A string that represents the amount of the `TakerGets` currency the side placing the offer has available to be traded. (XRP is represented as drops; any other currency is represented as a decimal value.) If a trader has multiple offers in the same book, only the highest-ranked offer includes this field. -* `taker_gets_funded`: (Only included in partially-funded offers) A currency amount that represents the maximum amount of currency that the taker can get, given the funding status of the offer. -* `taker_pays_funded`: (Only included in partially-funded offers) A currency amount that represents the maximum amount of currency that the taker would pay, given the funding status of the offer. -* `quality`: A string that represents the exchange rate, as the ratio of `taker_pays` divided by `taker_gets`. For fairness, offers that have the same quality are automatically taken first-in, first-out. (In other words, if multiple people offer to exchange currency at the same rate, the oldest offer is taken first.) - -### JSON-RPC Request Example - -```json -{ - "method": "book_offers", - "params": [ - { - "taker": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "taker_gets": { - "currency": "XRP" - }, - "taker_pays": { - "currency": "USD", - "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B" - }, - "limit": 10 - } - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "ledger_current_index": 8696243, - "offers": [], - "status": "success", - "validated": false - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/channel_authorize.md b/v1.0/RPC Nodes/others/rpc-xrp/channel_authorize.md deleted file mode 100644 index 4341ad65..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/channel_authorize.md +++ /dev/null @@ -1,87 +0,0 @@ ---- -title: "channel_authorize" -slug: "rpc-xrp-channel_authorize" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network, Secrets } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.channelAuthorize( - '1000000', - '5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3', - { keyType: 'secp256k1', seed: 's████████████████████████████' } -) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `channel_authorize` method creates a signature that can be used to redeem a specific amount of XRP from a payment channel. This method was added by the PayChan amendment and is available starting from the `rippled` 0.33.0 version. - -This method can be used when an account wants to authorize a specific amount of XRP to be redeemed from a payment channel it has created. It generates a signature for a claim, which the receiving account can use to redeem a specific amount of XRP from the channel. - -### Parameters - -The `channel_authorize` method includes the following parameters: - -* `amount`: Cumulative amount of XRP, in drops, to authorize. If the destination has already received a lesser amount of XRP from this channel, the signature created by this method can be redeemed for the difference. -* `channelId`: The unique ID of the payment channel to use. -* `options`: (Optional) An object that includes secrets for signing the claim: - * `keyType`: (Optional) The signing algorithm of the cryptographic key pair provided. Valid types are `secp256k1` or `ed25519`. The default is `secp256k1`. - * `seed`: (Optional) The secret seed to use to sign the claim. This must be the same key pair as the public key specified in the channel. Must be in the XRP Ledger's base58 format. - -### Return Object - -The `channel_authorize` method returns a result object that includes: - -* `signature`: The signature for this claim, as a hexadecimal value. To process the claim, the destination account of the payment channel must send a PaymentChannelClaim transaction with this signature, the exact Channel ID, XRP amount, and public key of the channel. - -### JSON-RPC Request Example - -```json -{ - "method": "channel_authorize", - "params": [ - { - "channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3", - "seed": "s████████████████████████████", - "key_type": "secp256k1", - "amount": "1000000", - } - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "id": "channel_authorize_example_id1", - "status": "success", - "result": { - "signature": "304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800 - -BBC43746F34AF50290064", - } -} -``` - -> **Warning:** Do not send secret keys to untrusted servers or through unsecured network connections. (This includes the secret, seed, seed\_hex, or passphrase fields of this request.) You should only use this method on a secure, encrypted network connection to a server you run or fully trust with your funds. Otherwise, eavesdroppers could use your secret key to sign claims and take all the money from this payment channel and anything else using the same key pair. See Set Up Secure Signing for instructions. diff --git a/v1.0/RPC Nodes/others/rpc-xrp/channel_verify.md b/v1.0/RPC Nodes/others/rpc-xrp/channel_verify.md deleted file mode 100644 index b83f5f6d..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/channel_verify.md +++ /dev/null @@ -1,84 +0,0 @@ ---- -title: "channel_verify" -slug: "rpc-xrp-channel_verify" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.channelVerify( - '1000000', - '5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3', - 'aB44YfzW24VDEJQ2UuLPV2PvqcPCSoLnL7y5M1EzhdW4LnK5xMS3', - '304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF50290064' -) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `channel_verify` method is used to check the validity of a signature that can be used to redeem a specific amount of XRP from a payment channel. This method was added by the PayChan amendment and is available starting from the `rippled` 0.33.0 version. - -The main use case of this method is to confirm the validity of a claim before attempting to redeem it. This is especially useful for payment channel recipients who want to ensure they are receiving valid claims. - -### Parameters - -The `channel_verify` method includes the following parameters: - -* `amount`: The amount of XRP, in drops, the provided signature authorizes. -* `channelId`: The Channel ID of the channel that provides the XRP. This is a 64-character hexadecimal string. -* `publicKey`: The public key of the channel and the key pair that was used to create the signature, in hexadecimal or the XRP Ledger's base58 format. -* `signature`: The signature to verify, in hexadecimal. - -### Return Object - -The `channel_verify` method returns a result object that includes: - -* `signature_verified`: If true, the signature is valid for the stated amount, channel, and public key. - -> **Caution:** This does not indicate check that the channel has enough XRP allocated to it. Before considering a claim valid, you should look up the channel in the latest validated ledger and confirm that the channel is open and its amount value is equal or greater than the amount of the claim. To do so, use the `account_channels` method. - -### JSON-RPC Request Example - -```json -{ - "method": "channel_verify", - "params": [{ - "channel_id": "5DB01B7FFED6B67E6B0414DED11E051D2EE2B7619CE0EAA6286D67A3A4D5BDB3", - "signature": "304402204EF0AFB78AC23ED1C472E74F4299C0C21F1B21D07EFC0A3838A420F76D783A400220154FB11B6F54320666E4C36CA7F686C16A3A0456800BBC43746F34AF50290064", - "public_key": "aB44YfzW24VDEJQ2U - -uLPV2PvqcPCSoLnL7y5M1EzhdW4LnK5xMS3", - "amount": "1000000" - }] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "signature_verified":true, - "status":"success" - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/deposit_authorized.md b/v1.0/RPC Nodes/others/rpc-xrp/deposit_authorized.md deleted file mode 100644 index 869bfa7e..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/deposit_authorized.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: "deposit_authorized" -slug: "rpc-xrp-deposit_authorized" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const sourceAccount = 'rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de' -const destinationAccount = 'rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8' - -const res = await tatum.rpc.depositAuthorized(sourceAccount, destinationAccount, { ledgerIndex: 'validated' }) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `deposit_authorized` method is used to verify if a specific account is authorized to send payments to another account. This feature becomes particularly useful in scenarios where accounts have deposit authorization enabled, which is a setting that requires accounts to be preauthorized before they can send payments. - -### Parameters - -* `sourceAccount` (String): The sender of a possible payment. -* `destinationAccount` (String): The recipient of a possible payment. -* `options` (Ledger): Optional parameter that includes details about the ledger to use. - -### Return Object - -The `deposit_authorized` method returns an object that provides information about whether the specified source account is authorized to send payments directly to the destination account. The object contains the following fields: - -* `deposit_authorized`: A boolean indicating whether the specified source account is authorized to send payments directly to the destination account. If true, either the destination account does not require Deposit Authorization or the source account is preauthorized. -* `destination_account`: A string that represents the destination account specified in the request. -* `ledger_hash`: (May be omitted) A string that represents the identifying hash of the ledger that was used to generate this response. -* `ledger_index`: (May be omitted) A number that represents the ledger index of the ledger version that was used to generate this response. -* `ledger_current_index`: (May be omitted) A number that represents the ledger index of the current in-progress ledger version, which was used to generate this response. -* `source_account`: A string that represents the source account specified in the request. -* `validated`: (May be omitted) A boolean indicating whether the information comes from a validated ledger version. If true, the information comes from a validated ledger version. - -### JSON-RPC Request Example - -```json -{ - "method": "deposit_authorized", - "params": [ - { - "source_account": "rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de", - "destination_account": "rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8", - "ledger_index": "validated" - } - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "deposit_authorized": true, - "destination_account": "rsUiUMpnrgxQp24dJYZDhmV4bE3aBtQyt8", - "ledger_hash": "BD03A10653ED9D77DCA859B7A735BF0580088A8F287FA2C5403E0A19C58EF322", - "ledger_index": 8, - "source_account": "rEhxGqkqPPSxQ3P25J66ft5TwpzV14k2de", - "status": "success", - "validated": true - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/fee.md b/v1.0/RPC Nodes/others/rpc-xrp/fee.md deleted file mode 100644 index 7f1be6da..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/fee.md +++ /dev/null @@ -1,99 +0,0 @@ ---- -title: "fee" -slug: "rpc-xrp-fee" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.fee() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `fee` method reports the current state of the open-ledger requirements for the transaction cost. This method requires the FeeEscalation amendment to be enabled. It was introduced in `rippled` version 0.31.0 and updated for public use in version 0.32.0. - -The `fee` method is useful for gaining insight into the current transaction costs and the state of the ledger and transaction queue. It can be used by unprivileged users to understand the fees associated with transactions at a particular point in time. - -{% embed url="https://codepen.io/tatum-devrel/pen/RwqOqdK" %} - -### Parameters - -The `fee` method does not take any parameters. - -### Return Object - -The `fee` method returns an object with the following fields: - -* `current_ledger_size`: Number of transactions provisionally included in the in-progress ledger. -* `current_queue_size`: Number of transactions currently queued for the next ledger. -* `drops`: Object with various information about the transaction cost, in drops of XRP. - * `base_fee`: The transaction cost required for a reference transaction to be included in a ledger under minimum load, represented in drops of XRP. - * `median_fee`: An approximation of the median transaction cost among transactions included in the previous validated ledger, represented in drops of XRP. - * `minimum_fee`: The minimum transaction cost for a reference transaction to be queued for a later ledger, represented in drops of XRP. - * `open_ledger_fee`: The minimum transaction cost that a reference transaction must pay to be included in the current open ledger, represented in drops of XRP. -* `expected_ledger_size`: The approximate number of transactions expected to be included in the current ledger. -* `ledger_current_index`: The Ledger Index of the current open ledger these stats describe. -* `levels`: Object with various information about the transaction cost, in fee levels. - * `median_level`: The median transaction cost among transactions in the previous validated ledger, represented in fee levels. - * `minimum_level`: The minimum transaction cost required to be queued for a future ledger, represented in fee levels. - * `open_ledger_level`: The minimum transaction cost required to be included in the current open ledger, represented in fee levels. - * `reference_level`: The equivalent of the minimum transaction cost, represented in fee levels. -* `max_queue_size`: The maximum number of transactions that the transaction queue can currently hold. - -### JSON-RPC Request Example - -```json -{ - "method": "fee", - "params": [{}] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "current_ledger_size": "56", - "current_queue_size": "11", - "drops": { - "base_fee": "10", - "median_fee": "10000", - "minimum_fee": "10", - "open_ledger_fee": "2653937" - }, - "expected_ledger_size": "55", - "ledger_current_index": 26575101, - "levels": { - "median_level": "256000", - "minimum_level": "256", - "open_ledger_level": "67940792", - "reference_level": "256" - }, - "max_queue_size": "1100", - "status": "success" - } - - -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/ledger.md b/v1.0/RPC Nodes/others/rpc-xrp/ledger.md deleted file mode 100644 index 02a72bee..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/ledger.md +++ /dev/null @@ -1,143 +0,0 @@ ---- -title: "ledger" -slug: "rpc-xrp-ledger" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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] - -{% hint style="warning" %} -XRP only maintains history from ledger 32570, for more info see [onxrp.com/missing-genesis-block-xrpl/](https://onxrp.com/missing-genesis-block-xrpl/) -{% endhint %} - -### How to use it - -```javascript -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.ledger({ - ledgerIndex: 'validated', - full: false, - accounts: false, - transactions: false, - expand: false, - ownerFunds: false, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `ledger` RPC method is used to retrieve information about the public ledger in XRP. You can specify various options to customize the returned information, such as the ledger version, whether to include full information on the entire ledger, the ledger's entire state data, information on transactions in the specified ledger version, and so on. - -Use cases for this method include retrieving information about a specific ledger, examining the transactions that have occurred in a specific ledger version, examining the state data of a ledger, and more. - -{% embed url="https://codepen.io/tatum-devrel/pen/GRwLXGG?editors=1111" %} - -### Parameters - -The `ledger` method takes an optional `LedgerOptions` object. This object can contain the following fields: - -* `full` (boolean): If true, return full information on the entire ledger. -* `accounts` (boolean): If true, return the ledger's entire state data. -* `transactions` (boolean): If true, return information on transactions in the specified ledger version. -* `expand` (boolean): Provide full JSON-formatted information for transaction/account information instead of only hashes. -* `ownerFunds` (boolean): If true, include owner\_funds field in the metadata of OfferCreate transactions in the response. -* `binary` (boolean): If true, return the requested ledger object's contents as a hex string in the XRP Ledger's binary format. - -### Return Object - -The method returns a promise that resolves to an `XrpResult` object. This object contains information about the ledger, including the following fields: - -* `ledger.account_hash`: A string representing the hash of all account state information in this ledger, as hexadecimal. -* `ledger.accountState`: An array of all the account-state information in this ledger. This field is omitted unless explicitly requested. -* `ledger.close_flags`: An integer representing a bitmap of flags relating to the closing of this ledger. -* `ledger.close_time`: An integer representing the time this ledger was closed, in seconds since the Ripple Epoch. -* `ledger.close_time_human`: A string representing the time this ledger was closed, in human-readable format. Always uses the UTC time zone. -* `ledger.close_time_resolution`: An integer representing how ledger close times are rounded. Ledger close times are rounded to within this many seconds. -* `ledger.closed`: A boolean indicating whether or not this ledger has been closed. -* `ledger.ledger_hash`: A string representing the unique identifying hash of the entire ledger. -* `ledger.ledger_index`: A string representing the Ledger Index of this ledger, as a quoted integer. -* `ledger.parent_close_time`: An integer representing the time at which the previous ledger was closed. -* `ledger.parent_hash`: A string representing the unique identifying hash of the ledger that came immediately before this one. -* `ledger.total_coins`: A string representing the total number of XRP drops in the network, as a quoted integer. This decreases as transaction costs destroy XRP. -* `ledger.transaction_hash`: A string representing the hash of the transaction information included in this ledger, as hexadecimal. -* `ledger.transactions`: An array of transactions applied in this ledger version. By default, members are the transactions' identifying Hash strings. If the request specified `expand` as true, members are full representations of the transactions instead, in either JSON or binary depending on whether the request specified binary as true. - -Within the `queue_data` object, which is an array of objects describing queued transactions, you can find the following fields: - -* `account`: The Address of the sender for this queued transaction. -* `tx`: By default, this is a string containing the identifying hash of the transaction. If transactions are expanded in binary format, this is an object whose only field is `tx_blob`, containing the binary form of the transaction as a decimal string. If transactions are expanded in JSON format, this is an object containing the transaction object including the transaction's identifying hash in the `hash` field. -* `retries_remaining`: The number of times this transaction can be retried before being dropped. -* `preflight_result`: The tentative result from preliminary transaction checking. This is always `tesSUCCESS`. -* `last_result`: If this transaction was left in the queue after getting a retriable (ter) result, this is the exact ter result code it got. This field may be omitted. -* `auth_change`: Indicates whether this transaction changes this address's ways of authorizing transactions. This field may be omitted. -* `fee`: The Transaction Cost of this transaction, in drops of XRP. This field may be omitted. -* `fee_level`: The transaction cost of this transaction, relative to the minimum cost for this type of transaction, in fee levels. This field may be omitted. -* `max_spend_drops`: The maximum amount of XRP, in drops, this transaction could potentially send or destroy. This field may be omitted. - - - -### JSON-RPC Request Example - -Here is an example of a JSON-RPC request using the `ledger` method: - -```json -{ - "method": "ledger", - "params": [ - { - "ledger_index": "validated", - "accounts": false, - "full": false, - "transactions": false, - "expand": false, - "owner_funds": false - } - ] -} -``` - -### JSON-RPC Response Example - -Here is an example of a successful JSON-RPC response: - -```json -{ - "result": { - "ledger": { - "accepted": true, - "account_hash": "B258A8BB4743FB74CBBD6E9F67E4A56C4432EA09E5805E4CC2DA26F2DBE8F3D1", - "close_flags": 0, - "close_time": 638329271, - "close_time_human": "2020-Mar-24 01:41:11.000000000 UTC", - "close_time_resolution": 10, - "closed": true, - "hash": "3652D7FD0576BC452C0D2E9B747BDD733075971D1A9A1D98125055DEF428721A", - "ledger_hash": "3652D7FD0576BC452C0D2E9B747BDD733075971D1A9A1D98125055DEF428721A", - "ledger_index": "54300940", - "parent_close_time": 638329270, - "parent_hash": "AE996778246BC81F85D5AF051241DAA577C23BCA04C034A7074F93700194520D", - "seqNum": "54300940", - "totalCoins": "99991024049618156", - "total_coins": "99991024049618156", - "transaction_hash": "FC6FFCB71B2527DDD630EE5409D38913B4D4C026AA6C3B14A3E9D4ED45CFE30D" - }, - "ledger_hash": "3652D7FD0576BC452C0D2E9B747BDD733075971D1A9A1D98125055DEF428721A", - "ledger_index": 54300940, - "status": "success", - "validated": true - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/ledger_closed.md b/v1.0/RPC Nodes/others/rpc-xrp/ledger_closed.md deleted file mode 100644 index d4b59df2..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/ledger_closed.md +++ /dev/null @@ -1,75 +0,0 @@ ---- -title: "ledger_closed" -slug: "rpc-xrp-ledger_closed" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.ledgerClosed() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `ledger_closed` method is used to fetch the unique identifiers of the most recently closed ledger. Note that the ledger might not be validated and immutable yet, so use this method when you need information about the latest ledger and not necessarily the final state. - -{% embed url="https://codepen.io/tatum-devrel/pen/MWzRPbb" %} - -### Parameters - -This method does not require any parameters. - -### Return Object - -The `ledger_closed` method returns an object with the following fields: - -* `ledger_hash` (String): The unique hash of this ledger version, in hexadecimal. -* `ledger_index` (Unsigned Integer): The ledger index of this ledger version. - -### JSON-RPC Request Example - -Here's an example of the `ledger_closed` method request: - -```json -{ - "id": 2, - "command": "ledger_closed" -} -``` - -### JSON-RPC Response Example - -Here's an example of a successful response: - -```json -{ - "id": 1, - "status": "success", - "type": "response", - "result": { - "ledger_hash": "17ACB57A0F73B5160713E81FE72B2AC9F6064541004E272BD09F257D57C30C02", - "ledger_index": 6643099 - } -} -``` - -In this response, `ledger_hash` is the unique identifier of the ledger, and `ledger_index` is the index number of this ledger version. diff --git a/v1.0/RPC Nodes/others/rpc-xrp/ledger_data.md b/v1.0/RPC Nodes/others/rpc-xrp/ledger_data.md deleted file mode 100644 index 2683a21b..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/ledger_data.md +++ /dev/null @@ -1,119 +0,0 @@ ---- -title: "ledger_data" -slug: "rpc-xrp-ledger_data" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.ledgerData({ - ledger_hash: "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8", - limit: 5, - binary: true -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `ledger_data` method retrieves the contents of the specified ledger. You can iterate through several calls to retrieve the entire contents of a single ledger version. - -{% embed url="https://codepen.io/tatum-devrel/pen/eYQoPWW" %} - -### Parameters - -The `ledger_data` method takes the following parameters: - -* `ledger_hash` (Hash): A 20-byte hex string identifying the ledger version to use. (Optional) -* `ledger_index` (Ledger Index): The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. (Optional) -* `binary` (Boolean): If true, return ledger entries as hexadecimal strings instead of JSON. The default is false. (Optional) -* `limit` (Number): Limit the number of ledger entries to retrieve. The server may return fewer than this number of entries. Cannot be more than 2048 (when requesting binary) or 256 (when requesting JSON). The default is the maximum. (Optional) -* `marker` (Marker): Value from a previous paginated response. Resume retrieving data where that response left off. (Optional) -* `type` (String): Filter results to a specific type of ledger entry. Valid types include account, amendments, amm, check, deposit\_preauth, directory, escrow, fee, hashes, nft\_offer, offer, payment\_channel, signer\_list, state (trust line), and ticket. (Optional) - -### Return Object - -The `ledger_data` response provides information about the state tree of a specific ledger version. It follows the standard format and a successful result contains the following fields: - -* `ledger_index`: An unsigned integer representing the ledger index of this ledger version. -* `ledger_hash`: A string representing the unique identifying hash of this ledger version. -* `state`: An array of JSON objects containing data from the ledger's state tree. The format of these objects will depend on whether binary was set to true in the request. -* `marker`: A server-defined value indicating the response is paginated. This can be passed to the next call to resume where this call left off. - -If a type field is mentioned in the request, the state array will be empty if the first set of array objects does not match the type requested. In such cases, the marker from this response can be used to paginate and retrieve further data. - -Each object in the `state` array may include the following fields: - -* `data`: A string representing the hex representation of the requested data. This field is included only if "binary" was set to true in the request. -* `LedgerEntryType`: A string indicating what type of ledger object this object represents. This field is included only if "binary" was set to false in the request. -* Additional fields describing the object, depending on which ledger object type it is. These fields are included only if "binary" was set to false in the request. -* `index`: A string representing the unique identifier for this ledger entry, in hexadecimal format. - -### JSON-RPC Request Example - -Here's an example of the `ledger_data` method request: - -```json -{ - "id": 2, - "ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8", - "command": "ledger_data", - "limit": 5, - "binary": true -} -``` - -### JSON-RPC Response Example - -Here's an example of a successful response: - -```json -{ - "result": { - "ledger_hash": "842B57C1CC0613299A686D3E9F310EC0422C84D3911E5056389AA7E5808A93C8", - "ledger_index": "6885842", - "marker": "0002A590029B53BE7857EFF9985F770EC792CE483720EB5E963C4D6A607D43DF", - "state": [ - { - "data": "11006122000000002400000001250062FEA42D0000000055C204A65CF2542946289A3358C67D991B5E135FABFA89F271DBA7A150C08CA0466240000000354540208114C909F42250CFE8F12A7A1A0DFBD3CBD20F32CD79", - "index": "00001A2969BE1FC85F1D7A55282FA2E6D95C71D2E4B9C0FDD3D9994F3C00FF8F" - }, - { - "data": "11006F22000000002400000003250035788533000000000000000034000000000000000055555B93628BF3EC318892BB7C7CDCB6732FF53D12B6EEC4FAF60DD1AEE1C6101F501071633D7DE1B6AEB32F87F1A73258B13FC8CC32942D53A66D4F038D7EA4C6800064D4838D7EA4C68000000000000000000000000000425443000000000035DD7DF146893456296BF4061FBE68735D28F3286540000000000F42408114A4B8F5F7B644AEDC3447F9459C132EEB016A133B", - "index": "000037C6659BB98F8D09F2F4CFEB27DE8EFEAFE54DD9E1C13AECDF5794B0C0F5" - }, - { - "data": "11006F2200020000240000000A250067395C33000000000000000034000000000000000055A160BC41A45B6BB118DF23D77E4FF23C723431B917F50DCB41319ECC2821F34C5010DFA3B6DDAB58C7E8E5D944E736DA4B7046C30E4F460FD9DE4C1AA535D3D0C00064D554C88B43EFA00000000000000000000000000055534400000000000A20B3C85F482532A9578DBB3950B85CA06594D165400000B59B9F780081148366FB9ACD2A0FD822E31112D2EB6F98C317C2C1", - "index": "0000A8791F78CC9B39200E12A9BDAACCF40A72A512FA815525CFC9BA772990F7" - }, - { - "data": "1100612200000000240000000125003E742F2D0000000055286498B513710CFEB2D723A554C7557983D1952DF4DEE342C40DCB43067C9A21624000000306DC42008114225BAB89C4A4B94624BB069D6DB3C819F934991C", - "index": "0000B717320558E2DE1A3B9FDB24E9A695BF05D1A44E4A4683212BB1DD0FBA23" - }, - { - "data": "110072220002000025000B65783700000000000000003800000000000000005587591A63051645F37B85D1FBA55EE69B1C96BFF16904F5C99F03FB93D42D03756280000000000000000000000000000000000000004254430000000000000000000000000000000000000000000000000166800000000000000000000000000000000000000042544300000000000A20B3C85F482532A9578DBB3950B85CA06594D167D4C38D7EA4C680000000000000000000000000004254430000000000C795FDF8A637BCAAEDAD1C434033506236C82A2D", - "index": "000103996A3BAD918657F86E12A67D693E8FC8A814DA4B958A244B5F14D93E58" - } - ], - "status": "success" - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/ledger_entry.md b/v1.0/RPC Nodes/others/rpc-xrp/ledger_entry.md deleted file mode 100644 index 67f78e1d..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/ledger_entry.md +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: "ledger_entry" -slug: "rpc-xrp-ledger_entry" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.ledgerEntry({ - ledgerIndex: 'validated', - index: '7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4' -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -In this example, we're initializing the SDK for the XRP network and calling the `ledgerEntry` method with a specific ledger index and object ID. - -### Overview - -The `ledgerEntry` method of Tatum SDK facilitates interaction with the XRP Ledger. This method allows you to retrieve a single ledger object from the XRP Ledger in its raw format. It is a powerful and flexible tool with numerous use-cases such as obtaining account details, checking the state of an offer, retrieving trust lines, and much more. - -This method is comprehensive and can retrieve several different types of data. The specific type of item you wish to retrieve can be selected by passing the appropriate parameters. - -{% embed url="https://codepen.io/tatum-devrel/pen/QWJPZmE" %} - -### Parameters - -The `ledgerEntry` method accepts a parameter of `LedgerEntryOptions` type, which may contain the following fields: - -* `index`: the object ID of a single object to retrieve from the ledger, as a 64-character (256-bit) hexadecimal string. -* `accountRoot`: the classic address of the AccountRoot object to retrieve. -* `directory`: the object ID of the directory or an object requiring either `dir_root` or `owner` as a sub-field, plus optionally a `sub_index` sub-field. -* `offer`: the unique object ID to the Offer or an object requiring the sub-fields `account` and `seq` to uniquely identify the offer. -* `rippleState`: an object specifying the RippleState (trust line) object to retrieve, with the `accounts` and `currency` sub-fields required. -* `check`: the object ID of a Check object to retrieve. -* `escrow`: the object ID of the Escrow or an object requiring `owner` and `seq` sub-fields. -* `paymentChannel`: the object ID of a PayChannel object to retrieve. -* `depositPreauth`: the object ID of the DepositPreauth object or an object requiring `owner` and `authorized` sub-fields. -* `ticket`: the object ID of the Ticket or an object requiring `account` and `ticket_seq` sub-fields. -* `nftPage`: the object ID of an NFT Page to retrieve. - -### Return Object - -The `ledger_entry` response provides information about a specific ledger object and follows the standard format. A successful result contains the following fields: - -* `index`: A string representing the unique ID of the ledger object. -* `ledger_index`: An unsigned integer representing the ledger index of the ledger that was used when retrieving this data. -* `node`: An object containing the data of the ledger object, according to the ledger format. This field is omitted if the "binary": true parameter is specified. -* `node_binary`: A string representing the binary representation of the ledger object in hexadecimal format. This field is included only if the "binary": true parameter is specified. - -### JSON-RPC Request Example - -```json -{ - "method": "ledger_entry", - "params": [ - { - "index": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4", - "ledger_index": "validated" - } - ] -} -``` - -In this example, we're requesting a ledger entry for a particular object ID and using the 'validated' ledger index. - -### JSON-RPC Response Example - -```json -{ - "result": { - "ledger_index": 464, - "nft_page": "7DB0788C020F02780A673DC74757F23823FA3014C1866E72CC4CD8B226CD6EF4", - "ledger_index": "validated" - }] -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/manifest.md b/v1.0/RPC Nodes/others/rpc-xrp/manifest.md deleted file mode 100644 index 7279b3a8..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/manifest.md +++ /dev/null @@ -1,85 +0,0 @@ ---- -title: "manifest" -slug: "rpc-xrp-manifest" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.manifest('nHUFE9prPXPrHcG3SkwP1UzAQbSphqyQkQK9ATXLZsfkezhhda3p') - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `manifest` method is a specialized RPC method provided by the Ripple (XRP) blockchain to report the current "manifest" information for a given validator's public key. The "manifest" is a block of data that authorizes an ephemeral signing key with a signature from the validator's master key pair. - -This method is particularly useful in scenarios where one needs to verify the authenticity of a validator. It could also be used to gather information about a validator's association with a domain, its ephemeral and master keys, and the sequence number of its manifest. - -{% embed url="https://codepen.io/tatum-devrel/pen/PoxgXRB" %} - -### Parameters - -The `manifest` method accepts a single parameter: - -* `publicKey`: The base58-encoded public key of the validator to look up. This can be the master public key or ephemeral public key. - -### Return Object - -The `manifest` method returns an object with the following fields: - -* `details`: An object containing detailed information about the manifest. This field is omitted if the server does not have a manifest for the `public_key` from the request. The details object has the following fields: - * `domain`: The domain name this validator claims to be associated with. If the manifest does not contain a domain, this is an empty string. - * `ephemeral_key`: The ephemeral public key for this validator, in base58. - * `master_key`: The master public key for this validator, in base58. - * `seq`: The sequence number of this manifest. This number increases whenever the validator operator updates the validator's token to rotate ephemeral keys or change settings. -* `manifest`: The full manifest data in base64 format. This data is serialized to binary before being base64-encoded. This field is omitted if the server does not have a manifest for the `public_key` from the request. -* `requested`: The `public_key` from the request. -* `status`: The status of the request, typically "success". - -### JSON-RPC Request Example - -```json -{ - "method": "manifest", - "params": [{ - "public_key":"nHUFE9prPXPrHcG3SkwP1UzAQbSphqyQkQK9ATXLZsfkezhhda3p" - }] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "details": { - "domain": "", - "ephemeral_key": "n9J67zk4B7GpbQV5jRQntbgdKf7TW6894QuG7qq1rE5gvjCu6snA", - "master_key": "nHUFE9prPXPrHcG3SkwP1UzAQbSphqyQkQK9ATXLZsfkezhhda3p", - "seq": 1 - }, - "manifest": "JAAAAAFxIe3AkJgOyqs3y+UuiAI27Ff3Mrfbt8e7mjdo06bnGEp5XnMhAhRmvCZmWZXlwShVE9qXs2AVCvhVuA/WGYkTX/vVGBGwdkYwRAIgGnYpIGufURojN2cTXakAM7Vwa0GR7o3osdVlZShroXQCIH9R/Lx1v9rdb4YY2n5nrxdnhSSof3U6V/wIHJmeao5ucBJA9D1iAMo7YFCpb245N3Czc0L1R2Xac0YwQ6XdGT+cZ7yw2n8JbdC3hH8Xu9OUqc867Ee6JmlXtyDHzBdY/hdJCQ==", - "requested": "nHUFE9prPXPrHcG3SkwP1UzAQbSphqyQkQK9ATXLZsfkezhhda3p", - "status": "success" - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/nft_buy_offers.md b/v1.0/RPC Nodes/others/rpc-xrp/nft_buy_offers.md deleted file mode 100644 index 852300b3..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/nft_buy_offers.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: "nft_buy_offers" -slug: "rpc-xrp-nft_buy_offers" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const nftId = '00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007' - -const res = await tatum.rpc.nftBuyOffers(nftId, { ledgerIndex: 'validated', limit: 250 }) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `nft_buy_offers` method is used to get a list of active buy offers for a specific NFToken. This allows users to track and analyze offers for a particular token and make informed decisions based on the market demand. - -{% embed url="https://codepen.io/tatum-devrel/pen/Poxgxyj" %} - -### Parameters - -* `nftId` (String): The unique identifier of a NFToken object. -* `options` (Ledger & Pagination): Optional parameter that includes details about the ledger to use and pagination options. - -### Return Object - -The `nft_buy_offers` method returns an object that provides information about the buy offers for a specific non-fungible token (NFT). The object contains the following fields: - -* `nft_id`: A string that represents the NFT these offers are for, as specified in the request. -* `offers`: An array that contains a list of buy offers for the token. Each member of this array represents one NFTokenOffer object to buy the NFT in question and has the following fields: - * `amount`: A string or an object that represents the amount offered to buy the NFT for. This could be a string representing an amount in drops of XRP, or an object representing an amount of a fungible token. - * `flags`: A number that represents a set of bit-flags for this offer. See NFTokenOffer flags for possible values. - * `nft_offer_index`: A string that represents the ledger object ID of this offer. - * `owner`: A string that represents the account that placed this offer. -* `limit`: (May be omitted) A number that represents the limit, as specified in the request. -* `marker`: (May be omitted) A server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. This field is omitted when there are no pages of information after this one. - -### JSON-RPC Request Example - -```json -{ - "method": "nft_buy_offers", - "params": [{ - "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007", - "ledger_index": "validated" - }] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007", - "offers": [ - { - "amount": "1500", - "flags": 0, - "nft_offer_index": "3212D26DB00031889D4EF7D9129BB0FA673B5B40B1759564486C0F0946BA203F", - "owner": "rsuHaTvJh1bDmDoxX9QcKP7HEBSBt4XsHx" - } - ], - "status": "success" - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/nft_sell_offers.md b/v1.0/RPC Nodes/others/rpc-xrp/nft_sell_offers.md deleted file mode 100644 index c0a5d9f2..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/nft_sell_offers.md +++ /dev/null @@ -1,86 +0,0 @@ ---- -title: "nft_sell_offers" -slug: "rpc-xrp-nft_sell_offers" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const nftId = '00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007' - -const res = await tatum.rpc.nftSellOffers(nftId, { ledgerIndex: 'validated', limit: 250 }) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `nft_sell_offers` method is used to get a list of active sell offers for a specific NFToken. This allows users to track and analyze offers for a particular token and make informed decisions based on the market demand. - -{% embed url="https://codepen.io/tatum-devrel/pen/QWJPJZr" %} - -### Parameters - -* `nftId` (String): The unique identifier of a NFToken object. -* `options` (Ledger & Pagination): Optional parameter that includes details about the ledger to use and pagination options. - -### Return Object - -\ -The `nft_sell_offers` method returns an object that provides information about the sell offers for a specific non-fungible token (NFT). The object contains the following fields: - -* `nft_id`: A string that represents the NFT these offers are for, as specified in the request. -* `offers`: An array that contains a list of sell offers for the token. Each member of this array represents one NFTokenOffer object to sell the NFT in question and has the following fields: - * `amount`: A string or an object that represents the amount offered to sell the NFT for. This could be a string representing an amount in drops of XRP, or an object representing an amount of a fungible token. - * `flags`: A number that represents a set of bit-flags for this offer. See NFTokenOffer flags for possible values. - * `nft_offer_index`: A string that represents the ledger object ID of this offer. - * `owner`: A string that represents the account that placed this offer. -* `limit`: (May be omitted) A number that represents the limit, as specified in the request. -* `marker`: (May be omitted) A server-defined value indicating the response is paginated. Pass this to the next call to resume where this call left off. This field is omitted when there are no pages of information after this one. - -### JSON-RPC Request Example - -```json -{ - "method": "nft_sell_offers", - "params": [{ - "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007" - }] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "nft_id": "00090000D0B007439B080E9B05BF62403911301A7B1F0CFAA048C0A200000007", - "offers": [ - { - "amount": "1000", - "flags": 1, - "nft_offer_index": "9E28E366573187F8E5B85CE301F229E061A619EE5A589EF740088F8843BF10A1", - "owner": "rLpSRZ1E8JHyNDZeHYsQs1R5cwDCB3uuZt" - } - ], - "status": "success" - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/noripple_check.md b/v1.0/RPC Nodes/others/rpc-xrp/noripple_check.md deleted file mode 100644 index 49383198..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/noripple_check.md +++ /dev/null @@ -1,120 +0,0 @@ ---- -title: "noripple_check" -slug: "rpc-xrp-noripple_check" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const result = await tatum.rpc.norippleCheck('r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', 'gateway', { - transactions: true, - limit: 2 -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `noripple_check` method provides a quick way to check the status of the Default Ripple field for an account and the No Ripple flag of its trust lines, compared with the recommended settings. This can be useful for developers and administrators who want to ensure that their accounts are configured correctly, especially when managing the accounts of large or complex financial organisations. - -{% embed url="https://codepen.io/tatum-devrel/pen/poQBOLM" %} - -### Parameters - -* `account` (String): A unique identifier for the account, most commonly the account's address. -* `role` (String): Whether the address refers to a gateway or user. Recommendations depend on the role of the account. Issuers must have Default Ripple enabled and must disable No Ripple on all trust lines. Users should have Default Ripple disabled, and should enable No Ripple on all trust lines. -* `transactions` (Boolean, optional): If true, include an array of suggested transactions, as JSON objects, that you can sign and submit to fix the problems. Defaults to false. -* `limit` (Number, optional): The maximum number of trust line problems to include in the results. Defaults to 300. - -### Return Object - -The `noripple_check` method returns an object with the following fields: - -* `ledger_current_index` (Number): The ledger index of the ledger used to calculate these results. -* `problems` (Array): Array of strings with human-readable descriptions of the problems. This includes up to one entry if the account's Default Ripple setting is not as recommended, plus up to limit entries for trust lines whose No Ripple setting is not as recommended. -* `transactions` (Array): If the request specified transactions as true, this is an array of JSON objects, each of which is the JSON form of a transaction that should fix one of the described problems. The length of this array is the same as the problems array, and each entry is intended to fix the problem described at the same index into that array. - -### JSON-RPC Request Example - -```json -{ - "method": "noripple_check", - "params": [ - { - "account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "ledger_index": "current", - "limit": 2, - "role": "gateway", - "transactions": true - } - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "ledger_current_index": 14380381, - "problems": [ - "You should immediately set your default ripple flag", - "You should clear the no ripple flag on your XAU line to r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", - "You should clear the no ripple flag on your USD line to rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q" - ], - "status": "success", - "transactions": [ - { - "Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "Fee": 10000, - "Sequence": 1406, - "SetFlag": 8, - "TransactionType": "AccountSet" - }, - { - "Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "Fee": 10000, - "Flags": 262144, - "LimitAmount": { - "currency": "XAU", - "issuer": "r3vi7mWxru9rJCxETCyA1CHvzL96eZWx5z", - "value": "0" - }, - "Sequence": 1407, - "TransactionType": "TrustSet" - }, - { - "Account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "Fee": 10000, - "Flags": 262144, - "LimitAmount": { - "currency": "USD", - "issuer": "rMwjYedjc7qqtKYVLiAccJSmCwih4LnE2q", - "value": "5" - }, - "Sequence": 1408, - "TransactionType": "TrustSet" - } - ], - "validated": false - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/ping.md b/v1.0/RPC Nodes/others/rpc-xrp/ping.md deleted file mode 100644 index 7b6a9e17..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/ping.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: "ping" -slug: "rpc-xrp-ping" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.ping() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `ping` method is a simple RPC method provided by the Ripple (XRP) blockchain, used primarily to check the connection status and latency to the XRP blockchain node. It's a useful tool in debugging and network troubleshooting scenarios, as it provides an easy way to verify the connection and round-trip time between the client and the server. - -{% embed url="https://codepen.io/tatum-devrel/pen/oNQOJdw" %} - -### Parameters - -The `ping` method accepts no parameters. - -### Return Object - -The `ping` method returns a simple object with the following field: - -* `status`: The status of the request, typically "success". The presence of this field in the response indicates a successful round trip. - -The client can measure the round-trip time from the request to the response as latency. - -### JSON-RPC Request Example - -```json -{ - "method": "ping", - "params": [ - {} - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "status": "success" - } -} -``` - -This response signifies a successful connection to the XRP node. The time it takes to receive this response can be used to measure network latency. diff --git a/v1.0/RPC Nodes/others/rpc-xrp/random.md b/v1.0/RPC Nodes/others/rpc-xrp/random.md deleted file mode 100644 index a756259f..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/random.md +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: "random" -slug: "rpc-xrp-random" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.random() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `random` method is an RPC method provided by the Ripple (XRP) blockchain. This command returns a random number that can be used as a source of entropy for random number generation by clients. It's particularly useful in scenarios where a high-entropy random number is required, such as cryptographic operations or unique identifier generation. - -{% embed url="https://codepen.io/tatum-devrel/pen/MWzRZXW" %} - -### Parameters - -The `random` method accepts no parameters. - -### Return Object - -The `random` method returns an object with the following fields: - -* `random`: A Random 256-bit hex value. -* `status`: The status of the request, typically "success". - -### JSON-RPC Request Example - -```json -{ - "method": "random", - "params": [ - {} - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "random": "4E57146AA47BC6E88FDFE8BAA235B900126C916B6CC521550996F590487B837A", - "status": "success" - } -} -``` - -This response includes a random 256-bit hex value generated by the XRP node. diff --git a/v1.0/RPC Nodes/others/rpc-xrp/ripple_path_find.md b/v1.0/RPC Nodes/others/rpc-xrp/ripple_path_find.md deleted file mode 100644 index bf54dcb6..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/ripple_path_find.md +++ /dev/null @@ -1,151 +0,0 @@ ---- -title: "ripple_path_find" -slug: "rpc-xrp-ripple_path_find" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```typescript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network, CurrencyAmount, RipplePathFindOptions } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const destinationAmount: CurrencyAmount = { - currency: 'USD', - issuer: 'rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B', - value: '0.001', -} - -const res = await tatum.rpc.ripplePathFind( - 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', - 'r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59', - destinationAmount -) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `ripple_path_find` method is a simplified version of the `path_find` method that provides a single response with a payment path that can be used immediately. It tries to find the cheapest path or combination of paths for making a payment, but it is not guaranteed that the paths returned are, in fact, the best paths. - -The method is available in both the WebSocket and JSON-RPC APIs. However, the results tend to become outdated as time passes. Instead of making multiple calls to stay updated, it is recommended to use the `path_find` method to subscribe to continued updates where possible. - -One thing to note is that pathfinding results from untrusted servers need to be handled with care. A server could be modified to return less-than-optimal paths to earn money for its operators. A server may also return poor results when under heavy load. If you do not have your own server that you can trust with pathfinding, you should compare the results of pathfinding from multiple servers run by different parties, to minimize the risk of a single server returning poor results. - -### Parameters - -The `ripple_path_find` method includes the following parameters: - -* `source_account`: Unique address of the account that would send funds in a transaction -* `destination_account`: Unique address of the account that would receive funds in a transaction -* `destination_amount`: Currency Amount that the destination account would receive in a transaction. Special case: New in: rippled 0.30.0 You can specify "-1" (for XRP) or provide -1 as the contents of the value field (for non-XRP currencies). This requests a path to deliver as much as possible, while spending no more than the amount specified in send\_max (if provided). -* `send_max`: (Optional) Currency Amount that would be spent in the transaction. Cannot be used with source\_currencies. New in: rippled 0.30.0 -* `source_currencies`: (Optional) Array of currencies that the source account might want to spend. Each entry in the array should be a JSON object with a mandatory currency field and optional issuer field, like how currency amounts are specified. Cannot contain more than 18 source currencies. By default, uses all source currencies available up to a maximum of 88 different currency/issuer pairs. -* `ledger_hash`: (Optional) A 20-byte hex string for the ledger version to use. (See Specifying Ledgers) -* `ledger_index`: (Optional) The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. (See Specifying Ledgers) - -### Return Object - -The `ripple_path_find` method returns a result object that includes: - -* `alternatives`: Array of objects with possible paths to take. If empty, then there are no paths connecting the source and destination accounts. -* `destination_account`: Unique address of the account that would receive a payment transaction -* `destination_currencies`: Array of strings representing the currencies that the destination accepts, as 3-letter codes like "USD" or as 40-character hex like "015841551A748AD2C1F76FF6ECB0CCCD00000000" - -Each element in the alternatives array is an object that represents a path from one possible source currency (held by the initiating account) to the destination account and currency. This object has the following fields: - -* `paths_computed`: Array of arrays of objects defining payment paths -* `source_amount`: Currency Amount that the source would have to send along this path for the destination to receive the desired amount - -### JSON-RPC Request Example - -```json -{ - "method": "ripple_path_find", - "params": [ - { - "destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "destination_amount": { - "currency": "USD", - "issuer": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "value": "0.001" - }, - "source_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "source_currencies": [ - { - "currency": "XRP" - }, - { - "currency": "USD" - } - ] - } - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "alternatives": [ - { - "paths_computed": [ - [ - { - "currency": "USD", - "issuer": "rpDMez6pm6dBve2TJsmDpv7Yae6V5Pyvy2", - "type": 48, - "type_hex": "0000000000000030" - }, - { - "account": "rpDMez6pm6dBve2TJsmDpv7Yae6V5Pyvy2", - "type": 1, - "type_hex": "0000000000000001" - }, - { - "account": "rfDeu7TPUmyvUrffexjMjq3mMcSQHZSYyA", - "type": 1, - "type_hex": "0000000000000001" - }, - { - "account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B", - "type": 1, - "type_hex": "0000000000000001" - } - ] - ], - "source_amount": "207414" - } - ], - "destination_account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59", - "destination_currencies": [ - "USD", - "JOE", - "BTC", - "DYM", - "CNY", - "EUR", - "015841551A748AD2C1F76FF6ECB0CCCD00000000", - "MXN", - "XRP" - ], - "status": "success" - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/server_info.md b/v1.0/RPC Nodes/others/rpc-xrp/server_info.md deleted file mode 100644 index f2edc91a..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/server_info.md +++ /dev/null @@ -1,172 +0,0 @@ ---- -title: "server_info" -slug: "rpc-xrp-server_info" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -// Initialize Tatum SDK for XRP -const tatum = await TatumSDK.init({network: Network.XRP}) - -// Call the serverInfo method -const serverInfo = await tatum.rpc.serverInfo() - -console.log(serverInfo) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `serverInfo` method provides a human-readable version of various information about the rippled server being queried. This information can be crucial for understanding the current state of the server, including its uptime, validation quorum, current ledger sequence, transaction load, and much more. - -Use cases for `serverInfo` include: - -* Monitoring server performance and resource usage. -* Checking the server's connection status to the XRP Ledger network. -* Investigating the server's ledger history and validation status. - -{% embed url="https://codepen.io/Martin-Zemanek/pen/JjeXYxB" %} - -### Parameters - -The `serverInfo` method doesn't require any parameters. - -Here are the fields for the `server_info` method: - -* `amendment_blocked`: (May be omitted) A Boolean value that indicates whether this server is amendment blocked. If the server is not amendment blocked, the response omits this field. -* `build_version`: A string that represents the version number of the running `rippled` server. -* `closed_ledger`: (May be omitted) An object that provides information about the most recently closed ledger that has not been validated by consensus. If the most recently validated ledger is available, the response omits this field and includes `validated_ledger` instead. The member fields are the same as the `validated_ledger` field. -* `complete_ledgers`: A string that indicates the range of ledger versions the local `rippled` has in its database. This may be a disjoint sequence. If the server does not have any complete ledgers, this is the string "empty". -* `hostid`: On an admin request, returns the hostname of the server running the `rippled` instance; otherwise, returns a single RFC-1751 word based on the node public key. -* `io_latency_ms`: A number that shows the amount of time spent waiting for I/O operations, in milliseconds. If this number is high, then the `rippled` server is probably having serious load issues. -* `jq_trans_overflow`: The number of times (since starting up) that this server has had over 250 transactions waiting to be processed at once. A large number here may mean that your server is unable to handle the transaction load of the XRP Ledger network. -* `last_close`: An object that provides information about the last time the server closed a ledger, including the amount of time it took to reach a consensus and the number of trusted validators participating. - * `last_close.converge_time_s`: A number that represents the amount of time it took to reach a consensus on the most recently validated ledger version, in seconds. - * `last_close.proposers`: A number that shows how many trusted validators the server considered (including itself, if configured as a validator) in the consensus process for the most recently validated ledger version. -* `load`: (Admin only) An object that provides detailed information about the current load state of the server. - * `load.job_types`: (Admin only) An array that provides information about the rate of different types of jobs the server is doing and how much time it spends on each. - * `load.threads`: (Admin only) A number that shows the number of threads in the server's main job pool. -* `load_factor`: A number that represents the load-scaled open ledger transaction cost the server is currently enforcing, as a multiplier on the base transaction cost. -* `load_factor_local`: (May be omitted) A number that represents the current multiplier to the transaction cost based on load to this server. -* `load_factor_net`: (May be omitted) A number that represents the current multiplier to the transaction cost being used by the rest of the network (estimated from other servers' reported load values). -* `load_factor_cluster`: (May be omitted) A number that represents the current multiplier to the transaction cost based on load to servers in this cluster. -* `load_factor_fee_escalation`: (May be omitted) A number that represents the current multiplier to the transaction cost that a transaction must pay to get into the open ledger. -* `load_factor_fee_queue`: (May be omitted) A number that represents the current multiplier to the transaction cost that a transaction must pay to get into the queue, if the queue is full. -* `load_factor_server`: (May be omitted) A number that represents the load factor the server is enforcing, not - -including the open ledger cost. - -* `peers`: (Omitted by reporting mode servers) A number that shows how many other `rippled` servers this one is currently connected to. -* `pubkey_node`: A string that represents the public key used to verify this server for peer-to-peer communications. -* `pubkey_validator`: (Admin only) A string that represents the public key used by this node to sign ledger validations. -* `reporting`: (Reporting mode servers only) An object that provides information about this server's reporting-mode specific configurations. -* `reporting.etl_sources`: (Reporting mode servers only) An array that lists the P2P-mode servers this reporting mode is retrieving data from. -* `reporting.is_writer`: (Reporting mode servers only) A Boolean value that indicates whether this server is writing to the external database with ledger data. -* `reporting.last_publish_time`: (Reporting mode servers only) A string that represents an ISO 8601 timestamp indicating when this server last published a validated ledger to its subscription streams. -* `server_state`: A string that indicates to what extent the server is participating in the network. -* `server_state_duration_us`: A number that represents the number of consecutive microseconds the server has been in the current state. -* `state_accounting`: An object that is a map of various server states with information about the time the server spends in each. -* `state_accounting.*.duration_us`: A string that shows the number of microseconds the server has spent in this state. -* `state_accounting.*.transitions`: A string that shows the number of times the server has changed into this state. -* `time`: A string that represents the current time in UTC, according to the server's clock. -* `uptime`: A number that represents the number of consecutive seconds that the server has been operational. -* `validated_ledger`: (May be omitted) An object that provides information about the most recent fully-validated ledger. - * `validated_ledger.age`: A number that shows the time since the ledger was closed, in seconds. - * `validated_ledger.base_fee_xrp`: A number that represents the base fee, in XRP. - * `validated_ledger.hash`: A string that represents the unique hash for the ledger, as hexadecimal. - * `validated_ledger.reserve_base_xrp`: A number that represents the minimum amount of XRP (not drops) necessary for every account to keep in reserve. - * `validated_ledger.reserve_inc_xrp`: A number that represents the amount of XRP (not drops) added to the account reserve for each object an account owns in the ledger. - * `validated_ledger.seq`: A number that represents the ledger index of the latest validated ledger. -* `validation_quorum`: A number that represents the minimum number of trusted validations required to validate a ledger version. Some circumstances may cause the server to require more validations. -* `validator_list_expires`: (Admin only) A string that either represents the human readable time, in UTC, when the current validator list expires, the string "unknown" if the server has yet to load a published validator list or the string "never" if the server uses a static validator list. - -### JSON-RPC Request Example - -```json -{ - "method": "server_info", - "params": [ - {} - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "info": { - "build_version": "1.9.4", - "complete_ledgers": "32570-75801747", - "hostid": "ABET", - "initial_sync_duration_us": "566800928", - "io_latency_ms": 1, - "jq_trans_overflow": "47035", - "last_close": { - "converge_time_s": 3, - "proposers": 35 - }, - "load_factor": 1, - "network_id": 0, - "peer_disconnects": "542", - "peer_disconnects_resources": "1", - "peers": 24, - "pubkey_node": "n9LvjJyaYHBWUvQUat632RrnpS7UHVLW2tLUGXSZ2yXouh4goDHX", - "server_state": "full", - "server_state_duration_us": "3612238603", - "state_accounting": { - "connected": { - "duration_us": "125498126", - "transitions": "67" - }, - "disconnected": { - "duration_us": "473415516", - "transitions": "2" - }, - "full": { - "duration_us": "4365855930299", - "transitions": "337" - }, - "syncing": { - "duration_us": "1383837914", - "transitions": "311" - }, - "tracking": { - "duration_us": "518995710", - "transitions": "374" - } - }, - "time": "2022-Nov-16 21:51:03.737667 UTC", - "uptime": 4368357, - "validated_ledger": { - "age": 1, - "base_fee_xrp": 0.00001, - "hash": "D54A94D5EF620DC212EAB5958D592EC641FC94ED92146477A04DCE5B006DFF05", - "reserve_base_xrp": 10, - "reserve_inc_xrp": 2, - "seq": 75801747 - }, - "validation_quorum": 28 - }, - "status": "success" - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/server_state.md b/v1.0/RPC Nodes/others/rpc-xrp/server_state.md deleted file mode 100644 index f5af6893..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/server_state.md +++ /dev/null @@ -1,172 +0,0 @@ ---- -title: "server_state" -slug: "rpc-xrp-server_state" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.serverState() - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `server_state` RPC method is used to retrieve various machine-readable information about the rippled server's current state. The response provided by this method is almost the same as the `server_info` method, but uses units that are easier to process instead of easier to read. For example, XRP values are given in integer drops instead of scientific notation or decimal values, and time is given in milliseconds instead of seconds. - -This method can be useful when you need to gather specific information about the server's state, such as the build version, complete ledgers, load base, load factor, server state, and more. This information can be useful for monitoring the health and performance of a rippled server. - -{% embed url="https://codepen.io/tatum-devrel/pen/mdQgaXx" %} - -### Parameters - -The `server_state` method does not require any parameters. - -### Return Object - -The `server_state` method returns an object with the following fields: - -* `amendment_blocked`: (Optional) A Boolean value that indicates if the server is amendment blocked. This field may be omitted if the server is not amendment blocked. -* `build_version`: A string that provides the version number of the running `rippled` version. -* `complete_ledgers`: A string that indicates the sequence numbers of the ledger versions the local `rippled` has in its database. This could be a disjoint sequence like "2500-5000,32570-7695432". If the server does not have any complete ledgers (for example, if it recently started syncing with the network), this is an empty string. -* `closed_ledger`: (Optional) An object that provides information on the most recently closed ledger that has not been validated by consensus. If the most recently validated ledger is available, the response omits this field and includes `validated_ledger` instead. The member fields are the same as the `validated_ledger` field. -* `io_latency_ms`: A number that indicates the amount of time spent waiting for I/O operations, in milliseconds. If this number is not very, very low, then the `rippled` server is probably having serious load issues. -* `jq_trans_overflow`: A string-number that represents the number of times this server has had over 250 transactions waiting to be processed at once. A large number here may mean that your server is unable to handle the transaction load of the XRP Ledger network. -* `last_close`: An object that provides information about the last time the server closed a ledger, including the amount of time it took to reach a consensus and the number of trusted validators participating. This object includes: - * `last_close.converge_time`: A number that shows the amount of time it took to reach a consensus on the most recently validated ledger version, in milliseconds. - * `last_close.proposers`: A number that indicates how many trusted validators the server considered (including itself, if configured as a validator) in the consensus process for the most recently validated ledger version. -* `load`: (Admin only) An object that provides detailed information about the current load state of the server. This object includes: - * `load.job_types`: (Admin only) An array that provides information about the rate of different types of jobs the server is doing and how much time it spends on each. - * `load.threads`: (Admin only) A number that indicates the number of threads in the server's main job pool. -* `load_base`: An integer that represents the baseline amount of server load used in transaction cost calculations. If the `load_factor` is equal to the `load_base` then only the base transaction cost is enforced. If the `load_factor` is higher than the `load_base`, then transaction costs are multiplied by the ratio between them. -* `load_factor`: A number that represents the load factor the server is currently enforcing. The ratio between this value and the `load_base` determines the multiplier for transaction costs. The load factor is determined by the highest of the individual server's load factor, cluster's load factor, the open ledger cost, and the overall network's load factor. -* `load_factor_fee_escalation`: (Optional) A number that indicates the current multiplier to the transaction cost to get into the open ledger, in fee levels. -* `load_factor_fee_queue`: (Optional) A number that indicates the current multiplier to the transaction cost to get into the queue, if the queue is full, in fee levels. -* `load_factor_fee_reference`: (Optional) A number that indicates the transaction cost with no load scaling, in fee levels. -* `load_factor_server`: (Optional) A number that represents the load factor the server is enforcing, not including the open ledger cost. -* `peers`: A number that shows how many other `rippled` servers this one is currently connected to. This field is omitted by reporting mode servers. -* `pubkey_node`: A string that represents the public key used to verify this server for peer-to-peer communications. This node key pair is automatically generated by the server the first time it starts up. -* `pubkey_validator`: (Admin only) A string that represents the public key used by this node to sign ledger validations. This validation key pair is derived from the `[validator_token]` or `[validation_seed]` config field. -* `reporting`: (Reporting mode servers only) An object that provides information about this server's reporting-mode specific configurations. This object includes: - * `reporting.etl_sources`: (Reporting mode servers only) An array that lists P2P-mode servers this reporting mode is retrieving data from. Each entry in this array is an ETL Source object. - * `reporting.is_writer`: (Reporting mode servers only) A Boolean value that indicates if this server is writing to the external database with ledger data. If false, it is not currently writing, possibly because another reporting mode server is currently populating a shared database, or because it's configured as read-only. - * `reporting.last_publish_time`: (Reporting mode servers only) A string that represents an ISO 8601 timestamp indicating when this server last saw a new validated ledger from any of its P2P mode sources. -* `server_state`: A string that indicates to what extent the server is participating in the network. -* `server_state_duration_us`: A number that shows the number of consecutive microseconds the server has been in the current state. -* `state_accounting`: An object that represents a map of various server states with information about the time the server spends in each. This object includes: - * `state_accounting.*.duration_us`: A string that indicates the number of microseconds the server has spent in this state. This is updated whenever the server transitions into another state. - * `state_accounting.*.transitions`: A string that shows the number of times the server has changed into this state. -* `time`: A string that indicates the current time in UTC, according to the server's clock. -* `uptime`: A number that indicates the number of consecutive seconds that the server has been operational. -* `validated_ledger`: (Optional) An object that provides information about the most recent fully-validated ledger. This object includes: - * `validated_ledger.base_fee`: A number that indicates the base fee, in drops of XRP, for propagating a transaction to the network. - * `validated_ledger.close_time`: A number that shows the time this ledger was closed, in seconds since the Ripple Epoch. - * `validated_ledger.hash`: A string that represents the unique hash of this ledger version, as hexadecimal. - * `validated_ledger.reserve_base`: A number that shows the minimum account reserve, as of the most recent validated ledger version. - * `validated_ledger.reserve_inc`: A number that shows the owner reserve for each item an account owns, as of the most recent validated ledger version. - * `validated_ledger.seq`: A number that represents the ledger index of the most recently validated ledger version. -* `validation_quorum`: A number that indicates the minimum number of trusted validations required to validate a ledger version. Some circumstances may cause the server to require more validations. -* `validator_list_expires`: (Admin only) A number that shows when the current validator list expires, in seconds since the Ripple Epoch, or 0 if the server has yet to load a published validator list. - -For the `ETL Source Object`, each member of the `etl_sources` field is an object with the following fields: - -* `connected`: A Boolean value that indicates if the reporting mode server is connected to this P2P mode server. If false, the server is not connected. -* `grpc_port`: A string that shows the port number on the P2P mode server where this reporting mode server is configured to connect and retrieve ledger data via gRPC. -* `ip`: A string that represents the IP address (IPv4 or IPv6) of the P2P mode server. -* `last_message_arrival_time`: A string that represents an ISO 8601 timestamp indicating the most recent time the reporting mode server received a message from this P2P server. -* `validated_ledgers_range`: A string that shows the range of validated ledger versions this P2P mode server reports that it has available, in the same format as complete\_ledgers. -* `websocket_port`: A string that shows the port number on the P2P server where this reporting mode server is configured to forward WebSocket requests that cannot be served directly from reporting mode. - -### JSON-RPC Request Example - -```json -{ - "method": "server_state", - "params": [ - {} - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "state": { - "build_version": "1.7.2", - "complete_ledgers": "65844785-65887184", - "io_latency_ms": 3, - "jq_trans_overflow": "580", - "last_close": { - "converge_time": 3012, - "proposers": 41 - }, - "load_base": 256, - "load_factor": 134022, - "load_factor_fee_escalation": 134022, - "load_factor_fee_queue": 256, - "load_factor_fee_reference": 256, - "load_factor_server": 256, - "peer_disconnects": "792367", - "peer_disconnects_resources": "7273", - "peers": 72, - "pubkey_node": "n9LNvsFiYfFf8va6pma2PHGJKVLSyZweN1iBAkJQSeHw4GjM8gvN", - "server_state": "full", - "server_state_duration_us": "422128665555", - "state_accounting": { - "connected": { - "duration_us": "172799714", - "transitions": "1" - }, - "disconnected": { - "duration_us": "309059", - "transitions": "1" - }, - "full": { - "duration_us": "6020429212246", - "transitions": "143" - }, - "syncing": { - "duration_us": "413813232", - "transitions": "152" - }, - "tracking": { - "duration_us": "266553605", - "transitions": "152" - } - }, - "time": "2021-Aug-24 20:43:43.043406 UTC", - "uptime": 6021282, - "validated_ledger": { - "base_fee": 10, - "close_time": 683153020, - "hash": "ABEF3D24015E8B6B7184B4ABCEDC0E0E3AA4F0677FAB91C40B1E500707C1F3E5", - "reserve_base": 20000000, - "reserve_inc": 5000000, - "seq": 65887184 - }, - "validation_quorum": 33 - }, - "status": "success" - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/submit.md b/v1.0/RPC Nodes/others/rpc-xrp/submit.md deleted file mode 100644 index 09bad74a..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/submit.md +++ /dev/null @@ -1,159 +0,0 @@ ---- -title: "submit" -slug: "rpc-xrp-submit" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const tx = { - TransactionType: "Payment", - Account: "rBPAQmwMrt7FDDPNyjwFgwSqbWZPf6GieV", - Destination: "rPEPPER7kfTD9w2To4CQk6UCfuHM9c6GDY", - Amount: "2000000", - Flags: 2147483648 -} - -const res = await tatum.rpc.submit(tx, { - secret: 's████████████████████████████' -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `submit` method is an RPC method in the XRP Ledger which is used to apply a transaction and send it to the network for confirmation and inclusion in future ledgers. It has two modes: Submit-only mode, where a signed and serialized transaction is submitted as-is, and Sign-and-submit mode, where a JSON-formatted transaction object is completed, signed, and then submitted. It is generally recommended to use the Submit-only mode for robustness. - -Use cases for this method include submitting transactions to the XRP ledger, such as sending payments, managing trust lines, or deploying smart contracts. - -{% embed url="https://codepen.io/tatum-devrel/pen/LYXvXLw" %} - -### Parameters - -The `submit` method takes the following parameters: - -* `tx` (required): A string or JSON object representing the transaction to be submitted. This can be a hex representation of the signed transaction or a transaction definition in JSON format. -* `options` (optional): An object containing additional parameters. These can include: - * `secret` (optional): The secret seed of the account. - * `seed` (optional): The secret seed of the account in the XRP Ledger's base58 format. - * `seedHex` (optional): The secret seed of the account in the hexadecimal format. - * `passphrase` (optional): The secret seed of the account as the string passphrase. - * `keyType` (optional): The signing algorithm of the cryptographic key pair provided (secp256k1 or ed25519). - * `failHard` (optional): If true, and the transaction fails locally, do not retry or relay the transaction to other servers. - * `offline` (optional): If true, when constructing the transaction, do not try to automatically fill in or validate values. - * `buildPath` (optional): If true, the server auto-fills the Paths field of a Payment transaction before signing. - * `feeMultMax` (optional): Sign-and-submit fails with the error rpcHIGH\_FEE if the auto-filled Fee value would be greater than the reference transaction cost × feeMultMax ÷ feeDivMax. - * `feeDivMax` (optional): Sign-and-submit fails with the error rpcHIGH\_FEE if the auto-filled Fee value would be greater than the reference transaction cost × feeMultMax ÷ feeDivMax. - -### Return Object - -The `submit` method returns an object that provides information about the result of the submitted transaction. The object contains the following fields: - -* `engine_result`: A string that represents a code indicating the preliminary result of the transaction, for example, "tesSUCCESS". -* `engine_result_code`: An integer that represents a numeric version of the result code. This is directly correlated to the `engine_result`. -* `engine_result_message`: A string that represents a human-readable explanation of the transaction's preliminary result. -* `tx_blob`: A string that represents the complete transaction in hexadecimal string format. -* `tx_json`: An object that represents the complete transaction in JSON format. -* `accepted`: A boolean value that indicates whether the transaction was accepted. This field is omitted in sign-and-submit mode. -* `account_sequence_available`: A number indicating the next Sequence Number available for the sending account after all pending and queued transactions. This field is omitted in sign-and-submit mode. -* `account_sequence_next`: A number indicating the next Sequence Number for the sending account after all transactions that have been provisionally applied, but not transactions in the queue. This field is omitted in sign-and-submit mode. -* `applied`: A boolean value indicating whether the transaction was applied to the open ledger. This field is omitted in sign-and-submit mode. -* `broadcast`: A boolean value indicating whether the transaction was broadcast to peer servers in the peer-to-peer XRP Ledger network. This field is omitted in sign-and-submit mode. -* `kept`: A boolean value indicating whether the transaction was kept to be retried later. This field is omitted in sign-and-submit mode. -* `queued`: A boolean value indicating whether the transaction was put in the Transaction Queue. This field is omitted in sign-and-submit mode. -* `open_ledger_cost`: A string indicating the current open ledger cost before processing this transaction. Transactions with a lower cost are likely to be queued. This field is omitted in sign-and-submit mode. -* `validated_ledger_index`: An integer indicating the ledger index of the newest validated ledger at the time of submission. This field is omitted in sign-and-submit mode. - -### JSON-RPC Request Example - Submit Only - -```json -{ - "method": "submit", - "params": [ - { - "tx_blob": "1200002280000000240000000361D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA968400000000000000A732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100D184EB4AE5956FF600E7536EE459345C7BBCF097A84CC61A93B9AF7197EDB98702201CEA8009B7BEEBAA2AACC0359B41C427C1C5B550A4CA4B80CF2174AF2D6D5DCE81144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754" - } - ] -} -``` - -### JSON-RPC Request Example - Submit Only - -```json -{ - "method": "submit", - "params": [ - { - "offline": false, - "secret": "s████████████████████████████", - "tx_json": { - "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", - "Amount": { - "currency": "USD", - "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", - "value": "1" - }, - "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", - "TransactionType": "Payment" - }, - "fee_mult_max": 1000 - } - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "accepted" : true, - "account_sequence_available" : 362, - "account_sequence_next" : 362, - "applied" : true, - "broadcast" : true, - "engine_result": "tesSUCCESS", - "engine_result_code": 0, - "engine_result_message": "The transaction was applied. Only final in a validated ledger.", - "status": "success", - "kept" : true, - "open_ledger_cost": "10", - "queued" : false, - "tx_blob": "1200002280000000240000016961D4838D7EA4C6800000000000000000000000000055534400000000004B4E9C06F24296074F7BC48F92A97916C6DC5EA9684000000000002710732103AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB74473045022100A7CCD11455E47547FF617D5BFC15D120D9053DFD0536B044F10CA3631CD609E502203B61DEE4AC027C5743A1B56AF568D1E2B8E79BB9E9E14744AC87F38375C3C2F181144B4E9C06F24296074F7BC48F92A97916C6DC5EA983143E9D4A2B8AA0780F682D136F7A56D6724EF53754", - "tx_json": { - "Account": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", - "Amount": { - "currency": "USD", - "issuer": "rf1BiGeXwwQoi8Z2ueFYTEXSwuJYfV2Jpn", - "value": "1" - }, - "Destination": "ra5nK24KXen9AHvsdFTKHSANinZseWnPcX", - "Fee": "10000", - "Flags": 2147483648, - "Sequence": 361, - "SigningPubKey": "03AB40A0490F9B7ED8DF29D246BF2D6269820A0EE7742ACDD457BEA7C7D0931EDB", - "TransactionType": "Payment", - "TxnSignature": "3045022100A7CCD11455E47547FF617D5BFC15D120D9053DFD0536B044F10CA3631CD609E502203B61DEE4AC027C5743A1B56AF568D1E2B8E79BB9E9E14744AC87F38375C3C2F1", - "hash": "5B31A7518DC304D5327B4887CD1F7DC2C38D5F684170097020C7C9758B973847" - } - }, - "validated_ledger_index" : 21184416 -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/submit_multisigned.md b/v1.0/RPC Nodes/others/rpc-xrp/submit_multisigned.md deleted file mode 100644 index 3799ee33..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/submit_multisigned.md +++ /dev/null @@ -1,117 +0,0 @@ ---- -title: "submit_multisigned" -slug: "rpc-xrp-submit_multisigned" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const txJson = { /* your transaction JSON here */ } -const options = { failHard: true } // optional - -const res = await tatum.rpc.submitMultisigned(txJson, options) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `submitMultisigned` method in the XRP RPC API allows you to apply a multi-signed transaction and send it to the network to be included in future ledgers. This method requires the MultiSign amendment to be enabled and was introduced in rippled 0.31.0. - -This method is used when multiple parties are required to authorise a transaction, which can be a useful feature for securing high-value accounts, implementing distributed decision-making processes, or creating more complex authorisation structures for transactions. - -{% embed url="https://codepen.io/tatum-devrel/pen/XWyQyao" %} - -### Parameters - -* `txJson` (TxJson): The transaction in JSON format with an array of Signers. To be successful, the weights of the signatures must be equal to or higher than the quorum of the SignerList. -* `options` (FailOption, optional): This parameter is optional. If `failHard` is true, and the transaction fails locally, it will not retry or relay the transaction to other servers. The default is false. - -### Return Object - -The `submit_multisigned` method returns an object that provides information about the result of the submitted multisigned transaction. The object contains the following fields: - -* `engine_result`: A string that represents a code indicating the preliminary result of the transaction, for example, "tesSUCCESS". -* `engine_result_code`: An integer that represents a numeric code indicating the preliminary result of the transaction. This is directly correlated to the `engine_result`. -* `engine_result_message`: A string that represents a human-readable explanation of the preliminary transaction result. -* `tx_blob`: A string that represents the complete transaction in hexadecimal string format. -* `tx_json`: An object that represents the complete transaction in JSON format. - -### JSON-RPC Request Example - -```json -{ - "method": "submit_multisigned", - "params": [ - { - "tx_json": { - "Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC", - "Fee": "30000", - /* ... rest of the transaction ... */ - }, - "fail_hard": true - } - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "engine_result": "tesSUCCESS", - "engine_result_code": 0, - "engine_result_message": "The transaction was applied. Only final in a validated ledger.", - "status": "success", - "tx_blob": "120014220004000024000000046380000000000000000000000000000000000000005553440000000000B5F762798A53D543A014CAF8B297CFF8F2F937E868400000000000753073008114A3780F5CB5A44D366520FC44055E8ED44D9A2270F3E010732102B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF74473045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B78114204288D2E47F8EF6C99BCC457966320D12409711E1E010732103398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C174473045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D0881143A4C02EA95AD6AC3BED92FA036E0BBFB712C030CE1F1", - "tx_json": { - "Account": "rEuLyBCvcw4CFmzv8RepSiAoNgF8tTGJQC", - "Fee": "30000", - "Flags": 262144, - "LimitAmount": { - "currency": "USD", - "issuer": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", - "value": "0" - }, - "Sequence": 4, - "Signers": [ - { - "Signer": { - "Account": "rsA2LpzuawewSBQXkiju3YQTMzW13pAAdW", - "SigningPubKey": "02B3EC4E5DD96029A647CFA20DA07FE1F85296505552CCAC114087E66B46BD77DF", - "TxnSignature": "3045022100CC9C56DF51251CB04BB047E5F3B5EF01A0F4A8A549D7A20A7402BF54BA744064022061EF8EF1BCCBF144F480B32508B1D10FD4271831D5303F920DE41C64671CB5B7" - } - }, - { - "Signer": { - "Account": "raKEEVSGnKSD9Zyvxu4z6Pqpm4ABH8FS6n", - "SigningPubKey": "03398A4EDAE8EE009A5879113EAA5BA15C7BB0F612A87F4103E793AC919BD1E3C1", - "TxnSignature": "3045022100FEE8D8FA2D06CE49E9124567DCA265A21A9F5465F4A9279F075E4CE27E4430DE022042D5305777DA1A7801446780308897699412E4EDF0E1AEFDF3C8A0532BDE4D08" - } - } - ], - "SigningPubKey": "", - "TransactionType": "TrustSet", - "hash": "81A477E2A362D171BB16BE17B4120D9F809A327FA00242ABCA867283BEA2F4F8" - } - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/transaction_entry.md b/v1.0/RPC Nodes/others/rpc-xrp/transaction_entry.md deleted file mode 100644 index bae237f6..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/transaction_entry.md +++ /dev/null @@ -1,92 +0,0 @@ ---- -title: "transaction_entry" -slug: "rpc-xrp-transaction_entry" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum - -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const res = await tatum.rpc.transactionEntry('C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9', { - ledgerIndex: '56865245', -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `transaction_entry` method retrieves information on a single transaction from a specific ledger version. It does not search all ledgers for the specified transaction, unlike the `tx` method, which does. The `transaction_entry` method is useful for fetching transaction data from a specified ledger, making it an essential method for auditing or tracking transaction histories. - -It's important to note that this method does not support retrieving information from the current in-progress ledger. A ledger version must be specified in either `ledger_index` or `ledger_hash`. - -This method can fail to find the transaction due to the following reasons: - -* The transaction does not exist. -* The transaction exists, but not in the specified ledger version. -* The server does not have the specified ledger version available. Another server that has the correct version on hand may have a different response. - -{% embed url="https://codepen.io/tatum-devrel/pen/xxQeQXN" %} - -### Parameters - -The parameters required for this method are: - -* `txHash`: (String) The unique hash of the transaction you are looking up. -* `options`: (Ledger) Options for specifying the ledger to use. It includes the following properties: - * `ledger_hash`: (Optional) A 20-byte hex string for the ledger version to use. - * `ledger_index`: (Optional) The ledger index of the ledger to use, or a shortcut string to choose a ledger automatically. - -### Return Object - -The `transaction_entry` method returns an object that provides detailed information about a transaction from a specified ledger. The object contains the following fields: - -* `ledger_index`: A number that represents the ledger index of the ledger version the transaction was found in; this is the same as the one from the request. -* `ledger_hash`: A string that represents the identifying hash of the ledger version the transaction was found in; this is the same as the one from the request. This field may be omitted. -* `metadata`: An object that represents the transaction metadata. This shows the exact results of the transaction in detail. -* `tx_json`: An object that represents the JSON representation of the Transaction object. - -### JSON-RPC Request Example - -```json -{ - "method": "transaction_entry", - "params": [ - { - "tx_hash": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9", - "ledger_index": 56865245 - } - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "ledger_hash": "793E56131D8D4ABFB27FA383BFC44F2978B046E023FF46C588D7E0C874C2472A", - "ledger_index": 56865245, - "metadata": { /* Detailed result of the transaction */ }, - "status": "success", - "tx_json": { /* JSON representation of the Transaction object */ }, - "validated": true - } -} -``` diff --git a/v1.0/RPC Nodes/others/rpc-xrp/tx.md b/v1.0/RPC Nodes/others/rpc-xrp/tx.md deleted file mode 100644 index 84ba9b4f..00000000 --- a/v1.0/RPC Nodes/others/rpc-xrp/tx.md +++ /dev/null @@ -1,199 +0,0 @@ ---- -title: "tx" -slug: "rpc-xrp-tx" -excerpt: "XRP RPC" -category: 65c5e93c623cad004b45d505 -hidden: false -metadata: - description: "XRP RPC" - image: [] - keywords: "xrp, 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 - -```javascript -// yarn add @tatumio/tatum -import { TatumSDK, Xrp, Network } from '@tatumio/tatum' - -const tatum = await TatumSDK.init({network: Network.XRP}) - -const transactionDetails = await tatum.rpc.tx('C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9', { - binary: false, - minLedger: 10000, - maxLedger: 20000, -}) - -await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs -``` - -### Overview - -The `tx` method in XRP ledger's RPC API retrieves information on a single transaction by its identifying hash. It is primarily used for querying details about specific transactions that have occurred on the XRP Ledger. The transaction could be any type of operation such as a payment, offer creation, offer cancellation, trust set operation, etc. - -This method can be very useful when tracking payment statuses, auditing transactions, or developing blockchain analysis tools. However, it should be noted that the command may successfully find the transaction even if it is included in a ledger outside the range of min\_ledger to max\_ledger. - -{% embed url="https://codepen.io/tatum-devrel/pen/ExOJOQJ" %} - -### Parameters - -The `tx` method accepts the following parameters: - -* `transaction`: (Type: String) The 256-bit hash of the transaction, as hex. -* `binary`: (Type: Boolean, Optional) If true, return transaction data and metadata as binary serialized to hexadecimal strings. If false, return transaction data and metadata as JSON. The default is false. -* `minLedger`: (Type: Number, Optional) Use this with `maxLedger` to specify a range of up to 1000 ledger indexes, starting with this ledger (inclusive). -* `maxLedger`: (Type: Number, Optional) Use this with `minLedger` to specify a range of up to 1000 ledger indexes, ending with this ledger (inclusive). - -### Return Object - -The `tx` method returns an object that provides information about a prepared transaction. The object contains the following fields: - -* `date`: A number that represents the number of seconds since January 1, 2000 (00:00 UTC) indicating the close time of the ledger in which the transaction was applied. This value does not have a precise relationship with physical time, and is dependent on the close time resolution. -* `hash`: A string that represents the SHA-512 hash of the transaction. -* `inLedger`: (Deprecated) An alias for `ledger_index`. -* `ledger_index`: A number that represents the ledger index of the ledger that includes this transaction. -* `meta`: An object (JSON) or a string (binary) that represents the transaction metadata, which describes the results of the transaction. -* `validated`: A boolean that indicates if this data comes from a validated ledger version; if omitted or set to false, this data is not final. -* `(Various)`: (Various) Other fields from the Transaction object. - -### JSON-RPC Request Example - -```json -{ - "method": "tx", - "params": [ - { - "transaction": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9", - "binary": false, - "minLedger": 10000, - "maxLedger": 20000 - } - ] -} -``` - -### JSON-RPC Response Example - -```json -{ - "result": { - "Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM", - "Fee": "12", - "Flags": 0, - "LastLedgerSequence": 56865248, - "OfferSequence": 5037708, - "Sequence": 5037710, - "SigningPubKey": "03B51A3EDF70E4098DA7FB053A01C5A6A0A163A30ED1445F14F87C7C3295FCB3BE", - "TakerGets": "15000000000", - "TakerPays": { - "currency": "CNY", - "issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y", - "value": "20160.75" - }, - "TransactionType": "OfferCreate", - "TxnSignature": "3045022100A5023A0E64923616FCDB6D664F569644C7C9D1895772F986CD6B981B515B02A00220530C973E9A8395BC6FE2484948D2751F6B030FC7FB8575D1BFB406368AD554D9", - "date": 648248020, - "hash": "C53ECF838647FA5A4C780377025FEC7999AB4182590510CA461444B207AB74A9", - "inLedger": 56865245, - "ledger_index": 56865245, - "meta": { - "AffectedNodes": [ - { - "ModifiedNode": { - "FinalFields": { - "ExchangeRate": "4F04C66806CF7400", - "Flags": 0, - "RootIndex": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400", - "TakerGetsCurrency": "0000000000000000000000000000000000000000", - "TakerGetsIssuer": "0000000000000000000000000000000000000000", - "TakerPaysCurrency": "000000000000000000000000434E590000000000", - "TakerPaysIssuer": "CED6E99370D5C00EF4EBF72567DA99F5661BFB3A" - }, - "LedgerEntryType": "DirectoryNode", - "LedgerIndex": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400" - } - }, - { - "ModifiedNode": { - "FinalFields": { - "Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM", - "Balance": "10404767991", - "Flags": 0, - "OwnerCount": 3, - "Sequence": 5037711 - }, - "LedgerEntryType": "AccountRoot", - "LedgerIndex": "1DECD9844E95FFBA273F1B94BA0BF2564DDF69F2804497A6D7837B52050174A2", - "PreviousFields": { - "Balance": "10404768003", - "Sequence": 5037710 - }, - "PreviousTxnID": "4DC47B246B5EB9CCE92ABA8C482479E3BF1F946CABBEF74CA4DE36521D5F9008", - "PreviousTxnLgrSeq": 56865244 - } - }, - { - "DeletedNode": { - "FinalFields": { - "Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM", - "BookDirectory": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400", - "BookNode": "0000000000000000", - "Flags": 0, - "OwnerNode": "0000000000000000", - "PreviousTxnID": "8F5FF57B404827F12BDA7561876A13C3E3B3095CBF75334DBFB5F227391A660C", - "PreviousTxnLgrSeq": 56865244, - "Sequence": 5037708, - "TakerGets": "15000000000", - "TakerPays": { - "currency": "CNY", - "issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y", - "value": "20160.75" - } - }, - "LedgerEntryType": "Offer", - "LedgerIndex": "26AAE6CA8D29E28A47C92ADF22D5D96A0216F0551E16936856DDC8CB1AAEE93B" - } - }, - { - "ModifiedNode": { - "FinalFields": { - "Flags": 0, - "IndexNext": "0000000000000000", - "IndexPrevious": "0000000000000000", - "Owner": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM", - "RootIndex": "47FAF5D102D8CE655574F440CDB97AC67C5A11068BB3759E87C2B9745EE94548" - }, - "LedgerEntryType": "DirectoryNode", - "LedgerIndex": "47FAF5D102D8CE655574F440CDB97AC67C5A11068BB3759E87C2B9745EE94548" - } - }, - { - "CreatedNode": { - "LedgerEntryType": "Offer", - "LedgerIndex": "8BAEE3C7DE04A568E96007420FA11ABD0BC9AE44D35932BB5640E9C3FB46BC9B", - "NewFields": { - "Account": "rhhh49pFH96roGyuC4E5P4CHaNjS1k8gzM", - "BookDirectory": "02BAAC1E67C1CE0E96F0FA2E8061020536CEDD043FEB0FF54F04C66806CF7400", - "Sequence": 5037710, - "TakerGets": "15000000000", - "TakerPays": { - "currency": "CNY", - "issuer": "rKiCet8SdvWxPXnAgYarFUXMh1zCPz432Y", - "value": "20160.75" - } - } - } - } - ], - "TransactionIndex": 0, - "TransactionResult": "tesSUCCESS" - }, - "status": "success", - "validated": true - } -} -``` diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch.md new file mode 100644 index 00000000..a1286f7b --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch.md @@ -0,0 +1,9 @@ +--- +title: "BCH" +slug: "rpc-bch" +excerpt: "" +category: 65c5e93c623cad004b45d505 +hidden: false +createdAt: "Wed Mar 06 2024 10:39:28 GMT+0000 (Coordinated Universal Time)" +updatedAt: "Wed Mar 06 2024 10:39:29 GMT+0000 (Coordinated Universal Time)" +--- diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/createrawtransaction.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/createrawtransaction.md new file mode 100644 index 00000000..d92f397a --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/createrawtransaction.md @@ -0,0 +1,101 @@ +--- +title: "createrawtransaction" +slug: "rpc-bch-createrawtransaction" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.createRawTransaction([ + { + "txid": "abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234", + "vout": 0 + } + ], + { + "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa": 0.01 + }) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +The `createrawtransaction` RPC method creates an unsigned raw transaction that spends a set of previous transaction outputs to a set of new addresses with specific amounts. The method can be used to create custom transactions, which can then be signed and broadcasted to the network. + +### Parameters + +* `inputs`: (array, required) An array of objects, each specifying a previous transaction output to spend. + * `txid`: (string, required) The transaction ID of the previous transaction output to spend. + * `vout`: (numeric, required) The index of the output to spend from the previous transaction. + * `sequence`: (numeric, optional) default=depends on the value of the 'replaceable' and 'locktime' arguments) The sequence number +* `outputs`: (object, required) An object with the key-value pairs representing the receiving address and the amount to be sent. +* `locktime`: (numeric, optional, default=0) The lock time for the transaction. It can be used to specify the earliest time or block height at which the transaction can be included in a block. +* `replaceable`: (boolean, optional, default=false) **Marks this transaction as BIP125-replaceable.** Allows this transaction to be replaced by a transaction with higher fees. If provided, it is an error if explicit sequence numbers are incompatible. + +### Return Object + +* (string) A hex-encoded raw transaction. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "id": 1, + "method": "createrawtransaction", + "params": [ + [ + { + "txid": "abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234", + "vout": 0 + } + ], + { + "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa": 0.01 + } + ] +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": "02000000013412cdab3412cdab3412cdab3412cdab3412cdab3412cdab3412cdab3412cdab0000000000fdffffff0140420f00000000001976a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac00000000", + "error": null, + "id": 1 +} + +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/decoderawtransaction.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/decoderawtransaction.md new file mode 100644 index 00000000..b278ecfe --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/decoderawtransaction.md @@ -0,0 +1,132 @@ +--- +title: "decoderawtransaction" +slug: "rpc-bch-decoderawtransaction" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.decodeRawTransaction("02000000013412cdab3412cdab3412cdab3412cdab3412cdab3412cdab3412cdab3412cdab0000000000fdffffff0140420f00000000001976a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac00000000") + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +The `decoderawtransaction` RPC method decodes a serialized (hex-encoded) raw transaction and displays its information in a human-readable format. This method is useful for inspecting raw transactions before broadcasting them to the network or for debugging purposes. + +### Parameters + +* `hex_string`: (string, required) The serialized raw transaction in hex format. + +### Return Object + +An object containing the decoded raw transaction information: + +* `txid`: (string) The transaction ID. +* `hash`: (string) The transaction hash. +* `version`: (numeric) The transaction version. +* `size`: (numeric) The transaction size in bytes. +* `vsize`: (numeric) The virtual transaction size in bytes. +* `weight`: (numeric) The transaction weight. +* `locktime`: (numeric) The lock time for the transaction. +* `vin`: (array) An array of objects, each representing an input of the transaction. + * `txid`: (string) The transaction ID of the previous transaction output to spend. + * `vout`: (numeric) The index of the output to spend from the previous transaction. + * `scriptSig`: (object) The script used to redeem the previous transaction output. + * `asm`: (string) The assembly representation of the script. + * `hex`: (string) The hex-encoded script. + * `sequence`: (numeric) The sequence number. +* `vout`: (array) An array of objects, each representing an output of the transaction. + * `value`: (numeric) The amount sent to the output. + * `n`: (numeric) The index of the output. + * `scriptPubKey`: (object) The script used to lock the output. + * `asm`: (string) The assembly representation of the script. + * `hex`: (string) The hex-encoded script. + * `reqSigs`: (numeric) The required number of signatures. + * `type`: (string) The type of the script (e.g., 'pubkeyhash'). + * `addresses`: (array) An array of addresses associated with the output. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "method": "decoderawtransaction", + "params": ["02000000013412cdab3412cdab3412cdab3412cdab3412cdab3412cdab3412cdab3412cdab0000000000fdffffff0140420f00000000001976a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac00000000"], + "id": 1 +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": { + "txid": "9f5f5e6d36b6a284f52626be505175e43900009e7aa1b88fce74fcd30f0dc258", + "hash": "9f5f5e6d36b6a284f52626be505175e43900009e7aa1b88fce74fcd30f0dc258", + "version": 2, + "size": 85, + "vsize": 85, + "weight": 340, + "locktime": 0, + "vin": [ + { + "txid": "abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234", + "vout": 0, + "scriptSig": { + "asm": "", + "hex": "" + }, + "sequence": 4294967293 + } + ], + "vout": [ + { + "value": 0.01, + "n": 0, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 62e907b15cbf27d5425399ebf6f0fb50ebb88f18 OP_EQUALVERIFY OP_CHECKSIG", + "desc": "addr(1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa)#632p52jr", + "hex": "76a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac", + "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", + "type": "pubkeyhash" + } + } + ] + }, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/decodescript.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/decodescript.md new file mode 100644 index 00000000..321cb2c9 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/decodescript.md @@ -0,0 +1,87 @@ +--- +title: "decodescript" +slug: "rpc-bch-decodescript" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.decodeScript("3044022070cc08500b2203b6ebe7c8285295bc1914a9d252504416e1cde4de4a7dc6c3c8022079af2be6db34efcf147e86a4cbf61cf9995106e5b5e95270d47c40b082052c8501") + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +The `decodescript` RPC method decodes a serialized (hex-encoded) script and provides information about the script in a human-readable format. This method is useful for inspecting scripts for debugging purposes or for understanding their structure. + +### Parameters + +* `hex_string`: (string, required) The serialized script in hex format. + +### Return Object + +An object containing the decoded script information: + +* `asm`: (string) The assembly representation of the script. +* `hex`: (string) The hex-encoded script. +* `type`: (string) The type of the script (e.g., 'pubkeyhash', 'multisig'). +* `reqSigs`: (numeric, optional) The required number of signatures if the script is a multisig script. +* `addresses`: (array, optional) An array of addresses associated with the script if applicable. +* `p2sh`: (string, optional) The P2SH address for this script if applicable. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "method": "decodescript", + "params": ["3044022070cc08500b2203b6ebe7c8285295bc1914a9d252504416e1cde4de4a7dc6c3c8022079af2be6db34efcf147e86a4cbf61cf9995106e5b5e95270d47c40b082052c8501"], + "id": 1 +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": { + "asm": "44022070cc08500b2203b6ebe7c8285295bc1914a9d252504416e1cde4de4a7dc6c3c8022079af2be6db34efcf147e86 OP_MAX OP_UNKNOWN OP_UNKNOWN [error]", + "desc": "raw(3044022070cc08500b2203b6ebe7c8285295bc1914a9d252504416e1cde4de4a7dc6c3c8022079af2be6db34efcf147e86a4cbf61cf9995106e5b5e95270d47c40b082052c8501)#3x5hf724", + "type": "nonstandard" + }, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/estimatefee.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/estimatefee.md new file mode 100644 index 00000000..54557188 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/estimatefee.md @@ -0,0 +1,52 @@ +--- +title: "estimatefee" +slug: "rpc-bch-estimatefee" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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 + +```typescript +import { TatumSDK, BitcoinCash, Network } from '@tatumio/tatum'; + +// Initialize Tatum SDK for Bitcoin Cash +const tatum = await TatumSDK.init({ network: Network.BITCOIN_CASH }); + +// Call the estimatefee method +const estimatedFee = await tatum.rpc.estimateFee(); + +console.log('Estimated fee:', estimatedFee.result); + +// Destroy Tatum SDK - needed for stopping background jobs +await tatum.destroy(); +``` + +### Overview + +The `estimatefee` method is used to estimate the transaction fee for a transaction. It calculates the fee based on the current network conditions. + +### Example use cases: + +1. **Transaction Fee Calculation:** + This method is commonly used by wallet applications to calculate the appropriate transaction fee for a transaction based on the desired confirmation time. + +2. **Custom Fee Estimation:** + Developers can use this method to implement custom fee estimation logic in their applications. + +### Request Parameters + +The `estimatefee` method does not require any parameters. + +### Return Object + +The `estimatefee` method returns an estimated transaction fee in currency unit. The fee is typically represented as a numeric value. diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/estimatesmartfee.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/estimatesmartfee.md new file mode 100644 index 00000000..1b689b15 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/estimatesmartfee.md @@ -0,0 +1,87 @@ +--- +title: "estimatesmartfee" +slug: "rpc-bch-estimatesmartfee" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.estimateSmartFee(20) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +The `estimatesmartfee` method provides an estimated fee rate for a transaction to be confirmed within a certain number of blocks. The estimation is based on recent transactions in the network. + +This method can be useful for users or applications trying to decide on an appropriate fee for their transactions, based on the desired confirmation speed. + +### Parameters + +The `estimatesmartfee` method accepts the following parameters: + +* `conf_target`: An integer representing the number of blocks within which the transaction should be confirmed. +* `estimate_mode` _(optional)_: A string that determines the estimation mode. Possible values are "UNSET", "ECONOMICAL", and "CONSERVATIVE". Default is "CONSERVATIVE". + +### Return Object + +The `estimatesmartfee` method returns an object containing the following fields: + +* `feerate`: A decimal number representing the estimated fee rate/kB. +* `blocks`: An integer representing the number of blocks within which the transaction is expected to be confirmed. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "method": "estimatesmartfee", + "params": [20], + "id": 1 +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": { + "feerate": 0.00017258, + "blocks": 20 + }, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getbestblockhash.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getbestblockhash.md new file mode 100644 index 00000000..0d756aa5 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getbestblockhash.md @@ -0,0 +1,75 @@ +--- +title: "getbestblockhash" +slug: "rpc-bch-getbestblockhash" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getBestBlockHash() + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +`getbestblockhash` is a method that returns the hash of the best (tip) block in the longest blockchain. This method is useful for obtaining the latest block hash, which can be used to fetch block details or confirmations for transactions. + +### Parameters + +This method does not have any parameters. + +### Return Object + +The returned object is a string containing the hash of the best block. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "id": 1, + "jsonrpc": "2.0", + "method": "getbestblockhash" +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "id": 1, + "result": "0000000000000000000ef0e1f703b56f2b0d6724e4eeccf00e4f8d55b9c3c3f6e", + "error": null +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblock.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblock.md new file mode 100644 index 00000000..97372fa2 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblock.md @@ -0,0 +1,128 @@ +--- +title: "getblock" +slug: "rpc-bch-getblock" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getBlock('000000000000000000013d0a85b72c591500abe074a7f9175c596a194f67b82d') + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +`getblock` is a method that returns information about a specified block. This method is useful for obtaining block details such as the hash, height, transactions, and other metadata. It can be used for various purposes, including validating transactions, monitoring the blockchain, and analyzing the network. + +### Parameters + +* `blockhash` (required): The hash of the block to be retrieved. + * Example: `"0000000000000000000ef0e1f703b56f2b0d6724e4eeccf00e4f8d55b9c3c3f6e"` +* `verbosity` (optional): Specifies the level of detail returned for the block. + * `0`: Returns a serialized block as a hex-encoded string (default). + * `1`: Returns a JSON object with block information. + * `2`: Returns a JSON object with block information and detailed transaction data. + * Example: `1` + +### Return Object + +The returned object varies depending on the `verbosity` parameter: + +* If `verbosity` is `0`, the return object is a hex-encoded string of the serialized block. +* If `verbosity` is `1` or `2`, the return object is a JSON object containing the following fields: + * `hash`: The block hash. + * `confirmations`: The number of confirmations for the block. + * `strippedsize`: The block size without witness data. + * `size`: The block size. + * `weight`: The block weight. + * `height`: The block height. + * `version`: The block version. + * `versionHex`: The block version as a hex string. + * `merkleroot`: The Merkle root of the transactions in the block. + * `tx`: An array of transaction identifiers (if `verbosity` is `1`) or detailed transaction objects (if `verbosity` is `2`). + * `time`: The block time in UNIX timestamp format. + * `mediantime`: The median block time of the previous 11 blocks. + * `nonce`: The block nonce. + * `bits`: The block difficulty target as a hex string. + * `difficulty`: The block difficulty. + * `chainwork`: The total work in the blockchain up to this block. + * `nTx`: The number of transactions in the block. + * `previousblockhash`: The hash of the previous block. + * `nextblockhash`: The hash of the next block (if available). + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "id": 1, + "jsonrpc": "2.0", + "method": "getblock", + "params": [ + "000000000000000000013d0a85b72c591500abe074a7f9175c596a194f67b82d", + 1 + ] +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": { + "hash": "000000000000000000013d0a85b72c591500abe074a7f9175c596a194f67b82d", + "confirmations": 1, + "height": 787065, + "version": 536895488, + "versionHex": "20006000", + "merkleroot": "f4d9edf4e50ed243778b553ae0043683a2a9be84c0996f15b30e2e282e6bd2d8", + "time": 1682499730, + "mediantime": 1682496628, + "nonce": 1195457913, + "bits": "1705c739", + "difficulty": 48712405953118.43, + "chainwork": "000000000000000000000000000000000000000046b01da204f6db69fc714174", + "nTx": 4114, + "previousblockhash": "000000000000000000041dd53066beb0577142582ec56573b5260d915311c773", + "strippedsize": 770704, + "size": 1680952, + "weight": 3993064, + "tx": [ + "63b36961bd94b217382409ceb8ec2f3da3d35a24e962e66089946d333f1af82b" + ] + }, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockchaininfo.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockchaininfo.md new file mode 100644 index 00000000..48fbe67a --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockchaininfo.md @@ -0,0 +1,105 @@ +--- +title: "getblockchaininfo" +slug: "rpc-bch-getblockchaininfo" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getBlockChainInfo() + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +`getblockchaininfo` is a method that provides general information about the current state of the blockchain. This method is useful for obtaining an overview of the blockchain, including the best block hash, chain height, difficulty, and network protocol version. It can be used for various purposes, such as monitoring the blockchain, tracking network upgrades, and assessing the current mining difficulty. + +### Parameters + +This method does not have any parameters. + +### Return Object + +The return object is a JSON object containing the following fields: + +* `chain`: The current network name (e.g., "main", "test", or "regtest"). +* `blocks`: The number of blocks in the local best block chain. +* `headers`: The number of headers the local node has validated. +* `bestblockhash`: The hash of the best (tip) block. +* `difficulty`: The current mining difficulty. +* `mediantime`: The median block time of the last 11 blocks in UNIX timestamp format. +* `verificationprogress`: The estimate of the verification progress of the local node as a percentage. +* `initialblockdownload`: A boolean indicating whether the node is in the initial block download mode. +* `chainwork`: The total work in the blockchain up to the best block. +* `size_on_disk`: The estimated size of the block and undo files on disk. +* `pruned`: A boolean indicating whether the block chain is pruned. +* `pruneheight`: The lowest-height complete block stored if the node is pruned (only present if `pruned` is true). +* `softforks`: An array of objects, each containing information about a softfork. +* `bip9_softforks`: An object containing the status of BIP9 softforks in the blockchain. +* `warnings`: Any network and blockchain warnings. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "id": 1, + "jsonrpc": "2.0", + "method": "getblockchaininfo" +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": { + "chain": "main", + "blocks": 787066, + "headers": 787066, + "bestblockhash": "00000000000000000005233c5202951a85538b047e62f4c12c25d9ff65e62f07", + "difficulty": 48712405953118.43, + "time": 1682501447, + "mediantime": 1682496904, + "verificationprogress": 0.9999996042025764, + "initialblockdownload": false, + "chainwork": "000000000000000000000000000000000000000046b049efeeebefbd7f5e5cd6", + "size_on_disk": 540374248868, + "pruned": false, + "warnings": "" + }, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockcount.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockcount.md new file mode 100644 index 00000000..a0d7e4b2 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockcount.md @@ -0,0 +1,75 @@ +--- +title: "getblockcount" +slug: "rpc-bch-getblockcount" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getBlockCount() + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +`getblockcount` is a method that returns the number of blocks in the local best blockchain. This method is useful for obtaining the current height of the blockchain, which can be used for various purposes, such as monitoring the blockchain, determining the number of confirmations for a transaction, or assessing the progress of the blockchain's growth. + +### Parameters + +This method does not have any parameters. + +### Return Object + +The returned object is an integer representing the number of blocks in the local best blockchain. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "id": 1, + "jsonrpc": "2.0", + "method": "getblockcount" +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": 787067, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockhash.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockhash.md new file mode 100644 index 00000000..db28ef99 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockhash.md @@ -0,0 +1,78 @@ +--- +title: "getblockhash" +slug: "rpc-bch-getblockhash" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getBlockHash(587123) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +`getblockhash` is a method that returns the block hash for a specified block height in the local best blockchain. This method is useful for obtaining the hash of a specific block, which can then be used to query for more detailed information about that block using other RPC methods, such as `getblock`. + +### Parameters + +* `height`: The height of the block for which the hash is requested. This is an integer parameter. + + Example: `587123` + +### Return Object + +The return object is a string representing the hash of the block at the specified height. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "method": "getblockhash", + "params": [587123], + "id": 1 +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": "0000000000000000001b4fedbfb3672963c37f965686c2bf6350e32e77f9941f", + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockheader.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockheader.md new file mode 100644 index 00000000..37b97bb8 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockheader.md @@ -0,0 +1,115 @@ +--- +title: "getblockheader" +slug: "rpc-bch-getblockheader" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getBlockHeader("0000000000000000001b4fedbfb3672963c37f965686c2bf6350e32e77f9941f", true) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +`getblockheader` is a method that returns information about a specified block header. This method is useful for obtaining a high-level view of a specific block, including its hash, previous block hash, merkle root, timestamp, difficulty target, and nonce, without having to fetch the entire block's contents. + +### Parameters + +* `blockhash`: The hash of the block for which the header information is requested. This is a string parameter. + + Example: `"`0000000000000000001b4fedbfb3672963c37f965686c2bf6350e32e77f9941f`"` +* `verbose` (optional): A boolean parameter that specifies whether to return the header information in a JSON object (true) or as a serialized hex-encoded string (false). Default is true. + + Example: `true` + +### Return Object + +If `verbose` is set to true (default), the return object is a JSON object containing the following fields: + +* `hash`: The hash of the block. +* `confirmations`: The number of confirmations for the block. +* `height`: The height of the block in the block chain. +* `version`: The block version. +* `versionHex`: The block version formatted as a hex string. +* `merkleroot`: The merkle root of the block. +* `time`: The block timestamp in UNIX format. +* `mediantime`: The median block time of the last 11 blocks in UNIX timestamp format. +* `nonce`: The nonce value for the block. +* `bits`: The encoded difficulty target for the block. +* `difficulty`: The actual difficulty target for the block as a decimal number. +* `chainwork`: The total work in the block chain up to this block. +* `nTx`: The number of transactions in the block. +* `previousblockhash`: The hash of the previous block. +* `nextblockhash`: The hash of the next block (only present if there is a next block). + +If `verbose` is set to false, the return object is a serialized hex-encoded string of the block header. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "method": "getblockheader", + "params": ["0000000000000000001b4fedbfb3672963c37f965686c2bf6350e32e77f9941f", true], + "id": 1 +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": { + "hash": "0000000000000000001b4fedbfb3672963c37f965686c2bf6350e32e77f9941f", + "confirmations": 199945, + "height": 587123, + "version": 549453824, + "versionHex": "20c00000", + "merkleroot": "06bc20da616f96fef435445cbf1bbcc9ff00896dd30c73b875aed7e06902666d", + "time": 1564152126, + "mediantime": 1564151358, + "nonce": 444284193, + "bits": "171f3a08", + "difficulty": 9013786945891.682, + "chainwork": "00000000000000000000000000000000000000000768b223a5622f8f0f1ac0a0", + "nTx": 1820, + "previousblockhash": "0000000000000000001683477bc3c17ab029412183952cb4a37f49968e16e6a8", + "nextblockhash": "00000000000000000007aeb07bc2fe4dbd0b55fc4be751050589b59fe95352fc" + }, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockstats.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockstats.md new file mode 100644 index 00000000..e224b84b --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getblockstats.md @@ -0,0 +1,147 @@ +--- +title: "getblockstats" +slug: "rpc-bch-getblockstats" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getBlockStats("0000000000000000001b4fedbfb3672963c37f965686c2bf6350e32e77f9941f") + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +`getblockstats` is a method that returns various statistics about a specified block. This method is useful for obtaining detailed information about a block, including the number of transactions, transaction volume, fees, and other related data. The results can be used for data analysis, monitoring, and understanding the state of the network at a specific block height. + +### Parameters + +* `hash_or_height`: The block hash or block height for which the statistics are requested. This parameter can be either a string (block hash) or an integer (block height). + + Example (block hash): `"0000000000000000000f92fb968a8d1a2a9c2039e6e99f8c7a0ee3421a44a7d6"` + + Example (block height): `685230` +* `stats` (optional): An array of strings indicating the statistics to be included in the response. If not specified, all available statistics will be returned. + + Example: `["txs", "avgfee"]` + +### Return Object + +The return object is a JSON object containing the requested statistics as key-value pairs. The available statistics are: + +* `avgfee`: The average transaction fee in satoshis. +* `avgfeerate`: The average fee rate in satoshis per virtual byte. +* `avgtxsize`: The average transaction size in bytes. +* `blockhash`: The hash of the block. +* `height`: The height of the block in the block chain. +* `ins`: The total number of inputs in all transactions. +* `maxfee`: The maximum transaction fee in satoshis. +* `maxfeerate`: The maximum fee rate in satoshis per virtual byte. +* `maxtxsize`: The maximum transaction size in bytes. +* `medianfee`: The median transaction fee in satoshis. +* `mediantime`: The median time for the block in UNIX timestamp format. +* `mediantxsize`: The median transaction size in bytes. +* `minfee`: The minimum transaction fee in satoshis. +* `minfeerate`: The minimum fee rate in satoshis per virtual byte. +* `mintxsize`: The minimum transaction size in bytes. +* `outs`: The total number of outputs in all transactions. +* `subsidy`: The block reward in satoshis. +* `swtotal_size`: The total size of all SegWit transactions in bytes. +* `swtotal_weight`: The total weight of all SegWit transactions. +* `swtxs`: The total number of SegWit transactions. +* `time`: The block timestamp in UNIX format. +* `total_size`: The total size of all transactions in bytes. +* `total_weight`: The total weight of all transactions. +* `totalfee`: The total transaction fees in satoshis. +* `txs`: The total number of transactions in the block. +* `utxo_increase`: The increase in the number of unspent transaction outputs. +* `utxo_size_inc`: The increase in the size of the UTXO set. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "method": "getblockstats", + "params": ["0000000000000000001b4fedbfb3672963c37f965686c2bf6350e32e77f9941f"], + "id": 1 +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": { + "avgfee": 10220, + "avgfeerate": 18, + "avgtxsize": 619, + "blockhash": "0000000000000000001b4fedbfb3672963c37f965686c2bf6350e32e77f9941f", + "feerate_percentiles": [ + 6, + 9, + 9, + 15, + 48 + ], + "height": 587123, + "ins": 3615, + "maxfee": 419448, + "maxfeerate": 393, + "maxtxsize": 17196, + "medianfee": 9528, + "mediantime": 1564151358, + "mediantxsize": 374, + "minfee": 136, + "minfeerate": 1, + "mintxsize": 189, + "outs": 3617, + "subsidy": 1250000000, + "swtotal_size": 323742, + "swtotal_weight": 777804, + "swtxs": 616, + "time": 1564152126, + "total_out": 342467209172, + "total_size": 1127251, + "total_weight": 3991840, + "totalfee": 18590521, + "txs": 1820, + "utxo_increase": 2, + "utxo_size_inc": 4000 + }, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getchaintips.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getchaintips.md new file mode 100644 index 00000000..c2f7412d --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getchaintips.md @@ -0,0 +1,243 @@ +--- +title: "getchaintips" +slug: "rpc-bch-getchaintips" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getChainTips() + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +`getchaintips` is a method that returns information about all known tips in the block tree. This method is useful for identifying and analyzing potential forks or alternative chains in the network. It can be used to monitor the health and status of the network or to investigate discrepancies in blockchain data. + +### Parameters + +This method does not require any parameters. + +### Return Object + +The return object is an array of JSON objects, with each object representing a chain tip. The fields in each object are: + +* `height`: The height of the chain tip in the block chain. +* `hash`: The hash of the block corresponding to the chain tip. +* `branchlen`: The length of the branch connected to the main chain. +* `status`: The status of the chain tip, which can be one of the following values: + * `active`: The tip is part of the main chain. + * `valid-fork`: The tip is part of a valid but inactive fork. + * `valid-headers`: The tip is part of a valid fork but with incomplete block data. + * `headers-only`: The tip is a fork with valid headers but incomplete block data and an invalid parent block. + * `invalid`: The tip is part of an invalid fork. + * `unknown`: The tip has an unknown validation state. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "method": "getchaintips", + "id": 1 +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": [ + { + "height": 787067, + "hash": "0000000000000000000348522f4f24304bfcadece8b34c0696faa4f87ec4fdc4", + "branchlen": 0, + "status": "active" + }, + { + "height": 784121, + "hash": "000000000000000000046a2698233ed93bb5e74ba7d2146a68ddb0c2504c980d", + "branchlen": 1, + "status": "invalid" + }, + { + "height": 783830, + "hash": "0000000000000000000366d2c12772a350f507879a5325203424e58ec440249b", + "branchlen": 1, + "status": "valid-headers" + }, + { + "height": 783478, + "hash": "0000000000000000000446f7d3093688ae697386fed3f52a63812678ea6b251d", + "branchlen": 1, + "status": "valid-headers" + }, + { + "height": 783426, + "hash": "00000000000000000002ec935e245f8ae70fc68cc828f05bf4cfa002668599e4", + "branchlen": 1, + "status": "invalid" + }, + { + "height": 782333, + "hash": "00000000000000000001a1abda3a2eb4acc211f64f8748d1a7635aad80690b7a", + "branchlen": 1, + "status": "valid-headers" + }, + { + "height": 782129, + "hash": "000000000000000000036f461ab63c78f08401d3907a67fd2237166d8a373193", + "branchlen": 1, + "status": "valid-headers" + }, + { + "height": 781487, + "hash": "0000000000000000000125e5d7c0d2e1b83982e5284ea21e08f5a73b8109d41b", + "branchlen": 1, + "status": "valid-fork" + }, + { + "height": 781277, + "hash": "0000000000000000000388f42000fa901c01f2bfae36042bbae133ee430e6485", + "branchlen": 1, + "status": "valid-fork" + }, + { + "height": 780994, + "hash": "00000000000000000001b666391fe81859e96fdfdbb83f1a1eafb7951c738c77", + "branchlen": 1, + "status": "valid-headers" + }, + { + "height": 777172, + "hash": "0000000000000000000215ac1b6fd564d8d4707631f6b77273521eb1e242cf28", + "branchlen": 1, + "status": "valid-headers" + }, + { + "height": 776941, + "hash": "00000000000000000004cc87382e38118248ec926716565d50d63f0637c22c07", + "branchlen": 1, + "status": "valid-headers" + }, + { + "height": 772981, + "hash": "0000000000000000000682990a0dae862b48e0451d619938215dd47ed9560200", + "branchlen": 1, + "status": "valid-headers" + }, + { + "height": 771745, + "hash": "00000000000000000004370a77a30add64bba97c26a90ca9643b45a75219b2a6", + "branchlen": 1, + "status": "valid-headers" + }, + { + "height": 771627, + "hash": "00000000000000000005a92bdb6f9d55ea8d2b42579e0db6ca7764f97b6910e1", + "branchlen": 1, + "status": "valid-headers" + }, + { + "height": 763445, + "hash": "000000000000000000065d0f6847466feeeaffa9663895cedde33aa12c262e00", + "branchlen": 1, + "status": "valid-headers" + }, + { + "height": 759781, + "hash": "000000000000000000025edbf5ea025e4af2674b318ba82206f70681d97ca162", + "branchlen": 1, + "status": "valid-fork" + }, + { + "height": 741082, + "hash": "00000000000000000004e2891d08337eb9263b703eb1c897e05dc59e8b246a9b", + "branchlen": 1, + "status": "headers-only" + }, + { + "height": 737096, + "hash": "00000000000000000002b07a9a9f066d463844960542d96e88b4815e063fab08", + "branchlen": 1, + "status": "headers-only" + }, + { + "height": 733430, + "hash": "00000000000000000006ead1cff09f279f7beb31a7290c2a603b0776d98dc334", + "branchlen": 1, + "status": "valid-headers" + }, + { + "height": 730848, + "hash": "000000000000000000029ec31578132d01696910f299f8d104f29b8f8bbdc24f", + "branchlen": 1, + "status": "valid-headers" + }, + { + "height": 723102, + "hash": "00000000000000000006a970fdd8e537521747aff917d909bf3a78b4b68143e1", + "branchlen": 1, + "status": "valid-headers" + }, + { + "height": 715276, + "hash": "00000000000000000009b160476c5f407ccd4957e20346b862d8fc46004759f0", + "branchlen": 1, + "status": "valid-headers" + }, + { + "height": 715139, + "hash": "0000000000000000000407bc4e26035c137869cdb677dfcab268b3faf7d7b5d1", + "branchlen": 1, + "status": "headers-only" + }, + { + "height": 714637, + "hash": "00000000000000000009f819d004fea5bcb77bda25f4906d0a39e79c9ba19590", + "branchlen": 1, + "status": "valid-fork" + }, + { + "height": 714367, + "hash": "0000000000000000000b2e70d7675bc7b4e89d384d0e6e1a7ecc2779e1d93244", + "branchlen": 1, + "status": "valid-headers" + } + ], + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getdifficulty.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getdifficulty.md new file mode 100644 index 00000000..a5fdf873 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getdifficulty.md @@ -0,0 +1,75 @@ +--- +title: "getdifficulty" +slug: "rpc-bch-getdifficulty" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getDifficulty() + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +`getdifficulty` is a method that returns the current mining difficulty. The mining difficulty is a measure of how difficult it is to find a new block compared to the easiest it can ever be. This method can be used to monitor the mining difficulty, which adjusts every 2016 blocks to maintain a consistent block creation rate of approximately 10 minutes per block. + +### Parameters + +This method does not require any parameters. + +### Return Object + +A return object is a floating-point number that represents the current mining difficulty. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "method": "getdifficulty", + "id": 1 +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": 48712405953118.43, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempoolancestors.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempoolancestors.md new file mode 100644 index 00000000..60fd80e5 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempoolancestors.md @@ -0,0 +1,85 @@ +--- +title: "getmempoolancestors" +slug: "rpc-bch-getmempoolancestors" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getMempoolAncestors("3b3c3bc559deddb0991e1fe9fb6d9f10c1c4a0dab4a18c12e8566b37ad4f06e4") + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +`getmempoolancestors` is a method that returns information about the ancestors of a transaction in the memory pool. This method can be used to analyze the dependency relationships between unconfirmed transactions and to investigate potential transaction issues, such as chains of unconfirmed transactions or transactions that depend on others with a low fee. + +### Parameters + +* `txid`: The transaction ID (string, required) of the transaction for which you want to retrieve the ancestors. +* `verbose`: Whether to return a JSON object with detailed information about the ancestors (bool, optional, default = false). If `false`, only the transaction IDs of the ancestors are returned. + +### Return Object + +The return object depends on the `verbose` parameter: + +* If `verbose` is `false`, the return object is an array of strings, each representing the transaction ID of an ancestor. +* If `verbose` is `true`, the return object is a JSON object, where the keys are the transaction IDs of the ancestors, and the values are JSON objects containing detailed information about the ancestors. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "id": 1, + "jsonrpc": "2.0", + "method": "getmempoolancestors", + "params": [ + "3b3c3bc559deddb0991e1fe9fb6d9f10c1c4a0dab4a18c12e8566b37ad4f06e4" + ] +} + +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "id": 1, + "result": [ + "1d1c1bc9a9a7d7b0990e0e1f1b5b5a5a5c5b5a5a5a5a5a5a5a5a5a5a5a5a5a5a" + ] +} + +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempooldescendants.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempooldescendants.md new file mode 100644 index 00000000..ad772686 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempooldescendants.md @@ -0,0 +1,85 @@ +--- +title: "getmempooldescendants" +slug: "rpc-bch-getmempooldescendants" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getMempoolDescendants("3b3c3bc559deddb0991e1fe9fb6d9f10c1c4a0dab4a18c12e8566b37ad4f06e4") + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +The `getmempooldescendants` RPC method allows you to retrieve information about the descendant transactions of a specified transaction in the memory pool. This method is useful for understanding the relationships between unconfirmed transactions and the possible effects of their confirmation on the overall transaction fees and network congestion. + +### Parameters + +* `txid`: (string, required) The transaction ID of the transaction for which you want to get its descendants. +* `verbose`: (boolean, optional, default=`false`) If set to `true`, detailed information about each descendant transaction will be returned, otherwise only the transaction IDs will be returned. + +### Return Object + +The return object depends on the `verbose` parameter: + +* If `verbose` is `false`, the return object is an array of strings, each representing the transaction ID of a descendant. +* If `verbose` is `true`, the return object is a JSON object, where the keys are the transaction IDs of the descendants, and the values are JSON objects containing detailed information about the descendants. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "id": 1, + "jsonrpc": "2.0", + "method": "getmempooldescendants", + "params": [ + "3b3c3bc559deddb0991e1fe9fb6d9f10c1c4a0dab4a18c12e8566b37ad4f06e4" + ] +} + +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "id": 1, + "result": [ + "1d1c1bc9a9a7d7b0990e0e1f1b5b5a5a5c5b5a5a5a5a5a5a5a5a5a5a5a5a5a5a" + ] +} + +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempoolentry.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempoolentry.md new file mode 100644 index 00000000..911ebf04 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempoolentry.md @@ -0,0 +1,114 @@ +--- +title: "getmempoolentry" +slug: "rpc-bch-getmempoolentry" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getMempoolEntry("c7ad51e46a39d136adc2bb7536a236136cc206ab3c8dabcd4277d4cadcf674f2") + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +The `getmempoolentry` RPC method allows you to retrieve information about a specific transaction in the memory pool. This method is useful for tracking the status of unconfirmed transactions and for gathering additional details about their current state. + +### Parameters + +* `txid`: (string, required) The transaction ID of the transaction you want to retrieve information about. + +### Return Object + +The return object will be an object containing information about the specified transaction. + +**Fields** + +* `size`: (numeric) The transaction size in bytes. +* `fee`: (numeric) The transaction fee. +* `modifiedfee`: (numeric) The transaction fee with fee deltas used for mining priority. +* `time`: (numeric) The local time the transaction entered the memory pool. +* `height`: (numeric) The block height when the transaction entered the memory pool. +* `descendantcount`: (numeric) The number of descendant transactions. +* `descendantsize`: (numeric) The virtual transaction size of all descendant transactions combined. +* `descendantfees`: (numeric) The total fees of all descendant transactions. +* `ancestorcount`: (numeric) The number of ancestor transactions. +* `ancestorsize`: (numeric) The virtual transaction size of all ancestor transactions combined. +* `ancestorfees`: (numeric) The total fees of all ancestor transactions. +* `wtxid`: (string) The witness transaction ID of the transaction. +* `depends`: (array) An array containing the witness transaction IDs of the transactions this transaction depends on. +* `spentby`: (array) An array containing the witness transaction IDs of the transactions that spend this transaction. +* `bip125-replaceable`: (string) Whether the transaction is BIP125 replaceable. Possible values are "yes", "no", or "unknown". + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "method": "getmempoolentry", + "params": ["c7ad51e46a39d136adc2bb7536a236136cc206ab3c8dabcd4277d4cadcf674f2"], + "id": 1 +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": { + "vsize": 203, + "weight": 809, + "time": 1682502684, + "height": 787068, + "descendantcount": 1, + "descendantsize": 203, + "ancestorcount": 1, + "ancestorsize": 203, + "wtxid": "c00fc27056ad4305dc65a40a78381a6c923b4311a460ceccd81401016f5c8984", + "fees": { + "base": 0.00005481, + "modified": 0.00005481, + "ancestor": 0.00005481, + "descendant": 0.00005481 + }, + "depends": [], + "spentby": [], + "bip125-replaceable": false, + "unbroadcast": false + }, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempoolinfo.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempoolinfo.md new file mode 100644 index 00000000..71e418eb --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getmempoolinfo.md @@ -0,0 +1,96 @@ +--- +title: "getmempoolinfo" +slug: "rpc-bch-getmempoolinfo" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getMempoolInfo() + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +The `getmempoolinfo` RPC method allows you to retrieve general information about the current memory pool. This method is useful for monitoring the state of the memory pool, such as its size, the total transaction fees, and the minimum fee rate required for transactions to be included in the next block. + +### Parameters + +This method does not require any parameters. + +### Return Object + +The return object will be an object containing general information about the current memory pool. + +**Fields** + +* `size`: (numeric) The number of transactions in the memory pool. +* `bytes`: (numeric) The total size of all transactions in the memory pool, in bytes. +* `usage`: (numeric) The total memory usage of the memory pool, in bytes. +* `maxmempool`: (numeric) The maximum memory usage of the memory pool, in bytes. +* `mempoolminfee`: (numeric) The minimum fee rate required for transactions to be included in the memory pool. +* `minrelaytxfee`: (numeric) The minimum fee rate required for transactions to be relayed across the network. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "method": "getmempoolinfo", + "id": 1 +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": { + "loaded": true, + "size": 28338, + "bytes": 11367166, + "usage": 63671920, + "total_fee": 0.73841041, + "maxmempool": 4000000000, + "mempoolminfee": 0.00001, + "minrelaytxfee": 0.00001, + "incrementalrelayfee": 0.00001, + "unbroadcastcount": 0, + "fullrbf": false + }, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getrawmempool.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getrawmempool.md new file mode 100644 index 00000000..93a623a9 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getrawmempool.md @@ -0,0 +1,123 @@ +--- +title: "getrawmempool" +slug: "rpc-bch-getrawmempool" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getRawMemPool(true) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +The `getrawmempool` RPC method provides information on the transactions currently in the memory pool. This method is useful for getting details about unconfirmed transactions that have not yet been included in a block. + +### Parameters + +* `verbose` (boolean, optional, default=false): Set to `true` to receive a detailed JSON object for each transaction in the memory pool. Set to `false` to receive a simple array of transaction IDs. + +**Example** + +* `verbose`: `true` + +### Return Object + +The return object will depend on the value of the `verbose` parameter. + +* If `verbose` is set to `false`, the method will return an array of transaction IDs. +* If `verbose` is set to `true`, the method will return an object with transaction IDs as keys and detailed transaction information as values. + +**Fields (when verbose is true)** + +* `size`: (numeric) The transaction size in bytes. +* `fee`: (numeric) The transaction fee. +* `modifiedfee`: (numeric) The transaction fee with descendants. +* `time`: (numeric) The local time when the transaction entered the memory pool. +* `height`: (numeric) The block height when the transaction entered the memory pool. +* `descendantcount`: (numeric) The number of descendant transactions in the memory pool. +* `descendantsize`: (numeric) The total size of all descendant transactions in the memory pool, in bytes. +* `descendantfees`: (numeric) The total fees of all descendant transactions in the memory pool, in satoshis. +* `ancestorcount`: (numeric) The number of ancestor transactions in the memory pool. +* `ancestorsize`: (numeric) The total size of all ancestor transactions in the memory pool, in bytes. +* `ancestorfees`: (numeric) The total fees of all ancestor transactions in the memory pool, in satoshis. +* `wtxid`: (string) The transaction witness ID. +* `depends`: (array) An array of unconfirmed transactions that this transaction depends on. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "method": "getrawmempool", + "params": [true], + "id": 1 +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ +"result": { + "940352ce2be1f34f2a88ed32ba9bfcd01d4d8cbd68b79c88ce97115d1d8da8ce": { + "vsize": 151, + "weight": 602, + "time": 1682395086, + "height": 787063, + "descendantcount": 1, + "descendantsize": 151, + "ancestorcount": 2, + "ancestorsize": 1334, + "wtxid": "a824488001981d130794c9982afb0aeab3cdef25b5b9505b50ded0724308e976", + "fees": { + "base": 0.00000307, + "modified": 0.00000307, + "ancestor": 0.00002679, + "descendant": 0.00000307 + }, + "depends": [ + "e17275ca632c7083ce2f36415d4a52eda928901624e90f104c51696bc3338379" + ], + "spentby": [], + "bip125-replaceable": true, + "unbroadcast": false + } + }, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getrawtransaction.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getrawtransaction.md new file mode 100644 index 00000000..6d9fbb97 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/getrawtransaction.md @@ -0,0 +1,178 @@ +--- +title: "getrawtransaction" +slug: "rpc-bch-getrawtransaction" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getRawTransaction("c7ad51e46a39d136adc2bb7536a236136cc206ab3c8dabcd4277d4cadcf674f2") + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +The `getrawtransaction` RPC method retrieves a raw transaction from the blockchain or mempool. It returns the serialized (hex-encoded) transaction data. This method can be used to inspect a transaction's content before it's included in a block or to decode the transaction for further analysis. + +### Parameters + +* `txid`: (string, required) The transaction ID of the transaction to fetch. +* `verbose`: (bool, optional, default=false) If set to `true`, the method returns a JSON object containing information about the transaction. + +### Return Object + +If `verbose` is `false`, the method returns a hex-encoded string representing the serialized transaction data. If `verbose` is `true`, the method returns a JSON object with the following fields: + +* `txid`: (string) The transaction ID. +* `hash`: (string) The transaction hash. +* `version`: (numeric) The transaction version. +* `size`: (numeric) The transaction size. +* `vsize`: (numeric) The virtual transaction size. +* `weight`: (numeric) The transaction's weight. +* `locktime`: (numeric) The transaction locktime. +* `vin`: (array) The transaction inputs. Each object within the array has the following properties: + 1. `txid`: A string representing the transaction ID of the output being spent. This refers to the transaction where the bitcoin spent in the current transaction was received. + 2. `vout`: An integer representing the index of the output in the transaction specified by `txid`. This is the position of the output in that transaction's `vout` array. + 3. `scriptSig`: An object containing two fields, `asm` and `hex`, which represent the unlocking script that satisfies the conditions of the spent output's locking script. `asm` contains the assembly representation of the script, while `hex` contains the hexadecimal representation. + 4. `sequence`: A number representing the sequence number of the input. It can be used to signal relative locktime constraints on the transaction. +* `vout`: (array) The transaction outputs. Each object within the array has the following properties: + 1. `value`: A decimal number representing the amount sent to the output's address. + 2. `n`: An integer representing the index of the output in the transaction's `vout` array. + 3. `scriptPubKey`: An object containing information about the locking script used to lock the output. The object has the following fields: + * `asm`: The assembly representation of the locking script. + * `hex`: The hexadecimal representation of the locking script. + * `reqSigs`: The number of required signatures to unlock the output (relevant for multisig addresses). + * `type`: The type of the locking script (e.g., 'pubkeyhash', 'scripthash', 'multisig', etc.). + * `addresses`: An array of addresses associated with the output. +* `hex`: (string) The serialized transaction data in hex format. +* `blockhash`: (string, optional) The block hash containing the transaction. +* `confirmations`: (numeric, optional) The number of confirmations the transaction has. +* `time`: (numeric, optional) The transaction time in UNIX timestamp format. +* `blocktime`: (numeric, optional) The block time in UNIX timestamp format. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "method": "getrawtransaction", + "params": ["c7ad51e46a39d136adc2bb7536a236136cc206ab3c8dabcd4277d4cadcf674f2", true], + "id": 1 +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": { + "txid": "c7ad51e46a39d136adc2bb7536a236136cc206ab3c8dabcd4277d4cadcf674f2", + "hash": "c00fc27056ad4305dc65a40a78381a6c923b4311a460ceccd81401016f5c8984", + "version": 2, + "size": 284, + "vsize": 203, + "weight": 809, + "locktime": 0, + "vin": [ + { + "txid": "aaeb16390ca5209d8c72a0090a9ca87e6ff6491f239b3496cdb5c99977643583", + "vout": 9, + "scriptSig": { + "asm": "", + "hex": "" + }, + "txinwitness": [ + "3044022070cc08500b2203b6ebe7c8285295bc1914a9d252504416e1cde4de4a7dc6c3c8022079af2be6db34efcf147e86a4cbf61cf9995106e5b5e95270d47c40b082052c8501", + "03c9f7cff5a1d1a5fc107f37609c99d2e0fd699cacdef9696753b626b7508921c0" + ], + "sequence": 4294967294 + } + ], + "vout": [ + { + "value": 0.00112825, + "n": 0, + "scriptPubKey": { + "asm": "0 29a7007eabae2ac56f221aad9c983b77a9f96c3b", + "desc": "addr(bc1q9xnsql4t4c4v2mezr2keexpmw75ljmpm0we75k)#3al0qk8v", + "hex": "001429a7007eabae2ac56f221aad9c983b77a9f96c3b", + "address": "bc1q9xnsql4t4c4v2mezr2keexpmw75ljmpm0we75k", + "type": "witness_v0_keyhash" + } + }, + { + "value": 0.0027, + "n": 1, + "scriptPubKey": { + "asm": "0 24007ed98749dbb504fdea2bd07715c94d4c7751", + "desc": "addr(bc1qysq8akv8f8dm2p8aag4aqac4e9x5ca63yq4c88)#2wxgfkqe", + "hex": "001424007ed98749dbb504fdea2bd07715c94d4c7751", + "address": "bc1qysq8akv8f8dm2p8aag4aqac4e9x5ca63yq4c88", + "type": "witness_v0_keyhash" + } + }, + { + "value": 0.00104468, + "n": 2, + "scriptPubKey": { + "asm": "0 c4c04e31613e2c3dfadaedde383bbfdd7a107d8a", + "desc": "addr(bc1qcnqyuvtp8ckrm7k6ah0rswalm4apqlv2ku24fa)#5rw0gs2m", + "hex": "0014c4c04e31613e2c3dfadaedde383bbfdd7a107d8a", + "address": "bc1qcnqyuvtp8ckrm7k6ah0rswalm4apqlv2ku24fa", + "type": "witness_v0_keyhash" + } + }, + { + "value": 0.41658346, + "n": 3, + "scriptPubKey": { + "asm": "0 b33b0a68aba1d4697d8329f2b7939fb2a46b7332", + "desc": "addr(bc1qkvas569t582xjlvr98et0yulk2jxkuejx27yh4)#savgw9p6", + "hex": "0014b33b0a68aba1d4697d8329f2b7939fb2a46b7332", + "address": "bc1qkvas569t582xjlvr98et0yulk2jxkuejx27yh4", + "type": "witness_v0_keyhash" + } + } + ], + "hex": "020000000001018335647799c9b5cd96349b231f49f66f7ea89c0a09a0728c9d20a50c3916ebaa0900000000feffffff04b9b801000000000016001429a7007eabae2ac56f221aad9c983b77a9f96c3bb01e04000000000016001424007ed98749dbb504fdea2bd07715c94d4c77511498010000000000160014c4c04e31613e2c3dfadaedde383bbfdd7a107d8aeaa77b0200000000160014b33b0a68aba1d4697d8329f2b7939fb2a46b733202473044022070cc08500b2203b6ebe7c8285295bc1914a9d252504416e1cde4de4a7dc6c3c8022079af2be6db34efcf147e86a4cbf61cf9995106e5b5e95270d47c40b082052c85012103c9f7cff5a1d1a5fc107f37609c99d2e0fd699cacdef9696753b626b7508921c000000000", + "blockhash": "00000000000000000004c6125026f00b76e7b762e645a0b0b7ecfa7a7dafdba2", + "confirmations": 7, + "time": 1682503076, + "blocktime": 1682503076 + }, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/gettxout.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/gettxout.md new file mode 100644 index 00000000..017e2515 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/gettxout.md @@ -0,0 +1,108 @@ +--- +title: "gettxout" +slug: "rpc-bch-gettxout" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getTxOut("c7ad51e46a39d136adc2bb7536a236136cc206ab3c8dabcd4277d4cadcf674f2", 1) + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +The `gettxout` RPC method returns details about an unspent transaction output (UTXO). This method can be used to check if a specific transaction output is still unspent and obtain its details such as the value and scriptPubKey. + +### Parameters + +* `txid` (string, required): The transaction ID of the output. +* `n` (numeric, required): The index of the output within the transaction (vout). +* `include_mempool` (boolean, optional, default=true): Whether to include the mempool. Set to `false` to only check for outputs confirmed in the blockchain. + +**Example** + +* `txid`: `"a12345abcdef67890bcdef1234567890abcdef1234567890abcdef1234567890"` +* `n`: `1` +* `include_mempool`: `true` + +### Return Object + +The return object contains the following fields: + +* `bestblock`: (string) The hash of the block at the tip of the blockchain. +* `confirmations`: (numeric) The number of confirmations for the transaction. -1 if the transaction is not yet confirmed and in the mempool. +* `value`: (numeric) The value of the output. +* `scriptPubKey`: (object) Information about the output's scriptPubKey. + * `asm`: (string) The assembly representation of the script. + * `hex`: (string) The hex representation of the script. + * `type`: (string) The type of the script (e.g., `pubkeyhash`, `scripthash`). + * `addresses`: (array) The addresses associated with this output. +* `coinbase`: (boolean) Whether the transaction is a coinbase transaction. +* `version`: (numeric) The transaction version. +* `height`: (numeric) The height of the block containing this output. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "method": "gettxout", + "params": ["c7ad51e46a39d136adc2bb7536a236136cc206ab3c8dabcd4277d4cadcf674f2", 1], + "id": 1 +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": { + "bestblock": "00000000000000000000bb252e11a381e2d9ee948dd8f2c9df9b7cb41adc40b2", + "confirmations": 5, + "value": 0.0027, + "scriptPubKey": { + "asm": "0 24007ed98749dbb504fdea2bd07715c94d4c7751", + "desc": "addr(bc1qysq8akv8f8dm2p8aag4aqac4e9x5ca63yq4c88)#2wxgfkqe", + "hex": "001424007ed98749dbb504fdea2bd07715c94d4c7751", + "address": "bc1qysq8akv8f8dm2p8aag4aqac4e9x5ca63yq4c88", + "type": "witness_v0_keyhash" + }, + "coinbase": false + }, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/gettxoutproof.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/gettxoutproof.md new file mode 100644 index 00000000..b969dcd4 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/gettxoutproof.md @@ -0,0 +1,82 @@ +--- +title: "gettxoutproof" +slug: "rpc-bch-gettxoutproof" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.getTxOutProof(["c7ad51e46a39d136adc2bb7536a236136cc206ab3c8dabcd4277d4cadcf674f2"], "00000000000000000004c6125026f00b76e7b762e645a0b0b7ecfa7a7dafdba2") + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +The `gettxoutproof` RPC method returns a hex-encoded proof that the specified transaction(s) were included in a block. This method can be used to provide proof of inclusion for one or more transactions in the blockchain. + +### Parameters + +* `txids` (array, required): An array of transaction IDs to create a proof for. +* `blockhash` (string, optional): The hash of the block that contains the transactions. If not provided, the method will search for the transactions in the most recent blocks. + +**Example** + +* `txids`: `["`c7ad51e46a39d136adc2bb7536a236136cc206ab3c8dabcd4277d4cadcf674f2`"]` +* `blockhash`: `"`00000000000000000004c6125026f00b76e7b762e645a0b0b7ecfa7a7dafdba2`"` + +### Return Object + +* `hex`: (string) The hex-encoded proof of the transaction(s) inclusion in the block. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "method": "gettxoutproof", + "params": [["c7ad51e46a39d136adc2bb7536a236136cc206ab3c8dabcd4277d4cadcf674f2"], "00000000000000000004c6125026f00b76e7b762e645a0b0b7ecfa7a7dafdba2"], + "id": 1 +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": "00800020208d9c3576f57c3f0c35bd94440f37fe7971cf2b914001000000000000000000db47732e70243f1ae818f635ae4f5cacbacf1230f4dc226f0e62c0871d6e8692a4f5486439c705171a71df638e1100000e8c9aa54adefc4c7b9ccd760b4ee1369bdd5cc7cb8b3e426b4a3b490c2eee5473e8f8f4134d4035e4241a929b9cdac2c22b6d74e0cae88e9ad1f50eeba06ae52659f1c0be83c1705e6642336d47356c39632ca55d11c04f24d09132fd081f5144caf6c733deed2366cd75a4e5a355920cd31c889239e78e195fb15435451f82398b683b27258ff3523cf63a276f38ffe296dd541b99f80cc87ecb40f473e1af2656ac06a0d999105c71c293e571bb62bdd3f0509fe8d5be381d92a76d1659cafcfea20ac316c4cc72a4d81fd7e9d94227cf6457d5412e4ef0d0b32e195a092321e1ad6c16ff7c6a28b39104f3e38a21775f4ea730b25269de7a54eb4dee8752735fe3e7add927cb2f0813a5bddda182776a559d7ba91c3580fb55e49a0bef8186f274f6dccad47742cdab8d3cab06c26c1336a23675bbc2ad36d1396ae451adc759fa97499c565c252524eed6934be8f18f3784f1f7d74a1471c1778af5aa65b6e6ebb5c3625ce00ac09a644aaa8b0b86b679e65c9fa204582ac285368b97eaa7ef2c43019754f8a3e9442c9a6820a25b3d7037fe53ba9d89732f5835939225fa30b5d86694bb5fc5a384e799a22ae82017fb0cf95e70e7bb529725a81e0f96f704afaa5a00", + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/sendrawtransaction.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/sendrawtransaction.md new file mode 100644 index 00000000..4cd0ad1b --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/sendrawtransaction.md @@ -0,0 +1,81 @@ +--- +title: "sendrawtransaction" +slug: "rpc-bch-sendrawtransaction" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.sendRawTransaction("02000000013412cdab3412cdab3412cdab3412cdab3412cdab3412cdab3412cdab3412cdab0000000000fdffffff0140420f00000000001976a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac00000000") + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +The `sendrawtransaction` method submits a serialized raw transaction to the network. If the transaction is well-formed and valid, it will be propagated to the network and included in a mined block. + +This method is commonly used in conjunction with [`createrawtransaction`](createrawtransaction.md), or other methods to construct and sign raw transactions before broadcasting them. + +### Parameters + +The `sendrawtransaction` method accepts the following parameters: + +* `hexstring`: A string representing the serialized raw transaction in hexadecimal format. + +### Return Object + +The `sendrawtransaction` method returns a string containing the transaction ID (txid) of the broadcasted transaction. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "id": 1, + "method": "sendrawtransaction", + "params": ["02000000013412cdab3412cdab3412cdab3412cdab3412cdab3412cdab3412cdab3412cdab0000000000fdffffff0140420f00000000001976a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac00000000"] +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": "c7ad51e46a39d136adc2bb7536a236136cc206ab3c8dabcd4277d4cadcf674f2", + "error": null, + "id": 1 +} + +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/validateaddress.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/validateaddress.md new file mode 100644 index 00000000..73f22e5b --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/validateaddress.md @@ -0,0 +1,98 @@ +--- +title: "validateaddress" +slug: "rpc-bch-validateaddress" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.validateAddress("1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa") + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +`validateaddress` is a method that enables users to verify if a given address is valid. This method provides important information about the address, such as its type and whether it's a spendable or watch-only address. It can be particularly useful in applications where address validation is necessary before performing transactions or when dealing with user-generated addresses to ensure their validity. + +### Parameters + +The `validateaddress` method accepts one required parameter: + +* `address` (string, required): The address to be validated. + +### Return Object + +The `validateaddress` method returns an object with the following fields: + +* `isvalid` (boolean): Indicates if the supplied address is valid. +* `address` (string): The validated address. +* `scriptPubKey` (string): The hex-encoded scriptPubKey generated by the address. +* `isscript` (boolean): Indicates if the address is a script address (P2SH). +* `iswitness` (boolean): Indicates if the address is a witness address (P2WPKH or P2WSH). +* `witness_version` (numeric, optional): The version number of the witness program, if applicable. +* `witness_program` (string, optional): The hex value of the witness program, if applicable. +* `isspendable` (boolean): Indicates if the address is spendable (has the private key). +* `iswatchonly` (boolean): Indicates if the address is watch-only (wallet has the public key but not the private key). +* `iscompressed` (boolean, optional): Indicates if the associated public key is compressed. +* `account` (string, optional): DEPRECATED. The account associated with the address, if any. Example: + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "id": 1, + "method": "validateaddress", + "params": [ + "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa" + ] +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": { + "isvalid": true, + "address": "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", + "scriptPubKey": "76a91462e907b15cbf27d5425399ebf6f0fb50ebb88f1888ac", + "isscript": false, + "iswitness": false + }, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/verifymessage.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/verifymessage.md new file mode 100644 index 00000000..6f147562 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/verifymessage.md @@ -0,0 +1,86 @@ +--- +title: "verifymessage" +slug: "rpc-bch-verifymessage" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.verifyMessage( "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", "HxK7Mw0K6Uox7iGcOe9v9Ll+OZzG7TjTkeTJCD7VHw4yKP4O4a4gFtgm9XNmxfH1tK7JRgYrP/+20xP/ek8iQ2E=", "Hello, this is a signed message.") + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +`verifymessage` is a method that allows users to verify a signed message using a address. This method can be used to confirm the authenticity of a message by verifying that the signature was created by the owner of the address, without revealing the private key. Use cases include proving ownership of an address, verifying the content of a message, or validating communications within a trustless system. + +### Parameters + +The `verifymessage` method accepts three required parameters: + +* `address` (string, required): The address that supposedly signed the message. +* `signature` (string, required): The base64-encoded signature of the message. +* `message` (string, required): The message that was signed. + +### Return Object + +The `verifymessage` method returns a single boolean value: + +* `isvalid` (boolean): Indicates if the signature is valid for the given message and address + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "id": 1, + "method": "verifymessage", + "params": [ + "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa", +"HxK7Mw0K6Uox7iGcOe9v9Ll+OZzG7TjTkeTJCD7VHw4yKP4O4a4gFtgm9XNmxfH1tK7JRgYrP/+20xP/ek8iQ2E=", + "Hello, this is a signed message." + ] +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": false, + "error": null, + "id": 1 +} +``` +{% endcode %} + +\ diff --git a/v1.0/RPC Nodes/rpc-utxo/rpc-bch/verifytxoutproof.md b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/verifytxoutproof.md new file mode 100644 index 00000000..7e4cc4c1 --- /dev/null +++ b/v1.0/RPC Nodes/rpc-utxo/rpc-bch/verifytxoutproof.md @@ -0,0 +1,80 @@ +--- +title: "verifytxoutproof" +slug: "rpc-bch-verifytxoutproof" +excerpt: "BCH RPC" +category: 65c5e93c623cad004b45d505 +hidden: false +metadata: + description: "BCH RPC" + image: [] + keywords: "bch, 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, BitcoinCash, Network } from '@tatumio/tatum' + +const tatum = await TatumSDK.init({network: Network.BITCOIN_CASH}) + +const result = await tatum.rpc.verifyTxOutProof("") + +await tatum.destroy() // Destroy Tatum SDK - needed for stopping background jobs +``` +{% endcode %} +{% endtab %} +{% endtabs %} + +### Overview + +The `verifytxoutproof` RPC method verifies the given transaction proof (in the form of a Merkle block) and returns an array of transaction hashes contained in the verified Merkle block. This method can be used to confirm that specific transactions are included in a block without having to download the entire block. + +### Parameters + +* `proof`: (string, required) The hex-encoded proof generated by the `gettxoutproof` RPC method. + +### Return Object + +* (array of strings) An array of transaction hashes contained in the verified Merkle block. + +### JSON Examples + +Request example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "jsonrpc": "2.0", + "id": 1, + "method": "verifytxoutproof", + "params": [ + "00000020fc61cc9f1bda9ef9e5d6bcccc7f210a0e87e7ccbc017d8487031b91d0000000047451bc9b84a546eafbe39baedb3cda967ea57cf1ab650b24d88395f2e4e3d413e4f22e8d9d9ea1c000000000102000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0100f2052a01000000434104e70b81e35e7cf03f6238471f7d9c903d48aea7c1d067e3010b9000000000000" + ] +} +``` +{% endcode %} + +Response example: + +{% code overflow="wrap" lineNumbers="true" %} +```json +{ + "result": [ + "3e4f22e8d9d9ea1c123456789abcdef0123456789abcdef0123456789abcdef" + ], + "error": null, + "id": 1 +} +``` +{% endcode %} + +\