@@ -13,6 +13,7 @@ interface InscribeProps {
1313
1414const Inscribe : React . FC < InscribeProps > = ( { descriptor, setDescriptor } ) => {
1515 const [ encryptedData , setEncryptedData ] = useState < string > ( '' ) ;
16+ const [ isTestnet , setIsTestnet ] = useState < boolean > ( false ) ;
1617 const [ encryptWarning , setEncryptWarning ] = useState < string > ( '' ) ;
1718 const [ encryptError , setEncryptError ] = useState < string > ( '' ) ;
1819
@@ -24,8 +25,9 @@ const Inscribe: React.FC<InscribeProps> = ({ descriptor, setDescriptor }) => {
2425 throw new Error ( 'Please enter a descriptor' ) ;
2526 }
2627
27- const { encryptedText, missingXfps } = await encrypt ( descriptor ) ;
28+ const { encryptedText, missingXfps, isTestnet } = await encrypt ( descriptor ) ;
2829 setEncryptedData ( encryptedText ) ;
30+ setIsTestnet ( isTestnet ) ;
2931
3032 if ( missingXfps ) {
3133 setEncryptWarning ( `
@@ -39,6 +41,8 @@ const Inscribe: React.FC<InscribeProps> = ({ descriptor, setDescriptor }) => {
3941 }
4042 } ;
4143
44+ const inscribeUrl = isTestnet ? 'https://testnet4.btcscribe.org' : 'https://btcscribe.org' ;
45+
4246 return (
4347 < >
4448 < Input
@@ -58,8 +62,8 @@ const Inscribe: React.FC<InscribeProps> = ({ descriptor, setDescriptor }) => {
5862 < >
5963 < CopyableTextarea value = { encryptedData } />
6064 < Button variant = "outline" className = "w-full" asChild >
61- < a href = { `https://btcscribe.org ?msg=${ encodeURIComponent ( encryptedData ) } ` } target = "_blank" >
62- Inscribe on Bitcoin
65+ < a href = { `${ inscribeUrl } ?msg=${ encodeURIComponent ( encryptedData ) } ` } target = "_blank" >
66+ { isTestnet ? " Inscribe on Testnet4" : "Inscribe on Bitcoin" }
6367 </ a >
6468 </ Button >
6569 </ >
0 commit comments