Skip to content

Commit

Permalink
ALL-4895 - Add Cronos subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Hathoriel committed Mar 14, 2024
1 parent d106fe6 commit 024fc41
Show file tree
Hide file tree
Showing 8 changed files with 77 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## [4.2.16] - 2024.2.15

### Added

- Added support for Cronos and Cronos testnet subscriptions.

## [4.2.15] - 2024.3.11

### Added
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.2.15",
"version": "4.2.16",
"description": "Tatum JS SDK",
"author": "Tatum",
"repository": "https://github.com/tatumio/tatum-js",
Expand Down
1 change: 1 addition & 0 deletions src/dto/AddressEventNotificationChain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ export enum AddressEventNotificationChain {
EON = 'EON',
CHZ = 'CHZ',
FLR = 'FLR',
CRO = 'CRO',
}
2 changes: 2 additions & 0 deletions src/dto/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -822,11 +822,13 @@ export const NETWORK_METADATA: Record<Network, NetworkMetadata> = {
currency: Currency.CRO,
testnet: false,
chainId: 25,
defaultMainnet: true,
},
[Network.CRONOS_TESTNET]: {
currency: Currency.CRO,
testnet: true,
chainId: 338,
defaultTestnet: true,
},
[Network.KUCOIN]: {
currency: Currency.KCS,
Expand Down
61 changes: 61 additions & 0 deletions src/e2e/e2e.constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ export const AddressEventNetworks = [
Network.XRP_TESTNET,
Network.TEZOS,
Network.FLARE,
Network.FLARE_COSTON,
Network.FLARE_COSTON_2,
Network.FLARE_SONGBIRD,
Network.CRONOS,
Network.CRONOS_TESTNET,
]

export const IncomingNativeTxNetworks = [
Expand Down Expand Up @@ -62,6 +67,12 @@ export const IncomingNativeTxNetworks = [
Network.XRP,
Network.XRP_TESTNET,
Network.TEZOS,
Network.FLARE,
Network.FLARE_COSTON,
Network.FLARE_COSTON_2,
Network.FLARE_SONGBIRD,
Network.CRONOS,
Network.CRONOS_TESTNET,
]

export const OutgoingNativeTxNetworks = [
Expand Down Expand Up @@ -89,6 +100,12 @@ export const OutgoingNativeTxNetworks = [
Network.XRP,
Network.XRP_TESTNET,
Network.TEZOS,
Network.FLARE,
Network.FLARE_COSTON,
Network.FLARE_COSTON_2,
Network.FLARE_SONGBIRD,
Network.CRONOS,
Network.CRONOS_TESTNET,
]

export const OutgoingFailedNetworks = [
Expand All @@ -104,6 +121,12 @@ export const OutgoingFailedNetworks = [
Network.KLAYTN,
Network.KLAYTN_BAOBAB,
Network.TEZOS,
Network.FLARE,
Network.FLARE_COSTON,
Network.FLARE_COSTON_2,
Network.FLARE_SONGBIRD,
Network.CRONOS,
Network.CRONOS_TESTNET,
]

export const PaidFeeNetworks = [
Expand All @@ -123,6 +146,12 @@ export const PaidFeeNetworks = [
Network.XRP,
Network.XRP_TESTNET,
Network.TEZOS,
Network.FLARE,
Network.FLARE_COSTON,
Network.FLARE_COSTON_2,
Network.FLARE_SONGBIRD,
Network.CRONOS,
Network.CRONOS_TESTNET,
]

export const FungibleTxNetworks = [
Expand All @@ -142,6 +171,12 @@ export const FungibleTxNetworks = [
Network.SOLANA,
Network.SOLANA_DEVNET,
Network.TEZOS,
Network.FLARE,
Network.FLARE_COSTON,
Network.FLARE_COSTON_2,
Network.FLARE_SONGBIRD,
Network.CRONOS,
Network.CRONOS_TESTNET,
]

export const NftNetworks = [
Expand All @@ -161,6 +196,12 @@ export const NftNetworks = [
Network.SOLANA,
Network.SOLANA_DEVNET,
Network.TEZOS,
Network.FLARE,
Network.FLARE_COSTON,
Network.FLARE_COSTON_2,
Network.FLARE_SONGBIRD,
Network.CRONOS,
Network.CRONOS_TESTNET,
]

export const MultitokenNetworks = [
Expand All @@ -175,6 +216,12 @@ export const MultitokenNetworks = [
Network.BINANCE_SMART_CHAIN_TESTNET,
Network.KLAYTN,
Network.KLAYTN_BAOBAB,
Network.FLARE,
Network.FLARE_COSTON,
Network.FLARE_COSTON_2,
Network.FLARE_SONGBIRD,
Network.CRONOS,
Network.CRONOS_TESTNET,
]

export const FailedTxPerBlockNetworks = [
Expand All @@ -194,6 +241,12 @@ export const FailedTxPerBlockNetworks = [
Network.SOLANA,
Network.SOLANA_DEVNET,
Network.TEZOS,
Network.FLARE,
Network.FLARE_COSTON,
Network.FLARE_COSTON_2,
Network.FLARE_SONGBIRD,
Network.CRONOS,
Network.CRONOS_TESTNET,
]

export const ContractAddressLogEventNetworks = [
Expand All @@ -208,6 +261,10 @@ export const ContractAddressLogEventNetworks = [
Network.BINANCE_SMART_CHAIN_TESTNET,
Network.KLAYTN,
Network.KLAYTN_BAOBAB,
Network.FLARE,
Network.FLARE_COSTON,
Network.FLARE_COSTON_2,
Network.FLARE_SONGBIRD,
]

export const InternalTxNetworks = [
Expand All @@ -217,4 +274,8 @@ export const InternalTxNetworks = [
Network.CELO,
Network.CELO_ALFAJORES,
Network.TEZOS,
Network.FLARE,
Network.FLARE_COSTON,
Network.FLARE_COSTON_2,
Network.FLARE_SONGBIRD,
]
2 changes: 2 additions & 0 deletions src/e2e/e2e.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ export const e2eUtil = {
case Network.FLARE_COSTON:
case Network.FLARE_COSTON_2:
case Network.FLARE_SONGBIRD:
case Network.CRONOS:
case Network.CRONOS_TESTNET:
return '0xdb4C3b4350EE869F2D0a2F43ce0292865E2Aa149'
case Network.CELO_ALFAJORES:
return '0xdf083B077F1FD890fC71feCaBbd3F68F94cD21Bf'
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 @@ -53,7 +53,7 @@ export class ArbitrumNova extends BaseEvm {}
export class ArbitrumOne extends BaseEvm {}
export class Aurora extends BaseEvm {}
export class AvalancheC extends BaseEvm {}
export class Cronos extends BaseEvm {}
export class Cronos extends NotificationEvm {}
export class EthereumClassic extends BaseEvm {}
export class Fantom extends BaseEvm {}
export class Gnosis extends BaseEvm {}
Expand Down
3 changes: 3 additions & 0 deletions src/util/util.shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -478,6 +478,9 @@ export const Utils = {
case Network.FLARE_COSTON_2:
case Network.FLARE_SONGBIRD:
return AddressEventNotificationChain.FLR
case Network.CRONOS:
case Network.CRONOS_TESTNET:
return AddressEventNotificationChain.CRO
default:
throw new Error(`Network ${network} is not supported.`)
}
Expand Down

0 comments on commit 024fc41

Please sign in to comment.