Skip to content

Commit

Permalink
ALL-10241 - Add ronin (#1141)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hathoriel authored Jan 17, 2025
1 parent d28addf commit b359b62
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/dto/Currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export enum Currency {
CSPR = 'CSPR',
TON = 'TON',
ZKS = 'ZKS',
RON = 'RON',
}

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

// Testnets
ALGORAND_ALGOD_TESTNET = 'algorand-testnet-algod',
Expand Down Expand Up @@ -114,6 +115,7 @@ export enum Network {
ROSTRUM_TESTNET = 'bch-testnet-rostrum',
TON_TESTNET = 'ton-testnet',
ZK_SYNC_TESTNET = 'zksync-testnet',
RONIN_SAIGON = 'ronin-saigon',
}

export const EVM_BASED_NETWORKS = [
Expand Down Expand Up @@ -167,6 +169,8 @@ export const EVM_BASED_NETWORKS = [
Network.CHILIZ,
Network.ZK_SYNC,
Network.ZK_SYNC_TESTNET,
Network.RONIN,
Network.RONIN_SAIGON,
]

export const UTXO_BASED_NETWORKS = [
Expand Down Expand Up @@ -1001,4 +1005,14 @@ export const NETWORK_METADATA: Record<Network, NetworkMetadata> = {
testnet: true,
chainId: 300,
},
[Network.RONIN]: {
currency: Currency.RON,
testnet: false,
chainId: 2020
},
[Network.RONIN_SAIGON]: {
currency: Currency.RON,
chainId: 2021,
testnet: true,
},
}
4 changes: 3 additions & 1 deletion src/e2e/rpc/evm/evm.rpc.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ const testNetworks = [
// { network: Network.OPTIMISM },
{ network: Network.HAQQ },
{ network: Network.HAQQ_TESTNET },
{ network: Network.RONIN },
{ network: Network.RONIN_SAIGON },
// {
// network: Network.TRON,
// data: {
Expand Down Expand Up @@ -71,7 +73,7 @@ const testNetworks = [
},
// { network: Network.CRONOS },
{ network: Network.CRONOS_TESTNET, apiKey: ApiKey.testnet },
{ network: Network.BASE },
// { network: Network.BASE },
{ network: Network.ZK_SYNC, url: 'https://mainnet.era.zksync.io' },
{ network: Network.ZK_SYNC_TESTNET, url: 'https://sepolia.era.zksync.dev' },
]
Expand Down
2 changes: 1 addition & 1 deletion src/e2e/rpc/other/tatum.rpc.tezos.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { e2eUtil } from '../../e2e.util'
const getTezosRpc = async (testnet?: boolean) =>
await TatumSDK.init<Tezos>(e2eUtil.initConfig(testnet ? Network.TEZOS_TESTNET : Network.TEZOS))

describe.each([false, true])(`Tezos`, (testnet: boolean) => {
describe.skip.each([false, true])(`Tezos`, (testnet: boolean) => {
describe(`${testnet ? 'Testnet' : 'Mainnet'}`, () => {
it('getBlock', async () => {
const tatum = await getTezosRpc(testnet)
Expand Down
1 change: 1 addition & 0 deletions src/service/tatum/tatum.evm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ export class Optimism extends NotificationEvm {}
export class Palm extends BaseEvm {}
export class Vechain extends BaseEvm {}
export class XinFin extends BaseEvm {}
export class Ronin extends BaseEvm {}
export class Base extends NotificationEvm {}
export class Flare extends NotificationEvm {}
export class Chiliz extends NotificationEvm {}
Expand Down
4 changes: 4 additions & 0 deletions src/util/constant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ export const Constant = {
[Network.TON_TESTNET]: 9,
[Network.ZK_SYNC]: 18,
[Network.ZK_SYNC_TESTNET]: 18,
[Network.RONIN]: 18,
[Network.RONIN_SAIGON]: 18,
},
CURRENCY_NAMES: {
[Network.BITCOIN]: 'BTC',
Expand Down Expand Up @@ -244,6 +246,8 @@ export const Constant = {
[Network.TON_TESTNET]: 'TON',
[Network.ZK_SYNC]: 'ZKS',
[Network.ZK_SYNC_TESTNET]: 'ZKS',
[Network.RONIN]: 'RON',
[Network.RONIN_SAIGON]: 'RON',
},
RPC: {
MAINNETS: [
Expand Down
5 changes: 4 additions & 1 deletion src/util/util.shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ import {
Oasis,
Optimism,
Palm,
Polygon,
Polygon, Ronin,
Rostrum,
Solana,
Stellar,
Expand Down Expand Up @@ -913,6 +913,9 @@ export const Utils = {
case Network.BASE:
case Network.BASE_SEPOLIA:
return new Base(id) as T
case Network.RONIN:
case Network.RONIN_SAIGON:
return new Ronin(id) as T
case Network.KADENA:
case Network.KADENA_TESTNET:
return new Kadena(id) as T
Expand Down

0 comments on commit b359b62

Please sign in to comment.