diff --git a/packages/models/src/network/network.model.ts b/packages/models/src/network/network.model.ts index 290dc892b..cdd731574 100644 --- a/packages/models/src/network/network.model.ts +++ b/packages/models/src/network/network.model.ts @@ -51,6 +51,21 @@ export type BitcoinNetwork = (typeof bitcoinNetworks)[number]; export type NetworkModes = (typeof networkModes)[number]; type BitcoinTestnetModes = (typeof testnetModes)[number]; +export function bitcoinNetworkToNetworkMode(network: BitcoinNetwork): BitcoinNetworkModes { + switch (network) { + case 'mainnet': + return 'mainnet'; + case 'testnet3': + return 'testnet'; + case 'testnet4': + return 'testnet'; + case 'regtest': + return 'regtest'; + case 'signet': + return 'signet'; + } +} + export type BitcoinNetworkModes = NetworkModes | BitcoinTestnetModes; interface BaseChainConfig { @@ -109,7 +124,7 @@ const networkTestnet: NetworkConfiguration = { }; const networkTestnet4: NetworkConfiguration = { - id: WalletDefaultNetworkConfigurationIds.testnet, + id: WalletDefaultNetworkConfigurationIds.testnet4, name: 'Testnet4', chain: { stacks: { diff --git a/packages/models/src/network/network.schema.ts b/packages/models/src/network/network.schema.ts index a8d12395b..c5828cdfd 100644 --- a/packages/models/src/network/network.schema.ts +++ b/packages/models/src/network/network.schema.ts @@ -1,9 +1,11 @@ import { z } from 'zod'; -import { networkModes, testnetModes } from './network.model'; +import { bitcoinNetworks, networkModes, testnetModes } from './network.model'; export const bitcoinNetworkModesSchema = z.enum([...networkModes, ...testnetModes]); +export const bitcoinNetworkSchema = z.enum([...bitcoinNetworks]); + export const networkConfigurationSchema = z.object({ name: z.string(), id: z.string(),