@@ -8,13 +8,12 @@ import {
88 bufferCVFromString ,
99 callReadOnlyFunction ,
1010 ClarityType ,
11- ChainID ,
1211} from '@stacks/transactions' ;
1312import {
1413 BnsGetNamePriceResponse ,
1514 BnsGetNamespacePriceResponse ,
1615} from '@stacks/stacks-blockchain-api-types' ;
17- import { isValidPrincipal } from './../../../helpers' ;
16+ import { ChainID , getChainIDNetwork , isValidPrincipal } from './../../../helpers' ;
1817import { PgStore } from '../../../datastore/pg-store' ;
1918import { getBnsContractID , GetStacksNetwork } from '../../../event-stream/bns/bns-helpers' ;
2019import { logger } from '../../../logger' ;
@@ -34,7 +33,9 @@ export function createBnsPriceRouter(db: PgStore, chainId: ChainID): express.Rou
3433 const randomPrivKey = makeRandomPrivKey ( ) ;
3534 const address = getAddressFromPrivateKey (
3635 randomPrivKey . data ,
37- chainId === ChainID . Mainnet ? TransactionVersion . Mainnet : TransactionVersion . Testnet
36+ getChainIDNetwork ( chainId ) === 'mainnet'
37+ ? TransactionVersion . Mainnet
38+ : TransactionVersion . Testnet
3839 ) ;
3940 const bnsContractIdentifier = getBnsContractID ( chainId ) ;
4041 if ( ! bnsContractIdentifier || ! isValidPrincipal ( bnsContractIdentifier ) ) {
@@ -87,7 +88,9 @@ export function createBnsPriceRouter(db: PgStore, chainId: ChainID): express.Rou
8788 const randomPrivKey = makeRandomPrivKey ( ) ;
8889 const address = getAddressFromPrivateKey (
8990 randomPrivKey . data ,
90- chainId === ChainID . Mainnet ? TransactionVersion . Mainnet : TransactionVersion . Testnet
91+ getChainIDNetwork ( chainId ) === 'mainnet'
92+ ? TransactionVersion . Mainnet
93+ : TransactionVersion . Testnet
9194 ) ;
9295
9396 const bnsContractIdentifier = getBnsContractID ( chainId ) ;
0 commit comments