Skip to content

Commit

Permalink
ALL-3626 Added Support for XinFin Network (#1032)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hathoriel authored Dec 1, 2023
1 parent e67fff9 commit f57a5ee
Show file tree
Hide file tree
Showing 8 changed files with 36 additions and 24 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.33] - 2023.12.1
### Added
- Added RPC support for the XINFIN network. Users can now make RPC calls to these network using the `Network.XINFIN` network.

## [4.1.32] - 2023.11.29
### Fixed
- Fixed logic of IPFS upload, now upload passes request using client's version
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ Interact seamlessly with various blockchains through native RPC calls. Say goodb
| [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) |
| [XinFin RPC](https://docs.tatum.io/docs/rpc/evm-blockchains/xinfin-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) |
Expand Down Expand Up @@ -492,6 +493,7 @@ This section provides a list of various blockchain network status pages, powered
| [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) |
| [xinfin-mainnet-archive.status.tatum.io](https://xinfin-mainnet-archive.status.tatum.io) |



Expand Down Expand Up @@ -599,6 +601,7 @@ Here are the list of nodes for each blockchain:
| [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) |
| [rpc.tatum.io/xinfin-mainnet-archive/list.json](https://rpc.tatum.io/xinfin-mainnet-archive/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.32",
"version": "4.1.33",
"description": "Tatum JS SDK",
"author": "Tatum",
"repository": "https://github.com/tatumio/tatum-js",
Expand Down
9 changes: 5 additions & 4 deletions src/dto/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export enum Network {
TEZOS = 'tezos-mainnet',
TRON = 'tron-mainnet',
VECHAIN = 'vechain-mainnet',
XDC = 'xdc-mainnet',
XINFIN = 'xinfin-mainnet',
XRP = 'ripple-mainnet',
ZCASH = 'zcash-mainnet',
ZILLIQA = 'zilliqa-mainnet',
Expand Down Expand Up @@ -92,7 +92,7 @@ export enum Network {
TEZOS_TESTNET = 'tezos-testnet',
TRON_SHASTA = 'tron-testnet',
VECHAIN_TESTNET = 'vechain-testnet',
XDC_TESTNET = 'xdc-testnet',
XINFIN_TESTNET = 'xdc-testnet',
XRP_TESTNET = 'ripple-testnet',
ZCASH_TESTNET = 'zcash-testnet',
ZILLIQA_TESTNET = 'zilliqa-testnet',
Expand All @@ -119,8 +119,8 @@ export const EVM_BASED_NETWORKS = [
Network.BINANCE_SMART_CHAIN_TESTNET,
Network.VECHAIN,
Network.VECHAIN_TESTNET,
Network.XDC,
Network.XDC_TESTNET,
Network.XINFIN,
Network.XINFIN_TESTNET,
Network.PALM,
Network.PALM_TESTNET,
Network.CRONOS,
Expand Down Expand Up @@ -227,6 +227,7 @@ export const EVM_LOAD_BALANCER_NETWORKS = [
Network.AVALANCHE_C,
Network.CELO,
Network.CELO_ALFAJORES,
Network.XINFIN,
]

export const TRON_LOAD_BALANCER_NETWORKS = [Network.TRON]
Expand Down
16 changes: 10 additions & 6 deletions src/e2e/rpc/evm/evm.rpc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const testNetworks = [
expected: { chainId: 421613 },
apiKey: process.env.V3_API_KEY_TESTNET,
},
//{ network: Network.HORIZEN_EON, expected: { chainId: 7332 } },
{ network: Network.HORIZEN_EON, expected: { chainId: 7332 } },
{ network: Network.HORIZEN_EON_GOBI, expected: { chainId: 1663 } },
{ network: Network.CHILIZ, expected: { chainId: 88888 } },
{ network: Network.BINANCE_SMART_CHAIN, expected: { chainId: 56 } },
Expand All @@ -29,7 +29,7 @@ const testNetworks = [
{ network: Network.ETHEREUM_HOLESKY, expected: { chainId: 17000 } },
{ network: Network.ETHEREUM_CLASSIC, expected: { chainId: 61 } },
{ network: Network.POLYGON, expected: { chainId: 137 } },
//{ network: Network.POLYGON_MUMBAI, expected: { chainId: 80001 } },
{ network: Network.POLYGON_MUMBAI, expected: { chainId: 80001 } },
{ network: Network.OPTIMISM, expected: { chainId: 10 } },
{ network: Network.HAQQ, expected: { chainId: 11235 } },
{ network: Network.HAQQ_TESTNET, expected: { chainId: 54211 } },
Expand All @@ -53,10 +53,10 @@ const testNetworks = [
skipEstimateGas: true,
apiKey: process.env.V3_API_KEY_TESTNET,
},
// {
// network: Network.KLAYTN,
// expected: { chainId: 8217 },
// },
{
network: Network.KLAYTN,
expected: { chainId: 8217 },
},
{
network: Network.KLAYTN_BAOBAB,
expected: { chainId: 1001 },
Expand All @@ -71,6 +71,10 @@ const testNetworks = [
expected: { chainId: 43113 },
apiKey: process.env.V3_API_KEY_TESTNET,
},
{
network: Network.XINFIN,
expected: { chainId: 50 },
},
]

describe.each(testNetworks)('RPC EVM', (testNetwork) => {
Expand Down
2 changes: 1 addition & 1 deletion src/service/tatum/tatum.evm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export class Oasis extends BaseEvm {}
export class Optimism extends BaseEvm {}
export class Palm extends BaseEvm {}
export class Vechain extends BaseEvm {}
export class Xdc extends BaseEvm {}
export class XinFin extends BaseEvm {}
export class Chiliz extends NotificationEvm {}

export class HorizenEon extends FaucetEvm {
Expand Down
16 changes: 8 additions & 8 deletions src/util/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ export const Constant = {
[Network.GNOSIS_TESTNET]: 10200,
[Network.VECHAIN]: 100009,
[Network.VECHAIN_TESTNET]: 100010,
[Network.XDC]: 50,
[Network.XDC_TESTNET]: 51,
[Network.XINFIN]: 50,
[Network.XINFIN_TESTNET]: 51,
[Network.OPTIMISM_TESTNET]: 420,
},
ChainMapInverse: {
Expand Down Expand Up @@ -154,8 +154,8 @@ export const Constant = {
[Network.RSK_TESTNET]: 18,
[Network.VECHAIN]: 18,
[Network.VECHAIN_TESTNET]: 18,
[Network.XDC]: 18,
[Network.XDC_TESTNET]: 18,
[Network.XINFIN]: 18,
[Network.XINFIN_TESTNET]: 18,
[Network.ZILLIQA]: 12,
[Network.ZILLIQA_TESTNET]: 12,
[Network.FLARE]: 18,
Expand Down Expand Up @@ -254,8 +254,8 @@ export const Constant = {
[Network.RSK_TESTNET]: 'RBTC',
[Network.VECHAIN]: 'VET',
[Network.VECHAIN_TESTNET]: 'VET',
[Network.XDC]: 'XDC',
[Network.XDC_TESTNET]: 'XDC',
[Network.XINFIN]: 'XDC',
[Network.XINFIN_TESTNET]: 'XDC',
[Network.ZILLIQA]: 'ZIL',
[Network.ZILLIQA_TESTNET]: 'ZIL',
[Network.HAQQ]: 'HAQQ',
Expand Down Expand Up @@ -302,7 +302,7 @@ export const Constant = {
Network.TEZOS,
Network.TRON,
Network.VECHAIN,
Network.XDC,
Network.XINFIN,
Network.XRP,
Network.ZCASH,
Network.ZILLIQA,
Expand Down Expand Up @@ -346,7 +346,7 @@ export const Constant = {
Network.TEZOS_TESTNET,
Network.TRON_SHASTA,
Network.VECHAIN_TESTNET,
Network.XDC_TESTNET,
Network.XINFIN_TESTNET,
Network.XRP_TESTNET,
Network.ZCASH_TESTNET,
Network.ZILLIQA_TESTNET,
Expand Down
8 changes: 4 additions & 4 deletions src/util/util.shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ import {
Tron,
UtxoRpc,
Vechain,
Xdc,
XinFin,
Xrp,
ZCash,
} from '../service'
Expand Down Expand Up @@ -635,9 +635,9 @@ export const Utils = {
case Network.VECHAIN:
case Network.VECHAIN_TESTNET:
return new Vechain(id) as T
case Network.XDC:
case Network.XDC_TESTNET:
return new Xdc(id) as T
case Network.XINFIN:
case Network.XINFIN_TESTNET:
return new XinFin(id) as T
case Network.XRP:
case Network.XRP_TESTNET:
return new Xrp(id) as T
Expand Down

0 comments on commit f57a5ee

Please sign in to comment.