Skip to content

Commit

Permalink
ALL-10470 - Add sonic & kaia
Browse files Browse the repository at this point in the history
  • Loading branch information
Hathoriel committed Feb 19, 2025
1 parent 5f55226 commit d95cba5
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 4 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.47] - 2025.2.19

### Added

- Added sonic & kaia

## [4.2.46] - 2025.2.5

### Removed
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.46",
"version": "4.2.47",
"description": "Tatum JS SDK",
"author": "Tatum",
"repository": "https://github.com/tatumio/tatum-js",
Expand Down
2 changes: 2 additions & 0 deletions src/dto/Currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ export enum Currency {
TON = 'TON',
ZKS = 'ZKS',
RON = 'RON',
SONIC = 'SONIC',
KAIA = 'KAIA',
}

export function networkToCurrency(network: Network): Currency {
Expand Down
28 changes: 28 additions & 0 deletions src/dto/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export enum Network {
TON = 'ton-mainnet',
ZK_SYNC = 'zksync-mainnet',
RONIN = 'ronin-mainnet',
SONIC_MAINNET = 'sonic-mainnet',
KAIA_MAINNET = 'kaia-mainnet',

// Testnets
ALGORAND_ALGOD_TESTNET = 'algorand-testnet-algod',
Expand Down Expand Up @@ -115,6 +117,8 @@ export enum Network {
TON_TESTNET = 'ton-testnet',
ZK_SYNC_TESTNET = 'zksync-testnet',
RONIN_SAIGON = 'ronin-saigon',
SONIC_BLAZE = 'sonic-blaze',
KAIA_KAIROS = 'kaia-kairos',
}

export const EVM_BASED_NETWORKS = [
Expand Down Expand Up @@ -170,6 +174,10 @@ export const EVM_BASED_NETWORKS = [
Network.ZK_SYNC_TESTNET,
Network.RONIN,
Network.RONIN_SAIGON,
Network.KAIA_MAINNET,
Network.KAIA_KAIROS,
Network.SONIC_MAINNET,
Network.SONIC_BLAZE
]

export const UTXO_BASED_NETWORKS = [
Expand Down Expand Up @@ -1005,4 +1013,24 @@ export const NETWORK_METADATA: Record<Network, NetworkMetadata> = {
chainId: 2021,
testnet: true,
},
[Network.SONIC_MAINNET]: {
currency: Currency.SONIC,
testnet: false,
chainId: 146
},
[Network.SONIC_BLAZE]: {
currency: Currency.SONIC,
testnet: true,
chainId: 57054
},
[Network.KAIA_MAINNET]: {
currency: Currency.KAIA,
testnet: false,
chainId: 8217
},
[Network.KAIA_KAIROS]: {
currency: Currency.KAIA,
testnet: true,
chainId: 1001
}
}
2 changes: 2 additions & 0 deletions src/service/tatum/tatum.evm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ export class Palm extends BaseEvm {}
export class Vechain extends BaseEvm {}
export class XinFin extends BaseEvm {}
export class Ronin extends BaseEvm {}
export class Sonic extends BaseEvm {}
export class Kaia extends BaseEvm {}
export class Base extends NotificationEvm {}
export class Flare extends NotificationEvm {}
export class Chiliz extends NotificationEvm {}
Expand Down
8 changes: 8 additions & 0 deletions src/util/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,10 @@ export const Constant = {
[Network.ZK_SYNC_TESTNET]: 18,
[Network.RONIN]: 18,
[Network.RONIN_SAIGON]: 18,
[Network.KAIA_MAINNET]: 18,
[Network.KAIA_KAIROS]: 18,
[Network.SONIC_MAINNET]: 18,
[Network.SONIC_BLAZE]: 18
},
CURRENCY_NAMES: {
[Network.BITCOIN]: 'BTC',
Expand Down Expand Up @@ -246,6 +250,10 @@ export const Constant = {
[Network.ZK_SYNC_TESTNET]: 'ZKS',
[Network.RONIN]: 'RON',
[Network.RONIN_SAIGON]: 'RON',
[Network.KAIA_MAINNET]: 'KAIA',
[Network.KAIA_KAIROS]: 'KAIA',
[Network.SONIC_MAINNET]: 'SONIC',
[Network.SONIC_BLAZE]: 'SONIC',
},
RPC: {
MAINNETS: [
Expand Down
13 changes: 10 additions & 3 deletions src/util/util.shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,17 @@ import {
HarmonyOne,
HorizenEon,
Iota,
Kadena,
Kadena, Kaia,
Klaytn,
Kucoin,
Litecoin,
Oasis,
Optimism,
Palm,
Polygon, Ronin,
Polygon,
Ronin,
Rostrum,
Solana,
Solana, Sonic,
Stellar,
TatumConfig,
Tezos,
Expand Down Expand Up @@ -886,6 +887,12 @@ export const Utils = {
case Network.RONIN:
case Network.RONIN_SAIGON:
return new Ronin(id) as T
case Network.SONIC_BLAZE:
case Network.SONIC_MAINNET:
return new Sonic(id) as T
case Network.KAIA_MAINNET:
case Network.KAIA_KAIROS:
return new Kaia(id) as T
case Network.KADENA:
case Network.KADENA_TESTNET:
return new Kadena(id) as T
Expand Down

0 comments on commit d95cba5

Please sign in to comment.