Skip to content

Commit

Permalink
feat(core): add preview and preprod network magics
Browse files Browse the repository at this point in the history
also rename file NetworkId->ChainId
  • Loading branch information
mkazlauskas authored and mirceahasegan committed Dec 21, 2022
1 parent 252c589 commit 676c576
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/core/src/CML/cmlToCore/certificate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import {
VrfVkHex
} from '../../Cardano/types';
import { Hash28ByteBase16, Hash32ByteBase16 } from '../../Cardano/util/primitives';
import { NetworkId } from '../../Cardano/NetworkId';
import { NetworkId } from '../../Cardano/ChainId';
import { NotImplementedError, SerializationError, SerializationFailure } from '../../errors';
import { usingAutoFree } from '@cardano-sdk/util';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
/**
* Network type (mainnet or **some** testnet)
*/
export enum NetworkId {
Mainnet = 1,
Testnet = 0
}

export enum CardanoNetworkMagic {
Mainnet = 764_824_073,
Preprod = 1,
Preview = 2,
/**
* Legacy public testnet
*/
Testnet = 1_097_911_063
}

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/Cardano/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './NetworkId';
export * from './ChainId';
export * as util from './util';
export * from './types';
2 changes: 1 addition & 1 deletion packages/core/src/Cardano/types/Genesis.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Lovelace } from './Value';
import { NetworkId, NetworkMagic } from '../NetworkId';
import { NetworkId, NetworkMagic } from '../ChainId';

/**
* A compact (without genesis UTxO) representation of the genesis configuration.
Expand Down

0 comments on commit 676c576

Please sign in to comment.