From e49f6397fc5e5578cee96ea24f08093ed59ad8ea Mon Sep 17 00:00:00 2001 From: Jan Musil Date: Mon, 27 May 2024 08:40:20 +0200 Subject: [PATCH] ALL-7154 - Cosmos methods update --- .../rpc-cosmos-constructionmetadata.md | 2 +- .../rpc-cosmos-constructionpayloads.md | 2 +- .../rpc-cosmos/rpc-cosmos-deriveaccount.md | 6 +- .../rpc-cosmos-getaccountbalance.md | 6 +- .../rpc-cosmos/rpc-cosmos-getaccountcoins.md | 12 +- .../rpc-cosmos-gethashoftransaction.md | 4 +- .../rpc-cosmos/rpc-cosmos-getnetworklist.md | 7 +- .../rpc-cosmos/rpc-cosmos-getnetworkstatus.md | 4 +- .../rpc-cosmos/rpc-cosmos-parsetransaction.md | 2 +- .../rpc-cosmos-searchtransactions.md | 125 ------------------ 10 files changed, 25 insertions(+), 145 deletions(-) delete mode 100644 v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-searchtransactions.md diff --git a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-constructionmetadata.md b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-constructionmetadata.md index 36740d9..91a21f7 100644 --- a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-constructionmetadata.md +++ b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-constructionmetadata.md @@ -58,7 +58,7 @@ The `constructionMetadata` method retrieves metadata necessary to construct tran ## Request Example ```json -curl --location 'https://api.tatum.io/v3/blockchain/node/cosmos/' \ +curl --location 'https://api.tatum.io/v3/blockchain/node/cosmos-mainnet/construction/metadata' \ --header 'Content-Type: application/json' \ --header 'x-api-key: {API_KEY}' \ --data '{ diff --git a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-constructionpayloads.md b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-constructionpayloads.md index e3d0c31..a21765c 100644 --- a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-constructionpayloads.md +++ b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-constructionpayloads.md @@ -85,7 +85,7 @@ The `constructionPayloads` contains the network, a slice of operations, and arbi ## Request Example ```json -curl --location 'https://api.tatum.io/v3/blockchain/node/cosmos/' \ +curl --location 'https://api.tatum.io/v3/blockchain/node/cosmos-mainnet/construction/payloads' \ --header 'Content-Type: application/json' \ --header 'x-api-key: {API_KEY}' \ --data '{ diff --git a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-deriveaccount.md b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-deriveaccount.md index 3ca612c..f8ca1d8 100644 --- a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-deriveaccount.md +++ b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-deriveaccount.md @@ -56,7 +56,7 @@ curl --location 'https://api.tatum.io/v3/blockchain/node/cosmos-mainnet/construc --data '{ "networkIdentifier": { "blockchain": "cosmos", - "network": "cosmos-mainnet" + "network": "mainnet" }, "publicKeys": { "hexBytes": "PUBLIC_KEY_HEX_BYTES", @@ -76,8 +76,8 @@ const cosmos = await TatumSDK.init({ // Define the input parameters with only required fields const params = { networkIdentifier: { - blockchain: "COSMOS", - network: "COSMOS_MAINNET", + blockchain: "cosmos", + network: "mainnet", }, publicKeys: { hexBytes: "PUBLIC_KEY_HEX_BYTES", // Hexadecimal representation of the public key. diff --git a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getaccountbalance.md b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getaccountbalance.md index 8d256cb..475b1bf 100644 --- a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getaccountbalance.md +++ b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getaccountbalance.md @@ -78,7 +78,7 @@ curl --location 'https://api.tatum.io/v3/blockchain/node/cosmos-mainnet/account/ --data '{ "networkIdentifier": { "blockchain": "cosmos", - "network": "cosmos-mainnet" + "network": "mainnet" }, "accountIdentifier": { "address": "{{address}}", @@ -97,8 +97,8 @@ const cosmos = await TatumSDK.init({ // Define the input parameters with only required fields const params = { networkIdentifier: { - blockchain: "COSMOS", - network: "COSMOS_MAINNET", + blockchain: "cosmos", + network: "mainnet", }, accountIdentifier: { address: "{{address}}", diff --git a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getaccountcoins.md b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getaccountcoins.md index b33df22..83883e8 100644 --- a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getaccountcoins.md +++ b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getaccountcoins.md @@ -81,11 +81,11 @@ curl --location 'https://api.tatum.io/v3/blockchain/node/cosmos-mainnet/account/ --header 'x-api-key: {API_KEY}' \ --data '{ "networkIdentifier": { - "blockchain": "{{blockchain}}", - "network": "{{network}}" + "blockchain": "cosmos", + "network": "mainnet" }, "accountIdentifier": { - "address": "{{address}}", + "address": "cosmos1...", }, "include_mempool": true }' @@ -99,11 +99,11 @@ const {{blockchain}} = await TatumSDK.init({ network: Network.COSMOS_MAI const accountCoins = await tatum.rpc.getAccountCoins({ networkIdentifier: { - blockchain: "{{blockchain}}", - network: "{{network}}" + blockchain: "cosmos", + network: "mainnet" }, accountIdentifier: { - address: "{{address}}", + address: "cosmos1...", }, include_mempool: true }); diff --git a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-gethashoftransaction.md b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-gethashoftransaction.md index 2403255..baa9ae1 100644 --- a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-gethashoftransaction.md +++ b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-gethashoftransaction.md @@ -27,8 +27,8 @@ This method is essential for obtaining a transaction hash from a signed transact | Name | Type | Required | Description | | ---------------------- | ---------------------------------- | -------- | ------------------------------------------------------------------- | | `networkIdentifier` | object | Yes | Identifies the Cosmos blockchain and network details. | -| `blockchain` | string (from networkIdentifier) | Yes | The blockchain identifier, typically "Cosmos". | -| `network` | string (from networkIdentifier) | Yes | The network name, e.g., "cosmos-mainnet". | +| `blockchain` | string (from networkIdentifier) | Yes | The blockchain identifier, typically "cosmos". | +| `network` | string (from networkIdentifier) | Yes | The network name, e.g., "mainnet". | | `subNetworkIdentifier` | object (from networkIdentifier) | No | Optional sub-network identifier object. | | `network` | string (from subNetworkIdentifier) | Yes | The name of the sub-network within Cosmos. | | `metadata` | object (from subNetworkIdentifier) | No | Metadata associated with the sub-network. | diff --git a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getnetworklist.md b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getnetworklist.md index 7bc0ec4..809b3ac 100644 --- a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getnetworklist.md +++ b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getnetworklist.md @@ -53,7 +53,12 @@ The method returns a comprehensive list of all supported networks, including ess curl --location 'https://api.tatum.io/v3/blockchain/node/cosmos-mainnet/network/list' \ --header 'Content-Type: application/json' \ --header 'x-api-key: {API_KEY}' \ ---data '{} +--data '{ + "network_identifier": { + "blockchain": "cosmos", + "network": "mainnet" + } +}' ``` ```typescript import { TatumSDK, Cosmos, Network } from "@tatumio/tatum"; diff --git a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getnetworkstatus.md b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getnetworkstatus.md index 3f903db..33f07f9 100644 --- a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getnetworkstatus.md +++ b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-getnetworkstatus.md @@ -24,7 +24,7 @@ The `getNetworkStatus` method provides real-time information about the operation | ---------------------- | ---------------------------------- | -------- | --------------------------------------------------------------- | | `networkIdentifier` | object | Yes | Identifies the Cosmos blockchain and network details. | | `blockchain` | string (from networkIdentifier) | Yes | The blockchain identifier, typically "Cosmos". | -| `network` | string (from networkIdentifier) | Yes | The network name, e.g., "cosmos-mainnet". | +| `network` | string (from networkIdentifier) | Yes | The network name, e.g., "mainnet". | | `subNetworkIdentifier` | object (from networkIdentifier) | No | Optional sub-network identifier object. | | `network` | string (from subNetworkIdentifier) | Yes | The name of the sub-network within Cosmos. | | `metadata` | object (from subNetworkIdentifier) | No | Metadata associated with the sub-network. | @@ -108,7 +108,7 @@ const cosmos = await TatumSDK.init({ const networkStatus = await tatum.rpc.getNetworkStatus({ networkIdentifier: { blockchain: "cosmos", - network: "cosmos-mainnet", + network: "mainnet", }, }); diff --git a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-parsetransaction.md b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-parsetransaction.md index e1621fe..c26e048 100644 --- a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-parsetransaction.md +++ b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-parsetransaction.md @@ -74,7 +74,7 @@ curl --location 'https://api.tatum.io/v3/blockchain/node/cosmos-mainnet/construc --data '{ "network_identifier": { "blockchain": "cosmos", - "network": "cosmos-mainnet" + "network": "mainnet" }, "signed": true, "transaction": "TRANSACTION_BLOB" diff --git a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-searchtransactions.md b/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-searchtransactions.md deleted file mode 100644 index 8fef6c6..0000000 --- a/v1.0/RPC Nodes/rpc-others/rpc-cosmos/rpc-cosmos-searchtransactions.md +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: "searchTransactions" -slug: "rpc-cosmos-searchtransactions" -category: "6620f7e31ea673003624a8ce" -parentDoc: "662a3ee8730164006e9b0cd5" -excerpt: "Cosmos RPC" -hidden: false -metadata: - description: "Search for transactions in the Cosmos blockchain based on various criteria." - image: [] - keywords: "cosmos, rpc, search, transactions" - robots: "index" -createdAt: "Wed Mar 06 2024 10:35:44 GMT+0000 (Coordinated Universal Time)" -updatedAt: "Sat Apr 06 2024 12:59:40 GMT+0000 (Coordinated Universal Time)" ---- - -## Overview - -The `searchTransactions` method allows you to search for transactions matching a set of provided conditions in canonical blocks. This can be useful for querying transaction data based on various criteria. - -## Parameters - -| Name | Type | Required | Description | -| ----------------------- | ----------------------------------- | -------- | --------------------------------------------------------------- | -| `networkIdentifier` | object | Yes | Identifies the Cosmos blockchain and network details. | -| `blockchain` | string (from networkIdentifier) | Yes | The blockchain identifier, typically "Cosmos". | -| `network` | string (from networkIdentifier) | Yes | The network name on which the transaction is taking place. | -| `subNetworkIdentifier` | object (from networkIdentifier) | No | Optional sub-network identifier object. | -| `network` | string (from subNetworkIdentifier) | Yes | The name of the sub-network within Cosmos. | -| `metadata` | object (from subNetworkIdentifier) | No | Metadata associated with the sub-network. | -| `operator` | enum | No | Conditions `or` and `and` for complex queries. | -| `max_block` | number | No | The largest block index to consider. | -| `offset` | number | No | The offset into the result set to start returning transactions. | -| `limit` | number | No | The maximum number of transactions to return. | -| `transactionIdentifier` | object | No | Identifies the transaction by hash. | -| `hash` | string (from transactionIdentifier) | Yes | The hash of the transaction. | -| `accountIdentifier` | object | No | Information about the account involved. | -| `address` | string (from accountIdentifier) | Yes | The Cosmos account address associated with the operation. | -| `sub_account` | object (from accountIdentifier) | No | Optional sub-account object. | -| `metadata` | object (from accountIdentifier) | No | Metadata for the account. | -| `coinIdentifier` | object | No | Conditions for coin identifier. | -| `identifier` | string (from coinIdentifier) | Yes | A globally unique identifier of a Coin. | -| `currency` | object | No | Specifies the currency details. | -| `symbol` | string (from currency) | Yes | The symbol or code of the currency. | -| `decimals` | number (from currency) | Yes | The number of decimal places for the currency. | -| `status` | string | No | The network-specific operation status type. | -| `type` | string | No | The network-specific operation type. | -| `address` | string | No | Account address for transaction search. | -| `success` | boolean | No | A synthetic condition indicating success. | - -## Returns - -| Field | Description | -| -------------- | ------------------------------------------------------ | -| `transactions` | A list of transactions that match the search criteria. | - -## Example Result - -```json -{ - "transactions": [ - { - "transaction_identifier": { - "hash": "TRANSACTION_HASH" - }, - "operations": [ - { - "operation_identifier": { - "index": 0 - }, - "type": "TRANSFER", - "status": "SUCCESS", - "account": { - "address": "cosmos1..." - }, - "amount": { - "value": "-1000", - "currency": { - "symbol": "ATOM", - "decimals": 6 - } - } - } - ] - } - ], - "total_count": 5, - "next_offset": 5 -} -``` - -## Request Example - -```json -curl --location 'https://api.tatum.io/v3/blockchain/node/cosmos-mainnet/search/transactions' \ ---header 'Content-Type: application/json' \ ---header 'x-api-key: {API_KEY}' \ ---data '{ - "network_identifier": { - "blockchain": "cosmos", - "network": "mainnet" - } -}' -``` - -```typescript -import { TatumSDK, Cosmos, Network } from "@tatumio/tatum"; - -const cosmos = await TatumSDK.init({ - network: Network.COSMOS_MAINNET, -}); - -const transactions = await cosmos.rpc.searchTransactions({ - networkIdentifier: { - blockchain: "cosmos", - network: "mainnet", - }, -}); - -// Log the retrieved transactions -console.log("Transactions:", transactions); - -// Always destroy the Tatum SDK instance when done to stop any background processes -await tatum.destroy(); -```