1- import chalk from "chalk " ;
2- import { Account , Contract , RpcProvider , shortString } from "starknet " ;
1+ import { Account , Contract , RpcProvider } from "starknet " ;
2+ import { blue , cyan , green , red , yellow } from "./colorize-log " ;
33
44const createHyperlink = ( url : string , text ?: string ) => {
55 const displayText = text || url ;
@@ -21,18 +21,18 @@ export const logDeploymentSummary = ({
2121 } else if ( network === "mainnet" ) {
2222 baseUrl = `https://starkscan.co` ;
2323 } else {
24- console . error ( chalk . red ( `Unsupported network: ${ network } ` ) ) ;
24+ console . error ( red ( `Unsupported network: ${ network } ` ) ) ;
2525 return ;
2626 }
2727
28- console . log ( chalk . green ( "\n📦 Deployment Summary\n" ) ) ;
29- console . log ( `${ chalk . blue ( "🌐 Network:" ) } ${ chalk . white ( network ) } \n` ) ;
30- console . log ( chalk . cyan ( "🔗 Transaction:" ) ) ;
28+ console . log ( green ( "\n📦 Deployment Summary\n" ) ) ;
29+ console . log ( `${ blue ( "🌐 Network:" ) } ${ network } \n` ) ;
30+ console . log ( cyan ( "🔗 Transaction:" ) ) ;
3131 const txUrl = `${ baseUrl } /tx/${ transactionHash } ` ;
3232 console . log ( createHyperlink ( txUrl ) + "\n" ) ;
3333
3434 for ( const [ name , { address } ] of Object . entries ( deployments ) ) {
35- console . log ( chalk . yellow ( `📄 ${ name } Contract:` ) ) ;
35+ console . log ( yellow ( `📄 ${ name } Contract:` ) ) ;
3636 const contractUrl = `${ baseUrl } /contract/${ address } ` ;
3737 console . log ( createHyperlink ( contractUrl ) + "\n" ) ;
3838 }
@@ -52,14 +52,12 @@ export const postDeploymentBalanceSummary = async ({
5252 address : string ;
5353 } [ ] ;
5454} ) => {
55- console . log ( chalk . blue ( "💰 Deployer Balance Summary:" ) ) ;
55+ console . log ( blue ( "💰 Deployer Balance Summary:" ) ) ;
5656 console . log ( `Deployer-Address: ${ deployer . address } ` ) ;
5757
5858 if ( ! feeToken || feeToken . length === 0 ) {
5959 console . log (
60- chalk . red (
61- "Error: No fee token information provided. Cannot fetch balance."
62- )
60+ red ( "Error: No fee token information provided. Cannot fetch balance." )
6361 ) ;
6462 return ;
6563 }
@@ -92,7 +90,7 @@ export const postDeploymentBalanceSummary = async ({
9290 }
9391 } catch ( e ) {
9492 console . warn (
95- chalk . yellow (
93+ yellow (
9694 `Could not fetch decimals for ${ tokenInfo . name } . Assuming 18 decimals.`
9795 )
9896 ) ;
@@ -109,11 +107,11 @@ export const postDeploymentBalanceSummary = async ({
109107 ) ;
110108 } catch ( error ) {
111109 console . error (
112- chalk . red ( `Error fetching deployer balance for ${ tokenInfo . name } :` ) ,
110+ red ( `Error fetching deployer balance for ${ tokenInfo . name } :` ) ,
113111 error
114112 ) ;
115113 if ( error instanceof Error ) {
116- console . error ( chalk . red ( "Error message:" ) , error . message ) ;
114+ console . error ( red ( "Error message:" ) , error . message ) ;
117115 }
118116 }
119117} ;
0 commit comments