Skip to content

Commit

Permalink
ALL-5088 - Add Casper rpc (#1111)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hathoriel authored Jun 18, 2024
1 parent 179fa52 commit e67fd3c
Show file tree
Hide file tree
Showing 15 changed files with 666 additions and 20 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [4.2.34] - 2024.6.178
### Added

- Support for Casper mainnet

## [4.2.33] - 2024.6.17

### 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.33",
"version": "4.2.34",
"description": "Tatum JS SDK",
"author": "Tatum",
"repository": "https://github.com/tatumio/tatum-js",
Expand Down
1 change: 1 addition & 0 deletions src/dto/Currency.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ export enum Currency {
KADENA = 'KADENA',
ATOM = 'ATOM',
IOTA = 'IOTA',
CSPR = 'CSPR',
}

export function networkToCurrency(network: Network): Currency {
Expand Down
9 changes: 9 additions & 0 deletions src/dto/Network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export enum Network {
ZCASH = 'zcash-mainnet',
ZILLIQA = 'zilliqa-mainnet',
BITCOIN_ELECTRS = 'bitcoin-mainnet-electrs',
CASPER = 'casper-mainnet',


// Testnets
Expand Down Expand Up @@ -265,6 +266,7 @@ export const ROSTRUM_LOAD_BALANCER_NETWORKS = [Network.ROSTRUM, Network.BITCOIN_
export const IOTA_LOAD_BALANCER_NETWORKS = [Network.IOTA]
export const BITCOIN_ELECTRS_NETWORKS = [Network.BITCOIN_ELECTRS, Network.BITCOIN_ELECTRS_TESTNET]
export const IOTA_NETWORKS = [Network.IOTA, Network.IOTA_TESTNET]
export const CASPER_NETWORKS = [Network.CASPER]

export const LOAD_BALANCER_NETWORKS = [
...UTXO_LOAD_BALANCER_NETWORKS,
Expand All @@ -285,6 +287,7 @@ export const LOAD_BALANCER_NETWORKS = [
...ROSTRUM_LOAD_BALANCER_NETWORKS,
...IOTA_LOAD_BALANCER_NETWORKS,
...BITCOIN_ELECTRS_NETWORKS,
...CASPER_NETWORKS,
]

export const EVM_ARCHIVE_NON_ARCHIVE_LOAD_BALANCER_NETWORKS = [
Expand Down Expand Up @@ -383,6 +386,8 @@ export const isIotaNetwork = (network: Network) => IOTA_NETWORKS.includes(networ

export const isElectrsNetwork = (network: Network) => BITCOIN_ELECTRS_NETWORKS.includes(network)

export const isCasperNetwork = (network: Network) => CASPER_NETWORKS.includes(network)

export const isSameGetBlockNetwork = (network: Network) =>
isUtxoBasedNetwork(network) ||
isEvmBasedNetwork(network) ||
Expand Down Expand Up @@ -952,4 +957,8 @@ export const NETWORK_METADATA: Record<Network, NetworkMetadata> = {
currency: Currency.BTC,
testnet: true,
},
[Network.CASPER]: {
currency: Currency.CSPR,
testnet: false,
}
}
Loading

0 comments on commit e67fd3c

Please sign in to comment.