diff --git a/CHANGELOG.md b/CHANGELOG.md index 42e1cd2466..3078c4907d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [3.1.9] - 2023.09.26 +### Added +- Added RPC support for the Horizen Eon Gobi and Chiliz networks. Users can now make RPC calls to these networks using the `Network.HORIZEN_EON_GOBI` and `Network.CHILIZ` network. + ## [3.1.8] - 2023.09.22 ### Added - Capability to initialize `TatumSDK` with various extensions from Extension Ecosystem using the init() method and `TatumConfig.configureExtensions`. diff --git a/package.json b/package.json index 93d58e308e..582b5a4917 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@tatumio/tatum", - "version": "3.1.8", + "version": "3.1.9", "description": "Tatum JS SDK", "author": "Tatum", "repository": "https://github.com/tatumio/tatum-js", diff --git a/src/dto/Network.ts b/src/dto/Network.ts index 302a83417d..c974324c35 100644 --- a/src/dto/Network.ts +++ b/src/dto/Network.ts @@ -16,6 +16,7 @@ export enum Network { DOGECOIN = 'doge-mainnet', EOS = 'eos-mainnet', HORIZEN_EON = 'eon-mainnet', + CHILIZ = 'chiliz-mainnet', ETHEREUM = 'ethereum-mainnet', ETHEREUM_CLASSIC = 'ethereum-classic-mainnet', FANTOM = 'fantom-mainnet', @@ -70,6 +71,7 @@ export enum Network { GNOSIS_TESTNET = 'gno-testnet', HAQQ_TESTNET = 'haqq-testnet', HARMONY_ONE_TESTNET_SHARD_0 = 'one-testnet-s0', + HORIZEN_EON_GOBI = 'horizen-eon-gobi', KLAYTN_BAOBAB = 'klaytn-baobab', KUCOIN_TESTNET = 'kcs-testnet', LITECOIN_TESTNET = 'litecoin-testnet', @@ -139,6 +141,8 @@ export const EVM_BASED_NETWORKS = [ Network.ARBITRUM_ONE, Network.BINANCE_SMART_CHAIN, Network.HORIZEN_EON, + Network.HORIZEN_EON_GOBI, + Network.CHILIZ, ] export const UTXO_BASED_NETWORKS = [ @@ -203,8 +207,10 @@ export const EVM_LOAD_BALANCER_NETWORKS = [ Network.OPTIMISM, Network.OPTIMISM_TESTNET, Network.HORIZEN_EON, + Network.HORIZEN_EON_GOBI, Network.ARBITRUM_ONE, Network.BINANCE_SMART_CHAIN, + Network.CHILIZ, ] export const TRON_LOAD_BALANCER_NETWORKS = [Network.TRON] @@ -222,6 +228,7 @@ export const EVM_ARCHIVE_NON_ARCHIVE_LOAD_BALANCER_NETWORKS = [ Network.HAQQ_TESTNET, Network.POLYGON, Network.POLYGON_MUMBAI, + Network.CHILIZ, ] export const SOLANA_NETWORKS = [Network.SOLANA, Network.SOLANA_DEVNET] diff --git a/src/e2e/rpc/evm/evm.rpc.spec.ts b/src/e2e/rpc/evm/evm.rpc.spec.ts index 80ba7d05eb..ceccd2e47f 100644 --- a/src/e2e/rpc/evm/evm.rpc.spec.ts +++ b/src/e2e/rpc/evm/evm.rpc.spec.ts @@ -11,6 +11,8 @@ const testNetworks = [ apiKey: process.env.V3_API_KEY_TESTNET, }, { network: Network.HORIZEN_EON, expected: { chainId: 7332 } }, + { network: Network.HORIZEN_EON_GOBI, expected: { chainId: 7332 } }, + { network: Network.CHILIZ, expected: { chainId: 7332 } }, { network: Network.BINANCE_SMART_CHAIN, expected: { chainId: 56 } }, { network: Network.BINANCE_SMART_CHAIN_TESTNET, diff --git a/src/service/tatum/tatum.ts b/src/service/tatum/tatum.ts index 65a486cb17..f45d4f7b2d 100644 --- a/src/service/tatum/tatum.ts +++ b/src/service/tatum/tatum.ts @@ -3,6 +3,7 @@ import { isLoadBalancerNetwork } from '../../dto' import { EvmBasedRpcSuite, SolanaRpcSuite, TronRpcSuite, UtxoBasedRpcSuite, XrpRpcSuite } from '../../dto/rpc' import { CONFIG, Constant, Utils } from '../../util' import { Address, AddressTezos, AddressTron } from '../address' +import { TatumSdkContainer, TatumSdkExtension } from '../extensions' import { FeeEvm, FeeUtxo } from '../fee' import { Nft, NftTezos } from '../nft' import { Notification } from '../notification' @@ -11,22 +12,25 @@ import { LoadBalancer } from '../rpc/generic/LoadBalancer' import { Token } from '../token' import { WalletProvider } from '../walletProvider' import { ApiVersion, TatumConfig } from './tatum.dto' -import { TatumSdkContainer, TatumSdkExtension } from "../extensions"; export interface ITatumSdkChain { - extension(type: new (tatumSdkContainer: TatumSdkContainer, ...args: unknown[]) => T): T + extension( + type: new (tatumSdkContainer: TatumSdkContainer, ...args: unknown[]) => T, + ): T } export abstract class TatumSdkChain implements ITatumSdkChain { - protected constructor(readonly id: string) { } + protected constructor(readonly id: string) {} - extension(type: new (tatumSdkContainer: TatumSdkContainer, ...args: unknown[]) => T): T { - return Container.of(this.id).get(type); - } + extension( + type: new (tatumSdkContainer: TatumSdkContainer, ...args: unknown[]) => T, + ): T { + return Container.of(this.id).get(type) + } - destroy(): void { - Container.of(this.id).reset( {strategy: 'resetServices' }) - } + destroy(): void { + Container.of(this.id).reset({ strategy: 'resetServices' }) + } } export class BaseTatumSdk extends TatumSdkChain { @@ -98,6 +102,7 @@ export class Polygon extends BaseEvmClass {} export class Vechain extends BaseEvmClass {} export class Xdc extends BaseEvmClass {} export class HorizenEon extends BaseEvmClass {} +export class Chiliz extends BaseEvmClass {} // UTXO chains export class Bitcoin extends BaseUtxoClass {} diff --git a/src/util/constant.ts b/src/util/constant.ts index 24e5827b66..8ebf025548 100644 --- a/src/util/constant.ts +++ b/src/util/constant.ts @@ -82,6 +82,7 @@ export const Constant = { [Network.ETHEREUM_CLASSIC]: 18, [Network.EOS]: 4, [Network.HORIZEN_EON]: 18, + [Network.HORIZEN_EON_GOBI]: 18, [Network.EOS_TESTNET]: 4, [Network.TEZOS]: 6, [Network.TEZOS_TESTNET]: 6, @@ -109,6 +110,7 @@ export const Constant = { [Network.FLARE_SONGBIRD]: 18, [Network.HAQQ]: 18, [Network.HAQQ_TESTNET]: 18, + [Network.CHILIZ]: 18, }, CURRENCY_NAMES: { [Network.BITCOIN]: 'BTC', @@ -176,6 +178,7 @@ export const Constant = { [Network.ETHEREUM_CLASSIC]: 'ETC', [Network.EOS]: 'EOS', [Network.HORIZEN_EON]: 'EON', + [Network.HORIZEN_EON_GOBI]: 'EON', [Network.EOS_TESTNET]: 'EOS', [Network.TEZOS]: 'XTZ', [Network.TEZOS_TESTNET]: 'XTZ', @@ -199,6 +202,7 @@ export const Constant = { [Network.ZILLIQA_TESTNET]: 'ZIL', [Network.HAQQ]: 'HAQQ', [Network.HAQQ_TESTNET]: 'HAQQ', + [Network.CHILIZ]: 'CHILIZ', }, RPC: { MAINNETS: [ @@ -243,6 +247,7 @@ export const Constant = { Network.XRP, Network.ZCASH, Network.ZILLIQA, + Network.CHILIZ, ], TESTNETS: [ Network.ALGORAND_TESTNET, @@ -285,6 +290,7 @@ export const Constant = { Network.XRP_TESTNET, Network.ZCASH_TESTNET, Network.ZILLIQA_TESTNET, + Network.HORIZEN_EON_GOBI, ], }, OPEN_RPC: { diff --git a/src/util/util.shared.ts b/src/util/util.shared.ts index da39521714..7fd83487de 100644 --- a/src/util/util.shared.ts +++ b/src/util/util.shared.ts @@ -30,6 +30,7 @@ import { Bitcoin, BitcoinCash, Celo, + Chiliz, Cronos, Dogecoin, Ethereum, @@ -383,7 +384,10 @@ export const Utils = { case Network.TEZOS: return new Tezos(id) as T case Network.HORIZEN_EON: + case Network.HORIZEN_EON_GOBI: return new HorizenEon(id) as T + case Network.CHILIZ: + return new Chiliz(id) as T default: return new BaseTatumSdk(id) as T }