Skip to content

Commit

Permalink
ALL-3289 - Add Cardano Rpc support (#1022)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hathoriel authored Nov 15, 2023
1 parent 4be940b commit 0214594
Show file tree
Hide file tree
Showing 13 changed files with 955 additions and 41 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## [4.1.29] - 2023.11.15
### Added
- Added RPC support for the CARDANO_ROSETTA network. Users can now make RPC calls to these network using the `Network.CARDANO_ROSETTA` network.

## [4.1.28] - 2023.11.13
### Fixed
- Fixed lb archive fallback
Expand Down
59 changes: 32 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,34 +44,35 @@ With Tatum SDK, you can:

Interact seamlessly with various blockchains through native RPC calls. Say goodbye to the hassle of juggling separate RPC clients for each blockchain.

| Documentation |
|----------------------------------------------------------------------------------------------------------|
| **EVM Blockchains** |
| [Ethereum RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/ethereum-rpc-documentation) |
| [Polygon RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/polygon-rpc-documentation) |
| [Flare RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/flare-rpc-documentation) |
| [Haqq RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/haqq-rpc-documentation) |
| [Optimism RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/optimism-rpc-documentation) |
| [Horizen EON RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/horizen-eon-rpc-documentation) |
| [Arbitrum One RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/arbitrum-rpc-documentation) |
| [Chiliz RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/chiliz-rpc-documentation) |
| Documentation |
|-----------------------------------------------------------------------------------------------------------|
| **EVM Blockchains** |
| [Ethereum RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/ethereum-rpc-documentation) |
| [Polygon RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/polygon-rpc-documentation) |
| [Flare RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/flare-rpc-documentation) |
| [Haqq RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/haqq-rpc-documentation) |
| [Optimism RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/optimism-rpc-documentation) |
| [Horizen EON RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/horizen-eon-rpc-documentation) |
| [Arbitrum One RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/arbitrum-rpc-documentation) |
| [Chiliz RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/chiliz-rpc-documentation) |
| [Ethereum Classic RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/ethereum-classic-rpc-documentation) |
| [Klaytn RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/klaytn-rpc-documentation) |
| [Avalanche RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/avalanche-rpc-documentation) |
| [Celo RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/celo-rpc-documentation) |
| **UTXO Blockchains** |
| [Bitcoin RPC](https://docs.tatum.io/docs/rpc/utxo-blockchains/bitcoin-rpc-documentation) |
| [Litecoin RPC](https://docs.tatum.io/docs/rpc/utxo-blockchains/litecoin-rpc-documentation) |
| [Dogecoin RPC](https://docs.tatum.io/docs/rpc/utxo-blockchains/dogecoin-rpc-documentation) |
| [ZCash RPC](https://docs.tatum.io/docs/rpc/utxo-blockchains/zcash-rpc-documentation) |
| [Bitcoin Cash RPC](https://docs.tatum.io/docs/rpc/utxo-blockchains/bitcion-cash-rpc-documentation) |
| **Other Blockchains** |
| [Solana RPC](https://docs.tatum.io/docs/rpc/solana-rpc-documentation) |
| [XPR RPC](https://docs.tatum.io/docs/rpc/xrp-rpc-documentation) |
| [Tron RPC](https://docs.tatum.io/docs/rpc/tron-rpc-documentation) |
| [Eos RPC](https://docs.tatum.io/docs/rpc/eos-rpc-documentation) |
| [Tezos RPC](https://docs.tatum.io/docs/rpc/tezos-rpc-documentation) |
| [Agorand RPC](https://docs.tatum.io/docs/rpc/algorand-rpc-documentation) |
| [Klaytn RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/klaytn-rpc-documentation) |
| [Avalanche RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/avalanche-rpc-documentation) |
| [Celo RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/celo-rpc-documentation) |
| **UTXO Blockchains** |
| [Bitcoin RPC](https://docs.tatum.io/docs/rpc/utxo-blockchains/bitcoin-rpc-documentation) |
| [Litecoin RPC](https://docs.tatum.io/docs/rpc/utxo-blockchains/litecoin-rpc-documentation) |
| [Dogecoin RPC](https://docs.tatum.io/docs/rpc/utxo-blockchains/dogecoin-rpc-documentation) |
| [ZCash RPC](https://docs.tatum.io/docs/rpc/utxo-blockchains/zcash-rpc-documentation) |
| [Bitcoin Cash RPC](https://docs.tatum.io/docs/rpc/utxo-blockchains/bitcion-cash-rpc-documentation) |
| **Other Blockchains** |
| [Solana RPC](https://docs.tatum.io/docs/rpc/solana-rpc-documentation) |
| [XPR RPC](https://docs.tatum.io/docs/rpc/xrp-rpc-documentation) |
| [Tron RPC](https://docs.tatum.io/docs/rpc/tron-rpc-documentation) |
| [Eos RPC](https://docs.tatum.io/docs/rpc/eos-rpc-documentation) |
| [Tezos RPC](https://docs.tatum.io/docs/rpc/tezos-rpc-documentation) |
| [Agorand RPC](https://docs.tatum.io/docs/rpc/algo-rpc-documentation) |
| [Cardano RPC](https://docs.tatum.io/docs/rpc/cardano-rpc-documentation) |

### πŸ”” Create Notifications

Expand Down Expand Up @@ -489,6 +490,8 @@ This section provides a list of various blockchain network status pages, powered
| [algorand-testnet-algod.status.tatum.io](https://algorand-testnet-algod.status.tatum.io) |
| [algorand-mainnet-indexer.status.tatum.io](https://algorand-mainnet-indexer.status.tatum.io) |
| [algorand-testnet-indexer.status.tatum.io](https://algorand-testnet-indexer.status.tatum.io) |
| [cardano-mainnet.status.tatum.io](https://cardano-mainnet.status.tatum.io) |
| [cardano-preprod.status.tatum.io](https://cardano-preprod.status.tatum.io) |



Expand Down Expand Up @@ -594,6 +597,8 @@ Here are the list of nodes for each blockchain:
| [rpc.tatum.io/algorand-testnet-algod/list.json](https://rpc.tatum.io/algorand-testnet-algod/list.json) |
| [rpc.tatum.io/algorand-mainnet-indexer/list.json](https://rpc.tatum.io/algorand-mainnet-indexer/list.json) |
| [rpc.tatum.io/algorand-testnet-indexer/list.json](https://rpc.tatum.io/algorand-testnet-indexer/list.json) |
| [rpc.tatum.io/cardano-mainnet/list.json](https://rpc.tatum.io/cardano-mainnet/list.json) |
| [rpc.tatum.io/cardano-preprod/list.json](https://rpc.tatum.io/cardano-preprod/list.json) |


Following pattern defines the URL for fetching the list of nodes:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tatumio/tatum",
"version": "4.1.28",
"version": "4.1.29",
"description": "Tatum JS SDK",
"author": "Tatum",
"repository": "https://github.com/tatumio/tatum-js",
Expand Down
2 changes: 0 additions & 2 deletions src/api/api.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,6 @@ export function networkToChain(network: Network): Chain {
return ChainEnum.POLYGON
case Network.POLYGON_MUMBAI:
return ChainEnum.POLYGON_MUMBAI
case Network.CARDANO:
return ChainEnum.POLYGON_MUMBAI
default:
throw new Error(`Unsupported network ${network}`)
}
Expand Down
12 changes: 8 additions & 4 deletions src/dto/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export enum Network {
BNB = 'bnb-beacon-chain-mainnet',
BITCOIN = 'bitcoin-mainnet',
BITCOIN_CASH = 'bitcoin-cash-mainnet',
CARDANO = 'cardano-mainnet',
CARDANO_ROSETTA = 'cardano-mainnet',
CELO = 'celo-mainnet',
CRONOS = 'cro-mainnet',
DOGECOIN = 'doge-mainnet',
Expand Down Expand Up @@ -59,7 +59,7 @@ export enum Network {
BINANCE_SMART_CHAIN_TESTNET = 'bsc-testnet',
BITCOIN_TESTNET = 'bitcoin-testnet',
BITCOIN_CASH_TESTNET = 'bch-testnet',
CARDANO_PREPROD = 'cardano-preprod',
CARDANO_ROSETTA_PREPROD = 'cardano-preprod',
CELO_ALFAJORES = 'celo-testnet',
CRONOS_TESTNET = 'cro-testnet',
DOGECOIN_TESTNET = 'doge-testnet',
Expand Down Expand Up @@ -172,8 +172,8 @@ export const DATA_API_UTXO_NETWORKS = [
Network.BITCOIN_TESTNET,
Network.LITECOIN,
Network.LITECOIN_TESTNET,
Network.CARDANO,
Network.CARDANO_PREPROD,
Network.CARDANO_ROSETTA,
Network.CARDANO_ROSETTA_PREPROD,
Network.DOGECOIN,
Network.DOGECOIN_TESTNET,
]
Expand Down Expand Up @@ -238,6 +238,7 @@ export const BNB_LOAD_BALANCER_NETWORKS = [Network.BNB]
export const TEZOS_NETWORKS = [Network.TEZOS, Network.TEZOS_TESTNET]
export const ALGORAND_ALGOD_NETWORKS = [Network.ALGORAND_ALGOD, Network.ALGORAND_ALGOD_TESTNET]
export const ALGORAND_INDEXER_NETWORKS = [Network.ALGORAND_INDEXER, Network.ALGORAND_INDEXER_TESTNET]
export const CARDANO_NETWORKS = [Network.CARDANO_ROSETTA, Network.CARDANO_ROSETTA_PREPROD]

export const LOAD_BALANCER_NETWORKS = [
...UTXO_LOAD_BALANCER_NETWORKS,
Expand All @@ -251,6 +252,7 @@ export const LOAD_BALANCER_NETWORKS = [
...TEZOS_NETWORKS,
...ALGORAND_ALGOD_NETWORKS,
...ALGORAND_INDEXER_NETWORKS,
...CARDANO_NETWORKS,
]

export const EVM_ARCHIVE_NON_ARCHIVE_LOAD_BALANCER_NETWORKS = [
Expand Down Expand Up @@ -324,6 +326,8 @@ export const isAlgorandAlgodNetwork = (network: Network) => ALGORAND_ALGOD_NETWO

export const isAlgorandIndexerNetwork = (network: Network) => ALGORAND_INDEXER_NETWORKS.includes(network)

export const isCardanoNetwork = (network: Network) => CARDANO_NETWORKS.includes(network)

export const isSameGetBlockNetwork = (network: Network) =>
isUtxoBasedNetwork(network) ||
isEvmBasedNetwork(network) ||
Expand Down
Loading

0 comments on commit 0214594

Please sign in to comment.