MCPcopy Create free account
hub / github.com/CashScript/cashscript / getNetworkPrefix

Function getNetworkPrefix

packages/cashscript/src/utils.ts:342–356  ·  view source on GitHub ↗
(network: string)

Source from the content-addressed store, hash-verified

340}
341
342export function getNetworkPrefix(network: string): 'bitcoincash' | 'bchtest' | 'bchreg' {
343 switch (network) {
344 case Network.MAINNET:
345 return 'bitcoincash';
346 case Network.TESTNET4:
347 case Network.TESTNET3:
348 case Network.CHIPNET:
349 case Network.MOCKNET:
350 return 'bchtest';
351 case Network.REGTEST:
352 return 'bchreg';
353 default:
354 return 'bitcoincash';
355 }
356}
357
358const randomInt = (): bigint => BigInt(Math.floor(Math.random() * 10000));
359

Callers 3

getTxOutputsFunction · 0.85
validateOutputFunction · 0.85
scriptToAddressFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected